From d43e30875922fcb0e469a9d85752727e20de554d Mon Sep 17 00:00:00 2001 From: Joram van den Boezem Date: Thu, 1 Jun 2023 11:56:42 +0200 Subject: [PATCH] fix: attempt to fix esbuild esm/cjs quirck --- .releaserc.json | 2 +- action.yml | 2 +- packages/action/dist/index.js | 23377 ---------------- packages/action/package.json | 2 +- packages/core/src/io.ts | 14 + .../src/githubActions/githubActions.ts | 29 +- 6 files changed, 38 insertions(+), 23388 deletions(-) delete mode 100644 packages/action/dist/index.js diff --git a/.releaserc.json b/.releaserc.json index fc76638d..d19bf050 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -19,7 +19,7 @@ "package.json", "packages/*/package.json", "!packages/*/README.md", - "packages/action/dist/index.js" + "packages/action/dist/index.cjs" ], "message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}\n\n[skip ci]" } diff --git a/action.yml b/action.yml index 3f99e8b3..eb5c6f0d 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ author: Joram van den Boezem description: Reload moker plugins runs: using: node16 - main: packages/action/dist/index.js + main: packages/action/dist/index.cjs branding: icon: refresh-cw color: green diff --git a/packages/action/dist/index.js b/packages/action/dist/index.js deleted file mode 100644 index e913aed4..00000000 --- a/packages/action/dist/index.js +++ /dev/null @@ -1,23377 +0,0 @@ -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 __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { - get: (a, b) => (typeof require !== "undefined" ? require : a)[b] -}) : x)(function(x) { - if (typeof require !== "undefined") - return require.apply(this, arguments); - throw new Error('Dynamic require of "' + x + '" is not supported'); -}); -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require2() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -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); -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 __privateMethod = (obj, member, method) => { - __accessCheck(obj, member, "access private method"); - return method; -}; - -// ../../node_modules/@actions/core/lib/utils.js -var require_utils = __commonJS({ - "../../node_modules/@actions/core/lib/utils.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toCommandProperties = exports.toCommandValue = void 0; - function toCommandValue(input) { - if (input === null || input === void 0) { - return ""; - } else if (typeof input === "string" || input instanceof String) { - return input; - } - return JSON.stringify(input); - } - exports.toCommandValue = toCommandValue; - function toCommandProperties(annotationProperties) { - if (!Object.keys(annotationProperties).length) { - return {}; - } - return { - title: annotationProperties.title, - file: annotationProperties.file, - line: annotationProperties.startLine, - endLine: annotationProperties.endLine, - col: annotationProperties.startColumn, - endColumn: annotationProperties.endColumn - }; - } - exports.toCommandProperties = toCommandProperties; - } -}); - -// ../../node_modules/@actions/core/lib/command.js -var require_command = __commonJS({ - "../../node_modules/@actions/core/lib/command.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.issue = exports.issueCommand = void 0; - var os8 = __importStar(__require("os")); - var utils_1 = require_utils(); - function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os8.EOL); - } - exports.issueCommand = issueCommand; - function issue(name, message = "") { - issueCommand(name, {}, message); - } - exports.issue = issue; - var CMD_STRING = "::"; - var Command = class { - constructor(command, properties, message) { - if (!command) { - command = "missing.command"; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += " "; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } else { - cmdStr += ","; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } - } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } - }; - function escapeData(s) { - return utils_1.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); - } - function escapeProperty(s) { - return utils_1.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); - } - } -}); - -// ../../node_modules/uuid/dist/esm-node/rng.js -import crypto from "crypto"; -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - crypto.randomFillSync(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} -var rnds8Pool, poolPtr; -var init_rng = __esm({ - "../../node_modules/uuid/dist/esm-node/rng.js"() { - rnds8Pool = new Uint8Array(256); - poolPtr = rnds8Pool.length; - } -}); - -// ../../node_modules/uuid/dist/esm-node/regex.js -var regex_default; -var init_regex = __esm({ - "../../node_modules/uuid/dist/esm-node/regex.js"() { - regex_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; - } -}); - -// ../../node_modules/uuid/dist/esm-node/validate.js -function validate(uuid) { - return typeof uuid === "string" && regex_default.test(uuid); -} -var validate_default; -var init_validate = __esm({ - "../../node_modules/uuid/dist/esm-node/validate.js"() { - init_regex(); - validate_default = validate; - } -}); - -// ../../node_modules/uuid/dist/esm-node/stringify.js -function stringify(arr, offset = 0) { - 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(); - if (!validate_default(uuid)) { - throw TypeError("Stringified UUID is invalid"); - } - return uuid; -} -var byteToHex, stringify_default; -var init_stringify = __esm({ - "../../node_modules/uuid/dist/esm-node/stringify.js"() { - init_validate(); - byteToHex = []; - for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).substr(1)); - } - stringify_default = stringify; - } -}); - -// ../../node_modules/uuid/dist/esm-node/v1.js -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 !== void 0 ? options.clockseq : _clockseq; - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || rng)(); - if (node == null) { - node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - if (clockseq == null) { - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; - } - } - let msecs = options.msecs !== void 0 ? options.msecs : Date.now(); - let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; - if (dt < 0 && options.clockseq === void 0) { - clockseq = clockseq + 1 & 16383; - } - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) { - nsecs = 0; - } - if (nsecs >= 1e4) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - msecs += 122192928e5; - const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; - b[i++] = tl >>> 24 & 255; - b[i++] = tl >>> 16 & 255; - b[i++] = tl >>> 8 & 255; - b[i++] = tl & 255; - const tmh = msecs / 4294967296 * 1e4 & 268435455; - b[i++] = tmh >>> 8 & 255; - b[i++] = tmh & 255; - b[i++] = tmh >>> 24 & 15 | 16; - b[i++] = tmh >>> 16 & 255; - b[i++] = clockseq >>> 8 | 128; - b[i++] = clockseq & 255; - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - return buf || stringify_default(b); -} -var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default; -var init_v1 = __esm({ - "../../node_modules/uuid/dist/esm-node/v1.js"() { - init_rng(); - init_stringify(); - _lastMSecs = 0; - _lastNSecs = 0; - v1_default = v1; - } -}); - -// ../../node_modules/uuid/dist/esm-node/parse.js -function parse(uuid) { - if (!validate_default(uuid)) { - throw TypeError("Invalid UUID"); - } - let v; - const arr = new Uint8Array(16); - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 255; - arr[2] = v >>> 8 & 255; - arr[3] = v & 255; - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 255; - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 255; - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 255; - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255; - arr[11] = v / 4294967296 & 255; - arr[12] = v >>> 24 & 255; - arr[13] = v >>> 16 & 255; - arr[14] = v >>> 8 & 255; - arr[15] = v & 255; - return arr; -} -var parse_default; -var init_parse = __esm({ - "../../node_modules/uuid/dist/esm-node/parse.js"() { - init_validate(); - parse_default = parse; - } -}); - -// ../../node_modules/uuid/dist/esm-node/v35.js -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); - const bytes = []; - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - return bytes; -} -function v35_default(name, version2, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === "string") { - value = stringToBytes(value); - } - if (typeof namespace === "string") { - namespace = parse_default(namespace); - } - if (namespace.length !== 16) { - throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); - } - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 15 | version2; - bytes[8] = bytes[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - return buf; - } - return stringify_default(bytes); - } - try { - generateUUID.name = name; - } catch (err) { - } - generateUUID.DNS = DNS; - generateUUID.URL = URL2; - return generateUUID; -} -var DNS, URL2; -var init_v35 = __esm({ - "../../node_modules/uuid/dist/esm-node/v35.js"() { - init_stringify(); - init_parse(); - DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; - URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - } -}); - -// ../../node_modules/uuid/dist/esm-node/md5.js -import crypto2 from "crypto"; -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return crypto2.createHash("md5").update(bytes).digest(); -} -var md5_default; -var init_md5 = __esm({ - "../../node_modules/uuid/dist/esm-node/md5.js"() { - md5_default = md5; - } -}); - -// ../../node_modules/uuid/dist/esm-node/v3.js -var v3, v3_default; -var init_v3 = __esm({ - "../../node_modules/uuid/dist/esm-node/v3.js"() { - init_v35(); - init_md5(); - v3 = v35_default("v3", 48, md5_default); - v3_default = v3; - } -}); - -// ../../node_modules/uuid/dist/esm-node/v4.js -function v4(options, buf, offset) { - options = options || {}; - const rnds = options.random || (options.rng || rng)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return stringify_default(rnds); -} -var v4_default; -var init_v4 = __esm({ - "../../node_modules/uuid/dist/esm-node/v4.js"() { - init_rng(); - init_stringify(); - v4_default = v4; - } -}); - -// ../../node_modules/uuid/dist/esm-node/sha1.js -import crypto3 from "crypto"; -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return crypto3.createHash("sha1").update(bytes).digest(); -} -var sha1_default; -var init_sha1 = __esm({ - "../../node_modules/uuid/dist/esm-node/sha1.js"() { - sha1_default = sha1; - } -}); - -// ../../node_modules/uuid/dist/esm-node/v5.js -var v5, v5_default; -var init_v5 = __esm({ - "../../node_modules/uuid/dist/esm-node/v5.js"() { - init_v35(); - init_sha1(); - v5 = v35_default("v5", 80, sha1_default); - v5_default = v5; - } -}); - -// ../../node_modules/uuid/dist/esm-node/nil.js -var nil_default; -var init_nil = __esm({ - "../../node_modules/uuid/dist/esm-node/nil.js"() { - nil_default = "00000000-0000-0000-0000-000000000000"; - } -}); - -// ../../node_modules/uuid/dist/esm-node/version.js -function version(uuid) { - if (!validate_default(uuid)) { - throw TypeError("Invalid UUID"); - } - return parseInt(uuid.substr(14, 1), 16); -} -var version_default; -var init_version = __esm({ - "../../node_modules/uuid/dist/esm-node/version.js"() { - init_validate(); - version_default = version; - } -}); - -// ../../node_modules/uuid/dist/esm-node/index.js -var esm_node_exports = {}; -__export(esm_node_exports, { - NIL: () => nil_default, - parse: () => parse_default, - stringify: () => stringify_default, - v1: () => v1_default, - v3: () => v3_default, - v4: () => v4_default, - v5: () => v5_default, - validate: () => validate_default, - version: () => version_default -}); -var init_esm_node = __esm({ - "../../node_modules/uuid/dist/esm-node/index.js"() { - init_v1(); - init_v3(); - init_v4(); - init_v5(); - init_nil(); - init_version(); - init_validate(); - init_stringify(); - init_parse(); - } -}); - -// ../../node_modules/@actions/core/lib/file-command.js -var require_file_command = __commonJS({ - "../../node_modules/@actions/core/lib/file-command.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; - var fs5 = __importStar(__require("fs")); - var os8 = __importStar(__require("os")); - var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports)); - var utils_1 = require_utils(); - function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs5.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs5.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os8.EOL}`, { - encoding: "utf8" - }); - } - exports.issueFileCommand = issueFileCommand; - function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${uuid_1.v4()}`; - const convertedValue = utils_1.toCommandValue(value); - if (key.includes(delimiter)) { - throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); - } - if (convertedValue.includes(delimiter)) { - throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); - } - return `${key}<<${delimiter}${os8.EOL}${convertedValue}${os8.EOL}${delimiter}`; - } - exports.prepareKeyValueMessage = prepareKeyValueMessage; - } -}); - -// ../../node_modules/@actions/http-client/lib/proxy.js -var require_proxy = __commonJS({ - "../../node_modules/@actions/http-client/lib/proxy.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.checkBypass = exports.getProxyUrl = void 0; - function getProxyUrl(reqUrl) { - const usingSsl = reqUrl.protocol === "https:"; - if (checkBypass(reqUrl)) { - return void 0; - } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; - } - })(); - if (proxyVar) { - return new URL(proxyVar); - } else { - return void 0; - } - } - exports.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; - } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; - } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { - if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { - return true; - } - } - return false; - } - exports.checkBypass = checkBypass; - function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); - } - } -}); - -// ../../node_modules/tunnel/lib/tunnel.js -var require_tunnel = __commonJS({ - "../../node_modules/tunnel/lib/tunnel.js"(exports) { - "use strict"; - var net = __require("net"); - var tls = __require("tls"); - var http = __require("http"); - var https = __require("https"); - var events = __require("events"); - var assert = __require("assert"); - var util = __require("util"); - exports.httpOverHttp = httpOverHttp; - exports.httpsOverHttp = httpsOverHttp; - exports.httpOverHttps = httpOverHttps; - exports.httpsOverHttps = httpsOverHttps; - function httpOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - return agent; - } - function httpsOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; - } - function httpOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - return agent; - } - function httpsOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; - } - 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 = []; - self.on("free", function onFree(socket, host, port, localAddress) { - var options2 = toOptions(host, port, localAddress); - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i]; - if (pending.host === options2.host && pending.port === options2.port) { - self.requests.splice(i, 1); - pending.request.onSocket(socket); - return; - } - } - socket.destroy(); - self.removeSocket(socket); - }); - } - util.inherits(TunnelingAgent, events.EventEmitter); - TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { - var self = this; - var options = mergeOptions({ request: req }, self.options, toOptions(host, port, localAddress)); - if (self.sockets.length >= this.maxSockets) { - self.requests.push(options); - return; - } - self.createSocket(options, function(socket) { - socket.on("free", onFree); - socket.on("close", onCloseOrRemove); - socket.on("agentRemove", onCloseOrRemove); - req.onSocket(socket); - function onFree() { - self.emit("free", socket, options); - } - function onCloseOrRemove(err) { - self.removeSocket(socket); - socket.removeListener("free", onFree); - socket.removeListener("close", onCloseOrRemove); - socket.removeListener("agentRemove", onCloseOrRemove); - } - }); - }; - TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this; - var placeholder = {}; - self.sockets.push(placeholder); - 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; - } - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {}; - connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); - } - debug2("making CONNECT request"); - var connectReq = self.request(connectOptions); - connectReq.useChunkedEncodingByDefault = false; - connectReq.once("response", onResponse); - connectReq.once("upgrade", onUpgrade); - connectReq.once("connect", onConnect); - connectReq.once("error", onError); - connectReq.end(); - function onResponse(res) { - res.upgrade = true; - } - function onUpgrade(res, socket, head) { - process.nextTick(function() { - onConnect(res, socket, head); - }); - } - function onConnect(res, socket, head) { - connectReq.removeAllListeners(); - socket.removeAllListeners(); - if (res.statusCode !== 200) { - debug2( - "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) { - debug2("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; - } - debug2("tunneling connection has established"); - self.sockets[self.sockets.indexOf(placeholder)] = socket; - return cb(socket); - } - function onError(cause) { - connectReq.removeAllListeners(); - debug2( - "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); - } - }; - TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket); - if (pos === -1) { - return; - } - this.sockets.splice(pos, 1); - var pending = this.requests.shift(); - if (pending) { - this.createSocket(pending, function(socket2) { - pending.request.onSocket(socket2); - }); - } - }; - 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, - servername: hostHeader ? hostHeader.replace(/:.*$/, "") : options.host - }); - var secureSocket = tls.connect(0, tlsOptions); - self.sockets[self.sockets.indexOf(socket)] = secureSocket; - cb(secureSocket); - }); - } - function toOptions(host, port, localAddress) { - if (typeof host === "string") { - return { - host, - port, - localAddress - }; - } - return host; - } - 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] !== void 0) { - target[k] = overrides[k]; - } - } - } - } - return target; - } - var debug2; - if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug2 = function() { - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === "string") { - args[0] = "TUNNEL: " + args[0]; - } else { - args.unshift("TUNNEL:"); - } - console.error.apply(console, args); - }; - } else { - debug2 = function() { - }; - } - exports.debug = debug2; - } -}); - -// ../../node_modules/tunnel/index.js -var require_tunnel2 = __commonJS({ - "../../node_modules/tunnel/index.js"(exports, module) { - module.exports = require_tunnel(); - } -}); - -// ../../node_modules/@actions/http-client/lib/index.js -var require_lib = __commonJS({ - "../../node_modules/@actions/http-client/lib/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve3) { - resolve3(value); - }); - } - return new (P || (P = Promise))(function(resolve3, 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 ? resolve3(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; - var http = __importStar(__require("http")); - var https = __importStar(__require("https")); - var pm = __importStar(require_proxy()); - var tunnel = __importStar(require_tunnel2()); - var HttpCodes; - (function(HttpCodes2) { - HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; - HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; - HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; - HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; - HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; - HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; - HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; - HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; - HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; - HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; - HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; - })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); - var Headers; - (function(Headers2) { - Headers2["Accept"] = "accept"; - Headers2["ContentType"] = "content-type"; - })(Headers = exports.Headers || (exports.Headers = {})); - var MediaTypes; - (function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; - })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); - function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ""; - } - exports.getProxyUrl = getProxyUrl; - var HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect - ]; - var HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout - ]; - var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; - var ExponentialBackoffCeiling = 10; - var ExponentialBackoffTimeSlice = 5; - var HttpClientError = class extends Error { - constructor(message, statusCode) { - super(message); - this.name = "HttpClientError"; - this.statusCode = statusCode; - Object.setPrototypeOf(this, HttpClientError.prototype); - } - }; - exports.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve3) => __awaiter(this, void 0, void 0, function* () { - let output = Buffer.alloc(0); - this.message.on("data", (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on("end", () => { - resolve3(output.toString()); - }); - })); - }); - } - }; - exports.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports.isHttps = isHttps; - var HttpClient = class { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info2 = this._prepareRequest(verb, parsedUrl, headers); - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; - let numTries = 0; - let response; - do { - response = yield this.requestRaw(info2, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info2, data); - } else { - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { - const redirectUrl = response.message.headers["location"]; - if (!redirectUrl) { - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { - throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } - } - info2 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info2, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info2, data) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve3, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve3(res); - } - } - this.requestRawWithCallback(info2, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info2, data, onResult) { - if (typeof data === "string") { - if (!info2.options.headers) { - info2.options.headers = {}; - } - info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info2.httpModule.request(info2.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(void 0, res); - }); - let socket; - req.on("socket", (sock) => { - socket = sock; - }); - req.setTimeout(this._socketTimeout || 3 * 6e4, () => { - if (socket) { - socket.end(); - } - handleResult(new Error(`Request timeout: ${info2.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); - } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info2 = {}; - info2.parsedUrl = requestUrl; - const usingSsl = info2.parsedUrl.protocol === "https:"; - info2.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info2.options = {}; - info2.options.host = info2.parsedUrl.hostname; - info2.options.port = info2.parsedUrl.port ? parseInt(info2.parsedUrl.port) : defaultPort; - info2.options.path = (info2.parsedUrl.pathname || "") + (info2.parsedUrl.search || ""); - info2.options.method = method; - info2.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info2.options.headers["user-agent"] = this.userAgent; - } - info2.options.agent = this._getAgent(info2.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info2.options); - } - } - return info2; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; - } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - if (agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (proxyUrl && proxyUrl.hostname) { - const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), { host: proxyUrl.hostname, port: proxyUrl.port }) - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === "https:"; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve3) => setTimeout(() => resolve3(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve3, reject) => __awaiter(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve3(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - let obj; - let contents; - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { - } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; - } else { - msg = `Failed request: (${statusCode})`; - } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve3(response); - } - })); - }); - } - }; - exports.HttpClient = HttpClient; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// ../../node_modules/@actions/http-client/lib/auth.js -var require_auth = __commonJS({ - "../../node_modules/@actions/http-client/lib/auth.js"(exports) { - "use strict"; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve3) { - resolve3(value); - }); - } - return new (P || (P = Promise))(function(resolve3, 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 ? resolve3(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; - } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// ../../node_modules/@actions/core/lib/oidc-utils.js -var require_oidc_utils = __commonJS({ - "../../node_modules/@actions/core/lib/oidc-utils.js"(exports) { - "use strict"; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve3) { - resolve3(value); - }); - } - return new (P || (P = Promise))(function(resolve3, 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 ? resolve3(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OidcClient = void 0; - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var core_1 = require_core(); - var OidcClient = class { - static createHttpClient(allowRetry = true, maxRetry = 10) { - const requestOptions = { - allowRetries: allowRetry, - maxRetries: maxRetry - }; - return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); - } - static getRequestToken() { - const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; - if (!token) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); - } - return token; - } - static getIDTokenUrl() { - const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; - if (!runtimeUrl) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); - } - return runtimeUrl; - } - static getCall(id_token_url) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - const httpclient = OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error) => { - throw new Error(`Failed to get ID Token. - - Error Code : ${error.statusCode} - - Error Message: ${error.result.message}`); - }); - const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; - if (!id_token) { - throw new Error("Response json body do not have ID Token field"); - } - return id_token; - }); - } - static getIDToken(audience) { - return __awaiter(this, void 0, void 0, function* () { - try { - let id_token_url = OidcClient.getIDTokenUrl(); - if (audience) { - const encodedAudience = encodeURIComponent(audience); - id_token_url = `${id_token_url}&audience=${encodedAudience}`; - } - core_1.debug(`ID token url is ${id_token_url}`); - const id_token = yield OidcClient.getCall(id_token_url); - core_1.setSecret(id_token); - return id_token; - } catch (error) { - throw new Error(`Error message: ${error.message}`); - } - }); - } - }; - exports.OidcClient = OidcClient; - } -}); - -// ../../node_modules/@actions/core/lib/summary.js -var require_summary = __commonJS({ - "../../node_modules/@actions/core/lib/summary.js"(exports) { - "use strict"; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve3) { - resolve3(value); - }); - } - return new (P || (P = Promise))(function(resolve3, 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 ? resolve3(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; - var os_1 = __require("os"); - var fs_1 = __require("fs"); - var { access, appendFile, writeFile: writeFile2 } = fs_1.promises; - exports.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; - exports.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; - var Summary = class { - constructor() { - this._buffer = ""; - } - /** - * Finds the summary file path from the environment, rejects if env var is not found or file does not exist - * Also checks r/w permissions. - * - * @returns step summary file path - */ - filePath() { - return __awaiter(this, void 0, void 0, function* () { - if (this._filePath) { - return this._filePath; - } - const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; - if (!pathFromEnv) { - throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); - } - try { - yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } catch (_a) { - throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); - } - this._filePath = pathFromEnv; - return this._filePath; - }); - } - /** - * Wraps content in an HTML tag, adding any HTML attributes - * - * @param {string} tag HTML tag to wrap - * @param {string | null} content content within the tag - * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add - * - * @returns {string} content wrapped in HTML element - */ - wrap(tag, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); - if (!content) { - return `<${tag}${htmlAttrs}>`; - } - return `<${tag}${htmlAttrs}>${content}`; - } - /** - * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. - * - * @param {SummaryWriteOptions} [options] (optional) options for write operation - * - * @returns {Promise} summary instance - */ - write(options) { - return __awaiter(this, void 0, void 0, function* () { - const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); - const filePath = yield this.filePath(); - const writeFunc = overwrite ? writeFile2 : appendFile; - yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); - return this.emptyBuffer(); - }); - } - /** - * Clears the summary buffer and wipes the summary file - * - * @returns {Summary} summary instance - */ - clear() { - return __awaiter(this, void 0, void 0, function* () { - return this.emptyBuffer().write({ overwrite: true }); - }); - } - /** - * Returns the current summary buffer as a string - * - * @returns {string} string of summary buffer - */ - stringify() { - return this._buffer; - } - /** - * If the summary buffer is empty - * - * @returns {boolen} true if the buffer is empty - */ - isEmptyBuffer() { - return this._buffer.length === 0; - } - /** - * Resets the summary buffer without writing to summary file - * - * @returns {Summary} summary instance - */ - emptyBuffer() { - this._buffer = ""; - return this; - } - /** - * Adds raw text to the summary buffer - * - * @param {string} text content to add - * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) - * - * @returns {Summary} summary instance - */ - addRaw(text, addEOL = false) { - this._buffer += text; - return addEOL ? this.addEOL() : this; - } - /** - * Adds the operating system-specific end-of-line marker to the buffer - * - * @returns {Summary} summary instance - */ - addEOL() { - return this.addRaw(os_1.EOL); - } - /** - * Adds an HTML codeblock to the summary buffer - * - * @param {string} code content to render within fenced code block - * @param {string} lang (optional) language to syntax highlight code - * - * @returns {Summary} summary instance - */ - addCodeBlock(code, lang) { - const attrs = Object.assign({}, lang && { lang }); - const element = this.wrap("pre", this.wrap("code", code), attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML list to the summary buffer - * - * @param {string[]} items list of items to render - * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) - * - * @returns {Summary} summary instance - */ - addList(items, ordered = false) { - const tag = ordered ? "ol" : "ul"; - const listItems = items.map((item) => this.wrap("li", item)).join(""); - const element = this.wrap(tag, listItems); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML table to the summary buffer - * - * @param {SummaryTableCell[]} rows table rows - * - * @returns {Summary} summary instance - */ - addTable(rows) { - const tableBody = rows.map((row) => { - const cells = row.map((cell) => { - if (typeof cell === "string") { - return this.wrap("td", cell); - } - const { header, data, colspan, rowspan } = cell; - const tag = header ? "th" : "td"; - const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); - return this.wrap(tag, data, attrs); - }).join(""); - return this.wrap("tr", cells); - }).join(""); - const element = this.wrap("table", tableBody); - return this.addRaw(element).addEOL(); - } - /** - * Adds a collapsable HTML details element to the summary buffer - * - * @param {string} label text for the closed state - * @param {string} content collapsable content - * - * @returns {Summary} summary instance - */ - addDetails(label, content) { - const element = this.wrap("details", this.wrap("summary", label) + content); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML image tag to the summary buffer - * - * @param {string} src path to the image you to embed - * @param {string} alt text description of the image - * @param {SummaryImageOptions} options (optional) addition image attributes - * - * @returns {Summary} summary instance - */ - addImage(src, alt, options) { - const { width, height } = options || {}; - const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); - const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML section heading element - * - * @param {string} text heading text - * @param {number | string} [level=1] (optional) the heading level, default: 1 - * - * @returns {Summary} summary instance - */ - addHeading(text, level) { - const tag = `h${level}`; - const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; - const element = this.wrap(allowedTag, text); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML thematic break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addSeparator() { - const element = this.wrap("hr", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML line break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addBreak() { - const element = this.wrap("br", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML blockquote to the summary buffer - * - * @param {string} text quote text - * @param {string} cite (optional) citation url - * - * @returns {Summary} summary instance - */ - addQuote(text, cite) { - const attrs = Object.assign({}, cite && { cite }); - const element = this.wrap("blockquote", text, attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML anchor tag to the summary buffer - * - * @param {string} text link text/content - * @param {string} href hyperlink - * - * @returns {Summary} summary instance - */ - addLink(text, href) { - const element = this.wrap("a", text, { href }); - return this.addRaw(element).addEOL(); - } - }; - var _summary = new Summary(); - exports.markdownSummary = _summary; - exports.summary = _summary; - } -}); - -// ../../node_modules/@actions/core/lib/path-utils.js -var require_path_utils = __commonJS({ - "../../node_modules/@actions/core/lib/path-utils.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; - var path5 = __importStar(__require("path")); - function toPosixPath(pth) { - return pth.replace(/[\\]/g, "/"); - } - exports.toPosixPath = toPosixPath; - function toWin32Path(pth) { - return pth.replace(/[/]/g, "\\"); - } - exports.toWin32Path = toWin32Path; - function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path5.sep); - } - exports.toPlatformPath = toPlatformPath; - } -}); - -// ../../node_modules/@actions/core/lib/core.js -var require_core = __commonJS({ - "../../node_modules/@actions/core/lib/core.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve3) { - resolve3(value); - }); - } - return new (P || (P = Promise))(function(resolve3, 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 ? resolve3(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - 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; - var command_1 = require_command(); - var file_command_1 = require_file_command(); - var utils_1 = require_utils(); - var os8 = __importStar(__require("os")); - var path5 = __importStar(__require("path")); - var oidc_utils_1 = require_oidc_utils(); - var ExitCode; - (function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; - })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); - function exportVariable(name, val) { - const convertedVal = utils_1.toCommandValue(val); - process.env[name] = convertedVal; - const filePath = process.env["GITHUB_ENV"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("ENV", file_command_1.prepareKeyValueMessage(name, val)); - } - command_1.issueCommand("set-env", { name }, convertedVal); - } - exports.exportVariable = exportVariable; - function setSecret(secret) { - command_1.issueCommand("add-mask", {}, secret); - } - exports.setSecret = setSecret; - function addPath(inputPath) { - const filePath = process.env["GITHUB_PATH"] || ""; - if (filePath) { - file_command_1.issueFileCommand("PATH", inputPath); - } else { - command_1.issueCommand("add-path", {}, inputPath); - } - process.env["PATH"] = `${inputPath}${path5.delimiter}${process.env["PATH"]}`; - } - exports.addPath = addPath; - function getInput(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); - } - if (options && options.trimWhitespace === false) { - return val; - } - return val.trim(); - } - exports.getInput = getInput; - function getMultilineInput(name, options) { - const inputs = getInput(name, options).split("\n").filter((x) => x !== ""); - if (options && options.trimWhitespace === false) { - return inputs; - } - return inputs.map((input) => input.trim()); - } - exports.getMultilineInput = getMultilineInput; - function getBooleanInput(name, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val = getInput(name, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) - return false; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); - } - exports.getBooleanInput = getBooleanInput; - function setOutput2(name, value) { - const filePath = process.env["GITHUB_OUTPUT"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value)); - } - process.stdout.write(os8.EOL); - command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value)); - } - exports.setOutput = setOutput2; - function setCommandEcho(enabled) { - command_1.issue("echo", enabled ? "on" : "off"); - } - exports.setCommandEcho = setCommandEcho; - function setFailed2(message) { - process.exitCode = ExitCode.Failure; - error(message); - } - exports.setFailed = setFailed2; - function isDebug() { - return process.env["RUNNER_DEBUG"] === "1"; - } - exports.isDebug = isDebug; - function debug2(message) { - command_1.issueCommand("debug", {}, message); - } - exports.debug = debug2; - function error(message, properties = {}) { - command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); - } - exports.error = error; - function warning2(message, properties = {}) { - command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); - } - exports.warning = warning2; - function notice(message, properties = {}) { - command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); - } - exports.notice = notice; - function info2(message) { - process.stdout.write(message + os8.EOL); - } - exports.info = info2; - function startGroup(name) { - command_1.issue("group", name); - } - exports.startGroup = startGroup; - function endGroup() { - command_1.issue("endgroup"); - } - exports.endGroup = endGroup; - function group(name, fn) { - return __awaiter(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } finally { - endGroup(); - } - return result; - }); - } - exports.group = group; - function saveState(name, value) { - const filePath = process.env["GITHUB_STATE"] || ""; - if (filePath) { - return file_command_1.issueFileCommand("STATE", file_command_1.prepareKeyValueMessage(name, value)); - } - command_1.issueCommand("save-state", { name }, utils_1.toCommandValue(value)); - } - exports.saveState = saveState; - function getState(name) { - return process.env[`STATE_${name}`] || ""; - } - exports.getState = getState; - function getIDToken(aud) { - return __awaiter(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); - } - exports.getIDToken = getIDToken; - var summary_1 = require_summary(); - Object.defineProperty(exports, "summary", { enumerable: true, get: function() { - return summary_1.summary; - } }); - var summary_2 = require_summary(); - Object.defineProperty(exports, "markdownSummary", { enumerable: true, get: function() { - return summary_2.markdownSummary; - } }); - var path_utils_1 = require_path_utils(); - 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; - } }); - } -}); - -// ../../node_modules/chalk/source/vendor/ansi-styles/index.js -function assembleStyles() { - const codes = /* @__PURE__ */ new Map(); - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\x1B[${style[0]}m`, - close: `\x1B[${style[1]}m` - }; - group[styleName] = styles[styleName]; - codes.set(style[0], style[1]); - } - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - Object.defineProperty(styles, "codes", { - value: codes, - enumerable: false - }); - styles.color.close = "\x1B[39m"; - styles.bgColor.close = "\x1B[49m"; - styles.color.ansi = wrapAnsi16(); - styles.color.ansi256 = wrapAnsi256(); - styles.color.ansi16m = wrapAnsi16m(); - styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); - styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); - styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); - Object.defineProperties(styles, { - rgbToAnsi256: { - value(red, green, blue) { - if (red === green && green === blue) { - if (red < 8) { - return 16; - } - if (red > 248) { - return 231; - } - return Math.round((red - 8) / 247 * 24) + 232; - } - return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); - }, - enumerable: false - }, - hexToRgb: { - value(hex) { - const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); - if (!matches) { - return [0, 0, 0]; - } - let [colorString] = matches; - if (colorString.length === 3) { - colorString = [...colorString].map((character) => character + character).join(""); - } - const integer = Number.parseInt(colorString, 16); - return [ - /* eslint-disable no-bitwise */ - integer >> 16 & 255, - integer >> 8 & 255, - integer & 255 - /* eslint-enable no-bitwise */ - ]; - }, - enumerable: false - }, - hexToAnsi256: { - value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), - enumerable: false - }, - ansi256ToAnsi: { - value(code) { - if (code < 8) { - return 30 + code; - } - if (code < 16) { - return 90 + (code - 8); - } - let red; - let green; - let blue; - if (code >= 232) { - red = ((code - 232) * 10 + 8) / 255; - green = red; - blue = red; - } else { - code -= 16; - const remainder = code % 36; - red = Math.floor(code / 36) / 5; - green = Math.floor(remainder / 6) / 5; - blue = remainder % 6 / 5; - } - const value = Math.max(red, green, blue) * 2; - if (value === 0) { - return 30; - } - let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); - if (value === 2) { - result += 60; - } - return result; - }, - enumerable: false - }, - rgbToAnsi: { - value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), - enumerable: false - }, - hexToAnsi: { - value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), - enumerable: false - } - }); - return styles; -} -var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default; -var init_ansi_styles = __esm({ - "../../node_modules/chalk/source/vendor/ansi-styles/index.js"() { - ANSI_BACKGROUND_OFFSET = 10; - wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; - wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; - wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; - styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - overline: [53, 55], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - // Bright color - blackBright: [90, 39], - gray: [90, 39], - // Alias of `blackBright` - grey: [90, 39], - // Alias of `blackBright` - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - // Bright color - bgBlackBright: [100, 49], - bgGray: [100, 49], - // Alias of `bgBlackBright` - bgGrey: [100, 49], - // Alias of `bgBlackBright` - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - modifierNames = Object.keys(styles.modifier); - foregroundColorNames = Object.keys(styles.color); - backgroundColorNames = Object.keys(styles.bgColor); - colorNames = [...foregroundColorNames, ...backgroundColorNames]; - ansiStyles = assembleStyles(); - ansi_styles_default = ansiStyles; - } -}); - -// ../../node_modules/chalk/source/vendor/supports-color/index.js -import process2 from "process"; -import os from "os"; -import tty from "tty"; -function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -} -function envForceColor() { - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - return 1; - } - if (env.FORCE_COLOR === "false") { - return 0; - } - return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); - } -} -function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} -function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { - const noFlagForceColor = envForceColor(); - if (noFlagForceColor !== void 0) { - flagForceColor = noFlagForceColor; - } - const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; - if (forceColor === 0) { - return 0; - } - if (sniffFlags) { - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - } - if ("TF_BUILD" in env && "AGENT_NAME" in env) { - return 1; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process2.platform === "win32") { - const osRelease = os.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if ("GITHUB_ACTIONS" in env) { - return 3; - } - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].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 (env.TERM === "xterm-kitty") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": { - return version2 >= 3 ? 3 : 2; - } - case "Apple_Terminal": { - return 2; - } - } - } - 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; - } - return min; -} -function createSupportsColor(stream, options = {}) { - const level = _supportsColor(stream, { - streamIsTTY: stream && stream.isTTY, - ...options - }); - return translateLevel(level); -} -var env, flagForceColor, supportsColor, supports_color_default; -var init_supports_color = __esm({ - "../../node_modules/chalk/source/vendor/supports-color/index.js"() { - ({ env } = process2); - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - flagForceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - flagForceColor = 1; - } - supportsColor = { - stdout: createSupportsColor({ isTTY: tty.isatty(1) }), - stderr: createSupportsColor({ isTTY: tty.isatty(2) }) - }; - supports_color_default = supportsColor; - } -}); - -// ../../node_modules/chalk/source/utilities.js -function stringReplaceAll(string, substring, replacer) { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ""; - do { - returnValue += string.slice(endIndex, index) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - returnValue += string.slice(endIndex); - return returnValue; -} -function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { - let endIndex = 0; - let returnValue = ""; - do { - const gotCR = string[index - 1] === "\r"; - returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; - endIndex = index + 1; - index = string.indexOf("\n", endIndex); - } while (index !== -1); - returnValue += string.slice(endIndex); - return returnValue; -} -var init_utilities = __esm({ - "../../node_modules/chalk/source/utilities.js"() { - } -}); - -// ../../node_modules/chalk/source/index.js -function createChalk(options) { - return chalkFactory(options); -} -var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default; -var init_source = __esm({ - "../../node_modules/chalk/source/index.js"() { - init_ansi_styles(); - init_supports_color(); - init_utilities(); - init_ansi_styles(); - ({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default); - GENERATOR = Symbol("GENERATOR"); - STYLER = Symbol("STYLER"); - IS_EMPTY = Symbol("IS_EMPTY"); - levelMapping = [ - "ansi", - "ansi", - "ansi256", - "ansi16m" - ]; - styles2 = /* @__PURE__ */ Object.create(null); - applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error("The `level` option should be an integer from 0 to 3"); - } - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === void 0 ? colorLevel : options.level; - }; - chalkFactory = (options) => { - const chalk4 = (...strings) => strings.join(" "); - applyOptions(chalk4, options); - Object.setPrototypeOf(chalk4, createChalk.prototype); - return chalk4; - }; - Object.setPrototypeOf(createChalk.prototype, Function.prototype); - for (const [styleName, style] of Object.entries(ansi_styles_default)) { - styles2[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); - Object.defineProperty(this, styleName, { value: builder }); - return builder; - } - }; - } - styles2.visible = { - get() { - const builder = createBuilder(this, this[STYLER], true); - Object.defineProperty(this, "visible", { value: builder }); - return builder; - } - }; - getModelAnsi = (model, level, type, ...arguments_) => { - if (model === "rgb") { - if (level === "ansi16m") { - return ansi_styles_default[type].ansi16m(...arguments_); - } - if (level === "ansi256") { - return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); - } - return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); - } - if (model === "hex") { - return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_)); - } - return ansi_styles_default[type][model](...arguments_); - }; - usedModels = ["rgb", "hex", "ansi256"]; - for (const model of usedModels) { - styles2[model] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); - return createBuilder(this, styler, this[IS_EMPTY]); - }; - } - }; - const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles2[bgModel] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); - return createBuilder(this, styler, this[IS_EMPTY]); - }; - } - }; - } - proto = Object.defineProperties(() => { - }, { - ...styles2, - level: { - enumerable: true, - get() { - return this[GENERATOR].level; - }, - set(level) { - this[GENERATOR].level = level; - } - } - }); - createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === void 0) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } - return { - open, - close, - openAll, - closeAll, - parent - }; - }; - createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); - Object.setPrototypeOf(builder, proto); - builder[GENERATOR] = self; - builder[STYLER] = _styler; - builder[IS_EMPTY] = _isEmpty; - return builder; - }; - applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self[IS_EMPTY] ? "" : string; - } - let styler = self[STYLER]; - if (styler === void 0) { - return string; - } - const { openAll, closeAll } = styler; - if (string.includes("\x1B")) { - while (styler !== void 0) { - string = stringReplaceAll(string, styler.close, styler.open); - styler = styler.parent; - } - } - const lfIndex = string.indexOf("\n"); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } - return openAll + string + closeAll; - }; - Object.defineProperties(createChalk.prototype, styles2); - chalk = createChalk(); - chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); - source_default = chalk; - } -}); - -// ../../node_modules/ora/node_modules/chalk/source/vendor/ansi-styles/index.js -function assembleStyles2() { - const codes = /* @__PURE__ */ new Map(); - for (const [groupName, group] of Object.entries(styles3)) { - for (const [styleName, style] of Object.entries(group)) { - styles3[styleName] = { - open: `\x1B[${style[0]}m`, - close: `\x1B[${style[1]}m` - }; - group[styleName] = styles3[styleName]; - codes.set(style[0], style[1]); - } - Object.defineProperty(styles3, groupName, { - value: group, - enumerable: false - }); - } - Object.defineProperty(styles3, "codes", { - value: codes, - enumerable: false - }); - styles3.color.close = "\x1B[39m"; - styles3.bgColor.close = "\x1B[49m"; - styles3.color.ansi = wrapAnsi162(); - styles3.color.ansi256 = wrapAnsi2562(); - styles3.color.ansi16m = wrapAnsi16m2(); - styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2); - styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2); - styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2); - Object.defineProperties(styles3, { - rgbToAnsi256: { - value(red, green, blue) { - if (red === green && green === blue) { - if (red < 8) { - return 16; - } - if (red > 248) { - return 231; - } - return Math.round((red - 8) / 247 * 24) + 232; - } - return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); - }, - enumerable: false - }, - hexToRgb: { - value(hex) { - const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); - if (!matches) { - return [0, 0, 0]; - } - let [colorString] = matches; - if (colorString.length === 3) { - colorString = [...colorString].map((character) => character + character).join(""); - } - const integer = Number.parseInt(colorString, 16); - return [ - /* eslint-disable no-bitwise */ - integer >> 16 & 255, - integer >> 8 & 255, - integer & 255 - /* eslint-enable no-bitwise */ - ]; - }, - enumerable: false - }, - hexToAnsi256: { - value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)), - enumerable: false - }, - ansi256ToAnsi: { - value(code) { - if (code < 8) { - return 30 + code; - } - if (code < 16) { - return 90 + (code - 8); - } - let red; - let green; - let blue; - if (code >= 232) { - red = ((code - 232) * 10 + 8) / 255; - green = red; - blue = red; - } else { - code -= 16; - const remainder = code % 36; - red = Math.floor(code / 36) / 5; - green = Math.floor(remainder / 6) / 5; - blue = remainder % 6 / 5; - } - const value = Math.max(red, green, blue) * 2; - if (value === 0) { - return 30; - } - let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); - if (value === 2) { - result += 60; - } - return result; - }, - enumerable: false - }, - rgbToAnsi: { - value: (red, green, blue) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red, green, blue)), - enumerable: false - }, - hexToAnsi: { - value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)), - enumerable: false - } - }); - return styles3; -} -var ANSI_BACKGROUND_OFFSET2, wrapAnsi162, wrapAnsi2562, wrapAnsi16m2, styles3, modifierNames2, foregroundColorNames2, backgroundColorNames2, colorNames2, ansiStyles2, ansi_styles_default2; -var init_ansi_styles2 = __esm({ - "../../node_modules/ora/node_modules/chalk/source/vendor/ansi-styles/index.js"() { - ANSI_BACKGROUND_OFFSET2 = 10; - wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`; - wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; - wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; - styles3 = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - overline: [53, 55], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - // Bright color - blackBright: [90, 39], - gray: [90, 39], - // Alias of `blackBright` - grey: [90, 39], - // Alias of `blackBright` - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - // Bright color - bgBlackBright: [100, 49], - bgGray: [100, 49], - // Alias of `bgBlackBright` - bgGrey: [100, 49], - // Alias of `bgBlackBright` - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - modifierNames2 = Object.keys(styles3.modifier); - foregroundColorNames2 = Object.keys(styles3.color); - backgroundColorNames2 = Object.keys(styles3.bgColor); - colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2]; - ansiStyles2 = assembleStyles2(); - ansi_styles_default2 = ansiStyles2; - } -}); - -// ../../node_modules/ora/node_modules/chalk/source/vendor/supports-color/index.js -import process3 from "process"; -import os2 from "os"; -import tty2 from "tty"; -function hasFlag2(flag, argv = process3.argv) { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -} -function envForceColor2() { - if ("FORCE_COLOR" in env2) { - if (env2.FORCE_COLOR === "true") { - return 1; - } - if (env2.FORCE_COLOR === "false") { - return 0; - } - return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3); - } -} -function translateLevel2(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} -function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) { - const noFlagForceColor = envForceColor2(); - if (noFlagForceColor !== void 0) { - flagForceColor2 = noFlagForceColor; - } - const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor; - if (forceColor === 0) { - return 0; - } - if (sniffFlags) { - if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) { - return 3; - } - if (hasFlag2("color=256")) { - return 2; - } - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env2.TERM === "dumb") { - return min; - } - if (process3.platform === "win32") { - const osRelease = os2.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env2) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env2) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0; - } - if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) { - return 1; - } - if (env2.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env2) { - const version2 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env2.TERM_PROGRAM) { - case "iTerm.app": - return version2 >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env2.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) { - return 1; - } - if ("COLORTERM" in env2) { - return 1; - } - return min; -} -function createSupportsColor2(stream, options = {}) { - const level = _supportsColor2(stream, { - streamIsTTY: stream && stream.isTTY, - ...options - }); - return translateLevel2(level); -} -var env2, flagForceColor2, supportsColor2, supports_color_default2; -var init_supports_color2 = __esm({ - "../../node_modules/ora/node_modules/chalk/source/vendor/supports-color/index.js"() { - ({ env: env2 } = process3); - if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) { - flagForceColor2 = 0; - } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) { - flagForceColor2 = 1; - } - supportsColor2 = { - stdout: createSupportsColor2({ isTTY: tty2.isatty(1) }), - stderr: createSupportsColor2({ isTTY: tty2.isatty(2) }) - }; - supports_color_default2 = supportsColor2; - } -}); - -// ../../node_modules/ora/node_modules/chalk/source/utilities.js -function stringReplaceAll2(string, substring, replacer) { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ""; - do { - returnValue += string.slice(endIndex, index) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - returnValue += string.slice(endIndex); - return returnValue; -} -function stringEncaseCRLFWithFirstIndex2(string, prefix, postfix, index) { - let endIndex = 0; - let returnValue = ""; - do { - const gotCR = string[index - 1] === "\r"; - returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; - endIndex = index + 1; - index = string.indexOf("\n", endIndex); - } while (index !== -1); - returnValue += string.slice(endIndex); - return returnValue; -} -var init_utilities2 = __esm({ - "../../node_modules/ora/node_modules/chalk/source/utilities.js"() { - } -}); - -// ../../node_modules/ora/node_modules/chalk/source/index.js -function createChalk2(options) { - return chalkFactory2(options); -} -var stdoutColor2, stderrColor2, GENERATOR2, STYLER2, IS_EMPTY2, levelMapping2, styles4, applyOptions2, chalkFactory2, getModelAnsi2, usedModels2, proto2, createStyler2, createBuilder2, applyStyle2, chalk2, chalkStderr2, source_default2; -var init_source2 = __esm({ - "../../node_modules/ora/node_modules/chalk/source/index.js"() { - init_ansi_styles2(); - init_supports_color2(); - init_utilities2(); - init_ansi_styles2(); - ({ stdout: stdoutColor2, stderr: stderrColor2 } = supports_color_default2); - GENERATOR2 = Symbol("GENERATOR"); - STYLER2 = Symbol("STYLER"); - IS_EMPTY2 = Symbol("IS_EMPTY"); - levelMapping2 = [ - "ansi", - "ansi", - "ansi256", - "ansi16m" - ]; - styles4 = /* @__PURE__ */ Object.create(null); - applyOptions2 = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error("The `level` option should be an integer from 0 to 3"); - } - const colorLevel = stdoutColor2 ? stdoutColor2.level : 0; - object.level = options.level === void 0 ? colorLevel : options.level; - }; - chalkFactory2 = (options) => { - const chalk4 = (...strings) => strings.join(" "); - applyOptions2(chalk4, options); - Object.setPrototypeOf(chalk4, createChalk2.prototype); - return chalk4; - }; - Object.setPrototypeOf(createChalk2.prototype, Function.prototype); - for (const [styleName, style] of Object.entries(ansi_styles_default2)) { - styles4[styleName] = { - get() { - const builder = createBuilder2(this, createStyler2(style.open, style.close, this[STYLER2]), this[IS_EMPTY2]); - Object.defineProperty(this, styleName, { value: builder }); - return builder; - } - }; - } - styles4.visible = { - get() { - const builder = createBuilder2(this, this[STYLER2], true); - Object.defineProperty(this, "visible", { value: builder }); - return builder; - } - }; - getModelAnsi2 = (model, level, type, ...arguments_) => { - if (model === "rgb") { - if (level === "ansi16m") { - return ansi_styles_default2[type].ansi16m(...arguments_); - } - if (level === "ansi256") { - return ansi_styles_default2[type].ansi256(ansi_styles_default2.rgbToAnsi256(...arguments_)); - } - return ansi_styles_default2[type].ansi(ansi_styles_default2.rgbToAnsi(...arguments_)); - } - if (model === "hex") { - return getModelAnsi2("rgb", level, type, ...ansi_styles_default2.hexToRgb(...arguments_)); - } - return ansi_styles_default2[type][model](...arguments_); - }; - usedModels2 = ["rgb", "hex", "ansi256"]; - for (const model of usedModels2) { - styles4[model] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "color", ...arguments_), ansi_styles_default2.color.close, this[STYLER2]); - return createBuilder2(this, styler, this[IS_EMPTY2]); - }; - } - }; - const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles4[bgModel] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "bgColor", ...arguments_), ansi_styles_default2.bgColor.close, this[STYLER2]); - return createBuilder2(this, styler, this[IS_EMPTY2]); - }; - } - }; - } - proto2 = Object.defineProperties(() => { - }, { - ...styles4, - level: { - enumerable: true, - get() { - return this[GENERATOR2].level; - }, - set(level) { - this[GENERATOR2].level = level; - } - } - }); - createStyler2 = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === void 0) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } - return { - open, - close, - openAll, - closeAll, - parent - }; - }; - createBuilder2 = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); - Object.setPrototypeOf(builder, proto2); - builder[GENERATOR2] = self; - builder[STYLER2] = _styler; - builder[IS_EMPTY2] = _isEmpty; - return builder; - }; - applyStyle2 = (self, string) => { - if (self.level <= 0 || !string) { - return self[IS_EMPTY2] ? "" : string; - } - let styler = self[STYLER2]; - if (styler === void 0) { - return string; - } - const { openAll, closeAll } = styler; - if (string.includes("\x1B")) { - while (styler !== void 0) { - string = stringReplaceAll2(string, styler.close, styler.open); - styler = styler.parent; - } - } - const lfIndex = string.indexOf("\n"); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex2(string, closeAll, openAll, lfIndex); - } - return openAll + string + closeAll; - }; - Object.defineProperties(createChalk2.prototype, styles4); - chalk2 = createChalk2(); - chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 }); - source_default2 = chalk2; - } -}); - -// ../../node_modules/onetime/node_modules/mimic-fn/index.js -var require_mimic_fn = __commonJS({ - "../../node_modules/onetime/node_modules/mimic-fn/index.js"(exports, module) { - "use strict"; - var mimicFn = (to, from) => { - for (const prop of Reflect.ownKeys(from)) { - Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); - } - return to; - }; - module.exports = mimicFn; - module.exports.default = mimicFn; - } -}); - -// ../../node_modules/onetime/index.js -var require_onetime = __commonJS({ - "../../node_modules/onetime/index.js"(exports, module) { - "use strict"; - var mimicFn = require_mimic_fn(); - var calledFunctions = /* @__PURE__ */ new WeakMap(); - var onetime2 = (function_, options = {}) => { - if (typeof function_ !== "function") { - throw new TypeError("Expected a function"); - } - let returnValue; - let callCount = 0; - const functionName = function_.displayName || function_.name || ""; - const onetime3 = function(...arguments_) { - calledFunctions.set(onetime3, ++callCount); - if (callCount === 1) { - returnValue = function_.apply(this, arguments_); - function_ = null; - } else if (options.throw === true) { - throw new Error(`Function \`${functionName}\` can only be called once`); - } - return returnValue; - }; - mimicFn(onetime3, function_); - calledFunctions.set(onetime3, callCount); - return onetime3; - }; - module.exports = onetime2; - module.exports.default = onetime2; - module.exports.callCount = (function_) => { - if (!calledFunctions.has(function_)) { - throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); - } - return calledFunctions.get(function_); - }; - } -}); - -// ../../node_modules/signal-exit/signals.js -var require_signals = __commonJS({ - "../../node_modules/signal-exit/signals.js"(exports, module) { - module.exports = [ - "SIGABRT", - "SIGALRM", - "SIGHUP", - "SIGINT", - "SIGTERM" - ]; - if (process.platform !== "win32") { - module.exports.push( - "SIGVTALRM", - "SIGXCPU", - "SIGXFSZ", - "SIGUSR2", - "SIGTRAP", - "SIGSYS", - "SIGQUIT", - "SIGIOT" - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ); - } - if (process.platform === "linux") { - module.exports.push( - "SIGIO", - "SIGPOLL", - "SIGPWR", - "SIGSTKFLT", - "SIGUNUSED" - ); - } - } -}); - -// ../../node_modules/signal-exit/index.js -var require_signal_exit = __commonJS({ - "../../node_modules/signal-exit/index.js"(exports, module) { - var process11 = global.process; - var processOk = function(process12) { - return process12 && typeof process12 === "object" && typeof process12.removeListener === "function" && typeof process12.emit === "function" && typeof process12.reallyExit === "function" && typeof process12.listeners === "function" && typeof process12.kill === "function" && typeof process12.pid === "number" && typeof process12.on === "function"; - }; - if (!processOk(process11)) { - module.exports = function() { - return function() { - }; - }; - } else { - assert = __require("assert"); - signals = require_signals(); - isWin = /^win/i.test(process11.platform); - EE = __require("events"); - if (typeof EE !== "function") { - EE = EE.EventEmitter; - } - if (process11.__signal_exit_emitter__) { - emitter = process11.__signal_exit_emitter__; - } else { - emitter = process11.__signal_exit_emitter__ = new EE(); - emitter.count = 0; - emitter.emitted = {}; - } - if (!emitter.infinite) { - emitter.setMaxListeners(Infinity); - emitter.infinite = true; - } - module.exports = function(cb, opts) { - if (!processOk(global.process)) { - return function() { - }; - } - assert.equal(typeof cb, "function", "a callback must be provided for exit handler"); - if (loaded === false) { - load15(); - } - var ev = "exit"; - if (opts && opts.alwaysLast) { - ev = "afterexit"; - } - var remove15 = function() { - emitter.removeListener(ev, cb); - if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { - unload(); - } - }; - emitter.on(ev, cb); - return remove15; - }; - unload = function unload2() { - if (!loaded || !processOk(global.process)) { - return; - } - loaded = false; - signals.forEach(function(sig) { - try { - process11.removeListener(sig, sigListeners[sig]); - } catch (er) { - } - }); - process11.emit = originalProcessEmit; - process11.reallyExit = originalProcessReallyExit; - emitter.count -= 1; - }; - module.exports.unload = unload; - emit = function emit2(event, code, signal) { - if (emitter.emitted[event]) { - return; - } - emitter.emitted[event] = true; - emitter.emit(event, code, signal); - }; - sigListeners = {}; - signals.forEach(function(sig) { - sigListeners[sig] = function listener() { - if (!processOk(global.process)) { - return; - } - var listeners = process11.listeners(sig); - if (listeners.length === emitter.count) { - unload(); - emit("exit", null, sig); - emit("afterexit", null, sig); - if (isWin && sig === "SIGHUP") { - sig = "SIGINT"; - } - process11.kill(process11.pid, sig); - } - }; - }); - module.exports.signals = function() { - return signals; - }; - loaded = false; - load15 = function load16() { - if (loaded || !processOk(global.process)) { - return; - } - loaded = true; - emitter.count += 1; - signals = signals.filter(function(sig) { - try { - process11.on(sig, sigListeners[sig]); - return true; - } catch (er) { - return false; - } - }); - process11.emit = processEmit; - process11.reallyExit = processReallyExit; - }; - module.exports.load = load15; - originalProcessReallyExit = process11.reallyExit; - processReallyExit = function processReallyExit2(code) { - if (!processOk(global.process)) { - return; - } - process11.exitCode = code || /* istanbul ignore next */ - 0; - emit("exit", process11.exitCode, null); - emit("afterexit", process11.exitCode, null); - originalProcessReallyExit.call(process11, process11.exitCode); - }; - originalProcessEmit = process11.emit; - processEmit = function processEmit2(ev, arg) { - if (ev === "exit" && processOk(global.process)) { - if (arg !== void 0) { - process11.exitCode = arg; - } - var ret = originalProcessEmit.apply(this, arguments); - emit("exit", process11.exitCode, null); - emit("afterexit", process11.exitCode, null); - return ret; - } else { - return originalProcessEmit.apply(this, arguments); - } - }; - } - var assert; - var signals; - var isWin; - var EE; - var emitter; - var unload; - var emit; - var sigListeners; - var loaded; - var load15; - var originalProcessReallyExit; - var processReallyExit; - var originalProcessEmit; - var processEmit; - } -}); - -// ../../node_modules/ora/node_modules/restore-cursor/index.js -import process4 from "process"; -var import_onetime, import_signal_exit, restoreCursor, restore_cursor_default; -var init_restore_cursor = __esm({ - "../../node_modules/ora/node_modules/restore-cursor/index.js"() { - import_onetime = __toESM(require_onetime(), 1); - import_signal_exit = __toESM(require_signal_exit(), 1); - restoreCursor = (0, import_onetime.default)(() => { - (0, import_signal_exit.default)(() => { - process4.stderr.write("\x1B[?25h"); - }, { alwaysLast: true }); - }); - restore_cursor_default = restoreCursor; - } -}); - -// ../../node_modules/ora/node_modules/cli-cursor/index.js -import process5 from "process"; -var isHidden, cliCursor, cli_cursor_default; -var init_cli_cursor = __esm({ - "../../node_modules/ora/node_modules/cli-cursor/index.js"() { - init_restore_cursor(); - isHidden = false; - cliCursor = {}; - cliCursor.show = (writableStream = process5.stderr) => { - if (!writableStream.isTTY) { - return; - } - isHidden = false; - writableStream.write("\x1B[?25h"); - }; - cliCursor.hide = (writableStream = process5.stderr) => { - if (!writableStream.isTTY) { - return; - } - restore_cursor_default(); - isHidden = true; - writableStream.write("\x1B[?25l"); - }; - cliCursor.toggle = (force, writableStream) => { - if (force !== void 0) { - isHidden = force; - } - if (isHidden) { - cliCursor.show(writableStream); - } else { - cliCursor.hide(writableStream); - } - }; - cli_cursor_default = cliCursor; - } -}); - -// ../../node_modules/cli-spinners/spinners.json -var require_spinners = __commonJS({ - "../../node_modules/cli-spinners/spinners.json"(exports, module) { - module.exports = { - dots: { - interval: 80, - frames: [ - "\u280B", - "\u2819", - "\u2839", - "\u2838", - "\u283C", - "\u2834", - "\u2826", - "\u2827", - "\u2807", - "\u280F" - ] - }, - dots2: { - interval: 80, - frames: [ - "\u28FE", - "\u28FD", - "\u28FB", - "\u28BF", - "\u287F", - "\u28DF", - "\u28EF", - "\u28F7" - ] - }, - dots3: { - interval: 80, - frames: [ - "\u280B", - "\u2819", - "\u281A", - "\u281E", - "\u2816", - "\u2826", - "\u2834", - "\u2832", - "\u2833", - "\u2813" - ] - }, - dots4: { - interval: 80, - frames: [ - "\u2804", - "\u2806", - "\u2807", - "\u280B", - "\u2819", - "\u2838", - "\u2830", - "\u2820", - "\u2830", - "\u2838", - "\u2819", - "\u280B", - "\u2807", - "\u2806" - ] - }, - dots5: { - interval: 80, - frames: [ - "\u280B", - "\u2819", - "\u281A", - "\u2812", - "\u2802", - "\u2802", - "\u2812", - "\u2832", - "\u2834", - "\u2826", - "\u2816", - "\u2812", - "\u2810", - "\u2810", - "\u2812", - "\u2813", - "\u280B" - ] - }, - dots6: { - interval: 80, - frames: [ - "\u2801", - "\u2809", - "\u2819", - "\u281A", - "\u2812", - "\u2802", - "\u2802", - "\u2812", - "\u2832", - "\u2834", - "\u2824", - "\u2804", - "\u2804", - "\u2824", - "\u2834", - "\u2832", - "\u2812", - "\u2802", - "\u2802", - "\u2812", - "\u281A", - "\u2819", - "\u2809", - "\u2801" - ] - }, - dots7: { - interval: 80, - frames: [ - "\u2808", - "\u2809", - "\u280B", - "\u2813", - "\u2812", - "\u2810", - "\u2810", - "\u2812", - "\u2816", - "\u2826", - "\u2824", - "\u2820", - "\u2820", - "\u2824", - "\u2826", - "\u2816", - "\u2812", - "\u2810", - "\u2810", - "\u2812", - "\u2813", - "\u280B", - "\u2809", - "\u2808" - ] - }, - dots8: { - interval: 80, - frames: [ - "\u2801", - "\u2801", - "\u2809", - "\u2819", - "\u281A", - "\u2812", - "\u2802", - "\u2802", - "\u2812", - "\u2832", - "\u2834", - "\u2824", - "\u2804", - "\u2804", - "\u2824", - "\u2820", - "\u2820", - "\u2824", - "\u2826", - "\u2816", - "\u2812", - "\u2810", - "\u2810", - "\u2812", - "\u2813", - "\u280B", - "\u2809", - "\u2808", - "\u2808" - ] - }, - dots9: { - interval: 80, - frames: [ - "\u28B9", - "\u28BA", - "\u28BC", - "\u28F8", - "\u28C7", - "\u2867", - "\u2857", - "\u284F" - ] - }, - dots10: { - interval: 80, - frames: [ - "\u2884", - "\u2882", - "\u2881", - "\u2841", - "\u2848", - "\u2850", - "\u2860" - ] - }, - dots11: { - interval: 100, - frames: [ - "\u2801", - "\u2802", - "\u2804", - "\u2840", - "\u2880", - "\u2820", - "\u2810", - "\u2808" - ] - }, - dots12: { - interval: 80, - frames: [ - "\u2880\u2800", - "\u2840\u2800", - "\u2804\u2800", - "\u2882\u2800", - "\u2842\u2800", - "\u2805\u2800", - "\u2883\u2800", - "\u2843\u2800", - "\u280D\u2800", - "\u288B\u2800", - "\u284B\u2800", - "\u280D\u2801", - "\u288B\u2801", - "\u284B\u2801", - "\u280D\u2809", - "\u280B\u2809", - "\u280B\u2809", - "\u2809\u2819", - "\u2809\u2819", - "\u2809\u2829", - "\u2808\u2899", - "\u2808\u2859", - "\u2888\u2829", - "\u2840\u2899", - "\u2804\u2859", - "\u2882\u2829", - "\u2842\u2898", - "\u2805\u2858", - "\u2883\u2828", - "\u2843\u2890", - "\u280D\u2850", - "\u288B\u2820", - "\u284B\u2880", - "\u280D\u2841", - "\u288B\u2801", - "\u284B\u2801", - "\u280D\u2809", - "\u280B\u2809", - "\u280B\u2809", - "\u2809\u2819", - "\u2809\u2819", - "\u2809\u2829", - "\u2808\u2899", - "\u2808\u2859", - "\u2808\u2829", - "\u2800\u2899", - "\u2800\u2859", - "\u2800\u2829", - "\u2800\u2898", - "\u2800\u2858", - "\u2800\u2828", - "\u2800\u2890", - "\u2800\u2850", - "\u2800\u2820", - "\u2800\u2880", - "\u2800\u2840" - ] - }, - dots13: { - interval: 80, - frames: [ - "\u28FC", - "\u28F9", - "\u28BB", - "\u283F", - "\u285F", - "\u28CF", - "\u28E7", - "\u28F6" - ] - }, - dots8Bit: { - interval: 80, - frames: [ - "\u2800", - "\u2801", - "\u2802", - "\u2803", - "\u2804", - "\u2805", - "\u2806", - "\u2807", - "\u2840", - "\u2841", - "\u2842", - "\u2843", - "\u2844", - "\u2845", - "\u2846", - "\u2847", - "\u2808", - "\u2809", - "\u280A", - "\u280B", - "\u280C", - "\u280D", - "\u280E", - "\u280F", - "\u2848", - "\u2849", - "\u284A", - "\u284B", - "\u284C", - "\u284D", - "\u284E", - "\u284F", - "\u2810", - "\u2811", - "\u2812", - "\u2813", - "\u2814", - "\u2815", - "\u2816", - "\u2817", - "\u2850", - "\u2851", - "\u2852", - "\u2853", - "\u2854", - "\u2855", - "\u2856", - "\u2857", - "\u2818", - "\u2819", - "\u281A", - "\u281B", - "\u281C", - "\u281D", - "\u281E", - "\u281F", - "\u2858", - "\u2859", - "\u285A", - "\u285B", - "\u285C", - "\u285D", - "\u285E", - "\u285F", - "\u2820", - "\u2821", - "\u2822", - "\u2823", - "\u2824", - "\u2825", - "\u2826", - "\u2827", - "\u2860", - "\u2861", - "\u2862", - "\u2863", - "\u2864", - "\u2865", - "\u2866", - "\u2867", - "\u2828", - "\u2829", - "\u282A", - "\u282B", - "\u282C", - "\u282D", - "\u282E", - "\u282F", - "\u2868", - "\u2869", - "\u286A", - "\u286B", - "\u286C", - "\u286D", - "\u286E", - "\u286F", - "\u2830", - "\u2831", - "\u2832", - "\u2833", - "\u2834", - "\u2835", - "\u2836", - "\u2837", - "\u2870", - "\u2871", - "\u2872", - "\u2873", - "\u2874", - "\u2875", - "\u2876", - "\u2877", - "\u2838", - "\u2839", - "\u283A", - "\u283B", - "\u283C", - "\u283D", - "\u283E", - "\u283F", - "\u2878", - "\u2879", - "\u287A", - "\u287B", - "\u287C", - "\u287D", - "\u287E", - "\u287F", - "\u2880", - "\u2881", - "\u2882", - "\u2883", - "\u2884", - "\u2885", - "\u2886", - "\u2887", - "\u28C0", - "\u28C1", - "\u28C2", - "\u28C3", - "\u28C4", - "\u28C5", - "\u28C6", - "\u28C7", - "\u2888", - "\u2889", - "\u288A", - "\u288B", - "\u288C", - "\u288D", - "\u288E", - "\u288F", - "\u28C8", - "\u28C9", - "\u28CA", - "\u28CB", - "\u28CC", - "\u28CD", - "\u28CE", - "\u28CF", - "\u2890", - "\u2891", - "\u2892", - "\u2893", - "\u2894", - "\u2895", - "\u2896", - "\u2897", - "\u28D0", - "\u28D1", - "\u28D2", - "\u28D3", - "\u28D4", - "\u28D5", - "\u28D6", - "\u28D7", - "\u2898", - "\u2899", - "\u289A", - "\u289B", - "\u289C", - "\u289D", - "\u289E", - "\u289F", - "\u28D8", - "\u28D9", - "\u28DA", - "\u28DB", - "\u28DC", - "\u28DD", - "\u28DE", - "\u28DF", - "\u28A0", - "\u28A1", - "\u28A2", - "\u28A3", - "\u28A4", - "\u28A5", - "\u28A6", - "\u28A7", - "\u28E0", - "\u28E1", - "\u28E2", - "\u28E3", - "\u28E4", - "\u28E5", - "\u28E6", - "\u28E7", - "\u28A8", - "\u28A9", - "\u28AA", - "\u28AB", - "\u28AC", - "\u28AD", - "\u28AE", - "\u28AF", - "\u28E8", - "\u28E9", - "\u28EA", - "\u28EB", - "\u28EC", - "\u28ED", - "\u28EE", - "\u28EF", - "\u28B0", - "\u28B1", - "\u28B2", - "\u28B3", - "\u28B4", - "\u28B5", - "\u28B6", - "\u28B7", - "\u28F0", - "\u28F1", - "\u28F2", - "\u28F3", - "\u28F4", - "\u28F5", - "\u28F6", - "\u28F7", - "\u28B8", - "\u28B9", - "\u28BA", - "\u28BB", - "\u28BC", - "\u28BD", - "\u28BE", - "\u28BF", - "\u28F8", - "\u28F9", - "\u28FA", - "\u28FB", - "\u28FC", - "\u28FD", - "\u28FE", - "\u28FF" - ] - }, - sand: { - interval: 80, - frames: [ - "\u2801", - "\u2802", - "\u2804", - "\u2840", - "\u2848", - "\u2850", - "\u2860", - "\u28C0", - "\u28C1", - "\u28C2", - "\u28C4", - "\u28CC", - "\u28D4", - "\u28E4", - "\u28E5", - "\u28E6", - "\u28EE", - "\u28F6", - "\u28F7", - "\u28FF", - "\u287F", - "\u283F", - "\u289F", - "\u281F", - "\u285B", - "\u281B", - "\u282B", - "\u288B", - "\u280B", - "\u280D", - "\u2849", - "\u2809", - "\u2811", - "\u2821", - "\u2881" - ] - }, - line: { - interval: 130, - frames: [ - "-", - "\\", - "|", - "/" - ] - }, - line2: { - interval: 100, - frames: [ - "\u2802", - "-", - "\u2013", - "\u2014", - "\u2013", - "-" - ] - }, - pipe: { - interval: 100, - frames: [ - "\u2524", - "\u2518", - "\u2534", - "\u2514", - "\u251C", - "\u250C", - "\u252C", - "\u2510" - ] - }, - simpleDots: { - interval: 400, - frames: [ - ". ", - ".. ", - "...", - " " - ] - }, - simpleDotsScrolling: { - interval: 200, - frames: [ - ". ", - ".. ", - "...", - " ..", - " .", - " " - ] - }, - star: { - interval: 70, - frames: [ - "\u2736", - "\u2738", - "\u2739", - "\u273A", - "\u2739", - "\u2737" - ] - }, - star2: { - interval: 80, - frames: [ - "+", - "x", - "*" - ] - }, - flip: { - interval: 70, - frames: [ - "_", - "_", - "_", - "-", - "`", - "`", - "'", - "\xB4", - "-", - "_", - "_", - "_" - ] - }, - hamburger: { - interval: 100, - frames: [ - "\u2631", - "\u2632", - "\u2634" - ] - }, - growVertical: { - interval: 120, - frames: [ - "\u2581", - "\u2583", - "\u2584", - "\u2585", - "\u2586", - "\u2587", - "\u2586", - "\u2585", - "\u2584", - "\u2583" - ] - }, - growHorizontal: { - interval: 120, - frames: [ - "\u258F", - "\u258E", - "\u258D", - "\u258C", - "\u258B", - "\u258A", - "\u2589", - "\u258A", - "\u258B", - "\u258C", - "\u258D", - "\u258E" - ] - }, - balloon: { - interval: 140, - frames: [ - " ", - ".", - "o", - "O", - "@", - "*", - " " - ] - }, - balloon2: { - interval: 120, - frames: [ - ".", - "o", - "O", - "\xB0", - "O", - "o", - "." - ] - }, - noise: { - interval: 100, - frames: [ - "\u2593", - "\u2592", - "\u2591" - ] - }, - bounce: { - interval: 120, - frames: [ - "\u2801", - "\u2802", - "\u2804", - "\u2802" - ] - }, - boxBounce: { - interval: 120, - frames: [ - "\u2596", - "\u2598", - "\u259D", - "\u2597" - ] - }, - boxBounce2: { - interval: 100, - frames: [ - "\u258C", - "\u2580", - "\u2590", - "\u2584" - ] - }, - triangle: { - interval: 50, - frames: [ - "\u25E2", - "\u25E3", - "\u25E4", - "\u25E5" - ] - }, - arc: { - interval: 100, - frames: [ - "\u25DC", - "\u25E0", - "\u25DD", - "\u25DE", - "\u25E1", - "\u25DF" - ] - }, - circle: { - interval: 120, - frames: [ - "\u25E1", - "\u2299", - "\u25E0" - ] - }, - squareCorners: { - interval: 180, - frames: [ - "\u25F0", - "\u25F3", - "\u25F2", - "\u25F1" - ] - }, - circleQuarters: { - interval: 120, - frames: [ - "\u25F4", - "\u25F7", - "\u25F6", - "\u25F5" - ] - }, - circleHalves: { - interval: 50, - frames: [ - "\u25D0", - "\u25D3", - "\u25D1", - "\u25D2" - ] - }, - squish: { - interval: 100, - frames: [ - "\u256B", - "\u256A" - ] - }, - toggle: { - interval: 250, - frames: [ - "\u22B6", - "\u22B7" - ] - }, - toggle2: { - interval: 80, - frames: [ - "\u25AB", - "\u25AA" - ] - }, - toggle3: { - interval: 120, - frames: [ - "\u25A1", - "\u25A0" - ] - }, - toggle4: { - interval: 100, - frames: [ - "\u25A0", - "\u25A1", - "\u25AA", - "\u25AB" - ] - }, - toggle5: { - interval: 100, - frames: [ - "\u25AE", - "\u25AF" - ] - }, - toggle6: { - interval: 300, - frames: [ - "\u101D", - "\u1040" - ] - }, - toggle7: { - interval: 80, - frames: [ - "\u29BE", - "\u29BF" - ] - }, - toggle8: { - interval: 100, - frames: [ - "\u25CD", - "\u25CC" - ] - }, - toggle9: { - interval: 100, - frames: [ - "\u25C9", - "\u25CE" - ] - }, - toggle10: { - interval: 100, - frames: [ - "\u3282", - "\u3280", - "\u3281" - ] - }, - toggle11: { - interval: 50, - frames: [ - "\u29C7", - "\u29C6" - ] - }, - toggle12: { - interval: 120, - frames: [ - "\u2617", - "\u2616" - ] - }, - toggle13: { - interval: 80, - frames: [ - "=", - "*", - "-" - ] - }, - arrow: { - interval: 100, - frames: [ - "\u2190", - "\u2196", - "\u2191", - "\u2197", - "\u2192", - "\u2198", - "\u2193", - "\u2199" - ] - }, - arrow2: { - interval: 80, - frames: [ - "\u2B06\uFE0F ", - "\u2197\uFE0F ", - "\u27A1\uFE0F ", - "\u2198\uFE0F ", - "\u2B07\uFE0F ", - "\u2199\uFE0F ", - "\u2B05\uFE0F ", - "\u2196\uFE0F " - ] - }, - arrow3: { - interval: 120, - frames: [ - "\u25B9\u25B9\u25B9\u25B9\u25B9", - "\u25B8\u25B9\u25B9\u25B9\u25B9", - "\u25B9\u25B8\u25B9\u25B9\u25B9", - "\u25B9\u25B9\u25B8\u25B9\u25B9", - "\u25B9\u25B9\u25B9\u25B8\u25B9", - "\u25B9\u25B9\u25B9\u25B9\u25B8" - ] - }, - bouncingBar: { - interval: 80, - frames: [ - "[ ]", - "[= ]", - "[== ]", - "[=== ]", - "[ ===]", - "[ ==]", - "[ =]", - "[ ]", - "[ =]", - "[ ==]", - "[ ===]", - "[====]", - "[=== ]", - "[== ]", - "[= ]" - ] - }, - bouncingBall: { - interval: 80, - frames: [ - "( \u25CF )", - "( \u25CF )", - "( \u25CF )", - "( \u25CF )", - "( \u25CF)", - "( \u25CF )", - "( \u25CF )", - "( \u25CF )", - "( \u25CF )", - "(\u25CF )" - ] - }, - smiley: { - interval: 200, - frames: [ - "\u{1F604} ", - "\u{1F61D} " - ] - }, - monkey: { - interval: 300, - frames: [ - "\u{1F648} ", - "\u{1F648} ", - "\u{1F649} ", - "\u{1F64A} " - ] - }, - hearts: { - interval: 100, - frames: [ - "\u{1F49B} ", - "\u{1F499} ", - "\u{1F49C} ", - "\u{1F49A} ", - "\u2764\uFE0F " - ] - }, - clock: { - interval: 100, - frames: [ - "\u{1F55B} ", - "\u{1F550} ", - "\u{1F551} ", - "\u{1F552} ", - "\u{1F553} ", - "\u{1F554} ", - "\u{1F555} ", - "\u{1F556} ", - "\u{1F557} ", - "\u{1F558} ", - "\u{1F559} ", - "\u{1F55A} " - ] - }, - earth: { - interval: 180, - frames: [ - "\u{1F30D} ", - "\u{1F30E} ", - "\u{1F30F} " - ] - }, - material: { - interval: 17, - frames: [ - "\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588", - "\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588", - "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", - "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", - "\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", - "\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588", - "\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", - "\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", - "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581" - ] - }, - moon: { - interval: 80, - frames: [ - "\u{1F311} ", - "\u{1F312} ", - "\u{1F313} ", - "\u{1F314} ", - "\u{1F315} ", - "\u{1F316} ", - "\u{1F317} ", - "\u{1F318} " - ] - }, - runner: { - interval: 140, - frames: [ - "\u{1F6B6} ", - "\u{1F3C3} " - ] - }, - pong: { - interval: 80, - frames: [ - "\u2590\u2802 \u258C", - "\u2590\u2808 \u258C", - "\u2590 \u2802 \u258C", - "\u2590 \u2820 \u258C", - "\u2590 \u2840 \u258C", - "\u2590 \u2820 \u258C", - "\u2590 \u2802 \u258C", - "\u2590 \u2808 \u258C", - "\u2590 \u2802 \u258C", - "\u2590 \u2820 \u258C", - "\u2590 \u2840 \u258C", - "\u2590 \u2820 \u258C", - "\u2590 \u2802 \u258C", - "\u2590 \u2808 \u258C", - "\u2590 \u2802\u258C", - "\u2590 \u2820\u258C", - "\u2590 \u2840\u258C", - "\u2590 \u2820 \u258C", - "\u2590 \u2802 \u258C", - "\u2590 \u2808 \u258C", - "\u2590 \u2802 \u258C", - "\u2590 \u2820 \u258C", - "\u2590 \u2840 \u258C", - "\u2590 \u2820 \u258C", - "\u2590 \u2802 \u258C", - "\u2590 \u2808 \u258C", - "\u2590 \u2802 \u258C", - "\u2590 \u2820 \u258C", - "\u2590 \u2840 \u258C", - "\u2590\u2820 \u258C" - ] - }, - shark: { - interval: 120, - frames: [ - "\u2590|\\____________\u258C", - "\u2590_|\\___________\u258C", - "\u2590__|\\__________\u258C", - "\u2590___|\\_________\u258C", - "\u2590____|\\________\u258C", - "\u2590_____|\\_______\u258C", - "\u2590______|\\______\u258C", - "\u2590_______|\\_____\u258C", - "\u2590________|\\____\u258C", - "\u2590_________|\\___\u258C", - "\u2590__________|\\__\u258C", - "\u2590___________|\\_\u258C", - "\u2590____________|\\\u258C", - "\u2590____________/|\u258C", - "\u2590___________/|_\u258C", - "\u2590__________/|__\u258C", - "\u2590_________/|___\u258C", - "\u2590________/|____\u258C", - "\u2590_______/|_____\u258C", - "\u2590______/|______\u258C", - "\u2590_____/|_______\u258C", - "\u2590____/|________\u258C", - "\u2590___/|_________\u258C", - "\u2590__/|__________\u258C", - "\u2590_/|___________\u258C", - "\u2590/|____________\u258C" - ] - }, - dqpb: { - interval: 100, - frames: [ - "d", - "q", - "p", - "b" - ] - }, - weather: { - interval: 100, - frames: [ - "\u2600\uFE0F ", - "\u2600\uFE0F ", - "\u2600\uFE0F ", - "\u{1F324} ", - "\u26C5\uFE0F ", - "\u{1F325} ", - "\u2601\uFE0F ", - "\u{1F327} ", - "\u{1F328} ", - "\u{1F327} ", - "\u{1F328} ", - "\u{1F327} ", - "\u{1F328} ", - "\u26C8 ", - "\u{1F328} ", - "\u{1F327} ", - "\u{1F328} ", - "\u2601\uFE0F ", - "\u{1F325} ", - "\u26C5\uFE0F ", - "\u{1F324} ", - "\u2600\uFE0F ", - "\u2600\uFE0F " - ] - }, - christmas: { - interval: 400, - frames: [ - "\u{1F332}", - "\u{1F384}" - ] - }, - grenade: { - interval: 80, - frames: [ - "\u060C ", - "\u2032 ", - " \xB4 ", - " \u203E ", - " \u2E0C", - " \u2E0A", - " |", - " \u204E", - " \u2055", - " \u0DF4 ", - " \u2053", - " ", - " ", - " " - ] - }, - point: { - interval: 125, - frames: [ - "\u2219\u2219\u2219", - "\u25CF\u2219\u2219", - "\u2219\u25CF\u2219", - "\u2219\u2219\u25CF", - "\u2219\u2219\u2219" - ] - }, - layer: { - interval: 150, - frames: [ - "-", - "=", - "\u2261" - ] - }, - betaWave: { - interval: 80, - frames: [ - "\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2", - "\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2", - "\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2", - "\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2", - "\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2", - "\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2", - "\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1" - ] - }, - fingerDance: { - interval: 160, - frames: [ - "\u{1F918} ", - "\u{1F91F} ", - "\u{1F596} ", - "\u270B ", - "\u{1F91A} ", - "\u{1F446} " - ] - }, - fistBump: { - interval: 80, - frames: [ - "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ", - "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ", - "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ", - "\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ", - "\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ", - "\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ", - "\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 " - ] - }, - soccerHeader: { - interval: 80, - frames: [ - " \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", - "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} " - ] - }, - mindblown: { - interval: 160, - frames: [ - "\u{1F610} ", - "\u{1F610} ", - "\u{1F62E} ", - "\u{1F62E} ", - "\u{1F626} ", - "\u{1F626} ", - "\u{1F627} ", - "\u{1F627} ", - "\u{1F92F} ", - "\u{1F4A5} ", - "\u2728 ", - "\u3000 ", - "\u3000 ", - "\u3000 " - ] - }, - speaker: { - interval: 160, - frames: [ - "\u{1F508} ", - "\u{1F509} ", - "\u{1F50A} ", - "\u{1F509} " - ] - }, - orangePulse: { - interval: 100, - frames: [ - "\u{1F538} ", - "\u{1F536} ", - "\u{1F7E0} ", - "\u{1F7E0} ", - "\u{1F536} " - ] - }, - bluePulse: { - interval: 100, - frames: [ - "\u{1F539} ", - "\u{1F537} ", - "\u{1F535} ", - "\u{1F535} ", - "\u{1F537} " - ] - }, - orangeBluePulse: { - interval: 100, - frames: [ - "\u{1F538} ", - "\u{1F536} ", - "\u{1F7E0} ", - "\u{1F7E0} ", - "\u{1F536} ", - "\u{1F539} ", - "\u{1F537} ", - "\u{1F535} ", - "\u{1F535} ", - "\u{1F537} " - ] - }, - timeTravel: { - interval: 100, - frames: [ - "\u{1F55B} ", - "\u{1F55A} ", - "\u{1F559} ", - "\u{1F558} ", - "\u{1F557} ", - "\u{1F556} ", - "\u{1F555} ", - "\u{1F554} ", - "\u{1F553} ", - "\u{1F552} ", - "\u{1F551} ", - "\u{1F550} " - ] - }, - aesthetic: { - interval: 80, - frames: [ - "\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1", - "\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1", - "\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1", - "\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1", - "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1", - "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1", - "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0", - "\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1" - ] - } - }; - } -}); - -// ../../node_modules/cli-spinners/index.js -var require_cli_spinners = __commonJS({ - "../../node_modules/cli-spinners/index.js"(exports, module) { - "use strict"; - var spinners = Object.assign({}, require_spinners()); - var spinnersList = Object.keys(spinners); - Object.defineProperty(spinners, "random", { - get() { - const randomIndex = Math.floor(Math.random() * spinnersList.length); - const spinnerName = spinnersList[randomIndex]; - return spinners[spinnerName]; - } - }); - module.exports = spinners; - } -}); - -// ../../node_modules/log-symbols/node_modules/chalk/source/vendor/ansi-styles/index.js -function assembleStyles3() { - const codes = /* @__PURE__ */ new Map(); - for (const [groupName, group] of Object.entries(styles5)) { - for (const [styleName, style] of Object.entries(group)) { - styles5[styleName] = { - open: `\x1B[${style[0]}m`, - close: `\x1B[${style[1]}m` - }; - group[styleName] = styles5[styleName]; - codes.set(style[0], style[1]); - } - Object.defineProperty(styles5, groupName, { - value: group, - enumerable: false - }); - } - Object.defineProperty(styles5, "codes", { - value: codes, - enumerable: false - }); - styles5.color.close = "\x1B[39m"; - styles5.bgColor.close = "\x1B[49m"; - styles5.color.ansi = wrapAnsi163(); - styles5.color.ansi256 = wrapAnsi2563(); - styles5.color.ansi16m = wrapAnsi16m3(); - styles5.bgColor.ansi = wrapAnsi163(ANSI_BACKGROUND_OFFSET3); - styles5.bgColor.ansi256 = wrapAnsi2563(ANSI_BACKGROUND_OFFSET3); - styles5.bgColor.ansi16m = wrapAnsi16m3(ANSI_BACKGROUND_OFFSET3); - Object.defineProperties(styles5, { - rgbToAnsi256: { - value(red, green, blue) { - if (red === green && green === blue) { - if (red < 8) { - return 16; - } - if (red > 248) { - return 231; - } - return Math.round((red - 8) / 247 * 24) + 232; - } - return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); - }, - enumerable: false - }, - hexToRgb: { - value(hex) { - const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); - if (!matches) { - return [0, 0, 0]; - } - let [colorString] = matches; - if (colorString.length === 3) { - colorString = [...colorString].map((character) => character + character).join(""); - } - const integer = Number.parseInt(colorString, 16); - return [ - /* eslint-disable no-bitwise */ - integer >> 16 & 255, - integer >> 8 & 255, - integer & 255 - /* eslint-enable no-bitwise */ - ]; - }, - enumerable: false - }, - hexToAnsi256: { - value: (hex) => styles5.rgbToAnsi256(...styles5.hexToRgb(hex)), - enumerable: false - }, - ansi256ToAnsi: { - value(code) { - if (code < 8) { - return 30 + code; - } - if (code < 16) { - return 90 + (code - 8); - } - let red; - let green; - let blue; - if (code >= 232) { - red = ((code - 232) * 10 + 8) / 255; - green = red; - blue = red; - } else { - code -= 16; - const remainder = code % 36; - red = Math.floor(code / 36) / 5; - green = Math.floor(remainder / 6) / 5; - blue = remainder % 6 / 5; - } - const value = Math.max(red, green, blue) * 2; - if (value === 0) { - return 30; - } - let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); - if (value === 2) { - result += 60; - } - return result; - }, - enumerable: false - }, - rgbToAnsi: { - value: (red, green, blue) => styles5.ansi256ToAnsi(styles5.rgbToAnsi256(red, green, blue)), - enumerable: false - }, - hexToAnsi: { - value: (hex) => styles5.ansi256ToAnsi(styles5.hexToAnsi256(hex)), - enumerable: false - } - }); - return styles5; -} -var ANSI_BACKGROUND_OFFSET3, wrapAnsi163, wrapAnsi2563, wrapAnsi16m3, styles5, modifierNames3, foregroundColorNames3, backgroundColorNames3, colorNames3, ansiStyles3, ansi_styles_default3; -var init_ansi_styles3 = __esm({ - "../../node_modules/log-symbols/node_modules/chalk/source/vendor/ansi-styles/index.js"() { - ANSI_BACKGROUND_OFFSET3 = 10; - wrapAnsi163 = (offset = 0) => (code) => `\x1B[${code + offset}m`; - wrapAnsi2563 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; - wrapAnsi16m3 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; - styles5 = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - overline: [53, 55], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - // Bright color - blackBright: [90, 39], - gray: [90, 39], - // Alias of `blackBright` - grey: [90, 39], - // Alias of `blackBright` - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - // Bright color - bgBlackBright: [100, 49], - bgGray: [100, 49], - // Alias of `bgBlackBright` - bgGrey: [100, 49], - // Alias of `bgBlackBright` - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - modifierNames3 = Object.keys(styles5.modifier); - foregroundColorNames3 = Object.keys(styles5.color); - backgroundColorNames3 = Object.keys(styles5.bgColor); - colorNames3 = [...foregroundColorNames3, ...backgroundColorNames3]; - ansiStyles3 = assembleStyles3(); - ansi_styles_default3 = ansiStyles3; - } -}); - -// ../../node_modules/log-symbols/node_modules/chalk/source/vendor/supports-color/index.js -import process6 from "process"; -import os3 from "os"; -import tty3 from "tty"; -function hasFlag3(flag, argv = process6.argv) { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -} -function envForceColor3() { - if ("FORCE_COLOR" in env3) { - if (env3.FORCE_COLOR === "true") { - return 1; - } - if (env3.FORCE_COLOR === "false") { - return 0; - } - return env3.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env3.FORCE_COLOR, 10), 3); - } -} -function translateLevel3(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} -function _supportsColor3(haveStream, { streamIsTTY, sniffFlags = true } = {}) { - const noFlagForceColor = envForceColor3(); - if (noFlagForceColor !== void 0) { - flagForceColor3 = noFlagForceColor; - } - const forceColor = sniffFlags ? flagForceColor3 : noFlagForceColor; - if (forceColor === 0) { - return 0; - } - if (sniffFlags) { - if (hasFlag3("color=16m") || hasFlag3("color=full") || hasFlag3("color=truecolor")) { - return 3; - } - if (hasFlag3("color=256")) { - return 2; - } - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env3.TERM === "dumb") { - return min; - } - if (process6.platform === "win32") { - const osRelease = os3.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env3) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env3) || env3.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env3) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0; - } - if ("TF_BUILD" in env3 && "AGENT_NAME" in env3) { - return 1; - } - if (env3.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env3) { - const version2 = Number.parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env3.TERM_PROGRAM) { - case "iTerm.app": - return version2 >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env3.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) { - return 1; - } - if ("COLORTERM" in env3) { - return 1; - } - return min; -} -function createSupportsColor3(stream, options = {}) { - const level = _supportsColor3(stream, { - streamIsTTY: stream && stream.isTTY, - ...options - }); - return translateLevel3(level); -} -var env3, flagForceColor3, supportsColor3, supports_color_default3; -var init_supports_color3 = __esm({ - "../../node_modules/log-symbols/node_modules/chalk/source/vendor/supports-color/index.js"() { - ({ env: env3 } = process6); - if (hasFlag3("no-color") || hasFlag3("no-colors") || hasFlag3("color=false") || hasFlag3("color=never")) { - flagForceColor3 = 0; - } else if (hasFlag3("color") || hasFlag3("colors") || hasFlag3("color=true") || hasFlag3("color=always")) { - flagForceColor3 = 1; - } - supportsColor3 = { - stdout: createSupportsColor3({ isTTY: tty3.isatty(1) }), - stderr: createSupportsColor3({ isTTY: tty3.isatty(2) }) - }; - supports_color_default3 = supportsColor3; - } -}); - -// ../../node_modules/log-symbols/node_modules/chalk/source/utilities.js -function stringReplaceAll3(string, substring, replacer) { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ""; - do { - returnValue += string.slice(endIndex, index) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - returnValue += string.slice(endIndex); - return returnValue; -} -function stringEncaseCRLFWithFirstIndex3(string, prefix, postfix, index) { - let endIndex = 0; - let returnValue = ""; - do { - const gotCR = string[index - 1] === "\r"; - returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; - endIndex = index + 1; - index = string.indexOf("\n", endIndex); - } while (index !== -1); - returnValue += string.slice(endIndex); - return returnValue; -} -var init_utilities3 = __esm({ - "../../node_modules/log-symbols/node_modules/chalk/source/utilities.js"() { - } -}); - -// ../../node_modules/log-symbols/node_modules/chalk/source/index.js -function createChalk3(options) { - return chalkFactory3(options); -} -var stdoutColor3, stderrColor3, GENERATOR3, STYLER3, IS_EMPTY3, levelMapping3, styles6, applyOptions3, chalkFactory3, getModelAnsi3, usedModels3, proto3, createStyler3, createBuilder3, applyStyle3, chalk3, chalkStderr3, source_default3; -var init_source3 = __esm({ - "../../node_modules/log-symbols/node_modules/chalk/source/index.js"() { - init_ansi_styles3(); - init_supports_color3(); - init_utilities3(); - init_ansi_styles3(); - ({ stdout: stdoutColor3, stderr: stderrColor3 } = supports_color_default3); - GENERATOR3 = Symbol("GENERATOR"); - STYLER3 = Symbol("STYLER"); - IS_EMPTY3 = Symbol("IS_EMPTY"); - levelMapping3 = [ - "ansi", - "ansi", - "ansi256", - "ansi16m" - ]; - styles6 = /* @__PURE__ */ Object.create(null); - applyOptions3 = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error("The `level` option should be an integer from 0 to 3"); - } - const colorLevel = stdoutColor3 ? stdoutColor3.level : 0; - object.level = options.level === void 0 ? colorLevel : options.level; - }; - chalkFactory3 = (options) => { - const chalk4 = (...strings) => strings.join(" "); - applyOptions3(chalk4, options); - Object.setPrototypeOf(chalk4, createChalk3.prototype); - return chalk4; - }; - Object.setPrototypeOf(createChalk3.prototype, Function.prototype); - for (const [styleName, style] of Object.entries(ansi_styles_default3)) { - styles6[styleName] = { - get() { - const builder = createBuilder3(this, createStyler3(style.open, style.close, this[STYLER3]), this[IS_EMPTY3]); - Object.defineProperty(this, styleName, { value: builder }); - return builder; - } - }; - } - styles6.visible = { - get() { - const builder = createBuilder3(this, this[STYLER3], true); - Object.defineProperty(this, "visible", { value: builder }); - return builder; - } - }; - getModelAnsi3 = (model, level, type, ...arguments_) => { - if (model === "rgb") { - if (level === "ansi16m") { - return ansi_styles_default3[type].ansi16m(...arguments_); - } - if (level === "ansi256") { - return ansi_styles_default3[type].ansi256(ansi_styles_default3.rgbToAnsi256(...arguments_)); - } - return ansi_styles_default3[type].ansi(ansi_styles_default3.rgbToAnsi(...arguments_)); - } - if (model === "hex") { - return getModelAnsi3("rgb", level, type, ...ansi_styles_default3.hexToRgb(...arguments_)); - } - return ansi_styles_default3[type][model](...arguments_); - }; - usedModels3 = ["rgb", "hex", "ansi256"]; - for (const model of usedModels3) { - styles6[model] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler3(getModelAnsi3(model, levelMapping3[level], "color", ...arguments_), ansi_styles_default3.color.close, this[STYLER3]); - return createBuilder3(this, styler, this[IS_EMPTY3]); - }; - } - }; - const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles6[bgModel] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler3(getModelAnsi3(model, levelMapping3[level], "bgColor", ...arguments_), ansi_styles_default3.bgColor.close, this[STYLER3]); - return createBuilder3(this, styler, this[IS_EMPTY3]); - }; - } - }; - } - proto3 = Object.defineProperties(() => { - }, { - ...styles6, - level: { - enumerable: true, - get() { - return this[GENERATOR3].level; - }, - set(level) { - this[GENERATOR3].level = level; - } - } - }); - createStyler3 = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === void 0) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } - return { - open, - close, - openAll, - closeAll, - parent - }; - }; - createBuilder3 = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => applyStyle3(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); - Object.setPrototypeOf(builder, proto3); - builder[GENERATOR3] = self; - builder[STYLER3] = _styler; - builder[IS_EMPTY3] = _isEmpty; - return builder; - }; - applyStyle3 = (self, string) => { - if (self.level <= 0 || !string) { - return self[IS_EMPTY3] ? "" : string; - } - let styler = self[STYLER3]; - if (styler === void 0) { - return string; - } - const { openAll, closeAll } = styler; - if (string.includes("\x1B")) { - while (styler !== void 0) { - string = stringReplaceAll3(string, styler.close, styler.open); - styler = styler.parent; - } - } - const lfIndex = string.indexOf("\n"); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex3(string, closeAll, openAll, lfIndex); - } - return openAll + string + closeAll; - }; - Object.defineProperties(createChalk3.prototype, styles6); - chalk3 = createChalk3(); - chalkStderr3 = createChalk3({ level: stderrColor3 ? stderrColor3.level : 0 }); - source_default3 = chalk3; - } -}); - -// ../../node_modules/is-unicode-supported/index.js -import process7 from "process"; -function isUnicodeSupported() { - if (process7.platform !== "win32") { - return process7.env.TERM !== "linux"; - } - return Boolean(process7.env.CI) || Boolean(process7.env.WT_SESSION) || Boolean(process7.env.TERMINUS_SUBLIME) || process7.env.ConEmuTask === "{cmd::Cmder}" || process7.env.TERM_PROGRAM === "Terminus-Sublime" || process7.env.TERM_PROGRAM === "vscode" || process7.env.TERM === "xterm-256color" || process7.env.TERM === "alacritty" || process7.env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; -} -var init_is_unicode_supported = __esm({ - "../../node_modules/is-unicode-supported/index.js"() { - } -}); - -// ../../node_modules/log-symbols/index.js -var main, fallback, logSymbols, log_symbols_default; -var init_log_symbols = __esm({ - "../../node_modules/log-symbols/index.js"() { - init_source3(); - init_is_unicode_supported(); - main = { - info: source_default3.blue("\u2139"), - success: source_default3.green("\u2714"), - warning: source_default3.yellow("\u26A0"), - error: source_default3.red("\u2716") - }; - fallback = { - info: source_default3.blue("i"), - success: source_default3.green("\u221A"), - warning: source_default3.yellow("\u203C"), - error: source_default3.red("\xD7") - }; - logSymbols = isUnicodeSupported() ? main : fallback; - log_symbols_default = logSymbols; - } -}); - -// ../../node_modules/ansi-regex/index.js -function ansiRegex({ onlyFirst = false } = {}) { - const pattern = [ - "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", - "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))" - ].join("|"); - return new RegExp(pattern, onlyFirst ? void 0 : "g"); -} -var init_ansi_regex = __esm({ - "../../node_modules/ansi-regex/index.js"() { - } -}); - -// ../../node_modules/ora/node_modules/strip-ansi/index.js -function stripAnsi(string) { - if (typeof string !== "string") { - throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); - } - return string.replace(ansiRegex(), ""); -} -var init_strip_ansi = __esm({ - "../../node_modules/ora/node_modules/strip-ansi/index.js"() { - init_ansi_regex(); - } -}); - -// ../../node_modules/clone/clone.js -var require_clone = __commonJS({ - "../../node_modules/clone/clone.js"(exports, module) { - var clone = function() { - "use strict"; - function clone2(parent, circular, depth, prototype) { - var filter; - if (typeof circular === "object") { - depth = circular.depth; - prototype = circular.prototype; - filter = circular.filter; - circular = circular.circular; - } - var allParents = []; - var allChildren = []; - var useBuffer = typeof Buffer != "undefined"; - if (typeof circular == "undefined") - circular = true; - if (typeof depth == "undefined") - depth = Infinity; - function _clone(parent2, depth2) { - if (parent2 === null) - return null; - if (depth2 == 0) - return parent2; - var child; - var proto4; - if (typeof parent2 != "object") { - return parent2; - } - if (clone2.__isArray(parent2)) { - child = []; - } else if (clone2.__isRegExp(parent2)) { - child = new RegExp(parent2.source, __getRegExpFlags(parent2)); - if (parent2.lastIndex) - child.lastIndex = parent2.lastIndex; - } else if (clone2.__isDate(parent2)) { - child = new Date(parent2.getTime()); - } else if (useBuffer && Buffer.isBuffer(parent2)) { - if (Buffer.allocUnsafe) { - child = Buffer.allocUnsafe(parent2.length); - } else { - child = new Buffer(parent2.length); - } - parent2.copy(child); - return child; - } else { - if (typeof prototype == "undefined") { - proto4 = Object.getPrototypeOf(parent2); - child = Object.create(proto4); - } else { - child = Object.create(prototype); - proto4 = prototype; - } - } - if (circular) { - var index = allParents.indexOf(parent2); - if (index != -1) { - return allChildren[index]; - } - allParents.push(parent2); - allChildren.push(child); - } - for (var i in parent2) { - var attrs; - if (proto4) { - attrs = Object.getOwnPropertyDescriptor(proto4, i); - } - if (attrs && attrs.set == null) { - continue; - } - child[i] = _clone(parent2[i], depth2 - 1); - } - return child; - } - return _clone(parent, depth); - } - clone2.clonePrototype = function clonePrototype(parent) { - if (parent === null) - return null; - var c = function() { - }; - c.prototype = parent; - return new c(); - }; - function __objToStr(o) { - return Object.prototype.toString.call(o); - } - ; - clone2.__objToStr = __objToStr; - function __isDate(o) { - return typeof o === "object" && __objToStr(o) === "[object Date]"; - } - ; - clone2.__isDate = __isDate; - function __isArray(o) { - return typeof o === "object" && __objToStr(o) === "[object Array]"; - } - ; - clone2.__isArray = __isArray; - function __isRegExp(o) { - return typeof o === "object" && __objToStr(o) === "[object RegExp]"; - } - ; - clone2.__isRegExp = __isRegExp; - function __getRegExpFlags(re) { - var flags = ""; - if (re.global) - flags += "g"; - if (re.ignoreCase) - flags += "i"; - if (re.multiline) - flags += "m"; - return flags; - } - ; - clone2.__getRegExpFlags = __getRegExpFlags; - return clone2; - }(); - if (typeof module === "object" && module.exports) { - module.exports = clone; - } - } -}); - -// ../../node_modules/defaults/index.js -var require_defaults = __commonJS({ - "../../node_modules/defaults/index.js"(exports, module) { - var clone = require_clone(); - module.exports = function(options, defaults) { - options = options || {}; - Object.keys(defaults).forEach(function(key) { - if (typeof options[key] === "undefined") { - options[key] = clone(defaults[key]); - } - }); - return options; - }; - } -}); - -// ../../node_modules/wcwidth/combining.js -var require_combining = __commonJS({ - "../../node_modules/wcwidth/combining.js"(exports, module) { - module.exports = [ - [768, 879], - [1155, 1158], - [1160, 1161], - [1425, 1469], - [1471, 1471], - [1473, 1474], - [1476, 1477], - [1479, 1479], - [1536, 1539], - [1552, 1557], - [1611, 1630], - [1648, 1648], - [1750, 1764], - [1767, 1768], - [1770, 1773], - [1807, 1807], - [1809, 1809], - [1840, 1866], - [1958, 1968], - [2027, 2035], - [2305, 2306], - [2364, 2364], - [2369, 2376], - [2381, 2381], - [2385, 2388], - [2402, 2403], - [2433, 2433], - [2492, 2492], - [2497, 2500], - [2509, 2509], - [2530, 2531], - [2561, 2562], - [2620, 2620], - [2625, 2626], - [2631, 2632], - [2635, 2637], - [2672, 2673], - [2689, 2690], - [2748, 2748], - [2753, 2757], - [2759, 2760], - [2765, 2765], - [2786, 2787], - [2817, 2817], - [2876, 2876], - [2879, 2879], - [2881, 2883], - [2893, 2893], - [2902, 2902], - [2946, 2946], - [3008, 3008], - [3021, 3021], - [3134, 3136], - [3142, 3144], - [3146, 3149], - [3157, 3158], - [3260, 3260], - [3263, 3263], - [3270, 3270], - [3276, 3277], - [3298, 3299], - [3393, 3395], - [3405, 3405], - [3530, 3530], - [3538, 3540], - [3542, 3542], - [3633, 3633], - [3636, 3642], - [3655, 3662], - [3761, 3761], - [3764, 3769], - [3771, 3772], - [3784, 3789], - [3864, 3865], - [3893, 3893], - [3895, 3895], - [3897, 3897], - [3953, 3966], - [3968, 3972], - [3974, 3975], - [3984, 3991], - [3993, 4028], - [4038, 4038], - [4141, 4144], - [4146, 4146], - [4150, 4151], - [4153, 4153], - [4184, 4185], - [4448, 4607], - [4959, 4959], - [5906, 5908], - [5938, 5940], - [5970, 5971], - [6002, 6003], - [6068, 6069], - [6071, 6077], - [6086, 6086], - [6089, 6099], - [6109, 6109], - [6155, 6157], - [6313, 6313], - [6432, 6434], - [6439, 6440], - [6450, 6450], - [6457, 6459], - [6679, 6680], - [6912, 6915], - [6964, 6964], - [6966, 6970], - [6972, 6972], - [6978, 6978], - [7019, 7027], - [7616, 7626], - [7678, 7679], - [8203, 8207], - [8234, 8238], - [8288, 8291], - [8298, 8303], - [8400, 8431], - [12330, 12335], - [12441, 12442], - [43014, 43014], - [43019, 43019], - [43045, 43046], - [64286, 64286], - [65024, 65039], - [65056, 65059], - [65279, 65279], - [65529, 65531], - [68097, 68099], - [68101, 68102], - [68108, 68111], - [68152, 68154], - [68159, 68159], - [119143, 119145], - [119155, 119170], - [119173, 119179], - [119210, 119213], - [119362, 119364], - [917505, 917505], - [917536, 917631], - [917760, 917999] - ]; - } -}); - -// ../../node_modules/wcwidth/index.js -var require_wcwidth = __commonJS({ - "../../node_modules/wcwidth/index.js"(exports, module) { - "use strict"; - var defaults = require_defaults(); - var combining = require_combining(); - var DEFAULTS = { - nul: 0, - control: 0 - }; - module.exports = function wcwidth3(str) { - return wcswidth(str, DEFAULTS); - }; - module.exports.config = function(opts) { - opts = defaults(opts || {}, DEFAULTS); - return function wcwidth3(str) { - return wcswidth(str, opts); - }; - }; - function wcswidth(str, opts) { - if (typeof str !== "string") - return wcwidth2(str, opts); - var s = 0; - for (var i = 0; i < str.length; i++) { - var n = wcwidth2(str.charCodeAt(i), opts); - if (n < 0) - return -1; - s += n; - } - return s; - } - function wcwidth2(ucs, opts) { - if (ucs === 0) - return opts.nul; - if (ucs < 32 || ucs >= 127 && ucs < 160) - return opts.control; - if (bisearch(ucs)) - return 0; - return 1 + (ucs >= 4352 && (ucs <= 4447 || // Hangul Jamo init. consonants - ucs == 9001 || ucs == 9002 || ucs >= 11904 && ucs <= 42191 && ucs != 12351 || // CJK ... Yi - ucs >= 44032 && ucs <= 55203 || // Hangul Syllables - ucs >= 63744 && ucs <= 64255 || // CJK Compatibility Ideographs - ucs >= 65040 && ucs <= 65049 || // Vertical forms - ucs >= 65072 && ucs <= 65135 || // CJK Compatibility Forms - ucs >= 65280 && ucs <= 65376 || // Fullwidth Forms - ucs >= 65504 && ucs <= 65510 || ucs >= 131072 && ucs <= 196605 || ucs >= 196608 && ucs <= 262141)); - } - function bisearch(ucs) { - var min = 0; - var max = combining.length - 1; - var mid; - if (ucs < combining[0][0] || ucs > combining[max][1]) - return false; - while (max >= min) { - mid = Math.floor((min + max) / 2); - if (ucs > combining[mid][1]) - min = mid + 1; - else if (ucs < combining[mid][0]) - max = mid - 1; - else - return true; - } - return false; - } - } -}); - -// ../../node_modules/is-interactive/index.js -function isInteractive({ stream = process.stdout } = {}) { - return Boolean( - stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env) - ); -} -var init_is_interactive = __esm({ - "../../node_modules/is-interactive/index.js"() { - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js -var require_stream = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js"(exports, module) { - module.exports = __require("stream"); - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js -var require_buffer_list = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports, module) { - "use strict"; - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) - symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys(Object(source), true).forEach(function(key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - 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, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; - } - return obj; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - return Constructor; - } - var _require = __require("buffer"); - var Buffer2 = _require.Buffer; - var _require2 = __require("util"); - var inspect = _require2.inspect; - var custom = inspect && inspect.custom || "inspect"; - function copyBuffer(src, target, offset) { - Buffer2.prototype.copy.call(src, target, offset); - } - module.exports = /* @__PURE__ */ function() { - function BufferList() { - _classCallCheck(this, BufferList); - this.head = null; - this.tail = null; - this.length = 0; - } - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) - this.tail.next = entry; - else - this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) - this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) - return; - var ret = this.head.data; - if (this.length === 1) - this.head = this.tail = null; - else - this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join10(s) { - if (this.length === 0) - return ""; - var p = this.head; - var ret = "" + p.data; - while (p = p.next) { - ret += s + p.data; - } - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) - return Buffer2.alloc(0); - var ret = Buffer2.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - } - // Consumes a specified amount of bytes or characters from the buffered data. - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - if (n < this.head.data.length) { - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - ret = this.shift(); - } else { - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } - // Consumes a specified amount of characters from the buffered data. - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) - ret += str; - else - ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) - this.head = p.next; - else - this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } - // Consumes a specified amount of bytes from the buffered data. - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer2.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) - this.head = p.next; - else - this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } - // Make sure the linked list only shows the minimal necessary information. - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread({}, options, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - return BufferList; - }(); - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js -var require_destroy = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports, module) { - "use strict"; - function destroy(err, cb) { - var _this = this; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - return this; - } - if (this._readableState) { - this._readableState.destroyed = true; - } - if (this._writableState) { - this._writableState.destroyed = true; - } - this._destroy(err || null, function(err2) { - if (!cb && err2) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err2); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err2); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err2); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - return this; - } - function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); - } - function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) - return; - if (self._readableState && !self._readableState.emitClose) - return; - self.emit("close"); - } - function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } - } - function emitErrorNT(self, err) { - self.emit("error", err); - } - function errorOrDestroy(stream, err) { - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) - stream.destroy(err); - else - stream.emit("error", err); - } - module.exports = { - destroy, - undestroy, - errorOrDestroy - }; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/errors.js -var require_errors = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/errors.js"(exports, module) { - "use strict"; - var codes = {}; - function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - function getMessage(arg1, arg2, arg3) { - if (typeof message === "string") { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - class NodeError extends Base { - constructor(arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; - } - function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } - } - function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; - } - function endsWith(str, search, this_len) { - if (this_len === void 0 || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; - } - function includes(str, search, start) { - if (typeof start !== "number") { - start = 0; - } - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } - } - createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; - }, TypeError); - createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { - let determiner; - if (typeof expected === "string" && startsWith(expected, "not ")) { - determiner = "must not be"; - expected = expected.replace(/^not /, ""); - } else { - determiner = "must be"; - } - let msg; - if (endsWith(name, " argument")) { - msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`; - } else { - const type = includes(name, ".") ? "property" : "argument"; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`; - } - msg += `. Received type ${typeof actual}`; - return msg; - }, TypeError); - createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); - createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { - return "The " + name + " method is not implemented"; - }); - createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); - createErrorType("ERR_STREAM_DESTROYED", function(name) { - return "Cannot call " + name + " after a stream was destroyed"; - }); - createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); - createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); - createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); - createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); - createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { - return "Unknown encoding: " + arg; - }, TypeError); - createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); - module.exports.codes = codes; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js -var require_state = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js"(exports, module) { - "use strict"; - var ERR_INVALID_OPT_VALUE = require_errors().codes.ERR_INVALID_OPT_VALUE; - function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; - } - function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : "highWaterMark"; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - return Math.floor(hwm); - } - return state.objectMode ? 16 : 16 * 1024; - } - module.exports = { - getHighWaterMark - }; - } -}); - -// ../../node_modules/inherits/inherits_browser.js -var require_inherits_browser = __commonJS({ - "../../node_modules/inherits/inherits_browser.js"(exports, module) { - if (typeof Object.create === "function") { - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - } - }; - } else { - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - var TempCtor = function() { - }; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - }; - } - } -}); - -// ../../node_modules/inherits/inherits.js -var require_inherits = __commonJS({ - "../../node_modules/inherits/inherits.js"(exports, module) { - try { - util = __require("util"); - if (typeof util.inherits !== "function") - throw ""; - module.exports = util.inherits; - } catch (e) { - module.exports = require_inherits_browser(); - } - var util; - } -}); - -// ../../node_modules/util-deprecate/node.js -var require_node = __commonJS({ - "../../node_modules/util-deprecate/node.js"(exports, module) { - module.exports = __require("util").deprecate; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js -var require_stream_writable = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js"(exports, module) { - "use strict"; - module.exports = Writable; - function CorkedRequest(state) { - var _this = this; - this.next = null; - this.entry = null; - this.finish = function() { - onCorkedFinish(_this, state); - }; - } - var Duplex; - Writable.WritableState = WritableState; - var internalUtil = { - deprecate: require_node() - }; - var Stream = require_stream(); - var Buffer2 = __require("buffer").Buffer; - var OurUint8Array = global.Uint8Array || function() { - }; - function _uint8ArrayToBuffer(chunk) { - return Buffer2.from(chunk); - } - function _isUint8Array(obj) { - return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; - } - var destroyImpl = require_destroy(); - var _require = require_state(); - var getHighWaterMark = _require.getHighWaterMark; - var _require$codes = require_errors().codes; - var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; - var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; - var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; - var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE; - var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES; - var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END; - var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; - var errorOrDestroy = destroyImpl.errorOrDestroy; - require_inherits()(Writable, Stream); - function nop() { - } - function WritableState(options, stream, isDuplex) { - Duplex = Duplex || require_stream_duplex(); - options = options || {}; - if (typeof isDuplex !== "boolean") - isDuplex = stream instanceof Duplex; - this.objectMode = !!options.objectMode; - if (isDuplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; - this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); - this.finalCalled = false; - this.needDrain = false; - this.ending = false; - this.ended = false; - this.finished = false; - this.destroyed = false; - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - this.defaultEncoding = options.defaultEncoding || "utf8"; - this.length = 0; - this.writing = false; - this.corked = 0; - this.sync = true; - this.bufferProcessing = false; - this.onwrite = function(er) { - onwrite(stream, er); - }; - this.writecb = null; - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; - this.pendingcb = 0; - this.prefinished = false; - this.errorEmitted = false; - this.emitClose = options.emitClose !== false; - this.autoDestroy = !!options.autoDestroy; - this.bufferedRequestCount = 0; - this.corkedRequestsFree = new CorkedRequest(this); - } - WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; - }; - (function() { - try { - Object.defineProperty(WritableState.prototype, "buffer", { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") - }); - } catch (_) { - } - })(); - var realHasInstance; - if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) - return true; - if (this !== Writable) - return false; - return object && object._writableState instanceof WritableState; - } - }); - } else { - realHasInstance = function realHasInstance2(object) { - return object instanceof this; - }; - } - function Writable(options) { - Duplex = Duplex || require_stream_duplex(); - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) - return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); - this.writable = true; - if (options) { - if (typeof options.write === "function") - this._write = options.write; - if (typeof options.writev === "function") - this._writev = options.writev; - if (typeof options.destroy === "function") - this._destroy = options.destroy; - if (typeof options.final === "function") - this._final = options.final; - } - Stream.call(this); - } - Writable.prototype.pipe = function() { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); - }; - function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); - errorOrDestroy(stream, er); - process.nextTick(cb, er); - } - function validChunk(stream, state, chunk, cb) { - var er; - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== "string" && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); - } - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; - } - return true; - } - Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - if (isBuf && !Buffer2.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (typeof encoding === "function") { - cb = encoding; - encoding = null; - } - if (isBuf) - encoding = "buffer"; - else if (!encoding) - encoding = state.defaultEncoding; - if (typeof cb !== "function") - cb = nop; - if (state.ending) - writeAfterEnd(this, cb); - else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; - }; - Writable.prototype.cork = function() { - this._writableState.corked++; - }; - Writable.prototype.uncork = function() { - var state = this._writableState; - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) - clearBuffer(this, state); - } - }; - Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - if (typeof encoding === "string") - encoding = encoding.toLowerCase(); - if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) - throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; - }; - Object.defineProperty(Writable.prototype, "writableBuffer", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } - }); - function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { - chunk = Buffer2.from(chunk, encoding); - } - return chunk; - } - Object.defineProperty(Writable.prototype, "writableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } - }); - function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = "buffer"; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; - if (!ret) - state.needDrain = true; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk, - encoding, - isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - return ret; - } - function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) - state.onwrite(new ERR_STREAM_DESTROYED("write")); - else if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; - } - function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) { - process.nextTick(cb, er); - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - finishMaybe(stream, state); - } - } - function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; - } - function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== "function") - throw new ERR_MULTIPLE_CALLBACK(); - onwriteStateUpdate(state); - if (er) - onwriteError(stream, state, sync, er, cb); - else { - var finished = needFinish(state) || stream.destroyed; - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } - } - function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); - } - function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit("drain"); - } - } - function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - if (stream._writev && entry && entry.next) { - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) - allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, "", holder.finish); - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - if (state.writing) { - break; - } - } - if (entry === null) - state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; - } - Writable.prototype._write = function(chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); - }; - Writable.prototype._writev = null; - Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - if (typeof chunk === "function") { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === "function") { - cb = encoding; - encoding = null; - } - if (chunk !== null && chunk !== void 0) - this.write(chunk, encoding); - if (state.corked) { - state.corked = 1; - this.uncork(); - } - if (!state.ending) - endWritable(this, state, cb); - return this; - }; - Object.defineProperty(Writable.prototype, "writableLength", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } - }); - function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; - } - function callFinal(stream, state) { - stream._final(function(err) { - state.pendingcb--; - if (err) { - errorOrDestroy(stream, err); - } - state.prefinished = true; - stream.emit("prefinish"); - finishMaybe(stream, state); - }); - } - function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === "function" && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit("prefinish"); - } - } - } - function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit("finish"); - if (state.autoDestroy) { - var rState = stream._readableState; - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - return need; - } - function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - process.nextTick(cb); - else - stream.once("finish", cb); - } - state.ended = true; - stream.writable = false; - } - function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - state.corkedRequestsFree.next = corkReq; - } - Object.defineProperty(Writable.prototype, "destroyed", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === void 0) { - return false; - } - return this._writableState.destroyed; - }, - set: function set(value) { - if (!this._writableState) { - return; - } - this._writableState.destroyed = value; - } - }); - Writable.prototype.destroy = destroyImpl.destroy; - Writable.prototype._undestroy = destroyImpl.undestroy; - Writable.prototype._destroy = function(err, cb) { - cb(err); - }; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js -var require_stream_duplex = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js"(exports, module) { - "use strict"; - var objectKeys = Object.keys || function(obj) { - var keys2 = []; - for (var key in obj) { - keys2.push(key); - } - return keys2; - }; - module.exports = Duplex; - var Readable = require_stream_readable(); - var Writable = require_stream_writable(); - require_inherits()(Duplex, Readable); - { - keys = objectKeys(Writable.prototype); - for (v = 0; v < keys.length; v++) { - method = keys[v]; - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; - } - } - var keys; - var method; - var v; - function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - if (options) { - if (options.readable === false) - this.readable = false; - if (options.writable === false) - this.writable = false; - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once("end", onend); - } - } - } - Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } - }); - Object.defineProperty(Duplex.prototype, "writableBuffer", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } - }); - Object.defineProperty(Duplex.prototype, "writableLength", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } - }); - function onend() { - if (this._writableState.ended) - return; - process.nextTick(onEndNT, this); - } - function onEndNT(self) { - self.end(); - } - Object.defineProperty(Duplex.prototype, "destroyed", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === void 0 || this._writableState === void 0) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - if (this._readableState === void 0 || this._writableState === void 0) { - return; - } - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } - }); - } -}); - -// ../../node_modules/bl/node_modules/safe-buffer/index.js -var require_safe_buffer = __commonJS({ - "../../node_modules/bl/node_modules/safe-buffer/index.js"(exports, module) { - var buffer = __require("buffer"); - var Buffer2 = buffer.Buffer; - function copyProps(src, dst) { - for (var key in src) { - dst[key] = src[key]; - } - } - if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { - module.exports = buffer; - } else { - copyProps(buffer, exports); - exports.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer2(arg, encodingOrOffset, length); - } - SafeBuffer.prototype = Object.create(Buffer2.prototype); - copyProps(Buffer2, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); - } - return Buffer2(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function(size, fill, encoding) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - var buf = Buffer2(size); - if (fill !== void 0) { - 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 Buffer2(size); - }; - SafeBuffer.allocUnsafeSlow = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return buffer.SlowBuffer(size); - }; - } -}); - -// ../../node_modules/bl/node_modules/string_decoder/lib/string_decoder.js -var require_string_decoder = __commonJS({ - "../../node_modules/bl/node_modules/string_decoder/lib/string_decoder.js"(exports) { - "use strict"; - var Buffer2 = require_safe_buffer().Buffer; - var isEncoding = Buffer2.isEncoding || function(encoding) { - encoding = "" + encoding; - switch (encoding && encoding.toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - case "raw": - return true; - default: - return false; - } - }; - function _normalizeEncoding(enc) { - if (!enc) - return "utf8"; - var retried; - while (true) { - switch (enc) { - case "utf8": - case "utf-8": - return "utf8"; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return "utf16le"; - case "latin1": - case "binary": - return "latin1"; - case "base64": - case "ascii": - case "hex": - return enc; - default: - if (retried) - return; - enc = ("" + enc).toLowerCase(); - retried = true; - } - } - } - function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) - throw new Error("Unknown encoding: " + enc); - return nenc || enc; - } - exports.StringDecoder = StringDecoder; - function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case "utf16le": - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case "utf8": - this.fillLast = utf8FillLast; - nb = 4; - break; - case "base64": - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer2.allocUnsafe(nb); - } - StringDecoder.prototype.write = function(buf) { - if (buf.length === 0) - return ""; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === void 0) - return ""; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) - return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ""; - }; - StringDecoder.prototype.end = utf8End; - StringDecoder.prototype.text = utf8Text; - StringDecoder.prototype.fillLast = function(buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; - }; - function utf8CheckByte(byte) { - if (byte <= 127) - return 0; - else if (byte >> 5 === 6) - return 2; - else if (byte >> 4 === 14) - return 3; - else if (byte >> 3 === 30) - return 4; - return byte >> 6 === 2 ? -1 : -2; - } - function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) - return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) - self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) - return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) - self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) - return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) - nb = 0; - else - self.lastNeed = nb - 3; - } - return nb; - } - return 0; - } - function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 192) !== 128) { - self.lastNeed = 0; - return "\uFFFD"; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 192) !== 128) { - self.lastNeed = 1; - return "\uFFFD"; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 192) !== 128) { - self.lastNeed = 2; - return "\uFFFD"; - } - } - } - } - function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== void 0) - return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; - } - function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) - return buf.toString("utf8", i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString("utf8", i, end); - } - function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) - return r + "\uFFFD"; - return r; - } - function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString("utf16le", i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 55296 && c <= 56319) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString("utf16le", i, buf.length - 1); - } - function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString("utf16le", 0, end); - } - return r; - } - function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) - return buf.toString("base64", i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString("base64", i, buf.length - n); - } - function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) - return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed); - return r; - } - function simpleWrite(buf) { - return buf.toString(this.encoding); - } - function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ""; - } - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js -var require_end_of_stream = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports, module) { - "use strict"; - var ERR_STREAM_PREMATURE_CLOSE = require_errors().codes.ERR_STREAM_PREMATURE_CLOSE; - function once(callback) { - var called = false; - return function() { - if (called) - return; - called = true; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - callback.apply(this, args); - }; - } - function noop() { - } - function isRequest(stream) { - return stream.setHeader && typeof stream.abort === "function"; - } - function eos(stream, opts, callback) { - if (typeof opts === "function") - return eos(stream, null, opts); - if (!opts) - opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var onlegacyfinish = function onlegacyfinish2() { - if (!stream.writable) - onfinish(); - }; - var writableEnded = stream._writableState && stream._writableState.finished; - var onfinish = function onfinish2() { - writable = false; - writableEnded = true; - if (!readable) - callback.call(stream); - }; - var readableEnded = stream._readableState && stream._readableState.endEmitted; - var onend = function onend2() { - readable = false; - readableEnded = true; - if (!writable) - callback.call(stream); - }; - var onerror = function onerror2(err) { - callback.call(stream, err); - }; - var onclose = function onclose2() { - var err; - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) - err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) - err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - var onrequest = function onrequest2() { - stream.req.on("finish", onfinish); - }; - if (isRequest(stream)) { - stream.on("complete", onfinish); - stream.on("abort", onclose); - if (stream.req) - onrequest(); - else - stream.on("request", onrequest); - } else if (writable && !stream._writableState) { - stream.on("end", onlegacyfinish); - stream.on("close", onlegacyfinish); - } - stream.on("end", onend); - stream.on("finish", onfinish); - if (opts.error !== false) - stream.on("error", onerror); - stream.on("close", onclose); - return function() { - stream.removeListener("complete", onfinish); - stream.removeListener("abort", onclose); - stream.removeListener("request", onrequest); - if (stream.req) - stream.req.removeListener("finish", onfinish); - stream.removeListener("end", onlegacyfinish); - stream.removeListener("close", onlegacyfinish); - stream.removeListener("finish", onfinish); - stream.removeListener("end", onend); - stream.removeListener("error", onerror); - stream.removeListener("close", onclose); - }; - } - module.exports = eos; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js -var require_async_iterator = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports, module) { - "use strict"; - var _Object$setPrototypeO; - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; - } - return obj; - } - var finished = require_end_of_stream(); - var kLastResolve = Symbol("lastResolve"); - var kLastReject = Symbol("lastReject"); - var kError = Symbol("error"); - var kEnded = Symbol("ended"); - var kLastPromise = Symbol("lastPromise"); - var kHandlePromise = Symbol("handlePromise"); - var kStream = Symbol("stream"); - function createIterResult(value, done) { - return { - value, - done - }; - } - function readAndResolve(iter) { - var resolve3 = iter[kLastResolve]; - if (resolve3 !== null) { - var data = iter[kStream].read(); - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve3(createIterResult(data, false)); - } - } - } - function onReadable(iter) { - process.nextTick(readAndResolve, iter); - } - function wrapForNext(lastPromise, iter) { - return function(resolve3, reject) { - lastPromise.then(function() { - if (iter[kEnded]) { - resolve3(createIterResult(void 0, true)); - return; - } - iter[kHandlePromise](resolve3, reject); - }, reject); - }; - } - var AsyncIteratorPrototype = Object.getPrototypeOf(function() { - }); - var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - next: function next() { - var _this = this; - var error = this[kError]; - if (error !== null) { - return Promise.reject(error); - } - if (this[kEnded]) { - return Promise.resolve(createIterResult(void 0, true)); - } - if (this[kStream].destroyed) { - return new Promise(function(resolve3, reject) { - process.nextTick(function() { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve3(createIterResult(void 0, true)); - } - }); - }); - } - var lastPromise = this[kLastPromise]; - var promise; - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - var data = this[kStream].read(); - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - promise = new Promise(this[kHandlePromise]); - } - this[kLastPromise] = promise; - return promise; - } - }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { - return this; - }), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - return new Promise(function(resolve3, reject) { - _this2[kStream].destroy(null, function(err) { - if (err) { - reject(err); - return; - } - resolve3(createIterResult(void 0, true)); - }); - }); - }), _Object$setPrototypeO), AsyncIteratorPrototype); - var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) { - var _Object$create; - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve3, reject) { - var data = iterator[kStream].read(); - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve3(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve3; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function(err) { - if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { - var reject = iterator[kLastReject]; - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - iterator[kError] = err; - return; - } - var resolve3 = iterator[kLastResolve]; - if (resolve3 !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve3(createIterResult(void 0, true)); - } - iterator[kEnded] = true; - }); - stream.on("readable", onReadable.bind(null, iterator)); - return iterator; - }; - module.exports = createReadableStreamAsyncIterator; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js -var require_from = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js"(exports, module) { - "use strict"; - function asyncGeneratorStep(gen, resolve3, reject, _next, _throw, key, arg) { - try { - var info2 = gen[key](arg); - var value = info2.value; - } catch (error) { - reject(error); - return; - } - if (info2.done) { - resolve3(value); - } else { - Promise.resolve(value).then(_next, _throw); - } - } - function _asyncToGenerator(fn) { - return function() { - var self = this, args = arguments; - return new Promise(function(resolve3, reject) { - var gen = fn.apply(self, args); - function _next(value) { - asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "next", value); - } - function _throw(err) { - asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "throw", err); - } - _next(void 0); - }); - }; - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) - symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys(Object(source), true).forEach(function(key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - 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, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; - } - return obj; - } - var ERR_INVALID_ARG_TYPE = require_errors().codes.ERR_INVALID_ARG_TYPE; - function from(Readable, iterable, opts) { - var iterator; - if (iterable && typeof iterable.next === "function") { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) - iterator = iterable[Symbol.asyncIterator](); - else if (iterable && iterable[Symbol.iterator]) - iterator = iterable[Symbol.iterator](); - else - throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); - var reading = false; - readable._read = function() { - if (!reading) { - reading = true; - next(); - } - }; - function next() { - return _next2.apply(this, arguments); - } - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _ref = yield iterator.next(), value = _ref.value, done = _ref.done; - if (done) { - readable.push(null); - } else if (readable.push(yield value)) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - return readable; - } - module.exports = from; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js -var require_stream_readable = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js"(exports, module) { - "use strict"; - module.exports = Readable; - var Duplex; - Readable.ReadableState = ReadableState; - var EE = __require("events").EventEmitter; - var EElistenerCount = function EElistenerCount2(emitter, type) { - return emitter.listeners(type).length; - }; - var Stream = require_stream(); - var Buffer2 = __require("buffer").Buffer; - var OurUint8Array = global.Uint8Array || function() { - }; - function _uint8ArrayToBuffer(chunk) { - return Buffer2.from(chunk); - } - function _isUint8Array(obj) { - return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; - } - var debugUtil = __require("util"); - var debug2; - if (debugUtil && debugUtil.debuglog) { - debug2 = debugUtil.debuglog("stream"); - } else { - debug2 = function debug3() { - }; - } - var BufferList = require_buffer_list(); - var destroyImpl = require_destroy(); - var _require = require_state(); - var getHighWaterMark = _require.getHighWaterMark; - var _require$codes = require_errors().codes; - var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; - var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF; - var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; - var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; - var StringDecoder; - var createReadableStreamAsyncIterator; - var from; - require_inherits()(Readable, Stream); - var errorOrDestroy = destroyImpl.errorOrDestroy; - var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; - function prependListener(emitter, event, fn) { - if (typeof emitter.prependListener === "function") - return emitter.prependListener(event, fn); - if (!emitter._events || !emitter._events[event]) - emitter.on(event, fn); - else if (Array.isArray(emitter._events[event])) - emitter._events[event].unshift(fn); - else - emitter._events[event] = [fn, emitter._events[event]]; - } - function ReadableState(options, stream, isDuplex) { - Duplex = Duplex || require_stream_duplex(); - options = options || {}; - if (typeof isDuplex !== "boolean") - isDuplex = stream instanceof Duplex; - this.objectMode = !!options.objectMode; - if (isDuplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; - this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - this.sync = true; - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; - this.emitClose = options.emitClose !== false; - this.autoDestroy = !!options.autoDestroy; - this.destroyed = false; - this.defaultEncoding = options.defaultEncoding || "utf8"; - this.awaitDrain = 0; - this.readingMore = false; - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require_string_decoder().StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } - } - function Readable(options) { - Duplex = Duplex || require_stream_duplex(); - if (!(this instanceof Readable)) - return new Readable(options); - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); - this.readable = true; - if (options) { - if (typeof options.read === "function") - this._read = options.read; - if (typeof options.destroy === "function") - this._destroy = options.destroy; - } - Stream.call(this); - } - Object.defineProperty(Readable.prototype, "destroyed", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === void 0) { - return false; - } - return this._readableState.destroyed; - }, - set: function set(value) { - if (!this._readableState) { - return; - } - this._readableState.destroyed = value; - } - }); - Readable.prototype.destroy = destroyImpl.destroy; - Readable.prototype._undestroy = destroyImpl.undestroy; - Readable.prototype._destroy = function(err, cb) { - cb(err); - }; - Readable.prototype.push = function(chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - if (!state.objectMode) { - if (typeof chunk === "string") { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer2.from(chunk, encoding); - encoding = ""; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); - }; - Readable.prototype.unshift = function(chunk) { - return readableAddChunk(this, chunk, null, true, false); - }; - function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug2("readableAddChunk", chunk); - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) - er = chunkInvalid(state, chunk); - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (addToFront) { - if (state.endEmitted) - errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); - else - addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) - addChunk(stream, state, chunk, false); - else - maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } - return !state.ended && (state.length < state.highWaterMark || state.length === 0); - } - function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit("data", chunk); - } else { - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - if (state.needReadable) - emitReadable(stream); - } - maybeReadMore(stream, state); - } - function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); - } - return er; - } - Readable.prototype.isPaused = function() { - return this._readableState.flowing === false; - }; - Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require_string_decoder().StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; - this._readableState.encoding = this._readableState.decoder.encoding; - var p = this._readableState.buffer.head; - var content = ""; - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - this._readableState.buffer.clear(); - if (content !== "") - this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; - }; - var MAX_HWM = 1073741824; - function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; - } - function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) - return 0; - if (state.objectMode) - return 1; - if (n !== n) { - if (state.flowing && state.length) - return state.buffer.head.data.length; - else - return state.length; - } - if (n > state.highWaterMark) - state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) - return n; - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; - } - Readable.prototype.read = function(n) { - debug2("read", n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) - state.emittedReadable = false; - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug2("read: emitReadable", state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; - } - n = howMuchToRead(n, state); - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; - } - var doRead = state.needReadable; - debug2("need readable", doRead); - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug2("length less than watermark", doRead); - } - if (state.ended || state.reading) { - doRead = false; - debug2("reading or ended", doRead); - } else if (doRead) { - debug2("do read"); - state.reading = true; - state.sync = true; - if (state.length === 0) - state.needReadable = true; - this._read(state.highWaterMark); - state.sync = false; - if (!state.reading) - n = howMuchToRead(nOrig, state); - } - var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - if (state.length === 0) { - if (!state.ended) - state.needReadable = true; - if (nOrig !== n && state.ended) - endReadable(this); - } - if (ret !== null) - this.emit("data", ret); - return ret; - }; - function onEofChunk(stream, state) { - debug2("onEofChunk"); - if (state.ended) - return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - if (state.sync) { - emitReadable(stream); - } else { - state.needReadable = false; - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } - } - function emitReadable(stream) { - var state = stream._readableState; - debug2("emitReadable", state.needReadable, state.emittedReadable); - state.needReadable = false; - if (!state.emittedReadable) { - debug2("emitReadable", state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } - } - function emitReadable_(stream) { - var state = stream._readableState; - debug2("emitReadable_", state.destroyed, state.length, state.ended); - if (!state.destroyed && (state.length || state.ended)) { - stream.emit("readable"); - state.emittedReadable = false; - } - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); - } - function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } - } - function maybeReadMore_(stream, state) { - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug2("maybeReadMore read 0"); - stream.read(0); - if (len === state.length) - break; - } - state.readingMore = false; - } - Readable.prototype._read = function(n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); - }; - Readable.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug2("pipe count=%d opts=%j", state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) - process.nextTick(endFn); - else - src.once("end", endFn); - dest.on("unpipe", onunpipe); - function onunpipe(readable, unpipeInfo) { - debug2("onunpipe"); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - function onend() { - debug2("onend"); - dest.end(); - } - var ondrain = pipeOnDrain(src); - dest.on("drain", ondrain); - var cleanedUp = false; - function cleanup() { - debug2("cleanup"); - dest.removeListener("close", onclose); - dest.removeListener("finish", onfinish); - dest.removeListener("drain", ondrain); - dest.removeListener("error", onerror); - dest.removeListener("unpipe", onunpipe); - src.removeListener("end", onend); - src.removeListener("end", unpipe); - src.removeListener("data", ondata); - cleanedUp = true; - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - src.on("data", ondata); - function ondata(chunk) { - debug2("ondata"); - var ret = dest.write(chunk); - debug2("dest.write", ret); - if (ret === false) { - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug2("false write response, pause", state.awaitDrain); - state.awaitDrain++; - } - src.pause(); - } - } - function onerror(er) { - debug2("onerror", er); - unpipe(); - dest.removeListener("error", onerror); - if (EElistenerCount(dest, "error") === 0) - errorOrDestroy(dest, er); - } - prependListener(dest, "error", onerror); - function onclose() { - dest.removeListener("finish", onfinish); - unpipe(); - } - dest.once("close", onclose); - function onfinish() { - debug2("onfinish"); - dest.removeListener("close", onclose); - unpipe(); - } - dest.once("finish", onfinish); - function unpipe() { - debug2("unpipe"); - src.unpipe(dest); - } - dest.emit("pipe", src); - if (!state.flowing) { - debug2("pipe resume"); - src.resume(); - } - return dest; - }; - function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug2("pipeOnDrain", state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { - state.flowing = true; - flow(src); - } - }; - } - Readable.prototype.unpipe = function(dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; - if (state.pipesCount === 0) - return this; - if (state.pipesCount === 1) { - if (dest && dest !== state.pipes) - return this; - if (!dest) - dest = state.pipes; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit("unpipe", this, unpipeInfo); - return this; - } - if (!dest) { - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - for (var i = 0; i < len; i++) { - dests[i].emit("unpipe", this, { - hasUnpiped: false - }); - } - return this; - } - var index = indexOf(state.pipes, dest); - if (index === -1) - return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - dest.emit("unpipe", this, unpipeInfo); - return this; - }; - Readable.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; - if (ev === "data") { - state.readableListening = this.listenerCount("readable") > 0; - if (state.flowing !== false) - this.resume(); - } else if (ev === "readable") { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug2("on readable", state.length, state.reading); - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - return res; - }; - Readable.prototype.addListener = Readable.prototype.on; - Readable.prototype.removeListener = function(ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); - if (ev === "readable") { - process.nextTick(updateReadableListening, this); - } - return res; - }; - Readable.prototype.removeAllListeners = function(ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); - if (ev === "readable" || ev === void 0) { - process.nextTick(updateReadableListening, this); - } - return res; - }; - function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount("readable") > 0; - if (state.resumeScheduled && !state.paused) { - state.flowing = true; - } else if (self.listenerCount("data") > 0) { - self.resume(); - } - } - function nReadingNextTick(self) { - debug2("readable nexttick read 0"); - self.read(0); - } - Readable.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug2("resume"); - state.flowing = !state.readableListening; - resume(this, state); - } - state.paused = false; - return this; - }; - function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } - } - function resume_(stream, state) { - debug2("resume", state.reading); - if (!state.reading) { - stream.read(0); - } - state.resumeScheduled = false; - stream.emit("resume"); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); - } - Readable.prototype.pause = function() { - debug2("call pause flowing=%j", this._readableState.flowing); - if (this._readableState.flowing !== false) { - debug2("pause"); - this._readableState.flowing = false; - this.emit("pause"); - } - this._readableState.paused = true; - return this; - }; - function flow(stream) { - var state = stream._readableState; - debug2("flow", state.flowing); - while (state.flowing && stream.read() !== null) { - ; - } - } - Readable.prototype.wrap = function(stream) { - var _this = this; - var state = this._readableState; - var paused = false; - stream.on("end", function() { - debug2("wrapped end"); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - _this.push(chunk); - } - _this.push(null); - }); - stream.on("data", function(chunk) { - debug2("wrapped data"); - if (state.decoder) - chunk = state.decoder.write(chunk); - if (state.objectMode && (chunk === null || chunk === void 0)) - return; - else if (!state.objectMode && (!chunk || !chunk.length)) - return; - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - for (var i in stream) { - if (this[i] === void 0 && typeof stream[i] === "function") { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - this._read = function(n2) { - debug2("wrapped _read", n2); - if (paused) { - paused = false; - stream.resume(); - } - }; - return this; - }; - if (typeof Symbol === "function") { - Readable.prototype[Symbol.asyncIterator] = function() { - if (createReadableStreamAsyncIterator === void 0) { - createReadableStreamAsyncIterator = require_async_iterator(); - } - return createReadableStreamAsyncIterator(this); - }; - } - Object.defineProperty(Readable.prototype, "readableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } - }); - Object.defineProperty(Readable.prototype, "readableBuffer", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } - }); - Object.defineProperty(Readable.prototype, "readableFlowing", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } - }); - Readable._fromList = fromList; - Object.defineProperty(Readable.prototype, "readableLength", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } - }); - function fromList(n, state) { - if (state.length === 0) - return null; - var ret; - if (state.objectMode) - ret = state.buffer.shift(); - else if (!n || n >= state.length) { - if (state.decoder) - ret = state.buffer.join(""); - else if (state.buffer.length === 1) - ret = state.buffer.first(); - else - ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - ret = state.buffer.consume(n, state.decoder); - } - return ret; - } - function endReadable(stream) { - var state = stream._readableState; - debug2("endReadable", state.endEmitted); - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } - } - function endReadableNT(state, stream) { - debug2("endReadableNT", state.endEmitted, state.length); - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit("end"); - if (state.autoDestroy) { - var wState = stream._writableState; - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } - } - if (typeof Symbol === "function") { - Readable.from = function(iterable, opts) { - if (from === void 0) { - from = require_from(); - } - return from(Readable, iterable, opts); - }; - } - function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) - return i; - } - return -1; - } - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js -var require_stream_transform = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js"(exports, module) { - "use strict"; - module.exports = Transform; - var _require$codes = require_errors().codes; - var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; - var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; - var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING; - var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; - var Duplex = require_stream_duplex(); - require_inherits()(Transform, Duplex); - function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - if (cb === null) { - return this.emit("error", new ERR_MULTIPLE_CALLBACK()); - } - ts.writechunk = null; - ts.writecb = null; - if (data != null) - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } - } - function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - this._readableState.needReadable = true; - this._readableState.sync = false; - if (options) { - if (typeof options.transform === "function") - this._transform = options.transform; - if (typeof options.flush === "function") - this._flush = options.flush; - } - this.on("prefinish", prefinish); - } - function prefinish() { - var _this = this; - if (typeof this._flush === "function" && !this._readableState.destroyed) { - this._flush(function(er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } - } - Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); - }; - Transform.prototype._transform = function(chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); - }; - Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } - }; - Transform.prototype._read = function(n) { - var ts = this._transformState; - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - ts.needTransform = true; - } - }; - Transform.prototype._destroy = function(err, cb) { - Duplex.prototype._destroy.call(this, err, function(err2) { - cb(err2); - }); - }; - function done(stream, er, data) { - if (er) - return stream.emit("error", er); - if (data != null) - stream.push(data); - if (stream._writableState.length) - throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) - throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); - } - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js -var require_stream_passthrough = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js"(exports, module) { - "use strict"; - module.exports = PassThrough; - var Transform = require_stream_transform(); - require_inherits()(PassThrough, Transform); - function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); - Transform.call(this, options); - } - PassThrough.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); - }; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js -var require_pipeline = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports, module) { - "use strict"; - var eos; - function once(callback) { - var called = false; - return function() { - if (called) - return; - called = true; - callback.apply(void 0, arguments); - }; - } - var _require$codes = require_errors().codes; - var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; - var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - function noop(err) { - if (err) - throw err; - } - function isRequest(stream) { - return stream.setHeader && typeof stream.abort === "function"; - } - function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on("close", function() { - closed = true; - }); - if (eos === void 0) - eos = require_end_of_stream(); - eos(stream, { - readable: reading, - writable: writing - }, function(err) { - if (err) - return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function(err) { - if (closed) - return; - if (destroyed) - return; - destroyed = true; - if (isRequest(stream)) - return stream.abort(); - if (typeof stream.destroy === "function") - return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED("pipe")); - }; - } - function call(fn) { - fn(); - } - function pipe2(from, to) { - return from.pipe(to); - } - function popCallback(streams) { - if (!streams.length) - return noop; - if (typeof streams[streams.length - 1] !== "function") - return noop; - return streams.pop(); - } - function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - var callback = popCallback(streams); - if (Array.isArray(streams[0])) - streams = streams[0]; - if (streams.length < 2) { - throw new ERR_MISSING_ARGS("streams"); - } - var error; - var destroys = streams.map(function(stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function(err) { - if (!error) - error = err; - if (err) - destroys.forEach(call); - if (reading) - return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe2); - } - module.exports = pipeline; - } -}); - -// ../../node_modules/bl/node_modules/readable-stream/readable.js -var require_readable = __commonJS({ - "../../node_modules/bl/node_modules/readable-stream/readable.js"(exports, module) { - var Stream = __require("stream"); - if (process.env.READABLE_STREAM === "disable" && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; - } else { - exports = module.exports = require_stream_readable(); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require_stream_writable(); - exports.Duplex = require_stream_duplex(); - exports.Transform = require_stream_transform(); - exports.PassThrough = require_stream_passthrough(); - exports.finished = require_end_of_stream(); - exports.pipeline = require_pipeline(); - } - } -}); - -// ../../node_modules/bl/BufferList.js -var require_BufferList = __commonJS({ - "../../node_modules/bl/BufferList.js"(exports, module) { - "use strict"; - var { Buffer: Buffer2 } = __require("buffer"); - var symbol = Symbol.for("BufferList"); - function BufferList(buf) { - if (!(this instanceof BufferList)) { - return new BufferList(buf); - } - BufferList._init.call(this, buf); - } - BufferList._init = function _init(buf) { - Object.defineProperty(this, symbol, { value: true }); - this._bufs = []; - this.length = 0; - if (buf) { - this.append(buf); - } - }; - BufferList.prototype._new = function _new(buf) { - return new BufferList(buf); - }; - BufferList.prototype._offset = function _offset(offset) { - if (offset === 0) { - return [0, 0]; - } - let tot = 0; - for (let i = 0; i < this._bufs.length; i++) { - const _t = tot + this._bufs[i].length; - if (offset < _t || i === this._bufs.length - 1) { - return [i, offset - tot]; - } - tot = _t; - } - }; - BufferList.prototype._reverseOffset = function(blOffset) { - const bufferId = blOffset[0]; - let offset = blOffset[1]; - for (let i = 0; i < bufferId; i++) { - offset += this._bufs[i].length; - } - return offset; - }; - BufferList.prototype.get = function get(index) { - if (index > this.length || index < 0) { - return void 0; - } - const offset = this._offset(index); - return this._bufs[offset[0]][offset[1]]; - }; - BufferList.prototype.slice = function slice(start, end) { - if (typeof start === "number" && start < 0) { - start += this.length; - } - if (typeof end === "number" && end < 0) { - end += this.length; - } - return this.copy(null, 0, start, end); - }; - BufferList.prototype.copy = function copy(dst, dstStart, srcStart, srcEnd) { - if (typeof srcStart !== "number" || srcStart < 0) { - srcStart = 0; - } - if (typeof srcEnd !== "number" || srcEnd > this.length) { - srcEnd = this.length; - } - if (srcStart >= this.length) { - return dst || Buffer2.alloc(0); - } - if (srcEnd <= 0) { - return dst || Buffer2.alloc(0); - } - const copy2 = !!dst; - const off = this._offset(srcStart); - const len = srcEnd - srcStart; - let bytes = len; - let bufoff = copy2 && dstStart || 0; - let start = off[1]; - if (srcStart === 0 && srcEnd === this.length) { - if (!copy2) { - return this._bufs.length === 1 ? this._bufs[0] : Buffer2.concat(this._bufs, this.length); - } - for (let i = 0; i < this._bufs.length; i++) { - this._bufs[i].copy(dst, bufoff); - bufoff += this._bufs[i].length; - } - return dst; - } - if (bytes <= this._bufs[off[0]].length - start) { - return copy2 ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes); - } - if (!copy2) { - dst = Buffer2.allocUnsafe(len); - } - for (let i = off[0]; i < this._bufs.length; i++) { - const l = this._bufs[i].length - start; - if (bytes > l) { - this._bufs[i].copy(dst, bufoff, start); - bufoff += l; - } else { - this._bufs[i].copy(dst, bufoff, start, start + bytes); - bufoff += l; - break; - } - bytes -= l; - if (start) { - start = 0; - } - } - if (dst.length > bufoff) - return dst.slice(0, bufoff); - return dst; - }; - BufferList.prototype.shallowSlice = function shallowSlice(start, end) { - start = start || 0; - end = typeof end !== "number" ? this.length : end; - if (start < 0) { - start += this.length; - } - if (end < 0) { - end += this.length; - } - if (start === end) { - return this._new(); - } - const startOffset = this._offset(start); - const endOffset = this._offset(end); - const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1); - if (endOffset[1] === 0) { - buffers.pop(); - } else { - buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]); - } - if (startOffset[1] !== 0) { - buffers[0] = buffers[0].slice(startOffset[1]); - } - return this._new(buffers); - }; - BufferList.prototype.toString = function toString(encoding, start, end) { - return this.slice(start, end).toString(encoding); - }; - BufferList.prototype.consume = function consume(bytes) { - bytes = Math.trunc(bytes); - if (Number.isNaN(bytes) || bytes <= 0) - return this; - while (this._bufs.length) { - if (bytes >= this._bufs[0].length) { - bytes -= this._bufs[0].length; - this.length -= this._bufs[0].length; - this._bufs.shift(); - } else { - this._bufs[0] = this._bufs[0].slice(bytes); - this.length -= bytes; - break; - } - } - return this; - }; - BufferList.prototype.duplicate = function duplicate() { - const copy = this._new(); - for (let i = 0; i < this._bufs.length; i++) { - copy.append(this._bufs[i]); - } - return copy; - }; - BufferList.prototype.append = function append(buf) { - if (buf == null) { - return this; - } - if (buf.buffer) { - this._appendBuffer(Buffer2.from(buf.buffer, buf.byteOffset, buf.byteLength)); - } else if (Array.isArray(buf)) { - for (let i = 0; i < buf.length; i++) { - this.append(buf[i]); - } - } else if (this._isBufferList(buf)) { - for (let i = 0; i < buf._bufs.length; i++) { - this.append(buf._bufs[i]); - } - } else { - if (typeof buf === "number") { - buf = buf.toString(); - } - this._appendBuffer(Buffer2.from(buf)); - } - return this; - }; - BufferList.prototype._appendBuffer = function appendBuffer(buf) { - this._bufs.push(buf); - this.length += buf.length; - }; - BufferList.prototype.indexOf = function(search, offset, encoding) { - if (encoding === void 0 && typeof offset === "string") { - encoding = offset; - offset = void 0; - } - if (typeof search === "function" || Array.isArray(search)) { - throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.'); - } else if (typeof search === "number") { - search = Buffer2.from([search]); - } else if (typeof search === "string") { - search = Buffer2.from(search, encoding); - } else if (this._isBufferList(search)) { - search = search.slice(); - } else if (Array.isArray(search.buffer)) { - search = Buffer2.from(search.buffer, search.byteOffset, search.byteLength); - } else if (!Buffer2.isBuffer(search)) { - search = Buffer2.from(search); - } - 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; - } - const blOffset = this._offset(offset); - let blIndex = blOffset[0]; - let buffOffset = blOffset[1]; - for (; blIndex < this._bufs.length; blIndex++) { - const buff = this._bufs[blIndex]; - while (buffOffset < buff.length) { - const availableWindow = buff.length - buffOffset; - if (availableWindow >= search.length) { - const nativeSearchResult = buff.indexOf(search, buffOffset); - if (nativeSearchResult !== -1) { - return this._reverseOffset([blIndex, nativeSearchResult]); - } - buffOffset = buff.length - search.length + 1; - } else { - const revOffset = this._reverseOffset([blIndex, buffOffset]); - if (this._match(revOffset, search)) { - return revOffset; - } - buffOffset++; - } - } - buffOffset = 0; - } - return -1; - }; - BufferList.prototype._match = function(offset, search) { - if (this.length - offset < search.length) { - return false; - } - for (let searchOffset = 0; searchOffset < search.length; searchOffset++) { - if (this.get(offset + searchOffset) !== search[searchOffset]) { - return false; - } - } - return true; - }; - (function() { - const methods = { - readDoubleBE: 8, - readDoubleLE: 8, - readFloatBE: 4, - readFloatLE: 4, - readInt32BE: 4, - readInt32LE: 4, - readUInt32BE: 4, - readUInt32LE: 4, - readInt16BE: 2, - readInt16LE: 2, - readUInt16BE: 2, - readUInt16LE: 2, - readInt8: 1, - readUInt8: 1, - readIntBE: null, - readIntLE: null, - readUIntBE: null, - readUIntLE: null - }; - for (const m in methods) { - (function(m2) { - if (methods[m2] === null) { - BufferList.prototype[m2] = function(offset, byteLength) { - return this.slice(offset, offset + byteLength)[m2](0, byteLength); - }; - } else { - BufferList.prototype[m2] = function(offset = 0) { - return this.slice(offset, offset + methods[m2])[m2](0); - }; - } - })(m); - } - })(); - BufferList.prototype._isBufferList = function _isBufferList(b) { - return b instanceof BufferList || BufferList.isBufferList(b); - }; - BufferList.isBufferList = function isBufferList(b) { - return b != null && b[symbol]; - }; - module.exports = BufferList; - } -}); - -// ../../node_modules/bl/bl.js -var require_bl = __commonJS({ - "../../node_modules/bl/bl.js"(exports, module) { - "use strict"; - var DuplexStream = require_readable().Duplex; - var inherits = require_inherits(); - var BufferList = require_BufferList(); - function BufferListStream2(callback) { - if (!(this instanceof BufferListStream2)) { - return new BufferListStream2(callback); - } - if (typeof callback === "function") { - this._callback = callback; - const piper = function piper2(err) { - if (this._callback) { - this._callback(err); - this._callback = null; - } - }.bind(this); - this.on("pipe", function onPipe(src) { - src.on("error", piper); - }); - this.on("unpipe", function onUnpipe(src) { - src.removeListener("error", piper); - }); - callback = null; - } - BufferList._init.call(this, callback); - DuplexStream.call(this); - } - inherits(BufferListStream2, DuplexStream); - Object.assign(BufferListStream2.prototype, BufferList.prototype); - BufferListStream2.prototype._new = function _new(callback) { - return new BufferListStream2(callback); - }; - BufferListStream2.prototype._write = function _write(buf, encoding, callback) { - this._appendBuffer(buf); - if (typeof callback === "function") { - callback(); - } - }; - BufferListStream2.prototype._read = function _read(size) { - if (!this.length) { - return this.push(null); - } - size = Math.min(size, this.length); - this.push(this.slice(0, size)); - this.consume(size); - }; - BufferListStream2.prototype.end = function end(chunk) { - DuplexStream.prototype.end.call(this, chunk); - if (this._callback) { - this._callback(null, this.slice()); - this._callback = null; - } - }; - BufferListStream2.prototype._destroy = function _destroy(err, cb) { - this._bufs.length = 0; - this.length = 0; - cb(err); - }; - BufferListStream2.prototype._isBufferList = function _isBufferList(b) { - return b instanceof BufferListStream2 || b instanceof BufferList || BufferListStream2.isBufferList(b); - }; - BufferListStream2.isBufferList = BufferList.isBufferList; - module.exports = BufferListStream2; - module.exports.BufferListStream = BufferListStream2; - module.exports.BufferList = BufferList; - } -}); - -// ../../node_modules/stdin-discarder/index.js -import process8 from "process"; -import readline from "readline"; -var import_bl, ASCII_ETX_CODE, StdinDiscarder, stdinDiscarder, stdin_discarder_default; -var init_stdin_discarder = __esm({ - "../../node_modules/stdin-discarder/index.js"() { - import_bl = __toESM(require_bl(), 1); - ASCII_ETX_CODE = 3; - StdinDiscarder = class { - #requests = 0; - #mutedStream = new import_bl.BufferListStream(); - #ourEmit; - #rl; - constructor() { - this.#mutedStream.pipe(process8.stdout); - const self = this; - this.#ourEmit = function(event, data, ...arguments_) { - const { stdin } = process8; - if (self.#requests > 0 || stdin.emit === self.#ourEmit) { - if (event === "keypress") { - return; - } - if (event === "data" && data.includes(ASCII_ETX_CODE)) { - process8.emit("SIGINT"); - } - Reflect.apply(self.#ourEmit, this, [event, data, ...arguments_]); - } else { - Reflect.apply(process8.stdin.emit, this, [event, data, ...arguments_]); - } - }; - } - start() { - this.#requests++; - if (this.#requests === 1) { - this._realStart(); - } - } - stop() { - if (this.#requests <= 0) { - throw new Error("`stop` called more times than `start`"); - } - this.#requests--; - if (this.#requests === 0) { - this._realStop(); - } - } - // TODO: Use private methods when targeting Node.js 14. - _realStart() { - if (process8.platform === "win32") { - return; - } - this.#rl = readline.createInterface({ - input: process8.stdin, - output: this.#mutedStream - }); - this.#rl.on("SIGINT", () => { - if (process8.listenerCount("SIGINT") === 0) { - process8.emit("SIGINT"); - } else { - this.#rl.close(); - process8.kill(process8.pid, "SIGINT"); - } - }); - } - _realStop() { - if (process8.platform === "win32") { - return; - } - this.#rl.close(); - this.#rl = void 0; - } - }; - stdinDiscarder = new StdinDiscarder(); - stdin_discarder_default = stdinDiscarder; - } -}); - -// ../../node_modules/ora/index.js -import process9 from "process"; -function ora(options) { - return new Ora(options); -} -var import_cli_spinners, import_wcwidth, import_cli_spinners2, Ora; -var init_ora = __esm({ - "../../node_modules/ora/index.js"() { - init_source2(); - init_cli_cursor(); - import_cli_spinners = __toESM(require_cli_spinners(), 1); - init_log_symbols(); - init_strip_ansi(); - import_wcwidth = __toESM(require_wcwidth(), 1); - init_is_interactive(); - init_is_unicode_supported(); - init_stdin_discarder(); - import_cli_spinners2 = __toESM(require_cli_spinners(), 1); - Ora = class { - #linesToClear = 0; - #isDiscardingStdin = false; - #lineCount = 0; - #frameIndex = 0; - #options; - #spinner; - #stream; - #id; - #initialInterval; - #isEnabled; - #isSilent; - #indent; - #text; - #prefixText; - #suffixText; - color; - constructor(options) { - if (typeof options === "string") { - options = { - text: options - }; - } - this.#options = { - color: "cyan", - stream: process9.stderr, - discardStdin: true, - hideCursor: true, - ...options - }; - this.color = this.#options.color; - this.spinner = this.#options.spinner; - this.#initialInterval = this.#options.interval; - this.#stream = this.#options.stream; - this.#isEnabled = typeof this.#options.isEnabled === "boolean" ? this.#options.isEnabled : isInteractive({ stream: this.#stream }); - this.#isSilent = typeof this.#options.isSilent === "boolean" ? this.#options.isSilent : false; - this.text = this.#options.text; - this.prefixText = this.#options.prefixText; - this.suffixText = this.#options.suffixText; - this.indent = this.#options.indent; - if (process9.env.NODE_ENV === "test") { - this._stream = this.#stream; - this._isEnabled = this.#isEnabled; - Object.defineProperty(this, "_linesToClear", { - get() { - return this.#linesToClear; - }, - set(newValue) { - this.#linesToClear = newValue; - } - }); - Object.defineProperty(this, "_frameIndex", { - get() { - return this.#frameIndex; - } - }); - Object.defineProperty(this, "_lineCount", { - get() { - return this.#lineCount; - } - }); - } - } - get indent() { - return this.#indent; - } - set indent(indent = 0) { - if (!(indent >= 0 && Number.isInteger(indent))) { - throw new Error("The `indent` option must be an integer from 0 and up"); - } - this.#indent = indent; - this.updateLineCount(); - } - get interval() { - return this.#initialInterval || this.#spinner.interval || 100; - } - get spinner() { - return this.#spinner; - } - set spinner(spinner) { - this.#frameIndex = 0; - this.#initialInterval = void 0; - if (typeof spinner === "object") { - if (spinner.frames === void 0) { - throw new Error("The given spinner must have a `frames` property"); - } - this.#spinner = spinner; - } else if (!isUnicodeSupported()) { - this.#spinner = import_cli_spinners.default.line; - } else if (spinner === void 0) { - this.#spinner = import_cli_spinners.default.dots; - } else if (spinner !== "default" && import_cli_spinners.default[spinner]) { - this.#spinner = import_cli_spinners.default[spinner]; - } else { - throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`); - } - } - get text() { - return this.#text; - } - set text(value) { - this.#text = value || ""; - this.updateLineCount(); - } - get prefixText() { - return this.#prefixText; - } - set prefixText(value) { - this.#prefixText = value || ""; - this.updateLineCount(); - } - get suffixText() { - return this.#suffixText; - } - set suffixText(value) { - this.#suffixText = value || ""; - this.updateLineCount(); - } - get isSpinning() { - return this.#id !== void 0; - } - // TODO: Use private methods when targeting Node.js 14. - getFullPrefixText(prefixText = this.#prefixText, postfix = " ") { - if (typeof prefixText === "string" && prefixText !== "") { - return prefixText + postfix; - } - if (typeof prefixText === "function") { - return prefixText() + postfix; - } - return ""; - } - getFullSuffixText(suffixText = this.#suffixText, prefix = " ") { - if (typeof suffixText === "string" && suffixText !== "") { - return prefix + suffixText; - } - if (typeof suffixText === "function") { - return prefix + suffixText(); - } - return ""; - } - updateLineCount() { - const columns = this.#stream.columns || 80; - const fullPrefixText = this.getFullPrefixText(this.#prefixText, "-"); - const fullSuffixText = this.getFullSuffixText(this.#suffixText, "-"); - const fullText = " ".repeat(this.#indent) + fullPrefixText + "--" + this.#text + "--" + fullSuffixText; - this.#lineCount = 0; - for (const line of stripAnsi(fullText).split("\n")) { - this.#lineCount += Math.max(1, Math.ceil((0, import_wcwidth.default)(line) / columns)); - } - } - get isEnabled() { - return this.#isEnabled && !this.#isSilent; - } - set isEnabled(value) { - if (typeof value !== "boolean") { - throw new TypeError("The `isEnabled` option must be a boolean"); - } - this.#isEnabled = value; - } - get isSilent() { - return this.#isSilent; - } - set isSilent(value) { - if (typeof value !== "boolean") { - throw new TypeError("The `isSilent` option must be a boolean"); - } - this.#isSilent = value; - } - frame() { - const { frames } = this.#spinner; - let frame = frames[this.#frameIndex]; - if (this.color) { - frame = source_default2[this.color](frame); - } - this.#frameIndex = ++this.#frameIndex % frames.length; - const fullPrefixText = typeof this.#prefixText === "string" && this.#prefixText !== "" ? this.#prefixText + " " : ""; - const fullText = typeof this.text === "string" ? " " + this.text : ""; - const fullSuffixText = typeof this.#suffixText === "string" && this.#suffixText !== "" ? " " + this.#suffixText : ""; - return fullPrefixText + frame + fullText + fullSuffixText; - } - clear() { - if (!this.#isEnabled || !this.#stream.isTTY) { - return this; - } - this.#stream.cursorTo(0); - for (let index = 0; index < this.#linesToClear; index++) { - if (index > 0) { - this.#stream.moveCursor(0, -1); - } - this.#stream.clearLine(1); - } - if (this.#indent || this.lastIndent !== this.#indent) { - this.#stream.cursorTo(this.#indent); - } - this.lastIndent = this.#indent; - this.#linesToClear = 0; - return this; - } - render() { - if (this.#isSilent) { - return this; - } - this.clear(); - this.#stream.write(this.frame()); - this.#linesToClear = this.#lineCount; - return this; - } - start(text) { - if (text) { - this.text = text; - } - if (this.#isSilent) { - return this; - } - if (!this.#isEnabled) { - if (this.text) { - this.#stream.write(`- ${this.text} -`); - } - return this; - } - if (this.isSpinning) { - return this; - } - if (this.#options.hideCursor) { - cli_cursor_default.hide(this.#stream); - } - if (this.#options.discardStdin && process9.stdin.isTTY) { - this.#isDiscardingStdin = true; - stdin_discarder_default.start(); - } - this.render(); - this.#id = setInterval(this.render.bind(this), this.interval); - return this; - } - stop() { - if (!this.#isEnabled) { - return this; - } - clearInterval(this.#id); - this.#id = void 0; - this.#frameIndex = 0; - this.clear(); - if (this.#options.hideCursor) { - cli_cursor_default.show(this.#stream); - } - if (this.#options.discardStdin && process9.stdin.isTTY && this.#isDiscardingStdin) { - stdin_discarder_default.stop(); - this.#isDiscardingStdin = false; - } - return this; - } - succeed(text) { - return this.stopAndPersist({ symbol: log_symbols_default.success, text }); - } - fail(text) { - return this.stopAndPersist({ symbol: log_symbols_default.error, text }); - } - warn(text) { - return this.stopAndPersist({ symbol: log_symbols_default.warning, text }); - } - info(text) { - return this.stopAndPersist({ symbol: log_symbols_default.info, text }); - } - stopAndPersist(options = {}) { - if (this.#isSilent) { - return this; - } - const prefixText = options.prefixText || this.#prefixText; - const fullPrefixText = this.getFullPrefixText(prefixText, " "); - const symbolText = options.symbol || " "; - const text = options.text || this.text; - const fullText = typeof text === "string" ? " " + text : ""; - const suffixText = options.suffixText !== void 0 ? options.suffixText : this.#suffixText; - const fullSuffixText = this.getFullSuffixText(suffixText, " "); - const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + "\n"; - this.stop(); - this.#stream.write(textToWrite); - return this; - } - }; - } -}); - -// ../core/dist/io.js -function log(message, type = "info") { - messages.push({ message, type }); -} -function logError(error) { - messages.push({ message: error, type: "error" }); - encounteredErrors = true; -} -function debug(message) { - if (process.env["DEBUG"]) { - log(message, "debug"); - } -} -function warning(message) { - log(message, "warning"); -} -function writeInfo(message) { - return console.log(source_default.blue(message)); -} -function writeDebug(message) { - return console.debug(source_default.gray(message)); -} -function writeWarning(message) { - return console.warn(source_default.bgYellow.black(message)); -} -function writeError(err) { - if (process.env["DEBUG"]) { - console.debug(err); - } else { - console.error(source_default.bgRed.white(String(err))); - } -} -function resetMessages() { - messages = []; -} -function resetEncounteredErrors() { - encounteredErrors = false; -} -function resetState() { - resetMessages(); - resetEncounteredErrors(); -} -async function flushLogs() { - for (const { message, type } of messages) { - type === "warning" ? writeWarning(message) : type === "debug" ? writeDebug(message) : type === "error" ? writeError(message) : writeInfo(message); - } - resetMessages(); -} -async function task(title, callback) { - const spinner = ora(title).start(); - let result; - try { - result = await callback(); - } catch (error) { - spinner.fail(); - logError(error); - flushLogs(); - return [null, error]; - } - if (messages.filter(({ type }) => type === "warning").length > 0) { - spinner.warn(); - } else { - spinner.succeed(); - } - flushLogs(); - return [result, null]; -} -var messages, encounteredErrors; -var init_io = __esm({ - "../core/dist/io.js"() { - "use strict"; - init_source(); - init_ora(); - resetState(); - } -}); - -// ../core/dist/file.js -import fs from "fs"; -import os4 from "os"; -import { dirname } from "path"; -async function readFile({ path: path5 }) { - return fs.promises.readFile(path5, "utf8"); -} -async function writeFile({ path: path5, contents }) { - await createDirectory({ directory: dirname(path5) }); - debug(`writing "${contents}" to "${path5}"`); - return fs.promises.writeFile(path5, `${contents.trim()}${os4.EOL}`, "utf8"); -} -async function copyFile({ from, to }) { - await createDirectory({ directory: dirname(to) }); - return fs.promises.copyFile(from, to); -} -async function removeFile({ path: path5 }) { - return fs.promises.rm(path5); -} -async function isAccessibleFile({ path: path5, mode }) { - try { - await fs.promises.access(path5, mode); - return true; - } catch { - return false; - } -} -async function isReadableAndWritableFile({ path: path5 }) { - return isAccessibleFile({ - path: path5, - mode: fs.constants.R_OK | fs.constants.W_OK - }); -} -var init_file = __esm({ - "../core/dist/file.js"() { - "use strict"; - init_directory(); - init_io(); - } -}); - -// ../core/dist/directory.js -import fs2 from "fs"; -async function removeDirectory({ directory }) { - return fs2.promises.rm(directory, { recursive: true }); -} -async function createDirectory({ directory }) { - return fs2.promises.mkdir(directory, { recursive: true }); -} -async function isDirectory({ directory }) { - try { - return (await fs2.promises.stat(directory)).isDirectory(); - } catch { - return false; - } -} -var init_directory = __esm({ - "../core/dist/directory.js"() { - "use strict"; - init_file(); - } -}); - -// ../core/dist/gitignore.js -import os5 from "os"; -import { resolve } from "path"; -async function readGitignore({ directory }) { - return (await readFile({ path: resolve(directory, FILENAME) })).trim().split(os5.EOL); -} -async function writeGitignore({ directory, lines, append = true }) { - const path5 = resolve(directory, FILENAME); - if (append && await isReadableAndWritableFile({ path: path5 })) { - let existingLines = await readGitignore({ directory }); - lines = [.../* @__PURE__ */ new Set([...existingLines, ...lines])]; - } - return writeFile({ - path: path5, - contents: lines.join(os5.EOL) - }); -} -var FILENAME; -var init_gitignore = __esm({ - "../core/dist/gitignore.js"() { - "use strict"; - init_file(); - FILENAME = ".gitignore"; - } -}); - -// ../core/dist/utils/exec.js -import childProcess, { ChildProcess } from "child_process"; -function childAwaiter(child) { - return new Promise(function(resolve3, reject) { - child.on("error", reject); - child.on("exit", resolve3); - }); -} -async function exec(cmd, args = [], { cwd = process.cwd(), env: env4 = process.env, io = "return" } = {}) { - debug(`spawning "${cmd} ${args.join(" ")}" in "${cwd}"`); - const child = childProcess.spawn(cmd, args, { - shell: true, - stdio: io === "passthrough" ? "inherit" : "pipe", - cwd, - env: env4 - }); - let stdout = ""; - let stderr = ""; - if (child.stdout) { - child.stdout.on("data", function(chunk) { - stdout += chunk; - }); - } - if (child.stderr) { - child.stderr.on("data", function(chunk) { - stdout += chunk; - }); - } - const status = await childAwaiter(child); - const result = { status, stdout, stderr }; - if (status !== 0) { - const error = new Error(`exec [${cmd}] returned with an error - ${JSON.stringify(result)}`); - Object.assign(error, result); - throw error; - } - return result; -} -var init_exec = __esm({ - "../core/dist/utils/exec.js"() { - "use strict"; - init_io(); - } -}); - -// ../core/dist/utils/assertions.js -var init_assertions = __esm({ - "../core/dist/utils/assertions.js"() { - "use strict"; - init_exec(); - } -}); - -// ../core/dist/utils/author.js -var init_author = __esm({ - "../core/dist/utils/author.js"() { - "use strict"; - init_exec(); - } -}); - -// ../../node_modules/deepmerge/dist/cjs.js -var require_cjs = __commonJS({ - "../../node_modules/deepmerge/dist/cjs.js"(exports, module) { - "use strict"; - var isMergeableObject = function isMergeableObject2(value) { - return isNonNullObject(value) && !isSpecial(value); - }; - function isNonNullObject(value) { - return !!value && typeof value === "object"; - } - function isSpecial(value) { - var stringValue = Object.prototype.toString.call(value); - return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); - } - var canUseSymbol = typeof Symbol === "function" && Symbol.for; - var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103; - function isReactElement(value) { - return value.$$typeof === REACT_ELEMENT_TYPE; - } - function emptyTarget(val) { - return Array.isArray(val) ? [] : {}; - } - function cloneUnlessOtherwiseSpecified(value, options) { - return options.clone !== false && options.isMergeableObject(value) ? deepmerge4(emptyTarget(value), value, options) : value; - } - function defaultArrayMerge(target, source, options) { - return target.concat(source).map(function(element) { - return cloneUnlessOtherwiseSpecified(element, options); - }); - } - function getMergeFunction(key, options) { - if (!options.customMerge) { - return deepmerge4; - } - var customMerge = options.customMerge(key); - return typeof customMerge === "function" ? customMerge : deepmerge4; - } - function getEnumerableOwnPropertySymbols(target) { - return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { - return Object.propertyIsEnumerable.call(target, symbol); - }) : []; - } - function getKeys(target) { - return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); - } - function propertyIsOnObject(object, property) { - try { - return property in object; - } catch (_) { - return false; - } - } - function propertyIsUnsafe(target, key) { - return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); - } - function mergeObject(target, source, options) { - var destination = {}; - if (options.isMergeableObject(target)) { - getKeys(target).forEach(function(key) { - destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); - }); - } - getKeys(source).forEach(function(key) { - if (propertyIsUnsafe(target, key)) { - return; - } - if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { - destination[key] = getMergeFunction(key, options)(target[key], source[key], options); - } else { - destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); - } - }); - return destination; - } - function deepmerge4(target, source, options) { - options = options || {}; - options.arrayMerge = options.arrayMerge || defaultArrayMerge; - options.isMergeableObject = options.isMergeableObject || isMergeableObject; - options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; - var sourceIsArray = Array.isArray(source); - var targetIsArray = Array.isArray(target); - var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; - if (!sourceAndTargetTypesMatch) { - return cloneUnlessOtherwiseSpecified(source, options); - } else if (sourceIsArray) { - return options.arrayMerge(target, source, options); - } else { - return mergeObject(target, source, options); - } - } - deepmerge4.all = function deepmergeAll(array, options) { - if (!Array.isArray(array)) { - throw new Error("first argument should be an array"); - } - return array.reduce(function(prev, next) { - return deepmerge4(prev, next, options); - }, {}); - }; - var deepmerge_1 = deepmerge4; - module.exports = deepmerge_1; - } -}); - -// ../core/dist/utils/merge.js -function deepmerge(source1, source2) { - return (0, import_deepmerge.default)(source1, source2, { - arrayMerge - }); -} -function arrayMerge(source1, source2) { - return [.../* @__PURE__ */ new Set([...source1, ...source2])]; -} -var import_deepmerge; -var init_merge = __esm({ - "../core/dist/utils/merge.js"() { - "use strict"; - import_deepmerge = __toESM(require_cjs(), 1); - } -}); - -// ../core/dist/utils/string.js -function toCamelCase(str) { - return str.toLowerCase().replace(/[-_][a-z]/g, (group) => group.slice(-1).toUpperCase()); -} -var init_string = __esm({ - "../core/dist/utils/string.js"() { - "use strict"; - } -}); - -// ../../node_modules/sort-object-keys/index.js -var require_sort_object_keys = __commonJS({ - "../../node_modules/sort-object-keys/index.js"(exports, module) { - module.exports = function sortObjectByKeyNameList(object, sortWith) { - var keys; - var sortFn; - if (typeof sortWith === "function") { - sortFn = sortWith; - } else { - keys = sortWith; - } - var objectKeys = Object.keys(object); - return (keys || []).concat(objectKeys.sort(sortFn)).reduce(function(total, key) { - if (objectKeys.indexOf(key) !== -1) { - total[key] = object[key]; - } - return total; - }, /* @__PURE__ */ Object.create(null)); - }; - } -}); - -// ../../node_modules/sort-package-json/node_modules/detect-indent/index.js -function makeIndentsMap(string, ignoreSingleSpaces) { - const indents = /* @__PURE__ */ new Map(); - let previousSize = 0; - let previousIndentType; - let key; - for (const line of string.split(/\n/g)) { - if (!line) { - continue; - } - let indent; - let indentType; - let use; - let weight; - let entry; - const matches = line.match(INDENT_REGEX); - if (matches === null) { - previousSize = 0; - previousIndentType = ""; - } else { - indent = matches[0].length; - indentType = matches[1] ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB; - if (ignoreSingleSpaces && indentType === INDENT_TYPE_SPACE && indent === 1) { - continue; - } - if (indentType !== previousIndentType) { - previousSize = 0; - } - previousIndentType = indentType; - use = 1; - weight = 0; - const indentDifference = indent - previousSize; - previousSize = indent; - if (indentDifference === 0) { - use = 0; - weight = 1; - } else { - const absoluteIndentDifference = indentDifference > 0 ? indentDifference : -indentDifference; - key = encodeIndentsKey(indentType, absoluteIndentDifference); - } - entry = indents.get(key); - entry = entry === void 0 ? [1, 0] : [entry[0] + use, entry[1] + weight]; - indents.set(key, entry); - } - } - return indents; -} -function encodeIndentsKey(indentType, indentAmount) { - const typeCharacter = indentType === INDENT_TYPE_SPACE ? "s" : "t"; - return typeCharacter + String(indentAmount); -} -function decodeIndentsKey(indentsKey) { - const keyHasTypeSpace = indentsKey[0] === "s"; - const type = keyHasTypeSpace ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB; - const amount = Number(indentsKey.slice(1)); - return { type, amount }; -} -function getMostUsedKey(indents) { - let result; - let maxUsed = 0; - let maxWeight = 0; - for (const [key, [usedCount, weight]] of indents) { - if (usedCount > maxUsed || usedCount === maxUsed && weight > maxWeight) { - maxUsed = usedCount; - maxWeight = weight; - result = key; - } - } - return result; -} -function makeIndentString(type, amount) { - const indentCharacter = type === INDENT_TYPE_SPACE ? " " : " "; - return indentCharacter.repeat(amount); -} -function detectIndent(string) { - if (typeof string !== "string") { - throw new TypeError("Expected a string"); - } - let indents = makeIndentsMap(string, true); - if (indents.size === 0) { - indents = makeIndentsMap(string, false); - } - const keyOfMostUsedIndent = getMostUsedKey(indents); - let type; - let amount = 0; - let indent = ""; - if (keyOfMostUsedIndent !== void 0) { - ({ type, amount } = decodeIndentsKey(keyOfMostUsedIndent)); - indent = makeIndentString(type, amount); - } - return { - amount, - type, - indent - }; -} -var INDENT_REGEX, INDENT_TYPE_SPACE, INDENT_TYPE_TAB; -var init_detect_indent = __esm({ - "../../node_modules/sort-package-json/node_modules/detect-indent/index.js"() { - INDENT_REGEX = /^(?:( )+|\t+)/; - INDENT_TYPE_SPACE = "space"; - INDENT_TYPE_TAB = "tab"; - } -}); - -// ../../node_modules/detect-newline/index.js -function detectNewline(string) { - if (typeof string !== "string") { - throw new TypeError("Expected a string"); - } - const newlines = string.match(/(?:\r?\n)/g) || []; - if (newlines.length === 0) { - return; - } - const crlf = newlines.filter((newline) => newline === "\r\n").length; - const lf = newlines.length - crlf; - return crlf > lf ? "\r\n" : "\n"; -} -function detectNewlineGraceful(string) { - return typeof string === "string" && detectNewline(string) || "\n"; -} -var init_detect_newline = __esm({ - "../../node_modules/detect-newline/index.js"() { - } -}); - -// ../../node_modules/git-hooks-list/index.js -import fs3 from "fs"; -var dataFile, gitHooks, git_hooks_list_default; -var init_git_hooks_list = __esm({ - "../../node_modules/git-hooks-list/index.js"() { - dataFile = new URL("./index.json", import.meta.url); - gitHooks = JSON.parse(fs3.readFileSync(dataFile)); - git_hooks_list_default = gitHooks; - } -}); - -// ../../node_modules/sort-package-json/node_modules/is-plain-obj/index.js -function isPlainObject(value) { - if (typeof value !== "object" || value === null) { - return false; - } - const prototype = Object.getPrototypeOf(value); - return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); -} -var init_is_plain_obj = __esm({ - "../../node_modules/sort-package-json/node_modules/is-plain-obj/index.js"() { - } -}); - -// ../../node_modules/sort-package-json/index.js -function editStringJSON(json, over) { - if (typeof json === "string") { - const { indent } = detectIndent(json); - const endCharacters = json.slice(-1) === "\n" ? "\n" : ""; - const newline = detectNewlineGraceful(json); - json = JSON.parse(json); - let result = JSON.stringify(over(json), null, indent) + endCharacters; - if (newline === "\r\n") { - result = result.replace(/\n/g, newline); - } - return result; - } - return over(json); -} -function sortPackageJson(jsonIsh, options = {}) { - return editStringJSON( - jsonIsh, - onObject((json) => { - let sortOrder = options.sortOrder || defaultSortOrder; - if (Array.isArray(sortOrder)) { - const keys = Object.keys(json); - const [privateKeys, publicKeys] = partition(keys, isPrivateKey); - sortOrder = [ - ...sortOrder, - ...defaultSortOrder, - ...publicKeys.sort(), - ...privateKeys.sort() - ]; - } - return overFields((0, import_sort_object_keys.default)(json, sortOrder), json); - }) - ); -} -var import_sort_object_keys, hasOwn, pipe, onArray, onStringArray, uniq, sortArray, uniqAndSortArray, onObject, sortObjectBy, sortObject, sortURLObject, sortPeopleObject, sortDirectories, overProperty, sortGitHooks, eslintBaseConfigProperties, sortEslintConfig, sortVSCodeBadgeObject, sortPrettierConfig, sortVolta, defaultNpmScripts, hasDevDependency, sortScripts, fields, defaultSortOrder, overFields, isPrivateKey, partition, sort_package_json_default; -var init_sort_package_json = __esm({ - "../../node_modules/sort-package-json/index.js"() { - import_sort_object_keys = __toESM(require_sort_object_keys(), 1); - init_detect_indent(); - init_detect_newline(); - init_git_hooks_list(); - init_is_plain_obj(); - hasOwn = Object.hasOwn || // TODO: Remove this when we drop supported for Node.js v14 - ((object, property) => Object.prototype.hasOwnProperty.call(object, property)); - pipe = (fns) => (x, ...args) => fns.reduce((result, fn) => fn(result, ...args), x); - onArray = (fn) => (x) => Array.isArray(x) ? fn(x) : x; - onStringArray = (fn) => (x) => Array.isArray(x) && x.every((item) => typeof item === "string") ? fn(x) : x; - uniq = onStringArray((xs) => [...new Set(xs)]); - sortArray = onStringArray((array) => [...array].sort()); - uniqAndSortArray = pipe([uniq, sortArray]); - onObject = (fn) => (x, ...args) => isPlainObject(x) ? fn(x, ...args) : x; - sortObjectBy = (comparator, deep) => { - const over = onObject((object) => { - if (deep) { - object = Object.fromEntries( - Object.entries(object).map(([key, value]) => [key, over(value)]) - ); - } - return (0, import_sort_object_keys.default)(object, comparator); - }); - return over; - }; - sortObject = sortObjectBy(); - sortURLObject = sortObjectBy(["type", "url"]); - sortPeopleObject = sortObjectBy(["name", "email", "url"]); - sortDirectories = sortObjectBy([ - "lib", - "bin", - "man", - "doc", - "example", - "test" - ]); - overProperty = (property, over) => (object, ...args) => hasOwn(object, property) ? { ...object, [property]: over(object[property], ...args) } : object; - sortGitHooks = sortObjectBy(git_hooks_list_default); - eslintBaseConfigProperties = [ - // `files` and `excludedFiles` are only on `overrides[]` - // for easier sort `overrides[]`, - // add them to here, so we don't need sort `overrides[]` twice - "files", - "excludedFiles", - // baseConfig - "env", - "parser", - "parserOptions", - "settings", - "plugins", - "extends", - "rules", - "overrides", - "globals", - "processor", - "noInlineConfig", - "reportUnusedDisableDirectives" - ]; - sortEslintConfig = onObject( - pipe([ - sortObjectBy(eslintBaseConfigProperties), - overProperty("env", sortObject), - overProperty("globals", sortObject), - overProperty( - "overrides", - onArray((overrides) => overrides.map(sortEslintConfig)) - ), - overProperty("parserOptions", sortObject), - overProperty( - "rules", - sortObjectBy( - (rule1, rule2) => rule1.split("/").length - rule2.split("/").length || rule1.localeCompare(rule2) - ) - ), - overProperty("settings", sortObject) - ]) - ); - sortVSCodeBadgeObject = sortObjectBy(["description", "url", "href"]); - sortPrettierConfig = onObject( - pipe([ - // sort keys alphabetically, but put `overrides` at bottom - (config) => (0, import_sort_object_keys.default)(config, [ - ...Object.keys(config).filter((key) => key !== "overrides").sort(), - "overrides" - ]), - // if `config.overrides` exists - overProperty( - "overrides", - // and `config.overrides` is an array - onArray( - (overrides) => overrides.map( - pipe([ - // sort `config.overrides[]` alphabetically - sortObject, - // sort `config.overrides[].options` alphabetically - overProperty("options", sortObject) - ]) - ) - ) - ) - ]) - ); - sortVolta = sortObjectBy(["node", "npm", "yarn"]); - defaultNpmScripts = /* @__PURE__ */ new Set([ - "install", - "pack", - "prepare", - "publish", - "restart", - "shrinkwrap", - "start", - "stop", - "test", - "uninstall", - "version" - ]); - hasDevDependency = (dependency, packageJson) => { - return hasOwn(packageJson, "devDependencies") && hasOwn(packageJson.devDependencies, dependency); - }; - sortScripts = onObject((scripts, packageJson) => { - const names = Object.keys(scripts); - const prefixable = /* @__PURE__ */ new Set(); - const keys = names.map((name) => { - const omitted = name.replace(/^(?:pre|post)/, ""); - if (defaultNpmScripts.has(omitted) || names.includes(omitted)) { - prefixable.add(omitted); - return omitted; - } - return name; - }); - if (!hasDevDependency("npm-run-all", packageJson)) { - keys.sort(); - } - const order = keys.flatMap( - (key) => prefixable.has(key) ? [`pre${key}`, key, `post${key}`] : [key] - ); - return (0, import_sort_object_keys.default)(scripts, order); - }); - fields = [ - { key: "$schema" }, - { key: "name" }, - /* vscode */ - { key: "displayName" }, - { key: "version" }, - { key: "private" }, - { key: "description" }, - /* vscode */ - { key: "categories", over: uniq }, - { key: "keywords", over: uniq }, - { key: "homepage" }, - { key: "bugs", over: sortObjectBy(["url", "email"]) }, - { key: "repository", over: sortURLObject }, - { key: "funding", over: sortURLObject }, - { key: "license", over: sortURLObject }, - /* vscode */ - { key: "qna" }, - { key: "author", over: sortPeopleObject }, - { - key: "maintainers", - over: onArray((maintainers) => maintainers.map(sortPeopleObject)) - }, - { - key: "contributors", - over: onArray((contributors) => contributors.map(sortPeopleObject)) - }, - /* vscode */ - { key: "publisher" }, - { key: "sideEffects" }, - { key: "type" }, - { key: "imports" }, - { key: "exports" }, - { key: "main" }, - { key: "svelte" }, - { key: "umd:main" }, - { key: "jsdelivr" }, - { key: "unpkg" }, - { key: "module" }, - { key: "source" }, - { key: "jsnext:main" }, - { key: "browser" }, - { key: "react-native" }, - { key: "types" }, - { key: "typesVersions" }, - { key: "typings" }, - { key: "style" }, - { key: "example" }, - { key: "examplestyle" }, - { key: "assets" }, - { key: "bin", over: sortObject }, - { key: "man" }, - { key: "directories", over: sortDirectories }, - { key: "files", over: uniq }, - { key: "workspaces" }, - // node-pre-gyp https://www.npmjs.com/package/node-pre-gyp#1-add-new-entries-to-your-packagejson - { - key: "binary", - over: sortObjectBy([ - "module_name", - "module_path", - "remote_path", - "package_name", - "host" - ]) - }, - { key: "scripts", over: sortScripts }, - { key: "betterScripts", over: sortScripts }, - /* vscode */ - { key: "contributes", over: sortObject }, - /* vscode */ - { key: "activationEvents", over: uniq }, - { key: "husky", over: overProperty("hooks", sortGitHooks) }, - { key: "simple-git-hooks", over: sortGitHooks }, - { key: "pre-commit" }, - { key: "commitlint", over: sortObject }, - { key: "lint-staged" }, - { key: "config", over: sortObject }, - { key: "nodemonConfig", over: sortObject }, - { key: "browserify", over: sortObject }, - { key: "babel", over: sortObject }, - { key: "browserslist" }, - { key: "xo", over: sortObject }, - { key: "prettier", over: sortPrettierConfig }, - { key: "eslintConfig", over: sortEslintConfig }, - { key: "eslintIgnore" }, - { key: "npmpkgjsonlint", over: sortObject }, - { key: "npmPackageJsonLintConfig", over: sortObject }, - { key: "npmpackagejsonlint", over: sortObject }, - { key: "release", over: sortObject }, - { key: "remarkConfig", over: sortObject }, - { key: "stylelint" }, - { key: "ava", over: sortObject }, - { key: "jest", over: sortObject }, - { key: "jest-junit", over: sortObject }, - { key: "jest-stare", over: sortObject }, - { key: "mocha", over: sortObject }, - { key: "nyc", over: sortObject }, - { key: "c8", over: sortObject }, - { key: "tap", over: sortObject }, - { key: "resolutions", over: sortObject }, - { key: "dependencies", over: sortObject }, - { key: "devDependencies", over: sortObject }, - { key: "dependenciesMeta", over: sortObjectBy(void 0, true) }, - { key: "peerDependencies", over: sortObject }, - // TODO: only sort depth = 2 - { key: "peerDependenciesMeta", over: sortObjectBy(void 0, true) }, - { key: "optionalDependencies", over: sortObject }, - { key: "bundledDependencies", over: uniqAndSortArray }, - { key: "bundleDependencies", over: uniqAndSortArray }, - /* vscode */ - { key: "extensionPack", over: uniqAndSortArray }, - /* vscode */ - { key: "extensionDependencies", over: uniqAndSortArray }, - { key: "flat" }, - { key: "packageManager" }, - { key: "engines", over: sortObject }, - { key: "engineStrict", over: sortObject }, - { key: "volta", over: sortVolta }, - { key: "languageName" }, - { key: "os" }, - { key: "cpu" }, - { key: "preferGlobal", over: sortObject }, - { key: "publishConfig", over: sortObject }, - /* vscode */ - { key: "icon" }, - /* vscode */ - { - key: "badges", - over: onArray((badge) => badge.map(sortVSCodeBadgeObject)) - }, - /* vscode */ - { key: "galleryBanner", over: sortObject }, - /* vscode */ - { key: "preview" }, - /* vscode */ - { key: "markdown" } - ]; - defaultSortOrder = fields.map(({ key }) => key); - overFields = pipe( - fields.map(({ key, over }) => over ? overProperty(key, over) : void 0).filter(Boolean) - ); - isPrivateKey = (key) => key[0] === "_"; - partition = (array, predicate) => array.reduce( - (result, value) => { - result[predicate(value) ? 0 : 1].push(value); - return result; - }, - [[], []] - ); - sort_package_json_default = sortPackageJson; - } -}); - -// ../core/dist/package.js -import { resolve as resolve2 } from "path"; -async function hasPackage({ directory }) { - return isReadableAndWritableFile({ path: resolve2(directory, FILENAME2) }); -} -async function readPackage({ directory }) { - return readJson({ path: resolve2(directory, FILENAME2) }); -} -async function writePackage({ directory, data, append = true }) { - await writeJson({ path: resolve2(directory, FILENAME2), data, append }); - await sortPackage({ directory }); -} -async function updatePackage({ directory, merge }) { - await updateJson({ path: resolve2(directory, FILENAME2), merge }); - await sortPackage({ directory }); -} -async function sortPackage({ directory }) { - debug(`sorting "package.json" in "${directory}"`); - await updateJson({ - path: resolve2(directory, FILENAME2), - merge: sort_package_json_default - }); -} -var FILENAME2; -var init_package = __esm({ - "../core/dist/package.js"() { - "use strict"; - init_sort_package_json(); - init_file(); - init_io(); - init_json(); - FILENAME2 = "package.json"; - } -}); - -// ../../node_modules/lru-cache/index.js -var require_lru_cache = __commonJS({ - "../../node_modules/lru-cache/index.js"(exports, module) { - var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date; - var hasAbortController = typeof AbortController === "function"; - var AC = hasAbortController ? AbortController : class AbortController { - constructor() { - this.signal = new AS(); - } - abort() { - this.signal.dispatchEvent("abort"); - } - }; - var hasAbortSignal = typeof AbortSignal === "function"; - var hasACAbortSignal = typeof AC.AbortSignal === "function"; - var AS = hasAbortSignal ? AbortSignal : hasACAbortSignal ? AC.AbortController : class AbortSignal { - constructor() { - this.aborted = false; - this._listeners = []; - } - dispatchEvent(type) { - if (type === "abort") { - this.aborted = true; - const e = { type, target: this }; - this.onabort(e); - this._listeners.forEach((f) => f(e), this); - } - } - onabort() { - } - addEventListener(ev, fn) { - if (ev === "abort") { - this._listeners.push(fn); - } - } - removeEventListener(ev, fn) { - if (ev === "abort") { - this._listeners = this._listeners.filter((f) => f !== fn); - } - } - }; - var warned = /* @__PURE__ */ new Set(); - var deprecatedOption = (opt, instead) => { - const code = `LRU_CACHE_OPTION_${opt}`; - if (shouldWarn(code)) { - warn(code, `${opt} option`, `options.${instead}`, LRUCache); - } - }; - var deprecatedMethod = (method, instead) => { - const code = `LRU_CACHE_METHOD_${method}`; - if (shouldWarn(code)) { - const { prototype } = LRUCache; - const { get } = Object.getOwnPropertyDescriptor(prototype, method); - warn(code, `${method} method`, `cache.${instead}()`, get); - } - }; - var deprecatedProperty = (field, instead) => { - const code = `LRU_CACHE_PROPERTY_${field}`; - if (shouldWarn(code)) { - const { prototype } = LRUCache; - const { get } = Object.getOwnPropertyDescriptor(prototype, field); - warn(code, `${field} property`, `cache.${instead}`, get); - } - }; - var emitWarning = (...a) => { - typeof process === "object" && process && typeof process.emitWarning === "function" ? process.emitWarning(...a) : console.error(...a); - }; - var shouldWarn = (code) => !warned.has(code); - var warn = (code, what, instead, fn) => { - warned.add(code); - const msg = `The ${what} is deprecated. Please use ${instead} instead.`; - emitWarning(msg, "DeprecationWarning", code, fn); - }; - var isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); - var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; - var ZeroArray = class extends Array { - constructor(size) { - super(size); - this.fill(0); - } - }; - var Stack = class { - constructor(max) { - if (max === 0) { - return []; - } - const UintArray = getUintArray(max); - this.heap = new UintArray(max); - this.length = 0; - } - push(n) { - this.heap[this.length++] = n; - } - pop() { - return this.heap[--this.length]; - } - }; - var LRUCache = class { - constructor(options = {}) { - const { - max = 0, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - updateAgeOnHas, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize = 0, - maxEntrySize = 0, - sizeCalculation, - fetchMethod, - fetchContext, - noDeleteOnFetchRejection, - noDeleteOnStaleGet - } = options; - const { length, maxAge, stale } = options instanceof LRUCache ? {} : options; - if (max !== 0 && !isPosInt(max)) { - throw new TypeError("max option must be a nonnegative integer"); - } - const UintArray = max ? getUintArray(max) : Array; - if (!UintArray) { - throw new Error("invalid max value: " + max); - } - this.max = max; - this.maxSize = maxSize; - this.maxEntrySize = maxEntrySize || this.maxSize; - this.sizeCalculation = sizeCalculation || length; - if (this.sizeCalculation) { - if (!this.maxSize && !this.maxEntrySize) { - throw new TypeError( - "cannot set sizeCalculation without setting maxSize or maxEntrySize" - ); - } - if (typeof this.sizeCalculation !== "function") { - throw new TypeError("sizeCalculation set to non-function"); - } - } - this.fetchMethod = fetchMethod || null; - if (this.fetchMethod && typeof this.fetchMethod !== "function") { - throw new TypeError( - "fetchMethod must be a function if specified" - ); - } - this.fetchContext = fetchContext; - if (!this.fetchMethod && fetchContext !== void 0) { - throw new TypeError( - "cannot set fetchContext without fetchMethod" - ); - } - this.keyMap = /* @__PURE__ */ new Map(); - this.keyList = new Array(max).fill(null); - this.valList = new Array(max).fill(null); - this.next = new UintArray(max); - this.prev = new UintArray(max); - this.head = 0; - this.tail = 0; - this.free = new Stack(max); - this.initialFill = 1; - this.size = 0; - if (typeof dispose === "function") { - this.dispose = dispose; - } - if (typeof disposeAfter === "function") { - this.disposeAfter = disposeAfter; - this.disposed = []; - } else { - this.disposeAfter = null; - this.disposed = null; - } - this.noDisposeOnSet = !!noDisposeOnSet; - this.noUpdateTTL = !!noUpdateTTL; - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; - if (this.maxEntrySize !== 0) { - if (this.maxSize !== 0) { - if (!isPosInt(this.maxSize)) { - throw new TypeError( - "maxSize must be a positive integer if specified" - ); - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError( - "maxEntrySize must be a positive integer if specified" - ); - } - this.initializeSizeTracking(); - } - this.allowStale = !!allowStale || !!stale; - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; - this.updateAgeOnGet = !!updateAgeOnGet; - this.updateAgeOnHas = !!updateAgeOnHas; - this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; - this.ttlAutopurge = !!ttlAutopurge; - this.ttl = ttl || maxAge || 0; - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError( - "ttl must be a positive integer if specified" - ); - } - this.initializeTTLTracking(); - } - if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { - throw new TypeError( - "At least one of max, maxSize, or ttl is required" - ); - } - if (!this.ttlAutopurge && !this.max && !this.maxSize) { - const code = "LRU_CACHE_UNBOUNDED"; - if (shouldWarn(code)) { - warned.add(code); - const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption."; - emitWarning(msg, "UnboundedCacheWarning", code, LRUCache); - } - } - if (stale) { - deprecatedOption("stale", "allowStale"); - } - if (maxAge) { - deprecatedOption("maxAge", "ttl"); - } - if (length) { - deprecatedOption("length", "sizeCalculation"); - } - } - getRemainingTTL(key) { - return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0; - } - initializeTTLTracking() { - this.ttls = new ZeroArray(this.max); - this.starts = new ZeroArray(this.max); - this.setItemTTL = (index, ttl, start = perf.now()) => { - this.starts[index] = ttl !== 0 ? start : 0; - this.ttls[index] = ttl; - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.isStale(index)) { - this.delete(this.keyList[index]); - } - }, ttl + 1); - if (t.unref) { - t.unref(); - } - } - }; - this.updateItemAge = (index) => { - this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0; - }; - let cachedNow = 0; - const getNow = () => { - const n = perf.now(); - if (this.ttlResolution > 0) { - cachedNow = n; - const t = setTimeout( - () => cachedNow = 0, - this.ttlResolution - ); - if (t.unref) { - t.unref(); - } - } - return n; - }; - this.getRemainingTTL = (key) => { - const index = this.keyMap.get(key); - if (index === void 0) { - return 0; - } - return this.ttls[index] === 0 || this.starts[index] === 0 ? Infinity : this.starts[index] + this.ttls[index] - (cachedNow || getNow()); - }; - this.isStale = (index) => { - return this.ttls[index] !== 0 && this.starts[index] !== 0 && (cachedNow || getNow()) - this.starts[index] > this.ttls[index]; - }; - } - updateItemAge(index) { - } - setItemTTL(index, ttl, start) { - } - isStale(index) { - return false; - } - initializeSizeTracking() { - this.calculatedSize = 0; - this.sizes = new ZeroArray(this.max); - this.removeItemSize = (index) => { - this.calculatedSize -= this.sizes[index]; - this.sizes[index] = 0; - }; - this.requireSize = (k, v, size, sizeCalculation) => { - if (this.isBackgroundFetch(v)) { - return 0; - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== "function") { - throw new TypeError("sizeCalculation must be a function"); - } - size = sizeCalculation(v, k); - if (!isPosInt(size)) { - throw new TypeError( - "sizeCalculation return invalid (expect positive integer)" - ); - } - } else { - throw new TypeError( - "invalid size value (must be positive integer)" - ); - } - } - return size; - }; - this.addItemSize = (index, size) => { - this.sizes[index] = size; - if (this.maxSize) { - const maxSize = this.maxSize - this.sizes[index]; - while (this.calculatedSize > maxSize) { - this.evict(true); - } - } - this.calculatedSize += this.sizes[index]; - }; - } - removeItemSize(index) { - } - addItemSize(index, size) { - } - requireSize(k, v, size, sizeCalculation) { - if (size || sizeCalculation) { - throw new TypeError( - "cannot set size without setting maxSize or maxEntrySize on cache" - ); - } - } - *indexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.tail; true; ) { - if (!this.isValidIndex(i)) { - break; - } - if (allowStale || !this.isStale(i)) { - yield i; - } - if (i === this.head) { - break; - } else { - i = this.prev[i]; - } - } - } - } - *rindexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.head; true; ) { - if (!this.isValidIndex(i)) { - break; - } - if (allowStale || !this.isStale(i)) { - yield i; - } - if (i === this.tail) { - break; - } else { - i = this.next[i]; - } - } - } - } - isValidIndex(index) { - return this.keyMap.get(this.keyList[index]) === index; - } - *entries() { - for (const i of this.indexes()) { - yield [this.keyList[i], this.valList[i]]; - } - } - *rentries() { - for (const i of this.rindexes()) { - yield [this.keyList[i], this.valList[i]]; - } - } - *keys() { - for (const i of this.indexes()) { - yield this.keyList[i]; - } - } - *rkeys() { - for (const i of this.rindexes()) { - yield this.keyList[i]; - } - } - *values() { - for (const i of this.indexes()) { - yield this.valList[i]; - } - } - *rvalues() { - for (const i of this.rindexes()) { - yield this.valList[i]; - } - } - [Symbol.iterator]() { - return this.entries(); - } - find(fn, getOptions = {}) { - for (const i of this.indexes()) { - if (fn(this.valList[i], this.keyList[i], this)) { - return this.get(this.keyList[i], getOptions); - } - } - } - forEach(fn, thisp = this) { - for (const i of this.indexes()) { - fn.call(thisp, this.valList[i], this.keyList[i], this); - } - } - rforEach(fn, thisp = this) { - for (const i of this.rindexes()) { - fn.call(thisp, this.valList[i], this.keyList[i], this); - } - } - get prune() { - deprecatedMethod("prune", "purgeStale"); - return this.purgeStale; - } - purgeStale() { - let deleted = false; - for (const i of this.rindexes({ allowStale: true })) { - if (this.isStale(i)) { - this.delete(this.keyList[i]); - deleted = true; - } - } - return deleted; - } - dump() { - const arr = []; - for (const i of this.indexes({ allowStale: true })) { - const key = this.keyList[i]; - const v = this.valList[i]; - const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v; - const entry = { value }; - if (this.ttls) { - entry.ttl = this.ttls[i]; - const age = perf.now() - this.starts[i]; - entry.start = Math.floor(Date.now() - age); - } - if (this.sizes) { - entry.size = this.sizes[i]; - } - arr.unshift([key, entry]); - } - return arr; - } - load(arr) { - this.clear(); - for (const [key, entry] of arr) { - if (entry.start) { - const age = Date.now() - entry.start; - entry.start = perf.now() - age; - } - this.set(key, entry.value, entry); - } - } - dispose(v, k, reason) { - } - set(k, v, { - ttl = this.ttl, - start, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL - } = {}) { - size = this.requireSize(k, v, size, sizeCalculation); - if (this.maxEntrySize && size > this.maxEntrySize) { - this.delete(k); - return this; - } - let index = this.size === 0 ? void 0 : this.keyMap.get(k); - if (index === void 0) { - index = this.newIndex(); - this.keyList[index] = k; - this.valList[index] = v; - this.keyMap.set(k, index); - this.next[this.tail] = index; - this.prev[index] = this.tail; - this.tail = index; - this.size++; - this.addItemSize(index, size); - noUpdateTTL = false; - } else { - const oldVal = this.valList[index]; - if (v !== oldVal) { - if (this.isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort(); - } else { - if (!noDisposeOnSet) { - this.dispose(oldVal, k, "set"); - if (this.disposeAfter) { - this.disposed.push([oldVal, k, "set"]); - } - } - } - this.removeItemSize(index); - this.valList[index] = v; - this.addItemSize(index, size); - } - this.moveToTail(index); - } - if (ttl !== 0 && this.ttl === 0 && !this.ttls) { - this.initializeTTLTracking(); - } - if (!noUpdateTTL) { - this.setItemTTL(index, ttl, start); - } - if (this.disposeAfter) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()); - } - } - return this; - } - newIndex() { - if (this.size === 0) { - return this.tail; - } - if (this.size === this.max && this.max !== 0) { - return this.evict(false); - } - if (this.free.length !== 0) { - return this.free.pop(); - } - return this.initialFill++; - } - pop() { - if (this.size) { - const val = this.valList[this.head]; - this.evict(true); - return val; - } - } - evict(free) { - const head = this.head; - const k = this.keyList[head]; - const v = this.valList[head]; - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(); - } else { - this.dispose(v, k, "evict"); - if (this.disposeAfter) { - this.disposed.push([v, k, "evict"]); - } - } - this.removeItemSize(head); - if (free) { - this.keyList[head] = null; - this.valList[head] = null; - this.free.push(head); - } - this.head = this.next[head]; - this.keyMap.delete(k); - this.size--; - return head; - } - has(k, { updateAgeOnHas = this.updateAgeOnHas } = {}) { - const index = this.keyMap.get(k); - if (index !== void 0) { - if (!this.isStale(index)) { - if (updateAgeOnHas) { - this.updateItemAge(index); - } - return true; - } - } - return false; - } - // like get(), but without any LRU updating or TTL expiration - peek(k, { allowStale = this.allowStale } = {}) { - const index = this.keyMap.get(k); - if (index !== void 0 && (allowStale || !this.isStale(index))) { - const v = this.valList[index]; - return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v; - } - } - backgroundFetch(k, index, options, context) { - const v = index === void 0 ? void 0 : this.valList[index]; - if (this.isBackgroundFetch(v)) { - return v; - } - const ac = new AC(); - const fetchOpts = { - signal: ac.signal, - options, - context - }; - const cb = (v2) => { - if (!ac.signal.aborted) { - this.set(k, v2, fetchOpts.options); - } - return v2; - }; - const eb = (er) => { - if (this.valList[index] === p) { - const del = !options.noDeleteOnFetchRejection || p.__staleWhileFetching === void 0; - if (del) { - this.delete(k); - } else { - this.valList[index] = p.__staleWhileFetching; - } - } - if (p.__returned === p) { - throw er; - } - }; - const pcall = (res) => res(this.fetchMethod(k, v, fetchOpts)); - const p = new Promise(pcall).then(cb, eb); - p.__abortController = ac; - p.__staleWhileFetching = v; - p.__returned = null; - if (index === void 0) { - this.set(k, p, fetchOpts.options); - index = this.keyMap.get(k); - } else { - this.valList[index] = p; - } - return p; - } - isBackgroundFetch(p) { - return p && typeof p === "object" && typeof p.then === "function" && Object.prototype.hasOwnProperty.call( - p, - "__staleWhileFetching" - ) && Object.prototype.hasOwnProperty.call(p, "__returned") && (p.__returned === p || p.__returned === null); - } - // this takes the union of get() and set() opts, because it does both - async fetch(k, { - // get options - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, - fetchContext = this.fetchContext, - forceRefresh = false - } = {}) { - if (!this.fetchMethod) { - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet - }); - } - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection - }; - let index = this.keyMap.get(k); - if (index === void 0) { - const p = this.backgroundFetch(k, index, options, fetchContext); - return p.__returned = p; - } else { - const v = this.valList[index]; - if (this.isBackgroundFetch(v)) { - return allowStale && v.__staleWhileFetching !== void 0 ? v.__staleWhileFetching : v.__returned = v; - } - if (!forceRefresh && !this.isStale(index)) { - this.moveToTail(index); - if (updateAgeOnGet) { - this.updateItemAge(index); - } - return v; - } - const p = this.backgroundFetch(k, index, options, fetchContext); - return allowStale && p.__staleWhileFetching !== void 0 ? p.__staleWhileFetching : p.__returned = p; - } - } - get(k, { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet - } = {}) { - const index = this.keyMap.get(k); - if (index !== void 0) { - const value = this.valList[index]; - const fetching = this.isBackgroundFetch(value); - if (this.isStale(index)) { - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k); - } - return allowStale ? value : void 0; - } else { - return allowStale ? value.__staleWhileFetching : void 0; - } - } else { - if (fetching) { - return void 0; - } - this.moveToTail(index); - if (updateAgeOnGet) { - this.updateItemAge(index); - } - return value; - } - } - } - connect(p, n) { - this.prev[n] = p; - this.next[p] = n; - } - moveToTail(index) { - if (index !== this.tail) { - if (index === this.head) { - this.head = this.next[index]; - } else { - this.connect(this.prev[index], this.next[index]); - } - this.connect(this.tail, index); - this.tail = index; - } - } - get del() { - deprecatedMethod("del", "delete"); - return this.delete; - } - delete(k) { - let deleted = false; - if (this.size !== 0) { - const index = this.keyMap.get(k); - if (index !== void 0) { - deleted = true; - if (this.size === 1) { - this.clear(); - } else { - this.removeItemSize(index); - const v = this.valList[index]; - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(); - } else { - this.dispose(v, k, "delete"); - if (this.disposeAfter) { - this.disposed.push([v, k, "delete"]); - } - } - this.keyMap.delete(k); - this.keyList[index] = null; - this.valList[index] = null; - if (index === this.tail) { - this.tail = this.prev[index]; - } else if (index === this.head) { - this.head = this.next[index]; - } else { - this.next[this.prev[index]] = this.next[index]; - this.prev[this.next[index]] = this.prev[index]; - } - this.size--; - this.free.push(index); - } - } - } - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()); - } - } - return deleted; - } - clear() { - for (const index of this.rindexes({ allowStale: true })) { - const v = this.valList[index]; - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(); - } else { - const k = this.keyList[index]; - this.dispose(v, k, "delete"); - if (this.disposeAfter) { - this.disposed.push([v, k, "delete"]); - } - } - } - this.keyMap.clear(); - this.valList.fill(null); - this.keyList.fill(null); - if (this.ttls) { - this.ttls.fill(0); - this.starts.fill(0); - } - if (this.sizes) { - this.sizes.fill(0); - } - this.head = 0; - this.tail = 0; - this.initialFill = 1; - this.free.length = 0; - this.calculatedSize = 0; - this.size = 0; - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()); - } - } - } - get reset() { - deprecatedMethod("reset", "clear"); - return this.clear; - } - get length() { - deprecatedProperty("length", "size"); - return this.size; - } - static get AbortController() { - return AC; - } - static get AbortSignal() { - return AS; - } - }; - module.exports = LRUCache; - } -}); - -// ../../node_modules/hosted-git-info/lib/hosts.js -var require_hosts = __commonJS({ - "../../node_modules/hosted-git-info/lib/hosts.js"(exports, module) { - "use strict"; - var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : ""; - var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : ""; - var formatHashFragment = (f) => f.toLowerCase().replace(/^\W+|\/|\W+$/g, "").replace(/\W+/g, "-"); - var defaults = { - sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`, - sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, - edittemplate: ({ domain, user, project, committish, editpath, path: path5 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path5)}`, - browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`, - browsetreetemplate: ({ domain, user, project, committish, treepath, path: path5, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path5}${maybeJoin("#", hashformat(fragment || ""))}`, - browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path5, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path5}${maybeJoin("#", hashformat(fragment || ""))}`, - docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`, - httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, - filetemplate: ({ domain, user, project, committish, path: path5 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path5}`, - shortcuttemplate: ({ type, user, project, committish }) => `${type}:${user}/${project}${maybeJoin("#", committish)}`, - pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`, - bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`, - hashformat: formatHashFragment - }; - var hosts = {}; - hosts.github = { - // First two are insecure and generally shouldn't be used any more, but - // they are still supported. - protocols: ["git:", "http:", "git+ssh:", "git+https:", "ssh:", "https:"], - domain: "github.com", - treepath: "tree", - blobpath: "blob", - editpath: "edit", - filetemplate: ({ auth, user, project, committish, path: path5 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path5}`, - gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, - tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`, - extract: (url) => { - let [, user, project, type, committish] = url.pathname.split("/", 5); - if (type && type !== "tree") { - return; - } - if (!type) { - committish = url.hash.slice(1); - } - if (project && project.endsWith(".git")) { - project = project.slice(0, -4); - } - if (!user || !project) { - return; - } - return { user, project, committish }; - } - }; - hosts.bitbucket = { - protocols: ["git+ssh:", "git+https:", "ssh:", "https:"], - domain: "bitbucket.org", - treepath: "src", - blobpath: "src", - editpath: "?mode=edit", - edittemplate: ({ domain, user, project, committish, treepath, path: path5, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path5, editpath)}`, - tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`, - extract: (url) => { - let [, user, project, aux] = url.pathname.split("/", 4); - if (["get"].includes(aux)) { - return; - } - if (project && project.endsWith(".git")) { - project = project.slice(0, -4); - } - if (!user || !project) { - return; - } - return { user, project, committish: url.hash.slice(1) }; - } - }; - hosts.gitlab = { - protocols: ["git+ssh:", "git+https:", "ssh:", "https:"], - domain: "gitlab.com", - treepath: "tree", - blobpath: "tree", - editpath: "-/edit", - httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, - tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`, - extract: (url) => { - const path5 = url.pathname.slice(1); - if (path5.includes("/-/") || path5.includes("/archive.tar.gz")) { - return; - } - const segments = path5.split("/"); - let project = segments.pop(); - if (project.endsWith(".git")) { - project = project.slice(0, -4); - } - const user = segments.join("/"); - if (!user || !project) { - return; - } - return { user, project, committish: url.hash.slice(1) }; - } - }; - hosts.gist = { - protocols: ["git:", "git+ssh:", "git+https:", "ssh:", "https:"], - domain: "gist.github.com", - editpath: "edit", - sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin("#", committish)}`, - sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`, - edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`, - browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`, - browsetreetemplate: ({ domain, project, committish, path: path5, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path5))}`, - browseblobtemplate: ({ domain, project, committish, path: path5, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path5))}`, - docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`, - httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`, - filetemplate: ({ user, project, committish, path: path5 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path5}`, - shortcuttemplate: ({ type, project, committish }) => `${type}:${project}${maybeJoin("#", committish)}`, - pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`, - bugstemplate: ({ domain, project }) => `https://${domain}/${project}`, - gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin("#", committish)}`, - tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`, - extract: (url) => { - let [, user, project, aux] = url.pathname.split("/", 4); - if (aux === "raw") { - return; - } - if (!project) { - if (!user) { - return; - } - project = user; - user = null; - } - if (project.endsWith(".git")) { - project = project.slice(0, -4); - } - return { user, project, committish: url.hash.slice(1) }; - }, - hashformat: function(fragment) { - return fragment && "file-" + formatHashFragment(fragment); - } - }; - hosts.sourcehut = { - protocols: ["git+ssh:", "https:"], - domain: "git.sr.ht", - treepath: "tree", - blobpath: "tree", - filetemplate: ({ domain, user, project, committish, path: path5 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path5}`, - httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, - tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`, - bugstemplate: ({ user, project }) => `https://todo.sr.ht/${user}/${project}`, - extract: (url) => { - let [, user, project, aux] = url.pathname.split("/", 4); - if (["archive"].includes(aux)) { - return; - } - if (project && project.endsWith(".git")) { - project = project.slice(0, -4); - } - if (!user || !project) { - return; - } - return { user, project, committish: url.hash.slice(1) }; - } - }; - for (const [name, host] of Object.entries(hosts)) { - hosts[name] = Object.assign({}, defaults, host); - } - module.exports = hosts; - } -}); - -// ../../node_modules/hosted-git-info/lib/parse-url.js -var require_parse_url = __commonJS({ - "../../node_modules/hosted-git-info/lib/parse-url.js"(exports, module) { - var url = __require("url"); - var lastIndexOfBefore = (str, char, beforeChar) => { - const startPosition = str.indexOf(beforeChar); - return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity); - }; - var safeUrl = (u) => { - try { - return new url.URL(u); - } catch { - } - }; - var correctProtocol = (arg, protocols) => { - const firstColon = arg.indexOf(":"); - const proto4 = arg.slice(0, firstColon + 1); - if (Object.prototype.hasOwnProperty.call(protocols, proto4)) { - return arg; - } - const firstAt = arg.indexOf("@"); - if (firstAt > -1) { - if (firstAt > firstColon) { - return `git+ssh://${arg}`; - } else { - return arg; - } - } - const doubleSlash = arg.indexOf("//"); - if (doubleSlash === firstColon + 1) { - return arg; - } - return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`; - }; - var correctUrl = (giturl) => { - const firstAt = lastIndexOfBefore(giturl, "@", "#"); - const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#"); - if (lastColonBeforeHash > firstAt) { - giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1); - } - if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) { - giturl = `git+ssh://${giturl}`; - } - return giturl; - }; - module.exports = (giturl, protocols) => { - const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl; - return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol)); - }; - } -}); - -// ../../node_modules/hosted-git-info/lib/from-url.js -var require_from_url = __commonJS({ - "../../node_modules/hosted-git-info/lib/from-url.js"(exports, module) { - "use strict"; - var parseUrl = require_parse_url(); - var isGitHubShorthand = (arg) => { - const firstHash = arg.indexOf("#"); - const firstSlash = arg.indexOf("/"); - const secondSlash = arg.indexOf("/", firstSlash + 1); - const firstColon = arg.indexOf(":"); - const firstSpace = /\s/.exec(arg); - const firstAt = arg.indexOf("@"); - const spaceOnlyAfterHash = !firstSpace || firstHash > -1 && firstSpace.index > firstHash; - const atOnlyAfterHash = firstAt === -1 || firstHash > -1 && firstAt > firstHash; - const colonOnlyAfterHash = firstColon === -1 || firstHash > -1 && firstColon > firstHash; - const secondSlashOnlyAfterHash = secondSlash === -1 || firstHash > -1 && secondSlash > firstHash; - const hasSlash = firstSlash > 0; - const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== "/" : !arg.endsWith("/"); - const doesNotStartWithDot = !arg.startsWith("."); - return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash; - }; - module.exports = (giturl, opts, { gitHosts, protocols }) => { - if (!giturl) { - return; - } - const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl; - const parsed = parseUrl(correctedUrl, protocols); - if (!parsed) { - return; - } - const gitHostShortcut = gitHosts.byShortcut[parsed.protocol]; - const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith("www.") ? parsed.hostname.slice(4) : parsed.hostname]; - const gitHostName = gitHostShortcut || gitHostDomain; - if (!gitHostName) { - return; - } - const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain]; - let auth = null; - if (protocols[parsed.protocol]?.auth && (parsed.username || parsed.password)) { - auth = `${parsed.username}${parsed.password ? ":" + parsed.password : ""}`; - } - let committish = null; - let user = null; - let project = null; - let defaultRepresentation = null; - try { - if (gitHostShortcut) { - let pathname = parsed.pathname.startsWith("/") ? parsed.pathname.slice(1) : parsed.pathname; - const firstAt = pathname.indexOf("@"); - if (firstAt > -1) { - pathname = pathname.slice(firstAt + 1); - } - const lastSlash = pathname.lastIndexOf("/"); - if (lastSlash > -1) { - user = decodeURIComponent(pathname.slice(0, lastSlash)); - if (!user) { - user = null; - } - project = decodeURIComponent(pathname.slice(lastSlash + 1)); - } else { - project = decodeURIComponent(pathname); - } - if (project.endsWith(".git")) { - project = project.slice(0, -4); - } - if (parsed.hash) { - committish = decodeURIComponent(parsed.hash.slice(1)); - } - defaultRepresentation = "shortcut"; - } else { - if (!gitHostInfo.protocols.includes(parsed.protocol)) { - return; - } - const segments = gitHostInfo.extract(parsed); - if (!segments) { - return; - } - user = segments.user && decodeURIComponent(segments.user); - project = decodeURIComponent(segments.project); - committish = decodeURIComponent(segments.committish); - defaultRepresentation = protocols[parsed.protocol]?.name || parsed.protocol.slice(0, -1); - } - } catch (err) { - if (err instanceof URIError) { - return; - } else { - throw err; - } - } - return [gitHostName, user, auth, project, committish, defaultRepresentation, opts]; - }; - } -}); - -// ../../node_modules/hosted-git-info/lib/index.js -var require_lib2 = __commonJS({ - "../../node_modules/hosted-git-info/lib/index.js"(exports, module) { - "use strict"; - var LRU = require_lru_cache(); - var hosts = require_hosts(); - var fromUrl = require_from_url(); - var parseUrl = require_parse_url(); - var cache = new LRU({ max: 1e3 }); - var _gitHosts, _protocols, _fill, fill_fn; - var _GitHost = class { - constructor(type, user, auth, project, committish, defaultRepresentation, opts = {}) { - __privateAdd(this, _fill); - Object.assign(this, __privateGet(_GitHost, _gitHosts)[type], { - type, - user, - auth, - project, - committish, - default: defaultRepresentation, - opts - }); - } - static addHost(name, host) { - __privateGet(_GitHost, _gitHosts)[name] = host; - __privateGet(_GitHost, _gitHosts).byDomain[host.domain] = name; - __privateGet(_GitHost, _gitHosts).byShortcut[`${name}:`] = name; - __privateGet(_GitHost, _protocols)[`${name}:`] = { name }; - } - static fromUrl(giturl, opts) { - if (typeof giturl !== "string") { - return; - } - const key = giturl + JSON.stringify(opts || {}); - if (!cache.has(key)) { - const hostArgs = fromUrl(giturl, opts, { - gitHosts: __privateGet(_GitHost, _gitHosts), - protocols: __privateGet(_GitHost, _protocols) - }); - cache.set(key, hostArgs ? new _GitHost(...hostArgs) : void 0); - } - return cache.get(key); - } - static parseUrl(url) { - return parseUrl(url); - } - hash() { - return this.committish ? `#${this.committish}` : ""; - } - ssh(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.sshtemplate, opts); - } - sshurl(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.sshurltemplate, opts); - } - browse(path5, ...args) { - if (typeof path5 !== "string") { - return __privateMethod(this, _fill, fill_fn).call(this, this.browsetemplate, path5); - } - if (typeof args[0] !== "string") { - return __privateMethod(this, _fill, fill_fn).call(this, this.browsetreetemplate, { ...args[0], path: path5 }); - } - return __privateMethod(this, _fill, fill_fn).call(this, this.browsetreetemplate, { ...args[1], fragment: args[0], path: path5 }); - } - // If the path is known to be a file, then browseFile should be used. For some hosts - // the url is the same as browse, but for others like GitHub a file can use both `/tree/` - // and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/` - // path will redirect to a specific commit. Using the `/blob/` path avoids this and - // does not redirect to a different commit. - browseFile(path5, ...args) { - if (typeof args[0] !== "string") { - return __privateMethod(this, _fill, fill_fn).call(this, this.browseblobtemplate, { ...args[0], path: path5 }); - } - return __privateMethod(this, _fill, fill_fn).call(this, this.browseblobtemplate, { ...args[1], fragment: args[0], path: path5 }); - } - docs(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.docstemplate, opts); - } - bugs(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.bugstemplate, opts); - } - https(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.httpstemplate, opts); - } - git(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.gittemplate, opts); - } - shortcut(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.shortcuttemplate, opts); - } - path(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.pathtemplate, opts); - } - tarball(opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.tarballtemplate, { ...opts, noCommittish: false }); - } - file(path5, opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.filetemplate, { ...opts, path: path5 }); - } - edit(path5, opts) { - return __privateMethod(this, _fill, fill_fn).call(this, this.edittemplate, { ...opts, path: path5 }); - } - getDefaultRepresentation() { - return this.default; - } - toString(opts) { - if (this.default && typeof this[this.default] === "function") { - return this[this.default](opts); - } - return this.sshurl(opts); - } - }; - var GitHost = _GitHost; - _gitHosts = new WeakMap(); - _protocols = new WeakMap(); - _fill = new WeakSet(); - fill_fn = function(template, opts) { - if (typeof template !== "function") { - return null; - } - const options = { ...this, ...this.opts, ...opts }; - if (!options.path) { - options.path = ""; - } - if (options.path.startsWith("/")) { - options.path = options.path.slice(1); - } - if (options.noCommittish) { - options.committish = null; - } - const result = template(options); - return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result; - }; - __privateAdd(GitHost, _gitHosts, { byShortcut: {}, byDomain: {} }); - __privateAdd(GitHost, _protocols, { - "git+ssh:": { name: "sshurl" }, - "ssh:": { name: "sshurl" }, - "git+https:": { name: "https", auth: true }, - "git:": { auth: true }, - "http:": { auth: true }, - "https:": { auth: true }, - "git+http:": { auth: true } - }); - for (const [name, host] of Object.entries(hosts)) { - GitHost.addHost(name, host); - } - module.exports = GitHost; - } -}); - -// ../../node_modules/@ovyerus/licenses/spdx-simple.json -var require_spdx_simple = __commonJS({ - "../../node_modules/@ovyerus/licenses/spdx-simple.json"(exports, module) { - module.exports = [ - "0BSD", - "AAL", - "ADSL", - "AFL-1.1", - "AFL-1.2", - "AFL-2.0", - "AFL-2.1", - "AFL-3.0", - "AGPL-1.0", - "AGPL-1.0-only", - "AGPL-1.0-or-later", - "AGPL-3.0", - "AGPL-3.0-only", - "AGPL-3.0-or-later", - "AMDPLPA", - "AML", - "AMPAS", - "ANTLR-PD", - "APAFML", - "APL-1.0", - "APSL-1.0", - "APSL-1.1", - "APSL-1.2", - "APSL-2.0", - "Abstyles", - "Adobe-2006", - "Adobe-Glyph", - "Afmparse", - "Aladdin", - "Apache-1.0", - "Apache-1.1", - "Apache-2.0", - "Artistic-1.0", - "Artistic-1.0-Perl", - "Artistic-1.0-cl8", - "Artistic-2.0", - "BSD-1-Clause", - "BSD-2-Clause", - "BSD-2-Clause-FreeBSD", - "BSD-2-Clause-NetBSD", - "BSD-2-Clause-Patent", - "BSD-3-Clause", - "BSD-3-Clause-Attribution", - "BSD-3-Clause-Clear", - "BSD-3-Clause-LBNL", - "BSD-3-Clause-No-Nuclear-License", - "BSD-3-Clause-No-Nuclear-License-2014", - "BSD-3-Clause-No-Nuclear-Warranty", - "BSD-3-Clause-Open-MPI", - "BSD-4-Clause", - "BSD-4-Clause-UC", - "BSD-Protection", - "BSD-Source-Code", - "BSL-1.0", - "Bahyph", - "Barr", - "Beerware", - "BitTorrent-1.0", - "BitTorrent-1.1", - "BlueOak-1.0.0", - "Borceux", - "CATOSL-1.1", - "CC-BY-1.0", - "CC-BY-2.0", - "CC-BY-2.5", - "CC-BY-3.0", - "CC-BY-4.0", - "CC-BY-NC-1.0", - "CC-BY-NC-2.0", - "CC-BY-NC-2.5", - "CC-BY-NC-3.0", - "CC-BY-NC-4.0", - "CC-BY-NC-ND-1.0", - "CC-BY-NC-ND-2.0", - "CC-BY-NC-ND-2.5", - "CC-BY-NC-ND-3.0", - "CC-BY-NC-ND-4.0", - "CC-BY-NC-SA-1.0", - "CC-BY-NC-SA-2.0", - "CC-BY-NC-SA-2.5", - "CC-BY-NC-SA-3.0", - "CC-BY-NC-SA-4.0", - "CC-BY-ND-1.0", - "CC-BY-ND-2.0", - "CC-BY-ND-2.5", - "CC-BY-ND-3.0", - "CC-BY-ND-4.0", - "CC-BY-SA-1.0", - "CC-BY-SA-2.0", - "CC-BY-SA-2.5", - "CC-BY-SA-3.0", - "CC-BY-SA-4.0", - "CC-PDDC", - "CC0-1.0", - "CDDL-1.0", - "CDDL-1.1", - "CDLA-Permissive-1.0", - "CDLA-Sharing-1.0", - "CECILL-1.0", - "CECILL-1.1", - "CECILL-2.0", - "CECILL-2.1", - "CECILL-B", - "CECILL-C", - "CERN-OHL-1.1", - "CERN-OHL-1.2", - "CNRI-Jython", - "CNRI-Python", - "CNRI-Python-GPL-Compatible", - "CPAL-1.0", - "CPL-1.0", - "CPOL-1.02", - "CUA-OPL-1.0", - "Caldera", - "ClArtistic", - "Condor-1.1", - "Crossword", - "CrystalStacker", - "Cube", - "D-FSL-1.0", - "DOC", - "DSDP", - "Dotseqn", - "ECL-1.0", - "ECL-2.0", - "EFL-1.0", - "EFL-2.0", - "EPL-1.0", - "EPL-2.0", - "EUDatagrid", - "EUPL-1.0", - "EUPL-1.1", - "EUPL-1.2", - "Entessa", - "ErlPL-1.1", - "Eurosym", - "FSFAP", - "FSFUL", - "FSFULLR", - "FTL", - "Fair", - "Frameworx-1.0", - "FreeImage", - "GFDL-1.1", - "GFDL-1.1-only", - "GFDL-1.1-or-later", - "GFDL-1.2", - "GFDL-1.2-only", - "GFDL-1.2-or-later", - "GFDL-1.3", - "GFDL-1.3-only", - "GFDL-1.3-or-later", - "GL2PS", - "GPL-1.0", - "GPL-1.0+", - "GPL-1.0-only", - "GPL-1.0-or-later", - "GPL-2.0", - "GPL-2.0+", - "GPL-2.0-only", - "GPL-2.0-or-later", - "GPL-2.0-with-GCC-exception", - "GPL-2.0-with-autoconf-exception", - "GPL-2.0-with-bison-exception", - "GPL-2.0-with-classpath-exception", - "GPL-2.0-with-font-exception", - "GPL-3.0", - "GPL-3.0+", - "GPL-3.0-only", - "GPL-3.0-or-later", - "GPL-3.0-with-GCC-exception", - "GPL-3.0-with-autoconf-exception", - "Giftware", - "Glide", - "Glulxe", - "HPND", - "HPND-sell-variant", - "HaskellReport", - "IBM-pibs", - "ICU", - "IJG", - "IPA", - "IPL-1.0", - "ISC", - "ImageMagick", - "Imlib2", - "Info-ZIP", - "Intel", - "Intel-ACPI", - "Interbase-1.0", - "JPNIC", - "JSON", - "JasPer-2.0", - "LAL-1.2", - "LAL-1.3", - "LGPL-2.0", - "LGPL-2.0+", - "LGPL-2.0-only", - "LGPL-2.0-or-later", - "LGPL-2.1", - "LGPL-2.1+", - "LGPL-2.1-only", - "LGPL-2.1-or-later", - "LGPL-3.0", - "LGPL-3.0+", - "LGPL-3.0-only", - "LGPL-3.0-or-later", - "LGPLLR", - "LPL-1.0", - "LPL-1.02", - "LPPL-1.0", - "LPPL-1.1", - "LPPL-1.2", - "LPPL-1.3a", - "LPPL-1.3c", - "Latex2e", - "Leptonica", - "LiLiQ-P-1.1", - "LiLiQ-R-1.1", - "LiLiQ-Rplus-1.1", - "Libpng", - "Linux-OpenIB", - "MIT", - "MIT-0", - "MIT-CMU", - "MIT-advertising", - "MIT-enna", - "MIT-feh", - "MITNFA", - "MPL-1.0", - "MPL-1.1", - "MPL-2.0", - "MPL-2.0-no-copyleft-exception", - "MS-PL", - "MS-RL", - "MTLL", - "MakeIndex", - "MirOS", - "Motosoto", - "MulanPSL-1.0", - "Multics", - "Mup", - "NASA-1.3", - "NBPL-1.0", - "NCSA", - "NGPL", - "NLOD-1.0", - "NLPL", - "NOSL", - "NPL-1.0", - "NPL-1.1", - "NPOSL-3.0", - "NRL", - "NTP", - "NTP-0", - "Naumen", - "Net-SNMP", - "NetCDF", - "Newsletr", - "Nokia", - "Noweb", - "Nunit", - "OCCT-PL", - "OCLC-2.0", - "ODC-By-1.0", - "ODbL-1.0", - "OFL-1.0", - "OFL-1.0-RFN", - "OFL-1.0-no-RFN", - "OFL-1.1", - "OFL-1.1-RFN", - "OFL-1.1-no-RFN", - "OGL-Canada-2.0", - "OGL-UK-1.0", - "OGL-UK-2.0", - "OGL-UK-3.0", - "OGTSL", - "OLDAP-1.1", - "OLDAP-1.2", - "OLDAP-1.3", - "OLDAP-1.4", - "OLDAP-2.0", - "OLDAP-2.0.1", - "OLDAP-2.1", - "OLDAP-2.2", - "OLDAP-2.2.1", - "OLDAP-2.2.2", - "OLDAP-2.3", - "OLDAP-2.4", - "OLDAP-2.5", - "OLDAP-2.6", - "OLDAP-2.7", - "OLDAP-2.8", - "OML", - "OPL-1.0", - "OSET-PL-2.1", - "OSL-1.0", - "OSL-1.1", - "OSL-2.0", - "OSL-2.1", - "OSL-3.0", - "OpenSSL", - "PDDL-1.0", - "PHP-3.0", - "PHP-3.01", - "PSF-2.0", - "Parity-6.0.0", - "Plexus", - "PostgreSQL", - "Python-2.0", - "QPL-1.0", - "Qhull", - "RHeCos-1.1", - "RPL-1.1", - "RPL-1.5", - "RPSL-1.0", - "RSA-MD", - "RSCPL", - "Rdisc", - "Ruby", - "SAX-PD", - "SCEA", - "SGI-B-1.0", - "SGI-B-1.1", - "SGI-B-2.0", - "SHL-0.5", - "SHL-0.51", - "SISSL", - "SISSL-1.2", - "SMLNJ", - "SMPPL", - "SNIA", - "SPL-1.0", - "SSH-OpenSSH", - "SSH-short", - "SSPL-1.0", - "SWL", - "Saxpath", - "Sendmail", - "Sendmail-8.23", - "SimPL-2.0", - "Sleepycat", - "Spencer-86", - "Spencer-94", - "Spencer-99", - "StandardML-NJ", - "SugarCRM-1.1.3", - "TAPR-OHL-1.0", - "TCL", - "TCP-wrappers", - "TMate", - "TORQUE-1.1", - "TOSL", - "TU-Berlin-1.0", - "TU-Berlin-2.0", - "UCL-1.0", - "UPL-1.0", - "Unicode-DFS-2015", - "Unicode-DFS-2016", - "Unicode-TOU", - "Unlicense", - "VOSTROM", - "VSL-1.0", - "Vim", - "W3C", - "W3C-19980720", - "W3C-20150513", - "WTFPL", - "Watcom-1.0", - "Wsuipa", - "X11", - "XFree86-1.1", - "XSkat", - "Xerox", - "Xnet", - "YPL-1.0", - "YPL-1.1", - "ZPL-1.1", - "ZPL-2.0", - "ZPL-2.1", - "Zed", - "Zend-2.0", - "Zimbra-1.3", - "Zimbra-1.4", - "Zlib", - "blessing", - "bzip2-1.0.5", - "bzip2-1.0.6", - "copyleft-next-0.3.0", - "copyleft-next-0.3.1", - "curl", - "diffmark", - "dvipdfm", - "eCos-2.0", - "eGenix", - "etalab-2.0", - "gSOAP-1.3b", - "gnuplot", - "iMatix", - "libpng-2.0", - "libselinux-1.0", - "libtiff", - "mpich2", - "psfrag", - "psutils", - "wxWindows", - "xinetd", - "xpp", - "zlib-acknowledgement" - ]; - } -}); - -// ../../node_modules/@ovyerus/licenses/simple.js -var require_simple = __commonJS({ - "../../node_modules/@ovyerus/licenses/simple.js"(exports, module) { - "use strict"; - module.exports = new Set(require_spdx_simple()); - } -}); - -// ../../node_modules/license/dist/getLicense.js -var require_getLicense = __commonJS({ - "../../node_modules/license/dist/getLicense.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - var simple_1 = __importDefault(require_simple()); - var fs_1 = __importDefault(__require("fs")); - function getLicense2(license, replacements = {}) { - if (!simple_1.default.has(license)) - throw new TypeError("license is not a valid SPDX identifier"); - let modified = JSON.parse( - // eslint-disable-next-line no-sync - fs_1.default.readFileSync(__require.resolve(`@ovyerus/licenses/licenses/${license}`), "utf-8") - // During testing I've found that loading the largest license (~40kb at time of writing) - // doesn't appear to have an noticeable impact on performance, however should this be made - // async just in case?? - // Or perhaps use an LRU cache to offset future loads - ).licenseText; - for (const [key, value] of Object.entries(replacements).filter( - // Remove any undefined or falsey values - ([, value2]) => value2 - )) - modified = modified.replace(new RegExp(`<${key}>`, "g"), value); - return modified; - } - exports.getLicense = getLicense2; - exports.default = getLicense2; - } -}); - -// ../../node_modules/@ovyerus/licenses/spdx.json -var require_spdx = __commonJS({ - "../../node_modules/@ovyerus/licenses/spdx.json"(exports, module) { - module.exports = { - "0BSD": { - name: "BSD Zero Clause License", - osiApproved: true, - url: "http://landley.net/toybox/license.html" - }, - AAL: { - name: "Attribution Assurance License", - osiApproved: true, - url: "https://opensource.org/licenses/attribution" - }, - ADSL: { - name: "Amazon Digital Services License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/AmazonDigitalServicesLicense" - }, - "AFL-1.1": { - name: "Academic Free License v1.1", - osiApproved: true, - url: "http://opensource.linux-mirror.org/licenses/afl-1.1.txt" - }, - "AFL-1.2": { - name: "Academic Free License v1.2", - osiApproved: true, - url: "http://opensource.linux-mirror.org/licenses/afl-1.2.txt" - }, - "AFL-2.0": { - name: "Academic Free License v2.0", - osiApproved: true, - url: "http://wayback.archive.org/web/20060924134533/http://www.opensource.org/licenses/afl-2.0.txt" - }, - "AFL-2.1": { - name: "Academic Free License v2.1", - osiApproved: true, - url: "http://opensource.linux-mirror.org/licenses/afl-2.1.txt" - }, - "AFL-3.0": { - name: "Academic Free License v3.0", - osiApproved: true, - url: "http://www.rosenlaw.com/AFL3.0.htm" - }, - "AGPL-1.0": { - name: "Affero General Public License v1.0", - osiApproved: false, - url: "http://www.affero.org/oagpl.html" - }, - "AGPL-1.0-only": { - name: "Affero General Public License v1.0 only", - osiApproved: false, - url: "http://www.affero.org/oagpl.html" - }, - "AGPL-1.0-or-later": { - name: "Affero General Public License v1.0 or later", - osiApproved: false, - url: "http://www.affero.org/oagpl.html" - }, - "AGPL-3.0": { - name: "GNU Affero General Public License v3.0", - osiApproved: true, - url: "https://www.gnu.org/licenses/agpl.txt" - }, - "AGPL-3.0-only": { - name: "GNU Affero General Public License v3.0 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/agpl.txt" - }, - "AGPL-3.0-or-later": { - name: "GNU Affero General Public License v3.0 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/agpl.txt" - }, - AMDPLPA: { - name: "AMD's plpa_map.c License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/AMD_plpa_map_License" - }, - AML: { - name: "Apple MIT License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Apple_MIT_License" - }, - AMPAS: { - name: "Academy of Motion Picture Arts and Sciences BSD", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/BSD#AMPASBSD" - }, - "ANTLR-PD": { - name: "ANTLR Software Rights Notice", - osiApproved: false, - url: "http://www.antlr2.org/license.html" - }, - APAFML: { - name: "Adobe Postscript AFM License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/AdobePostscriptAFM" - }, - "APL-1.0": { - name: "Adaptive Public License 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/APL-1.0" - }, - "APSL-1.0": { - name: "Apple Public Source License 1.0", - osiApproved: true, - url: "https://fedoraproject.org/wiki/Licensing/Apple_Public_Source_License_1.0" - }, - "APSL-1.1": { - name: "Apple Public Source License 1.1", - osiApproved: true, - url: "http://www.opensource.apple.com/source/IOSerialFamily/IOSerialFamily-7/APPLE_LICENSE" - }, - "APSL-1.2": { - name: "Apple Public Source License 1.2", - osiApproved: true, - url: "http://www.samurajdata.se/opensource/mirror/licenses/apsl.php" - }, - "APSL-2.0": { - name: "Apple Public Source License 2.0", - osiApproved: true, - url: "http://www.opensource.apple.com/license/apsl/" - }, - Abstyles: { - name: "Abstyles License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Abstyles" - }, - "Adobe-2006": { - name: "Adobe Systems Incorporated Source Code License Agreement", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/AdobeLicense" - }, - "Adobe-Glyph": { - name: "Adobe Glyph List License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/MIT#AdobeGlyph" - }, - Afmparse: { - name: "Afmparse License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Afmparse" - }, - Aladdin: { - name: "Aladdin Free Public License", - osiApproved: false, - url: "http://pages.cs.wisc.edu/~ghost/doc/AFPL/6.01/Public.htm" - }, - "Apache-1.0": { - name: "Apache License 1.0", - osiApproved: false, - url: "http://www.apache.org/licenses/LICENSE-1.0" - }, - "Apache-1.1": { - name: "Apache License 1.1", - osiApproved: true, - url: "http://apache.org/licenses/LICENSE-1.1" - }, - "Apache-2.0": { - name: "Apache License 2.0", - osiApproved: true, - url: "http://www.apache.org/licenses/LICENSE-2.0" - }, - "Artistic-1.0": { - name: "Artistic License 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/Artistic-1.0" - }, - "Artistic-1.0-Perl": { - name: "Artistic License 1.0 (Perl)", - osiApproved: true, - url: "http://dev.perl.org/licenses/artistic.html" - }, - "Artistic-1.0-cl8": { - name: "Artistic License 1.0 w/clause 8", - osiApproved: true, - url: "https://opensource.org/licenses/Artistic-1.0" - }, - "Artistic-2.0": { - name: "Artistic License 2.0", - osiApproved: true, - url: "http://www.perlfoundation.org/artistic_license_2_0" - }, - "BSD-1-Clause": { - name: "BSD 1-Clause License", - osiApproved: false, - url: "https://svnweb.freebsd.org/base/head/include/ifaddrs.h?revision=326823" - }, - "BSD-2-Clause": { - name: 'BSD 2-Clause "Simplified" License', - osiApproved: true, - url: "https://opensource.org/licenses/BSD-2-Clause" - }, - "BSD-2-Clause-FreeBSD": { - name: "BSD 2-Clause FreeBSD License", - osiApproved: false, - url: "http://www.freebsd.org/copyright/freebsd-license.html" - }, - "BSD-2-Clause-NetBSD": { - name: "BSD 2-Clause NetBSD License", - osiApproved: false, - url: "http://www.netbsd.org/about/redistribution.html#default" - }, - "BSD-2-Clause-Patent": { - name: "BSD-2-Clause Plus Patent License", - osiApproved: true, - url: "https://opensource.org/licenses/BSDplusPatent" - }, - "BSD-3-Clause": { - name: 'BSD 3-Clause "New" or "Revised" License', - osiApproved: true, - url: "https://opensource.org/licenses/BSD-3-Clause" - }, - "BSD-3-Clause-Attribution": { - name: "BSD with attribution", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/BSD_with_Attribution" - }, - "BSD-3-Clause-Clear": { - name: "BSD 3-Clause Clear License", - osiApproved: false, - url: "http://labs.metacarta.com/license-explanation.html#license" - }, - "BSD-3-Clause-LBNL": { - name: "Lawrence Berkeley National Labs BSD variant license", - osiApproved: true, - url: "https://fedoraproject.org/wiki/Licensing/LBNLBSD" - }, - "BSD-3-Clause-No-Nuclear-License": { - name: "BSD 3-Clause No Nuclear License", - osiApproved: false, - url: "http://download.oracle.com/otn-pub/java/licenses/bsd.txt?AuthParam=1467140197_43d516ce1776bd08a58235a7785be1cc" - }, - "BSD-3-Clause-No-Nuclear-License-2014": { - name: "BSD 3-Clause No Nuclear License 2014", - osiApproved: false, - url: "https://java.net/projects/javaeetutorial/pages/BerkeleyLicense" - }, - "BSD-3-Clause-No-Nuclear-Warranty": { - name: "BSD 3-Clause No Nuclear Warranty", - osiApproved: false, - url: "https://jogamp.org/git/?p=gluegen.git;a=blob_plain;f=LICENSE.txt" - }, - "BSD-3-Clause-Open-MPI": { - name: "BSD 3-Clause Open MPI variant", - osiApproved: false, - url: "https://www.open-mpi.org/community/license.php" - }, - "BSD-4-Clause": { - name: 'BSD 4-Clause "Original" or "Old" License', - osiApproved: false, - url: "http://directory.fsf.org/wiki/License:BSD_4Clause" - }, - "BSD-4-Clause-UC": { - name: "BSD-4-Clause (University of California-Specific)", - osiApproved: false, - url: "http://www.freebsd.org/copyright/license.html" - }, - "BSD-Protection": { - name: "BSD Protection License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/BSD_Protection_License" - }, - "BSD-Source-Code": { - name: "BSD Source Code Attribution", - osiApproved: false, - url: "https://github.com/robbiehanson/CocoaHTTPServer/blob/master/LICENSE.txt" - }, - "BSL-1.0": { - name: "Boost Software License 1.0", - osiApproved: true, - url: "http://www.boost.org/LICENSE_1_0.txt" - }, - Bahyph: { - name: "Bahyph License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Bahyph" - }, - Barr: { - name: "Barr License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Barr" - }, - Beerware: { - name: "Beerware License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Beerware" - }, - "BitTorrent-1.0": { - name: "BitTorrent Open Source License v1.0", - osiApproved: false, - url: "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/licenses/BitTorrent?r1=1.1&r2=1.1.1.1&diff_format=s" - }, - "BitTorrent-1.1": { - name: "BitTorrent Open Source License v1.1", - osiApproved: false, - url: "http://directory.fsf.org/wiki/License:BitTorrentOSL1.1" - }, - "BlueOak-1.0.0": { - name: "Blue Oak Model License 1.0.0", - osiApproved: false, - url: "https://blueoakcouncil.org/license/1.0.0" - }, - Borceux: { - name: "Borceux license", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Borceux" - }, - "CATOSL-1.1": { - name: "Computer Associates Trusted Open Source License 1.1", - osiApproved: true, - url: "https://opensource.org/licenses/CATOSL-1.1" - }, - "CC-BY-1.0": { - name: "Creative Commons Attribution 1.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by/1.0/legalcode" - }, - "CC-BY-2.0": { - name: "Creative Commons Attribution 2.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by/2.0/legalcode" - }, - "CC-BY-2.5": { - name: "Creative Commons Attribution 2.5 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by/2.5/legalcode" - }, - "CC-BY-3.0": { - name: "Creative Commons Attribution 3.0 Unported", - osiApproved: false, - url: "https://creativecommons.org/licenses/by/3.0/legalcode" - }, - "CC-BY-4.0": { - name: "Creative Commons Attribution 4.0 International", - osiApproved: false, - url: "https://creativecommons.org/licenses/by/4.0/legalcode" - }, - "CC-BY-NC-1.0": { - name: "Creative Commons Attribution Non Commercial 1.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc/1.0/legalcode" - }, - "CC-BY-NC-2.0": { - name: "Creative Commons Attribution Non Commercial 2.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc/2.0/legalcode" - }, - "CC-BY-NC-2.5": { - name: "Creative Commons Attribution Non Commercial 2.5 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc/2.5/legalcode" - }, - "CC-BY-NC-3.0": { - name: "Creative Commons Attribution Non Commercial 3.0 Unported", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc/3.0/legalcode" - }, - "CC-BY-NC-4.0": { - name: "Creative Commons Attribution Non Commercial 4.0 International", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc/4.0/legalcode" - }, - "CC-BY-NC-ND-1.0": { - name: "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nd-nc/1.0/legalcode" - }, - "CC-BY-NC-ND-2.0": { - name: "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-nd/2.0/legalcode" - }, - "CC-BY-NC-ND-2.5": { - name: "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-nd/2.5/legalcode" - }, - "CC-BY-NC-ND-3.0": { - name: "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode" - }, - "CC-BY-NC-ND-4.0": { - name: "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode" - }, - "CC-BY-NC-SA-1.0": { - name: "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-sa/1.0/legalcode" - }, - "CC-BY-NC-SA-2.0": { - name: "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode" - }, - "CC-BY-NC-SA-2.5": { - name: "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-sa/2.5/legalcode" - }, - "CC-BY-NC-SA-3.0": { - name: "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode" - }, - "CC-BY-NC-SA-4.0": { - name: "Creative Commons Attribution Non Commercial Share Alike 4.0 International", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode" - }, - "CC-BY-ND-1.0": { - name: "Creative Commons Attribution No Derivatives 1.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nd/1.0/legalcode" - }, - "CC-BY-ND-2.0": { - name: "Creative Commons Attribution No Derivatives 2.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nd/2.0/legalcode" - }, - "CC-BY-ND-2.5": { - name: "Creative Commons Attribution No Derivatives 2.5 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nd/2.5/legalcode" - }, - "CC-BY-ND-3.0": { - name: "Creative Commons Attribution No Derivatives 3.0 Unported", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nd/3.0/legalcode" - }, - "CC-BY-ND-4.0": { - name: "Creative Commons Attribution No Derivatives 4.0 International", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-nd/4.0/legalcode" - }, - "CC-BY-SA-1.0": { - name: "Creative Commons Attribution Share Alike 1.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-sa/1.0/legalcode" - }, - "CC-BY-SA-2.0": { - name: "Creative Commons Attribution Share Alike 2.0 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-sa/2.0/legalcode" - }, - "CC-BY-SA-2.5": { - name: "Creative Commons Attribution Share Alike 2.5 Generic", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-sa/2.5/legalcode" - }, - "CC-BY-SA-3.0": { - name: "Creative Commons Attribution Share Alike 3.0 Unported", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-sa/3.0/legalcode" - }, - "CC-BY-SA-4.0": { - name: "Creative Commons Attribution Share Alike 4.0 International", - osiApproved: false, - url: "https://creativecommons.org/licenses/by-sa/4.0/legalcode" - }, - "CC-PDDC": { - name: "Creative Commons Public Domain Dedication and Certification", - osiApproved: false, - url: "https://creativecommons.org/licenses/publicdomain/" - }, - "CC0-1.0": { - name: "Creative Commons Zero v1.0 Universal", - osiApproved: false, - url: "https://creativecommons.org/publicdomain/zero/1.0/legalcode" - }, - "CDDL-1.0": { - name: "Common Development and Distribution License 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/cddl1" - }, - "CDDL-1.1": { - name: "Common Development and Distribution License 1.1", - osiApproved: false, - url: "http://glassfish.java.net/public/CDDL+GPL_1_1.html" - }, - "CDLA-Permissive-1.0": { - name: "Community Data License Agreement Permissive 1.0", - osiApproved: false, - url: "https://cdla.io/permissive-1-0" - }, - "CDLA-Sharing-1.0": { - name: "Community Data License Agreement Sharing 1.0", - osiApproved: false, - url: "https://cdla.io/sharing-1-0" - }, - "CECILL-1.0": { - name: "CeCILL Free Software License Agreement v1.0", - osiApproved: false, - url: "http://www.cecill.info/licences/Licence_CeCILL_V1-fr.html" - }, - "CECILL-1.1": { - name: "CeCILL Free Software License Agreement v1.1", - osiApproved: false, - url: "http://www.cecill.info/licences/Licence_CeCILL_V1.1-US.html" - }, - "CECILL-2.0": { - name: "CeCILL Free Software License Agreement v2.0", - osiApproved: false, - url: "http://www.cecill.info/licences/Licence_CeCILL_V2-en.html" - }, - "CECILL-2.1": { - name: "CeCILL Free Software License Agreement v2.1", - osiApproved: true, - url: "http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html" - }, - "CECILL-B": { - name: "CeCILL-B Free Software License Agreement", - osiApproved: false, - url: "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html" - }, - "CECILL-C": { - name: "CeCILL-C Free Software License Agreement", - osiApproved: false, - url: "http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html" - }, - "CERN-OHL-1.1": { - name: "CERN Open Hardware Licence v1.1", - osiApproved: false, - url: "https://www.ohwr.org/project/licenses/wikis/cern-ohl-v1.1" - }, - "CERN-OHL-1.2": { - name: "CERN Open Hardware Licence v1.2", - osiApproved: false, - url: "https://www.ohwr.org/project/licenses/wikis/cern-ohl-v1.2" - }, - "CNRI-Jython": { - name: "CNRI Jython License", - osiApproved: false, - url: "http://www.jython.org/license.html" - }, - "CNRI-Python": { - name: "CNRI Python License", - osiApproved: true, - url: "https://opensource.org/licenses/CNRI-Python" - }, - "CNRI-Python-GPL-Compatible": { - name: "CNRI Python Open Source GPL Compatible License Agreement", - osiApproved: false, - url: "http://www.python.org/download/releases/1.6.1/download_win/" - }, - "CPAL-1.0": { - name: "Common Public Attribution License 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/CPAL-1.0" - }, - "CPL-1.0": { - name: "Common Public License 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/CPL-1.0" - }, - "CPOL-1.02": { - name: "Code Project Open License 1.02", - osiApproved: false, - url: "http://www.codeproject.com/info/cpol10.aspx" - }, - "CUA-OPL-1.0": { - name: "CUA Office Public License v1.0", - osiApproved: true, - url: "https://opensource.org/licenses/CUA-OPL-1.0" - }, - Caldera: { - name: "Caldera License", - osiApproved: false, - url: "http://www.lemis.com/grog/UNIX/ancient-source-all.pdf" - }, - ClArtistic: { - name: "Clarified Artistic License", - osiApproved: false, - url: "http://gianluca.dellavedova.org/2011/01/03/clarified-artistic-license/" - }, - "Condor-1.1": { - name: "Condor Public License v1.1", - osiApproved: false, - url: "http://research.cs.wisc.edu/condor/license.html#condor" - }, - Crossword: { - name: "Crossword License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Crossword" - }, - CrystalStacker: { - name: "CrystalStacker License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing:CrystalStacker?rd=Licensing/CrystalStacker" - }, - Cube: { - name: "Cube License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Cube" - }, - "D-FSL-1.0": { - name: "Deutsche Freie Software Lizenz", - osiApproved: false, - url: "http://www.dipp.nrw.de/d-fsl/lizenzen/" - }, - DOC: { - name: "DOC License", - osiApproved: false, - url: "http://www.cs.wustl.edu/~schmidt/ACE-copying.html" - }, - DSDP: { - name: "DSDP License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/DSDP" - }, - Dotseqn: { - name: "Dotseqn License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Dotseqn" - }, - "ECL-1.0": { - name: "Educational Community License v1.0", - osiApproved: true, - url: "https://opensource.org/licenses/ECL-1.0" - }, - "ECL-2.0": { - name: "Educational Community License v2.0", - osiApproved: true, - url: "https://opensource.org/licenses/ECL-2.0" - }, - "EFL-1.0": { - name: "Eiffel Forum License v1.0", - osiApproved: true, - url: "http://www.eiffel-nice.org/license/forum.txt" - }, - "EFL-2.0": { - name: "Eiffel Forum License v2.0", - osiApproved: true, - url: "http://www.eiffel-nice.org/license/eiffel-forum-license-2.html" - }, - "EPL-1.0": { - name: "Eclipse Public License 1.0", - osiApproved: true, - url: "http://www.eclipse.org/legal/epl-v10.html" - }, - "EPL-2.0": { - name: "Eclipse Public License 2.0", - osiApproved: true, - url: "https://www.eclipse.org/legal/epl-2.0" - }, - EUDatagrid: { - name: "EU DataGrid Software License", - osiApproved: true, - url: "http://eu-datagrid.web.cern.ch/eu-datagrid/license.html" - }, - "EUPL-1.0": { - name: "European Union Public License 1.0", - osiApproved: false, - url: "http://ec.europa.eu/idabc/en/document/7330.html" - }, - "EUPL-1.1": { - name: "European Union Public License 1.1", - osiApproved: true, - url: "https://joinup.ec.europa.eu/software/page/eupl/licence-eupl" - }, - "EUPL-1.2": { - name: "European Union Public License 1.2", - osiApproved: true, - url: "https://joinup.ec.europa.eu/page/eupl-text-11-12" - }, - Entessa: { - name: "Entessa Public License v1.0", - osiApproved: true, - url: "https://opensource.org/licenses/Entessa" - }, - "ErlPL-1.1": { - name: "Erlang Public License v1.1", - osiApproved: false, - url: "http://www.erlang.org/EPLICENSE" - }, - Eurosym: { - name: "Eurosym License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Eurosym" - }, - FSFAP: { - name: "FSF All Permissive License", - osiApproved: false, - url: "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html" - }, - FSFUL: { - name: "FSF Unlimited License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/FSF_Unlimited_License" - }, - FSFULLR: { - name: "FSF Unlimited License (with License Retention)", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/FSF_Unlimited_License#License_Retention_Variant" - }, - FTL: { - name: "Freetype Project License", - osiApproved: false, - url: "http://freetype.fis.uniroma2.it/FTL.TXT" - }, - Fair: { - name: "Fair License", - osiApproved: true, - url: "http://fairlicense.org/" - }, - "Frameworx-1.0": { - name: "Frameworx Open License 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/Frameworx-1.0" - }, - FreeImage: { - name: "FreeImage Public License v1.0", - osiApproved: false, - url: "http://freeimage.sourceforge.net/freeimage-license.txt" - }, - "GFDL-1.1": { - name: "GNU Free Documentation License v1.1", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" - }, - "GFDL-1.1-only": { - name: "GNU Free Documentation License v1.1 only", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" - }, - "GFDL-1.1-or-later": { - name: "GNU Free Documentation License v1.1 or later", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" - }, - "GFDL-1.2": { - name: "GNU Free Documentation License v1.2", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" - }, - "GFDL-1.2-only": { - name: "GNU Free Documentation License v1.2 only", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" - }, - "GFDL-1.2-or-later": { - name: "GNU Free Documentation License v1.2 or later", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" - }, - "GFDL-1.3": { - name: "GNU Free Documentation License v1.3", - osiApproved: false, - url: "https://www.gnu.org/licenses/fdl-1.3.txt" - }, - "GFDL-1.3-only": { - name: "GNU Free Documentation License v1.3 only", - osiApproved: false, - url: "https://www.gnu.org/licenses/fdl-1.3.txt" - }, - "GFDL-1.3-or-later": { - name: "GNU Free Documentation License v1.3 or later", - osiApproved: false, - url: "https://www.gnu.org/licenses/fdl-1.3.txt" - }, - GL2PS: { - name: "GL2PS License", - osiApproved: false, - url: "http://www.geuz.org/gl2ps/COPYING.GL2PS" - }, - "GPL-1.0": { - name: "GNU General Public License v1.0 only", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" - }, - "GPL-1.0+": { - name: "GNU General Public License v1.0 or later", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" - }, - "GPL-1.0-only": { - name: "GNU General Public License v1.0 only", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" - }, - "GPL-1.0-or-later": { - name: "GNU General Public License v1.0 or later", - osiApproved: false, - url: "https://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" - }, - "GPL-2.0": { - name: "GNU General Public License v2.0 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html" - }, - "GPL-2.0+": { - name: "GNU General Public License v2.0 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html" - }, - "GPL-2.0-only": { - name: "GNU General Public License v2.0 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html" - }, - "GPL-2.0-or-later": { - name: "GNU General Public License v2.0 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html" - }, - "GPL-2.0-with-GCC-exception": { - name: "GNU General Public License v2.0 w/GCC Runtime Library exception", - osiApproved: false, - url: "https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/libgcc1.c;h=762f5143fc6eed57b6797c82710f3538aa52b40b;hb=cb143a3ce4fb417c68f5fa2691a1b1b1053dfba9#l10" - }, - "GPL-2.0-with-autoconf-exception": { - name: "GNU General Public License v2.0 w/Autoconf exception", - osiApproved: false, - url: "http://ac-archive.sourceforge.net/doc/copyright.html" - }, - "GPL-2.0-with-bison-exception": { - name: "GNU General Public License v2.0 w/Bison exception", - osiApproved: false, - url: "http://git.savannah.gnu.org/cgit/bison.git/tree/data/yacc.c?id=193d7c7054ba7197b0789e14965b739162319b5e#n141" - }, - "GPL-2.0-with-classpath-exception": { - name: "GNU General Public License v2.0 w/Classpath exception", - osiApproved: false, - url: "https://www.gnu.org/software/classpath/license.html" - }, - "GPL-2.0-with-font-exception": { - name: "GNU General Public License v2.0 w/Font exception", - osiApproved: false, - url: "https://www.gnu.org/licenses/gpl-faq.html#FontException" - }, - "GPL-3.0": { - name: "GNU General Public License v3.0 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/gpl-3.0-standalone.html" - }, - "GPL-3.0+": { - name: "GNU General Public License v3.0 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/gpl-3.0-standalone.html" - }, - "GPL-3.0-only": { - name: "GNU General Public License v3.0 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/gpl-3.0-standalone.html" - }, - "GPL-3.0-or-later": { - name: "GNU General Public License v3.0 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/gpl-3.0-standalone.html" - }, - "GPL-3.0-with-GCC-exception": { - name: "GNU General Public License v3.0 w/GCC Runtime Library exception", - osiApproved: true, - url: "https://www.gnu.org/licenses/gcc-exception-3.1.html" - }, - "GPL-3.0-with-autoconf-exception": { - name: "GNU General Public License v3.0 w/Autoconf exception", - osiApproved: false, - url: "https://www.gnu.org/licenses/autoconf-exception-3.0.html" - }, - Giftware: { - name: "Giftware License", - osiApproved: false, - url: "http://liballeg.org/license.html#allegro-4-the-giftware-license" - }, - Glide: { - name: "3dfx Glide License", - osiApproved: false, - url: "http://www.users.on.net/~triforce/glidexp/COPYING.txt" - }, - Glulxe: { - name: "Glulxe License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Glulxe" - }, - HPND: { - name: "Historical Permission Notice and Disclaimer", - osiApproved: true, - url: "https://opensource.org/licenses/HPND" - }, - "HPND-sell-variant": { - name: "Historical Permission Notice and Disclaimer - sell variant", - osiApproved: false, - url: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/sunrpc/auth_gss/gss_generic_token.c?h=v4.19" - }, - HaskellReport: { - name: "Haskell Language Report License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Haskell_Language_Report_License" - }, - "IBM-pibs": { - name: "IBM PowerPC Initialization and Boot Software", - osiApproved: false, - url: "http://git.denx.de/?p=u-boot.git;a=blob;f=arch/powerpc/cpu/ppc4xx/miiphy.c;h=297155fdafa064b955e53e9832de93bfb0cfb85b;hb=9fab4bf4cc077c21e43941866f3f2c196f28670d" - }, - ICU: { - name: "ICU License", - osiApproved: false, - url: "http://source.icu-project.org/repos/icu/icu/trunk/license.html" - }, - IJG: { - name: "Independent JPEG Group License", - osiApproved: false, - url: "http://dev.w3.org/cvsweb/Amaya/libjpeg/Attic/README?rev=1.2" - }, - IPA: { - name: "IPA Font License", - osiApproved: true, - url: "https://opensource.org/licenses/IPA" - }, - "IPL-1.0": { - name: "IBM Public License v1.0", - osiApproved: true, - url: "https://opensource.org/licenses/IPL-1.0" - }, - ISC: { - name: "ISC License", - osiApproved: true, - url: "https://www.isc.org/downloads/software-support-policy/isc-license/" - }, - ImageMagick: { - name: "ImageMagick License", - osiApproved: false, - url: "http://www.imagemagick.org/script/license.php" - }, - Imlib2: { - name: "Imlib2 License", - osiApproved: false, - url: "http://trac.enlightenment.org/e/browser/trunk/imlib2/COPYING" - }, - "Info-ZIP": { - name: "Info-ZIP License", - osiApproved: false, - url: "http://www.info-zip.org/license.html" - }, - Intel: { - name: "Intel Open Source License", - osiApproved: true, - url: "https://opensource.org/licenses/Intel" - }, - "Intel-ACPI": { - name: "Intel ACPI Software License Agreement", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Intel_ACPI_Software_License_Agreement" - }, - "Interbase-1.0": { - name: "Interbase Public License v1.0", - osiApproved: false, - url: "https://web.archive.org/web/20060319014854/http://info.borland.com/devsupport/interbase/opensource/IPL.html" - }, - JPNIC: { - name: "Japan Network Information Center License", - osiApproved: false, - url: "https://gitlab.isc.org/isc-projects/bind9/blob/master/COPYRIGHT#L366" - }, - JSON: { - name: "JSON License", - osiApproved: false, - url: "http://www.json.org/license.html" - }, - "JasPer-2.0": { - name: "JasPer License", - osiApproved: false, - url: "http://www.ece.uvic.ca/~mdadams/jasper/LICENSE" - }, - "LAL-1.2": { - name: "Licence Art Libre 1.2", - osiApproved: false, - url: "http://artlibre.org/licence/lal/licence-art-libre-12/" - }, - "LAL-1.3": { - name: "Licence Art Libre 1.3", - osiApproved: false, - url: "https://artlibre.org/" - }, - "LGPL-2.0": { - name: "GNU Library General Public License v2 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html" - }, - "LGPL-2.0+": { - name: "GNU Library General Public License v2 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html" - }, - "LGPL-2.0-only": { - name: "GNU Library General Public License v2 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html" - }, - "LGPL-2.0-or-later": { - name: "GNU Library General Public License v2 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html" - }, - "LGPL-2.1": { - name: "GNU Lesser General Public License v2.1 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html" - }, - "LGPL-2.1+": { - name: "GNU Library General Public License v2.1 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html" - }, - "LGPL-2.1-only": { - name: "GNU Lesser General Public License v2.1 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html" - }, - "LGPL-2.1-or-later": { - name: "GNU Lesser General Public License v2.1 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html" - }, - "LGPL-3.0": { - name: "GNU Lesser General Public License v3.0 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/lgpl-3.0-standalone.html" - }, - "LGPL-3.0+": { - name: "GNU Lesser General Public License v3.0 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/lgpl-3.0-standalone.html" - }, - "LGPL-3.0-only": { - name: "GNU Lesser General Public License v3.0 only", - osiApproved: true, - url: "https://www.gnu.org/licenses/lgpl-3.0-standalone.html" - }, - "LGPL-3.0-or-later": { - name: "GNU Lesser General Public License v3.0 or later", - osiApproved: true, - url: "https://www.gnu.org/licenses/lgpl-3.0-standalone.html" - }, - LGPLLR: { - name: "Lesser General Public License For Linguistic Resources", - osiApproved: false, - url: "http://www-igm.univ-mlv.fr/~unitex/lgpllr.html" - }, - "LPL-1.0": { - name: "Lucent Public License Version 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/LPL-1.0" - }, - "LPL-1.02": { - name: "Lucent Public License v1.02", - osiApproved: true, - url: "http://plan9.bell-labs.com/plan9/license.html" - }, - "LPPL-1.0": { - name: "LaTeX Project Public License v1.0", - osiApproved: false, - url: "http://www.latex-project.org/lppl/lppl-1-0.txt" - }, - "LPPL-1.1": { - name: "LaTeX Project Public License v1.1", - osiApproved: false, - url: "http://www.latex-project.org/lppl/lppl-1-1.txt" - }, - "LPPL-1.2": { - name: "LaTeX Project Public License v1.2", - osiApproved: false, - url: "http://www.latex-project.org/lppl/lppl-1-2.txt" - }, - "LPPL-1.3a": { - name: "LaTeX Project Public License v1.3a", - osiApproved: false, - url: "http://www.latex-project.org/lppl/lppl-1-3a.txt" - }, - "LPPL-1.3c": { - name: "LaTeX Project Public License v1.3c", - osiApproved: true, - url: "http://www.latex-project.org/lppl/lppl-1-3c.txt" - }, - Latex2e: { - name: "Latex2e License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Latex2e" - }, - Leptonica: { - name: "Leptonica License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Leptonica" - }, - "LiLiQ-P-1.1": { - name: "Licence Libre du Qu\xE9bec \u2013 Permissive version 1.1", - osiApproved: true, - url: "https://forge.gouv.qc.ca/licence/fr/liliq-v1-1/" - }, - "LiLiQ-R-1.1": { - name: "Licence Libre du Qu\xE9bec \u2013 R\xE9ciprocit\xE9 version 1.1", - osiApproved: true, - url: "https://www.forge.gouv.qc.ca/participez/licence-logicielle/licence-libre-du-quebec-liliq-en-francais/licence-libre-du-quebec-reciprocite-liliq-r-v1-1/" - }, - "LiLiQ-Rplus-1.1": { - name: "Licence Libre du Qu\xE9bec \u2013 R\xE9ciprocit\xE9 forte version 1.1", - osiApproved: true, - url: "https://www.forge.gouv.qc.ca/participez/licence-logicielle/licence-libre-du-quebec-liliq-en-francais/licence-libre-du-quebec-reciprocite-forte-liliq-r-v1-1/" - }, - Libpng: { - name: "libpng License", - osiApproved: false, - url: "http://www.libpng.org/pub/png/src/libpng-LICENSE.txt" - }, - "Linux-OpenIB": { - name: "Linux Kernel Variant of OpenIB.org license", - osiApproved: false, - url: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/infiniband/core/sa.h" - }, - MIT: { - name: "MIT License", - osiApproved: true, - url: "https://opensource.org/licenses/MIT" - }, - "MIT-0": { - name: "MIT No Attribution", - osiApproved: false, - url: "https://github.com/aws/mit-0" - }, - "MIT-CMU": { - name: "CMU License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing:MIT?rd=Licensing/MIT#CMU_Style" - }, - "MIT-advertising": { - name: "Enlightenment License (e16)", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/MIT_With_Advertising" - }, - "MIT-enna": { - name: "enna License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/MIT#enna" - }, - "MIT-feh": { - name: "feh License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/MIT#feh" - }, - MITNFA: { - name: "MIT +no-false-attribs license", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/MITNFA" - }, - "MPL-1.0": { - name: "Mozilla Public License 1.0", - osiApproved: true, - url: "http://www.mozilla.org/MPL/MPL-1.0.html" - }, - "MPL-1.1": { - name: "Mozilla Public License 1.1", - osiApproved: true, - url: "http://www.mozilla.org/MPL/MPL-1.1.html" - }, - "MPL-2.0": { - name: "Mozilla Public License 2.0", - osiApproved: true, - url: "http://www.mozilla.org/MPL/2.0/" - }, - "MPL-2.0-no-copyleft-exception": { - name: "Mozilla Public License 2.0 (no copyleft exception)", - osiApproved: true, - url: "http://www.mozilla.org/MPL/2.0/" - }, - "MS-PL": { - name: "Microsoft Public License", - osiApproved: true, - url: "http://www.microsoft.com/opensource/licenses.mspx" - }, - "MS-RL": { - name: "Microsoft Reciprocal License", - osiApproved: true, - url: "http://www.microsoft.com/opensource/licenses.mspx" - }, - MTLL: { - name: "Matrix Template Library License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Matrix_Template_Library_License" - }, - MakeIndex: { - name: "MakeIndex License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/MakeIndex" - }, - MirOS: { - name: "The MirOS Licence", - osiApproved: true, - url: "https://opensource.org/licenses/MirOS" - }, - Motosoto: { - name: "Motosoto License", - osiApproved: true, - url: "https://opensource.org/licenses/Motosoto" - }, - "MulanPSL-1.0": { - name: "Mulan Permissive Software License, Version 1", - osiApproved: false, - url: "https://license.coscl.org.cn/MulanPSL/" - }, - Multics: { - name: "Multics License", - osiApproved: true, - url: "https://opensource.org/licenses/Multics" - }, - Mup: { - name: "Mup License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Mup" - }, - "NASA-1.3": { - name: "NASA Open Source Agreement 1.3", - osiApproved: true, - url: "http://ti.arc.nasa.gov/opensource/nosa/" - }, - "NBPL-1.0": { - name: "Net Boolean Public License v1", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=37b4b3f6cc4bf34e1d3dec61e69914b9819d8894" - }, - NCSA: { - name: "University of Illinois/NCSA Open Source License", - osiApproved: true, - url: "http://otm.illinois.edu/uiuc_openSource" - }, - NGPL: { - name: "Nethack General Public License", - osiApproved: true, - url: "https://opensource.org/licenses/NGPL" - }, - "NLOD-1.0": { - name: "Norwegian Licence for Open Government Data", - osiApproved: false, - url: "http://data.norge.no/nlod/en/1.0" - }, - NLPL: { - name: "No Limit Public License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/NLPL" - }, - NOSL: { - name: "Netizen Open Source License", - osiApproved: false, - url: "http://bits.netizen.com.au/licenses/NOSL/nosl.txt" - }, - "NPL-1.0": { - name: "Netscape Public License v1.0", - osiApproved: false, - url: "http://www.mozilla.org/MPL/NPL/1.0/" - }, - "NPL-1.1": { - name: "Netscape Public License v1.1", - osiApproved: false, - url: "http://www.mozilla.org/MPL/NPL/1.1/" - }, - "NPOSL-3.0": { - name: "Non-Profit Open Software License 3.0", - osiApproved: true, - url: "https://opensource.org/licenses/NOSL3.0" - }, - NRL: { - name: "NRL License", - osiApproved: false, - url: "http://web.mit.edu/network/isakmp/nrllicense.html" - }, - NTP: { - name: "NTP License", - osiApproved: true, - url: "https://opensource.org/licenses/NTP" - }, - "NTP-0": { - name: "NTP No Attribution", - osiApproved: false, - url: "https://github.com/tytso/e2fsprogs/blob/master/lib/et/et_name.c" - }, - Naumen: { - name: "Naumen Public License", - osiApproved: true, - url: "https://opensource.org/licenses/Naumen" - }, - "Net-SNMP": { - name: "Net-SNMP License", - osiApproved: false, - url: "http://net-snmp.sourceforge.net/about/license.html" - }, - NetCDF: { - name: "NetCDF license", - osiApproved: false, - url: "http://www.unidata.ucar.edu/software/netcdf/copyright.html" - }, - Newsletr: { - name: "Newsletr License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Newsletr" - }, - Nokia: { - name: "Nokia Open Source License", - osiApproved: true, - url: "https://opensource.org/licenses/nokia" - }, - Noweb: { - name: "Noweb License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Noweb" - }, - Nunit: { - name: "Nunit License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Nunit" - }, - "OCCT-PL": { - name: "Open CASCADE Technology Public License", - osiApproved: false, - url: "http://www.opencascade.com/content/occt-public-license" - }, - "OCLC-2.0": { - name: "OCLC Research Public License 2.0", - osiApproved: true, - url: "http://www.oclc.org/research/activities/software/license/v2final.htm" - }, - "ODC-By-1.0": { - name: "Open Data Commons Attribution License v1.0", - osiApproved: false, - url: "https://opendatacommons.org/licenses/by/1.0/" - }, - "ODbL-1.0": { - name: "ODC Open Database License v1.0", - osiApproved: false, - url: "http://www.opendatacommons.org/licenses/odbl/1.0/" - }, - "OFL-1.0": { - name: "SIL Open Font License 1.0", - osiApproved: false, - url: "http://scripts.sil.org/cms/scripts/page.php?item_id=OFL10_web" - }, - "OFL-1.0-RFN": { - name: "SIL Open Font License 1.0 with Reserved Font Name", - osiApproved: false, - url: "http://scripts.sil.org/cms/scripts/page.php?item_id=OFL10_web" - }, - "OFL-1.0-no-RFN": { - name: "SIL Open Font License 1.0 with no Reserved Font Name", - osiApproved: false, - url: "http://scripts.sil.org/cms/scripts/page.php?item_id=OFL10_web" - }, - "OFL-1.1": { - name: "SIL Open Font License 1.1", - osiApproved: true, - url: "http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web" - }, - "OFL-1.1-RFN": { - name: "SIL Open Font License 1.1 with Reserved Font Name", - osiApproved: true, - url: "http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web" - }, - "OFL-1.1-no-RFN": { - name: "SIL Open Font License 1.1 with no Reserved Font Name", - osiApproved: true, - url: "http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web" - }, - "OGL-Canada-2.0": { - name: "Open Government Licence - Canada", - osiApproved: false, - url: "https://open.canada.ca/en/open-government-licence-canada" - }, - "OGL-UK-1.0": { - name: "Open Government Licence v1.0", - osiApproved: false, - url: "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/1/" - }, - "OGL-UK-2.0": { - name: "Open Government Licence v2.0", - osiApproved: false, - url: "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/" - }, - "OGL-UK-3.0": { - name: "Open Government Licence v3.0", - osiApproved: false, - url: "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" - }, - OGTSL: { - name: "Open Group Test Suite License", - osiApproved: true, - url: "http://www.opengroup.org/testing/downloads/The_Open_Group_TSL.txt" - }, - "OLDAP-1.1": { - name: "Open LDAP Public License v1.1", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=806557a5ad59804ef3a44d5abfbe91d706b0791f" - }, - "OLDAP-1.2": { - name: "Open LDAP Public License v1.2", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=42b0383c50c299977b5893ee695cf4e486fb0dc7" - }, - "OLDAP-1.3": { - name: "Open LDAP Public License v1.3", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=e5f8117f0ce088d0bd7a8e18ddf37eaa40eb09b1" - }, - "OLDAP-1.4": { - name: "Open LDAP Public License v1.4", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=c9f95c2f3f2ffb5e0ae55fe7388af75547660941" - }, - "OLDAP-2.0": { - name: "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=cbf50f4e1185a21abd4c0a54d3f4341fe28f36ea" - }, - "OLDAP-2.0.1": { - name: "Open LDAP Public License v2.0.1", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=b6d68acd14e51ca3aab4428bf26522aa74873f0e" - }, - "OLDAP-2.1": { - name: "Open LDAP Public License v2.1", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=b0d176738e96a0d3b9f85cb51e140a86f21be715" - }, - "OLDAP-2.2": { - name: "Open LDAP Public License v2.2", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=470b0c18ec67621c85881b2733057fecf4a1acc3" - }, - "OLDAP-2.2.1": { - name: "Open LDAP Public License v2.2.1", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=4bc786f34b50aa301be6f5600f58a980070f481e" - }, - "OLDAP-2.2.2": { - name: "Open LDAP Public License 2.2.2", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=df2cc1e21eb7c160695f5b7cffd6296c151ba188" - }, - "OLDAP-2.3": { - name: "Open LDAP Public License v2.3", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=d32cf54a32d581ab475d23c810b0a7fbaf8d63c3" - }, - "OLDAP-2.4": { - name: "Open LDAP Public License v2.4", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=cd1284c4a91a8a380d904eee68d1583f989ed386" - }, - "OLDAP-2.5": { - name: "Open LDAP Public License v2.5", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=6852b9d90022e8593c98205413380536b1b5a7cf" - }, - "OLDAP-2.6": { - name: "Open LDAP Public License v2.6", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=1cae062821881f41b73012ba816434897abf4205" - }, - "OLDAP-2.7": { - name: "Open LDAP Public License v2.7", - osiApproved: false, - url: "http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=47c2415c1df81556eeb39be6cad458ef87c534a2" - }, - "OLDAP-2.8": { - name: "Open LDAP Public License v2.8", - osiApproved: false, - url: "http://www.openldap.org/software/release/license.html" - }, - OML: { - name: "Open Market License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Open_Market_License" - }, - "OPL-1.0": { - name: "Open Public License v1.0", - osiApproved: false, - url: "http://old.koalateam.com/jackaroo/OPL_1_0.TXT" - }, - "OSET-PL-2.1": { - name: "OSET Public License version 2.1", - osiApproved: true, - url: "http://www.osetfoundation.org/public-license" - }, - "OSL-1.0": { - name: "Open Software License 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/OSL-1.0" - }, - "OSL-1.1": { - name: "Open Software License 1.1", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/OSL1.1" - }, - "OSL-2.0": { - name: "Open Software License 2.0", - osiApproved: true, - url: "http://web.archive.org/web/20041020171434/http://www.rosenlaw.com/osl2.0.html" - }, - "OSL-2.1": { - name: "Open Software License 2.1", - osiApproved: true, - url: "http://web.archive.org/web/20050212003940/http://www.rosenlaw.com/osl21.htm" - }, - "OSL-3.0": { - name: "Open Software License 3.0", - osiApproved: true, - url: "https://web.archive.org/web/20120101081418/http://rosenlaw.com:80/OSL3.0.htm" - }, - OpenSSL: { - name: "OpenSSL License", - osiApproved: false, - url: "http://www.openssl.org/source/license.html" - }, - "PDDL-1.0": { - name: "ODC Public Domain Dedication & License 1.0", - osiApproved: false, - url: "http://opendatacommons.org/licenses/pddl/1.0/" - }, - "PHP-3.0": { - name: "PHP License v3.0", - osiApproved: true, - url: "http://www.php.net/license/3_0.txt" - }, - "PHP-3.01": { - name: "PHP License v3.01", - osiApproved: false, - url: "http://www.php.net/license/3_01.txt" - }, - "PSF-2.0": { - name: "Python Software Foundation License 2.0", - osiApproved: false, - url: "https://opensource.org/licenses/Python-2.0" - }, - "Parity-6.0.0": { - name: "The Parity Public License 6.0.0", - osiApproved: false, - url: "https://paritylicense.com/versions/6.0.0.html" - }, - Plexus: { - name: "Plexus Classworlds License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Plexus_Classworlds_License" - }, - PostgreSQL: { - name: "PostgreSQL License", - osiApproved: true, - url: "http://www.postgresql.org/about/licence" - }, - "Python-2.0": { - name: "Python License 2.0", - osiApproved: true, - url: "https://opensource.org/licenses/Python-2.0" - }, - "QPL-1.0": { - name: "Q Public License 1.0", - osiApproved: true, - url: "http://doc.qt.nokia.com/3.3/license.html" - }, - Qhull: { - name: "Qhull License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Qhull" - }, - "RHeCos-1.1": { - name: "Red Hat eCos Public License v1.1", - osiApproved: false, - url: "http://ecos.sourceware.org/old-license.html" - }, - "RPL-1.1": { - name: "Reciprocal Public License 1.1", - osiApproved: true, - url: "https://opensource.org/licenses/RPL-1.1" - }, - "RPL-1.5": { - name: "Reciprocal Public License 1.5", - osiApproved: true, - url: "https://opensource.org/licenses/RPL-1.5" - }, - "RPSL-1.0": { - name: "RealNetworks Public Source License v1.0", - osiApproved: true, - url: "https://helixcommunity.org/content/rpsl" - }, - "RSA-MD": { - name: "RSA Message-Digest License ", - osiApproved: false, - url: "http://www.faqs.org/rfcs/rfc1321.html" - }, - RSCPL: { - name: "Ricoh Source Code Public License", - osiApproved: true, - url: "http://wayback.archive.org/web/20060715140826/http://www.risource.org/RPL/RPL-1.0A.shtml" - }, - Rdisc: { - name: "Rdisc License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Rdisc_License" - }, - Ruby: { - name: "Ruby License", - osiApproved: false, - url: "http://www.ruby-lang.org/en/LICENSE.txt" - }, - "SAX-PD": { - name: "Sax Public Domain Notice", - osiApproved: false, - url: "http://www.saxproject.org/copying.html" - }, - SCEA: { - name: "SCEA Shared Source License", - osiApproved: false, - url: "http://research.scea.com/scea_shared_source_license.html" - }, - "SGI-B-1.0": { - name: "SGI Free Software License B v1.0", - osiApproved: false, - url: "http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.1.0.html" - }, - "SGI-B-1.1": { - name: "SGI Free Software License B v1.1", - osiApproved: false, - url: "http://oss.sgi.com/projects/FreeB/" - }, - "SGI-B-2.0": { - name: "SGI Free Software License B v2.0", - osiApproved: false, - url: "http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf" - }, - "SHL-0.5": { - name: "Solderpad Hardware License v0.5", - osiApproved: false, - url: "https://solderpad.org/licenses/SHL-0.5/" - }, - "SHL-0.51": { - name: "Solderpad Hardware License, Version 0.51", - osiApproved: false, - url: "https://solderpad.org/licenses/SHL-0.51/" - }, - SISSL: { - name: "Sun Industry Standards Source License v1.1", - osiApproved: true, - url: "http://www.openoffice.org/licenses/sissl_license.html" - }, - "SISSL-1.2": { - name: "Sun Industry Standards Source License v1.2", - osiApproved: false, - url: "http://gridscheduler.sourceforge.net/Gridengine_SISSL_license.html" - }, - SMLNJ: { - name: "Standard ML of New Jersey License", - osiApproved: false, - url: "https://www.smlnj.org/license.html" - }, - SMPPL: { - name: "Secure Messaging Protocol Public License", - osiApproved: false, - url: "https://github.com/dcblake/SMP/blob/master/Documentation/License.txt" - }, - SNIA: { - name: "SNIA Public License 1.1", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/SNIA_Public_License" - }, - "SPL-1.0": { - name: "Sun Public License v1.0", - osiApproved: true, - url: "https://opensource.org/licenses/SPL-1.0" - }, - "SSH-OpenSSH": { - name: "SSH OpenSSH license", - osiApproved: false, - url: "https://github.com/openssh/openssh-portable/blob/1b11ea7c58cd5c59838b5fa574cd456d6047b2d4/LICENCE#L10" - }, - "SSH-short": { - name: "SSH short notice", - osiApproved: false, - url: "https://github.com/openssh/openssh-portable/blob/1b11ea7c58cd5c59838b5fa574cd456d6047b2d4/pathnames.h" - }, - "SSPL-1.0": { - name: "Server Side Public License, v 1", - osiApproved: false, - url: "https://www.mongodb.com/licensing/server-side-public-license" - }, - SWL: { - name: "Scheme Widget Library (SWL) Software License Agreement", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/SWL" - }, - Saxpath: { - name: "Saxpath License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Saxpath_License" - }, - Sendmail: { - name: "Sendmail License", - osiApproved: false, - url: "http://www.sendmail.com/pdfs/open_source/sendmail_license.pdf" - }, - "Sendmail-8.23": { - name: "Sendmail License 8.23", - osiApproved: false, - url: "https://www.proofpoint.com/sites/default/files/sendmail-license.pdf" - }, - "SimPL-2.0": { - name: "Simple Public License 2.0", - osiApproved: true, - url: "https://opensource.org/licenses/SimPL-2.0" - }, - Sleepycat: { - name: "Sleepycat License", - osiApproved: true, - url: "https://opensource.org/licenses/Sleepycat" - }, - "Spencer-86": { - name: "Spencer License 86", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Henry_Spencer_Reg-Ex_Library_License" - }, - "Spencer-94": { - name: "Spencer License 94", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Henry_Spencer_Reg-Ex_Library_License" - }, - "Spencer-99": { - name: "Spencer License 99", - osiApproved: false, - url: "http://www.opensource.apple.com/source/tcl/tcl-5/tcl/generic/regfronts.c" - }, - "StandardML-NJ": { - name: "Standard ML of New Jersey License", - osiApproved: false, - url: "http://www.smlnj.org//license.html" - }, - "SugarCRM-1.1.3": { - name: "SugarCRM Public License v1.1.3", - osiApproved: false, - url: "http://www.sugarcrm.com/crm/SPL" - }, - "TAPR-OHL-1.0": { - name: "TAPR Open Hardware License v1.0", - osiApproved: false, - url: "https://www.tapr.org/OHL" - }, - TCL: { - name: "TCL/TK License", - osiApproved: false, - url: "http://www.tcl.tk/software/tcltk/license.html" - }, - "TCP-wrappers": { - name: "TCP Wrappers License", - osiApproved: false, - url: "http://rc.quest.com/topics/openssh/license.php#tcpwrappers" - }, - TMate: { - name: "TMate Open Source License", - osiApproved: false, - url: "http://svnkit.com/license.html" - }, - "TORQUE-1.1": { - name: "TORQUE v2.5+ Software License v1.1", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/TORQUEv1.1" - }, - TOSL: { - name: "Trusster Open Source License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/TOSL" - }, - "TU-Berlin-1.0": { - name: "Technische Universitaet Berlin License 1.0", - osiApproved: false, - url: "https://github.com/swh/ladspa/blob/7bf6f3799fdba70fda297c2d8fd9f526803d9680/gsm/COPYRIGHT" - }, - "TU-Berlin-2.0": { - name: "Technische Universitaet Berlin License 2.0", - osiApproved: false, - url: "https://github.com/CorsixTH/deps/blob/fd339a9f526d1d9c9f01ccf39e438a015da50035/licences/libgsm.txt" - }, - "UCL-1.0": { - name: "Upstream Compatibility License v1.0", - osiApproved: true, - url: "https://opensource.org/licenses/UCL-1.0" - }, - "UPL-1.0": { - name: "Universal Permissive License v1.0", - osiApproved: true, - url: "https://opensource.org/licenses/UPL" - }, - "Unicode-DFS-2015": { - name: "Unicode License Agreement - Data Files and Software (2015)", - osiApproved: false, - url: "https://web.archive.org/web/20151224134844/http://unicode.org/copyright.html" - }, - "Unicode-DFS-2016": { - name: "Unicode License Agreement - Data Files and Software (2016)", - osiApproved: false, - url: "http://www.unicode.org/copyright.html" - }, - "Unicode-TOU": { - name: "Unicode Terms of Use", - osiApproved: false, - url: "http://www.unicode.org/copyright.html" - }, - Unlicense: { - name: "The Unlicense", - osiApproved: false, - url: "https://unlicense.org/" - }, - VOSTROM: { - name: "VOSTROM Public License for Open Source", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/VOSTROM" - }, - "VSL-1.0": { - name: "Vovida Software License v1.0", - osiApproved: true, - url: "https://opensource.org/licenses/VSL-1.0" - }, - Vim: { - name: "Vim License", - osiApproved: false, - url: "http://vimdoc.sourceforge.net/htmldoc/uganda.html" - }, - W3C: { - name: "W3C Software Notice and License (2002-12-31)", - osiApproved: true, - url: "http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231.html" - }, - "W3C-19980720": { - name: "W3C Software Notice and License (1998-07-20)", - osiApproved: false, - url: "http://www.w3.org/Consortium/Legal/copyright-software-19980720.html" - }, - "W3C-20150513": { - name: "W3C Software Notice and Document License (2015-05-13)", - osiApproved: false, - url: "https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document" - }, - WTFPL: { - name: "Do What The F*ck You Want To Public License", - osiApproved: false, - url: "http://sam.zoy.org/wtfpl/COPYING" - }, - "Watcom-1.0": { - name: "Sybase Open Watcom Public License 1.0", - osiApproved: true, - url: "https://opensource.org/licenses/Watcom-1.0" - }, - Wsuipa: { - name: "Wsuipa License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Wsuipa" - }, - X11: { - name: "X11 License", - osiApproved: false, - url: "http://www.xfree86.org/3.3.6/COPYRIGHT2.html#3" - }, - "XFree86-1.1": { - name: "XFree86 License 1.1", - osiApproved: false, - url: "http://www.xfree86.org/current/LICENSE4.html" - }, - XSkat: { - name: "XSkat License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/XSkat_License" - }, - Xerox: { - name: "Xerox License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Xerox" - }, - Xnet: { - name: "X.Net License", - osiApproved: true, - url: "https://opensource.org/licenses/Xnet" - }, - "YPL-1.0": { - name: "Yahoo! Public License v1.0", - osiApproved: false, - url: "http://www.zimbra.com/license/yahoo_public_license_1.0.html" - }, - "YPL-1.1": { - name: "Yahoo! Public License v1.1", - osiApproved: false, - url: "http://www.zimbra.com/license/yahoo_public_license_1.1.html" - }, - "ZPL-1.1": { - name: "Zope Public License 1.1", - osiApproved: false, - url: "http://old.zope.org/Resources/License/ZPL-1.1" - }, - "ZPL-2.0": { - name: "Zope Public License 2.0", - osiApproved: true, - url: "http://old.zope.org/Resources/License/ZPL-2.0" - }, - "ZPL-2.1": { - name: "Zope Public License 2.1", - osiApproved: false, - url: "http://old.zope.org/Resources/ZPL/" - }, - Zed: { - name: "Zed License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Zed" - }, - "Zend-2.0": { - name: "Zend License v2.0", - osiApproved: false, - url: "https://web.archive.org/web/20130517195954/http://www.zend.com/license/2_00.txt" - }, - "Zimbra-1.3": { - name: "Zimbra Public License v1.3", - osiApproved: false, - url: "http://web.archive.org/web/20100302225219/http://www.zimbra.com/license/zimbra-public-license-1-3.html" - }, - "Zimbra-1.4": { - name: "Zimbra Public License v1.4", - osiApproved: false, - url: "http://www.zimbra.com/legal/zimbra-public-license-1-4" - }, - Zlib: { - name: "zlib License", - osiApproved: true, - url: "http://www.zlib.net/zlib_license.html" - }, - blessing: { - name: "SQLite Blessing", - osiApproved: false, - url: "https://www.sqlite.org/src/artifact/e33a4df7e32d742a?ln=4-9" - }, - "bzip2-1.0.5": { - name: "bzip2 and libbzip2 License v1.0.5", - osiApproved: false, - url: "http://bzip.org/1.0.5/bzip2-manual-1.0.5.html" - }, - "bzip2-1.0.6": { - name: "bzip2 and libbzip2 License v1.0.6", - osiApproved: false, - url: "https://github.com/asimonov-im/bzip2/blob/master/LICENSE" - }, - "copyleft-next-0.3.0": { - name: "copyleft-next 0.3.0", - osiApproved: false, - url: "https://github.com/copyleft-next/copyleft-next/blob/master/Releases/copyleft-next-0.3.0" - }, - "copyleft-next-0.3.1": { - name: "copyleft-next 0.3.1", - osiApproved: false, - url: "https://github.com/copyleft-next/copyleft-next/blob/master/Releases/copyleft-next-0.3.1" - }, - curl: { - name: "curl License", - osiApproved: false, - url: "https://github.com/bagder/curl/blob/master/COPYING" - }, - diffmark: { - name: "diffmark license", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/diffmark" - }, - dvipdfm: { - name: "dvipdfm License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/dvipdfm" - }, - "eCos-2.0": { - name: "eCos license version 2.0", - osiApproved: false, - url: "https://www.gnu.org/licenses/ecos-license.html" - }, - eGenix: { - name: "eGenix.com Public License 1.1.0", - osiApproved: false, - url: "http://www.egenix.com/products/eGenix.com-Public-License-1.1.0.pdf" - }, - "etalab-2.0": { - name: "Etalab Open License 2.0", - osiApproved: false, - url: "https://github.com/DISIC/politique-de-contribution-open-source/blob/master/LICENSE.pdf" - }, - "gSOAP-1.3b": { - name: "gSOAP Public License v1.3b", - osiApproved: false, - url: "http://www.cs.fsu.edu/~engelen/license.html" - }, - gnuplot: { - name: "gnuplot License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Gnuplot" - }, - iMatix: { - name: "iMatix Standard Function Library Agreement", - osiApproved: false, - url: "http://legacy.imatix.com/html/sfl/sfl4.htm#license" - }, - "libpng-2.0": { - name: "PNG Reference Library version 2", - osiApproved: false, - url: "http://www.libpng.org/pub/png/src/libpng-LICENSE.txt" - }, - "libselinux-1.0": { - name: "libselinux public domain notice", - osiApproved: false, - url: "https://github.com/SELinuxProject/selinux/blob/master/libselinux/LICENSE" - }, - libtiff: { - name: "libtiff License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/libtiff" - }, - mpich2: { - name: "mpich2 License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/MIT" - }, - psfrag: { - name: "psfrag License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/psfrag" - }, - psutils: { - name: "psutils License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/psutils" - }, - wxWindows: { - name: "wxWindows Library License", - osiApproved: false, - url: "https://opensource.org/licenses/WXwindows" - }, - xinetd: { - name: "xinetd License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/Xinetd_License" - }, - xpp: { - name: "XPP License", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/xpp" - }, - "zlib-acknowledgement": { - name: "zlib/libpng License with Acknowledgement", - osiApproved: false, - url: "https://fedoraproject.org/wiki/Licensing/ZlibWithAcknowledgement" - } - }; - } -}); - -// ../../node_modules/@ovyerus/licenses/index.js -var require_licenses = __commonJS({ - "../../node_modules/@ovyerus/licenses/index.js"(exports, module) { - "use strict"; - module.exports = require_spdx(); - } -}); - -// ../../node_modules/fuzzy-search/dist/FuzzySearch.js -var require_FuzzySearch = __commonJS({ - "../../node_modules/fuzzy-search/dist/FuzzySearch.js"(exports, module) { - !function(e, t) { - "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.FuzzySearch = t() : e.FuzzySearch = t(); - }("undefined" != typeof window ? window : exports, function() { - return function(e) { - var t = {}; - function n(r) { - if (t[r]) - return t[r].exports; - var o = t[r] = { i: r, l: false, exports: {} }; - return e[r].call(o.exports, o, o.exports, n), o.l = true, o.exports; - } - return n.m = e, n.c = t, n.d = function(e2, t2, r) { - n.o(e2, t2) || Object.defineProperty(e2, t2, { enumerable: true, get: r }); - }, n.r = function(e2) { - "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e2, "__esModule", { value: true }); - }, n.t = function(e2, t2) { - if (1 & t2 && (e2 = n(e2)), 8 & t2) - return e2; - if (4 & t2 && "object" == typeof e2 && e2 && e2.__esModule) - return e2; - var r = /* @__PURE__ */ Object.create(null); - if (n.r(r), Object.defineProperty(r, "default", { enumerable: true, value: e2 }), 2 & t2 && "string" != typeof e2) - for (var o in e2) - n.d(r, o, function(t3) { - return e2[t3]; - }.bind(null, o)); - return r; - }, n.n = function(e2) { - var t2 = e2 && e2.__esModule ? function() { - return e2.default; - } : function() { - return e2; - }; - return n.d(t2, "a", t2), t2; - }, n.o = function(e2, t2) { - return Object.prototype.hasOwnProperty.call(e2, t2); - }, n.p = "/", n(n.s = 0); - }([function(e, t, n) { - e.exports = n(1); - }, function(e, t, n) { - "use strict"; - function r(e2, t2) { - for (var n2 = 0; n2 < t2.length; n2++) { - var r2 = t2[n2]; - r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(e2, r2.key, r2); - } - } - n.r(t); - var o = function() { - function e2() { - !function(e3, t3) { - if (!(e3 instanceof t3)) - throw new TypeError("Cannot call a class as a function"); - }(this, e2); - } - var t2, n2, o2; - return t2 = e2, o2 = [{ key: "getDescendantProperty", value: function(t3, n3) { - var r2, o3, i2, a2, u2, s, c = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []; - if (n3) { - if (-1 === (i2 = n3.indexOf(".")) ? r2 = n3 : (r2 = n3.slice(0, i2), o3 = n3.slice(i2 + 1)), null != (a2 = t3[r2])) - if (o3 || "string" != typeof a2 && "number" != typeof a2) - if ("[object Array]" === Object.prototype.toString.call(a2)) - for (u2 = 0, s = a2.length; u2 < s; u2++) - e2.getDescendantProperty(a2[u2], o3, c); - else - o3 && e2.getDescendantProperty(a2, o3, c); - else - c.push(a2); - } else - c.push(t3); - return c; - } }], (n2 = null) && r(t2.prototype, n2), o2 && r(t2, o2), e2; - }(); - function i(e2, t2) { - if (!(e2 instanceof t2)) - throw new TypeError("Cannot call a class as a function"); - } - function a(e2, t2) { - for (var n2 = 0; n2 < t2.length; n2++) { - var r2 = t2[n2]; - r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(e2, r2.key, r2); - } - } - n.d(t, "default", function() { - return u; - }); - var u = function() { - function e2() { - var t3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], n3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], r3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - i(this, e2), Array.isArray(n3) || (r3 = n3, n3 = []), this.haystack = t3, this.keys = n3, this.options = Object.assign({ caseSensitive: false, sort: false }, r3); - } - var t2, n2, r2; - return t2 = e2, r2 = [{ key: "isMatch", value: function(e3, t3, n3) { - e3 = String(e3), t3 = String(t3), n3 || (e3 = e3.toLocaleLowerCase(), t3 = t3.toLocaleLowerCase()); - for (var r3 = t3.split(""), o2 = [], i2 = 0, a2 = 0; a2 < r3.length; a2++) { - var u2 = r3[a2]; - if (-1 === (i2 = e3.indexOf(u2, i2))) - return false; - o2.push(i2), i2++; - } - return e3 === t3 ? 1 : o2.length > 1 ? o2[o2.length - 1] - o2[0] + 2 : 2 + o2[0]; - } }], (n2 = [{ key: "search", value: function() { - var t3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; - if ("" === t3) - return this.haystack; - for (var n3 = [], r3 = 0; r3 < this.haystack.length; r3++) { - var i2 = this.haystack[r3]; - if (0 === this.keys.length) { - var a2 = e2.isMatch(i2, t3, this.options.caseSensitive); - a2 && n3.push({ item: i2, score: a2 }); - } else - for (var u2 = 0; u2 < this.keys.length; u2++) { - for (var s = o.getDescendantProperty(i2, this.keys[u2]), c = false, f = 0; f < s.length; f++) { - var l = e2.isMatch(s[f], t3, this.options.caseSensitive); - if (l) { - c = true, n3.push({ item: i2, score: l }); - break; - } - } - if (c) - break; - } - } - return this.options.sort && n3.sort(function(e3, t4) { - return e3.score - t4.score; - }), n3.map(function(e3) { - return e3.item; - }); - } }]) && a(t2.prototype, n2), r2 && a(t2, r2), e2; - }(); - }]).default; - }); - } -}); - -// ../../node_modules/license/dist/findLicense.js -var require_findLicense = __commonJS({ - "../../node_modules/license/dist/findLicense.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - var licenses_1 = __importDefault(require_licenses()); - var fuzzy_search_1 = __importDefault(require_FuzzySearch()); - var searcher = new fuzzy_search_1.default(Object.keys(licenses_1.default), [], { sort: true }); - var osiOnlySearcher = new fuzzy_search_1.default(Object.entries(licenses_1.default).filter(([, { osiApproved }]) => osiApproved).map(([identifier]) => identifier), [], { sort: true }); - function findLicense(search, osiOnly = true) { - const searchIn = osiOnly ? osiOnlySearcher : searcher; - const matches = searchIn.search(search); - const [first] = matches; - if ((first === null || first === void 0 ? void 0 : first.toLowerCase()) === search.toLowerCase()) - return [first]; - else - return matches; - } - exports.findLicense = findLicense; - exports.default = findLicense; - } -}); - -// ../../node_modules/license/dist/index.js -var require_dist = __commonJS({ - "../../node_modules/license/dist/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var getLicense_1 = require_getLicense(); - exports.default = getLicense_1.default; - exports.getLicense = getLicense_1.getLicense; - var findLicense_1 = require_findLicense(); - exports.findLicense = findLicense_1.findLicense; - } -}); - -// ../core/dist/license.js -var import_license; -var init_license = __esm({ - "../core/dist/license.js"() { - "use strict"; - import_license = __toESM(require_dist(), 1); - init_file(); - } -}); - -// ../../node_modules/yocto-queue/index.js -var Node, Queue; -var init_yocto_queue = __esm({ - "../../node_modules/yocto-queue/index.js"() { - Node = class { - value; - next; - constructor(value) { - this.value = value; - } - }; - Queue = class { - #head; - #tail; - #size; - constructor() { - this.clear(); - } - enqueue(value) { - const node = new Node(value); - if (this.#head) { - this.#tail.next = node; - this.#tail = node; - } else { - this.#head = node; - this.#tail = node; - } - this.#size++; - } - dequeue() { - const current = this.#head; - if (!current) { - return; - } - this.#head = this.#head.next; - this.#size--; - return current.value; - } - clear() { - this.#head = void 0; - this.#tail = void 0; - this.#size = 0; - } - get size() { - return this.#size; - } - *[Symbol.iterator]() { - let current = this.#head; - while (current) { - yield current.value; - current = current.next; - } - } - }; - } -}); - -// ../../node_modules/p-limit/index.js -function pLimit(concurrency) { - if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) { - throw new TypeError("Expected `concurrency` to be a number from 1 and up"); - } - const queue = new Queue(); - let activeCount = 0; - const next = () => { - activeCount--; - if (queue.size > 0) { - queue.dequeue()(); - } - }; - const run2 = async (fn, resolve3, args) => { - activeCount++; - const result = (async () => fn(...args))(); - resolve3(result); - try { - await result; - } catch { - } - next(); - }; - const enqueue2 = (fn, resolve3, args) => { - queue.enqueue(run2.bind(void 0, fn, resolve3, args)); - (async () => { - await Promise.resolve(); - if (activeCount < concurrency && queue.size > 0) { - queue.dequeue()(); - } - })(); - }; - const generator = (fn, ...args) => new Promise((resolve3) => { - enqueue2(fn, resolve3, args); - }); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.size - }, - clearQueue: { - value: () => { - queue.clear(); - } - } - }); - return generator; -} -var init_p_limit = __esm({ - "../../node_modules/p-limit/index.js"() { - init_yocto_queue(); - } -}); - -// ../../node_modules/p-locate/index.js -async function pLocate(iterable, tester, { - concurrency = Number.POSITIVE_INFINITY, - preserveOrder = true -} = {}) { - const limit = pLimit(concurrency); - const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]); - const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY); - try { - await Promise.all(items.map((element) => checkLimit(finder, element))); - } catch (error) { - if (error instanceof EndError) { - return error.value; - } - throw error; - } -} -var EndError, testElement, finder; -var init_p_locate = __esm({ - "../../node_modules/p-locate/index.js"() { - init_p_limit(); - EndError = class extends Error { - constructor(value) { - super(); - this.value = value; - } - }; - testElement = async (element, tester) => tester(await element); - finder = async (element) => { - const values = await Promise.all(element); - if (values[1] === true) { - throw new EndError(values[0]); - } - return false; - }; - } -}); - -// ../../node_modules/locate-path/index.js -import process10 from "process"; -import path from "path"; -import fs4, { promises as fsPromises } from "fs"; -import { fileURLToPath } from "url"; -function checkType(type) { - if (Object.hasOwnProperty.call(typeMappings, type)) { - return; - } - throw new Error(`Invalid type specified: ${type}`); -} -async function locatePath(paths, { - cwd = process10.cwd(), - type = "file", - allowSymlinks = true, - concurrency, - preserveOrder -} = {}) { - checkType(type); - cwd = toPath(cwd); - const statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat; - return pLocate(paths, async (path_) => { - try { - const stat = await statFunction(path.resolve(cwd, path_)); - return matchType(type, stat); - } catch { - return false; - } - }, { concurrency, preserveOrder }); -} -var typeMappings, matchType, toPath; -var init_locate_path = __esm({ - "../../node_modules/locate-path/index.js"() { - init_p_locate(); - typeMappings = { - directory: "isDirectory", - file: "isFile" - }; - matchType = (type, stat) => stat[typeMappings[type]](); - toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath; - } -}); - -// ../../node_modules/path-exists/index.js -var init_path_exists = __esm({ - "../../node_modules/path-exists/index.js"() { - } -}); - -// ../../node_modules/pkg-up/node_modules/find-up/index.js -import path2 from "path"; -import { fileURLToPath as fileURLToPath2 } from "url"; -async function findUpMultiple(name, options = {}) { - let directory = path2.resolve(toPath2(options.cwd) || ""); - const { root } = path2.parse(directory); - const stopAt = path2.resolve(directory, options.stopAt || root); - const limit = options.limit || Number.POSITIVE_INFINITY; - const paths = [name].flat(); - const runMatcher = async (locateOptions) => { - if (typeof name !== "function") { - return locatePath(paths, locateOptions); - } - const foundPath = await name(locateOptions.cwd); - if (typeof foundPath === "string") { - return locatePath([foundPath], locateOptions); - } - return foundPath; - }; - const matches = []; - while (true) { - const foundPath = await runMatcher({ ...options, cwd: directory }); - if (foundPath === findUpStop) { - break; - } - if (foundPath) { - matches.push(path2.resolve(directory, foundPath)); - } - if (directory === stopAt || matches.length >= limit) { - break; - } - directory = path2.dirname(directory); - } - return matches; -} -async function findUp(name, options = {}) { - const matches = await findUpMultiple(name, { ...options, limit: 1 }); - return matches[0]; -} -var toPath2, findUpStop; -var init_find_up = __esm({ - "../../node_modules/pkg-up/node_modules/find-up/index.js"() { - init_locate_path(); - init_path_exists(); - toPath2 = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath; - findUpStop = Symbol("findUpStop"); - } -}); - -// ../../node_modules/pkg-up/index.js -async function pkgUp({ cwd } = {}) { - return findUp("package.json", { cwd }); -} -var init_pkg_up = __esm({ - "../../node_modules/pkg-up/index.js"() { - init_find_up(); - } -}); - -// ../core/dist/workspace.js -import { basename, dirname as dirname2, join } from "path"; -async function isWorkspace({ directory }) { - if (!await hasPackage({ directory })) { - return false; - } - if (await getMonorepoDirectory({ directory })) { - return true; - } - return false; -} -async function getMonorepoDirectory({ directory }) { - const path5 = await pkgUp({ cwd: dirname2(directory) }); - if (!path5) { - return; - } - const parentPackageDirectory = dirname2(path5); - return await isMonorepo({ directory: parentPackageDirectory }) ? parentPackageDirectory : void 0; -} -var init_workspace = __esm({ - "../core/dist/workspace.js"() { - "use strict"; - init_pkg_up(); - init_directory(); - init_file(); - init_monorepo(); - init_package(); - } -}); - -// ../../node_modules/yaml/dist/nodes/identity.js -var require_identity = __commonJS({ - "../../node_modules/yaml/dist/nodes/identity.js"(exports) { - "use strict"; - var ALIAS = Symbol.for("yaml.alias"); - var DOC = Symbol.for("yaml.document"); - var MAP = Symbol.for("yaml.map"); - var PAIR = Symbol.for("yaml.pair"); - var SCALAR = Symbol.for("yaml.scalar"); - var SEQ = Symbol.for("yaml.seq"); - var NODE_TYPE = Symbol.for("yaml.node.type"); - var isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS; - var isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC; - var isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP; - var isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR; - var isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR; - var isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ; - function isCollection(node) { - if (node && typeof node === "object") - switch (node[NODE_TYPE]) { - case MAP: - case SEQ: - return true; - } - return false; - } - function isNode(node) { - if (node && typeof node === "object") - switch (node[NODE_TYPE]) { - case ALIAS: - case MAP: - case SCALAR: - case SEQ: - return true; - } - return false; - } - var hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor; - exports.ALIAS = ALIAS; - exports.DOC = DOC; - exports.MAP = MAP; - exports.NODE_TYPE = NODE_TYPE; - exports.PAIR = PAIR; - exports.SCALAR = SCALAR; - exports.SEQ = SEQ; - exports.hasAnchor = hasAnchor; - exports.isAlias = isAlias; - exports.isCollection = isCollection; - exports.isDocument = isDocument; - exports.isMap = isMap; - exports.isNode = isNode; - exports.isPair = isPair; - exports.isScalar = isScalar; - exports.isSeq = isSeq; - } -}); - -// ../../node_modules/yaml/dist/visit.js -var require_visit = __commonJS({ - "../../node_modules/yaml/dist/visit.js"(exports) { - "use strict"; - var identity = require_identity(); - var BREAK = Symbol("break visit"); - var SKIP = Symbol("skip children"); - var REMOVE = Symbol("remove node"); - function visit(node, visitor) { - const visitor_ = initVisitor(visitor); - if (identity.isDocument(node)) { - const cd = visit_(null, node.contents, visitor_, Object.freeze([node])); - if (cd === REMOVE) - node.contents = null; - } else - visit_(null, node, visitor_, Object.freeze([])); - } - visit.BREAK = BREAK; - visit.SKIP = SKIP; - visit.REMOVE = REMOVE; - function visit_(key, node, visitor, path5) { - const ctrl = callVisitor(key, node, visitor, path5); - if (identity.isNode(ctrl) || identity.isPair(ctrl)) { - replaceNode(key, path5, ctrl); - return visit_(key, ctrl, visitor, path5); - } - if (typeof ctrl !== "symbol") { - if (identity.isCollection(node)) { - path5 = Object.freeze(path5.concat(node)); - for (let i = 0; i < node.items.length; ++i) { - const ci = visit_(i, node.items[i], visitor, path5); - if (typeof ci === "number") - i = ci - 1; - else if (ci === BREAK) - return BREAK; - else if (ci === REMOVE) { - node.items.splice(i, 1); - i -= 1; - } - } - } else if (identity.isPair(node)) { - path5 = Object.freeze(path5.concat(node)); - const ck = visit_("key", node.key, visitor, path5); - if (ck === BREAK) - return BREAK; - else if (ck === REMOVE) - node.key = null; - const cv = visit_("value", node.value, visitor, path5); - if (cv === BREAK) - return BREAK; - else if (cv === REMOVE) - node.value = null; - } - } - return ctrl; - } - async function visitAsync(node, visitor) { - const visitor_ = initVisitor(visitor); - if (identity.isDocument(node)) { - const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node])); - if (cd === REMOVE) - node.contents = null; - } else - await visitAsync_(null, node, visitor_, Object.freeze([])); - } - visitAsync.BREAK = BREAK; - visitAsync.SKIP = SKIP; - visitAsync.REMOVE = REMOVE; - async function visitAsync_(key, node, visitor, path5) { - const ctrl = await callVisitor(key, node, visitor, path5); - if (identity.isNode(ctrl) || identity.isPair(ctrl)) { - replaceNode(key, path5, ctrl); - return visitAsync_(key, ctrl, visitor, path5); - } - if (typeof ctrl !== "symbol") { - if (identity.isCollection(node)) { - path5 = Object.freeze(path5.concat(node)); - for (let i = 0; i < node.items.length; ++i) { - const ci = await visitAsync_(i, node.items[i], visitor, path5); - if (typeof ci === "number") - i = ci - 1; - else if (ci === BREAK) - return BREAK; - else if (ci === REMOVE) { - node.items.splice(i, 1); - i -= 1; - } - } - } else if (identity.isPair(node)) { - path5 = Object.freeze(path5.concat(node)); - const ck = await visitAsync_("key", node.key, visitor, path5); - if (ck === BREAK) - return BREAK; - else if (ck === REMOVE) - node.key = null; - const cv = await visitAsync_("value", node.value, visitor, path5); - if (cv === BREAK) - return BREAK; - else if (cv === REMOVE) - node.value = null; - } - } - return ctrl; - } - function initVisitor(visitor) { - if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) { - return Object.assign({ - Alias: visitor.Node, - Map: visitor.Node, - Scalar: visitor.Node, - Seq: visitor.Node - }, visitor.Value && { - Map: visitor.Value, - Scalar: visitor.Value, - Seq: visitor.Value - }, visitor.Collection && { - Map: visitor.Collection, - Seq: visitor.Collection - }, visitor); - } - return visitor; - } - function callVisitor(key, node, visitor, path5) { - if (typeof visitor === "function") - return visitor(key, node, path5); - if (identity.isMap(node)) - return visitor.Map?.(key, node, path5); - if (identity.isSeq(node)) - return visitor.Seq?.(key, node, path5); - if (identity.isPair(node)) - return visitor.Pair?.(key, node, path5); - if (identity.isScalar(node)) - return visitor.Scalar?.(key, node, path5); - if (identity.isAlias(node)) - return visitor.Alias?.(key, node, path5); - return void 0; - } - function replaceNode(key, path5, node) { - const parent = path5[path5.length - 1]; - if (identity.isCollection(parent)) { - parent.items[key] = node; - } else if (identity.isPair(parent)) { - if (key === "key") - parent.key = node; - else - parent.value = node; - } else if (identity.isDocument(parent)) { - parent.contents = node; - } else { - const pt = identity.isAlias(parent) ? "alias" : "scalar"; - throw new Error(`Cannot replace node with ${pt} parent`); - } - } - exports.visit = visit; - exports.visitAsync = visitAsync; - } -}); - -// ../../node_modules/yaml/dist/doc/directives.js -var require_directives = __commonJS({ - "../../node_modules/yaml/dist/doc/directives.js"(exports) { - "use strict"; - var identity = require_identity(); - var visit = require_visit(); - var escapeChars = { - "!": "%21", - ",": "%2C", - "[": "%5B", - "]": "%5D", - "{": "%7B", - "}": "%7D" - }; - var escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, (ch) => escapeChars[ch]); - var Directives = class { - constructor(yaml2, tags) { - this.docStart = null; - this.docEnd = false; - this.yaml = Object.assign({}, Directives.defaultYaml, yaml2); - this.tags = Object.assign({}, Directives.defaultTags, tags); - } - clone() { - const copy = new Directives(this.yaml, this.tags); - copy.docStart = this.docStart; - return copy; - } - /** - * During parsing, get a Directives instance for the current document and - * update the stream state according to the current version's spec. - */ - atDocument() { - const res = new Directives(this.yaml, this.tags); - switch (this.yaml.version) { - case "1.1": - this.atNextDocument = true; - break; - case "1.2": - this.atNextDocument = false; - this.yaml = { - explicit: Directives.defaultYaml.explicit, - version: "1.2" - }; - this.tags = Object.assign({}, Directives.defaultTags); - break; - } - return res; - } - /** - * @param onError - May be called even if the action was successful - * @returns `true` on success - */ - add(line, onError) { - if (this.atNextDocument) { - this.yaml = { explicit: Directives.defaultYaml.explicit, version: "1.1" }; - this.tags = Object.assign({}, Directives.defaultTags); - this.atNextDocument = false; - } - const parts = line.trim().split(/[ \t]+/); - const name = parts.shift(); - switch (name) { - case "%TAG": { - if (parts.length !== 2) { - onError(0, "%TAG directive should contain exactly two parts"); - if (parts.length < 2) - return false; - } - const [handle, prefix] = parts; - this.tags[handle] = prefix; - return true; - } - case "%YAML": { - this.yaml.explicit = true; - if (parts.length !== 1) { - onError(0, "%YAML directive should contain exactly one part"); - return false; - } - const [version2] = parts; - if (version2 === "1.1" || version2 === "1.2") { - this.yaml.version = version2; - return true; - } else { - const isValid = /^\d+\.\d+$/.test(version2); - onError(6, `Unsupported YAML version ${version2}`, isValid); - return false; - } - } - default: - onError(0, `Unknown directive ${name}`, true); - return false; - } - } - /** - * Resolves a tag, matching handles to those defined in %TAG directives. - * - * @returns Resolved tag, which may also be the non-specific tag `'!'` or a - * `'!local'` tag, or `null` if unresolvable. - */ - tagName(source, onError) { - if (source === "!") - return "!"; - if (source[0] !== "!") { - onError(`Not a valid tag: ${source}`); - return null; - } - if (source[1] === "<") { - const verbatim = source.slice(2, -1); - if (verbatim === "!" || verbatim === "!!") { - onError(`Verbatim tags aren't resolved, so ${source} is invalid.`); - return null; - } - if (source[source.length - 1] !== ">") - onError("Verbatim tags must end with a >"); - return verbatim; - } - const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/); - if (!suffix) - onError(`The ${source} tag has no suffix`); - const prefix = this.tags[handle]; - if (prefix) - return prefix + decodeURIComponent(suffix); - if (handle === "!") - return source; - onError(`Could not resolve tag: ${source}`); - return null; - } - /** - * Given a fully resolved tag, returns its printable string form, - * taking into account current tag prefixes and defaults. - */ - tagString(tag) { - for (const [handle, prefix] of Object.entries(this.tags)) { - if (tag.startsWith(prefix)) - return handle + escapeTagName(tag.substring(prefix.length)); - } - return tag[0] === "!" ? tag : `!<${tag}>`; - } - toString(doc) { - const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : []; - const tagEntries = Object.entries(this.tags); - let tagNames; - if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) { - const tags = {}; - visit.visit(doc.contents, (_key, node) => { - if (identity.isNode(node) && node.tag) - tags[node.tag] = true; - }); - tagNames = Object.keys(tags); - } else - tagNames = []; - for (const [handle, prefix] of tagEntries) { - if (handle === "!!" && prefix === "tag:yaml.org,2002:") - continue; - if (!doc || tagNames.some((tn) => tn.startsWith(prefix))) - lines.push(`%TAG ${handle} ${prefix}`); - } - return lines.join("\n"); - } - }; - Directives.defaultYaml = { explicit: false, version: "1.2" }; - Directives.defaultTags = { "!!": "tag:yaml.org,2002:" }; - exports.Directives = Directives; - } -}); - -// ../../node_modules/yaml/dist/doc/anchors.js -var require_anchors = __commonJS({ - "../../node_modules/yaml/dist/doc/anchors.js"(exports) { - "use strict"; - var identity = require_identity(); - var visit = require_visit(); - function anchorIsValid(anchor) { - if (/[\x00-\x19\s,[\]{}]/.test(anchor)) { - const sa = JSON.stringify(anchor); - const msg = `Anchor must not contain whitespace or control characters: ${sa}`; - throw new Error(msg); - } - return true; - } - function anchorNames(root) { - const anchors = /* @__PURE__ */ new Set(); - visit.visit(root, { - Value(_key, node) { - if (node.anchor) - anchors.add(node.anchor); - } - }); - return anchors; - } - function findNewAnchor(prefix, exclude) { - for (let i = 1; true; ++i) { - const name = `${prefix}${i}`; - if (!exclude.has(name)) - return name; - } - } - function createNodeAnchors(doc, prefix) { - const aliasObjects = []; - const sourceObjects = /* @__PURE__ */ new Map(); - let prevAnchors = null; - return { - onAnchor: (source) => { - aliasObjects.push(source); - if (!prevAnchors) - prevAnchors = anchorNames(doc); - const anchor = findNewAnchor(prefix, prevAnchors); - prevAnchors.add(anchor); - return anchor; - }, - /** - * With circular references, the source node is only resolved after all - * of its child nodes are. This is why anchors are set only after all of - * the nodes have been created. - */ - setAnchors: () => { - for (const source of aliasObjects) { - const ref = sourceObjects.get(source); - if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) { - ref.node.anchor = ref.anchor; - } else { - const error = new Error("Failed to resolve repeated object (this should not happen)"); - error.source = source; - throw error; - } - } - }, - sourceObjects - }; - } - exports.anchorIsValid = anchorIsValid; - exports.anchorNames = anchorNames; - exports.createNodeAnchors = createNodeAnchors; - exports.findNewAnchor = findNewAnchor; - } -}); - -// ../../node_modules/yaml/dist/doc/applyReviver.js -var require_applyReviver = __commonJS({ - "../../node_modules/yaml/dist/doc/applyReviver.js"(exports) { - "use strict"; - function applyReviver(reviver, obj, key, val) { - if (val && typeof val === "object") { - if (Array.isArray(val)) { - for (let i = 0, len = val.length; i < len; ++i) { - const v0 = val[i]; - const v12 = applyReviver(reviver, val, String(i), v0); - if (v12 === void 0) - delete val[i]; - else if (v12 !== v0) - val[i] = v12; - } - } else if (val instanceof Map) { - for (const k of Array.from(val.keys())) { - const v0 = val.get(k); - const v12 = applyReviver(reviver, val, k, v0); - if (v12 === void 0) - val.delete(k); - else if (v12 !== v0) - val.set(k, v12); - } - } else if (val instanceof Set) { - for (const v0 of Array.from(val)) { - const v12 = applyReviver(reviver, val, v0, v0); - if (v12 === void 0) - val.delete(v0); - else if (v12 !== v0) { - val.delete(v0); - val.add(v12); - } - } - } else { - for (const [k, v0] of Object.entries(val)) { - const v12 = applyReviver(reviver, val, k, v0); - if (v12 === void 0) - delete val[k]; - else if (v12 !== v0) - val[k] = v12; - } - } - } - return reviver.call(obj, key, val); - } - exports.applyReviver = applyReviver; - } -}); - -// ../../node_modules/yaml/dist/nodes/toJS.js -var require_toJS = __commonJS({ - "../../node_modules/yaml/dist/nodes/toJS.js"(exports) { - "use strict"; - var identity = require_identity(); - function toJS(value, arg, ctx) { - if (Array.isArray(value)) - return value.map((v, i) => toJS(v, String(i), ctx)); - if (value && typeof value.toJSON === "function") { - if (!ctx || !identity.hasAnchor(value)) - return value.toJSON(arg, ctx); - const data = { aliasCount: 0, count: 1, res: void 0 }; - ctx.anchors.set(value, data); - ctx.onCreate = (res2) => { - data.res = res2; - delete ctx.onCreate; - }; - const res = value.toJSON(arg, ctx); - if (ctx.onCreate) - ctx.onCreate(res); - return res; - } - if (typeof value === "bigint" && !ctx?.keep) - return Number(value); - return value; - } - exports.toJS = toJS; - } -}); - -// ../../node_modules/yaml/dist/nodes/Node.js -var require_Node = __commonJS({ - "../../node_modules/yaml/dist/nodes/Node.js"(exports) { - "use strict"; - var applyReviver = require_applyReviver(); - var identity = require_identity(); - var toJS = require_toJS(); - var NodeBase = class { - constructor(type) { - Object.defineProperty(this, identity.NODE_TYPE, { value: type }); - } - /** Create a copy of this node. */ - clone() { - const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); - if (this.range) - copy.range = this.range.slice(); - return copy; - } - /** A plain JavaScript representation of this node. */ - toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { - if (!identity.isDocument(doc)) - throw new TypeError("A document argument is required"); - const ctx = { - anchors: /* @__PURE__ */ new Map(), - doc, - keep: true, - mapAsMap: mapAsMap === true, - mapKeyWarned: false, - maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 - }; - const res = toJS.toJS(this, "", ctx); - if (typeof onAnchor === "function") - for (const { count, res: res2 } of ctx.anchors.values()) - onAnchor(res2, count); - return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res; - } - }; - exports.NodeBase = NodeBase; - } -}); - -// ../../node_modules/yaml/dist/nodes/Alias.js -var require_Alias = __commonJS({ - "../../node_modules/yaml/dist/nodes/Alias.js"(exports) { - "use strict"; - var anchors = require_anchors(); - var visit = require_visit(); - var identity = require_identity(); - var Node2 = require_Node(); - var toJS = require_toJS(); - var Alias = class extends Node2.NodeBase { - constructor(source) { - super(identity.ALIAS); - this.source = source; - Object.defineProperty(this, "tag", { - set() { - throw new Error("Alias nodes cannot have tags"); - } - }); - } - /** - * Resolve the value of this alias within `doc`, finding the last - * instance of the `source` anchor before this node. - */ - resolve(doc) { - let found = void 0; - visit.visit(doc, { - Node: (_key, node) => { - if (node === this) - return visit.visit.BREAK; - if (node.anchor === this.source) - found = node; - } - }); - return found; - } - toJSON(_arg, ctx) { - if (!ctx) - return { source: this.source }; - const { anchors: anchors2, doc, maxAliasCount } = ctx; - const source = this.resolve(doc); - if (!source) { - const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; - throw new ReferenceError(msg); - } - let data = anchors2.get(source); - if (!data) { - toJS.toJS(source, null, ctx); - data = anchors2.get(source); - } - if (!data || data.res === void 0) { - const msg = "This should not happen: Alias anchor was not resolved?"; - throw new ReferenceError(msg); - } - if (maxAliasCount >= 0) { - data.count += 1; - if (data.aliasCount === 0) - data.aliasCount = getAliasCount(doc, source, anchors2); - if (data.count * data.aliasCount > maxAliasCount) { - const msg = "Excessive alias count indicates a resource exhaustion attack"; - throw new ReferenceError(msg); - } - } - return data.res; - } - toString(ctx, _onComment, _onChompKeep) { - const src = `*${this.source}`; - if (ctx) { - anchors.anchorIsValid(this.source); - if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) { - const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; - throw new Error(msg); - } - if (ctx.implicitKey) - return `${src} `; - } - return src; - } - }; - function getAliasCount(doc, node, anchors2) { - if (identity.isAlias(node)) { - const source = node.resolve(doc); - const anchor = anchors2 && source && anchors2.get(source); - return anchor ? anchor.count * anchor.aliasCount : 0; - } else if (identity.isCollection(node)) { - let count = 0; - for (const item of node.items) { - const c = getAliasCount(doc, item, anchors2); - if (c > count) - count = c; - } - return count; - } else if (identity.isPair(node)) { - const kc = getAliasCount(doc, node.key, anchors2); - const vc = getAliasCount(doc, node.value, anchors2); - return Math.max(kc, vc); - } - return 1; - } - exports.Alias = Alias; - } -}); - -// ../../node_modules/yaml/dist/nodes/Scalar.js -var require_Scalar = __commonJS({ - "../../node_modules/yaml/dist/nodes/Scalar.js"(exports) { - "use strict"; - var identity = require_identity(); - var Node2 = require_Node(); - var toJS = require_toJS(); - var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object"; - var Scalar = class extends Node2.NodeBase { - constructor(value) { - super(identity.SCALAR); - this.value = value; - } - toJSON(arg, ctx) { - return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx); - } - toString() { - return String(this.value); - } - }; - Scalar.BLOCK_FOLDED = "BLOCK_FOLDED"; - Scalar.BLOCK_LITERAL = "BLOCK_LITERAL"; - Scalar.PLAIN = "PLAIN"; - Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE"; - Scalar.QUOTE_SINGLE = "QUOTE_SINGLE"; - exports.Scalar = Scalar; - exports.isScalarValue = isScalarValue; - } -}); - -// ../../node_modules/yaml/dist/doc/createNode.js -var require_createNode = __commonJS({ - "../../node_modules/yaml/dist/doc/createNode.js"(exports) { - "use strict"; - var Alias = require_Alias(); - var identity = require_identity(); - var Scalar = require_Scalar(); - var defaultTagPrefix = "tag:yaml.org,2002:"; - function findTagObject(value, tagName, tags) { - if (tagName) { - const match = tags.filter((t) => t.tag === tagName); - const tagObj = match.find((t) => !t.format) ?? match[0]; - if (!tagObj) - throw new Error(`Tag ${tagName} not found`); - return tagObj; - } - return tags.find((t) => t.identify?.(value) && !t.format); - } - function createNode(value, tagName, ctx) { - if (identity.isDocument(value)) - value = value.contents; - if (identity.isNode(value)) - return value; - if (identity.isPair(value)) { - const map = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx); - map.items.push(value); - return map; - } - if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) { - value = value.valueOf(); - } - const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx; - let ref = void 0; - if (aliasDuplicateObjects && value && typeof value === "object") { - ref = sourceObjects.get(value); - if (ref) { - if (!ref.anchor) - ref.anchor = onAnchor(value); - return new Alias.Alias(ref.anchor); - } else { - ref = { anchor: null, node: null }; - sourceObjects.set(value, ref); - } - } - if (tagName?.startsWith("!!")) - tagName = defaultTagPrefix + tagName.slice(2); - let tagObj = findTagObject(value, tagName, schema.tags); - if (!tagObj) { - if (value && typeof value.toJSON === "function") { - value = value.toJSON(); - } - if (!value || typeof value !== "object") { - const node2 = new Scalar.Scalar(value); - if (ref) - ref.node = node2; - return node2; - } - tagObj = value instanceof Map ? schema[identity.MAP] : Symbol.iterator in Object(value) ? schema[identity.SEQ] : schema[identity.MAP]; - } - if (onTagObj) { - onTagObj(tagObj); - delete ctx.onTagObj; - } - const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar.Scalar(value); - if (tagName) - node.tag = tagName; - else if (!tagObj.default) - node.tag = tagObj.tag; - if (ref) - ref.node = node; - return node; - } - exports.createNode = createNode; - } -}); - -// ../../node_modules/yaml/dist/nodes/Collection.js -var require_Collection = __commonJS({ - "../../node_modules/yaml/dist/nodes/Collection.js"(exports) { - "use strict"; - var createNode = require_createNode(); - var identity = require_identity(); - var Node2 = require_Node(); - function collectionFromPath(schema, path5, value) { - let v = value; - for (let i = path5.length - 1; i >= 0; --i) { - const k = path5[i]; - if (typeof k === "number" && Number.isInteger(k) && k >= 0) { - const a = []; - a[k] = v; - v = a; - } else { - v = /* @__PURE__ */ new Map([[k, v]]); - } - } - return createNode.createNode(v, void 0, { - aliasDuplicateObjects: false, - keepUndefined: false, - onAnchor: () => { - throw new Error("This should not happen, please report a bug."); - }, - schema, - sourceObjects: /* @__PURE__ */ new Map() - }); - } - var isEmptyPath = (path5) => path5 == null || typeof path5 === "object" && !!path5[Symbol.iterator]().next().done; - var Collection = class extends Node2.NodeBase { - constructor(type, schema) { - super(type); - Object.defineProperty(this, "schema", { - value: schema, - configurable: true, - enumerable: false, - writable: true - }); - } - /** - * Create a copy of this collection. - * - * @param schema - If defined, overwrites the original's schema - */ - clone(schema) { - const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); - if (schema) - copy.schema = schema; - copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it); - if (this.range) - copy.range = this.range.slice(); - return copy; - } - /** - * Adds a value to the collection. For `!!map` and `!!omap` the value must - * be a Pair instance or a `{ key, value }` object, which may not have a key - * that already exists in the map. - */ - addIn(path5, value) { - if (isEmptyPath(path5)) - this.add(value); - else { - const [key, ...rest] = path5; - const node = this.get(key, true); - if (identity.isCollection(node)) - node.addIn(rest, value); - else if (node === void 0 && this.schema) - this.set(key, collectionFromPath(this.schema, rest, value)); - else - throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } - } - /** - * Removes a value from the collection. - * @returns `true` if the item was found and removed. - */ - deleteIn(path5) { - const [key, ...rest] = path5; - if (rest.length === 0) - return this.delete(key); - const node = this.get(key, true); - if (identity.isCollection(node)) - return node.deleteIn(rest); - else - throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } - /** - * Returns item at `key`, or `undefined` if not found. By default unwraps - * scalar values from their surrounding node; to disable set `keepScalar` to - * `true` (collections are always returned intact). - */ - getIn(path5, keepScalar) { - const [key, ...rest] = path5; - const node = this.get(key, true); - if (rest.length === 0) - return !keepScalar && identity.isScalar(node) ? node.value : node; - else - return identity.isCollection(node) ? node.getIn(rest, keepScalar) : void 0; - } - hasAllNullValues(allowScalar) { - return this.items.every((node) => { - if (!identity.isPair(node)) - return false; - const n = node.value; - return n == null || allowScalar && identity.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag; - }); - } - /** - * Checks if the collection includes a value with the key `key`. - */ - hasIn(path5) { - const [key, ...rest] = path5; - if (rest.length === 0) - return this.has(key); - const node = this.get(key, true); - return identity.isCollection(node) ? node.hasIn(rest) : false; - } - /** - * Sets a value in this collection. For `!!set`, `value` needs to be a - * boolean to add/remove the item from the set. - */ - setIn(path5, value) { - const [key, ...rest] = path5; - if (rest.length === 0) { - this.set(key, value); - } else { - const node = this.get(key, true); - if (identity.isCollection(node)) - node.setIn(rest, value); - else if (node === void 0 && this.schema) - this.set(key, collectionFromPath(this.schema, rest, value)); - else - throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } - } - }; - Collection.maxFlowStringSingleLineLength = 60; - exports.Collection = Collection; - exports.collectionFromPath = collectionFromPath; - exports.isEmptyPath = isEmptyPath; - } -}); - -// ../../node_modules/yaml/dist/stringify/stringifyComment.js -var require_stringifyComment = __commonJS({ - "../../node_modules/yaml/dist/stringify/stringifyComment.js"(exports) { - "use strict"; - var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#"); - function indentComment(comment, indent) { - if (/^\n+$/.test(comment)) - return comment.substring(1); - return indent ? comment.replace(/^(?! *$)/gm, indent) : comment; - } - var lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment; - exports.indentComment = indentComment; - exports.lineComment = lineComment; - exports.stringifyComment = stringifyComment; - } -}); - -// ../../node_modules/yaml/dist/stringify/foldFlowLines.js -var require_foldFlowLines = __commonJS({ - "../../node_modules/yaml/dist/stringify/foldFlowLines.js"(exports) { - "use strict"; - var FOLD_FLOW = "flow"; - var FOLD_BLOCK = "block"; - var FOLD_QUOTED = "quoted"; - function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) { - if (!lineWidth || lineWidth < 0) - return text; - const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); - if (text.length <= endStep) - return text; - const folds = []; - const escapedFolds = {}; - let end = lineWidth - indent.length; - if (typeof indentAtStart === "number") { - if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) - folds.push(0); - else - end = lineWidth - indentAtStart; - } - let split = void 0; - let prev = void 0; - let overflow = false; - let i = -1; - let escStart = -1; - let escEnd = -1; - if (mode === FOLD_BLOCK) { - i = consumeMoreIndentedLines(text, i); - if (i !== -1) - end = i + endStep; - } - for (let ch; ch = text[i += 1]; ) { - if (mode === FOLD_QUOTED && ch === "\\") { - escStart = i; - switch (text[i + 1]) { - case "x": - i += 3; - break; - case "u": - i += 5; - break; - case "U": - i += 9; - break; - default: - i += 1; - } - escEnd = i; - } - if (ch === "\n") { - if (mode === FOLD_BLOCK) - i = consumeMoreIndentedLines(text, i); - end = i + endStep; - split = void 0; - } else { - if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") { - const next = text[i + 1]; - if (next && next !== " " && next !== "\n" && next !== " ") - split = i; - } - if (i >= end) { - if (split) { - folds.push(split); - end = split + endStep; - split = void 0; - } else if (mode === FOLD_QUOTED) { - while (prev === " " || prev === " ") { - prev = ch; - ch = text[i += 1]; - overflow = true; - } - const j = i > escEnd + 1 ? i - 2 : escStart - 1; - if (escapedFolds[j]) - return text; - folds.push(j); - escapedFolds[j] = true; - end = j + endStep; - split = void 0; - } else { - overflow = true; - } - } - } - prev = ch; - } - if (overflow && onOverflow) - onOverflow(); - if (folds.length === 0) - return text; - if (onFold) - onFold(); - let res = text.slice(0, folds[0]); - for (let i2 = 0; i2 < folds.length; ++i2) { - const fold = folds[i2]; - const end2 = folds[i2 + 1] || text.length; - if (fold === 0) - res = ` -${indent}${text.slice(0, end2)}`; - else { - if (mode === FOLD_QUOTED && escapedFolds[fold]) - res += `${text[fold]}\\`; - res += ` -${indent}${text.slice(fold + 1, end2)}`; - } - } - return res; - } - function consumeMoreIndentedLines(text, i) { - let ch = text[i + 1]; - while (ch === " " || ch === " ") { - do { - ch = text[i += 1]; - } while (ch && ch !== "\n"); - ch = text[i + 1]; - } - return i; - } - exports.FOLD_BLOCK = FOLD_BLOCK; - exports.FOLD_FLOW = FOLD_FLOW; - exports.FOLD_QUOTED = FOLD_QUOTED; - exports.foldFlowLines = foldFlowLines; - } -}); - -// ../../node_modules/yaml/dist/stringify/stringifyString.js -var require_stringifyString = __commonJS({ - "../../node_modules/yaml/dist/stringify/stringifyString.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - var foldFlowLines = require_foldFlowLines(); - var getFoldOptions = (ctx, isBlock) => ({ - indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart, - lineWidth: ctx.options.lineWidth, - minContentWidth: ctx.options.minContentWidth - }); - var containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str); - function lineLengthOverLimit(str, lineWidth, indentLength) { - if (!lineWidth || lineWidth < 0) - return false; - const limit = lineWidth - indentLength; - const strLen = str.length; - if (strLen <= limit) - return false; - for (let i = 0, start = 0; i < strLen; ++i) { - if (str[i] === "\n") { - if (i - start > limit) - return true; - start = i + 1; - if (strLen - start <= limit) - return false; - } - } - return true; - } - function doubleQuotedString(value, ctx) { - const json = JSON.stringify(value); - if (ctx.options.doubleQuotedAsJSON) - return json; - const { implicitKey } = ctx; - const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength; - const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); - let str = ""; - let start = 0; - for (let i = 0, ch = json[i]; ch; ch = json[++i]) { - if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") { - str += json.slice(start, i) + "\\ "; - i += 1; - start = i; - ch = "\\"; - } - if (ch === "\\") - switch (json[i + 1]) { - case "u": - { - str += json.slice(start, i); - const code = json.substr(i + 2, 4); - switch (code) { - case "0000": - str += "\\0"; - break; - case "0007": - str += "\\a"; - break; - case "000b": - str += "\\v"; - break; - case "001b": - str += "\\e"; - break; - case "0085": - str += "\\N"; - break; - case "00a0": - str += "\\_"; - break; - case "2028": - str += "\\L"; - break; - case "2029": - str += "\\P"; - break; - default: - if (code.substr(0, 2) === "00") - str += "\\x" + code.substr(2); - else - str += json.substr(i, 6); - } - i += 5; - start = i + 1; - } - break; - case "n": - if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) { - i += 1; - } else { - str += json.slice(start, i) + "\n\n"; - while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') { - str += "\n"; - i += 2; - } - str += indent; - if (json[i + 2] === " ") - str += "\\"; - i += 1; - start = i + 1; - } - break; - default: - i += 1; - } - } - str = start ? str + json.slice(start) : json; - return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false)); - } - function singleQuotedString(value, ctx) { - if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value)) - return doubleQuotedString(value, ctx); - const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); - const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$& -${indent}`) + "'"; - return ctx.implicitKey ? res : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false)); - } - function quotedString(value, ctx) { - const { singleQuote } = ctx.options; - let qs; - if (singleQuote === false) - qs = doubleQuotedString; - else { - const hasDouble = value.includes('"'); - const hasSingle = value.includes("'"); - if (hasDouble && !hasSingle) - qs = singleQuotedString; - else if (hasSingle && !hasDouble) - qs = doubleQuotedString; - else - qs = singleQuote ? singleQuotedString : doubleQuotedString; - } - return qs(value, ctx); - } - var blockEndNewlines; - try { - blockEndNewlines = new RegExp("(^|(?\n"; - let chomp; - let endStart; - for (endStart = value.length; endStart > 0; --endStart) { - const ch = value[endStart - 1]; - if (ch !== "\n" && ch !== " " && ch !== " ") - break; - } - let end = value.substring(endStart); - const endNlPos = end.indexOf("\n"); - if (endNlPos === -1) { - chomp = "-"; - } else if (value === end || endNlPos !== end.length - 1) { - chomp = "+"; - if (onChompKeep) - onChompKeep(); - } else { - chomp = ""; - } - if (end) { - value = value.slice(0, -end.length); - if (end[end.length - 1] === "\n") - end = end.slice(0, -1); - end = end.replace(blockEndNewlines, `$&${indent}`); - } - let startWithSpace = false; - let startEnd; - let startNlPos = -1; - for (startEnd = 0; startEnd < value.length; ++startEnd) { - const ch = value[startEnd]; - if (ch === " ") - startWithSpace = true; - else if (ch === "\n") - startNlPos = startEnd; - else - break; - } - let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd); - if (start) { - value = value.substring(start.length); - start = start.replace(/\n+/g, `$&${indent}`); - } - const indentSize = indent ? "2" : "1"; - let header = (literal ? "|" : ">") + (startWithSpace ? indentSize : "") + chomp; - if (comment) { - header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " ")); - if (onComment) - onComment(); - } - if (literal) { - value = value.replace(/\n+/g, `$&${indent}`); - return `${header} -${indent}${start}${value}${end}`; - } - value = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`); - const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx, true)); - return `${header} -${indent}${body}`; - } - function plainString(item, ctx, onComment, onChompKeep) { - const { type, value } = item; - const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; - if (implicitKey && /[\n[\]{},]/.test(value) || inFlow && /[[\]{},]/.test(value)) { - return quotedString(value, ctx); - } - if (!value || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) { - return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep); - } - if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) { - return blockString(item, ctx, onComment, onChompKeep); - } - if (containsDocumentMarker(value)) { - if (indent === "") { - ctx.forceBlockIndent = true; - return blockString(item, ctx, onComment, onChompKeep); - } else if (implicitKey && indent === indentStep) { - return quotedString(value, ctx); - } - } - const str = value.replace(/\n+/g, `$& -${indent}`); - if (actualString) { - const test2 = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str); - const { compat, tags } = ctx.doc.schema; - if (tags.some(test2) || compat?.some(test2)) - return quotedString(value, ctx); - } - return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false)); - } - function stringifyString(item, ctx, onComment, onChompKeep) { - const { implicitKey, inFlow } = ctx; - const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) }); - let { type } = item; - if (type !== Scalar.Scalar.QUOTE_DOUBLE) { - if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value)) - type = Scalar.Scalar.QUOTE_DOUBLE; - } - const _stringify = (_type) => { - switch (_type) { - case Scalar.Scalar.BLOCK_FOLDED: - case Scalar.Scalar.BLOCK_LITERAL: - return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep); - case Scalar.Scalar.QUOTE_DOUBLE: - return doubleQuotedString(ss.value, ctx); - case Scalar.Scalar.QUOTE_SINGLE: - return singleQuotedString(ss.value, ctx); - case Scalar.Scalar.PLAIN: - return plainString(ss, ctx, onComment, onChompKeep); - default: - return null; - } - }; - let res = _stringify(type); - if (res === null) { - const { defaultKeyType, defaultStringType } = ctx.options; - const t = implicitKey && defaultKeyType || defaultStringType; - res = _stringify(t); - if (res === null) - throw new Error(`Unsupported default string type ${t}`); - } - return res; - } - exports.stringifyString = stringifyString; - } -}); - -// ../../node_modules/yaml/dist/stringify/stringify.js -var require_stringify = __commonJS({ - "../../node_modules/yaml/dist/stringify/stringify.js"(exports) { - "use strict"; - var anchors = require_anchors(); - var identity = require_identity(); - var stringifyComment = require_stringifyComment(); - var stringifyString = require_stringifyString(); - function createStringifyContext(doc, options) { - const opt = Object.assign({ - blockQuote: true, - commentString: stringifyComment.stringifyComment, - defaultKeyType: null, - defaultStringType: "PLAIN", - directives: null, - doubleQuotedAsJSON: false, - doubleQuotedMinMultiLineLength: 40, - falseStr: "false", - flowCollectionPadding: true, - indentSeq: true, - lineWidth: 80, - minContentWidth: 20, - nullStr: "null", - simpleKeys: false, - singleQuote: null, - trueStr: "true", - verifyAliasOrder: true - }, doc.schema.toStringOptions, options); - let inFlow; - switch (opt.collectionStyle) { - case "block": - inFlow = false; - break; - case "flow": - inFlow = true; - break; - default: - inFlow = null; - } - return { - anchors: /* @__PURE__ */ new Set(), - doc, - flowCollectionPadding: opt.flowCollectionPadding ? " " : "", - indent: "", - indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : " ", - inFlow, - options: opt - }; - } - function getTagObject(tags, item) { - if (item.tag) { - const match = tags.filter((t) => t.tag === item.tag); - if (match.length > 0) - return match.find((t) => t.format === item.format) ?? match[0]; - } - let tagObj = void 0; - let obj; - if (identity.isScalar(item)) { - obj = item.value; - const match = tags.filter((t) => t.identify?.(obj)); - tagObj = match.find((t) => t.format === item.format) ?? match.find((t) => !t.format); - } else { - obj = item; - tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass); - } - if (!tagObj) { - const name = obj?.constructor?.name ?? typeof obj; - throw new Error(`Tag not resolved for ${name} value`); - } - return tagObj; - } - function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) { - if (!doc.directives) - return ""; - const props = []; - const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor; - if (anchor && anchors.anchorIsValid(anchor)) { - anchors$1.add(anchor); - props.push(`&${anchor}`); - } - const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag; - if (tag) - props.push(doc.directives.tagString(tag)); - return props.join(" "); - } - function stringify2(item, ctx, onComment, onChompKeep) { - if (identity.isPair(item)) - return item.toString(ctx, onComment, onChompKeep); - if (identity.isAlias(item)) { - if (ctx.doc.directives) - return item.toString(ctx); - if (ctx.resolvedAliases?.has(item)) { - throw new TypeError(`Cannot stringify circular structure without alias nodes`); - } else { - if (ctx.resolvedAliases) - ctx.resolvedAliases.add(item); - else - ctx.resolvedAliases = /* @__PURE__ */ new Set([item]); - item = item.resolve(ctx.doc); - } - } - let tagObj = void 0; - const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o }); - if (!tagObj) - tagObj = getTagObject(ctx.doc.schema.tags, node); - const props = stringifyProps(node, tagObj, ctx); - if (props.length > 0) - ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1; - const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep); - if (!props) - return str; - return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props} -${ctx.indent}${str}`; - } - exports.createStringifyContext = createStringifyContext; - exports.stringify = stringify2; - } -}); - -// ../../node_modules/yaml/dist/stringify/stringifyPair.js -var require_stringifyPair = __commonJS({ - "../../node_modules/yaml/dist/stringify/stringifyPair.js"(exports) { - "use strict"; - var identity = require_identity(); - var Scalar = require_Scalar(); - var stringify2 = require_stringify(); - var stringifyComment = require_stringifyComment(); - function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { - const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; - let keyComment = identity.isNode(key) && key.comment || null; - if (simpleKeys) { - if (keyComment) { - throw new Error("With simple keys, key nodes cannot have comments"); - } - if (identity.isCollection(key)) { - const msg = "With simple keys, collection cannot be used as a key value"; - throw new Error(msg); - } - } - let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity.isCollection(key) || (identity.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object")); - ctx = Object.assign({}, ctx, { - allNullValues: false, - implicitKey: !explicitKey && (simpleKeys || !allNullValues), - indent: indent + indentStep - }); - let keyCommentDone = false; - let chompKeep = false; - let str = stringify2.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true); - if (!explicitKey && !ctx.inFlow && str.length > 1024) { - if (simpleKeys) - throw new Error("With simple keys, single line scalar must not span more than 1024 characters"); - explicitKey = true; - } - if (ctx.inFlow) { - if (allNullValues || value == null) { - if (keyCommentDone && onComment) - onComment(); - return str === "" ? "?" : explicitKey ? `? ${str}` : str; - } - } else if (allNullValues && !simpleKeys || value == null && explicitKey) { - str = `? ${str}`; - if (keyComment && !keyCommentDone) { - str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); - } else if (chompKeep && onChompKeep) - onChompKeep(); - return str; - } - if (keyCommentDone) - keyComment = null; - if (explicitKey) { - if (keyComment) - str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); - str = `? ${str} -${indent}:`; - } else { - str = `${str}:`; - if (keyComment) - str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); - } - let vsb, vcb, valueComment; - if (identity.isNode(value)) { - vsb = !!value.spaceBefore; - vcb = value.commentBefore; - valueComment = value.comment; - } else { - vsb = false; - vcb = null; - valueComment = null; - if (value && typeof value === "object") - value = doc.createNode(value); - } - ctx.implicitKey = false; - if (!explicitKey && !keyComment && identity.isScalar(value)) - ctx.indentAtStart = str.length + 1; - chompKeep = false; - if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) { - ctx.indent = ctx.indent.substring(2); - } - let valueCommentDone = false; - const valueStr = stringify2.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true); - let ws = " "; - if (keyComment || vsb || vcb) { - ws = vsb ? "\n" : ""; - if (vcb) { - const cs = commentString(vcb); - ws += ` -${stringifyComment.indentComment(cs, ctx.indent)}`; - } - if (valueStr === "" && !ctx.inFlow) { - if (ws === "\n") - ws = "\n\n"; - } else { - ws += ` -${ctx.indent}`; - } - } else if (!explicitKey && identity.isCollection(value)) { - const vs0 = valueStr[0]; - const nl0 = valueStr.indexOf("\n"); - const hasNewline = nl0 !== -1; - const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0; - if (hasNewline || !flow) { - let hasPropsLine = false; - if (hasNewline && (vs0 === "&" || vs0 === "!")) { - let sp0 = valueStr.indexOf(" "); - if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") { - sp0 = valueStr.indexOf(" ", sp0 + 1); - } - if (sp0 === -1 || nl0 < sp0) - hasPropsLine = true; - } - if (!hasPropsLine) - ws = ` -${ctx.indent}`; - } - } else if (valueStr === "" || valueStr[0] === "\n") { - ws = ""; - } - str += ws + valueStr; - if (ctx.inFlow) { - if (valueCommentDone && onComment) - onComment(); - } else if (valueComment && !valueCommentDone) { - str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment)); - } else if (chompKeep && onChompKeep) { - onChompKeep(); - } - return str; - } - exports.stringifyPair = stringifyPair; - } -}); - -// ../../node_modules/yaml/dist/log.js -var require_log = __commonJS({ - "../../node_modules/yaml/dist/log.js"(exports) { - "use strict"; - function debug2(logLevel, ...messages2) { - if (logLevel === "debug") - console.log(...messages2); - } - function warn(logLevel, warning2) { - if (logLevel === "debug" || logLevel === "warn") { - if (typeof process !== "undefined" && process.emitWarning) - process.emitWarning(warning2); - else - console.warn(warning2); - } - } - exports.debug = debug2; - exports.warn = warn; - } -}); - -// ../../node_modules/yaml/dist/nodes/addPairToJSMap.js -var require_addPairToJSMap = __commonJS({ - "../../node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports) { - "use strict"; - var log2 = require_log(); - var stringify2 = require_stringify(); - var identity = require_identity(); - var Scalar = require_Scalar(); - var toJS = require_toJS(); - var MERGE_KEY = "<<"; - function addPairToJSMap(ctx, map, { key, value }) { - if (ctx?.doc.schema.merge && isMergeKey(key)) { - value = identity.isAlias(value) ? value.resolve(ctx.doc) : value; - if (identity.isSeq(value)) - for (const it of value.items) - mergeToJSMap(ctx, map, it); - else if (Array.isArray(value)) - for (const it of value) - mergeToJSMap(ctx, map, it); - else - mergeToJSMap(ctx, map, value); - } else { - const jsKey = toJS.toJS(key, "", ctx); - if (map instanceof Map) { - map.set(jsKey, toJS.toJS(value, jsKey, ctx)); - } else if (map instanceof Set) { - map.add(jsKey); - } else { - const stringKey = stringifyKey(key, jsKey, ctx); - const jsValue = toJS.toJS(value, stringKey, ctx); - if (stringKey in map) - Object.defineProperty(map, stringKey, { - value: jsValue, - writable: true, - enumerable: true, - configurable: true - }); - else - map[stringKey] = jsValue; - } - } - return map; - } - var isMergeKey = (key) => key === MERGE_KEY || identity.isScalar(key) && key.value === MERGE_KEY && (!key.type || key.type === Scalar.Scalar.PLAIN); - function mergeToJSMap(ctx, map, value) { - const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; - if (!identity.isMap(source)) - throw new Error("Merge sources must be maps or map aliases"); - const srcMap = source.toJSON(null, ctx, Map); - for (const [key, value2] of srcMap) { - if (map instanceof Map) { - if (!map.has(key)) - map.set(key, value2); - } else if (map instanceof Set) { - map.add(key); - } else if (!Object.prototype.hasOwnProperty.call(map, key)) { - Object.defineProperty(map, key, { - value: value2, - writable: true, - enumerable: true, - configurable: true - }); - } - } - return map; - } - function stringifyKey(key, jsKey, ctx) { - if (jsKey === null) - return ""; - if (typeof jsKey !== "object") - return String(jsKey); - if (identity.isNode(key) && ctx && ctx.doc) { - const strCtx = stringify2.createStringifyContext(ctx.doc, {}); - strCtx.anchors = /* @__PURE__ */ new Set(); - for (const node of ctx.anchors.keys()) - strCtx.anchors.add(node.anchor); - strCtx.inFlow = true; - strCtx.inStringifyKey = true; - const strKey = key.toString(strCtx); - if (!ctx.mapKeyWarned) { - let jsonStr = JSON.stringify(strKey); - if (jsonStr.length > 40) - jsonStr = jsonStr.substring(0, 36) + '..."'; - log2.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`); - ctx.mapKeyWarned = true; - } - return strKey; - } - return JSON.stringify(jsKey); - } - exports.addPairToJSMap = addPairToJSMap; - } -}); - -// ../../node_modules/yaml/dist/nodes/Pair.js -var require_Pair = __commonJS({ - "../../node_modules/yaml/dist/nodes/Pair.js"(exports) { - "use strict"; - var createNode = require_createNode(); - var stringifyPair = require_stringifyPair(); - var addPairToJSMap = require_addPairToJSMap(); - var identity = require_identity(); - function createPair(key, value, ctx) { - const k = createNode.createNode(key, void 0, ctx); - const v = createNode.createNode(value, void 0, ctx); - return new Pair(k, v); - } - var Pair = class { - constructor(key, value = null) { - Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR }); - this.key = key; - this.value = value; - } - clone(schema) { - let { key, value } = this; - if (identity.isNode(key)) - key = key.clone(schema); - if (identity.isNode(value)) - value = value.clone(schema); - return new Pair(key, value); - } - toJSON(_, ctx) { - const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; - return addPairToJSMap.addPairToJSMap(ctx, pair, this); - } - toString(ctx, onComment, onChompKeep) { - return ctx?.doc ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this); - } - }; - exports.Pair = Pair; - exports.createPair = createPair; - } -}); - -// ../../node_modules/yaml/dist/stringify/stringifyCollection.js -var require_stringifyCollection = __commonJS({ - "../../node_modules/yaml/dist/stringify/stringifyCollection.js"(exports) { - "use strict"; - var Collection = require_Collection(); - var identity = require_identity(); - var stringify2 = require_stringify(); - var stringifyComment = require_stringifyComment(); - function stringifyCollection(collection, ctx, options) { - const flow = ctx.inFlow ?? collection.flow; - const stringify3 = flow ? stringifyFlowCollection : stringifyBlockCollection; - return stringify3(collection, ctx, options); - } - function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) { - const { indent, options: { commentString } } = ctx; - const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null }); - let chompKeep = false; - const lines = []; - for (let i = 0; i < items.length; ++i) { - const item = items[i]; - let comment2 = null; - if (identity.isNode(item)) { - if (!chompKeep && item.spaceBefore) - lines.push(""); - addCommentBefore(ctx, lines, item.commentBefore, chompKeep); - if (item.comment) - comment2 = item.comment; - } else if (identity.isPair(item)) { - const ik = identity.isNode(item.key) ? item.key : null; - if (ik) { - if (!chompKeep && ik.spaceBefore) - lines.push(""); - addCommentBefore(ctx, lines, ik.commentBefore, chompKeep); - } - } - chompKeep = false; - let str2 = stringify2.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true); - if (comment2) - str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2)); - if (chompKeep && comment2) - chompKeep = false; - lines.push(blockItemPrefix + str2); - } - let str; - if (lines.length === 0) { - str = flowChars.start + flowChars.end; - } else { - str = lines[0]; - for (let i = 1; i < lines.length; ++i) { - const line = lines[i]; - str += line ? ` -${indent}${line}` : "\n"; - } - } - if (comment) { - str += "\n" + stringifyComment.indentComment(commentString(comment), indent); - if (onComment) - onComment(); - } else if (chompKeep && onChompKeep) - onChompKeep(); - return str; - } - function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) { - const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx; - itemIndent += indentStep; - const itemCtx = Object.assign({}, ctx, { - indent: itemIndent, - inFlow: true, - type: null - }); - let reqNewline = false; - let linesAtValue = 0; - const lines = []; - for (let i = 0; i < items.length; ++i) { - const item = items[i]; - let comment2 = null; - if (identity.isNode(item)) { - if (item.spaceBefore) - lines.push(""); - addCommentBefore(ctx, lines, item.commentBefore, false); - if (item.comment) - comment2 = item.comment; - } else if (identity.isPair(item)) { - const ik = identity.isNode(item.key) ? item.key : null; - if (ik) { - if (ik.spaceBefore) - lines.push(""); - addCommentBefore(ctx, lines, ik.commentBefore, false); - if (ik.comment) - reqNewline = true; - } - const iv = identity.isNode(item.value) ? item.value : null; - if (iv) { - if (iv.comment) - comment2 = iv.comment; - if (iv.commentBefore) - reqNewline = true; - } else if (item.value == null && ik && ik.comment) { - comment2 = ik.comment; - } - } - if (comment2) - reqNewline = true; - let str2 = stringify2.stringify(item, itemCtx, () => comment2 = null); - if (i < items.length - 1) - str2 += ","; - if (comment2) - str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2)); - if (!reqNewline && (lines.length > linesAtValue || str2.includes("\n"))) - reqNewline = true; - lines.push(str2); - linesAtValue = lines.length; - } - let str; - const { start, end } = flowChars; - if (lines.length === 0) { - str = start + end; - } else { - if (!reqNewline) { - const len = lines.reduce((sum, line) => sum + line.length + 2, 2); - reqNewline = len > Collection.Collection.maxFlowStringSingleLineLength; - } - if (reqNewline) { - str = start; - for (const line of lines) - str += line ? ` -${indentStep}${indent}${line}` : "\n"; - str += ` -${indent}${end}`; - } else { - str = `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`; - } - } - if (comment) { - str += stringifyComment.lineComment(str, indent, commentString(comment)); - if (onComment) - onComment(); - } - return str; - } - function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) { - if (comment && chompKeep) - comment = comment.replace(/^\n+/, ""); - if (comment) { - const ic = stringifyComment.indentComment(commentString(comment), indent); - lines.push(ic.trimStart()); - } - } - exports.stringifyCollection = stringifyCollection; - } -}); - -// ../../node_modules/yaml/dist/nodes/YAMLMap.js -var require_YAMLMap = __commonJS({ - "../../node_modules/yaml/dist/nodes/YAMLMap.js"(exports) { - "use strict"; - var stringifyCollection = require_stringifyCollection(); - var addPairToJSMap = require_addPairToJSMap(); - var Collection = require_Collection(); - var identity = require_identity(); - var Pair = require_Pair(); - var Scalar = require_Scalar(); - function findPair(items, key) { - const k = identity.isScalar(key) ? key.value : key; - for (const it of items) { - if (identity.isPair(it)) { - if (it.key === key || it.key === k) - return it; - if (identity.isScalar(it.key) && it.key.value === k) - return it; - } - } - return void 0; - } - var YAMLMap = class extends Collection.Collection { - static get tagName() { - return "tag:yaml.org,2002:map"; - } - constructor(schema) { - super(identity.MAP, schema); - this.items = []; - } - /** - * A generic collection parsing method that can be extended - * to other node classes that inherit from YAMLMap - */ - static from(schema, obj, ctx) { - const { keepUndefined, replacer } = ctx; - const map = new this(schema); - const add = (key, value) => { - if (typeof replacer === "function") - value = replacer.call(obj, key, value); - else if (Array.isArray(replacer) && !replacer.includes(key)) - return; - if (value !== void 0 || keepUndefined) - map.items.push(Pair.createPair(key, value, ctx)); - }; - if (obj instanceof Map) { - for (const [key, value] of obj) - add(key, value); - } else if (obj && typeof obj === "object") { - for (const key of Object.keys(obj)) - add(key, obj[key]); - } - if (typeof schema.sortMapEntries === "function") { - map.items.sort(schema.sortMapEntries); - } - return map; - } - /** - * Adds a value to the collection. - * - * @param overwrite - If not set `true`, using a key that is already in the - * collection will throw. Otherwise, overwrites the previous value. - */ - add(pair, overwrite) { - let _pair; - if (identity.isPair(pair)) - _pair = pair; - else if (!pair || typeof pair !== "object" || !("key" in pair)) { - _pair = new Pair.Pair(pair, pair?.value); - } else - _pair = new Pair.Pair(pair.key, pair.value); - const prev = findPair(this.items, _pair.key); - const sortEntries = this.schema?.sortMapEntries; - if (prev) { - if (!overwrite) - throw new Error(`Key ${_pair.key} already set`); - if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value)) - prev.value.value = _pair.value; - else - prev.value = _pair.value; - } else if (sortEntries) { - const i = this.items.findIndex((item) => sortEntries(_pair, item) < 0); - if (i === -1) - this.items.push(_pair); - else - this.items.splice(i, 0, _pair); - } else { - this.items.push(_pair); - } - } - delete(key) { - const it = findPair(this.items, key); - if (!it) - return false; - const del = this.items.splice(this.items.indexOf(it), 1); - return del.length > 0; - } - get(key, keepScalar) { - const it = findPair(this.items, key); - const node = it?.value; - return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? void 0; - } - has(key) { - return !!findPair(this.items, key); - } - set(key, value) { - this.add(new Pair.Pair(key, value), true); - } - /** - * @param ctx - Conversion context, originally set in Document#toJS() - * @param {Class} Type - If set, forces the returned collection type - * @returns Instance of Type, Map, or Object - */ - toJSON(_, ctx, Type) { - const map = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; - if (ctx?.onCreate) - ctx.onCreate(map); - for (const item of this.items) - addPairToJSMap.addPairToJSMap(ctx, map, item); - return map; - } - toString(ctx, onComment, onChompKeep) { - if (!ctx) - return JSON.stringify(this); - for (const item of this.items) { - if (!identity.isPair(item)) - throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`); - } - if (!ctx.allNullValues && this.hasAllNullValues(false)) - ctx = Object.assign({}, ctx, { allNullValues: true }); - return stringifyCollection.stringifyCollection(this, ctx, { - blockItemPrefix: "", - flowChars: { start: "{", end: "}" }, - itemIndent: ctx.indent || "", - onChompKeep, - onComment - }); - } - }; - exports.YAMLMap = YAMLMap; - exports.findPair = findPair; - } -}); - -// ../../node_modules/yaml/dist/schema/common/map.js -var require_map = __commonJS({ - "../../node_modules/yaml/dist/schema/common/map.js"(exports) { - "use strict"; - var identity = require_identity(); - var YAMLMap = require_YAMLMap(); - var map = { - collection: "map", - default: true, - nodeClass: YAMLMap.YAMLMap, - tag: "tag:yaml.org,2002:map", - resolve(map2, onError) { - if (!identity.isMap(map2)) - onError("Expected a mapping for this tag"); - return map2; - }, - createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx) - }; - exports.map = map; - } -}); - -// ../../node_modules/yaml/dist/nodes/YAMLSeq.js -var require_YAMLSeq = __commonJS({ - "../../node_modules/yaml/dist/nodes/YAMLSeq.js"(exports) { - "use strict"; - var createNode = require_createNode(); - var stringifyCollection = require_stringifyCollection(); - var Collection = require_Collection(); - var identity = require_identity(); - var Scalar = require_Scalar(); - var toJS = require_toJS(); - var YAMLSeq = class extends Collection.Collection { - static get tagName() { - return "tag:yaml.org,2002:seq"; - } - constructor(schema) { - super(identity.SEQ, schema); - this.items = []; - } - add(value) { - this.items.push(value); - } - /** - * Removes a value from the collection. - * - * `key` must contain a representation of an integer for this to succeed. - * It may be wrapped in a `Scalar`. - * - * @returns `true` if the item was found and removed. - */ - delete(key) { - const idx = asItemIndex(key); - if (typeof idx !== "number") - return false; - const del = this.items.splice(idx, 1); - return del.length > 0; - } - get(key, keepScalar) { - const idx = asItemIndex(key); - if (typeof idx !== "number") - return void 0; - const it = this.items[idx]; - return !keepScalar && identity.isScalar(it) ? it.value : it; - } - /** - * Checks if the collection includes a value with the key `key`. - * - * `key` must contain a representation of an integer for this to succeed. - * It may be wrapped in a `Scalar`. - */ - has(key) { - const idx = asItemIndex(key); - return typeof idx === "number" && idx < this.items.length; - } - /** - * Sets a value in this collection. For `!!set`, `value` needs to be a - * boolean to add/remove the item from the set. - * - * If `key` does not contain a representation of an integer, this will throw. - * It may be wrapped in a `Scalar`. - */ - set(key, value) { - const idx = asItemIndex(key); - if (typeof idx !== "number") - throw new Error(`Expected a valid index, not ${key}.`); - const prev = this.items[idx]; - if (identity.isScalar(prev) && Scalar.isScalarValue(value)) - prev.value = value; - else - this.items[idx] = value; - } - toJSON(_, ctx) { - const seq = []; - if (ctx?.onCreate) - ctx.onCreate(seq); - let i = 0; - for (const item of this.items) - seq.push(toJS.toJS(item, String(i++), ctx)); - return seq; - } - toString(ctx, onComment, onChompKeep) { - if (!ctx) - return JSON.stringify(this); - return stringifyCollection.stringifyCollection(this, ctx, { - blockItemPrefix: "- ", - flowChars: { start: "[", end: "]" }, - itemIndent: (ctx.indent || "") + " ", - onChompKeep, - onComment - }); - } - static from(schema, obj, ctx) { - const { replacer } = ctx; - const seq = new this(schema); - if (obj && Symbol.iterator in Object(obj)) { - let i = 0; - for (let it of obj) { - if (typeof replacer === "function") { - const key = obj instanceof Set ? it : String(i++); - it = replacer.call(obj, key, it); - } - seq.items.push(createNode.createNode(it, void 0, ctx)); - } - } - return seq; - } - }; - function asItemIndex(key) { - let idx = identity.isScalar(key) ? key.value : key; - if (idx && typeof idx === "string") - idx = Number(idx); - return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null; - } - exports.YAMLSeq = YAMLSeq; - } -}); - -// ../../node_modules/yaml/dist/schema/common/seq.js -var require_seq = __commonJS({ - "../../node_modules/yaml/dist/schema/common/seq.js"(exports) { - "use strict"; - var identity = require_identity(); - var YAMLSeq = require_YAMLSeq(); - var seq = { - collection: "seq", - default: true, - nodeClass: YAMLSeq.YAMLSeq, - tag: "tag:yaml.org,2002:seq", - resolve(seq2, onError) { - if (!identity.isSeq(seq2)) - onError("Expected a sequence for this tag"); - return seq2; - }, - createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx) - }; - exports.seq = seq; - } -}); - -// ../../node_modules/yaml/dist/schema/common/string.js -var require_string = __commonJS({ - "../../node_modules/yaml/dist/schema/common/string.js"(exports) { - "use strict"; - var stringifyString = require_stringifyString(); - var string = { - identify: (value) => typeof value === "string", - default: true, - tag: "tag:yaml.org,2002:str", - resolve: (str) => str, - stringify(item, ctx, onComment, onChompKeep) { - ctx = Object.assign({ actualString: true }, ctx); - return stringifyString.stringifyString(item, ctx, onComment, onChompKeep); - } - }; - exports.string = string; - } -}); - -// ../../node_modules/yaml/dist/schema/common/null.js -var require_null = __commonJS({ - "../../node_modules/yaml/dist/schema/common/null.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - var nullTag = { - identify: (value) => value == null, - createNode: () => new Scalar.Scalar(null), - default: true, - tag: "tag:yaml.org,2002:null", - test: /^(?:~|[Nn]ull|NULL)?$/, - resolve: () => new Scalar.Scalar(null), - stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr - }; - exports.nullTag = nullTag; - } -}); - -// ../../node_modules/yaml/dist/schema/core/bool.js -var require_bool = __commonJS({ - "../../node_modules/yaml/dist/schema/core/bool.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - var boolTag = { - identify: (value) => typeof value === "boolean", - default: true, - tag: "tag:yaml.org,2002:bool", - test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, - resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"), - stringify({ source, value }, ctx) { - if (source && boolTag.test.test(source)) { - const sv = source[0] === "t" || source[0] === "T"; - if (value === sv) - return source; - } - return value ? ctx.options.trueStr : ctx.options.falseStr; - } - }; - exports.boolTag = boolTag; - } -}); - -// ../../node_modules/yaml/dist/stringify/stringifyNumber.js -var require_stringifyNumber = __commonJS({ - "../../node_modules/yaml/dist/stringify/stringifyNumber.js"(exports) { - "use strict"; - function stringifyNumber({ format, minFractionDigits, tag, value }) { - if (typeof value === "bigint") - return String(value); - const num = typeof value === "number" ? value : Number(value); - if (!isFinite(num)) - return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf"; - let n = JSON.stringify(value); - if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) { - let i = n.indexOf("."); - if (i < 0) { - i = n.length; - n += "."; - } - let d = minFractionDigits - (n.length - i - 1); - while (d-- > 0) - n += "0"; - } - return n; - } - exports.stringifyNumber = stringifyNumber; - } -}); - -// ../../node_modules/yaml/dist/schema/core/float.js -var require_float = __commonJS({ - "../../node_modules/yaml/dist/schema/core/float.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - var stringifyNumber = require_stringifyNumber(); - var floatNaN = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/, - resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, - stringify: stringifyNumber.stringifyNumber - }; - var floatExp = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - format: "EXP", - test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, - resolve: (str) => parseFloat(str), - stringify(node) { - const num = Number(node.value); - return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node); - } - }; - var float = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/, - resolve(str) { - const node = new Scalar.Scalar(parseFloat(str)); - const dot = str.indexOf("."); - if (dot !== -1 && str[str.length - 1] === "0") - node.minFractionDigits = str.length - dot - 1; - return node; - }, - stringify: stringifyNumber.stringifyNumber - }; - exports.float = float; - exports.floatExp = floatExp; - exports.floatNaN = floatNaN; - } -}); - -// ../../node_modules/yaml/dist/schema/core/int.js -var require_int = __commonJS({ - "../../node_modules/yaml/dist/schema/core/int.js"(exports) { - "use strict"; - var stringifyNumber = require_stringifyNumber(); - var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); - var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix); - function intStringify(node, radix, prefix) { - const { value } = node; - if (intIdentify(value) && value >= 0) - return prefix + value.toString(radix); - return stringifyNumber.stringifyNumber(node); - } - var intOct = { - identify: (value) => intIdentify(value) && value >= 0, - default: true, - tag: "tag:yaml.org,2002:int", - format: "OCT", - test: /^0o[0-7]+$/, - resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt), - stringify: (node) => intStringify(node, 8, "0o") - }; - var int = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - test: /^[-+]?[0-9]+$/, - resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), - stringify: stringifyNumber.stringifyNumber - }; - var intHex = { - identify: (value) => intIdentify(value) && value >= 0, - default: true, - tag: "tag:yaml.org,2002:int", - format: "HEX", - test: /^0x[0-9a-fA-F]+$/, - resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), - stringify: (node) => intStringify(node, 16, "0x") - }; - exports.int = int; - exports.intHex = intHex; - exports.intOct = intOct; - } -}); - -// ../../node_modules/yaml/dist/schema/core/schema.js -var require_schema = __commonJS({ - "../../node_modules/yaml/dist/schema/core/schema.js"(exports) { - "use strict"; - var map = require_map(); - var _null = require_null(); - var seq = require_seq(); - var string = require_string(); - var bool = require_bool(); - var float = require_float(); - var int = require_int(); - var schema = [ - map.map, - seq.seq, - string.string, - _null.nullTag, - bool.boolTag, - int.intOct, - int.int, - int.intHex, - float.floatNaN, - float.floatExp, - float.float - ]; - exports.schema = schema; - } -}); - -// ../../node_modules/yaml/dist/schema/json/schema.js -var require_schema2 = __commonJS({ - "../../node_modules/yaml/dist/schema/json/schema.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - var map = require_map(); - var seq = require_seq(); - function intIdentify(value) { - return typeof value === "bigint" || Number.isInteger(value); - } - var stringifyJSON = ({ value }) => JSON.stringify(value); - var jsonScalars = [ - { - identify: (value) => typeof value === "string", - default: true, - tag: "tag:yaml.org,2002:str", - resolve: (str) => str, - stringify: stringifyJSON - }, - { - identify: (value) => value == null, - createNode: () => new Scalar.Scalar(null), - default: true, - tag: "tag:yaml.org,2002:null", - test: /^null$/, - resolve: () => null, - stringify: stringifyJSON - }, - { - identify: (value) => typeof value === "boolean", - default: true, - tag: "tag:yaml.org,2002:bool", - test: /^true|false$/, - resolve: (str) => str === "true", - stringify: stringifyJSON - }, - { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - test: /^-?(?:0|[1-9][0-9]*)$/, - resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10), - stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value) - }, - { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, - resolve: (str) => parseFloat(str), - stringify: stringifyJSON - } - ]; - var jsonError = { - default: true, - tag: "", - test: /^/, - resolve(str, onError) { - onError(`Unresolved plain scalar ${JSON.stringify(str)}`); - return str; - } - }; - var schema = [map.map, seq.seq].concat(jsonScalars, jsonError); - exports.schema = schema; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js -var require_binary = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - var stringifyString = require_stringifyString(); - var binary = { - identify: (value) => value instanceof Uint8Array, - default: false, - tag: "tag:yaml.org,2002:binary", - /** - * Returns a Buffer in node and an Uint8Array in browsers - * - * To use the resulting buffer as an image, you'll want to do something like: - * - * const blob = new Blob([buffer], { type: 'image/jpeg' }) - * document.querySelector('#photo').src = URL.createObjectURL(blob) - */ - resolve(src, onError) { - if (typeof Buffer === "function") { - return Buffer.from(src, "base64"); - } else if (typeof atob === "function") { - const str = atob(src.replace(/[\n\r]/g, "")); - const buffer = new Uint8Array(str.length); - for (let i = 0; i < str.length; ++i) - buffer[i] = str.charCodeAt(i); - return buffer; - } else { - onError("This environment does not support reading binary tags; either Buffer or atob is required"); - return src; - } - }, - stringify({ comment, type, value }, ctx, onComment, onChompKeep) { - const buf = value; - let str; - if (typeof Buffer === "function") { - str = buf instanceof Buffer ? buf.toString("base64") : Buffer.from(buf.buffer).toString("base64"); - } else if (typeof btoa === "function") { - let s = ""; - for (let i = 0; i < buf.length; ++i) - s += String.fromCharCode(buf[i]); - str = btoa(s); - } else { - throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required"); - } - if (!type) - type = Scalar.Scalar.BLOCK_LITERAL; - if (type !== Scalar.Scalar.QUOTE_DOUBLE) { - const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth); - const n = Math.ceil(str.length / lineWidth); - const lines = new Array(n); - for (let i = 0, o = 0; i < n; ++i, o += lineWidth) { - lines[i] = str.substr(o, lineWidth); - } - str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " "); - } - return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep); - } - }; - exports.binary = binary; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/pairs.js -var require_pairs = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports) { - "use strict"; - var identity = require_identity(); - var Pair = require_Pair(); - var Scalar = require_Scalar(); - var YAMLSeq = require_YAMLSeq(); - function resolvePairs(seq, onError) { - if (identity.isSeq(seq)) { - for (let i = 0; i < seq.items.length; ++i) { - let item = seq.items[i]; - if (identity.isPair(item)) - continue; - else if (identity.isMap(item)) { - if (item.items.length > 1) - onError("Each pair must have its own sequence indicator"); - const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null)); - if (item.commentBefore) - pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore} -${pair.key.commentBefore}` : item.commentBefore; - if (item.comment) { - const cn = pair.value ?? pair.key; - cn.comment = cn.comment ? `${item.comment} -${cn.comment}` : item.comment; - } - item = pair; - } - seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item); - } - } else - onError("Expected a sequence for this tag"); - return seq; - } - function createPairs(schema, iterable, ctx) { - const { replacer } = ctx; - const pairs2 = new YAMLSeq.YAMLSeq(schema); - pairs2.tag = "tag:yaml.org,2002:pairs"; - let i = 0; - if (iterable && Symbol.iterator in Object(iterable)) - for (let it of iterable) { - if (typeof replacer === "function") - it = replacer.call(iterable, String(i++), it); - let key, value; - if (Array.isArray(it)) { - if (it.length === 2) { - key = it[0]; - value = it[1]; - } else - throw new TypeError(`Expected [key, value] tuple: ${it}`); - } else if (it && it instanceof Object) { - const keys = Object.keys(it); - if (keys.length === 1) { - key = keys[0]; - value = it[key]; - } else - throw new TypeError(`Expected { key: value } tuple: ${it}`); - } else { - key = it; - } - pairs2.items.push(Pair.createPair(key, value, ctx)); - } - return pairs2; - } - var pairs = { - collection: "seq", - default: false, - tag: "tag:yaml.org,2002:pairs", - resolve: resolvePairs, - createNode: createPairs - }; - exports.createPairs = createPairs; - exports.pairs = pairs; - exports.resolvePairs = resolvePairs; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/omap.js -var require_omap = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports) { - "use strict"; - var identity = require_identity(); - var toJS = require_toJS(); - var YAMLMap = require_YAMLMap(); - var YAMLSeq = require_YAMLSeq(); - var pairs = require_pairs(); - var YAMLOMap = class extends YAMLSeq.YAMLSeq { - constructor() { - super(); - this.add = YAMLMap.YAMLMap.prototype.add.bind(this); - this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this); - this.get = YAMLMap.YAMLMap.prototype.get.bind(this); - this.has = YAMLMap.YAMLMap.prototype.has.bind(this); - this.set = YAMLMap.YAMLMap.prototype.set.bind(this); - this.tag = YAMLOMap.tag; - } - /** - * If `ctx` is given, the return type is actually `Map`, - * but TypeScript won't allow widening the signature of a child method. - */ - toJSON(_, ctx) { - if (!ctx) - return super.toJSON(_); - const map = /* @__PURE__ */ new Map(); - if (ctx?.onCreate) - ctx.onCreate(map); - for (const pair of this.items) { - let key, value; - if (identity.isPair(pair)) { - key = toJS.toJS(pair.key, "", ctx); - value = toJS.toJS(pair.value, key, ctx); - } else { - key = toJS.toJS(pair, "", ctx); - } - if (map.has(key)) - throw new Error("Ordered maps must not include duplicate keys"); - map.set(key, value); - } - return map; - } - static from(schema, iterable, ctx) { - const pairs$1 = pairs.createPairs(schema, iterable, ctx); - const omap2 = new this(); - omap2.items = pairs$1.items; - return omap2; - } - }; - YAMLOMap.tag = "tag:yaml.org,2002:omap"; - var omap = { - collection: "seq", - identify: (value) => value instanceof Map, - nodeClass: YAMLOMap, - default: false, - tag: "tag:yaml.org,2002:omap", - resolve(seq, onError) { - const pairs$1 = pairs.resolvePairs(seq, onError); - const seenKeys = []; - for (const { key } of pairs$1.items) { - if (identity.isScalar(key)) { - if (seenKeys.includes(key.value)) { - onError(`Ordered maps must not include duplicate keys: ${key.value}`); - } else { - seenKeys.push(key.value); - } - } - } - return Object.assign(new YAMLOMap(), pairs$1); - }, - createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx) - }; - exports.YAMLOMap = YAMLOMap; - exports.omap = omap; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/bool.js -var require_bool2 = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - function boolStringify({ value, source }, ctx) { - const boolObj = value ? trueTag : falseTag; - if (source && boolObj.test.test(source)) - return source; - return value ? ctx.options.trueStr : ctx.options.falseStr; - } - var trueTag = { - identify: (value) => value === true, - default: true, - tag: "tag:yaml.org,2002:bool", - test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, - resolve: () => new Scalar.Scalar(true), - stringify: boolStringify - }; - var falseTag = { - identify: (value) => value === false, - default: true, - tag: "tag:yaml.org,2002:bool", - test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i, - resolve: () => new Scalar.Scalar(false), - stringify: boolStringify - }; - exports.falseTag = falseTag; - exports.trueTag = trueTag; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/float.js -var require_float2 = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - var stringifyNumber = require_stringifyNumber(); - var floatNaN = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/, - resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, - stringify: stringifyNumber.stringifyNumber - }; - var floatExp = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - format: "EXP", - test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/, - resolve: (str) => parseFloat(str.replace(/_/g, "")), - stringify(node) { - const num = Number(node.value); - return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node); - } - }; - var float = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/, - resolve(str) { - const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, ""))); - const dot = str.indexOf("."); - if (dot !== -1) { - const f = str.substring(dot + 1).replace(/_/g, ""); - if (f[f.length - 1] === "0") - node.minFractionDigits = f.length; - } - return node; - }, - stringify: stringifyNumber.stringifyNumber - }; - exports.float = float; - exports.floatExp = floatExp; - exports.floatNaN = floatNaN; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/int.js -var require_int2 = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports) { - "use strict"; - var stringifyNumber = require_stringifyNumber(); - var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); - function intResolve(str, offset, radix, { intAsBigInt }) { - const sign = str[0]; - if (sign === "-" || sign === "+") - offset += 1; - str = str.substring(offset).replace(/_/g, ""); - if (intAsBigInt) { - switch (radix) { - case 2: - str = `0b${str}`; - break; - case 8: - str = `0o${str}`; - break; - case 16: - str = `0x${str}`; - break; - } - const n2 = BigInt(str); - return sign === "-" ? BigInt(-1) * n2 : n2; - } - const n = parseInt(str, radix); - return sign === "-" ? -1 * n : n; - } - function intStringify(node, radix, prefix) { - const { value } = node; - if (intIdentify(value)) { - const str = value.toString(radix); - return value < 0 ? "-" + prefix + str.substr(1) : prefix + str; - } - return stringifyNumber.stringifyNumber(node); - } - var intBin = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - format: "BIN", - test: /^[-+]?0b[0-1_]+$/, - resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt), - stringify: (node) => intStringify(node, 2, "0b") - }; - var intOct = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - format: "OCT", - test: /^[-+]?0[0-7_]+$/, - resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt), - stringify: (node) => intStringify(node, 8, "0") - }; - var int = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - test: /^[-+]?[0-9][0-9_]*$/, - resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), - stringify: stringifyNumber.stringifyNumber - }; - var intHex = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - format: "HEX", - test: /^[-+]?0x[0-9a-fA-F_]+$/, - resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), - stringify: (node) => intStringify(node, 16, "0x") - }; - exports.int = int; - exports.intBin = intBin; - exports.intHex = intHex; - exports.intOct = intOct; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/set.js -var require_set = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports) { - "use strict"; - var identity = require_identity(); - var Pair = require_Pair(); - var YAMLMap = require_YAMLMap(); - var YAMLSet = class extends YAMLMap.YAMLMap { - constructor(schema) { - super(schema); - this.tag = YAMLSet.tag; - } - add(key) { - let pair; - if (identity.isPair(key)) - pair = key; - else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null) - pair = new Pair.Pair(key.key, null); - else - pair = new Pair.Pair(key, null); - const prev = YAMLMap.findPair(this.items, pair.key); - if (!prev) - this.items.push(pair); - } - /** - * If `keepPair` is `true`, returns the Pair matching `key`. - * Otherwise, returns the value of that Pair's key. - */ - get(key, keepPair) { - const pair = YAMLMap.findPair(this.items, key); - return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair; - } - set(key, value) { - if (typeof value !== "boolean") - throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`); - const prev = YAMLMap.findPair(this.items, key); - if (prev && !value) { - this.items.splice(this.items.indexOf(prev), 1); - } else if (!prev && value) { - this.items.push(new Pair.Pair(key)); - } - } - toJSON(_, ctx) { - return super.toJSON(_, ctx, Set); - } - toString(ctx, onComment, onChompKeep) { - if (!ctx) - return JSON.stringify(this); - if (this.hasAllNullValues(true)) - return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep); - else - throw new Error("Set items must all have null values"); - } - static from(schema, iterable, ctx) { - const { replacer } = ctx; - const set2 = new this(schema); - if (iterable && Symbol.iterator in Object(iterable)) - for (let value of iterable) { - if (typeof replacer === "function") - value = replacer.call(iterable, value, value); - set2.items.push(Pair.createPair(value, null, ctx)); - } - return set2; - } - }; - YAMLSet.tag = "tag:yaml.org,2002:set"; - var set = { - collection: "map", - identify: (value) => value instanceof Set, - nodeClass: YAMLSet, - default: false, - tag: "tag:yaml.org,2002:set", - createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx), - resolve(map, onError) { - if (identity.isMap(map)) { - if (map.hasAllNullValues(true)) - return Object.assign(new YAMLSet(), map); - else - onError("Set items must all have null values"); - } else - onError("Expected a mapping for this tag"); - return map; - } - }; - exports.YAMLSet = YAMLSet; - exports.set = set; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/timestamp.js -var require_timestamp = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports) { - "use strict"; - var stringifyNumber = require_stringifyNumber(); - function parseSexagesimal(str, asBigInt) { - const sign = str[0]; - const parts = sign === "-" || sign === "+" ? str.substring(1) : str; - const num = (n) => asBigInt ? BigInt(n) : Number(n); - const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0)); - return sign === "-" ? num(-1) * res : res; - } - function stringifySexagesimal(node) { - let { value } = node; - let num = (n) => n; - if (typeof value === "bigint") - num = (n) => BigInt(n); - else if (isNaN(value) || !isFinite(value)) - return stringifyNumber.stringifyNumber(node); - let sign = ""; - if (value < 0) { - sign = "-"; - value *= num(-1); - } - const _60 = num(60); - const parts = [value % _60]; - if (value < 60) { - parts.unshift(0); - } else { - value = (value - parts[0]) / _60; - parts.unshift(value % _60); - if (value >= 60) { - value = (value - parts[0]) / _60; - parts.unshift(value); - } - } - return sign + parts.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, ""); - } - var intTime = { - identify: (value) => typeof value === "bigint" || Number.isInteger(value), - default: true, - tag: "tag:yaml.org,2002:int", - format: "TIME", - test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, - resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt), - stringify: stringifySexagesimal - }; - var floatTime = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - format: "TIME", - test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, - resolve: (str) => parseSexagesimal(str, false), - stringify: stringifySexagesimal - }; - var timestamp = { - identify: (value) => value instanceof Date, - default: true, - tag: "tag:yaml.org,2002:timestamp", - // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part - // may be omitted altogether, resulting in a date format. In such a case, the time part is - // assumed to be 00:00:00Z (start of day, UTC). - test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"), - resolve(str) { - const match = str.match(timestamp.test); - if (!match) - throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd"); - const [, year, month, day, hour, minute, second] = match.map(Number); - const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0; - let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec); - const tz = match[8]; - if (tz && tz !== "Z") { - let d = parseSexagesimal(tz, false); - if (Math.abs(d) < 30) - d *= 60; - date -= 6e4 * d; - } - return new Date(date); - }, - stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "") - }; - exports.floatTime = floatTime; - exports.intTime = intTime; - exports.timestamp = timestamp; - } -}); - -// ../../node_modules/yaml/dist/schema/yaml-1.1/schema.js -var require_schema3 = __commonJS({ - "../../node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports) { - "use strict"; - var map = require_map(); - var _null = require_null(); - var seq = require_seq(); - var string = require_string(); - var binary = require_binary(); - var bool = require_bool2(); - var float = require_float2(); - var int = require_int2(); - var omap = require_omap(); - var pairs = require_pairs(); - var set = require_set(); - var timestamp = require_timestamp(); - var schema = [ - map.map, - seq.seq, - string.string, - _null.nullTag, - bool.trueTag, - bool.falseTag, - int.intBin, - int.intOct, - int.int, - int.intHex, - float.floatNaN, - float.floatExp, - float.float, - binary.binary, - omap.omap, - pairs.pairs, - set.set, - timestamp.intTime, - timestamp.floatTime, - timestamp.timestamp - ]; - exports.schema = schema; - } -}); - -// ../../node_modules/yaml/dist/schema/tags.js -var require_tags = __commonJS({ - "../../node_modules/yaml/dist/schema/tags.js"(exports) { - "use strict"; - var map = require_map(); - var _null = require_null(); - var seq = require_seq(); - var string = require_string(); - var bool = require_bool(); - var float = require_float(); - var int = require_int(); - var schema = require_schema(); - var schema$1 = require_schema2(); - var binary = require_binary(); - var omap = require_omap(); - var pairs = require_pairs(); - var schema$2 = require_schema3(); - var set = require_set(); - var timestamp = require_timestamp(); - var schemas = /* @__PURE__ */ new Map([ - ["core", schema.schema], - ["failsafe", [map.map, seq.seq, string.string]], - ["json", schema$1.schema], - ["yaml11", schema$2.schema], - ["yaml-1.1", schema$2.schema] - ]); - var tagsByName = { - binary: binary.binary, - bool: bool.boolTag, - float: float.float, - floatExp: float.floatExp, - floatNaN: float.floatNaN, - floatTime: timestamp.floatTime, - int: int.int, - intHex: int.intHex, - intOct: int.intOct, - intTime: timestamp.intTime, - map: map.map, - null: _null.nullTag, - omap: omap.omap, - pairs: pairs.pairs, - seq: seq.seq, - set: set.set, - timestamp: timestamp.timestamp - }; - var coreKnownTags = { - "tag:yaml.org,2002:binary": binary.binary, - "tag:yaml.org,2002:omap": omap.omap, - "tag:yaml.org,2002:pairs": pairs.pairs, - "tag:yaml.org,2002:set": set.set, - "tag:yaml.org,2002:timestamp": timestamp.timestamp - }; - function getTags(customTags, schemaName) { - let tags = schemas.get(schemaName); - if (!tags) { - if (Array.isArray(customTags)) - tags = []; - else { - const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", "); - throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`); - } - } - if (Array.isArray(customTags)) { - for (const tag of customTags) - tags = tags.concat(tag); - } else if (typeof customTags === "function") { - tags = customTags(tags.slice()); - } - return tags.map((tag) => { - if (typeof tag !== "string") - return tag; - const tagObj = tagsByName[tag]; - if (tagObj) - return tagObj; - const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", "); - throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`); - }); - } - exports.coreKnownTags = coreKnownTags; - exports.getTags = getTags; - } -}); - -// ../../node_modules/yaml/dist/schema/Schema.js -var require_Schema = __commonJS({ - "../../node_modules/yaml/dist/schema/Schema.js"(exports) { - "use strict"; - var identity = require_identity(); - var map = require_map(); - var seq = require_seq(); - var string = require_string(); - var tags = require_tags(); - var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0; - var Schema = class { - constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) { - this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null; - this.merge = !!merge; - this.name = typeof schema === "string" && schema || "core"; - this.knownTags = resolveKnownTags ? tags.coreKnownTags : {}; - this.tags = tags.getTags(customTags, this.name); - this.toStringOptions = toStringDefaults ?? null; - Object.defineProperty(this, identity.MAP, { value: map.map }); - Object.defineProperty(this, identity.SCALAR, { value: string.string }); - Object.defineProperty(this, identity.SEQ, { value: seq.seq }); - this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null; - } - clone() { - const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this)); - copy.tags = this.tags.slice(); - return copy; - } - }; - exports.Schema = Schema; - } -}); - -// ../../node_modules/yaml/dist/stringify/stringifyDocument.js -var require_stringifyDocument = __commonJS({ - "../../node_modules/yaml/dist/stringify/stringifyDocument.js"(exports) { - "use strict"; - var identity = require_identity(); - var stringify2 = require_stringify(); - var stringifyComment = require_stringifyComment(); - function stringifyDocument(doc, options) { - const lines = []; - let hasDirectives = options.directives === true; - if (options.directives !== false && doc.directives) { - const dir = doc.directives.toString(doc); - if (dir) { - lines.push(dir); - hasDirectives = true; - } else if (doc.directives.docStart) - hasDirectives = true; - } - if (hasDirectives) - lines.push("---"); - const ctx = stringify2.createStringifyContext(doc, options); - const { commentString } = ctx.options; - if (doc.commentBefore) { - if (lines.length !== 1) - lines.unshift(""); - const cs = commentString(doc.commentBefore); - lines.unshift(stringifyComment.indentComment(cs, "")); - } - let chompKeep = false; - let contentComment = null; - if (doc.contents) { - if (identity.isNode(doc.contents)) { - if (doc.contents.spaceBefore && hasDirectives) - lines.push(""); - if (doc.contents.commentBefore) { - const cs = commentString(doc.contents.commentBefore); - lines.push(stringifyComment.indentComment(cs, "")); - } - ctx.forceBlockIndent = !!doc.comment; - contentComment = doc.contents.comment; - } - const onChompKeep = contentComment ? void 0 : () => chompKeep = true; - let body = stringify2.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep); - if (contentComment) - body += stringifyComment.lineComment(body, "", commentString(contentComment)); - if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") { - lines[lines.length - 1] = `--- ${body}`; - } else - lines.push(body); - } else { - lines.push(stringify2.stringify(doc.contents, ctx)); - } - if (doc.directives?.docEnd) { - if (doc.comment) { - const cs = commentString(doc.comment); - if (cs.includes("\n")) { - lines.push("..."); - lines.push(stringifyComment.indentComment(cs, "")); - } else { - lines.push(`... ${cs}`); - } - } else { - lines.push("..."); - } - } else { - let dc = doc.comment; - if (dc && chompKeep) - dc = dc.replace(/^\n+/, ""); - if (dc) { - if ((!chompKeep || contentComment) && lines[lines.length - 1] !== "") - lines.push(""); - lines.push(stringifyComment.indentComment(commentString(dc), "")); - } - } - return lines.join("\n") + "\n"; - } - exports.stringifyDocument = stringifyDocument; - } -}); - -// ../../node_modules/yaml/dist/doc/Document.js -var require_Document = __commonJS({ - "../../node_modules/yaml/dist/doc/Document.js"(exports) { - "use strict"; - var Alias = require_Alias(); - var Collection = require_Collection(); - var identity = require_identity(); - var Pair = require_Pair(); - var toJS = require_toJS(); - var Schema = require_Schema(); - var stringifyDocument = require_stringifyDocument(); - var anchors = require_anchors(); - var applyReviver = require_applyReviver(); - var createNode = require_createNode(); - var directives = require_directives(); - var Document = class { - constructor(value, replacer, options) { - this.commentBefore = null; - this.comment = null; - this.errors = []; - this.warnings = []; - Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC }); - let _replacer = null; - if (typeof replacer === "function" || Array.isArray(replacer)) { - _replacer = replacer; - } else if (options === void 0 && replacer) { - options = replacer; - replacer = void 0; - } - const opt = Object.assign({ - intAsBigInt: false, - keepSourceTokens: false, - logLevel: "warn", - prettyErrors: true, - strict: true, - uniqueKeys: true, - version: "1.2" - }, options); - this.options = opt; - let { version: version2 } = opt; - if (options?._directives) { - this.directives = options._directives.atDocument(); - if (this.directives.yaml.explicit) - version2 = this.directives.yaml.version; - } else - this.directives = new directives.Directives({ version: version2 }); - this.setSchema(version2, options); - this.contents = value === void 0 ? null : this.createNode(value, _replacer, options); - } - /** - * Create a deep copy of this Document and its contents. - * - * Custom Node values that inherit from `Object` still refer to their original instances. - */ - clone() { - const copy = Object.create(Document.prototype, { - [identity.NODE_TYPE]: { value: identity.DOC } - }); - copy.commentBefore = this.commentBefore; - copy.comment = this.comment; - copy.errors = this.errors.slice(); - copy.warnings = this.warnings.slice(); - copy.options = Object.assign({}, this.options); - if (this.directives) - copy.directives = this.directives.clone(); - copy.schema = this.schema.clone(); - copy.contents = identity.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents; - if (this.range) - copy.range = this.range.slice(); - return copy; - } - /** Adds a value to the document. */ - add(value) { - if (assertCollection(this.contents)) - this.contents.add(value); - } - /** Adds a value to the document. */ - addIn(path5, value) { - if (assertCollection(this.contents)) - this.contents.addIn(path5, value); - } - /** - * Create a new `Alias` node, ensuring that the target `node` has the required anchor. - * - * If `node` already has an anchor, `name` is ignored. - * Otherwise, the `node.anchor` value will be set to `name`, - * or if an anchor with that name is already present in the document, - * `name` will be used as a prefix for a new unique anchor. - * If `name` is undefined, the generated anchor will use 'a' as a prefix. - */ - createAlias(node, name) { - if (!node.anchor) { - const prev = anchors.anchorNames(this); - node.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - !name || prev.has(name) ? anchors.findNewAnchor(name || "a", prev) : name; - } - return new Alias.Alias(node.anchor); - } - createNode(value, replacer, options) { - let _replacer = void 0; - if (typeof replacer === "function") { - value = replacer.call({ "": value }, "", value); - _replacer = replacer; - } else if (Array.isArray(replacer)) { - const keyToStr = (v) => typeof v === "number" || v instanceof String || v instanceof Number; - const asStr = replacer.filter(keyToStr).map(String); - if (asStr.length > 0) - replacer = replacer.concat(asStr); - _replacer = replacer; - } else if (options === void 0 && replacer) { - options = replacer; - replacer = void 0; - } - const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {}; - const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors( - this, - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - anchorPrefix || "a" - ); - const ctx = { - aliasDuplicateObjects: aliasDuplicateObjects ?? true, - keepUndefined: keepUndefined ?? false, - onAnchor, - onTagObj, - replacer: _replacer, - schema: this.schema, - sourceObjects - }; - const node = createNode.createNode(value, tag, ctx); - if (flow && identity.isCollection(node)) - node.flow = true; - setAnchors(); - return node; - } - /** - * Convert a key and a value into a `Pair` using the current schema, - * recursively wrapping all values as `Scalar` or `Collection` nodes. - */ - createPair(key, value, options = {}) { - const k = this.createNode(key, null, options); - const v = this.createNode(value, null, options); - return new Pair.Pair(k, v); - } - /** - * Removes a value from the document. - * @returns `true` if the item was found and removed. - */ - delete(key) { - return assertCollection(this.contents) ? this.contents.delete(key) : false; - } - /** - * Removes a value from the document. - * @returns `true` if the item was found and removed. - */ - deleteIn(path5) { - if (Collection.isEmptyPath(path5)) { - if (this.contents == null) - return false; - this.contents = null; - return true; - } - return assertCollection(this.contents) ? this.contents.deleteIn(path5) : false; - } - /** - * Returns item at `key`, or `undefined` if not found. By default unwraps - * scalar values from their surrounding node; to disable set `keepScalar` to - * `true` (collections are always returned intact). - */ - get(key, keepScalar) { - return identity.isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0; - } - /** - * Returns item at `path`, or `undefined` if not found. By default unwraps - * scalar values from their surrounding node; to disable set `keepScalar` to - * `true` (collections are always returned intact). - */ - getIn(path5, keepScalar) { - if (Collection.isEmptyPath(path5)) - return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents; - return identity.isCollection(this.contents) ? this.contents.getIn(path5, keepScalar) : void 0; - } - /** - * Checks if the document includes a value with the key `key`. - */ - has(key) { - return identity.isCollection(this.contents) ? this.contents.has(key) : false; - } - /** - * Checks if the document includes a value at `path`. - */ - hasIn(path5) { - if (Collection.isEmptyPath(path5)) - return this.contents !== void 0; - return identity.isCollection(this.contents) ? this.contents.hasIn(path5) : false; - } - /** - * Sets a value in this document. For `!!set`, `value` needs to be a - * boolean to add/remove the item from the set. - */ - set(key, value) { - if (this.contents == null) { - this.contents = Collection.collectionFromPath(this.schema, [key], value); - } else if (assertCollection(this.contents)) { - this.contents.set(key, value); - } - } - /** - * Sets a value in this document. For `!!set`, `value` needs to be a - * boolean to add/remove the item from the set. - */ - setIn(path5, value) { - if (Collection.isEmptyPath(path5)) { - this.contents = value; - } else if (this.contents == null) { - this.contents = Collection.collectionFromPath(this.schema, Array.from(path5), value); - } else if (assertCollection(this.contents)) { - this.contents.setIn(path5, value); - } - } - /** - * Change the YAML version and schema used by the document. - * A `null` version disables support for directives, explicit tags, anchors, and aliases. - * It also requires the `schema` option to be given as a `Schema` instance value. - * - * Overrides all previously set schema options. - */ - setSchema(version2, options = {}) { - if (typeof version2 === "number") - version2 = String(version2); - let opt; - switch (version2) { - case "1.1": - if (this.directives) - this.directives.yaml.version = "1.1"; - else - this.directives = new directives.Directives({ version: "1.1" }); - opt = { merge: true, resolveKnownTags: false, schema: "yaml-1.1" }; - break; - case "1.2": - case "next": - if (this.directives) - this.directives.yaml.version = version2; - else - this.directives = new directives.Directives({ version: version2 }); - opt = { merge: false, resolveKnownTags: true, schema: "core" }; - break; - case null: - if (this.directives) - delete this.directives; - opt = null; - break; - default: { - const sv = JSON.stringify(version2); - throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`); - } - } - if (options.schema instanceof Object) - this.schema = options.schema; - else if (opt) - this.schema = new Schema.Schema(Object.assign(opt, options)); - else - throw new Error(`With a null YAML version, the { schema: Schema } option is required`); - } - // json & jsonArg are only used from toJSON() - toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { - const ctx = { - anchors: /* @__PURE__ */ new Map(), - doc: this, - keep: !json, - mapAsMap: mapAsMap === true, - mapKeyWarned: false, - maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 - }; - const res = toJS.toJS(this.contents, jsonArg ?? "", ctx); - if (typeof onAnchor === "function") - for (const { count, res: res2 } of ctx.anchors.values()) - onAnchor(res2, count); - return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res; - } - /** - * A JSON representation of the document `contents`. - * - * @param jsonArg Used by `JSON.stringify` to indicate the array index or - * property name. - */ - toJSON(jsonArg, onAnchor) { - return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor }); - } - /** A YAML representation of the document. */ - toString(options = {}) { - if (this.errors.length > 0) - throw new Error("Document with errors cannot be stringified"); - if ("indent" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) { - const s = JSON.stringify(options.indent); - throw new Error(`"indent" option must be a positive integer, not ${s}`); - } - return stringifyDocument.stringifyDocument(this, options); - } - }; - function assertCollection(contents) { - if (identity.isCollection(contents)) - return true; - throw new Error("Expected a YAML collection as document contents"); - } - exports.Document = Document; - } -}); - -// ../../node_modules/yaml/dist/errors.js -var require_errors2 = __commonJS({ - "../../node_modules/yaml/dist/errors.js"(exports) { - "use strict"; - var YAMLError = class extends Error { - constructor(name, pos, code, message) { - super(); - this.name = name; - this.code = code; - this.message = message; - this.pos = pos; - } - }; - var YAMLParseError = class extends YAMLError { - constructor(pos, code, message) { - super("YAMLParseError", pos, code, message); - } - }; - var YAMLWarning = class extends YAMLError { - constructor(pos, code, message) { - super("YAMLWarning", pos, code, message); - } - }; - var prettifyError = (src, lc) => (error) => { - if (error.pos[0] === -1) - return; - error.linePos = error.pos.map((pos) => lc.linePos(pos)); - const { line, col } = error.linePos[0]; - error.message += ` at line ${line}, column ${col}`; - let ci = col - 1; - let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, ""); - if (ci >= 60 && lineStr.length > 80) { - const trimStart = Math.min(ci - 39, lineStr.length - 79); - lineStr = "\u2026" + lineStr.substring(trimStart); - ci -= trimStart - 1; - } - if (lineStr.length > 80) - lineStr = lineStr.substring(0, 79) + "\u2026"; - if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) { - let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]); - if (prev.length > 80) - prev = prev.substring(0, 79) + "\u2026\n"; - lineStr = prev + lineStr; - } - if (/[^ ]/.test(lineStr)) { - let count = 1; - const end = error.linePos[1]; - if (end && end.line === line && end.col > col) { - count = Math.max(1, Math.min(end.col - col, 80 - ci)); - } - const pointer = " ".repeat(ci) + "^".repeat(count); - error.message += `: - -${lineStr} -${pointer} -`; - } - }; - exports.YAMLError = YAMLError; - exports.YAMLParseError = YAMLParseError; - exports.YAMLWarning = YAMLWarning; - exports.prettifyError = prettifyError; - } -}); - -// ../../node_modules/yaml/dist/compose/resolve-props.js -var require_resolve_props = __commonJS({ - "../../node_modules/yaml/dist/compose/resolve-props.js"(exports) { - "use strict"; - function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnNewline }) { - let spaceBefore = false; - let atNewline = startOnNewline; - let hasSpace = startOnNewline; - let comment = ""; - let commentSep = ""; - let hasNewline = false; - let hasNewlineAfterProp = false; - let reqSpace = false; - let anchor = null; - let tag = null; - let comma = null; - let found = null; - let start = null; - for (const token of tokens) { - if (reqSpace) { - if (token.type !== "space" && token.type !== "newline" && token.type !== "comma") - onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); - reqSpace = false; - } - switch (token.type) { - case "space": - if (!flow && atNewline && indicator !== "doc-start" && token.source[0] === " ") - onError(token, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); - hasSpace = true; - break; - case "comment": { - if (!hasSpace) - onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); - const cb = token.source.substring(1) || " "; - if (!comment) - comment = cb; - else - comment += commentSep + cb; - commentSep = ""; - atNewline = false; - break; - } - case "newline": - if (atNewline) { - if (comment) - comment += token.source; - else - spaceBefore = true; - } else - commentSep += token.source; - atNewline = true; - hasNewline = true; - if (anchor || tag) - hasNewlineAfterProp = true; - hasSpace = true; - break; - case "anchor": - if (anchor) - onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor"); - if (token.source.endsWith(":")) - onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true); - anchor = token; - if (start === null) - start = token.offset; - atNewline = false; - hasSpace = false; - reqSpace = true; - break; - case "tag": { - if (tag) - onError(token, "MULTIPLE_TAGS", "A node can have at most one tag"); - tag = token; - if (start === null) - start = token.offset; - atNewline = false; - hasSpace = false; - reqSpace = true; - break; - } - case indicator: - if (anchor || tag) - onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`); - if (found) - onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`); - found = token; - atNewline = false; - hasSpace = false; - break; - case "comma": - if (flow) { - if (comma) - onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`); - comma = token; - atNewline = false; - hasSpace = false; - break; - } - default: - onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`); - atNewline = false; - hasSpace = false; - } - } - const last = tokens[tokens.length - 1]; - const end = last ? last.offset + last.source.length : offset; - if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) - onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); - return { - comma, - found, - spaceBefore, - comment, - hasNewline, - hasNewlineAfterProp, - anchor, - tag, - end, - start: start ?? end - }; - } - exports.resolveProps = resolveProps; - } -}); - -// ../../node_modules/yaml/dist/compose/util-contains-newline.js -var require_util_contains_newline = __commonJS({ - "../../node_modules/yaml/dist/compose/util-contains-newline.js"(exports) { - "use strict"; - function containsNewline(key) { - if (!key) - return null; - switch (key.type) { - case "alias": - case "scalar": - case "double-quoted-scalar": - case "single-quoted-scalar": - if (key.source.includes("\n")) - return true; - if (key.end) { - for (const st of key.end) - if (st.type === "newline") - return true; - } - return false; - case "flow-collection": - for (const it of key.items) { - for (const st of it.start) - if (st.type === "newline") - return true; - if (it.sep) { - for (const st of it.sep) - if (st.type === "newline") - return true; - } - if (containsNewline(it.key) || containsNewline(it.value)) - return true; - } - return false; - default: - return true; - } - } - exports.containsNewline = containsNewline; - } -}); - -// ../../node_modules/yaml/dist/compose/util-flow-indent-check.js -var require_util_flow_indent_check = __commonJS({ - "../../node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports) { - "use strict"; - var utilContainsNewline = require_util_contains_newline(); - function flowIndentCheck(indent, fc, onError) { - if (fc?.type === "flow-collection") { - const end = fc.end[0]; - if (end.indent === indent && (end.source === "]" || end.source === "}") && utilContainsNewline.containsNewline(fc)) { - const msg = "Flow end indicator should be more indented than parent"; - onError(end, "BAD_INDENT", msg, true); - } - } - } - exports.flowIndentCheck = flowIndentCheck; - } -}); - -// ../../node_modules/yaml/dist/compose/util-map-includes.js -var require_util_map_includes = __commonJS({ - "../../node_modules/yaml/dist/compose/util-map-includes.js"(exports) { - "use strict"; - var identity = require_identity(); - function mapIncludes(ctx, items, search) { - const { uniqueKeys } = ctx.options; - if (uniqueKeys === false) - return false; - const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value && !(a.value === "<<" && ctx.schema.merge); - return items.some((pair) => isEqual(pair.key, search)); - } - exports.mapIncludes = mapIncludes; - } -}); - -// ../../node_modules/yaml/dist/compose/resolve-block-map.js -var require_resolve_block_map = __commonJS({ - "../../node_modules/yaml/dist/compose/resolve-block-map.js"(exports) { - "use strict"; - var Pair = require_Pair(); - var YAMLMap = require_YAMLMap(); - var resolveProps = require_resolve_props(); - var utilContainsNewline = require_util_contains_newline(); - var utilFlowIndentCheck = require_util_flow_indent_check(); - var utilMapIncludes = require_util_map_includes(); - var startColMsg = "All mapping items must start at the same column"; - function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) { - const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap; - const map = new NodeClass(ctx.schema); - if (ctx.atRoot) - ctx.atRoot = false; - let offset = bm.offset; - let commentEnd = null; - for (const collItem of bm.items) { - const { start, key, sep, value } = collItem; - const keyProps = resolveProps.resolveProps(start, { - indicator: "explicit-key-ind", - next: key ?? sep?.[0], - offset, - onError, - startOnNewline: true - }); - const implicitKey = !keyProps.found; - if (implicitKey) { - if (key) { - if (key.type === "block-seq") - onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key"); - else if ("indent" in key && key.indent !== bm.indent) - onError(offset, "BAD_INDENT", startColMsg); - } - if (!keyProps.anchor && !keyProps.tag && !sep) { - commentEnd = keyProps.end; - if (keyProps.comment) { - if (map.comment) - map.comment += "\n" + keyProps.comment; - else - map.comment = keyProps.comment; - } - continue; - } - if (keyProps.hasNewlineAfterProp || utilContainsNewline.containsNewline(key)) { - onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line"); - } - } else if (keyProps.found?.indent !== bm.indent) { - onError(offset, "BAD_INDENT", startColMsg); - } - const keyStart = keyProps.end; - const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError); - if (ctx.schema.compat) - utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError); - if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) - onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); - const valueProps = resolveProps.resolveProps(sep ?? [], { - indicator: "map-value-ind", - next: value, - offset: keyNode.range[2], - onError, - startOnNewline: !key || key.type === "block-scalar" - }); - offset = valueProps.end; - if (valueProps.found) { - if (implicitKey) { - if (value?.type === "block-map" && !valueProps.hasNewline) - onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"); - if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024) - onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"); - } - const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep, null, valueProps, onError); - if (ctx.schema.compat) - utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError); - offset = valueNode.range[2]; - const pair = new Pair.Pair(keyNode, valueNode); - if (ctx.options.keepSourceTokens) - pair.srcToken = collItem; - map.items.push(pair); - } else { - if (implicitKey) - onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"); - if (valueProps.comment) { - if (keyNode.comment) - keyNode.comment += "\n" + valueProps.comment; - else - keyNode.comment = valueProps.comment; - } - const pair = new Pair.Pair(keyNode); - if (ctx.options.keepSourceTokens) - pair.srcToken = collItem; - map.items.push(pair); - } - } - if (commentEnd && commentEnd < offset) - onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content"); - map.range = [bm.offset, offset, commentEnd ?? offset]; - return map; - } - exports.resolveBlockMap = resolveBlockMap; - } -}); - -// ../../node_modules/yaml/dist/compose/resolve-block-seq.js -var require_resolve_block_seq = __commonJS({ - "../../node_modules/yaml/dist/compose/resolve-block-seq.js"(exports) { - "use strict"; - var YAMLSeq = require_YAMLSeq(); - var resolveProps = require_resolve_props(); - var utilFlowIndentCheck = require_util_flow_indent_check(); - function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) { - const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq; - const seq = new NodeClass(ctx.schema); - if (ctx.atRoot) - ctx.atRoot = false; - let offset = bs.offset; - let commentEnd = null; - for (const { start, value } of bs.items) { - const props = resolveProps.resolveProps(start, { - indicator: "seq-item-ind", - next: value, - offset, - onError, - startOnNewline: true - }); - if (!props.found) { - if (props.anchor || props.tag || value) { - if (value && value.type === "block-seq") - onError(props.end, "BAD_INDENT", "All sequence items must start at the same column"); - else - onError(offset, "MISSING_CHAR", "Sequence item without - indicator"); - } else { - commentEnd = props.end; - if (props.comment) - seq.comment = props.comment; - continue; - } - } - const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError); - if (ctx.schema.compat) - utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError); - offset = node.range[2]; - seq.items.push(node); - } - seq.range = [bs.offset, offset, commentEnd ?? offset]; - return seq; - } - exports.resolveBlockSeq = resolveBlockSeq; - } -}); - -// ../../node_modules/yaml/dist/compose/resolve-end.js -var require_resolve_end = __commonJS({ - "../../node_modules/yaml/dist/compose/resolve-end.js"(exports) { - "use strict"; - function resolveEnd(end, offset, reqSpace, onError) { - let comment = ""; - if (end) { - let hasSpace = false; - let sep = ""; - for (const token of end) { - const { source, type } = token; - switch (type) { - case "space": - hasSpace = true; - break; - case "comment": { - if (reqSpace && !hasSpace) - onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); - const cb = source.substring(1) || " "; - if (!comment) - comment = cb; - else - comment += sep + cb; - sep = ""; - break; - } - case "newline": - if (comment) - sep += source; - hasSpace = true; - break; - default: - onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`); - } - offset += source.length; - } - } - return { comment, offset }; - } - exports.resolveEnd = resolveEnd; - } -}); - -// ../../node_modules/yaml/dist/compose/resolve-flow-collection.js -var require_resolve_flow_collection = __commonJS({ - "../../node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports) { - "use strict"; - var identity = require_identity(); - var Pair = require_Pair(); - var YAMLMap = require_YAMLMap(); - var YAMLSeq = require_YAMLSeq(); - var resolveEnd = require_resolve_end(); - var resolveProps = require_resolve_props(); - var utilContainsNewline = require_util_contains_newline(); - var utilMapIncludes = require_util_map_includes(); - var blockMsg = "Block collections are not allowed within flow collections"; - var isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq"); - function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) { - const isMap = fc.start.source === "{"; - const fcName = isMap ? "flow map" : "flow sequence"; - const NodeClass = tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq); - const coll = new NodeClass(ctx.schema); - coll.flow = true; - const atRoot = ctx.atRoot; - if (atRoot) - ctx.atRoot = false; - let offset = fc.offset + fc.start.source.length; - for (let i = 0; i < fc.items.length; ++i) { - const collItem = fc.items[i]; - const { start, key, sep, value } = collItem; - const props = resolveProps.resolveProps(start, { - flow: fcName, - indicator: "explicit-key-ind", - next: key ?? sep?.[0], - offset, - onError, - startOnNewline: false - }); - if (!props.found) { - if (!props.anchor && !props.tag && !sep && !value) { - if (i === 0 && props.comma) - onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); - else if (i < fc.items.length - 1) - onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`); - if (props.comment) { - if (coll.comment) - coll.comment += "\n" + props.comment; - else - coll.comment = props.comment; - } - offset = props.end; - continue; - } - if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key)) - onError( - key, - // checked by containsNewline() - "MULTILINE_IMPLICIT_KEY", - "Implicit keys of flow sequence pairs need to be on a single line" - ); - } - if (i === 0) { - if (props.comma) - onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); - } else { - if (!props.comma) - onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`); - if (props.comment) { - let prevItemComment = ""; - loop: - for (const st of start) { - switch (st.type) { - case "comma": - case "space": - break; - case "comment": - prevItemComment = st.source.substring(1); - break loop; - default: - break loop; - } - } - if (prevItemComment) { - let prev = coll.items[coll.items.length - 1]; - if (identity.isPair(prev)) - prev = prev.value ?? prev.key; - if (prev.comment) - prev.comment += "\n" + prevItemComment; - else - prev.comment = prevItemComment; - props.comment = props.comment.substring(prevItemComment.length + 1); - } - } - } - if (!isMap && !sep && !props.found) { - const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep, null, props, onError); - coll.items.push(valueNode); - offset = valueNode.range[2]; - if (isBlock(value)) - onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); - } else { - const keyStart = props.end; - const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError); - if (isBlock(key)) - onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg); - const valueProps = resolveProps.resolveProps(sep ?? [], { - flow: fcName, - indicator: "map-value-ind", - next: value, - offset: keyNode.range[2], - onError, - startOnNewline: false - }); - if (valueProps.found) { - if (!isMap && !props.found && ctx.options.strict) { - if (sep) - for (const st of sep) { - if (st === valueProps.found) - break; - if (st.type === "newline") { - onError(st, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line"); - break; - } - } - if (props.start < valueProps.found.offset - 1024) - onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key"); - } - } else if (value) { - if ("source" in value && value.source && value.source[0] === ":") - onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`); - else - onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`); - } - const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) : null; - if (valueNode) { - if (isBlock(value)) - onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); - } else if (valueProps.comment) { - if (keyNode.comment) - keyNode.comment += "\n" + valueProps.comment; - else - keyNode.comment = valueProps.comment; - } - const pair = new Pair.Pair(keyNode, valueNode); - if (ctx.options.keepSourceTokens) - pair.srcToken = collItem; - if (isMap) { - const map = coll; - if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) - onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); - map.items.push(pair); - } else { - const map = new YAMLMap.YAMLMap(ctx.schema); - map.flow = true; - map.items.push(pair); - coll.items.push(map); - } - offset = valueNode ? valueNode.range[2] : valueProps.end; - } - } - const expectedEnd = isMap ? "}" : "]"; - const [ce, ...ee] = fc.end; - let cePos = offset; - if (ce && ce.source === expectedEnd) - cePos = ce.offset + ce.source.length; - else { - const name = fcName[0].toUpperCase() + fcName.substring(1); - const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`; - onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg); - if (ce && ce.source.length !== 1) - ee.unshift(ce); - } - if (ee.length > 0) { - const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError); - if (end.comment) { - if (coll.comment) - coll.comment += "\n" + end.comment; - else - coll.comment = end.comment; - } - coll.range = [fc.offset, cePos, end.offset]; - } else { - coll.range = [fc.offset, cePos, cePos]; - } - return coll; - } - exports.resolveFlowCollection = resolveFlowCollection; - } -}); - -// ../../node_modules/yaml/dist/compose/compose-collection.js -var require_compose_collection = __commonJS({ - "../../node_modules/yaml/dist/compose/compose-collection.js"(exports) { - "use strict"; - var identity = require_identity(); - var Scalar = require_Scalar(); - var YAMLMap = require_YAMLMap(); - var YAMLSeq = require_YAMLSeq(); - var resolveBlockMap = require_resolve_block_map(); - var resolveBlockSeq = require_resolve_block_seq(); - var resolveFlowCollection = require_resolve_flow_collection(); - function resolveCollection(CN, ctx, token, onError, tagName, tag) { - const coll = token.type === "block-map" ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag); - const Coll = coll.constructor; - if (tagName === "!" || tagName === Coll.tagName) { - coll.tag = Coll.tagName; - return coll; - } - if (tagName) - coll.tag = tagName; - return coll; - } - function composeCollection(CN, ctx, token, tagToken, onError) { - const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)); - const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq"; - if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq" || !expType) { - return resolveCollection(CN, ctx, token, onError, tagName); - } - let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType); - if (!tag) { - const kt = ctx.schema.knownTags[tagName]; - if (kt && kt.collection === expType) { - ctx.schema.tags.push(Object.assign({}, kt, { default: false })); - tag = kt; - } else { - if (kt?.collection) { - onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true); - } else { - onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true); - } - return resolveCollection(CN, ctx, token, onError, tagName); - } - } - const coll = resolveCollection(CN, ctx, token, onError, tagName, tag); - const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll; - const node = identity.isNode(res) ? res : new Scalar.Scalar(res); - node.range = coll.range; - node.tag = tagName; - if (tag?.format) - node.format = tag.format; - return node; - } - exports.composeCollection = composeCollection; - } -}); - -// ../../node_modules/yaml/dist/compose/resolve-block-scalar.js -var require_resolve_block_scalar = __commonJS({ - "../../node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - function resolveBlockScalar(scalar, strict, onError) { - const start = scalar.offset; - const header = parseBlockScalarHeader(scalar, strict, onError); - if (!header) - return { value: "", type: null, comment: "", range: [start, start, start] }; - const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL; - const lines = scalar.source ? splitLines(scalar.source) : []; - let chompStart = lines.length; - for (let i = lines.length - 1; i >= 0; --i) { - const content = lines[i][1]; - if (content === "" || content === "\r") - chompStart = i; - else - break; - } - if (chompStart === 0) { - const value2 = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : ""; - let end2 = start + header.length; - if (scalar.source) - end2 += scalar.source.length; - return { value: value2, type, comment: header.comment, range: [start, end2, end2] }; - } - let trimIndent = scalar.indent + header.indent; - let offset = scalar.offset + header.length; - let contentStart = 0; - for (let i = 0; i < chompStart; ++i) { - const [indent, content] = lines[i]; - if (content === "" || content === "\r") { - if (header.indent === 0 && indent.length > trimIndent) - trimIndent = indent.length; - } else { - if (indent.length < trimIndent) { - const message = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"; - onError(offset + indent.length, "MISSING_CHAR", message); - } - if (header.indent === 0) - trimIndent = indent.length; - contentStart = i; - break; - } - offset += indent.length + content.length + 1; - } - for (let i = lines.length - 1; i >= chompStart; --i) { - if (lines[i][0].length > trimIndent) - chompStart = i + 1; - } - let value = ""; - let sep = ""; - let prevMoreIndented = false; - for (let i = 0; i < contentStart; ++i) - value += lines[i][0].slice(trimIndent) + "\n"; - for (let i = contentStart; i < chompStart; ++i) { - let [indent, content] = lines[i]; - offset += indent.length + content.length + 1; - const crlf = content[content.length - 1] === "\r"; - if (crlf) - content = content.slice(0, -1); - if (content && indent.length < trimIndent) { - const src = header.indent ? "explicit indentation indicator" : "first line"; - const message = `Block scalar lines must not be less indented than their ${src}`; - onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message); - indent = ""; - } - if (type === Scalar.Scalar.BLOCK_LITERAL) { - value += sep + indent.slice(trimIndent) + content; - sep = "\n"; - } else if (indent.length > trimIndent || content[0] === " ") { - if (sep === " ") - sep = "\n"; - else if (!prevMoreIndented && sep === "\n") - sep = "\n\n"; - value += sep + indent.slice(trimIndent) + content; - sep = "\n"; - prevMoreIndented = true; - } else if (content === "") { - if (sep === "\n") - value += "\n"; - else - sep = "\n"; - } else { - value += sep + content; - sep = " "; - prevMoreIndented = false; - } - } - switch (header.chomp) { - case "-": - break; - case "+": - for (let i = chompStart; i < lines.length; ++i) - value += "\n" + lines[i][0].slice(trimIndent); - if (value[value.length - 1] !== "\n") - value += "\n"; - break; - default: - value += "\n"; - } - const end = start + header.length + scalar.source.length; - return { value, type, comment: header.comment, range: [start, end, end] }; - } - function parseBlockScalarHeader({ offset, props }, strict, onError) { - if (props[0].type !== "block-scalar-header") { - onError(props[0], "IMPOSSIBLE", "Block scalar header not found"); - return null; - } - const { source } = props[0]; - const mode = source[0]; - let indent = 0; - let chomp = ""; - let error = -1; - for (let i = 1; i < source.length; ++i) { - const ch = source[i]; - if (!chomp && (ch === "-" || ch === "+")) - chomp = ch; - else { - const n = Number(ch); - if (!indent && n) - indent = n; - else if (error === -1) - error = offset + i; - } - } - if (error !== -1) - onError(error, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`); - let hasSpace = false; - let comment = ""; - let length = source.length; - for (let i = 1; i < props.length; ++i) { - const token = props[i]; - switch (token.type) { - case "space": - hasSpace = true; - case "newline": - length += token.source.length; - break; - case "comment": - if (strict && !hasSpace) { - const message = "Comments must be separated from other tokens by white space characters"; - onError(token, "MISSING_CHAR", message); - } - length += token.source.length; - comment = token.source.substring(1); - break; - case "error": - onError(token, "UNEXPECTED_TOKEN", token.message); - length += token.source.length; - break; - default: { - const message = `Unexpected token in block scalar header: ${token.type}`; - onError(token, "UNEXPECTED_TOKEN", message); - const ts = token.source; - if (ts && typeof ts === "string") - length += ts.length; - } - } - } - return { mode, indent, chomp, comment, length }; - } - function splitLines(source) { - const split = source.split(/\n( *)/); - const first = split[0]; - const m = first.match(/^( *)/); - const line0 = m?.[1] ? [m[1], first.slice(m[1].length)] : ["", first]; - const lines = [line0]; - for (let i = 1; i < split.length; i += 2) - lines.push([split[i], split[i + 1]]); - return lines; - } - exports.resolveBlockScalar = resolveBlockScalar; - } -}); - -// ../../node_modules/yaml/dist/compose/resolve-flow-scalar.js -var require_resolve_flow_scalar = __commonJS({ - "../../node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports) { - "use strict"; - var Scalar = require_Scalar(); - var resolveEnd = require_resolve_end(); - function resolveFlowScalar(scalar, strict, onError) { - const { offset, type, source, end } = scalar; - let _type; - let value; - const _onError = (rel, code, msg) => onError(offset + rel, code, msg); - switch (type) { - case "scalar": - _type = Scalar.Scalar.PLAIN; - value = plainValue(source, _onError); - break; - case "single-quoted-scalar": - _type = Scalar.Scalar.QUOTE_SINGLE; - value = singleQuotedValue(source, _onError); - break; - case "double-quoted-scalar": - _type = Scalar.Scalar.QUOTE_DOUBLE; - value = doubleQuotedValue(source, _onError); - break; - default: - onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`); - return { - value: "", - type: null, - comment: "", - range: [offset, offset + source.length, offset + source.length] - }; - } - const valueEnd = offset + source.length; - const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError); - return { - value, - type: _type, - comment: re.comment, - range: [offset, valueEnd, re.offset] - }; - } - function plainValue(source, onError) { - let badChar = ""; - switch (source[0]) { - case " ": - badChar = "a tab character"; - break; - case ",": - badChar = "flow indicator character ,"; - break; - case "%": - badChar = "directive indicator character %"; - break; - case "|": - case ">": { - badChar = `block scalar indicator ${source[0]}`; - break; - } - case "@": - case "`": { - badChar = `reserved character ${source[0]}`; - break; - } - } - if (badChar) - onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`); - return foldLines(source); - } - function singleQuotedValue(source, onError) { - if (source[source.length - 1] !== "'" || source.length === 1) - onError(source.length, "MISSING_CHAR", "Missing closing 'quote"); - return foldLines(source.slice(1, -1)).replace(/''/g, "'"); - } - function foldLines(source) { - let first, line; - try { - first = new RegExp("(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch; - } else { - res += ch; - } - } - if (source[source.length - 1] !== '"' || source.length === 1) - onError(source.length, "MISSING_CHAR", 'Missing closing "quote'); - return res; - } - function foldNewline(source, offset) { - let fold = ""; - let ch = source[offset + 1]; - while (ch === " " || ch === " " || ch === "\n" || ch === "\r") { - if (ch === "\r" && source[offset + 2] !== "\n") - break; - if (ch === "\n") - fold += "\n"; - offset += 1; - ch = source[offset + 1]; - } - if (!fold) - fold = " "; - return { fold, offset }; - } - var escapeCodes = { - "0": "\0", - a: "\x07", - b: "\b", - e: "\x1B", - f: "\f", - n: "\n", - r: "\r", - t: " ", - v: "\v", - N: "\x85", - _: "\xA0", - L: "\u2028", - P: "\u2029", - " ": " ", - '"': '"', - "/": "/", - "\\": "\\", - " ": " " - }; - function parseCharCode(source, offset, length, onError) { - const cc = source.substr(offset, length); - const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc); - const code = ok ? parseInt(cc, 16) : NaN; - if (isNaN(code)) { - const raw = source.substr(offset - 2, length + 2); - onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`); - return raw; - } - return String.fromCodePoint(code); - } - exports.resolveFlowScalar = resolveFlowScalar; - } -}); - -// ../../node_modules/yaml/dist/compose/compose-scalar.js -var require_compose_scalar = __commonJS({ - "../../node_modules/yaml/dist/compose/compose-scalar.js"(exports) { - "use strict"; - var identity = require_identity(); - var Scalar = require_Scalar(); - var resolveBlockScalar = require_resolve_block_scalar(); - var resolveFlowScalar = require_resolve_flow_scalar(); - function composeScalar(ctx, token, tagToken, onError) { - const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(token, ctx.options.strict, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError); - const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null; - const tag = tagToken && tagName ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError) : token.type === "scalar" ? findScalarTagByTest(ctx, value, token, onError) : ctx.schema[identity.SCALAR]; - let scalar; - try { - const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options); - scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res); - } catch (error) { - const msg = error instanceof Error ? error.message : String(error); - onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg); - scalar = new Scalar.Scalar(value); - } - scalar.range = range; - scalar.source = value; - if (type) - scalar.type = type; - if (tagName) - scalar.tag = tagName; - if (tag.format) - scalar.format = tag.format; - if (comment) - scalar.comment = comment; - return scalar; - } - function findScalarTagByName(schema, value, tagName, tagToken, onError) { - if (tagName === "!") - return schema[identity.SCALAR]; - const matchWithTest = []; - for (const tag of schema.tags) { - if (!tag.collection && tag.tag === tagName) { - if (tag.default && tag.test) - matchWithTest.push(tag); - else - return tag; - } - } - for (const tag of matchWithTest) - if (tag.test?.test(value)) - return tag; - const kt = schema.knownTags[tagName]; - if (kt && !kt.collection) { - schema.tags.push(Object.assign({}, kt, { default: false, test: void 0 })); - return kt; - } - onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str"); - return schema[identity.SCALAR]; - } - function findScalarTagByTest({ directives, schema }, value, token, onError) { - const tag = schema.tags.find((tag2) => tag2.default && tag2.test?.test(value)) || schema[identity.SCALAR]; - if (schema.compat) { - const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR]; - if (tag.tag !== compat.tag) { - const ts = directives.tagString(tag.tag); - const cs = directives.tagString(compat.tag); - const msg = `Value may be parsed as either ${ts} or ${cs}`; - onError(token, "TAG_RESOLVE_FAILED", msg, true); - } - } - return tag; - } - exports.composeScalar = composeScalar; - } -}); - -// ../../node_modules/yaml/dist/compose/util-empty-scalar-position.js -var require_util_empty_scalar_position = __commonJS({ - "../../node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports) { - "use strict"; - function emptyScalarPosition(offset, before, pos) { - if (before) { - if (pos === null) - pos = before.length; - for (let i = pos - 1; i >= 0; --i) { - let st = before[i]; - switch (st.type) { - case "space": - case "comment": - case "newline": - offset -= st.source.length; - continue; - } - st = before[++i]; - while (st?.type === "space") { - offset += st.source.length; - st = before[++i]; - } - break; - } - } - return offset; - } - exports.emptyScalarPosition = emptyScalarPosition; - } -}); - -// ../../node_modules/yaml/dist/compose/compose-node.js -var require_compose_node = __commonJS({ - "../../node_modules/yaml/dist/compose/compose-node.js"(exports) { - "use strict"; - var Alias = require_Alias(); - var composeCollection = require_compose_collection(); - var composeScalar = require_compose_scalar(); - var resolveEnd = require_resolve_end(); - var utilEmptyScalarPosition = require_util_empty_scalar_position(); - var CN = { composeNode, composeEmptyNode }; - function composeNode(ctx, token, props, onError) { - const { spaceBefore, comment, anchor, tag } = props; - let node; - let isSrcToken = true; - switch (token.type) { - case "alias": - node = composeAlias(ctx, token, onError); - if (anchor || tag) - onError(token, "ALIAS_PROPS", "An alias node must not specify any properties"); - break; - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": - case "block-scalar": - node = composeScalar.composeScalar(ctx, token, tag, onError); - if (anchor) - node.anchor = anchor.source.substring(1); - break; - case "block-map": - case "block-seq": - case "flow-collection": - node = composeCollection.composeCollection(CN, ctx, token, tag, onError); - if (anchor) - node.anchor = anchor.source.substring(1); - break; - default: { - const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`; - onError(token, "UNEXPECTED_TOKEN", message); - node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError); - isSrcToken = false; - } - } - if (anchor && node.anchor === "") - onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); - if (spaceBefore) - node.spaceBefore = true; - if (comment) { - if (token.type === "scalar" && token.source === "") - node.comment = comment; - else - node.commentBefore = comment; - } - if (ctx.options.keepSourceTokens && isSrcToken) - node.srcToken = token; - return node; - } - function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) { - const token = { - type: "scalar", - offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos), - indent: -1, - source: "" - }; - const node = composeScalar.composeScalar(ctx, token, tag, onError); - if (anchor) { - node.anchor = anchor.source.substring(1); - if (node.anchor === "") - onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); - } - if (spaceBefore) - node.spaceBefore = true; - if (comment) { - node.comment = comment; - node.range[2] = end; - } - return node; - } - function composeAlias({ options }, { offset, source, end }, onError) { - const alias = new Alias.Alias(source.substring(1)); - if (alias.source === "") - onError(offset, "BAD_ALIAS", "Alias cannot be an empty string"); - if (alias.source.endsWith(":")) - onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true); - const valueEnd = offset + source.length; - const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError); - alias.range = [offset, valueEnd, re.offset]; - if (re.comment) - alias.comment = re.comment; - return alias; - } - exports.composeEmptyNode = composeEmptyNode; - exports.composeNode = composeNode; - } -}); - -// ../../node_modules/yaml/dist/compose/compose-doc.js -var require_compose_doc = __commonJS({ - "../../node_modules/yaml/dist/compose/compose-doc.js"(exports) { - "use strict"; - var Document = require_Document(); - var composeNode = require_compose_node(); - var resolveEnd = require_resolve_end(); - var resolveProps = require_resolve_props(); - function composeDoc(options, directives, { offset, start, value, end }, onError) { - const opts = Object.assign({ _directives: directives }, options); - const doc = new Document.Document(void 0, opts); - const ctx = { - atRoot: true, - directives: doc.directives, - options: doc.options, - schema: doc.schema - }; - const props = resolveProps.resolveProps(start, { - indicator: "doc-start", - next: value ?? end?.[0], - offset, - onError, - startOnNewline: true - }); - if (props.found) { - doc.directives.docStart = true; - if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline) - onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker"); - } - doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError); - const contentEnd = doc.contents.range[2]; - const re = resolveEnd.resolveEnd(end, contentEnd, false, onError); - if (re.comment) - doc.comment = re.comment; - doc.range = [offset, contentEnd, re.offset]; - return doc; - } - exports.composeDoc = composeDoc; - } -}); - -// ../../node_modules/yaml/dist/compose/composer.js -var require_composer = __commonJS({ - "../../node_modules/yaml/dist/compose/composer.js"(exports) { - "use strict"; - var directives = require_directives(); - var Document = require_Document(); - var errors = require_errors2(); - var identity = require_identity(); - var composeDoc = require_compose_doc(); - var resolveEnd = require_resolve_end(); - function getErrorPos(src) { - if (typeof src === "number") - return [src, src + 1]; - if (Array.isArray(src)) - return src.length === 2 ? src : [src[0], src[1]]; - const { offset, source } = src; - return [offset, offset + (typeof source === "string" ? source.length : 1)]; - } - function parsePrelude(prelude) { - let comment = ""; - let atComment = false; - let afterEmptyLine = false; - for (let i = 0; i < prelude.length; ++i) { - const source = prelude[i]; - switch (source[0]) { - case "#": - comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " "); - atComment = true; - afterEmptyLine = false; - break; - case "%": - if (prelude[i + 1]?.[0] !== "#") - i += 1; - atComment = false; - break; - default: - if (!atComment) - afterEmptyLine = true; - atComment = false; - } - } - return { comment, afterEmptyLine }; - } - var Composer = class { - constructor(options = {}) { - this.doc = null; - this.atDirectives = false; - this.prelude = []; - this.errors = []; - this.warnings = []; - this.onError = (source, code, message, warning2) => { - const pos = getErrorPos(source); - if (warning2) - this.warnings.push(new errors.YAMLWarning(pos, code, message)); - else - this.errors.push(new errors.YAMLParseError(pos, code, message)); - }; - this.directives = new directives.Directives({ version: options.version || "1.2" }); - this.options = options; - } - decorate(doc, afterDoc) { - const { comment, afterEmptyLine } = parsePrelude(this.prelude); - if (comment) { - const dc = doc.contents; - if (afterDoc) { - doc.comment = doc.comment ? `${doc.comment} -${comment}` : comment; - } else if (afterEmptyLine || doc.directives.docStart || !dc) { - doc.commentBefore = comment; - } else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) { - let it = dc.items[0]; - if (identity.isPair(it)) - it = it.key; - const cb = it.commentBefore; - it.commentBefore = cb ? `${comment} -${cb}` : comment; - } else { - const cb = dc.commentBefore; - dc.commentBefore = cb ? `${comment} -${cb}` : comment; - } - } - if (afterDoc) { - Array.prototype.push.apply(doc.errors, this.errors); - Array.prototype.push.apply(doc.warnings, this.warnings); - } else { - doc.errors = this.errors; - doc.warnings = this.warnings; - } - this.prelude = []; - this.errors = []; - this.warnings = []; - } - /** - * Current stream status information. - * - * Mostly useful at the end of input for an empty stream. - */ - streamInfo() { - return { - comment: parsePrelude(this.prelude).comment, - directives: this.directives, - errors: this.errors, - warnings: this.warnings - }; - } - /** - * Compose tokens into documents. - * - * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. - * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. - */ - *compose(tokens, forceDoc = false, endOffset = -1) { - for (const token of tokens) - yield* this.next(token); - yield* this.end(forceDoc, endOffset); - } - /** Advance the composer by one CST token. */ - *next(token) { - if (process.env.LOG_STREAM) - console.dir(token, { depth: null }); - switch (token.type) { - case "directive": - this.directives.add(token.source, (offset, message, warning2) => { - const pos = getErrorPos(token); - pos[0] += offset; - this.onError(pos, "BAD_DIRECTIVE", message, warning2); - }); - this.prelude.push(token.source); - this.atDirectives = true; - break; - case "document": { - const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError); - if (this.atDirectives && !doc.directives.docStart) - this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"); - this.decorate(doc, false); - if (this.doc) - yield this.doc; - this.doc = doc; - this.atDirectives = false; - break; - } - case "byte-order-mark": - case "space": - break; - case "comment": - case "newline": - this.prelude.push(token.source); - break; - case "error": { - const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message; - const error = new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg); - if (this.atDirectives || !this.doc) - this.errors.push(error); - else - this.doc.errors.push(error); - break; - } - case "doc-end": { - if (!this.doc) { - const msg = "Unexpected doc-end without preceding document"; - this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg)); - break; - } - this.doc.directives.docEnd = true; - const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError); - this.decorate(this.doc, true); - if (end.comment) { - const dc = this.doc.comment; - this.doc.comment = dc ? `${dc} -${end.comment}` : end.comment; - } - this.doc.range[2] = end.offset; - break; - } - default: - this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`)); - } - } - /** - * Call at end of input to yield any remaining document. - * - * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. - * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. - */ - *end(forceDoc = false, endOffset = -1) { - if (this.doc) { - this.decorate(this.doc, true); - yield this.doc; - this.doc = null; - } else if (forceDoc) { - const opts = Object.assign({ _directives: this.directives }, this.options); - const doc = new Document.Document(void 0, opts); - if (this.atDirectives) - this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line"); - doc.range = [0, endOffset, endOffset]; - this.decorate(doc, false); - yield doc; - } - } - }; - exports.Composer = Composer; - } -}); - -// ../../node_modules/yaml/dist/parse/cst-scalar.js -var require_cst_scalar = __commonJS({ - "../../node_modules/yaml/dist/parse/cst-scalar.js"(exports) { - "use strict"; - var resolveBlockScalar = require_resolve_block_scalar(); - var resolveFlowScalar = require_resolve_flow_scalar(); - var errors = require_errors2(); - var stringifyString = require_stringifyString(); - function resolveAsScalar(token, strict = true, onError) { - if (token) { - const _onError = (pos, code, message) => { - const offset = typeof pos === "number" ? pos : Array.isArray(pos) ? pos[0] : pos.offset; - if (onError) - onError(offset, code, message); - else - throw new errors.YAMLParseError([offset, offset + 1], code, message); - }; - switch (token.type) { - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": - return resolveFlowScalar.resolveFlowScalar(token, strict, _onError); - case "block-scalar": - return resolveBlockScalar.resolveBlockScalar(token, strict, _onError); - } - } - return null; - } - function createScalarToken(value, context) { - const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context; - const source = stringifyString.stringifyString({ type, value }, { - implicitKey, - indent: indent > 0 ? " ".repeat(indent) : "", - inFlow, - options: { blockQuote: true, lineWidth: -1 } - }); - const end = context.end ?? [ - { type: "newline", offset: -1, indent, source: "\n" } - ]; - switch (source[0]) { - case "|": - case ">": { - const he = source.indexOf("\n"); - const head = source.substring(0, he); - const body = source.substring(he + 1) + "\n"; - const props = [ - { type: "block-scalar-header", offset, indent, source: head } - ]; - if (!addEndtoBlockProps(props, end)) - props.push({ type: "newline", offset: -1, indent, source: "\n" }); - return { type: "block-scalar", offset, indent, props, source: body }; - } - case '"': - return { type: "double-quoted-scalar", offset, indent, source, end }; - case "'": - return { type: "single-quoted-scalar", offset, indent, source, end }; - default: - return { type: "scalar", offset, indent, source, end }; - } - } - function setScalarValue(token, value, context = {}) { - let { afterKey = false, implicitKey = false, inFlow = false, type } = context; - let indent = "indent" in token ? token.indent : null; - if (afterKey && typeof indent === "number") - indent += 2; - if (!type) - switch (token.type) { - case "single-quoted-scalar": - type = "QUOTE_SINGLE"; - break; - case "double-quoted-scalar": - type = "QUOTE_DOUBLE"; - break; - case "block-scalar": { - const header = token.props[0]; - if (header.type !== "block-scalar-header") - throw new Error("Invalid block scalar header"); - type = header.source[0] === ">" ? "BLOCK_FOLDED" : "BLOCK_LITERAL"; - break; - } - default: - type = "PLAIN"; - } - const source = stringifyString.stringifyString({ type, value }, { - implicitKey: implicitKey || indent === null, - indent: indent !== null && indent > 0 ? " ".repeat(indent) : "", - inFlow, - options: { blockQuote: true, lineWidth: -1 } - }); - switch (source[0]) { - case "|": - case ">": - setBlockScalarValue(token, source); - break; - case '"': - setFlowScalarValue(token, source, "double-quoted-scalar"); - break; - case "'": - setFlowScalarValue(token, source, "single-quoted-scalar"); - break; - default: - setFlowScalarValue(token, source, "scalar"); - } - } - function setBlockScalarValue(token, source) { - const he = source.indexOf("\n"); - const head = source.substring(0, he); - const body = source.substring(he + 1) + "\n"; - if (token.type === "block-scalar") { - const header = token.props[0]; - if (header.type !== "block-scalar-header") - throw new Error("Invalid block scalar header"); - header.source = head; - token.source = body; - } else { - const { offset } = token; - const indent = "indent" in token ? token.indent : -1; - const props = [ - { type: "block-scalar-header", offset, indent, source: head } - ]; - if (!addEndtoBlockProps(props, "end" in token ? token.end : void 0)) - props.push({ type: "newline", offset: -1, indent, source: "\n" }); - for (const key of Object.keys(token)) - if (key !== "type" && key !== "offset") - delete token[key]; - Object.assign(token, { type: "block-scalar", indent, props, source: body }); - } - } - function addEndtoBlockProps(props, end) { - if (end) - for (const st of end) - switch (st.type) { - case "space": - case "comment": - props.push(st); - break; - case "newline": - props.push(st); - return true; - } - return false; - } - function setFlowScalarValue(token, source, type) { - switch (token.type) { - case "scalar": - case "double-quoted-scalar": - case "single-quoted-scalar": - token.type = type; - token.source = source; - break; - case "block-scalar": { - const end = token.props.slice(1); - let oa = source.length; - if (token.props[0].type === "block-scalar-header") - oa -= token.props[0].source.length; - for (const tok of end) - tok.offset += oa; - delete token.props; - Object.assign(token, { type, source, end }); - break; - } - case "block-map": - case "block-seq": { - const offset = token.offset + source.length; - const nl = { type: "newline", offset, indent: token.indent, source: "\n" }; - delete token.items; - Object.assign(token, { type, source, end: [nl] }); - break; - } - default: { - const indent = "indent" in token ? token.indent : -1; - const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st) => st.type === "space" || st.type === "comment" || st.type === "newline") : []; - for (const key of Object.keys(token)) - if (key !== "type" && key !== "offset") - delete token[key]; - Object.assign(token, { type, indent, source, end }); - } - } - } - exports.createScalarToken = createScalarToken; - exports.resolveAsScalar = resolveAsScalar; - exports.setScalarValue = setScalarValue; - } -}); - -// ../../node_modules/yaml/dist/parse/cst-stringify.js -var require_cst_stringify = __commonJS({ - "../../node_modules/yaml/dist/parse/cst-stringify.js"(exports) { - "use strict"; - var stringify2 = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst); - function stringifyToken(token) { - switch (token.type) { - case "block-scalar": { - let res = ""; - for (const tok of token.props) - res += stringifyToken(tok); - return res + token.source; - } - case "block-map": - case "block-seq": { - let res = ""; - for (const item of token.items) - res += stringifyItem(item); - return res; - } - case "flow-collection": { - let res = token.start.source; - for (const item of token.items) - res += stringifyItem(item); - for (const st of token.end) - res += st.source; - return res; - } - case "document": { - let res = stringifyItem(token); - if (token.end) - for (const st of token.end) - res += st.source; - return res; - } - default: { - let res = token.source; - if ("end" in token && token.end) - for (const st of token.end) - res += st.source; - return res; - } - } - } - function stringifyItem({ start, key, sep, value }) { - let res = ""; - for (const st of start) - res += st.source; - if (key) - res += stringifyToken(key); - if (sep) - for (const st of sep) - res += st.source; - if (value) - res += stringifyToken(value); - return res; - } - exports.stringify = stringify2; - } -}); - -// ../../node_modules/yaml/dist/parse/cst-visit.js -var require_cst_visit = __commonJS({ - "../../node_modules/yaml/dist/parse/cst-visit.js"(exports) { - "use strict"; - var BREAK = Symbol("break visit"); - var SKIP = Symbol("skip children"); - var REMOVE = Symbol("remove item"); - function visit(cst, visitor) { - if ("type" in cst && cst.type === "document") - cst = { start: cst.start, value: cst.value }; - _visit(Object.freeze([]), cst, visitor); - } - visit.BREAK = BREAK; - visit.SKIP = SKIP; - visit.REMOVE = REMOVE; - visit.itemAtPath = (cst, path5) => { - let item = cst; - for (const [field, index] of path5) { - const tok = item?.[field]; - if (tok && "items" in tok) { - item = tok.items[index]; - } else - return void 0; - } - return item; - }; - visit.parentCollection = (cst, path5) => { - const parent = visit.itemAtPath(cst, path5.slice(0, -1)); - const field = path5[path5.length - 1][0]; - const coll = parent?.[field]; - if (coll && "items" in coll) - return coll; - throw new Error("Parent collection not found"); - }; - function _visit(path5, item, visitor) { - let ctrl = visitor(item, path5); - if (typeof ctrl === "symbol") - return ctrl; - for (const field of ["key", "value"]) { - const token = item[field]; - if (token && "items" in token) { - for (let i = 0; i < token.items.length; ++i) { - const ci = _visit(Object.freeze(path5.concat([[field, i]])), token.items[i], visitor); - if (typeof ci === "number") - i = ci - 1; - else if (ci === BREAK) - return BREAK; - else if (ci === REMOVE) { - token.items.splice(i, 1); - i -= 1; - } - } - if (typeof ctrl === "function" && field === "key") - ctrl = ctrl(item, path5); - } - } - return typeof ctrl === "function" ? ctrl(item, path5) : ctrl; - } - exports.visit = visit; - } -}); - -// ../../node_modules/yaml/dist/parse/cst.js -var require_cst = __commonJS({ - "../../node_modules/yaml/dist/parse/cst.js"(exports) { - "use strict"; - var cstScalar = require_cst_scalar(); - var cstStringify = require_cst_stringify(); - var cstVisit = require_cst_visit(); - var BOM = "\uFEFF"; - var DOCUMENT = ""; - var FLOW_END = ""; - var SCALAR = ""; - var isCollection = (token) => !!token && "items" in token; - var isScalar = (token) => !!token && (token.type === "scalar" || token.type === "single-quoted-scalar" || token.type === "double-quoted-scalar" || token.type === "block-scalar"); - function prettyToken(token) { - switch (token) { - case BOM: - return ""; - case DOCUMENT: - return ""; - case FLOW_END: - return ""; - case SCALAR: - return ""; - default: - return JSON.stringify(token); - } - } - function tokenType(source) { - switch (source) { - case BOM: - return "byte-order-mark"; - case DOCUMENT: - return "doc-mode"; - case FLOW_END: - return "flow-error-end"; - case SCALAR: - return "scalar"; - case "---": - return "doc-start"; - case "...": - return "doc-end"; - case "": - case "\n": - case "\r\n": - return "newline"; - case "-": - return "seq-item-ind"; - case "?": - return "explicit-key-ind"; - case ":": - return "map-value-ind"; - case "{": - return "flow-map-start"; - case "}": - return "flow-map-end"; - case "[": - return "flow-seq-start"; - case "]": - return "flow-seq-end"; - case ",": - return "comma"; - } - switch (source[0]) { - case " ": - case " ": - return "space"; - case "#": - return "comment"; - case "%": - return "directive-line"; - case "*": - return "alias"; - case "&": - return "anchor"; - case "!": - return "tag"; - case "'": - return "single-quoted-scalar"; - case '"': - return "double-quoted-scalar"; - case "|": - case ">": - return "block-scalar-header"; - } - return null; - } - exports.createScalarToken = cstScalar.createScalarToken; - exports.resolveAsScalar = cstScalar.resolveAsScalar; - exports.setScalarValue = cstScalar.setScalarValue; - exports.stringify = cstStringify.stringify; - exports.visit = cstVisit.visit; - exports.BOM = BOM; - exports.DOCUMENT = DOCUMENT; - exports.FLOW_END = FLOW_END; - exports.SCALAR = SCALAR; - exports.isCollection = isCollection; - exports.isScalar = isScalar; - exports.prettyToken = prettyToken; - exports.tokenType = tokenType; - } -}); - -// ../../node_modules/yaml/dist/parse/lexer.js -var require_lexer = __commonJS({ - "../../node_modules/yaml/dist/parse/lexer.js"(exports) { - "use strict"; - var cst = require_cst(); - function isEmpty(ch) { - switch (ch) { - case void 0: - case " ": - case "\n": - case "\r": - case " ": - return true; - default: - return false; - } - } - var hexDigits = "0123456789ABCDEFabcdef".split(""); - var tagChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""); - var invalidFlowScalarChars = ",[]{}".split(""); - var invalidAnchorChars = " ,[]{}\n\r ".split(""); - var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.includes(ch); - var Lexer = class { - constructor() { - this.atEnd = false; - this.blockScalarIndent = -1; - this.blockScalarKeep = false; - this.buffer = ""; - this.flowKey = false; - this.flowLevel = 0; - this.indentNext = 0; - this.indentValue = 0; - this.lineEndPos = null; - this.next = null; - this.pos = 0; - } - /** - * Generate YAML tokens from the `source` string. If `incomplete`, - * a part of the last line may be left as a buffer for the next call. - * - * @returns A generator of lexical tokens - */ - *lex(source, incomplete = false) { - if (source) { - this.buffer = this.buffer ? this.buffer + source : source; - this.lineEndPos = null; - } - this.atEnd = !incomplete; - let next = this.next ?? "stream"; - while (next && (incomplete || this.hasChars(1))) - next = yield* this.parseNext(next); - } - atLineEnd() { - let i = this.pos; - let ch = this.buffer[i]; - while (ch === " " || ch === " ") - ch = this.buffer[++i]; - if (!ch || ch === "#" || ch === "\n") - return true; - if (ch === "\r") - return this.buffer[i + 1] === "\n"; - return false; - } - charAt(n) { - return this.buffer[this.pos + n]; - } - continueScalar(offset) { - let ch = this.buffer[offset]; - if (this.indentNext > 0) { - let indent = 0; - while (ch === " ") - ch = this.buffer[++indent + offset]; - if (ch === "\r") { - const next = this.buffer[indent + offset + 1]; - if (next === "\n" || !next && !this.atEnd) - return offset + indent + 1; - } - return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1; - } - if (ch === "-" || ch === ".") { - const dt = this.buffer.substr(offset, 3); - if ((dt === "---" || dt === "...") && isEmpty(this.buffer[offset + 3])) - return -1; - } - return offset; - } - getLine() { - let end = this.lineEndPos; - if (typeof end !== "number" || end !== -1 && end < this.pos) { - end = this.buffer.indexOf("\n", this.pos); - this.lineEndPos = end; - } - if (end === -1) - return this.atEnd ? this.buffer.substring(this.pos) : null; - if (this.buffer[end - 1] === "\r") - end -= 1; - return this.buffer.substring(this.pos, end); - } - hasChars(n) { - return this.pos + n <= this.buffer.length; - } - setNext(state) { - this.buffer = this.buffer.substring(this.pos); - this.pos = 0; - this.lineEndPos = null; - this.next = state; - return null; - } - peek(n) { - return this.buffer.substr(this.pos, n); - } - *parseNext(next) { - switch (next) { - case "stream": - return yield* this.parseStream(); - case "line-start": - return yield* this.parseLineStart(); - case "block-start": - return yield* this.parseBlockStart(); - case "doc": - return yield* this.parseDocument(); - case "flow": - return yield* this.parseFlowCollection(); - case "quoted-scalar": - return yield* this.parseQuotedScalar(); - case "block-scalar": - return yield* this.parseBlockScalar(); - case "plain-scalar": - return yield* this.parsePlainScalar(); - } - } - *parseStream() { - let line = this.getLine(); - if (line === null) - return this.setNext("stream"); - if (line[0] === cst.BOM) { - yield* this.pushCount(1); - line = line.substring(1); - } - if (line[0] === "%") { - let dirEnd = line.length; - const cs = line.indexOf("#"); - if (cs !== -1) { - const ch = line[cs - 1]; - if (ch === " " || ch === " ") - dirEnd = cs - 1; - } - while (true) { - const ch = line[dirEnd - 1]; - if (ch === " " || ch === " ") - dirEnd -= 1; - else - break; - } - const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true)); - yield* this.pushCount(line.length - n); - this.pushNewline(); - return "stream"; - } - if (this.atLineEnd()) { - const sp = yield* this.pushSpaces(true); - yield* this.pushCount(line.length - sp); - yield* this.pushNewline(); - return "stream"; - } - yield cst.DOCUMENT; - return yield* this.parseLineStart(); - } - *parseLineStart() { - const ch = this.charAt(0); - if (!ch && !this.atEnd) - return this.setNext("line-start"); - if (ch === "-" || ch === ".") { - if (!this.atEnd && !this.hasChars(4)) - return this.setNext("line-start"); - const s = this.peek(3); - if (s === "---" && isEmpty(this.charAt(3))) { - yield* this.pushCount(3); - this.indentValue = 0; - this.indentNext = 0; - return "doc"; - } else if (s === "..." && isEmpty(this.charAt(3))) { - yield* this.pushCount(3); - return "stream"; - } - } - this.indentValue = yield* this.pushSpaces(false); - if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1))) - this.indentNext = this.indentValue; - return yield* this.parseBlockStart(); - } - *parseBlockStart() { - const [ch0, ch1] = this.peek(2); - if (!ch1 && !this.atEnd) - return this.setNext("block-start"); - if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) { - const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)); - this.indentNext = this.indentValue + 1; - this.indentValue += n; - return yield* this.parseBlockStart(); - } - return "doc"; - } - *parseDocument() { - yield* this.pushSpaces(true); - const line = this.getLine(); - if (line === null) - return this.setNext("doc"); - let n = yield* this.pushIndicators(); - switch (line[n]) { - case "#": - yield* this.pushCount(line.length - n); - case void 0: - yield* this.pushNewline(); - return yield* this.parseLineStart(); - case "{": - case "[": - yield* this.pushCount(1); - this.flowKey = false; - this.flowLevel = 1; - return "flow"; - case "}": - case "]": - yield* this.pushCount(1); - return "doc"; - case "*": - yield* this.pushUntil(isNotAnchorChar); - return "doc"; - case '"': - case "'": - return yield* this.parseQuotedScalar(); - case "|": - case ">": - n += yield* this.parseBlockScalarHeader(); - n += yield* this.pushSpaces(true); - yield* this.pushCount(line.length - n); - yield* this.pushNewline(); - return yield* this.parseBlockScalar(); - default: - return yield* this.parsePlainScalar(); - } - } - *parseFlowCollection() { - let nl, sp; - let indent = -1; - do { - nl = yield* this.pushNewline(); - if (nl > 0) { - sp = yield* this.pushSpaces(false); - this.indentValue = indent = sp; - } else { - sp = 0; - } - sp += yield* this.pushSpaces(true); - } while (nl + sp > 0); - const line = this.getLine(); - if (line === null) - return this.setNext("flow"); - if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) { - const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}"); - if (!atFlowEndMarker) { - this.flowLevel = 0; - yield cst.FLOW_END; - return yield* this.parseLineStart(); - } - } - let n = 0; - while (line[n] === ",") { - n += yield* this.pushCount(1); - n += yield* this.pushSpaces(true); - this.flowKey = false; - } - n += yield* this.pushIndicators(); - switch (line[n]) { - case void 0: - return "flow"; - case "#": - yield* this.pushCount(line.length - n); - return "flow"; - case "{": - case "[": - yield* this.pushCount(1); - this.flowKey = false; - this.flowLevel += 1; - return "flow"; - case "}": - case "]": - yield* this.pushCount(1); - this.flowKey = true; - this.flowLevel -= 1; - return this.flowLevel ? "flow" : "doc"; - case "*": - yield* this.pushUntil(isNotAnchorChar); - return "flow"; - case '"': - case "'": - this.flowKey = true; - return yield* this.parseQuotedScalar(); - case ":": { - const next = this.charAt(1); - if (this.flowKey || isEmpty(next) || next === ",") { - this.flowKey = false; - yield* this.pushCount(1); - yield* this.pushSpaces(true); - return "flow"; - } - } - default: - this.flowKey = false; - return yield* this.parsePlainScalar(); - } - } - *parseQuotedScalar() { - const quote = this.charAt(0); - let end = this.buffer.indexOf(quote, this.pos + 1); - if (quote === "'") { - while (end !== -1 && this.buffer[end + 1] === "'") - end = this.buffer.indexOf("'", end + 2); - } else { - while (end !== -1) { - let n = 0; - while (this.buffer[end - 1 - n] === "\\") - n += 1; - if (n % 2 === 0) - break; - end = this.buffer.indexOf('"', end + 1); - } - } - const qb = this.buffer.substring(0, end); - let nl = qb.indexOf("\n", this.pos); - if (nl !== -1) { - while (nl !== -1) { - const cs = this.continueScalar(nl + 1); - if (cs === -1) - break; - nl = qb.indexOf("\n", cs); - } - if (nl !== -1) { - end = nl - (qb[nl - 1] === "\r" ? 2 : 1); - } - } - if (end === -1) { - if (!this.atEnd) - return this.setNext("quoted-scalar"); - end = this.buffer.length; - } - yield* this.pushToIndex(end + 1, false); - return this.flowLevel ? "flow" : "doc"; - } - *parseBlockScalarHeader() { - this.blockScalarIndent = -1; - this.blockScalarKeep = false; - let i = this.pos; - while (true) { - const ch = this.buffer[++i]; - if (ch === "+") - this.blockScalarKeep = true; - else if (ch > "0" && ch <= "9") - this.blockScalarIndent = Number(ch) - 1; - else if (ch !== "-") - break; - } - return yield* this.pushUntil((ch) => isEmpty(ch) || ch === "#"); - } - *parseBlockScalar() { - let nl = this.pos - 1; - let indent = 0; - let ch; - loop: - for (let i = this.pos; ch = this.buffer[i]; ++i) { - switch (ch) { - case " ": - indent += 1; - break; - case "\n": - nl = i; - indent = 0; - break; - case "\r": { - const next = this.buffer[i + 1]; - if (!next && !this.atEnd) - return this.setNext("block-scalar"); - if (next === "\n") - break; - } - default: - break loop; - } - } - if (!ch && !this.atEnd) - return this.setNext("block-scalar"); - if (indent >= this.indentNext) { - if (this.blockScalarIndent === -1) - this.indentNext = indent; - else - this.indentNext += this.blockScalarIndent; - do { - const cs = this.continueScalar(nl + 1); - if (cs === -1) - break; - nl = this.buffer.indexOf("\n", cs); - } while (nl !== -1); - if (nl === -1) { - if (!this.atEnd) - return this.setNext("block-scalar"); - nl = this.buffer.length; - } - } - if (!this.blockScalarKeep) { - do { - let i = nl - 1; - let ch2 = this.buffer[i]; - if (ch2 === "\r") - ch2 = this.buffer[--i]; - const lastChar = i; - while (ch2 === " " || ch2 === " ") - ch2 = this.buffer[--i]; - if (ch2 === "\n" && i >= this.pos && i + 1 + indent > lastChar) - nl = i; - else - break; - } while (true); - } - yield cst.SCALAR; - yield* this.pushToIndex(nl + 1, true); - return yield* this.parseLineStart(); - } - *parsePlainScalar() { - const inFlow = this.flowLevel > 0; - let end = this.pos - 1; - let i = this.pos - 1; - let ch; - while (ch = this.buffer[++i]) { - if (ch === ":") { - const next = this.buffer[i + 1]; - if (isEmpty(next) || inFlow && next === ",") - break; - end = i; - } else if (isEmpty(ch)) { - let next = this.buffer[i + 1]; - if (ch === "\r") { - if (next === "\n") { - i += 1; - ch = "\n"; - next = this.buffer[i + 1]; - } else - end = i; - } - if (next === "#" || inFlow && invalidFlowScalarChars.includes(next)) - break; - if (ch === "\n") { - const cs = this.continueScalar(i + 1); - if (cs === -1) - break; - i = Math.max(i, cs - 2); - } - } else { - if (inFlow && invalidFlowScalarChars.includes(ch)) - break; - end = i; - } - } - if (!ch && !this.atEnd) - return this.setNext("plain-scalar"); - yield cst.SCALAR; - yield* this.pushToIndex(end + 1, true); - return inFlow ? "flow" : "doc"; - } - *pushCount(n) { - if (n > 0) { - yield this.buffer.substr(this.pos, n); - this.pos += n; - return n; - } - return 0; - } - *pushToIndex(i, allowEmpty) { - const s = this.buffer.slice(this.pos, i); - if (s) { - yield s; - this.pos += s.length; - return s.length; - } else if (allowEmpty) - yield ""; - return 0; - } - *pushIndicators() { - switch (this.charAt(0)) { - case "!": - return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); - case "&": - return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); - case "-": - case "?": - case ":": { - const inFlow = this.flowLevel > 0; - const ch1 = this.charAt(1); - if (isEmpty(ch1) || inFlow && invalidFlowScalarChars.includes(ch1)) { - if (!inFlow) - this.indentNext = this.indentValue + 1; - else if (this.flowKey) - this.flowKey = false; - return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); - } - } - } - return 0; - } - *pushTag() { - if (this.charAt(1) === "<") { - let i = this.pos + 2; - let ch = this.buffer[i]; - while (!isEmpty(ch) && ch !== ">") - ch = this.buffer[++i]; - return yield* this.pushToIndex(ch === ">" ? i + 1 : i, false); - } else { - let i = this.pos + 1; - let ch = this.buffer[i]; - while (ch) { - if (tagChars.includes(ch)) - ch = this.buffer[++i]; - else if (ch === "%" && hexDigits.includes(this.buffer[i + 1]) && hexDigits.includes(this.buffer[i + 2])) { - ch = this.buffer[i += 3]; - } else - break; - } - return yield* this.pushToIndex(i, false); - } - } - *pushNewline() { - const ch = this.buffer[this.pos]; - if (ch === "\n") - return yield* this.pushCount(1); - else if (ch === "\r" && this.charAt(1) === "\n") - return yield* this.pushCount(2); - else - return 0; - } - *pushSpaces(allowTabs) { - let i = this.pos - 1; - let ch; - do { - ch = this.buffer[++i]; - } while (ch === " " || allowTabs && ch === " "); - const n = i - this.pos; - if (n > 0) { - yield this.buffer.substr(this.pos, n); - this.pos = i; - } - return n; - } - *pushUntil(test2) { - let i = this.pos; - let ch = this.buffer[i]; - while (!test2(ch)) - ch = this.buffer[++i]; - return yield* this.pushToIndex(i, false); - } - }; - exports.Lexer = Lexer; - } -}); - -// ../../node_modules/yaml/dist/parse/line-counter.js -var require_line_counter = __commonJS({ - "../../node_modules/yaml/dist/parse/line-counter.js"(exports) { - "use strict"; - var LineCounter = class { - constructor() { - this.lineStarts = []; - this.addNewLine = (offset) => this.lineStarts.push(offset); - this.linePos = (offset) => { - let low = 0; - let high = this.lineStarts.length; - while (low < high) { - const mid = low + high >> 1; - if (this.lineStarts[mid] < offset) - low = mid + 1; - else - high = mid; - } - if (this.lineStarts[low] === offset) - return { line: low + 1, col: 1 }; - if (low === 0) - return { line: 0, col: offset }; - const start = this.lineStarts[low - 1]; - return { line: low, col: offset - start + 1 }; - }; - } - }; - exports.LineCounter = LineCounter; - } -}); - -// ../../node_modules/yaml/dist/parse/parser.js -var require_parser = __commonJS({ - "../../node_modules/yaml/dist/parse/parser.js"(exports) { - "use strict"; - var cst = require_cst(); - var lexer = require_lexer(); - function includesToken(list, type) { - for (let i = 0; i < list.length; ++i) - if (list[i].type === type) - return true; - return false; - } - function findNonEmptyIndex(list) { - for (let i = 0; i < list.length; ++i) { - switch (list[i].type) { - case "space": - case "comment": - case "newline": - break; - default: - return i; - } - } - return -1; - } - function isFlowToken(token) { - switch (token?.type) { - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": - case "flow-collection": - return true; - default: - return false; - } - } - function getPrevProps(parent) { - switch (parent.type) { - case "document": - return parent.start; - case "block-map": { - const it = parent.items[parent.items.length - 1]; - return it.sep ?? it.start; - } - case "block-seq": - return parent.items[parent.items.length - 1].start; - default: - return []; - } - } - function getFirstKeyStartProps(prev) { - if (prev.length === 0) - return []; - let i = prev.length; - loop: - while (--i >= 0) { - switch (prev[i].type) { - case "doc-start": - case "explicit-key-ind": - case "map-value-ind": - case "seq-item-ind": - case "newline": - break loop; - } - } - while (prev[++i]?.type === "space") { - } - return prev.splice(i, prev.length); - } - function fixFlowSeqItems(fc) { - if (fc.start.type === "flow-seq-start") { - for (const it of fc.items) { - if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) { - if (it.key) - it.value = it.key; - delete it.key; - if (isFlowToken(it.value)) { - if (it.value.end) - Array.prototype.push.apply(it.value.end, it.sep); - else - it.value.end = it.sep; - } else - Array.prototype.push.apply(it.start, it.sep); - delete it.sep; - } - } - } - } - var Parser = class { - /** - * @param onNewLine - If defined, called separately with the start position of - * each new line (in `parse()`, including the start of input). - */ - constructor(onNewLine) { - this.atNewLine = true; - this.atScalar = false; - this.indent = 0; - this.offset = 0; - this.onKeyLine = false; - this.stack = []; - this.source = ""; - this.type = ""; - this.lexer = new lexer.Lexer(); - this.onNewLine = onNewLine; - } - /** - * Parse `source` as a YAML stream. - * If `incomplete`, a part of the last line may be left as a buffer for the next call. - * - * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens. - * - * @returns A generator of tokens representing each directive, document, and other structure. - */ - *parse(source, incomplete = false) { - if (this.onNewLine && this.offset === 0) - this.onNewLine(0); - for (const lexeme of this.lexer.lex(source, incomplete)) - yield* this.next(lexeme); - if (!incomplete) - yield* this.end(); - } - /** - * Advance the parser by the `source` of one lexical token. - */ - *next(source) { - this.source = source; - if (process.env.LOG_TOKENS) - console.log("|", cst.prettyToken(source)); - if (this.atScalar) { - this.atScalar = false; - yield* this.step(); - this.offset += source.length; - return; - } - const type = cst.tokenType(source); - if (!type) { - const message = `Not a YAML token: ${source}`; - yield* this.pop({ type: "error", offset: this.offset, message, source }); - this.offset += source.length; - } else if (type === "scalar") { - this.atNewLine = false; - this.atScalar = true; - this.type = "scalar"; - } else { - this.type = type; - yield* this.step(); - switch (type) { - case "newline": - this.atNewLine = true; - this.indent = 0; - if (this.onNewLine) - this.onNewLine(this.offset + source.length); - break; - case "space": - if (this.atNewLine && source[0] === " ") - this.indent += source.length; - break; - case "explicit-key-ind": - case "map-value-ind": - case "seq-item-ind": - if (this.atNewLine) - this.indent += source.length; - break; - case "doc-mode": - case "flow-error-end": - return; - default: - this.atNewLine = false; - } - this.offset += source.length; - } - } - /** Call at end of input to push out any remaining constructions */ - *end() { - while (this.stack.length > 0) - yield* this.pop(); - } - get sourceToken() { - const st = { - type: this.type, - offset: this.offset, - indent: this.indent, - source: this.source - }; - return st; - } - *step() { - const top = this.peek(1); - if (this.type === "doc-end" && (!top || top.type !== "doc-end")) { - while (this.stack.length > 0) - yield* this.pop(); - this.stack.push({ - type: "doc-end", - offset: this.offset, - source: this.source - }); - return; - } - if (!top) - return yield* this.stream(); - switch (top.type) { - case "document": - return yield* this.document(top); - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": - return yield* this.scalar(top); - case "block-scalar": - return yield* this.blockScalar(top); - case "block-map": - return yield* this.blockMap(top); - case "block-seq": - return yield* this.blockSequence(top); - case "flow-collection": - return yield* this.flowCollection(top); - case "doc-end": - return yield* this.documentEnd(top); - } - yield* this.pop(); - } - peek(n) { - return this.stack[this.stack.length - n]; - } - *pop(error) { - const token = error ?? this.stack.pop(); - if (!token) { - const message = "Tried to pop an empty stack"; - yield { type: "error", offset: this.offset, source: "", message }; - } else if (this.stack.length === 0) { - yield token; - } else { - const top = this.peek(1); - if (token.type === "block-scalar") { - token.indent = "indent" in top ? top.indent : 0; - } else if (token.type === "flow-collection" && top.type === "document") { - token.indent = 0; - } - if (token.type === "flow-collection") - fixFlowSeqItems(token); - switch (top.type) { - case "document": - top.value = token; - break; - case "block-scalar": - top.props.push(token); - break; - case "block-map": { - const it = top.items[top.items.length - 1]; - if (it.value) { - top.items.push({ start: [], key: token, sep: [] }); - this.onKeyLine = true; - return; - } else if (it.sep) { - it.value = token; - } else { - Object.assign(it, { key: token, sep: [] }); - this.onKeyLine = !includesToken(it.start, "explicit-key-ind"); - return; - } - break; - } - case "block-seq": { - const it = top.items[top.items.length - 1]; - if (it.value) - top.items.push({ start: [], value: token }); - else - it.value = token; - break; - } - case "flow-collection": { - const it = top.items[top.items.length - 1]; - if (!it || it.value) - top.items.push({ start: [], key: token, sep: [] }); - else if (it.sep) - it.value = token; - else - Object.assign(it, { key: token, sep: [] }); - return; - } - default: - yield* this.pop(); - yield* this.pop(token); - } - if ((top.type === "document" || top.type === "block-map" || top.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) { - const last = token.items[token.items.length - 1]; - if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st) => st.type !== "comment" || st.indent < token.indent))) { - if (top.type === "document") - top.end = last.start; - else - top.items.push({ start: last.start }); - token.items.splice(-1, 1); - } - } - } - } - *stream() { - switch (this.type) { - case "directive-line": - yield { type: "directive", offset: this.offset, source: this.source }; - return; - case "byte-order-mark": - case "space": - case "comment": - case "newline": - yield this.sourceToken; - return; - case "doc-mode": - case "doc-start": { - const doc = { - type: "document", - offset: this.offset, - start: [] - }; - if (this.type === "doc-start") - doc.start.push(this.sourceToken); - this.stack.push(doc); - return; - } - } - yield { - type: "error", - offset: this.offset, - message: `Unexpected ${this.type} token in YAML stream`, - source: this.source - }; - } - *document(doc) { - if (doc.value) - return yield* this.lineEnd(doc); - switch (this.type) { - case "doc-start": { - if (findNonEmptyIndex(doc.start) !== -1) { - yield* this.pop(); - yield* this.step(); - } else - doc.start.push(this.sourceToken); - return; - } - case "anchor": - case "tag": - case "space": - case "comment": - case "newline": - doc.start.push(this.sourceToken); - return; - } - const bv = this.startBlockValue(doc); - if (bv) - this.stack.push(bv); - else { - yield { - type: "error", - offset: this.offset, - message: `Unexpected ${this.type} token in YAML document`, - source: this.source - }; - } - } - *scalar(scalar) { - if (this.type === "map-value-ind") { - const prev = getPrevProps(this.peek(2)); - const start = getFirstKeyStartProps(prev); - let sep; - if (scalar.end) { - sep = scalar.end; - sep.push(this.sourceToken); - delete scalar.end; - } else - sep = [this.sourceToken]; - const map = { - type: "block-map", - offset: scalar.offset, - indent: scalar.indent, - items: [{ start, key: scalar, sep }] - }; - this.onKeyLine = true; - this.stack[this.stack.length - 1] = map; - } else - yield* this.lineEnd(scalar); - } - *blockScalar(scalar) { - switch (this.type) { - case "space": - case "comment": - case "newline": - scalar.props.push(this.sourceToken); - return; - case "scalar": - scalar.source = this.source; - this.atNewLine = true; - this.indent = 0; - if (this.onNewLine) { - let nl = this.source.indexOf("\n") + 1; - while (nl !== 0) { - this.onNewLine(this.offset + nl); - nl = this.source.indexOf("\n", nl) + 1; - } - } - yield* this.pop(); - break; - default: - yield* this.pop(); - yield* this.step(); - } - } - *blockMap(map) { - const it = map.items[map.items.length - 1]; - switch (this.type) { - case "newline": - this.onKeyLine = false; - if (it.value) { - const end = "end" in it.value ? it.value.end : void 0; - const last = Array.isArray(end) ? end[end.length - 1] : void 0; - if (last?.type === "comment") - end?.push(this.sourceToken); - else - map.items.push({ start: [this.sourceToken] }); - } else if (it.sep) { - it.sep.push(this.sourceToken); - } else { - it.start.push(this.sourceToken); - } - return; - case "space": - case "comment": - if (it.value) { - map.items.push({ start: [this.sourceToken] }); - } else if (it.sep) { - it.sep.push(this.sourceToken); - } else { - if (this.atIndentedComment(it.start, map.indent)) { - const prev = map.items[map.items.length - 2]; - const end = prev?.value?.end; - if (Array.isArray(end)) { - Array.prototype.push.apply(end, it.start); - end.push(this.sourceToken); - map.items.pop(); - return; - } - } - it.start.push(this.sourceToken); - } - return; - } - if (this.indent >= map.indent) { - const atNextItem = !this.onKeyLine && this.indent === map.indent && it.sep; - let start = []; - if (atNextItem && it.sep && !it.value) { - const nl = []; - for (let i = 0; i < it.sep.length; ++i) { - const st = it.sep[i]; - switch (st.type) { - case "newline": - nl.push(i); - break; - case "space": - break; - case "comment": - if (st.indent > map.indent) - nl.length = 0; - break; - default: - nl.length = 0; - } - } - if (nl.length >= 2) - start = it.sep.splice(nl[1]); - } - switch (this.type) { - case "anchor": - case "tag": - if (atNextItem || it.value) { - start.push(this.sourceToken); - map.items.push({ start }); - this.onKeyLine = true; - } else if (it.sep) { - it.sep.push(this.sourceToken); - } else { - it.start.push(this.sourceToken); - } - return; - case "explicit-key-ind": - if (!it.sep && !includesToken(it.start, "explicit-key-ind")) { - it.start.push(this.sourceToken); - } else if (atNextItem || it.value) { - start.push(this.sourceToken); - map.items.push({ start }); - } else { - this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ start: [this.sourceToken] }] - }); - } - this.onKeyLine = true; - return; - case "map-value-ind": - if (includesToken(it.start, "explicit-key-ind")) { - if (!it.sep) { - if (includesToken(it.start, "newline")) { - Object.assign(it, { key: null, sep: [this.sourceToken] }); - } else { - const start2 = getFirstKeyStartProps(it.start); - this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ start: start2, key: null, sep: [this.sourceToken] }] - }); - } - } else if (it.value) { - map.items.push({ start: [], key: null, sep: [this.sourceToken] }); - } else if (includesToken(it.sep, "map-value-ind")) { - this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ start, key: null, sep: [this.sourceToken] }] - }); - } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) { - const start2 = getFirstKeyStartProps(it.start); - const key = it.key; - const sep = it.sep; - sep.push(this.sourceToken); - delete it.key, delete it.sep; - this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ start: start2, key, sep }] - }); - } else if (start.length > 0) { - it.sep = it.sep.concat(start, this.sourceToken); - } else { - it.sep.push(this.sourceToken); - } - } else { - if (!it.sep) { - Object.assign(it, { key: null, sep: [this.sourceToken] }); - } else if (it.value || atNextItem) { - map.items.push({ start, key: null, sep: [this.sourceToken] }); - } else if (includesToken(it.sep, "map-value-ind")) { - this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ start: [], key: null, sep: [this.sourceToken] }] - }); - } else { - it.sep.push(this.sourceToken); - } - } - this.onKeyLine = true; - return; - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": { - const fs5 = this.flowScalar(this.type); - if (atNextItem || it.value) { - map.items.push({ start, key: fs5, sep: [] }); - this.onKeyLine = true; - } else if (it.sep) { - this.stack.push(fs5); - } else { - Object.assign(it, { key: fs5, sep: [] }); - this.onKeyLine = true; - } - return; - } - default: { - const bv = this.startBlockValue(map); - if (bv) { - if (atNextItem && bv.type !== "block-seq" && includesToken(it.start, "explicit-key-ind")) { - map.items.push({ start }); - } - this.stack.push(bv); - return; - } - } - } - } - yield* this.pop(); - yield* this.step(); - } - *blockSequence(seq) { - const it = seq.items[seq.items.length - 1]; - switch (this.type) { - case "newline": - if (it.value) { - const end = "end" in it.value ? it.value.end : void 0; - const last = Array.isArray(end) ? end[end.length - 1] : void 0; - if (last?.type === "comment") - end?.push(this.sourceToken); - else - seq.items.push({ start: [this.sourceToken] }); - } else - it.start.push(this.sourceToken); - return; - case "space": - case "comment": - if (it.value) - seq.items.push({ start: [this.sourceToken] }); - else { - if (this.atIndentedComment(it.start, seq.indent)) { - const prev = seq.items[seq.items.length - 2]; - const end = prev?.value?.end; - if (Array.isArray(end)) { - Array.prototype.push.apply(end, it.start); - end.push(this.sourceToken); - seq.items.pop(); - return; - } - } - it.start.push(this.sourceToken); - } - return; - case "anchor": - case "tag": - if (it.value || this.indent <= seq.indent) - break; - it.start.push(this.sourceToken); - return; - case "seq-item-ind": - if (this.indent !== seq.indent) - break; - if (it.value || includesToken(it.start, "seq-item-ind")) - seq.items.push({ start: [this.sourceToken] }); - else - it.start.push(this.sourceToken); - return; - } - if (this.indent > seq.indent) { - const bv = this.startBlockValue(seq); - if (bv) { - this.stack.push(bv); - return; - } - } - yield* this.pop(); - yield* this.step(); - } - *flowCollection(fc) { - const it = fc.items[fc.items.length - 1]; - if (this.type === "flow-error-end") { - let top; - do { - yield* this.pop(); - top = this.peek(1); - } while (top && top.type === "flow-collection"); - } else if (fc.end.length === 0) { - switch (this.type) { - case "comma": - case "explicit-key-ind": - if (!it || it.sep) - fc.items.push({ start: [this.sourceToken] }); - else - it.start.push(this.sourceToken); - return; - case "map-value-ind": - if (!it || it.value) - fc.items.push({ start: [], key: null, sep: [this.sourceToken] }); - else if (it.sep) - it.sep.push(this.sourceToken); - else - Object.assign(it, { key: null, sep: [this.sourceToken] }); - return; - case "space": - case "comment": - case "newline": - case "anchor": - case "tag": - if (!it || it.value) - fc.items.push({ start: [this.sourceToken] }); - else if (it.sep) - it.sep.push(this.sourceToken); - else - it.start.push(this.sourceToken); - return; - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": { - const fs5 = this.flowScalar(this.type); - if (!it || it.value) - fc.items.push({ start: [], key: fs5, sep: [] }); - else if (it.sep) - this.stack.push(fs5); - else - Object.assign(it, { key: fs5, sep: [] }); - return; - } - case "flow-map-end": - case "flow-seq-end": - fc.end.push(this.sourceToken); - return; - } - const bv = this.startBlockValue(fc); - if (bv) - this.stack.push(bv); - else { - yield* this.pop(); - yield* this.step(); - } - } else { - const parent = this.peek(2); - if (parent.type === "block-map" && (this.type === "map-value-ind" && parent.indent === fc.indent || this.type === "newline" && !parent.items[parent.items.length - 1].sep)) { - yield* this.pop(); - yield* this.step(); - } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") { - const prev = getPrevProps(parent); - const start = getFirstKeyStartProps(prev); - fixFlowSeqItems(fc); - const sep = fc.end.splice(1, fc.end.length); - sep.push(this.sourceToken); - const map = { - type: "block-map", - offset: fc.offset, - indent: fc.indent, - items: [{ start, key: fc, sep }] - }; - this.onKeyLine = true; - this.stack[this.stack.length - 1] = map; - } else { - yield* this.lineEnd(fc); - } - } - } - flowScalar(type) { - if (this.onNewLine) { - let nl = this.source.indexOf("\n") + 1; - while (nl !== 0) { - this.onNewLine(this.offset + nl); - nl = this.source.indexOf("\n", nl) + 1; - } - } - return { - type, - offset: this.offset, - indent: this.indent, - source: this.source - }; - } - startBlockValue(parent) { - switch (this.type) { - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": - return this.flowScalar(this.type); - case "block-scalar-header": - return { - type: "block-scalar", - offset: this.offset, - indent: this.indent, - props: [this.sourceToken], - source: "" - }; - case "flow-map-start": - case "flow-seq-start": - return { - type: "flow-collection", - offset: this.offset, - indent: this.indent, - start: this.sourceToken, - items: [], - end: [] - }; - case "seq-item-ind": - return { - type: "block-seq", - offset: this.offset, - indent: this.indent, - items: [{ start: [this.sourceToken] }] - }; - case "explicit-key-ind": { - this.onKeyLine = true; - const prev = getPrevProps(parent); - const start = getFirstKeyStartProps(prev); - start.push(this.sourceToken); - return { - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ start }] - }; - } - case "map-value-ind": { - this.onKeyLine = true; - const prev = getPrevProps(parent); - const start = getFirstKeyStartProps(prev); - return { - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ start, key: null, sep: [this.sourceToken] }] - }; - } - } - return null; - } - atIndentedComment(start, indent) { - if (this.type !== "comment") - return false; - if (this.indent <= indent) - return false; - return start.every((st) => st.type === "newline" || st.type === "space"); - } - *documentEnd(docEnd) { - if (this.type !== "doc-mode") { - if (docEnd.end) - docEnd.end.push(this.sourceToken); - else - docEnd.end = [this.sourceToken]; - if (this.type === "newline") - yield* this.pop(); - } - } - *lineEnd(token) { - switch (this.type) { - case "comma": - case "doc-start": - case "doc-end": - case "flow-seq-end": - case "flow-map-end": - case "map-value-ind": - yield* this.pop(); - yield* this.step(); - break; - case "newline": - this.onKeyLine = false; - case "space": - case "comment": - default: - if (token.end) - token.end.push(this.sourceToken); - else - token.end = [this.sourceToken]; - if (this.type === "newline") - yield* this.pop(); - } - } - }; - exports.Parser = Parser; - } -}); - -// ../../node_modules/yaml/dist/public-api.js -var require_public_api = __commonJS({ - "../../node_modules/yaml/dist/public-api.js"(exports) { - "use strict"; - var composer = require_composer(); - var Document = require_Document(); - var errors = require_errors2(); - var log2 = require_log(); - var lineCounter = require_line_counter(); - var parser = require_parser(); - function parseOptions(options) { - const prettyErrors = options.prettyErrors !== false; - const lineCounter$1 = options.lineCounter || prettyErrors && new lineCounter.LineCounter() || null; - return { lineCounter: lineCounter$1, prettyErrors }; - } - function parseAllDocuments(source, options = {}) { - const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options); - const parser$1 = new parser.Parser(lineCounter2?.addNewLine); - const composer$1 = new composer.Composer(options); - const docs = Array.from(composer$1.compose(parser$1.parse(source))); - if (prettyErrors && lineCounter2) - for (const doc of docs) { - doc.errors.forEach(errors.prettifyError(source, lineCounter2)); - doc.warnings.forEach(errors.prettifyError(source, lineCounter2)); - } - if (docs.length > 0) - return docs; - return Object.assign([], { empty: true }, composer$1.streamInfo()); - } - function parseDocument(source, options = {}) { - const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options); - const parser$1 = new parser.Parser(lineCounter2?.addNewLine); - const composer$1 = new composer.Composer(options); - let doc = null; - for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) { - if (!doc) - doc = _doc; - else if (doc.options.logLevel !== "silent") { - doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()")); - break; - } - } - if (prettyErrors && lineCounter2) { - doc.errors.forEach(errors.prettifyError(source, lineCounter2)); - doc.warnings.forEach(errors.prettifyError(source, lineCounter2)); - } - return doc; - } - function parse2(src, reviver, options) { - let _reviver = void 0; - if (typeof reviver === "function") { - _reviver = reviver; - } else if (options === void 0 && reviver && typeof reviver === "object") { - options = reviver; - } - const doc = parseDocument(src, options); - if (!doc) - return null; - doc.warnings.forEach((warning2) => log2.warn(doc.options.logLevel, warning2)); - if (doc.errors.length > 0) { - if (doc.options.logLevel !== "silent") - throw doc.errors[0]; - else - doc.errors = []; - } - return doc.toJS(Object.assign({ reviver: _reviver }, options)); - } - function stringify2(value, replacer, options) { - let _replacer = null; - if (typeof replacer === "function" || Array.isArray(replacer)) { - _replacer = replacer; - } else if (options === void 0 && replacer) { - options = replacer; - } - if (typeof options === "string") - options = options.length; - if (typeof options === "number") { - const indent = Math.round(options); - options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent }; - } - if (value === void 0) { - const { keepUndefined } = options ?? replacer ?? {}; - if (!keepUndefined) - return void 0; - } - return new Document.Document(value, _replacer, options).toString(options); - } - exports.parse = parse2; - exports.parseAllDocuments = parseAllDocuments; - exports.parseDocument = parseDocument; - exports.stringify = stringify2; - } -}); - -// ../../node_modules/yaml/dist/index.js -var require_dist2 = __commonJS({ - "../../node_modules/yaml/dist/index.js"(exports) { - "use strict"; - var composer = require_composer(); - var Document = require_Document(); - var Schema = require_Schema(); - var errors = require_errors2(); - var Alias = require_Alias(); - var identity = require_identity(); - var Pair = require_Pair(); - var Scalar = require_Scalar(); - var YAMLMap = require_YAMLMap(); - var YAMLSeq = require_YAMLSeq(); - var cst = require_cst(); - var lexer = require_lexer(); - var lineCounter = require_line_counter(); - var parser = require_parser(); - var publicApi = require_public_api(); - var visit = require_visit(); - exports.Composer = composer.Composer; - exports.Document = Document.Document; - exports.Schema = Schema.Schema; - exports.YAMLError = errors.YAMLError; - exports.YAMLParseError = errors.YAMLParseError; - exports.YAMLWarning = errors.YAMLWarning; - exports.Alias = Alias.Alias; - exports.isAlias = identity.isAlias; - exports.isCollection = identity.isCollection; - exports.isDocument = identity.isDocument; - exports.isMap = identity.isMap; - exports.isNode = identity.isNode; - exports.isPair = identity.isPair; - exports.isScalar = identity.isScalar; - exports.isSeq = identity.isSeq; - exports.Pair = Pair.Pair; - exports.Scalar = Scalar.Scalar; - exports.YAMLMap = YAMLMap.YAMLMap; - exports.YAMLSeq = YAMLSeq.YAMLSeq; - exports.CST = cst; - exports.Lexer = lexer.Lexer; - exports.LineCounter = lineCounter.LineCounter; - exports.Parser = parser.Parser; - exports.parse = publicApi.parse; - exports.parseAllDocuments = publicApi.parseAllDocuments; - exports.parseDocument = publicApi.parseDocument; - exports.stringify = publicApi.stringify; - exports.visit = visit.visit; - exports.visitAsync = visit.visitAsync; - } -}); - -// ../core/dist/utils/types.js -function isPlainObject2(value) { - return value?.constructor === Object; -} -var init_types = __esm({ - "../core/dist/utils/types.js"() { - "use strict"; - } -}); - -// ../core/dist/yaml.js -async function readYaml({ path: path5 }) { - return import_yaml.default.parse(await readFile({ path: path5 })); -} -async function writeYaml({ path: path5, data, append = true }) { - if (append && await isReadableAndWritableFile({ path: path5 })) { - const existingData = await readYaml({ path: path5 }); - if (!isPlainObject2(existingData)) { - throw new Error("Can't currently write non-plain objects"); - } - data = (0, import_deepmerge2.default)(existingData, data); - } - return writeFile({ - path: path5, - contents: import_yaml.default.stringify(data) - }); -} -var import_deepmerge2, import_yaml; -var init_yaml = __esm({ - "../core/dist/yaml.js"() { - "use strict"; - import_deepmerge2 = __toESM(require_cjs(), 1); - import_yaml = __toESM(require_dist2(), 1); - init_file(); - init_types(); - } -}); - -// ../core/dist/yarnrc.js -var init_yarnrc = __esm({ - "../core/dist/yarnrc.js"() { - "use strict"; - init_yaml(); - } -}); - -// ../core/dist/yarn.js -async function runYarnCmd(args, { directory }) { - return exec("yarn", args, { - cwd: directory, - env: { - ...process.env, - // Reset NODE_OPTIONS='--loader=ts-node/esm' when running from tests - NODE_OPTIONS: void 0 - } - }); -} -async function addYarnPlugin({ directory, name }) { - await runYarnCmd(["plugin", "import", name], { directory }); -} -async function removeYarnPlugin({ directory, name }) { - await runYarnCmd(["plugin", "remove", name], { directory }); -} -async function installDependency({ directory, identifier, dev = false }) { - identifier = Array.isArray(identifier) ? identifier : [identifier]; - const installArgs = [ - "add", - "--exact", - ...identifier.map((id) => dev ? `--dev ${id}` : id) - ]; - await runYarnCmd(installArgs, { directory }); -} -function enqueueInstallDependency({ directory, identifier, dev = false }) { - enqueue({ - queue: dev ? queues.installDev : queues.install, - directory, - identifier - }); -} -function enqueueRemoveDependency({ directory, identifier }) { - enqueue({ - queue: queues.remove, - directory, - identifier - }); -} -function enqueue({ queue, directory, identifier }) { - if (!queue.has(directory)) { - queue.set(directory, /* @__PURE__ */ new Set()); - } - identifier = Array.isArray(identifier) ? identifier : [identifier]; - for (const id of identifier) { - queue.get(directory).add(id); - } -} -async function runDependencyQueues({ directory }) { - const dependencies = queues.install.get(directory) || /* @__PURE__ */ new Set(); - const devDependencies = queues.installDev.get(directory) || /* @__PURE__ */ new Set(); - const removeDependencies = queues.remove.get(directory) || /* @__PURE__ */ new Set(); - if (!dependencies.size && !devDependencies.size && !removeDependencies.size) { - await runYarnCmd([], { directory }); - return; - } - if (dependencies.size) { - const installArgs = ["add", "--exact", ...Array.from(dependencies)]; - await runYarnCmd(installArgs, { directory }); - queues.install.set(directory, /* @__PURE__ */ new Set()); - } - if (devDependencies.size) { - const installArgs = [ - "add", - "--exact", - "--dev", - ...Array.from(devDependencies) - ]; - await runYarnCmd(installArgs, { directory }); - queues.installDev.set(directory, /* @__PURE__ */ new Set()); - } - if (removeDependencies.size) { - const removeArgs = ["remove", ...Array.from(removeDependencies)]; - await runYarnCmd(removeArgs, { directory }); - queues.remove.set(directory, /* @__PURE__ */ new Set()); - } - await sortPackage({ directory }); -} -var queues; -var init_yarn = __esm({ - "../core/dist/yarn.js"() { - "use strict"; - init_directory(); - init_gitignore(); - init_package(); - init_exec(); - init_yarnrc(); - queues = { - install: /* @__PURE__ */ new Map(), - installDev: /* @__PURE__ */ new Map(), - remove: /* @__PURE__ */ new Map() - }; - } -}); - -// ../core/dist/repo.js -import { basename as basename2, join as join2 } from "path"; -async function isRepo({ directory }) { - return await isDirectory({ directory: join2(directory, ".git") }) && await hasPackage({ directory }); -} -var import_hosted_git_info; -var init_repo = __esm({ - "../core/dist/repo.js"() { - "use strict"; - import_hosted_git_info = __toESM(require_lib2(), 1); - init_directory(); - init_license(); - init_package(); - init_utils(); - init_workspace(); - init_yarn(); - } -}); - -// ../core/dist/monorepo.js -async function isMonorepo({ directory }) { - if (!await isRepo({ directory })) { - return false; - } - const pkg = await readPackage({ directory }); - return checkMonorepo({ pkg }); -} -function checkMonorepo(options) { - const { pkg } = options; - if (typeof pkg.moker === "undefined") { - return false; - } - return "scoped" in pkg.moker; -} -var init_monorepo = __esm({ - "../core/dist/monorepo.js"() { - "use strict"; - init_package(); - init_repo(); - init_yarn(); - } -}); - -// ../plugins/dist/dependabot/dependabot.js -import { join as join3 } from "path"; -async function install({ directory }) { - await writeYaml({ - path: join3(directory, FILENAME3), - data: { - version: 2, - updates: [ - { - "package-ecosystem": "npm", - directory: "/", - schedule: { - interval: "weekly" - }, - "commit-message": { - prefix: "fix", - "prefix-development": "chore", - include: "scope" - } - } - ] - } - }); -} -async function remove({ directory }) { - await removeFile({ path: join3(directory, FILENAME3) }); -} -async function load({ directory }) { - const path5 = join3(directory, FILENAME3); - if (await hasPlugin({ directory, name: "github-actions" })) { - const existingData = await readYaml({ path: path5 }); - if (!existingData.updates?.find((update) => update["package-ecosystem"] === "github-actions")) { - await writeYaml({ - path: join3(directory, FILENAME3), - data: { - updates: [ - { - "package-ecosystem": "github-actions", - directory: "/", - schedule: { - interval: "weekly" - } - } - ] - } - }); - } - } -} -var FILENAME3, dependabot; -var init_dependabot = __esm({ - "../plugins/dist/dependabot/dependabot.js"() { - "use strict"; - init_dist2(); - FILENAME3 = ".github/dependabot.yml"; - dependabot = { - type: PluginType.Repo, - install, - remove, - load - }; - } -}); - -// ../plugins/dist/devcontainer/devcontainerJson.js -import { join as join4 } from "path"; -async function readDevcontainerJson({ directory }) { - return readJson({ - path: join4(directory, FILENAME4) - }); -} -async function writeDevcontainerJson({ directory, data }) { - await writeJson({ path: join4(directory, FILENAME4), data }); -} -async function removeDevcontainerJson({ directory }) { - await removeFile({ path: join4(directory, FILENAME4) }); -} -var FILENAME4; -var init_devcontainerJson = __esm({ - "../plugins/dist/devcontainer/devcontainerJson.js"() { - "use strict"; - init_dist2(); - FILENAME4 = ".devcontainer/devcontainer.json"; - } -}); - -// ../plugins/dist/devcontainer/devcontainer.js -async function install2({ directory }) { - await writeDevcontainerJson({ - directory, - data: { - name: "Node.js & TypeScript", - image: "mcr.microsoft.com/devcontainers/typescript-node:16-bullseye", - features: {}, - forwardPorts: [], - postCreateCommand: "yarn install", - customizations: {} - } - }); -} -async function remove2({ directory }) { - await removeDevcontainerJson({ directory }); -} -async function load2({ directory }) { - if (await hasPlugin({ directory, name: "prettier" })) { - const id = "esbenp.prettier-vscode"; - const existingData = await readDevcontainerJson({ directory }); - if (!existingData.customizations?.vscode?.extensions?.includes(id)) { - await writeDevcontainerJson({ - directory, - data: { - customizations: { - vscode: { - extensions: [id] - } - } - } - }); - } - } -} -var devcontainer; -var init_devcontainer = __esm({ - "../plugins/dist/devcontainer/devcontainer.js"() { - "use strict"; - init_dist2(); - init_devcontainerJson(); - devcontainer = { - type: PluginType.Repo, - install: install2, - remove: remove2, - load: load2 - }; - } -}); - -// ../plugins/dist/husky/husky.js -import os6 from "os"; -import { join as join5 } from "path"; -async function install3({ directory }) { - await installDependency({ directory, identifier: "husky", dev: true }); - await exec("yarn", ["husky", "install"], { cwd: directory }); - if (await isMonorepo({ directory })) { - await writePackage({ - directory, - data: { - scripts: { - postinstall: "husky install" - } - } - }); - } -} -async function remove3({ directory }) { - enqueueRemoveDependency({ directory, identifier: "husky" }); - await updatePackage({ - directory, - merge: (existingData) => { - if (existingData.scripts?.["postinstall"] !== "husky install") { - warning("Can't automatically remove 'husky install' from package.json, please manually review the 'postinstall' script."); - return existingData; - } - delete existingData.scripts?.["postinstall"]; - return existingData; - } - }); - await removeDirectory({ directory: join5(directory, ".husky") }); - await exec("git", ["config", "--unset", "core.hooksPath"], { - cwd: directory - }); -} -async function load3() { -} -function getPreCommitHookPath({ directory }) { - return join5(directory, PRE_COMMIT_HOOK_FILE); -} -async function getPreCommitHookCommands({ directory }) { - if (!await isReadableAndWritableFile({ - path: getPreCommitHookPath({ directory }) - })) { - return []; - } - return (await readFile({ - path: getPreCommitHookPath({ directory }) - })).trim().split(os6.EOL).filter((line) => line !== ""); -} -async function setPreCommitHookCommands({ directory, commands }) { - return writeFile({ - path: getPreCommitHookPath({ directory }), - contents: commands.join(os6.EOL) - }); -} -async function hasPreCommitHookCommand({ directory, command }) { - return (await getPreCommitHookCommands({ directory })).includes(command); -} -async function addPreCommitHookCommand({ directory, command }) { - if (await hasPreCommitHookCommand({ directory, command })) { - return; - } - await exec("yarn", ["husky", "add", PRE_COMMIT_HOOK_FILE, `"${command}"`], { - cwd: directory - }); -} -async function removePreCommitHookCommand({ directory, command }) { - if (!await hasPreCommitHookCommand({ directory, command })) { - return; - } - const newCommands = (await getPreCommitHookCommands({ directory })).filter((line) => line !== command); - if (newCommands.length === 2) { - await removeFile({ path: getPreCommitHookPath({ directory }) }); - return; - } - await setPreCommitHookCommands({ directory, commands: newCommands }); -} -var PRE_COMMIT_HOOK_FILE, husky; -var init_husky = __esm({ - "../plugins/dist/husky/husky.js"() { - "use strict"; - init_dist2(); - PRE_COMMIT_HOOK_FILE = ".husky/pre-commit"; - husky = { - type: PluginType.Repo, - install: install3, - remove: remove3, - load: load3 - }; - } -}); - -// ../plugins/dist/doctoc/doctoc.js -async function install4({ directory }) { - enqueueInstallDependency({ directory, identifier: "doctoc", dev: true }); - await writePackage({ - directory, - data: { - scripts: { - doctoc: "doctoc README.md" - } - } - }); -} -async function remove4({ directory }) { - enqueueRemoveDependency({ directory, identifier: "doctoc" }); - await updatePackage({ - directory, - merge: (existingData) => { - delete existingData?.["scripts"]?.["doctoc"]; - return existingData; - } - }); - removePreCommitHookCommand({ directory, command: PRE_COMMIT_HOOK_COMMAND }); - removePreCommitHookCommand({ - directory, - command: PRE_COMMIT_HOOK_COMMAND_FORMAT - }); -} -async function load4({ directory }) { - if (await hasPlugin({ directory, name: "husky" })) { - await addPreCommitHookCommand({ - directory, - command: PRE_COMMIT_HOOK_COMMAND - }); - if (await hasPlugin({ directory, name: "prettier" })) { - await addPreCommitHookCommand({ - directory, - command: PRE_COMMIT_HOOK_COMMAND_FORMAT - }); - } - } -} -var PRE_COMMIT_HOOK_COMMAND, PRE_COMMIT_HOOK_COMMAND_FORMAT, doctoc; -var init_doctoc = __esm({ - "../plugins/dist/doctoc/doctoc.js"() { - "use strict"; - init_dist2(); - init_husky(); - PRE_COMMIT_HOOK_COMMAND = "yarn doctoc && git add README.md"; - PRE_COMMIT_HOOK_COMMAND_FORMAT = "yarn prettier --write README.md && git add README.md"; - doctoc = { - type: PluginType.Repo, - install: install4, - remove: remove4, - load: load4 - }; - } -}); - -// ../plugins/dist/esbuild/esbuild.js -async function install5({ directory }) { - enqueueInstallDependency({ - directory, - identifier: "esbuild", - dev: true - }); - await writeGitignore({ - directory, - lines: ["", "# artifacts", "/dist"] - }); -} -async function remove5({ directory }) { - enqueueRemoveDependency({ - directory, - identifier: "esbuild" - }); - await updatePackage({ - directory, - merge: (existingData) => { - delete existingData?.["scripts"]?.["build:typecheck"]; - delete existingData?.["scripts"]?.["build:bundle"]; - return existingData; - } - }); - warning("Please review your package.json manually"); -} -async function load5({ directory }) { - const monorepoDirectory = await getMonorepoDirectory({ directory }); - if (await hasPlugin({ directory, name: "typescript" })) { - await writePackage({ - directory, - data: { - scripts: { - clean: "rm -rf dist", - build: "yarn clean && yarn build:typecheck && yarn build:bundle", - "build:typecheck": "tsc --noEmit", - "build:bundle": "esbuild --bundle --platform=node --format=esm --target=es2022 --outdir=dist src/index.ts" - } - } - }); - } else { - await writePackage({ - directory, - data: { - type: "module", - main: "dist/index.js", - files: ["dist"], - scripts: { - clean: "rm -rf dist", - build: "yarn clean && esbuild --bundle --platform=node --format=esm --target=es2022 --outdir=dist src/index.ts", - prepublish: "yarn build" - } - } - }); - } - if (monorepoDirectory) { - await writePackage({ - directory: monorepoDirectory, - data: { - scripts: { - build: "yarn workspaces foreach --topological --verbose run build" - } - } - }); - } -} -var esbuild; -var init_esbuild = __esm({ - "../plugins/dist/esbuild/esbuild.js"() { - "use strict"; - init_dist2(); - esbuild = { - type: PluginType.RepoOrWorkspace, - install: install5, - remove: remove5, - load: load5 - }; - } -}); - -// ../plugins/dist/githubActions/githubActions.js -import { join as join6 } from "path"; -import { URL as URL3 } from "url"; -async function install6({ directory }) { - const workflowDirectory = join6(directory, WORKFLOWS_DIRECTORY); - await copyFile({ - from: new URL3("../../static/ci.yml", import.meta.url).pathname, - to: join6(workflowDirectory, "ci.yml") - }); - await copyFile({ - from: new URL3("../../static/update-node-versions.yml", import.meta.url).pathname, - to: join6(workflowDirectory, "update-node-versions.yml") - }); -} -async function remove6({ directory }) { - const workflowDirectory = join6(directory, WORKFLOWS_DIRECTORY); - await removeDirectory({ directory: workflowDirectory }); -} -async function load6({ directory }) { - const workflowDirectory = join6(directory, WORKFLOWS_DIRECTORY); - if (await hasPlugin({ directory, name: "semantic-release" })) { - await copyFile({ - from: new URL3("../../static/release.yml", import.meta.url).pathname, - to: join6(workflowDirectory, "release.yml") - }); - } - if (await hasPlugin({ directory, name: "prettier" })) { - await copyFile({ - from: new URL3("../../static/format-check.yml", import.meta.url).pathname, - to: join6(workflowDirectory, "format-check.yml") - }); - } - if (await hasPlugin({ directory, name: "dependabot" })) { - await copyFile({ - from: new URL3("../../static/dependabot-automerge.yml", import.meta.url).pathname, - to: join6(workflowDirectory, "dependabot-automerge.yml") - }); - } -} -var WORKFLOWS_DIRECTORY, githubActions; -var init_githubActions = __esm({ - "../plugins/dist/githubActions/githubActions.js"() { - "use strict"; - init_dist2(); - WORKFLOWS_DIRECTORY = ".github/workflows"; - githubActions = { - type: PluginType.Repo, - install: install6, - remove: remove6, - load: load6 - }; - } -}); - -// ../plugins/dist/jest/jest.js -import { join as join7 } from "path"; -async function install7({ directory }) { - const monorepoDirectory = await getMonorepoDirectory({ directory }); - if (!hasPlugin({ directory, name: "typescript" })) { - } else { - enqueueInstallDependency({ - directory, - identifier: ["jest", "ts-jest", "@types/jest"], - dev: true - }); - await writeFile({ - path: join7(directory, JEST_CONFIG_FILENAME), - contents: TS_JEST_CONFIG - }); - } - await writePackage({ - directory, - data: { - scripts: { - test: "jest", - "test:watch": "jest --watch" - } - } - }); - if (monorepoDirectory) { - await writePackage({ - directory: monorepoDirectory, - data: { - scripts: { - test: "yarn workspaces foreach --topological --verbose run test", - "test:watch": "yarn workspaces foreach --parallel --interlaced run test:watch" - } - } - }); - } -} -async function remove7({ directory }) { - enqueueRemoveDependency({ directory, identifier: ["jest", "ts-jest"] }); - try { - await removeFile({ path: join7(directory, JEST_CONFIG_FILENAME) }); - } catch { - } - warning("Please review package.json manually"); -} -async function load7() { -} -var JEST_CONFIG_FILENAME, TS_JEST_CONFIG, jest; -var init_jest = __esm({ - "../plugins/dist/jest/jest.js"() { - "use strict"; - init_dist2(); - JEST_CONFIG_FILENAME = "jest.config.js"; - TS_JEST_CONFIG = ` -/** @type {import("ts-jest").JestConfigWithTsJest} */ - -export default { - preset: "ts-jest/presets/default-esm", - moduleNameMapper: { - "^(\\\\.{1,2}/.*)\\\\.js$": "$1", - }, -}; -`; - jest = { - type: PluginType.RepoOrWorkspace, - install: install7, - remove: remove7, - load: load7 - }; - } -}); - -// ../plugins/dist/lintStaged/lintStaged.js -async function install8({ directory }) { - enqueueInstallDependency({ - directory, - identifier: "lint-staged", - dev: true - }); -} -async function remove8({ directory }) { - enqueueRemoveDependency({ directory, identifier: "lint-staged" }); - await updatePackage({ - directory, - merge: (existingData) => { - delete existingData?.["lint-staged"]; - return existingData; - } - }); - removePreCommitHookCommand({ directory, command: PRE_COMMIT_HOOK_COMMAND2 }); -} -async function load8({ directory }) { - if (await hasPlugin({ directory, name: "prettier" })) { - await writePackage({ - directory, - data: { - "lint-staged": { - "*": "prettier --write --ignore-unknown" - } - } - }); - } - if (await hasPlugin({ directory, name: "husky" })) { - await addPreCommitHookCommand({ - directory, - command: PRE_COMMIT_HOOK_COMMAND2 - }); - } -} -var PRE_COMMIT_HOOK_COMMAND2, lintStaged; -var init_lintStaged = __esm({ - "../plugins/dist/lintStaged/lintStaged.js"() { - "use strict"; - init_dist2(); - init_husky(); - PRE_COMMIT_HOOK_COMMAND2 = "yarn lint-staged"; - lintStaged = { - type: PluginType.Repo, - install: install8, - remove: remove8, - load: load8 - }; - } -}); - -// ../plugins/dist/prettier/prettierrc.js -import path3 from "path"; -async function writePrettierrc({ directory, data }) { - await writeYaml({ path: path3.join(directory, FILENAME5), data }); -} -async function removePrettierrc({ directory }) { - await removeFile({ path: path3.join(directory, FILENAME5) }); -} -var FILENAME5; -var init_prettierrc = __esm({ - "../plugins/dist/prettier/prettierrc.js"() { - "use strict"; - init_dist2(); - FILENAME5 = ".prettierrc.yml"; - } -}); - -// ../plugins/dist/prettier/prettier.js -import os7 from "os"; -import { join as join8 } from "path"; -async function install9({ directory }) { - enqueueInstallDependency({ - directory, - identifier: "prettier", - dev: true - }); - await writePrettierrc({ - directory, - data: { - proseWrap: "always" - } - }); - await writePackage({ - directory, - data: { - scripts: { - format: "prettier --write --ignore-unknown .", - "format:check": "prettier --check --ignore-unknown ." - } - } - }); - await writeFile({ - path: join8(directory, ".prettierignore"), - contents: PRETTIER_IGNORE.join(os7.EOL) - }); -} -async function remove9({ directory }) { - enqueueRemoveDependency({ directory, identifier: "prettier" }); - await updatePackage({ - directory, - merge: (existingData) => { - delete existingData?.["scripts"]?.["format"]; - return existingData; - } - }); - await removePrettierrc({ - directory - }); - await removeFile({ - path: join8(directory, ".prettierignore") - }); -} -async function load9() { -} -var PRETTIER_IGNORE, prettier; -var init_prettier = __esm({ - "../plugins/dist/prettier/prettier.js"() { - "use strict"; - init_dist2(); - init_prettierrc(); - PRETTIER_IGNORE = [ - "# yarn", - ".yarn", - "", - "# artifacts", - "dist/", - "types/", - "" - ]; - prettier = { - type: PluginType.Repo, - install: install9, - remove: remove9, - load: load9 - }; - } -}); - -// ../plugins/dist/semanticRelease/semanticRelease.js -import { join as join9 } from "path"; -async function install10({ directory }) { - enqueueInstallDependency({ - directory, - identifier: [ - "@semantic-release/changelog", - "@semantic-release/git", - "semantic-release", - "semantic-release-yarn" - ], - dev: true - }); - await writeJson({ - path: join9(directory, CONFIG_FILENAME), - data: CONFIG - }); - await writePackage({ - directory, - data: { - scripts: { - release: "semantic-release" - } - } - }); -} -async function remove10({ directory }) { - enqueueRemoveDependency({ - directory, - identifier: [ - "@semantic-release/changelog", - "@semantic-release/git", - "semantic-release", - "semantic-release-yarn" - ] - }); - await removeFile({ - path: join9(directory, CONFIG_FILENAME) - }); -} -async function load10() { -} -var CONFIG_FILENAME, CONFIG, semanticRelease; -var init_semanticRelease = __esm({ - "../plugins/dist/semanticRelease/semanticRelease.js"() { - "use strict"; - init_dist2(); - CONFIG_FILENAME = ".releaserc.json"; - CONFIG = { - branches: ["main"], - plugins: [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/changelog", - "semantic-release-yarn", - "@semantic-release/github", - [ - "@semantic-release/git", - { - assets: ["CHANGELOG.md", "package.json", "packages/*/package.json"], - message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}\n\n[skip ci]" - } - ] - ] - }; - semanticRelease = { - type: PluginType.RepoOrWorkspace, - install: install10, - remove: remove10, - load: load10 - }; - } -}); - -// ../plugins/dist/test/test.js -async function install11({ directory }) { - const monorepoDirectory = await getMonorepoDirectory({ directory }); - enqueueInstallDependency({ - directory, - identifier: ["test", "tap"], - dev: true - }); - if (!hasPlugin({ directory, name: "typescript" })) { - await writePackage({ - directory, - data: { - scripts: { - test: "node--test | tap --no-coverage" - } - } - }); - } else { - enqueueInstallDependency({ - directory, - identifier: "ts-node", - dev: true - }); - await writePackage({ - directory, - data: { - scripts: { - test: "NODE_OPTIONS='--loader=ts-node/esm --no-warnings' node--test test/*.test.ts | NODE_OPTIONS='--loader=ts-node/esm --no-warnings' tap --no-coverage" - } - } - }); - } - if (monorepoDirectory) { - await writePackage({ - directory: monorepoDirectory, - data: { - scripts: { - test: "yarn workspaces foreach --topological --verbose run test" - } - } - }); - } -} -async function remove11({ directory }) { - enqueueRemoveDependency({ directory, identifier: ["test", "ts-node"] }); - warning("Please review package.json manually"); -} -async function load11() { -} -var test; -var init_test = __esm({ - "../plugins/dist/test/test.js"() { - "use strict"; - init_dist2(); - test = { - type: PluginType.RepoOrWorkspace, - install: install11, - remove: remove11, - load: load11 - }; - } -}); - -// ../plugins/dist/todos/todos.js -async function install12({ directory }) { - enqueueInstallDependency({ directory, identifier: "leasot", dev: true }); - await writePackage({ - directory, - data: { - scripts: { - todos: 'leasot --exit-nicely --reporter markdown --ignore "**/node_modules" "**/*.ts" > TODO.md' - } - } - }); -} -async function remove12({ directory }) { - enqueueRemoveDependency({ directory, identifier: "leasot" }); - await updatePackage({ - directory, - merge: (existingData) => { - delete existingData?.["scripts"]?.["todos"]; - return existingData; - } - }); - removePreCommitHookCommand({ directory, command: PRE_COMMIT_HOOK_COMMAND3 }); - removePreCommitHookCommand({ - directory, - command: PRE_COMMIT_HOOK_COMMAND_FORMAT2 - }); -} -async function load12({ directory }) { - if (await hasPlugin({ directory, name: "husky" })) { - await addPreCommitHookCommand({ - directory, - command: PRE_COMMIT_HOOK_COMMAND3 - }); - if (await hasPlugin({ directory, name: "prettier" })) { - await addPreCommitHookCommand({ - directory, - command: PRE_COMMIT_HOOK_COMMAND_FORMAT2 - }); - } - } -} -var PRE_COMMIT_HOOK_COMMAND3, PRE_COMMIT_HOOK_COMMAND_FORMAT2, todos; -var init_todos = __esm({ - "../plugins/dist/todos/todos.js"() { - "use strict"; - init_dist2(); - init_husky(); - PRE_COMMIT_HOOK_COMMAND3 = "yarn todos && git add TODO.md"; - PRE_COMMIT_HOOK_COMMAND_FORMAT2 = "yarn prettier --write TODO.md && git add TODO.md"; - todos = { - type: PluginType.Repo, - install: install12, - remove: remove12, - load: load12 - }; - } -}); - -// ../plugins/dist/typescript/tsconfig.js -import path4 from "path"; -async function writeTsconfig({ directory, data }) { - await writeJson({ path: path4.join(directory, FILENAME6), data }); -} -async function removeTsconfig({ directory }) { - await removeFile({ path: path4.join(directory, FILENAME6) }); -} -var FILENAME6; -var init_tsconfig = __esm({ - "../plugins/dist/typescript/tsconfig.js"() { - "use strict"; - init_dist2(); - FILENAME6 = "tsconfig.json"; - } -}); - -// ../plugins/dist/typescript/typescript.js -async function install13({ directory }) { - const monorepoDirectory = await getMonorepoDirectory({ directory }); - enqueueInstallDependency({ - directory, - identifier: ["typescript", "@types/node"], - dev: true - }); - await addYarnPlugin({ directory, name: "typescript" }); - await writeGitignore({ - directory, - lines: ["", "# artifacts", "/dist", "/types"] - }); - await writePackage({ - directory, - data: { - type: "module", - main: "dist/index.js", - types: "types/index.d.ts", - files: ["dist", "types"], - scripts: { - clean: "rm -rf dist && rm -rf types", - build: "yarn clean && tsc", - "build:watch": "tsc --watch", - prepublish: "yarn build" - } - } - }); - if (!monorepoDirectory) { - await writeTsconfig({ - directory, - data: (0, import_deepmerge3.default)(TSCONFIG_BASE, TSCONFIG_WORKSPACE) - }); - } else { - await writeTsconfig({ - directory, - data: { - extends: "../../tsconfig.json", - ...TSCONFIG_WORKSPACE - } - }); - await writeTsconfig({ - directory: monorepoDirectory, - data: TSCONFIG_BASE - }); - await writePackage({ - directory: monorepoDirectory, - data: { - scripts: { - build: "yarn workspaces foreach --topological --verbose run build", - "build:watch": "yarn workspaces foreach --parallel --interlaced run build:watch" - } - } - }); - } -} -async function remove13({ directory }) { - const monorepoDirectory = await getMonorepoDirectory({ directory }); - enqueueRemoveDependency({ - directory, - identifier: ["typescript", "@types/node"] - }); - await removeYarnPlugin({ directory, name: "typescript" }); - await removeTsconfig({ directory }); - if (monorepoDirectory) { - await removeTsconfig({ directory: monorepoDirectory }); - } - warning("Please review your package.json manually"); -} -async function load13() { -} -var import_deepmerge3, TSCONFIG_WORKSPACE, TSCONFIG_BASE, typescript; -var init_typescript = __esm({ - "../plugins/dist/typescript/typescript.js"() { - "use strict"; - init_dist2(); - import_deepmerge3 = __toESM(require_cjs(), 1); - init_tsconfig(); - TSCONFIG_WORKSPACE = { - compilerOptions: { - rootDir: "src", - outDir: "dist", - declarationDir: "types" - }, - include: ["src/**/*"] - }; - TSCONFIG_BASE = { - $schema: "https://json.schemastore.org/tsconfig", - display: "Node 20 + ESM + Strictest", - compilerOptions: { - lib: ["es2023"], - module: "es2022", - target: "es2022", - strict: true, - esModuleInterop: true, - skipLibCheck: true, - forceConsistentCasingInFileNames: true, - moduleResolution: "node", - verbatimModuleSyntax: true, - allowUnusedLabels: false, - allowUnreachableCode: false, - exactOptionalPropertyTypes: true, - noFallthroughCasesInSwitch: true, - noImplicitOverride: true, - noImplicitReturns: true, - noPropertyAccessFromIndexSignature: true, - noUncheckedIndexedAccess: true, - noUnusedLocals: true, - noUnusedParameters: true, - // Custom - declaration: true, - declarationMap: true - } - }; - typescript = { - type: PluginType.RepoOrWorkspace, - install: install13, - remove: remove13, - load: load13 - }; - } -}); - -// ../plugins/dist/xv/xv.js -async function install14({ directory }) { - const monorepoDirectory = await getMonorepoDirectory({ directory }); - if (!hasPlugin({ directory, name: "typescript" })) { - } else { - enqueueInstallDependency({ - directory, - identifier: ["xv", "ts-node"], - dev: true - }); - } - await writePackage({ - directory, - data: { - scripts: { - test: "xv --loader=ts-node/esm test" - } - } - }); - if (monorepoDirectory) { - await writePackage({ - directory: monorepoDirectory, - data: { - scripts: { - test: "yarn workspaces foreach --topological --verbose run test" - } - } - }); - } -} -async function remove14({ directory }) { - enqueueRemoveDependency({ directory, identifier: ["xv", "ts-node"] }); - warning("Please review package.json manually"); -} -async function load14() { -} -var xv; -var init_xv = __esm({ - "../plugins/dist/xv/xv.js"() { - "use strict"; - init_dist2(); - xv = { - type: PluginType.RepoOrWorkspace, - install: install14, - remove: remove14, - load: load14 - }; - } -}); - -// ../plugins/dist/index.js -var dist_exports = {}; -__export(dist_exports, { - addPreCommitHookCommand: () => addPreCommitHookCommand, - dependabot: () => dependabot, - devcontainer: () => devcontainer, - doctoc: () => doctoc, - esbuild: () => esbuild, - githubActions: () => githubActions, - husky: () => husky, - jest: () => jest, - lintStaged: () => lintStaged, - prettier: () => prettier, - removePreCommitHookCommand: () => removePreCommitHookCommand, - semanticRelease: () => semanticRelease, - test: () => test, - todos: () => todos, - typescript: () => typescript, - xv: () => xv -}); -var init_dist = __esm({ - "../plugins/dist/index.js"() { - init_dependabot(); - init_devcontainer(); - init_doctoc(); - init_esbuild(); - init_githubActions(); - init_husky(); - init_jest(); - init_lintStaged(); - init_prettier(); - init_semanticRelease(); - init_test(); - init_todos(); - init_typescript(); - init_xv(); - } -}); - -// ../core/dist/plugin.js -function isPlugin(plugin) { - return !!(plugin && typeof plugin === "object" && // @ts-ignore - typeof plugin?.type === "string" && // @ts-ignore - typeof plugin?.install === "function" && // @ts-ignore - typeof plugin?.remove === "function" && // @ts-ignore - typeof plugin?.load === "function"); -} -async function importPlugin({ directory, name }) { - let plugin; - if (CORE_PLUGINS.includes(name)) { - const plugins = await Promise.resolve().then(() => (init_dist(), dist_exports)); - plugin = plugins[toCamelCase(name)]; - } else { - plugin = await import(name); - } - if (!isPlugin(plugin)) { - throw new Error(`Plugin ${name} does not exist or is not valid`); - } - await validateType({ directory, name, type: plugin.type }); - return plugin; -} -async function validateType({ directory, name, type }) { - const repo = await isRepo({ directory }); - const monorepo = await isMonorepo({ directory }); - const workspace = await isWorkspace({ directory }); - switch (type) { - case PluginType.Repo: - if (!repo) { - throw new Error(`Plugin or template ${name} can only be used at repo level`); - } - break; - case PluginType.RepoOrWorkspace: - if (!repo && !workspace) { - throw new Error(`Plugin or template ${name} can only be used at repo or workspace level`); - } - break; - case PluginType.Monorepo: - if (!monorepo) { - throw new Error(`Plugin or template ${name} can only be used at monorepo level`); - } - break; - case PluginType.Workspace: - if (!workspace) { - throw new Error(`Plugin or template ${name} can only be used at workspace level`); - } - break; - } -} -async function loadPlugin({ directory, name }) { - const plugin = await importPlugin({ directory, name }); - await plugin.load({ directory }); -} -async function loadAllPlugins({ directory }) { - const plugins = await getPlugins({ directory }); - for (const name of plugins) { - await loadPlugin({ directory, name }); - } -} -async function getPlugins({ directory }) { - const { moker } = await readPackage({ directory }); - return moker?.plugins ?? []; -} -async function hasPlugin({ directory, name }) { - const plugins = await getPlugins({ directory }); - return !!plugins.includes(name); -} -var PluginType, CORE_PLUGINS; -var init_plugin = __esm({ - "../core/dist/plugin.js"() { - "use strict"; - init_monorepo(); - init_package(); - init_repo(); - init_string(); - init_workspace(); - (function(PluginType2) { - PluginType2["Repo"] = "repo"; - PluginType2["RepoOrWorkspace"] = "repoOrWorkspace"; - PluginType2["Monorepo"] = "monorepo"; - PluginType2["Workspace"] = "workspace"; - })(PluginType || (PluginType = {})); - CORE_PLUGINS = [ - "husky", - "prettier", - "lint-staged", - "devcontainer", - "github-actions", - "typescript", - "jest", - "semantic-release", - "dependabot", - "todos", - "doctoc", - "esbuild", - "xv", - "test" - ]; - } -}); - -// ../core/dist/utils/tasks.js -async function formatTask({ directory }) { - if (await hasPlugin({ directory, name: "prettier" })) { - await task(`Format code`, () => exec("yarn", ["format"], { cwd: directory })); - } -} -async function loadPluginsTask({ directory }) { - await task(`Load plugins`, () => loadAllPlugins({ directory })); -} -async function updateDependenciesTask({ directory }) { - await task(`Update dependencies`, () => runDependencyQueues({ directory })); -} -var init_tasks = __esm({ - "../core/dist/utils/tasks.js"() { - "use strict"; - init_io(); - init_plugin(); - init_yarn(); - init_exec(); - } -}); - -// ../core/dist/utils/index.js -var init_utils = __esm({ - "../core/dist/utils/index.js"() { - "use strict"; - init_assertions(); - init_author(); - init_exec(); - init_merge(); - init_string(); - init_tasks(); - init_types(); - } -}); - -// ../core/dist/json.js -async function readJson({ path: path5 }) { - return JSON.parse(await readFile({ path: path5 })); -} -async function writeJson({ path: path5, data, append = true }) { - if (append && await isReadableAndWritableFile({ path: path5 })) { - const existingData = await readJson({ path: path5 }); - if (!isPlainObject2(existingData)) { - throw new Error("Can't currently write non-plain objects"); - } - data = deepmerge(existingData, data); - } - return writeFile({ - path: path5, - contents: formatJson(data) - }); -} -async function updateJson({ path: path5, merge }) { - if (!await isReadableAndWritableFile({ path: path5 })) { - throw new Error(`File ${path5} is not accessible`); - } - const existingData = await readJson({ path: path5 }); - const data = merge(existingData); - return writeFile({ - path: path5, - contents: formatJson(data) - }); -} -function formatJson(data) { - return JSON.stringify(data, void 0, 2); -} -var init_json = __esm({ - "../core/dist/json.js"() { - "use strict"; - init_file(); - init_utils(); - } -}); - -// ../core/dist/template.js -var init_template = __esm({ - "../core/dist/template.js"() { - "use strict"; - init_plugin(); - init_string(); - } -}); - -// ../core/dist/index.js -var init_dist2 = __esm({ - "../core/dist/index.js"() { - init_directory(); - init_file(); - init_gitignore(); - init_io(); - init_json(); - init_monorepo(); - init_package(); - init_plugin(); - init_repo(); - init_template(); - init_utils(); - init_workspace(); - init_yaml(); - init_yarn(); - init_yarnrc(); - } -}); - -// src/index.ts -var import_core18 = __toESM(require_core(), 1); -init_dist2(); -async function run() { - const directory = process.cwd(); - await loadPluginsTask({ directory }); - await updateDependenciesTask({ directory }); - await formatTask({ directory }); - (0, import_core18.info)("Action complete"); - return { - result: "ok" - }; -} -run().then( - (outputs) => Object.entries(outputs).forEach(([key, value]) => { - (0, import_core18.setOutput)(key, value); - }) -).catch(import_core18.setFailed); -/*! Bundled license information: - -safe-buffer/index.js: - (*! safe-buffer. MIT License. Feross Aboukhadijeh *) -*/ diff --git a/packages/action/package.json b/packages/action/package.json index 53ce9494..1b646be6 100644 --- a/packages/action/package.json +++ b/packages/action/package.json @@ -14,7 +14,7 @@ ], "scripts": { "build": "yarn clean && yarn build:typecheck && yarn build:bundle", - "build:bundle": "esbuild --bundle --platform=node --format=esm --target=es2022 --outdir=dist src/index.ts", + "build:bundle": "esbuild --bundle --platform=node --format=cjs --target=es2022 --outfile=dist/index.cjs src/index.ts", "build:typecheck": "tsc --noEmit", "build:watch": "tsc --watch", "clean": "rm -rf dist", diff --git a/packages/core/src/io.ts b/packages/core/src/io.ts index 600da864..849cf586 100644 --- a/packages/core/src/io.ts +++ b/packages/core/src/io.ts @@ -1,4 +1,6 @@ import chalk from "chalk"; +import { join } from "node:path"; +import { URL } from "node:url"; import ora from "ora"; type Log = @@ -124,3 +126,15 @@ export function containsMessage(search: string) { export function hasEncounteredErrors() { return encounteredErrors; } + +export function toPathName( + filename: string, + root: { + __dirname?: string; + importUrl?: string; + } +) { + return typeof root.__dirname !== "undefined" + ? join(root.__dirname, filename) + : new URL(filename, root.importUrl).pathname; +} diff --git a/packages/plugins/src/githubActions/githubActions.ts b/packages/plugins/src/githubActions/githubActions.ts index dcdbc317..d45e92d5 100644 --- a/packages/plugins/src/githubActions/githubActions.ts +++ b/packages/plugins/src/githubActions/githubActions.ts @@ -3,10 +3,10 @@ import { copyFile, hasPlugin, removeDirectory, + toPathName, type PluginArgs, } from "@mokr/core"; import { join } from "node:path"; -import { URL } from "node:url"; const WORKFLOWS_DIRECTORY = ".github/workflows"; @@ -23,13 +23,18 @@ async function install({ directory }: PluginArgs) { // workspace level await copyFile({ - from: new URL("../../static/ci.yml", import.meta.url).pathname, + from: toPathName("../../static/ci.yml", { + __dirname, + importUrl: import.meta.url, + }), to: join(workflowDirectory, "ci.yml"), }); await copyFile({ - from: new URL("../../static/update-node-versions.yml", import.meta.url) - .pathname, + from: toPathName("../../static/update-node-versions.yml", { + __dirname, + importUrl: import.meta.url, + }), to: join(workflowDirectory, "update-node-versions.yml"), }); } @@ -47,22 +52,30 @@ async function load({ directory }: PluginArgs) { if (await hasPlugin({ directory, name: "semantic-release" })) { await copyFile({ - from: new URL("../../static/release.yml", import.meta.url).pathname, + from: toPathName("../../static/release.yml", { + __dirname, + importUrl: import.meta.url, + }), to: join(workflowDirectory, "release.yml"), }); } if (await hasPlugin({ directory, name: "prettier" })) { await copyFile({ - from: new URL("../../static/format-check.yml", import.meta.url).pathname, + from: toPathName("../../static/format-check.yml", { + __dirname, + importUrl: import.meta.url, + }), to: join(workflowDirectory, "format-check.yml"), }); } if (await hasPlugin({ directory, name: "dependabot" })) { await copyFile({ - from: new URL("../../static/dependabot-automerge.yml", import.meta.url) - .pathname, + from: toPathName("../../static/dependabot-automerge.yml", { + __dirname, + importUrl: import.meta.url, + }), to: join(workflowDirectory, "dependabot-automerge.yml"), }); }