From 3281bf04fc1d6248780ad380d13206f19ede30dc Mon Sep 17 00:00:00 2001 From: Jason3S Date: Wed, 16 Aug 2023 11:43:44 +0000 Subject: [PATCH] feat: Update CSpell to (7.0.0) --- action-src/package.json | 4 +- action/lib/main_root.js | 59562 ++++++++++++++++---------------------- yarn.lock | 484 +- 3 files changed, 25376 insertions(+), 34674 deletions(-) diff --git a/action-src/package.json b/action-src/package.json index 2753ffcf3..350a7a9d1 100644 --- a/action-src/package.json +++ b/action-src/package.json @@ -27,8 +27,8 @@ "@octokit/core": "^4.2.4", "@octokit/plugin-rest-endpoint-methods": "7.1.3", "@octokit/rest": "^19.0.13", - "cspell": "^6.31.3", - "cspell-glob": "^6.31.3", + "cspell": "^7.0.0", + "cspell-glob": "^7.0.0", "esbuild": "^0.19.2", "vscode-uri": "^3.0.7" } diff --git a/action/lib/main_root.js b/action/lib/main_root.js index 616e31fab..2eb2838eb 100644 --- a/action/lib/main_root.js +++ b/action/lib/main_root.js @@ -11,9 +11,9 @@ var __esm = (fn, res) => function __init() { var __commonJS = (cb, mod) => function __require() { 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 __export = (target, all3) => { + for (var name in all3) + __defProp(target, name, { get: all3[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { @@ -99,11 +99,11 @@ var require_command = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.issue = exports.issueCommand = void 0; - var os = __importStar(require("os")); + var os5 = __importStar(require("os")); var utils_1 = require_utils(); function issueCommand2(command, properties, message) { const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); + process.stdout.write(cmd.toString() + os5.EOL); } exports.issueCommand = issueCommand2; function issue(name, message = "") { @@ -124,13 +124,13 @@ var require_command = __commonJS({ let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += " "; - let first = true; + let first3 = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { - if (first) { - first = false; + if (first3) { + first3 = false; } else { cmdStr += ","; } @@ -311,7 +311,7 @@ function stringToBytes(str) { } return bytes; } -function v35_default(name, version3, hashfunc) { +function v35_default(name, version4, hashfunc) { function generateUUID(value, namespace, buf, offset) { if (typeof value === "string") { value = stringToBytes(value); @@ -326,7 +326,7 @@ function v35_default(name, version3, hashfunc) { bytes.set(namespace); bytes.set(value, namespace.length); bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 15 | version3; + bytes[6] = bytes[6] & 15 | version4; bytes[8] = bytes[8] & 63 | 128; if (buf) { offset = offset || 0; @@ -519,8 +519,8 @@ var require_file_command = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; - var fs6 = __importStar(require("fs")); - var os = __importStar(require("os")); + var fs9 = __importStar(require("fs")); + var os5 = __importStar(require("os")); var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports)); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -528,10 +528,10 @@ var require_file_command = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs6.existsSync(filePath)) { + if (!fs9.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs6.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + fs9.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os5.EOL}`, { encoding: "utf8" }); } @@ -545,7 +545,7 @@ var require_file_command = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; + return `${key}<<${delimiter}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; } exports.prepareKeyValueMessage = prepareKeyValueMessage; } @@ -624,7 +624,7 @@ var require_tunnel = __commonJS({ var http = require("http"); var https = require("https"); var events = require("events"); - var assert7 = require("assert"); + var assert20 = require("assert"); var util = require("util"); exports.httpOverHttp = httpOverHttp; exports.httpsOverHttp = httpsOverHttp; @@ -815,9 +815,9 @@ var require_tunnel = __commonJS({ 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]; + var keys2 = Object.keys(overrides); + for (var j = 0, keyLen = keys2.length; j < keyLen; ++j) { + var k = keys2[j]; if (overrides[k] !== void 0) { target[k] = overrides[k]; } @@ -886,11 +886,11 @@ var require_lib = __commonJS({ }; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -906,7 +906,7 @@ var require_lib = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -991,13 +991,13 @@ var require_lib = __commonJS({ } readBody() { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve10) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve13) => __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", () => { - resolve10(output.toString()); + resolve13(output.toString()); }); })); }); @@ -1206,14 +1206,14 @@ var require_lib = __commonJS({ */ requestRaw(info3, data) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve10, reject) => { + return new Promise((resolve13, reject) => { function callbackForResult(err, res) { if (err) { reject(err); } else if (!res) { reject(new Error("Unknown error")); } else { - resolve10(res); + resolve13(res); } } this.requestRawWithCallback(info3, data, callbackForResult); @@ -1369,12 +1369,12 @@ var require_lib = __commonJS({ return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve10) => setTimeout(() => resolve10(), ms)); + return new Promise((resolve13) => setTimeout(() => resolve13(), ms)); }); } _processResponse(res, options) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve10, reject) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve13, reject) => __awaiter(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -1382,7 +1382,7 @@ var require_lib = __commonJS({ headers: {} }; if (statusCode === HttpCodes.NotFound) { - resolve10(response); + resolve13(response); } function dateTimeDeserializer(key, value) { if (typeof value === "string") { @@ -1421,7 +1421,7 @@ var require_lib = __commonJS({ err.result = response.result; reject(err); } else { - resolve10(response); + resolve13(response); } })); }); @@ -1438,11 +1438,11 @@ var require_auth = __commonJS({ "use strict"; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -1458,7 +1458,7 @@ var require_auth = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -1542,11 +1542,11 @@ var require_oidc_utils = __commonJS({ "use strict"; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -1562,7 +1562,7 @@ var require_oidc_utils = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -1595,7 +1595,7 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; + var _a2; return __awaiter(this, void 0, void 0, function* () { const httpclient = _OidcClient.createHttpClient(); const res = yield httpclient.getJson(id_token_url).catch((error2) => { @@ -1605,7 +1605,7 @@ var require_oidc_utils = __commonJS({ Error Message: ${error2.result.message}`); }); - const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; if (!id_token) { throw new Error("Response json body do not have ID Token field"); } @@ -1640,11 +1640,11 @@ var require_summary = __commonJS({ "use strict"; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -1660,7 +1660,7 @@ var require_summary = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -1693,7 +1693,7 @@ var require_summary = __commonJS({ } try { yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } catch (_a) { + } catch (_a2) { throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } this._filePath = pathFromEnv; @@ -1962,7 +1962,7 @@ var require_path_utils = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; - var path16 = __importStar(require("path")); + var path26 = __importStar(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -1972,7 +1972,7 @@ var require_path_utils = __commonJS({ } exports.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path16.sep); + return pth.replace(/[/\\]/g, path26.sep); } exports.toPlatformPath = toPlatformPath; } @@ -2012,11 +2012,11 @@ var require_core = __commonJS({ }; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -2032,7 +2032,7 @@ var require_core = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -2042,8 +2042,8 @@ var require_core = __commonJS({ var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os = __importStar(require("os")); - var path16 = __importStar(require("path")); + var os5 = __importStar(require("os")); + var path26 = __importStar(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -2071,7 +2071,7 @@ var require_core = __commonJS({ } else { command_1.issueCommand("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path26.delimiter}${process.env["PATH"]}`; } exports.addPath = addPath; function getInput3(name, options) { @@ -2110,7 +2110,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); if (filePath) { return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value)); } - process.stdout.write(os.EOL); + process.stdout.write(os5.EOL); command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value)); } exports.setOutput = setOutput2; @@ -2144,7 +2144,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.notice = notice; function info3(message) { - process.stdout.write(message + os.EOL); + process.stdout.write(message + os5.EOL); } exports.info = info3; function startGroup(name) { @@ -2220,14 +2220,14 @@ var require_context = __commonJS({ * Hydrate the context from the environment */ constructor() { - var _a, _b, _c; + var _a2, _b, _c; this.payload = {}; if (process.env.GITHUB_EVENT_PATH) { if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path16 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path16} does not exist${os_1.EOL}`); + const path26 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path26} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -2239,7 +2239,7 @@ var require_context = __commonJS({ this.job = process.env.GITHUB_JOB; this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); - this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`; + this.apiUrl = (_a2 = process.env.GITHUB_API_URL) !== null && _a2 !== void 0 ? _a2 : `https://api.github.com`; this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; } @@ -2551,7 +2551,7 @@ var require_dist_node2 = __commonJS({ } return obj; } - function merge(defaults, route, options) { + function merge4(defaults, route, options) { if (typeof route === "string") { let [method, url] = route.split(" "); options = Object.assign(url ? { @@ -2624,7 +2624,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined2(value) { + function isDefined8(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -2632,7 +2632,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context, operator, key, modifier) { var value = context[key], result = []; - if (isDefined2(value) && value !== "") { + if (isDefined8(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -2642,12 +2642,12 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined2).forEach(function(value2) { + value.filter(isDefined8).forEach(function(value2) { result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : "")); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined2(value[k])) { + if (isDefined8(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -2655,12 +2655,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined2).forEach(function(value2) { + value.filter(isDefined8).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined2(value[k])) { + if (isDefined8(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -2675,7 +2675,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined2(value)) { + if (isDefined8(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -2686,14 +2686,14 @@ var require_dist_node2 = __commonJS({ } return result; } - function parseUrl(template2) { + function parseUrl(template3) { return { - expand: expand.bind(null, template2) + expand: expand.bind(null, template3) }; } - function expand(template2, context) { + function expand(template3, context) { var operators2 = ["+", "#", ".", "/", ";", "?", "&"]; - return template2.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(_, expression, literal) { + return template3.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(_, expression, literal) { if (expression) { let operator = ""; const values = []; @@ -2721,7 +2721,7 @@ var require_dist_node2 = __commonJS({ } }); } - function parse3(options) { + function parse4(options) { let method = options.method.toUpperCase(); let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); let headers = Object.assign({}, options.headers); @@ -2742,8 +2742,8 @@ var require_dist_node2 = __commonJS({ if (options.mediaType.previews.length) { const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => { - const format5 = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format5}`; + const format6 = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format6}`; }).join(","); } } @@ -2777,16 +2777,16 @@ var require_dist_node2 = __commonJS({ } : null); } function endpointWithDefaults(defaults, route, options) { - return parse3(merge(defaults, route, options)); + return parse4(merge4(defaults, route, options)); } function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS2 = merge(oldDefaults, newDefaults); + const DEFAULTS2 = merge4(oldDefaults, newDefaults); const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); return Object.assign(endpoint2, { DEFAULTS: DEFAULTS2, defaults: withDefaults.bind(null, DEFAULTS2), - merge: merge.bind(null, DEFAULTS2), - parse: parse3 + merge: merge4.bind(null, DEFAULTS2), + parse: parse4 }); } var VERSION = "6.0.12"; @@ -2970,9 +2970,9 @@ var require_utils3 = __commonJS({ "node_modules/whatwg-url/lib/utils.js"(exports, module2) { "use strict"; module2.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i = 0; i < keys.length; ++i) { - Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); + const keys2 = Object.getOwnPropertyNames(source); + for (let i = 0; i < keys2.length; ++i) { + Object.defineProperty(target, keys2[i], Object.getOwnPropertyDescriptor(source, keys2[i])); } }; module2.exports.wrapperSymbol = Symbol("wrapper"); @@ -3003,7 +3003,7 @@ var require_tr46 = __commonJS({ TRANSITIONAL: 0, NONTRANSITIONAL: 1 }; - function normalize(str) { + function normalize3(str) { return str.split("\0").map(function(s) { return s.normalize("NFC"); }).join("\0"); @@ -3083,7 +3083,7 @@ var require_tr46 = __commonJS({ processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; } var error2 = false; - if (normalize(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { + if (normalize3(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { error2 = true; } var len = countSymbols(label); @@ -3101,7 +3101,7 @@ var require_tr46 = __commonJS({ } function processing(domain_name, useSTD3, processing_option) { var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize(result.string); + result.string = normalize3(result.string); var labels = result.string.split("."); for (var i = 0; i < labels.length; ++i) { try { @@ -3174,8 +3174,8 @@ var require_url_state_machine = __commonJS({ function countSymbols(str) { return punycode.ucs2.decode(str).length; } - function at(input, idx) { - const c = input[idx]; + function at(input, idx2) { + const c = input[idx2]; return isNaN(c) ? void 0 : String.fromCodePoint(c); } function isASCIIDigit(c) { @@ -3545,14 +3545,14 @@ var require_url_state_machine = __commonJS({ return url.replace(/\u0009|\u000A|\u000D/g, ""); } function shortenPath(url) { - const path16 = url.path; - if (path16.length === 0) { + const path26 = url.path; + if (path26.length === 0) { return; } - if (url.scheme === "file" && path16.length === 1 && isNormalizedWindowsDriveLetter(path16[0])) { + if (url.scheme === "file" && path26.length === 1 && isNormalizedWindowsDriveLetter(path26[0])) { return; } - path16.pop(); + path26.pop(); } function includesCredentials(url) { return url.username !== "" || url.password !== ""; @@ -4843,11 +4843,11 @@ var require_lib3 = __commonJS({ json: { enumerable: true }, text: { enumerable: true } }); - Body.mixIn = function(proto) { + Body.mixIn = function(proto2) { for (const name of Object.getOwnPropertyNames(Body.prototype)) { - if (!(name in proto)) { + if (!(name in proto2)) { const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); + Object.defineProperty(proto2, name, desc); } } }; @@ -4876,7 +4876,7 @@ var require_lib3 = __commonJS({ let accum = []; let accumBytes = 0; let abort = false; - return new Body.Promise(function(resolve10, reject) { + return new Body.Promise(function(resolve13, reject) { let resTimeout; if (_this4.timeout) { resTimeout = setTimeout(function() { @@ -4910,7 +4910,7 @@ var require_lib3 = __commonJS({ } clearTimeout(resTimeout); try { - resolve10(Buffer.concat(accum, accumBytes)); + resolve13(Buffer.concat(accum, accumBytes)); } catch (err) { reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); } @@ -5048,9 +5048,9 @@ var require_lib3 = __commonJS({ throw new TypeError(`${value} is not a legal HTTP header value`); } } - function find(map, name) { + function find(map3, name) { name = name.toLowerCase(); - for (const key in map) { + for (const key in map3) { if (key.toLowerCase() === name) { return key; } @@ -5257,8 +5257,8 @@ var require_lib3 = __commonJS({ }); function getHeaders(headers) { let kind = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === "key" ? function(k) { + const keys2 = Object.keys(headers[MAP]).sort(); + return keys2.map(kind === "key" ? function(k) { return k.toLowerCase(); } : kind === "value" ? function(k) { return headers[MAP][k].join(", "); @@ -5426,8 +5426,8 @@ var require_lib3 = __commonJS({ return typeof input === "object" && typeof input[INTERNALS$2] === "object"; } function isAbortSignal(signal) { - const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === "AbortSignal"); + const proto2 = signal && typeof signal === "object" && Object.getPrototypeOf(signal); + return !!(proto2 && proto2.constructor.name === "AbortSignal"); } var Request = class _Request { constructor(input) { @@ -5590,7 +5590,7 @@ var require_lib3 = __commonJS({ throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); } Body.Promise = fetch2.Promise; - return new fetch2.Promise(function(resolve10, reject) { + return new fetch2.Promise(function(resolve13, reject) { const request = new Request(url, opts); const options = getNodeRequestOptions(request); const send = (options.protocol === "https:" ? https : http).request; @@ -5725,7 +5725,7 @@ var require_lib3 = __commonJS({ requestOpts.body = void 0; requestOpts.headers.delete("content-length"); } - resolve10(fetch2(new Request(locationURL, requestOpts))); + resolve13(fetch2(new Request(locationURL, requestOpts))); finalize(); return; } @@ -5747,7 +5747,7 @@ var require_lib3 = __commonJS({ const codings = headers.get("Content-Encoding"); if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { response = new Response(body, response_options); - resolve10(response); + resolve13(response); return; } const zlibOptions = { @@ -5757,7 +5757,7 @@ var require_lib3 = __commonJS({ if (codings == "gzip" || codings == "x-gzip") { body = body.pipe(zlib.createGunzip(zlibOptions)); response = new Response(body, response_options); - resolve10(response); + resolve13(response); return; } if (codings == "deflate" || codings == "x-deflate") { @@ -5769,12 +5769,12 @@ var require_lib3 = __commonJS({ body = body.pipe(zlib.createInflateRaw()); } response = new Response(body, response_options); - resolve10(response); + resolve13(response); }); raw.on("end", function() { if (!response) { response = new Response(body, response_options); - resolve10(response); + resolve13(response); } }); return; @@ -5782,11 +5782,11 @@ var require_lib3 = __commonJS({ if (codings == "br" && typeof zlib.createBrotliDecompress === "function") { body = body.pipe(zlib.createBrotliDecompress()); response = new Response(body, response_options); - resolve10(response); + resolve13(response); return; } response = new Response(body, response_options); - resolve10(response); + resolve13(response); }); writeToStream(req, request); }); @@ -6414,10 +6414,10 @@ var require_dist_node8 = __commonJS({ * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) */ static plugin(...newPlugins) { - var _a; + var _a2; const currentPlugins = this.plugins; - const NewOctokit = (_a = class extends this { - }, _a.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))), _a); + const NewOctokit = (_a2 = class extends this { + }, _a2.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))), _a2); return NewOctokit; } }; @@ -6433,7 +6433,7 @@ var require_dist_node9 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); + var keys2 = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { @@ -6441,9 +6441,9 @@ var require_dist_node9 = __commonJS({ return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } - keys.push.apply(keys, symbols); + keys2.push.apply(keys2, symbols); } - return keys; + return keys2; } function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { @@ -7508,14 +7508,14 @@ var require_dist_node10 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); var VERSION = "2.21.3"; function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); + var keys2 = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function(sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), keys.push.apply(keys, symbols); + })), keys2.push.apply(keys2, symbols); } - return keys; + return keys2; } function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { @@ -7692,22 +7692,22 @@ var require_utils4 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0; var Context2 = __importStar(require_context()); - var Utils = __importStar(require_utils2()); + var Utils2 = __importStar(require_utils2()); var core_1 = require_dist_node8(); var plugin_rest_endpoint_methods_1 = require_dist_node9(); var plugin_paginate_rest_1 = require_dist_node10(); exports.context = new Context2.Context(); - var baseUrl = Utils.getApiBaseUrl(); + var baseUrl = Utils2.getApiBaseUrl(); exports.defaults = { baseUrl, request: { - agent: Utils.getProxyAgent(baseUrl) + agent: Utils2.getProxyAgent(baseUrl) } }; exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults); function getOctokitOptions(token, options) { const opts = Object.assign({}, options || {}); - const auth = Utils.getAuthString(token, opts); + const auth = Utils2.getAuthString(token, opts); if (auth) { opts.auth = auth; } @@ -7776,12 +7776,12 @@ var require_utils5 = __commonJS({ return false; }; exports.find = (node, type) => node.nodes.find((node2) => node2.type === type); - exports.exceedsLimit = (min, max, step = 1, limit) => { + exports.exceedsLimit = (min3, max4, step = 1, limit) => { if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) + if (!exports.isInteger(min3) || !exports.isInteger(max4)) return false; - return (Number(max) - Number(min)) / Number(step) >= limit; + return (Number(max4) - Number(min3)) / Number(step) >= limit; }; exports.escapeNode = (block, n = 0, type) => { let node = block.nodes[n]; @@ -7898,14 +7898,14 @@ var require_to_regex_range = __commonJS({ "node_modules/to-regex-range/index.js"(exports, module2) { "use strict"; var isNumber = require_is_number(); - var toRegexRange = (min, max, options) => { - if (isNumber(min) === false) { + var toRegexRange = (min3, max4, options) => { + if (isNumber(min3) === false) { throw new TypeError("toRegexRange: expected the first argument to be a number"); } - if (max === void 0 || min === max) { - return String(min); + if (max4 === void 0 || min3 === max4) { + return String(min3); } - if (isNumber(max) === false) { + if (isNumber(max4) === false) { throw new TypeError("toRegexRange: expected the second argument to be a number."); } let opts = { relaxZeros: true, ...options }; @@ -7916,14 +7916,14 @@ var require_to_regex_range = __commonJS({ let shorthand = String(opts.shorthand); let capture = String(opts.capture); let wrap = String(opts.wrap); - let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap; + let cacheKey = min3 + ":" + max4 + "=" + relax + shorthand + capture + wrap; if (toRegexRange.cache.hasOwnProperty(cacheKey)) { return toRegexRange.cache[cacheKey].result; } - let a = Math.min(min, max); - let b = Math.max(min, max); + let a = Math.min(min3, max4); + let b = Math.max(min3, max4); if (Math.abs(a - b) === 1) { - let result = min + "|" + max; + let result = min3 + "|" + max4; if (opts.capture) { return `(${result})`; } @@ -7932,8 +7932,8 @@ var require_to_regex_range = __commonJS({ } return `(?:${result})`; } - let isPadded = hasPadding(min) || hasPadding(max); - let state = { min, max, a, b }; + let isPadded = hasPadding(min3) || hasPadding(max4); + let state = { min: min3, max: max4, a, b }; let positives = []; let negatives = []; if (isPadded) { @@ -7966,24 +7966,24 @@ var require_to_regex_range = __commonJS({ let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); return subpatterns.join("|"); } - function splitToRanges(min, max) { + function splitToRanges(min3, max4) { let nines = 1; let zeros = 1; - let stop = countNines(min, nines); - let stops = /* @__PURE__ */ new Set([max]); - while (min <= stop && stop <= max) { + let stop = countNines(min3, nines); + let stops = /* @__PURE__ */ new Set([max4]); + while (min3 <= stop && stop <= max4) { stops.add(stop); nines += 1; - stop = countNines(min, nines); + stop = countNines(min3, nines); } - stop = countZeros(max + 1, zeros) - 1; - while (min < stop && stop <= max) { + stop = countZeros(max4 + 1, zeros) - 1; + while (min3 < stop && stop <= max4) { stops.add(stop); zeros += 1; - stop = countZeros(max + 1, zeros) - 1; + stop = countZeros(max4 + 1, zeros) - 1; } stops = [...stops]; - stops.sort(compare2); + stops.sort(compare4); return stops; } function rangeToPattern(start, stop, options) { @@ -7993,7 +7993,7 @@ var require_to_regex_range = __commonJS({ let zipped = zip(start, stop); let digits = zipped.length; let pattern = ""; - let count = 0; + let count3 = 0; for (let i = 0; i < digits; i++) { let [startDigit, stopDigit] = zipped[i]; if (startDigit === stopDigit) { @@ -8001,22 +8001,22 @@ var require_to_regex_range = __commonJS({ } else if (startDigit !== "0" || stopDigit !== "9") { pattern += toCharacterClass(startDigit, stopDigit, options); } else { - count++; + count3++; } } - if (count) { + if (count3) { pattern += options.shorthand === true ? "\\d" : "[0-9]"; } - return { pattern, count: [count], digits }; + return { pattern, count: [count3], digits }; } - function splitToPatterns(min, max, tok, options) { - let ranges = splitToRanges(min, max); + function splitToPatterns(min3, max4, tok, options) { + let ranges = splitToRanges(min3, max4); let tokens = []; - let start = min; + let start = min3; let prev; for (let i = 0; i < ranges.length; i++) { - let max2 = ranges[i]; - let obj = rangeToPattern(String(start), String(max2), options); + let max5 = ranges[i]; + let obj = rangeToPattern(String(start), String(max5), options); let zeros = ""; if (!tok.isPadded && prev && prev.pattern === obj.pattern) { if (prev.count.length > 1) { @@ -8024,15 +8024,15 @@ var require_to_regex_range = __commonJS({ } prev.count.push(obj.count[0]); prev.string = prev.pattern + toQuantifier(prev.count); - start = max2 + 1; + start = max5 + 1; continue; } if (tok.isPadded) { - zeros = padZeros(max2, tok, options); + zeros = padZeros(max5, tok, options); } obj.string = zeros + obj.pattern + toQuantifier(obj.count); tokens.push(obj); - start = max2 + 1; + start = max5 + 1; prev = obj; } return tokens; @@ -8056,14 +8056,14 @@ var require_to_regex_range = __commonJS({ arr.push([a[i], b[i]]); return arr; } - function compare2(a, b) { + function compare4(a, b) { return a > b ? 1 : b > a ? -1 : 0; } function contains2(arr, key, val) { return arr.some((ele) => ele[key] === val); } - function countNines(min, len) { - return Number(String(min).slice(0, -len) + "9".repeat(len)); + function countNines(min3, len) { + return Number(String(min3).slice(0, -len) + "9".repeat(len)); } function countZeros(integer, zeros) { return integer - integer % Math.pow(10, zeros); @@ -8112,7 +8112,7 @@ var require_fill_range = __commonJS({ var util = require("util"); var toRegexRange = require_to_regex_range(); var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val); - var transform = (toNumber) => { + var transform2 = (toNumber) => { return (value) => toNumber === true ? Number(value) : String(value); }; var isValidValue = (value) => { @@ -8233,7 +8233,7 @@ var require_fill_range = __commonJS({ let padded = zeros(startString) || zeros(endString) || zeros(stepString); let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; let toNumber = padded === false && stringify2(start, end, options) === false; - let format5 = options.transform || transform(toNumber); + let format6 = options.transform || transform2(toNumber); if (options.toRegex && step === 1) { return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); } @@ -8245,7 +8245,7 @@ var require_fill_range = __commonJS({ if (options.toRegex === true && step > 1) { push(a); } else { - range.push(pad(format5(a, index), maxLen, toNumber)); + range.push(pad(format6(a, index), maxLen, toNumber)); } a = descending ? a - step : a + step; index++; @@ -8259,19 +8259,19 @@ var require_fill_range = __commonJS({ if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) { return invalidRange(start, end, options); } - let format5 = options.transform || ((val) => String.fromCharCode(val)); + let format6 = options.transform || ((val) => String.fromCharCode(val)); let a = `${start}`.charCodeAt(0); let b = `${end}`.charCodeAt(0); let descending = a > b; - let min = Math.min(a, b); - let max = Math.max(a, b); + let min3 = Math.min(a, b); + let max4 = Math.max(a, b); if (options.toRegex && step === 1) { - return toRange(min, max, false, options); + return toRange(min3, max4, false, options); } let range = []; let index = 0; while (descending ? a >= b : a <= b) { - range.push(format5(a, index)); + range.push(format6(a, index)); a = descending ? a - step : a + step; index++; } @@ -8318,7 +8318,7 @@ var require_compile = __commonJS({ var fill = require_fill_range(); var utils = require_utils5(); var compile = (ast, options = {}) => { - let walk = (node, parent = {}) => { + let walk4 = (node, parent = {}) => { let invalidBlock = utils.isInvalidBrace(parent); let invalidNode = node.invalid === true && options.escapeInvalid === true; let invalid = invalidBlock === true || invalidNode === true; @@ -8351,12 +8351,12 @@ var require_compile = __commonJS({ } if (node.nodes) { for (let child of node.nodes) { - output += walk(child, node); + output += walk4(child, node); } } return output; }; - return walk(ast); + return walk4(ast); }; module2.exports = compile; } @@ -8395,7 +8395,7 @@ var require_expand = __commonJS({ }; var expand = (ast, options = {}) => { let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit; - let walk = (node, parent = {}) => { + let walk4 = (node, parent = {}) => { node.queue = []; let p = parent; let q = parent.queue; @@ -8448,12 +8448,12 @@ var require_expand = __commonJS({ continue; } if (child.nodes) { - walk(child, node); + walk4(child, node); } } return queue; }; - return utils.flatten(walk(ast)); + return utils.flatten(walk4(ast)); }; module2.exports = expand; } @@ -8594,14 +8594,14 @@ var require_parse = __commonJS({ CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants(); - var parse3 = (input, options = {}) => { + var parse4 = (input, options = {}) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } let opts = options || {}; - let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + let max4 = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max4) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max4})`); } let ast = { type: "root", input, nodes: [] }; let stack = [ast]; @@ -8800,7 +8800,7 @@ var require_parse = __commonJS({ push({ type: "eos" }); return ast; }; - module2.exports = parse3; + module2.exports = parse4; } }); @@ -8811,7 +8811,7 @@ var require_braces = __commonJS({ var stringify2 = require_stringify(); var compile = require_compile(); var expand = require_expand(); - var parse3 = require_parse(); + var parse4 = require_parse(); var braces = (input, options = {}) => { let output = []; if (Array.isArray(input)) { @@ -8831,7 +8831,7 @@ var require_braces = __commonJS({ } return output; }; - braces.parse = (input, options = {}) => parse3(input, options); + braces.parse = (input, options = {}) => parse4(input, options); braces.stringify = (input, options = {}) => { if (typeof input === "string") { return stringify2(braces.parse(input, options), options); @@ -8871,7 +8871,7 @@ var require_braces = __commonJS({ var require_constants2 = __commonJS({ "node_modules/picomatch/lib/constants.js"(exports, module2) { "use strict"; - var path16 = require("path"); + var path26 = require("path"); var WIN_SLASH = "\\\\/"; var WIN_NO_SLASH = `[^${WIN_SLASH}]`; var DOT_LITERAL = "\\."; @@ -9041,7 +9041,7 @@ var require_constants2 = __commonJS({ /* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ - SEP: path16.sep, + SEP: path26.sep, /** * Create EXTGLOB_CHARS */ @@ -9068,7 +9068,7 @@ var require_constants2 = __commonJS({ var require_utils6 = __commonJS({ "node_modules/picomatch/lib/utils.js"(exports) { "use strict"; - var path16 = require("path"); + var path26 = require("path"); var win32 = process.platform === "win32"; var { REGEX_BACKSLASH, @@ -9082,8 +9082,8 @@ var require_utils6 = __commonJS({ exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1"); exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/"); exports.removeBackslashes = (str) => { - return str.replace(REGEX_REMOVE_BACKSLASH, (match) => { - return match === "\\" ? "" : match; + return str.replace(REGEX_REMOVE_BACKSLASH, (match2) => { + return match2 === "\\" ? "" : match2; }); }; exports.supportsLookbehinds = () => { @@ -9097,15 +9097,15 @@ var require_utils6 = __commonJS({ if (options && typeof options.windows === "boolean") { return options.windows; } - return win32 === true || path16.sep === "\\"; + return win32 === true || path26.sep === "\\"; }; exports.escapeLast = (input, char, lastIdx) => { - const idx = input.lastIndexOf(char, lastIdx); - if (idx === -1) + const idx2 = input.lastIndexOf(char, lastIdx); + if (idx2 === -1) return input; - if (input[idx - 1] === "\\") - return exports.escapeLast(input, char, idx - 1); - return `${input.slice(0, idx)}\\${input.slice(idx)}`; + if (input[idx2 - 1] === "\\") + return exports.escapeLast(input, char, idx2 - 1); + return `${input.slice(0, idx2)}\\${input.slice(idx2)}`; }; exports.removePrefix = (input, state = {}) => { let output = input; @@ -9172,7 +9172,7 @@ var require_scan = __commonJS({ token.depth = token.isGlobstar ? Infinity : 1; } }; - var scan = (input, options) => { + var scan3 = (input, options) => { const opts = options || {}; const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; @@ -9423,21 +9423,21 @@ var require_scan = __commonJS({ } if (opts.parts === true || opts.tokens === true) { let prevIndex; - for (let idx = 0; idx < slashes.length; idx++) { + for (let idx2 = 0; idx2 < slashes.length; idx2++) { const n = prevIndex ? prevIndex + 1 : start; - const i = slashes[idx]; + const i = slashes[idx2]; const value = input.slice(n, i); if (opts.tokens) { - if (idx === 0 && start !== 0) { - tokens[idx].isPrefix = true; - tokens[idx].value = prefix; + if (idx2 === 0 && start !== 0) { + tokens[idx2].isPrefix = true; + tokens[idx2].value = prefix; } else { - tokens[idx].value = value; + tokens[idx2].value = value; } - depth(tokens[idx]); - state.maxDepth += tokens[idx].depth; + depth(tokens[idx2]); + state.maxDepth += tokens[idx2].depth; } - if (idx !== 0 || value !== "") { + if (idx2 !== 0 || value !== "") { parts.push(value); } prevIndex = i; @@ -9456,7 +9456,7 @@ var require_scan = __commonJS({ } return state; }; - module2.exports = scan; + module2.exports = scan3; } }); @@ -9473,7 +9473,7 @@ var require_parse2 = __commonJS({ REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants; - var expandRange = (args, options) => { + var expandRange2 = (args, options) => { if (typeof options.expandRange === "function") { return options.expandRange(...args, options); } @@ -9489,16 +9489,16 @@ var require_parse2 = __commonJS({ var syntaxError = (type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }; - var parse3 = (input, options) => { + var parse4 = (input, options) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } input = REPLACEMENTS[input] || input; const opts = { ...options }; - const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const max4 = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; let len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + if (len > max4) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max4}`); } const bos = { type: "bos", value: "", output: opts.prepend || "" }; const tokens = [bos]; @@ -9569,13 +9569,13 @@ var require_parse2 = __commonJS({ consume(token.value); }; const negate = () => { - let count = 1; + let count3 = 1; while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) { advance(); state.start++; - count++; + count3++; } - if (count % 2 === 0) { + if (count3 % 2 === 0) { return false; } state.negated = true; @@ -9639,7 +9639,7 @@ var require_parse2 = __commonJS({ output = token.close = `)$))${extglobStar}`; } if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { - const expression = parse3(rest, { ...options, fastpaths: false }).output; + const expression = parse4(rest, { ...options, fastpaths: false }).output; output = token.close = `)${expression})${extglobStar})`; } if (token.prev.type === "bos") { @@ -9651,26 +9651,26 @@ var require_parse2 = __commonJS({ }; if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { let backslashes = false; - let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { - if (first === "\\") { + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first3, rest, index) => { + if (first3 === "\\") { backslashes = true; return m; } - if (first === "?") { + if (first3 === "?") { if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ""); + return esc + first3 + (rest ? QMARK.repeat(rest.length) : ""); } if (index === 0) { return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ""); } return QMARK.repeat(chars.length); } - if (first === ".") { + if (first3 === ".") { return DOT_LITERAL.repeat(chars.length); } - if (first === "*") { + if (first3 === "*") { if (esc) { - return esc + first + (rest ? star : ""); + return esc + first3 + (rest ? star : ""); } return star; } @@ -9710,10 +9710,10 @@ var require_parse2 = __commonJS({ push({ type: "text", value }); continue; } - const match = /^\\+/.exec(remaining()); + const match2 = /^\\+/.exec(remaining()); let slashes = 0; - if (match && match[0].length > 2) { - slashes = match[0].length; + if (match2 && match2[0].length > 2) { + slashes = match2[0].length; state.index += slashes; if (slashes % 2 !== 0) { value += "\\"; @@ -9735,9 +9735,9 @@ var require_parse2 = __commonJS({ if (inner.includes("[")) { prev.posix = true; if (inner.includes(":")) { - const idx = prev.value.lastIndexOf("["); - const pre = prev.value.slice(0, idx); - const rest2 = prev.value.slice(idx + 2); + const idx2 = prev.value.lastIndexOf("["); + const pre = prev.value.slice(0, idx2); + const rest2 = prev.value.slice(idx2 + 2); const posix3 = POSIX_REGEX_SOURCE[rest2]; if (posix3) { prev.value = pre + posix3; @@ -9872,7 +9872,7 @@ var require_parse2 = __commonJS({ range.unshift(arr[i].value); } } - output = expandRange(range, opts); + output = expandRange2(range, opts); state.backtrack = true; } if (brace.comma !== true && brace.dots !== true) { @@ -10002,10 +10002,10 @@ var require_parse2 = __commonJS({ if (value === "$" || value === "^") { value = `\\${value}`; } - const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); - if (match) { - value += match[0]; - state.index += match[0].length; + const match2 = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match2) { + value += match2[0]; + state.index += match2[0].length; } push({ type: "text", value }); continue; @@ -10168,12 +10168,12 @@ var require_parse2 = __commonJS({ } return state; }; - parse3.fastpaths = (input, options) => { + parse4.fastpaths = (input, options) => { const opts = { ...options }; - const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const max4 = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + if (len > max4) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max4}`); } input = REPLACEMENTS[input] || input; const win32 = utils.isWindows(options); @@ -10220,13 +10220,13 @@ var require_parse2 = __commonJS({ case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; default: { - const match = /^(.*?)\.(\w+)$/.exec(str); - if (!match) + const match2 = /^(.*?)\.(\w+)$/.exec(str); + if (!match2) return; - const source2 = create(match[1]); + const source2 = create(match2[1]); if (!source2) return; - return source2 + DOT_LITERAL + match[2]; + return source2 + DOT_LITERAL + match2[2]; } } }; @@ -10237,7 +10237,7 @@ var require_parse2 = __commonJS({ } return source; }; - module2.exports = parse3; + module2.exports = parse4; } }); @@ -10245,9 +10245,9 @@ var require_parse2 = __commonJS({ var require_picomatch = __commonJS({ "node_modules/picomatch/lib/picomatch.js"(exports, module2) { "use strict"; - var path16 = require("path"); - var scan = require_scan(); - var parse3 = require_parse2(); + var path26 = require("path"); + var scan3 = require_scan(); + var parse4 = require_parse2(); var utils = require_utils6(); var constants = require_constants2(); var isObject = (val) => val && typeof val === "object" && !Array.isArray(val); @@ -10279,8 +10279,8 @@ var require_picomatch = __commonJS({ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); } const matcher = (input, returnObject = false) => { - const { isMatch, match, output } = picomatch.test(input, regex, options, { glob: glob2, posix: posix3 }); - const result = { glob: glob2, state, regex, posix: posix3, input, output, match, isMatch }; + const { isMatch, match: match2, output } = picomatch.test(input, regex, options, { glob: glob2, posix: posix3 }); + const result = { glob: glob2, state, regex, posix: posix3, input, output, match: match2, isMatch }; if (typeof opts.onResult === "function") { opts.onResult(result); } @@ -10313,33 +10313,33 @@ var require_picomatch = __commonJS({ return { isMatch: false, output: "" }; } const opts = options || {}; - const format5 = opts.format || (posix3 ? utils.toPosixSlashes : null); - let match = input === glob2; - let output = match && format5 ? format5(input) : input; - if (match === false) { - output = format5 ? format5(input) : input; - match = output === glob2; - } - if (match === false || opts.capture === true) { + const format6 = opts.format || (posix3 ? utils.toPosixSlashes : null); + let match2 = input === glob2; + let output = match2 && format6 ? format6(input) : input; + if (match2 === false) { + output = format6 ? format6(input) : input; + match2 = output === glob2; + } + if (match2 === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input, regex, options, posix3); + match2 = picomatch.matchBase(input, regex, options, posix3); } else { - match = regex.exec(output); + match2 = regex.exec(output); } } - return { isMatch: Boolean(match), match, output }; + return { isMatch: Boolean(match2), match: match2, output }; }; picomatch.matchBase = (input, glob2, options, posix3 = utils.isWindows(options)) => { const regex = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options); - return regex.test(path16.basename(input)); + return regex.test(path26.basename(input)); }; picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); picomatch.parse = (pattern, options) => { if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options)); - return parse3(pattern, { ...options, fastpaths: false }); + return parse4(pattern, { ...options, fastpaths: false }); }; - picomatch.scan = (input, options) => scan(input, options); + picomatch.scan = (input, options) => scan3(input, options); picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { if (returnOutput === true) { return state.output; @@ -10363,10 +10363,10 @@ var require_picomatch = __commonJS({ } let parsed = { negated: false, fastpaths: true }; if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) { - parsed.output = parse3.fastpaths(input, options); + parsed.output = parse4.fastpaths(input, options); } if (!parsed.output) { - parsed = parse3(input, options); + parsed = parse4(input, options); } return picomatch.compileRe(parsed, options, returnOutput, returnState); }; @@ -10422,8 +10422,8 @@ var require_micromatch = __commonJS({ negatives++; for (let item of list) { let matched = isMatch(item, true); - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) + let match2 = negated ? !matched.isMatch : matched.isMatch; + if (!match2) continue; if (negated) { omit.add(matched.output); @@ -10487,9 +10487,9 @@ var require_micromatch = __commonJS({ if (!utils.isObject(obj)) { throw new TypeError("Expected the first argument to be an object"); } - let keys = micromatch(Object.keys(obj), patterns, options); + let keys2 = micromatch(Object.keys(obj), patterns, options); let res = {}; - for (let key of keys) + for (let key of keys2) res[key] = obj[key]; return res; }; @@ -10522,9 +10522,9 @@ var require_micromatch = __commonJS({ micromatch.capture = (glob2, input, options) => { let posix3 = utils.isWindows(options); let regex = picomatch.makeRe(String(glob2), { ...options, capture: true }); - let match = regex.exec(posix3 ? utils.toPosixSlashes(input) : input); - if (match) { - return match.slice(1).map((v) => v === void 0 ? "" : v); + let match2 = regex.exec(posix3 ? utils.toPosixSlashes(input) : input); + if (match2) { + return match2.slice(1).map((v) => v === void 0 ? "" : v); } }; micromatch.makeRe = (...args) => picomatch.makeRe(...args); @@ -10563,9 +10563,9 @@ var require_dist_node11 = __commonJS({ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); + var __export2 = (target, all3) => { + for (var name in all3) + __defProp2(target, name, { get: all3[name], enumerable: true }); }; var __copyProps2 = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { @@ -12934,9 +12934,9 @@ var require_umd = __commonJS({ } }); -// node_modules/cspell-glob/dist/cjs/globHelper.js -var require_globHelper = __commonJS({ - "node_modules/cspell-glob/dist/cjs/globHelper.js"(exports) { +// node_modules/cspell-lib/dist/lib-cjs/vscodeUri.cjs +var require_vscodeUri = __commonJS({ + "node_modules/cspell-lib/dist/lib-cjs/vscodeUri.cjs"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) @@ -12971,718 +12971,9 @@ var require_globHelper = __commonJS({ return result; }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.normalizeGlobToRoot = exports.normalizeGlobPattern = exports.normalizeGlobPatterns = exports.isGlobPatternNormalized = exports.isGlobPatternWithRoot = exports.isGlobPatternWithOptionalRoot = exports.doesRootContainPath = exports.fileOrGlobToGlob = void 0; - var Path3 = __importStar(require("path")); - var { posix: posix3 } = Path3; - var relRegExp2 = /^\.[\\/]/; - var isGlobalPatternRegExp2 = /^!*[*]{2}/; - function fileOrGlobToGlob2(fileOrGlob, root, path16 = Path3) { - const pathToGlob = path16.sep === "\\" ? (p) => p.replace(/\\/g, "/") : (p) => p; - const isGlobalPattern = false; - if (isGlobPatternWithOptionalRoot2(fileOrGlob)) { - const useRoot = fileOrGlob.root ?? root; - const isGlobalPattern2 = isGlobPatternWithRoot2(fileOrGlob) ? fileOrGlob.isGlobalPattern : isGlobalGlob2(fileOrGlob.glob); - return { ...fileOrGlob, root: useRoot, isGlobalPattern: isGlobalPattern2 }; - } - if (doesRootContainPath2(root, fileOrGlob, path16) || relRegExp2.test(fileOrGlob)) { - const rel = path16.relative(root, path16.resolve(root, fileOrGlob)); - return { glob: pathToGlob(rel), root, isGlobalPattern }; - } - return { glob: pathToGlob(fileOrGlob), root, isGlobalPattern }; - } - exports.fileOrGlobToGlob = fileOrGlobToGlob2; - function doesRootContainPath2(root, child, path16) { - if (child.startsWith(root)) - return true; - const rel = path16.relative(root, child); - return !rel || rel !== child && !rel.startsWith("..") && !path16.isAbsolute(rel); - } - exports.doesRootContainPath = doesRootContainPath2; - function isGlobPatternWithOptionalRoot2(g) { - return typeof g !== "string" && typeof g.glob === "string"; - } - exports.isGlobPatternWithOptionalRoot = isGlobPatternWithOptionalRoot2; - function isGlobPatternWithRoot2(g) { - return typeof g.root === "string" && "isGlobalPattern" in g; - } - exports.isGlobPatternWithRoot = isGlobPatternWithRoot2; - function isGlobPatternNormalized2(g) { - if (!isGlobPatternWithOptionalRoot2(g)) - return false; - if (!isGlobPatternWithRoot2(g)) - return false; - const gr = g; - return "rawGlob" in gr && "rawRoot" in gr && typeof gr.rawGlob === "string"; - } - exports.isGlobPatternNormalized = isGlobPatternNormalized2; - function normalizePattern2(pattern, nested) { - pattern = pattern.replace(/^(!!)+/, ""); - const isNeg = pattern.startsWith("!"); - const prefix = isNeg ? "!" : ""; - pattern = isNeg ? pattern.slice(1) : pattern; - const patterns = nested ? normalizePatternNested2(pattern) : normalizePatternGeneral2(pattern); - return patterns.map((p) => prefix + p); - } - function normalizePatternNested2(pattern) { - if (!pattern.includes("/")) { - if (pattern === "**") - return ["**"]; - return ["**/" + pattern, "**/" + pattern + "/**"]; - } - const hasLeadingSlash = pattern.startsWith("/"); - pattern = hasLeadingSlash ? pattern.slice(1) : pattern; - if (pattern.endsWith("/")) { - return hasLeadingSlash || pattern.slice(0, -1).includes("/") ? [pattern + "**/*"] : ["**/" + pattern + "**/*"]; - } - if (pattern.endsWith("**")) { - return [pattern]; - } - return [pattern, pattern + "/**"]; - } - function normalizePatternGeneral2(pattern) { - pattern = pattern.startsWith("/") ? pattern.slice(1) : pattern; - pattern = pattern.endsWith("/") ? pattern + "**/*" : pattern; - return [pattern]; - } - function normalizeGlobPatterns2(patterns, options) { - function* normalize() { - for (const glob2 of patterns) { - if (isGlobPatternNormalized2(glob2)) { - yield glob2; - continue; - } - yield* normalizeGlobPattern2(glob2, options); - } - } - return [...normalize()]; - } - exports.normalizeGlobPatterns = normalizeGlobPatterns2; - function normalizeGlobPattern2(g, options) { - const { root, nodePath: path16 = Path3, nested, cwd = Path3.resolve() } = options; - g = !isGlobPatternWithOptionalRoot2(g) ? { glob: g } : g; - const gr = { ...g, root: g.root ?? root }; - const rawRoot = gr.root; - const rawGlob = g.glob; - gr.glob = gr.glob.trim(); - if (gr.glob.startsWith("${cwd}")) { - gr.glob = gr.glob.replace("${cwd}", ""); - gr.root = "${cwd}"; - } - if (gr.root.startsWith("${cwd}")) { - gr.root = path16.resolve(gr.root.replace("${cwd}", cwd)); - } - const isGlobalPattern = isGlobalGlob2(gr.glob); - gr.root = path16.resolve(root, path16.normalize(gr.root)); - const globs = normalizePattern2(gr.glob, nested); - return globs.map((glob2) => ({ ...gr, glob: glob2, rawGlob, rawRoot, isGlobalPattern })); - } - exports.normalizeGlobPattern = normalizeGlobPattern2; - function normalizeGlobToRoot2(glob2, root, path16) { - function relToGlob(relativePath2) { - return path16.sep === "\\" ? relativePath2.replace(/\\/g, "/") : relativePath2; - } - if (glob2.root === root) { - return glob2; - } - const relFromRootToGlob = path16.relative(root, glob2.root); - if (!relFromRootToGlob) { - return glob2; - } - if (glob2.isGlobalPattern) { - return { ...glob2, root }; - } - const relFromGlobToRoot = path16.relative(glob2.root, root); - const globIsUnderRoot = relFromRootToGlob[0] !== "." && !path16.isAbsolute(relFromRootToGlob); - const rootIsUnderGlob = relFromGlobToRoot[0] !== "." && !path16.isAbsolute(relFromGlobToRoot); - if (!globIsUnderRoot && !rootIsUnderGlob) { - return glob2; - } - const isNeg = glob2.glob.startsWith("!"); - const g = isNeg ? glob2.glob.slice(1) : glob2.glob; - const prefix = isNeg ? "!" : ""; - if (globIsUnderRoot) { - const relGlob2 = relToGlob(relFromRootToGlob); - return { - ...glob2, - glob: prefix + posix3.join(relGlob2, g), - root - }; - } - const relGlob = relToGlob(relFromGlobToRoot) + "/"; - const rebasedGlob = rebaseGlob2(g, relGlob); - return rebasedGlob ? { ...glob2, glob: prefix + rebasedGlob, root } : glob2; - } - exports.normalizeGlobToRoot = normalizeGlobToRoot2; - function rebaseGlob2(glob2, rebaseTo) { - if (!rebaseTo || rebaseTo === "/") - return glob2; - if (glob2.startsWith("**")) - return glob2; - rebaseTo = rebaseTo.endsWith("/") ? rebaseTo : rebaseTo + "/"; - if (glob2.startsWith(rebaseTo)) { - return glob2.slice(rebaseTo.length); - } - const relParts = rebaseTo.split("/"); - const globParts = glob2.split("/"); - for (let i = 0; i < relParts.length && i < globParts.length; ++i) { - const relSeg = relParts[i]; - const globSeg = globParts[i]; - if (!relSeg || globSeg === "**") { - return globParts.slice(i).join("/"); - } - if (relSeg !== globSeg && globSeg !== "*") { - break; - } - } - return void 0; - } - function trimGlob(glob2) { - glob2 = glob2.replace(/(?= 0 && glob2[i] in spaces) { - --i; - } - if (glob2[i] === "\\" && i < lenMin1) { - ++i; - } - ++i; - return i ? glob2.slice(0, i) : ""; - } - function trimGlobLeft(glob2) { - let i = 0; - while (i < glob2.length && glob2[i] in spaces) { - ++i; - } - return glob2.slice(i); - } - function isGlobalGlob2(glob2) { - return isGlobalPatternRegExp2.test(glob2); - } - exports.__testing__ = { - rebaseGlob: rebaseGlob2, - trimGlob, - isGlobalGlob: isGlobalGlob2 - }; - } -}); - -// node_modules/cspell-glob/dist/cjs/GlobMatcher.js -var require_GlobMatcher = __commonJS({ - "node_modules/cspell-glob/dist/cjs/GlobMatcher.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GlobMatcher = void 0; - var micromatch_1 = __importDefault(require_micromatch()); - var Path3 = __importStar(require("path")); - var globHelper_js_1 = require_globHelper(); - var GlobMatcher2 = class { - constructor(patterns, rootOrOptions, _nodePath) { - _nodePath = _nodePath ?? Path3; - const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions ?? {}; - const { mode = "exclude" } = options; - const isExcludeMode = mode !== "include"; - _nodePath = options.nodePath ?? _nodePath; - const { root = _nodePath.resolve(), dot = isExcludeMode, nodePath = _nodePath, nested = isExcludeMode, cwd = process.cwd(), nobrace } = options; - const normalizedRoot = nodePath.resolve(nodePath.normalize(root)); - this.options = { root: normalizedRoot, dot, nodePath, nested, mode, nobrace, cwd }; - patterns = Array.isArray(patterns) ? patterns : typeof patterns === "string" ? patterns.split(/\r?\n/g) : [patterns]; - const globPatterns = (0, globHelper_js_1.normalizeGlobPatterns)(patterns, this.options); - this.patternsNormalizedToRoot = globPatterns.map((g) => (0, globHelper_js_1.normalizeGlobToRoot)(g, normalizedRoot, nodePath)).filter((g) => nodePath.relative(g.root, normalizedRoot) === ""); - this.patterns = globPatterns; - this.root = normalizedRoot; - this.path = nodePath; - this.dot = dot; - this.matchEx = buildMatcherFn2(this.patterns, this.options); - } - /** - * Check to see if a filename matches any of the globs. - * If filename is relative, it is considered relative to the root. - * If filename is absolute and contained within the root, it will be made relative before being tested for a glob match. - * If filename is absolute and not contained within the root, it will be tested as is. - * @param filename full path of the file to check. - */ - match(filename) { - return this.matchEx(filename).matched; - } - }; - exports.GlobMatcher = GlobMatcher2; - function buildMatcherFn2(patterns, options) { - const { nodePath: path16, dot, nobrace } = options; - const makeReOptions = { dot, nobrace }; - const rules = patterns.map((pattern, index) => ({ pattern, index })).filter((r) => !!r.pattern.glob).filter((r) => !r.pattern.glob.startsWith("#")).map(({ pattern, index }) => { - const matchNeg = pattern.glob.match(/^!/); - const glob2 = pattern.glob.replace(/^!/, ""); - const isNeg = matchNeg && matchNeg[0].length & 1 && true || false; - const reg = micromatch_1.default.makeRe(glob2, makeReOptions); - const fn2 = (filename) => { - const match = filename.match(reg); - return !!match; - }; - return { pattern, index, isNeg, fn: fn2, reg }; - }); - const negRules = rules.filter((r) => r.isNeg); - const posRules = rules.filter((r) => !r.isNeg); - const fn = (filename) => { - filename = path16.resolve(path16.normalize(filename)); - function testRules(rules2, matched) { - for (const rule of rules2) { - const pattern = rule.pattern; - const root = pattern.root; - const isRelPat = !pattern.isGlobalPattern; - if (isRelPat && !(0, globHelper_js_1.doesRootContainPath)(root, filename, path16)) { - continue; - } - const relName = isRelPat ? path16.relative(root, filename) : filename; - const fname = path16.sep === "\\" ? relName.replace(/\\/g, "/") : relName; - if (rule.fn(fname)) { - return { - matched, - glob: pattern.glob, - root, - pattern, - index: rule.index, - isNeg: rule.isNeg - }; - } - } - } - return testRules(negRules, false) || testRules(posRules, true) || { matched: false }; - }; - return fn; - } - } -}); - -// node_modules/cspell-glob/dist/cjs/GlobMatcherTypes.js -var require_GlobMatcherTypes = __commonJS({ - "node_modules/cspell-glob/dist/cjs/GlobMatcherTypes.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - } -}); - -// node_modules/cspell-glob/dist/cjs/index.js -var require_cjs = __commonJS({ - "node_modules/cspell-glob/dist/cjs/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GlobMatcher = exports.normalizeGlobPatterns = exports.isGlobPatternWithRoot = exports.isGlobPatternWithOptionalRoot = exports.isGlobPatternNormalized = exports.fileOrGlobToGlob = void 0; - var globHelper_js_1 = require_globHelper(); - Object.defineProperty(exports, "fileOrGlobToGlob", { enumerable: true, get: function() { - return globHelper_js_1.fileOrGlobToGlob; - } }); - Object.defineProperty(exports, "isGlobPatternNormalized", { enumerable: true, get: function() { - return globHelper_js_1.isGlobPatternNormalized; - } }); - Object.defineProperty(exports, "isGlobPatternWithOptionalRoot", { enumerable: true, get: function() { - return globHelper_js_1.isGlobPatternWithOptionalRoot; - } }); - Object.defineProperty(exports, "isGlobPatternWithRoot", { enumerable: true, get: function() { - return globHelper_js_1.isGlobPatternWithRoot; - } }); - Object.defineProperty(exports, "normalizeGlobPatterns", { enumerable: true, get: function() { - return globHelper_js_1.normalizeGlobPatterns; - } }); - var GlobMatcher_js_1 = require_GlobMatcher(); - Object.defineProperty(exports, "GlobMatcher", { enumerable: true, get: function() { - return GlobMatcher_js_1.GlobMatcher; - } }); - __exportStar(require_GlobMatcherTypes(), exports); - } -}); - -// node_modules/cspell-lib/dist/cjs/util/Uri.js -var require_Uri = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/Uri.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.from = exports.resolvePath = exports.joinPath = exports.extname = exports.dirname = exports.basename = exports.isUri = exports.normalizeDriveLetter = exports.parse = exports.file = exports.fromStdinFilePath = exports.fromFilePath = exports.uriToFilePath = exports.toUri = void 0; - var assert_1 = __importDefault(require("assert")); - var vscode_uri_1 = require_umd(); - var isFile = /^(?:[a-zA-Z]:|[/\\])/; - var isPossibleUri = /\w:\/\//; - var isUrl = /^(file:|stdin:|https?:|s?ftp:)/; - var STDIN_PROTOCOL = "stdin:"; - function toUri(uriOrFile) { - if (UriImpl.isUri(uriOrFile)) - return uriOrFile; - if (vscode_uri_1.URI.isUri(uriOrFile)) - return UriImpl.from(uriOrFile); - if (uriOrFile instanceof URL) - return UriImpl.parse(uriOrFile.toString()); - if (isUrlLike2(uriOrFile)) - return UriImpl.parse(uriOrFile.href); - if (isUri(uriOrFile)) - return UriImpl.from(uriOrFile); - if (isUrl.test(uriOrFile)) - return UriImpl.parse(uriOrFile); - return isFile.test(uriOrFile) && !isPossibleUri.test(uriOrFile) ? UriImpl.file(normalizeDriveLetter(uriOrFile)) : UriImpl.parse(uriOrFile); - } - exports.toUri = toUri; - var hasDriveLetter = /^[A-Z]:/i; - function uriToFilePath(uri) { - const adj = uri.scheme === "stdin" ? { scheme: "file" } : {}; - return normalizeDriveLetter(vscode_uri_1.URI.from(UriImpl.from(uri, adj)).fsPath); - } - exports.uriToFilePath = uriToFilePath; - function fromFilePath(file) { - return UriImpl.file(file); - } - exports.fromFilePath = fromFilePath; - function fromStdinFilePath(path16) { - return UriImpl.stdin(path16); - } - exports.fromStdinFilePath = fromStdinFilePath; - exports.file = fromFilePath; - function parse3(uri) { - return UriImpl.parse(uri); - } - exports.parse = parse3; - function normalizeDriveLetter(path16) { - return hasDriveLetter.test(path16) ? path16[0].toLowerCase() + path16.slice(1) : path16; - } - exports.normalizeDriveLetter = normalizeDriveLetter; - function isUrlLike2(url) { - return !!url && typeof url === "object" && typeof url.href === "string" || false; - } - function isUri(uri) { - if (!uri || typeof uri !== "object") - return false; - if (UriImpl.isUri(uri)) - return true; - if (vscode_uri_1.URI.isUri(uri)) - return true; - const u = uri; - return typeof u.path === "string" && typeof u.scheme === "string"; - } - exports.isUri = isUri; - function basename3(uri) { - return vscode_uri_1.Utils.basename(vscode_uri_1.URI.from(uri)); - } - exports.basename = basename3; - function dirname6(uri) { - return UriImpl.from(vscode_uri_1.Utils.dirname(vscode_uri_1.URI.from(uri))); - } - exports.dirname = dirname6; - function extname(uri) { - return vscode_uri_1.Utils.extname(vscode_uri_1.URI.from(uri)); - } - exports.extname = extname; - function joinPath(uri, ...paths) { - return UriImpl.from(vscode_uri_1.Utils.joinPath(vscode_uri_1.URI.from(uri), ...paths)); - } - exports.joinPath = joinPath; - function resolvePath2(uri, ...paths) { - return UriImpl.from(vscode_uri_1.Utils.resolvePath(vscode_uri_1.URI.from(uri), ...paths)); - } - exports.resolvePath = resolvePath2; - function from(uri, ...parts) { - return UriImpl.from(uri, ...parts); - } - exports.from = from; - var keys = ["scheme", "authority", "path", "query", "fragment"]; - var UriImpl = class _UriImpl { - constructor(uri) { - this.scheme = uri.scheme || ""; - uri.authority && (this.authority = uri.authority); - this.path = uri.path || ""; - uri.query && (this.query = uri.query); - uri.fragment && (this.fragment = uri.fragment); - } - toString() { - const path16 = this.path; - const base = `${this.scheme}://${this.authority || ""}${path16}`; - const query = this.query && `?${this.query}` || ""; - const fragment = this.fragment && `#${this.fragment}` || ""; - const url = base + query + fragment; - return encodeURI(url); - } - toJson() { - const { scheme, authority, path: path16, query, fragment } = this; - return { scheme, authority, path: path16, query, fragment }; - } - with(change) { - const { scheme, authority, path: path16, query, fragment } = this; - const u = { scheme, authority, path: path16, query, fragment }; - for (const key of keys) { - if (change[key] && typeof change[key] === "string") { - u[key] = change[key]; - } - } - return new _UriImpl(u); - } - static isUri(uri) { - return uri instanceof _UriImpl; - } - static from(uri, ...parts) { - let u = new _UriImpl(uri); - for (const part of parts) { - u = u.with(part); - } - return u; - } - static parse(uri) { - if (uri.startsWith(STDIN_PROTOCOL)) { - return _UriImpl.from(parseStdinUri(uri)); - } - const u = vscode_uri_1.URI.parse(uri); - return _UriImpl.from(u); - } - static file(filename) { - return _UriImpl.from(vscode_uri_1.URI.file(normalizeFilePath(filename))); - } - static stdin(filePath = "") { - return _UriImpl.from(_UriImpl.file(filePath), { scheme: "stdin" }); - } - }; - function normalizeFilePath(path16) { - return normalizeDriveLetter(path16.replace(/\\/g, "/")); - } - function parseStdinUri(uri) { - (0, assert_1.default)(uri.startsWith(STDIN_PROTOCOL)); - const idxSlash = STDIN_PROTOCOL.length; - let idxSlashEnd = idxSlash; - for (; uri[idxSlashEnd] === "/"; ++idxSlashEnd) { - } - const pathStart = idxSlashEnd; - const iH = uri.indexOf("#", pathStart); - const idxHash = iH > 0 ? iH : uri.length; - const iQ = uri.indexOf("?", pathStart); - const idxQ = iQ > 0 && iQ < idxHash ? iQ : idxHash; - const pathEnd = idxQ; - const path16 = uri.slice(pathStart, pathEnd); - const query = idxQ < idxHash ? uri.slice(idxQ + 1, idxHash) : ""; - const hash = uri.slice(idxHash + 1); - const pathPrefix = idxSlashEnd - idxSlash > 2 ? "/" : ""; - return { - scheme: "stdin", - path: pathPrefix + normalizeFilePath(decodeURI(path16)), - query: decodeURI(query), - fragment: decodeURI(hash) - }; - } - exports.__testing__ = { - UriImpl, - normalizeFilePath - }; - } -}); - -// node_modules/cspell-lib/dist/cjs/exclusionHelper.js -var require_exclusionHelper = __commonJS({ - "node_modules/cspell-lib/dist/cjs/exclusionHelper.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.generateExclusionFunctionForFiles = exports.generateExclusionFunctionForUri = exports.extractGlobsFromExcludeFilesGlobMap = void 0; - var cspell_glob_1 = require_cjs(); - var Uri_js_1 = require_Uri(); - var defaultAllowedSchemes = /* @__PURE__ */ new Set(["file", "untitled"]); - function extractGlobsFromExcludeFilesGlobMap(globMap) { - const globs = Object.getOwnPropertyNames(globMap).filter((glob2) => globMap[glob2]); - return globs; - } - exports.extractGlobsFromExcludeFilesGlobMap = extractGlobsFromExcludeFilesGlobMap; - var leadingGlobPattern = /^\*\*\/([^/*{}]+)$/; - function adjustGlobPatternForBackwardsCompatibility(g) { - return g.replace(leadingGlobPattern, "**/{$1,$1/**}"); - } - function adjustGlobPatternsForBackwardsCompatibility(globs) { - return globs.map((g) => { - if (typeof g === "string") { - return adjustGlobPatternForBackwardsCompatibility(g); - } - return { ...g, glob: adjustGlobPatternForBackwardsCompatibility(g.glob) }; - }); - } - function generateExclusionFunctionForUri(globs, root, allowedSchemes = defaultAllowedSchemes) { - const adjustedGlobs = adjustGlobPatternsForBackwardsCompatibility(globs); - const matchFn = generateExclusionFunctionForFiles(adjustedGlobs, root); - function testUri(uri) { - if (!allowedSchemes.has(uri.scheme)) { - return true; - } - return matchFn(uri.scheme === "file" || uri.scheme === "stdin" ? (0, Uri_js_1.uriToFilePath)(uri) : uri.path); - } - function testUriPath(uriPath) { - const uri = (0, Uri_js_1.toUri)(uriPath); - return testUri(uri); - } - return testUriPath; - } - exports.generateExclusionFunctionForUri = generateExclusionFunctionForUri; - function generateExclusionFunctionForFiles(globs, root) { - const matcher = new cspell_glob_1.GlobMatcher(globs, { root, dot: true }); - return (file) => matcher.match(file); - } - exports.generateExclusionFunctionForFiles = generateExclusionFunctionForFiles; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/util.js -var require_util = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isRecordEqual = exports.doSetsIntersect = exports.isArrayEqual = exports.asyncIterableToArray = exports.isDefined = exports.scanMap = exports.clean = exports.unique = exports.uniqueFilterFnGenerator = exports.uniqueFn = void 0; - exports.uniqueFn = uniqueFilterFnGenerator2; - function uniqueFilterFnGenerator2(extractFn) { - const values = /* @__PURE__ */ new Set(); - const extractor = extractFn || ((a) => a); - return (v) => { - const vv = extractor(v); - const ret = !values.has(vv); - values.add(vv); - return ret; - }; - } - exports.uniqueFilterFnGenerator = uniqueFilterFnGenerator2; - function unique(src) { - return [...new Set(src)]; - } - exports.unique = unique; - function clean2(src) { - const r = src; - for (const key of Object.keys(r)) { - if (r[key] === void 0 || r[key] === null) { - delete r[key]; - } - } - return r; - } - exports.clean = clean2; - function scanMap(accFn, init) { - let acc = init; - let first = true; - return function(value) { - if (first && acc === void 0) { - first = false; - acc = value; - return acc; - } - acc = accFn(acc, value); - return acc; - }; - } - exports.scanMap = scanMap; - function isDefined2(v) { - return v !== void 0; - } - exports.isDefined = isDefined2; - async function asyncIterableToArray2(iter) { - const acc = []; - for await (const t of iter) { - acc.push(t); - } - return acc; - } - exports.asyncIterableToArray = asyncIterableToArray2; - function isArrayEqual(a, b) { - if (a === b) - return true; - let isMatch = a.length === b.length; - for (let i = 0; i < a.length && isMatch; ++i) { - isMatch = a[i] === b[i]; - } - return isMatch; - } - exports.isArrayEqual = isArrayEqual; - function doSetsIntersect(a, b) { - function compare2(a2, b2) { - for (const item of a2) { - if (b2.has(item)) - return true; - } - return false; - } - return a.size <= b.size ? compare2(a, b) : compare2(b, a); - } - exports.doSetsIntersect = doSetsIntersect; - function isRecordEqual(a, b) { - if (a === b) - return true; - if (a === void 0 || b === void 0) - return false; - for (const key of Object.keys(a)) { - if (a[key] !== b[key]) - return false; - } - for (const key of Object.keys(b)) { - if (a[key] !== b[key]) - return false; - } - return true; - } - exports.isRecordEqual = isRecordEqual; + exports.Utils = exports.URI = void 0; + var vscodeUriPkg = __importStar(require_umd()); + exports.URI = vscodeUriPkg.URI, exports.Utils = vscodeUriPkg.Utils; } }); @@ -13733,7 +13024,7 @@ var require_esprima = __commonJS({ var jsx_parser_1 = __webpack_require__(3); var parser_1 = __webpack_require__(8); var tokenizer_1 = __webpack_require__(15); - function parse3(code, options, delegate) { + function parse4(code, options, delegate) { var commentHandler = null; var proxyDelegate = function(node, metadata) { if (delegate) { @@ -13759,36 +13050,36 @@ var require_esprima = __commonJS({ if (options && typeof options.sourceType === "string") { isModule = options.sourceType === "module"; } - var parser; + var parser2; if (options && typeof options.jsx === "boolean" && options.jsx) { - parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); + parser2 = new jsx_parser_1.JSXParser(code, options, parserDelegate); } else { - parser = new parser_1.Parser(code, options, parserDelegate); + parser2 = new parser_1.Parser(code, options, parserDelegate); } - var program = isModule ? parser.parseModule() : parser.parseScript(); + var program = isModule ? parser2.parseModule() : parser2.parseScript(); var ast = program; if (collectComment && commentHandler) { ast.comments = commentHandler.comments; } - if (parser.config.tokens) { - ast.tokens = parser.tokens; + if (parser2.config.tokens) { + ast.tokens = parser2.tokens; } - if (parser.config.tolerant) { - ast.errors = parser.errorHandler.errors; + if (parser2.config.tolerant) { + ast.errors = parser2.errorHandler.errors; } return ast; } - exports2.parse = parse3; + exports2.parse = parse4; function parseModule(code, options, delegate) { var parsingOptions = options || {}; parsingOptions.sourceType = "module"; - return parse3(code, parsingOptions, delegate); + return parse4(code, parsingOptions, delegate); } exports2.parseModule = parseModule; function parseScript(code, options, delegate) { var parsingOptions = options || {}; parsingOptions.sourceType = "script"; - return parse3(code, parsingOptions, delegate); + return parse4(code, parsingOptions, delegate); } exports2.parseScript = parseScript; function tokenize(code, options, delegate) { @@ -13884,8 +13175,8 @@ var require_esprima = __commonJS({ } } if (target) { - var count = target.leadingComments ? target.leadingComments.length : 0; - for (var i = count - 1; i >= 0; --i) { + var count3 = target.leadingComments ? target.leadingComments.length : 0; + for (var i = count3 - 1; i >= 0; --i) { var comment = target.leadingComments[i]; if (comment.range[1] <= metadata.start.offset) { leadingComments.unshift(comment); @@ -14065,7 +13356,7 @@ var require_esprima = __commonJS({ var character_1 = __webpack_require__(4); var JSXNode = __webpack_require__(5); var jsx_syntax_1 = __webpack_require__(6); - var Node = __webpack_require__(7); + var Node2 = __webpack_require__(7); var parser_1 = __webpack_require__(8); var token_1 = __webpack_require__(13); var xhtml_entities_1 = __webpack_require__(14); @@ -14381,7 +13672,7 @@ var require_esprima = __commonJS({ this.throwUnexpectedToken(token); } var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); + return this.finalize(node, new Node2.Literal(token.value, raw)); }; JSXParser2.prototype.parseJSXExpressionAttribute = function() { var node = this.createJSXNode(); @@ -15407,7 +14698,7 @@ var require_esprima = __commonJS({ var assert_1 = __webpack_require__(9); var error_handler_1 = __webpack_require__(10); var messages_1 = __webpack_require__(11); - var Node = __webpack_require__(7); + var Node2 = __webpack_require__(7); var scanner_1 = __webpack_require__(12); var syntax_1 = __webpack_require__(2); var token_1 = __webpack_require__(13); @@ -15509,9 +14800,9 @@ var require_esprima = __commonJS({ values[_i - 1] = arguments[_i]; } var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) { - assert_1.assert(idx < args.length, "Message reference must be in range"); - return args[idx]; + var msg = messageFormat.replace(/%(\d)/g, function(whole, idx2) { + assert_1.assert(idx2 < args.length, "Message reference must be in range"); + return args[idx2]; }); var index = this.lastMarker.index; var line = this.lastMarker.line; @@ -15524,9 +14815,9 @@ var require_esprima = __commonJS({ values[_i - 1] = arguments[_i]; } var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) { - assert_1.assert(idx < args.length, "Message reference must be in range"); - return args[idx]; + var msg = messageFormat.replace(/%(\d)/g, function(whole, idx2) { + assert_1.assert(idx2 < args.length, "Message reference must be in range"); + return args[idx2]; }); var index = this.lastMarker.index; var line = this.scanner.lineNumber; @@ -15824,7 +15115,7 @@ var require_esprima = __commonJS({ if ((this.context.isModule || this.context.await) && this.lookahead.value === "await") { this.tolerateUnexpectedToken(this.lookahead); } - expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); + expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node2.Identifier(this.nextToken().value)); break; case 6: case 8: @@ -15835,21 +15126,21 @@ var require_esprima = __commonJS({ this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value, raw)); + expr = this.finalize(node, new Node2.Literal(token.value, raw)); break; case 1: this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value === "true", raw)); + expr = this.finalize(node, new Node2.Literal(token.value === "true", raw)); break; case 5: this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(null, raw)); + expr = this.finalize(node, new Node2.Literal(null, raw)); break; case 10: expr = this.parseTemplateLiteral(); @@ -15873,7 +15164,7 @@ var require_esprima = __commonJS({ this.scanner.index = this.startMarker.index; token = this.nextRegexToken(); raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); + expr = this.finalize(node, new Node2.RegexLiteral(token.regex, raw, token.pattern, token.flags)); break; default: expr = this.throwUnexpectedToken(this.nextToken()); @@ -15883,7 +15174,7 @@ var require_esprima = __commonJS({ if (!this.context.strict && this.context.allowYield && this.matchKeyword("yield")) { expr = this.parseIdentifierName(); } else if (!this.context.strict && this.matchKeyword("let")) { - expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); + expr = this.finalize(node, new Node2.Identifier(this.nextToken().value)); } else { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; @@ -15891,7 +15182,7 @@ var require_esprima = __commonJS({ expr = this.parseFunctionExpression(); } else if (this.matchKeyword("this")) { this.nextToken(); - expr = this.finalize(node, new Node.ThisExpression()); + expr = this.finalize(node, new Node2.ThisExpression()); } else if (this.matchKeyword("class")) { expr = this.parseClassExpression(); } else { @@ -15908,7 +15199,7 @@ var require_esprima = __commonJS({ var node = this.createNode(); this.expect("..."); var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); - return this.finalize(node, new Node.SpreadElement(arg)); + return this.finalize(node, new Node2.SpreadElement(arg)); }; Parser2.prototype.parseArrayInitializer = function() { var node = this.createNode(); @@ -15934,7 +15225,7 @@ var require_esprima = __commonJS({ } } this.expect("]"); - return this.finalize(node, new Node.ArrayExpression(elements)); + return this.finalize(node, new Node2.ArrayExpression(elements)); }; Parser2.prototype.parsePropertyMethod = function(params) { this.context.isAssignmentTarget = false; @@ -15961,7 +15252,7 @@ var require_esprima = __commonJS({ var params = this.parseFormalParameters(); var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + return this.finalize(node, new Node2.FunctionExpression(null, params.params, method, isGenerator)); }; Parser2.prototype.parsePropertyMethodAsyncFunction = function() { var node = this.createNode(); @@ -15973,7 +15264,7 @@ var require_esprima = __commonJS({ var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; this.context.await = previousAwait; - return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); + return this.finalize(node, new Node2.AsyncFunctionExpression(null, params.params, method)); }; Parser2.prototype.parseObjectPropertyKey = function() { var node = this.createNode(); @@ -15986,13 +15277,13 @@ var require_esprima = __commonJS({ this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); } var raw = this.getTokenRaw(token); - key = this.finalize(node, new Node.Literal(token.value, raw)); + key = this.finalize(node, new Node2.Literal(token.value, raw)); break; case 3: case 1: case 5: case 4: - key = this.finalize(node, new Node.Identifier(token.value)); + key = this.finalize(node, new Node2.Identifier(token.value)); break; case 7: if (token.value === "[") { @@ -16025,7 +15316,7 @@ var require_esprima = __commonJS({ this.nextToken(); computed = this.match("["); isAsync = !this.hasLineTerminator && id === "async" && !this.match(":") && !this.match("(") && !this.match("*") && !this.match(","); - key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); + key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node2.Identifier(id)); } else if (this.match("*")) { this.nextToken(); } else { @@ -16068,13 +15359,13 @@ var require_esprima = __commonJS({ value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); method = true; } else if (token.type === 3) { - var id = this.finalize(node, new Node.Identifier(token.value)); + var id = this.finalize(node, new Node2.Identifier(token.value)); if (this.match("=")) { this.context.firstCoverInitializedNameError = this.lookahead; this.nextToken(); shorthand = true; var init = this.isolateCoverGrammar(this.parseAssignmentExpression); - value = this.finalize(node, new Node.AssignmentPattern(id, init)); + value = this.finalize(node, new Node2.AssignmentPattern(id, init)); } else { shorthand = true; value = id; @@ -16083,7 +15374,7 @@ var require_esprima = __commonJS({ this.throwUnexpectedToken(this.nextToken()); } } - return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); + return this.finalize(node, new Node2.Property(kind, key, computed, value, method, shorthand)); }; Parser2.prototype.parseObjectInitializer = function() { var node = this.createNode(); @@ -16097,7 +15388,7 @@ var require_esprima = __commonJS({ } } this.expect("}"); - return this.finalize(node, new Node.ObjectExpression(properties)); + return this.finalize(node, new Node2.ObjectExpression(properties)); }; Parser2.prototype.parseTemplateHead = function() { assert_1.assert(this.lookahead.head, "Template literal must start with a template head"); @@ -16105,7 +15396,7 @@ var require_esprima = __commonJS({ var token = this.nextToken(); var raw = token.value; var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw, cooked }, token.tail)); + return this.finalize(node, new Node2.TemplateElement({ raw, cooked }, token.tail)); }; Parser2.prototype.parseTemplateElement = function() { if (this.lookahead.type !== 10) { @@ -16115,7 +15406,7 @@ var require_esprima = __commonJS({ var token = this.nextToken(); var raw = token.value; var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw, cooked }, token.tail)); + return this.finalize(node, new Node2.TemplateElement({ raw, cooked }, token.tail)); }; Parser2.prototype.parseTemplateLiteral = function() { var node = this.createNode(); @@ -16128,7 +15419,7 @@ var require_esprima = __commonJS({ quasi = this.parseTemplateElement(); quasis.push(quasi); } - return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); + return this.finalize(node, new Node2.TemplateLiteral(quasis, expressions)); }; Parser2.prototype.reinterpretExpressionAsPattern = function(expr) { switch (expr.type) { @@ -16242,7 +15533,7 @@ var require_esprima = __commonJS({ } } if (!arrow) { - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + expr = this.finalize(this.startNode(startToken), new Node2.SequenceExpression(expressions)); } } if (!arrow) { @@ -16309,7 +15600,7 @@ var require_esprima = __commonJS({ if (!this.isIdentifierName(token)) { this.throwUnexpectedToken(token); } - return this.finalize(node, new Node.Identifier(token.value)); + return this.finalize(node, new Node2.Identifier(token.value)); }; Parser2.prototype.parseNewExpression = function() { var node = this.createNode(); @@ -16320,14 +15611,14 @@ var require_esprima = __commonJS({ this.nextToken(); if (this.lookahead.type === 3 && this.context.inFunctionBody && this.lookahead.value === "target") { var property = this.parseIdentifierName(); - expr = new Node.MetaProperty(id, property); + expr = new Node2.MetaProperty(id, property); } else { this.throwUnexpectedToken(this.lookahead); } } else { var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); var args = this.match("(") ? this.parseArguments() : []; - expr = new Node.NewExpression(callee, args); + expr = new Node2.NewExpression(callee, args); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } @@ -16366,7 +15657,7 @@ var require_esprima = __commonJS({ if (this.matchKeyword("super") && this.context.inFunctionBody) { expr = this.createNode(); this.nextToken(); - expr = this.finalize(expr, new Node.Super()); + expr = this.finalize(expr, new Node2.Super()); if (!this.match("(") && !this.match(".") && !this.match("[")) { this.throwUnexpectedToken(this.lookahead); } @@ -16379,13 +15670,13 @@ var require_esprima = __commonJS({ this.context.isAssignmentTarget = true; this.expect("."); var property = this.parseIdentifierName(); - expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); + expr = this.finalize(this.startNode(startToken), new Node2.StaticMemberExpression(expr, property)); } else if (this.match("(")) { var asyncArrow = maybeAsync && startToken.lineNumber === this.lookahead.lineNumber; this.context.isBindingElement = false; this.context.isAssignmentTarget = false; var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); - expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); + expr = this.finalize(this.startNode(startToken), new Node2.CallExpression(expr, args)); if (asyncArrow && this.match("=>")) { for (var i = 0; i < args.length; ++i) { this.reinterpretExpressionAsPattern(args[i]); @@ -16402,10 +15693,10 @@ var require_esprima = __commonJS({ this.expect("["); var property = this.isolateCoverGrammar(this.parseExpression); this.expect("]"); - expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); + expr = this.finalize(this.startNode(startToken), new Node2.ComputedMemberExpression(expr, property)); } else if (this.lookahead.type === 10 && this.lookahead.head) { var quasi = this.parseTemplateLiteral(); - expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); + expr = this.finalize(this.startNode(startToken), new Node2.TaggedTemplateExpression(expr, quasi)); } else { break; } @@ -16419,7 +15710,7 @@ var require_esprima = __commonJS({ if (!this.match("[") && !this.match(".")) { this.throwUnexpectedToken(this.lookahead); } - return this.finalize(node, new Node.Super()); + return this.finalize(node, new Node2.Super()); }; Parser2.prototype.parseLeftHandSideExpression = function() { assert_1.assert(this.context.allowIn, "callee of new expression always allow in keyword."); @@ -16432,16 +15723,16 @@ var require_esprima = __commonJS({ this.expect("["); var property = this.isolateCoverGrammar(this.parseExpression); this.expect("]"); - expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); + expr = this.finalize(node, new Node2.ComputedMemberExpression(expr, property)); } else if (this.match(".")) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect("."); var property = this.parseIdentifierName(); - expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); + expr = this.finalize(node, new Node2.StaticMemberExpression(expr, property)); } else if (this.lookahead.type === 10 && this.lookahead.head) { var quasi = this.parseTemplateLiteral(); - expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); + expr = this.finalize(node, new Node2.TaggedTemplateExpression(expr, quasi)); } else { break; } @@ -16462,7 +15753,7 @@ var require_esprima = __commonJS({ this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); } var prefix = true; - expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); + expr = this.finalize(node, new Node2.UpdateExpression(token.value, expr, prefix)); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } else { @@ -16479,7 +15770,7 @@ var require_esprima = __commonJS({ this.context.isBindingElement = false; var operator = this.nextToken().value; var prefix = false; - expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); + expr = this.finalize(this.startNode(startToken), new Node2.UpdateExpression(operator, expr, prefix)); } } } @@ -16489,7 +15780,7 @@ var require_esprima = __commonJS({ var node = this.createNode(); this.nextToken(); var argument = this.parseUnaryExpression(); - return this.finalize(node, new Node.AwaitExpression(argument)); + return this.finalize(node, new Node2.AwaitExpression(argument)); }; Parser2.prototype.parseUnaryExpression = function() { var expr; @@ -16497,7 +15788,7 @@ var require_esprima = __commonJS({ var node = this.startNode(this.lookahead); var token = this.nextToken(); expr = this.inheritCoverGrammar(this.parseUnaryExpression); - expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); + expr = this.finalize(node, new Node2.UnaryExpression(token.value, expr)); if (this.context.strict && expr.operator === "delete" && expr.argument.type === syntax_1.Syntax.Identifier) { this.tolerateError(messages_1.Messages.StrictDelete); } @@ -16519,7 +15810,7 @@ var require_esprima = __commonJS({ this.context.isBindingElement = false; var left = expr; var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression("**", left, right)); + expr = this.finalize(this.startNode(startToken), new Node2.BinaryExpression("**", left, right)); } return expr; }; @@ -16561,7 +15852,7 @@ var require_esprima = __commonJS({ left = stack.pop(); markers.pop(); var node = this.startNode(markers[markers.length - 1]); - stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); + stack.push(this.finalize(node, new Node2.BinaryExpression(operator, left, right))); } stack.push(this.nextToken().value); precedences.push(prec); @@ -16576,7 +15867,7 @@ var require_esprima = __commonJS({ var lastLineStart = lastMarker && lastMarker.lineStart; var node = this.startNode(marker, lastLineStart); var operator = stack[i - 1]; - expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); + expr = this.finalize(node, new Node2.BinaryExpression(operator, stack[i - 2], expr)); i -= 2; lastMarker = marker; } @@ -16594,7 +15885,7 @@ var require_esprima = __commonJS({ this.context.allowIn = previousAllowIn; this.expect(":"); var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); + expr = this.finalize(this.startNode(startToken), new Node2.ConditionalExpression(expr, consequent, alternate)); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } @@ -16626,7 +15917,7 @@ var require_esprima = __commonJS({ default: break; } - options.simple = options.simple && param instanceof Node.Identifier; + options.simple = options.simple && param instanceof Node2.Identifier; }; Parser2.prototype.reinterpretAsCoverFormalsList = function(expr) { var params = [expr]; @@ -16738,7 +16029,7 @@ var require_esprima = __commonJS({ if (this.context.strict && list.stricted) { this.tolerateUnexpectedToken(list.stricted, list.message); } - expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); + expr = isAsync ? this.finalize(node, new Node2.AsyncArrowFunctionExpression(list.params, body, expression)) : this.finalize(node, new Node2.ArrowFunctionExpression(list.params, body, expression)); this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; this.context.allowYield = previousAllowYield; @@ -16767,7 +16058,7 @@ var require_esprima = __commonJS({ token = this.nextToken(); var operator = token.value; var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); + expr = this.finalize(this.startNode(startToken), new Node2.AssignmentExpression(operator, expr, right)); this.context.firstCoverInitializedNameError = null; } } @@ -16787,7 +16078,7 @@ var require_esprima = __commonJS({ this.nextToken(); expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); } - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + expr = this.finalize(this.startNode(startToken), new Node2.SequenceExpression(expressions)); } return expr; }; @@ -16841,7 +16132,7 @@ var require_esprima = __commonJS({ block.push(this.parseStatementListItem()); } this.expect("}"); - return this.finalize(node, new Node.BlockStatement(block)); + return this.finalize(node, new Node2.BlockStatement(block)); }; Parser2.prototype.parseLexicalBinding = function(kind, options) { var node = this.createNode(); @@ -16866,7 +16157,7 @@ var require_esprima = __commonJS({ this.expect("="); init = this.isolateCoverGrammar(this.parseAssignmentExpression); } - return this.finalize(node, new Node.VariableDeclarator(id, init)); + return this.finalize(node, new Node2.VariableDeclarator(id, init)); }; Parser2.prototype.parseBindingList = function(kind, options) { var list = [this.parseLexicalBinding(kind, options)]; @@ -16889,13 +16180,13 @@ var require_esprima = __commonJS({ assert_1.assert(kind === "let" || kind === "const", "Lexical declaration must be either let or const"); var declarations = this.parseBindingList(kind, options); this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); + return this.finalize(node, new Node2.VariableDeclaration(declarations, kind)); }; Parser2.prototype.parseBindingRestElement = function(params, kind) { var node = this.createNode(); this.expect("..."); var arg = this.parsePattern(params, kind); - return this.finalize(node, new Node.RestElement(arg)); + return this.finalize(node, new Node2.RestElement(arg)); }; Parser2.prototype.parseArrayPattern = function(params, kind) { var node = this.createNode(); @@ -16918,7 +16209,7 @@ var require_esprima = __commonJS({ } } this.expect("]"); - return this.finalize(node, new Node.ArrayPattern(elements)); + return this.finalize(node, new Node2.ArrayPattern(elements)); }; Parser2.prototype.parsePropertyPattern = function(params, kind) { var node = this.createNode(); @@ -16930,13 +16221,13 @@ var require_esprima = __commonJS({ if (this.lookahead.type === 3) { var keyToken = this.lookahead; key = this.parseVariableIdentifier(); - var init = this.finalize(node, new Node.Identifier(keyToken.value)); + var init = this.finalize(node, new Node2.Identifier(keyToken.value)); if (this.match("=")) { params.push(keyToken); shorthand = true; this.nextToken(); var expr = this.parseAssignmentExpression(); - value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); + value = this.finalize(this.startNode(keyToken), new Node2.AssignmentPattern(init, expr)); } else if (!this.match(":")) { params.push(keyToken); shorthand = true; @@ -16951,7 +16242,7 @@ var require_esprima = __commonJS({ this.expect(":"); value = this.parsePatternWithDefault(params, kind); } - return this.finalize(node, new Node.Property("init", key, computed, value, method, shorthand)); + return this.finalize(node, new Node2.Property("init", key, computed, value, method, shorthand)); }; Parser2.prototype.parseObjectPattern = function(params, kind) { var node = this.createNode(); @@ -16964,7 +16255,7 @@ var require_esprima = __commonJS({ } } this.expect("}"); - return this.finalize(node, new Node.ObjectPattern(properties)); + return this.finalize(node, new Node2.ObjectPattern(properties)); }; Parser2.prototype.parsePattern = function(params, kind) { var pattern; @@ -16990,7 +16281,7 @@ var require_esprima = __commonJS({ this.context.allowYield = true; var right = this.isolateCoverGrammar(this.parseAssignmentExpression); this.context.allowYield = previousAllowYield; - pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); + pattern = this.finalize(this.startNode(startToken), new Node2.AssignmentPattern(pattern, right)); } return pattern; }; @@ -17014,7 +16305,7 @@ var require_esprima = __commonJS({ } else if ((this.context.isModule || this.context.await) && token.type === 3 && token.value === "await") { this.tolerateUnexpectedToken(token); } - return this.finalize(node, new Node.Identifier(token.value)); + return this.finalize(node, new Node2.Identifier(token.value)); }; Parser2.prototype.parseVariableDeclaration = function(options) { var node = this.createNode(); @@ -17032,7 +16323,7 @@ var require_esprima = __commonJS({ } else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { this.expect("="); } - return this.finalize(node, new Node.VariableDeclarator(id, init)); + return this.finalize(node, new Node2.VariableDeclarator(id, init)); }; Parser2.prototype.parseVariableDeclarationList = function(options) { var opt = { inFor: options.inFor }; @@ -17049,18 +16340,18 @@ var require_esprima = __commonJS({ this.expectKeyword("var"); var declarations = this.parseVariableDeclarationList({ inFor: false }); this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, "var")); + return this.finalize(node, new Node2.VariableDeclaration(declarations, "var")); }; Parser2.prototype.parseEmptyStatement = function() { var node = this.createNode(); this.expect(";"); - return this.finalize(node, new Node.EmptyStatement()); + return this.finalize(node, new Node2.EmptyStatement()); }; Parser2.prototype.parseExpressionStatement = function() { var node = this.createNode(); var expr = this.parseExpression(); this.consumeSemicolon(); - return this.finalize(node, new Node.ExpressionStatement(expr)); + return this.finalize(node, new Node2.ExpressionStatement(expr)); }; Parser2.prototype.parseIfClause = function() { if (this.context.strict && this.matchKeyword("function")) { @@ -17077,7 +16368,7 @@ var require_esprima = __commonJS({ var test = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); - consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); + consequent = this.finalize(this.createNode(), new Node2.EmptyStatement()); } else { this.expect(")"); consequent = this.parseIfClause(); @@ -17086,7 +16377,7 @@ var require_esprima = __commonJS({ alternate = this.parseIfClause(); } } - return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); + return this.finalize(node, new Node2.IfStatement(test, consequent, alternate)); }; Parser2.prototype.parseDoWhileStatement = function() { var node = this.createNode(); @@ -17106,7 +16397,7 @@ var require_esprima = __commonJS({ this.nextToken(); } } - return this.finalize(node, new Node.DoWhileStatement(body, test)); + return this.finalize(node, new Node2.DoWhileStatement(body, test)); }; Parser2.prototype.parseWhileStatement = function() { var node = this.createNode(); @@ -17116,7 +16407,7 @@ var require_esprima = __commonJS({ var test = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); + body = this.finalize(this.createNode(), new Node2.EmptyStatement()); } else { this.expect(")"); var previousInIteration = this.context.inIteration; @@ -17124,7 +16415,7 @@ var require_esprima = __commonJS({ body = this.parseStatement(); this.context.inIteration = previousInIteration; } - return this.finalize(node, new Node.WhileStatement(test, body)); + return this.finalize(node, new Node2.WhileStatement(test, body)); }; Parser2.prototype.parseForStatement = function() { var init = null; @@ -17150,27 +16441,27 @@ var require_esprima = __commonJS({ if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in"); } - init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, "var")); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, "var")); this.nextToken(); left = init; right = this.parseAssignmentExpression(); init = null; forIn = false; } else { - init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, "var")); this.expect(";"); } } else if (this.matchKeyword("const") || this.matchKeyword("let")) { init = this.createNode(); var kind = this.nextToken().value; if (!this.context.strict && this.lookahead.value === "in") { - init = this.finalize(init, new Node.Identifier(kind)); + init = this.finalize(init, new Node2.Identifier(kind)); this.nextToken(); left = init; right = this.parseExpression(); @@ -17181,13 +16472,13 @@ var require_esprima = __commonJS({ var declarations = this.parseBindingList(kind, { inFor: true }); this.context.allowIn = previousAllowIn; if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, kind)); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, kind)); this.nextToken(); left = init; right = this.parseAssignmentExpression(); @@ -17195,7 +16486,7 @@ var require_esprima = __commonJS({ forIn = false; } else { this.consumeSemicolon(); - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, kind)); } } } else { @@ -17230,7 +16521,7 @@ var require_esprima = __commonJS({ this.nextToken(); initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); } - init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); + init = this.finalize(this.startNode(initStartToken), new Node2.SequenceExpression(initSeq)); } this.expect(";"); } @@ -17248,7 +16539,7 @@ var require_esprima = __commonJS({ var body; if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); + body = this.finalize(this.createNode(), new Node2.EmptyStatement()); } else { this.expect(")"); var previousInIteration = this.context.inIteration; @@ -17256,7 +16547,7 @@ var require_esprima = __commonJS({ body = this.isolateCoverGrammar(this.parseStatement); this.context.inIteration = previousInIteration; } - return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body)); + return typeof left === "undefined" ? this.finalize(node, new Node2.ForStatement(init, test, update, body)) : forIn ? this.finalize(node, new Node2.ForInStatement(left, right, body)) : this.finalize(node, new Node2.ForOfStatement(left, right, body)); }; Parser2.prototype.parseContinueStatement = function() { var node = this.createNode(); @@ -17274,7 +16565,7 @@ var require_esprima = __commonJS({ if (label === null && !this.context.inIteration) { this.throwError(messages_1.Messages.IllegalContinue); } - return this.finalize(node, new Node.ContinueStatement(label)); + return this.finalize(node, new Node2.ContinueStatement(label)); }; Parser2.prototype.parseBreakStatement = function() { var node = this.createNode(); @@ -17292,7 +16583,7 @@ var require_esprima = __commonJS({ if (label === null && !this.context.inIteration && !this.context.inSwitch) { this.throwError(messages_1.Messages.IllegalBreak); } - return this.finalize(node, new Node.BreakStatement(label)); + return this.finalize(node, new Node2.BreakStatement(label)); }; Parser2.prototype.parseReturnStatement = function() { if (!this.context.inFunctionBody) { @@ -17303,7 +16594,7 @@ var require_esprima = __commonJS({ var hasArgument = !this.match(";") && !this.match("}") && !this.hasLineTerminator && this.lookahead.type !== 2 || this.lookahead.type === 8 || this.lookahead.type === 10; var argument = hasArgument ? this.parseExpression() : null; this.consumeSemicolon(); - return this.finalize(node, new Node.ReturnStatement(argument)); + return this.finalize(node, new Node2.ReturnStatement(argument)); }; Parser2.prototype.parseWithStatement = function() { if (this.context.strict) { @@ -17316,12 +16607,12 @@ var require_esprima = __commonJS({ var object = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); + body = this.finalize(this.createNode(), new Node2.EmptyStatement()); } else { this.expect(")"); body = this.parseStatement(); } - return this.finalize(node, new Node.WithStatement(object, body)); + return this.finalize(node, new Node2.WithStatement(object, body)); }; Parser2.prototype.parseSwitchCase = function() { var node = this.createNode(); @@ -17341,7 +16632,7 @@ var require_esprima = __commonJS({ } consequent.push(this.parseStatementListItem()); } - return this.finalize(node, new Node.SwitchCase(test, consequent)); + return this.finalize(node, new Node2.SwitchCase(test, consequent)); }; Parser2.prototype.parseSwitchStatement = function() { var node = this.createNode(); @@ -17369,7 +16660,7 @@ var require_esprima = __commonJS({ } this.expect("}"); this.context.inSwitch = previousInSwitch; - return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); + return this.finalize(node, new Node2.SwitchStatement(discriminant, cases)); }; Parser2.prototype.parseLabelledStatement = function() { var node = this.createNode(); @@ -17400,10 +16691,10 @@ var require_esprima = __commonJS({ body = this.parseStatement(); } delete this.context.labelSet[key]; - statement = new Node.LabeledStatement(id, body); + statement = new Node2.LabeledStatement(id, body); } else { this.consumeSemicolon(); - statement = new Node.ExpressionStatement(expr); + statement = new Node2.ExpressionStatement(expr); } return this.finalize(node, statement); }; @@ -17415,7 +16706,7 @@ var require_esprima = __commonJS({ } var argument = this.parseExpression(); this.consumeSemicolon(); - return this.finalize(node, new Node.ThrowStatement(argument)); + return this.finalize(node, new Node2.ThrowStatement(argument)); }; Parser2.prototype.parseCatchClause = function() { var node = this.createNode(); @@ -17441,7 +16732,7 @@ var require_esprima = __commonJS({ } this.expect(")"); var body = this.parseBlock(); - return this.finalize(node, new Node.CatchClause(param, body)); + return this.finalize(node, new Node2.CatchClause(param, body)); }; Parser2.prototype.parseFinallyClause = function() { this.expectKeyword("finally"); @@ -17456,13 +16747,13 @@ var require_esprima = __commonJS({ if (!handler && !finalizer) { this.throwError(messages_1.Messages.NoCatchOrFinally); } - return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); + return this.finalize(node, new Node2.TryStatement(block, handler, finalizer)); }; Parser2.prototype.parseDebuggerStatement = function() { var node = this.createNode(); this.expectKeyword("debugger"); this.consumeSemicolon(); - return this.finalize(node, new Node.DebuggerStatement()); + return this.finalize(node, new Node2.DebuggerStatement()); }; Parser2.prototype.parseStatement = function() { var statement; @@ -17567,7 +16858,7 @@ var require_esprima = __commonJS({ this.context.inIteration = previousInIteration; this.context.inSwitch = previousInSwitch; this.context.inFunctionBody = previousInFunctionBody; - return this.finalize(node, new Node.BlockStatement(body)); + return this.finalize(node, new Node2.BlockStatement(body)); }; Parser2.prototype.validateParam = function(options, param, name) { var key = "$" + name; @@ -17608,7 +16899,7 @@ var require_esprima = __commonJS({ if (!this.match(")")) { this.throwError(messages_1.Messages.ParameterAfterRestParameter); } - return this.finalize(node, new Node.RestElement(arg)); + return this.finalize(node, new Node2.RestElement(arg)); }; Parser2.prototype.parseFormalParameter = function(options) { var params = []; @@ -17616,7 +16907,7 @@ var require_esprima = __commonJS({ for (var i = 0; i < params.length; i++) { this.validateParam(options, params[i], params[i].value); } - options.simple = options.simple && param instanceof Node.Identifier; + options.simple = options.simple && param instanceof Node2.Identifier; options.params.push(param); }; Parser2.prototype.parseFormalParameters = function(firstRestricted) { @@ -17650,15 +16941,15 @@ var require_esprima = __commonJS({ }; }; Parser2.prototype.matchAsyncFunction = function() { - var match = this.matchContextualKeyword("async"); - if (match) { + var match2 = this.matchContextualKeyword("async"); + if (match2) { var state = this.scanner.saveState(); this.scanner.scanComments(); var next = this.scanner.lex(); this.scanner.restoreState(state); - match = state.lineNumber === next.lineNumber && next.type === 4 && next.value === "function"; + match2 = state.lineNumber === next.lineNumber && next.type === 4 && next.value === "function"; } - return match; + return match2; }; Parser2.prototype.parseFunctionDeclaration = function(identifierIsOptional) { var node = this.createNode(); @@ -17716,7 +17007,7 @@ var require_esprima = __commonJS({ this.context.allowStrictDirective = previousAllowStrictDirective; this.context.await = previousAllowAwait; this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); + return isAsync ? this.finalize(node, new Node2.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node, new Node2.FunctionDeclaration(id, params, body, isGenerator)); }; Parser2.prototype.parseFunctionExpression = function() { var node = this.createNode(); @@ -17774,7 +17065,7 @@ var require_esprima = __commonJS({ this.context.allowStrictDirective = previousAllowStrictDirective; this.context.await = previousAllowAwait; this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); + return isAsync ? this.finalize(node, new Node2.AsyncFunctionExpression(id, params, body)) : this.finalize(node, new Node2.FunctionExpression(id, params, body, isGenerator)); }; Parser2.prototype.parseDirective = function() { var token = this.lookahead; @@ -17782,7 +17073,7 @@ var require_esprima = __commonJS({ var expr = this.parseExpression(); var directive = expr.type === syntax_1.Syntax.Literal ? this.getTokenRaw(token).slice(1, -1) : null; this.consumeSemicolon(); - return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); + return this.finalize(node, directive ? new Node2.Directive(expr, directive) : new Node2.ExpressionStatement(expr)); }; Parser2.prototype.parseDirectivePrologues = function() { var firstRestricted = null; @@ -17841,7 +17132,7 @@ var require_esprima = __commonJS({ } var method = this.parsePropertyMethod(formalParameters); this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + return this.finalize(node, new Node2.FunctionExpression(null, formalParameters.params, method, isGenerator)); }; Parser2.prototype.parseSetterMethod = function() { var node = this.createNode(); @@ -17851,12 +17142,12 @@ var require_esprima = __commonJS({ var formalParameters = this.parseFormalParameters(); if (formalParameters.params.length !== 1) { this.tolerateError(messages_1.Messages.BadSetterArity); - } else if (formalParameters.params[0] instanceof Node.RestElement) { + } else if (formalParameters.params[0] instanceof Node2.RestElement) { this.tolerateError(messages_1.Messages.BadSetterRestParameter); } var method = this.parsePropertyMethod(formalParameters); this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + return this.finalize(node, new Node2.FunctionExpression(null, formalParameters.params, method, isGenerator)); }; Parser2.prototype.parseGeneratorMethod = function() { var node = this.createNode(); @@ -17867,7 +17158,7 @@ var require_esprima = __commonJS({ this.context.allowYield = false; var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + return this.finalize(node, new Node2.FunctionExpression(null, params.params, method, isGenerator)); }; Parser2.prototype.isStartOfExpression = function() { var start = true; @@ -17901,7 +17192,7 @@ var require_esprima = __commonJS({ } this.context.allowYield = previousAllowYield; } - return this.finalize(node, new Node.YieldExpression(argument, delegate)); + return this.finalize(node, new Node2.YieldExpression(argument, delegate)); }; Parser2.prototype.parseClassElement = function(hasConstructor) { var token = this.lookahead; @@ -17989,7 +17280,7 @@ var require_esprima = __commonJS({ kind = "constructor"; } } - return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); + return this.finalize(node, new Node2.MethodDefinition(key, computed, value, kind, isStatic)); }; Parser2.prototype.parseClassElementList = function() { var body = []; @@ -18008,7 +17299,7 @@ var require_esprima = __commonJS({ Parser2.prototype.parseClassBody = function() { var node = this.createNode(); var elementList = this.parseClassElementList(); - return this.finalize(node, new Node.ClassBody(elementList)); + return this.finalize(node, new Node2.ClassBody(elementList)); }; Parser2.prototype.parseClassDeclaration = function(identifierIsOptional) { var node = this.createNode(); @@ -18023,7 +17314,7 @@ var require_esprima = __commonJS({ } var classBody = this.parseClassBody(); this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); + return this.finalize(node, new Node2.ClassDeclaration(id, superClass, classBody)); }; Parser2.prototype.parseClassExpression = function() { var node = this.createNode(); @@ -18038,7 +17329,7 @@ var require_esprima = __commonJS({ } var classBody = this.parseClassBody(); this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); + return this.finalize(node, new Node2.ClassExpression(id, superClass, classBody)); }; Parser2.prototype.parseModule = function() { this.context.strict = true; @@ -18049,7 +17340,7 @@ var require_esprima = __commonJS({ while (this.lookahead.type !== 2) { body.push(this.parseStatementListItem()); } - return this.finalize(node, new Node.Module(body)); + return this.finalize(node, new Node2.Module(body)); }; Parser2.prototype.parseScript = function() { var node = this.createNode(); @@ -18057,7 +17348,7 @@ var require_esprima = __commonJS({ while (this.lookahead.type !== 2) { body.push(this.parseStatementListItem()); } - return this.finalize(node, new Node.Script(body)); + return this.finalize(node, new Node2.Script(body)); }; Parser2.prototype.parseModuleSpecifier = function() { var node = this.createNode(); @@ -18066,7 +17357,7 @@ var require_esprima = __commonJS({ } var token = this.nextToken(); var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); + return this.finalize(node, new Node2.Literal(token.value, raw)); }; Parser2.prototype.parseImportSpecifier = function() { var node = this.createNode(); @@ -18089,7 +17380,7 @@ var require_esprima = __commonJS({ this.throwUnexpectedToken(this.nextToken()); } } - return this.finalize(node, new Node.ImportSpecifier(local, imported)); + return this.finalize(node, new Node2.ImportSpecifier(local, imported)); }; Parser2.prototype.parseNamedImports = function() { this.expect("{"); @@ -18106,7 +17397,7 @@ var require_esprima = __commonJS({ Parser2.prototype.parseImportDefaultSpecifier = function() { var node = this.createNode(); var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportDefaultSpecifier(local)); + return this.finalize(node, new Node2.ImportDefaultSpecifier(local)); }; Parser2.prototype.parseImportNamespaceSpecifier = function() { var node = this.createNode(); @@ -18116,7 +17407,7 @@ var require_esprima = __commonJS({ } this.nextToken(); var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); + return this.finalize(node, new Node2.ImportNamespaceSpecifier(local)); }; Parser2.prototype.parseImportDeclaration = function() { if (this.context.inFunctionBody) { @@ -18156,7 +17447,7 @@ var require_esprima = __commonJS({ src = this.parseModuleSpecifier(); } this.consumeSemicolon(); - return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); + return this.finalize(node, new Node2.ImportDeclaration(specifiers, src)); }; Parser2.prototype.parseExportSpecifier = function() { var node = this.createNode(); @@ -18166,7 +17457,7 @@ var require_esprima = __commonJS({ this.nextToken(); exported = this.parseIdentifierName(); } - return this.finalize(node, new Node.ExportSpecifier(local, exported)); + return this.finalize(node, new Node2.ExportSpecifier(local, exported)); }; Parser2.prototype.parseExportDeclaration = function() { if (this.context.inFunctionBody) { @@ -18179,20 +17470,20 @@ var require_esprima = __commonJS({ this.nextToken(); if (this.matchKeyword("function")) { var declaration = this.parseFunctionDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + exportDeclaration = this.finalize(node, new Node2.ExportDefaultDeclaration(declaration)); } else if (this.matchKeyword("class")) { var declaration = this.parseClassDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + exportDeclaration = this.finalize(node, new Node2.ExportDefaultDeclaration(declaration)); } else if (this.matchContextualKeyword("async")) { var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + exportDeclaration = this.finalize(node, new Node2.ExportDefaultDeclaration(declaration)); } else { if (this.matchContextualKeyword("from")) { this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); } var declaration = this.match("{") ? this.parseObjectInitializer() : this.match("[") ? this.parseArrayInitializer() : this.parseAssignmentExpression(); this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + exportDeclaration = this.finalize(node, new Node2.ExportDefaultDeclaration(declaration)); } } else if (this.match("*")) { this.nextToken(); @@ -18203,7 +17494,7 @@ var require_esprima = __commonJS({ this.nextToken(); var src = this.parseModuleSpecifier(); this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); + exportDeclaration = this.finalize(node, new Node2.ExportAllDeclaration(src)); } else if (this.lookahead.type === 4) { var declaration = void 0; switch (this.lookahead.value) { @@ -18219,10 +17510,10 @@ var require_esprima = __commonJS({ default: this.throwUnexpectedToken(this.lookahead); } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + exportDeclaration = this.finalize(node, new Node2.ExportNamedDeclaration(declaration, [], null)); } else if (this.matchAsyncFunction()) { var declaration = this.parseFunctionDeclaration(); - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + exportDeclaration = this.finalize(node, new Node2.ExportNamedDeclaration(declaration, [], null)); } else { var specifiers = []; var source = null; @@ -18246,7 +17537,7 @@ var require_esprima = __commonJS({ } else { this.consumeSemicolon(); } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); + exportDeclaration = this.finalize(node, new Node2.ExportNamedDeclaration(null, specifiers, source)); } return exportDeclaration; }; @@ -18259,12 +17550,12 @@ var require_esprima = __commonJS({ function(module3, exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - function assert7(condition, message) { + function assert20(condition, message) { if (!condition) { throw new Error("ASSERT: " + message); } } - exports2.assert = assert7; + exports2.assert = assert20; }, /* 10 */ /***/ @@ -18675,8 +17966,8 @@ var require_esprima = __commonJS({ if (cp >= 55296 && cp <= 56319) { var second = this.source.charCodeAt(i + 1); if (second >= 56320 && second <= 57343) { - var first = cp; - cp = (first - 55296) * 1024 + second - 56320 + 65536; + var first3 = cp; + cp = (first3 - 55296) * 1024 + second - 56320 + 65536; } } return cp; @@ -19923,15 +19214,15 @@ var require_esprima = __commonJS({ }); // node_modules/core-util-is/lib/util.js -var require_util2 = __commonJS({ +var require_util = __commonJS({ "node_modules/core-util-is/lib/util.js"(exports) { - function isArray(arg) { + function isArray2(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === "[object Array]"; } - exports.isArray = isArray; + exports.isArray = isArray2; function isBoolean(arg) { return typeof arg === "boolean"; } @@ -19948,10 +19239,10 @@ var require_util2 = __commonJS({ return typeof arg === "number"; } exports.isNumber = isNumber; - function isString2(arg) { + function isString3(arg) { return typeof arg === "string"; } - exports.isString = isString2; + exports.isString = isString3; function isSymbol(arg) { return typeof arg === "symbol"; } @@ -19972,10 +19263,10 @@ var require_util2 = __commonJS({ return objectToString(d) === "[object Date]"; } exports.isDate = isDate; - function isError4(e) { + function isError6(e) { return objectToString(e) === "[object Error]" || e instanceof Error; } - exports.isError = isError4; + exports.isError = isError6; function isFunction(arg) { return typeof arg === "function"; } @@ -20051,19 +19342,19 @@ var require_src = __commonJS({ } return n + r; } - function makeAscendingRun(array, lo, hi, compare2) { + function makeAscendingRun(array, lo, hi, compare4) { let runHi = lo + 1; if (runHi === hi) { return 1; } - if (compare2(array[runHi++], array[lo]) < 0) { - while (runHi < hi && compare2(array[runHi], array[runHi - 1]) < 0) { + if (compare4(array[runHi++], array[lo]) < 0) { + while (runHi < hi && compare4(array[runHi], array[runHi - 1]) < 0) { runHi++; } reverseRun(array, lo, runHi); reverseRun(results, lo, runHi); } else { - while (runHi < hi && compare2(array[runHi], array[runHi - 1]) >= 0) { + while (runHi < hi && compare4(array[runHi], array[runHi - 1]) >= 0) { runHi++; } } @@ -20077,7 +19368,7 @@ var require_src = __commonJS({ array[hi--] = t; } } - function binaryInsertionSort(array, lo, hi, start, compare2) { + function binaryInsertionSort(array, lo, hi, start, compare4) { if (start === lo) { start++; } @@ -20088,7 +19379,7 @@ var require_src = __commonJS({ let right = start; while (left < right) { const mid = left + right >>> 1; - if (compare2(pivot, array[mid]) < 0) { + if (compare4(pivot, array[mid]) < 0) { right = mid; } else { left = mid + 1; @@ -20117,13 +19408,13 @@ var require_src = __commonJS({ results[left] = pivotIndex; } } - function gallopLeft(value, array, start, length, hint, compare2) { + function gallopLeft(value, array, start, length, hint, compare4) { let lastOffset = 0; let maxOffset = 0; let offset = 1; - if (compare2(value, array[start + hint]) > 0) { + if (compare4(value, array[start + hint]) > 0) { maxOffset = length - hint; - while (offset < maxOffset && compare2(value, array[start + hint + offset]) > 0) { + while (offset < maxOffset && compare4(value, array[start + hint + offset]) > 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { @@ -20137,7 +19428,7 @@ var require_src = __commonJS({ offset += hint; } else { maxOffset = hint + 1; - while (offset < maxOffset && compare2(value, array[start + hint - offset]) <= 0) { + while (offset < maxOffset && compare4(value, array[start + hint - offset]) <= 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { @@ -20154,7 +19445,7 @@ var require_src = __commonJS({ lastOffset++; while (lastOffset < offset) { const m = lastOffset + (offset - lastOffset >>> 1); - if (compare2(value, array[start + m]) > 0) { + if (compare4(value, array[start + m]) > 0) { lastOffset = m + 1; } else { offset = m; @@ -20162,13 +19453,13 @@ var require_src = __commonJS({ } return offset; } - function gallopRight(value, array, start, length, hint, compare2) { + function gallopRight(value, array, start, length, hint, compare4) { let lastOffset = 0; let maxOffset = 0; let offset = 1; - if (compare2(value, array[start + hint]) < 0) { + if (compare4(value, array[start + hint]) < 0) { maxOffset = hint + 1; - while (offset < maxOffset && compare2(value, array[start + hint - offset]) < 0) { + while (offset < maxOffset && compare4(value, array[start + hint - offset]) < 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { @@ -20183,7 +19474,7 @@ var require_src = __commonJS({ offset = hint - tmp; } else { maxOffset = length - hint; - while (offset < maxOffset && compare2(value, array[start + hint + offset]) >= 0) { + while (offset < maxOffset && compare4(value, array[start + hint + offset]) >= 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { @@ -20199,7 +19490,7 @@ var require_src = __commonJS({ lastOffset++; while (lastOffset < offset) { const m = lastOffset + (offset - lastOffset >>> 1); - if (compare2(value, array[start + m]) < 0) { + if (compare4(value, array[start + m]) < 0) { offset = m; } else { lastOffset = m + 1; @@ -20208,9 +19499,9 @@ var require_src = __commonJS({ return offset; } var TimSort = class { - constructor(array, compare2) { + constructor(array, compare4) { this.array = array; - this.compare = compare2; + this.compare = compare4; const { length } = array; this.length = length; this.minGallop = DEFAULT_MIN_GALLOPING; @@ -20270,7 +19561,7 @@ var require_src = __commonJS({ * @param {number} i - Index of the run to merge in TimSort's stack. */ mergeAt(i) { - const { compare: compare2 } = this; + const { compare: compare4 } = this; const { array } = this; let start1 = this.runStart[i]; let length1 = this.runLength[i]; @@ -20282,7 +19573,7 @@ var require_src = __commonJS({ this.runLength[i + 1] = this.runLength[i + 2]; } this.stackSize--; - const k = gallopRight(array[start2], array, start1, length1, 0, compare2); + const k = gallopRight(array[start2], array, start1, length1, 0, compare4); start1 += k; length1 -= k; if (length1 === 0) { @@ -20294,7 +19585,7 @@ var require_src = __commonJS({ start2, length2, length2 - 1, - compare2 + compare4 ); if (length2 === 0) { return; @@ -20319,7 +19610,7 @@ var require_src = __commonJS({ * @param {number} length2 - Length of run2. */ mergeLow(start1, length1, start2, length2) { - const { compare: compare2 } = this; + const { compare: compare4 } = this; const { array } = this; const { tmp } = this; const { tmpIndex } = this; @@ -20354,15 +19645,15 @@ var require_src = __commonJS({ let { minGallop } = this; while (true) { let count1 = 0; - let count2 = 0; + let count22 = 0; let exit = false; do { - if (compare2(array[cursor2], tmp[cursor1]) < 0) { + if (compare4(array[cursor2], tmp[cursor1]) < 0) { array[dest] = array[cursor2]; results[dest] = results[cursor2]; dest++; cursor2++; - count2++; + count22++; count1 = 0; if (--length2 === 0) { exit = true; @@ -20374,18 +19665,18 @@ var require_src = __commonJS({ dest++; cursor1++; count1++; - count2 = 0; + count22 = 0; if (--length1 === 1) { exit = true; break; } } - } while ((count1 | count2) < minGallop); + } while ((count1 | count22) < minGallop); if (exit) { break; } do { - count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare2); + count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare4); if (count1 !== 0) { for (i = 0; i < count1; i++) { array[dest + i] = tmp[cursor1 + i]; @@ -20407,15 +19698,15 @@ var require_src = __commonJS({ exit = true; break; } - count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare2); - if (count2 !== 0) { - for (i = 0; i < count2; i++) { + count22 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare4); + if (count22 !== 0) { + for (i = 0; i < count22; i++) { array[dest + i] = array[cursor2 + i]; results[dest + i] = results[cursor2 + i]; } - dest += count2; - cursor2 += count2; - length2 -= count2; + dest += count22; + cursor2 += count22; + length2 -= count22; if (length2 === 0) { exit = true; break; @@ -20430,7 +19721,7 @@ var require_src = __commonJS({ break; } minGallop--; - } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + } while (count1 >= DEFAULT_MIN_GALLOPING || count22 >= DEFAULT_MIN_GALLOPING); if (exit) { break; } @@ -20473,7 +19764,7 @@ var require_src = __commonJS({ * @param {number} length2 - Length of run2. */ mergeHigh(start1, length1, start2, length2) { - const { compare: compare2 } = this; + const { compare: compare4 } = this; const { array } = this; const { tmp } = this; const { tmpIndex } = this; @@ -20515,16 +19806,16 @@ var require_src = __commonJS({ let { minGallop } = this; while (true) { let count1 = 0; - let count2 = 0; + let count22 = 0; let exit = false; do { - if (compare2(tmp[cursor2], array[cursor1]) < 0) { + if (compare4(tmp[cursor2], array[cursor1]) < 0) { array[dest] = array[cursor1]; results[dest] = results[cursor1]; dest--; cursor1--; count1++; - count2 = 0; + count22 = 0; if (--length1 === 0) { exit = true; break; @@ -20534,14 +19825,14 @@ var require_src = __commonJS({ results[dest] = tmpIndex[cursor2]; dest--; cursor2--; - count2++; + count22++; count1 = 0; if (--length2 === 1) { exit = true; break; } } - } while ((count1 | count2) < minGallop); + } while ((count1 | count22) < minGallop); if (exit) { break; } @@ -20552,7 +19843,7 @@ var require_src = __commonJS({ start1, length1, length1 - 1, - compare2 + compare4 ); if (count1 !== 0) { dest -= count1; @@ -20577,21 +19868,21 @@ var require_src = __commonJS({ exit = true; break; } - count2 = length2 - gallopLeft( + count22 = length2 - gallopLeft( array[cursor1], tmp, 0, length2, length2 - 1, - compare2 + compare4 ); - if (count2 !== 0) { - dest -= count2; - cursor2 -= count2; - length2 -= count2; + if (count22 !== 0) { + dest -= count22; + cursor2 -= count22; + length2 -= count22; customDest = dest + 1; customCursor = cursor2 + 1; - for (i = 0; i < count2; i++) { + for (i = 0; i < count22; i++) { array[customDest + i] = tmp[customCursor + i]; results[customDest + i] = tmpIndex[customCursor + i]; } @@ -20609,7 +19900,7 @@ var require_src = __commonJS({ break; } minGallop--; - } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + } while (count1 >= DEFAULT_MIN_GALLOPING || count22 >= DEFAULT_MIN_GALLOPING); if (exit) { break; } @@ -20644,7 +19935,7 @@ var require_src = __commonJS({ } } }; - function sort(array, compare2, lo, hi) { + function sort(array, compare4, lo, hi) { if (!Array.isArray(array)) { throw new TypeError( `The "array" argument must be an array. Received ${array}` @@ -20656,12 +19947,12 @@ var require_src = __commonJS({ while (i < length) { results[i] = i++; } - if (!compare2) { - compare2 = alphabeticalCompare; - } else if (typeof compare2 !== "function") { + if (!compare4) { + compare4 = alphabeticalCompare; + } else if (typeof compare4 !== "function") { hi = lo; - lo = compare2; - compare2 = alphabeticalCompare; + lo = compare4; + compare4 = alphabeticalCompare; } if (!lo) { lo = 0; @@ -20675,20 +19966,20 @@ var require_src = __commonJS({ } let runLength = 0; if (remaining < DEFAULT_MIN_MERGE) { - runLength = makeAscendingRun(array, lo, hi, compare2); - binaryInsertionSort(array, lo, hi, lo + runLength, compare2); + runLength = makeAscendingRun(array, lo, hi, compare4); + binaryInsertionSort(array, lo, hi, lo + runLength, compare4); return results; } - const ts = new TimSort(array, compare2); + const ts = new TimSort(array, compare4); const minRun = minRunLength(remaining); do { - runLength = makeAscendingRun(array, lo, hi, compare2); + runLength = makeAscendingRun(array, lo, hi, compare4); if (runLength < minRun) { let force = remaining; if (force > minRun) { force = minRun; } - binaryInsertionSort(array, lo, lo + force, lo + runLength, compare2); + binaryInsertionSort(array, lo, lo + force, lo + runLength, compare4); runLength = force; } ts.pushRun(lo, runLength); @@ -20720,10 +20011,10 @@ var require_common = __commonJS({ var hasOwnProperty2 = require_has_own_prop(); var { isObject, - isArray, - isString: isString2, + isArray: isArray2, + isString: isString3, isNumber - } = require_util2(); + } = require_util(); var PREFIX_BEFORE = "before"; var PREFIX_AFTER_PROP = "after-prop"; var PREFIX_AFTER_COLON = "after-colon"; @@ -20805,9 +20096,9 @@ var require_common = __commonJS({ } }); }; - var assign = (target, source, keys) => { - keys.forEach((key) => { - if (!isString2(key) && !isNumber(key)) { + var assign2 = (target, source, keys2) => { + keys2.forEach((key) => { + if (!isString3(key) && !isNumber(key)) { return; } if (!hasOwnProperty2(source, key)) { @@ -20841,22 +20132,22 @@ var require_common = __commonJS({ copy_comments, swap_comments, assign_non_prop_comments, - assign(target, source, keys) { + assign(target, source, keys2) { if (!isObject(target)) { throw new TypeError("Cannot convert undefined or null to object"); } if (!isObject(source)) { return target; } - if (keys === UNDEFINED) { - keys = Object.keys(source); + if (keys2 === UNDEFINED) { + keys2 = Object.keys(source); assign_non_prop_comments(target, source); - } else if (!isArray(keys)) { + } else if (!isArray2(keys2)) { throw new TypeError("keys must be array or undefined"); - } else if (keys.length === 0) { + } else if (keys2.length === 0) { assign_non_prop_comments(target, source); } - return assign(target, source, keys); + return assign2(target, source, keys2); } }; } @@ -20865,7 +20156,7 @@ var require_common = __commonJS({ // node_modules/comment-json/src/array.js var require_array = __commonJS({ "node_modules/comment-json/src/array.js"(exports, module2) { - var { isArray } = require_util2(); + var { isArray: isArray2 } = require_util(); var { sort } = require_src(); var { SYMBOL_PREFIXES, @@ -20877,24 +20168,24 @@ var require_array = __commonJS({ var reverse_comments = (array) => { const { length } = array; let i = 0; - const max = length / 2; - for (; i < max; i++) { + const max4 = length / 2; + for (; i < max4; i++) { swap_comments(array, i, length - i - 1); } }; var move_comment = (target, source, i, offset, remove) => { copy_comments(target, source, i + offset, i, remove); }; - var move_comments = (target, source, start, count, offset, remove) => { + var move_comments = (target, source, start, count3, offset, remove) => { if (offset > 0) { - let i2 = count; + let i2 = count3; while (i2-- > 0) { move_comment(target, source, start + i2, offset, remove); } return; } let i = 0; - while (i < count) { + while (i < count3) { const ii = i++; move_comment(target, source, start + ii, offset, remove); } @@ -20905,10 +20196,10 @@ var require_array = __commonJS({ delete array[prop]; }); }; - var get_mapped = (map, key) => { + var get_mapped = (map3, key) => { let mapped = key; - while (mapped in map) { - mapped = map[mapped]; + while (mapped in map3) { + mapped = map3[mapped]; } return mapped; }; @@ -20935,8 +20226,8 @@ var require_array = __commonJS({ } = items; const offset = item_length - deleteCount; const start = begin + deleteCount; - const count = length - start; - move_comments(this, this, start, count, offset, true); + const count3 = length - start; + move_comments(this, this, start, count3, offset, true); return ret; } slice(...args) { @@ -20996,7 +20287,7 @@ var require_array = __commonJS({ move_comments(ret, this, 0, this.length, 0); items.forEach((item) => { const prev = length; - length += isArray(item) ? item.length : 1; + length += isArray2(item) ? item.length : 1; if (!(item instanceof _CommentArray)) { return; } @@ -21009,16 +20300,16 @@ var require_array = __commonJS({ this, ...args.slice(0, 1) ); - const map = /* @__PURE__ */ Object.create(null); + const map3 = /* @__PURE__ */ Object.create(null); result.forEach((source_index, index) => { if (source_index === index) { return; } - const real_source_index = get_mapped(map, source_index); + const real_source_index = get_mapped(map3, source_index); if (real_source_index === index) { return; } - map[index] = real_source_index; + map3[index] = real_source_index; swap_comments(this, index, real_source_index); }); return this; @@ -21073,20 +20364,20 @@ var require_parse3 = __commonJS({ var current = null; var index; var reviver = null; - var clean2 = () => { + var clean6 = () => { previous_props.length = previous_hosts.length = 0; last = null; last_prop = UNDEFINED; }; var free = () => { - clean2(); + clean6(); tokens.length = 0; unassigned_comments = comments_host = tokens = last = current = reviver = null; }; var symbolFor = (prefix) => Symbol.for( last_prop !== UNDEFINED ? prefix + COLON + last_prop : prefix ); - var transform = (k, v) => reviver ? reviver(k, v) : v; + var transform2 = (k, v) => reviver ? reviver(k, v) : v; var unexpected = () => { const error2 = new SyntaxError(`Unexpected token ${current.value.slice(0, 1)}`); Object.assign(error2, current.loc.start); @@ -21214,7 +20505,7 @@ var require_parse3 = __commonJS({ expect(COLON); next(); parse_comments(PREFIX_AFTER_COLON); - obj[name] = transform(name, walk()); + obj[name] = transform2(name, walk4()); parse_comments(); } if (started) { @@ -21250,7 +20541,7 @@ var require_parse3 = __commonJS({ started = true; set_prop(i); assign_comments(PREFIX_BEFORE); - array[i] = transform(i, walk()); + array[i] = transform2(i, walk4()); i++; parse_comments(); } @@ -21266,7 +20557,7 @@ var require_parse3 = __commonJS({ restore_prop(); return array; }; - function walk() { + function walk4() { let tt = type(); if (tt === CURLY_BRACKET_OPEN) { next(); @@ -21295,8 +20586,8 @@ var require_parse3 = __commonJS({ } } var isObject = (subject) => Object(subject) === subject; - var parse3 = (code, rev, no_comments) => { - clean2(); + var parse4 = (code, rev, no_comments) => { + clean6(); tokens = tokenize(code); reviver = rev; remove_comments = no_comments; @@ -21307,7 +20598,7 @@ var require_parse3 = __commonJS({ next(); set_comments_host({}); parse_comments(PREFIX_BEFORE_ALL); - let result = walk(); + let result = walk4(); parse_comments(PREFIX_AFTER_ALL); if (current) { unexpected(); @@ -21319,12 +20610,12 @@ var require_parse3 = __commonJS({ assign_non_prop_comments(result, comments_host); } restore_comments_host(); - result = transform("", result); + result = transform2("", result); free(); return result; }; module2.exports = { - parse: parse3, + parse: parse4, tokenize }; } @@ -21335,7 +20626,7 @@ var require_repeat_string = __commonJS({ "node_modules/repeat-string/index.js"(exports, module2) { "use strict"; var res = ""; - var cache; + var cache2; module2.exports = repeat; function repeat(str, num) { if (typeof str !== "string") { @@ -21345,14 +20636,14 @@ var require_repeat_string = __commonJS({ return str; if (num === 2) return str + str; - var max = str.length * num; - if (cache !== str || typeof cache === "undefined") { - cache = str; + var max4 = str.length * num; + if (cache2 !== str || typeof cache2 === "undefined") { + cache2 = str; res = ""; - } else if (res.length >= max) { - return res.substr(0, max); + } else if (res.length >= max4) { + return res.substr(0, max4); } - while (max > res.length && num > 1) { + while (max4 > res.length && num > 1) { if (num & 1) { res += str; } @@ -21360,7 +20651,7 @@ var require_repeat_string = __commonJS({ str += str; } res += str; - res = res.substr(0, max); + res = res.substr(0, max4); return res; } } @@ -21370,12 +20661,12 @@ var require_repeat_string = __commonJS({ var require_stringify2 = __commonJS({ "node_modules/comment-json/src/stringify.js"(exports, module2) { var { - isArray, + isArray: isArray2, isObject, isFunction, isNumber, - isString: isString2 - } = require_util2(); + isString: isString3 + } = require_util(); var repeat = require_repeat_string(); var { PREFIX_BEFORE_ALL, @@ -21396,7 +20687,7 @@ var require_stringify2 = __commonJS({ } = require_common(); var ESCAPABLE = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; var SPACE = " "; - var LF = "\n"; + var LF2 = "\n"; var STR_NULL = "null"; var BEFORE = (prop) => `${PREFIX_BEFORE}:${prop}`; var AFTER_PROP = (prop) => `${PREFIX_AFTER_PROP}:${prop}`; @@ -21435,22 +20726,22 @@ var require_stringify2 = __commonJS({ type, value }) => { - const delimiter = inline ? SPACE : LF + deeper_gap; + const delimiter = inline ? SPACE : LF2 + deeper_gap; is_line_comment = type === "LineComment"; return prev + delimiter + comment_stringify(value, is_line_comment); }, EMPTY); - return display_block || is_line_comment ? str + LF + deeper_gap : str; + return display_block || is_line_comment ? str + LF2 + deeper_gap : str; }; var replacer = null; var indent = EMPTY; - var clean2 = () => { + var clean6 = () => { replacer = null; indent = EMPTY; }; - var join2 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + LF + gap : two ? two.trimRight() + LF + gap : EMPTY; + var join3 = (one, two, gap) => one ? two ? one + two.trim() + LF2 + gap : one.trimRight() + LF2 + gap : two ? two.trimRight() + LF2 + gap : EMPTY; var join_content = (inside, value, gap) => { const comment = process_comments(value, PREFIX_BEFORE, gap + indent, true); - return join2(comment, inside, gap); + return join3(comment, inside, gap); }; var array_stringify = (value, gap) => { const deeper_gap = gap + indent; @@ -21461,17 +20752,17 @@ var require_stringify2 = __commonJS({ if (i !== 0) { inside += COMMA; } - const before = join2( + const before = join3( after_comma, process_comments(value, BEFORE(i), deeper_gap), deeper_gap ); - inside += before || LF + deeper_gap; + inside += before || LF2 + deeper_gap; inside += stringify2(i, value, deeper_gap) || STR_NULL; inside += process_comments(value, AFTER_VALUE(i), deeper_gap); after_comma = process_comments(value, AFTER(i), deeper_gap); } - inside += join2( + inside += join3( after_comma, process_comments(value, PREFIX_AFTER, deeper_gap), deeper_gap @@ -21485,28 +20776,28 @@ var require_stringify2 = __commonJS({ const deeper_gap = gap + indent; let inside = EMPTY; let after_comma = EMPTY; - let first = true; - const keys = isArray(replacer) ? replacer : Object.keys(value); + let first3 = true; + const keys2 = isArray2(replacer) ? replacer : Object.keys(value); const iteratee = (key) => { const sv = stringify2(key, value, deeper_gap); if (sv === UNDEFINED) { return; } - if (!first) { + if (!first3) { inside += COMMA; } - first = false; - const before = join2( + first3 = false; + const before = join3( after_comma, process_comments(value, BEFORE(key), deeper_gap), deeper_gap ); - inside += before || LF + deeper_gap; + inside += before || LF2 + deeper_gap; inside += quote(key) + process_comments(value, AFTER_PROP(key), deeper_gap) + COLON + process_comments(value, AFTER_COLON(key), deeper_gap) + SPACE + sv + process_comments(value, AFTER_VALUE(key), deeper_gap); after_comma = process_comments(value, AFTER(key), deeper_gap); }; - keys.forEach(iteratee); - inside += join2( + keys2.forEach(iteratee); + inside += join3( after_comma, process_comments(value, PREFIX_AFTER, deeper_gap), deeper_gap @@ -21530,11 +20821,11 @@ var require_stringify2 = __commonJS({ case "null": return String(value); case "object": - return isArray(value) ? array_stringify(value, gap) : object_stringify(value, gap); + return isArray2(value) ? array_stringify(value, gap) : object_stringify(value, gap); default: } } - var get_indent = (space) => isString2(space) ? space : isNumber(space) ? repeat(SPACE, space) : EMPTY; + var get_indent = (space) => isString3(space) ? space : isNumber(space) ? repeat(SPACE, space) : EMPTY; var { toString } = Object.prototype; var PRIMITIVE_OBJECT_TYPES = [ "[object Number]", @@ -21553,13 +20844,13 @@ var require_stringify2 = __commonJS({ if (!indent_) { return JSON.stringify(value, replacer_); } - if (!isFunction(replacer_) && !isArray(replacer_)) { + if (!isFunction(replacer_) && !isArray2(replacer_)) { replacer_ = null; } replacer = replacer_; indent = indent_; const str = is_primitive_object(value) ? JSON.stringify(value) : stringify2("", { "": value }, EMPTY); - clean2(); + clean6(); return isObject(value) ? process_comments(value, PREFIX_BEFORE_ALL, EMPTY).trimLeft() + str + process_comments(value, PREFIX_AFTER_ALL, EMPTY).trimRight() : str; }; } @@ -21568,16 +20859,16 @@ var require_stringify2 = __commonJS({ // node_modules/comment-json/src/index.js var require_src2 = __commonJS({ "node_modules/comment-json/src/index.js"(exports, module2) { - var { parse: parse3, tokenize } = require_parse3(); + var { parse: parse4, tokenize } = require_parse3(); var stringify2 = require_stringify2(); var { CommentArray } = require_array(); - var { assign } = require_common(); + var { assign: assign2 } = require_common(); module2.exports = { - parse: parse3, + parse: parse4, stringify: stringify2, tokenize, CommentArray, - assign + assign: assign2 }; } }); @@ -21591,22 +20882,22 @@ var require_cacheWrapper = __commonJS({ }); exports.cacheWrapper = cacheWrapper; exports.cacheWrapperSync = cacheWrapperSync; - async function cacheWrapper(cache, key, fn) { - const cached = cache.get(key); + async function cacheWrapper(cache2, key, fn) { + const cached = cache2.get(key); if (cached !== void 0) { return cached; } const result = await fn(); - cache.set(key, result); + cache2.set(key, result); return result; } - function cacheWrapperSync(cache, key, fn) { - const cached = cache.get(key); + function cacheWrapperSync(cache2, key, fn) { + const cached = cache2.get(key); if (cached !== void 0) { return cached; } const result = fn(); - cache.set(key, result); + cache2.set(key, result); return result; } } @@ -21616,10 +20907,10 @@ var require_cacheWrapper = __commonJS({ var require_resolve_from = __commonJS({ "node_modules/import-fresh/node_modules/resolve-from/index.js"(exports, module2) { "use strict"; - var path16 = require("path"); + var path26 = require("path"); var Module = require("module"); - var fs6 = require("fs"); - var resolveFrom = (fromDir, moduleId, silent) => { + var fs9 = require("fs"); + var resolveFrom2 = (fromDir, moduleId, silent) => { if (typeof fromDir !== "string") { throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``); } @@ -21627,17 +20918,17 @@ var require_resolve_from = __commonJS({ throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); } try { - fromDir = fs6.realpathSync(fromDir); + fromDir = fs9.realpathSync(fromDir); } catch (err) { if (err.code === "ENOENT") { - fromDir = path16.resolve(fromDir); + fromDir = path26.resolve(fromDir); } else if (silent) { return null; } else { throw err; } } - const fromFile = path16.join(fromDir, "noop.js"); + const fromFile = path26.join(fromDir, "noop.js"); const resolveFileName = () => Module._resolveFilename(moduleId, { id: fromFile, filename: fromFile, @@ -21652,8 +20943,8 @@ var require_resolve_from = __commonJS({ } return resolveFileName(); }; - module2.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId); - module2.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true); + module2.exports = (fromDir, moduleId) => resolveFrom2(fromDir, moduleId); + module2.exports.silent = (fromDir, moduleId) => resolveFrom2(fromDir, moduleId, true); } }); @@ -21709,16 +21000,16 @@ var require_parent_module = __commonJS({ var require_import_fresh = __commonJS({ "node_modules/import-fresh/index.js"(exports, module2) { "use strict"; - var path16 = require("path"); - var resolveFrom = require_resolve_from(); + var path26 = require("path"); + var resolveFrom2 = require_resolve_from(); var parentModule = require_parent_module(); module2.exports = (moduleId) => { if (typeof moduleId !== "string") { throw new TypeError("Expected a string"); } const parentPath = parentModule(__filename); - const cwd = parentPath ? path16.dirname(parentPath) : __dirname; - const filePath = resolveFrom(cwd, moduleId); + const cwd = parentPath ? path26.dirname(parentPath) : __dirname; + const filePath = resolveFrom2(cwd, moduleId); const oldModule = require.cache[filePath]; if (oldModule && oldModule.parent) { let i = oldModule.parent.children.length; @@ -21915,7 +21206,7 @@ var require_json_parse_even_better_errors = __commonJS({ var kNewline = Symbol.for("newline"); var formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/; var emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/; - var parseJson = (txt, reviver, context) => { + var parseJson2 = (txt, reviver, context) => { const parseText = stripBOM(txt); context = context || 20; try { @@ -21936,13 +21227,13 @@ var require_json_parse_even_better_errors = __commonJS({ systemError: e }); } - throw new JSONParseError(e, parseText, context, parseJson); + throw new JSONParseError(e, parseText, context, parseJson2); } }; var stripBOM = (txt) => String(txt).replace(/^\uFEFF/, ""); - module2.exports = parseJson; - parseJson.JSONParseError = JSONParseError; - parseJson.noExceptions = (txt, reviver) => { + module2.exports = parseJson2; + parseJson2.JSONParseError = JSONParseError; + parseJson2.noExceptions = (txt, reviver) => { try { return JSON.parse(stripBOM(txt), reviver); } catch (e) { @@ -21957,7 +21248,7 @@ var require_build = __commonJS({ "use strict"; exports.__esModule = true; exports.LinesAndColumns = void 0; - var LF = "\n"; + var LF2 = "\n"; var CR = "\r"; var LinesAndColumns = ( /** @class */ @@ -21967,14 +21258,14 @@ var require_build = __commonJS({ var offsets = [0]; for (var offset = 0; offset < string.length; ) { switch (string[offset]) { - case LF: - offset += LF.length; + case LF2: + offset += LF2.length; offsets.push(offset); break; case CR: offset += CR.length; - if (string[offset] === LF) { - offset += LF.length; + if (string[offset] === LF2) { + offset += LF2.length; } offsets.push(offset); break; @@ -22027,23 +21318,23 @@ var require_js_tokens = __commonJS({ value: true }); exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; - exports.matchToToken = function(match) { - var token = { type: "invalid", value: match[0], closed: void 0 }; - if (match[1]) - token.type = "string", token.closed = !!(match[3] || match[4]); - else if (match[5]) + exports.matchToToken = function(match2) { + var token = { type: "invalid", value: match2[0], closed: void 0 }; + if (match2[1]) + token.type = "string", token.closed = !!(match2[3] || match2[4]); + else if (match2[5]) token.type = "comment"; - else if (match[6]) - token.type = "comment", token.closed = !!match[7]; - else if (match[8]) + else if (match2[6]) + token.type = "comment", token.closed = !!match2[7]; + else if (match2[8]) token.type = "regex"; - else if (match[9]) + else if (match2[9]) token.type = "number"; - else if (match[10]) + else if (match2[10]) token.type = "name"; - else if (match[11]) + else if (match2[11]) token.type = "punctuator"; - else if (match[12]) + else if (match2[12]) token.type = "whitespace"; return token; }; @@ -22247,9 +21538,9 @@ var require_escape_string_regexp = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/color-name/index.js +// node_modules/color-name/index.js var require_color_name = __commonJS({ - "node_modules/@babel/highlight/node_modules/color-name/index.js"(exports, module2) { + "node_modules/color-name/index.js"(exports, module2) { "use strict"; module2.exports = { "aliceblue": [240, 248, 255], @@ -22404,9 +21695,9 @@ var require_color_name = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/color-convert/conversions.js +// node_modules/color-convert/conversions.js var require_conversions = __commonJS({ - "node_modules/@babel/highlight/node_modules/color-convert/conversions.js"(exports, module2) { + "node_modules/color-convert/conversions.js"(exports, module2) { var cssKeywords = require_color_name(); var reverseKeywords = {}; for (key in cssKeywords) { @@ -22458,32 +21749,32 @@ var require_conversions = __commonJS({ var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; - var min = Math.min(r, g, b); - var max = Math.max(r, g, b); - var delta = max - min; + var min3 = Math.min(r, g, b); + var max4 = Math.max(r, g, b); + var delta = max4 - min3; var h; var s; var l; - if (max === min) { + if (max4 === min3) { h = 0; - } else if (r === max) { + } else if (r === max4) { h = (g - b) / delta; - } else if (g === max) { + } else if (g === max4) { h = 2 + (b - r) / delta; - } else if (b === max) { + } else if (b === max4) { h = 4 + (r - g) / delta; } h = Math.min(h * 60, 360); if (h < 0) { h += 360; } - l = (min + max) / 2; - if (max === min) { + l = (min3 + max4) / 2; + if (max4 === min3) { s = 0; } else if (l <= 0.5) { - s = delta / (max + min); + s = delta / (max4 + min3); } else { - s = delta / (2 - max - min); + s = delta / (2 - max4 - min3); } return [h, s * 100, l * 100]; }; @@ -22926,12 +22217,12 @@ var require_conversions = __commonJS({ return "000000".substring(string.length) + string; }; convert.hex.rgb = function(args) { - var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { + var match2 = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match2) { return [0, 0, 0]; } - var colorString = match[0]; - if (match[0].length === 3) { + var colorString = match2[0]; + if (match2[0].length === 3) { colorString = colorString.split("").map(function(char) { return char + char; }).join(""); @@ -22946,21 +22237,21 @@ var require_conversions = __commonJS({ var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; - var max = Math.max(Math.max(r, g), b); - var min = Math.min(Math.min(r, g), b); - var chroma = max - min; + var max4 = Math.max(Math.max(r, g), b); + var min3 = Math.min(Math.min(r, g), b); + var chroma = max4 - min3; var grayscale; var hue; if (chroma < 1) { - grayscale = min / (1 - chroma); + grayscale = min3 / (1 - chroma); } else { grayscale = 0; } if (chroma <= 0) { hue = 0; - } else if (max === r) { + } else if (max4 === r) { hue = (g - b) / chroma % 6; - } else if (max === g) { + } else if (max4 === g) { hue = 2 + (b - r) / chroma; } else { hue = 4 + (r - g) / chroma + 4; @@ -23117,9 +22408,9 @@ var require_conversions = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/color-convert/route.js +// node_modules/color-convert/route.js var require_route = __commonJS({ - "node_modules/@babel/highlight/node_modules/color-convert/route.js"(exports, module2) { + "node_modules/color-convert/route.js"(exports, module2) { var conversions = require_conversions(); function buildGraph() { var graph = {}; @@ -23159,15 +22450,15 @@ var require_route = __commonJS({ }; } function wrapConversion(toModel, graph) { - var path16 = [graph[toModel].parent, toModel]; + var path26 = [graph[toModel].parent, toModel]; var fn = conversions[graph[toModel].parent][toModel]; var cur = graph[toModel].parent; while (graph[cur].parent) { - path16.unshift(graph[cur].parent); + path26.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); cur = graph[cur].parent; } - fn.conversion = path16; + fn.conversion = path26; return fn; } module2.exports = function(fromModel) { @@ -23187,9 +22478,9 @@ var require_route = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/color-convert/index.js +// node_modules/color-convert/index.js var require_color_convert = __commonJS({ - "node_modules/@babel/highlight/node_modules/color-convert/index.js"(exports, module2) { + "node_modules/color-convert/index.js"(exports, module2) { var conversions = require_conversions(); var route = require_route(); var convert = {}; @@ -23246,26 +22537,26 @@ var require_color_convert = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/ansi-styles/index.js +// node_modules/ansi-styles/index.js var require_ansi_styles = __commonJS({ - "node_modules/@babel/highlight/node_modules/ansi-styles/index.js"(exports, module2) { + "node_modules/ansi-styles/index.js"(exports, module2) { "use strict"; var colorConvert = require_color_convert(); - var wrapAnsi16 = (fn, offset) => function() { + var wrapAnsi162 = (fn, offset) => function() { const code = fn.apply(colorConvert, arguments); return `\x1B[${code + offset}m`; }; - var wrapAnsi256 = (fn, offset) => function() { + var wrapAnsi2562 = (fn, offset) => function() { const code = fn.apply(colorConvert, arguments); return `\x1B[${38 + offset};5;${code}m`; }; - var wrapAnsi16m = (fn, offset) => function() { + var wrapAnsi16m2 = (fn, offset) => function() { const rgb = fn.apply(colorConvert, arguments); return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; }; - function assembleStyles() { - const codes2 = /* @__PURE__ */ new Map(); - const styles = { + function assembleStyles2() { + const codes3 = /* @__PURE__ */ new Map(); + const styles3 = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing @@ -23316,48 +22607,48 @@ var require_ansi_styles = __commonJS({ bgWhiteBright: [107, 49] } }; - styles.color.grey = styles.color.gray; - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; + styles3.color.grey = styles3.color.gray; + for (const groupName of Object.keys(styles3)) { + const group = styles3[groupName]; for (const styleName of Object.keys(group)) { const style = group[styleName]; - styles[styleName] = { + styles3[styleName] = { open: `\x1B[${style[0]}m`, close: `\x1B[${style[1]}m` }; - group[styleName] = styles[styleName]; - codes2.set(style[0], style[1]); + group[styleName] = styles3[styleName]; + codes3.set(style[0], style[1]); } - Object.defineProperty(styles, groupName, { + Object.defineProperty(styles3, groupName, { value: group, enumerable: false }); - Object.defineProperty(styles, "codes", { - value: codes2, + Object.defineProperty(styles3, "codes", { + value: codes3, enumerable: false }); } const ansi2ansi = (n) => n; const rgb2rgb = (r, g, b) => [r, g, b]; - styles.color.close = "\x1B[39m"; - styles.bgColor.close = "\x1B[49m"; - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) + styles3.color.close = "\x1B[39m"; + styles3.bgColor.close = "\x1B[49m"; + styles3.color.ansi = { + ansi: wrapAnsi162(ansi2ansi, 0) }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) + styles3.color.ansi256 = { + ansi256: wrapAnsi2562(ansi2ansi, 0) }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) + styles3.color.ansi16m = { + rgb: wrapAnsi16m2(rgb2rgb, 0) }; - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) + styles3.bgColor.ansi = { + ansi: wrapAnsi162(ansi2ansi, 10) }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) + styles3.bgColor.ansi256 = { + ansi256: wrapAnsi2562(ansi2ansi, 10) }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) + styles3.bgColor.ansi16m = { + rgb: wrapAnsi16m2(rgb2rgb, 10) }; for (let key of Object.keys(colorConvert)) { if (typeof colorConvert[key] !== "object") { @@ -23368,30 +22659,30 @@ var require_ansi_styles = __commonJS({ key = "ansi"; } if ("ansi16" in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + styles3.color.ansi[key] = wrapAnsi162(suite.ansi16, 0); + styles3.bgColor.ansi[key] = wrapAnsi162(suite.ansi16, 10); } if ("ansi256" in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + styles3.color.ansi256[key] = wrapAnsi2562(suite.ansi256, 0); + styles3.bgColor.ansi256[key] = wrapAnsi2562(suite.ansi256, 10); } if ("rgb" in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + styles3.color.ansi16m[key] = wrapAnsi16m2(suite.rgb, 0); + styles3.bgColor.ansi16m[key] = wrapAnsi16m2(suite.rgb, 10); } } - return styles; + return styles3; } Object.defineProperty(module2, "exports", { enumerable: true, - get: assembleStyles + get: assembleStyles2 }); } }); -// node_modules/@babel/highlight/node_modules/has-flag/index.js +// node_modules/has-flag/index.js var require_has_flag = __commonJS({ - "node_modules/@babel/highlight/node_modules/has-flag/index.js"(exports, module2) { + "node_modules/has-flag/index.js"(exports, module2) { "use strict"; module2.exports = (flag, argv) => { argv = argv || process.argv; @@ -23403,23 +22694,23 @@ var require_has_flag = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/supports-color/index.js +// node_modules/supports-color/index.js var require_supports_color = __commonJS({ - "node_modules/@babel/highlight/node_modules/supports-color/index.js"(exports, module2) { + "node_modules/supports-color/index.js"(exports, module2) { "use strict"; - var os = require("os"); - var hasFlag = require_has_flag(); - var env = process.env; + var os5 = require("os"); + var hasFlag2 = require_has_flag(); + var env3 = process.env; var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) { + if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false")) { forceColor = false; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) { forceColor = true; } - if ("FORCE_COLOR" in env) { - forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; + if ("FORCE_COLOR" in env3) { + forceColor = env3.FORCE_COLOR.length === 0 || parseInt(env3.FORCE_COLOR, 10) !== 0; } - function translateLevel(level) { + function translateLevel2(level) { if (level === 0) { return false; } @@ -23430,65 +22721,65 @@ var require_supports_color = __commonJS({ has16m: level >= 3 }; } - function supportsColor(stream) { + function supportsColor2(stream) { if (forceColor === false) { return 0; } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) { return 3; } - if (hasFlag("color=256")) { + if (hasFlag2("color=256")) { return 2; } if (stream && !stream.isTTY && forceColor !== true) { return 0; } - const min = forceColor ? 1 : 0; + const min3 = forceColor ? 1 : 0; if (process.platform === "win32") { - const osRelease = os.release().split("."); + const osRelease = os5.release().split("."); if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + if ("CI" in env3) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env3) || env3.CI_NAME === "codeship") { return 1; } - return min; + return min3; } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + if ("TEAMCITY_VERSION" in env3) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0; } - if (env.COLORTERM === "truecolor") { + if (env3.COLORTERM === "truecolor") { return 3; } - if ("TERM_PROGRAM" in env) { - const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { + if ("TERM_PROGRAM" in env3) { + const version4 = parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env3.TERM_PROGRAM) { case "iTerm.app": - return version3 >= 3 ? 3 : 2; + return version4 >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } - if (/-256(color)?$/i.test(env.TERM)) { + if (/-256(color)?$/i.test(env3.TERM)) { return 2; } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) { return 1; } - if ("COLORTERM" in env) { + if ("COLORTERM" in env3) { return 1; } - if (env.TERM === "dumb") { - return min; + if (env3.TERM === "dumb") { + return min3; } - return min; + return min3; } function getSupportLevel(stream) { - const level = supportsColor(stream); - return translateLevel(level); + const level = supportsColor2(stream); + return translateLevel2(level); } module2.exports = { supportsColor: getSupportLevel, @@ -23502,11 +22793,11 @@ var require_supports_color = __commonJS({ var require_templates = __commonJS({ "node_modules/@babel/highlight/node_modules/chalk/templates.js"(exports, module2) { "use strict"; - var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; - var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; - var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; - var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; - var ESCAPES = /* @__PURE__ */ new Map([ + var TEMPLATE_REGEX2 = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; + var STYLE_REGEX2 = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; + var STRING_REGEX2 = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; + var ESCAPE_REGEX2 = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; + var ESCAPES2 = /* @__PURE__ */ new Map([ ["n", "\n"], ["r", "\r"], ["t", " "], @@ -23518,35 +22809,35 @@ var require_templates = __commonJS({ ["e", "\x1B"], ["a", "\x07"] ]); - function unescape2(c) { + function unescape3(c) { if (c[0] === "u" && c.length === 5 || c[0] === "x" && c.length === 3) { return String.fromCharCode(parseInt(c.slice(1), 16)); } - return ESCAPES.get(c) || c; + return ESCAPES2.get(c) || c; } - function parseArguments(name, args) { + function parseArguments2(name, args) { const results = []; const chunks = args.trim().split(/\s*,\s*/g); let matches; for (const chunk of chunks) { if (!isNaN(chunk)) { results.push(Number(chunk)); - } else if (matches = chunk.match(STRING_REGEX)) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape2(escape) : chr)); + } else if (matches = chunk.match(STRING_REGEX2)) { + results.push(matches[2].replace(ESCAPE_REGEX2, (m, escape, chr) => escape ? unescape3(escape) : chr)); } else { throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); } } return results; } - function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; + function parseStyle2(style) { + STYLE_REGEX2.lastIndex = 0; const results = []; let matches; - while ((matches = STYLE_REGEX.exec(style)) !== null) { + while ((matches = STYLE_REGEX2.exec(style)) !== null) { const name = matches[1]; if (matches[2]) { - const args = parseArguments(name, matches[2]); + const args = parseArguments2(name, matches[2]); results.push([name].concat(args)); } else { results.push([name]); @@ -23554,14 +22845,14 @@ var require_templates = __commonJS({ } return results; } - function buildStyle(chalk3, styles) { + function buildStyle(chalk2, styles3) { const enabled = {}; - for (const layer of styles) { + for (const layer of styles3) { for (const style of layer.styles) { enabled[style[0]] = layer.inverse ? null : style.slice(1); } } - let current = chalk3; + let current = chalk2; for (const styleName of Object.keys(enabled)) { if (Array.isArray(enabled[styleName])) { if (!(styleName in current)) { @@ -23576,32 +22867,32 @@ var require_templates = __commonJS({ } return current; } - module2.exports = (chalk3, tmp) => { - const styles = []; + module2.exports = (chalk2, tmp) => { + const styles3 = []; const chunks = []; let chunk = []; - tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { + tmp.replace(TEMPLATE_REGEX2, (m, escapeChar, inverse, style, close, chr) => { if (escapeChar) { - chunk.push(unescape2(escapeChar)); + chunk.push(unescape3(escapeChar)); } else if (style) { const str = chunk.join(""); chunk = []; - chunks.push(styles.length === 0 ? str : buildStyle(chalk3, styles)(str)); - styles.push({ inverse, styles: parseStyle(style) }); + chunks.push(styles3.length === 0 ? str : buildStyle(chalk2, styles3)(str)); + styles3.push({ inverse, styles: parseStyle2(style) }); } else if (close) { - if (styles.length === 0) { + if (styles3.length === 0) { throw new Error("Found extraneous } in Chalk template literal"); } - chunks.push(buildStyle(chalk3, styles)(chunk.join(""))); + chunks.push(buildStyle(chalk2, styles3)(chunk.join(""))); chunk = []; - styles.pop(); + styles3.pop(); } else { chunk.push(chr); } }); chunks.push(chunk.join("")); - if (styles.length > 0) { - const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`; + if (styles3.length > 0) { + const errMsg = `Chalk template literal is missing ${styles3.length} closing bracket${styles3.length === 1 ? "" : "s"} (\`}\`)`; throw new Error(errMsg); } return chunks.join(""); @@ -23614,102 +22905,102 @@ var require_chalk = __commonJS({ "node_modules/@babel/highlight/node_modules/chalk/index.js"(exports, module2) { "use strict"; var escapeStringRegexp = require_escape_string_regexp(); - var ansiStyles = require_ansi_styles(); - var stdoutColor = require_supports_color().stdout; - var template2 = require_templates(); + var ansiStyles2 = require_ansi_styles(); + var stdoutColor2 = require_supports_color().stdout; + var template3 = require_templates(); var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm"); - var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"]; + var levelMapping2 = ["ansi", "ansi", "ansi256", "ansi16m"]; var skipModels = /* @__PURE__ */ new Set(["gray"]); - var styles = /* @__PURE__ */ Object.create(null); - function applyOptions(obj, options) { + var styles3 = /* @__PURE__ */ Object.create(null); + function applyOptions2(obj, options) { options = options || {}; - const scLevel = stdoutColor ? stdoutColor.level : 0; + const scLevel = stdoutColor2 ? stdoutColor2.level : 0; obj.level = options.level === void 0 ? scLevel : options.level; obj.enabled = "enabled" in options ? options.enabled : obj.level > 0; } function Chalk(options) { if (!this || !(this instanceof Chalk) || this.template) { - const chalk3 = {}; - applyOptions(chalk3, options); - chalk3.template = function() { + const chalk2 = {}; + applyOptions2(chalk2, options); + chalk2.template = function() { const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk3.template].concat(args)); + return chalkTag.apply(null, [chalk2.template].concat(args)); }; - Object.setPrototypeOf(chalk3, Chalk.prototype); - Object.setPrototypeOf(chalk3.template, chalk3); - chalk3.template.constructor = Chalk; - return chalk3.template; + Object.setPrototypeOf(chalk2, Chalk.prototype); + Object.setPrototypeOf(chalk2.template, chalk2); + chalk2.template.constructor = Chalk; + return chalk2.template; } - applyOptions(this, options); + applyOptions2(this, options); } if (isSimpleWindowsTerm) { - ansiStyles.blue.open = "\x1B[94m"; + ansiStyles2.blue.open = "\x1B[94m"; } - for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g"); - styles[key] = { + for (const key of Object.keys(ansiStyles2)) { + ansiStyles2[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles2[key].close), "g"); + styles3[key] = { get() { - const codes2 = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, key); + const codes3 = ansiStyles2[key]; + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, key); } }; } - styles.visible = { + styles3.visible = { get() { return build.call(this, this._styles || [], true, "visible"); } }; - ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), "g"); - for (const model of Object.keys(ansiStyles.color.ansi)) { + ansiStyles2.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles2.color.close), "g"); + for (const model of Object.keys(ansiStyles2.color.ansi)) { if (skipModels.has(model)) { continue; } - styles[model] = { + styles3[model] = { get() { const level = this.level; return function() { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes2 = { + const open = ansiStyles2.color[levelMapping2[level]][model].apply(null, arguments); + const codes3 = { open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe + close: ansiStyles2.color.close, + closeRe: ansiStyles2.color.closeRe }; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model); + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, model); }; } }; } - ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), "g"); - for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + ansiStyles2.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles2.bgColor.close), "g"); + for (const model of Object.keys(ansiStyles2.bgColor.ansi)) { if (skipModels.has(model)) { continue; } const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { + styles3[bgModel] = { get() { const level = this.level; return function() { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes2 = { + const open = ansiStyles2.bgColor[levelMapping2[level]][model].apply(null, arguments); + const codes3 = { open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe + close: ansiStyles2.bgColor.close, + closeRe: ansiStyles2.bgColor.closeRe }; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model); + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, model); }; } }; } - var proto = Object.defineProperties(() => { - }, styles); + var proto2 = Object.defineProperties(() => { + }, styles3); function build(_styles, _empty, key) { - const builder = function() { - return applyStyle.apply(builder, arguments); + const builder2 = function() { + return applyStyle2.apply(builder2, arguments); }; - builder._styles = _styles; - builder._empty = _empty; + builder2._styles = _styles; + builder2._empty = _empty; const self = this; - Object.defineProperty(builder, "level", { + Object.defineProperty(builder2, "level", { enumerable: true, get() { return self.level; @@ -23718,7 +23009,7 @@ var require_chalk = __commonJS({ self.level = level; } }); - Object.defineProperty(builder, "enabled", { + Object.defineProperty(builder2, "enabled", { enumerable: true, get() { return self.enabled; @@ -23727,11 +23018,11 @@ var require_chalk = __commonJS({ self.enabled = enabled; } }); - builder.hasGrey = this.hasGrey || key === "gray" || key === "grey"; - builder.__proto__ = proto; - return builder; + builder2.hasGrey = this.hasGrey || key === "gray" || key === "grey"; + builder2.__proto__ = proto2; + return builder2; } - function applyStyle() { + function applyStyle2() { const args = arguments; const argsLen = args.length; let str = String(arguments[0]); @@ -23746,18 +23037,18 @@ var require_chalk = __commonJS({ if (!this.enabled || this.level <= 0 || !str) { return this._empty ? "" : str; } - const originalDim = ansiStyles.dim.open; + const originalDim = ansiStyles2.dim.open; if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ""; + ansiStyles2.dim.open = ""; } for (const code of this._styles.slice().reverse()) { str = code.open + str.replace(code.closeRe, code.open) + code.close; str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); } - ansiStyles.dim.open = originalDim; + ansiStyles2.dim.open = originalDim; return str; } - function chalkTag(chalk3, strings) { + function chalkTag(chalk2, strings) { if (!Array.isArray(strings)) { return [].slice.call(arguments, 1).join(" "); } @@ -23767,11 +23058,11 @@ var require_chalk = __commonJS({ parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&")); parts.push(String(strings.raw[i])); } - return template2(chalk3, parts.join("")); + return template3(chalk2, parts.join("")); } - Object.defineProperties(Chalk.prototype, styles); + Object.defineProperties(Chalk.prototype, styles3); module2.exports = Chalk(); - module2.exports.supportsColor = stdoutColor; + module2.exports.supportsColor = stdoutColor2; module2.exports.default = module2.exports; } }); @@ -23790,17 +23081,17 @@ var require_lib5 = __commonJS({ var _helperValidatorIdentifier = require_lib4(); var _chalk = require_chalk(); var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]); - function getDefs(chalk3) { + function getDefs(chalk2) { return { - keyword: chalk3.cyan, - capitalized: chalk3.yellow, - jsxIdentifier: chalk3.yellow, - punctuator: chalk3.yellow, - number: chalk3.magenta, - string: chalk3.green, - regex: chalk3.magenta, - comment: chalk3.grey, - invalid: chalk3.white.bgRed.bold + keyword: chalk2.cyan, + capitalized: chalk2.yellow, + jsxIdentifier: chalk2.yellow, + punctuator: chalk2.yellow, + number: chalk2.magenta, + string: chalk2.green, + regex: chalk2.magenta, + comment: chalk2.grey, + invalid: chalk2.white.bgRed.bold }; } var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; @@ -23829,11 +23120,11 @@ var require_lib5 = __commonJS({ return token.type; }; tokenize = function* (text) { - let match; - while (match = _jsTokens.default.exec(text)) { - const token = _jsTokens.matchToToken(match); + let match2; + while (match2 = _jsTokens.default.exec(text)) { + const token = _jsTokens.matchToToken(match2); yield { - type: getTokenType(token, match.index, text), + type: getTokenType(token, match2.index, text), value: token.value }; } @@ -23865,8 +23156,8 @@ var require_lib5 = __commonJS({ } function highlight(code, options = {}) { if (code !== "" && shouldHighlight(options)) { - const chalk3 = getChalk(options); - const defs = getDefs(chalk3); + const chalk2 = getChalk(options); + const defs = getDefs(chalk2); return highlightTokens(defs, code); } else { return code; @@ -23886,11 +23177,11 @@ var require_lib6 = __commonJS({ exports.default = _default; var _highlight = require_lib5(); var deprecationWarningShown = false; - function getDefs(chalk3) { + function getDefs(chalk2) { return { - gutter: chalk3.grey, - marker: chalk3.red.bold, - message: chalk3.red.bold + gutter: chalk2.grey, + marker: chalk2.red.bold, + message: chalk2.red.bold }; } var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; @@ -23952,8 +23243,8 @@ var require_lib6 = __commonJS({ } function codeFrameColumns(rawLines, loc, opts = {}) { const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); - const chalk3 = (0, _highlight.getChalk)(opts); - const defs = getDefs(chalk3); + const chalk2 = (0, _highlight.getChalk)(opts); + const defs = getDefs(chalk2); const maybeHighlight = (chalkFn, string) => { return highlighted ? chalkFn(string) : string; }; @@ -23992,7 +23283,7 @@ var require_lib6 = __commonJS({ ${frame}`; } if (highlighted) { - return chalk3.reset(frame); + return chalk2.reset(frame); } else { return frame; } @@ -24033,7 +23324,7 @@ var require_parse_json = __commonJS({ fileName: errorEx.append("in %s"), codeFrame: errorEx.append("\n\n%s\n") }); - var parseJson = (string, reviver, filename) => { + var parseJson2 = (string, reviver, filename) => { if (typeof reviver === "string") { filename = reviver; reviver = null; @@ -24066,8 +23357,8 @@ var require_parse_json = __commonJS({ throw jsonError; } }; - parseJson.JSONError = JSONError; - module2.exports = parseJson; + parseJson2.JSONError = JSONError; + module2.exports = parseJson2; } }); @@ -24099,9 +23390,9 @@ var require_common2 = __commonJS({ } return target; } - function repeat(string, count) { + function repeat(string, count3) { var result = "", cycle; - for (cycle = 0; cycle < count; cycle += 1) { + for (cycle = 0; cycle < count3; cycle += 1) { result += string; } return result; @@ -24179,8 +23470,8 @@ var require_snippet = __commonJS({ // relative position }; } - function padStart(string, max) { - return common.repeat(" ", max - string.length) + string; + function padStart(string, max4) { + return common.repeat(" ", max4 - string.length) + string; } function makeSnippet(mark, options) { options = Object.create(options || null); @@ -24197,12 +23488,12 @@ var require_snippet = __commonJS({ var re = /\r?\n|\r|\0/g; var lineStarts = [0]; var lineEnds = []; - var match; + var match2; var foundLineNo = -1; - while (match = re.exec(mark.buffer)) { - lineEnds.push(match.index); - lineStarts.push(match.index + match[0].length); - if (mark.position <= match.index && foundLineNo < 0) { + while (match2 = re.exec(mark.buffer)) { + lineEnds.push(match2.index); + lineStarts.push(match2.index + match2[0].length); + if (mark.position <= match2.index && foundLineNo < 0) { foundLineNo = lineStarts.length - 2; } } @@ -24266,11 +23557,11 @@ var require_type = __commonJS({ "sequence", "mapping" ]; - function compileStyleAliases(map) { + function compileStyleAliases(map3) { var result = {}; - if (map !== null) { - Object.keys(map).forEach(function(style) { - map[style].forEach(function(alias) { + if (map3 !== null) { + Object.keys(map3).forEach(function(style) { + map3[style].forEach(function(alias) { result[String(alias)] = style; }); }); @@ -24464,8 +23755,8 @@ var require_null = __commonJS({ function resolveYamlNull(data) { if (data === null) return true; - var max = data.length; - return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL"); + var max4 = data.length; + return max4 === 1 && data === "~" || max4 === 4 && (data === "null" || data === "Null" || data === "NULL"); } function constructYamlNull() { return null; @@ -24508,8 +23799,8 @@ var require_bool = __commonJS({ function resolveYamlBoolean(data) { if (data === null) return false; - var max = data.length; - return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE"); + var max4 = data.length; + return max4 === 4 && (data === "true" || data === "True" || data === "TRUE") || max4 === 5 && (data === "false" || data === "False" || data === "FALSE"); } function constructYamlBoolean(data) { return data === "true" || data === "True" || data === "TRUE"; @@ -24556,20 +23847,20 @@ var require_int = __commonJS({ function resolveYamlInteger(data) { if (data === null) return false; - var max = data.length, index = 0, hasDigits = false, ch; - if (!max) + var max4 = data.length, index = 0, hasDigits = false, ch; + if (!max4) return false; ch = data[index]; if (ch === "-" || ch === "+") { ch = data[++index]; } if (ch === "0") { - if (index + 1 === max) + if (index + 1 === max4) return true; ch = data[++index]; if (ch === "b") { index++; - for (; index < max; index++) { + for (; index < max4; index++) { ch = data[index]; if (ch === "_") continue; @@ -24581,7 +23872,7 @@ var require_int = __commonJS({ } if (ch === "x") { index++; - for (; index < max; index++) { + for (; index < max4; index++) { ch = data[index]; if (ch === "_") continue; @@ -24593,7 +23884,7 @@ var require_int = __commonJS({ } if (ch === "o") { index++; - for (; index < max; index++) { + for (; index < max4; index++) { ch = data[index]; if (ch === "_") continue; @@ -24606,7 +23897,7 @@ var require_int = __commonJS({ } if (ch === "_") return false; - for (; index < max; index++) { + for (; index < max4; index++) { ch = data[index]; if (ch === "_") continue; @@ -24805,33 +24096,33 @@ var require_timestamp = __commonJS({ return false; } function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; - match = YAML_DATE_REGEXP.exec(data); - if (match === null) - match = YAML_TIMESTAMP_REGEXP.exec(data); - if (match === null) + var match2, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match2 = YAML_DATE_REGEXP.exec(data); + if (match2 === null) + match2 = YAML_TIMESTAMP_REGEXP.exec(data); + if (match2 === null) throw new Error("Date resolve error"); - year = +match[1]; - month = +match[2] - 1; - day = +match[3]; - if (!match[4]) { + year = +match2[1]; + month = +match2[2] - 1; + day = +match2[3]; + if (!match2[4]) { return new Date(Date.UTC(year, month, day)); } - hour = +match[4]; - minute = +match[5]; - second = +match[6]; - if (match[7]) { - fraction = match[7].slice(0, 3); + hour = +match2[4]; + minute = +match2[5]; + second = +match2[6]; + if (match2[7]) { + fraction = match2[7].slice(0, 3); while (fraction.length < 3) { fraction += "0"; } fraction = +fraction; } - if (match[9]) { - tz_hour = +match[10]; - tz_minute = +(match[11] || 0); + if (match2[9]) { + tz_hour = +match2[10]; + tz_minute = +(match2[11] || 0); delta = (tz_hour * 60 + tz_minute) * 6e4; - if (match[9] === "-") + if (match2[9] === "-") delta = -delta; } date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); @@ -24876,9 +24167,9 @@ var require_binary = __commonJS({ function resolveYamlBinary(data) { if (data === null) return false; - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); + var code, idx2, bitlen = 0, max4 = data.length, map3 = BASE64_MAP; + for (idx2 = 0; idx2 < max4; idx2++) { + code = map3.indexOf(data.charAt(idx2)); if (code > 64) continue; if (code < 0) @@ -24888,16 +24179,16 @@ var require_binary = __commonJS({ return bitlen % 8 === 0; } function constructYamlBinary(data) { - var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = []; - for (idx = 0; idx < max; idx++) { - if (idx % 4 === 0 && idx) { + var idx2, tailbits, input = data.replace(/[\r\n=]/g, ""), max4 = input.length, map3 = BASE64_MAP, bits = 0, result = []; + for (idx2 = 0; idx2 < max4; idx2++) { + if (idx2 % 4 === 0 && idx2) { result.push(bits >> 16 & 255); result.push(bits >> 8 & 255); result.push(bits & 255); } - bits = bits << 6 | map.indexOf(input.charAt(idx)); + bits = bits << 6 | map3.indexOf(input.charAt(idx2)); } - tailbits = max % 4 * 6; + tailbits = max4 % 4 * 6; if (tailbits === 0) { result.push(bits >> 16 & 255); result.push(bits >> 8 & 255); @@ -24911,32 +24202,32 @@ var require_binary = __commonJS({ return new Uint8Array(result); } function representYamlBinary(object) { - var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP; - for (idx = 0; idx < max; idx++) { - if (idx % 3 === 0 && idx) { - result += map[bits >> 18 & 63]; - result += map[bits >> 12 & 63]; - result += map[bits >> 6 & 63]; - result += map[bits & 63]; + var result = "", bits = 0, idx2, tail, max4 = object.length, map3 = BASE64_MAP; + for (idx2 = 0; idx2 < max4; idx2++) { + if (idx2 % 3 === 0 && idx2) { + result += map3[bits >> 18 & 63]; + result += map3[bits >> 12 & 63]; + result += map3[bits >> 6 & 63]; + result += map3[bits & 63]; } - bits = (bits << 8) + object[idx]; + bits = (bits << 8) + object[idx2]; } - tail = max % 3; + tail = max4 % 3; if (tail === 0) { - result += map[bits >> 18 & 63]; - result += map[bits >> 12 & 63]; - result += map[bits >> 6 & 63]; - result += map[bits & 63]; + result += map3[bits >> 18 & 63]; + result += map3[bits >> 12 & 63]; + result += map3[bits >> 6 & 63]; + result += map3[bits & 63]; } else if (tail === 2) { - result += map[bits >> 10 & 63]; - result += map[bits >> 4 & 63]; - result += map[bits << 2 & 63]; - result += map[64]; + result += map3[bits >> 10 & 63]; + result += map3[bits >> 4 & 63]; + result += map3[bits << 2 & 63]; + result += map3[64]; } else if (tail === 1) { - result += map[bits >> 2 & 63]; - result += map[bits << 4 & 63]; - result += map[64]; - result += map[64]; + result += map3[bits >> 2 & 63]; + result += map3[bits << 4 & 63]; + result += map3[64]; + result += map3[64]; } return result; } @@ -25006,28 +24297,28 @@ var require_pairs = __commonJS({ function resolveYamlPairs(data) { if (data === null) return true; - var index, length, pair, keys, result, object = data; + var index, length, pair, keys2, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; if (_toString.call(pair) !== "[object Object]") return false; - keys = Object.keys(pair); - if (keys.length !== 1) + keys2 = Object.keys(pair); + if (keys2.length !== 1) return false; - result[index] = [keys[0], pair[keys[0]]]; + result[index] = [keys2[0], pair[keys2[0]]]; } return true; } function constructYamlPairs(data) { if (data === null) return []; - var index, length, pair, keys, result, object = data; + var index, length, pair, keys2, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; - keys = Object.keys(pair); - result[index] = [keys[0], pair[keys[0]]]; + keys2 = Object.keys(pair); + result[index] = [keys2[0], pair[keys2[0]]]; } return result; } @@ -25211,19 +24502,19 @@ var require_loader = __commonJS({ } var directiveHandlers = { YAML: function handleYamlDirective(state, name, args) { - var match, major, minor; + var match2, major, minor; if (state.version !== null) { throwError(state, "duplication of %YAML directive"); } if (args.length !== 1) { throwError(state, "YAML directive accepts exactly one argument"); } - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - if (match === null) { + match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match2 === null) { throwError(state, "ill-formed argument of the YAML directive"); } - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); + major = parseInt(match2[1], 10); + minor = parseInt(match2[2], 10); if (major !== 1) { throwError(state, "unacceptable YAML version of the document"); } @@ -25398,11 +24689,11 @@ var require_loader = __commonJS({ } return false; } - function writeFoldedLines(state, count) { - if (count === 1) { + function writeFoldedLines(state, count3) { + if (count3 === 1) { state.result += " "; - } else if (count > 1) { - state.result += common.repeat("\n", count - 1); + } else if (count3 > 1) { + state.result += common.repeat("\n", count3 - 1); } } function readPlainScalar(state, nodeIndent, withinFlowCollection) { @@ -26126,7 +25417,7 @@ var require_loader = __commonJS({ } return state.tag !== null || state.anchor !== null || hasContent; } - function readDocument(state) { + function readDocument2(state) { var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; state.version = null; state.checkLineBreaks = state.legacy; @@ -26224,7 +25515,7 @@ var require_loader = __commonJS({ state.position += 1; } while (state.position < state.length - 1) { - readDocument(state); + readDocument2(state); } return state.documents; } @@ -26241,7 +25532,7 @@ var require_loader = __commonJS({ iterator(documents[index]); } } - function load(input, options) { + function load2(input, options) { var documents = loadDocuments(input, options); if (documents.length === 0) { return void 0; @@ -26251,7 +25542,7 @@ var require_loader = __commonJS({ throw new YAMLException("expected a single document in the stream, but found more"); } module2.exports.loadAll = loadAll; - module2.exports.load = load; + module2.exports.load = load2; } }); @@ -26324,15 +25615,15 @@ var require_dumper = __commonJS({ "OFF" ]; var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; - function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - if (map === null) + function compileStyleMap(schema, map3) { + var result, keys2, index, length, tag, style, type; + if (map3 === null) return {}; result = {}; - keys = Object.keys(map); - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); + keys2 = Object.keys(map3); + for (index = 0, length = keys2.length; index < length; index += 1) { + tag = keys2[index]; + style = String(map3[tag]); if (tag.slice(0, 2) === "!!") { tag = "tag:yaml.org,2002:" + tag.slice(2); } @@ -26442,14 +25733,14 @@ var require_dumper = __commonJS({ return !isWhitespace(c) && c !== CHAR_COLON; } function codePointAt(string, pos) { - var first = string.charCodeAt(pos), second; - if (first >= 55296 && first <= 56319 && pos + 1 < string.length) { + var first3 = string.charCodeAt(pos), second; + if (first3 >= 55296 && first3 <= 56319 && pos + 1 < string.length) { second = string.charCodeAt(pos + 1); if (second >= 56320 && second <= 57343) { - return (first - 55296) * 1024 + second - 56320 + 65536; + return (first3 - 55296) * 1024 + second - 56320 + 65536; } } - return first; + return first3; } function needIndentIndicator(string) { var leadingSpaceRe = /^\n* /; @@ -26571,9 +25862,9 @@ var require_dumper = __commonJS({ }(); var prevMoreIndented = string[0] === "\n" || string[0] === " "; var moreIndented; - var match; - while (match = lineRe.exec(string)) { - var prefix = match[1], line = match[2]; + var match2; + while (match2 = lineRe.exec(string)) { + var prefix = match2[1], line = match2[2]; moreIndented = line[0] === " "; result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width); prevMoreIndented = moreIndented; @@ -26584,11 +25875,11 @@ var require_dumper = __commonJS({ if (line === "" || line[0] === " ") return line; var breakRe = / [^ ]/g; - var match; + var match2; var start = 0, end, curr = 0, next = 0; var result = ""; - while (match = breakRe.exec(line)) { - next = match.index; + while (match2 = breakRe.exec(line)) { + next = match2.index; if (next - start > width) { end = curr > start ? curr : next; result += "\n" + line.slice(start, end); @@ -26899,7 +26190,7 @@ var require_dumper = __commonJS({ var require_js_yaml = __commonJS({ "node_modules/js-yaml/index.js"(exports, module2) { "use strict"; - var loader = require_loader(); + var loader2 = require_loader(); var dumper = require_dumper(); function renamed(from, to) { return function() { @@ -26912,8 +26203,8 @@ var require_js_yaml = __commonJS({ module2.exports.JSON_SCHEMA = require_json(); module2.exports.CORE_SCHEMA = require_core2(); module2.exports.DEFAULT_SCHEMA = require_default(); - module2.exports.load = loader.load; - module2.exports.loadAll = loader.loadAll; + module2.exports.load = loader2.load; + module2.exports.loadAll = loader2.loadAll; module2.exports.dump = dumper.dump; module2.exports.YAMLException = require_exception(); module2.exports.types = { @@ -26945,21 +26236,21 @@ var require_loaders = __commonJS({ value: true }); exports.loaders = void 0; - var importFresh; + var importFresh2; var loadJs = function loadJs2(filepath) { - if (importFresh === void 0) { - importFresh = require_import_fresh(); + if (importFresh2 === void 0) { + importFresh2 = require_import_fresh(); } - const result = importFresh(filepath); + const result = importFresh2(filepath); return result; }; - var parseJson; + var parseJson2; var loadJson = function loadJson2(filepath, content) { - if (parseJson === void 0) { - parseJson = require_parse_json(); + if (parseJson2 === void 0) { + parseJson2 = require_parse_json(); } try { - const result = parseJson(content); + const result = parseJson2(content); return result; } catch (error2) { error2.message = `JSON Error in ${filepath}: @@ -26981,12 +26272,12 @@ ${error2.message}`; throw error2; } }; - var loaders = { + var loaders2 = { loadJs, loadJson, loadYaml }; - exports.loaders = loaders; + exports.loaders = loaders2; } }); @@ -26998,11 +26289,11 @@ var require_getPropertyByPath = __commonJS({ value: true }); exports.getPropertyByPath = getPropertyByPath; - function getPropertyByPath(source, path16) { - if (typeof path16 === "string" && Object.prototype.hasOwnProperty.call(source, path16)) { - return source[path16]; + function getPropertyByPath(source, path26) { + if (typeof path26 === "string" && Object.prototype.hasOwnProperty.call(source, path26)) { + return source[path26]; } - const parsedPath = typeof path16 === "string" ? path16.split(".") : path16; + const parsedPath = typeof path26 === "string" ? path26.split(".") : path26; return parsedPath.reduce((previous, key) => { if (previous === void 0) { return previous; @@ -27055,12 +26346,12 @@ var require_ExplorerBase = __commonJS({ const config = this.config; config.searchPlaces.forEach((place) => { const loaderKey = _path.default.extname(place) || "noExt"; - const loader = config.loaders[loaderKey]; - if (!loader) { + const loader2 = config.loaders[loaderKey]; + if (!loader2) { throw new Error(`No loader specified for ${getExtensionDescription(place)}, so searchPlaces item "${place}" is invalid`); } - if (typeof loader !== "function") { - throw new Error(`loader for ${getExtensionDescription(place)} is not a function (type provided: "${typeof loader}"), so searchPlaces item "${place}" is invalid`); + if (typeof loader2 !== "function") { + throw new Error(`loader for ${getExtensionDescription(place)} is not a function (type provided: "${typeof loader2}"), so searchPlaces item "${place}" is invalid`); } }); } @@ -27088,15 +26379,15 @@ var require_ExplorerBase = __commonJS({ } getLoaderEntryForFile(filepath) { if (_path.default.basename(filepath) === "package.json") { - const loader2 = this.loadPackageProp.bind(this); - return loader2; + const loader3 = this.loadPackageProp.bind(this); + return loader3; } const loaderKey = _path.default.extname(filepath) || "noExt"; - const loader = this.config.loaders[loaderKey]; - if (!loader) { + const loader2 = this.config.loaders[loaderKey]; + if (!loader2) { throw new Error(`No loader specified for ${getExtensionDescription(filepath)}`); } - return loader; + return loader2; } loadedContentToCosmiconfigResult(filepath, loadedContent) { if (loadedContent === null) { @@ -27135,14 +26426,14 @@ var require_ExplorerBase = __commonJS({ var require_path_type = __commonJS({ "node_modules/path-type/index.js"(exports) { "use strict"; - var { promisify: promisify3 } = require("util"); - var fs6 = require("fs"); + var { promisify: promisify4 } = require("util"); + var fs9 = require("fs"); async function isType(fsStatType, statsMethodName, filePath) { if (typeof filePath !== "string") { throw new TypeError(`Expected a string, got ${typeof filePath}`); } try { - const stats = await promisify3(fs6[fsStatType])(filePath); + const stats = await promisify4(fs9[fsStatType])(filePath); return stats[statsMethodName](); } catch (error2) { if (error2.code === "ENOENT") { @@ -27156,7 +26447,7 @@ var require_path_type = __commonJS({ throw new TypeError(`Expected a string, got ${typeof filePath}`); } try { - return fs6[fsStatType](filePath)[statsMethodName](); + return fs9[fsStatType](filePath)[statsMethodName](); } catch (error2) { if (error2.code === "ENOENT") { return false; @@ -27213,24 +26504,24 @@ var require_readFile = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); - exports.readFile = readFile4; - exports.readFileSync = readFileSync5; + exports.readFile = readFile3; + exports.readFileSync = readFileSync3; var _fs = _interopRequireDefault(require("fs")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } async function fsReadFileAsync(pathname, encoding) { - return new Promise((resolve10, reject) => { + return new Promise((resolve13, reject) => { _fs.default.readFile(pathname, encoding, (error2, contents) => { if (error2) { reject(error2); return; } - resolve10(contents); + resolve13(contents); }); }); } - async function readFile4(filepath, options = {}) { + async function readFile3(filepath, options = {}) { const throwNotFound = options.throwNotFound === true; try { const content = await fsReadFileAsync(filepath, "utf8"); @@ -27242,7 +26533,7 @@ var require_readFile = __commonJS({ throw error2; } } - function readFileSync5(filepath, options = {}) { + function readFileSync3(filepath, options = {}) { const throwNotFound = options.throwNotFound === true; try { const content = _fs.default.readFileSync(filepath, "utf8"); @@ -27320,9 +26611,9 @@ var require_Explorer = __commonJS({ if (content.trim() === "") { return void 0; } - const loader = this.getLoaderEntryForFile(filepath); + const loader2 = this.getLoaderEntryForFile(filepath); try { - return await loader(filepath, content); + return await loader2(filepath, content); } catch (e) { e.filepath = filepath; throw e; @@ -27417,9 +26708,9 @@ var require_ExplorerSync = __commonJS({ if (content.trim() === "") { return void 0; } - const loader = this.getLoaderEntryForFile(filepath); + const loader2 = this.getLoaderEntryForFile(filepath); try { - return loader(filepath, content); + return loader2(filepath, content); } catch (e) { e.filepath = filepath; throw e; @@ -27468,8 +26759,8 @@ var require_dist = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); - exports.cosmiconfig = cosmiconfig; - exports.cosmiconfigSync = cosmiconfigSync; + exports.cosmiconfig = cosmiconfig2; + exports.cosmiconfigSync = cosmiconfigSync2; exports.defaultLoaders = void 0; var _os = _interopRequireDefault(require("os")); var _Explorer = require_Explorer(); @@ -27479,7 +26770,7 @@ var require_dist = __commonJS({ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function cosmiconfig(moduleName, options = {}) { + function cosmiconfig2(moduleName, options = {}) { const normalizedOptions = normalizeOptions(moduleName, options); const explorer = new _Explorer.Explorer(normalizedOptions); return { @@ -27490,7 +26781,7 @@ var require_dist = __commonJS({ clearCaches: explorer.clearCaches.bind(explorer) }; } - function cosmiconfigSync(moduleName, options = {}) { + function cosmiconfigSync2(moduleName, options = {}) { const normalizedOptions = normalizeOptions(moduleName, options); const explorerSync = new _ExplorerSync.ExplorerSync(normalizedOptions); return { @@ -27536,15542 +26827,8750 @@ var require_dist = __commonJS({ } }); -// node_modules/cspell-io/dist/cjs/async/asyncIterable.js -var require_asyncIterable = __commonJS({ - "node_modules/cspell-io/dist/cjs/async/asyncIterable.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toArray = void 0; - async function toArray3(asyncIterable) { - const data = []; - for await (const item of asyncIterable) { - data.push(item); - } - return data; - } - exports.toArray = toArray3; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/errors.js -var require_errors = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/errors.js"(exports) { +// node_modules/resolve-from/index.js +var require_resolve_from2 = __commonJS({ + "node_modules/resolve-from/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ErrorDuplicateSubsystem = exports.UnhandledHandlerError = exports.ErrorServiceRequestDepthExceeded = exports.ErrorUnhandledRequest = void 0; - var ErrorUnhandledRequest2 = class extends Error { - constructor(request) { - super(`Unhandled Request: ${request.type}`); - this.request = request; + var path26 = require("path"); + var Module = require("module"); + var fs9 = require("fs"); + var resolveFrom2 = (fromDirectory, moduleId, silent) => { + if (typeof fromDirectory !== "string") { + throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``); } - }; - exports.ErrorUnhandledRequest = ErrorUnhandledRequest2; - var ErrorServiceRequestDepthExceeded2 = class extends Error { - constructor(request, depth) { - super(`Service Request Depth ${depth} Exceeded: ${request.type}`); - this.request = request; - this.depth = depth; + if (typeof moduleId !== "string") { + throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); } - }; - exports.ErrorServiceRequestDepthExceeded = ErrorServiceRequestDepthExceeded2; - var UnhandledHandlerError2 = class extends Error { - constructor(handlerName, handlerDescription, cause) { - super(`Unhandled Error in Handler: ${handlerName}`); - this.handlerName = handlerName; - this.handlerDescription = handlerDescription; - this.cause = cause; + try { + fromDirectory = fs9.realpathSync(fromDirectory); + } catch (error2) { + if (error2.code === "ENOENT") { + fromDirectory = path26.resolve(fromDirectory); + } else if (silent) { + return; + } else { + throw error2; + } } - }; - exports.UnhandledHandlerError = UnhandledHandlerError2; - var ErrorDuplicateSubsystem = class extends Error { - constructor(subsystemName) { - super(`Duplicate subsystem: ${subsystemName}`); - this.subsystemName = subsystemName; + const fromFile = path26.join(fromDirectory, "noop.js"); + const resolveFileName = () => Module._resolveFilename(moduleId, { + id: fromFile, + filename: fromFile, + paths: Module._nodeModulePaths(fromDirectory) + }); + if (silent) { + try { + return resolveFileName(); + } catch (error2) { + return; + } } + return resolveFileName(); }; - exports.ErrorDuplicateSubsystem = ErrorDuplicateSubsystem; + module2.exports = (fromDirectory, moduleId) => resolveFrom2(fromDirectory, moduleId); + module2.exports.silent = (fromDirectory, moduleId) => resolveFrom2(fromDirectory, moduleId, true); } }); -// node_modules/@cspell/cspell-service-bus/dist/cjs/request.js -var require_request = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/request.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.isInstanceOfFn = exports.isServiceResponseFailure = exports.isServiceResponseSuccess = exports.createResponseFail = exports.createResponse = exports.ServiceRequestCls = void 0; - var BaseServiceRequest2 = class { - constructor(type, params) { - this.type = type; - this.params = params; - } - }; - var ServiceRequestCls2 = class extends BaseServiceRequest2 { - constructor(type, params) { - super(type, params); +// node_modules/ini/ini.js +var require_ini = __commonJS({ + "node_modules/ini/ini.js"(exports) { + exports.parse = exports.decode = decode2; + exports.stringify = exports.encode = encode; + exports.safe = safe; + exports.unsafe = unsafe; + var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n"; + function encode(obj, opt) { + var children = []; + var out = ""; + if (typeof opt === "string") { + opt = { + section: opt, + whitespace: false + }; + } else { + opt = opt || {}; + opt.whitespace = opt.whitespace === true; } - }; - exports.ServiceRequestCls = ServiceRequestCls2; - function createResponse2(value, _req) { - return { value }; + var separator = opt.whitespace ? " = " : "="; + Object.keys(obj).forEach(function(k, _, __) { + var val = obj[k]; + if (val && Array.isArray(val)) { + val.forEach(function(item) { + out += safe(k + "[]") + separator + safe(item) + "\n"; + }); + } else if (val && typeof val === "object") + children.push(k); + else + out += safe(k) + separator + safe(val) + eol; + }); + if (opt.section && out.length) + out = "[" + safe(opt.section) + "]" + eol + out; + children.forEach(function(k, _, __) { + var nk = dotSplit(k).join("\\."); + var section = (opt.section ? opt.section + "." : "") + nk; + var child = encode(obj[k], { + section, + whitespace: opt.whitespace + }); + if (out.length && child.length) + out += eol; + out += child; + }); + return out; } - exports.createResponse = createResponse2; - function createResponseFail2(_request, error2) { - return { error: error2 }; + function dotSplit(str) { + return str.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map(function(part) { + return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, ""); + }); } - exports.createResponseFail = createResponseFail2; - function isServiceResponseSuccess2(res) { - return "value" in res && res.error === void 0; + function decode2(str) { + var out = {}; + var p = out; + var section = null; + var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i; + var lines = str.split(/[\r\n]+/g); + lines.forEach(function(line, _, __) { + if (!line || line.match(/^\s*[;#]/)) + return; + var match2 = line.match(re); + if (!match2) + return; + if (match2[1] !== void 0) { + section = unsafe(match2[1]); + if (section === "__proto__") { + p = {}; + return; + } + p = out[section] = out[section] || {}; + return; + } + var key = unsafe(match2[2]); + if (key === "__proto__") + return; + var value = match2[3] ? unsafe(match2[4]) : true; + switch (value) { + case "true": + case "false": + case "null": + value = JSON.parse(value); + } + if (key.length > 2 && key.slice(-2) === "[]") { + key = key.substring(0, key.length - 2); + if (key === "__proto__") + return; + if (!p[key]) + p[key] = []; + else if (!Array.isArray(p[key])) + p[key] = [p[key]]; + } + if (Array.isArray(p[key])) + p[key].push(value); + else + p[key] = value; + }); + Object.keys(out).filter(function(k, _, __) { + if (!out[k] || typeof out[k] !== "object" || Array.isArray(out[k])) + return false; + var parts = dotSplit(k); + var p2 = out; + var l = parts.pop(); + var nl = l.replace(/\\\./g, "."); + parts.forEach(function(part, _2, __2) { + if (part === "__proto__") + return; + if (!p2[part] || typeof p2[part] !== "object") + p2[part] = {}; + p2 = p2[part]; + }); + if (p2 === out && nl === l) + return false; + p2[nl] = out[k]; + return true; + }).forEach(function(del, _, __) { + delete out[del]; + }); + return out; } - exports.isServiceResponseSuccess = isServiceResponseSuccess2; - function isServiceResponseFailure2(res) { - return res.error !== void 0; + function isQuoted(val) { + return val.charAt(0) === '"' && val.slice(-1) === '"' || val.charAt(0) === "'" && val.slice(-1) === "'"; } - exports.isServiceResponseFailure = isServiceResponseFailure2; - function isInstanceOfFn(constructor) { - return (t) => t instanceof constructor; + function safe(val) { + return typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim() ? JSON.stringify(val) : val.replace(/;/g, "\\;").replace(/#/g, "\\#"); + } + function unsafe(val, doUnesc) { + val = (val || "").trim(); + if (isQuoted(val)) { + if (val.charAt(0) === "'") + val = val.substr(1, val.length - 2); + try { + val = JSON.parse(val); + } catch (_) { + } + } else { + var esc = false; + var unesc = ""; + for (var i = 0, l = val.length; i < l; i++) { + var c = val.charAt(i); + if (esc) { + if ("\\;#".indexOf(c) !== -1) + unesc += c; + else + unesc += "\\" + c; + esc = false; + } else if (";#".indexOf(c) !== -1) + break; + else if (c === "\\") + esc = true; + else + unesc += c; + } + if (esc) + unesc += "\\"; + return unesc.trim(); + } + return val; } - exports.isInstanceOfFn = isInstanceOfFn; - exports.__testing__ = { - BaseServiceRequest: BaseServiceRequest2 - }; } }); -// node_modules/@cspell/cspell-service-bus/dist/cjs/bus.js -var require_bus = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/bus.js"(exports) { +// node_modules/global-dirs/index.js +var require_global_dirs = __commonJS({ + "node_modules/global-dirs/index.js"(exports) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createServiceBus = exports.ServiceBus = void 0; - var errors_js_1 = require_errors(); - var request_js_1 = require_request(); - var MAX_DEPTH2 = 10; - var ServiceBus2 = class { - constructor(handlers = []) { - this.handlers = []; - handlers.forEach((h) => this.addHandler(h)); - } - addHandler(handler, name = "anonymous", description) { - const h = typeof handler === "function" ? { fn: handler, name, description } : handler; - const { fn, name: _name, description: _description } = h; - this.handlers.push({ fn, name: _name, description: _description }); - return this; + var path26 = require("path"); + var os5 = require("os"); + var fs9 = require("fs"); + var ini = require_ini(); + var readRc = (fp) => { + try { + return ini.parse(fs9.readFileSync(fp, "utf8")).prefix; + } catch (err) { } - dispatch(request) { - let depth = 0; - const dispatcher = { dispatch }; - const handler = this.reduceHandlers(this.handlers, request, dispatcher, this.defaultHandler); - function dispatch(request2) { - ++depth; - if (depth >= MAX_DEPTH2) { - return (0, request_js_1.createResponseFail)(request2, new errors_js_1.ErrorServiceRequestDepthExceeded(request2, depth)); - } - const response = handler(request2); - --depth; - return response; - } - return dispatch(request); + }; + var defaultNpmPrefix = (() => { + if (process.env.PREFIX) { + return process.env.PREFIX; } - defaultHandler(request) { - return (0, request_js_1.createResponseFail)(request, new errors_js_1.ErrorUnhandledRequest(request)); + if (process.platform === "win32") { + return path26.dirname(process.execPath); } - reduceHandlers(handlers, request, dispatcher, defaultHandler) { - const _handlers = handlers.map((m) => ({ ...m, fn: m.fn(dispatcher) })); - const handler = _handlers.reduce((next, h) => { - const fn = h.fn(next); - return (req) => { - try { - return fn(req); - } catch (e) { - return (0, request_js_1.createResponseFail)(request, new errors_js_1.UnhandledHandlerError(h.name, h.description, e)); - } - }; - }, defaultHandler); - return handler; + return path26.dirname(path26.dirname(process.execPath)); + })(); + var getNpmPrefix = () => { + if (process.env.PREFIX) { + return process.env.PREFIX; } - }; - exports.ServiceBus = ServiceBus2; - function createServiceBus2(handlers = []) { - return new ServiceBus2(handlers); - } - exports.createServiceBus = createServiceBus2; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/createRequestHandler.js -var require_createRequestHandler = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/createRequestHandler.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createIsRequestHandler = exports.createIsRequestHandlerFn = exports.createRequestHandler = void 0; - function createRequestHandler2(requestDef, fn, name, description) { - return createIsRequestHandler2(requestDef.is, fn, name ?? requestDef.type, description); - } - exports.createRequestHandler = createRequestHandler2; - function createIsRequestHandlerFn2(isA, fn) { - return (dispatcher) => (next) => (request) => isA(request) ? fn(request, next, dispatcher) : next(request); - } - exports.createIsRequestHandlerFn = createIsRequestHandlerFn2; - function createIsRequestHandler2(isA, fn, name, description) { - return { - fn: createIsRequestHandlerFn2(isA, fn), - name, - description - }; - } - exports.createIsRequestHandler = createIsRequestHandler2; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/requestFactory.js -var require_requestFactory = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/requestFactory.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.requestFactory = void 0; - var createRequestHandler_js_1 = require_createRequestHandler(); - var request_js_1 = require_request(); - function requestFactory2(requestType) { - class RequestClass extends request_js_1.ServiceRequestCls { - constructor(params) { - super(requestType, params); - } - static is(req) { - return req instanceof RequestClass && req.type === requestType; - } - static create(params) { - return new RequestClass(params); + const homePrefix = readRc(path26.join(os5.homedir(), ".npmrc")); + if (homePrefix) { + return homePrefix; + } + const globalConfigPrefix = readRc(path26.resolve(defaultNpmPrefix, "etc", "npmrc")); + if (globalConfigPrefix) { + return globalConfigPrefix; + } + if (process.platform === "win32" && process.env.APPDATA) { + const prefix = path26.join(process.env.APPDATA, "npm"); + if (fs9.existsSync(prefix)) { + return prefix; } - static createRequestHandler(fn, name, description) { - return (0, createRequestHandler_js_1.createRequestHandler)(RequestClass, fn, name, description); + } + return defaultNpmPrefix; + }; + var npmPrefix = path26.resolve(getNpmPrefix()); + var getYarnPrefix = () => { + if (process.env.PREFIX) { + return process.env.PREFIX; + } + if (process.platform === "win32" && process.env.LOCALAPPDATA) { + const prefix = path26.join(process.env.LOCALAPPDATA, "Yarn"); + if (fs9.existsSync(prefix)) { + return prefix; } } - RequestClass.type = requestType; - return RequestClass; - } - exports.requestFactory = requestFactory2; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/index.js -var require_cjs2 = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.requestFactory = exports.ServiceRequestCls = exports.isServiceResponseSuccess = exports.isServiceResponseFailure = exports.createResponseFail = exports.createResponse = exports.createRequestHandler = exports.createIsRequestHandler = exports.ServiceBus = exports.createServiceBus = void 0; - var bus_js_1 = require_bus(); - Object.defineProperty(exports, "createServiceBus", { enumerable: true, get: function() { - return bus_js_1.createServiceBus; - } }); - Object.defineProperty(exports, "ServiceBus", { enumerable: true, get: function() { - return bus_js_1.ServiceBus; - } }); - var createRequestHandler_js_1 = require_createRequestHandler(); - Object.defineProperty(exports, "createIsRequestHandler", { enumerable: true, get: function() { - return createRequestHandler_js_1.createIsRequestHandler; - } }); - Object.defineProperty(exports, "createRequestHandler", { enumerable: true, get: function() { - return createRequestHandler_js_1.createRequestHandler; - } }); - var request_js_1 = require_request(); - Object.defineProperty(exports, "createResponse", { enumerable: true, get: function() { - return request_js_1.createResponse; - } }); - Object.defineProperty(exports, "createResponseFail", { enumerable: true, get: function() { - return request_js_1.createResponseFail; - } }); - Object.defineProperty(exports, "isServiceResponseFailure", { enumerable: true, get: function() { - return request_js_1.isServiceResponseFailure; - } }); - Object.defineProperty(exports, "isServiceResponseSuccess", { enumerable: true, get: function() { - return request_js_1.isServiceResponseSuccess; - } }); - Object.defineProperty(exports, "ServiceRequestCls", { enumerable: true, get: function() { - return request_js_1.ServiceRequestCls; - } }); - var requestFactory_js_1 = require_requestFactory(); - Object.defineProperty(exports, "requestFactory", { enumerable: true, get: function() { - return requestFactory_js_1.requestFactory; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/common/stat.js -var require_stat = __commonJS({ - "node_modules/cspell-io/dist/cjs/common/stat.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.compareStats = void 0; - function compareStats2(left, right) { - if (left === right) - return 0; - if (left.eTag || right.eTag) - return left.eTag === right.eTag ? 0 : (left.eTag || "") < (right.eTag || "") ? -1 : 1; - const diff = left.size - right.size || left.mtimeMs - right.mtimeMs; - return diff < 0 ? -1 : diff > 0 ? 1 : 0; - } - exports.compareStats = compareStats2; - } -}); - -// node_modules/cspell-io/dist/cjs/errors/ErrorNotImplemented.js -var require_ErrorNotImplemented = __commonJS({ - "node_modules/cspell-io/dist/cjs/errors/ErrorNotImplemented.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ErrorNotImplemented = void 0; - var ErrorNotImplemented2 = class extends Error { - constructor(method) { - super(`Method ${method} is not supported.`); - this.method = method; + const configPrefix = path26.join(os5.homedir(), ".config/yarn"); + if (fs9.existsSync(configPrefix)) { + return configPrefix; + } + const homePrefix = path26.join(os5.homedir(), ".yarn-config"); + if (fs9.existsSync(homePrefix)) { + return homePrefix; } + return npmPrefix; }; - exports.ErrorNotImplemented = ErrorNotImplemented2; + exports.npm = {}; + exports.npm.prefix = npmPrefix; + exports.npm.packages = path26.join(npmPrefix, process.platform === "win32" ? "node_modules" : "lib/node_modules"); + exports.npm.binaries = process.platform === "win32" ? npmPrefix : path26.join(npmPrefix, "bin"); + var yarnPrefix = path26.resolve(getYarnPrefix()); + exports.yarn = {}; + exports.yarn.prefix = yarnPrefix; + exports.yarn.packages = path26.join(yarnPrefix, process.platform === "win32" ? "config/global/node_modules" : "global/node_modules"); + exports.yarn.binaries = path26.join(exports.yarn.packages, ".bin"); } }); -// node_modules/cspell-io/dist/cjs/common/encode-decode.js -var require_encode_decode = __commonJS({ - "node_modules/cspell-io/dist/cjs/common/encode-decode.js"(exports) { +// node_modules/resolve-global/index.js +var require_resolve_global = __commonJS({ + "node_modules/resolve-global/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.calcEncodingFromBom = exports.encodeUtf16BE = exports.encodeUtf16LE = exports.encodeString = exports.swapBytes = exports.swapBytesInPlace = exports.decode = exports.decodeUtf16BE = exports.decodeUtf16LE = void 0; - var BOM_BE2 = 65279; - var BOM_LE2 = 65534; - function decodeUtf16LE2(buf) { - const bom = buf[0] << 8 | buf[1]; - buf = bom === BOM_LE2 ? buf.subarray(2) : buf; - return buf.toString("utf16le"); - } - exports.decodeUtf16LE = decodeUtf16LE2; - function decodeUtf16BE2(buf) { - return decodeUtf16LE2(swapBytes2(buf)); - } - exports.decodeUtf16BE = decodeUtf16BE2; - function decode2(buf, encoding) { - switch (encoding) { - case "utf16be": - return decodeUtf16BE2(buf); - case "utf16le": - return decodeUtf16LE2(buf); - } - if (buf.length < 2 || encoding && !encoding.startsWith("utf")) - return buf.toString(encoding); - const bom = buf[0] << 8 | buf[1]; - if (bom === BOM_BE2 || buf[0] === 0 && buf[1] !== 0) - return decodeUtf16BE2(buf); - if (bom === BOM_LE2 || buf[0] !== 0 && buf[1] === 0) - return decodeUtf16LE2(buf); - return buf.toString(encoding); - } - exports.decode = decode2; - function swapBytesInPlace2(buf) { - for (let i = 0; i < buf.length - 1; i += 2) { - const v = buf[i]; - buf[i] = buf[i + 1]; - buf[i + 1] = v; - } - return buf; - } - exports.swapBytesInPlace = swapBytesInPlace2; - function swapBytes2(buf) { - const tBuf = Buffer.from(buf); - return swapBytesInPlace2(tBuf); - } - exports.swapBytes = swapBytes2; - function encodeString2(str, encoding, bom) { - switch (encoding) { - case "utf16be": - return encodeUtf16BE(str, bom); - case "utf16le": - return encodeUtf16LE(str, bom); - } - return Buffer.from(str, encoding); - } - exports.encodeString = encodeString2; - function encodeUtf16LE(str, bom = true) { - const buf = Buffer.from(str, "utf16le"); - if (bom) { - const target = Buffer.alloc(buf.length + 2); - target.writeUint16LE(BOM_BE2); - buf.copy(target, 2); - return target; + var path26 = require("path"); + var globalDirs = require_global_dirs(); + var resolveGlobal2 = (moduleId) => { + try { + return require.resolve(path26.join(globalDirs.yarn.packages, moduleId)); + } catch (_) { + return require.resolve(path26.join(globalDirs.npm.packages, moduleId)); } - return buf; - } - exports.encodeUtf16LE = encodeUtf16LE; - function encodeUtf16BE(str, bom = true) { - return swapBytesInPlace2(encodeUtf16LE(str, bom)); - } - exports.encodeUtf16BE = encodeUtf16BE; - function calcEncodingFromBom2(buf) { - if (buf.length < 2) + }; + module2.exports = resolveGlobal2; + module2.exports.silent = (moduleId) => { + try { + return resolveGlobal2(moduleId); + } catch (_) { return void 0; - switch (buf[0] << 8 | buf[1]) { - case BOM_BE2: - return "utf16be"; - case BOM_LE2: - return "utf16le"; } - return void 0; - } - exports.calcEncodingFromBom = calcEncodingFromBom2; + }; } }); -// node_modules/cspell-io/dist/cjs/errors/error.js -var require_error = __commonJS({ - "node_modules/cspell-io/dist/cjs/errors/error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toError = void 0; - function toError4(e) { - if (e instanceof Error) - return e; - if (typeof e === "object" && e && typeof e.message === "string") { - return e; - } - return Error(e && e.toString()); - } - exports.toError = toError4; - } -}); - -// node_modules/cspell-io/dist/cjs/errors/index.js -var require_errors2 = __commonJS({ - "node_modules/cspell-io/dist/cjs/errors/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ErrorNotImplemented = exports.toError = void 0; - var error_js_1 = require_error(); - Object.defineProperty(exports, "toError", { enumerable: true, get: function() { - return error_js_1.toError; - } }); - var ErrorNotImplemented_js_1 = require_ErrorNotImplemented(); - Object.defineProperty(exports, "ErrorNotImplemented", { enumerable: true, get: function() { - return ErrorNotImplemented_js_1.ErrorNotImplemented; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/util.js -var require_util3 = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.basename = exports.urlDirname = exports.urlBasename = exports.toURL = exports.isFileURL = exports.isSupportedURL = exports.isUrlLike = exports.isZipped = void 0; - var url_1 = require("url"); - var isZippedRegExp = /\.gz($|[?#])/i; - var isURLRegExp2 = /^(\w{2,64}:\/\/|data:)/i; - var supportedProtocols = { "file:": true, "http:": true, "https:": true }; - function isZipped2(filename) { - const path16 = typeof filename === "string" ? filename : filename.pathname; - return isZippedRegExp.test(path16); - } - exports.isZipped = isZipped2; - function isUrlLike2(filename) { - return filename instanceof URL || isURLRegExp2.test(filename); - } - exports.isUrlLike = isUrlLike2; - function isSupportedURL2(url) { - return !!supportedProtocols[url.protocol]; - } - exports.isSupportedURL = isSupportedURL2; - function isFileURL2(url) { - return url.protocol === "file:"; - } - exports.isFileURL = isFileURL2; - function toURL2(filename) { - return filename instanceof URL || typeof filename !== "string" ? filename : isUrlLike2(filename) ? new URL(filename) : (0, url_1.pathToFileURL)(filename); - } - exports.toURL = toURL2; - var regMatchFilename2 = /filename=([^;,]*)/; - function urlBasename2(url) { - function guessDataUrlName(header) { - const filenameMatch = header.match(regMatchFilename2); - if (filenameMatch) - return filenameMatch[1]; - const mime = header.split(";", 1)[0]; - return mime.replace(/\W/g, "."); - } - if (typeof url === "string" && url.startsWith("data:")) { - return guessDataUrlName(url.split(",", 1)[0].split(":", 2)[1]); - } - url = toURL2(url); - if (url.protocol === "data:") { - return guessDataUrlName(url.pathname.split(",", 1)[0]); - } - return basename3(url.pathname); - } - exports.urlBasename = urlBasename2; - function urlDirname2(url) { - if (typeof url === "string" && url.startsWith("data:")) { - return toURL2("data:"); - } - url = toURL2(url); - if (url.protocol === "data:") { - return toURL2("data:"); - } - return new URL(url.pathname.endsWith("/") ? ".." : ".", url); - } - exports.urlDirname = urlDirname2; - function basename3(path16) { - path16 = path16.endsWith("/") ? path16.slice(0, path16.length - 1) : path16; - const idx = path16.lastIndexOf("/"); - return idx >= 0 ? path16.slice(idx + 1) || "" : path16; - } - exports.basename = basename3; - } -}); - -// node_modules/cspell-io/dist/cjs/node/dataUrl.js -var require_dataUrl = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/dataUrl.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.guessMimeType = exports.encodeDataUrlFromFile = exports.decodeDataUrl = exports.toDataUrl = exports.encodeDataUrl = void 0; - var fs_1 = require("fs"); - var fsPath = __importStar(require("path")); - var util_js_1 = require_util3(); - function encodeDataUrl2(data, mediaType, attributes) { - if (typeof data === "string") - return encodeString2(data, mediaType, attributes); - const attribs = encodeAttributes(attributes || []); - return `data:${mediaType}${attribs};base64,${data.toString("base64url")}`; - } - exports.encodeDataUrl = encodeDataUrl2; - function toDataUrl2(data, mediaType, attributes) { - return new URL(encodeDataUrl2(data, mediaType, attributes)); - } - exports.toDataUrl = toDataUrl2; - function encodeString2(data, mediaType, attributes) { - mediaType = mediaType || "text/plain"; - attributes = attributes || []; - const asUrlComp = encodeURIComponent(data); - const asBase64 = Buffer.from(data).toString("base64url"); - const useBase64 = asBase64.length < asUrlComp.length - 7; - const encoded = useBase64 ? asBase64 : asUrlComp; - const attribMap = new Map([["charset", "utf8"]].concat([...attributes])); - attribMap.set("charset", "utf8"); - const attribs = encodeAttributes(attribMap); - return `data:${mediaType}${attribs}${useBase64 ? ";base64" : ""},${encoded}`; - } - function encodeAttributes(attributes) { - return [...attributes].map(([key, value]) => `;${key}=${encodeURIComponent(value)}`).join(""); - } - var dataUrlRegExHead2 = /^data:(?[^;,]*)(?(?:;[^=]+=[^;,]*)*)(?;base64)?$/; - function decodeDataUrl2(url) { - url = url.toString(); - const [head, encodedData] = url.split(",", 2); - if (!head || encodedData === void 0) - throw Error("Not a data url"); - const match = head.match(dataUrlRegExHead2); - if (!match || !match.groups) - throw Error("Not a data url"); - const mediaType = match.groups["mediaType"] || ""; - const rawAttributes = (match.groups["attributes"] || "").split(";").filter((a) => !!a).map((entry) => entry.split("=", 2)).map(([key, value]) => [key, decodeURIComponent(value)]); - const attributes = new Map(rawAttributes); - const encoding = attributes.get("charset"); - const isBase64 = !!match.groups["base64"]; - const data = isBase64 ? Buffer.from(encodedData, "base64url") : Buffer.from(decodeURIComponent(encodedData)); - return { mediaType, data, encoding, attributes }; - } - exports.decodeDataUrl = decodeDataUrl2; - async function encodeDataUrlFromFile(path16, mediaType, attributes) { - const url = (0, util_js_1.toURL)(path16); - const filename = fsPath.basename(url.pathname); - const guess = guessMimeType(filename); - mediaType = mediaType || guess?.mimeType || "text/plain"; - const _attributes = new Map(attributes || []); - filename && _attributes.set("filename", filename); - const content = guess?.encoding ? await fs_1.promises.readFile(url, guess?.encoding) : await fs_1.promises.readFile(url); - return encodeDataUrl2(content, mediaType, _attributes); - } - exports.encodeDataUrlFromFile = encodeDataUrlFromFile; - function guessMimeType(filename) { - if (filename.endsWith(".trie")) - return { mimeType: "application/vnd.cspell.dictionary+trie", encoding: "utf-8" }; - if (filename.endsWith(".trie.gz")) - return { mimeType: "application/vnd.cspell.dictionary+trie.gz" }; - if (filename.endsWith(".txt")) - return { mimeType: "text/plain", encoding: "utf-8" }; - if (filename.endsWith(".gz")) - return { mimeType: "application/gzip" }; - if (filename.endsWith(".json")) - return { mimeType: "application/json", encoding: "utf-8" }; - if (filename.endsWith(".yaml") || filename.endsWith(".yml")) - return { mimeType: "application/x-yaml", encoding: "utf-8" }; - return void 0; - } - exports.guessMimeType = guessMimeType; - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/FetchError.js -var require_FetchError = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/FetchError.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.FetchUrlError = void 0; - var FetchUrlError2 = class _FetchUrlError extends Error { - constructor(message, code, status, url) { - super(message); - this.code = code; - this.status = status; - this.url = url; - this.name = "FetchUrlError"; - } - static create(url, status, message) { - if (status === 404) - return new _FetchUrlError(message || "URL not found.", "ENOENT", status, url); - if (status >= 400 && status < 500) - return new _FetchUrlError(message || "Permission denied.", "EACCES", status, url); - return new _FetchUrlError(message || "Fatal Error", "ECONNREFUSED", status, url); - } - }; - exports.FetchUrlError = FetchUrlError2; - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/fetch.js -var require_fetch = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/fetch.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; +// node_modules/graceful-fs/polyfills.js +var require_polyfills = __commonJS({ + "node_modules/graceful-fs/polyfills.js"(exports, module2) { + var constants = require("constants"); + var origCwd = process.cwd; + var cwd = null; + var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; + process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process); + return cwd; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fetchURL = exports.fetchHead = exports.fetch = void 0; - var node_fetch_1 = __importDefault(require_lib3()); - var FetchError_js_1 = require_FetchError(); - exports.fetch = node_fetch_1.default; - async function fetchHead2(request) { - const r = await (0, exports.fetch)(request, { method: "HEAD" }); - return r.headers; + try { + process.cwd(); + } catch (er) { } - exports.fetchHead = fetchHead2; - async function fetchURL2(url) { - const response = await (0, exports.fetch)(url); - if (!response.ok) { - throw FetchError_js_1.FetchUrlError.create(url, response.status); - } - return Buffer.from(await response.arrayBuffer()); + if (typeof process.chdir === "function") { + chdir = process.chdir; + process.chdir = function(d) { + cwd = null; + chdir.call(process, d); + }; + if (Object.setPrototypeOf) + Object.setPrototypeOf(process.chdir, chdir); } - exports.fetchURL = fetchURL2; - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/stat.js -var require_stat2 = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/stat.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStatHttp = exports.getStatSync = exports.getStat = void 0; - var fs_1 = require("fs"); - var util_1 = require("util"); - var fetch_js_1 = require_fetch(); - var util_js_1 = require_util3(); - async function getStat3(filenameOrUri) { - if ((0, util_js_1.isUrlLike)(filenameOrUri)) { - const url = (0, util_js_1.toURL)(filenameOrUri); - if (!(0, util_js_1.isFileURL)(url)) { - try { - return await getStatHttp2(url); - } catch (e) { - return toError4(e); - } - } + var chdir; + module2.exports = patch; + function patch(fs9) { + if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs9); + } + if (!fs9.lutimes) { + patchLutimes(fs9); + } + fs9.chown = chownFix(fs9.chown); + fs9.fchown = chownFix(fs9.fchown); + fs9.lchown = chownFix(fs9.lchown); + fs9.chmod = chmodFix(fs9.chmod); + fs9.fchmod = chmodFix(fs9.fchmod); + fs9.lchmod = chmodFix(fs9.lchmod); + fs9.chownSync = chownFixSync(fs9.chownSync); + fs9.fchownSync = chownFixSync(fs9.fchownSync); + fs9.lchownSync = chownFixSync(fs9.lchownSync); + fs9.chmodSync = chmodFixSync(fs9.chmodSync); + fs9.fchmodSync = chmodFixSync(fs9.fchmodSync); + fs9.lchmodSync = chmodFixSync(fs9.lchmodSync); + fs9.stat = statFix(fs9.stat); + fs9.fstat = statFix(fs9.fstat); + fs9.lstat = statFix(fs9.lstat); + fs9.statSync = statFixSync(fs9.statSync); + fs9.fstatSync = statFixSync(fs9.fstatSync); + fs9.lstatSync = statFixSync(fs9.lstatSync); + if (fs9.chmod && !fs9.lchmod) { + fs9.lchmod = function(path26, mode, cb) { + if (cb) + process.nextTick(cb); + }; + fs9.lchmodSync = function() { + }; } - return fs_1.promises.stat(filenameOrUri).catch((e) => toError4(e)); - } - exports.getStat = getStat3; - function getStatSync3(uri) { - try { - return (0, fs_1.statSync)(uri); - } catch (e) { - return toError4(e); + if (fs9.chown && !fs9.lchown) { + fs9.lchown = function(path26, uid, gid, cb) { + if (cb) + process.nextTick(cb); + }; + fs9.lchownSync = function() { + }; } - } - exports.getStatSync = getStatSync3; - async function getStatHttp2(url) { - const headers = await (0, fetch_js_1.fetchHead)(url); - const eTag = headers.get("etag") || void 0; - const guessSize = Number.parseInt(headers.get("content-length") || "0", 10); - return { - size: eTag ? -1 : guessSize, - mtimeMs: 0, - eTag - }; - } - exports.getStatHttp = getStatHttp2; - function toError4(e) { - if (isErrnoException(e) || e instanceof Error) - return e; - return new Error((0, util_1.format)(e)); - } - function isErrnoException(e) { - if (!e || typeof e !== "object") - return false; - const err = e; - return err.message !== void 0 && err.name !== void 0; - } - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsReadBinaryFile.js -var require_RequestFsReadBinaryFile = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsReadBinaryFile.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsReadBinaryFileSync = exports.RequestFsReadBinaryFile = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "fs:readBinaryFile"; - exports.RequestFsReadBinaryFile = (0, cspell_service_bus_1.requestFactory)(RequestType6); - var RequestTypeSync2 = "fs:readBinaryFileSync"; - exports.RequestFsReadBinaryFileSync = (0, cspell_service_bus_1.requestFactory)(RequestTypeSync2); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsReadFile.js -var require_RequestFsReadFile = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsReadFile.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsReadFile = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "fs:readFile"; - exports.RequestFsReadFile = (0, cspell_service_bus_1.requestFactory)(RequestType6); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsReadFileSync.js -var require_RequestFsReadFileSync = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsReadFileSync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsReadFileSync = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "fs:readFileSync"; - exports.RequestFsReadFileSync = (0, cspell_service_bus_1.requestFactory)(RequestType6); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsStat.js -var require_RequestFsStat = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsStat.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsStatSync = exports.RequestFsStat = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestTypeStat2 = "fs:stat"; - exports.RequestFsStat = (0, cspell_service_bus_1.requestFactory)(RequestTypeStat2); - var RequestTypeStatSync2 = "fs:statSync"; - exports.RequestFsStatSync = (0, cspell_service_bus_1.requestFactory)(RequestTypeStatSync2); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsWriteFile.js -var require_RequestFsWriteFile = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsWriteFile.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsWriteFile = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "fs:writeFile"; - exports.RequestFsWriteFile = (0, cspell_service_bus_1.requestFactory)(RequestType6); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestZlibInflate.js -var require_RequestZlibInflate = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestZlibInflate.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestZlibInflate = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "zlib:inflate"; - exports.RequestZlibInflate = (0, cspell_service_bus_1.requestFactory)(RequestType6); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/index.js -var require_requests = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestZlibInflate = exports.RequestFsWriteFile = exports.RequestFsStatSync = exports.RequestFsStat = exports.RequestFsReadFileSync = exports.RequestFsReadFile = exports.RequestFsReadBinaryFileSync = exports.RequestFsReadBinaryFile = void 0; - var RequestFsReadBinaryFile_js_1 = require_RequestFsReadBinaryFile(); - Object.defineProperty(exports, "RequestFsReadBinaryFile", { enumerable: true, get: function() { - return RequestFsReadBinaryFile_js_1.RequestFsReadBinaryFile; - } }); - Object.defineProperty(exports, "RequestFsReadBinaryFileSync", { enumerable: true, get: function() { - return RequestFsReadBinaryFile_js_1.RequestFsReadBinaryFileSync; - } }); - var RequestFsReadFile_js_1 = require_RequestFsReadFile(); - Object.defineProperty(exports, "RequestFsReadFile", { enumerable: true, get: function() { - return RequestFsReadFile_js_1.RequestFsReadFile; - } }); - var RequestFsReadFileSync_js_1 = require_RequestFsReadFileSync(); - Object.defineProperty(exports, "RequestFsReadFileSync", { enumerable: true, get: function() { - return RequestFsReadFileSync_js_1.RequestFsReadFileSync; - } }); - var RequestFsStat_js_1 = require_RequestFsStat(); - Object.defineProperty(exports, "RequestFsStat", { enumerable: true, get: function() { - return RequestFsStat_js_1.RequestFsStat; - } }); - Object.defineProperty(exports, "RequestFsStatSync", { enumerable: true, get: function() { - return RequestFsStat_js_1.RequestFsStatSync; - } }); - var RequestFsWriteFile_js_1 = require_RequestFsWriteFile(); - Object.defineProperty(exports, "RequestFsWriteFile", { enumerable: true, get: function() { - return RequestFsWriteFile_js_1.RequestFsWriteFile; - } }); - var RequestZlibInflate_js_1 = require_RequestZlibInflate(); - Object.defineProperty(exports, "RequestZlibInflate", { enumerable: true, get: function() { - return RequestZlibInflate_js_1.RequestZlibInflate; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/handlers/node/file.js -var require_file = __commonJS({ - "node_modules/cspell-io/dist/cjs/handlers/node/file.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.registerHandlers = void 0; - var cspell_service_bus_1 = require_cjs2(); - var assert_1 = __importDefault(require("assert")); - var fs_1 = require("fs"); - var url_1 = require("url"); - var zlib_1 = require("zlib"); - var encode_decode_js_1 = require_encode_decode(); - var index_js_1 = require_errors2(); - var dataUrl_js_1 = require_dataUrl(); - var fetch_js_1 = require_fetch(); - var stat_js_1 = require_stat2(); - var index_js_2 = require_requests(); - var isGzFileRegExp2 = /\.gz($|[?#])/; - function isGzFile2(url) { - return isGzFileRegExp2.test(url.pathname); - } - var handleRequestFsReadBinaryFile2 = index_js_2.RequestFsReadBinaryFile.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)(fs_1.promises.readFile((0, url_1.fileURLToPath)(params.url)).then((content) => ({ url: params.url, content }))), void 0, "Node: Read Binary File."); - var handleRequestFsReadBinaryFileSync2 = index_js_2.RequestFsReadBinaryFileSync.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)({ url: params.url, content: (0, fs_1.readFileSync)((0, url_1.fileURLToPath)(params.url)) }), void 0, "Node: Sync Read Binary File."); - var handleRequestFsReadFile2 = index_js_2.RequestFsReadFile.createRequestHandler((req, _, dispatcher) => { - const { url, encoding } = req.params; - const res = dispatcher.dispatch(index_js_2.RequestFsReadBinaryFile.create({ url })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - (0, assert_1.default)((0, cspell_service_bus_1.isServiceResponseFailure)(res)); - return (0, cspell_service_bus_1.createResponseFail)(req, res.error); - } - return (0, cspell_service_bus_1.createResponse)(res.value.then((res2) => ({ - url, - content: bufferToText2(res2.content, encoding), - baseFilename: res2.baseFilename - }))); - }, void 0, "Node: Read Text File."); - var handleRequestFsReadFileSync2 = index_js_2.RequestFsReadFileSync.createRequestHandler((req, _, dispatcher) => { - const { url, encoding } = req.params; - const res = dispatcher.dispatch(index_js_2.RequestFsReadBinaryFileSync.create({ url })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - (0, assert_1.default)((0, cspell_service_bus_1.isServiceResponseFailure)(res)); - return (0, cspell_service_bus_1.createResponseFail)(req, res.error); - } - return (0, cspell_service_bus_1.createResponse)({ - ...res.value, - content: bufferToText2(res.value.content, encoding) - }); - }, void 0, "Node: Sync Read Text File."); - var handleRequestZlibInflate2 = index_js_2.RequestZlibInflate.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)((0, zlib_1.gunzipSync)(params.data).toString("utf-8")), void 0, "Node: gz deflate."); - var supportedFetchProtocols2 = { "http:": true, "https:": true }; - var handleRequestFsReadBinaryFileHttp2 = index_js_2.RequestFsReadBinaryFile.createRequestHandler((req, next) => { - const { url } = req.params; - if (!(url.protocol in supportedFetchProtocols2)) - return next(req); - return (0, cspell_service_bus_1.createResponse)((0, fetch_js_1.fetchURL)(url).then((content) => ({ url, content }))); - }, void 0, "Node: Read Http(s) file."); - var handleRequestFsReadBinaryFileSyncData2 = index_js_2.RequestFsReadBinaryFileSync.createRequestHandler((req, next) => { - const { url } = req.params; - if (url.protocol !== "data:") - return next(req); - const data = (0, dataUrl_js_1.decodeDataUrl)(url); - return (0, cspell_service_bus_1.createResponse)({ url, content: data.data, baseFilename: data.attributes.get("filename") }); - }, void 0, "Node: Read data: urls."); - var handleRequestFsReadBinaryFileData2 = index_js_2.RequestFsReadBinaryFile.createRequestHandler((req, next, dispatcher) => { - const { url } = req.params; - if (url.protocol !== "data:") - return next(req); - const res = dispatcher.dispatch(index_js_2.RequestFsReadBinaryFileSync.create(req.params)); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) - return res; - return (0, cspell_service_bus_1.createResponse)(Promise.resolve(res.value)); - }, void 0, "Node: Read data: urls."); - function bufferToText2(buf, encoding) { - return buf[0] === 31 && buf[1] === 139 ? (0, encode_decode_js_1.decode)((0, zlib_1.gunzipSync)(buf), encoding) : (0, encode_decode_js_1.decode)(buf, encoding); - } - var handleRequestFsStat2 = index_js_2.RequestFsStat.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)(fs_1.promises.stat((0, url_1.fileURLToPath)(params.url))), void 0, "Node: fs.stat."); - var handleRequestFsStatSync2 = index_js_2.RequestFsStatSync.createRequestHandler((req) => { - const { params } = req; - try { - return (0, cspell_service_bus_1.createResponse)((0, fs_1.statSync)((0, url_1.fileURLToPath)(params.url))); - } catch (e) { - return (0, cspell_service_bus_1.createResponseFail)(req, (0, index_js_1.toError)(e)); - } - }, void 0, "Node: fs.stat."); - var handleRequestFsStatHttp2 = index_js_2.RequestFsStat.createRequestHandler((req, next) => { - const { url } = req.params; - if (!(url.protocol in supportedFetchProtocols2)) - return next(req); - return (0, cspell_service_bus_1.createResponse)((0, stat_js_1.getStatHttp)(url)); - }, void 0, "Node: http get stat"); - var handleRequestFsWriteFile2 = index_js_2.RequestFsWriteFile.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)(fs_1.promises.writeFile(params.url, params.content)), void 0, "Node: fs.writeFile"); - var handleRequestFsWriteFileGz2 = index_js_2.RequestFsWriteFile.createRequestHandler((req, next) => { - const { url, content } = req.params; - if (!isGzFile2(url)) - return next(req); - return (0, cspell_service_bus_1.createResponse)(fs_1.promises.writeFile(url, (0, zlib_1.gzipSync)(content))); - }, void 0, "Node: http get stat"); - function registerHandlers2(serviceBus) { - const handlers = [ - handleRequestFsWriteFile2, - handleRequestFsWriteFileGz2, - handleRequestFsReadBinaryFile2, - handleRequestFsReadBinaryFileSync2, - handleRequestFsReadBinaryFileHttp2, - handleRequestFsReadBinaryFileData2, - handleRequestFsReadBinaryFileSyncData2, - handleRequestFsReadFile2, - handleRequestFsReadFileSync2, - handleRequestZlibInflate2, - handleRequestFsStatSync2, - handleRequestFsStat2, - handleRequestFsStatHttp2 - ]; - handlers.forEach((handler) => serviceBus.addHandler(handler)); - } - exports.registerHandlers = registerHandlers2; - } -}); - -// node_modules/cspell-io/dist/cjs/CSpellIONode.js -var require_CSpellIONode = __commonJS({ - "node_modules/cspell-io/dist/cjs/CSpellIONode.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDefaultCSpellIO = exports.CSpellIONode = void 0; - var cspell_service_bus_1 = require_cjs2(); - var stat_js_1 = require_stat(); - var ErrorNotImplemented_js_1 = require_ErrorNotImplemented(); - var file_js_1 = require_file(); - var util_js_1 = require_util3(); - var index_js_1 = require_requests(); - var defaultCSpellIONode2 = void 0; - var CSpellIONode2 = class { - constructor(serviceBus = new cspell_service_bus_1.ServiceBus()) { - this.serviceBus = serviceBus; - (0, file_js_1.registerHandlers)(serviceBus); + if (platform === "win32") { + fs9.rename = typeof fs9.rename !== "function" ? fs9.rename : function(fs$rename) { + function rename(from, to, cb) { + var start = Date.now(); + var backoff = 0; + fs$rename(from, to, function CB(er) { + if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { + setTimeout(function() { + fs9.stat(to, function(stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er); + }); + }, backoff); + if (backoff < 100) + backoff += 10; + return; + } + if (cb) + cb(er); + }); + } + if (Object.setPrototypeOf) + Object.setPrototypeOf(rename, fs$rename); + return rename; + }(fs9.rename); } - readFile(uriOrFilename, encoding = "utf8") { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsReadFile.create({ url, encoding })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "readFile"); + fs9.read = typeof fs9.read !== "function" ? fs9.read : function(fs$read) { + function read2(fd, buffer, offset, length, position, callback_) { + var callback; + if (callback_ && typeof callback_ === "function") { + var eagCounter = 0; + callback = function(er, _, __) { + if (er && er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + return fs$read.call(fs9, fd, buffer, offset, length, position, callback); + } + callback_.apply(this, arguments); + }; + } + return fs$read.call(fs9, fd, buffer, offset, length, position, callback); } - return res.value; + if (Object.setPrototypeOf) + Object.setPrototypeOf(read2, fs$read); + return read2; + }(fs9.read); + fs9.readSync = typeof fs9.readSync !== "function" ? fs9.readSync : function(fs$readSync) { + return function(fd, buffer, offset, length, position) { + var eagCounter = 0; + while (true) { + try { + return fs$readSync.call(fs9, fd, buffer, offset, length, position); + } catch (er) { + if (er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + continue; + } + throw er; + } + } + }; + }(fs9.readSync); + function patchLchmod(fs10) { + fs10.lchmod = function(path26, mode, callback) { + fs10.open( + path26, + constants.O_WRONLY | constants.O_SYMLINK, + mode, + function(err, fd) { + if (err) { + if (callback) + callback(err); + return; + } + fs10.fchmod(fd, mode, function(err2) { + fs10.close(fd, function(err22) { + if (callback) + callback(err2 || err22); + }); + }); + } + ); + }; + fs10.lchmodSync = function(path26, mode) { + var fd = fs10.openSync(path26, constants.O_WRONLY | constants.O_SYMLINK, mode); + var threw = true; + var ret; + try { + ret = fs10.fchmodSync(fd, mode); + threw = false; + } finally { + if (threw) { + try { + fs10.closeSync(fd); + } catch (er) { + } + } else { + fs10.closeSync(fd); + } + } + return ret; + }; } - readFileSync(uriOrFilename, encoding = "utf8") { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsReadFileSync.create({ url, encoding })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "readFileSync"); + function patchLutimes(fs10) { + if (constants.hasOwnProperty("O_SYMLINK") && fs10.futimes) { + fs10.lutimes = function(path26, at, mt, cb) { + fs10.open(path26, constants.O_SYMLINK, function(er, fd) { + if (er) { + if (cb) + cb(er); + return; + } + fs10.futimes(fd, at, mt, function(er2) { + fs10.close(fd, function(er22) { + if (cb) + cb(er2 || er22); + }); + }); + }); + }; + fs10.lutimesSync = function(path26, at, mt) { + var fd = fs10.openSync(path26, constants.O_SYMLINK); + var ret; + var threw = true; + try { + ret = fs10.futimesSync(fd, at, mt); + threw = false; + } finally { + if (threw) { + try { + fs10.closeSync(fd); + } catch (er) { + } + } else { + fs10.closeSync(fd); + } + } + return ret; + }; + } else if (fs10.futimes) { + fs10.lutimes = function(_a2, _b, _c, cb) { + if (cb) + process.nextTick(cb); + }; + fs10.lutimesSync = function() { + }; } - return res.value; } - writeFile(uriOrFilename, content) { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsWriteFile.create({ url, content })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "writeFile"); - } - return res.value; + function chmodFix(orig) { + if (!orig) + return orig; + return function(target, mode, cb) { + return orig.call(fs9, target, mode, function(er) { + if (chownErOk(er)) + er = null; + if (cb) + cb.apply(this, arguments); + }); + }; } - getStat(uriOrFilename) { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsStat.create({ url })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "getStat"); - } - return res.value; + function chmodFixSync(orig) { + if (!orig) + return orig; + return function(target, mode) { + try { + return orig.call(fs9, target, mode); + } catch (er) { + if (!chownErOk(er)) + throw er; + } + }; } - getStatSync(uriOrFilename) { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsStatSync.create({ url })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "getStatSync"); - } - return res.value; + function chownFix(orig) { + if (!orig) + return orig; + return function(target, uid, gid, cb) { + return orig.call(fs9, target, uid, gid, function(er) { + if (chownErOk(er)) + er = null; + if (cb) + cb.apply(this, arguments); + }); + }; } - compareStats(left, right) { - return (0, stat_js_1.compareStats)(left, right); + function chownFixSync(orig) { + if (!orig) + return orig; + return function(target, uid, gid) { + try { + return orig.call(fs9, target, uid, gid); + } catch (er) { + if (!chownErOk(er)) + throw er; + } + }; } - toURL(uriOrFilename) { - return (0, util_js_1.toURL)(uriOrFilename); + function statFix(orig) { + if (!orig) + return orig; + return function(target, options, cb) { + if (typeof options === "function") { + cb = options; + options = null; + } + function callback(er, stats) { + if (stats) { + if (stats.uid < 0) + stats.uid += 4294967296; + if (stats.gid < 0) + stats.gid += 4294967296; + } + if (cb) + cb.apply(this, arguments); + } + return options ? orig.call(fs9, target, options, callback) : orig.call(fs9, target, callback); + }; } - uriBasename(uriOrFilename) { - return (0, util_js_1.urlBasename)(uriOrFilename); + function statFixSync(orig) { + if (!orig) + return orig; + return function(target, options) { + var stats = options ? orig.call(fs9, target, options) : orig.call(fs9, target); + if (stats) { + if (stats.uid < 0) + stats.uid += 4294967296; + if (stats.gid < 0) + stats.gid += 4294967296; + } + return stats; + }; } - uriDirname(uriOrFilename) { - return (0, util_js_1.urlDirname)(uriOrFilename); + function chownErOk(er) { + if (!er) + return true; + if (er.code === "ENOSYS") + return true; + var nonroot = !process.getuid || process.getuid() !== 0; + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true; + } + return false; } - }; - exports.CSpellIONode = CSpellIONode2; - function genError2(err, alt) { - return err || new ErrorNotImplemented_js_1.ErrorNotImplemented(alt); - } - function getDefaultCSpellIO2() { - if (defaultCSpellIONode2) - return defaultCSpellIONode2; - const cspellIO = new CSpellIONode2(); - defaultCSpellIONode2 = cspellIO; - return cspellIO; } - exports.getDefaultCSpellIO = getDefaultCSpellIO2; } }); -// node_modules/cspell-io/dist/cjs/common/transformers.js -var require_transformers = __commonJS({ - "node_modules/cspell-io/dist/cjs/common/transformers.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.encoderTransformer = exports.createDecoderTransformer = void 0; - var encode_decode_js_1 = require_encode_decode(); - function createDecoderTransformer2(encoding) { - function standardDecoder(buf) { - return (0, encode_decode_js_1.decode)(buf, encoding); - } - let decoder = void 0; - if (encoding && !encoding.startsWith("utf")) - return decoderNonUtf; - return decoderUtf; - async function* decoderNonUtf(iterable) { - for await (const buf of iterable) { - yield typeof buf === "string" ? buf : (0, encode_decode_js_1.decode)(buf, encoding); - } - } - async function* decoderUtf(iterable) { - for await (const sb of iterable) { - if (typeof sb === "string") { - yield sb; - continue; +// node_modules/graceful-fs/legacy-streams.js +var require_legacy_streams = __commonJS({ + "node_modules/graceful-fs/legacy-streams.js"(exports, module2) { + var Stream3 = require("stream").Stream; + module2.exports = legacy; + function legacy(fs9) { + return { + ReadStream, + WriteStream + }; + function ReadStream(path26, options) { + if (!(this instanceof ReadStream)) + return new ReadStream(path26, options); + Stream3.call(this); + var self = this; + this.path = path26; + this.fd = null; + this.readable = true; + this.paused = false; + this.flags = "r"; + this.mode = 438; + this.bufferSize = 64 * 1024; + options = options || {}; + var keys2 = Object.keys(options); + for (var index = 0, length = keys2.length; index < length; index++) { + var key = keys2[index]; + this[key] = options[key]; + } + if (this.encoding) + this.setEncoding(this.encoding); + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); } - if (sb.length < 2) { - yield standardDecoder(sb); - continue; + if (this.end === void 0) { + this.end = Infinity; + } else if ("number" !== typeof this.end) { + throw TypeError("end must be a Number"); } - if (decoder) { - yield decoder(sb); - continue; + if (this.start > this.end) { + throw new Error("start must be <= end"); } - decoder = standardDecoder; - const _encoding = (0, encode_decode_js_1.calcEncodingFromBom)(sb); - if (_encoding === "utf16le") { - decoder = encode_decode_js_1.decodeUtf16LE; - yield decoder(sb.subarray(2)); - continue; + this.pos = this.start; + } + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + fs9.open(this.path, this.flags, this.mode, function(err, fd) { + if (err) { + self.emit("error", err); + self.readable = false; + return; } - if (_encoding === "utf16be") { - decoder = encode_decode_js_1.decodeUtf16BE; - yield decoder(sb.subarray(2)); - continue; + self.fd = fd; + self.emit("open", fd); + self._read(); + }); + } + function WriteStream(path26, options) { + if (!(this instanceof WriteStream)) + return new WriteStream(path26, options); + Stream3.call(this); + this.path = path26; + this.fd = null; + this.writable = true; + this.flags = "w"; + this.encoding = "binary"; + this.mode = 438; + this.bytesWritten = 0; + options = options || {}; + var keys2 = Object.keys(options); + for (var index = 0, length = keys2.length; index < length; index++) { + var key = keys2[index]; + this[key] = options[key]; + } + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); } - yield decoder(sb); + if (this.start < 0) { + throw new Error("start must be >= zero"); + } + this.pos = this.start; + } + this.busy = false; + this._queue = []; + if (this.fd === null) { + this._open = fs9.open; + this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); + this.flush(); } } } - exports.createDecoderTransformer = createDecoderTransformer2; - function encoderTransformer2(iterable, encoding) { - return isAsyncIterable3(iterable) ? encoderAsyncIterable(iterable, encoding) : encoderIterable(iterable, encoding); - } - exports.encoderTransformer = encoderTransformer2; - function* encoderIterable(iterable, encoding) { - let useBom = true; - for (const chunk of iterable) { - yield (0, encode_decode_js_1.encodeString)(chunk, encoding, useBom); - useBom = false; - } - } - async function* encoderAsyncIterable(iterable, encoding) { - let useBom = true; - for await (const chunk of iterable) { - yield (0, encode_decode_js_1.encodeString)(chunk, encoding, useBom); - useBom = false; - } - } - function isAsyncIterable3(v) { - return v && typeof v === "object" && !!v[Symbol.asyncIterator]; - } } }); -// node_modules/cspell-io/dist/cjs/node/file/fileReader.js -var require_fileReader = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/fileReader.js"(exports) { +// node_modules/graceful-fs/clone.js +var require_clone = __commonJS({ + "node_modules/graceful-fs/clone.js"(exports, module2) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; + module2.exports = clone; + var getPrototypeOf = Object.getPrototypeOf || function(obj) { + return obj.__proto__; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readFileSync = exports.readFile = void 0; - var fs6 = __importStar(require("fs")); - var Stream3 = __importStar(require("stream")); - var url_1 = require("url"); - var util_1 = require("util"); - var zlib = __importStar(require("zlib")); - var encode_decode_js_1 = require_encode_decode(); - var transformers_js_1 = require_transformers(); - var fetch_js_1 = require_fetch(); - var FetchError_js_1 = require_FetchError(); - var util_js_1 = require_util3(); - var defaultEncoding = "utf8"; - var pipeline5 = (0, util_1.promisify)(Stream3.pipeline); - async function readFile4(filename, encoding) { - const url = (0, util_js_1.toURL)(filename); - if (!(0, util_js_1.isSupportedURL)(url)) { - throw new Error("Unsupported network protocol"); - } - return (0, util_js_1.isFileURL)(url) ? _readFile(url, encoding) : _fetchURL(url, encoding); - } - exports.readFile = readFile4; - function _readFile(url, encoding) { - const filename = (0, url_1.fileURLToPath)(url); - return _read(() => fs6.createReadStream(filename), (0, util_js_1.isZipped)(filename), encoding); - } - async function _fetchURL(url, encoding) { - const response = await (0, fetch_js_1.fetch)(url); - if (!response.ok) { - throw FetchError_js_1.FetchUrlError.create(url, response.status); - } - return _read(() => response.body, (0, util_js_1.isZipped)(url), encoding); - } - async function _read(getStream, isZipped2, encoding) { - const stream = getStream(); - const decoder = (0, transformers_js_1.createDecoderTransformer)(encoding); - const collector = createCollector(encoding || defaultEncoding); - return isZipped2 ? pipeline5(stream, zlib.createGunzip(), decoder, collector) : pipeline5(stream, decoder, collector); - } - function readFileSync5(filename, encoding) { - const rawData = fs6.readFileSync(filename); - const data = (0, util_js_1.isZipped)(filename) ? zlib.gunzipSync(rawData) : rawData; - return !encoding || encoding.startsWith("utf") ? (0, encode_decode_js_1.decode)(data) : data.toString(encoding); - } - exports.readFileSync = readFileSync5; - function createCollector(encoding) { - async function collect(iterable) { - const buf = []; - for await (const sb of iterable) { - buf.push(typeof sb === "string" ? sb : sb.toString(encoding)); - } - return buf.join(""); - } - return collect; - } - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/fileWriter.js -var require_fileWriter = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/fileWriter.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.writeToFileIterable = exports.writeToFile = void 0; - var fs6 = __importStar(require("fs")); - var Stream3 = __importStar(require("stream")); - var util_1 = require("util"); - var zlib = __importStar(require("zlib")); - var transformers_js_1 = require_transformers(); - var pipeline5 = (0, util_1.promisify)(Stream3.pipeline); - function writeToFile2(filename, data, encoding) { - return writeToFileIterable2(filename, typeof data === "string" ? [data] : data, encoding); - } - exports.writeToFile = writeToFile2; - function writeToFileIterable2(filename, data, encoding) { - const stream = Stream3.Readable.from((0, transformers_js_1.encoderTransformer)(data, encoding)); - const zip = filename.match(/\.gz$/) ? zlib.createGzip() : new Stream3.PassThrough(); - return pipeline5(stream, zip, fs6.createWriteStream(filename)); + function clone(obj) { + if (obj === null || typeof obj !== "object") + return obj; + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) }; + else + var copy = /* @__PURE__ */ Object.create(null); + Object.getOwnPropertyNames(obj).forEach(function(key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); + }); + return copy; } - exports.writeToFileIterable = writeToFileIterable2; - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/index.js -var require_file2 = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStatSync = exports.getStat = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = void 0; - var fileReader_js_1 = require_fileReader(); - Object.defineProperty(exports, "readFile", { enumerable: true, get: function() { - return fileReader_js_1.readFile; - } }); - Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function() { - return fileReader_js_1.readFileSync; - } }); - var fileWriter_js_1 = require_fileWriter(); - Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function() { - return fileWriter_js_1.writeToFile; - } }); - Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function() { - return fileWriter_js_1.writeToFileIterable; - } }); - var stat_js_1 = require_stat2(); - Object.defineProperty(exports, "getStat", { enumerable: true, get: function() { - return stat_js_1.getStat; - } }); - Object.defineProperty(exports, "getStatSync", { enumerable: true, get: function() { - return stat_js_1.getStatSync; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/file/file.js -var require_file3 = __commonJS({ - "node_modules/cspell-io/dist/cjs/file/file.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStatSync = exports.getStat = exports.readFileSync = exports.readFile = void 0; - var CSpellIONode_js_1 = require_CSpellIONode(); - var index_js_1 = require_errors2(); - var readFile4 = function(filename, encoding) { - return (0, CSpellIONode_js_1.getDefaultCSpellIO)().readFile(filename, encoding).then((fr) => fr.content); - }; - exports.readFile = readFile4; - var readFileSync5 = function(filename, encoding) { - return (0, CSpellIONode_js_1.getDefaultCSpellIO)().readFileSync(filename, encoding).content; - }; - exports.readFileSync = readFileSync5; - var getStat3 = function(filenameOrUri) { - return (0, CSpellIONode_js_1.getDefaultCSpellIO)().getStat(filenameOrUri).catch(index_js_1.toError); - }; - exports.getStat = getStat3; - var getStatSync3 = function(filenameOrUri) { - try { - return (0, CSpellIONode_js_1.getDefaultCSpellIO)().getStatSync(filenameOrUri); - } catch (e) { - return (0, index_js_1.toError)(e); - } - }; - exports.getStatSync = getStatSync3; - } -}); - -// node_modules/cspell-io/dist/cjs/file/index.js -var require_file4 = __commonJS({ - "node_modules/cspell-io/dist/cjs/file/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readFileSync = exports.readFile = exports.getStatSync = exports.getStat = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = void 0; - var index_js_1 = require_file2(); - Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function() { - return index_js_1.writeToFile; - } }); - Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function() { - return index_js_1.writeToFileIterable; - } }); - Object.defineProperty(exports, "writeToFileIterableP", { enumerable: true, get: function() { - return index_js_1.writeToFileIterable; - } }); - var file_js_1 = require_file3(); - Object.defineProperty(exports, "getStat", { enumerable: true, get: function() { - return file_js_1.getStat; - } }); - Object.defineProperty(exports, "getStatSync", { enumerable: true, get: function() { - return file_js_1.getStatSync; - } }); - Object.defineProperty(exports, "readFile", { enumerable: true, get: function() { - return file_js_1.readFile; - } }); - Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function() { - return file_js_1.readFileSync; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/index.js -var require_cjs3 = __commonJS({ - "node_modules/cspell-io/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toDataUrl = exports.encodeDataUrl = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.getStatSync = exports.getStat = exports.getDefaultCSpellIO = exports.CSpellIONode = exports.asyncIterableToArray = void 0; - var asyncIterable_js_1 = require_asyncIterable(); - Object.defineProperty(exports, "asyncIterableToArray", { enumerable: true, get: function() { - return asyncIterable_js_1.toArray; - } }); - var CSpellIONode_js_1 = require_CSpellIONode(); - Object.defineProperty(exports, "CSpellIONode", { enumerable: true, get: function() { - return CSpellIONode_js_1.CSpellIONode; - } }); - Object.defineProperty(exports, "getDefaultCSpellIO", { enumerable: true, get: function() { - return CSpellIONode_js_1.getDefaultCSpellIO; - } }); - var index_js_1 = require_file4(); - Object.defineProperty(exports, "getStat", { enumerable: true, get: function() { - return index_js_1.getStat; - } }); - Object.defineProperty(exports, "getStatSync", { enumerable: true, get: function() { - return index_js_1.getStatSync; - } }); - Object.defineProperty(exports, "readFile", { enumerable: true, get: function() { - return index_js_1.readFile; - } }); - Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function() { - return index_js_1.readFileSync; - } }); - Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function() { - return index_js_1.writeToFile; - } }); - Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function() { - return index_js_1.writeToFileIterable; - } }); - Object.defineProperty(exports, "writeToFileIterableP", { enumerable: true, get: function() { - return index_js_1.writeToFileIterableP; - } }); - var dataUrl_js_1 = require_dataUrl(); - Object.defineProperty(exports, "encodeDataUrl", { enumerable: true, get: function() { - return dataUrl_js_1.encodeDataUrl; - } }); - Object.defineProperty(exports, "toDataUrl", { enumerable: true, get: function() { - return dataUrl_js_1.toDataUrl; - } }); } }); -// node_modules/cspell-lib/dist/cjs/Models/CSpellSettingsInternalDef.js -var require_CSpellSettingsInternalDef = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Models/CSpellSettingsInternalDef.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDictionaryDefinitionInlineInternal = exports.isCSpellSettingsInternal = exports.createCSpellSettingsInternal = exports.cleanCSpellSettingsInternal = exports.SymbolCSpellSettingsInternal = void 0; - var util_js_1 = require_util(); - exports.SymbolCSpellSettingsInternal = Symbol("CSpellSettingsInternal"); - function cleanCSpellSettingsInternal(parts = {}) { - const csi = (0, util_js_1.clean)(parts); - Object.assign(csi, { [exports.SymbolCSpellSettingsInternal]: true }); - return csi; - } - exports.cleanCSpellSettingsInternal = cleanCSpellSettingsInternal; - function createCSpellSettingsInternal(parts = {}) { - return (0, util_js_1.clean)({ - ...parts, - [exports.SymbolCSpellSettingsInternal]: true - }); +// node_modules/graceful-fs/graceful-fs.js +var require_graceful_fs = __commonJS({ + "node_modules/graceful-fs/graceful-fs.js"(exports, module2) { + var fs9 = require("fs"); + var polyfills = require_polyfills(); + var legacy = require_legacy_streams(); + var clone = require_clone(); + var util = require("util"); + var gracefulQueue; + var previousSymbol; + if (typeof Symbol === "function" && typeof Symbol.for === "function") { + gracefulQueue = Symbol.for("graceful-fs.queue"); + previousSymbol = Symbol.for("graceful-fs.previous"); + } else { + gracefulQueue = "___graceful-fs.queue"; + previousSymbol = "___graceful-fs.previous"; } - exports.createCSpellSettingsInternal = createCSpellSettingsInternal; - function isCSpellSettingsInternal(cs) { - return !!cs[exports.SymbolCSpellSettingsInternal]; + function noop() { } - exports.isCSpellSettingsInternal = isCSpellSettingsInternal; - function isDictionaryDefinitionInlineInternal(def) { - if (def.path) - return false; - const defInline = def; - return !!(defInline.words || defInline.flagWords || defInline.ignoreWords || defInline.suggestWords); + function publishQueue(context, queue2) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue2; + } + }); } - exports.isDictionaryDefinitionInlineInternal = isDictionaryDefinitionInlineInternal; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/AutoResolveLRUCache.js -var require_AutoResolveLRUCache = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/AutoResolveLRUCache.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AutoResolveLastNCalls = exports.assertValidateLL = exports.AutoResolveLRUCache = void 0; - var assert_1 = __importDefault(require("assert")); - var util_js_1 = require_util(); - var AutoResolveLRUCache = class { - constructor(maxSize, isEqual) { - this.maxSize = maxSize; - this.isEqual = isEqual; - this.list = {}; - this.count = 0; - this._misses = 0; - this._hits = 0; - this._added = 0; - this._removed = 0; - (0, assert_1.default)(maxSize > 0); - } - get(params, fn) { - const isEqual = this.isEqual; - for (let n = this.list.n; n; n = n.n) { - if (isEqual(n.value.p, params)) { - this.addToHead(n); - ++this._hits; - return n.value.r; - } - } - ++this._misses; - if (!fn) - return void 0; - const value = { - p: params, - r: fn(params) - }; - this.addToHead({ value, n: void 0, p: void 0 }); - return value.r; - } - get size() { - return this.count; + var debug = noop; + if (util.debuglog) + debug = util.debuglog("gfs4"); + else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) + debug = function() { + var m = util.format.apply(util, arguments); + m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); + console.error(m); + }; + if (!fs9[gracefulQueue]) { + queue = global[gracefulQueue] || []; + publishQueue(fs9, queue); + fs9.close = function(fs$close) { + function close(fd, cb) { + return fs$close.call(fs9, fd, function(err) { + if (!err) { + resetQueue(); + } + if (typeof cb === "function") + cb.apply(this, arguments); + }); + } + Object.defineProperty(close, previousSymbol, { + value: fs$close + }); + return close; + }(fs9.close); + fs9.closeSync = function(fs$closeSync) { + function closeSync(fd) { + fs$closeSync.apply(fs9, arguments); + resetQueue(); + } + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }); + return closeSync; + }(fs9.closeSync); + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { + process.on("exit", function() { + debug(fs9[gracefulQueue]); + require("assert").equal(fs9[gracefulQueue].length, 0); + }); } - get hits() { - return this._hits; + } + var queue; + if (!global[gracefulQueue]) { + publishQueue(global, fs9[gracefulQueue]); + } + module2.exports = patch(clone(fs9)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs9.__patched) { + module2.exports = patch(fs9); + fs9.__patched = true; + } + function patch(fs10) { + polyfills(fs10); + fs10.gracefulify = patch; + fs10.createReadStream = createReadStream; + fs10.createWriteStream = createWriteStream; + var fs$readFile = fs10.readFile; + fs10.readFile = readFile3; + function readFile3(path26, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$readFile(path26, options, cb); + function go$readFile(path27, options2, cb2, startTime) { + return fs$readFile(path27, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$readFile, [path27, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } } - get misses() { - return this._misses; + var fs$writeFile = fs10.writeFile; + fs10.writeFile = writeFile; + function writeFile(path26, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$writeFile(path26, data, options, cb); + function go$writeFile(path27, data2, options2, cb2, startTime) { + return fs$writeFile(path27, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$writeFile, [path27, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } } - get added() { - return this._added; + var fs$appendFile = fs10.appendFile; + if (fs$appendFile) + fs10.appendFile = appendFile; + function appendFile(path26, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$appendFile(path26, data, options, cb); + function go$appendFile(path27, data2, options2, cb2, startTime) { + return fs$appendFile(path27, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$appendFile, [path27, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } } - get removed() { - return this._removed; + var fs$copyFile = fs10.copyFile; + if (fs$copyFile) + fs10.copyFile = copyFile; + function copyFile(src, dest, flags, cb) { + if (typeof flags === "function") { + cb = flags; + flags = 0; + } + return go$copyFile(src, dest, flags, cb); + function go$copyFile(src2, dest2, flags2, cb2, startTime) { + return fs$copyFile(src2, dest2, flags2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } } - clear() { - this._added = 0; - this._hits = 0; - this._misses = 0; - this._removed = 0; - this.list.n = void 0; - this.list.p = void 0; - this.count = 0; - } - addToHead(n) { - if (!this.list.n) { - this.list.n = n; - this.list.p = n; - n.n = void 0; - n.p = void 0; - this.count = 1; - this._added = 1; - return; + var fs$readdir = fs10.readdir; + fs10.readdir = readdir; + var noReaddirOptionVersions = /^v[0-5]\./; + function readdir(path26, options, cb) { + if (typeof options === "function") + cb = options, options = null; + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path27, options2, cb2, startTime) { + return fs$readdir(path27, fs$readdirCallback( + path27, + options2, + cb2, + startTime + )); + } : function go$readdir2(path27, options2, cb2, startTime) { + return fs$readdir(path27, options2, fs$readdirCallback( + path27, + options2, + cb2, + startTime + )); + }; + return go$readdir(path26, options, cb); + function fs$readdirCallback(path27, options2, cb2, startTime) { + return function(err, files) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([ + go$readdir, + [path27, options2, cb2], + err, + startTime || Date.now(), + Date.now() + ]); + else { + if (files && files.sort) + files.sort(); + if (typeof cb2 === "function") + cb2.call(this, err, files); + } + }; } - if (this.list.n === n) - return; - if (this.list.p === n) { - this.list.p = n.p; - } - const isNew = !n.n && !n.p; - n.p && (n.p.n = n.n); - n.n && (n.n.p = n.p); - n.p = void 0; - n.n = this.list.n; - n.n && (n.n.p = n); - this.list.n = n; - const add = isNew && 1 || 0; - this._added += add; - this.count += add; - if (this.count > this.maxSize) { - const prev = this.list.p?.p; - (0, assert_1.default)(prev); - prev.n = void 0; - this.list.p = prev; - ++this._removed; - --this.count; - } - } - stats() { - return { size: this.count, hits: this.hits, misses: this.misses, added: this.added, removed: this.removed }; } - toJSON() { - return this.stats(); + if (process.version.substr(0, 4) === "v0.8") { + var legStreams = legacy(fs10); + ReadStream = legStreams.ReadStream; + WriteStream = legStreams.WriteStream; } - static assertValid(cache) { - assertValidateLL(cache.list); + var fs$ReadStream = fs10.ReadStream; + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype); + ReadStream.prototype.open = ReadStream$open; } - }; - exports.AutoResolveLRUCache = AutoResolveLRUCache; - function assertValidateLL(list) { - if (!list.n && !list.p) - return; - (0, assert_1.default)(list.n, "Bad Next"); - (0, assert_1.default)(list.p, "Bad Prev"); - const visited = /* @__PURE__ */ new Set(); - let n = list; - for (; n.n; n = n.n) { - (0, assert_1.default)(!visited.has(n.n), "Circular"); - visited.add(n.n); + var fs$WriteStream = fs10.WriteStream; + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype); + WriteStream.prototype.open = WriteStream$open; + } + Object.defineProperty(fs10, "ReadStream", { + get: function() { + return ReadStream; + }, + set: function(val) { + ReadStream = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(fs10, "WriteStream", { + get: function() { + return WriteStream; + }, + set: function(val) { + WriteStream = val; + }, + enumerable: true, + configurable: true + }); + var FileReadStream = ReadStream; + Object.defineProperty(fs10, "FileReadStream", { + get: function() { + return FileReadStream; + }, + set: function(val) { + FileReadStream = val; + }, + enumerable: true, + configurable: true + }); + var FileWriteStream = WriteStream; + Object.defineProperty(fs10, "FileWriteStream", { + get: function() { + return FileWriteStream; + }, + set: function(val) { + FileWriteStream = val; + }, + enumerable: true, + configurable: true + }); + function ReadStream(path26, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this; + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments); } - (0, assert_1.default)(list.p === n, "Tail matches"); - visited.clear(); - n = list; - for (; n.p; n = n.p) { - (0, assert_1.default)(!visited.has(n.p), "Circular"); - visited.add(n.p); + function ReadStream$open() { + var that = this; + open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + if (that.autoClose) + that.destroy(); + that.emit("error", err); + } else { + that.fd = fd; + that.emit("open", fd); + that.read(); + } + }); } - (0, assert_1.default)(list.n === n, "Head matches"); - } - exports.assertValidateLL = assertValidateLL; - var AutoResolveLastNCalls = class extends AutoResolveLRUCache { - constructor(maxSize) { - super(maxSize, util_js_1.isArrayEqual); + function WriteStream(path26, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this; + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments); } - }; - exports.AutoResolveLastNCalls = AutoResolveLastNCalls; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/logger.js -var require_logger = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/logger.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getLogger = exports.setLogger = exports.log = exports.logWarning = exports.logError = void 0; - var _logger = console; - function logError(...args) { - _logger.error(...args); - } - exports.logError = logError; - function logWarning(...args) { - _logger.warn(...args); + function WriteStream$open() { + var that = this; + open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + that.destroy(); + that.emit("error", err); + } else { + that.fd = fd; + that.emit("open", fd); + } + }); + } + function createReadStream(path26, options) { + return new fs10.ReadStream(path26, options); + } + function createWriteStream(path26, options) { + return new fs10.WriteStream(path26, options); + } + var fs$open = fs10.open; + fs10.open = open; + function open(path26, flags, mode, cb) { + if (typeof mode === "function") + cb = mode, mode = null; + return go$open(path26, flags, mode, cb); + function go$open(path27, flags2, mode2, cb2, startTime) { + return fs$open(path27, flags2, mode2, function(err, fd) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$open, [path27, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + return fs10; } - exports.logWarning = logWarning; - function log(...args) { - _logger.log(...args); + function enqueue(elem) { + debug("ENQUEUE", elem[0].name, elem[1]); + fs9[gracefulQueue].push(elem); + retry(); } - exports.log = log; - function setLogger2(logger) { - const oldLogger = _logger; - _logger = logger; - return oldLogger; + var retryTimer; + function resetQueue() { + var now = Date.now(); + for (var i = 0; i < fs9[gracefulQueue].length; ++i) { + if (fs9[gracefulQueue][i].length > 2) { + fs9[gracefulQueue][i][3] = now; + fs9[gracefulQueue][i][4] = now; + } + } + retry(); } - exports.setLogger = setLogger2; - function getLogger() { - return _logger; + function retry() { + clearTimeout(retryTimer); + retryTimer = void 0; + if (fs9[gracefulQueue].length === 0) + return; + var elem = fs9[gracefulQueue].shift(); + var fn = elem[0]; + var args = elem[1]; + var err = elem[2]; + var startTime = elem[3]; + var lastTime = elem[4]; + if (startTime === void 0) { + debug("RETRY", fn.name, args); + fn.apply(null, args); + } else if (Date.now() - startTime >= 6e4) { + debug("TIMEOUT", fn.name, args); + var cb = args.pop(); + if (typeof cb === "function") + cb.call(null, err); + } else { + var sinceAttempt = Date.now() - lastTime; + var sinceStart = Math.max(lastTime - startTime, 1); + var desiredDelay = Math.min(sinceStart * 1.2, 100); + if (sinceAttempt >= desiredDelay) { + debug("RETRY", fn.name, args); + fn.apply(null, args.concat([startTime])); + } else { + fs9[gracefulQueue].push(elem); + } + } + if (retryTimer === void 0) { + retryTimer = setTimeout(retry, 0); + } } - exports.getLogger = getLogger; } }); -// node_modules/resolve-from/index.js -var require_resolve_from2 = __commonJS({ - "node_modules/resolve-from/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var Module = require("module"); - var fs6 = require("fs"); - var resolveFrom = (fromDirectory, moduleId, silent) => { - if (typeof fromDirectory !== "string") { - throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``); - } - if (typeof moduleId !== "string") { - throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); - } - try { - fromDirectory = fs6.realpathSync(fromDirectory); - } catch (error2) { - if (error2.code === "ENOENT") { - fromDirectory = path16.resolve(fromDirectory); - } else if (silent) { - return; - } else { - throw error2; +// node_modules/imurmurhash/imurmurhash.js +var require_imurmurhash = __commonJS({ + "node_modules/imurmurhash/imurmurhash.js"(exports, module2) { + (function() { + var cache2; + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache2; + m.reset(seed); + if (typeof key === "string" && key.length > 0) { + m.hash(key); + } + if (m !== this) { + return m; } } - const fromFile = path16.join(fromDirectory, "noop.js"); - const resolveFileName = () => Module._resolveFilename(moduleId, { - id: fromFile, - filename: fromFile, - paths: Module._nodeModulePaths(fromDirectory) - }); - if (silent) { - try { - return resolveFileName(); - } catch (error2) { - return; + ; + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + len = key.length; + this.len += len; + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: + k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0; + case 1: + k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0; + case 2: + k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0; + } + this.rem = len + this.rem & 3; + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = h1 * 5 + 3864292196 & 4294967295; + if (i >= len) { + break; + } + k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16; + top = key.charCodeAt(i++); + k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8; + } + k1 = 0; + switch (this.rem) { + case 3: + k1 ^= (key.charCodeAt(i + 2) & 65535) << 16; + case 2: + k1 ^= (key.charCodeAt(i + 1) & 65535) << 8; + case 1: + k1 ^= key.charCodeAt(i) & 65535; + } + this.h1 = h1; + } + this.k1 = k1; + return this; + }; + MurmurHash3.prototype.result = function() { + var k1, h1; + k1 = this.k1; + h1 = this.h1; + if (k1 > 0) { + k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; + h1 ^= k1; } + h1 ^= this.len; + h1 ^= h1 >>> 16; + h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295; + h1 ^= h1 >>> 13; + h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295; + h1 ^= h1 >>> 16; + return h1 >>> 0; + }; + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === "number" ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + cache2 = new MurmurHash3(); + if (typeof module2 != "undefined") { + module2.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; } - return resolveFileName(); - }; - module2.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId); - module2.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true); + })(); } }); -// node_modules/ini/ini.js -var require_ini = __commonJS({ - "node_modules/ini/ini.js"(exports) { - exports.parse = exports.decode = decode2; - exports.stringify = exports.encode = encode; - exports.safe = safe; - exports.unsafe = unsafe; - var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n"; - function encode(obj, opt) { - var children = []; - var out = ""; - if (typeof opt === "string") { - opt = { - section: opt, - whitespace: false - }; - } else { - opt = opt || {}; - opt.whitespace = opt.whitespace === true; - } - var separator = opt.whitespace ? " = " : "="; - Object.keys(obj).forEach(function(k, _, __) { - var val = obj[k]; - if (val && Array.isArray(val)) { - val.forEach(function(item) { - out += safe(k + "[]") + separator + safe(item) + "\n"; - }); - } else if (val && typeof val === "object") - children.push(k); - else - out += safe(k) + separator + safe(val) + eol; - }); - if (opt.section && out.length) - out = "[" + safe(opt.section) + "]" + eol + out; - children.forEach(function(k, _, __) { - var nk = dotSplit(k).join("\\."); - var section = (opt.section ? opt.section + "." : "") + nk; - var child = encode(obj[k], { - section, - whitespace: opt.whitespace - }); - if (out.length && child.length) - out += eol; - out += child; - }); - return out; +// node_modules/signal-exit/signals.js +var require_signals = __commonJS({ + "node_modules/signal-exit/signals.js"(exports, module2) { + module2.exports = [ + "SIGABRT", + "SIGALRM", + "SIGHUP", + "SIGINT", + "SIGTERM" + ]; + if (process.platform !== "win32") { + module2.exports.push( + "SIGVTALRM", + "SIGXCPU", + "SIGXFSZ", + "SIGUSR2", + "SIGTRAP", + "SIGSYS", + "SIGQUIT", + "SIGIOT" + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); } - function dotSplit(str) { - return str.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map(function(part) { - return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, ""); - }); + if (process.platform === "linux") { + module2.exports.push( + "SIGIO", + "SIGPOLL", + "SIGPWR", + "SIGSTKFLT", + "SIGUNUSED" + ); } - function decode2(str) { - var out = {}; - var p = out; - var section = null; - var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i; - var lines = str.split(/[\r\n]+/g); - lines.forEach(function(line, _, __) { - if (!line || line.match(/^\s*[;#]/)) - return; - var match = line.match(re); - if (!match) - return; - if (match[1] !== void 0) { - section = unsafe(match[1]); - if (section === "__proto__") { - p = {}; - return; + } +}); + +// node_modules/signal-exit/index.js +var require_signal_exit = __commonJS({ + "node_modules/signal-exit/index.js"(exports, module2) { + var process6 = global.process; + var processOk = function(process7) { + return process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function"; + }; + if (!processOk(process6)) { + module2.exports = function() { + return function() { + }; + }; + } else { + assert20 = require("assert"); + signals = require_signals(); + isWin = /^win/i.test(process6.platform); + EE = require("events"); + if (typeof EE !== "function") { + EE = EE.EventEmitter; + } + if (process6.__signal_exit_emitter__) { + emitter = process6.__signal_exit_emitter__; + } else { + emitter = process6.__signal_exit_emitter__ = new EE(); + emitter.count = 0; + emitter.emitted = {}; + } + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity); + emitter.infinite = true; + } + module2.exports = function(cb, opts) { + if (!processOk(global.process)) { + return function() { + }; + } + assert20.equal(typeof cb, "function", "a callback must be provided for exit handler"); + if (loaded === false) { + load2(); + } + var ev = "exit"; + if (opts && opts.alwaysLast) { + ev = "afterexit"; + } + var remove = function() { + emitter.removeListener(ev, cb); + if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { + unload(); } - p = out[section] = out[section] || {}; + }; + emitter.on(ev, cb); + return remove; + }; + unload = function unload2() { + if (!loaded || !processOk(global.process)) { return; } - var key = unsafe(match[2]); - if (key === "__proto__") + loaded = false; + signals.forEach(function(sig) { + try { + process6.removeListener(sig, sigListeners[sig]); + } catch (er) { + } + }); + process6.emit = originalProcessEmit; + process6.reallyExit = originalProcessReallyExit; + emitter.count -= 1; + }; + module2.exports.unload = unload; + emit = function emit2(event, code, signal) { + if (emitter.emitted[event]) { return; - var value = match[3] ? unsafe(match[4]) : true; - switch (value) { - case "true": - case "false": - case "null": - value = JSON.parse(value); } - if (key.length > 2 && key.slice(-2) === "[]") { - key = key.substring(0, key.length - 2); - if (key === "__proto__") + emitter.emitted[event] = true; + emitter.emit(event, code, signal); + }; + sigListeners = {}; + signals.forEach(function(sig) { + sigListeners[sig] = function listener() { + if (!processOk(global.process)) { return; - if (!p[key]) - p[key] = []; - else if (!Array.isArray(p[key])) - p[key] = [p[key]]; - } - if (Array.isArray(p[key])) - p[key].push(value); - else - p[key] = value; + } + var listeners = process6.listeners(sig); + if (listeners.length === emitter.count) { + unload(); + emit("exit", null, sig); + emit("afterexit", null, sig); + if (isWin && sig === "SIGHUP") { + sig = "SIGINT"; + } + process6.kill(process6.pid, sig); + } + }; }); - Object.keys(out).filter(function(k, _, __) { - if (!out[k] || typeof out[k] !== "object" || Array.isArray(out[k])) - return false; - var parts = dotSplit(k); - var p2 = out; - var l = parts.pop(); - var nl = l.replace(/\\\./g, "."); - parts.forEach(function(part, _2, __2) { - if (part === "__proto__") - return; - if (!p2[part] || typeof p2[part] !== "object") - p2[part] = {}; - p2 = p2[part]; + module2.exports.signals = function() { + return signals; + }; + loaded = false; + load2 = function load3() { + if (loaded || !processOk(global.process)) { + return; + } + loaded = true; + emitter.count += 1; + signals = signals.filter(function(sig) { + try { + process6.on(sig, sigListeners[sig]); + return true; + } catch (er) { + return false; + } }); - if (p2 === out && nl === l) - return false; - p2[nl] = out[k]; - return true; - }).forEach(function(del, _, __) { - delete out[del]; - }); - return out; - } - function isQuoted(val) { - return val.charAt(0) === '"' && val.slice(-1) === '"' || val.charAt(0) === "'" && val.slice(-1) === "'"; - } - function safe(val) { - return typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim() ? JSON.stringify(val) : val.replace(/;/g, "\\;").replace(/#/g, "\\#"); - } - function unsafe(val, doUnesc) { - val = (val || "").trim(); - if (isQuoted(val)) { - if (val.charAt(0) === "'") - val = val.substr(1, val.length - 2); - try { - val = JSON.parse(val); - } catch (_) { + process6.emit = processEmit; + process6.reallyExit = processReallyExit; + }; + module2.exports.load = load2; + originalProcessReallyExit = process6.reallyExit; + processReallyExit = function processReallyExit2(code) { + if (!processOk(global.process)) { + return; } - } else { - var esc = false; - var unesc = ""; - for (var i = 0, l = val.length; i < l; i++) { - var c = val.charAt(i); - if (esc) { - if ("\\;#".indexOf(c) !== -1) - unesc += c; - else - unesc += "\\" + c; - esc = false; - } else if (";#".indexOf(c) !== -1) - break; - else if (c === "\\") - esc = true; - else - unesc += c; + process6.exitCode = code || /* istanbul ignore next */ + 0; + emit("exit", process6.exitCode, null); + emit("afterexit", process6.exitCode, null); + originalProcessReallyExit.call(process6, process6.exitCode); + }; + originalProcessEmit = process6.emit; + processEmit = function processEmit2(ev, arg) { + if (ev === "exit" && processOk(global.process)) { + if (arg !== void 0) { + process6.exitCode = arg; + } + var ret = originalProcessEmit.apply(this, arguments); + emit("exit", process6.exitCode, null); + emit("afterexit", process6.exitCode, null); + return ret; + } else { + return originalProcessEmit.apply(this, arguments); } - if (esc) - unesc += "\\"; - return unesc.trim(); - } - return val; + }; } + var assert20; + var signals; + var isWin; + var EE; + var emitter; + var unload; + var emit; + var sigListeners; + var loaded; + var load2; + var originalProcessReallyExit; + var processReallyExit; + var originalProcessEmit; + var processEmit; } }); -// node_modules/global-dirs/index.js -var require_global_dirs = __commonJS({ - "node_modules/global-dirs/index.js"(exports) { - "use strict"; - var path16 = require("path"); - var os = require("os"); - var fs6 = require("fs"); - var ini = require_ini(); - var readRc = (fp) => { - try { - return ini.parse(fs6.readFileSync(fp, "utf8")).prefix; - } catch (err) { - } - }; - var defaultNpmPrefix = (() => { - if (process.env.PREFIX) { - return process.env.PREFIX; - } - if (process.platform === "win32") { - return path16.dirname(process.execPath); - } - return path16.dirname(path16.dirname(process.execPath)); - })(); - var getNpmPrefix = () => { - if (process.env.PREFIX) { - return process.env.PREFIX; - } - const homePrefix = readRc(path16.join(os.homedir(), ".npmrc")); - if (homePrefix) { - return homePrefix; - } - const globalConfigPrefix = readRc(path16.resolve(defaultNpmPrefix, "etc", "npmrc")); - if (globalConfigPrefix) { - return globalConfigPrefix; - } - if (process.platform === "win32" && process.env.APPDATA) { - const prefix = path16.join(process.env.APPDATA, "npm"); - if (fs6.existsSync(prefix)) { - return prefix; - } - } - return defaultNpmPrefix; - }; - var npmPrefix = path16.resolve(getNpmPrefix()); - var getYarnPrefix = () => { - if (process.env.PREFIX) { - return process.env.PREFIX; - } - if (process.platform === "win32" && process.env.LOCALAPPDATA) { - const prefix = path16.join(process.env.LOCALAPPDATA, "Yarn"); - if (fs6.existsSync(prefix)) { - return prefix; - } - } - const configPrefix = path16.join(os.homedir(), ".config/yarn"); - if (fs6.existsSync(configPrefix)) { - return configPrefix; - } - const homePrefix = path16.join(os.homedir(), ".yarn-config"); - if (fs6.existsSync(homePrefix)) { - return homePrefix; - } - return npmPrefix; - }; - exports.npm = {}; - exports.npm.prefix = npmPrefix; - exports.npm.packages = path16.join(npmPrefix, process.platform === "win32" ? "node_modules" : "lib/node_modules"); - exports.npm.binaries = process.platform === "win32" ? npmPrefix : path16.join(npmPrefix, "bin"); - var yarnPrefix = path16.resolve(getYarnPrefix()); - exports.yarn = {}; - exports.yarn.prefix = yarnPrefix; - exports.yarn.packages = path16.join(yarnPrefix, process.platform === "win32" ? "config/global/node_modules" : "global/node_modules"); - exports.yarn.binaries = path16.join(exports.yarn.packages, ".bin"); - } -}); - -// node_modules/resolve-global/index.js -var require_resolve_global = __commonJS({ - "node_modules/resolve-global/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var globalDirs = require_global_dirs(); - var resolveGlobal = (moduleId) => { - try { - return require.resolve(path16.join(globalDirs.yarn.packages, moduleId)); - } catch (_) { - return require.resolve(path16.join(globalDirs.npm.packages, moduleId)); - } - }; - module2.exports = resolveGlobal; - module2.exports.silent = (moduleId) => { - try { - return resolveGlobal(moduleId); - } catch (_) { - return void 0; - } - }; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/resolveFile.js -var require_resolveFile = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/resolveFile.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; +// node_modules/is-typedarray/index.js +var require_is_typedarray = __commonJS({ + "node_modules/is-typedarray/index.js"(exports, module2) { + module2.exports = isTypedArray; + isTypedArray.strict = isStrictTypedArray; + isTypedArray.loose = isLooseTypedArray; + var toString = Object.prototype.toString; + var names = { + "[object Int8Array]": true, + "[object Int16Array]": true, + "[object Int32Array]": true, + "[object Uint8Array]": true, + "[object Uint8ClampedArray]": true, + "[object Uint16Array]": true, + "[object Uint32Array]": true, + "[object Float32Array]": true, + "[object Float64Array]": true }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveFile = void 0; - var fs6 = __importStar(require("fs")); - var os = __importStar(require("os")); - var path16 = __importStar(require("path")); - var resolve_from_1 = __importDefault(require_resolve_from2()); - var resolve_global_1 = __importDefault(require_resolve_global()); - var testNodeModules = /^node_modules\//; - function resolveFile(filename, relativeTo) { - filename = filename.replace(/^~/, os.homedir()); - const steps = [ - { filename, fn: tryUrl }, - { filename, fn: tryNodeResolve }, - { filename: path16.resolve(relativeTo, filename), fn: tryResolveExists }, - { filename: path16.resolve(filename), fn: tryResolveExists }, - { filename, fn: tryNodeResolveDefaultPaths }, - { filename, fn: tryResolveFrom }, - { filename: filename.replace(testNodeModules, ""), fn: tryResolveFrom }, - { filename, fn: tryResolveGlobal } - ]; - for (const step of steps) { - const r = step.fn(step.filename, relativeTo); - if (r.found) - return r; - } - return { filename: path16.resolve(relativeTo, filename), relativeTo, found: false }; - } - exports.resolveFile = resolveFile; - var isUrlRegExp = /^\w+:\/\//i; - function tryUrl(filename, relativeTo) { - if (isUrlRegExp.test(filename)) { - return { filename, relativeTo: void 0, found: true }; - } - if (isUrlRegExp.test(relativeTo)) { - const url = new URL(filename, relativeTo); - return { filename: url.href, relativeTo, found: true }; - } - return { filename, relativeTo: void 0, found: false }; - } - function tryNodeResolveDefaultPaths(filename) { - try { - const r = require.resolve(filename); - return { filename: r, relativeTo: void 0, found: true }; - } catch (_) { - return { filename, relativeTo: void 0, found: false }; - } - } - function tryNodeResolve(filename, relativeTo) { - const home = os.homedir(); - function calcPaths(p) { - const paths2 = [p]; - if (filename.startsWith(".") && (filename.startsWith("./") || filename.startsWith("." + path16.sep) || filename.startsWith(".."))) { - return paths2; - } - for (; p && path16.dirname(p) !== p && p !== home; p = path16.dirname(p)) { - paths2.push(p); - } - return paths2; - } - const paths = calcPaths(path16.resolve(relativeTo)); - try { - const r = require.resolve(filename, { paths }); - return { filename: r, relativeTo, found: true }; - } catch (_) { - return { filename, relativeTo, found: false }; - } - } - function tryResolveGlobal(filename) { - const r = resolve_global_1.default.silent(filename); - return { filename: r || filename, relativeTo: void 0, found: !!r }; + function isTypedArray(arr) { + return isStrictTypedArray(arr) || isLooseTypedArray(arr); } - function tryResolveExists(filename) { - return { filename, relativeTo: void 0, found: fs6.existsSync(filename) }; + function isStrictTypedArray(arr) { + return arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array; } - function tryResolveFrom(filename, relativeTo) { - try { - return { filename: (0, resolve_from_1.default)(relativeTo, filename), relativeTo, found: true }; - } catch (error2) { - return { filename, relativeTo, found: false }; - } + function isLooseTypedArray(arr) { + return names[toString.call(arr)]; } } }); -// node_modules/cspell-lib/dist/cjs/Settings/constants.js -var require_constants3 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/constants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ENV_CSPELL_GLOB_ROOT = exports.currentSettingsFileVersion = exports.configSettingsFileVersion0_2 = exports.configSettingsFileVersion0_1 = void 0; - exports.configSettingsFileVersion0_1 = "0.1"; - exports.configSettingsFileVersion0_2 = "0.2"; - exports.currentSettingsFileVersion = exports.configSettingsFileVersion0_2; - exports.ENV_CSPELL_GLOB_ROOT = "CSPELL_GLOB_ROOT"; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/AutoResolve.js -var require_AutoResolve = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/AutoResolve.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createAutoResolveWeakCache = exports.AutoResolveWeakCache = exports.autoResolveWeak = exports.createAutoResolveCache = exports.AutoResolveCache = exports.autoResolve = void 0; - function autoResolve(map, key, resolve10) { - const found = map.get(key); - if (found !== void 0 || map.has(key)) - return found; - const value = resolve10(key); - map.set(key, value); - return value; - } - exports.autoResolve = autoResolve; - var AutoResolveCache = class { - constructor() { - this.map = /* @__PURE__ */ new Map(); - } - get(k, resolve10) { - return resolve10 ? autoResolve(this.map, k, resolve10) : this.map.get(k); - } - has(k) { - return this.map.has(k); - } - set(k, v) { - this.map.set(k, v); - return this; - } - }; - exports.AutoResolveCache = AutoResolveCache; - function createAutoResolveCache() { - return new AutoResolveCache(); - } - exports.createAutoResolveCache = createAutoResolveCache; - function autoResolveWeak(map, key, resolve10) { - const found = map.get(key); - if (found !== void 0 || map.has(key)) - return found; - const value = resolve10(key); - map.set(key, value); - return value; - } - exports.autoResolveWeak = autoResolveWeak; - var AutoResolveWeakCache = class { - constructor() { - this.map = /* @__PURE__ */ new WeakMap(); - } - get(k, resolve10) { - return resolve10 ? autoResolveWeak(this.map, k, resolve10) : this.map.get(k); - } - has(k) { - return this.map.has(k); - } - set(k, v) { - this.map.set(k, v); - return this; +// node_modules/typedarray-to-buffer/index.js +var require_typedarray_to_buffer = __commonJS({ + "node_modules/typedarray-to-buffer/index.js"(exports, module2) { + var isTypedArray = require_is_typedarray().strict; + module2.exports = function typedarrayToBuffer(arr) { + if (isTypedArray(arr)) { + var buf = Buffer.from(arr.buffer); + if (arr.byteLength !== arr.buffer.byteLength) { + buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength); + } + return buf; + } else { + return Buffer.from(arr); } }; - exports.AutoResolveWeakCache = AutoResolveWeakCache; - function createAutoResolveWeakCache() { - return new AutoResolveWeakCache(); - } - exports.createAutoResolveWeakCache = createAutoResolveWeakCache; } }); -// node_modules/gensequence/dist/util/util.js -var require_util4 = __commonJS({ - "node_modules/gensequence/dist/util/util.js"(exports) { +// node_modules/write-file-atomic/index.js +var require_write_file_atomic = __commonJS({ + "node_modules/write-file-atomic/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toIterableIterator = exports.toIterator = void 0; - function toIterator(values) { - let iter; - const rangeIterator = { - next: function() { - if (!iter) { - iter = values[Symbol.iterator](); - } - return iter.next(); + module2.exports = writeFile; + module2.exports.sync = writeFileSync; + module2.exports._getTmpname = getTmpname; + module2.exports._cleanupOnExit = cleanupOnExit; + var fs9 = require("fs"); + var MurmurHash3 = require_imurmurhash(); + var onExit = require_signal_exit(); + var path26 = require("path"); + var isTypedArray = require_is_typedarray(); + var typedArrayToBuffer = require_typedarray_to_buffer(); + var { promisify: promisify4 } = require("util"); + var activeFiles = {}; + var threadId = function getId() { + try { + const workerThreads = require("worker_threads"); + return workerThreads.threadId; + } catch (e) { + return 0; + } + }(); + var invocations = 0; + function getTmpname(filename) { + return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result(); + } + function cleanupOnExit(tmpfile) { + return () => { + try { + fs9.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile); + } catch (_) { } }; - return rangeIterator; } - exports.toIterator = toIterator; - function* toIterableIterator(i) { - yield* i; + function serializeActiveFile(absoluteName) { + return new Promise((resolve13) => { + if (!activeFiles[absoluteName]) + activeFiles[absoluteName] = []; + activeFiles[absoluteName].push(resolve13); + if (activeFiles[absoluteName].length === 1) + resolve13(); + }); } - exports.toIterableIterator = toIterableIterator; - } -}); - -// node_modules/gensequence/dist/operators/operatorsBase.js -var require_operatorsBase = __commonJS({ - "node_modules/gensequence/dist/operators/operatorsBase.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.scanMap = exports.isAsyncIterableIterator = exports.isAsyncIterable = exports.makeAsyncIterable = exports.isIterableIterator = exports.isIterable = exports.makeIterable = exports.reduceAsyncForAsyncIterator = exports.reduceAsync = exports.reduce = exports.min = exports.max = exports.forEach = exports.first = exports.count = exports.any = exports.all = exports.scan = exports.map = exports.combine = exports.concatMap = exports.concat = exports.take = exports.skip = exports.filter = void 0; - function* filter(i, fnFilter) { - for (const v of i) { - if (fnFilter(v)) { - yield v; - } + function isChownErrOk(err) { + if (err.code === "ENOSYS") { + return true; } - } - exports.filter = filter; - function* skip(i, n) { - let a = 0; - for (const t of i) { - if (a >= n) { - yield t; + const nonroot = !process.getuid || process.getuid() !== 0; + if (nonroot) { + if (err.code === "EINVAL" || err.code === "EPERM") { + return true; } - a += 1; } + return false; } - exports.skip = skip; - function* take(i, n) { - let a = 0; - if (n) { - for (const t of i) { - if (a >= n) { - break; - } - yield t; - a += 1; - } - } - } - exports.take = take; - function* concat(i, j) { - yield* i; - yield* j; - } - exports.concat = concat; - function* concatMap(i, fn) { - for (const t of i) { - yield* fn(t); - } - } - exports.concatMap = concatMap; - function* combine(i, j, fnMap) { - const jit = j[Symbol.iterator](); - for (const r of i) { - const s = jit.next().value; - yield fnMap(r, s); + async function writeFileAsync(filename, data, options = {}) { + if (typeof options === "string") { + options = { encoding: options }; } - } - exports.combine = combine; - function map(i, fnMap) { - function* fn(i2, fnMap2) { - for (const v of i2) { - yield fnMap2(v); + let fd; + let tmpfile; + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)); + const absoluteName = path26.resolve(filename); + try { + await serializeActiveFile(absoluteName); + const truename = await promisify4(fs9.realpath)(filename).catch(() => filename); + tmpfile = getTmpname(truename); + if (!options.mode || !options.chown) { + const stats = await promisify4(fs9.stat)(truename).catch(() => { + }); + if (stats) { + if (options.mode == null) { + options.mode = stats.mode; + } + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid }; + } + } } - } - return fn(i, fnMap); - } - exports.map = map; - function* scan(i, fnReduce, initValue) { - let index = 0; - if (initValue === void 0) { - index = 1; - const iter = i[Symbol.iterator](); - let r = iter.next(); - if (!r.done) - yield r.value; - initValue = r.value; - i = makeIterable(iter); - } - let prevValue = initValue; - for (const t of i) { - const nextValue = fnReduce(prevValue, t, index); - yield nextValue; - prevValue = nextValue; - index += 1; - } - } - exports.scan = scan; - function all(i, fn) { - for (const t of i) { - if (!fn(t)) { - return false; + fd = await promisify4(fs9.open)(tmpfile, "w", options.mode); + if (options.tmpfileCreated) { + await options.tmpfileCreated(tmpfile); } - } - return true; - } - exports.all = all; - function any(i, fn) { - for (const t of i) { - if (fn(t)) { - return true; + if (isTypedArray(data)) { + data = typedArrayToBuffer(data); } - } - return false; - } - exports.any = any; - function count(i) { - return reduce2(i, (p) => p + 1, 0); - } - exports.count = count; - function first(i, fn, defaultValue) { - fn = fn || (() => true); - for (const t of i) { - if (fn(t)) { - return t; + if (Buffer.isBuffer(data)) { + await promisify4(fs9.write)(fd, data, 0, data.length, 0); + } else if (data != null) { + await promisify4(fs9.write)(fd, String(data), 0, String(options.encoding || "utf8")); } + if (options.fsync !== false) { + await promisify4(fs9.fsync)(fd); + } + await promisify4(fs9.close)(fd); + fd = null; + if (options.chown) { + await promisify4(fs9.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => { + if (!isChownErrOk(err)) { + throw err; + } + }); + } + if (options.mode) { + await promisify4(fs9.chmod)(tmpfile, options.mode).catch((err) => { + if (!isChownErrOk(err)) { + throw err; + } + }); + } + await promisify4(fs9.rename)(tmpfile, truename); + } finally { + if (fd) { + await promisify4(fs9.close)(fd).catch( + /* istanbul ignore next */ + () => { + } + ); + } + removeOnExitHandler(); + await promisify4(fs9.unlink)(tmpfile).catch(() => { + }); + activeFiles[absoluteName].shift(); + if (activeFiles[absoluteName].length > 0) { + activeFiles[absoluteName][0](); + } else + delete activeFiles[absoluteName]; } - return defaultValue; - } - exports.first = first; - function forEach(i, fn) { - let index = 0; - for (const t of i) { - fn(t, index); - index += 1; - } - } - exports.forEach = forEach; - function max(i, selector = (t) => t) { - return reduce2(i, (p, c) => selector(c) > selector(p) ? c : p, void 0); } - exports.max = max; - function min(i, selector = (t) => t) { - return reduce2(i, (p, c) => selector(c) < selector(p) ? c : p, void 0); - } - exports.min = min; - function reduce2(i, fnReduce, initialValue) { - const iter = makeIterable(i[Symbol.iterator]()); - let index = 0; - if (initialValue === void 0) { - index = 1; - const r = iter.next(); - initialValue = r.value; - } - let prevValue = initialValue; - for (const t of iter) { - const nextValue = fnReduce(prevValue, t, index); - prevValue = nextValue; - index += 1; - } - return prevValue; - } - exports.reduce = reduce2; - async function reduceAsync2(i, fnReduce, initialValue) { - const iter = makeIterable(i[Symbol.iterator]()); - let index = 0; - if (initialValue === void 0) { - index = 1; - const r = iter.next(); - initialValue = r.value; - } - let previousValue = await initialValue; - for (const p of iter) { - const t = await p; - const nextValue = await fnReduce(previousValue, t, index); - previousValue = nextValue; - index += 1; - } - return previousValue; - } - exports.reduceAsync = reduceAsync2; - async function reduceAsyncForAsyncIterator(i, fnReduce, initialValue) { - const iter = makeAsyncIterable(i[Symbol.asyncIterator]()); - let index = 0; - if (initialValue === void 0) { - index = 1; - const r = await iter.next(); - initialValue = r.value; + function writeFile(filename, data, options, callback) { + if (options instanceof Function) { + callback = options; + options = {}; } - let previousValue = await initialValue; - for await (const t of iter) { - const nextValue = await fnReduce(previousValue, t, index); - previousValue = nextValue; - index += 1; + const promise = writeFileAsync(filename, data, options); + if (callback) { + promise.then(callback, callback); } - return previousValue; + return promise; } - exports.reduceAsyncForAsyncIterator = reduceAsyncForAsyncIterator; - function makeIterable(i) { - function* fromIterator(i2) { - for (let r = i2.next(); !r.done; r = i2.next()) { - yield r.value; - } - } - function* fromIterable(i2) { - yield* i2; + function writeFileSync(filename, data, options) { + if (typeof options === "string") + options = { encoding: options }; + else if (!options) + options = {}; + try { + filename = fs9.realpathSync(filename); + } catch (ex) { } - return isIterable2(i) ? isIterableIterator(i) ? i : fromIterable(i) : fromIterator(i); - } - exports.makeIterable = makeIterable; - function isIterable2(i) { - return !!i[Symbol.iterator]; - } - exports.isIterable = isIterable2; - function isIterableIterator(i) { - return typeof i.next == "function"; - } - exports.isIterableIterator = isIterableIterator; - function makeAsyncIterable(i) { - async function* fromIterable(i2) { - for (const v of i2) { - yield v; + const tmpfile = getTmpname(filename); + if (!options.mode || !options.chown) { + try { + const stats = fs9.statSync(filename); + options = Object.assign({}, options); + if (!options.mode) { + options.mode = stats.mode; + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid }; + } + } catch (ex) { } } - async function* fromIterator(i2) { - for (let r = await i2.next(); !r.done; r = await i2.next()) { - yield r.value; + let fd; + const cleanup = cleanupOnExit(tmpfile); + const removeOnExitHandler = onExit(cleanup); + let threw = true; + try { + fd = fs9.openSync(tmpfile, "w", options.mode || 438); + if (options.tmpfileCreated) { + options.tmpfileCreated(tmpfile); } - } - async function* fromAsyncIterable(i2) { - yield* i2; - } - return isAsyncIterable3(i) ? isAsyncIterableIterator(i) ? i : fromAsyncIterable(i) : isIterable2(i) ? fromIterable(i) : fromIterator(i); - } - exports.makeAsyncIterable = makeAsyncIterable; - function isAsyncIterable3(i) { - return !!i[Symbol.asyncIterator]; - } - exports.isAsyncIterable = isAsyncIterable3; - function isAsyncIterableIterator(i) { - return typeof i.next == "function"; - } - exports.isAsyncIterableIterator = isAsyncIterableIterator; - function scanMap(accFn, init) { - let acc = init; - let first2 = true; - return function(value) { - if (first2 && acc === void 0) { - first2 = false; - acc = value; - return acc; + if (isTypedArray(data)) { + data = typedArrayToBuffer(data); } - acc = accFn(acc, value); - return acc; - }; - } - exports.scanMap = scanMap; - } -}); - -// node_modules/gensequence/dist/operators/operators.js -var require_operators = __commonJS({ - "node_modules/gensequence/dist/operators/operators.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.pipe = exports.reduceAsyncForAsyncIterator = exports.reduceAsync = exports.reduce = exports.min = exports.max = exports.forEach = exports.first = exports.count = exports.any = exports.all = exports.scan = exports.map = exports.combine = exports.concatMap = exports.concat = exports.take = exports.skip = exports.filter = void 0; - var op = __importStar(require_operatorsBase()); - function filter(fnFilter) { - return (i) => op.filter(i, fnFilter); - } - exports.filter = filter; - function skip(n) { - return (i) => op.skip(i, n); - } - exports.skip = skip; - function take(n) { - return (i) => op.take(i, n); - } - exports.take = take; - function concat(j) { - return (i) => op.concat(i, j); - } - exports.concat = concat; - function concatMap(fn) { - return (i) => op.concatMap(i, fn); - } - exports.concatMap = concatMap; - function combine(fnMap, j) { - return (i) => op.combine(i, j, fnMap); - } - exports.combine = combine; - function map(fnMap) { - return (i) => op.map(i, fnMap); - } - exports.map = map; - function scan(fnReduce, initValue) { - return (i) => op.scan(i, fnReduce, initValue); - } - exports.scan = scan; - function all(fn) { - return (i) => op.all(i, fn); - } - exports.all = all; - function any(fn) { - return (i) => op.any(i, fn); - } - exports.any = any; - function count() { - return (i) => op.count(i); - } - exports.count = count; - function first(fn, defaultValue) { - return (i) => op.first(i, fn, defaultValue); - } - exports.first = first; - function forEach(fn) { - return (i) => op.forEach(i, fn); - } - exports.forEach = forEach; - function max(selector) { - return (i) => op.max(i, selector); - } - exports.max = max; - function min(selector) { - return (i) => op.min(i, selector); - } - exports.min = min; - function reduce2(fnReduce, initialValue) { - return (i) => op.reduce(i, fnReduce, initialValue); - } - exports.reduce = reduce2; - function reduceAsync2(fnReduceAsync, initialValue) { - return (i) => op.reduceAsync(i, fnReduceAsync, initialValue); - } - exports.reduceAsync = reduceAsync2; - function reduceAsyncForAsyncIterator(fnReduceAsync, initialValue) { - return (i) => op.reduceAsyncForAsyncIterator(i, fnReduceAsync, initialValue); - } - exports.reduceAsyncForAsyncIterator = reduceAsyncForAsyncIterator; - function pipe(...fns) { - return (i) => { - for (const fn of fns) { - i = fn ? fn(i) : i; + if (Buffer.isBuffer(data)) { + fs9.writeSync(fd, data, 0, data.length, 0); + } else if (data != null) { + fs9.writeSync(fd, String(data), 0, String(options.encoding || "utf8")); } - return i; - }; + if (options.fsync !== false) { + fs9.fsyncSync(fd); + } + fs9.closeSync(fd); + fd = null; + if (options.chown) { + try { + fs9.chownSync(tmpfile, options.chown.uid, options.chown.gid); + } catch (err) { + if (!isChownErrOk(err)) { + throw err; + } + } + } + if (options.mode) { + try { + fs9.chmodSync(tmpfile, options.mode); + } catch (err) { + if (!isChownErrOk(err)) { + throw err; + } + } + } + fs9.renameSync(tmpfile, filename); + threw = false; + } finally { + if (fd) { + try { + fs9.closeSync(fd); + } catch (ex) { + } + } + removeOnExitHandler(); + if (threw) { + cleanup(); + } + } } - exports.pipe = pipe; } }); -// node_modules/gensequence/dist/operators/index.js -var require_operators2 = __commonJS({ - "node_modules/gensequence/dist/operators/index.js"(exports) { +// node_modules/is-obj/index.js +var require_is_obj = __commonJS({ + "node_modules/is-obj/index.js"(exports, module2) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); + module2.exports = (value) => { + const type = typeof value; + return value !== null && (type === "object" || type === "function"); }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(require_operators(), exports); } }); -// node_modules/gensequence/dist/ImplSequence.js -var require_ImplSequence = __commonJS({ - "node_modules/gensequence/dist/ImplSequence.js"(exports) { +// node_modules/dot-prop/index.js +var require_dot_prop = __commonJS({ + "node_modules/dot-prop/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ImplSequence = void 0; - var index_js_1 = require_operators2(); - var util_js_1 = require_util4(); - var ImplSequence = class _ImplSequence { - constructor(i) { - this.i = i; - } - get iter() { - return typeof this.i === "function" ? this.i() : this.i; - } - get iterator() { - if (!this._iterator) { - this._iterator = this.iter[Symbol.iterator](); + var isObj = require_is_obj(); + var disallowedKeys = /* @__PURE__ */ new Set([ + "__proto__", + "prototype", + "constructor" + ]); + var isValidPath = (pathSegments) => !pathSegments.some((segment) => disallowedKeys.has(segment)); + function getPathSegments(path26) { + const pathArray = path26.split("."); + const parts = []; + for (let i = 0; i < pathArray.length; i++) { + let p = pathArray[i]; + while (p[p.length - 1] === "\\" && pathArray[i + 1] !== void 0) { + p = p.slice(0, -1) + "."; + p += pathArray[++i]; } - return this._iterator; - } - inject(fn) { - const iter = this.i; - return () => fn(typeof iter === "function" ? iter() : iter); - } - chain(fn) { - return new _ImplSequence(this.inject(fn)); - } - [Symbol.iterator]() { - return this.iter[Symbol.iterator](); - } - next() { - return this.iterator.next(); - } - //// Filters - filter(fnFilter) { - return this.chain((0, index_js_1.filter)(fnFilter)); - } - skip(n) { - return this.chain((0, index_js_1.skip)(n)); - } - take(n) { - return this.chain((0, index_js_1.take)(n)); - } - //// Extenders - concat(j) { - return this.chain((0, index_js_1.concat)(j)); - } - concatMap(fn) { - return this.chain((0, index_js_1.concatMap)(fn)); - } - //// Mappers - combine(fn, j) { - return this.chain((0, index_js_1.combine)(fn, j)); - } - map(fn) { - return this.chain((0, index_js_1.map)(fn)); - } - scan(fnReduce, initValue) { - return this.chain((0, index_js_1.scan)(fnReduce, initValue)); - } - pipe(...fns) { - if (!fns.length) - return this; - return this.chain(index_js_1.pipe.apply(null, fns)); - } - // Reducers - all(fnFilter) { - return (0, index_js_1.all)(fnFilter)(this.iter); - } - any(fnFilter) { - return (0, index_js_1.any)(fnFilter)(this.iter); - } - count() { - return (0, index_js_1.count)()(this.iter); - } - first(fnFilter, defaultValue) { - return (0, index_js_1.first)(fnFilter, defaultValue)(this.iter); - } - forEach(fn) { - return (0, index_js_1.forEach)(fn)(this.iter); - } - max(fnSelector) { - return (0, index_js_1.max)(fnSelector)(this.iter); - } - min(fnSelector) { - return (0, index_js_1.min)(fnSelector)(this.iter); - } - reduce(fnReduce, initValue) { - return (0, index_js_1.reduce)(fnReduce, initValue)(this.iter); - } - reduceAsync(fnReduceAsync, initialValue) { - return (0, index_js_1.reduceAsync)(fnReduceAsync, initialValue)(this.iter); - } - reduceToSequence(fnReduce, initialValue) { - return this.chain((0, index_js_1.reduce)(fnReduce, initialValue)); - } - //// Cast - toArray() { - return [...this.iter]; + parts.push(p); } - toIterable() { - return (0, util_js_1.toIterableIterator)(this.iter); + if (!isValidPath(parts)) { + return []; } - }; - exports.ImplSequence = ImplSequence; - } -}); - -// node_modules/gensequence/dist/GenSequence.js -var require_GenSequence = __commonJS({ - "node_modules/gensequence/dist/GenSequence.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.sequenceFromRegExpMatch = exports.sequenceFromObject = exports.objectToSequence = exports.objectIterator = exports.toIterator = exports.GenSequence = exports.genSequence = exports.toIterableIterator = void 0; - var util_js_1 = require_util4(); - var ImplSequence_js_1 = require_ImplSequence(); - var util_js_2 = require_util4(); - Object.defineProperty(exports, "toIterableIterator", { enumerable: true, get: function() { - return util_js_2.toIterableIterator; - } }); - function genSequence(i) { - return new ImplSequence_js_1.ImplSequence(i); - } - exports.genSequence = genSequence; - exports.GenSequence = { - genSequence, - sequenceFromRegExpMatch, - sequenceFromObject - }; - exports.toIterator = util_js_1.toIterableIterator; - function* objectIterator(t) { - const keys = new Set(Object.keys(t)); - for (const k in t) { - if (keys.has(k)) { - yield [k, t[k]]; - } - } - } - exports.objectIterator = objectIterator; - function objectToSequence(t) { - return sequenceFromObject(t); - } - exports.objectToSequence = objectToSequence; - function sequenceFromObject(t) { - return genSequence(() => objectIterator(t)); - } - exports.sequenceFromObject = sequenceFromObject; - function sequenceFromRegExpMatch(pattern, text) { - function* doMatch() { - const regex = new RegExp(pattern); - let match; - let lastIndex = void 0; - while (match = regex.exec(text)) { - if (match.index === lastIndex) { + return parts; + } + module2.exports = { + get(object, path26, value) { + if (!isObj(object) || typeof path26 !== "string") { + return value === void 0 ? object : value; + } + const pathArray = getPathSegments(path26); + if (pathArray.length === 0) { + return; + } + for (let i = 0; i < pathArray.length; i++) { + object = object[pathArray[i]]; + if (object === void 0 || object === null) { + if (i !== pathArray.length - 1) { + return value; + } break; } - lastIndex = match.index; - yield match; } + return object === void 0 ? value : object; + }, + set(object, path26, value) { + if (!isObj(object) || typeof path26 !== "string") { + return object; + } + const root = object; + const pathArray = getPathSegments(path26); + for (let i = 0; i < pathArray.length; i++) { + const p = pathArray[i]; + if (!isObj(object[p])) { + object[p] = {}; + } + if (i === pathArray.length - 1) { + object[p] = value; + } + object = object[p]; + } + return root; + }, + delete(object, path26) { + if (!isObj(object) || typeof path26 !== "string") { + return false; + } + const pathArray = getPathSegments(path26); + for (let i = 0; i < pathArray.length; i++) { + const p = pathArray[i]; + if (i === pathArray.length - 1) { + delete object[p]; + return true; + } + object = object[p]; + if (!isObj(object)) { + return false; + } + } + }, + has(object, path26) { + if (!isObj(object) || typeof path26 !== "string") { + return false; + } + const pathArray = getPathSegments(path26); + if (pathArray.length === 0) { + return false; + } + for (let i = 0; i < pathArray.length; i++) { + if (isObj(object)) { + if (!(pathArray[i] in object)) { + return false; + } + object = object[pathArray[i]]; + } else { + return false; + } + } + return true; } - return genSequence(() => doMatch()); - } - exports.sequenceFromRegExpMatch = sequenceFromRegExpMatch; - exports.default = genSequence; + }; } }); -// node_modules/gensequence/dist/ImplAsyncSequence.js -var require_ImplAsyncSequence = __commonJS({ - "node_modules/gensequence/dist/ImplAsyncSequence.js"(exports) { +// node_modules/clear-module/node_modules/parent-module/index.js +var require_parent_module2 = __commonJS({ + "node_modules/clear-module/node_modules/parent-module/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ImplAsyncSequence = void 0; - var index_js_1 = require_operators2(); - var ImplAsyncSequence = class { - constructor(i) { - this.i = i; - } - get iter() { - return typeof this.i === "function" ? this.i() : this.i; - } - [Symbol.asyncIterator]() { - return this.iter[Symbol.asyncIterator](); + var callsites = require_callsites(); + module2.exports = (filePath) => { + const stacks = callsites(); + if (!filePath) { + return stacks[2].getFileName(); } - reduceAsync(fnReduceAsync, initialValue) { - return (0, index_js_1.reduceAsyncForAsyncIterator)(fnReduceAsync, initialValue)(this.iter); + let hasSeenValue = false; + stacks.shift(); + for (const stack of stacks) { + const parentFilePath = stack.getFileName(); + if (typeof parentFilePath !== "string") { + continue; + } + if (parentFilePath === filePath) { + hasSeenValue = true; + continue; + } + if (parentFilePath === "module.js") { + continue; + } + if (hasSeenValue && parentFilePath !== filePath) { + return parentFilePath; + } } }; - exports.ImplAsyncSequence = ImplAsyncSequence; - } -}); - -// node_modules/gensequence/dist/AsyncGenSequence.js -var require_AsyncGenSequence = __commonJS({ - "node_modules/gensequence/dist/AsyncGenSequence.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.asyncGenSequence = void 0; - var ImplAsyncSequence_js_1 = require_ImplAsyncSequence(); - function asyncGenSequence(i) { - return new ImplAsyncSequence_js_1.ImplAsyncSequence(i); - } - exports.asyncGenSequence = asyncGenSequence; } }); -// node_modules/gensequence/dist/ImplSequenceBuilder.js -var require_ImplSequenceBuilder = __commonJS({ - "node_modules/gensequence/dist/ImplSequenceBuilder.js"(exports) { +// node_modules/clear-module/index.js +var require_clear_module = __commonJS({ + "node_modules/clear-module/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ImplSequenceBuilder = void 0; - var index_js_1 = require_operators2(); - var ImplSequence_js_1 = require_ImplSequence(); - var ImplSequenceBuilder = class _ImplSequenceBuilder { - constructor(operators2 = []) { - this.operators = []; - this.operators = operators2; - } - build(i) { - return new ImplSequence_js_1.ImplSequence(i).pipe(index_js_1.pipe.apply(null, this.operators)); - } - pipe(...fns) { - return new _ImplSequenceBuilder([...this.operators, ...fns]); - } - //// Filters - /** keep values where the fnFilter(t) returns true */ - filter(fnFilter) { - return this.pipe((0, index_js_1.filter)(fnFilter)); - } - skip(n) { - return this.pipe((0, index_js_1.skip)(n)); - } - take(n) { - return this.pipe((0, index_js_1.take)(n)); - } - //// Extenders - concat(j) { - return this.pipe((0, index_js_1.concat)(j)); + var path26 = require("path"); + var resolveFrom2 = require_resolve_from2(); + var parentModule = require_parent_module2(); + var resolve13 = (moduleId) => { + try { + return resolveFrom2(path26.dirname(parentModule(__filename)), moduleId); + } catch (_) { } - concatMap(fn) { - return this.pipe((0, index_js_1.concatMap)(fn)); + }; + var clear = (moduleId) => { + if (typeof moduleId !== "string") { + throw new TypeError(`Expected a \`string\`, got \`${typeof moduleId}\``); } - //// Mappers - combine(fn, j) { - return this.pipe((0, index_js_1.combine)(fn, j)); + const filePath = resolve13(moduleId); + if (!filePath) { + return; } - /** map values from type T to type U */ - map(fnMap) { - return this.pipe((0, index_js_1.map)(fnMap)); + if (require.cache[filePath] && require.cache[filePath].parent) { + let i = require.cache[filePath].parent.children.length; + while (i--) { + if (require.cache[filePath].parent.children[i].id === filePath) { + require.cache[filePath].parent.children.splice(i, 1); + } + } } - scan(fnReduce, initialValue) { - return this.pipe((0, index_js_1.scan)(fnReduce, initialValue)); + if (require.cache[filePath]) { + const children = require.cache[filePath].children.map((child) => child.id); + delete require.cache[filePath]; + for (const id of children) { + clear(id); + } } }; - exports.ImplSequenceBuilder = ImplSequenceBuilder; - } -}); - -// node_modules/gensequence/dist/builder.js -var require_builder = __commonJS({ - "node_modules/gensequence/dist/builder.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.builder = void 0; - var ImplSequenceBuilder_js_1 = require_ImplSequenceBuilder(); - var index_js_1 = require_operators2(); - function makeBuilder(fn) { - return new ImplSequenceBuilder_js_1.ImplSequenceBuilder([fn]); - } - exports.builder = Object.freeze({ - pipe: (fn) => { - return makeBuilder(fn); - }, - //// Filters - /** keep values where the fnFilter(t) returns true */ - filter: (fnFilter) => { - return makeBuilder((0, index_js_1.filter)(fnFilter)); - }, - skip: (n) => { - return makeBuilder((0, index_js_1.skip)(n)); - }, - take: (n) => { - return makeBuilder((0, index_js_1.take)(n)); - }, - //// Extenders - concat: (j) => { - return makeBuilder((0, index_js_1.concat)(j)); - }, - concatMap: (fn) => { - return makeBuilder((0, index_js_1.concatMap)(fn)); - }, - //// Mappers - combine: (fn, j) => { - return makeBuilder((0, index_js_1.combine)(fn, j)); - }, - /** map values from type T to type U */ - map: (fnMap) => { - return makeBuilder((0, index_js_1.map)(fnMap)); - }, - scan: (fnReduce, initialValue) => { - return makeBuilder((0, index_js_1.scan)(fnReduce, initialValue)); - } - }); - } -}); - -// node_modules/gensequence/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/gensequence/dist/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; + clear.all = () => { + const directory = path26.dirname(parentModule(__filename)); + for (const moduleId of Object.keys(require.cache)) { + delete require.cache[resolveFrom2(directory, moduleId)]; } - Object.defineProperty(o, k2, desc); - } : 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 __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); }; - 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); + clear.match = (regex) => { + for (const moduleId of Object.keys(require.cache)) { + if (regex.test(moduleId)) { + clear(moduleId); + } } - __setModuleDefault(result, mod); - return result; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.operators = void 0; - __exportStar(require_GenSequence(), exports); - __exportStar(require_AsyncGenSequence(), exports); - __exportStar(require_builder(), exports); - var _operators = __importStar(require_operators2()); - exports.operators = _operators; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/TrieNode.js -var require_TrieNode = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/TrieNode.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ChildMap = exports.FLAG_WORD = void 0; - exports.FLAG_WORD = 1; - var ChildMap = class extends Map { + clear.single = (moduleId) => { + if (typeof moduleId !== "string") { + throw new TypeError(`Expected a \`string\`, got \`${typeof moduleId}\``); + } + delete require.cache[resolve13(moduleId)]; }; - exports.ChildMap = ChildMap; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/constants.js -var require_constants4 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/constants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultTrieOptions = exports.IDENTITY_PREFIX = exports.LINE_COMMENT = exports.FORBID_PREFIX = exports.CASE_INSENSITIVE_PREFIX = exports.OPTIONAL_COMPOUND_FIX = exports.COMPOUND_FIX = void 0; - exports.COMPOUND_FIX = "+"; - exports.OPTIONAL_COMPOUND_FIX = "*"; - exports.CASE_INSENSITIVE_PREFIX = "~"; - exports.FORBID_PREFIX = "!"; - exports.LINE_COMMENT = "#"; - exports.IDENTITY_PREFIX = "="; - exports.defaultTrieOptions = Object.freeze({ - compoundCharacter: exports.COMPOUND_FIX, - forbiddenWordPrefix: exports.FORBID_PREFIX, - stripCaseAndAccentsPrefix: exports.CASE_INSENSITIVE_PREFIX - }); + module2.exports = clear; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/mergeDefaults.js -var require_mergeDefaults = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/mergeDefaults.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mergeDefaults = void 0; - function mergeDefaults(value, defaultValue) { - const result = { ...defaultValue }; - if (value) { - for (const [k, v] of Object.entries(value)) { - if (k in result) { - result[k] = v ?? result[k]; +// node_modules/vscode-languageserver-textdocument/lib/umd/main.js +var require_main = __commonJS({ + "node_modules/vscode-languageserver-textdocument/lib/umd/main.js"(exports, module2) { + var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; } } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + (function(factory) { + if (typeof module2 === "object" && typeof module2.exports === "object") { + var v = factory(require, exports); + if (v !== void 0) + module2.exports = v; + } else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); } - return result; - } - exports.mergeDefaults = mergeDefaults; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/mergeOptionalWithDefaults.js -var require_mergeOptionalWithDefaults = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/mergeOptionalWithDefaults.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mergeOptionalWithDefaults = void 0; - var constants_js_1 = require_constants4(); - var mergeDefaults_js_1 = require_mergeDefaults(); - function mergeOptionalWithDefaults(options) { - return (0, mergeDefaults_js_1.mergeDefaults)(options, constants_js_1.defaultTrieOptions); - } - exports.mergeOptionalWithDefaults = mergeOptionalWithDefaults; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/walker/walkerTypes.js -var require_walkerTypes = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/walker/walkerTypes.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.CompoundWordsMethod = exports.WORD_SEPARATOR = exports.JOIN_SEPARATOR = void 0; - exports.JOIN_SEPARATOR = "+"; - exports.WORD_SEPARATOR = " "; - var CompoundWordsMethod; - (function(CompoundWordsMethod2) { - CompoundWordsMethod2[CompoundWordsMethod2["NONE"] = 0] = "NONE"; - CompoundWordsMethod2[CompoundWordsMethod2["SEPARATE_WORDS"] = 1] = "SEPARATE_WORDS"; - CompoundWordsMethod2[CompoundWordsMethod2["JOIN_WORDS"] = 2] = "JOIN_WORDS"; - })(CompoundWordsMethod || (exports.CompoundWordsMethod = CompoundWordsMethod = {})); - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/walker/walker.js -var require_walker = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/walker/walker.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.walker = void 0; - var walkerTypes_js_1 = require_walkerTypes(); - function* walker(root, compoundingMethod = walkerTypes_js_1.CompoundWordsMethod.NONE) { - const roots = { - [walkerTypes_js_1.CompoundWordsMethod.NONE]: [], - [walkerTypes_js_1.CompoundWordsMethod.JOIN_WORDS]: [[walkerTypes_js_1.JOIN_SEPARATOR, root]], - [walkerTypes_js_1.CompoundWordsMethod.SEPARATE_WORDS]: [[walkerTypes_js_1.WORD_SEPARATOR, root]] - }; - function* children(n) { - if (n.c) { - yield* n.c; - } - if (n.f) { - yield* roots[compoundingMethod]; - } - } - let depth = 0; - const stack = []; - stack[depth] = { t: "", c: children(root) }; - let ir; - while (depth >= 0) { - let baseText = stack[depth].t; - while (!(ir = stack[depth].c.next()).done) { - const [char, node] = ir.value; - const text = baseText + char; - const goDeeper = yield { text, node, depth }; - if (goDeeper || goDeeper === void 0) { - depth++; - baseText = text; - stack[depth] = { t: text, c: children(node) }; + })(function(require2, exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.TextDocument = void 0; + var FullTextDocument = ( + /** @class */ + function() { + function FullTextDocument2(uri, languageId, version4, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version4; + this._content = content; + this._lineOffsets = void 0; } + Object.defineProperty(FullTextDocument2.prototype, "uri", { + get: function() { + return this._uri; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(FullTextDocument2.prototype, "languageId", { + get: function() { + return this._languageId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(FullTextDocument2.prototype, "version", { + get: function() { + return this._version; + }, + enumerable: false, + configurable: true + }); + FullTextDocument2.prototype.getText = function(range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument2.prototype.update = function(changes, version4) { + for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { + var change = changes_1[_i]; + if (FullTextDocument2.isIncremental(change)) { + var range = getWellformedRange(change.range); + var startOffset = this.offsetAt(range.start); + var endOffset = this.offsetAt(range.end); + this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); + var startLine = Math.max(range.start.line, 0); + var endLine = Math.max(range.end.line, 0); + var lineOffsets = this._lineOffsets; + var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (var i = 0, len = addedLineOffsets.length; i < len; i++) { + lineOffsets[i + startLine + 1] = addedLineOffsets[i]; + } + } else { + if (addedLineOffsets.length < 1e4) { + lineOffsets.splice.apply(lineOffsets, __spreadArray([startLine + 1, endLine - startLine], addedLineOffsets, false)); + } else { + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + var diff = change.text.length - (endOffset - startOffset); + if (diff !== 0) { + for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { + lineOffsets[i] = lineOffsets[i] + diff; + } + } + } else if (FullTextDocument2.isFull(change)) { + this._content = change.text; + this._lineOffsets = void 0; + } else { + throw new Error("Unknown change event received"); + } + } + this._version = version4; + }; + FullTextDocument2.prototype.getLineOffsets = function() { + if (this._lineOffsets === void 0) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + }; + FullTextDocument2.prototype.positionAt = function(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return { line: 0, character: offset }; + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + var line = low - 1; + return { line, character: offset - lineOffsets[line] }; + }; + FullTextDocument2.prototype.offsetAt = function(position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument2.prototype, "lineCount", { + get: function() { + return this.getLineOffsets().length; + }, + enumerable: false, + configurable: true + }); + FullTextDocument2.isIncremental = function(event) { + var candidate = event; + return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number"); + }; + FullTextDocument2.isFull = function(event) { + var candidate = event; + return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0; + }; + return FullTextDocument2; + }() + ); + var TextDocument; + (function(TextDocument2) { + function create(uri, languageId, version4, content) { + return new FullTextDocument(uri, languageId, version4, content); } - depth -= 1; - } - } - exports.walker = walker; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/trie-util.js -var require_trie_util = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/trie-util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.trieNodeToRoot = exports.isCircular = exports.countWords = exports.countNodes = exports.findNode = exports.has = exports.createTriFromList = exports.createTrieRoot = exports.iteratorTrieWords = exports.iterateTrie = exports.walk = exports.orderTrie = exports.isWordTerminationNode = exports.insert = void 0; - var gensequence_1 = require_dist2(); - var TrieNode_js_1 = require_TrieNode(); - var mergeOptionalWithDefaults_js_1 = require_mergeOptionalWithDefaults(); - var walker_js_1 = require_walker(); - function insert(text, node = {}) { - if (text.length) { - const head = text[0]; - const tail = text.slice(1); - node.c = node.c || new TrieNode_js_1.ChildMap(); - node.c.set(head, insert(tail, node.c.get(head))); - } else { - node.f = (node.f || 0) | TrieNode_js_1.FLAG_WORD; - } - return node; - } - exports.insert = insert; - function isWordTerminationNode(node) { - return ((node.f || 0) & TrieNode_js_1.FLAG_WORD) === TrieNode_js_1.FLAG_WORD; - } - exports.isWordTerminationNode = isWordTerminationNode; - function orderTrie(node) { - if (!node.c) - return; - const nodes = [...node.c].sort(([a], [b]) => a < b ? -1 : 1); - node.c = new Map(nodes); - for (const n of node.c) { - orderTrie(n[1]); - } - } - exports.orderTrie = orderTrie; - function walk(node) { - return (0, gensequence_1.genSequence)((0, walker_js_1.walker)(node)); - } - exports.walk = walk; - exports.iterateTrie = walk; - function iteratorTrieWords(node) { - return walk(node).filter((r) => isWordTerminationNode(r.node)).map((r) => r.text); - } - exports.iteratorTrieWords = iteratorTrieWords; - function createTrieRoot(options) { - const fullOptions = (0, mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults)(options); - return { - ...fullOptions, - c: /* @__PURE__ */ new Map() - }; - } - exports.createTrieRoot = createTrieRoot; - function createTriFromList(words, options) { - const root = createTrieRoot(options); - for (const word of words) { - if (word.length) { - insert(word, root); - } - } - return root; - } - exports.createTriFromList = createTriFromList; - function has(node, word) { - let h = word.slice(0, 1); - let t = word.slice(1); - while (node.c && node.c.has(h)) { - node = node.c.get(h); - h = t.slice(0, 1); - t = t.slice(1); - } - return !h.length && !!((node.f || 0) & TrieNode_js_1.FLAG_WORD); - } - exports.has = has; - function findNode(node, prefix) { - let h = prefix.slice(0, 1); - let t = prefix.slice(1); - let n = node; - while (h.length && n && n.c) { - n = n.c.get(h); - h = t.slice(0, 1); - t = t.slice(1); - } - return n; - } - exports.findNode = findNode; - function countNodes(root) { - const seen = /* @__PURE__ */ new Set(); - function walk2(n) { - if (seen.has(n)) - return; - seen.add(n); - if (n.c) { - [...n.c.values()].forEach((n2) => walk2(n2)); - } - } - walk2(root); - return seen.size; - } - exports.countNodes = countNodes; - function countWords(root) { - const visited = /* @__PURE__ */ new Map(); - function walk2(n) { - if (visited.has(n)) { - return visited.get(n); - } - let cnt = n.f ? 1 : 0; - visited.set(n, cnt); - if (!n.c) { - return cnt; - } - for (const c of n.c.values()) { - cnt += walk2(c); - } - visited.set(n, cnt); - return cnt; - } - return walk2(root); - } - exports.countWords = countWords; - function isCircular(root) { - const seen = /* @__PURE__ */ new Set(); - const inStack = /* @__PURE__ */ new Set(); - function walk2(n) { - if (seen.has(n)) - return { isCircular: false, allSeen: true }; - if (inStack.has(n)) - return { isCircular: true, allSeen: false }; - inStack.add(n); - let r = { isCircular: false, allSeen: true }; - if (n.c) { - r = [...n.c.values()].reduce((acc, n2) => { - if (acc.isCircular) - return acc; - const r2 = walk2(n2); - r2.allSeen = r2.allSeen && acc.allSeen; - return r2; - }, r); - } - if (r.allSeen) { - seen.add(n); - } - inStack.delete(n); - return r; - } - return walk2(root).isCircular; - } - exports.isCircular = isCircular; - function trieNodeToRoot(node, options) { - const newOptions = (0, mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults)(options); - return { - ...newOptions, - c: node.c || /* @__PURE__ */ new Map() - }; - } - exports.trieNodeToRoot = trieNodeToRoot; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/consolidate.js -var require_consolidate = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/consolidate.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.consolidate = void 0; - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - function consolidate(root) { - let count = 0; - const signatures = /* @__PURE__ */ new Map(); - const cached = /* @__PURE__ */ new Map(); - const knownMap = /* @__PURE__ */ new Map(); - function signature(n) { - const isWord = n.f ? "*" : ""; - const ref = n.c ? JSON.stringify([...n.c.entries()].map(([k, n2]) => [k, cached.get(n2)])) : ""; - return isWord + ref; - } - function findEow(n) { - if (n.f && !n.c) - return n; - let r; - if (n.c) { - for (const c of n.c.values()) { - r = findEow(c); - if (r) - break; + TextDocument2.create = create; + function update(document, changes, version4) { + if (document instanceof FullTextDocument) { + document.update(changes, version4); + return document; + } else { + throw new Error("TextDocument.update: document must be created by TextDocument.create"); } } - return r; - } - function compareMaps(a, b) { - for (const e of a) { - if (b.get(e[0]) !== e[1]) - return false; - } - return a.length === b.size; - } - function deepCopy(n) { - const k = knownMap.get(n); - if (k) { - return k; - } - const orig = n; - if (n.c) { - const children = [...n.c].map((c) => [c[0], deepCopy(c[1])]); - if (!compareMaps(children, n.c)) { - n = { f: n.f, c: new Map(children) }; + TextDocument2.update = update; + function applyEdits2(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits.map(getWellformedEdit), function(a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + var lastModifiedOffset = 0; + var spans = []; + for (var _i = 0, sortedEdits_1 = sortedEdits; _i < sortedEdits_1.length; _i++) { + var e = sortedEdits_1[_i]; + var startOffset = document.offsetAt(e.range.start); + if (startOffset < lastModifiedOffset) { + throw new Error("Overlapping edit"); + } else if (startOffset > lastModifiedOffset) { + spans.push(text.substring(lastModifiedOffset, startOffset)); + } + if (e.newText.length) { + spans.push(e.newText); + } + lastModifiedOffset = document.offsetAt(e.range.end); } + spans.push(text.substr(lastModifiedOffset)); + return spans.join(""); } - const sig = signature(n); - const ref = signatures.get(sig); - if (ref) { - knownMap.set(orig, ref); - return ref; - } - Object.freeze(n); - signatures.set(sig, n); - cached.set(n, count++); - knownMap.set(orig, n); - return n; - } - function process4(n) { - if (cached.has(n)) { - return n; - } - if (Object.isFrozen(n)) { - return knownMap.get(n) || deepCopy(n); - } - if (n.c) { - const children = [...n.c].sort((a, b) => a[0] < b[0] ? -1 : 1).map((c) => [c[0], process4(c[1])]); - n.c = new Map(children); - } - const sig = signature(n); - const ref = signatures.get(sig); - if (ref) { - return ref; - } - signatures.set(sig, n); - cached.set(n, count++); - return n; - } - const eow = findEow(root) || { f: TrieNode_js_1.FLAG_WORD, c: void 0 }; - signatures.set(signature(eow), eow); - cached.set(eow, count++); - return (0, trie_util_js_1.trieNodeToRoot)(process4(root), root); - } - exports.consolidate = consolidate; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/PairingHeap.js -var require_PairingHeap = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/PairingHeap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.heapMethods = exports.PairingHeap = void 0; - var PairingHeap = class { - constructor(compare2) { - this.compare = compare2; - this._size = 0; - } - add(v) { - this._heap = insert(this.compare, this._heap, v); - ++this._size; - return this; - } - dequeue() { - const n = this.next(); - if (n.done) - return void 0; - return n.value; - } - concat(i) { - for (const v of i) { - this.add(v); - } - return this; - } - next() { - if (!this._heap) { - return { value: void 0, done: true }; + TextDocument2.applyEdits = applyEdits2; + })(TextDocument = exports2.TextDocument || (exports2.TextDocument = {})); + function mergeSort(data, compare4) { + if (data.length <= 1) { + return data; } - const value = this._heap.v; - --this._size; - this._heap = removeHead(this.compare, this._heap); - return { value }; - } - peek() { - return this._heap?.v; - } - [Symbol.iterator]() { - return this; - } - get length() { - return this._size; - } - }; - exports.PairingHeap = PairingHeap; - function removeHead(compare2, heap) { - if (!heap || !heap.c) - return void 0; - return mergeSiblings(compare2, heap.c); - } - function insert(compare2, heap, v) { - const n = { - v, - s: void 0, - c: void 0 - }; - if (!heap || compare2(v, heap.v) <= 0) { - n.c = heap; - return n; - } - n.s = heap.c; - heap.c = n; - return heap; - } - function merge(compare2, a, b) { - if (compare2(a.v, b.v) <= 0) { - a.s = void 0; - b.s = a.c; - a.c = b; - return a; - } - b.s = void 0; - a.s = b.c; - b.c = a; - return b; - } - function mergeSiblings(compare2, n) { - if (!n.s) - return n; - const s = n.s; - const ss = s.s; - const m = merge(compare2, n, s); - return ss ? merge(compare2, m, mergeSiblings(compare2, ss)) : m; - } - exports.heapMethods = { - insert, - merge, - mergeSiblings - }; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/distanceAStarWeighted.js -var require_distanceAStarWeighted = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/distanceAStarWeighted.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.distanceAStarWeightedEx = exports.distanceAStarWeighted = void 0; - var assert_1 = __importDefault(require("assert")); - var PairingHeap_js_1 = require_PairingHeap(); - function distanceAStarWeighted(wordA, wordB, map, cost = 100) { - const best = _distanceAStarWeightedEx(wordA, wordB, map, cost); - const penalty = map.calcAdjustment(wordB); - return best.c + best.p + penalty; - } - exports.distanceAStarWeighted = distanceAStarWeighted; - function distanceAStarWeightedEx(wordA, wordB, map, cost = 100) { - const best = _distanceAStarWeightedEx(wordA, wordB, map, cost); - const aa = "^" + wordA + "$"; - const bb = "^" + wordB + "$"; - const penalty = map.calcAdjustment(wordB); - const result = { - a: aa, - b: bb, - cost: best.c + best.p + penalty, - penalty, - segments: [] - }; - const segments = result.segments; - for (let n = best; n.f; n = n.f) { - const f = n.f; - const a = aa.slice(f.ai, n.ai); - const b = bb.slice(f.bi, n.bi); - const c = n.c - f.c; - const p = n.p - f.p; - segments.push({ a, b, c, p }); - } - segments.reverse(); - return result; - } - exports.distanceAStarWeightedEx = distanceAStarWeightedEx; - function _distanceAStarWeightedEx(wordA, wordB, map, cost = 100) { - const a = "^" + wordA + "$"; - const b = "^" + wordB + "$"; - const aN = a.length; - const bN = b.length; - const candidates = new CandidatePool(aN, bN); - candidates.add({ ai: 0, bi: 0, c: 0, p: 0, f: void 0 }); - function opSub(n) { - const { ai, bi, c, p } = n; - if (ai < aN && bi < bN) { - const cc = a[ai] === b[bi] ? c : c + cost; - candidates.add({ ai: ai + 1, bi: bi + 1, c: cc, p, f: n }); + var p = data.length / 2 | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare4); + mergeSort(right, compare4); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare4(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + data[i++] = left[leftIdx++]; + } else { + data[i++] = right[rightIdx++]; + } } - } - function opIns(n) { - const { ai, bi, c, p } = n; - if (bi < bN) { - candidates.add({ ai, bi: bi + 1, c: c + cost, p, f: n }); + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; } - } - function opDel(n) { - const { ai, bi, c, p } = n; - if (ai < aN) { - candidates.add({ ai: ai + 1, bi, c: c + cost, p, f: n }); + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; } + return data; } - function opSwap(n) { - const { ai, bi, c, p } = n; - if (a[ai] === b[bi + 1] && a[ai + 1] === b[bi]) { - candidates.add({ ai: ai + 2, bi: bi + 2, c: c + cost, p, f: n }); + function computeLineOffsets(text, isAtLineStart, textOffset2) { + if (textOffset2 === void 0) { + textOffset2 = 0; } - } - function opMap2(n) { - const { ai, bi, c, p } = n; - const pos = { a, b, ai, bi, c, p }; - const costCalculations = [map.calcInsDelCosts(pos), map.calcSwapCosts(pos), map.calcReplaceCosts(pos)]; - costCalculations.forEach((iter) => { - for (const nn of iter) { - candidates.add({ ...nn, f: n }); + var result = isAtLineStart ? [textOffset2] : []; + for (var i = 0; i < text.length; i++) { + var ch = text.charCodeAt(i); + if (ch === 13 || ch === 10) { + if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) { + i++; + } + result.push(textOffset2 + i + 1); } - }); - } - let best; - while (best = candidates.next()) { - if (best.ai === aN && best.bi === bN) - break; - opSwap(best); - opIns(best); - opDel(best); - opMap2(best); - opSub(best); - } - (0, assert_1.default)(best); - return best; - } - var CandidatePool = class { - constructor(aN, bN) { - this.aN = aN; - this.bN = bN; - this.pool = new PairingHeap_js_1.PairingHeap(compare2); - this.grid = []; + } + return result; } - next() { - let n; - while (n = this.pool.dequeue()) { - if (!n.d) - return n; + function getWellformedRange(range) { + var start = range.start; + var end = range.end; + if (start.line > end.line || start.line === end.line && start.character > end.character) { + return { start: end, end: start }; } - return void 0; + return range; } - add(n) { - const i = idx(n.ai, n.bi, this.bN); - const g = this.grid[i]; - if (!g) { - this.grid[i] = n; - this.pool.add(n); - return; + function getWellformedEdit(textEdit) { + var range = getWellformedRange(textEdit.range); + if (range !== textEdit.range) { + return { newText: textEdit.newText, range }; } - if (g.c <= n.c) - return; - g.d = true; - this.grid[i] = n; - this.pool.add(n); + return textEdit; } - }; - function idx(r, c, cols) { - return r * cols + c; - } - function compare2(a, b) { - return a.c - b.c || b.ai + b.bi - a.ai - a.bi; - } + }); } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/levenshtein.js -var require_levenshtein = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/levenshtein.js"(exports) { +// node_modules/cspell-lib/dist/lib-cjs/pkg-info.cjs +var require_pkg_info = __commonJS({ + "node_modules/cspell-lib/dist/lib-cjs/pkg-info.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.levenshteinDistance = void 0; - function levenshteinDistance(a, b) { - const aa = " " + a; - const bb = " " + b; - const nA = a.length + 1; - const nB = b.length + 1; - const firstRow = []; - for (let i = 0; i <= nA; ++i) { - firstRow[i] = i; - } - const matrix = [firstRow, [1].concat(firstRow), [2, 1].concat(firstRow)]; - let ppRow = matrix[0]; - let pRow = matrix[1]; - for (let j = 2; j <= nB; ++j) { - const row = matrix[j % 3]; - row[0] = pRow[0] + 1; - row[1] = pRow[1] + 1; - const bp = bb[j - 1]; - const bc = bb[j]; - let ap = aa[0]; - for (let i = 2, i1 = 1; i <= nA; i1 = i, ++i) { - const ac = aa[i]; - const c = pRow[i1] + (ac == bc ? 0 : 1); - const ct = ac == bp && ap == bc ? ppRow[i1 - 1] + 1 : c; - row[i] = Math.min( - c, - // substitute - ct, - // transpose - pRow[i] + 1, - // insert - row[i1] + 1 - // delete - ); - ap = ac; - } - ppRow = pRow; - pRow = row; - } - return pRow[nA]; - } - exports.levenshteinDistance = levenshteinDistance; + exports.srcDirectory = void 0; + exports.srcDirectory = __dirname; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/constants.js -var require_constants5 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/constants.js"(exports) { +// node_modules/cspell-lib/dist/lib-cjs/index.cjs +var require_lib_cjs = __commonJS({ + "node_modules/cspell-lib/dist/lib-cjs/index.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.DEFAULT_COMPOUNDED_WORD_SEPARATOR = void 0; - exports.DEFAULT_COMPOUNDED_WORD_SEPARATOR = "\u2219"; + exports.srcDirectory = void 0; + var pkg_info_cjs_1 = require_pkg_info(); + Object.defineProperty(exports, "srcDirectory", { enumerable: true, get: function() { + return pkg_info_cjs_1.srcDirectory; + } }); } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/weightedMaps.js -var require_weightedMaps = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/weightedMaps.js"(exports) { +// node_modules/cspell-dictionary/node_modules/fast-equals/dist/fast-equals.cjs.js +var require_fast_equals_cjs = __commonJS({ + "node_modules/cspell-dictionary/node_modules/fast-equals/dist/fast-equals.cjs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.lookupReplaceCost = exports.prettyPrintWeightMap = exports.prettyPrintSwap = exports.prettyPrintReplace = exports.splitMapSubstrings = exports.splitMapSubstringsIterable = exports.addDefsToWeightMap = exports.addAdjustment = exports.addDefToWeightMap = exports.createWeightMap = void 0; - var constants_js_1 = require_constants5(); - var matchPossibleWordSeparators = /[+∙•・●]/g; - function createWeightMap(...defs) { - const map = _createWeightMap(); - addDefsToWeightMap(map, defs); - return map; - } - exports.createWeightMap = createWeightMap; - function addDefToWeightMap(map, ...defs) { - return addDefsToWeightMap(map, defs); - } - exports.addDefToWeightMap = addDefToWeightMap; - function addAdjustment(map, ...adjustments) { - for (const adj of adjustments) { - map.adjustments.set(adj.id, adj); - } - return map; - } - exports.addAdjustment = addAdjustment; - function addDefsToWeightMap(map, defs) { - function addSet(set, def) { - addSetToTrieCost(map.insDel, set, def.insDel, def.penalty); - addSetToTrieTrieCost(map.replace, set, def.replace, def.penalty); - addSetToTrieTrieCost(map.swap, set, def.swap, def.penalty); - } - for (const _def of defs) { - const def = normalizeDef(_def); - const mapSets = splitMap(def); - mapSets.forEach((s) => addSet(s, def)); - } - return map; - } - exports.addDefsToWeightMap = addDefsToWeightMap; - function _createWeightMap() { - return new _WeightedMap(); - } - function lowest(a, b) { - if (a === void 0) - return b; - if (b === void 0) - return a; - return a <= b ? a : b; - } - function highest(a, b) { - if (a === void 0) - return b; - if (b === void 0) - return a; - return a >= b ? a : b; - } - function normalize(s) { - const f = /* @__PURE__ */ new Set([s]); - f.add(s.normalize("NFC")); - f.add(s.normalize("NFD")); - return f; + function createDefaultIsNestedEqual(comparator) { + return function isEqual(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, meta) { + return comparator(a, b, meta); + }; } - function* splitMapSubstringsIterable(map) { - let seq = ""; - let mode = 0; - for (const char of map) { - if (mode && char === ")") { - yield* normalize(seq); - mode = 0; - continue; - } - if (mode) { - seq += char; - continue; + function createIsCircular(areItemsEqual) { + return function isCircular2(a, b, isEqual, cache2) { + if (!a || !b || typeof a !== "object" || typeof b !== "object") { + return areItemsEqual(a, b, isEqual, cache2); } - if (char === "(") { - mode = 1; - seq = ""; - continue; + var cachedA = cache2.get(a); + var cachedB = cache2.get(b); + if (cachedA && cachedB) { + return cachedA === b && cachedB === a; } - yield* normalize(char); - } - } - exports.splitMapSubstringsIterable = splitMapSubstringsIterable; - function splitMapSubstrings(map) { - return [...splitMapSubstringsIterable(map)]; - } - exports.splitMapSubstrings = splitMapSubstrings; - function splitMap(def) { - const { map } = def; - const sets = map.split("|"); - return sets.map(splitMapSubstrings).filter((s) => s.length > 0); - } - function addToTrieCost(trie, str, cost, penalties) { - if (!str) - return; - let t = trie; - for (const c of str) { - const n = t.n = t.n || /* @__PURE__ */ Object.create(null); - t = n[c] = n[c] || /* @__PURE__ */ Object.create(null); - } - t.c = lowest(t.c, cost); - t.p = highest(t.p, penalties); + cache2.set(a, b); + cache2.set(b, a); + var result = areItemsEqual(a, b, isEqual, cache2); + cache2.delete(a); + cache2.delete(b); + return result; + }; } - function addToTrieTrieCost(trie, left, right, cost, penalties) { - let t = trie; - for (const c of left) { - const n = t.n = t.n || /* @__PURE__ */ Object.create(null); - t = n[c] = n[c] || /* @__PURE__ */ Object.create(null); + function merge4(a, b) { + var merged = {}; + for (var key in a) { + merged[key] = a[key]; } - const trieCost = t.t = t.t || /* @__PURE__ */ Object.create(null); - addToTrieCost(trieCost, right, cost, penalties); - } - function addSetToTrieCost(trie, set, cost, penalties) { - if (cost === void 0) - return; - for (const str of set) { - addToTrieCost(trie, str, cost, penalties); + for (var key in b) { + merged[key] = b[key]; } + return merged; } - function addSetToTrieTrieCost(trie, set, cost, penalties) { - if (cost === void 0) - return; - for (const left of set) { - for (const right of set) { - if (left === right) - continue; - addToTrieTrieCost(trie, left, right, cost, penalties); - } - } + function isPlainObject(value) { + return value.constructor === Object || value.constructor == null; } - function* searchTrieNodes(trie, str, i) { - const len = str.length; - for (let n = trie.n; i < len && n; ) { - const t = n[str[i]]; - if (!t) - return; - ++i; - yield { i, t }; - n = t.n; - } + function isPromiseLike(value) { + return typeof value.then === "function"; } - function* walkTrieNodes(t, s) { - if (!t) - return; - yield { s, t }; - if (!t.n) - return; - for (const [k, v] of Object.entries(t.n)) { - yield* walkTrieNodes(v, s + k); - } + function sameValueZeroEqual(a, b) { + return a === b || a !== a && b !== b; } - function* walkTrieCost(trie) { - for (const { s, t } of walkTrieNodes(trie, "")) { - if (t.c) { - yield { s, c: t.c, p: t.p }; + var ARGUMENTS_TAG = "[object Arguments]"; + var BOOLEAN_TAG = "[object Boolean]"; + var DATE_TAG = "[object Date]"; + var REG_EXP_TAG = "[object RegExp]"; + var MAP_TAG = "[object Map]"; + var NUMBER_TAG = "[object Number]"; + var OBJECT_TAG = "[object Object]"; + var SET_TAG = "[object Set]"; + var STRING_TAG = "[object String]"; + var toString = Object.prototype.toString; + function createComparator(_a2) { + var areArraysEqual2 = _a2.areArraysEqual, areDatesEqual2 = _a2.areDatesEqual, areMapsEqual2 = _a2.areMapsEqual, areObjectsEqual2 = _a2.areObjectsEqual, areRegExpsEqual2 = _a2.areRegExpsEqual, areSetsEqual2 = _a2.areSetsEqual, createIsNestedEqual = _a2.createIsNestedEqual; + var isEqual = createIsNestedEqual(comparator); + function comparator(a, b, meta) { + if (a === b) { + return true; } - } - } - function* walkTrieTrieCost(trie) { - for (const { s: a, t } of walkTrieNodes(trie, "")) { - if (t.t) { - for (const { s: b, c, p } of walkTrieCost(t.t)) { - yield { a, b, c, p }; - } + if (!a || !b || typeof a !== "object" || typeof b !== "object") { + return a !== a && b !== b; } - } - } - function* findTrieCostPrefixes(trie, str, i) { - for (const n of searchTrieNodes(trie, str, i)) { - const { c, p } = n.t; - if (c !== void 0) { - yield { i: n.i, c, p: p || 0 }; + if (isPlainObject(a) && isPlainObject(b)) { + return areObjectsEqual2(a, b, isEqual, meta); } - } - } - function* findTrieTrieCostPrefixes(trie, str, i) { - for (const n of searchTrieNodes(trie, str, i)) { - const t = n.t.t; - if (t !== void 0) { - yield { i: n.i, t }; + var aArray = Array.isArray(a); + var bArray = Array.isArray(b); + if (aArray || bArray) { + return aArray === bArray && areArraysEqual2(a, b, isEqual, meta); } - } - } - var _WeightedMap = class { - constructor() { - this.insDel = {}; - this.replace = {}; - this.swap = {}; - this.adjustments = /* @__PURE__ */ new Map(); - } - *calcInsDelCosts(pos) { - const { a, ai, b, bi, c, p } = pos; - for (const del of findTrieCostPrefixes(this.insDel, a, ai)) { - yield { a, b, ai: del.i, bi, c: c + del.c, p: p + del.p }; + var aTag = toString.call(a); + if (aTag !== toString.call(b)) { + return false; } - for (const ins of findTrieCostPrefixes(this.insDel, b, bi)) { - yield { a, b, ai, bi: ins.i, c: c + ins.c, p: p + ins.p }; + if (aTag === DATE_TAG) { + return areDatesEqual2(a, b, isEqual, meta); } - } - *calcReplaceCosts(pos) { - const { a, ai, b, bi, c, p } = pos; - for (const del of findTrieTrieCostPrefixes(this.replace, a, ai)) { - for (const ins of findTrieCostPrefixes(del.t, b, bi)) { - yield { a, b, ai: del.i, bi: ins.i, c: c + ins.c, p: p + ins.p }; - } + if (aTag === REG_EXP_TAG) { + return areRegExpsEqual2(a, b, isEqual, meta); } - } - *calcSwapCosts(pos) { - const { a, ai, b, bi, c, p } = pos; - const swap = this.swap; - for (const left of findTrieTrieCostPrefixes(swap, a, ai)) { - for (const right of findTrieCostPrefixes(left.t, a, left.i)) { - const sw = a.slice(left.i, right.i) + a.slice(ai, left.i); - if (b.slice(bi).startsWith(sw)) { - const len = sw.length; - yield { a, b, ai: ai + len, bi: bi + len, c: c + right.c, p: p + right.p }; - } - } + if (aTag === MAP_TAG) { + return areMapsEqual2(a, b, isEqual, meta); } - } - calcAdjustment(word) { - let penalty = 0; - for (const adj of this.adjustments.values()) { - if (adj.regexp.global) { - for (const _m of word.matchAll(adj.regexp)) { - penalty += adj.penalty; - } - } else if (adj.regexp.test(word)) { - penalty += adj.penalty; - } + if (aTag === SET_TAG) { + return areSetsEqual2(a, b, isEqual, meta); } - return penalty; - } - }; - function prettyPrintInsDel(trie, pfx = "", indent = " ") { - function* walk() { - for (const { s, c, p } of walkTrieCost(trie)) { - const pm = p ? ` + ${p}` : ""; - yield indent + `(${s}) = ${c}${pm}`; + if (aTag === OBJECT_TAG || aTag === ARGUMENTS_TAG) { + return isPromiseLike(a) || isPromiseLike(b) ? false : areObjectsEqual2(a, b, isEqual, meta); } - } - return ["InsDel:", ...[...walk()].sort()].map((line) => pfx + line + "\n").join(""); - } - function prettyPrintReplace(trie, pfx = "", indent = " ") { - function* walk() { - for (const { a, b, c, p } of walkTrieTrieCost(trie)) { - const pm = p ? ` + ${p}` : ""; - yield indent + `(${a}) -> (${b}) = ${c}${pm}`; + if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) { + return sameValueZeroEqual(a.valueOf(), b.valueOf()); } + return false; } - return ["Replace:", ...[...walk()].sort()].map((line) => pfx + line + "\n").join(""); + return comparator; } - exports.prettyPrintReplace = prettyPrintReplace; - function prettyPrintSwap(trie, pfx = "", indent = " ") { - function* walk() { - for (const { a, b, c, p } of walkTrieTrieCost(trie)) { - const pm = p ? ` + ${p}` : ""; - yield indent + `(${a}) <-> (${b}) = ${c}${pm}`; + function areArraysEqual(a, b, isEqual, meta) { + var index = a.length; + if (b.length !== index) { + return false; + } + while (index-- > 0) { + if (!isEqual(a[index], b[index], index, index, a, b, meta)) { + return false; } } - return ["Swap:", ...[...walk()].sort()].map((line) => pfx + line + "\n").join(""); + return true; } - exports.prettyPrintSwap = prettyPrintSwap; - function prettyPrintWeightMap(map) { - return [prettyPrintInsDel(map.insDel), prettyPrintReplace(map.replace), prettyPrintSwap(map.swap)].join("\n"); + var areArraysEqualCircular = createIsCircular(areArraysEqual); + function areDatesEqual(a, b) { + return sameValueZeroEqual(a.valueOf(), b.valueOf()); } - exports.prettyPrintWeightMap = prettyPrintWeightMap; - function lookupReplaceCost(map, a, b) { - const trie = map.replace; - let tt = trie; - for (let ai = 0; ai < a.length && tt; ++ai) { - tt = tt.n?.[a[ai]]; + function areMapsEqual(a, b, isEqual, meta) { + var isValueEqual = a.size === b.size; + if (!isValueEqual) { + return false; } - if (!tt) - return void 0; - let t = tt.t; - for (let bi = 0; bi < b.length && t; ++bi) { - t = t.n?.[b[bi]]; + if (!a.size) { + return true; } - return t?.c; - } - exports.lookupReplaceCost = lookupReplaceCost; - function normalizeDef(def) { - const { map, ...rest } = def; - return { ...rest, map: normalizeMap(map) }; - } - function normalizeMap(map) { - return map.replace(matchPossibleWordSeparators, constants_js_1.DEFAULT_COMPOUNDED_WORD_SEPARATOR); - } - exports.__testing__ = { - findTrieCostPrefixes, - findTrieTrieCostPrefixes, - normalizeDef, - splitMap, - splitMapSubstrings - }; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/distance.js -var require_distance = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/distance.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.updatedWeightedMap = exports.createWeightedMap = exports.editDistanceWeighted = exports.editDistance = void 0; - var distanceAStarWeighted_js_1 = require_distanceAStarWeighted(); - var levenshtein_js_1 = require_levenshtein(); - var weightedMaps_js_1 = require_weightedMaps(); - var defaultCost = 100; - function editDistance(wordA, wordB, editCost = defaultCost) { - return (0, levenshtein_js_1.levenshteinDistance)(wordA, wordB) * editCost; - } - exports.editDistance = editDistance; - function editDistanceWeighted(wordA, wordB, weights, editCost = defaultCost) { - return (0, distanceAStarWeighted_js_1.distanceAStarWeighted)(wordA, wordB, weights, editCost); + var matchedIndices = {}; + var indexA = 0; + a.forEach(function(aValue, aKey) { + if (!isValueEqual) { + return; + } + var hasMatch = false; + var matchIndexB = 0; + b.forEach(function(bValue, bKey) { + if (!hasMatch && !matchedIndices[matchIndexB] && (hasMatch = isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) && isEqual(aValue, bValue, aKey, bKey, a, b, meta))) { + matchedIndices[matchIndexB] = true; + } + matchIndexB++; + }); + indexA++; + isValueEqual = hasMatch; + }); + return isValueEqual; } - exports.editDistanceWeighted = editDistanceWeighted; - function createWeightedMap(defs) { - return (0, weightedMaps_js_1.createWeightMap)(...defs); - } - exports.createWeightedMap = createWeightedMap; - function updatedWeightedMap(weightedMap, def) { - (0, weightedMaps_js_1.addDefToWeightMap)(weightedMap, def); - } - exports.updatedWeightedMap = updatedWeightedMap; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/index.js -var require_distance2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.editDistanceWeighted = exports.editDistance = exports.createWeightedMap = void 0; - var distance_js_1 = require_distance(); - Object.defineProperty(exports, "createWeightedMap", { enumerable: true, get: function() { - return distance_js_1.createWeightedMap; - } }); - Object.defineProperty(exports, "editDistance", { enumerable: true, get: function() { - return distance_js_1.editDistance; - } }); - Object.defineProperty(exports, "editDistanceWeighted", { enumerable: true, get: function() { - return distance_js_1.editDistanceWeighted; - } }); - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/distribute.js -var require_distribute = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/distribute.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toDistributableIterable = exports.toDistributableIterableSync = void 0; - function toDistributableIterableSync(iterable) { - let lastValue; - let iter; - function getNext() { - if (lastValue && lastValue.done) { - return { ...lastValue }; - } - iter = iter || iterable[Symbol.iterator](); - lastValue = iter.next(); - return lastValue; - } - function* iterableFn() { - let next; - while (!(next = getNext()).done) { - yield next.value; - } - } - return { - [Symbol.iterator]: iterableFn - }; - } - exports.toDistributableIterableSync = toDistributableIterableSync; - exports.toDistributableIterable = toDistributableIterableSync; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/interleave.js -var require_interleave = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/interleave.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.interleave = void 0; - function* interleave2(a, b) { - const ai = a[Symbol.iterator](); - const bi = b[Symbol.iterator](); - for (let aNext = ai.next(); !aNext.done; aNext = ai.next()) { - yield aNext.value; - const bNext = bi.next(); - if (bNext.done) - break; - yield bNext.value; - } - for (let aNext = ai.next(); !aNext.done; aNext = ai.next()) { - yield aNext.value; + var areMapsEqualCircular = createIsCircular(areMapsEqual); + var OWNER = "_owner"; + var hasOwnProperty2 = Object.prototype.hasOwnProperty; + function areObjectsEqual(a, b, isEqual, meta) { + var keysA = Object.keys(a); + var index = keysA.length; + if (Object.keys(b).length !== index) { + return false; } - for (let bNext = bi.next(); !bNext.done; bNext = bi.next()) { - yield bNext.value; + var key; + while (index-- > 0) { + key = keysA[index]; + if (key === OWNER) { + var reactElementA = !!a.$$typeof; + var reactElementB = !!b.$$typeof; + if ((reactElementA || reactElementB) && reactElementA !== reactElementB) { + return false; + } + } + if (!hasOwnProperty2.call(b, key) || !isEqual(a[key], b[key], key, key, a, b, meta)) { + return false; + } } + return true; } - exports.interleave = interleave2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/iteratorToIterable.js -var require_iteratorToIterable = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/iteratorToIterable.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.asyncIteratorToAsyncIterable = exports.iteratorToIterable = void 0; - function* iteratorToIterable2(iterator) { - let n; - while (!(n = iterator.next()).done) { - yield n.value; - } + var areObjectsEqualCircular = createIsCircular(areObjectsEqual); + function areRegExpsEqual(a, b) { + return a.source === b.source && a.flags === b.flags; } - exports.iteratorToIterable = iteratorToIterable2; - async function* asyncIteratorToAsyncIterable2(iterator) { - let n; - while (!(n = await iterator.next()).done) { - yield n.value; + function areSetsEqual(a, b, isEqual, meta) { + var isValueEqual = a.size === b.size; + if (!isValueEqual) { + return false; } - } - exports.asyncIteratorToAsyncIterable = asyncIteratorToAsyncIterable2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/util.js -var require_util5 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isAsyncIterable = exports.toPipeFn = void 0; - function toPipeFn2(syncFn, asyncFn) { - function _(i) { - return isAsyncIterable3(i) ? asyncFn(i) : syncFn(i); + if (!a.size) { + return true; } - return _; + var matchedIndices = {}; + a.forEach(function(aValue, aKey) { + if (!isValueEqual) { + return; + } + var hasMatch = false; + var matchIndex = 0; + b.forEach(function(bValue, bKey) { + if (!hasMatch && !matchedIndices[matchIndex] && (hasMatch = isEqual(aValue, bValue, aKey, bKey, a, b, meta))) { + matchedIndices[matchIndex] = true; + } + matchIndex++; + }); + isValueEqual = hasMatch; + }); + return isValueEqual; } - exports.toPipeFn = toPipeFn2; - function isAsyncIterable3(i) { - return typeof i[Symbol.asyncIterator] === "function"; + var areSetsEqualCircular = createIsCircular(areSetsEqual); + var DEFAULT_CONFIG = Object.freeze({ + areArraysEqual, + areDatesEqual, + areMapsEqual, + areObjectsEqual, + areRegExpsEqual, + areSetsEqual, + createIsNestedEqual: createDefaultIsNestedEqual + }); + var DEFAULT_CIRCULAR_CONFIG = Object.freeze({ + areArraysEqual: areArraysEqualCircular, + areDatesEqual, + areMapsEqual: areMapsEqualCircular, + areObjectsEqual: areObjectsEqualCircular, + areRegExpsEqual, + areSetsEqual: areSetsEqualCircular, + createIsNestedEqual: createDefaultIsNestedEqual + }); + var isDeepEqual = createComparator(DEFAULT_CONFIG); + function deepEqual2(a, b) { + return isDeepEqual(a, b, void 0); } - exports.isAsyncIterable = isAsyncIterable3; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/toArray.js -var require_toArray = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/toArray.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toArrayAsync = exports.toArraySync = exports.toArray = void 0; - var util_js_1 = require_util5(); - function toArray3(i) { - return (0, util_js_1.isAsyncIterable)(i) ? toArrayAsync2(i) : toArraySync2(i); + var isShallowEqual = createComparator(merge4(DEFAULT_CONFIG, { createIsNestedEqual: function() { + return sameValueZeroEqual; + } })); + function shallowEqual(a, b) { + return isShallowEqual(a, b, void 0); } - exports.toArray = toArray3; - function toArraySync2(iter) { - return [...iter]; + var isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG); + function circularDeepEqual(a, b) { + return isCircularDeepEqual(a, b, /* @__PURE__ */ new WeakMap()); } - exports.toArraySync = toArraySync2; - async function toArrayAsync2(iter) { - const collection = []; - for await (const i of iter) { - collection.push(i); + var isCircularShallowEqual = createComparator(merge4(DEFAULT_CIRCULAR_CONFIG, { + createIsNestedEqual: function() { + return sameValueZeroEqual; } - return collection; + })); + function circularShallowEqual(a, b) { + return isCircularShallowEqual(a, b, /* @__PURE__ */ new WeakMap()); } - exports.toArrayAsync = toArrayAsync2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/toAsyncIterable.js -var require_toAsyncIterable = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/toAsyncIterable.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toAsyncIterable = exports.mergeAsyncIterables = void 0; - async function* mergeAsyncIterables2(iter, ...rest) { - for await (const i of [iter, ...rest]) { - yield* i; - } + function createCustomEqual(getComparatorOptions) { + return createComparator(merge4(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG))); + } + function createCustomCircularEqual(getComparatorOptions) { + var comparator = createComparator(merge4(DEFAULT_CIRCULAR_CONFIG, getComparatorOptions(DEFAULT_CIRCULAR_CONFIG))); + return function(a, b, meta) { + if (meta === void 0) { + meta = /* @__PURE__ */ new WeakMap(); + } + return comparator(a, b, meta); + }; } - exports.mergeAsyncIterables = mergeAsyncIterables2; - exports.toAsyncIterable = mergeAsyncIterables2; + exports.circularDeepEqual = circularDeepEqual; + exports.circularShallowEqual = circularShallowEqual; + exports.createCustomCircularEqual = createCustomCircularEqual; + exports.createCustomEqual = createCustomEqual; + exports.deepEqual = deepEqual2; + exports.sameValueZeroEqual = sameValueZeroEqual; + exports.shallowEqual = shallowEqual; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/index.js -var require_helpers = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/index.js"(exports) { +// node_modules/cspell/dist/lib/uri.cjs +var require_uri = __commonJS({ + "node_modules/cspell/dist/lib/uri.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.isAsyncIterable = exports.toAsyncIterable = exports.toArray = exports.iteratorToIterable = exports.asyncIteratorToAsyncIterable = exports.interleave = exports.toDistributableIterable = void 0; - var distribute_js_1 = require_distribute(); - Object.defineProperty(exports, "toDistributableIterable", { enumerable: true, get: function() { - return distribute_js_1.toDistributableIterable; - } }); - var interleave_js_1 = require_interleave(); - Object.defineProperty(exports, "interleave", { enumerable: true, get: function() { - return interleave_js_1.interleave; - } }); - var iteratorToIterable_js_1 = require_iteratorToIterable(); - Object.defineProperty(exports, "asyncIteratorToAsyncIterable", { enumerable: true, get: function() { - return iteratorToIterable_js_1.asyncIteratorToAsyncIterable; - } }); - Object.defineProperty(exports, "iteratorToIterable", { enumerable: true, get: function() { - return iteratorToIterable_js_1.iteratorToIterable; - } }); - var toArray_js_1 = require_toArray(); - Object.defineProperty(exports, "toArray", { enumerable: true, get: function() { - return toArray_js_1.toArray; - } }); - var toAsyncIterable_js_1 = require_toAsyncIterable(); - Object.defineProperty(exports, "toAsyncIterable", { enumerable: true, get: function() { - return toAsyncIterable_js_1.toAsyncIterable; + exports.Utils = exports.URI = void 0; + var vscode_uri_1 = require_umd(); + Object.defineProperty(exports, "URI", { enumerable: true, get: function() { + return vscode_uri_1.URI; } }); - var util_js_1 = require_util5(); - Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: function() { - return util_js_1.isAsyncIterable; + Object.defineProperty(exports, "Utils", { enumerable: true, get: function() { + return vscode_uri_1.Utils; } }); } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/append.js -var require_append = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/append.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opAppend = exports.opAppendSync = exports.opAppendAsync = void 0; - var index_js_1 = require_helpers(); - function opAppendAsync2(...iterablesToAppend) { - async function* fn(iter) { - yield* iter; - for (const i of iterablesToAppend) { - yield* i; - } - } - return fn; - } - exports.opAppendAsync = opAppendAsync2; - function opAppendSync2(...iterablesToAppend) { - function* fn(iter) { - yield* iter; - for (const i of iterablesToAppend) { - yield* i; - } - } - return fn; - } - exports.opAppendSync = opAppendSync2; - function opAppend2(...iterablesToAppend) { - function _(i) { - return (0, index_js_1.isAsyncIterable)(i) ? opAppendAsync2(...iterablesToAppend)(i) : opAppendSync2(...iterablesToAppend)(i); +// node_modules/yocto-queue/index.js +var require_yocto_queue = __commonJS({ + "node_modules/yocto-queue/index.js"(exports, module2) { + var Node2 = class { + /// value; + /// next; + constructor(value) { + this.value = value; + this.next = void 0; } - return _; - } - exports.opAppend = opAppend2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/await.js -var require_await = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/await.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opAwaitAsync = void 0; - async function* _asyncAwait2(iter) { - for await (const v of iter) { - yield v; + }; + var Queue2 = class { + // TODO: Use private class fields when targeting Node.js 12. + // #_head; + // #_tail; + // #_size; + constructor() { + this.clear(); } - } - function opAwaitAsync2() { - return _asyncAwait2; - } - exports.opAwaitAsync = opAwaitAsync2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/combine.js -var require_combine = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/combine.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opCombineSync = exports.opCombineAsync = void 0; - function opCombineAsync2(...fns) { - function combine(iter) { - for (const fn of fns) { - iter = fn(iter); + enqueue(value) { + const node = new Node2(value); + if (this._head) { + this._tail.next = node; + this._tail = node; + } else { + this._head = node; + this._tail = node; } - return iter; + this._size++; } - return combine; - } - exports.opCombineAsync = opCombineAsync2; - function opCombineSync2(...fns) { - function combine(iter) { - for (const fn of fns) { - iter = fn(iter); + dequeue() { + const current = this._head; + if (!current) { + return; } - return iter; + this._head = this._head.next; + this._size--; + return current.value; } - return combine; - } - exports.opCombineSync = opCombineSync2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/concatMap.js -var require_concatMap = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/concatMap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opConcatMap = exports.opConcatMapSync = exports.opConcatMapAsync = void 0; - var util_js_1 = require_util5(); - function opConcatMapAsync2(mapFn) { - async function* fn(iter) { - for await (const v of iter) { - yield* mapFn(v); - } + clear() { + this._head = void 0; + this._tail = void 0; + this._size = 0; } - return fn; - } - exports.opConcatMapAsync = opConcatMapAsync2; - function opConcatMapSync2(mapFn) { - function* fn(iter) { - for (const v of iter) { - yield* mapFn(v); + get size() { + return this._size; + } + *[Symbol.iterator]() { + let current = this._head; + while (current) { + yield current.value; + current = current.next; } } - return fn; - } - exports.opConcatMapSync = opConcatMapSync2; - var opConcatMap2 = (fn) => (0, util_js_1.toPipeFn)(opConcatMapSync2(fn), opConcatMapAsync2(fn)); - exports.opConcatMap = opConcatMap2; + }; + module2.exports = Queue2; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/filter.js -var require_filter = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/filter.js"(exports) { +// node_modules/p-limit/index.js +var require_p_limit = __commonJS({ + "node_modules/p-limit/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opFilter = exports.opFilterSync = exports.opFilterAsync = void 0; - var util_js_1 = require_util5(); - function opFilterAsync3(filterFn) { - async function* fn(iter) { - for await (const v of iter) { - const pass = await filterFn(v); - if (pass) - yield v; - } + var Queue2 = require_yocto_queue(); + var pLimit2 = (concurrency) => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + throw new TypeError("Expected `concurrency` to be a number from 1 and up"); } - return fn; - } - exports.opFilterAsync = opFilterAsync3; - function opFilterSync2(filterFn) { - function* fn(iter) { - for (const v of iter) { - if (filterFn(v)) - yield v; + const queue = new Queue2(); + let activeCount = 0; + const next = () => { + activeCount--; + if (queue.size > 0) { + queue.dequeue()(); } - } - return fn; - } - exports.opFilterSync = opFilterSync2; - function opFilter2(fn) { - const asyncFn = opFilterAsync3(fn); - const syncFn = opFilterSync2(fn); - function _(i) { - return (0, util_js_1.isAsyncIterable)(i) ? asyncFn(i) : syncFn(i); - } - return _; - } - exports.opFilter = opFilter2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/first.js -var require_first = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/first.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opFirst = exports.opFirstSync = exports.opFirstAsync = void 0; - var util_js_1 = require_util5(); - function opFirstAsync2(firstFn) { - async function* fn(iter) { - for await (const v of iter) { - const pass = await firstFn(v); - if (pass) { - yield v; - break; - } + }; + const run2 = async (fn, resolve13, ...args) => { + activeCount++; + const result = (async () => fn(...args))(); + resolve13(result); + try { + await result; + } catch { } - } - return fn; - } - exports.opFirstAsync = opFirstAsync2; - function opFirstSync2(firstFn) { - function* fn(iter) { - for (const v of iter) { - if (firstFn(v)) { - yield v; - break; + next(); + }; + const enqueue = (fn, resolve13, ...args) => { + queue.enqueue(run2.bind(null, fn, resolve13, ...args)); + (async () => { + await Promise.resolve(); + if (activeCount < concurrency && queue.size > 0) { + queue.dequeue()(); + } + })(); + }; + const generator = (fn, ...args) => new Promise((resolve13) => { + enqueue(fn, resolve13, ...args); + }); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.size + }, + clearQueue: { + value: () => { + queue.clear(); } } - } - return fn; - } - exports.opFirstSync = opFirstSync2; - function opFirst2(fn) { - const asyncFn = opFirstAsync2(fn); - const syncFn = opFirstSync2(fn); - function _(i) { - return (0, util_js_1.isAsyncIterable)(i) ? asyncFn(i) : syncFn(i); - } - return _; - } - exports.opFirst = opFirst2; + }); + return generator; + }; + module2.exports = pLimit2; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/flatten.js -var require_flatten = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/flatten.js"(exports) { +// node_modules/p-locate/index.js +var require_p_locate = __commonJS({ + "node_modules/p-locate/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opFlatten = exports.opFlattenSync = exports.opFlattenAsync = void 0; - var util_js_1 = require_util5(); - function opFlattenAsync2() { - async function* fn(iter) { - for await (const v of iter) { - yield* v; - } - } - return fn; - } - exports.opFlattenAsync = opFlattenAsync2; - function opFlattenSync2() { - function* fn(iter) { - for (const v of iter) { - yield* v; - } + var pLimit2 = require_p_limit(); + var EndError2 = class extends Error { + constructor(value) { + super(); + this.value = value; } - return fn; - } - exports.opFlattenSync = opFlattenSync2; - var opFlatten2 = () => (0, util_js_1.toPipeFn)(opFlattenSync2(), opFlattenAsync2()); - exports.opFlatten = opFlatten2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/joinStrings.js -var require_joinStrings = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/joinStrings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opJoinStrings = exports.opJoinStringsSync = exports.opJoinStringsAsync = void 0; - var toArray_js_1 = require_toArray(); - var util_js_1 = require_util5(); - function opJoinStringsAsync2(joinCharacter = ",") { - async function* fn(iter) { - for await (const v of iter) { - const a = await (0, toArray_js_1.toArray)(v); - yield a.join(joinCharacter); - } + }; + var testElement2 = async (element, tester) => tester(await element); + var finder2 = async (element) => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError2(values[0]); } - return fn; - } - exports.opJoinStringsAsync = opJoinStringsAsync2; - function opJoinStringsSync2(joinCharacter = ",") { - function* fn(iter) { - for (const v of iter) { - const a = (0, toArray_js_1.toArray)(v); - yield a.join(joinCharacter); + return false; + }; + var pLocate2 = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; + const limit = pLimit2(options.concurrency); + const items = [...iterable].map((element) => [element, limit(testElement2, element, tester)]); + const checkLimit = pLimit2(options.preserveOrder ? 1 : Infinity); + try { + await Promise.all(items.map((element) => checkLimit(finder2, element))); + } catch (error2) { + if (error2 instanceof EndError2) { + return error2.value; } + throw error2; } - return fn; - } - exports.opJoinStringsSync = opJoinStringsSync2; - var opJoinStrings2 = (joinCharacter) => (0, util_js_1.toPipeFn)(opJoinStringsSync2(joinCharacter), opJoinStringsAsync2(joinCharacter)); - exports.opJoinStrings = opJoinStrings2; + }; + module2.exports = pLocate2; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/last.js -var require_last = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/last.js"(exports) { +// node_modules/locate-path/index.js +var require_locate_path = __commonJS({ + "node_modules/locate-path/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opLast = exports.opLastSync = exports.opLastAsync = void 0; - var util_js_1 = require_util5(); - var symNotFound2 = Symbol("LastNotFound"); - function opLastAsync2(lastFn) { - async function* fn(iter) { - let last = symNotFound2; - for await (const v of iter) { - const pass = await lastFn(v); - if (pass) { - last = v; - } - } - if (last !== symNotFound2) - yield last; - } - return fn; - } - exports.opLastAsync = opLastAsync2; - function opLastSync2(lastFn) { - function* fn(iter) { - let last = symNotFound2; - for (const v of iter) { - if (lastFn(v)) { - last = v; - } - } - if (last !== symNotFound2) - yield last; - } - return fn; - } - exports.opLastSync = opLastSync2; - function opLast2(fn) { - const asyncFn = opLastAsync2(fn); - const syncFn = opLastSync2(fn); - function _(i) { - return (0, util_js_1.isAsyncIterable)(i) ? asyncFn(i) : syncFn(i); + var path26 = require("path"); + var fs9 = require("fs"); + var { promisify: promisify4 } = require("util"); + var pLocate2 = require_p_locate(); + var fsStat = promisify4(fs9.stat); + var fsLStat = promisify4(fs9.lstat); + var typeMappings2 = { + directory: "isDirectory", + file: "isFile" + }; + function checkType2({ type }) { + if (type in typeMappings2) { + return; } - return _; + throw new Error(`Invalid type specified: ${type}`); } - exports.opLast = opLast2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/map.js -var require_map2 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/map.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opMap = exports.opMapSync = exports.opMapAsync = void 0; - var util_js_1 = require_util5(); - function opMapAsync2(mapFn) { - async function* fn(iter) { - for await (const v of iter) { - yield mapFn(v); + var matchType2 = (type, stat2) => type === void 0 || stat2[typeMappings2[type]](); + module2.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: "file", + allowSymlinks: true, + ...options + }; + checkType2(options); + const statFn = options.allowSymlinks ? fsStat : fsLStat; + return pLocate2(paths, async (path_) => { + try { + const stat2 = await statFn(path26.resolve(options.cwd, path_)); + return matchType2(options.type, stat2); + } catch { + return false; } - } - return fn; - } - exports.opMapAsync = opMapAsync2; - function opMapSync2(mapFn) { - function* fn(iter) { - for (const v of iter) { - yield mapFn(v); + }, options); + }; + module2.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: "file", + ...options + }; + checkType2(options); + const statFn = options.allowSymlinks ? fs9.statSync : fs9.lstatSync; + for (const path_ of paths) { + try { + const stat2 = statFn(path26.resolve(options.cwd, path_)); + if (matchType2(options.type, stat2)) { + return path_; + } + } catch { } } - return fn; - } - exports.opMapSync = opMapSync2; - var opMap2 = (fn) => (0, util_js_1.toPipeFn)(opMapSync2(fn), opMapAsync2(fn)); - exports.opMap = opMap2; + }; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/reduce.js -var require_reduce = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/reduce.js"(exports) { +// node_modules/path-exists/index.js +var require_path_exists = __commonJS({ + "node_modules/path-exists/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opReduceSync = exports.opReduceAsync = void 0; - var index_js_1 = require_helpers(); - function opReduceAsync2(reduceFn, initialValue) { - async function* reduce2(head, tail) { - for await (const v of tail) { - head = reduceFn(head, v); - } - yield head; - } - async function* fn(iter) { - const ht = initialValue === void 0 ? await headTailAsync2(iter) : { head: await initialValue, tail: iter }; - if (!ht) - return; - yield* reduce2(ht.head, ht.tail); - } - return fn; - } - exports.opReduceAsync = opReduceAsync2; - function opReduceSync2(reduceFn, initialValue) { - function* reduce2(head, tail) { - for (const v of tail) { - head = reduceFn(head, v); - } - yield head; + var fs9 = require("fs"); + var { promisify: promisify4 } = require("util"); + var pAccess = promisify4(fs9.access); + module2.exports = async (path26) => { + try { + await pAccess(path26); + return true; + } catch (_) { + return false; } - function* fn(iter) { - const ht = initialValue === void 0 ? headTail2(iter) : { head: initialValue, tail: iter }; - if (!ht) - return; - yield* reduce2(ht.head, ht.tail); + }; + module2.exports.sync = (path26) => { + try { + fs9.accessSync(path26); + return true; + } catch (_) { + return false; } - return fn; - } - exports.opReduceSync = opReduceSync2; - function headTail2(iter) { - const iterator = iter[Symbol.iterator](); - const first = iterator.next(); - if (first.done) - return void 0; - return { head: first.value, tail: (0, index_js_1.iteratorToIterable)(iterator) }; - } - async function headTailAsync2(iter) { - const iterator = isIterable2(iter) ? iter[Symbol.iterator]() : iter[Symbol.asyncIterator](); - const first = await iterator.next(); - if (first.done) - return void 0; - return { head: first.value, tail: (0, index_js_1.asyncIteratorToAsyncIterable)(iterator) }; - } - function isIterable2(i) { - return typeof i[Symbol.iterator] === "function"; - } + }; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/skip.js -var require_skip = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/skip.js"(exports) { +// node_modules/find-up/index.js +var require_find_up = __commonJS({ + "node_modules/find-up/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opSkip = exports.opSkipSync = exports.opSkipAsync = void 0; - var util_js_1 = require_util5(); - function opSkipAsync2(count) { - async function* fn(iter) { - for await (const v of iter) { - if (count > 0) { - --count; - continue; - } - yield v; + var path26 = require("path"); + var locatePath2 = require_locate_path(); + var pathExists2 = require_path_exists(); + var stop = Symbol("findUp.stop"); + module2.exports = async (name, options = {}) => { + let directory = path26.resolve(options.cwd || ""); + const { root } = path26.parse(directory); + const paths = [].concat(name); + const runMatcher = async (locateOptions) => { + if (typeof name !== "function") { + return locatePath2(paths, locateOptions); } - } - return fn; - } - exports.opSkipAsync = opSkipAsync2; - function opSkipSync2(count) { - function* fn(iter) { - for (const v of iter) { - if (count > 0) { - --count; - continue; - } - yield v; + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === "string") { + return locatePath2([foundPath], locateOptions); } - } - return fn; - } - exports.opSkipSync = opSkipSync2; - var opSkip2 = (count) => (0, util_js_1.toPipeFn)(opSkipSync2(count), opSkipAsync2(count)); - exports.opSkip = opSkip2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/take.js -var require_take = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/take.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opTake = exports.opTakeSync = exports.opTakeAsync = void 0; - var util_js_1 = require_util5(); - function opTakeAsync2(count) { - async function* fn(iter) { - if (count <= 0) + return foundPath; + }; + while (true) { + const foundPath = await runMatcher({ ...options, cwd: directory }); + if (foundPath === stop) { return; - for await (const v of iter) { - yield v; - if (--count <= 0) - return; } - } - return fn; - } - exports.opTakeAsync = opTakeAsync2; - function opTakeSync2(count) { - function* fn(iter) { - if (count <= 0) - return; - for (const v of iter) { - yield v; - if (--count <= 0) - return; + if (foundPath) { + return path26.resolve(directory, foundPath); } - } - return fn; - } - exports.opTakeSync = opTakeSync2; - var opTake2 = (count) => (0, util_js_1.toPipeFn)(opTakeSync2(count), opTakeAsync2(count)); - exports.opTake = opTake2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/tap.js -var require_tap = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/tap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opTap = exports.opTapSync = exports.opTapAsync = void 0; - var util_js_1 = require_util5(); - function opTapAsync2(tapFn) { - async function* fn(iter) { - for await (const v of iter) { - tapFn(v); - yield v; + if (directory === root) { + return; } + directory = path26.dirname(directory); } - return fn; - } - exports.opTapAsync = opTapAsync2; - function opTapSync2(tapFn) { - function* fn(iter) { - for (const v of iter) { - tapFn(v); - yield v; + }; + module2.exports.sync = (name, options = {}) => { + let directory = path26.resolve(options.cwd || ""); + const { root } = path26.parse(directory); + const paths = [].concat(name); + const runMatcher = (locateOptions) => { + if (typeof name !== "function") { + return locatePath2.sync(paths, locateOptions); } - } - return fn; - } - exports.opTapSync = opTapSync2; - var opTap2 = (fn) => (0, util_js_1.toPipeFn)(opTapSync2(fn), opTapAsync2(fn)); - exports.opTap = opTap2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/unique.js -var require_unique = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/unique.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opUnique = exports.opUniqueSync = exports.opUniqueAsync = void 0; - var util_js_1 = require_util5(); - function opUniqueAsync2(k) { - function fnK(k2) { - async function* fn2(iter) { - const s = /* @__PURE__ */ new Set(); - for await (const v of iter) { - const kk = k2(v); - if (s.has(kk)) - continue; - s.add(kk); - yield v; - } + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === "string") { + return locatePath2.sync([foundPath], locateOptions); } - return fn2; - } - async function* fn(iter) { - const s = /* @__PURE__ */ new Set(); - for await (const v of iter) { - if (s.has(v)) - continue; - s.add(v); - yield v; + return foundPath; + }; + while (true) { + const foundPath = runMatcher({ ...options, cwd: directory }); + if (foundPath === stop) { + return; } - } - return k ? fnK(k) : fn; - } - exports.opUniqueAsync = opUniqueAsync2; - function opUniqueSync2(k) { - function fnK(key) { - function* fn2(iter) { - const s = /* @__PURE__ */ new Set(); - for (const v of iter) { - const kk = key(v); - if (s.has(kk)) - continue; - s.add(kk); - yield v; - } + if (foundPath) { + return path26.resolve(directory, foundPath); } - return fn2; - } - function* fn(iter) { - const s = /* @__PURE__ */ new Set(); - for (const v of iter) { - if (s.has(v)) - continue; - s.add(v); - yield v; + if (directory === root) { + return; } + directory = path26.dirname(directory); } - return k ? fnK(k) : fn; - } - exports.opUniqueSync = opUniqueSync2; - var opUnique2 = (getKey) => (0, util_js_1.toPipeFn)(opUniqueSync2(getKey), opUniqueAsync2(getKey)); - exports.opUnique = opUnique2; + }; + module2.exports.exists = pathExists2; + module2.exports.sync.exists = pathExists2.sync; + module2.exports.stop = stop; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/index.js -var require_operators3 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opUniqueSync = exports.opUniqueAsync = exports.opUnique = exports.opTapSync = exports.opTapAsync = exports.opTap = exports.opTakeSync = exports.opTakeAsync = exports.opTake = exports.opSkipSync = exports.opSkipAsync = exports.opSkip = exports.opReduceSync = exports.opReduceAsync = exports.opMapSync = exports.opMapAsync = exports.opMap = exports.opLastSync = exports.opLastAsync = exports.opLast = exports.opJoinStringsSync = exports.opJoinStringsAsync = exports.opJoinStrings = exports.opFlattenSync = exports.opFlattenAsync = exports.opFlatten = exports.opFirstSync = exports.opFirstAsync = exports.opFirst = exports.opFilterSync = exports.opFilterAsync = exports.opFilter = exports.opConcatMapSync = exports.opConcatMapAsync = exports.opConcatMap = exports.opCombineSync = exports.opCombineAsync = exports.opAwaitAsync = exports.opAppendSync = exports.opAppendAsync = exports.opAppend = void 0; - var append_js_1 = require_append(); - Object.defineProperty(exports, "opAppend", { enumerable: true, get: function() { - return append_js_1.opAppend; - } }); - Object.defineProperty(exports, "opAppendAsync", { enumerable: true, get: function() { - return append_js_1.opAppendAsync; - } }); - Object.defineProperty(exports, "opAppendSync", { enumerable: true, get: function() { - return append_js_1.opAppendSync; - } }); - var await_js_1 = require_await(); - Object.defineProperty(exports, "opAwaitAsync", { enumerable: true, get: function() { - return await_js_1.opAwaitAsync; - } }); - var combine_js_1 = require_combine(); - Object.defineProperty(exports, "opCombineAsync", { enumerable: true, get: function() { - return combine_js_1.opCombineAsync; - } }); - Object.defineProperty(exports, "opCombineSync", { enumerable: true, get: function() { - return combine_js_1.opCombineSync; - } }); - var concatMap_js_1 = require_concatMap(); - Object.defineProperty(exports, "opConcatMap", { enumerable: true, get: function() { - return concatMap_js_1.opConcatMap; - } }); - Object.defineProperty(exports, "opConcatMapAsync", { enumerable: true, get: function() { - return concatMap_js_1.opConcatMapAsync; - } }); - Object.defineProperty(exports, "opConcatMapSync", { enumerable: true, get: function() { - return concatMap_js_1.opConcatMapSync; - } }); - var filter_js_1 = require_filter(); - Object.defineProperty(exports, "opFilter", { enumerable: true, get: function() { - return filter_js_1.opFilter; - } }); - Object.defineProperty(exports, "opFilterAsync", { enumerable: true, get: function() { - return filter_js_1.opFilterAsync; - } }); - Object.defineProperty(exports, "opFilterSync", { enumerable: true, get: function() { - return filter_js_1.opFilterSync; - } }); - var first_js_1 = require_first(); - Object.defineProperty(exports, "opFirst", { enumerable: true, get: function() { - return first_js_1.opFirst; - } }); - Object.defineProperty(exports, "opFirstAsync", { enumerable: true, get: function() { - return first_js_1.opFirstAsync; - } }); - Object.defineProperty(exports, "opFirstSync", { enumerable: true, get: function() { - return first_js_1.opFirstSync; - } }); - var flatten_js_1 = require_flatten(); - Object.defineProperty(exports, "opFlatten", { enumerable: true, get: function() { - return flatten_js_1.opFlatten; - } }); - Object.defineProperty(exports, "opFlattenAsync", { enumerable: true, get: function() { - return flatten_js_1.opFlattenAsync; - } }); - Object.defineProperty(exports, "opFlattenSync", { enumerable: true, get: function() { - return flatten_js_1.opFlattenSync; - } }); - var joinStrings_js_1 = require_joinStrings(); - Object.defineProperty(exports, "opJoinStrings", { enumerable: true, get: function() { - return joinStrings_js_1.opJoinStrings; - } }); - Object.defineProperty(exports, "opJoinStringsAsync", { enumerable: true, get: function() { - return joinStrings_js_1.opJoinStringsAsync; - } }); - Object.defineProperty(exports, "opJoinStringsSync", { enumerable: true, get: function() { - return joinStrings_js_1.opJoinStringsSync; - } }); - var last_js_1 = require_last(); - Object.defineProperty(exports, "opLast", { enumerable: true, get: function() { - return last_js_1.opLast; - } }); - Object.defineProperty(exports, "opLastAsync", { enumerable: true, get: function() { - return last_js_1.opLastAsync; - } }); - Object.defineProperty(exports, "opLastSync", { enumerable: true, get: function() { - return last_js_1.opLastSync; - } }); - var map_js_1 = require_map2(); - Object.defineProperty(exports, "opMap", { enumerable: true, get: function() { - return map_js_1.opMap; - } }); - Object.defineProperty(exports, "opMapAsync", { enumerable: true, get: function() { - return map_js_1.opMapAsync; - } }); - Object.defineProperty(exports, "opMapSync", { enumerable: true, get: function() { - return map_js_1.opMapSync; - } }); - var reduce_js_1 = require_reduce(); - Object.defineProperty(exports, "opReduceAsync", { enumerable: true, get: function() { - return reduce_js_1.opReduceAsync; - } }); - Object.defineProperty(exports, "opReduceSync", { enumerable: true, get: function() { - return reduce_js_1.opReduceSync; - } }); - var skip_js_1 = require_skip(); - Object.defineProperty(exports, "opSkip", { enumerable: true, get: function() { - return skip_js_1.opSkip; - } }); - Object.defineProperty(exports, "opSkipAsync", { enumerable: true, get: function() { - return skip_js_1.opSkipAsync; - } }); - Object.defineProperty(exports, "opSkipSync", { enumerable: true, get: function() { - return skip_js_1.opSkipSync; - } }); - var take_js_1 = require_take(); - Object.defineProperty(exports, "opTake", { enumerable: true, get: function() { - return take_js_1.opTake; - } }); - Object.defineProperty(exports, "opTakeAsync", { enumerable: true, get: function() { - return take_js_1.opTakeAsync; - } }); - Object.defineProperty(exports, "opTakeSync", { enumerable: true, get: function() { - return take_js_1.opTakeSync; - } }); - var tap_js_1 = require_tap(); - Object.defineProperty(exports, "opTap", { enumerable: true, get: function() { - return tap_js_1.opTap; - } }); - Object.defineProperty(exports, "opTapAsync", { enumerable: true, get: function() { - return tap_js_1.opTapAsync; - } }); - Object.defineProperty(exports, "opTapSync", { enumerable: true, get: function() { - return tap_js_1.opTapSync; - } }); - var unique_js_1 = require_unique(); - Object.defineProperty(exports, "opUnique", { enumerable: true, get: function() { - return unique_js_1.opUnique; - } }); - Object.defineProperty(exports, "opUniqueAsync", { enumerable: true, get: function() { - return unique_js_1.opUniqueAsync; - } }); - Object.defineProperty(exports, "opUniqueSync", { enumerable: true, get: function() { - return unique_js_1.opUniqueSync; - } }); +// node_modules/cspell/package.json +var require_package = __commonJS({ + "node_modules/cspell/package.json"(exports, module2) { + module2.exports = { + name: "cspell", + version: "7.0.0", + description: "A Spelling Checker for Code!", + funding: "https://github.com/streetsidesoftware/cspell?sponsor=1", + bin: { + cspell: "bin.mjs", + "cspell-esm": "bin.mjs" + }, + type: "module", + types: "dist/esm/index.d.mts", + module: "dist/esm/index.mjs", + exports: { + ".": { + import: "./dist/esm/index.mjs" + }, + "./app": { + import: "./dist/esm/app.mjs" + }, + "./bin": { + import: "./bin.mjs" + }, + "./bin.mjs": { + import: "./bin.mjs" + }, + "./application": { + import: "./dist/esm/application.mjs" + } + }, + files: [ + "bin.mjs", + "dist", + "!dist/esm/**/*.js", + "!dist/esm/**/*.ts", + "!**/*.tsbuildInfo", + "!**/__mocks__", + "!**/test/**", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.map" + ], + scripts: { + clean: 'shx rm -rf dist temp coverage "*.tsbuildInfo"', + build: "tsc -b . && ts2mjs dist/esm && pnpm run build:api", + "build:api": "rollup -c rollup.config.mjs", + "build:esm": "tsc -b tsconfig.esm.json", + "build:esm:ts2mjs": "tsc -b tsconfig.esm.json && ts2mjs dist/esm", + "build:lib": "tsc -b src/lib/tsconfig.json", + "build:readme": "pnpm build:readme:help", + "build:readme:help": "pnpm build:readme:help:lint && pnpm build:readme:help:trace && inject-markdown README.md && prettier -w README.md", + "build:readme:help:lint": "./bin.mjs lint --help > static/help-lint.txt", + "build:readme:help:trace": "./bin.mjs trace --help > static/help-trace.txt", + "clean-build": "pnpm run clean && pnpm run build", + coverage: "pnpm coverage:vitest && pnpm coverage:fix", + "coverage:vitest": "vitest run --coverage", + "coverage:fix": 'nyc report --temp-dir "$(pwd)/coverage" --reporter lcov --report-dir "$(pwd)/coverage" --cwd ../..', + "test:watch": "vitest", + test: "vitest run", + watch: "tsc -b . -w", + compile: "tsc -p .", + "test-watch": "vitest", + prepublishOnly: "pnpm run clean-build", + "test:update-snapshot": "vitest run --update" + }, + repository: { + type: "git", + url: "git+https://github.com/streetsidesoftware/cspell.git" + }, + keywords: [ + "spell", + "checker", + "code", + "camel", + "case", + "spelling", + "spell checker", + "spelling checker", + "lint" + ], + author: "Jason Dent", + license: "MIT", + bugs: { + url: "https://github.com/streetsidesoftware/cspell/issues" + }, + homepage: "https://streetsidesoftware.github.io/cspell/", + dependencies: { + "@cspell/cspell-json-reporter": "7.0.0", + "@cspell/cspell-pipe": "7.0.0", + "@cspell/cspell-types": "7.0.0", + "@cspell/dynamic-import": "7.0.0", + chalk: "^5.3.0", + "chalk-template": "^1.1.0", + commander: "^10.0.1", + "cspell-gitignore": "7.0.0", + "cspell-glob": "7.0.0", + "cspell-io": "7.0.0", + "cspell-lib": "7.0.0", + "fast-glob": "^3.3.1", + "fast-json-stable-stringify": "^2.1.0", + "file-entry-cache": "^6.0.1", + "get-stdin": "^9.0.0", + semver: "^7.5.4", + "strip-ansi": "^7.1.0", + "vscode-uri": "^3.0.7" + }, + engines: { + node: ">=16" + }, + devDependencies: { + "@types/file-entry-cache": "^5.0.2", + "@types/glob": "^8.1.0", + "@types/micromatch": "^4.0.2", + "@types/semver": "^7.5.0", + micromatch: "^4.0.5", + minimatch: "^9.0.3" + }, + gitHead: "52960d5ed75655978f9b633f44fd106937a63cd7" + }; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/pipe.js -var require_pipe = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/pipe.js"(exports) { +// node_modules/cspell/dist/lib/pkgInfo.cjs +var require_pkgInfo = __commonJS({ + "node_modules/cspell/dist/lib/pkgInfo.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.pipeSync = exports.pipeAsync = void 0; - var index_js_1 = require_helpers(); - var index_js_2 = require_operators3(); - function pipeAsync2(i, ...fns) { - const iter = (0, index_js_1.toAsyncIterable)(i); - return (0, index_js_2.opCombineAsync)(...fns)(iter); - } - exports.pipeAsync = pipeAsync2; - function pipeSync2(i, ...fns) { - return (0, index_js_2.opCombineSync)(...fns)(i); - } - exports.pipeSync = pipeSync2; + exports.npmPackage = exports.pkgDir = void 0; + var path_1 = require("path"); + exports.pkgDir = (0, path_1.join)(__dirname, "../.."); + exports.npmPackage = require_package(); } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/reduce.js -var require_reduce2 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/reduce.js"(exports) { +// node_modules/fast-glob/out/utils/array.js +var require_array2 = __commonJS({ + "node_modules/fast-glob/out/utils/array.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.reduce = exports.reduceAsync = exports.reduceSync = void 0; - var index_js_1 = require_helpers(); - var toArray_js_1 = require_toArray(); - var index_js_2 = require_operators3(); - var pipe_js_1 = require_pipe(); - function reduceSync2(iter, reduceFn, initialValue) { - const i = initialValue === void 0 ? (0, pipe_js_1.pipeSync)(iter, (0, index_js_2.opReduceSync)(reduceFn)) : (0, pipe_js_1.pipeSync)(iter, (0, index_js_2.opReduceSync)(reduceFn, initialValue)); - return [...i][0]; - } - exports.reduceSync = reduceSync2; - async function reduceAsync2(iter, reduceFn, initialValue) { - const i = initialValue === void 0 ? (0, pipe_js_1.pipeAsync)(iter, (0, index_js_2.opReduceAsync)(reduceFn)) : (0, pipe_js_1.pipeAsync)(iter, (0, index_js_2.opReduceAsync)(reduceFn, initialValue)); - const arr = await (0, toArray_js_1.toArrayAsync)(i); - return arr[0]; - } - exports.reduceAsync = reduceAsync2; - function reduce2(iter, reduceFn, initialValue) { - return (0, index_js_1.isAsyncIterable)(iter) ? reduceAsync2(iter, reduceFn, initialValue) : reduceSync2(iter, reduceFn, initialValue); + exports.splitWhen = exports.flatten = void 0; + function flatten(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); } - exports.reduce = reduce2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/index.js -var require_cjs4 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); + exports.flatten = flatten; + function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } else { + result[groupIndex].push(item); + } } - __setModuleDefault(result, mod); return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.helpers = exports.operators = exports.reduceSync = exports.reduceAsync = exports.reduce = exports.pipeSync = exports.pipeAsync = exports.opUnique = exports.opTap = exports.opTake = exports.opSkip = exports.opMap = exports.opLast = exports.opJoinStrings = exports.opFlatten = exports.opFirst = exports.opFilter = exports.opConcatMap = exports.opAwaitAsync = exports.opAppend = exports.toDistributableIterable = exports.toAsyncIterable = exports.toArray = exports.isAsyncIterable = exports.interleave = void 0; - var _helpers = __importStar(require_helpers()); - var _operators = __importStar(require_operators3()); - var index_js_1 = require_helpers(); - Object.defineProperty(exports, "interleave", { enumerable: true, get: function() { - return index_js_1.interleave; - } }); - Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: function() { - return index_js_1.isAsyncIterable; - } }); - Object.defineProperty(exports, "toArray", { enumerable: true, get: function() { - return index_js_1.toArray; - } }); - Object.defineProperty(exports, "toAsyncIterable", { enumerable: true, get: function() { - return index_js_1.toAsyncIterable; - } }); - Object.defineProperty(exports, "toDistributableIterable", { enumerable: true, get: function() { - return index_js_1.toDistributableIterable; - } }); - var index_js_2 = require_operators3(); - Object.defineProperty(exports, "opAppend", { enumerable: true, get: function() { - return index_js_2.opAppend; - } }); - Object.defineProperty(exports, "opAwaitAsync", { enumerable: true, get: function() { - return index_js_2.opAwaitAsync; - } }); - Object.defineProperty(exports, "opConcatMap", { enumerable: true, get: function() { - return index_js_2.opConcatMap; - } }); - Object.defineProperty(exports, "opFilter", { enumerable: true, get: function() { - return index_js_2.opFilter; - } }); - Object.defineProperty(exports, "opFirst", { enumerable: true, get: function() { - return index_js_2.opFirst; - } }); - Object.defineProperty(exports, "opFlatten", { enumerable: true, get: function() { - return index_js_2.opFlatten; - } }); - Object.defineProperty(exports, "opJoinStrings", { enumerable: true, get: function() { - return index_js_2.opJoinStrings; - } }); - Object.defineProperty(exports, "opLast", { enumerable: true, get: function() { - return index_js_2.opLast; - } }); - Object.defineProperty(exports, "opMap", { enumerable: true, get: function() { - return index_js_2.opMap; - } }); - Object.defineProperty(exports, "opSkip", { enumerable: true, get: function() { - return index_js_2.opSkip; - } }); - Object.defineProperty(exports, "opTake", { enumerable: true, get: function() { - return index_js_2.opTake; - } }); - Object.defineProperty(exports, "opTap", { enumerable: true, get: function() { - return index_js_2.opTap; - } }); - Object.defineProperty(exports, "opUnique", { enumerable: true, get: function() { - return index_js_2.opUnique; - } }); - var pipe_js_1 = require_pipe(); - Object.defineProperty(exports, "pipeAsync", { enumerable: true, get: function() { - return pipe_js_1.pipeAsync; - } }); - Object.defineProperty(exports, "pipeSync", { enumerable: true, get: function() { - return pipe_js_1.pipeSync; - } }); - var reduce_js_1 = require_reduce2(); - Object.defineProperty(exports, "reduce", { enumerable: true, get: function() { - return reduce_js_1.reduce; - } }); - Object.defineProperty(exports, "reduceAsync", { enumerable: true, get: function() { - return reduce_js_1.reduceAsync; - } }); - Object.defineProperty(exports, "reduceSync", { enumerable: true, get: function() { - return reduce_js_1.reduceSync; - } }); - exports.operators = _operators; - exports.helpers = _helpers; + } + exports.splitWhen = splitWhen; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/convertToTrieRefNodes.js -var require_convertToTrieRefNodes = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/convertToTrieRefNodes.js"(exports) { +// node_modules/fast-glob/out/utils/errno.js +var require_errno = __commonJS({ + "node_modules/fast-glob/out/utils/errno.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.convertToTrieRefNodes = void 0; - var gensequence_1 = require_dist2(); - var TrieNode_js_1 = require_TrieNode(); - var MinReferenceCount = 3; - function convertToTrieRefNodes(root) { - const eow = { f: TrieNode_js_1.FLAG_WORD, c: void 0 }; - const tallies = /* @__PURE__ */ new Map([[eow, 0]]); - let count = 0; - const cached = /* @__PURE__ */ new Map(); - const rollupTally = /* @__PURE__ */ new Map(); - function tally(n) { - if (n.f && !n.c) { - tallies.set(eow, (tallies.get(eow) || 0) + 1); - return; - } - const t = tallies.get(n); - if (t) { - tallies.set(n, t + 1); - return; - } - tallies.set(n, 1); - for (const c of n.c?.values() || []) { - tally(c); - } - } - function rollup(n) { - const c = rollupTally.get(n); - if (c) { - return c; - } - if (!n.c) { - const sum2 = tallies.get(eow) || 0; - rollupTally.set(n, sum2); - return sum2; - } - const sum = [...n.c.values()].reduce((acc, v) => acc + rollup(v), tallies.get(n) || 0); - rollupTally.set(n, sum); - return sum; - } - function* walkByTallies(tallies2) { - const nodes = [...(0, gensequence_1.genSequence)(tallies2).filter((a) => a[1] >= MinReferenceCount)].sort((a, b) => b[1] - a[1]); - for (const [n] of nodes) { - yield* walkByRollup(n); - } - } - function* walkByRollup(n) { - if (cached.has(n)) - return; - if (n.f && !n.c) { - cached.set(n, cached.get(eow)); - return; - } - const children = [...n.c?.values() || []].sort((a, b) => (rollupTally.get(b) || 0) - (rollupTally.get(a) || 0)); - for (const c of children) { - yield* walkByRollup(c); - } - cached.set(n, count++); - yield convert(n); - } - function convert(n) { - const { f, c } = n; - const r = c ? [...c].sort((a, b) => a[0] < b[0] ? -1 : 1).map(([s, n2]) => [s, cached.get(n2)]) : void 0; - const rn = r ? f ? { f, r } : { r } : { f }; - return rn; - } - function* walk(root2) { - cached.set(eow, count++); - yield convert(eow); - yield* walkByTallies(tallies); - yield* walkByRollup(root2); - } - tally(root); - rollup(root); - return walk(root); + exports.isEnoentCodeError = void 0; + function isEnoentCodeError(error2) { + return error2.code === "ENOENT"; } - exports.convertToTrieRefNodes = convertToTrieRefNodes; + exports.isEnoentCodeError = isEnoentCodeError; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV1.js -var require_importExportV1 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV1.js"(exports) { +// node_modules/fast-glob/out/utils/fs.js +var require_fs = __commonJS({ + "node_modules/fast-glob/out/utils/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.importTrie = exports.serializeTrie = exports.DATA = void 0; - var gensequence_1 = require_dist2(); - var convertToTrieRefNodes_js_1 = require_convertToTrieRefNodes(); - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - var EOW = "*"; - exports.DATA = EOW; - function toReferences(node) { - return (0, gensequence_1.genSequence)((0, convertToTrieRefNodes_js_1.convertToTrieRefNodes)(node)); - } - var regExpEscapeChars = /([[\]\\,:{}*])/g; - var regExTrailingComma = /,(\}|\n)/g; - function escapeChar(char) { - return char.replace(regExpEscapeChars, "\\$1"); - } - function trieToExportString(node, base) { - function* walk(node2) { - if (node2.f) { - yield EOW; - } - if (node2.r) { - const refs = [...node2.r].sort((a, b) => a[0] < b[0] ? -1 : 1); - for (const n of refs) { - const [c, r] = n; - const ref = r ? r.toString(base) : ""; - yield escapeChar(c) + ref + ","; - } - } - } - return (0, gensequence_1.genSequence)(walk(node)); - } - function generateHeader(base, comment) { - const header = ["#!/usr/bin/env cspell-trie reader", "TrieXv1", "base=" + base].concat(comment ? comment.split("\n").map((a) => "# " + a) : []).concat(["# Data:"]); - return (0, gensequence_1.genSequence)(header).map((a) => a + "\n"); - } - function serializeTrie(root, options = 16) { - options = typeof options === "number" ? { base: options } : options; - const { base = 16, comment = "" } = options; - const radix = base > 36 ? 36 : base < 10 ? 10 : base; - const rows = toReferences(root).map((node) => { - const row = [...trieToExportString(node, radix), "\n"].join("").replace(regExTrailingComma, "$1"); - return row; - }); - return generateHeader(radix, comment).concat(rows); - } - exports.serializeTrie = serializeTrie; - function* toIterableIterator(iter) { - yield* iter; - } - function importTrie(linesX) { - let radix = 16; - const comment = /^\s*#/; - const iter = toIterableIterator(linesX); - function parseHeaderRows(headerRows) { - const header = headerRows.slice(0, 2).join("\n"); - const headerReg = /^TrieXv1\nbase=(\d+)$/; - if (!headerReg.test(header)) - throw new Error("Unknown file format"); - radix = Number.parseInt(header.replace(headerReg, "$1"), 10); - } - function readHeader(iter2) { - const headerRows = []; - while (true) { - const next = iter2.next(); - if (next.done) { - break; - } - const line = next.value.trim(); - if (!line || comment.test(line)) { - continue; - } - if (line === exports.DATA) { - break; - } - headerRows.push(line); - } - parseHeaderRows(headerRows); - } - const regNotEscapedCommas = /(^|[^\\]),/g; - const regUnescapeCommas = /__COMMA__/g; - const regUnescape = /[\\](.)/g; - const flagsWord = { f: TrieNode_js_1.FLAG_WORD }; - function splitLine(line) { - const pattern = "$1__COMMA__"; - return line.replace(regNotEscapedCommas, pattern).split(regUnescapeCommas).map((a) => a.replace(regUnescape, "$1")); - } - function decodeLine(line, nodes) { - const isWord = line[0] === EOW; - line = isWord ? line.slice(1) : line; - const flags = isWord ? flagsWord : {}; - const children = splitLine(line).filter((a) => !!a).map((a) => [a[0], Number.parseInt(a.slice(1) || "0", radix)]).map(([k, i]) => [k, nodes[i]]); - const cNode = children.length ? { c: new TrieNode_js_1.ChildMap(children) } : {}; - return { ...cNode, ...flags }; + exports.createDirentFromStats = void 0; + var DirentFromStats = class { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); } - readHeader(iter); - const n = (0, gensequence_1.genSequence)([exports.DATA]).concat(iter).map((a) => a.replace(/\r?\n/, "")).filter((a) => !!a).reduce((acc, line) => { - const { lines, nodes } = acc; - const root = decodeLine(line, nodes); - nodes[lines] = root; - return { lines: lines + 1, root, nodes }; - }, { lines: 0, nodes: [], root: {} }); - return (0, trie_util_js_1.trieNodeToRoot)(n.root, {}); + }; + function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); } - exports.importTrie = importTrie; + exports.createDirentFromStats = createDirentFromStats; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV2.js -var require_importExportV2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV2.js"(exports) { +// node_modules/fast-glob/out/utils/path.js +var require_path = __commonJS({ + "node_modules/fast-glob/out/utils/path.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.importTrie = exports.serializeTrie = exports.DATA = void 0; - var gensequence_1 = require_dist2(); - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - var EOW = "*"; - exports.DATA = "__DATA__"; - function leaves(node) { - function toRefNode(node2, k) { - const refNode = node2; - refNode.s = refNode.s ?? k; - return refNode; - } - function* walk(node2, k, p) { - const ref = toRefNode(node2, k); - if (!ref.c) { - yield { n: ref, p }; - } else { - for (const n of ref.c) { - yield* walk(n[1], n[0], ref); - } - } - } - return (0, gensequence_1.genSequence)(walk(node, "")); + exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; + var os5 = require("os"); + var path26 = require("path"); + var IS_WINDOWS_PLATFORM = os5.platform() === "win32"; + var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; + var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; + var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g; + var DOS_DEVICE_PATH_RE = /^\\\\([.?])/; + var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@{}])/g; + function unixify(filepath) { + return filepath.replace(/\\/g, "/"); } - function flattenToReferences(node) { - function* walk() { - let iterations = 100; - let processed = 0; - let index = 0; - do { - processed = 0; - const signatureMap = /* @__PURE__ */ new Map(); - for (const leaf of leaves(node)) { - const h = signature(leaf.n); - let m = signatureMap.get(h); - if (m === void 0) { - yield leaf.n; - m = index; - signatureMap.set(h, m); - index += 1; - } - if (leaf.p && leaf.p.c) { - leaf.p.r = leaf.p.r || []; - leaf.p.r.push(m); - leaf.p.c.delete(leaf.n.s); - if (!leaf.p.c.size) { - delete leaf.p.c; - } - } - processed += 1; - } - iterations -= 1; - } while (processed && iterations && node.c); - yield node; - } - return (0, gensequence_1.genSequence)(walk()); - } - function signature(node) { - const flags = node.f ? EOW : ""; - const refs = node.r ? node.r.sort((a, b) => a - b).join(",") : ""; - return node.s + flags + refs; - } - function toLine(node, base) { - const flags = node.f ? EOW : ""; - const refs = node.r ? node.r.sort((a, b) => a - b).map((r) => r.toString(base)).join(",") : ""; - return node.s + flags + refs; - } - function generateHeader(base, comment) { - const header = ["#!/usr/bin/env cspell-trie reader", "TrieXv2", "base=" + base].concat(comment ? comment.split("\n").map((a) => "# " + a) : []).concat(["# Data:", exports.DATA]); - return (0, gensequence_1.genSequence)(header); - } - function serializeTrie(root, options = 16) { - options = typeof options === "number" ? { base: options } : options; - const { base = 16, comment = "" } = options; - const radix = base > 36 ? 36 : base < 10 ? 10 : base; - const rootRef = { ...root, s: "^" }; - const rows = flattenToReferences(rootRef).map((n) => toLine(n, base)); - return generateHeader(radix, comment).concat(rows).map((a) => a + "\n"); - } - exports.serializeTrie = serializeTrie; - function* toIterableIterator(iter) { - yield* iter; - } - function importTrie(linesX) { - let radix = 16; - const comment = /^\s*#/; - const iter = toIterableIterator(linesX); - function parseHeaderRows(headerRows) { - const header = headerRows.slice(0, 2).join("\n"); - const headerReg = /^TrieXv2\nbase=(\d+)$/; - if (!headerReg.test(header)) - throw new Error("Unknown file format"); - radix = Number.parseInt(header.replace(headerReg, "$1"), 10); - } - function readHeader(iter2) { - const headerRows = []; - while (true) { - const next = iter2.next(); - if (next.done) { - break; - } - const line = next.value.trim(); - if (!line || comment.test(line)) { - continue; - } - if (line === exports.DATA) { - break; - } - headerRows.push(line); + exports.unixify = unixify; + function makeAbsolute(cwd, filepath) { + return path26.resolve(cwd, filepath); + } + exports.makeAbsolute = makeAbsolute; + function removeLeadingDotSegment(entry) { + if (entry.charAt(0) === ".") { + const secondCharactery = entry.charAt(1); + if (secondCharactery === "/" || secondCharactery === "\\") { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); } - parseHeaderRows(headerRows); - } - function parseLine(line, base) { - const isWord = line[1] === EOW; - const refOffset = isWord ? 2 : 1; - const refs = line.slice(refOffset).split(",").filter((a) => !!a).map((r) => parseInt(r, base)); - return { - letter: line[0], - isWord, - refs - }; - } - const flagsWord = { f: TrieNode_js_1.FLAG_WORD }; - function decodeLine(line, nodes) { - const { letter, isWord, refs } = parseLine(line, radix); - const flags = isWord ? flagsWord : {}; - const children = refs.map((r) => nodes[r]).sort((a, b) => a.s < b.s ? -1 : 1).map((n2) => [n2.s, n2]); - const cNode = children.length ? { c: new TrieNode_js_1.ChildMap(children) } : {}; - return { s: letter, ...cNode, ...flags }; } - readHeader(iter); - const n = (0, gensequence_1.genSequence)(iter).map((a) => a.replace(/\r?\n/, "")).filter((a) => !!a).reduce((acc, line) => { - const { nodes } = acc; - const root = decodeLine(line, nodes); - nodes.push(root); - return { root, nodes }; - }, { nodes: [], root: { s: "", c: /* @__PURE__ */ new Map() } }); - return (0, trie_util_js_1.trieNodeToRoot)(n.root, {}); + return entry; + } + exports.removeLeadingDotSegment = removeLeadingDotSegment; + exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; + function escapeWindowsPath(pattern) { + return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); + } + exports.escapeWindowsPath = escapeWindowsPath; + function escapePosixPath(pattern) { + return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); + } + exports.escapePosixPath = escapePosixPath; + exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; + function convertWindowsPathToPattern(filepath) { + return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/"); + } + exports.convertWindowsPathToPattern = convertWindowsPathToPattern; + function convertPosixPathToPattern(filepath) { + return escapePosixPath(filepath); } - exports.importTrie = importTrie; + exports.convertPosixPathToPattern = convertPosixPathToPattern; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/bufferLines.js -var require_bufferLines = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/bufferLines.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.bufferLines = exports.buffer = void 0; - function* buffer(iter, bufferSize) { - const buffer2 = []; - for (const s of iter) { - buffer2.push(s); - if (buffer2.length >= bufferSize) { - yield buffer2; - buffer2.length = 0; - } - } - if (buffer2.length) { - yield buffer2; - buffer2.length = 0; +// node_modules/is-extglob/index.js +var require_is_extglob = __commonJS({ + "node_modules/is-extglob/index.js"(exports, module2) { + module2.exports = function isExtglob(str) { + if (typeof str !== "string" || str === "") { + return false; } - } - exports.buffer = buffer; - function* bufferLines(iter, bufferSize, eol) { - if (eol) { - for (const s of buffer(iter, bufferSize)) { - yield s.join("") + eol; - } - } else { - for (const s of buffer(iter, bufferSize)) { - yield s.join(""); - } + var match2; + while (match2 = /(\\).|([@?!+*]\(.*\))/g.exec(str)) { + if (match2[2]) + return true; + str = str.slice(match2.index + match2[0].length); } - } - exports.bufferLines = bufferLines; + return false; + }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV3.js -var require_importExportV3 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV3.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.importTrie = exports.serializeTrie = exports.DATA = void 0; - var gensequence_1 = require_dist2(); - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - var bufferLines_js_1 = require_bufferLines(); - var EOW = "$"; - var BACK = "<"; - var EOL = "\n"; - var LF = "\r"; - var REF = "#"; - var EOR = ";"; - var ESCAPE = "\\"; - var specialCharacters = new Set([EOW, BACK, EOL, REF, EOR, ESCAPE, LF].concat("0123456789".split("")).concat("`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|".split(""))); - var specialCharacterMap = /* @__PURE__ */ new Map([ - ["\n", "\\n"], - ["\r", "\\r"], - ["\\", "\\\\"] - ]); - var characterMap = new Map([...specialCharacterMap].map((a) => [a[1], a[0]])); - var specialPrefix = stringToCharSet("~!"); - var WORDS_PER_LINE = 20; - exports.DATA = "__DATA__"; - function generateHeader(base, comment) { - const header = ["#!/usr/bin/env cspell-trie reader", "TrieXv3", "base=" + base].concat(comment ? comment.split("\n").map((a) => "# " + a) : []).concat(["# Data:", exports.DATA]); - return (0, gensequence_1.genSequence)(header).map((a) => a + "\n"); - } - function serializeTrie(root, options = 16) { - options = typeof options === "number" ? { base: options, addLineBreaksToImproveDiffs: false } : options; - const { base = 16, comment = "", addLineBreaksToImproveDiffs: addBreaks = true } = options; - const radix = base > 36 ? 36 : base < 10 ? 10 : base; - const cache = /* @__PURE__ */ new Map(); - const cacheShouldRef = /* @__PURE__ */ new Map(); - let count = 0; - const backBuffer = { last: "", count: 0, words: 0, eol: false }; - const optimizeSimpleReferences = options.optimizeSimpleReferences ?? false; - const wordChars = []; - function ref(n) { - return "#" + n.toString(radix) + ";"; - } - function escape(s) { - return specialCharacters.has(s) ? ESCAPE + (specialCharacterMap.get(s) || s) : s; - } - function* flush() { - while (backBuffer.count) { - const n = Math.min(9, backBuffer.count); - yield n > 1 ? backBuffer.last + n : backBuffer.last; - backBuffer.last = BACK; - backBuffer.count -= n; - } - if (backBuffer.eol) { - yield EOL; - backBuffer.eol = false; - backBuffer.words = 0; - } - } - function* emit(s) { - switch (s) { - case EOW: - yield* flush(); - backBuffer.last = EOW; - backBuffer.count = 0; - backBuffer.words++; - break; - case BACK: - backBuffer.count++; - break; - case EOL: - backBuffer.eol = true; - break; - default: - if (backBuffer.words >= WORDS_PER_LINE) { - backBuffer.eol = true; - } - yield* flush(); - if (s.startsWith(REF)) { - backBuffer.words++; - } - yield s; - } +// node_modules/is-glob/index.js +var require_is_glob = __commonJS({ + "node_modules/is-glob/index.js"(exports, module2) { + var isExtglob = require_is_extglob(); + var chars = { "{": "}", "(": ")", "[": "]" }; + var strictCheck = function(str) { + if (str[0] === "!") { + return true; } - function* walk(node, depth) { - const r = cache.get(node); - if (r !== void 0 && (!optimizeSimpleReferences || !shouldSimpleRef(node))) { - yield* emit(ref(r)); - return; + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === "*") { + return true; + } + if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) { + return true; } - if (node.c) { - if (addBreaks && depth > 0 && depth <= 2) { - yield* emit(EOL); + if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf("]", index); } - cache.set(node, count++); - const c = [...node.c].sort((a, b) => a[0] < b[0] ? -1 : 1); - for (const [s, n] of c) { - wordChars[depth] = s; - yield* emit(escape(s)); - yield* walk(n, depth + 1); - yield* emit(BACK); - if (depth === 0) - yield* emit(EOL); + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } } } - if (node.f) { - yield* emit(EOW); + if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") { + closeCurlyIndex = str.indexOf("}", index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } } - if (addBreaks && (depth === 2 || depth === 3 && wordChars[0] in specialPrefix)) { - yield* emit(EOL); + if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") { + closeParenIndex = str.indexOf(")", index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } } - } - function* serialize(node) { - yield* walk(node, 0); - yield* flush(); - } - function _calcShouldSimpleRef(node) { - if (node.c?.size !== 1) - return false; - const [n] = [...node.c.values()]; - return !!n.f && (n.c === void 0 || n.c.size === 0); - } - function shouldSimpleRef(node) { - const r = cacheShouldRef.get(node); - if (r !== void 0) - return r; - const rr = _calcShouldSimpleRef(node); - cacheShouldRef.set(node, rr); - return rr; - } - return generateHeader(radix, comment).concat((0, bufferLines_js_1.bufferLines)(serialize(root), 1200, "")); - } - exports.serializeTrie = serializeTrie; - function* toIterableIterator(iter) { - yield* iter; - } - function importTrie(linesX) { - linesX = typeof linesX === "string" ? linesX.split(/^/m) : linesX; - const root = (0, trie_util_js_1.trieNodeToRoot)({}, {}); - let radix = 16; - const comment = /^\s*#/; - const iter = toIterableIterator(linesX); - function parseHeaderRows(headerRows) { - const header = headerRows.slice(0, 2).join("\n"); - const headerReg = /^TrieXv3\nbase=(\d+)$/; - if (!headerReg.test(header)) - throw new Error("Unknown file format"); - radix = Number.parseInt(header.replace(headerReg, "$1"), 10); - } - function readHeader(iter2) { - const headerRows = []; - while (true) { - const next = iter2.next(); - if (next.done) { - break; + if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") { + if (pipeIndex < index) { + pipeIndex = str.indexOf("|", index); } - const line = next.value.trim().replace(/\r|\n/g, ""); - if (!line || comment.test(line)) { - continue; + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") { + closeParenIndex = str.indexOf(")", pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf("\\", pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } } - if (line === exports.DATA) { - break; + } + if (str[index] === "\\") { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } } - headerRows.push(line); + if (str[index] === "!") { + return true; + } + } else { + index++; } - parseHeaderRows(headerRows); - } - readHeader(iter); - const n = (0, gensequence_1.genSequence)(iter).concatMap((a) => a.split("")).reduce(parseStream(radix), { - nodes: [root], - root, - stack: [{ node: root, s: "" }], - parser: void 0 - }); - return n.root; - } - exports.importTrie = importTrie; - function parseStream(radix) { - const eow = Object.freeze({ f: 1 }); - function parseReference(acc, _) { - let ref = ""; - function parser(acc2, s) { - if (s === EOR) { - const { root, nodes: nodes2, stack } = acc2; - const r = parseInt(ref, radix); - const top = stack[stack.length - 1]; - const p = stack[stack.length - 2].node; - p.c?.set(top.s, nodes2[r]); - return { root, nodes: nodes2, stack, parser: void 0 }; - } - ref = ref + s; - return acc2; - } - const { nodes } = acc; - nodes.pop(); - return { ...acc, nodes, parser }; - } - function parseEscapeCharacter(acc, _) { - let prev = ""; - const parser = function(acc2, s) { - if (prev) { - s = characterMap.get(prev + s) || s; - return parseCharacter({ ...acc2, parser: void 0 }, s); - } - if (s === ESCAPE) { - prev = s; - return acc2; - } - return parseCharacter({ ...acc2, parser: void 0 }, s); - }; - return { ...acc, parser }; } - function parseCharacter(acc, s) { - const parser = void 0; - const { root, nodes, stack } = acc; - const top = stack[stack.length - 1]; - const node = top.node; - node.c = node.c ?? /* @__PURE__ */ new Map(); - const n = { f: void 0, c: void 0, n: nodes.length }; - node.c.set(s, n); - stack.push({ node: n, s }); - nodes.push(n); - return { root, nodes, stack, parser }; - } - function parseEOW(acc, _) { - const parser = parseBack; - const { root, nodes, stack } = acc; - const top = stack[stack.length - 1]; - const node = top.node; - node.f = TrieNode_js_1.FLAG_WORD; - if (!node.c) { - top.node = eow; - const p = stack[stack.length - 2].node; - p.c?.set(top.s, eow); - nodes.pop(); - } - stack.pop(); - return { root, nodes, stack, parser }; + return false; + }; + var relaxedCheck = function(str) { + if (str[0] === "!") { + return true; } - const charactersBack = new Set((BACK + "23456789").split("")); - function parseBack(acc, s) { - if (!charactersBack.has(s)) { - return parserMain({ ...acc, parser: void 0 }, s); + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; } - let n = s === BACK ? 1 : parseInt(s, 10) - 1; - const { stack } = acc; - while (n-- > 0) { - stack.pop(); + if (str[index] === "\\") { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + if (str[index] === "!") { + return true; + } + } else { + index++; } - return { ...acc, parser: parseBack }; } - function parseIgnore(acc, _) { - return acc; + return false; + }; + module2.exports = function isGlob(str, options) { + if (typeof str !== "string" || str === "") { + return false; } - const parsers = /* @__PURE__ */ new Map([ - [EOW, parseEOW], - [BACK, parseBack], - [REF, parseReference], - [ESCAPE, parseEscapeCharacter], - [EOL, parseIgnore], - [LF, parseIgnore] - ]); - function parserMain(acc, s) { - const parser = acc.parser ?? parsers.get(s) ?? parseCharacter; - return parser(acc, s); + if (isExtglob(str)) { + return true; } - return parserMain; - } - function stringToCharSet(values) { - const set = /* @__PURE__ */ Object.create(null); - const len = values.length; - for (let i = 0; i < len; ++i) { - set[values[i]] = true; + var check = strictCheck; + if (options && options.strict === false) { + check = relaxedCheck; } - return set; - } + return check(str); + }; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/sync/index.js -var require_sync = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/sync/index.js"(exports) { +// node_modules/glob-parent/index.js +var require_glob_parent = __commonJS({ + "node_modules/glob-parent/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.reduce = exports.pipeSync = exports.pipe = exports.opUnique = exports.opTap = exports.opTake = exports.opSkip = exports.opReduce = exports.opMap = exports.opLast = exports.opJoinStrings = exports.opFlatten = exports.opFirst = exports.opFilter = exports.opConcatMap = exports.opCombine = exports.opAppend = exports.toArray = void 0; - var toArray_js_1 = require_toArray(); - Object.defineProperty(exports, "toArray", { enumerable: true, get: function() { - return toArray_js_1.toArraySync; - } }); - var index_js_1 = require_operators3(); - Object.defineProperty(exports, "opAppend", { enumerable: true, get: function() { - return index_js_1.opAppendSync; - } }); - Object.defineProperty(exports, "opCombine", { enumerable: true, get: function() { - return index_js_1.opCombineSync; - } }); - Object.defineProperty(exports, "opConcatMap", { enumerable: true, get: function() { - return index_js_1.opConcatMapSync; - } }); - Object.defineProperty(exports, "opFilter", { enumerable: true, get: function() { - return index_js_1.opFilterSync; - } }); - Object.defineProperty(exports, "opFirst", { enumerable: true, get: function() { - return index_js_1.opFirstSync; - } }); - Object.defineProperty(exports, "opFlatten", { enumerable: true, get: function() { - return index_js_1.opFlattenSync; - } }); - Object.defineProperty(exports, "opJoinStrings", { enumerable: true, get: function() { - return index_js_1.opJoinStringsSync; - } }); - Object.defineProperty(exports, "opLast", { enumerable: true, get: function() { - return index_js_1.opLastSync; - } }); - Object.defineProperty(exports, "opMap", { enumerable: true, get: function() { - return index_js_1.opMapSync; - } }); - Object.defineProperty(exports, "opReduce", { enumerable: true, get: function() { - return index_js_1.opReduceSync; - } }); - Object.defineProperty(exports, "opSkip", { enumerable: true, get: function() { - return index_js_1.opSkipSync; - } }); - Object.defineProperty(exports, "opTake", { enumerable: true, get: function() { - return index_js_1.opTakeSync; - } }); - Object.defineProperty(exports, "opTap", { enumerable: true, get: function() { - return index_js_1.opTapSync; - } }); - Object.defineProperty(exports, "opUnique", { enumerable: true, get: function() { - return index_js_1.opUniqueSync; - } }); - var pipe_js_1 = require_pipe(); - Object.defineProperty(exports, "pipe", { enumerable: true, get: function() { - return pipe_js_1.pipeSync; - } }); - Object.defineProperty(exports, "pipeSync", { enumerable: true, get: function() { - return pipe_js_1.pipeSync; - } }); - var reduce_js_1 = require_reduce2(); - Object.defineProperty(exports, "reduce", { enumerable: true, get: function() { - return reduce_js_1.reduceSync; - } }); - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV4.js -var require_importExportV4 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV4.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.importTrie = exports.serializeTrie = exports.DATA = void 0; - var sync_1 = require_sync(); - var gensequence_1 = require_dist2(); - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - var bufferLines_js_1 = require_bufferLines(); - var EOW = "$"; - var BACK = "<"; - var EOL = "\n"; - var LF = "\r"; - var REF = "#"; - var REF_REL = "@"; - var EOR = ";"; - var ESCAPE = "\\"; - var REF_INDEX_BEGIN = "["; - var REF_INDEX_END = "]"; - var INLINE_DATA_COMMENT_LINE = "/"; - var specialCharacters = stringToCharSet([EOW, BACK, EOL, REF, REF_REL, EOR, ESCAPE, LF, REF_INDEX_BEGIN, REF_INDEX_END, INLINE_DATA_COMMENT_LINE].concat("0123456789".split("")).concat("`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|".split("")).join("")); - var SPECIAL_CHARACTERS_MAP = [ - ["\n", "\\n"], - ["\r", "\\r"], - ["\\", "\\\\"] - ]; - var specialCharacterMap = stringToCharMap(SPECIAL_CHARACTERS_MAP); - var characterMap = stringToCharMap(SPECIAL_CHARACTERS_MAP.map((a) => [a[1], a[0]])); - var specialPrefix = stringToCharSet("~!"); - var WORDS_PER_LINE = 20; - exports.DATA = "__DATA__"; - function generateHeader(base, comment) { - const comments = comment.split("\n").map((a) => "# " + a.trimEnd()).join("\n"); - return `#!/usr/bin/env cspell-trie reader -TrieXv4 -base=${base} -${comments} -# Data: -${exports.DATA} -`; - } - function serializeTrie(root, options = 16) { - options = typeof options === "number" ? { base: options } : options; - const { base = 10, comment = "" } = options; - const radix = base > 36 ? 36 : base < 10 ? 10 : base; - const cache = /* @__PURE__ */ new Map(); - const refMap = buildReferenceMap(root, base); - const nodeToIndexMap = new Map(refMap.refCounts.map(([node], index) => [node, index])); - let count = 0; - const backBuffer = { last: "", count: 0, words: 0, eol: false }; - const wordChars = []; - function ref(n, idx) { - const r = idx === void 0 || n < idx ? REF + n.toString(radix) : REF_REL + idx.toString(radix); - return radix === 10 ? r : r + ";"; - } - function escape(s) { - return s in specialCharacters ? ESCAPE + (specialCharacterMap[s] || s) : s; - } - function* flush() { - while (backBuffer.count) { - const n = Math.min(9, backBuffer.count); - yield n > 1 ? backBuffer.last + n : backBuffer.last; - backBuffer.last = BACK; - backBuffer.count -= n; - } - if (backBuffer.eol) { - yield EOL; - backBuffer.eol = false; - backBuffer.words = 0; - } - } - function* emit(s) { - switch (s) { - case EOW: - yield* flush(); - backBuffer.last = EOW; - backBuffer.count = 0; - backBuffer.words++; - break; - case BACK: - backBuffer.count++; - break; - case EOL: - backBuffer.eol = true; - break; - default: - if (backBuffer.words >= WORDS_PER_LINE) { - backBuffer.eol = true; - } - yield* flush(); - if (s.startsWith(REF) || s.startsWith(REF_REL)) { - backBuffer.words++; - } - yield s; - } - } - const comment_begin = `${EOL}${INLINE_DATA_COMMENT_LINE}* `; - const comment_end = ` *${INLINE_DATA_COMMENT_LINE}${EOL}`; - function* walk(node, depth) { - const nodeNumber = cache.get(node); - const refIndex = nodeToIndexMap.get(node); - if (nodeNumber !== void 0) { - yield* emit(ref(nodeNumber, refIndex)); - return; - } - if (node.c) { - if (depth > 0 && depth <= 2) { - const chars = wordChars.slice(0, depth).map(escape).join(""); - yield* emit(comment_begin + chars + comment_end); - } - cache.set(node, count++); - const c = [...node.c].sort((a, b) => a[0] < b[0] ? -1 : 1); - for (const [s, n] of c) { - wordChars[depth] = s; - yield* emit(escape(s)); - yield* walk(n, depth + 1); - yield* emit(BACK); - if (depth === 0) - yield* emit(EOL); - } - } - if (node.f) { - yield* emit(EOW); - } - if (depth === 2 || depth === 3 && wordChars[0] in specialPrefix) { - yield* emit(EOL); - } - } - function* serialize(node) { - yield* walk(node, 0); - yield* flush(); - } - const lines = [...(0, bufferLines_js_1.bufferLines)(serialize(root), 1e3, "")]; - const resolvedReferences = refMap.refCounts.map(([node]) => cache.get(node) || 0); - const reference = "[\n" + resolvedReferences.map((n) => n.toString(radix)).join(",").replace(/.{110,130}[,]/g, "$&\n") + "\n]\n"; - return (0, gensequence_1.genSequence)([generateHeader(radix, comment), reference]).concat(lines); - } - exports.serializeTrie = serializeTrie; - function buildReferenceMap(root, base) { - const refCount = /* @__PURE__ */ new Map(); - let nodeCount = 0; - function walk(node) { - const ref = refCount.get(node); - if (ref) { - ref.c++; - return; - } - refCount.set(node, { c: 1, n: nodeCount++ }); - if (!node.c) - return; - for (const child of node.c.values()) { - walk(child); - } - } - walk(root); - const refCountAndNode = [ - ...(0, sync_1.pipe)(refCount, (0, sync_1.opFilter)(([_, ref]) => ref.c >= 2)) - ].sort((a, b) => b[1].c - a[1].c || a[1].n - b[1].n); - let adj = 0; - const baseLogScale = 1 / Math.log(base); - const refs = refCountAndNode.filter(([_, ref], idx) => { - const i = idx - adj; - const charsIdx = Math.ceil(Math.log(i) * baseLogScale); - const charsNode = Math.ceil(Math.log(ref.n) * baseLogScale); - const savings = ref.c * (charsNode - charsIdx) - charsIdx; - const keep = savings > 0; - adj += keep ? 0 : 1; - return keep; - }).map(([n, ref]) => [n, ref.c]); - return { refCounts: refs }; - } - function importTrie(linesX) { - linesX = typeof linesX === "string" ? linesX.split(/^/m) : linesX; - let radix = 10; - const comment = /^\s*#/; - const iter = tapIterable((0, sync_1.pipe)(linesX, (0, sync_1.opConcatMap)((a) => a.split(/^/m)))); - function parseHeaderRows(headerRows) { - const header = headerRows.slice(0, 2).join("\n"); - const headerReg = /^TrieXv[34]\nbase=(\d+)$/; - if (!headerReg.test(header)) - throw new Error("Unknown file format"); - radix = Number.parseInt(header.replace(headerReg, "$1"), 10); - } - function readHeader(iter2) { - const headerRows = []; - for (const value of iter2) { - const line = value.trim(); - if (!line || comment.test(line)) - continue; - if (line === exports.DATA) - break; - headerRows.push(line); - } - parseHeaderRows(headerRows); - } - readHeader(iter); - const root = parseStream(radix, iter); - return root; - } - exports.importTrie = importTrie; - var numbersSet = stringToCharSet("0123456789"); - function parseStream(radix, iter) { - const eow = Object.freeze({ f: 1 }); - let refIndex = []; - const root = (0, trie_util_js_1.trieNodeToRoot)({}, {}); - function parseReference(acc, s) { - const isIndexRef = s === REF_REL; - let ref = ""; - function parser(acc2, s2) { - if (s2 === EOR || radix === 10 && !(s2 in numbersSet)) { - const { root: root2, nodes: nodes2, stack } = acc2; - const r = parseInt(ref, radix); - const top = stack[stack.length - 1]; - const p = stack[stack.length - 2].node; - const n = isIndexRef ? refIndex[r] : r; - p.c?.set(top.s, nodes2[n]); - const rr = { root: root2, nodes: nodes2, stack, parser: void 0 }; - return s2 === EOR ? rr : parserMain(rr, s2); - } - ref = ref + s2; - return acc2; - } - const { nodes } = acc; - nodes.pop(); - return { ...acc, nodes, parser }; - } - function parseEscapeCharacter(acc, _) { - let prev = ""; - const parser = function(acc2, s) { - if (prev) { - s = characterMap[prev + s] || s; - return parseCharacter({ ...acc2, parser: void 0 }, s); - } - if (s === ESCAPE) { - prev = s; - return acc2; - } - return parseCharacter({ ...acc2, parser: void 0 }, s); - }; - return { ...acc, parser }; - } - function parseComment(acc, s) { - const endOfComment = s; - let isEscaped = false; - function parser(acc2, s2) { - if (isEscaped) { - isEscaped = false; - return acc2; - } - if (s2 === ESCAPE) { - isEscaped = true; - return acc2; - } - if (s2 === endOfComment) { - return { ...acc2, parser: void 0 }; - } - return acc2; - } - return { ...acc, parser }; - } - function parseCharacter(acc, s) { - const parser = void 0; - const { root: root2, nodes, stack } = acc; - const top = stack[stack.length - 1]; - const node = top.node; - node.c = node.c ?? /* @__PURE__ */ new Map(); - const n = { f: void 0, c: void 0, n: nodes.length }; - node.c.set(s, n); - stack.push({ node: n, s }); - nodes.push(n); - return { root: root2, nodes, stack, parser }; - } - function parseEOW(acc, _) { - const parser = parseBack; - const { root: root2, nodes, stack } = acc; - const top = stack[stack.length - 1]; - const node = top.node; - node.f = TrieNode_js_1.FLAG_WORD; - if (!node.c) { - top.node = eow; - const p = stack[stack.length - 2].node; - p.c?.set(top.s, eow); - nodes.pop(); - } - stack.pop(); - return { root: root2, nodes, stack, parser }; - } - const charactersBack = stringToCharSet(BACK + "23456789"); - function parseBack(acc, s) { - if (!(s in charactersBack)) { - return parserMain({ ...acc, parser: void 0 }, s); - } - let n = s === BACK ? 1 : parseInt(s, 10) - 1; - const { stack } = acc; - while (n-- > 0) { - stack.pop(); - } - return { ...acc, parser: parseBack }; - } - function parseIgnore(acc, _) { - return acc; - } - const parsers = createStringLookupMap([ - [EOW, parseEOW], - [BACK, parseBack], - [REF, parseReference], - [REF_REL, parseReference], - [ESCAPE, parseEscapeCharacter], - [EOL, parseIgnore], - [LF, parseIgnore], - [INLINE_DATA_COMMENT_LINE, parseComment] - ]); - function parserMain(acc, s) { - const parser = acc.parser ?? parsers[s] ?? parseCharacter; - return parser(acc, s); - } - const charsetSpaces = stringToCharSet(" \r\n "); - function parseReferenceIndex(acc, s) { - let json = ""; - function parserStart(acc2, s2) { - if (s2 === REF_INDEX_BEGIN) { - json = json + s2; - return { ...acc2, parser }; - } - if (s2 in charsetSpaces) { - return acc2; - } - return parserMain({ ...acc2, parser: void 0 }, s2); - } - function parser(acc2, s2) { - json = json + s2; - if (s2 === REF_INDEX_END) { - refIndex = json.replace(/[\s[\]]/g, "").split(",").map((n) => parseInt(n, radix)); - return { ...acc2, parser: void 0 }; - } - return acc2; - } - return parserStart({ ...acc, parser: parserStart }, s); - } - (0, gensequence_1.genSequence)(iter).concatMap((a) => a.split("")).reduce(parserMain, { - nodes: [root], - root, - stack: [{ node: root, s: "" }], - parser: parseReferenceIndex - }); - return root; - } - function stringToCharSet(values) { - const set = /* @__PURE__ */ Object.create(null); - const len = values.length; - for (let i = 0; i < len; ++i) { - set[values[i]] = true; - } - return set; - } - function stringToCharMap(values) { - return createStringLookupMap(values); - } - function createStringLookupMap(values) { - const map = /* @__PURE__ */ Object.create(null); - const len = values.length; - for (let i = 0; i < len; ++i) { - map[values[i][0]] = values[i][1]; - } - return map; - } - function tapIterable(iterable) { - let lastValue; - let iter; - function getNext() { - if (lastValue && lastValue.done) { - return { ...lastValue }; - } - iter = iter || iterable[Symbol.iterator](); - lastValue = iter.next(); - return lastValue; + var isGlob = require_is_glob(); + var pathPosixDirname = require("path").posix.dirname; + var isWin32 = require("os").platform() === "win32"; + var slash = "/"; + var backslash = /\\/g; + var enclosure = /[\{\[].*[\}\]]$/; + var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; + var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + module2.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); } - function* iterableFn() { - let next; - while (!(next = getNext()).done) { - yield next.value; - } + if (enclosure.test(str)) { + str += slash; } - return { - [Symbol.iterator]: iterableFn - }; - } - exports.__testing__ = { - buildReferenceMap + str += "a"; + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + return str.replace(escaped, "$1"); }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExport.js -var require_importExport = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExport.js"(exports) { +// node_modules/fast-glob/out/utils/pattern.js +var require_pattern = __commonJS({ + "node_modules/fast-glob/out/utils/pattern.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.importTrie = exports.serializeTrie = void 0; - var cspell_pipe_1 = require_cjs4(); - var gensequence_1 = require_dist2(); - var iv1 = __importStar(require_importExportV1()); - var iv2 = __importStar(require_importExportV2()); - var iv3 = __importStar(require_importExportV3()); - var iv4 = __importStar(require_importExportV4()); - var serializers = [ - iv1.serializeTrie, - iv1.serializeTrie, - iv2.serializeTrie, - iv3.serializeTrie, - iv4.serializeTrie - ]; - var deserializers = [iv1.importTrie, iv1.importTrie, iv2.importTrie, iv3.importTrie, iv4.importTrie]; - var DEFAULT_VERSION = 3; - function serializeTrie(root, options = 16) { - const version3 = typeof options !== "number" && options.version ? options.version : DEFAULT_VERSION; - const method = serializers[version3]; - if (!method) { - throw new Error(`Unknown version: ${version3}`); - } - return method(root, options); - } - exports.serializeTrie = serializeTrie; - function importTrie(lines) { - function parseHeaderRows(headerRows) { - const header = headerRows.join("\n"); - const headerReg = /^\s*TrieXv(\d+)/m; - const match = header.match(headerReg); - if (!match) - throw new Error("Unknown file format"); - return parseInt(match[1], 10); - } - function readHeader(iter) { - const headerRows = []; - for (const entry of iter) { - const line = entry.trim(); - headerRows.push(line); - if (line === iv1.DATA || line === iv2.DATA) { - break; - } - } - return headerRows; - } - const input = (0, cspell_pipe_1.toDistributableIterable)(lines); - const headerLines = readHeader(input); - const version3 = parseHeaderRows(headerLines); - const stream = (0, gensequence_1.genSequence)(headerLines).concat(input); - const method = deserializers[version3]; - if (!method) { - throw new Error(`Unsupported version: ${version3}`); - } - return method(stream); + exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; + var path26 = require("path"); + var globParent = require_glob_parent(); + var micromatch = require_micromatch(); + var GLOBSTAR = "**"; + var ESCAPE_SYMBOL = "\\"; + var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; + var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; + var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; + var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; + var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; + var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; + function isStaticPattern(pattern, options = {}) { + return !isDynamicPattern(pattern, options); } - exports.importTrie = importTrie; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/knownLocales.js -var require_knownLocales = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/knownLocales.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.codes = void 0; - exports.codes = [ - // ['code', 'language'[', ''locale']], - ["af", "Afrikaans"], - ["af-NA", "Afrikaans", "Namibia"], - ["af-ZA", "Afrikaans", "South Africa"], - ["ak", "Akan"], - ["ak-GH", "Akan", "Ghana"], - ["am", "Amharic"], - ["am-ET", "Amharic", "Ethiopia"], - ["ar", "Arabic"], - ["ar-1", "Arabic"], - ["ar-AE", "Arabic", "United Arab Emirates"], - ["ar-BH", "Arabic", "Bahrain"], - ["ar-DJ", "Arabic", "Djibouti"], - ["ar-DZ", "Arabic", "Algeria"], - ["ar-EG", "Arabic", "Egypt"], - ["ar-EH", "Arabic"], - ["ar-ER", "Arabic", "Eritrea"], - ["ar-IL", "Arabic", "Israel"], - ["ar-IQ", "Arabic", "Iraq"], - ["ar-JO", "Arabic", "Jordan"], - ["ar-KM", "Arabic", "Comoros"], - ["ar-KW", "Arabic", "Kuwait"], - ["ar-LB", "Arabic", "Lebanon"], - ["ar-LY", "Arabic", "Libya"], - ["ar-MA", "Arabic", "Morocco"], - ["ar-MR", "Arabic", "Mauritania"], - ["ar-OM", "Arabic", "Oman"], - ["ar-PS", "Arabic"], - ["ar-QA", "Arabic", "Qatar"], - ["ar-SA", "Arabic", "Saudi Arabia"], - ["ar-SD", "Arabic", "Sudan"], - ["ar-SO", "Arabic", "Somalia"], - ["ar-SS", "Arabic"], - ["ar-SY", "Arabic", "Syria"], - ["ar-TD", "Arabic", "Chad"], - ["ar-TN", "Arabic", "Tunisia"], - ["ar-YE", "Arabic", "Yemen"], - ["as", "Assamese"], - ["as-IN", "Assamese", "India"], - ["az", "Azerbaijani"], - ["az-AZ", "Azerbaijani", "Azerbaijan"], - ["be", "Belarusian"], - ["be-BY", "Belarusian", "Belarus"], - ["bg", "Bulgarian"], - ["bg-BG", "Bulgarian", "Bulgaria"], - ["bm", "Bambara"], - ["bm-ML", "Bambara", "Mali"], - ["bn", "Bengali"], - ["bn-BD", "Bengali", "Bangladesh"], - ["bn-IN", "Bengali", "India"], - ["bo", "Tibetan"], - ["bo-CN", "Tibetan", "China"], - ["bo-IN", "Tibetan", "India"], - ["br", "Breton"], - ["br-FR", "Breton", "France"], - ["bs", "Bosnian"], - ["bs-BA", "Bosnian", "Bosnia and Herzegovina"], - ["ca", "Catalan"], - ["ca-AD", "Catalan", "Andorra"], - ["ca-ES", "Catalan", "Spain"], - ["ca-FR", "Catalan", "France"], - ["ca-IT", "Catalan", "Italy"], - ["ce", "Chechen"], - ["ce-RU", "Chechen", "Russia"], - ["cs", "Czech"], - ["cs-CZ", "Czech", "Czech Republic"], - ["cu", "Old Slavonic"], - ["cu-RU", "Old Slavonic", "Russia"], - ["cy", "Welsh"], - ["cy-GB", "Welsh", "United Kingdom"], - ["da", "Danish"], - ["da-DK", "Danish", "Denmark"], - ["da-GL", "Danish", "Greenland"], - ["de", "German"], - ["de-AT", "German", "Austria"], - ["de-BE", "German", "Belgium"], - ["de-CH", "German", "Switzerland"], - ["de-DE", "German", "Germany"], - ["de-IT", "German", "Italy"], - ["de-LI", "German", "Liechtenstein"], - ["de-LU", "German", "Luxembourg"], - ["dz", "Dzongkha"], - ["dz-BT", "Dzongkha", "Bhutan"], - ["ee", "Ewe"], - ["ee-GH", "Ewe", "Ghana"], - ["ee-TG", "Ewe", "Togo"], - ["el", "Greek", "Modern (1453-)"], - ["el-CY", "Greek", "Cyprus"], - ["el-GR", "Greek", "Greece"], - ["en", "English"], - ["en-AG", "English", "Antigua and Barbuda"], - ["en-AI", "English", "Anguilla"], - ["en-AS", "English", "American Samoa"], - ["en-AT", "English", "Austria"], - ["en-AU", "English", "Australia"], - ["en-BB", "English", "Barbados"], - ["en-BE", "English", "Belgium"], - ["en-BI", "English", "Burundi"], - ["en-BM", "English", "Bermuda"], - ["en-BS", "English", "Bahamas"], - ["en-BW", "English", "Botswana"], - ["en-BZ", "English", "Belize"], - ["en-CA", "English", "Canada"], - ["en-CC", "English", "Cocos (Keeling) Islands"], - ["en-CH", "English", "Switzerland"], - ["en-CK", "English", "Cook Islands"], - ["en-CM", "English", "Cameroon"], - ["en-CX", "English", "Christmas Island"], - ["en-CY", "English", "Cyprus"], - ["en-DE", "English", "Germany"], - ["en-DG", "English"], - ["en-DK", "English", "Denmark"], - ["en-DM", "English", "Dominica"], - ["en-ER", "English", "Eritrea"], - ["en-FI", "English", "Finland"], - ["en-FJ", "English", "Fiji"], - ["en-FK", "English", "Falkland Islands (Islas Malvinas)"], - ["en-FM", "English", "Micronesia"], - ["en-GB", "English", "United Kingdom"], - ["en-GD", "English", "Grenada"], - ["en-GG", "English", "Guernsey"], - ["en-GH", "English", "Ghana"], - ["en-GI", "English", "Gibraltar"], - ["en-GM", "English", "Gambia"], - ["en-GU", "English", "Guam"], - ["en-GY", "English", "Guyana"], - ["en-HK", "English", "Hong Kong"], - ["en-IE", "English", "Ireland"], - ["en-IL", "English", "Israel"], - ["en-IM", "English", "Isle of Man"], - ["en-IN", "English", "India"], - ["en-IO", "English", "British Indian Ocean Territory"], - ["en-JE", "English", "Jersey"], - ["en-JM", "English", "Jamaica"], - ["en-KE", "English", "Kenya"], - ["en-KI", "English", "Kiribati"], - ["en-KN", "English", "Saint Kitts and Nevis"], - ["en-KY", "English", "Cayman Islands"], - ["en-LC", "English", "Saint Lucia"], - ["en-LR", "English", "Liberia"], - ["en-LS", "English", "Lesotho"], - ["en-MG", "English", "Madagascar"], - ["en-MH", "English", "Marshall Islands"], - ["en-MO", "English", "Macau"], - ["en-MP", "English", "Northern Mariana Islands"], - ["en-MS", "English", "Montserrat"], - ["en-MT", "English", "Malta"], - ["en-MU", "English", "Mauritius"], - ["en-MW", "English", "Malawi"], - ["en-MY", "English", "Malaysia"], - ["en-NA", "English", "Namibia"], - ["en-NF", "English", "Norfolk Island"], - ["en-NG", "English", "Nigeria"], - ["en-NL", "English", "Netherlands"], - ["en-NR", "English", "Nauru"], - ["en-NU", "English", "Niue"], - ["en-NZ", "English", "New Zealand"], - ["en-PG", "English", "Papua New Guinea"], - ["en-PH", "English", "Philippines"], - ["en-PK", "English", "Pakistan"], - ["en-PN", "English", "Pitcairn Islands"], - ["en-PR", "English", "Puerto Rico"], - ["en-PW", "English", "Palau"], - ["en-RW", "English", "Rwanda"], - ["en-SB", "English", "Solomon Islands"], - ["en-SC", "English", "Seychelles"], - ["en-SD", "English", "Sudan"], - ["en-SE", "English", "Sweden"], - ["en-SG", "English", "Singapore"], - ["en-SH", "English", "Saint Helena"], - ["en-SI", "English", "Slovenia"], - ["en-SL", "English", "Sierra Leone"], - ["en-SS", "English"], - ["en-SX", "English"], - ["en-SZ", "English", "Swaziland"], - ["en-TC", "English", "Turks and Caicos Islands"], - ["en-TK", "English", "Tokelau"], - ["en-TO", "English", "Tonga"], - ["en-TT", "English", "Trinidad and Tobago"], - ["en-TV", "English", "Tuvalu"], - ["en-TZ", "English", "Tanzania"], - ["en-UG", "English", "Uganda"], - ["en-UM", "English", "Baker Island"], - ["en-US", "English", "United States"], - ["en-VC", "English", "Saint Vincent and the Grenadines"], - ["en-VG", "English", "British Virgin Islands"], - ["en-VI", "English", "U.S. Virgin Islands"], - ["en-VU", "English", "Vanuatu"], - ["en-WS", "English", "Samoa"], - ["en-ZA", "English", "South Africa"], - ["en-ZM", "English", "Zambia"], - ["en-ZW", "English", "Zimbabwe"], - ["eo", "Esperanto"], - ["es", "Spanish"], - ["es-AR", "Spanish", "Argentina"], - ["es-BO", "Spanish", "Bolivia"], - ["es-BR", "Spanish", "Brazil"], - ["es-BZ", "Spanish", "Belize"], - ["es-CL", "Spanish", "Chile"], - ["es-CO", "Spanish", "Colombia"], - ["es-CR", "Spanish", "Costa Rica"], - ["es-CU", "Spanish", "Cuba"], - ["es-DO", "Spanish", "Dominican Republic"], - ["es-EA", "Spanish"], - ["es-EC", "Spanish", "Ecuador"], - ["es-ES", "Spanish", "Spain"], - ["es-GQ", "Spanish", "Equatorial Guinea"], - ["es-GT", "Spanish", "Guatemala"], - ["es-HN", "Spanish", "Honduras"], - ["es-IC", "Spanish"], - ["es-MX", "Spanish", "Mexico"], - ["es-NI", "Spanish", "Nicaragua"], - ["es-PA", "Spanish", "Panama"], - ["es-PE", "Spanish", "Peru"], - ["es-PH", "Spanish", "Philippines"], - ["es-PR", "Spanish", "Puerto Rico"], - ["es-PY", "Spanish", "Paraguay"], - ["es-SV", "Spanish", "El Salvador"], - ["es-US", "Spanish", "United States"], - ["es-UY", "Spanish", "Uruguay"], - ["es-VE", "Spanish", "Venezuela"], - ["et", "Estonian"], - ["et-EE", "Estonian", "Estonia"], - ["eu", "Basque"], - ["eu-ES", "Basque", "Spain"], - ["fa", "Persian"], - ["fa-AF", "Persian", "Afghanistan"], - ["fa-IR", "Persian", "Iran"], - ["ff", "Fulah"], - ["ff-CM", "Fulah", "Cameroon"], - ["ff-GN", "Fulah", "Guinea"], - ["ff-MR", "Fulah", "Mauritania"], - ["ff-SN", "Fulah", "Senegal"], - ["fi", "Finnish"], - ["fi-FI", "Finnish", "Finland"], - ["fo", "Faroese"], - ["fo-DK", "Faroese", "Denmark"], - ["fo-FO", "Faroese", "Faroe Islands"], - ["fr", "French"], - ["fr-BE", "French", "Belgium"], - ["fr-BF", "French", "Burkina Faso"], - ["fr-BI", "French", "Burundi"], - ["fr-BJ", "French", "Benin"], - ["fr-BL", "French"], - ["fr-CA", "French", "Canada"], - ["fr-CD", "French", "Congo"], - ["fr-CF", "French", "Central African Republic"], - ["fr-CG", "French", "Congo"], - ["fr-CH", "French", "Switzerland"], - ["fr-CI", "French, Cote d'Ivoire (Ivory Coast)"], - ["fr-CM", "French", "Cameroon"], - ["fr-DJ", "French", "Djibouti"], - ["fr-DZ", "French", "Algeria"], - ["fr-FR", "French", "France"], - ["fr-GA", "French", "Gabon"], - ["fr-GF", "French", "French Guiana"], - ["fr-GN", "French", "Guinea"], - ["fr-GP", "French", "Saint Barthelemy"], - ["fr-GQ", "French", "Equatorial Guinea"], - ["fr-HT", "French", "Haiti"], - ["fr-KM", "French", "Comoros"], - ["fr-LU", "French", "Luxembourg"], - ["fr-MA", "French", "Morocco"], - ["fr-MC", "French", "Monaco"], - ["fr-MF", "French"], - ["fr-MG", "French", "Madagascar"], - ["fr-ML", "French", "Mali"], - ["fr-MQ", "French", "Martinique"], - ["fr-MR", "French", "Mauritania"], - ["fr-MU", "French", "Mauritius"], - ["fr-NC", "French", "New Caledonia"], - ["fr-NE", "French", "Niger"], - ["fr-PF", "French", "French Polynesia"], - ["fr-PM", "French", "Saint Pierre and Miquelon"], - ["fr-RE", "French", "Reunion"], - ["fr-RW", "French", "Rwanda"], - ["fr-SC", "French", "Seychelles"], - ["fr-SN", "French", "Senegal"], - ["fr-SY", "French", "Syria"], - ["fr-TD", "French", "Chad"], - ["fr-TG", "French", "Togo"], - ["fr-TN", "French", "Tunisia"], - ["fr-VU", "French", "Vanuatu"], - ["fr-WF", "French", "Wallis and Futuna"], - ["fr-YT", "French", "Mayotte"], - ["fy", "Western Frisian"], - ["fy-NL", "Western Frisian", "Netherlands"], - ["ga", "Irish"], - ["ga-IE", "Irish", "Ireland"], - ["gd", "Gaelic"], - ["gd-GB", "Gaelic", "United Kingdom"], - ["gl", "Galician"], - ["gl-ES", "Galician", "Spain"], - ["gu", "Gujarati"], - ["gu-IN", "Gujarati", "India"], - ["gv", "Manx"], - ["gv-IM", "Manx", "Isle of Man"], - ["ha", "Hausa"], - ["ha-GH", "Hausa", "Ghana"], - ["ha-NE", "Hausa", "Niger"], - ["ha-NG", "Hausa", "Nigeria"], - ["he", "Hebrew"], - ["he-IL", "Hebrew", "Israel"], - ["hi", "Hindi"], - ["hi-IN", "Hindi", "India"], - ["hr", "Croatian"], - ["hr-BA", "Croatian", "Bosnia and Herzegovina"], - ["hr-HR", "Croatian", "Croatia"], - ["hu", "Hungarian"], - ["hu-HU", "Hungarian", "Hungary"], - ["hy", "Armenian"], - ["hy-AM", "Armenian", "Armenia"], - ["id", "Indonesian"], - ["id-ID", "Indonesian", "Indonesia"], - ["ig", "Igbo"], - ["ig-NG", "Igbo", "Nigeria"], - ["ii", "Sichuan Yi"], - ["ii-CN", "Sichuan Yi", "China"], - ["is", "Icelandic"], - ["is-IS", "Icelandic", "Iceland"], - ["it", "Italian"], - ["it-CH", "Italian", "Switzerland"], - ["it-IT", "Italian", "Italy"], - ["it-SM", "Italian", "San Marino"], - ["it-VA", "Italian", "Vatican City"], - ["ja", "Japanese"], - ["ja-JP", "Japanese", "Japan"], - ["ka", "Georgian"], - ["ka-GE", "Georgian", "Georgia"], - ["ki", "Kikuyu"], - ["ki-KE", "Kikuyu", "Kenya"], - ["kk", "Kazakh"], - ["kk-KZ", "Kazakh", "Kazakhstan"], - ["kl", "Kalaallisut"], - ["kl-GL", "Kalaallisut", "Greenland"], - ["km", "Central Khmer"], - ["km-KH", "Central Khmer", "Cambodia"], - ["kn", "Kannada"], - ["kn-IN", "Kannada", "India"], - ["ko", "Korean"], - ["ko-KP", "Korean", "Korea"], - ["ko-KR", "Korean", "Korea"], - ["ks", "Kashmiri"], - ["ks-IN", "Kashmiri", "India"], - ["kw", "Cornish"], - ["kw-GB", "Cornish", "United Kingdom"], - ["ky", "Kirghiz"], - ["ky-KG", "Kirghiz", "Kyrgyzstan"], - ["lb", "Luxembourgish"], - ["lb-LU", "Luxembourgish", "Luxembourg"], - ["lg", "Ganda"], - ["lg-UG", "Ganda", "Uganda"], - ["ln", "Lingala"], - ["ln-AO", "Lingala", "Angola"], - ["ln-CD", "Lingala", "Congo"], - ["ln-CF", "Lingala", "Central African Republic"], - ["ln-CG", "Lingala", "Congo"], - ["lo", "Lao"], - ["lo-LA", "Lao", "Laos"], - ["lt", "Lithuanian"], - ["lt-LT", "Lithuanian", "Lithuania"], - ["lu", "Luba-Katanga"], - ["lu-CD", "Luba-Katanga", "Congo"], - ["lv", "Latvian"], - ["lv-LV", "Latvian", "Latvia"], - ["mg", "Malagasy"], - ["mg-MG", "Malagasy", "Madagascar"], - ["mk", "Macedonian"], - ["mk-MK", "Macedonian", "Macedonia"], - ["ml", "Malayalam"], - ["ml-IN", "Malayalam", "India"], - ["mn", "Mongolian"], - ["mn-MN", "Mongolian", "Mongolia"], - ["mr", "Marathi"], - ["mr-IN", "Marathi", "India"], - ["ms", "Malay"], - ["ms-BN", "Malay", "Brunei"], - ["ms-MY", "Malay", "Malaysia"], - ["ms-SG", "Malay", "Singapore"], - ["mt", "Maltese"], - ["mt-MT", "Maltese", "Malta"], - ["my", "Burmese"], - ["my-MM", "Burmese", "Myanmar (Burma)"], - ["nb", "Bokm\xE5l Norwegian"], - ["nb-NO", "Bokm\xE5l Norwegian", "Norway"], - ["nb-SJ", "Bokm\xE5l Norwegian", "Svalbard"], - ["nd", "Ndebele, North"], - ["nd-ZW", "Ndebele, North", "Zimbabwe"], - ["ne", "Nepali"], - ["ne-IN", "Nepali", "India"], - ["ne-NP", "Nepali", "Nepal"], - ["nl", "Dutch"], - ["nl-AW", "Dutch", "Aruba"], - ["nl-BE", "Dutch", "Belgium"], - ["nl-BQ", "Dutch"], - ["nl-CW", "Dutch"], - ["nl-NL", "Dutch", "Netherlands"], - ["nl-SR", "Dutch", "Suriname"], - ["nl-SX", "Dutch"], - ["nn", "Norwegian Nynorsk"], - ["nn-NO", "Norwegian Nynorsk", "Norway"], - ["om", "Oromo"], - ["om-ET", "Oromo", "Ethiopia"], - ["om-KE", "Oromo", "Kenya"], - ["or", "Oriya"], - ["or-IN", "Oriya", "India"], - ["os", "Ossetian"], - ["os-GE", "Ossetian", "Georgia"], - ["os-RU", "Ossetian", "Russia"], - ["pa", "Panjabi"], - ["pa-IN", "Panjabi", "India"], - ["pa-PK", "Panjabi", "Pakistan"], - ["pl", "Polish"], - ["pl-PL", "Polish", "Poland"], - ["ps", "Pushto"], - ["ps-AF", "Pushto", "Afghanistan"], - ["pt", "Portuguese"], - ["pt-AO", "Portuguese", "Angola"], - ["pt-BR", "Portuguese", "Brazil"], - ["pt-CH", "Portuguese", "Switzerland"], - ["pt-CV", "Portuguese", "Cape Verde"], - ["pt-GQ", "Portuguese", "Equatorial Guinea"], - ["pt-GW", "Portuguese", "Guinea-Bissau"], - ["pt-LU", "Portuguese", "Luxembourg"], - ["pt-MO", "Portuguese", "Macau"], - ["pt-MZ", "Portuguese", "Mozambique"], - ["pt-PT", "Portuguese", "Portugal"], - ["pt-ST", "Portuguese", "Sao Tome and Principe"], - ["pt-TL", "Portuguese", "Timor-Leste (East Timor)"], - ["qu", "Quechua"], - ["qu-BO", "Quechua", "Bolivia"], - ["qu-EC", "Quechua", "Ecuador"], - ["qu-PE", "Quechua", "Peru"], - ["rm", "Romansh"], - ["rm-CH", "Romansh", "Switzerland"], - ["rn", "Rundi"], - ["rn-BI", "Rundi", "Burundi"], - ["ro", "Romanian"], - ["ro-MD", "Romanian", "Moldova"], - ["ro-RO", "Romanian", "Romania"], - ["ru", "Russian"], - ["ru-BY", "Russian", "Belarus"], - ["ru-KG", "Russian", "Kyrgyzstan"], - ["ru-KZ", "Russian", "Kazakhstan"], - ["ru-MD", "Russian", "Moldova"], - ["ru-RU", "Russian", "Russia"], - ["ru-UA", "Russian", "Ukraine"], - ["rw", "Kinyarwanda"], - ["rw-RW", "Kinyarwanda", "Rwanda"], - ["se", "Northern Sami"], - ["se-FI", "Northern Sami", "Finland"], - ["se-NO", "Northern Sami", "Norway"], - ["se-SE", "Northern Sami", "Sweden"], - ["sg", "Sango"], - ["sg-CF", "Sango", "Central African Republic"], - ["si", "Sinhala"], - ["si-LK", "Sinhala", "Sri Lanka"], - ["sk", "Slovak"], - ["sk-SK", "Slovak", "Slovakia"], - ["sl", "Slovenian"], - ["sl-SI", "Slovenian", "Slovenia"], - ["sn", "Shona"], - ["sn-ZW", "Shona", "Zimbabwe"], - ["so", "Somali"], - ["so-DJ", "Somali", "Djibouti"], - ["so-ET", "Somali", "Ethiopia"], - ["so-KE", "Somali", "Kenya"], - ["so-SO", "Somali", "Somalia"], - ["sq", "Albanian"], - ["sq-AL", "Albanian", "Albania"], - ["sq-MK", "Albanian", "Macedonia"], - ["sq-XK", "Albanian"], - ["sr", "Serbian"], - ["sr-BA", "Serbian", "Bosnia and Herzegovina"], - ["sr-ME", "Serbian", "Montenegro"], - ["sr-RS", "Serbian", "Serbia"], - ["sr-XK", "Serbian"], - ["sv", "Swedish"], - ["sv-AX", "Swedish", "Aland"], - ["sv-FI", "Swedish", "Finland"], - ["sv-SE", "Swedish", "Sweden"], - ["sw", "Swahili"], - ["sw-CD", "Swahili", "Congo"], - ["sw-KE", "Swahili", "Kenya"], - ["sw-TZ", "Swahili", "Tanzania"], - ["sw-UG", "Swahili", "Uganda"], - ["ta", "Tamil"], - ["ta-IN", "Tamil", "India"], - ["ta-LK", "Tamil", "Sri Lanka"], - ["ta-MY", "Tamil", "Malaysia"], - ["ta-SG", "Tamil", "Singapore"], - ["te", "Telugu"], - ["te-IN", "Telugu", "India"], - ["th", "Thai"], - ["th-TH", "Thai", "Thailand"], - ["ti", "Tigrinya"], - ["ti-ER", "Tigrinya", "Eritrea"], - ["ti-ET", "Tigrinya", "Ethiopia"], - ["tk", "Turkmen"], - ["tk-TM", "Turkmen", "Turkmenistan"], - ["to", "Tonga (Tonga Islands)"], - ["to-TO", "Tonga (Tonga Islands)", "Tonga"], - ["tr", "Turkish"], - ["tr-CY", "Turkish", "Cyprus"], - ["tr-TR", "Turkish", "Turkey"], - ["ug", "Uighur"], - ["ug-CN", "Uighur", "China"], - ["uk", "Ukrainian"], - ["uk-UA", "Ukrainian", "Ukraine"], - ["ur", "Urdu"], - ["ur-IN", "Urdu", "India"], - ["ur-PK", "Urdu", "Pakistan"], - ["uz", "Uzbek"], - ["uz-AF", "Uzbek", "Afghanistan"], - ["uz-UZ", "Uzbek", "Uzbekistan"], - ["vi", "Vietnamese"], - ["vi-VN", "Vietnamese", "Vietnam"], - ["vo", "Volap\xFCk"], - ["yi", "Yiddish"], - ["yi-1", "Yiddish"], - ["yo", "Yoruba"], - ["yo-BJ", "Yoruba", "Benin"], - ["yo-NG", "Yoruba", "Nigeria"], - ["zh", "Chinese"], - ["zh-CN", "Chinese", "China"], - ["zh-HK", "Chinese", "Hong Kong"], - ["zh-MO", "Chinese", "Macau"], - ["zh-SG", "Chinese", "Singapore"], - ["zh-TW", "Chinese", "China"], - ["zu", "Zulu"], - ["zu-ZA", "Zulu", "South Africa"] - ]; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/locale.js -var require_locale = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/locale.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseLocale = exports.lookupLocaleInfo = exports.isStandardLocale = exports.normalizeLocale = exports.Locale = void 0; - var knownLocales_js_1 = require_knownLocales(); - var codesByLocale; - var Locale = class { - constructor(locale) { - this._raw = locale; - this._locale = normalizeLocale(locale); + exports.isStaticPattern = isStaticPattern; + function isDynamicPattern(pattern, options = {}) { + if (pattern === "") { + return false; } - get locale() { - return this._locale; + if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; } - localInfo() { - return lookupLocaleInfo(this._locale); + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; } - isValid() { - return isStandardLocale(this._locale); + if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; } - toJSON() { - return this.locale; + if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { + return true; } - toString() { - return this.locale; - } - }; - exports.Locale = Locale; - var regExTwoLetter = /^[a-z]{2}$/i; - var regExLocaleWithCountry = /^([a-z]{2})[_-]?([a-z]{2,3})$/i; - var regExValidLocale = /^([a-z]{2})(?:-([A-Z]{2,3}))?$/; - function normalizeLocale(locale) { - locale = locale.trim(); - if (regExTwoLetter.test(locale)) - return locale.toLowerCase(); - const m = locale.match(regExLocaleWithCountry); - if (!m) - return locale; - const lang = m[1].toLowerCase(); - const variant = m[2].toUpperCase(); - return `${lang}-${variant}`; - } - exports.normalizeLocale = normalizeLocale; - function isStandardLocale(locale) { - return regExValidLocale.test(locale); + return false; } - exports.isStandardLocale = isStandardLocale; - function lookupLocaleInfo(locale) { - codesByLocale = codesByLocale || buildLocaleLookup(); - return codesByLocale.get(locale); + exports.isDynamicPattern = isDynamicPattern; + function hasBraceExpansion(pattern) { + const openingBraceIndex = pattern.indexOf("{"); + if (openingBraceIndex === -1) { + return false; + } + const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1); + if (closingBraceIndex === -1) { + return false; + } + const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); + return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); } - exports.lookupLocaleInfo = lookupLocaleInfo; - function buildLocaleLookup() { - const info3 = knownLocales_js_1.codes.map(([locale, language, country]) => ({ locale, language, country })); - return new Map(info3.map((i) => [i.locale, i])); + function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; } - function createLocale(locale) { - return new Locale(locale); + exports.convertToPositivePattern = convertToPositivePattern; + function convertToNegativePattern(pattern) { + return "!" + pattern; } - function parseLocale(locales) { - locales = typeof locales === "string" ? locales.split(",") : locales; - return locales.map(createLocale); + exports.convertToNegativePattern = convertToNegativePattern; + function isNegativePattern(pattern) { + return pattern.startsWith("!") && pattern[1] !== "("; } - exports.parseLocale = parseLocale; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/index.js -var require_locale2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseLocale = exports.Locale = void 0; - var locale_js_1 = require_locale(); - Object.defineProperty(exports, "Locale", { enumerable: true, get: function() { - return locale_js_1.Locale; - } }); - Object.defineProperty(exports, "parseLocale", { enumerable: true, get: function() { - return locale_js_1.parseLocale; - } }); - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/util.js -var require_util6 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isArrayEqual = exports.replaceAllFactory = exports.regexQuote = exports.replaceAll = exports.flatten = exports.unique = exports.clean = exports.cleanCopy = exports.isDefined = void 0; - function isDefined2(a) { - return a !== void 0; + exports.isNegativePattern = isNegativePattern; + function isPositivePattern(pattern) { + return !isNegativePattern(pattern); } - exports.isDefined = isDefined2; - function cleanCopy(t) { - const r = { ...t }; - return clean2(r); + exports.isPositivePattern = isPositivePattern; + function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); } - exports.cleanCopy = cleanCopy; - function clean2(t) { - for (const prop in t) { - if (t[prop] === void 0) { - delete t[prop]; - } - } - return t; + exports.getNegativePatterns = getNegativePatterns; + function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); } - exports.clean = clean2; - function unique(a) { - return [...new Set(a)]; + exports.getPositivePatterns = getPositivePatterns; + function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); } - exports.unique = unique; - function* flatten(i) { - for (const v of i) { - yield* v; - } + exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; + function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); } - exports.flatten = flatten; - function replaceAll(text, match, withText) { - const fn = replaceAllFactory(match, withText); - return fn(text); + exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; + function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith("..") || pattern.startsWith("./.."); } - exports.replaceAll = replaceAll; - function regexQuote(text) { - return text.replace(/([[\]\-+(){},|*.\\])/g, "\\$1"); + exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; + function getBaseDirectory(pattern) { + return globParent(pattern, { flipBackslashes: false }); } - exports.regexQuote = regexQuote; - function replaceAllFactory(match, replaceWithText) { - const r = RegExp(regexQuote(match), "g"); - return (text) => text.replace(r, replaceWithText); + exports.getBaseDirectory = getBaseDirectory; + function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR); } - exports.replaceAllFactory = replaceAllFactory; - function isArrayEqual(a, b) { - if (a === b) - return true; - let isMatch = a.length === b.length; - const len = a.length; - for (let i = 0; isMatch && i < len; ++i) { - isMatch = a[i] === b[i]; - } - return isMatch; + exports.hasGlobStar = hasGlobStar; + function endsWithSlashGlobStar(pattern) { + return pattern.endsWith("/" + GLOBSTAR); } - exports.isArrayEqual = isArrayEqual; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapCosts.js -var require_mapCosts = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapCosts.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mapEditCosts = exports.mapHunspellCosts = void 0; - var util_js_1 = require_util6(); - var defaultEditCosts = { - accentCosts: 1, - baseCost: 100, - capsCosts: 1, - firstLetterPenalty: 4, - nonAlphabetCosts: 110 - }; - var defaultHunspellCosts = { - ...defaultEditCosts, - ioConvertCost: 30, - keyboardCost: 99, - mapCost: 25, - replaceCosts: 75, - tryCharCost: 100 - }; - function mapHunspellCosts(costs = {}) { - return { ...defaultHunspellCosts, ...(0, util_js_1.cleanCopy)(costs) }; + exports.endsWithSlashGlobStar = endsWithSlashGlobStar; + function isAffectDepthOfReadingPattern(pattern) { + const basename7 = path26.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename7); } - exports.mapHunspellCosts = mapHunspellCosts; - function mapEditCosts(costs = {}) { - return { ...defaultEditCosts, ...(0, util_js_1.cleanCopy)(costs) }; + exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; + function expandPatternsWithBraceExpansion(patterns) { + return patterns.reduce((collection, pattern) => { + return collection.concat(expandBraceExpansion(pattern)); + }, []); } - exports.mapEditCosts = mapEditCosts; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/text.js -var require_text = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/text.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.stripNonAccents = exports.stripAccents = exports.accentForms = exports.caseForms = exports.expandRange = exports.expandCharacterSet = void 0; - function expandCharacterSet(line, rangeChar = "-") { - const charSet = /* @__PURE__ */ new Set(); - let mode = 0; - let prev = ""; - for (const char of line) { - if (mode) { - expandRange(prev, char).forEach((a) => charSet.add(a)); - mode = 0; - } - if (char === rangeChar) { - if (prev) { - mode = 1; - continue; - } - } - charSet.add(char); - prev = char; - } - if (mode) - charSet.add(rangeChar); - return charSet; + exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; + function expandBraceExpansion(pattern) { + const patterns = micromatch.braces(pattern, { expand: true, nodupes: true }); + patterns.sort((a, b) => a.length - b.length); + return patterns.filter((pattern2) => pattern2 !== ""); } - exports.expandCharacterSet = expandCharacterSet; - function expandRange(a, b) { - const values = []; - const end = b.codePointAt(0); - const begin = a.codePointAt(0); - if (!(begin && end)) - return values; - for (let i = begin; i <= end; ++i) { - values.push(String.fromCodePoint(i)); + exports.expandBraceExpansion = expandBraceExpansion; + function getPatternParts(pattern, options) { + let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); + if (parts.length === 0) { + parts = [pattern]; } - return values; - } - exports.expandRange = expandRange; - function caseForms(letter, locale) { - const forms = /* @__PURE__ */ new Set([letter]); - function tryCases(s) { - forms.add(s.toLocaleLowerCase(locale)); - forms.add(s.toLocaleUpperCase(locale)); + if (parts[0].startsWith("/")) { + parts[0] = parts[0].slice(1); + parts.unshift(""); } - tryCases(letter); - [...forms].forEach(tryCases); - return [...forms].filter((a) => !!a); + return parts; } - exports.caseForms = caseForms; - function accentForms(letter) { - const forms = /* @__PURE__ */ new Set([letter, letter.normalize("NFC"), letter.normalize("NFD")]); - return forms; + exports.getPatternParts = getPatternParts; + function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); } - exports.accentForms = accentForms; - function stripAccents(characters) { - return characters.normalize("NFD").replace(/\p{M}/gu, ""); + exports.makeRe = makeRe; + function convertPatternsToRe(patterns, options) { + return patterns.map((pattern) => makeRe(pattern, options)); } - exports.stripAccents = stripAccents; - function stripNonAccents(characters) { - return characters.normalize("NFD").replace(/[^\p{M}]/gu, ""); + exports.convertPatternsToRe = convertPatternsToRe; + function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); } - exports.stripNonAccents = stripNonAccents; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/joinLetters.js -var require_joinLetters = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/joinLetters.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.joinLetters = void 0; - function joinLetters(letters) { - const v = [...letters]; - return v.map((a) => a.length > 1 || !a.length ? `(${a})` : a).join(""); + exports.matchAny = matchAny; + function removeDuplicateSlashes(pattern) { + return pattern.replace(DOUBLE_SLASH_RE, "/"); } - exports.joinLetters = joinLetters; + exports.removeDuplicateSlashes = removeDuplicateSlashes; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapToSuggestionCostDef.js -var require_mapToSuggestionCostDef = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapToSuggestionCostDef.js"(exports) { +// node_modules/merge2/index.js +var require_merge2 = __commonJS({ + "node_modules/merge2/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.splitMap = exports.calcCostsForAccentedLetters = exports.parseAccents = exports.calcFirstCharacterReplace = exports.calcFirstCharacterReplaceDefs = exports.parseAlphabetCaps = exports.parseAlphabet = void 0; - var sync_1 = require_sync(); - var text_js_1 = require_text(); - var util_js_1 = require_util6(); - var joinLetters_js_1 = require_joinLetters(); - function parseAlphabet(cs, locale, editCost) { - const { cost, penalty } = cs; - const characters = (0, text_js_1.expandCharacterSet)(cs.characters); - const charForms = [ - ...(0, sync_1.pipe)(characters, (0, sync_1.opMap)((c) => (0, text_js_1.caseForms)(c, locale).sort())) - ]; - const alphabet = (0, joinLetters_js_1.joinLetters)([ - ...(0, sync_1.pipe)(charForms, (0, sync_1.opFlatten)(), (0, sync_1.opMap)((letter) => (0, text_js_1.accentForms)(letter)), (0, sync_1.opFlatten)(), (0, sync_1.opUnique)()) - ].sort()); - const sugAlpha = (0, util_js_1.clean)({ - map: alphabet, - replace: cost, - insDel: cost, - swap: cost, - penalty - }); - return [ - sugAlpha, - parseAlphabetCaps(cs.characters, locale, editCost), - ...calcCostsForAccentedLetters(alphabet, locale, editCost) - ]; - } - exports.parseAlphabet = parseAlphabet; - function parseAlphabetCaps(alphabet, locale, editCost) { - const characters = (0, text_js_1.expandCharacterSet)(alphabet); - const charForms = [ - ...(0, sync_1.pipe)(characters, (0, sync_1.opMap)((c) => (0, text_js_1.caseForms)(c, locale).sort())) - ]; - const caps = charForms.map((a) => (0, joinLetters_js_1.joinLetters)(a)).join("|"); - const sugCaps = { - map: caps, - replace: editCost.capsCosts - }; - return sugCaps; - } - exports.parseAlphabetCaps = parseAlphabetCaps; - function calcFirstCharacterReplaceDefs(alphabets, editCost) { - return alphabets.map((cs) => calcFirstCharacterReplace(cs, editCost)); - } - exports.calcFirstCharacterReplaceDefs = calcFirstCharacterReplaceDefs; - function calcFirstCharacterReplace(cs, editCost) { - const mapOfFirstLetters = [ - ...(0, sync_1.pipe)((0, text_js_1.expandCharacterSet)(cs.characters), (0, sync_1.opUnique)(), (0, sync_1.opMap)((letter) => `(^${letter})`)) - ].sort().join("") + "(^)"; - const penalty = editCost.firstLetterPenalty; - const cost = cs.cost - penalty; - return { - map: mapOfFirstLetters, - replace: cost, - penalty: penalty * 2 - }; - } - exports.calcFirstCharacterReplace = calcFirstCharacterReplace; - function parseAccents(cs, _editCost) { - const { cost, penalty } = cs; - const accents = (0, joinLetters_js_1.joinLetters)([ - ...(0, sync_1.pipe)((0, text_js_1.expandCharacterSet)(cs.characters), (0, sync_1.opMap)((char) => (0, text_js_1.stripNonAccents)(char))) - ]); - if (!accents) - return void 0; - return (0, util_js_1.clean)({ - map: accents, - replace: cost, - insDel: cost, - penalty - }); - } - exports.parseAccents = parseAccents; - function calcCostsForAccentedLetters(simpleMap, locale, costs) { - const charactersWithAccents = [ - ...(0, sync_1.pipe)(splitMap(simpleMap), (0, sync_1.opMap)((char) => (0, text_js_1.caseForms)(char, locale)), (0, sync_1.opFlatten)(), (0, sync_1.opMap)((char) => [...(0, text_js_1.accentForms)(char)]), (0, sync_1.opFilter)((forms) => forms.length > 1)) - ]; - const characters = (0, sync_1.pipe)(charactersWithAccents, (0, sync_1.opMap)((forms) => /* @__PURE__ */ new Set([...forms, ...forms.map((char) => (0, text_js_1.stripAccents)(char))])), (0, sync_1.opMap)((forms) => [...forms].sort()), (0, sync_1.opFilter)((forms) => forms.length > 1), (0, sync_1.opMap)(joinLetters_js_1.joinLetters), (0, sync_1.opUnique)()); - const replaceAccentMap = [...characters].join("|"); - const cost = costs.accentCosts; - const costToReplaceAccent = !replaceAccentMap ? [] : [{ map: replaceAccentMap, replace: cost }]; - const normalizeMap = charactersWithAccents.map((a) => a.sort()).map(joinLetters_js_1.joinLetters).join("|"); - const costToNormalizeAccent = !normalizeMap ? [] : [{ map: normalizeMap, replace: 0 }]; - return [...costToReplaceAccent, ...costToNormalizeAccent]; - } - exports.calcCostsForAccentedLetters = calcCostsForAccentedLetters; - function* splitMap(map) { - let seq = ""; - let mode = 0; - for (const char of map) { - if (mode && char === ")") { - yield seq; - mode = 0; - continue; + var Stream3 = require("stream"); + var PassThrough2 = Stream3.PassThrough; + var slice = Array.prototype.slice; + module2.exports = merge22; + function merge22() { + const streamsQueue = []; + const args = slice.call(arguments); + let merging = false; + let options = args[args.length - 1]; + if (options && !Array.isArray(options) && options.pipe == null) { + args.pop(); + } else { + options = {}; + } + const doEnd = options.end !== false; + const doPipeError = options.pipeError === true; + if (options.objectMode == null) { + options.objectMode = true; + } + if (options.highWaterMark == null) { + options.highWaterMark = 64 * 1024; + } + const mergedStream = PassThrough2(options); + function addStream() { + for (let i = 0, len = arguments.length; i < len; i++) { + streamsQueue.push(pauseStreams(arguments[i], options)); } - if (mode) { - seq += char; - continue; + mergeStream(); + return this; + } + function mergeStream() { + if (merging) { + return; } - if (char === "(") { - mode = 1; - seq = ""; - continue; + merging = true; + let streams = streamsQueue.shift(); + if (!streams) { + process.nextTick(endStream); + return; + } + if (!Array.isArray(streams)) { + streams = [streams]; + } + let pipesCount = streams.length + 1; + function next() { + if (--pipesCount > 0) { + return; + } + merging = false; + mergeStream(); + } + function pipe2(stream) { + function onend() { + stream.removeListener("merge2UnpipeEnd", onend); + stream.removeListener("end", onend); + if (doPipeError) { + stream.removeListener("error", onerror); + } + next(); + } + function onerror(err) { + mergedStream.emit("error", err); + } + if (stream._readableState.endEmitted) { + return next(); + } + stream.on("merge2UnpipeEnd", onend); + stream.on("end", onend); + if (doPipeError) { + stream.on("error", onerror); + } + stream.pipe(mergedStream, { end: false }); + stream.resume(); + } + for (let i = 0; i < streams.length; i++) { + pipe2(streams[i]); } - yield char; + next(); } - } - exports.splitMap = splitMap; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapHunspellInformation.js -var require_mapHunspellInformation = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapHunspellInformation.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.hunspellInformationToSuggestionCostDef = void 0; - var sync_1 = require_sync(); - var text_js_1 = require_text(); - var util_js_1 = require_util6(); - var joinLetters_js_1 = require_joinLetters(); - var mapCosts_js_1 = require_mapCosts(); - var mapToSuggestionCostDef_js_1 = require_mapToSuggestionCostDef(); - function hunspellInformationToSuggestionCostDef(hunInfo, locales) { - const costs = calcCosts(hunInfo.costs, locales); - const operations = [ - affKey, - affKeyCaps, - affMap, - affMapAccents, - affMapCaps, - affNoTry, - affRepConv, - affTry, - affTryAccents, - affTryFirstCharacterReplace - ]; - function parseAff(aff, costs2) { - const regSupportedAff = /^(?:MAP|KEY|TRY|NO-TRY|ICONV|OCONV|REP)\s/; - const rejectAff = /^(?:MAP|KEY|TRY|ICONV|OCONV|REP)\s+\d+$/; - const lines = aff.split("\n").map((a) => a.replace(/#.*/, "")).map((a) => a.trim()).filter((a) => regSupportedAff.test(a)).filter((a) => !rejectAff.test(a)); - const defs = (0, sync_1.pipe)(lines, (0, sync_1.opMap)((line) => (0, sync_1.pipe)(operations, (0, sync_1.opMap)((fn) => fn(line, costs2)), (0, sync_1.opMap)(asArrayOf), (0, sync_1.opFlatten)())), (0, sync_1.opFlatten)(), (0, sync_1.opFilter)(util_js_1.isDefined)); - return [...defs]; - } - return parseAff(hunInfo.aff, costs); - } - exports.hunspellInformationToSuggestionCostDef = hunspellInformationToSuggestionCostDef; - function calcCosts(costs = {}, locale) { - const useLocale = locale?.length ? locale.map((loc) => loc.locale) : void 0; - const hunCosts = (0, mapCosts_js_1.mapHunspellCosts)(costs); - const c = { - ...hunCosts, - locale: useLocale - }; - return c; - } - var regExpMap = /^(?:MAP)\s+(\S+)$/; - function affMap(line, costs) { - const m = line.match(regExpMap); - if (!m) - return void 0; - const map = m[1]; - const cost = costs.mapCost; - return { - map, - replace: cost, - swap: cost - }; - } - var regExpTry = /^(?:TRY)\s+(\S+)$/; - function affTry(line, costs) { - const m = line.match(regExpTry); - if (!m) - return void 0; - const cost = costs.tryCharCost; - const tryChars = m[1]; - const characters = tryChars; - return (0, mapToSuggestionCostDef_js_1.parseAlphabet)({ - characters, - cost - }, costs.locale, costs); - } - function affTryFirstCharacterReplace(line, costs) { - const m = line.match(regExpTry); - if (!m) - return void 0; - const characters = m[1]; - const cost = costs.tryCharCost; - return (0, mapToSuggestionCostDef_js_1.calcFirstCharacterReplace)({ - characters, - cost - }, costs); - } - var regExpNoTry = /^NO-TRY\s+(\S+)$/; - function affNoTry(line, costs) { - const m = line.match(regExpNoTry); - if (!m) - return void 0; - const map = m[1]; - return { - map, - insDel: Math.max(costs.nonAlphabetCosts - costs.tryCharCost, 0), - penalty: costs.nonAlphabetCosts + costs.tryCharCost - }; - } - var regExpRepConv = /^(?:REP|(?:I|O)CONV)\s+(\S+)\s+(\S+)$/; - function affRepConv(line, costs) { - const m = line.match(regExpRepConv); - if (!m) - return void 0; - const cost = line.startsWith("REP") ? costs.replaceCosts : costs.ioConvertCost; - const from = m[1]; - let into = m[2]; - into = into.replace(/^0$/, ""); - if (from.startsWith("^") && !into.startsWith("^")) { - into = "^" + into; + function endStream() { + merging = false; + mergedStream.emit("queueDrain"); + if (doEnd) { + mergedStream.end(); + } } - if (from.endsWith("$") && !into.endsWith("$")) { - into = into + "$"; + mergedStream.setMaxListeners(0); + mergedStream.add = addStream; + mergedStream.on("unpipe", function(stream) { + stream.emit("merge2UnpipeEnd"); + }); + if (args.length) { + addStream.apply(null, args); } - return { - map: (0, joinLetters_js_1.joinLetters)([from, into]), - replace: cost - }; - } - var regExpKey = /^(?:KEY)\s+(\S+)$/; - function affKey(line, costs) { - const m = line.match(regExpKey); - if (!m) - return void 0; - const kbd = m[1]; - const pairs = [...(0, mapToSuggestionCostDef_js_1.splitMap)(kbd)].map(reducer((p, v) => ({ a: p.b, b: v }), { a: "|", b: "|" })).filter((ab) => ab.a !== "|" && ab.b !== "|").map(({ a, b }) => (0, joinLetters_js_1.joinLetters)([a, b])); - const pairsUpper = pairs.map((p) => p.toLocaleUpperCase(costs.locale)); - const map = (0, util_js_1.unique)(pairs.concat(pairsUpper)).join("|"); - const cost = costs.keyboardCost; - return { - map, - replace: cost, - swap: cost - }; - } - function affKeyCaps(line, costs) { - const m = line.match(regExpKey); - if (!m) - return void 0; - return parseCaps(m[1], costs); - } - function affMapCaps(line, costs) { - const m = line.match(regExpMap); - if (!m) - return void 0; - return parseCaps(m[1], costs); - } - function affTryAccents(line, costs) { - const m = line.match(regExpTry); - if (!m) - return void 0; - return (0, mapToSuggestionCostDef_js_1.calcCostsForAccentedLetters)(m[1], costs.locale, costs); - } - function affMapAccents(line, costs) { - const m = line.match(regExpMap); - if (!m) - return void 0; - return (0, mapToSuggestionCostDef_js_1.calcCostsForAccentedLetters)(m[1], costs.locale, costs); - } - function parseCaps(value, costs) { - const locale = costs.locale; - const letters = [...(0, mapToSuggestionCostDef_js_1.splitMap)(value)].filter((a) => a !== "|"); - const withCases = letters.map((s) => (0, text_js_1.caseForms)(s, locale)).filter((forms) => forms.length > 1).map(joinLetters_js_1.joinLetters); - const map = (0, util_js_1.unique)(withCases).join("|"); - const cost = costs.capsCosts; - if (!map) - return void 0; - return { - map, - replace: cost - }; - } - function reducer(fn, initialVal) { - let acc = initialVal; - return (val, i) => acc = fn(acc, val, i); + return mergedStream; } - function asArrayOf(v) { - return Array.isArray(v) ? v : [v]; + function pauseStreams(streams, options) { + if (!Array.isArray(streams)) { + if (!streams._readableState && streams.pipe) { + streams = streams.pipe(PassThrough2(options)); + } + if (!streams._readableState || !streams.pause || !streams.pipe) { + throw new Error("Only readable stream can be merged."); + } + streams.pause(); + } else { + for (let i = 0, len = streams.length; i < len; i++) { + streams[i] = pauseStreams(streams[i], options); + } + } + return streams; } - exports.__testing__ = { - affKey, - affKeyCaps, - affMap, - affMapAccents, - affMapCaps, - affNoTry, - affRepConv, - affTry, - affTryAccents, - affTryFirstCharacterReplace, - calcCosts, - split: mapToSuggestionCostDef_js_1.splitMap - }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapDictionaryInfo.js -var require_mapDictionaryInfo = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapDictionaryInfo.js"(exports) { +// node_modules/fast-glob/out/utils/stream.js +var require_stream = __commonJS({ + "node_modules/fast-glob/out/utils/stream.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.mapDictionaryInformationToAdjustment = exports.mapDictionaryInformation = void 0; - var sync_1 = require_sync(); - var index_js_1 = require_locale2(); - var util_js_1 = require_util6(); - var mapCosts_js_1 = require_mapCosts(); - var mapHunspellInformation_js_1 = require_mapHunspellInformation(); - var mapToSuggestionCostDef_js_1 = require_mapToSuggestionCostDef(); - function mapDictionaryInformation(dictInfo) { - const _locale = dictInfo.locale; - const locale = _locale ? (0, index_js_1.parseLocale)(_locale).filter((loc) => loc.isValid()) : void 0; - const locales = locale?.map((loc) => loc.locale); - const costs = (0, mapCosts_js_1.mapEditCosts)(dictInfo.costs); - const defsEC = dictInfo.suggestionEditCosts || []; - const defsHI = dictInfo.hunspellInformation ? (0, mapHunspellInformation_js_1.hunspellInformationToSuggestionCostDef)(dictInfo.hunspellInformation, locale) : []; - return [ - ...defsEC, - ...processAlphabet(dictInfo.alphabet, locales, costs), - ...processAccents(dictInfo.accents, costs), - ...defsHI - ]; - } - exports.mapDictionaryInformation = mapDictionaryInformation; - function processAlphabet(alphabet, locale, editCost) { - const csAlphabet = toCharSets(alphabet, "a-zA-Z", editCost.baseCost); - return [ - ...(0, sync_1.pipeSync)(csAlphabet, (0, sync_1.opMap)((cs) => (0, mapToSuggestionCostDef_js_1.parseAlphabet)(cs, locale, editCost)), (0, sync_1.opFlatten)()), - ...(0, mapToSuggestionCostDef_js_1.calcFirstCharacterReplaceDefs)(csAlphabet, editCost) - ]; - } - function toCharSets(cs, defaultValue, cost, penalty) { - cs = cs ?? defaultValue; - if (!cs) - return []; - if (typeof cs === "string") { - cs = [ - { - characters: cs, - cost - } - ]; - } - if (penalty !== void 0) { - cs.forEach((cs2) => cs2.penalty = penalty); - } - return cs; - } - function processAccents(accents, editCost) { - const cs = toCharSets(accents, "\u0300-\u0341", editCost.accentCosts); - return cs.map((cs2) => (0, mapToSuggestionCostDef_js_1.parseAccents)(cs2, editCost)).filter(util_js_1.isDefined); - } - function mapDictionaryInformationToAdjustment(dictInfo) { - if (!dictInfo.adjustments) - return []; - return dictInfo.adjustments.map(mapAdjustment); + exports.merge = void 0; + var merge22 = require_merge2(); + function merge4(streams) { + const mergedStream = merge22(streams); + streams.forEach((stream) => { + stream.once("error", (error2) => mergedStream.emit("error", error2)); + }); + mergedStream.once("close", () => propagateCloseEventToSources(streams)); + mergedStream.once("end", () => propagateCloseEventToSources(streams)); + return mergedStream; } - exports.mapDictionaryInformationToAdjustment = mapDictionaryInformationToAdjustment; - function mapAdjustment(adj) { - const { id, regexp, penalty } = adj; - return { - id, - regexp: new RegExp(regexp), - penalty - }; + exports.merge = merge4; + function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit("close")); } } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapDictionaryInfoToWeightMap.js -var require_mapDictionaryInfoToWeightMap = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapDictionaryInfoToWeightMap.js"(exports) { +// node_modules/fast-glob/out/utils/string.js +var require_string = __commonJS({ + "node_modules/fast-glob/out/utils/string.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.mapDictionaryInformationToWeightMap = void 0; - var weightedMaps_js_1 = require_weightedMaps(); - var mapDictionaryInfo_js_1 = require_mapDictionaryInfo(); - var defaultDefs = [ - { - map: "1234567890-.", - insDel: 1, - penalty: 200 - } - ]; - var defaultAdjustments = [ - { - id: "compound-case-change", - regexp: /\p{Ll}∙\p{Lu}/gu, - penalty: 1e3 - }, - { - id: "short-compounds-1", - regexp: /^[^∙]{0,2}(?=∙)|∙[^∙]{0,2}(?=∙|$)/gm, - penalty: 100 - }, - { - id: "short-compounds-3", - regexp: /^[^∙]{3}(?=∙)|∙[^∙]{3}(?=∙|$)/gm, - penalty: 50 - } - ]; - function mapDictionaryInformationToWeightMap(dictInfo) { - const defs = (0, mapDictionaryInfo_js_1.mapDictionaryInformation)(dictInfo).concat(defaultDefs); - const adjustments = (0, mapDictionaryInfo_js_1.mapDictionaryInformationToAdjustment)(dictInfo); - const map = (0, weightedMaps_js_1.createWeightMap)(...defs); - (0, weightedMaps_js_1.addAdjustment)(map, ...defaultAdjustments, ...adjustments); - return map; + exports.isEmpty = exports.isString = void 0; + function isString3(input) { + return typeof input === "string"; + } + exports.isString = isString3; + function isEmpty2(input) { + return input === ""; } - exports.mapDictionaryInformationToWeightMap = mapDictionaryInformationToWeightMap; - exports.__testing__ = {}; + exports.isEmpty = isEmpty2; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/memorizeLastCall.js -var require_memorizeLastCall = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/memorizeLastCall.js"(exports) { +// node_modules/fast-glob/out/utils/index.js +var require_utils7 = __commonJS({ + "node_modules/fast-glob/out/utils/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.memorizeLastCall = void 0; - var SymEmpty = Symbol("memorizeLastCall"); - function memorizeLastCall(fn) { - let lastP = void 0; - let lastR = SymEmpty; - function calc(p) { - if (lastR !== SymEmpty && lastP === p) - return lastR; - lastP = p; - lastR = fn(p); - return lastR; - } - return calc; - } - exports.memorizeLastCall = memorizeLastCall; + exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; + var array = require_array2(); + exports.array = array; + var errno = require_errno(); + exports.errno = errno; + var fs9 = require_fs(); + exports.fs = fs9; + var path26 = require_path(); + exports.path = path26; + var pattern = require_pattern(); + exports.pattern = pattern; + var stream = require_stream(); + exports.stream = stream; + var string = require_string(); + exports.string = string; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/find.js -var require_find = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/find.js"(exports) { +// node_modules/fast-glob/out/managers/tasks.js +var require_tasks = __commonJS({ + "node_modules/fast-glob/out/managers/tasks.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.createFindOptions = exports.isForbiddenWord = exports.isEndOfWordNode = exports.findWordExact = exports.findCompoundNode = exports.findLegacyCompound = exports.findWordNode = exports.findWord = void 0; - var constants_js_1 = require_constants4(); - var TrieNode_js_1 = require_TrieNode(); - var memorizeLastCall_js_1 = require_memorizeLastCall(); - var mergeDefaults_js_1 = require_mergeDefaults(); - var defaultLegacyMinCompoundLength = 3; - var _defaultFindOptions = { - matchCase: false, - compoundMode: "compound", - forbidPrefix: constants_js_1.FORBID_PREFIX, - compoundFix: constants_js_1.COMPOUND_FIX, - caseInsensitivePrefix: constants_js_1.CASE_INSENSITIVE_PREFIX, - legacyMinCompoundLength: defaultLegacyMinCompoundLength - }; - var arrayCompoundModes = ["none", "compound", "legacy"]; - var knownCompoundModes = new Map(arrayCompoundModes.map((a) => [a, a])); - function findWord(root, word, options) { - return _findWord(root, word, (0, exports.createFindOptions)(options)); - } - exports.findWord = findWord; - function findWordNode(root, word, options) { - return _findWordNode(root, word, (0, exports.createFindOptions)(options)); - } - exports.findWordNode = findWordNode; - function _findWord(root, word, options) { - const { node: _, ...result } = _findWordNode(root, word, options); - return result; - } - function _findWordNode(root, word, options) { - const compoundMode = knownCompoundModes.get(options.compoundMode) || _defaultFindOptions.compoundMode; - const compoundPrefix = options.compoundMode === "compound" ? root.compoundCharacter ?? options.compoundFix : ""; - const ignoreCasePrefix = options.matchCase ? "" : root.stripCaseAndAccentsPrefix ?? options.caseInsensitivePrefix; - function __findCompound() { - const f = findCompoundWord(root, word, compoundPrefix, ignoreCasePrefix); - const result = { ...f }; - if (f.found !== false && f.compoundUsed) { - const r = !f.caseMatched ? walk(root, options.caseInsensitivePrefix) : root; - result.forbidden = isForbiddenWord(r, word, options.forbidPrefix); - } - return result; - } - function __findExact() { - const n = walk(root, word); - const isFound = isEndOfWordNode(n); - const result = { - found: isFound && word, - compoundUsed: false, - forbidden: isForbiddenWord(root, word, options.forbidPrefix), - node: n, - caseMatched: true - }; - return result; + exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; + var utils = require_utils7(); + function generate(input, settings) { + const patterns = processPatterns(input, settings); + const ignore = processPatterns(settings.ignore, settings); + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks( + staticPatterns, + negativePatterns, + /* dynamic */ + false + ); + const dynamicTasks = convertPatternsToTasks( + dynamicPatterns, + negativePatterns, + /* dynamic */ + true + ); + return staticTasks.concat(dynamicTasks); + } + exports.generate = generate; + function processPatterns(input, settings) { + let patterns = input; + if (settings.braceExpansion) { + patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); } - switch (compoundMode) { - case "none": - return options.matchCase ? __findExact() : __findCompound(); - case "compound": - return __findCompound(); - case "legacy": - return findLegacyCompound(root, word, options); + if (settings.baseNameMatch) { + patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`); } + return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); } - function findLegacyCompound(root, word, options) { - const roots = [root]; - if (!options.matchCase) { - roots.push(walk(root, options.caseInsensitivePrefix)); + function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + if ("." in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic)); + } else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); } - return findLegacyCompoundNode(roots, word, options.legacyMinCompoundLength); + return tasks; } - exports.findLegacyCompound = findLegacyCompound; - function findCompoundNode(root, word, compoundCharacter, ignoreCasePrefix) { - const stack = [ - // { n: root, compoundPrefix: '', cr: undefined, caseMatched: true }, - { n: root, compoundPrefix: ignoreCasePrefix, cr: void 0, caseMatched: true } - ]; - const compoundPrefix = compoundCharacter || ignoreCasePrefix; - const possibleCompoundPrefix = ignoreCasePrefix && compoundCharacter ? ignoreCasePrefix + compoundCharacter : ""; - const w = word.normalize(); - function determineRoot(s) { - const prefix = s.compoundPrefix; - let r = root; - let i2; - for (i2 = 0; i2 < prefix.length && r; ++i2) { - r = r.c?.get(prefix[i2]); - } - const caseMatched2 = s.caseMatched && prefix[0] !== ignoreCasePrefix; - return { - n: s.n, - compoundPrefix: prefix === compoundPrefix ? possibleCompoundPrefix : "", - cr: r, - caseMatched: caseMatched2 - }; - } - let compoundUsed = false; - let caseMatched = true; - let i = 0; - let node; - while (true) { - const s = stack[i]; - const h = w[i++]; - const n = s.cr || s.n; - const c = n?.c?.get(h); - if (c && i < word.length) { - caseMatched = s.caseMatched; - stack[i] = { n: c, compoundPrefix, cr: void 0, caseMatched }; - } else if (!c || !c.f) { - node = node || c; - while (--i > 0 && (!stack[i].compoundPrefix || !stack[i].n?.c?.has(compoundCharacter))) { - } - if (i >= 0 && stack[i].compoundPrefix) { - compoundUsed = i > 0; - const r = determineRoot(stack[i]); - stack[i] = r; - if (!r.cr) { - break; - } - if (!i && !r.caseMatched) { - if (w !== w.toLowerCase()) { - break; - } - } - } else { - break; - } - } else { - node = c; - caseMatched = s.caseMatched; - break; - } - } - const found = i && i === word.length && word || false; - const result = { found, compoundUsed, node, forbidden: void 0, caseMatched }; - return result; + exports.convertPatternsToTasks = convertPatternsToTasks; + function getPositivePatterns(patterns) { + return utils.pattern.getPositivePatterns(patterns); } - exports.findCompoundNode = findCompoundNode; - function findCompoundWord(root, word, compoundCharacter, ignoreCasePrefix) { - const { found, compoundUsed, node, caseMatched } = findCompoundNode(root, word, compoundCharacter, ignoreCasePrefix); - if (!node || !node.f) { - return { found: false, compoundUsed, node, forbidden: void 0, caseMatched }; - } - return { found, compoundUsed, node, forbidden: void 0, caseMatched }; + exports.getPositivePatterns = getPositivePatterns; + function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils.pattern.convertToPositivePattern); + return positive; } - function findWordExact(root, word) { - return isEndOfWordNode(walk(root, word)); + exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; + function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } else { + collection[base] = [pattern]; + } + return collection; + }, group); } - exports.findWordExact = findWordExact; - function isEndOfWordNode(n) { - return n?.f === TrieNode_js_1.FLAG_WORD; + exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; + function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); } - exports.isEndOfWordNode = isEndOfWordNode; - function walk(root, word) { - const w = word; - let n = root; - let i = 0; - while (n && i < word.length) { - const h = w[i++]; - n = n.c?.get(h); - } - return n; + exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; + function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) + }; } - function findLegacyCompoundNode(roots, word, minCompoundLength) { - const root = roots[0]; - const numRoots = roots.length; - const stack = [ - { n: root, usedRoots: 1, subLength: 0, isCompound: false, cr: void 0, caseMatched: true } - ]; - const w = word; - const wLen = w.length; - let compoundUsed = false; - let caseMatched = true; - let i = 0; - let node; - while (true) { - const s = stack[i]; - const h = w[i++]; - const n = s.cr || s.n; - const c = n?.c?.get(h); - if (c && i < wLen) { - stack[i] = { - n: c, - usedRoots: 0, - subLength: s.subLength + 1, - isCompound: s.isCompound, - cr: void 0, - caseMatched: s.caseMatched - }; - } else if (!c || !c.f || c.f && s.subLength < minCompoundLength - 1) { - while (--i > 0) { - const s2 = stack[i]; - if (s2.usedRoots < numRoots && s2.n?.f && (s2.subLength >= minCompoundLength || !s2.subLength) && wLen - i >= minCompoundLength) { - break; + exports.convertPatternGroupToTask = convertPatternGroupToTask; + } +}); + +// node_modules/@nodelib/fs.stat/out/providers/async.js +var require_async = __commonJS({ + "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.read = void 0; + function read2(path26, settings, callback) { + settings.fs.lstat(path26, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); + return; + } + settings.fs.stat(path26, (statError, stat2) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; } + callSuccessCallback(callback, lstat); + return; } - if (i > 0 || stack[i].usedRoots < numRoots) { - compoundUsed = i > 0; - const s2 = stack[i]; - s2.cr = roots[s2.usedRoots++]; - s2.subLength = 0; - s2.isCompound = compoundUsed; - s2.caseMatched = s2.caseMatched && s2.usedRoots <= 1; - } else { - break; - } - } else { - node = c; - caseMatched = s.caseMatched; - break; - } - } - function extractWord() { - if (!word || i < word.length) - return false; - const letters = []; - let subLen = 0; - for (let j = 0; j < i; ++j) { - const { subLength } = stack[j]; - if (subLength < subLen) { - letters.push("+"); + if (settings.markSymbolicLink) { + stat2.isSymbolicLink = () => true; } - letters.push(word[j]); - subLen = subLength; - } - return letters.join(""); - } - const found = extractWord(); - const result = { found, compoundUsed, node, forbidden: void 0, caseMatched }; - return result; - } - function findLegacyCompoundWord(roots, word, minCompoundLength) { - const { found, compoundUsed, caseMatched } = findLegacyCompoundNode(roots, word, minCompoundLength); - return { found, compoundUsed, caseMatched }; + callSuccessCallback(callback, stat2); + }); + }); } - function isForbiddenWord(root, word, forbiddenPrefix) { - return findWordExact(root?.c?.get(forbiddenPrefix), word); + exports.read = read2; + function callFailureCallback(callback, error2) { + callback(error2); } - exports.isForbiddenWord = isForbiddenWord; - exports.createFindOptions = (0, memorizeLastCall_js_1.memorizeLastCall)(_createFindOptions); - function _createFindOptions(options) { - return (0, mergeDefaults_js_1.mergeDefaults)(options, _defaultFindOptions); + function callSuccessCallback(callback, result) { + callback(null, result); } - exports.__testing__ = { - findLegacyCompoundWord - }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/clean.js -var require_clean = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/clean.js"(exports) { +// node_modules/@nodelib/fs.stat/out/providers/sync.js +var require_sync = __commonJS({ + "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.clean = void 0; - function clean2(t) { - const copy = { ...t }; - for (const key of Object.keys(copy)) { - if (copy[key] === void 0) { - delete copy[key]; + exports.read = void 0; + function read2(path26, settings) { + const lstat = settings.fs.lstatSync(path26); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat2 = settings.fs.statSync(path26); + if (settings.markSymbolicLink) { + stat2.isSymbolicLink = () => true; + } + return stat2; + } catch (error2) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; } + throw error2; } - return copy; } - exports.clean = clean2; + exports.read = read2; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/isDefined.js -var require_isDefined = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/isDefined.js"(exports) { +// node_modules/@nodelib/fs.stat/out/adapters/fs.js +var require_fs2 = __commonJS({ + "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDefined = void 0; - function isDefined2(t) { - return t !== void 0; + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + var fs9 = require("fs"); + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs9.lstat, + stat: fs9.stat, + lstatSync: fs9.lstatSync, + statSync: fs9.statSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === void 0) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); } - exports.isDefined = isDefined2; + exports.createFileSystemAdapter = createFileSystemAdapter; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/walker/hintedWalker.js -var require_hintedWalker = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/walker/hintedWalker.js"(exports) { +// node_modules/@nodelib/fs.stat/out/settings.js +var require_settings = __commonJS({ + "node_modules/@nodelib/fs.stat/out/settings.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.hintedWalker = void 0; - var isDefined_js_1 = require_isDefined(); - var walkerTypes_js_1 = require_walkerTypes(); - function hintedWalker(root, ignoreCase, hint, compoundingMethod, emitWordSeparator) { - return hintedWalkerNext(root, ignoreCase, hint, compoundingMethod, emitWordSeparator); - } - exports.hintedWalker = hintedWalker; - function* hintedWalkerNext(root, ignoreCase, hint, compoundingMethod, emitWordSeparator = "") { - const _compoundingMethod = compoundingMethod ?? walkerTypes_js_1.CompoundWordsMethod.NONE; - const compoundCharacter = root.compoundCharacter; - const noCaseCharacter = root.stripCaseAndAccentsPrefix; - const rawRoots = [root, ignoreCase ? root.c.get(noCaseCharacter) : void 0].filter(isDefined_js_1.isDefined); - const specialRootsPrefix = existMap([compoundCharacter, noCaseCharacter, root.forbiddenWordPrefix]); - function filterRoot(root2) { - const children2 = root2.c?.entries(); - const c = children2 && [...children2].filter(([v]) => !(v in specialRootsPrefix)); - return { - c: c && new Map(c) - }; + var fs9 = require_fs2(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs9.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); } - const roots = rawRoots.map(filterRoot); - const compoundRoots = rawRoots.map((r) => r.c?.get(compoundCharacter)).filter(isDefined_js_1.isDefined); - const setOfCompoundRoots = new Set(compoundRoots); - const rootsForCompoundMethods = roots.concat(compoundRoots); - const compoundMethodRoots = { - [walkerTypes_js_1.CompoundWordsMethod.NONE]: [], - [walkerTypes_js_1.CompoundWordsMethod.JOIN_WORDS]: [...rootsForCompoundMethods.map((r) => [walkerTypes_js_1.JOIN_SEPARATOR, r])], - [walkerTypes_js_1.CompoundWordsMethod.SEPARATE_WORDS]: [...rootsForCompoundMethods.map((r) => [walkerTypes_js_1.WORD_SEPARATOR, r])] - }; - function* children(n, hintOffset) { - if (n.c) { - const h = hint.slice(hintOffset, hintOffset + 3) + hint.slice(Math.max(0, hintOffset - 2), hintOffset); - const hints = new Set(h); - const c = n.c; - yield* [...hints].filter((a) => c.has(a)).map((letter) => ({ - letter, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - node: c.get(letter), - hintOffset: hintOffset + 1 - })); - hints.add(compoundCharacter); - yield* [...c].filter((a) => !hints.has(a[0])).map(([letter, node]) => ({ - letter, - node, - hintOffset: hintOffset + 1 - })); - if (c.has(compoundCharacter) && !setOfCompoundRoots.has(n)) { - for (const compoundRoot of compoundRoots) { - for (const child of children(compoundRoot, hintOffset)) { - const { letter, node, hintOffset: hintOffset2 } = child; - yield { letter: emitWordSeparator + letter, node, hintOffset: hintOffset2 }; - } - } - } - } - if (n.f) { - yield* [...compoundMethodRoots[_compoundingMethod]].map(([letter, node]) => ({ - letter, - node, - hintOffset - })); + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.stat/out/index.js +var require_out = __commonJS({ + "node_modules/@nodelib/fs.stat/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.statSync = exports.stat = exports.Settings = void 0; + var async = require_async(); + var sync = require_sync(); + var settings_1 = require_settings(); + exports.Settings = settings_1.default; + function stat2(path26, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + async.read(path26, getSettings2(), optionsOrSettingsOrCallback); + return; + } + async.read(path26, getSettings2(optionsOrSettingsOrCallback), callback); + } + exports.stat = stat2; + function statSync3(path26, optionsOrSettings) { + const settings = getSettings2(optionsOrSettings); + return sync.read(path26, settings); + } + exports.statSync = statSync3; + function getSettings2(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/queue-microtask/index.js +var require_queue_microtask = __commonJS({ + "node_modules/queue-microtask/index.js"(exports, module2) { + var promise; + module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => { + throw err; + }, 0)); + } +}); + +// node_modules/run-parallel/index.js +var require_run_parallel = __commonJS({ + "node_modules/run-parallel/index.js"(exports, module2) { + module2.exports = runParallel; + var queueMicrotask2 = require_queue_microtask(); + function runParallel(tasks, cb) { + let results, pending, keys2; + let isSync = true; + if (Array.isArray(tasks)) { + results = []; + pending = tasks.length; + } else { + keys2 = Object.keys(tasks); + results = {}; + pending = keys2.length; + } + function done(err) { + function end() { + if (cb) + cb(err, results); + cb = null; } + if (isSync) + queueMicrotask2(end); + else + end(); } - for (const root2 of roots) { - let depth = 0; - const stack = []; - const stackText = [""]; - stack[depth] = children(root2, depth); - let ir; - while (depth >= 0) { - while (!(ir = stack[depth].next()).done) { - const { letter: char, node, hintOffset } = ir.value; - const text = stackText[depth] + char; - const hinting = yield { text, node, depth }; - if (hinting && hinting.goDeeper) { - depth++; - stackText[depth] = text; - stack[depth] = children(node, hintOffset); - } - } - depth -= 1; + function each(i, err, result) { + results[i] = result; + if (--pending === 0 || err) { + done(err); } } - } - function existMap(values) { - const m = /* @__PURE__ */ Object.create(null); - for (const v of values) { - m[v] = true; + if (!pending) { + done(null); + } else if (keys2) { + keys2.forEach(function(key) { + tasks[key](function(err, result) { + each(key, err, result); + }); + }); + } else { + tasks.forEach(function(task, i) { + task(function(err, result) { + each(i, err, result); + }); + }); } - return m; + isSync = false; } - exports.__testing__ = { - hintedWalkerNext - }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/walker/index.js -var require_walker2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/walker/index.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/constants.js +var require_constants3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.hintedWalker = void 0; - var hintedWalker_js_1 = require_hintedWalker(); - Object.defineProperty(exports, "hintedWalker", { enumerable: true, get: function() { - return hintedWalker_js_1.hintedWalker; - } }); - __exportStar(require_walker(), exports); - __exportStar(require_walkerTypes(), exports); + exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; + var NODE_PROCESS_VERSION_PARTS = process.versions.node.split("."); + if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); + } + var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); + var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); + var SUPPORTED_MAJOR_VERSION = 10; + var SUPPORTED_MINOR_VERSION = 10; + var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; + var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; + exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/genSuggestionsOptions.js -var require_genSuggestionsOptions = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/genSuggestionsOptions.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/utils/fs.js +var require_fs3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.createSuggestionOptions = exports.defaultSuggestionOptions = exports.defaultGenSuggestionOptions = void 0; - var index_js_1 = require_walker2(); - exports.defaultGenSuggestionOptions = { - compoundMethod: index_js_1.CompoundWordsMethod.NONE, - ignoreCase: true, - changeLimit: 5 - }; - exports.defaultSuggestionOptions = { - ...exports.defaultGenSuggestionOptions, - numSuggestions: 8, - includeTies: true, - timeout: 5e3 - }; - var keyMapOfGenSuggestionOptionsStrict = { - changeLimit: "changeLimit", - compoundMethod: "compoundMethod", - ignoreCase: "ignoreCase", - compoundSeparator: "compoundSeparator" - }; - var keyMapOfSuggestionOptionsStrict = { - ...keyMapOfGenSuggestionOptionsStrict, - filter: "filter", - includeTies: "includeTies", - numSuggestions: "numSuggestions", - timeout: "timeout", - weightMap: "weightMap" - }; - function createSuggestionOptions(...opts) { - const options = { ...exports.defaultSuggestionOptions }; - const keys = Object.keys(keyMapOfSuggestionOptionsStrict); - for (const opt of opts) { - for (const key of keys) { - assign(options, opt, key); - } + exports.createDirentFromStats = void 0; + var DirentFromStats = class { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); } - return options; - } - exports.createSuggestionOptions = createSuggestionOptions; - function assign(dest, src, k) { - dest[k] = src[k] ?? dest[k]; + }; + function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); } + exports.createDirentFromStats = createDirentFromStats; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/orthography.js -var require_orthography = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/orthography.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/utils/index.js +var require_utils8 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.visualLetterMaskMap = exports.visualLetterGroups = exports.compare = void 0; - var intl = new Intl.Collator("en", { sensitivity: "base" }); - exports.compare = intl.compare; - exports.visualLetterGroups = [ - // cspell:disable - forms("\u01CE\xE0\xE5\xC4\xC0A\xE3\xE2\xE1\u01DF\u1EB7\u1EAF\u1EA5\u0100\u0101\u0103\u0105a\xE4\xE6\u0250\u0251\u03B1\u0430\u1FB3") + "\u1FB3", - forms("Bb\u1E03\u0432\u044A\u044C"), - forms("\u010B\u010C\u010Dc\u0109\xE7C\xC7\u0107\u010A\u0421\u0441\u03C2"), - forms("\u1E0E\u1E0B\u1E0F\u1E11\u010F\u0111\u1E0DDd"), - forms("\u0113\xEB\xC8\xCA\xCB\u1EC1\xE9\xE8\u1EBF\u1EC7\u0115eE\u0112\u0117\u0119\u011B\xEA\u0259\u025B\u0451\u0401\u0435\u0292"), - forms("f\u1E1FF"), - forms("\u0121\u0120\u011E\u01E7\u011D\u0123Gg\u0263"), - forms("\u0127\u0126\u0125\u1E25Hh\u1E24\u021F\u043D"), - forms("I\u012F\xEF\u0130\xCE\xCD\u012Bi\xCC\xEC\xED\xEE\u0131\u026A\u0268\u0457\u038A\u0399"), - forms("jJ\u0135"), - forms("\u0137Kk\u03BA\u043A\u045C"), - forms("\u1E37\u0142\u013E\u013CLl\u013A\u1E36\u03AF\u03B9"), - forms("M\u1E43\u1E41m"), - forms("n\u0146\xD1N\u1E47\u0148\u0147\xF1\u0144\u014B\u045D\u0438\u0439"), - forms("\xD2O\xF8\u022D\u014C\u014D\u0151\u1ECFo\xD6\xF2\u0231\u022F\xF3\xF4\xF5\xF6\u01A1\u0254\u03CC\u03B4\u043E"), - forms("P\u1E57p\u0440\u0420\u03C1"), - forms("Qq"), - forms("\u0159R\u1E5Br\u0155\u0157\u0453\u0433\u044F"), - forms("\u1E63\u0161\u0218\u1E62sS\u0160\u1E61\u015E\u015D\u015B\u0219\u0283\u03A3"), - forms("t\u021B\u021A\u0165T\u1E6D\u1E6C\u1E6B"), - forms("\xDC\xFC\xFB\u016A\u01B0\u016F\u016B\u0171\xFA\xDB\u016D\xD9\xF9u\u0173U"), - forms("Vv\u03BD"), - forms("\u0175wW\u1E83\u1E85\u1E81\u03C9\u0448"), - forms("xX\u0445"), - forms("\xFF\xFDY\u0177y\xDD\u1EF3\u0423\u045E\u0443"), - forms("Z\u1E93\u017E\u017D\u017C\u017B\u017Az") - // cspell:enable - ]; - function forms(letters) { - const n = letters.normalize("NFC").replace(/\p{M}/gu, ""); - const na = n.normalize("NFD").replace(/\p{M}/gu, ""); - const s = new Set(n + n.toLowerCase() + n.toUpperCase() + na + na.toLowerCase() + na.toUpperCase()); - return [...s].join(""); - } - exports.visualLetterMaskMap = calcVisualLetterMasks(exports.visualLetterGroups); - function calcVisualLetterMasks(groups) { - const map = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < groups.length; ++i) { - const m = 1 << i; - const g = groups[i]; - for (const c of g) { - map[c] = (map[c] || 0) | m; - } - } - return map; - } + exports.fs = void 0; + var fs9 = require_fs3(); + exports.fs = fs9; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/timer.js -var require_timer = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/timer.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/providers/common.js +var require_common3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.polyHrTime = exports.toMilliseconds = exports.createTimer = void 0; - var _hrTime = process?.hrtime || polyHrTime; - function createTimer(hrTimeFn = _hrTime) { - let start = hrTimeFn(); - return { - start() { - start = hrTimeFn(); - }, - elapsed() { - return toMilliseconds(hrTimeFn(start)); - } - }; - } - exports.createTimer = createTimer; - function toMilliseconds(t) { - return (t[0] + t[1] * 1e-9) * 1e3; - } - exports.toMilliseconds = toMilliseconds; - function polyHrTime(time) { - const now = Date.now() - (time ? toMilliseconds(time) : 0); - const inSeconds = now * 1e-3; - const s = Math.floor(inSeconds); - const n = (inSeconds - s) * 1e9; - return [s, n]; + exports.joinPathSegments = void 0; + function joinPathSegments(a, b, separator) { + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; } - exports.polyHrTime = polyHrTime; + exports.joinPathSegments = joinPathSegments; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/suggestCollector.js -var require_suggestCollector = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/suggestCollector.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/providers/async.js +var require_async2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.isSuggestionResult = exports.impersonateCollector = exports.suggestionCollector = exports.defaultSuggestionCollectorOptions = exports.compSuggestionResults = void 0; - var index_js_1 = require_distance2(); - var weightedMaps_js_1 = require_weightedMaps(); - var timer_js_1 = require_timer(); - var util_js_1 = require_util6(); - var index_js_2 = require_walker2(); - var constants_js_1 = require_constants5(); - var defaultMaxNumberSuggestions = 10; - var BASE_COST = 100; - var MAX_NUM_CHANGES = 5; - var MAX_COST_SCALE = 0.5; - var MAX_ALLOWED_COST_SCALE = 1.03 * MAX_COST_SCALE; - var collator = new Intl.Collator(); - var regexSeparator = new RegExp(`[${(0, util_js_1.regexQuote)(index_js_2.WORD_SEPARATOR)}]`, "g"); - var wordLengthCost = [0, 50, 25, 5, 0]; - var EXTRA_WORD_COST = 5; - var DEFAULT_COLLECTOR_TIMEOUT = 1e3; - var symStopProcessing = Symbol("Collector Stop Processing"); - function compSuggestionResults(a, b) { - const aPref = a.isPreferred && -1 || 0; - const bPref = b.isPreferred && -1 || 0; - return aPref - bPref || a.cost - b.cost || a.word.length - b.word.length || collator.compare(a.word, b.word); - } - exports.compSuggestionResults = compSuggestionResults; - exports.defaultSuggestionCollectorOptions = Object.freeze({ - numSuggestions: defaultMaxNumberSuggestions, - filter: () => true, - changeLimit: MAX_NUM_CHANGES, - includeTies: false, - ignoreCase: true, - timeout: DEFAULT_COLLECTOR_TIMEOUT, - weightMap: void 0, - compoundSeparator: "", - compoundMethod: void 0 - }); - function suggestionCollector(wordToMatch, options) { - const { filter = () => true, changeLimit = MAX_NUM_CHANGES, includeTies = false, ignoreCase = true, timeout = DEFAULT_COLLECTOR_TIMEOUT, weightMap, compoundSeparator = exports.defaultSuggestionCollectorOptions.compoundSeparator } = options; - const numSuggestions = Math.max(options.numSuggestions, 0) || 0; - const numSugToHold = weightMap ? numSuggestions * 2 : numSuggestions; - const sugs = /* @__PURE__ */ new Map(); - let maxCost = BASE_COST * Math.min(wordToMatch.length * MAX_ALLOWED_COST_SCALE, changeLimit); - const useSeparator = compoundSeparator || (weightMap ? constants_js_1.DEFAULT_COMPOUNDED_WORD_SEPARATOR : exports.defaultSuggestionCollectorOptions.compoundSeparator); - const fnCleanWord = !useSeparator || useSeparator === compoundSeparator ? (w) => w : (0, util_js_1.replaceAllFactory)(useSeparator, ""); - if (useSeparator && weightMap) { - (0, weightedMaps_js_1.addDefToWeightMap)(weightMap, { map: useSeparator, insDel: 50 }); - } - const genSuggestionOptions = (0, util_js_1.clean)({ - changeLimit, - ignoreCase, - compoundMethod: options.compoundMethod, - compoundSeparator: useSeparator - }); - let timeRemaining = timeout; - function dropMax() { - if (sugs.size < 2 || !numSuggestions) { - sugs.clear(); + exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; + var fsStat = require_out(); + var rpl = require_run_parallel(); + var constants_1 = require_constants3(); + var utils = require_utils8(); + var common = require_common3(); + function read2(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); + } + exports.read = read2; + function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); return; } - const sorted = [...sugs.values()].sort(compSuggestionResults); - let i = numSugToHold - 1; - maxCost = sorted[i].cost; - for (; i < sorted.length && sorted[i].cost <= maxCost; ++i) { - } - for (; i < sorted.length; ++i) { - sugs.delete(sorted[i].word); - } - } - function adjustCost(sug) { - if (sug.isPreferred) - return sug; - const words = sug.word.split(regexSeparator); - const extraCost = words.map((w) => wordLengthCost[w.length] || 0).reduce((a, b) => a + b, 0) + (words.length - 1) * EXTRA_WORD_COST; - return { word: sug.word, cost: sug.cost + extraCost }; - } - function collectSuggestion(suggestion) { - const { word, cost, isPreferred } = adjustCost(suggestion); - if (cost <= maxCost && filter(suggestion.word, cost)) { - const known = sugs.get(word); - if (known) { - known.cost = Math.min(known.cost, cost); - known.isPreferred = known.isPreferred || isPreferred; - } else { - sugs.set(word, { word, cost, isPreferred }); - if (cost < maxCost && sugs.size > numSugToHold) { - dropMax(); - } - } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; } - return maxCost; - } - function collect(src, timeout2, filter2) { - let stop = false; - timeout2 = timeout2 ?? timeRemaining; - timeout2 = Math.min(timeout2, timeRemaining); - if (timeout2 < 0) + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); + } + exports.readdirWithFileTypes = readdirWithFileTypes; + function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); return; - const timer = (0, timer_js_1.createTimer)(); - let ir; - while (!(ir = src.next(stop || maxCost)).done) { - if (timer.elapsed() > timeout2) { - stop = symStopProcessing; - } - const { value } = ir; - if (!value) - continue; - if (isSuggestionResult(value)) { - if (!filter2 || filter2(value.word, value.cost)) { - collectSuggestion(value); + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; } - continue; + done(null, entry); + return; } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; + } + function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; } - timeRemaining -= timer.elapsed(); - } - function cleanCompoundResult(sr) { - const { word, cost } = sr; - const cWord = fnCleanWord(word); - if (cWord !== word) { - return { - word: cWord, - cost, - compoundWord: word, - isPreferred: void 0 + const tasks = names.map((name) => { + const path26 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path26, settings.fsStatSettings, (error2, stats) => { + if (error2 !== null) { + done(error2); + return; + } + const entry = { + name, + path: path26, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); }; - } - return { ...sr }; - } - function suggestions() { - if (numSuggestions < 1 || !sugs.size) - return []; - const NF = "NFD"; - const nWordToMatch = wordToMatch.normalize(NF); - const rawValues = [...sugs.values()]; - const values = weightMap ? rawValues.map(({ word, cost, isPreferred }) => ({ - word, - cost: isPreferred ? cost : (0, index_js_1.editDistanceWeighted)(nWordToMatch, word.normalize(NF), weightMap, 110), - isPreferred - })) : rawValues; - const sorted = values.sort(compSuggestionResults).map(cleanCompoundResult); - let i = Math.min(sorted.length, numSuggestions) - 1; - const limit = includeTies ? sorted.length : Math.min(sorted.length, numSuggestions); - const iCost = sorted[i].cost; - const maxCost2 = Math.min(iCost, weightMap ? changeLimit * BASE_COST - 1 : iCost); - for (i = 1; i < limit && sorted[i].cost <= maxCost2; ++i) { - } - sorted.length = i; - return sorted; - } - const collector = { - collect, - add: function(suggestion) { - collectSuggestion(suggestion); - return this; - }, - get suggestions() { - return suggestions(); - }, - get maxCost() { - return maxCost; - }, - get word() { - return wordToMatch; - }, - get maxNumSuggestions() { - return numSuggestions; - }, - get changeLimit() { - return changeLimit; - }, - includesTies: includeTies, - ignoreCase, - symbolStopProcessing: symStopProcessing, - genSuggestionOptions - }; - return collector; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); } - exports.suggestionCollector = suggestionCollector; - function impersonateCollector(collector, word) { - const r = Object.create(collector); - Object.defineProperty(r, "word", { value: word, writable: false }); - return r; + exports.readdir = readdir; + function callFailureCallback(callback, error2) { + callback(error2); } - exports.impersonateCollector = impersonateCollector; - function isSuggestionResult(s) { - const r = s; - return r?.cost !== void 0 && r.word != void 0; + function callSuccessCallback(callback, result) { + callback(null, result); } - exports.isSuggestionResult = isSuggestionResult; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/suggest.js -var require_suggest = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/suggest.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/providers/sync.js +var require_sync2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.genCompoundableSuggestions = exports.genSuggestions = exports.suggest = void 0; - var trie_util_js_1 = require_trie_util(); - var clean_js_1 = require_clean(); - var index_js_1 = require_walker2(); - var genSuggestionsOptions_js_1 = require_genSuggestionsOptions(); - var orthography_js_1 = require_orthography(); - var suggestCollector_js_1 = require_suggestCollector(); - var baseCost = 100; - var swapCost = 75; - var postSwapCost = swapCost - baseCost; - var insertSpaceCost = -1; - var mapSubCost = 1; - var maxCostScale = 0.5; - var discourageInsertCost = baseCost; - var setOfSeparators = /* @__PURE__ */ new Set([index_js_1.JOIN_SEPARATOR, index_js_1.WORD_SEPARATOR]); - function suggest(root, word, options = {}) { - const opts = (0, genSuggestionsOptions_js_1.createSuggestionOptions)(options); - const collectorOpts = (0, clean_js_1.clean)(opts); - const collector = (0, suggestCollector_js_1.suggestionCollector)(word, collectorOpts); - collector.collect(genSuggestions(root, word, { ...opts, ...collector.genSuggestionOptions })); - return collector.suggestions; - } - exports.suggest = suggest; - function* genSuggestions(root, word, options = {}) { - const roots = Array.isArray(root) ? root : [root]; - for (const r of roots) { - yield* genCompoundableSuggestions(r, word, options); + exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; + var fsStat = require_out(); + var constants_1 = require_constants3(); + var utils = require_utils8(); + var common = require_common3(); + function read2(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); } - return void 0; + return readdir(directory, settings); } - exports.genSuggestions = genSuggestions; - function* genCompoundableSuggestions(root, word, options = {}) { - const { compoundMethod = index_js_1.CompoundWordsMethod.NONE, changeLimit, ignoreCase } = (0, genSuggestionsOptions_js_1.createSuggestionOptions)(options); - const history = []; - const historyTags = /* @__PURE__ */ new Map(); - const bc = baseCost; - const psc = postSwapCost; - const matrix = [[]]; - const stack = []; - const x = " " + word; - const mx = x.length - 1; - const specialInsCosts = Object.assign(/* @__PURE__ */ Object.create(null), { - [index_js_1.WORD_SEPARATOR]: insertSpaceCost, - [index_js_1.JOIN_SEPARATOR]: insertSpaceCost + exports.read = read2; + function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } catch (error2) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error2; + } + } + } + return entry; }); - const specialSubCosts = Object.assign(/* @__PURE__ */ Object.create(null), { - "-": discourageInsertCost - }); - let stopNow = false; - let costLimit = bc * Math.min(word.length * maxCostScale, changeLimit); - function updateCostLimit(maxCost) { - switch (typeof maxCost) { - case "number": - costLimit = maxCost; - break; - case "symbol": - stopNow = true; - break; - } - } - const a = 0; - let b = 0; - for (let i = 0, c = 0; i <= mx && c <= costLimit; ++i) { - c = i * baseCost; - matrix[0][i] = c; - b = i; - } - stack[0] = { a, b }; - const hint = word; - const iWalk = (0, index_js_1.hintedWalker)(root, ignoreCase, hint, compoundMethod, options.compoundSeparator); - let goDeeper = true; - for (let r = iWalk.next({ goDeeper }); !stopNow && !r.done; r = iWalk.next({ goDeeper })) { - const { text, node, depth } = r.value; - let { a: a2, b: b2 } = stack[depth]; - const w = text.slice(-1); - const wG = orthography_js_1.visualLetterMaskMap[w] || 0; - if (setOfSeparators.has(w)) { - const mxRange = matrix[depth].slice(a2, b2 + 1); - const mxMin = Math.min(...mxRange); - const tag = [a2].concat(mxRange.map((c2) => c2 - mxMin)).join(); - const ht = historyTags.get(tag); - if (ht && ht.m <= mxMin) { - goDeeper = false; - const { i: i2, w: w2, m } = ht; - if (i2 >= history.length) { - continue; - } - const r2 = history[i2]; - if (r2.word.slice(0, w2.length) !== w2) { - continue; - } - const dc = mxMin - m; - for (let p = i2; p < history.length; ++p) { - const { word: word2, cost: hCost } = history[p]; - const fix = word2.slice(0, w2.length); - if (fix !== w2) { - break; - } - const cost2 = hCost + dc; - if (cost2 <= costLimit) { - const suffix = word2.slice(w2.length); - const emit = text + suffix; - updateCostLimit(yield { word: emit, cost: cost2 }); - } - } - continue; - } else { - historyTags.set(tag, { w: text, i: history.length, m: mxMin }); - } - } - const d = depth + 1; - const lastSugLetter = d > 1 ? text[d - 2] : ""; - const c = bc - d + (specialSubCosts[w] || 0); - const ci = c + (specialInsCosts[w] || 0); - matrix[d] = matrix[d] || []; - matrix[d][a2] = matrix[d - 1][a2] + ci + d - a2; - let lastLetter = x[a2]; - let min = matrix[d][a2]; - let i; - for (i = a2 + 1; i <= b2; ++i) { - const curLetter = x[i]; - const cG = orthography_js_1.visualLetterMaskMap[curLetter] || 0; - const subCost = w === curLetter ? 0 : wG & cG ? mapSubCost : curLetter === lastSugLetter ? w === lastLetter ? psc : c : c; - const e = Math.min( - matrix[d - 1][i - 1] + subCost, - // substitute - matrix[d - 1][i] + ci, - // insert - matrix[d][i - 1] + c - // delete - ); - min = Math.min(min, e); - matrix[d][i] = e; - lastLetter = curLetter; - } - const { b: bb } = stack[d - 1]; - while (b2 < mx) { - b2 += 1; - i = b2; - const curLetter = x[i]; - const cG = orthography_js_1.visualLetterMaskMap[curLetter] || 0; - const subCost = w === curLetter ? 0 : wG & cG ? mapSubCost : curLetter === lastSugLetter ? w === lastLetter ? psc : c : c; - const j = Math.min(bb, i - 1); - const e = Math.min( - matrix[d - 1][j] + subCost, - // substitute - matrix[d][i - 1] + c - // delete - ); - min = Math.min(min, e); - matrix[d][i] = e; - lastLetter = curLetter; - if (e > costLimit) - break; - } - for (; b2 > a2 && matrix[d][b2] > costLimit; b2 -= 1) { - } - for (; a2 < b2 && matrix[d][a2] > costLimit; a2 += 1) { - } - b2 = Math.min(b2 + 1, mx); - stack[d] = { a: a2, b: b2 }; - const cost = matrix[d][b2]; - if (node.f && (0, trie_util_js_1.isWordTerminationNode)(node) && cost <= costLimit) { - const r2 = { word: text, cost }; - history.push(r2); - updateCostLimit(yield r2); - } else { - updateCostLimit(yield void 0); + } + exports.readdirWithFileTypes = readdirWithFileTypes; + function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; } - goDeeper = min <= costLimit; - } - return void 0; + return entry; + }); } - exports.genCompoundableSuggestions = genCompoundableSuggestions; + exports.readdir = readdir; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggest.js -var require_suggest2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggest.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/adapters/fs.js +var require_fs4 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.suggest = exports.genSuggestions = exports.genCompoundableSuggestions = void 0; - var suggest_js_1 = require_suggest(); - Object.defineProperty(exports, "genCompoundableSuggestions", { enumerable: true, get: function() { - return suggest_js_1.genCompoundableSuggestions; - } }); - Object.defineProperty(exports, "genSuggestions", { enumerable: true, get: function() { - return suggest_js_1.genSuggestions; - } }); - Object.defineProperty(exports, "suggest", { enumerable: true, get: function() { - return suggest_js_1.suggest; - } }); + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + var fs9 = require("fs"); + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs9.lstat, + stat: fs9.stat, + lstatSync: fs9.lstatSync, + statSync: fs9.statSync, + readdir: fs9.readdir, + readdirSync: fs9.readdirSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === void 0) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + } + exports.createFileSystemAdapter = createFileSystemAdapter; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/trie.js -var require_trie = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/trie.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/settings.js +var require_settings2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.Trie = exports.FORBID = exports.NORMALIZED = exports.OPTIONAL_COMPOUND = exports.COMPOUND = exports.OPTIONAL_COMPOUND_FIX = exports.FORBID_PREFIX = exports.defaultTrieOptions = exports.COMPOUND_FIX = exports.CASE_INSENSITIVE_PREFIX = void 0; - var gensequence_1 = require_dist2(); - var constants_js_1 = require_constants4(); - var find_js_1 = require_find(); - var suggest_js_1 = require_suggest2(); - var trie_util_js_1 = require_trie_util(); - var clean_js_1 = require_clean(); - var mergeOptionalWithDefaults_js_1 = require_mergeOptionalWithDefaults(); - var util_js_1 = require_util6(); - var index_js_1 = require_walker2(); - var constants_js_2 = require_constants4(); - Object.defineProperty(exports, "CASE_INSENSITIVE_PREFIX", { enumerable: true, get: function() { - return constants_js_2.CASE_INSENSITIVE_PREFIX; - } }); - Object.defineProperty(exports, "COMPOUND_FIX", { enumerable: true, get: function() { - return constants_js_2.COMPOUND_FIX; - } }); - Object.defineProperty(exports, "defaultTrieOptions", { enumerable: true, get: function() { - return constants_js_2.defaultTrieOptions; - } }); - Object.defineProperty(exports, "FORBID_PREFIX", { enumerable: true, get: function() { - return constants_js_2.FORBID_PREFIX; - } }); - Object.defineProperty(exports, "OPTIONAL_COMPOUND_FIX", { enumerable: true, get: function() { - return constants_js_2.OPTIONAL_COMPOUND_FIX; - } }); - exports.COMPOUND = constants_js_1.COMPOUND_FIX; - exports.OPTIONAL_COMPOUND = constants_js_1.OPTIONAL_COMPOUND_FIX; - exports.NORMALIZED = constants_js_1.CASE_INSENSITIVE_PREFIX; - exports.FORBID = constants_js_1.FORBID_PREFIX; - var defaultLegacyMinCompoundLength = 3; - var Trie = class _Trie { - constructor(root, count) { - this.root = root; - this.count = count; - this.lastCreateFindOptionsMatchCaseMap = /* @__PURE__ */ new Map(); - this._options = (0, mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults)(root); - this.isLegacy = this.calcIsLegacy(); - this.hasForbidden = !!root.c.get(root.forbiddenWordPrefix); - this._findOptionsDefaults = { - caseInsensitivePrefix: this._options.stripCaseAndAccentsPrefix, - compoundFix: this._options.compoundCharacter, - forbidPrefix: this._options.forbiddenWordPrefix - }; - this._findOptionsExact = this.createFindOptions({ compoundMode: "none" }); - } - /** - * Number of words in the Trie - */ - size() { - this.count = this.count ?? (0, trie_util_js_1.countWords)(this.root); - return this.count; - } - isSizeKnown() { - return this.count !== void 0; - } - get options() { - return this._options; - } - /** - * @param text - text to find in the Trie - * @param minCompoundLength - deprecated - allows words to be glued together - */ - find(text, minCompoundLength = false) { - const minLength = !minCompoundLength ? void 0 : minCompoundLength === true ? defaultLegacyMinCompoundLength : minCompoundLength; - const options = this.createFindOptions({ - compoundMode: minLength ? "legacy" : "compound", - legacyMinCompoundLength: minLength + var path26 = require("path"); + var fsStat = require_out(); + var fs9 = require_fs4(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs9.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink }); - return (0, find_js_1.findWordNode)(this.root, text, options).node; } - /** - * - * @param text - text to search for - * @param minCompoundLength - minimum word compound length - * @deprecated - this method is no longer needed since compounding can be explicitly defined by the dictionary words. - */ - findCompound(text, minCompoundLength = defaultLegacyMinCompoundLength) { - const options = this.createFindOptions({ legacyMinCompoundLength: minCompoundLength }); - const r = (0, find_js_1.findLegacyCompound)(this.root, text, options); - return r.node; + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; } - findExact(text) { - return (0, find_js_1.findWordNode)(this.root, text, this._findOptionsExact).node; + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.scandir/out/index.js +var require_out2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Settings = exports.scandirSync = exports.scandir = void 0; + var async = require_async2(); + var sync = require_sync2(); + var settings_1 = require_settings2(); + exports.Settings = settings_1.default; + function scandir(path26, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + async.read(path26, getSettings2(), optionsOrSettingsOrCallback); + return; } - has(word, minLegacyCompoundLength) { - if (this.hasWord(word, false)) - return true; - if (minLegacyCompoundLength) { - const f = this.findWord(word, { useLegacyWordCompounds: minLegacyCompoundLength }); - return !!f.found; - } - return false; + async.read(path26, getSettings2(optionsOrSettingsOrCallback), callback); + } + exports.scandir = scandir; + function scandirSync(path26, optionsOrSettings) { + const settings = getSettings2(optionsOrSettings); + return sync.read(path26, settings); + } + exports.scandirSync = scandirSync; + function getSettings2(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; } - /** - * Determine if a word is in the dictionary. - * @param word - the exact word to search for - must be normalized. - * @param caseSensitive - false means also searching a dictionary where the words were normalized to lower case and accents removed. - * @returns true if the word was found and is not forbidden. - */ - hasWord(word, caseSensitive) { - const f = this.findWord(word, { caseSensitive }); - return !!f.found && !f.forbidden; - } - findWord(word, options) { - if (options?.useLegacyWordCompounds) { - const len = options.useLegacyWordCompounds !== true ? options.useLegacyWordCompounds : defaultLegacyMinCompoundLength; - const findOptions2 = this.createFindOptions({ - legacyMinCompoundLength: len, - matchCase: options.caseSensitive - }); - return (0, find_js_1.findLegacyCompound)(this.root, word, findOptions2); + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/reusify/reusify.js +var require_reusify = __commonJS({ + "node_modules/reusify/reusify.js"(exports, module2) { + "use strict"; + function reusify(Constructor) { + var head = new Constructor(); + var tail = head; + function get() { + var current = head; + if (current.next) { + head = current.next; + } else { + head = new Constructor(); + tail = head; } - const findOptions = this.createFindOptionsMatchCase(options?.caseSensitive); - return (0, find_js_1.findWord)(this.root, word, findOptions); - } - /** - * Determine if a word is in the forbidden word list. - * @param word the word to lookup. - */ - isForbiddenWord(word) { - return this.hasForbidden && (0, find_js_1.isForbiddenWord)(this.root, word, this.options.forbiddenWordPrefix); + current.next = null; + return current; } - /** - * Provides an ordered sequence of words with the prefix of text. - */ - completeWord(text) { - const n = this.find(text); - const compoundChar = this.options.compoundCharacter; - const subNodes = (0, trie_util_js_1.iteratorTrieWords)(n || {}).filter((w) => w[w.length - 1] !== compoundChar).map((suffix) => text + suffix); - return (0, gensequence_1.genSequence)(n && (0, trie_util_js_1.isWordTerminationNode)(n) ? [text] : []).concat(subNodes); + function release(obj) { + tail.next = obj; + tail = obj; } - /** - * Suggest spellings for `text`. The results are sorted by edit distance with changes near the beginning of a word having a greater impact. - * @param text - the text to search for - * @param maxNumSuggestions - the maximum number of suggestions to return. - * @param compoundMethod - Use to control splitting words. - * @param numChanges - the maximum number of changes allowed to text. This is an approximate value, since some changes cost less than others. - * the lower the value, the faster results are returned. Values less than 4 are best. - */ - suggest(text, options) { - return this.suggestWithCost(text, options).map((a) => a.word); + return { + get, + release + }; + } + module2.exports = reusify; + } +}); + +// node_modules/fastq/queue.js +var require_queue = __commonJS({ + "node_modules/fastq/queue.js"(exports, module2) { + "use strict"; + var reusify = require_reusify(); + function fastqueue(context, worker, concurrency) { + if (typeof context === "function") { + concurrency = worker; + worker = context; + context = null; } - /** - * Suggest spellings for `text`. The results are sorted by edit distance with changes near the beginning of a word having a greater impact. - * The results include the word and adjusted edit cost. This is useful for merging results from multiple tries. - */ - suggestWithCost(text, options) { - const sep4 = options.compoundSeparator; - const adjWord = sep4 ? (0, util_js_1.replaceAllFactory)(sep4, "") : (a) => a; - const optFilter = options.filter; - const filter = optFilter ? (word, cost) => { - const w = adjWord(word); - return !this.isForbiddenWord(w) && optFilter(w, cost); - } : (word) => !this.isForbiddenWord(adjWord(word)); - const opts = { ...options, filter }; - return (0, suggest_js_1.suggest)(this.root, text, opts); + if (concurrency < 1) { + throw new Error("fastqueue concurrency must be greater than 1"); } - /** - * genSuggestions will generate suggestions and send them to `collector`. `collector` is responsible for returning the max acceptable cost. - * Costs are measured in weighted changes. A cost of 100 is the same as 1 edit. Some edits are considered cheaper. - * Returning a MaxCost < 0 will effectively cause the search for suggestions to stop. - */ - genSuggestions(collector, compoundMethod) { - const filter = (word) => !this.isForbiddenWord(word); - const options = (0, clean_js_1.clean)({ compoundMethod, ...collector.genSuggestionOptions }); - const suggestions = (0, suggest_js_1.genSuggestions)(this.root, collector.word, options); - collector.collect(suggestions, void 0, filter); + var cache2 = reusify(Task); + var queueHead = null; + var queueTail = null; + var _running = 0; + var errorHandler = null; + var self = { + push, + drain: noop, + saturated: noop, + pause, + paused: false, + concurrency, + running, + resume, + idle, + length, + getQueue, + unshift, + empty: noop, + kill, + killAndDrain, + error: error2 + }; + return self; + function running() { + return _running; } - /** - * Returns an iterator that can be used to get all words in the trie. For some dictionaries, this can result in millions of words. - */ - words() { - return (0, trie_util_js_1.iteratorTrieWords)(this.root); + function pause() { + self.paused = true; } - /** - * Allows iteration over the entire tree. - * On the returned Iterator, calling .next(goDeeper: boolean), allows for controlling the depth. - */ - iterate() { - return (0, index_js_1.walker)(this.root); + function length() { + var current = queueHead; + var counter = 0; + while (current) { + current = current.next; + counter++; + } + return counter; } - insert(word) { - (0, trie_util_js_1.insert)(word, this.root); - return this; + function getQueue() { + var current = queueHead; + var tasks = []; + while (current) { + tasks.push(current.value); + current = current.next; + } + return tasks; } - calcIsLegacy() { - const c = this.root.c; - return !(c?.get(this._options.compoundCharacter) || c?.get(this._options.stripCaseAndAccentsPrefix) || c?.get(this._options.forbiddenWordPrefix)); + function resume() { + if (!self.paused) + return; + self.paused = false; + for (var i = 0; i < self.concurrency; i++) { + _running++; + release(); + } } - static create(words, options) { - const root = (0, trie_util_js_1.createTriFromList)(words, options); - (0, trie_util_js_1.orderTrie)(root); - return new _Trie(root, void 0); + function idle() { + return _running === 0 && self.length() === 0; } - createFindOptions(options = {}) { - const findOptions = (0, find_js_1.createFindOptions)({ - ...this._findOptionsDefaults, - ...options - }); - return findOptions; + function push(value, done) { + var current = cache2.get(); + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop; + current.errorHandler = errorHandler; + if (_running === self.concurrency || self.paused) { + if (queueTail) { + queueTail.next = current; + queueTail = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); + } + } else { + _running++; + worker.call(context, current.value, current.worked); + } } - createFindOptionsMatchCase(matchCase) { - const f = this.lastCreateFindOptionsMatchCaseMap.get(matchCase); - if (f !== void 0) - return f; - const findOptions = this.createFindOptions({ matchCase }); - this.lastCreateFindOptionsMatchCaseMap.set(matchCase, findOptions); - return findOptions; + function unshift(value, done) { + var current = cache2.get(); + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop; + if (_running === self.concurrency || self.paused) { + if (queueHead) { + current.next = queueHead; + queueHead = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); + } + } else { + _running++; + worker.call(context, current.value, current.worked); + } } - }; - exports.Trie = Trie; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/secondChanceCache.js -var require_secondChanceCache = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/secondChanceCache.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SecondChanceCache = void 0; - var SecondChanceCache = class { - constructor(maxL0Size) { - this.maxL0Size = maxL0Size; - this.map0 = /* @__PURE__ */ new Map(); - this.map1 = /* @__PURE__ */ new Map(); - } - has(key) { - if (this.map0.has(key)) - return true; - if (this.map1.has(key)) { - this.set(key, this.get1(key)); - return true; + function release(holder) { + if (holder) { + cache2.release(holder); } - return false; + var next = queueHead; + if (next) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null; + } + queueHead = next.next; + next.next = null; + worker.call(context, next.value, next.worked); + if (queueTail === null) { + self.empty(); + } + } else { + _running--; + } + } else if (--_running === 0) { + self.drain(); + } + } + function kill() { + queueHead = null; + queueTail = null; + self.drain = noop; } - get(key) { - return this.map0.get(key) ?? this.get1(key); + function killAndDrain() { + queueHead = null; + queueTail = null; + self.drain(); + self.drain = noop; } - set(key, value) { - if (this.map0.size >= this.maxL0Size && !this.map0.has(key)) { - this.map1 = this.map0; - this.map0 = /* @__PURE__ */ new Map(); - } - this.map0.set(key, value); - return this; + function error2(handler) { + errorHandler = handler; } - get size() { - return this.map0.size + this.map1.size; + } + function noop() { + } + function Task() { + this.value = null; + this.callback = noop; + this.next = null; + this.release = noop; + this.context = null; + this.errorHandler = null; + var self = this; + this.worked = function worked(err, result) { + var callback = self.callback; + var errorHandler = self.errorHandler; + var val = self.value; + self.value = null; + self.callback = noop; + if (self.errorHandler) { + errorHandler(err, val); + } + callback.call(self.context, err, result); + self.release(self); + }; + } + function queueAsPromised(context, worker, concurrency) { + if (typeof context === "function") { + concurrency = worker; + worker = context; + context = null; } - get size0() { - return this.map0.size; + function asyncWrapper(arg, cb) { + worker.call(this, arg).then(function(res) { + cb(null, res); + }, cb); } - get size1() { - return this.map1.size; + var queue = fastqueue(context, asyncWrapper, concurrency); + var pushCb = queue.push; + var unshiftCb = queue.unshift; + queue.push = push; + queue.unshift = unshift; + queue.drained = drained; + return queue; + function push(value) { + var p = new Promise(function(resolve13, reject) { + pushCb(value, function(err, result) { + if (err) { + reject(err); + return; + } + resolve13(result); + }); + }); + p.catch(noop); + return p; } - clear() { - this.map0.clear(); - this.map1.clear(); - return this; + function unshift(value) { + var p = new Promise(function(resolve13, reject) { + unshiftCb(value, function(err, result) { + if (err) { + reject(err); + return; + } + resolve13(result); + }); + }); + p.catch(noop); + return p; } - get1(key) { - if (this.map1.has(key)) { - const v = this.map1.get(key); - this.map1.delete(key); - this.set(key, v); - return v; + function drained() { + if (queue.idle()) { + return new Promise(function(resolve13) { + resolve13(); + }); } - return void 0; - } - toArray() { - return [...this.map1, ...this.map0]; + var previousDrain = queue.drain; + var p = new Promise(function(resolve13) { + queue.drain = function() { + previousDrain(); + resolve13(); + }; + }); + return p; } - }; - exports.SecondChanceCache = SecondChanceCache; + } + module2.exports = fastqueue; + module2.exports.promise = queueAsPromised; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/TrieBuilder.js -var require_TrieBuilder = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/TrieBuilder.js"(exports) { +// node_modules/@nodelib/fs.walk/out/readers/common.js +var require_common4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.TrieBuilder = exports.buildTrieFast = exports.buildTrie = void 0; - var consolidate_js_1 = require_consolidate(); - var trie_js_1 = require_trie(); - var trie_util_js_1 = require_trie_util(); - var mergeOptionalWithDefaults_js_1 = require_mergeOptionalWithDefaults(); - var secondChanceCache_js_1 = require_secondChanceCache(); - function buildTrie(words, trieOptions) { - return new TrieBuilder(words, trieOptions).build(); - } - exports.buildTrie = buildTrie; - function buildTrieFast(words, trieOptions) { - const root = (0, trie_util_js_1.createTriFromList)(words, trieOptions); - return new trie_js_1.Trie(root, void 0); - } - exports.buildTrieFast = buildTrieFast; - var MAX_NUM_SIGS = 1e5; - var MAX_TRANSFORMS = 1e6; - var MAX_CACHE_SIZE = 1e6; - var TrieBuilder = class { - constructor(words, trieOptions) { - this.count = 0; - this.signatures = new secondChanceCache_js_1.SecondChanceCache(MAX_NUM_SIGS); - this.cached = new secondChanceCache_js_1.SecondChanceCache(MAX_CACHE_SIZE); - this.transforms = new secondChanceCache_js_1.SecondChanceCache(MAX_TRANSFORMS); - this._eow = Object.freeze({ f: 1 }); - this.lastPath = [{ s: "", n: { f: void 0, c: void 0 } }]; - this.tails = /* @__PURE__ */ new Map([["", this._eow]]); - this._canBeCached(this._eow); - this.signatures.set(this.signature(this._eow), this._eow); - this.cached.set(this._eow, this.count++); - this.trieOptions = Object.freeze((0, mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults)(trieOptions)); - if (words) { - this.insert(words); - } - } - set _root(n) { - this.lastPath[0].n = n; - } - get _root() { - return (0, trie_util_js_1.trieNodeToRoot)(this.lastPath[0].n, this.trieOptions); - } - signature(n) { - const isWord = n.f ? "*" : ""; - const ref = n.c ? JSON.stringify([...n.c.entries()].map(([k, n2]) => [k, this.cached.get(n2)])) : ""; - return isWord + ref; - } - _canBeCached(n) { - if (!n.c) - return true; - for (const v of n.c) { - if (!this.cached.has(v[1])) - return false; - } + exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; + function isFatalError(settings, error2) { + if (settings.errorFilter === null) { return true; } - tryCacheFrozen(n) { - if (this.cached.has(n)) { - return n; - } - this.cached.set(n, this.count++); - return n; - } - freeze(n) { - if (Object.isFrozen(n)) - return n; - if (n.c) { - const c = [...n.c].sort((a, b) => a[0] < b[0] ? -1 : 1).map(([k, n2]) => [k, this.freeze(n2)]); - n.c = new Map(c); - Object.freeze(n.c); - } - return Object.freeze(n); - } - tryToCache(n) { - if (!this._canBeCached(n)) { - return n; - } - const sig = this.signature(n); - const ref = this.signatures.get(sig); - if (ref !== void 0) { - return this.tryCacheFrozen(ref); - } - this.signatures.set(sig, this.freeze(n)); - return n; - } - storeTransform(src, s, result) { - if (!Object.isFrozen(result) || !Object.isFrozen(src)) - return; - const t = this.transforms.get(src) ?? /* @__PURE__ */ new Map(); - t.set(s, result); - this.transforms.set(src, t); - } - addChild(node, head, child) { - if (node.c?.get(head) !== child) { - if (!node.c || Object.isFrozen(node)) { - node = { ...node, c: new Map(node.c ?? []) }; - } - node.c?.set(head, child); - } - return Object.isFrozen(child) ? this.tryToCache(node) : node; - } - buildTail(s) { - const v = this.tails.get(s); - if (v) - return v; - const head = s[0]; - const tail = s.slice(1); - const t = this.tails.get(tail); - const c = t || this.buildTail(tail); - const n = this.addChild({ f: void 0, c: void 0 }, head, c); - if (!t) { - return n; - } - const cachedNode = this.tryCacheFrozen(Object.freeze(n)); - this.tails.set(s, cachedNode); - return cachedNode; - } - _insert(node, s, d) { - const orig = node; - if (Object.isFrozen(node)) { - const n = this.transforms.get(node)?.get(s); - if (n) { - return this.tryCacheFrozen(n); - } - } - if (!s) { - if (!node.c) { - return this._eow; - } else { - node = copyIfFrozen(node); - node.f = this._eow.f; - return node; - } - } - const head = s[0]; - const tail = s.slice(1); - const cNode = node.c?.get(head); - const child = cNode ? this._insert(cNode, tail, d + 1) : this.buildTail(tail); - node = this.addChild(node, head, child); - this.storeTransform(orig, s, node); - this.lastPath[d] = { s: head, n: child }; - return node; - } - insertWord(word) { - let d = 1; - for (const s of word.split("")) { - const p = this.lastPath[d]; - if (p?.s !== s) - break; - d++; - } - if (word.length < d) { - d = word.length; - } - this.lastPath.length = d; - d -= 1; - const { n } = this.lastPath[d]; - const tail = word.slice(d); - this.lastPath[d].n = this._insert(n, tail, d + 1); - while (d > 0) { - const { s, n: n2 } = this.lastPath[d]; - d -= 1; - const parent = this.lastPath[d]; - const pn = parent.n; - parent.n = this.addChild(pn, s, n2); - if (pn === parent.n) - break; - const tail2 = word.slice(d); - this.storeTransform(pn, tail2, parent.n); - } + return !settings.errorFilter(error2); + } + exports.isFatalError = isFatalError; + function isAppliedFilter(filter3, value) { + return filter3 === null || filter3(value); + } + exports.isAppliedFilter = isAppliedFilter; + function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); + } + exports.replacePathSegmentSeparator = replacePathSegmentSeparator; + function joinPathSegments(a, b, separator) { + if (a === "") { + return b; } - insert(words) { - for (const w of words) { - w && this.insertWord(w); - } + if (a.endsWith(separator)) { + return a + b; } - /** - * Resets the builder - */ - reset() { - this._root = (0, trie_util_js_1.createTrieRoot)(this.trieOptions); - this.cached.clear(); - this.signatures.clear(); - this.signatures.set(this.signature(this._eow), this._eow); - this.count = 0; - this.cached.set(this._eow, this.count++); - } - build(consolidateSuffixes = false) { - const root = this._root; - this.reset(); - return new trie_js_1.Trie(consolidateSuffixes ? (0, consolidate_js_1.consolidate)(root) : root); - } - }; - exports.TrieBuilder = TrieBuilder; - function copyIfFrozen(n) { - if (!Object.isFrozen(n)) - return n; - const c = n.c ? new Map(n.c) : void 0; - return { f: n.f, c }; + return a + separator + b; } + exports.joinPathSegments = joinPathSegments; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/normalizeWord.js -var require_normalizeWord = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/normalizeWord.js"(exports) { +// node_modules/@nodelib/fs.walk/out/readers/reader.js +var require_reader = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeWordForCaseInsensitive = exports.normalizeWordToLowercase = exports.normalizeWord = void 0; - var normalizeWord = (text) => text.normalize(); - exports.normalizeWord = normalizeWord; - var normalizeWordToLowercase = (text) => text.toLowerCase().normalize("NFD").replace(/\p{M}/gu, ""); - exports.normalizeWordToLowercase = normalizeWordToLowercase; - var normalizeWordForCaseInsensitive = (text) => { - const t = text.toLowerCase(); - return [t, t.normalize("NFD").replace(/\p{M}/gu, "")]; + var common = require_common4(); + var Reader = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } }; - exports.normalizeWordForCaseInsensitive = normalizeWordForCaseInsensitive; + exports.default = Reader; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/SimpleDictionaryParser.js -var require_SimpleDictionaryParser = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/SimpleDictionaryParser.js"(exports) { +// node_modules/@nodelib/fs.walk/out/readers/async.js +var require_async3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.parseDictionary = exports.parseLinesToDictionary = exports.parseDictionaryLines = exports.createDictionaryLineParserMapper = exports.setOfCSpellDirectiveFlags = exports.cSpellToolDirective = exports.defaultParseDictionaryOptions = void 0; - var sync_1 = require_sync(); - var constants_js_1 = require_constants4(); - var TrieBuilder_js_1 = require_TrieBuilder(); - var normalizeWord_js_1 = require_normalizeWord(); - var RegExpSplit = /[\s,;]/g; - var _defaultOptions = { - commentCharacter: constants_js_1.LINE_COMMENT, - optionalCompoundCharacter: constants_js_1.OPTIONAL_COMPOUND_FIX, - compoundCharacter: constants_js_1.COMPOUND_FIX, - forbiddenPrefix: constants_js_1.FORBID_PREFIX, - caseInsensitivePrefix: constants_js_1.CASE_INSENSITIVE_PREFIX, - keepExactPrefix: constants_js_1.IDENTITY_PREFIX, - stripCaseAndAccents: true, - stripCaseAndAccentsKeepDuplicate: false, - stripCaseAndAccentsOnForbidden: false, - split: false, - splitKeepBoth: false, - splitSeparator: RegExpSplit - }; - exports.defaultParseDictionaryOptions = Object.freeze(_defaultOptions); - exports.cSpellToolDirective = "cspell-dictionary:"; - exports.setOfCSpellDirectiveFlags = ["no-split", "split", "generate-alternatives", "no-generate-alternatives"]; - function createDictionaryLineParserMapper(options) { - const _options = options || _defaultOptions; - const { commentCharacter = _defaultOptions.commentCharacter, optionalCompoundCharacter: optionalCompound = _defaultOptions.optionalCompoundCharacter, compoundCharacter: compound = _defaultOptions.compoundCharacter, caseInsensitivePrefix: ignoreCase = _defaultOptions.caseInsensitivePrefix, forbiddenPrefix: forbidden = _defaultOptions.forbiddenPrefix, keepExactPrefix: keepCase = _defaultOptions.keepExactPrefix, splitSeparator = _defaultOptions.splitSeparator, splitKeepBoth = _defaultOptions.splitKeepBoth, stripCaseAndAccentsKeepDuplicate = _defaultOptions.stripCaseAndAccentsKeepDuplicate, stripCaseAndAccentsOnForbidden = _defaultOptions.stripCaseAndAccentsOnForbidden } = _options; - let { stripCaseAndAccents = _defaultOptions.stripCaseAndAccents, split = _defaultOptions.split } = _options; - function isString2(line) { - return typeof line === "string"; - } - function trim(line) { - return line.trim(); - } - function removeComments(line) { - const idx = line.indexOf(commentCharacter); - if (idx < 0) - return line; - const idxDirective = line.indexOf(exports.cSpellToolDirective, idx); - if (idxDirective >= 0) { - const flags = line.slice(idxDirective).split(/[\s,;]/g).map((s) => s.trim()).filter((a) => !!a); - for (const flag of flags) { - switch (flag) { - case "split": - split = true; - break; - case "no-split": - split = false; - break; - case "no-generate-alternatives": - stripCaseAndAccents = false; - break; - case "generate-alternatives": - stripCaseAndAccents = true; - break; - } + var events_1 = require("events"); + var fsScandir = require_out2(); + var fastq = require_queue(); + var common = require_common4(); + var reader_1 = require_reader(); + var AsyncReader = class extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit("end"); } - } - return line.slice(0, idx).trim(); + }; } - function filterEmptyLines(line) { - return !!line; + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; } - function* mapOptionalPrefix(line) { - if (line[0] === optionalCompound) { - const t = line.slice(1); - yield t; - yield compound + t; - } else { - yield line; - } + get isDestroyed() { + return this._isDestroyed; } - function* mapOptionalSuffix(line) { - if (line.slice(-1) === optionalCompound) { - const t = line.slice(0, -1); - yield t; - yield t + compound; - } else { - yield line; + destroy() { + if (this._isDestroyed) { + throw new Error("The reader is already destroyed"); } + this._isDestroyed = true; + this._queue.killAndDrain(); } - const doNotNormalizePrefix = /* @__PURE__ */ Object.create(null); - [ignoreCase, keepCase, '"'].forEach((prefix) => doNotNormalizePrefix[prefix] = true); - if (!stripCaseAndAccentsOnForbidden) { - doNotNormalizePrefix[forbidden] = true; - } - function removeDoublePrefix(w) { - return w.startsWith(ignoreCase + ignoreCase) ? w.slice(1) : w; + onEntry(callback) { + this._emitter.on("entry", callback); } - function stripKeepCasePrefixAndQuotes(word) { - word = word.replace(/"(.*?)"/g, "$1"); - return word[0] === keepCase ? word.slice(1) : word; + onError(callback) { + this._emitter.once("error", callback); } - function _normalize(word) { - return (0, normalizeWord_js_1.normalizeWord)(stripKeepCasePrefixAndQuotes(word)); + onEnd(callback) { + this._emitter.once("end", callback); } - function* mapNormalize(word) { - const nWord = _normalize(word); - const forms = /* @__PURE__ */ new Set(); - forms.add(nWord); - if (stripCaseAndAccents && !(word[0] in doNotNormalizePrefix)) { - for (const n of (0, normalizeWord_js_1.normalizeWordForCaseInsensitive)(nWord)) { - (stripCaseAndAccentsKeepDuplicate || n !== nWord) && forms.add(ignoreCase + n); + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error2) => { + if (error2 !== null) { + this._handleError(error2); } - } - yield* forms; + }); } - function* splitWords(lines) { - for (const line of lines) { - if (split) { - const lineEscaped = line.indexOf('"') >= 0 ? line.replace(/".*?"/g, (quoted) => " " + quoted.replace(/(\s)/g, "\\$1") + " ") : line; - const words = splitLine(lineEscaped, splitSeparator); - yield* words.map((escaped) => escaped.replace(/\\/g, "")); - if (!splitKeepBoth) - continue; + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error2, entries) => { + if (error2 !== null) { + done(error2, void 0); + return; } - yield line; - } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, void 0); + }); } - function* splitLines(paragraphs) { - for (const paragraph of paragraphs) { - yield* paragraph.split("\n"); + _handleError(error2) { + if (this._isDestroyed || !common.isFatalError(this._settings, error2)) { + return; } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit("error", error2); } - const processLines = (0, sync_1.opCombine)((0, sync_1.opFilter)(isString2), splitLines, (0, sync_1.opMap)(removeComments), splitWords, (0, sync_1.opMap)(trim), (0, sync_1.opFilter)(filterEmptyLines), (0, sync_1.opConcatMap)(mapOptionalPrefix), (0, sync_1.opConcatMap)(mapOptionalSuffix), (0, sync_1.opConcatMap)(mapNormalize), (0, sync_1.opMap)(removeDoublePrefix)); - return processLines; - } - exports.createDictionaryLineParserMapper = createDictionaryLineParserMapper; - function parseDictionaryLines(lines, options) { - return createDictionaryLineParserMapper(options)(typeof lines === "string" ? [lines] : lines); - } - exports.parseDictionaryLines = parseDictionaryLines; - function parseLinesToDictionary(lines, options) { - const _options = mergeOptions(_defaultOptions, options); - const dictLines = parseDictionaryLines(lines, _options); - return (0, TrieBuilder_js_1.buildTrieFast)([...new Set(dictLines)].sort(), { - compoundCharacter: _options.compoundCharacter, - forbiddenWordPrefix: _options.forbiddenPrefix, - stripCaseAndAccentsPrefix: _options.caseInsensitivePrefix - }); - } - exports.parseLinesToDictionary = parseLinesToDictionary; - function parseDictionary(text, options) { - return parseLinesToDictionary(text.split("\n"), options); - } - exports.parseDictionary = parseDictionary; - function mergeOptions(base, ...partials) { - const opt = { ...base }; - for (const p of partials) { - if (!p) - continue; - Object.assign(opt, p); + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== void 0) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); + } } - return opt; - } - var RegExpToEncode = /\\([\s,;])/g; - var RegExpDecode = /<<(%[\da-f]{2})>>/gi; - function encodeLine(line) { - return line.replace(RegExpToEncode, (_, v) => "<<" + encodeURIComponent(v) + ">>"); - } - function decodeLine(line) { - return line.replace(RegExpDecode, (_, v) => "\\" + decodeURIComponent(v)); - } - function splitLine(line, regExp) { - return encodeLine(line).split(regExp).map((line2) => decodeLine(line2)); - } - exports.__testing__ = { - splitLine - }; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestCollector.js -var require_suggestCollector2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestCollector.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.suggestionCollector = exports.isSuggestionResult = exports.impersonateCollector = exports.defaultSuggestionCollectorOptions = exports.compSuggestionResults = void 0; - var suggestCollector_js_1 = require_suggestCollector(); - Object.defineProperty(exports, "compSuggestionResults", { enumerable: true, get: function() { - return suggestCollector_js_1.compSuggestionResults; - } }); - Object.defineProperty(exports, "defaultSuggestionCollectorOptions", { enumerable: true, get: function() { - return suggestCollector_js_1.defaultSuggestionCollectorOptions; - } }); - Object.defineProperty(exports, "impersonateCollector", { enumerable: true, get: function() { - return suggestCollector_js_1.impersonateCollector; - } }); - Object.defineProperty(exports, "isSuggestionResult", { enumerable: true, get: function() { - return suggestCollector_js_1.isSuggestionResult; - } }); - Object.defineProperty(exports, "suggestionCollector", { enumerable: true, get: function() { - return suggestCollector_js_1.suggestionCollector; - } }); - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/index.js -var require_lib7 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hintedWalker = exports.CompoundWordsMethod = exports.expandCharacterSet = exports.normalizeWordToLowercase = exports.normalizeWordForCaseInsensitive = exports.normalizeWord = exports.mergeOptionalWithDefaults = exports.mergeDefaults = exports.isDefined = exports.FLAG_WORD = exports.ChildMap = exports.TrieBuilder = exports.buildTrieFast = exports.buildTrie = exports.walk = exports.trieNodeToRoot = exports.orderTrie = exports.iteratorTrieWords = exports.iterateTrie = exports.isWordTerminationNode = exports.isCircular = exports.insert = exports.has = exports.findNode = exports.createTriFromList = exports.createTrieRoot = exports.countWords = exports.countNodes = exports.Trie = exports.OPTIONAL_COMPOUND_FIX = exports.OPTIONAL_COMPOUND = exports.NORMALIZED = exports.FORBID_PREFIX = exports.FORBID = exports.defaultTrieOptions = exports.COMPOUND_FIX = exports.COMPOUND = exports.CASE_INSENSITIVE_PREFIX = exports.suggestionCollector = exports.impersonateCollector = exports.parseDictionaryLines = exports.parseDictionary = exports.createDictionaryLineParser = exports.mapDictionaryInformationToWeightMap = exports.serializeTrie = exports.importTrie = exports.editDistanceWeighted = exports.editDistance = exports.createWeightedMap = exports.consolidate = void 0; - exports.WORD_SEPARATOR = exports.walker = exports.JOIN_SEPARATOR = void 0; - var consolidate_js_1 = require_consolidate(); - Object.defineProperty(exports, "consolidate", { enumerable: true, get: function() { - return consolidate_js_1.consolidate; - } }); - var index_js_1 = require_distance2(); - Object.defineProperty(exports, "createWeightedMap", { enumerable: true, get: function() { - return index_js_1.createWeightedMap; - } }); - Object.defineProperty(exports, "editDistance", { enumerable: true, get: function() { - return index_js_1.editDistance; - } }); - Object.defineProperty(exports, "editDistanceWeighted", { enumerable: true, get: function() { - return index_js_1.editDistanceWeighted; - } }); - var importExport_js_1 = require_importExport(); - Object.defineProperty(exports, "importTrie", { enumerable: true, get: function() { - return importExport_js_1.importTrie; - } }); - Object.defineProperty(exports, "serializeTrie", { enumerable: true, get: function() { - return importExport_js_1.serializeTrie; - } }); - var mapDictionaryInfoToWeightMap_js_1 = require_mapDictionaryInfoToWeightMap(); - Object.defineProperty(exports, "mapDictionaryInformationToWeightMap", { enumerable: true, get: function() { - return mapDictionaryInfoToWeightMap_js_1.mapDictionaryInformationToWeightMap; - } }); - var SimpleDictionaryParser_js_1 = require_SimpleDictionaryParser(); - Object.defineProperty(exports, "createDictionaryLineParser", { enumerable: true, get: function() { - return SimpleDictionaryParser_js_1.createDictionaryLineParserMapper; - } }); - Object.defineProperty(exports, "parseDictionary", { enumerable: true, get: function() { - return SimpleDictionaryParser_js_1.parseDictionary; - } }); - Object.defineProperty(exports, "parseDictionaryLines", { enumerable: true, get: function() { - return SimpleDictionaryParser_js_1.parseDictionaryLines; - } }); - var suggestCollector_js_1 = require_suggestCollector2(); - Object.defineProperty(exports, "impersonateCollector", { enumerable: true, get: function() { - return suggestCollector_js_1.impersonateCollector; - } }); - Object.defineProperty(exports, "suggestionCollector", { enumerable: true, get: function() { - return suggestCollector_js_1.suggestionCollector; - } }); - var trie_js_1 = require_trie(); - Object.defineProperty(exports, "CASE_INSENSITIVE_PREFIX", { enumerable: true, get: function() { - return trie_js_1.CASE_INSENSITIVE_PREFIX; - } }); - Object.defineProperty(exports, "COMPOUND", { enumerable: true, get: function() { - return trie_js_1.COMPOUND; - } }); - Object.defineProperty(exports, "COMPOUND_FIX", { enumerable: true, get: function() { - return trie_js_1.COMPOUND_FIX; - } }); - Object.defineProperty(exports, "defaultTrieOptions", { enumerable: true, get: function() { - return trie_js_1.defaultTrieOptions; - } }); - Object.defineProperty(exports, "FORBID", { enumerable: true, get: function() { - return trie_js_1.FORBID; - } }); - Object.defineProperty(exports, "FORBID_PREFIX", { enumerable: true, get: function() { - return trie_js_1.FORBID_PREFIX; - } }); - Object.defineProperty(exports, "NORMALIZED", { enumerable: true, get: function() { - return trie_js_1.NORMALIZED; - } }); - Object.defineProperty(exports, "OPTIONAL_COMPOUND", { enumerable: true, get: function() { - return trie_js_1.OPTIONAL_COMPOUND; - } }); - Object.defineProperty(exports, "OPTIONAL_COMPOUND_FIX", { enumerable: true, get: function() { - return trie_js_1.OPTIONAL_COMPOUND_FIX; - } }); - Object.defineProperty(exports, "Trie", { enumerable: true, get: function() { - return trie_js_1.Trie; - } }); - var trie_util_js_1 = require_trie_util(); - Object.defineProperty(exports, "countNodes", { enumerable: true, get: function() { - return trie_util_js_1.countNodes; - } }); - Object.defineProperty(exports, "countWords", { enumerable: true, get: function() { - return trie_util_js_1.countWords; - } }); - Object.defineProperty(exports, "createTrieRoot", { enumerable: true, get: function() { - return trie_util_js_1.createTrieRoot; - } }); - Object.defineProperty(exports, "createTriFromList", { enumerable: true, get: function() { - return trie_util_js_1.createTriFromList; - } }); - Object.defineProperty(exports, "findNode", { enumerable: true, get: function() { - return trie_util_js_1.findNode; - } }); - Object.defineProperty(exports, "has", { enumerable: true, get: function() { - return trie_util_js_1.has; - } }); - Object.defineProperty(exports, "insert", { enumerable: true, get: function() { - return trie_util_js_1.insert; - } }); - Object.defineProperty(exports, "isCircular", { enumerable: true, get: function() { - return trie_util_js_1.isCircular; - } }); - Object.defineProperty(exports, "isWordTerminationNode", { enumerable: true, get: function() { - return trie_util_js_1.isWordTerminationNode; - } }); - Object.defineProperty(exports, "iterateTrie", { enumerable: true, get: function() { - return trie_util_js_1.iterateTrie; - } }); - Object.defineProperty(exports, "iteratorTrieWords", { enumerable: true, get: function() { - return trie_util_js_1.iteratorTrieWords; - } }); - Object.defineProperty(exports, "orderTrie", { enumerable: true, get: function() { - return trie_util_js_1.orderTrie; - } }); - Object.defineProperty(exports, "trieNodeToRoot", { enumerable: true, get: function() { - return trie_util_js_1.trieNodeToRoot; - } }); - Object.defineProperty(exports, "walk", { enumerable: true, get: function() { - return trie_util_js_1.walk; - } }); - var TrieBuilder_js_1 = require_TrieBuilder(); - Object.defineProperty(exports, "buildTrie", { enumerable: true, get: function() { - return TrieBuilder_js_1.buildTrie; - } }); - Object.defineProperty(exports, "buildTrieFast", { enumerable: true, get: function() { - return TrieBuilder_js_1.buildTrieFast; - } }); - Object.defineProperty(exports, "TrieBuilder", { enumerable: true, get: function() { - return TrieBuilder_js_1.TrieBuilder; - } }); - var TrieNode_js_1 = require_TrieNode(); - Object.defineProperty(exports, "ChildMap", { enumerable: true, get: function() { - return TrieNode_js_1.ChildMap; - } }); - Object.defineProperty(exports, "FLAG_WORD", { enumerable: true, get: function() { - return TrieNode_js_1.FLAG_WORD; - } }); - var isDefined_js_1 = require_isDefined(); - Object.defineProperty(exports, "isDefined", { enumerable: true, get: function() { - return isDefined_js_1.isDefined; - } }); - var mergeDefaults_js_1 = require_mergeDefaults(); - Object.defineProperty(exports, "mergeDefaults", { enumerable: true, get: function() { - return mergeDefaults_js_1.mergeDefaults; - } }); - var mergeOptionalWithDefaults_js_1 = require_mergeOptionalWithDefaults(); - Object.defineProperty(exports, "mergeOptionalWithDefaults", { enumerable: true, get: function() { - return mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults; - } }); - var normalizeWord_js_1 = require_normalizeWord(); - Object.defineProperty(exports, "normalizeWord", { enumerable: true, get: function() { - return normalizeWord_js_1.normalizeWord; - } }); - Object.defineProperty(exports, "normalizeWordForCaseInsensitive", { enumerable: true, get: function() { - return normalizeWord_js_1.normalizeWordForCaseInsensitive; - } }); - Object.defineProperty(exports, "normalizeWordToLowercase", { enumerable: true, get: function() { - return normalizeWord_js_1.normalizeWordToLowercase; - } }); - var text_js_1 = require_text(); - Object.defineProperty(exports, "expandCharacterSet", { enumerable: true, get: function() { - return text_js_1.expandCharacterSet; - } }); - var index_js_2 = require_walker2(); - Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function() { - return index_js_2.CompoundWordsMethod; - } }); - Object.defineProperty(exports, "hintedWalker", { enumerable: true, get: function() { - return index_js_2.hintedWalker; - } }); - Object.defineProperty(exports, "JOIN_SEPARATOR", { enumerable: true, get: function() { - return index_js_2.JOIN_SEPARATOR; - } }); - Object.defineProperty(exports, "walker", { enumerable: true, get: function() { - return index_js_2.walker; - } }); - Object.defineProperty(exports, "WORD_SEPARATOR", { enumerable: true, get: function() { - return index_js_2.WORD_SEPARATOR; - } }); - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/index.js -var require_cjs5 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; + _emitEntry(entry) { + this._emitter.emit("entry", entry); } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(require_lib7(), exports); + exports.default = AsyncReader; } }); -// node_modules/cspell-lib/dist/cjs/Settings/DictionaryReferenceCollection.js -var require_DictionaryReferenceCollection = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/DictionaryReferenceCollection.js"(exports) { +// node_modules/@nodelib/fs.walk/out/providers/async.js +var require_async4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDictionaryReferenceCollection = void 0; - function createDictionaryReferenceCollection(dictionaries) { - return new _DictionaryReferenceCollection(dictionaries); - } - exports.createDictionaryReferenceCollection = createDictionaryReferenceCollection; - var _DictionaryReferenceCollection = class { - constructor(dictionaries) { - this.dictionaries = dictionaries; - this.collection = collect(dictionaries); - } - isEnabled(name) { - const entry = this.collection[name]; - return entry === void 0 ? void 0 : !!(entry & 1); - } - isBlocked(name) { - const entry = this.collection[name]; - return entry === void 0 ? void 0 : !(entry & 1); - } - enabled() { - return this.dictionaryIds.filter((n) => this.isEnabled(n)); - } - blocked() { - return this.dictionaryIds.filter((n) => this.isBlocked(n)); + var async_1 = require_async3(); + var AsyncProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; } - get dictionaryIds() { - return Object.keys(this.collection); + read(callback) { + this._reader.onError((error2) => { + callFailureCallback(callback, error2); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); } }; - function collect(dictionaries) { - const refs = dictionaries.map(normalizeName).map(mapReference); - const col = {}; - for (const ref of refs) { - col[ref.name] = Math.max(ref.weight, col[ref.name] || 0); - } - return col; - } - function normalizeName(entry) { - return entry.normalize().trim(); + exports.default = AsyncProvider; + function callFailureCallback(callback, error2) { + callback(error2); } - function mapReference(ref) { - const name = ref.replace(/^!+/, ""); - const weight = ref.length - name.length + 1; - return { name: name.trim(), weight }; + function callSuccessCallback(callback, entries) { + callback(null, entries); } } }); -// node_modules/cspell-lib/dist/cjs/Settings/DictionarySettings.js -var require_DictionarySettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/DictionarySettings.js"(exports) { +// node_modules/@nodelib/fs.walk/out/providers/stream.js +var require_stream2 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDictionaryDefinitionInlineInternalWithSource = exports.isDictionaryFileDefinitionInternalWithSource = exports.isDictionaryDefinitionInternal = exports.isDictionaryDefinitionWithSource = exports.calcDictionaryDefsToLoad = exports.mapDictDefToInternal = exports.mapDictDefsToInternal = exports.filterDictDefsToLoad = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var path16 = __importStar(require("path")); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var AutoResolve_js_1 = require_AutoResolve(); - var resolveFile_js_1 = require_resolveFile(); - var util_js_1 = require_util(); - var DictionaryReferenceCollection_js_1 = require_DictionaryReferenceCollection(); - function filterDictDefsToLoad(dictRefCol, defs) { - const allActiveDefs = defs.filter(({ name }) => dictRefCol.isEnabled(name)).map(fixPath); - return [...new Map(allActiveDefs.map((d) => [d.name, d])).values()]; - } - exports.filterDictDefsToLoad = filterDictDefsToLoad; - function fixPath(def) { - if (def instanceof _DictionaryDefinitionInternalWithSource) { - return def; - } - const newPath = fixDicPath(def.path, def.file); - return { - ...def, - file: void 0, - path: newPath - }; - } - function fixDicPath(defPath, defFile) { - const parts = [defPath || "", defFile || ""].filter((p) => !!p); - return parts.length > 1 ? path16.join(...parts) : parts[0] || ""; - } - function mapDictDefsToInternal(defs, pathToSettingsFile) { - return defs?.map((def) => mapDictDefToInternal(def, pathToSettingsFile)); - } - exports.mapDictDefsToInternal = mapDictDefsToInternal; - var internalDefs = new AutoResolve_js_1.AutoResolveWeakCache(); - function mapDictDefToInternal(def, pathToSettingsFile) { - return internalDefs.get(def, (def2) => _mapDictDefToInternal(def2, pathToSettingsFile)); - } - exports.mapDictDefToInternal = mapDictDefToInternal; - function _mapDictDefToInternal(def, pathToSettingsFile) { - if (isDictionaryDefinitionWithSource(def)) { - return def; - } - if ((0, CSpellSettingsInternalDef_js_1.isDictionaryDefinitionInlineInternal)(def)) { - return { ...def, __source: pathToSettingsFile }; - } - return new _DictionaryDefinitionInternalWithSource(def, pathToSettingsFile); - } - function determineName(filename, options) { - return options.name || path16.basename(filename); - } - function calcDictionaryDefsToLoad(settings) { - const { dictionaries = [], dictionaryDefinitions = [], noSuggestDictionaries = [] } = settings; - const colNoSug = (0, DictionaryReferenceCollection_js_1.createDictionaryReferenceCollection)(noSuggestDictionaries); - const colDicts = (0, DictionaryReferenceCollection_js_1.createDictionaryReferenceCollection)(dictionaries.concat(colNoSug.enabled())); - const modDefs = dictionaryDefinitions.map((def) => { - const enabled = colNoSug.isEnabled(def.name); - if (enabled === void 0) - return def; - return { ...def, noSuggest: enabled }; - }); - return filterDictDefsToLoad(colDicts, modDefs); - } - exports.calcDictionaryDefsToLoad = calcDictionaryDefsToLoad; - function isDictionaryDefinitionWithSource(d) { - return isDictionaryFileDefinitionInternalWithSource(d) || isDictionaryDefinitionInlineInternalWithSource(d); - } - exports.isDictionaryDefinitionWithSource = isDictionaryDefinitionWithSource; - function isDictionaryDefinitionInternal(def) { - return def instanceof _DictionaryDefinitionInternalWithSource; - } - exports.isDictionaryDefinitionInternal = isDictionaryDefinitionInternal; - function isDictionaryFileDefinitionInternalWithSource(def) { - return def instanceof _DictionaryDefinitionInternalWithSource; - } - exports.isDictionaryFileDefinitionInternalWithSource = isDictionaryFileDefinitionInternalWithSource; - function isDictionaryDefinitionInlineInternalWithSource(def) { - return (0, CSpellSettingsInternalDef_js_1.isDictionaryDefinitionInlineInternal)(def) && !!def.__source; - } - exports.isDictionaryDefinitionInlineInternalWithSource = isDictionaryDefinitionInlineInternalWithSource; - var _DictionaryDefinitionInternalWithSource = class { - constructor(def, __source) { - this.__source = __source; - const defAll = def; - const { path: relPath = "", file = "", addWords, description, dictionaryInformation, type, repMap, noSuggest, scope, useCompounds } = defAll; - const defaultPath = path16.dirname(__source); - const filePath = fixDicPath(relPath, file); - const name = determineName(filePath, def); - const r = (0, resolveFile_js_1.resolveFile)(filePath, defaultPath); - const ddi = { - name, - file: void 0, - path: r.filename, - addWords, - description, - dictionaryInformation, - type, - repMap, - noSuggest, - scope, - useCompounds - }; - Object.assign(this, (0, util_js_1.clean)(ddi)); - this.ddi = ddi; - this.name = ddi.name; - this.file = ddi.file; - this.path = ddi.path; - this._weightMap = this.dictionaryInformation ? (0, cspell_trie_lib_1.mapDictionaryInformationToWeightMap)(this.dictionaryInformation) : void 0; - } - get weightMap() { - return this._weightMap; + var stream_1 = require("stream"); + var async_1 = require_async3(); + var StreamProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { + }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); } - toJSON() { - return this.ddi; + read() { + this._reader.onError((error2) => { + this._stream.emit("error", error2); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; } }; + exports.default = StreamProvider; } }); -// node_modules/cspell-lib/dist/cjs/util/textRegex.js -var require_textRegex = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/textRegex.js"(exports) { +// node_modules/@nodelib/fs.walk/out/readers/sync.js +var require_sync3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.stringToRegExp = exports.regExNumericLiteral = exports.regExTrailingEndings = exports.regExDanglingQuote = exports.regExEscapeCharacters = exports.regExAccents = exports.regExMatchRegExParts = exports.regExPossibleWordBreaks = exports.regExAllLower = exports.regExAllUpper = exports.regExFirstUpper = exports.regExIgnoreCharacters = exports.regExWordsAndDigits = exports.regExWords = exports.regExSplitWords2 = exports.regExSplitWords = exports.regExUpperSOrIng = void 0; - exports.regExUpperSOrIng = /([\p{Lu}\p{M}]+\\?['’]?(?:s|ing|ies|es|ings|ed|ning))(?!\p{Ll})/gu; - exports.regExSplitWords = /(\p{Ll}\p{M}?)(\p{Lu})/gu; - exports.regExSplitWords2 = /(\p{Lu}\p{M}?)(\p{Lu}\p{M}?\p{Ll})/gu; - exports.regExWords = /\p{L}\p{M}?(?:(?:\\?['’])?\p{L}\p{M}?)*/gu; - exports.regExWordsAndDigits = /[\p{L}\w'’`.+-](?:(?:\\(?=[']))?[\p{L}\p{M}\w'’`.+-])*/gu; - exports.regExIgnoreCharacters = /[\p{sc=Hiragana}\p{sc=Han}\p{sc=Katakana}\u30A0-\u30FF\p{sc=Hangul}]/gu; - exports.regExFirstUpper = /^\p{Lu}\p{M}?\p{Ll}+$/u; - exports.regExAllUpper = /^(?:\p{Lu}\p{M}?)+$/u; - exports.regExAllLower = /^(?:\p{Ll}\p{M}?)+$/u; - exports.regExPossibleWordBreaks = /[-+_’'`.\s]/g; - exports.regExMatchRegExParts = /^\s*\/([\s\S]*?)\/([gimuxy]*)\s*$/; - exports.regExAccents = /\p{M}/gu; - exports.regExEscapeCharacters = /(?<=\\)[anrvtbf]/gi; - exports.regExDanglingQuote = /(?<=(?:^|(?!\p{M})\P{L})(?:\p{L}\p{M}?)?)[']/gu; - exports.regExTrailingEndings = /(?<=(?:\p{Lu}\p{M}?){2})['’]?(?:s|d|ings?|ies|e[ds]?|ning|th|nth)(?!\p{Ll})/gu; - exports.regExNumericLiteral = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/; - function stringToRegExp(pattern, defaultFlags = "gimu", forceFlags = "g") { - if (pattern instanceof RegExp) { - return pattern; + var fsScandir = require_out2(); + var common = require_common4(); + var reader_1 = require_reader(); + var SyncReader = class extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = /* @__PURE__ */ new Set(); } - try { - const [, pat, flag] = [ - ...pattern.match(exports.regExMatchRegExParts) || ["", pattern.trim(), defaultFlags], - forceFlags - ]; - if (pat) { - const regPattern = flag.includes("x") ? removeVerboseFromRegExp(pat) : pat; - const flags = [...new Set(forceFlags + flag)].join("").replace(/[^gimuy]/g, ""); - const regex = new RegExp(regPattern, flags); - return regex; - } - } catch (e) { + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; } - return void 0; - } - exports.stringToRegExp = stringToRegExp; - var SPACES = { - " ": true, - "\n": true, - "\r": true, - " ": true - }; - function removeVerboseFromRegExp(pattern) { - function escape(acc) { - const char = pattern[acc.idx]; - if (char !== "\\") - return void 0; - const next = pattern[++acc.idx]; - acc.idx++; - if (next === "#") { - acc.result += "#"; - return acc; - } - if (!(next in SPACES)) { - acc.result += "\\" + next; - return acc; - } - acc.result += next; - if (next === "\r" && pattern[acc.idx] === "\n") { - acc.result += "\n"; - acc.idx++; - } - return acc; + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); } - function braces(acc) { - const char = pattern[acc.idx]; - if (char !== "[") - return void 0; - acc.result += char; - acc.idx++; - let escCount = 0; - while (acc.idx < pattern.length) { - const char2 = pattern[acc.idx]; - acc.result += char2; - acc.idx++; - if (char2 === "]" && !(escCount & 1)) - break; - escCount = char2 === "\\" ? escCount + 1 : 0; + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); } - return acc; - } - function spaces(acc) { - const char = pattern[acc.idx]; - if (!(char in SPACES)) - return void 0; - acc.idx++; - return acc; } - function comments(acc) { - const char = pattern[acc.idx]; - if (char !== "#") - return void 0; - while (acc.idx < pattern.length && pattern[acc.idx] !== "\n") { - acc.idx++; + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } catch (error2) { + this._handleError(error2); } - return acc; } - function copy(acc) { - const char = pattern[acc.idx++]; - acc.result += char; - return acc; + _handleError(error2) { + if (!common.isFatalError(this._settings, error2)) { + return; + } + throw error2; } - const reducers = [escape, braces, spaces, comments, copy]; - const result = { idx: 0, result: "" }; - while (result.idx < pattern.length) { - for (const r of reducers) { - if (r(result)) - break; + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== void 0) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); } } - return result.result; - } + _pushToStorage(entry) { + this._storage.push(entry); + } + }; + exports.default = SyncReader; } }); -// node_modules/cspell-lib/dist/cjs/Settings/patterns.js -var require_patterns = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/patterns.js"(exports) { +// node_modules/@nodelib/fs.walk/out/providers/sync.js +var require_sync4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolvePatterns = void 0; - var textRegex_js_1 = require_textRegex(); - var util_js_1 = require_util(); - function resolvePatterns(regExpList = [], patternDefinitions = []) { - const patternMap = new Map(patternDefinitions.map((def) => [def.name.toLowerCase(), def.pattern])); - const resolved = /* @__PURE__ */ new Set(); - function resolvePattern(p) { - if (resolved.has(p)) - return void 0; - resolved.add(p); - return patternMap.get(p.toString().toLowerCase()) || p; + var sync_1 = require_sync3(); + var SyncProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); } - function* flatten(patterns) { - for (const pattern of patterns) { - if (Array.isArray(pattern)) { - yield* flatten(pattern.map(resolvePattern).filter(util_js_1.isDefined)); - } else { - yield pattern; - } - } + read() { + return this._reader.read(); } - const patternList = regExpList.map(resolvePattern).filter(util_js_1.isDefined); - return [...flatten(patternList)].map(toRegExp).filter(util_js_1.isDefined); - } - exports.resolvePatterns = resolvePatterns; - function toRegExp(pattern) { - return pattern instanceof RegExp ? new RegExp(pattern) : (0, textRegex_js_1.stringToRegExp)(pattern, "gim", "g"); - } + }; + exports.default = SyncProvider; } }); -// node_modules/cspell-lib/dist/cjs/Settings/CSpellSettingsServer.js -var require_CSpellSettingsServer = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/CSpellSettingsServer.js"(exports) { +// node_modules/@nodelib/fs.walk/out/settings.js +var require_settings3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/settings.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; + Object.defineProperty(exports, "__esModule", { value: true }); + var path26 = require("path"); + var fsScandir = require_out2(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, void 0); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); } - Object.defineProperty(o, k2, desc); - } : 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.walk/out/index.js +var require_out3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/index.js"(exports) { + "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.extractDependencies = exports.getSources = exports.checkFilenameMatchesGlob = exports.toInternalSettings = exports.finalizeSettings = exports.calcOverrideSettings = exports.mergeInDocSettings = exports.mergeSettings = void 0; - var assert_1 = __importDefault(require("assert")); - var cspell_glob_1 = require_cjs(); - var path16 = __importStar(require("path")); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var AutoResolve_js_1 = require_AutoResolve(); - var util = __importStar(require_util()); - var constants_js_1 = require_constants3(); - var DictionarySettings_js_1 = require_DictionarySettings(); - var patterns_js_1 = require_patterns(); - function mergeListUnique(left, right) { - if (!Array.isArray(left)) - return Array.isArray(right) ? right : void 0; - if (!Array.isArray(right)) - return left; - if (!right.length) - return left; - if (!left.length) - return right; - return [.../* @__PURE__ */ new Set([...left, ...right])]; - } - function mergeList(left, right) { - if (!Array.isArray(left)) - return Array.isArray(right) ? right : void 0; - if (!Array.isArray(right)) - return left; - if (!left.length) - return right; - if (!right.length) - return left; - return left.concat(right); - } - var emptyWords = []; - Object.freeze(emptyWords); - var cachedMerges = /* @__PURE__ */ new WeakMap(); - function _mergeWordsCached(left, right) { - const map = (0, AutoResolve_js_1.autoResolveWeak)(cachedMerges, left, () => /* @__PURE__ */ new WeakMap()); - return (0, AutoResolve_js_1.autoResolveWeak)(map, right, () => left.concat(right)); - } - function mergeWordsCached(left, right) { - if (!Array.isArray(left) || !left.length) { - return Array.isArray(right) ? right.length ? right : emptyWords : void 0; - } - if (!Array.isArray(right) || !right.length) - return left; - return _mergeWordsCached(left, right); - } - function mergeObjects(left, right) { - if (!left || typeof left !== "object") - return !right || typeof right !== "object" ? void 0 : right; - if (!right || typeof right !== "object") - return left; - return { ...left, ...right }; - } - function replaceIfNotEmpty(left = [], right = []) { - const filtered = right.filter((a) => !!a); - if (filtered.length) { - return filtered; - } - return left; - } - function mergeSettings3(left, ...settings) { - const rawSettings = settings.filter(util.isDefined).reduce(merge, toInternalSettings(left)); - return util.clean(rawSettings); - } - exports.mergeSettings = mergeSettings3; - function isEmpty(obj) { - return Object.keys(obj).length === 0 && obj.constructor === Object; - } - var mergeCache = new AutoResolve_js_1.AutoResolveWeakCache(); - function merge(left, right) { - const map = mergeCache.get(left, () => /* @__PURE__ */ new WeakMap()); - return (0, AutoResolve_js_1.autoResolveWeak)(map, right, () => _merge(left, right)); - } - function _merge(left, right) { - const _left = toInternalSettings(left); - const _right = toInternalSettings(right); - if (left === right) { - return _left; - } - if (isEmpty(right)) { - return _left; - } - if (isEmpty(left)) { - return _right; - } - if (isLeftAncestorOfRight(_left, _right)) { - return _right; - } - if (doesLeftHaveRightAncestor(_left, _right)) { - return _left; - } - const includeRegExpList = takeRightOtherwiseLeft(_left.includeRegExpList, _right.includeRegExpList); - const optionals = includeRegExpList?.length ? { includeRegExpList } : {}; - const version3 = max(_left.version, _right.version); - const valuesToClear = { - name: void 0, - id: void 0, - description: void 0, - globRoot: void 0, - import: void 0, - __importRef: void 0 - }; - const settings = (0, CSpellSettingsInternalDef_js_1.cleanCSpellSettingsInternal)({ - ..._left, - ..._right, - ...optionals, - ...valuesToClear, - version: version3, - words: mergeWordsCached(_left.words, _right.words), - userWords: mergeWordsCached(_left.userWords, _right.userWords), - flagWords: mergeWordsCached(_left.flagWords, _right.flagWords), - ignoreWords: mergeWordsCached(_left.ignoreWords, _right.ignoreWords), - suggestWords: mergeWordsCached(_left.suggestWords, _right.suggestWords), - enabledLanguageIds: replaceIfNotEmpty(_left.enabledLanguageIds, _right.enabledLanguageIds), - enableFiletypes: mergeList(_left.enableFiletypes, _right.enableFiletypes), - ignoreRegExpList: mergeListUnique(_left.ignoreRegExpList, _right.ignoreRegExpList), - patterns: mergeListUnique(_left.patterns, _right.patterns), - dictionaryDefinitions: mergeListUnique(_left.dictionaryDefinitions, _right.dictionaryDefinitions), - dictionaries: mergeListUnique(_left.dictionaries, _right.dictionaries), - noSuggestDictionaries: mergeListUnique(_left.noSuggestDictionaries, _right.noSuggestDictionaries), - languageSettings: mergeList(_left.languageSettings, _right.languageSettings), - enabled: _right.enabled !== void 0 ? _right.enabled : _left.enabled, - files: mergeListUnique(_left.files, _right.files), - ignorePaths: versionBasedMergeList(_left.ignorePaths, _right.ignorePaths, version3), - overrides: versionBasedMergeList(_left.overrides, _right.overrides, version3), - features: mergeObjects(_left.features, _right.features), - source: mergeSources(_left, _right), - plugins: mergeList(_left.plugins, _right.plugins), - __imports: mergeImportRefs(_left, _right) - }); - return settings; - } - function versionBasedMergeList(left, right, version3) { - if (version3 === constants_js_1.configSettingsFileVersion0_1) { - return takeRightOtherwiseLeft(left, right); - } - return mergeListUnique(left, right); - } - function isLeftAncestorOfRight(left, right) { - return hasAncestor(right, left, 0); - } - function doesLeftHaveRightAncestor(left, right) { - return hasAncestor(left, right, 1); - } - function hasAncestor(s, ancestor, side) { - const sources = s.source?.sources; - if (!sources) - return false; - const i = side ? sources.length - 1 : 0; - const src = sources[i]; - return src === ancestor || src && hasAncestor(src, ancestor, side) || false; - } - function mergeInDocSettings(left, right) { - const merged = { - ...mergeSettings3(left, right), - includeRegExpList: mergeListUnique(left.includeRegExpList, right.includeRegExpList) - }; - return util.clean(merged); - } - exports.mergeInDocSettings = mergeInDocSettings; - function takeRightOtherwiseLeft(left, right) { - if (right?.length) { - return right; - } - return left || right; - } - function calcOverrideSettings2(settings, filename) { - const _settings = toInternalSettings(settings); - const overrides = _settings.overrides || []; - const result = overrides.filter((override) => checkFilenameMatchesGlob(filename, override.filename)).reduce((settings2, override) => mergeSettings3(settings2, override), _settings); - return result; - } - exports.calcOverrideSettings = calcOverrideSettings2; - function finalizeSettings(settings) { - return _finalizeSettings(toInternalSettings(settings)); - } - exports.finalizeSettings = finalizeSettings; - function _finalizeSettings(settings) { - const finalized = { - ...settings, - finalized: true, - ignoreRegExpList: (0, patterns_js_1.resolvePatterns)(settings.ignoreRegExpList, settings.patterns), - includeRegExpList: (0, patterns_js_1.resolvePatterns)(settings.includeRegExpList, settings.patterns), - parserFn: resolveParser(settings) - }; - finalized.name = "Finalized " + (finalized.name || ""); - finalized.source = { name: settings.name || "src", sources: [settings] }; - return finalized; - } - var cacheInternalSettings = new AutoResolve_js_1.AutoResolveWeakCache(); - function toInternalSettings(settings) { - if (settings === void 0) - return void 0; - if ((0, CSpellSettingsInternalDef_js_1.isCSpellSettingsInternal)(settings)) - return settings; - return cacheInternalSettings.get(settings, _toInternalSettings); - } - exports.toInternalSettings = toInternalSettings; - function _toInternalSettings(settings) { - const { dictionaryDefinitions: defs, ...rest } = settings; - const dictionaryDefinitions = (0, DictionarySettings_js_1.mapDictDefsToInternal)(defs, filenameToDirectory(settings.source?.filename) || resolveCwd()); - const setting = dictionaryDefinitions ? { ...rest, dictionaryDefinitions } : rest; - return (0, CSpellSettingsInternalDef_js_1.cleanCSpellSettingsInternal)(setting); - } - function filenameToDirectory(filename) { - return filename ? path16.dirname(filename) : void 0; - } - function checkFilenameMatchesGlob(filename, globs) { - const m = new cspell_glob_1.GlobMatcher(globs); - return m.match(filename); - } - exports.checkFilenameMatchesGlob = checkFilenameMatchesGlob; - function mergeSources(left, right) { - return { - name: "merged", - sources: [left, right] - }; - } - function max(a, b) { - if (a === void 0 || a === null) - return b; - if (b === void 0 || b === null) - return a; - return a > b ? a : b; - } - function getSources(settings) { - const visited = /* @__PURE__ */ new Set(); - const sources = []; - function _walkSourcesTree(settings2) { - if (!settings2 || visited.has(settings2)) - return; - visited.add(settings2); - if (!settings2.source?.sources?.length) { - sources.push(settings2); - return; - } - settings2.source.sources.forEach(_walkSourcesTree); - } - _walkSourcesTree(settings); - return sources; - } - exports.getSources = getSources; - function mergeImportRefs(left, right = {}) { - const imports = new Map(left.__imports || []); - if (left.__importRef) { - imports.set(left.__importRef.filename, left.__importRef); - } - if (right.__importRef) { - imports.set(right.__importRef.filename, right.__importRef); - } - const rightImports = right.__imports?.values() || []; - for (const ref of rightImports) { - imports.set(ref.filename, ref); + exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; + var async_1 = require_async4(); + var stream_1 = require_stream2(); + var sync_1 = require_sync4(); + var settings_1 = require_settings3(); + exports.Settings = settings_1.default; + function walk4(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + new async_1.default(directory, getSettings2()).read(optionsOrSettingsOrCallback); + return; } - return imports.size ? imports : void 0; + new async_1.default(directory, getSettings2(optionsOrSettingsOrCallback)).read(callback); } - function extractDependencies2(settings) { - const settingsI = toInternalSettings(settings); - const configFiles = [...mergeImportRefs(settingsI) || []].map(([filename]) => filename); - const dictionaryFiles = (0, DictionarySettings_js_1.calcDictionaryDefsToLoad)(settingsI).map((dict) => dict.path).filter((file) => !!file); - return { - configFiles, - dictionaryFiles - }; + exports.walk = walk4; + function walkSync(directory, optionsOrSettings) { + const settings = getSettings2(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); } - exports.extractDependencies = extractDependencies2; - function resolveCwd() { - const envGlobRoot = process.env[constants_js_1.ENV_CSPELL_GLOB_ROOT]; - const cwd = envGlobRoot || process.cwd(); - return cwd; + exports.walkSync = walkSync; + function walkStream(directory, optionsOrSettings) { + const settings = getSettings2(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); } - function resolveParser(settings) { - if (!settings.parser) - return void 0; - if (typeof settings.parser === "function") - return settings.parser; - const parserName = settings.parser; - (0, assert_1.default)(typeof parserName === "string"); - const parsers2 = extractParsers(settings.plugins); - const parser = parsers2.get(parserName); - (0, assert_1.default)(parser, `Parser "${parserName}" not found.`); - return parser; - } - var parserCache = new AutoResolve_js_1.AutoResolveWeakCache(); - var emptyParserMap = /* @__PURE__ */ new Map(); - function* parsers(plugins) { - for (const plugin of plugins) { - if (!plugin.parsers) - continue; - for (const parser of plugin.parsers) { - yield [parser.name, parser]; - } + exports.walkStream = walkStream; + function getSettings2(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; } + return new settings_1.default(settingsOrOptions); } - function mapPlugins(plugins) { - return new Map(parsers(plugins)); - } - function extractParsers(plugins) { - if (!plugins || !plugins.length) - return emptyParserMap; - return parserCache.get(plugins, mapPlugins); - } - exports.__testing__ = { - mergeObjects - }; } }); -// node_modules/cspell-lib/dist/cjs/util/errors.js -var require_errors3 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/errors.js"(exports) { +// node_modules/fast-glob/out/readers/reader.js +var require_reader2 = __commonJS({ + "node_modules/fast-glob/out/readers/reader.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.wrapCall = exports.catchPromiseError = exports.UnknownError = exports.toError = exports.isError = exports.isErrnoException = void 0; - var util_1 = require("util"); - function getTypeOf(t) { - return typeof t; - } - var allowStringOrUndefined = { - string: true, - undefined: true - }; - var allowNumberOrUndefined = { - number: true, - undefined: true - }; - function isErrnoException(e) { - if (!e || typeof e !== "object") - return false; - if (!isError4(e)) - return false; - const ex = e; - return typeof ex.errno in allowNumberOrUndefined && typeof ex.code in allowStringOrUndefined && typeof ex.path in allowStringOrUndefined; - } - exports.isErrnoException = isErrnoException; - function isError4(e) { - if (e instanceof Error) - return true; - if (!e || typeof e !== "object") - return false; - const ex = e; - return typeof ex.name == "string" && typeof ex.message == "string" && typeof ex.stack in allowStringOrUndefined; - } - exports.isError = isError4; - function toError4(e, errorFactory = UnknownError) { - if (isError4(e)) - return e; - return new errorFactory(e); - } - exports.toError = toError4; - var UnknownError = class extends Error { - constructor(cause) { - super((0, util_1.format)(cause)); - this.cause = cause; + var path26 = require("path"); + var fsStat = require_out(); + var utils = require_utils7(); + var Reader = class { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); } - }; - exports.UnknownError = UnknownError; - function catchPromiseError(p, handler) { - if (p === void 0) - return void 0; - return _catchPromiseError(p, handler); - } - exports.catchPromiseError = catchPromiseError; - function wrapCall(fn, handler) { - return (...p) => { - try { - return fn(...p); - } catch (e) { - return handler(e); + _getFullEntryPath(filepath) { + return path26.resolve(this._settings.cwd, filepath); + } + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; } - }; - } - exports.wrapCall = wrapCall; - async function _catchPromiseError(p, handler) { - try { - return await p; - } catch (e) { - return handler(e); + return entry; + } + _isFatalError(error2) { + return !utils.errno.isEnoentCodeError(error2) && !this._settings.suppressErrors; } - } - exports.__testing__ = { - getTypeOf }; + exports.default = Reader; } }); -// node_modules/graceful-fs/polyfills.js -var require_polyfills = __commonJS({ - "node_modules/graceful-fs/polyfills.js"(exports, module2) { - var constants = require("constants"); - var origCwd = process.cwd; - var cwd = null; - var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; - process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process); - return cwd; - }; - try { - process.cwd(); - } catch (er) { - } - if (typeof process.chdir === "function") { - chdir = process.chdir; - process.chdir = function(d) { - cwd = null; - chdir.call(process, d); - }; - if (Object.setPrototypeOf) - Object.setPrototypeOf(process.chdir, chdir); - } - var chdir; - module2.exports = patch; - function patch(fs6) { - if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs6); - } - if (!fs6.lutimes) { - patchLutimes(fs6); - } - fs6.chown = chownFix(fs6.chown); - fs6.fchown = chownFix(fs6.fchown); - fs6.lchown = chownFix(fs6.lchown); - fs6.chmod = chmodFix(fs6.chmod); - fs6.fchmod = chmodFix(fs6.fchmod); - fs6.lchmod = chmodFix(fs6.lchmod); - fs6.chownSync = chownFixSync(fs6.chownSync); - fs6.fchownSync = chownFixSync(fs6.fchownSync); - fs6.lchownSync = chownFixSync(fs6.lchownSync); - fs6.chmodSync = chmodFixSync(fs6.chmodSync); - fs6.fchmodSync = chmodFixSync(fs6.fchmodSync); - fs6.lchmodSync = chmodFixSync(fs6.lchmodSync); - fs6.stat = statFix(fs6.stat); - fs6.fstat = statFix(fs6.fstat); - fs6.lstat = statFix(fs6.lstat); - fs6.statSync = statFixSync(fs6.statSync); - fs6.fstatSync = statFixSync(fs6.fstatSync); - fs6.lstatSync = statFixSync(fs6.lstatSync); - if (fs6.chmod && !fs6.lchmod) { - fs6.lchmod = function(path16, mode, cb) { - if (cb) - process.nextTick(cb); - }; - fs6.lchmodSync = function() { - }; - } - if (fs6.chown && !fs6.lchown) { - fs6.lchown = function(path16, uid, gid, cb) { - if (cb) - process.nextTick(cb); - }; - fs6.lchownSync = function() { - }; +// node_modules/fast-glob/out/readers/stream.js +var require_stream3 = __commonJS({ + "node_modules/fast-glob/out/readers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = require("stream"); + var fsStat = require_out(); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var ReaderStream = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk.walkStream; + this._stat = fsStat.stat; } - if (platform === "win32") { - fs6.rename = typeof fs6.rename !== "function" ? fs6.rename : function(fs$rename) { - function rename(from, to, cb) { - var start = Date.now(); - var backoff = 0; - fs$rename(from, to, function CB(er) { - if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { - setTimeout(function() { - fs6.stat(to, function(stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er); - }); - }, backoff); - if (backoff < 100) - backoff += 10; - return; - } - if (cb) - cb(er); - }); - } - if (Object.setPrototypeOf) - Object.setPrototypeOf(rename, fs$rename); - return rename; - }(fs6.rename); + dynamic(root, options) { + return this._walkStream(root, options); } - fs6.read = typeof fs6.read !== "function" ? fs6.read : function(fs$read) { - function read2(fd, buffer, offset, length, position, callback_) { - var callback; - if (callback_ && typeof callback_ === "function") { - var eagCounter = 0; - callback = function(er, _, __) { - if (er && er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - return fs$read.call(fs6, fd, buffer, offset, length, position, callback); - } - callback_.apply(this, arguments); - }; - } - return fs$read.call(fs6, fd, buffer, offset, length, position, callback); - } - if (Object.setPrototypeOf) - Object.setPrototypeOf(read2, fs$read); - return read2; - }(fs6.read); - fs6.readSync = typeof fs6.readSync !== "function" ? fs6.readSync : function(fs$readSync) { - return function(fd, buffer, offset, length, position) { - var eagCounter = 0; - while (true) { - try { - return fs$readSync.call(fs6, fd, buffer, offset, length, position); - } catch (er) { - if (er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - continue; - } - throw er; - } - } - }; - }(fs6.readSync); - function patchLchmod(fs7) { - fs7.lchmod = function(path16, mode, callback) { - fs7.open( - path16, - constants.O_WRONLY | constants.O_SYMLINK, - mode, - function(err, fd) { - if (err) { - if (callback) - callback(err); - return; - } - fs7.fchmod(fd, mode, function(err2) { - fs7.close(fd, function(err22) { - if (callback) - callback(err2 || err22); - }); - }); + static(patterns, options) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options).then((entry) => { + if (entry !== null && options.entryFilter(entry)) { + stream.push(entry); } - ); - }; - fs7.lchmodSync = function(path16, mode) { - var fd = fs7.openSync(path16, constants.O_WRONLY | constants.O_SYMLINK, mode); - var threw = true; - var ret; - try { - ret = fs7.fchmodSync(fd, mode); - threw = false; - } finally { - if (threw) { - try { - fs7.closeSync(fd); - } catch (er) { - } - } else { - fs7.closeSync(fd); + if (index === filepaths.length - 1) { + stream.end(); } - } - return ret; + done(); + }).catch(done); }; - } - function patchLutimes(fs7) { - if (constants.hasOwnProperty("O_SYMLINK") && fs7.futimes) { - fs7.lutimes = function(path16, at, mt, cb) { - fs7.open(path16, constants.O_SYMLINK, function(er, fd) { - if (er) { - if (cb) - cb(er); - return; - } - fs7.futimes(fd, at, mt, function(er2) { - fs7.close(fd, function(er22) { - if (cb) - cb(er2 || er22); - }); - }); - }); - }; - fs7.lutimesSync = function(path16, at, mt) { - var fd = fs7.openSync(path16, constants.O_SYMLINK); - var ret; - var threw = true; - try { - ret = fs7.futimesSync(fd, at, mt); - threw = false; - } finally { - if (threw) { - try { - fs7.closeSync(fd); - } catch (er) { - } - } else { - fs7.closeSync(fd); - } - } - return ret; - }; - } else if (fs7.futimes) { - fs7.lutimes = function(_a, _b, _c, cb) { - if (cb) - process.nextTick(cb); - }; - fs7.lutimesSync = function() { - }; + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); } + return stream; } - function chmodFix(orig) { - if (!orig) - return orig; - return function(target, mode, cb) { - return orig.call(fs6, target, mode, function(er) { - if (chownErOk(er)) - er = null; - if (cb) - cb.apply(this, arguments); - }); - }; - } - function chmodFixSync(orig) { - if (!orig) - return orig; - return function(target, mode) { - try { - return orig.call(fs6, target, mode); - } catch (er) { - if (!chownErOk(er)) - throw er; + _getEntry(filepath, pattern, options) { + return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error2) => { + if (options.errorFilter(error2)) { + return null; } - }; + throw error2; + }); } - function chownFix(orig) { - if (!orig) - return orig; - return function(target, uid, gid, cb) { - return orig.call(fs6, target, uid, gid, function(er) { - if (chownErOk(er)) - er = null; - if (cb) - cb.apply(this, arguments); + _getStat(filepath) { + return new Promise((resolve13, reject) => { + this._stat(filepath, this._fsStatSettings, (error2, stats) => { + return error2 === null ? resolve13(stats) : reject(error2); }); - }; + }); } - function chownFixSync(orig) { - if (!orig) - return orig; - return function(target, uid, gid) { - try { - return orig.call(fs6, target, uid, gid); - } catch (er) { - if (!chownErOk(er)) - throw er; - } - }; + }; + exports.default = ReaderStream; + } +}); + +// node_modules/fast-glob/out/readers/async.js +var require_async5 = __commonJS({ + "node_modules/fast-glob/out/readers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var stream_1 = require_stream3(); + var ReaderAsync = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkAsync = fsWalk.walk; + this._readerStream = new stream_1.default(this._settings); } - function statFix(orig) { - if (!orig) - return orig; - return function(target, options, cb) { - if (typeof options === "function") { - cb = options; - options = null; - } - function callback(er, stats) { - if (stats) { - if (stats.uid < 0) - stats.uid += 4294967296; - if (stats.gid < 0) - stats.gid += 4294967296; + dynamic(root, options) { + return new Promise((resolve13, reject) => { + this._walkAsync(root, options, (error2, entries) => { + if (error2 === null) { + resolve13(entries); + } else { + reject(error2); } - if (cb) - cb.apply(this, arguments); - } - return options ? orig.call(fs6, target, options, callback) : orig.call(fs6, target, callback); - }; - } - function statFixSync(orig) { - if (!orig) - return orig; - return function(target, options) { - var stats = options ? orig.call(fs6, target, options) : orig.call(fs6, target); - if (stats) { - if (stats.uid < 0) - stats.uid += 4294967296; - if (stats.gid < 0) - stats.gid += 4294967296; - } - return stats; - }; + }); + }); } - function chownErOk(er) { - if (!er) - return true; - if (er.code === "ENOSYS") - return true; - var nonroot = !process.getuid || process.getuid() !== 0; - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true; - } - return false; + async static(patterns, options) { + const entries = []; + const stream = this._readerStream.static(patterns, options); + return new Promise((resolve13, reject) => { + stream.once("error", reject); + stream.on("data", (entry) => entries.push(entry)); + stream.once("end", () => resolve13(entries)); + }); } - } + }; + exports.default = ReaderAsync; } }); -// node_modules/graceful-fs/legacy-streams.js -var require_legacy_streams = __commonJS({ - "node_modules/graceful-fs/legacy-streams.js"(exports, module2) { - var Stream3 = require("stream").Stream; - module2.exports = legacy; - function legacy(fs6) { - return { - ReadStream, - WriteStream - }; - function ReadStream(path16, options) { - if (!(this instanceof ReadStream)) - return new ReadStream(path16, options); - Stream3.call(this); - var self = this; - this.path = path16; - this.fd = null; - this.readable = true; - this.paused = false; - this.flags = "r"; - this.mode = 438; - this.bufferSize = 64 * 1024; - options = options || {}; - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.encoding) - this.setEncoding(this.encoding); - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.end === void 0) { - this.end = Infinity; - } else if ("number" !== typeof this.end) { - throw TypeError("end must be a Number"); - } - if (this.start > this.end) { - throw new Error("start must be <= end"); - } - this.pos = this.start; - } - if (this.fd !== null) { - process.nextTick(function() { - self._read(); +// node_modules/fast-glob/out/providers/matchers/matcher.js +var require_matcher = __commonJS({ + "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var Matcher = class { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); + } + _fillStorage() { + for (const pattern of this._patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections }); - return; } - fs6.open(this.path, this.flags, this.mode, function(err, fd) { - if (err) { - self.emit("error", err); - self.readable = false; - return; + } + _getPatternSegments(pattern) { + const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; } - self.fd = fd; - self.emit("open", fd); - self._read(); + return { + dynamic: true, + pattern: part, + patternRe: utils.pattern.makeRe(part, this._micromatchOptions) + }; }); } - function WriteStream(path16, options) { - if (!(this instanceof WriteStream)) - return new WriteStream(path16, options); - Stream3.call(this); - this.path = path16; - this.fd = null; - this.writable = true; - this.flags = "w"; - this.encoding = "binary"; - this.mode = 438; - this.bytesWritten = 0; - options = options || {}; - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); + _splitSegmentsIntoSections(segments) { + return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + } + }; + exports.default = Matcher; + } +}); + +// node_modules/fast-glob/out/providers/matchers/partial.js +var require_partial = __commonJS({ + "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var matcher_1 = require_matcher(); + var PartialMatcher = class extends matcher_1.default { + match(filepath) { + const parts = filepath.split("/"); + const levels = parts.length; + const patterns = this._storage.filter((info3) => !info3.complete || info3.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + if (!pattern.complete && levels > section.length) { + return true; } - if (this.start < 0) { - throw new Error("start must be >= zero"); + const match2 = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { + return true; + } + return false; + }); + if (match2) { + return true; } - this.pos = this.start; - } - this.busy = false; - this._queue = []; - if (this.fd === null) { - this._open = fs6.open; - this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); - this.flush(); } + return false; } - } + }; + exports.default = PartialMatcher; } }); -// node_modules/graceful-fs/clone.js -var require_clone = __commonJS({ - "node_modules/graceful-fs/clone.js"(exports, module2) { +// node_modules/fast-glob/out/providers/filters/deep.js +var require_deep = __commonJS({ + "node_modules/fast-glob/out/providers/filters/deep.js"(exports) { "use strict"; - module2.exports = clone; - var getPrototypeOf = Object.getPrototypeOf || function(obj) { - return obj.__proto__; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var partial_1 = require_partial(); + var DeepFilter = class { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + } + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); + } + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); + } + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); + return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + } + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { + return false; + } + if (this._isSkippedSymbolicLink(entry)) { + return false; + } + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { + return false; + } + return this._isSkippedByNegativePatterns(filepath, negativeRe); + } + _isSkippedByDeep(basePath, entryPath) { + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; + } + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split("/").length; + if (basePath === "") { + return entryPathDepth; + } + const basePathDepth = basePath.split("/").length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + } + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); + } + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); + } }; - function clone(obj) { - if (obj === null || typeof obj !== "object") - return obj; - if (obj instanceof Object) - var copy = { __proto__: getPrototypeOf(obj) }; - else - var copy = /* @__PURE__ */ Object.create(null); - Object.getOwnPropertyNames(obj).forEach(function(key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); - }); - return copy; - } + exports.default = DeepFilter; } }); -// node_modules/graceful-fs/graceful-fs.js -var require_graceful_fs = __commonJS({ - "node_modules/graceful-fs/graceful-fs.js"(exports, module2) { - var fs6 = require("fs"); - var polyfills = require_polyfills(); - var legacy = require_legacy_streams(); - var clone = require_clone(); - var util = require("util"); - var gracefulQueue; - var previousSymbol; - if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = Symbol.for("graceful-fs.queue"); - previousSymbol = Symbol.for("graceful-fs.previous"); - } else { - gracefulQueue = "___graceful-fs.queue"; - previousSymbol = "___graceful-fs.previous"; - } - function noop() { - } - function publishQueue(context, queue2) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue2; - } - }); - } - var debug = noop; - if (util.debuglog) - debug = util.debuglog("gfs4"); - else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) - debug = function() { - var m = util.format.apply(util, arguments); - m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); - console.error(m); - }; - if (!fs6[gracefulQueue]) { - queue = global[gracefulQueue] || []; - publishQueue(fs6, queue); - fs6.close = function(fs$close) { - function close(fd, cb) { - return fs$close.call(fs6, fd, function(err) { - if (!err) { - resetQueue(); - } - if (typeof cb === "function") - cb.apply(this, arguments); - }); - } - Object.defineProperty(close, previousSymbol, { - value: fs$close - }); - return close; - }(fs6.close); - fs6.closeSync = function(fs$closeSync) { - function closeSync(fd) { - fs$closeSync.apply(fs6, arguments); - resetQueue(); - } - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }); - return closeSync; - }(fs6.closeSync); - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { - process.on("exit", function() { - debug(fs6[gracefulQueue]); - require("assert").equal(fs6[gracefulQueue].length, 0); - }); +// node_modules/fast-glob/out/providers/filters/entry.js +var require_entry = __commonJS({ + "node_modules/fast-glob/out/providers/filters/entry.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var EntryFilter = class { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = /* @__PURE__ */ new Map(); } - } - var queue; - if (!global[gracefulQueue]) { - publishQueue(global, fs6[gracefulQueue]); - } - module2.exports = patch(clone(fs6)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs6.__patched) { - module2.exports = patch(fs6); - fs6.__patched = true; - } - function patch(fs7) { - polyfills(fs7); - fs7.gracefulify = patch; - fs7.createReadStream = createReadStream; - fs7.createWriteStream = createWriteStream; - var fs$readFile = fs7.readFile; - fs7.readFile = readFile4; - function readFile4(path16, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$readFile(path16, options, cb); - function go$readFile(path17, options2, cb2, startTime) { - return fs$readFile(path17, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path17, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } + getFilter(positive, negative) { + const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); + const negativeRe = utils.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); + return (entry) => this._filter(entry, positiveRe, negativeRe); } - var fs$writeFile = fs7.writeFile; - fs7.writeFile = writeFile; - function writeFile(path16, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$writeFile(path16, data, options, cb); - function go$writeFile(path17, data2, options2, cb2, startTime) { - return fs$writeFile(path17, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); + _filter(entry, positiveRe, negativeRe) { + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._settings.unique && this._isDuplicateEntry(filepath)) { + return false; } - } - var fs$appendFile = fs7.appendFile; - if (fs$appendFile) - fs7.appendFile = appendFile; - function appendFile(path16, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$appendFile(path16, data, options, cb); - function go$appendFile(path17, data2, options2, cb2, startTime) { - return fs$appendFile(path17, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; } - } - var fs$copyFile = fs7.copyFile; - if (fs$copyFile) - fs7.copyFile = copyFile; - function copyFile(src, dest, flags, cb) { - if (typeof flags === "function") { - cb = flags; - flags = 0; + if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) { + return false; } - return go$copyFile(src, dest, flags, cb); - function go$copyFile(src2, dest2, flags2, cb2, startTime) { - return fs$copyFile(src2, dest2, flags2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); + const isDirectory = entry.dirent.isDirectory(); + const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory); + if (this._settings.unique && isMatched) { + this._createIndexRecord(filepath); } + return isMatched; } - var fs$readdir = fs7.readdir; - fs7.readdir = readdir; - var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path16, options, cb) { - if (typeof options === "function") - cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path17, options2, cb2, startTime) { - return fs$readdir(path17, fs$readdirCallback( - path17, - options2, - cb2, - startTime - )); - } : function go$readdir2(path17, options2, cb2, startTime) { - return fs$readdir(path17, options2, fs$readdirCallback( - path17, - options2, - cb2, - startTime - )); - }; - return go$readdir(path16, options, cb); - function fs$readdirCallback(path17, options2, cb2, startTime) { - return function(err, files) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([ - go$readdir, - [path17, options2, cb2], - err, - startTime || Date.now(), - Date.now() - ]); - else { - if (files && files.sort) - files.sort(); - if (typeof cb2 === "function") - cb2.call(this, err, files); - } - }; - } + _isDuplicateEntry(filepath) { + return this.index.has(filepath); } - if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs7); - ReadStream = legStreams.ReadStream; - WriteStream = legStreams.WriteStream; + _createIndexRecord(filepath) { + this.index.set(filepath, void 0); } - var fs$ReadStream = fs7.ReadStream; - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype); - ReadStream.prototype.open = ReadStream$open; + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); } - var fs$WriteStream = fs7.WriteStream; - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype); - WriteStream.prototype.open = WriteStream$open; + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); } - Object.defineProperty(fs7, "ReadStream", { - get: function() { - return ReadStream; - }, - set: function(val) { - ReadStream = val; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(fs7, "WriteStream", { - get: function() { - return WriteStream; - }, - set: function(val) { - WriteStream = val; - }, - enumerable: true, - configurable: true - }); - var FileReadStream = ReadStream; - Object.defineProperty(fs7, "FileReadStream", { - get: function() { - return FileReadStream; - }, - set: function(val) { - FileReadStream = val; - }, - enumerable: true, - configurable: true - }); - var FileWriteStream = WriteStream; - Object.defineProperty(fs7, "FileWriteStream", { - get: function() { - return FileWriteStream; - }, - set: function(val) { - FileWriteStream = val; - }, - enumerable: true, - configurable: true - }); - function ReadStream(path16, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this; - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments); + _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { + if (!this._settings.absolute) { + return false; + } + const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); + return utils.pattern.matchAny(fullpath, patternsRe); } - function ReadStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - if (that.autoClose) - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - that.read(); - } - }); + _isMatchToPatterns(filepath, patternsRe, isDirectory) { + const isMatched = utils.pattern.matchAny(filepath, patternsRe); + if (!isMatched && isDirectory) { + return utils.pattern.matchAny(filepath + "/", patternsRe); + } + return isMatched; } - function WriteStream(path16, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this; - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments); + }; + exports.default = EntryFilter; + } +}); + +// node_modules/fast-glob/out/providers/filters/error.js +var require_error = __commonJS({ + "node_modules/fast-glob/out/providers/filters/error.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var ErrorFilter = class { + constructor(_settings) { + this._settings = _settings; } - function WriteStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - } - }); + getFilter() { + return (error2) => this._isNonFatalError(error2); } - function createReadStream(path16, options) { - return new fs7.ReadStream(path16, options); + _isNonFatalError(error2) { + return utils.errno.isEnoentCodeError(error2) || this._settings.suppressErrors; } - function createWriteStream(path16, options) { - return new fs7.WriteStream(path16, options); + }; + exports.default = ErrorFilter; + } +}); + +// node_modules/fast-glob/out/providers/transformers/entry.js +var require_entry2 = __commonJS({ + "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var EntryTransformer = class { + constructor(_settings) { + this._settings = _settings; } - var fs$open = fs7.open; - fs7.open = open; - function open(path16, flags, mode, cb) { - if (typeof mode === "function") - cb = mode, mode = null; - return go$open(path16, flags, mode, cb); - function go$open(path17, flags2, mode2, cb2, startTime) { - return fs$open(path17, flags2, mode2, function(err, fd) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path17, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } + getTransformer() { + return (entry) => this._transform(entry); } - return fs7; - } - function enqueue(elem) { - debug("ENQUEUE", elem[0].name, elem[1]); - fs6[gracefulQueue].push(elem); - retry(); - } - var retryTimer; - function resetQueue() { - var now = Date.now(); - for (var i = 0; i < fs6[gracefulQueue].length; ++i) { - if (fs6[gracefulQueue][i].length > 2) { - fs6[gracefulQueue][i][3] = now; - fs6[gracefulQueue][i][4] = now; + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils.path.unixify(filepath); } - } - retry(); - } - function retry() { - clearTimeout(retryTimer); - retryTimer = void 0; - if (fs6[gracefulQueue].length === 0) - return; - var elem = fs6[gracefulQueue].shift(); - var fn = elem[0]; - var args = elem[1]; - var err = elem[2]; - var startTime = elem[3]; - var lastTime = elem[4]; - if (startTime === void 0) { - debug("RETRY", fn.name, args); - fn.apply(null, args); - } else if (Date.now() - startTime >= 6e4) { - debug("TIMEOUT", fn.name, args); - var cb = args.pop(); - if (typeof cb === "function") - cb.call(null, err); - } else { - var sinceAttempt = Date.now() - lastTime; - var sinceStart = Math.max(lastTime - startTime, 1); - var desiredDelay = Math.min(sinceStart * 1.2, 100); - if (sinceAttempt >= desiredDelay) { - debug("RETRY", fn.name, args); - fn.apply(null, args.concat([startTime])); - } else { - fs6[gracefulQueue].push(elem); + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += "/"; } + if (!this._settings.objectMode) { + return filepath; + } + return Object.assign(Object.assign({}, entry), { path: filepath }); } - if (retryTimer === void 0) { - retryTimer = setTimeout(retry, 0); - } - } + }; + exports.default = EntryTransformer; } }); -// node_modules/make-dir/node_modules/semver/semver.js -var require_semver = __commonJS({ - "node_modules/make-dir/node_modules/semver/semver.js"(exports, module2) { - exports = module2.exports = SemVer; - var debug; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug = function() { - }; - } - exports.SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; - var re = exports.re = []; - var safeRe = exports.safeRe = []; - var src = exports.src = []; - var t = exports.tokens = {}; - var R = 0; - function tok(n) { - t[n] = R++; - } - var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; - var safeRegexReplacements = [ - ["\\s", 1], - ["\\d", MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] - ]; - function makeSafeRe(value) { - for (var i2 = 0; i2 < safeRegexReplacements.length; i2++) { - var token = safeRegexReplacements[i2][0]; - var max = safeRegexReplacements[i2][1]; - value = value.split(token + "*").join(token + "{0," + max + "}").split(token + "+").join(token + "{1," + max + "}"); +// node_modules/fast-glob/out/providers/provider.js +var require_provider = __commonJS({ + "node_modules/fast-glob/out/providers/provider.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path26 = require("path"); + var deep_1 = require_deep(); + var entry_1 = require_entry(); + var error_1 = require_error(); + var entry_2 = require_entry2(); + var Provider = class { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); } - return value; - } - tok("NUMERICIDENTIFIER"); - src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*"; - tok("NUMERICIDENTIFIERLOOSE"); - src[t.NUMERICIDENTIFIERLOOSE] = "\\d+"; - tok("NONNUMERICIDENTIFIER"); - src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*"; - tok("MAINVERSION"); - src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")"; - tok("MAINVERSIONLOOSE"); - src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")"; - tok("PRERELEASEIDENTIFIER"); - src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; - tok("PRERELEASEIDENTIFIERLOOSE"); - src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; - tok("PRERELEASE"); - src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))"; - tok("PRERELEASELOOSE"); - src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))"; - tok("BUILDIDENTIFIER"); - src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + "+"; - tok("BUILD"); - src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))"; - tok("FULL"); - tok("FULLPLAIN"); - src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?"; - src[t.FULL] = "^" + src[t.FULLPLAIN] + "$"; - tok("LOOSEPLAIN"); - src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?"; - tok("LOOSE"); - src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$"; - tok("GTLT"); - src[t.GTLT] = "((?:<|>)?=?)"; - tok("XRANGEIDENTIFIERLOOSE"); - src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"; - tok("XRANGEIDENTIFIER"); - src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*"; - tok("XRANGEPLAIN"); - src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?"; - tok("XRANGEPLAINLOOSE"); - src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?"; - tok("XRANGE"); - src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$"; - tok("XRANGELOOSE"); - src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$"; - tok("COERCE"); - src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])"; - tok("COERCERTL"); - re[t.COERCERTL] = new RegExp(src[t.COERCE], "g"); - safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), "g"); - tok("LONETILDE"); - src[t.LONETILDE] = "(?:~>?)"; - tok("TILDETRIM"); - src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+"; - re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g"); - safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), "g"); - var tildeTrimReplace = "$1~"; - tok("TILDE"); - src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$"; - tok("TILDELOOSE"); - src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$"; - tok("LONECARET"); - src[t.LONECARET] = "(?:\\^)"; - tok("CARETTRIM"); - src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+"; - re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g"); - safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), "g"); - var caretTrimReplace = "$1^"; - tok("CARET"); - src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$"; - tok("CARETLOOSE"); - src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$"; - tok("COMPARATORLOOSE"); - src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$"; - tok("COMPARATOR"); - src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$"; - tok("COMPARATORTRIM"); - src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")"; - re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g"); - safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), "g"); - var comparatorTrimReplace = "$1$2$3"; - tok("HYPHENRANGE"); - src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$"; - tok("HYPHENRANGELOOSE"); - src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$"; - tok("STAR"); - src[t.STAR] = "(<|>)?=?\\s*\\*"; - for (i = 0; i < R; i++) { - debug(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); + _getRootDirectory(task) { + return path26.resolve(this._settings.cwd, task.base); } - } - var i; - exports.parse = parse3; - function parse3(version3, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _getReaderOptions(task) { + const basePath = task.base === "." ? "" : task.base; + return { + basePath, + pathSegmentSeparator: "/", + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() }; } - if (version3 instanceof SemVer) { - return version3; + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false + }; } - if (typeof version3 !== "string") { - return null; + }; + exports.default = Provider; + } +}); + +// node_modules/fast-glob/out/providers/async.js +var require_async6 = __commonJS({ + "node_modules/fast-glob/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var async_1 = require_async5(); + var provider_1 = require_provider(); + var ProviderAsync = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new async_1.default(this._settings); } - if (version3.length > MAX_LENGTH) { - return null; + async read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = await this.api(root, task, options); + return entries.map((entry) => options.transform(entry)); } - var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version3)) { - return null; + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); } - try { - return new SemVer(version3, options); - } catch (er) { - return null; + }; + exports.default = ProviderAsync; + } +}); + +// node_modules/fast-glob/out/providers/stream.js +var require_stream4 = __commonJS({ + "node_modules/fast-glob/out/providers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = require("stream"); + var stream_2 = require_stream3(); + var provider_1 = require_provider(); + var ProviderStream = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); } - } - exports.valid = valid; - function valid(version3, options) { - var v = parse3(version3, options); - return v ? v.version : null; - } - exports.clean = clean2; - function clean2(version3, options) { - var s = parse3(version3.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; - } - exports.SemVer = SemVer; - function SemVer(version3, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const source = this.api(root, task, options); + const destination = new stream_1.Readable({ objectMode: true, read: () => { + } }); + source.once("error", (error2) => destination.emit("error", error2)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end")); + destination.once("close", () => source.destroy()); + return destination; } - if (version3 instanceof SemVer) { - if (version3.loose === options.loose) { - return version3; - } else { - version3 = version3.version; + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); } - } else if (typeof version3 !== "string") { - throw new TypeError("Invalid Version: " + version3); + return this._reader.static(task.patterns, options); + } + }; + exports.default = ProviderStream; + } +}); + +// node_modules/fast-glob/out/readers/sync.js +var require_sync5 = __commonJS({ + "node_modules/fast-glob/out/readers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsStat = require_out(); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var ReaderSync = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; } - if (version3.length > MAX_LENGTH) { - throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); + dynamic(root, options) { + return this._walkSync(root, options); } - if (!(this instanceof SemVer)) { - return new SemVer(version3, options); + static(patterns, options) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options); + if (entry === null || !options.entryFilter(entry)) { + continue; + } + entries.push(entry); + } + return entries; } - debug("SemVer", version3, options); - this.options = options; - this.loose = !!options.loose; - var m = version3.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); - if (!m) { - throw new TypeError("Invalid Version: " + version3); - } - this.raw = version3; - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); - } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); - } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); - } - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split(".").map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } + _getEntry(filepath, pattern, options) { + try { + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); + } catch (error2) { + if (options.errorFilter(error2)) { + return null; } - return id; - }); + throw error2; + } } - this.build = m[5] ? m[5].split(".") : []; - this.format(); - } - SemVer.prototype.format = function() { - this.version = this.major + "." + this.minor + "." + this.patch; - if (this.prerelease.length) { - this.version += "-" + this.prerelease.join("."); + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); } - return this.version; }; - SemVer.prototype.toString = function() { - return this.version; - }; - SemVer.prototype.compare = function(other) { - debug("SemVer.compare", this.version, this.options, other); - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - return this.compareMain(other) || this.comparePre(other); - }; - SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); - }; - SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + exports.default = ReaderSync; + } +}); + +// node_modules/fast-glob/out/providers/sync.js +var require_sync6 = __commonJS({ + "node_modules/fast-glob/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var sync_1 = require_sync5(); + var provider_1 = require_provider(); + var ProviderSync = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1.default(this._settings); } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = this.api(root, task, options); + return entries.map(options.transform); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug("prerelease compare", i2, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); } - } while (++i2); - }; - SemVer.prototype.compareBuild = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - var i2 = 0; - do { - var a = this.build[i2]; - var b = other.build[i2]; - debug("prerelease compare", i2, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i2); - }; - SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier); - this.inc("pre", identifier); - break; - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier); - } - this.inc("pre", identifier); - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - case "pre": - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - var i2 = this.prerelease.length; - while (--i2 >= 0) { - if (typeof this.prerelease[i2] === "number") { - this.prerelease[i2]++; - i2 = -2; - } - } - if (i2 === -1) { - this.prerelease.push(0); - } - } - if (identifier) { - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - break; - default: - throw new Error("invalid increment argument: " + release); + return this._reader.static(task.patterns, options); } - this.format(); - this.raw = this.version; - return this; }; - exports.inc = inc; - function inc(version3, release, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; + exports.default = ProviderSync; + } +}); + +// node_modules/fast-glob/out/settings.js +var require_settings4 = __commonJS({ + "node_modules/fast-glob/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; + var fs9 = require("fs"); + var os5 = require("os"); + var CPU_COUNT = Math.max(os5.cpus().length, 1); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs9.lstat, + lstatSync: fs9.lstatSync, + stat: fs9.stat, + statSync: fs9.statSync, + readdir: fs9.readdir, + readdirSync: fs9.readdirSync + }; + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; + } + if (this.stats) { + this.objectMode = true; + } + this.ignore = [].concat(this.ignore); } - try { - return new SemVer(version3, loose).inc(release, identifier).version; - } catch (er) { - return null; + _getValue(option, value) { + return option === void 0 ? value : option; } - } - exports.diff = diff; - function diff(version1, version22) { - if (eq(version1, version22)) { - return null; - } else { - var v12 = parse3(version1); - var v2 = parse3(version22); - var prefix = ""; - if (v12.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; - } - for (var key in v12) { - if (key === "major" || key === "minor" || key === "patch") { - if (v12[key] !== v2[key]) { - return prefix + key; - } - } - } - return defaultResult; + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); } + }; + exports.default = Settings; + } +}); + +// node_modules/fast-glob/out/index.js +var require_out4 = __commonJS({ + "node_modules/fast-glob/out/index.js"(exports, module2) { + "use strict"; + var taskManager = require_tasks(); + var async_1 = require_async6(); + var stream_1 = require_stream4(); + var sync_1 = require_sync6(); + var settings_1 = require_settings4(); + var utils = require_utils7(); + async function FastGlob(source, options) { + assertPatternsInput(source); + const works = getWorks(source, async_1.default, options); + const result = await Promise.all(works); + return utils.array.flatten(result); } - exports.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; + (function(FastGlob2) { + FastGlob2.glob = FastGlob2; + FastGlob2.globSync = sync; + FastGlob2.globStream = stream; + FastGlob2.async = FastGlob2; + function sync(source, options) { + assertPatternsInput(source); + const works = getWorks(source, sync_1.default, options); + return utils.array.flatten(works); } - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; - } - exports.rcompareIdentifiers = rcompareIdentifiers; - function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); - } - exports.major = major; - function major(a, loose) { - return new SemVer(a, loose).major; - } - exports.minor = minor; - function minor(a, loose) { - return new SemVer(a, loose).minor; - } - exports.patch = patch; - function patch(a, loose) { - return new SemVer(a, loose).patch; - } - exports.compare = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(a, b, true); - } - exports.compareBuild = compareBuild; - function compareBuild(a, b, loose) { - var versionA = new SemVer(a, loose); - var versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); - } - exports.rcompare = rcompare; - function rcompare(a, b, loose) { - return compare2(b, a, loose); - } - exports.sort = sort; - function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compareBuild(a, b, loose); - }); - } - exports.rsort = rsort; - function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.compareBuild(b, a, loose); - }); - } - exports.gt = gt; - function gt(a, b, loose) { - return compare2(a, b, loose) > 0; - } - exports.lt = lt; - function lt(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports.gte = gte; - function gte(a, b, loose) { - return compare2(a, b, loose) >= 0; - } - exports.lte = lte; - function lte(a, b, loose) { - return compare2(a, b, loose) <= 0; - } - exports.cmp = cmp; - function cmp(a, op, b, loose) { - switch (op) { - case "===": - if (typeof a === "object") - a = a.version; - if (typeof b === "object") - b = b.version; - return a === b; - case "!==": - if (typeof a === "object") - a = a.version; - if (typeof b === "object") - b = b.version; - return a !== b; - case "": - case "=": - case "==": - return eq(a, b, loose); - case "!=": - return neq(a, b, loose); - case ">": - return gt(a, b, loose); - case ">=": - return gte(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + FastGlob2.sync = sync; + function stream(source, options) { + assertPatternsInput(source); + const works = getWorks(source, stream_1.default, options); + return utils.stream.merge(works); } - } - exports.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + FastGlob2.stream = stream; + function generateTasks(source, options) { + assertPatternsInput(source); + const patterns = [].concat(source); + const settings = new settings_1.default(options); + return taskManager.generate(patterns, settings); } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } + FastGlob2.generateTasks = generateTasks; + function isDynamicPattern(source, options) { + assertPatternsInput(source); + const settings = new settings_1.default(options); + return utils.pattern.isDynamicPattern(source, settings); } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); + FastGlob2.isDynamicPattern = isDynamicPattern; + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escape(source); } - comp = comp.trim().split(/\s+/).join(" "); - debug("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; + FastGlob2.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertPathToPattern(source); } - debug("comp", this); + FastGlob2.convertPathToPattern = convertPathToPattern; + let posix3; + (function(posix4) { + function escapePath2(source) { + assertPatternsInput(source); + return utils.path.escapePosixPath(source); + } + posix4.escapePath = escapePath2; + function convertPathToPattern2(source) { + assertPatternsInput(source); + return utils.path.convertPosixPathToPattern(source); + } + posix4.convertPathToPattern = convertPathToPattern2; + })(posix3 = FastGlob2.posix || (FastGlob2.posix = {})); + let win32; + (function(win322) { + function escapePath2(source) { + assertPatternsInput(source); + return utils.path.escapeWindowsPath(source); + } + win322.escapePath = escapePath2; + function convertPathToPattern2(source) { + assertPatternsInput(source); + return utils.path.convertWindowsPathToPattern(source); + } + win322.convertPathToPattern = convertPathToPattern2; + })(win32 = FastGlob2.win32 || (FastGlob2.win32 = {})); + })(FastGlob || (FastGlob = {})); + function getWorks(source, _Provider, options) { + const patterns = [].concat(source); + const settings = new settings_1.default(options); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); } - var ANY = {}; - Comparator.prototype.parse = function(comp) { - var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var m = comp.match(r); - if (!m) { - throw new TypeError("Invalid comparator: " + comp); + function assertPatternsInput(input) { + const source = [].concat(input); + const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError("Patterns must be a string (non empty) or an array of strings"); } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; + } + module2.exports = FastGlob; + } +}); + +// node_modules/flatted/cjs/index.js +var require_cjs = __commonJS({ + "node_modules/flatted/cjs/index.js"(exports) { + "use strict"; + var { parse: $parse, stringify: $stringify } = JSON; + var { keys: keys2 } = Object; + var Primitive = String; + var primitive = "string"; + var ignore = {}; + var object = "object"; + var noop = (_, value) => value; + var primitives = (value) => value instanceof Primitive ? Primitive(value) : value; + var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value; + var revive = (input, parsed, output, $) => { + const lazy = []; + for (let ke = keys2(output), { length } = ke, y = 0; y < length; y++) { + const k = ke[y]; + const value = output[k]; + if (value instanceof Primitive) { + const tmp = input[value]; + if (typeof tmp === object && !parsed.has(tmp)) { + parsed.add(tmp); + output[k] = ignore; + lazy.push({ k, a: [input, parsed, tmp, $] }); + } else + output[k] = $.call(output, k, tmp); + } else if (output[k] !== ignore) + output[k] = $.call(output, k, value); } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); + for (let { length } = lazy, i = 0; i < length; i++) { + const { k, a } = lazy[i]; + output[k] = $.call(output, k, revive.apply(null, a)); } + return output; }; - Comparator.prototype.toString = function() { - return this.value; + var set = (known, input, value) => { + const index = Primitive(input.push(value) - 1); + known.set(value, index); + return index; }; - Comparator.prototype.test = function(version3) { - debug("Comparator.test", version3, this.options.loose); - if (this.semver === ANY || version3 === ANY) { - return true; - } - if (typeof version3 === "string") { - try { - version3 = new SemVer(version3, this.options); - } catch (er) { - return false; - } - } - return cmp(version3, this.operator, this.semver, this.options); + var parse4 = (text, reviver) => { + const input = $parse(text, Primitives).map(primitives); + const value = input[0]; + const $ = reviver || noop; + const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value; + return $.call({ "": tmp }, "", tmp); }; - Comparator.prototype.intersects = function(comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError("a Comparator is required"); - } - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + exports.parse = parse4; + var stringify2 = (value, replacer, space) => { + const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop; + const known = /* @__PURE__ */ new Map(); + const input = []; + const output = []; + let i = +set(known, input, $.call({ "": value }, "", value)); + let firstRun = !i; + while (i < input.length) { + firstRun = true; + output[i] = $stringify(input[i++], replace, space); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + return "[" + output.join(",") + "]"; + function replace(key, value2) { + if (firstRun) { + firstRun = !firstRun; + return value2; } - rangeTmp = new Range(comp.value, options); - return satisfies(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + const after = $.call(this, key, value2); + switch (typeof after) { + case object: + if (after === null) + return after; + case primitive: + return known.get(after) || set(known, input, after); } - rangeTmp = new Range(this.value, options); - return satisfies(comp.semver, rangeTmp, options); - } - var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">"); - var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<"); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<="); - var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<")); - var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">")); - return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; - }; - exports.Range = Range; - function Range(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + return after; } - if (range instanceof Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range(range.raw, options); + }; + exports.stringify = stringify2; + var toJSON = (any3) => $parse(stringify2(any3)); + exports.toJSON = toJSON; + var fromJSON = (any3) => parse4($stringify(any3)); + exports.fromJSON = fromJSON; + } +}); + +// node_modules/flat-cache/src/utils.js +var require_utils9 = __commonJS({ + "node_modules/flat-cache/src/utils.js"(exports, module2) { + var fs9 = require("fs"); + var path26 = require("path"); + var flatted = require_cjs(); + module2.exports = { + tryParse: function(filePath, defaultValue) { + var result; + try { + result = this.readJSON(filePath); + } catch (ex) { + result = defaultValue; } - } - if (range instanceof Comparator) { - return new Range(range.value, options); - } - if (!(this instanceof Range)) { - return new Range(range, options); - } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); - } - this.format(); - } - Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(" ").trim(); - }).join("||").trim(); - return this.range; - }; - Range.prototype.toString = function() { - return this.range; - }; - Range.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set = set.filter(function(comp) { - return !!comp.match(compRe); + return result; + }, + /** + * Read json file synchronously using flatted + * + * @method readJSON + * @param {String} filePath Json filepath + * @returns {*} parse result + */ + readJSON: function(filePath) { + return flatted.parse( + fs9.readFileSync(filePath, { + encoding: "utf8" + }) + ); + }, + /** + * Write json file synchronously using circular-json + * + * @method writeJSON + * @param {String} filePath Json filepath + * @param {*} data Object to serialize + */ + writeJSON: function(filePath, data) { + fs9.mkdirSync(path26.dirname(filePath), { + recursive: true }); + fs9.writeFileSync(filePath, flatted.stringify(data)); } - set = set.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set; - }; - Range.prototype.intersects = function(range, options) { - if (!(range instanceof Range)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); }; - function isSatisfiable(comparators, options) { - var result = true; - var remainingComparators = comparators.slice(); - var testComparator = remainingComparators.pop(); - while (result && remainingComparators.length) { - result = remainingComparators.every(function(otherComparator) { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); - } - return result; - } - exports.toComparators = toComparators; - function toComparators(range, options) { - return new Range(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug("comp", comp, options); - comp = replaceCarets(comp, options); - debug("caret", comp); - comp = replaceTildes(comp, options); - debug("tildes", comp); - comp = replaceXRanges(comp, options); - debug("xrange", comp); - comp = replaceStars(comp, options); - debug("stars", comp); - return comp; - } - function isX(id) { - return !id || id.toLowerCase() === "x" || id === "*"; - } - function replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceTilde(comp2, options); - }).join(" "); - } - function replaceTilde(comp, options) { - var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug("tilde", comp, _, M, m, p, pr); - var ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; - } else if (isX(p)) { - ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; - } else if (pr) { - debug("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + } +}); + +// node_modules/fs.realpath/old.js +var require_old = __commonJS({ + "node_modules/fs.realpath/old.js"(exports) { + var pathModule = require("path"); + var isWindows2 = process.platform === "win32"; + var fs9 = require("fs"); + var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + function rethrow() { + var callback; + if (DEBUG) { + var backtrace = new Error(); + callback = debugCallback; + } else + callback = missingCallback; + return callback; + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); } - debug("tilde return", ret); - return ret; - }); - } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug("caret", comp, _, M, m, p, pr); - var ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; - } else if (isX(p)) { - if (M === "0") { - ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0"; - } - } else if (pr) { - debug("replaceCaret pr", pr); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1); - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; - } - } else { - debug("no pr"); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } - } else { - ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; + } + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; + else if (!process.noDeprecation) { + var msg = "fs: missing callback " + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); } } - debug("caret return", ret); - return ret; - }); + } } - function replaceXRanges(comp, options) { - debug("replaceXRanges", comp, options); - return comp.split(/\s+/).map(function(comp2) { - return replaceXRange(comp2, options); - }).join(" "); - } - function replaceXRange(comp, options) { - comp = comp.trim(); - var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug("xRange", comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; - } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m = 0; - } - p = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M = +M + 1; - } else { - m = +m + 1; - } - } - ret = gtlt + M + "." + m + "." + p + pr; - } else if (xm) { - ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr; - } else if (xp) { - ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr; - } - debug("xRange return", ret); - return ret; - }); + function maybeCallback(cb) { + return typeof cb === "function" ? cb : rethrow(); } - function replaceStars(comp, options) { - debug("replaceStars", comp, options); - return comp.trim().replace(safeRe[t.STAR], ""); - } - function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = ">=" + fM + ".0.0"; - } else if (isX(fp)) { - from = ">=" + fM + "." + fm + ".0"; - } else { - from = ">=" + from; - } - if (isX(tM)) { - to = ""; - } else if (isX(tm)) { - to = "<" + (+tM + 1) + ".0.0"; - } else if (isX(tp)) { - to = "<" + tM + "." + (+tm + 1) + ".0"; - } else if (tpr) { - to = "<=" + tM + "." + tm + "." + tp + "-" + tpr; - } else { - to = "<=" + to; - } - return (from + " " + to).trim(); + var normalize3 = pathModule.normalize; + if (isWindows2) { + nextPartRe = /(.*?)(?:[\/\\]+|$)/g; + } else { + nextPartRe = /(.*?)(?:[\/]+|$)/g; } - Range.prototype.test = function(version3) { - if (!version3) { - return false; - } - if (typeof version3 === "string") { - try { - version3 = new SemVer(version3, this.options); - } catch (er) { - return false; - } + var nextPartRe; + if (isWindows2) { + splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; + } else { + splitRootRe = /^[\/]*/; + } + var splitRootRe; + exports.realpathSync = function realpathSync2(p, cache2) { + p = pathModule.resolve(p); + if (cache2 && Object.prototype.hasOwnProperty.call(cache2, p)) { + return cache2[p]; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version3, this.options)) { - return true; + var original = p, seenLinks = {}, knownHard = {}; + var pos; + var current; + var base; + var previous; + start(); + function start() { + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ""; + if (isWindows2 && !knownHard[base]) { + fs9.lstatSync(base); + knownHard[base] = true; } } - return false; - }; - function testSet(set, version3, options) { - for (var i2 = 0; i2 < set.length; i2++) { - if (!set[i2].test(version3)) { - return false; + while (pos < p.length) { + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + if (knownHard[base] || cache2 && cache2[base] === base) { + continue; } - } - if (version3.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set.length; i2++) { - debug(set[i2].semver); - if (set[i2].semver === ANY) { + var resolvedLink; + if (cache2 && Object.prototype.hasOwnProperty.call(cache2, base)) { + resolvedLink = cache2[base]; + } else { + var stat2 = fs9.lstatSync(base); + if (!stat2.isSymbolicLink()) { + knownHard[base] = true; + if (cache2) + cache2[base] = base; continue; } - if (set[i2].semver.prerelease.length > 0) { - var allowed = set[i2].semver; - if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { - return true; + var linkTarget = null; + if (!isWindows2) { + var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; } } + if (linkTarget === null) { + fs9.statSync(base); + linkTarget = fs9.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + if (cache2) + cache2[base] = resolvedLink; + if (!isWindows2) + seenLinks[id] = linkTarget; } - return false; + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); } - return true; - } - exports.satisfies = satisfies; - function satisfies(version3, range, options) { - try { - range = new Range(range, options); - } catch (er) { - return false; + if (cache2) + cache2[original] = p; + return p; + }; + exports.realpath = function realpath(p, cache2, cb) { + if (typeof cb !== "function") { + cb = maybeCallback(cache2); + cache2 = null; } - return range.test(version3); - } - exports.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; + p = pathModule.resolve(p); + if (cache2 && Object.prototype.hasOwnProperty.call(cache2, p)) { + return process.nextTick(cb.bind(null, null, cache2[p])); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } + var original = p, seenLinks = {}, knownHard = {}; + var pos; + var current; + var base; + var previous; + start(); + function start() { + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ""; + if (isWindows2 && !knownHard[base]) { + fs9.lstat(base, function(err) { + if (err) + return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); } - }); - return max; - } - exports.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } + function LOOP() { + if (pos >= p.length) { + if (cache2) + cache2[original] = p; + return cb(null, p); } - }); - return min; - } - exports.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; - } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.set[i2]; - comparators.forEach(function(comparator) { - var compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - compver.raw = compver.format(); - case "": - case ">=": - if (!minver || gt(minver, compver)) { - minver = compver; - } - break; - case "<": - case "<=": - break; - default: - throw new Error("Unexpected operation: " + comparator.operator); + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + if (knownHard[base] || cache2 && cache2[base] === base) { + return process.nextTick(LOOP); + } + if (cache2 && Object.prototype.hasOwnProperty.call(cache2, base)) { + return gotResolvedLink(cache2[base]); + } + return fs9.lstat(base, gotStat); + } + function gotStat(err, stat2) { + if (err) + return cb(err); + if (!stat2.isSymbolicLink()) { + knownHard[base] = true; + if (cache2) + cache2[base] = base; + return process.nextTick(LOOP); + } + if (!isWindows2) { + var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); } + } + fs9.stat(base, function(err2) { + if (err2) + return cb(err2); + fs9.readlink(base, function(err3, target) { + if (!isWindows2) + seenLinks[id] = target; + gotTarget(err3, target); + }); }); } - if (minver && range.test(minver)) { - return minver; + function gotTarget(err, target, base2) { + if (err) + return cb(err); + var resolvedLink = pathModule.resolve(previous, target); + if (cache2) + cache2[base2] = resolvedLink; + gotResolvedLink(resolvedLink); } - return null; - } - exports.validRange = validRange; - function validRange(range, options) { - try { - return new Range(range, options).range || "*"; - } catch (er) { - return null; + function gotResolvedLink(resolvedLink) { + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); } + }; + } +}); + +// node_modules/fs.realpath/index.js +var require_fs5 = __commonJS({ + "node_modules/fs.realpath/index.js"(exports, module2) { + module2.exports = realpath; + realpath.realpath = realpath; + realpath.sync = realpathSync2; + realpath.realpathSync = realpathSync2; + realpath.monkeypatch = monkeypatch; + realpath.unmonkeypatch = unmonkeypatch; + var fs9 = require("fs"); + var origRealpath = fs9.realpath; + var origRealpathSync = fs9.realpathSync; + var version4 = process.version; + var ok = /^v[0-5]\./.test(version4); + var old = require_old(); + function newError(er) { + return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG"); } - exports.ltr = ltr; - function ltr(version3, range, options) { - return outside(version3, range, "<", options); - } - exports.gtr = gtr; - function gtr(version3, range, options) { - return outside(version3, range, ">", options); - } - exports.outside = outside; - function outside(version3, range, hilo, options) { - version3 = new SemVer(version3, options); - range = new Range(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + function realpath(p, cache2, cb) { + if (ok) { + return origRealpath(p, cache2, cb); } - if (satisfies(version3, range, options)) { - return false; + if (typeof cache2 === "function") { + cb = cache2; + cache2 = null; } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.set[i2]; - var high = null; - var low = null; - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); - if (high.operator === comp || high.operator === ecomp) { - return false; - } - if ((!low.operator || low.operator === comp) && ltefn(version3, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version3, low.semver)) { - return false; + origRealpath(p, cache2, function(er, result) { + if (newError(er)) { + old.realpath(p, cache2, cb); + } else { + cb(er, result); } - } - return true; - } - exports.prerelease = prerelease; - function prerelease(version3, options) { - var parsed = parse3(version3, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; - } - exports.intersects = intersects; - function intersects(r1, r2, options) { - r1 = new Range(r1, options); - r2 = new Range(r2, options); - return r1.intersects(r2); + }); } - exports.coerce = coerce; - function coerce(version3, options) { - if (version3 instanceof SemVer) { - return version3; - } - if (typeof version3 === "number") { - version3 = String(version3); - } - if (typeof version3 !== "string") { - return null; + function realpathSync2(p, cache2) { + if (ok) { + return origRealpathSync(p, cache2); } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version3.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version3)) && (!match || match.index + match[0].length !== version3.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + try { + return origRealpathSync(p, cache2); + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache2); + } else { + throw er; } - safeRe[t.COERCERTL].lastIndex = -1; - } - if (match === null) { - return null; } - return parse3(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + } + function monkeypatch() { + fs9.realpath = realpath; + fs9.realpathSync = realpathSync2; + } + function unmonkeypatch() { + fs9.realpath = origRealpath; + fs9.realpathSync = origRealpathSync; } } }); -// node_modules/make-dir/index.js -var require_make_dir = __commonJS({ - "node_modules/make-dir/index.js"(exports, module2) { - "use strict"; - var fs6 = require("fs"); - var path16 = require("path"); - var { promisify: promisify3 } = require("util"); - var semver = require_semver(); - var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0"); - var checkPath = (pth) => { - if (process.platform === "win32") { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path16.parse(pth).root, "")); - if (pathHasInvalidWinCharacters) { - const error2 = new Error(`Path contains invalid characters: ${pth}`); - error2.code = "EINVAL"; - throw error2; - } +// node_modules/concat-map/index.js +var require_concat_map = __commonJS({ + "node_modules/concat-map/index.js"(exports, module2) { + module2.exports = function(xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray2(x)) + res.push.apply(res, x); + else + res.push(x); } + return res; }; - var processOptions = (options) => { - const defaults = { - mode: 511, - fs: fs6 - }; - return { - ...defaults, - ...options - }; - }; - var permissionError = (pth) => { - const error2 = new Error(`operation not permitted, mkdir '${pth}'`); - error2.code = "EPERM"; - error2.errno = -4048; - error2.path = pth; - error2.syscall = "mkdir"; - return error2; - }; - var makeDir = async (input, options) => { - checkPath(input); - options = processOptions(options); - const mkdir = promisify3(options.fs.mkdir); - const stat2 = promisify3(options.fs.stat); - if (useNativeRecursiveOption && options.fs.mkdir === fs6.mkdir) { - const pth = path16.resolve(input); - await mkdir(pth, { - mode: options.mode, - recursive: true - }); - return pth; - } - const make = async (pth) => { - try { - await mkdir(pth, options.mode); - return pth; - } catch (error2) { - if (error2.code === "EPERM") { - throw error2; - } - if (error2.code === "ENOENT") { - if (path16.dirname(pth) === pth) { - throw permissionError(pth); - } - if (error2.message.includes("null bytes")) { - throw error2; - } - await make(path16.dirname(pth)); - return make(pth); - } - try { - const stats = await stat2(pth); - if (!stats.isDirectory()) { - throw new Error("The path is not a directory"); - } - } catch (_) { - throw error2; - } - return pth; - } - }; - return make(path16.resolve(input)); - }; - module2.exports = makeDir; - module2.exports.sync = (input, options) => { - checkPath(input); - options = processOptions(options); - if (useNativeRecursiveOption && options.fs.mkdirSync === fs6.mkdirSync) { - const pth = path16.resolve(input); - fs6.mkdirSync(pth, { - mode: options.mode, - recursive: true - }); - return pth; - } - const make = (pth) => { - try { - options.fs.mkdirSync(pth, options.mode); - } catch (error2) { - if (error2.code === "EPERM") { - throw error2; - } - if (error2.code === "ENOENT") { - if (path16.dirname(pth) === pth) { - throw permissionError(pth); - } - if (error2.message.includes("null bytes")) { - throw error2; - } - make(path16.dirname(pth)); - return make(pth); - } - try { - if (!options.fs.statSync(pth).isDirectory()) { - throw new Error("The path is not a directory"); - } - } catch (_) { - throw error2; - } - } - return pth; - }; - return make(path16.resolve(input)); + var isArray2 = Array.isArray || function(xs) { + return Object.prototype.toString.call(xs) === "[object Array]"; }; } }); -// node_modules/xdg-basedir/index.js -var require_xdg_basedir = __commonJS({ - "node_modules/xdg-basedir/index.js"(exports) { +// node_modules/balanced-match/index.js +var require_balanced_match = __commonJS({ + "node_modules/balanced-match/index.js"(exports, module2) { "use strict"; - var os = require("os"); - var path16 = require("path"); - var homeDirectory = os.homedir(); - var { env } = process; - exports.data = env.XDG_DATA_HOME || (homeDirectory ? path16.join(homeDirectory, ".local", "share") : void 0); - exports.config = env.XDG_CONFIG_HOME || (homeDirectory ? path16.join(homeDirectory, ".config") : void 0); - exports.cache = env.XDG_CACHE_HOME || (homeDirectory ? path16.join(homeDirectory, ".cache") : void 0); - exports.runtime = env.XDG_RUNTIME_DIR || void 0; - exports.dataDirs = (env.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":"); - if (exports.data) { - exports.dataDirs.unshift(exports.data); + module2.exports = balanced; + function balanced(a, b, str) { + if (a instanceof RegExp) + a = maybeMatch(a, str); + if (b instanceof RegExp) + b = maybeMatch(b, str); + var r = range(a, b, str); + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; } - exports.configDirs = (env.XDG_CONFIG_DIRS || "/etc/xdg").split(":"); - if (exports.config) { - exports.configDirs.unshift(exports.config); + function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; } - } -}); - -// node_modules/imurmurhash/imurmurhash.js -var require_imurmurhash = __commonJS({ - "node_modules/imurmurhash/imurmurhash.js"(exports, module2) { - (function() { - var cache; - function MurmurHash3(key, seed) { - var m = this instanceof MurmurHash3 ? this : cache; - m.reset(seed); - if (typeof key === "string" && key.length > 0) { - m.hash(key); - } - if (m !== this) { - return m; - } - } - ; - MurmurHash3.prototype.hash = function(key) { - var h1, k1, i, top, len; - len = key.length; - this.len += len; - k1 = this.k1; - i = 0; - switch (this.rem) { - case 0: - k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0; - case 1: - k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0; - case 2: - k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0; - case 3: - k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0; - k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0; + balanced.range = range; + function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; } - this.rem = len + this.rem & 3; - len -= this.rem; - if (len > 0) { - h1 = this.h1; - while (1) { - k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; - k1 = k1 << 15 | k1 >>> 17; - k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; - h1 ^= k1; - h1 = h1 << 13 | h1 >>> 19; - h1 = h1 * 5 + 3864292196 & 4294967295; - if (i >= len) { - break; + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16; - top = key.charCodeAt(i++); - k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8; - } - k1 = 0; - switch (this.rem) { - case 3: - k1 ^= (key.charCodeAt(i + 2) & 65535) << 16; - case 2: - k1 ^= (key.charCodeAt(i + 1) & 65535) << 8; - case 1: - k1 ^= key.charCodeAt(i) & 65535; + bi = str.indexOf(b, i + 1); } - this.h1 = h1; + i = ai < bi && ai >= 0 ? ai : bi; } - this.k1 = k1; - return this; - }; - MurmurHash3.prototype.result = function() { - var k1, h1; - k1 = this.k1; - h1 = this.h1; - if (k1 > 0) { - k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; - k1 = k1 << 15 | k1 >>> 17; - k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; - h1 ^= k1; + if (begs.length) { + result = [left, right]; } - h1 ^= this.len; - h1 ^= h1 >>> 16; - h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295; - h1 ^= h1 >>> 13; - h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295; - h1 ^= h1 >>> 16; - return h1 >>> 0; - }; - MurmurHash3.prototype.reset = function(seed) { - this.h1 = typeof seed === "number" ? seed : 0; - this.rem = this.k1 = this.len = 0; - return this; - }; - cache = new MurmurHash3(); - if (typeof module2 != "undefined") { - module2.exports = MurmurHash3; - } else { - this.MurmurHash3 = MurmurHash3; } - })(); + return result; + } } }); -// node_modules/signal-exit/signals.js -var require_signals = __commonJS({ - "node_modules/signal-exit/signals.js"(exports, module2) { - module2.exports = [ - "SIGABRT", - "SIGALRM", - "SIGHUP", - "SIGINT", - "SIGTERM" - ]; - if (process.platform !== "win32") { - module2.exports.push( - "SIGVTALRM", - "SIGXCPU", - "SIGXFSZ", - "SIGUSR2", - "SIGTRAP", - "SIGSYS", - "SIGQUIT", - "SIGIOT" - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ); +// node_modules/brace-expansion/index.js +var require_brace_expansion = __commonJS({ + "node_modules/brace-expansion/index.js"(exports, module2) { + var concatMap3 = require_concat_map(); + var balanced = require_balanced_match(); + module2.exports = expandTop; + var escSlash = "\0SLASH" + Math.random() + "\0"; + var escOpen = "\0OPEN" + Math.random() + "\0"; + var escClose = "\0CLOSE" + Math.random() + "\0"; + var escComma = "\0COMMA" + Math.random() + "\0"; + var escPeriod = "\0PERIOD" + Math.random() + "\0"; + function numeric(str) { + return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } - if (process.platform === "linux") { - module2.exports.push( - "SIGIO", - "SIGPOLL", - "SIGPWR", - "SIGSTKFLT", - "SIGUNUSED" - ); + function escapeBraces(str) { + return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - } -}); - -// node_modules/signal-exit/index.js -var require_signal_exit = __commonJS({ - "node_modules/signal-exit/index.js"(exports, module2) { - var process4 = global.process; - var processOk = function(process5) { - return process5 && typeof process5 === "object" && typeof process5.removeListener === "function" && typeof process5.emit === "function" && typeof process5.reallyExit === "function" && typeof process5.listeners === "function" && typeof process5.kill === "function" && typeof process5.pid === "number" && typeof process5.on === "function"; - }; - if (!processOk(process4)) { - module2.exports = function() { - return function() { - }; - }; - } else { - assert7 = require("assert"); - signals = require_signals(); - isWin = /^win/i.test(process4.platform); - EE = require("events"); - if (typeof EE !== "function") { - EE = EE.EventEmitter; - } - if (process4.__signal_exit_emitter__) { - emitter = process4.__signal_exit_emitter__; - } else { - emitter = process4.__signal_exit_emitter__ = new EE(); - emitter.count = 0; - emitter.emitted = {}; + function unescapeBraces(str) { + return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + } + function parseCommaParts(str) { + if (!str) + return [""]; + var parts = []; + var m = balanced("{", "}", str); + if (!m) + return str.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - if (!emitter.infinite) { - emitter.setMaxListeners(Infinity); - emitter.infinite = true; + parts.push.apply(parts, p); + return parts; + } + function expandTop(str) { + if (!str) + return []; + if (str.substr(0, 2) === "{}") { + str = "\\{\\}" + str.substr(2); } - module2.exports = function(cb, opts) { - if (!processOk(global.process)) { - return function() { - }; - } - assert7.equal(typeof cb, "function", "a callback must be provided for exit handler"); - if (loaded === false) { - load(); - } - var ev = "exit"; - if (opts && opts.alwaysLast) { - ev = "afterexit"; + return expand(escapeBraces(str), true).map(unescapeBraces); + } + function embrace(str) { + return "{" + str + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte(i, y) { + return i >= y; + } + function expand(str, isTop) { + var expansions = []; + var m = balanced("{", "}", str); + if (!m || /\$$/.test(m.pre)) + return [str]; + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(",") >= 0; + if (!isSequence && !isOptions) { + if (m.post.match(/,.*\}/)) { + str = m.pre + "{" + m.body + escClose + m.post; + return expand(str); } - var remove = function() { - emitter.removeListener(ev, cb); - if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { - unload(); + return [str]; + } + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); } - }; - emitter.on(ev, cb); - return remove; - }; - unload = function unload2() { - if (!loaded || !processOk(global.process)) { - return; } - loaded = false; - signals.forEach(function(sig) { - try { - process4.removeListener(sig, sigListeners[sig]); - } catch (er) { - } - }); - process4.emit = originalProcessEmit; - process4.reallyExit = originalProcessReallyExit; - emitter.count -= 1; - }; - module2.exports.unload = unload; - emit = function emit2(event, code, signal) { - if (emitter.emitted[event]) { - return; + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; } - 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 = process4.listeners(sig); - if (listeners.length === emitter.count) { - unload(); - emit("exit", null, sig); - emit("afterexit", null, sig); - if (isWin && sig === "SIGHUP") { - sig = "SIGINT"; + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === "\\") + c = ""; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join("0"); + if (i < 0) + c = "-" + z + c.slice(1); + else + c = z + c; + } } - process4.kill(process4.pid, sig); } - }; - }); - module2.exports.signals = function() { - return signals; - }; - loaded = false; - load = function load2() { - if (loaded || !processOk(global.process)) { - return; + N.push(c); } - loaded = true; - emitter.count += 1; - signals = signals.filter(function(sig) { - try { - process4.on(sig, sigListeners[sig]); - return true; - } catch (er) { - return false; - } + } else { + N = concatMap3(n, function(el) { + return expand(el, false); }); - process4.emit = processEmit; - process4.reallyExit = processReallyExit; - }; - module2.exports.load = load; - originalProcessReallyExit = process4.reallyExit; - processReallyExit = function processReallyExit2(code) { - if (!processOk(global.process)) { - return; - } - process4.exitCode = code || /* istanbul ignore next */ - 0; - emit("exit", process4.exitCode, null); - emit("afterexit", process4.exitCode, null); - originalProcessReallyExit.call(process4, process4.exitCode); - }; - originalProcessEmit = process4.emit; - processEmit = function processEmit2(ev, arg) { - if (ev === "exit" && processOk(global.process)) { - if (arg !== void 0) { - process4.exitCode = arg; - } - var ret = originalProcessEmit.apply(this, arguments); - emit("exit", process4.exitCode, null); - emit("afterexit", process4.exitCode, null); - return ret; - } else { - return originalProcessEmit.apply(this, arguments); - } - }; - } - var assert7; - var signals; - var isWin; - var EE; - var emitter; - var unload; - var emit; - var sigListeners; - var loaded; - var load; - var originalProcessReallyExit; - var processReallyExit; - var originalProcessEmit; - var processEmit; - } -}); - -// node_modules/is-typedarray/index.js -var require_is_typedarray = __commonJS({ - "node_modules/is-typedarray/index.js"(exports, module2) { - module2.exports = isTypedArray; - isTypedArray.strict = isStrictTypedArray; - isTypedArray.loose = isLooseTypedArray; - var toString = Object.prototype.toString; - var names = { - "[object Int8Array]": true, - "[object Int16Array]": true, - "[object Int32Array]": true, - "[object Uint8Array]": true, - "[object Uint8ClampedArray]": true, - "[object Uint16Array]": true, - "[object Uint32Array]": true, - "[object Float32Array]": true, - "[object Float64Array]": true - }; - function isTypedArray(arr) { - return isStrictTypedArray(arr) || isLooseTypedArray(arr); - } - function isStrictTypedArray(arr) { - return arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array; - } - function isLooseTypedArray(arr) { - return names[toString.call(arr)]; - } - } -}); - -// node_modules/typedarray-to-buffer/index.js -var require_typedarray_to_buffer = __commonJS({ - "node_modules/typedarray-to-buffer/index.js"(exports, module2) { - var isTypedArray = require_is_typedarray().strict; - module2.exports = function typedarrayToBuffer(arr) { - if (isTypedArray(arr)) { - var buf = Buffer.from(arr.buffer); - if (arr.byteLength !== arr.buffer.byteLength) { - buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength); + } + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); } - return buf; - } else { - return Buffer.from(arr); } - }; + return expansions; + } } }); -// node_modules/write-file-atomic/index.js -var require_write_file_atomic = __commonJS({ - "node_modules/write-file-atomic/index.js"(exports, module2) { - "use strict"; - module2.exports = writeFile; - module2.exports.sync = writeFileSync; - module2.exports._getTmpname = getTmpname; - module2.exports._cleanupOnExit = cleanupOnExit; - var fs6 = require("fs"); - var MurmurHash3 = require_imurmurhash(); - var onExit = require_signal_exit(); - var path16 = require("path"); - var isTypedArray = require_is_typedarray(); - var typedArrayToBuffer = require_typedarray_to_buffer(); - var { promisify: promisify3 } = require("util"); - var activeFiles = {}; - var threadId = function getId() { +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path26 = function() { try { - const workerThreads = require("worker_threads"); - return workerThreads.threadId; + return require("path"); } catch (e) { - return 0; } - }(); - var invocations = 0; - function getTmpname(filename) { - return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result(); + }() || { + sep: "/" + }; + minimatch.sep = path26.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set, c) { + set[c] = true; + return set; + }, {}); } - function cleanupOnExit(tmpfile) { - return () => { - try { - fs6.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile); - } catch (_) { - } + var slashSplit = /\/+/; + minimatch.filter = filter3; + function filter3(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); }; } - function serializeActiveFile(absoluteName) { - return new Promise((resolve10) => { - if (!activeFiles[absoluteName]) - activeFiles[absoluteName] = []; - activeFiles[absoluteName].push(resolve10); - if (activeFiles[absoluteName].length === 1) - resolve10(); + function ext(a, b) { + b = b || {}; + var t = {}; + Object.keys(a).forEach(function(k) { + t[k] = a[k]; }); + Object.keys(b).forEach(function(k) { + t[k] = b[k]; + }); + return t; } - function isChownErrOk(err) { - if (err.code === "ENOSYS") { - return true; + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } - const nonroot = !process.getuid || process.getuid() !== 0; - if (nonroot) { - if (err.code === "EINVAL" || err.code === "EPERM") { - return true; - } + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter4(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) + options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; } - return false; + return new Minimatch(pattern, options).match(p); } - async function writeFileAsync(filename, data, options = {}) { - if (typeof options === "string") { - options = { encoding: options }; - } - let fd; - let tmpfile; - const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)); - const absoluteName = path16.resolve(filename); - try { - await serializeActiveFile(absoluteName); - const truename = await promisify3(fs6.realpath)(filename).catch(() => filename); - tmpfile = getTmpname(truename); - if (!options.mode || !options.chown) { - const stats = await promisify3(fs6.stat)(truename).catch(() => { - }); - if (stats) { - if (options.mode == null) { - options.mode = stats.mode; - } - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid }; - } - } - } - fd = await promisify3(fs6.open)(tmpfile, "w", options.mode); - if (options.tmpfileCreated) { - await options.tmpfileCreated(tmpfile); - } - if (isTypedArray(data)) { - data = typedArrayToBuffer(data); - } - if (Buffer.isBuffer(data)) { - await promisify3(fs6.write)(fd, data, 0, data.length, 0); - } else if (data != null) { - await promisify3(fs6.write)(fd, String(data), 0, String(options.encoding || "utf8")); - } - if (options.fsync !== false) { - await promisify3(fs6.fsync)(fd); - } - await promisify3(fs6.close)(fd); - fd = null; - if (options.chown) { - await promisify3(fs6.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => { - if (!isChownErrOk(err)) { - throw err; - } - }); - } - if (options.mode) { - await promisify3(fs6.chmod)(tmpfile, options.mode).catch((err) => { - if (!isChownErrOk(err)) { - throw err; - } - }); - } - await promisify3(fs6.rename)(tmpfile, truename); - } finally { - if (fd) { - await promisify3(fs6.close)(fd).catch( - /* istanbul ignore next */ - () => { - } - ); - } - removeOnExitHandler(); - await promisify3(fs6.unlink)(tmpfile).catch(() => { - }); - activeFiles[absoluteName].shift(); - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0](); - } else - delete activeFiles[absoluteName]; + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - } - function writeFile(filename, data, options, callback) { - if (options instanceof Function) { - callback = options; + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path26.sep !== "/") { + pattern = pattern.split(path26.sep).join("/"); } - const promise = writeFileAsync(filename, data, options); - if (callback) { - promise.then(callback, callback); - } - return promise; + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - function writeFileSync(filename, data, options) { - if (typeof options === "string") - options = { encoding: options }; - else if (!options) - options = {}; - try { - filename = fs6.realpathSync(filename); - } catch (ex) { + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern = this.pattern; + var options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; } - const tmpfile = getTmpname(filename); - if (!options.mode || !options.chown) { - try { - const stats = fs6.statSync(filename); - options = Object.assign({}, options); - if (!options.mode) { - options.mode = stats.mode; - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid }; - } - } catch (ex) { - } + if (!pattern) { + this.empty = true; + return; } - let fd; - const cleanup = cleanupOnExit(tmpfile); - const removeOnExitHandler = onExit(cleanup); - let threw = true; - try { - fd = fs6.openSync(tmpfile, "w", options.mode || 438); - if (options.tmpfileCreated) { - options.tmpfileCreated(tmpfile); - } - if (isTypedArray(data)) { - data = typedArrayToBuffer(data); - } - if (Buffer.isBuffer(data)) { - fs6.writeSync(fd, data, 0, data.length, 0); - } else if (data != null) { - fs6.writeSync(fd, String(data), 0, String(options.encoding || "utf8")); - } - if (options.fsync !== false) { - fs6.fsyncSync(fd); - } - fs6.closeSync(fd); - fd = null; - if (options.chown) { - try { - fs6.chownSync(tmpfile, options.chown.uid, options.chown.gid); - } catch (err) { - if (!isChownErrOk(err)) { - throw err; - } - } - } - if (options.mode) { - try { - fs6.chmodSync(tmpfile, options.mode); - } catch (err) { - if (!isChownErrOk(err)) { - throw err; - } - } - } - fs6.renameSync(tmpfile, filename); - threw = false; - } finally { - if (fd) { - try { - fs6.closeSync(fd); - } catch (ex) { - } - } - removeOnExitHandler(); - if (threw) { - cleanup(); - } + this.parseNegate(); + var set = this.globSet = this.braceExpand(); + if (options.debug) + this.debug = function debug() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set); + set = this.globParts = set.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set); + set = set.map(function(s, si, set2) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set); + set = set.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set); + this.set = set; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = false; + var options = this.options; + var negateOffset = 0; + if (options.nonegate) + return; + for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { + negate = !negate; + negateOffset++; } + if (negateOffset) + this.pattern = pattern.substr(negateOffset); + this.negate = negate; } - } -}); - -// node_modules/is-obj/index.js -var require_is_obj = __commonJS({ - "node_modules/is-obj/index.js"(exports, module2) { - "use strict"; - module2.exports = (value) => { - const type = typeof value; - return value !== null && (type === "object" || type === "function"); + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); }; - } -}); - -// node_modules/dot-prop/index.js -var require_dot_prop = __commonJS({ - "node_modules/dot-prop/index.js"(exports, module2) { - "use strict"; - var isObj = require_is_obj(); - var disallowedKeys = [ - "__proto__", - "prototype", - "constructor" - ]; - var isValidPath = (pathSegments) => !pathSegments.some((segment) => disallowedKeys.includes(segment)); - function getPathSegments(path16) { - const pathArray = path16.split("."); - const parts = []; - for (let i = 0; i < pathArray.length; i++) { - let p = pathArray[i]; - while (p[p.length - 1] === "\\" && pathArray[i + 1] !== void 0) { - p = p.slice(0, -1) + "."; - p += pathArray[++i]; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; } - parts.push(p); } - if (!isValidPath(parts)) { - return []; + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; } - return parts; + return expand(pattern); } - module2.exports = { - get(object, path16, value) { - if (!isObj(object) || typeof path16 !== "string") { - return value === void 0 ? object : value; - } - const pathArray = getPathSegments(path16); - if (pathArray.length === 0) { - return; - } - for (let i = 0; i < pathArray.length; i++) { - if (!Object.prototype.propertyIsEnumerable.call(object, pathArray[i])) { - return value; - } - object = object[pathArray[i]]; - if (object === void 0 || object === null) { - if (i !== pathArray.length - 1) { - return value; - } - break; - } - } - return object; - }, - set(object, path16, value) { - if (!isObj(object) || typeof path16 !== "string") { - return object; - } - const root = object; - const pathArray = getPathSegments(path16); - for (let i = 0; i < pathArray.length; i++) { - const p = pathArray[i]; - if (!isObj(object[p])) { - object[p] = {}; - } - if (i === pathArray.length - 1) { - object[p] = value; + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse4; + var SUBPARSE = {}; + function parse4(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern = "*"; + } + if (pattern === "") + return ""; + var re = ""; + var hasMagic = !!options.nocase; + var escaping = false; + var patternListStack = []; + var negativeLists = []; + var stateChar; + var inClass = false; + var reClassStart = -1; + var classStart = -1; + var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + var self = this; + function clearStateChar() { + if (stateChar) { + switch (stateChar) { + case "*": + re += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; } - object = object[p]; + self.debug("clearStateChar %j %j", stateChar, re); + stateChar = false; } - return root; - }, - delete(object, path16) { - if (!isObj(object) || typeof path16 !== "string") { - return false; + } + for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { + this.debug("%s %s %s %j", pattern, i, re, c); + if (escaping && reSpecials[c]) { + re += "\\" + c; + escaping = false; + continue; } - const pathArray = getPathSegments(path16); - for (let i = 0; i < pathArray.length; i++) { - const p = pathArray[i]; - if (i === pathArray.length - 1) { - delete object[p]; - return true; - } - object = object[p]; - if (!isObj(object)) { + switch (c) { + case "/": { return false; } - } - }, - has(object, path16) { - if (!isObj(object) || typeof path16 !== "string") { - return false; - } - const pathArray = getPathSegments(path16); - if (pathArray.length === 0) { - return false; - } - for (let i = 0; i < pathArray.length; i++) { - if (isObj(object)) { - if (!(pathArray[i] in object)) { - return false; + case "\\": + clearStateChar(); + escaping = true; + continue; + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); + if (inClass) { + this.debug(" in class"); + if (c === "!" && i === classStart + 1) + c = "^"; + re += c; + continue; } - object = object[pathArray[i]]; - } else { - return false; + self.debug("call clearStateChar %j", stateChar); + clearStateChar(); + stateChar = c; + if (options.noext) + clearStateChar(); + continue; + case "(": + if (inClass) { + re += "("; + continue; + } + if (!stateChar) { + re += "\\("; + continue; + } + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }); + re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; + this.debug("plType %j %j", stateChar, re); + stateChar = false; + continue; + case ")": + if (inClass || !patternListStack.length) { + re += "\\)"; + continue; + } + clearStateChar(); + hasMagic = true; + var pl = patternListStack.pop(); + re += pl.close; + if (pl.type === "!") { + negativeLists.push(pl); + } + pl.reEnd = re.length; + continue; + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|"; + escaping = false; + continue; + } + clearStateChar(); + re += "|"; + continue; + case "[": + clearStateChar(); + if (inClass) { + re += "\\" + c; + continue; + } + inClass = true; + classStart = i; + reClassStart = re.length; + re += c; + continue; + case "]": + if (i === classStart + 1 || !inClass) { + re += "\\" + c; + escaping = false; + continue; + } + var cs = pattern.substring(classStart + 1, i); + try { + RegExp("[" + cs + "]"); + } catch (er) { + var sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue; + } + hasMagic = true; + inClass = false; + re += c; + continue; + default: + clearStateChar(); + if (escaping) { + escaping = false; + } else if (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; + } + } + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; + } + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length); + this.debug("setting tail", re, pl); + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) { + if (!$2) { + $2 = "\\"; } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; + } + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n]; + var nlBefore = re.slice(0, nl.reStart); + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); + var nlAfter = re.slice(nl.reEnd); + nlLast += nlAfter; + var openParensBefore = nlBefore.split("(").length - 1; + var cleanAfter = nlAfter; + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); } - return true; + nlAfter = cleanAfter; + var dollar = ""; + if (nlAfter === "" && isSub !== SUBPARSE) { + dollar = "$"; + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; + re = newRe; + } + if (re !== "" && hasMagic) { + re = "(?=.)" + re; + } + if (addPatternStart) { + re = patternStart + re; + } + if (isSub === SUBPARSE) { + return [re, hasMagic]; } + if (!hasMagic) { + return globUnescape(pattern); + } + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re + "$", flags); + } catch (er) { + return new RegExp("$."); + } + regExp._glob = pattern; + regExp._src = re; + return regExp; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); }; - } -}); - -// node_modules/crypto-random-string/index.js -var require_crypto_random_string = __commonJS({ - "node_modules/crypto-random-string/index.js"(exports, module2) { - "use strict"; - var crypto5 = require("crypto"); - module2.exports = (length) => { - if (!Number.isFinite(length)) { - throw new TypeError("Expected a finite number"); + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) + return this.regexp; + var set = this.set; + if (!set.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; + }).join("\\/"); + }).join("|"); + re = "^(?:" + re + ")$"; + if (this.negate) + re = "^(?!" + re + ").*$"; + try { + this.regexp = new RegExp(re, flags); + } catch (ex) { + this.regexp = false; + } + return this.regexp; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm2 = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm2.match(f); + }); + if (mm2.options.nonull && !list.length) { + list.push(pattern); } - return crypto5.randomBytes(Math.ceil(length / 2)).toString("hex").slice(0, length); + return list; }; - } -}); - -// node_modules/unique-string/index.js -var require_unique_string = __commonJS({ - "node_modules/unique-string/index.js"(exports, module2) { - "use strict"; - var cryptoRandomString = require_crypto_random_string(); - module2.exports = () => cryptoRandomString(32); - } -}); - -// node_modules/configstore/index.js -var require_configstore = __commonJS({ - "node_modules/configstore/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var os = require("os"); - var fs6 = require_graceful_fs(); - var makeDir = require_make_dir(); - var xdgBasedir = require_xdg_basedir(); - var writeFileAtomic = require_write_file_atomic(); - var dotProp = require_dot_prop(); - var uniqueString = require_unique_string(); - var configDirectory = xdgBasedir.config || path16.join(os.tmpdir(), uniqueString()); - var permissionError = "You don't have access to this file."; - var makeDirOptions = { mode: 448 }; - var writeFileOptions = { mode: 384 }; - var Configstore = class { - constructor(id, defaults, options = {}) { - const pathPrefix = options.globalConfigPath ? path16.join(id, "config.json") : path16.join("configstore", `${id}.json`); - this.path = options.configPath || path16.join(configDirectory, pathPrefix); - if (defaults) { - this.all = { - ...defaults, - ...this.all - }; + Minimatch.prototype.match = function match2(f, partial) { + if (typeof partial === "undefined") + partial = this.partial; + this.debug("match", f, this.pattern); + if (this.comment) + return false; + if (this.empty) + return f === ""; + if (f === "/" && partial) + return true; + var options = this.options; + if (path26.sep !== "/") { + f = f.split(path26.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set = this.set; + this.debug(this.pattern, "set", set); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) + break; + } + for (i = 0; i < set.length; i++) { + var pattern = set[i]; + var file = f; + if (options.matchBase && pattern.length === 1) { + file = [filename]; + } + var hit = this.matchOne(file, pattern, partial); + if (hit) { + if (options.flipNegate) + return true; + return !this.negate; } } - get all() { - try { - return JSON.parse(fs6.readFileSync(this.path, "utf8")); - } catch (error2) { - if (error2.code === "ENOENT") { - return {}; - } - if (error2.code === "EACCES") { - error2.message = `${error2.message} -${permissionError} -`; + if (options.flipNegate) + return false; + return this.negate; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false) + return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") + return false; + } + return true; } - if (error2.name === "SyntaxError") { - writeFileAtomic.sync(this.path, "", writeFileOptions); - return {}; + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } } - throw error2; - } - } - set all(value) { - try { - makeDir.sync(path16.dirname(this.path), makeDirOptions); - writeFileAtomic.sync(this.path, JSON.stringify(value, void 0, " "), writeFileOptions); - } catch (error2) { - if (error2.code === "EACCES") { - error2.message = `${error2.message} -${permissionError} -`; + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) + return true; } - throw error2; + return false; } - } - get size() { - return Object.keys(this.all || {}).length; - } - get(key) { - return dotProp.get(this.all, key); - } - set(key, value) { - const config = this.all; - if (arguments.length === 1) { - for (const k of Object.keys(key)) { - dotProp.set(config, k, key[k]); - } + var hit; + if (typeof p === "string") { + hit = f === p; + this.debug("string match", p, f, hit); } else { - dotProp.set(config, key, value); + hit = f.match(p); + this.debug("pattern match", p, f, hit); } - this.all = config; - } - has(key) { - return dotProp.has(this.all, key); - } - delete(key) { - const config = this.all; - dotProp.delete(config, key); - this.all = config; + if (!hit) + return false; } - clear() { - this.all = {}; + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial; + } else if (pi === pl) { + return fi === fl - 1 && file[fi] === ""; } + throw new Error("wtf?"); }; - module2.exports = Configstore; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/cfgStore.js -var require_cfgStore = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/cfgStore.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ConfigStore = void 0; - var configstore_1 = __importDefault(require_configstore()); - exports.ConfigStore = configstore_1.default; + function globUnescape(s) { + return s.replace(/\\(.)/g, "$1"); + } + function regExpEscape(s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } } }); -// node_modules/cspell-lib/dist/cjs/Settings/GlobalSettings.js -var require_GlobalSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/GlobalSettings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getGlobalConfigPath = exports.writeRawGlobalSettings = exports.getRawGlobalSettings = void 0; - var util_1 = require("util"); - var errors_js_1 = require_errors3(); - var logger_js_1 = require_logger(); - var cfgStore_js_1 = require_cfgStore(); - var packageName = "cspell"; - function getRawGlobalSettings() { - const name = "CSpell Configstore"; - const globalConf = { - source: { - name, - filename: void 0 +// node_modules/inherits/inherits_browser.js +var require_inherits_browser = __commonJS({ + "node_modules/inherits/inherits_browser.js"(exports, module2) { + if (typeof Object.create === "function") { + module2.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 + } + }); } }; - try { - const cfgStore = new cfgStore_js_1.ConfigStore(packageName); - const cfg = cfgStore.all; - if (cfg && Object.keys(cfg).length) { - Object.assign(globalConf, cfg); - globalConf.source = { - name, - filename: cfgStore.path + } else { + module2.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; } - } catch (error2) { - if (!(0, errors_js_1.isErrnoException)(error2) || !error2.code || !["ENOENT", "EACCES", "ENOTDIR", "EISDIR"].includes(error2.code)) { - (0, logger_js_1.logError)(error2); - } - } - return globalConf; - } - exports.getRawGlobalSettings = getRawGlobalSettings; - function writeRawGlobalSettings(settings) { - const toWrite = { - import: settings.import }; - try { - const cfgStore = new cfgStore_js_1.ConfigStore(packageName); - cfgStore.set(toWrite); - return void 0; - } catch (error2) { - if (error2 instanceof Error) - return error2; - return new Error((0, util_1.format)(error2)); - } } - exports.writeRawGlobalSettings = writeRawGlobalSettings; - function getGlobalConfigPath() { - const cfgStore = new cfgStore_js_1.ConfigStore(packageName); - return cfgStore.path; - } - exports.getGlobalConfigPath = getGlobalConfigPath; } }); -// node_modules/cspell-lib/dist/cjs/Settings/Controller/ImportError.js -var require_ImportError = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/ImportError.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.UnsupportedPnpFile = exports.UnsupportedSchema = exports.ImportError = void 0; - var errors_js_1 = require_errors3(); - var ImportError = class extends Error { - constructor(msg, cause) { - super(msg); - this.cause = (0, errors_js_1.isError)(cause) ? cause : void 0; - } - }; - exports.ImportError = ImportError; - var UnsupportedSchema = class extends Error { - constructor(msg) { - super(msg); - } - }; - exports.UnsupportedSchema = UnsupportedSchema; - var UnsupportedPnpFile = class extends Error { - constructor(msg) { - super(msg); - } - }; - exports.UnsupportedPnpFile = UnsupportedPnpFile; +// node_modules/inherits/inherits.js +var require_inherits = __commonJS({ + "node_modules/inherits/inherits.js"(exports, module2) { + try { + util = require("util"); + if (typeof util.inherits !== "function") + throw ""; + module2.exports = util.inherits; + } catch (e) { + module2.exports = require_inherits_browser(); + } + var util; } }); -// node_modules/clear-module/node_modules/parent-module/index.js -var require_parent_module2 = __commonJS({ - "node_modules/clear-module/node_modules/parent-module/index.js"(exports, module2) { +// node_modules/path-is-absolute/index.js +var require_path_is_absolute = __commonJS({ + "node_modules/path-is-absolute/index.js"(exports, module2) { "use strict"; - var callsites = require_callsites(); - module2.exports = (filePath) => { - const stacks = callsites(); - if (!filePath) { - return stacks[2].getFileName(); - } - let hasSeenValue = false; - stacks.shift(); - for (const stack of stacks) { - const parentFilePath = stack.getFileName(); - if (typeof parentFilePath !== "string") { - continue; - } - if (parentFilePath === filePath) { - hasSeenValue = true; - continue; - } - if (parentFilePath === "module.js") { - continue; - } - if (hasSeenValue && parentFilePath !== filePath) { - return parentFilePath; - } - } - }; + function posix3(path26) { + return path26.charAt(0) === "/"; + } + function win32(path26) { + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path26); + var device = result[1] || ""; + var isUnc = Boolean(device && device.charAt(1) !== ":"); + return Boolean(result[2] || isUnc); + } + module2.exports = process.platform === "win32" ? win32 : posix3; + module2.exports.posix = posix3; + module2.exports.win32 = win32; } }); -// node_modules/clear-module/index.js -var require_clear_module = __commonJS({ - "node_modules/clear-module/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var resolveFrom = require_resolve_from2(); - var parentModule = require_parent_module2(); - var resolve10 = (moduleId) => { - try { - return resolveFrom(path16.dirname(parentModule(__filename)), moduleId); - } catch (_) { +// node_modules/glob/common.js +var require_common5 = __commonJS({ + "node_modules/glob/common.js"(exports) { + exports.setopts = setopts; + exports.ownProp = ownProp; + exports.makeAbs = makeAbs; + exports.finish = finish; + exports.mark = mark; + exports.isIgnored = isIgnored; + exports.childrenIgnored = childrenIgnored; + function ownProp(obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field); + } + var fs9 = require("fs"); + var path26 = require("path"); + var minimatch = require_minimatch(); + var isAbsolute = require_path_is_absolute(); + var Minimatch = minimatch.Minimatch; + function alphasort(a, b) { + return a.localeCompare(b, "en"); + } + function setupIgnores(self, options) { + self.ignore = options.ignore || []; + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore]; + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap); } - }; - var clear = (moduleId) => { - if (typeof moduleId !== "string") { - throw new TypeError(`Expected a \`string\`, got \`${typeof moduleId}\``); + } + function ignoreMap(pattern) { + var gmatcher = null; + if (pattern.slice(-3) === "/**") { + var gpattern = pattern.replace(/(\/\*\*)+$/, ""); + gmatcher = new Minimatch(gpattern, { dot: true }); } - const filePath = resolve10(moduleId); - if (!filePath) { - return; + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher + }; + } + function setopts(self, pattern, options) { + if (!options) + options = {}; + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar"); + } + pattern = "**/" + pattern; } - if (require.cache[filePath] && require.cache[filePath].parent) { - let i = require.cache[filePath].parent.children.length; - while (i--) { - if (require.cache[filePath].parent.children[i].id === filePath) { - require.cache[filePath].parent.children.splice(i, 1); + self.silent = !!options.silent; + self.pattern = pattern; + self.strict = options.strict !== false; + self.realpath = !!options.realpath; + self.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null); + self.follow = !!options.follow; + self.dot = !!options.dot; + self.mark = !!options.mark; + self.nodir = !!options.nodir; + if (self.nodir) + self.mark = true; + self.sync = !!options.sync; + self.nounique = !!options.nounique; + self.nonull = !!options.nonull; + self.nosort = !!options.nosort; + self.nocase = !!options.nocase; + self.stat = !!options.stat; + self.noprocess = !!options.noprocess; + self.absolute = !!options.absolute; + self.fs = options.fs || fs9; + self.maxLength = options.maxLength || Infinity; + self.cache = options.cache || /* @__PURE__ */ Object.create(null); + self.statCache = options.statCache || /* @__PURE__ */ Object.create(null); + self.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null); + setupIgnores(self, options); + self.changedCwd = false; + var cwd = process.cwd(); + if (!ownProp(options, "cwd")) + self.cwd = cwd; + else { + self.cwd = path26.resolve(options.cwd); + self.changedCwd = self.cwd !== cwd; + } + self.root = options.root || path26.resolve(self.cwd, "/"); + self.root = path26.resolve(self.root); + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/"); + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd); + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/"); + self.nomount = !!options.nomount; + options.nonegate = true; + options.nocomment = true; + options.allowWindowsEscape = false; + self.minimatch = new Minimatch(pattern, options); + self.options = self.minimatch.options; + } + function finish(self) { + var nou = self.nounique; + var all3 = nou ? [] : /* @__PURE__ */ Object.create(null); + for (var i = 0, l = self.matches.length; i < l; i++) { + var matches = self.matches[i]; + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + var literal = self.minimatch.globSet[i]; + if (nou) + all3.push(literal); + else + all3[literal] = true; } + } else { + var m = Object.keys(matches); + if (nou) + all3.push.apply(all3, m); + else + m.forEach(function(m2) { + all3[m2] = true; + }); } } - if (require.cache[filePath]) { - const children = require.cache[filePath].children.map((child) => child.id); - delete require.cache[filePath]; - for (const id of children) { - clear(id); + if (!nou) + all3 = Object.keys(all3); + if (!self.nosort) + all3 = all3.sort(alphasort); + if (self.mark) { + for (var i = 0; i < all3.length; i++) { + all3[i] = self._mark(all3[i]); + } + if (self.nodir) { + all3 = all3.filter(function(e) { + var notDir = !/\/$/.test(e); + var c = self.cache[e] || self.cache[makeAbs(self, e)]; + if (notDir && c) + notDir = c !== "DIR" && !Array.isArray(c); + return notDir; + }); } } - }; - clear.all = () => { - const directory = path16.dirname(parentModule(__filename)); - for (const moduleId of Object.keys(require.cache)) { - delete require.cache[resolveFrom(directory, moduleId)]; - } - }; - clear.match = (regex) => { - for (const moduleId of Object.keys(require.cache)) { - if (regex.test(moduleId)) { - clear(moduleId); + if (self.ignore.length) + all3 = all3.filter(function(m2) { + return !isIgnored(self, m2); + }); + self.found = all3; + } + function mark(self, p) { + var abs = makeAbs(self, p); + var c = self.cache[abs]; + var m = p; + if (c) { + var isDir2 = c === "DIR" || Array.isArray(c); + var slash = p.slice(-1) === "/"; + if (isDir2 && !slash) + m += "/"; + else if (!isDir2 && slash) + m = m.slice(0, -1); + if (m !== p) { + var mabs = makeAbs(self, m); + self.statCache[mabs] = self.statCache[abs]; + self.cache[mabs] = self.cache[abs]; } } - }; - clear.single = (moduleId) => { - if (typeof moduleId !== "string") { - throw new TypeError(`Expected a \`string\`, got \`${typeof moduleId}\``); + return m; + } + function makeAbs(self, f) { + var abs = f; + if (f.charAt(0) === "/") { + abs = path26.join(self.root, f); + } else if (isAbsolute(f) || f === "") { + abs = f; + } else if (self.changedCwd) { + abs = path26.resolve(self.cwd, f); + } else { + abs = path26.resolve(f); } - delete require.cache[resolve10(moduleId)]; - }; - module2.exports = clear; + if (process.platform === "win32") + abs = abs.replace(/\\/g, "/"); + return abs; + } + function isIgnored(self, path27) { + if (!self.ignore.length) + return false; + return self.ignore.some(function(item) { + return item.matcher.match(path27) || !!(item.gmatcher && item.gmatcher.match(path27)); + }); + } + function childrenIgnored(self, path27) { + if (!self.ignore.length) + return false; + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path27)); + }); + } } }); -// node_modules/yocto-queue/index.js -var require_yocto_queue = __commonJS({ - "node_modules/yocto-queue/index.js"(exports, module2) { - var Node = class { - /// value; - /// next; - constructor(value) { - this.value = value; - this.next = void 0; +// node_modules/glob/sync.js +var require_sync7 = __commonJS({ + "node_modules/glob/sync.js"(exports, module2) { + module2.exports = globSync; + globSync.GlobSync = GlobSync; + var rp = require_fs5(); + var minimatch = require_minimatch(); + var Minimatch = minimatch.Minimatch; + var Glob = require_glob().Glob; + var util = require("util"); + var path26 = require("path"); + var assert20 = require("assert"); + var isAbsolute = require_path_is_absolute(); + var common = require_common5(); + var setopts = common.setopts; + var ownProp = common.ownProp; + var childrenIgnored = common.childrenIgnored; + var isIgnored = common.isIgnored; + function globSync(pattern, options) { + if (typeof options === "function" || arguments.length === 3) + throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); + return new GlobSync(pattern, options).found; + } + function GlobSync(pattern, options) { + if (!pattern) + throw new Error("must provide pattern"); + if (typeof options === "function" || arguments.length === 3) + throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options); + setopts(this, pattern, options); + if (this.noprocess) + return this; + var n = this.minimatch.set.length; + this.matches = new Array(n); + for (var i = 0; i < n; i++) { + this._process(this.minimatch.set[i], i, false); } - }; - var Queue = class { - // TODO: Use private class fields when targeting Node.js 12. - // #_head; - // #_tail; - // #_size; - constructor() { - this.clear(); + this._finish(); + } + GlobSync.prototype._finish = function() { + assert20.ok(this instanceof GlobSync); + if (this.realpath) { + var self = this; + this.matches.forEach(function(matchset, index) { + var set = self.matches[index] = /* @__PURE__ */ Object.create(null); + for (var p in matchset) { + try { + p = self._makeAbs(p); + var real = rp.realpathSync(p, self.realpathCache); + set[real] = true; + } catch (er) { + if (er.syscall === "stat") + set[self._makeAbs(p)] = true; + else + throw er; + } + } + }); } - 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++; + common.finish(this); + }; + GlobSync.prototype._process = function(pattern, index, inGlobStar) { + assert20.ok(this instanceof GlobSync); + var n = 0; + while (typeof pattern[n] === "string") { + n++; } - dequeue() { - const current = this._head; - if (!current) { + var prefix; + switch (n) { + case pattern.length: + this._processSimple(pattern.join("/"), index); 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; - } + case 0: + prefix = null; + break; + default: + prefix = pattern.slice(0, n).join("/"); + break; } + var remain = pattern.slice(n); + var read2; + if (prefix === null) + read2 = "."; + else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) { + return typeof p === "string" ? p : "[*]"; + }).join("/"))) { + if (!prefix || !isAbsolute(prefix)) + prefix = "/" + prefix; + read2 = prefix; + } else + read2 = prefix; + var abs = this._makeAbs(read2); + if (childrenIgnored(this, read2)) + return; + var isGlobStar = remain[0] === minimatch.GLOBSTAR; + if (isGlobStar) + this._processGlobStar(prefix, read2, abs, remain, index, inGlobStar); + else + this._processReaddir(prefix, read2, abs, remain, index, inGlobStar); }; - module2.exports = Queue; - } -}); - -// node_modules/p-limit/index.js -var require_p_limit = __commonJS({ - "node_modules/p-limit/index.js"(exports, module2) { - "use strict"; - var Queue = require_yocto_queue(); - var pLimit = (concurrency) => { - if (!((Number.isInteger(concurrency) || concurrency === 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, resolve10, ...args) => { - activeCount++; - const result = (async () => fn(...args))(); - resolve10(result); - try { - await result; - } catch { + GlobSync.prototype._processReaddir = function(prefix, read2, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar); + if (!entries) + return; + var pn = remain[0]; + var negate = !!this.minimatch.negate; + var rawGlob = pn._glob; + var dotOk = this.dot || rawGlob.charAt(0) === "."; + var matchedEntries = []; + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (e.charAt(0) !== "." || dotOk) { + var m; + if (negate && !prefix) { + m = !e.match(pn); + } else { + m = e.match(pn); + } + if (m) + matchedEntries.push(e); } - next(); - }; - const enqueue = (fn, resolve10, ...args) => { - queue.enqueue(run2.bind(null, fn, resolve10, ...args)); - (async () => { - await Promise.resolve(); - if (activeCount < concurrency && queue.size > 0) { - queue.dequeue()(); + } + var len = matchedEntries.length; + if (len === 0) + return; + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = /* @__PURE__ */ Object.create(null); + for (var i = 0; i < len; i++) { + var e = matchedEntries[i]; + if (prefix) { + if (prefix.slice(-1) !== "/") + e = prefix + "/" + e; + else + e = prefix + e; } - })(); - }; - const generator = (fn, ...args) => new Promise((resolve10) => { - enqueue(fn, resolve10, ...args); - }); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.size - }, - clearQueue: { - value: () => { - queue.clear(); + if (e.charAt(0) === "/" && !this.nomount) { + e = path26.join(this.root, e); } + this._emitMatch(index, e); } - }); - return generator; - }; - module2.exports = pLimit; - } -}); - -// node_modules/p-locate/index.js -var require_p_locate = __commonJS({ - "node_modules/p-locate/index.js"(exports, module2) { - "use strict"; - var pLimit = require_p_limit(); - var EndError = class extends Error { - constructor(value) { - super(); - this.value = value; + return; + } + remain.shift(); + for (var i = 0; i < len; i++) { + var e = matchedEntries[i]; + var newPattern; + if (prefix) + newPattern = [prefix, e]; + else + newPattern = [e]; + this._process(newPattern.concat(remain), index, inGlobStar); } }; - var testElement = async (element, tester) => tester(await element); - var finder = async (element) => { - const values = await Promise.all(element); - if (values[1] === true) { - throw new EndError(values[0]); + GlobSync.prototype._emitMatch = function(index, e) { + if (isIgnored(this, e)) + return; + var abs = this._makeAbs(e); + if (this.mark) + e = this._mark(e); + if (this.absolute) { + e = abs; } - return false; + if (this.matches[index][e]) + return; + if (this.nodir) { + var c = this.cache[abs]; + if (c === "DIR" || Array.isArray(c)) + return; + } + this.matches[index][e] = true; + if (this.stat) + this._stat(e); }; - var pLocate = async (iterable, tester, options) => { - options = { - concurrency: Infinity, - preserveOrder: true, - ...options - }; - const limit = pLimit(options.concurrency); - const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]); - const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); + GlobSync.prototype._readdirInGlobStar = function(abs) { + if (this.follow) + return this._readdir(abs, false); + var entries; + var lstat; + var stat2; try { - await Promise.all(items.map((element) => checkLimit(finder, element))); - } catch (error2) { - if (error2 instanceof EndError) { - return error2.value; + lstat = this.fs.lstatSync(abs); + } catch (er) { + if (er.code === "ENOENT") { + return null; } - throw error2; } + var isSym = lstat && lstat.isSymbolicLink(); + this.symlinks[abs] = isSym; + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = "FILE"; + else + entries = this._readdir(abs, false); + return entries; }; - module2.exports = pLocate; - } -}); - -// node_modules/locate-path/index.js -var require_locate_path = __commonJS({ - "node_modules/locate-path/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var fs6 = require("fs"); - var { promisify: promisify3 } = require("util"); - var pLocate = require_p_locate(); - var fsStat = promisify3(fs6.stat); - var fsLStat = promisify3(fs6.lstat); - var typeMappings = { - directory: "isDirectory", - file: "isFile" - }; - function checkType({ type }) { - if (type in typeMappings) { - return; + GlobSync.prototype._readdir = function(abs, inGlobStar) { + var entries; + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs); + if (ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (!c || c === "FILE") + return null; + if (Array.isArray(c)) + return c; + } + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)); + } catch (er) { + this._readdirError(abs, er); + return null; } - throw new Error(`Invalid type specified: ${type}`); - } - var matchType = (type, stat2) => type === void 0 || stat2[typeMappings[type]](); - module2.exports = async (paths, options) => { - options = { - cwd: process.cwd(), - type: "file", - allowSymlinks: true, - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fsStat : fsLStat; - return pLocate(paths, async (path_) => { - try { - const stat2 = await statFn(path16.resolve(options.cwd, path_)); - return matchType(options.type, stat2); - } catch { - return false; - } - }, options); }; - module2.exports.sync = (paths, options) => { - options = { - cwd: process.cwd(), - allowSymlinks: true, - type: "file", - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fs6.statSync : fs6.lstatSync; - for (const path_ of paths) { - try { - const stat2 = statFn(path16.resolve(options.cwd, path_)); - if (matchType(options.type, stat2)) { - return path_; - } - } catch { + GlobSync.prototype._readdirEntries = function(abs, entries) { + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (abs === "/") + e = abs + e; + else + e = abs + "/" + e; + this.cache[e] = true; } } + this.cache[abs] = entries; + return entries; }; - } -}); - -// node_modules/path-exists/index.js -var require_path_exists = __commonJS({ - "node_modules/path-exists/index.js"(exports, module2) { - "use strict"; - var fs6 = require("fs"); - var { promisify: promisify3 } = require("util"); - var pAccess = promisify3(fs6.access); - module2.exports = async (path16) => { - try { - await pAccess(path16); - return true; - } catch (_) { - return false; + GlobSync.prototype._readdirError = function(f, er) { + switch (er.code) { + case "ENOTSUP": + case "ENOTDIR": + var abs = this._makeAbs(f); + this.cache[abs] = "FILE"; + if (abs === this.cwdAbs) { + var error2 = new Error(er.code + " invalid cwd " + this.cwd); + error2.path = this.cwd; + error2.code = er.code; + throw error2; + } + break; + case "ENOENT": + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[this._makeAbs(f)] = false; + break; + default: + this.cache[this._makeAbs(f)] = false; + if (this.strict) + throw er; + if (!this.silent) + console.error("glob error", er); + break; } }; - module2.exports.sync = (path16) => { - try { - fs6.accessSync(path16); - return true; - } catch (_) { - return false; + GlobSync.prototype._processGlobStar = function(prefix, read2, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar); + if (!entries) + return; + var remainWithoutGlobStar = remain.slice(1); + var gspref = prefix ? [prefix] : []; + var noGlobStar = gspref.concat(remainWithoutGlobStar); + this._process(noGlobStar, index, false); + var len = entries.length; + var isSym = this.symlinks[abs]; + if (isSym && inGlobStar) + return; + for (var i = 0; i < len; i++) { + var e = entries[i]; + if (e.charAt(0) === "." && !this.dot) + continue; + var instead = gspref.concat(entries[i], remainWithoutGlobStar); + this._process(instead, index, true); + var below = gspref.concat(entries[i], remain); + this._process(below, index, true); } }; - } -}); - -// node_modules/find-up/index.js -var require_find_up = __commonJS({ - "node_modules/find-up/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var locatePath = require_locate_path(); - var pathExists = require_path_exists(); - var stop = Symbol("findUp.stop"); - module2.exports = async (name, options = {}) => { - let directory = path16.resolve(options.cwd || ""); - const { root } = path16.parse(directory); - const paths = [].concat(name); - 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; - }; - while (true) { - const foundPath = await runMatcher({ ...options, cwd: directory }); - if (foundPath === stop) { - return; - } - if (foundPath) { - return path16.resolve(directory, foundPath); - } - if (directory === root) { - return; + GlobSync.prototype._processSimple = function(prefix, index) { + var exists = this._stat(prefix); + if (!this.matches[index]) + this.matches[index] = /* @__PURE__ */ Object.create(null); + if (!exists) + return; + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix); + if (prefix.charAt(0) === "/") { + prefix = path26.join(this.root, prefix); + } else { + prefix = path26.resolve(this.root, prefix); + if (trail) + prefix += "/"; } - directory = path16.dirname(directory); } + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/"); + this._emitMatch(index, prefix); }; - module2.exports.sync = (name, options = {}) => { - let directory = path16.resolve(options.cwd || ""); - const { root } = path16.parse(directory); - const paths = [].concat(name); - const runMatcher = (locateOptions) => { - if (typeof name !== "function") { - return locatePath.sync(paths, locateOptions); - } - const foundPath = name(locateOptions.cwd); - if (typeof foundPath === "string") { - return locatePath.sync([foundPath], locateOptions); - } - return foundPath; - }; - while (true) { - const foundPath = runMatcher({ ...options, cwd: directory }); - if (foundPath === stop) { - return; - } - if (foundPath) { - return path16.resolve(directory, foundPath); + GlobSync.prototype._stat = function(f) { + var abs = this._makeAbs(f); + var needDir = f.slice(-1) === "/"; + if (f.length > this.maxLength) + return false; + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (Array.isArray(c)) + c = "DIR"; + if (!needDir || c === "DIR") + return c; + if (needDir && c === "FILE") + return false; + } + var exists; + var stat2 = this.statCache[abs]; + if (!stat2) { + var lstat; + try { + lstat = this.fs.lstatSync(abs); + } catch (er) { + if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { + this.statCache[abs] = false; + return false; + } } - if (directory === root) { - return; + if (lstat && lstat.isSymbolicLink()) { + try { + stat2 = this.fs.statSync(abs); + } catch (er) { + stat2 = lstat; + } + } else { + stat2 = lstat; } - directory = path16.dirname(directory); } + this.statCache[abs] = stat2; + var c = true; + if (stat2) + c = stat2.isDirectory() ? "DIR" : "FILE"; + this.cache[abs] = this.cache[abs] || c; + if (needDir && c === "FILE") + return false; + return c; + }; + GlobSync.prototype._mark = function(p) { + return common.mark(this, p); + }; + GlobSync.prototype._makeAbs = function(f) { + return common.makeAbs(this, f); }; - module2.exports.exists = pathExists; - module2.exports.sync.exists = pathExists.sync; - module2.exports.stop = stop; } }); -// node_modules/cspell-lib/dist/cjs/Settings/Controller/pnpLoader.js -var require_pnpLoader = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/pnpLoader.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.clearPnPGlobalCache = exports.pnpLoader = exports.PnpLoader = void 0; - var clear_module_1 = __importDefault(require_clear_module()); - var find_up_1 = __importDefault(require_find_up()); - var import_fresh_1 = __importDefault(require_import_fresh()); - var Uri_js_1 = require_Uri(); - var ImportError_js_1 = require_ImportError(); - var defaultPnpFiles = [".pnp.cjs", ".pnp.js"]; - var supportedSchemas = /* @__PURE__ */ new Set(["file"]); - var cachedRequests = /* @__PURE__ */ new Map(); - var lock = void 0; - var cachedPnpImportsSync = /* @__PURE__ */ new Map(); - var cachedRequestsSync = /* @__PURE__ */ new Map(); - var PnpLoader = class { - constructor(pnpFiles = defaultPnpFiles) { - this.pnpFiles = pnpFiles; - this.cacheKeySuffix = ":" + pnpFiles.join(); - } - /** - * Request that the nearest .pnp file gets loaded - * @param uriDirectory starting directory - * @returns promise - rejects on error - success if loaded or not found. - */ - async load(uriDirectory) { - if (!supportedSchemas.has(uriDirectory.scheme)) - return void 0; - await lock; - const cacheKey = this.calcKey(uriDirectory); - const cached = cachedRequests.get(cacheKey); - if (cached) - return cached; - const r = findPnpAndLoad(uriDirectory, this.pnpFiles); - cachedRequests.set(cacheKey, r); - const result = await r; - cachedRequestsSync.set(cacheKey, result); - return result; - } - async peek(uriDirectory) { - if (!supportedSchemas.has(uriDirectory.scheme)) - return void 0; - await lock; - const cacheKey = this.calcKey(uriDirectory); - return cachedRequests.get(cacheKey) ?? Promise.resolve(void 0); - } - /** - * Request that the nearest .pnp file gets loaded - * @param uriDirectory starting directory - * @returns promise - rejects on error - success if loaded or not found. - */ - loadSync(uriDirectory) { - if (!supportedSchemas.has(uriDirectory.scheme)) - return void 0; - const cacheKey = this.calcKey(uriDirectory); - const cached = cachedRequestsSync.get(cacheKey); - if (cached) - return cached; - const r = findPnpAndLoadSync(uriDirectory, this.pnpFiles); - cachedRequestsSync.set(cacheKey, r); - cachedRequests.set(cacheKey, Promise.resolve(r)); - return r; - } - peekSync(uriDirectory) { - if (!supportedSchemas.has(uriDirectory.scheme)) - return void 0; - const cacheKey = this.calcKey(uriDirectory); - return cachedRequestsSync.get(cacheKey); - } - /** - * Clears the cached so .pnp files will get reloaded on request. - */ - clearCache() { - return clearPnPGlobalCache(); - } - calcKey(uriDirectory) { - return uriDirectory.toString() + this.cacheKeySuffix; - } - }; - exports.PnpLoader = PnpLoader; - function pnpLoader(pnpFiles) { - return new PnpLoader(pnpFiles); - } - exports.pnpLoader = pnpLoader; - async function findPnpAndLoad(uriDirectory, pnpFiles) { - const found = await (0, find_up_1.default)(pnpFiles, { cwd: (0, Uri_js_1.uriToFilePath)(uriDirectory) }); - return loadPnpIfNeeded(found); - } - function findPnpAndLoadSync(uriDirectory, pnpFiles) { - const found = find_up_1.default.sync(pnpFiles, { cwd: (0, Uri_js_1.uriToFilePath)(uriDirectory) }); - return loadPnpIfNeeded(found); - } - function loadPnpIfNeeded(found) { - if (!found) - return void 0; - const c = cachedPnpImportsSync.get(found); - if (c || cachedPnpImportsSync.has(found)) - return c; - const r = loadPnp(found); - cachedPnpImportsSync.set(found, r); - return r; - } - function loadPnp(pnpFile) { - const pnp = (0, import_fresh_1.default)(pnpFile); - if (pnp.setup) { - pnp.setup(); - return (0, Uri_js_1.toUri)(pnpFile); +// node_modules/inflight/inflight.js +var require_inflight = __commonJS({ + "node_modules/inflight/inflight.js"(exports, module2) { + var wrappy = require_wrappy(); + var reqs = /* @__PURE__ */ Object.create(null); + var once = require_once(); + module2.exports = wrappy(inflight); + function inflight(key, cb) { + if (reqs[key]) { + reqs[key].push(cb); + return null; + } else { + reqs[key] = [cb]; + return makeres(key); } - throw new ImportError_js_1.UnsupportedPnpFile(`Unsupported pnp file: "${pnpFile}"`); } - function clearPnPGlobalCache() { - if (lock) - return lock; - lock = _cleanCache().finally(() => { - lock = void 0; + function makeres(key) { + return once(function RES() { + var cbs = reqs[key]; + var len = cbs.length; + var args = slice(arguments); + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args); + } + } finally { + if (cbs.length > len) { + cbs.splice(0, len); + process.nextTick(function() { + RES.apply(null, args); + }); + } else { + delete reqs[key]; + } + } }); - return lock; - } - exports.clearPnPGlobalCache = clearPnPGlobalCache; - async function _cleanCache() { - await Promise.all([...cachedRequests.values()].map(rejectToUndefined)); - const modules = [...cachedPnpImportsSync.values()]; - modules.forEach((r) => r && clear_module_1.default.single((0, Uri_js_1.uriToFilePath)(r))); - cachedRequests.clear(); - cachedRequestsSync.clear(); - cachedPnpImportsSync.clear(); - return void 0; } - function rejectToUndefined(p) { - return p.catch(() => void 0); + function slice(args) { + var length = args.length; + var array = []; + for (var i = 0; i < length; i++) + array[i] = args[i]; + return array; } } }); -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/defaultSettings.js -var require_defaultSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/defaultSettings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultSettings = void 0; - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var constants_js_1 = require_constants3(); - exports.defaultSettings = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ - id: "default", - name: "default", - version: constants_js_1.currentSettingsFileVersion - }); - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/toGlobDef.js -var require_toGlobDef = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/toGlobDef.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toGlobDef = void 0; - function toGlobDef(g, root, source) { - if (g === void 0) - return void 0; - if (Array.isArray(g)) { - return g.map((g2) => toGlobDef(g2, root, source)); +// node_modules/glob/glob.js +var require_glob = __commonJS({ + "node_modules/glob/glob.js"(exports, module2) { + module2.exports = glob2; + var rp = require_fs5(); + var minimatch = require_minimatch(); + var Minimatch = minimatch.Minimatch; + var inherits = require_inherits(); + var EE = require("events").EventEmitter; + var path26 = require("path"); + var assert20 = require("assert"); + var isAbsolute = require_path_is_absolute(); + var globSync = require_sync7(); + var common = require_common5(); + var setopts = common.setopts; + var ownProp = common.ownProp; + var inflight = require_inflight(); + var util = require("util"); + var childrenIgnored = common.childrenIgnored; + var isIgnored = common.isIgnored; + var once = require_once(); + function glob2(pattern, options, cb) { + if (typeof options === "function") + cb = options, options = {}; + if (!options) + options = {}; + if (options.sync) { + if (cb) + throw new TypeError("callback provided to sync glob"); + return globSync(pattern, options); } - if (typeof g === "string") { - const glob2 = { glob: g }; - if (root !== void 0) { - glob2.root = root; - } - return toGlobDef(glob2, root, source); + return new Glob(pattern, options, cb); + } + glob2.sync = globSync; + var GlobSync = glob2.GlobSync = globSync.GlobSync; + glob2.glob = glob2; + function extend(origin, add) { + if (add === null || typeof add !== "object") { + return origin; } - if (source) { - return { ...g, source }; + var keys2 = Object.keys(add); + var i = keys2.length; + while (i--) { + origin[keys2[i]] = add[keys2[i]]; } - return g; + return origin; } - exports.toGlobDef = toGlobDef; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/normalizeRawSettings.js -var require_normalizeRawSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/normalizeRawSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); + glob2.hasMagic = function(pattern, options_) { + var options = extend({}, options_); + options.noprocess = true; + var g = new Glob(pattern, options); + var set = g.minimatch.set; + if (!pattern) + return false; + if (set.length > 1) + return true; + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== "string") + return true; } - __setModuleDefault(result, mod); - return result; + return false; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeCacheSettings = exports.normalizeSettingsGlobs = exports.normalizeGitignoreRoot = exports.normalizeLanguageSettings = exports.normalizeReporters = exports.normalizeOverrides = exports.normalizeDictionaryDefs = exports.normalizeRawConfig = void 0; - var path16 = __importStar(require("path")); - var resolveFile_js_1 = require_resolveFile(); - var util = __importStar(require_util()); - var DictionarySettings_js_1 = require_DictionarySettings(); - var toGlobDef_js_1 = require_toGlobDef(); - function normalizeRawConfig(config) { - if (typeof config.version === "number") { - config.version = config.version.toString(); - } - } - exports.normalizeRawConfig = normalizeRawConfig; - function normalizeDictionaryDefs(settings, pathToSettingsFile) { - const dictionaryDefinitions = (0, DictionarySettings_js_1.mapDictDefsToInternal)(settings.dictionaryDefinitions, pathToSettingsFile); - const languageSettings = settings.languageSettings?.map((langSetting) => util.clean({ - ...langSetting, - dictionaryDefinitions: (0, DictionarySettings_js_1.mapDictDefsToInternal)(langSetting.dictionaryDefinitions, pathToSettingsFile) - })); - return util.clean({ - dictionaryDefinitions, - languageSettings - }); - } - exports.normalizeDictionaryDefs = normalizeDictionaryDefs; - function normalizeOverrides(settings, pathToSettingsFile) { - const { globRoot = path16.dirname(pathToSettingsFile) } = settings; - const overrides = settings.overrides?.map((override) => { - const filename = (0, toGlobDef_js_1.toGlobDef)(override.filename, globRoot, pathToSettingsFile); - const { dictionaryDefinitions, languageSettings } = normalizeDictionaryDefs(override, pathToSettingsFile); - return util.clean({ - ...override, - filename, - dictionaryDefinitions, - languageSettings: normalizeLanguageSettings(languageSettings) + glob2.Glob = Glob; + inherits(Glob, EE); + function Glob(pattern, options, cb) { + if (typeof options === "function") { + cb = options; + options = null; + } + if (options && options.sync) { + if (cb) + throw new TypeError("callback provided to sync glob"); + return new GlobSync(pattern, options); + } + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb); + setopts(this, pattern, options); + this._didRealPath = false; + var n = this.minimatch.set.length; + this.matches = new Array(n); + if (typeof cb === "function") { + cb = once(cb); + this.on("error", cb); + this.on("end", function(matches) { + cb(null, matches); }); - }); - return overrides ? { overrides } : {}; - } - exports.normalizeOverrides = normalizeOverrides; - function normalizeReporters(settings, pathToSettingsFile) { - if (settings.reporters === void 0) - return {}; - const folder = path16.dirname(pathToSettingsFile); - function resolve10(s) { - if (s === "default") - return s; - const r = (0, resolveFile_js_1.resolveFile)(s, folder); - if (!r.found) { - throw new Error(`Not found: "${s}"`); - } - return r.filename; } - function resolveReporter(s) { - if (typeof s === "string") { - return resolve10(s); - } - if (!Array.isArray(s) || typeof s[0] !== "string") - throw new Error("Invalid Reporter"); - const [r, ...rest] = s; - return [resolve10(r), ...rest]; + var self = this; + this._processing = 0; + this._emitQueue = []; + this._processQueue = []; + this.paused = false; + if (this.noprocess) + return this; + if (n === 0) + return done(); + var sync = true; + for (var i = 0; i < n; i++) { + this._process(this.minimatch.set[i], i, false, done); } - return { - reporters: settings.reporters.map(resolveReporter) - }; - } - exports.normalizeReporters = normalizeReporters; - function normalizeLanguageSettings(languageSettings) { - if (!languageSettings) - return void 0; - function fixLocale(s) { - const { local: locale, ...rest } = s; - return util.clean({ locale, ...rest }); + sync = false; + function done() { + --self._processing; + if (self._processing <= 0) { + if (sync) { + process.nextTick(function() { + self._finish(); + }); + } else { + self._finish(); + } + } } - return languageSettings.map(fixLocale); - } - exports.normalizeLanguageSettings = normalizeLanguageSettings; - function normalizeGitignoreRoot(settings, pathToSettingsFile) { - const { gitignoreRoot } = settings; - if (!gitignoreRoot) - return {}; - const dir = path16.dirname(pathToSettingsFile); - const roots = Array.isArray(gitignoreRoot) ? gitignoreRoot : [gitignoreRoot]; - return { - gitignoreRoot: roots.map((p) => path16.resolve(dir, p)) - }; } - exports.normalizeGitignoreRoot = normalizeGitignoreRoot; - function normalizeSettingsGlobs(settings, pathToSettingsFile) { - const { globRoot } = settings; - if (settings.ignorePaths === void 0) - return {}; - const ignorePaths = (0, toGlobDef_js_1.toGlobDef)(settings.ignorePaths, globRoot, pathToSettingsFile); - return { - ignorePaths - }; - } - exports.normalizeSettingsGlobs = normalizeSettingsGlobs; - function normalizeCacheSettings(settings, pathToSettingsDir) { - const { cache } = settings; - if (cache === void 0) - return {}; - const { cacheLocation } = cache; - if (cacheLocation === void 0) - return { cache }; - return { cache: { ...cache, cacheLocation: resolveFilePath(cacheLocation, pathToSettingsDir) } }; - } - exports.normalizeCacheSettings = normalizeCacheSettings; - function resolveFilePath(filename, pathToSettingsFile) { - const cwd = process.cwd(); - return path16.resolve(pathToSettingsFile, filename.replace("${cwd}", cwd)); - } - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/PnPSettings.js -var require_PnPSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/PnPSettings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizePnPSettings = exports.defaultPnPSettings = void 0; - var util_js_1 = require_util(); - exports.defaultPnPSettings = Object.freeze({}); - var lastPnP = exports.defaultPnPSettings; - function normalizePnPSettings(settings) { - if (equal(lastPnP, settings)) - return lastPnP; - if (equal(exports.defaultPnPSettings, settings)) - return exports.defaultPnPSettings; - const { usePnP, pnpFiles } = settings; - return lastPnP = (0, util_js_1.clean)({ usePnP, pnpFiles }); - } - exports.normalizePnPSettings = normalizePnPSettings; - function equal(a, b) { - return a === b || a.usePnP === b.usePnP && (a.pnpFiles === b.pnpFiles || a.pnpFiles?.join("|") === b.pnpFiles?.join("|")); - } - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/configLoader.js -var require_configLoader = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/configLoader.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; + Glob.prototype._finish = function() { + assert20(this instanceof Glob); + if (this.aborted) + return; + if (this.realpath && !this._didRealpath) + return this._realpath(); + common.finish(this); + this.emit("end", this.found); + }; + Glob.prototype._realpath = function() { + if (this._didRealpath) + return; + this._didRealpath = true; + var n = this.matches.length; + if (n === 0) + return this._finish(); + var self = this; + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next); + function next() { + if (--n === 0) + self._finish(); } - Object.defineProperty(o, k2, desc); - } : 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.getDefaultConfigLoader = exports.createConfigLoader = exports.clearCachedSettingsFiles = exports.getCachedFileSize = exports.getGlobalSettings = exports.readRawSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfigSync = exports.loadConfig = exports.searchForConfigSync = exports.searchForConfig = exports.ConfigLoader = exports.defaultConfigFilenames = exports.defaultFileName = exports.sectionCSpell = void 0; - var json = __importStar(require_src2()); - var cosmiconfig_1 = require_dist(); - var cspell_io_1 = require_cjs3(); - var path16 = __importStar(require("path")); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var AutoResolveLRUCache_js_1 = require_AutoResolveLRUCache(); - var logger_js_1 = require_logger(); - var resolveFile_js_1 = require_resolveFile(); - var Uri_js_1 = require_Uri(); - var constants_js_1 = require_constants3(); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var GlobalSettings_js_1 = require_GlobalSettings(); - var ImportError_js_1 = require_ImportError(); - var pnpLoader_js_1 = require_pnpLoader(); - var defaultSettings_js_1 = require_defaultSettings(); - var normalizeRawSettings_js_1 = require_normalizeRawSettings(); - var PnPSettings_js_1 = require_PnPSettings(); - var supportedCSpellConfigVersions = [constants_js_1.configSettingsFileVersion0_2]; - var setOfSupportedConfigVersions = Object.freeze(new Set(supportedCSpellConfigVersions)); - exports.sectionCSpell = "cSpell"; - exports.defaultFileName = "cspell.json"; - var gcl = getDefaultConfigLoaderInternal; - var CACHE_SIZE_SEARCH_CONFIG = 32; - var searchPlaces = Object.freeze([ - "package.json", - // Original locations - ".cspell.json", - "cspell.json", - ".cSpell.json", - "cSpell.json", - // Original locations jsonc - ".cspell.jsonc", - "cspell.jsonc", - // Alternate locations - ".vscode/cspell.json", - ".vscode/cSpell.json", - ".vscode/.cspell.json", - // Standard Locations - "cspell.config.json", - "cspell.config.jsonc", - "cspell.config.yaml", - "cspell.config.yml", - "cspell.yaml", - "cspell.yml", - // Dynamic config is looked for last - "cspell.config.js", - "cspell.config.cjs", - // .config - ".config/.cspell.json", - ".config/cspell.json", - ".config/.cSpell.json", - ".config/cSpell.json", - ".config/.cspell.jsonc", - ".config/cspell.jsonc", - ".config/cspell.config.json", - ".config/cspell.config.jsonc", - ".config/cspell.config.yaml", - ".config/cspell.config.yml", - ".config/cspell.yaml", - ".config/cspell.yml", - ".config/cspell.config.js", - ".config/cspell.config.cjs" - ]); - var cspellCosmiconfig = { - searchPlaces: searchPlaces.concat(), - loaders: { - ".json": parseJson, - ".jsonc": parseJson - } + Glob.prototype._realpathSet = function(index, cb) { + var matchset = this.matches[index]; + if (!matchset) + return cb(); + var found = Object.keys(matchset); + var self = this; + var n = found.length; + if (n === 0) + return cb(); + var set = this.matches[index] = /* @__PURE__ */ Object.create(null); + found.forEach(function(p, i) { + p = self._makeAbs(p); + rp.realpath(p, self.realpathCache, function(er, real) { + if (!er) + set[real] = true; + else if (er.syscall === "stat") + set[p] = true; + else + self.emit("error", er); + if (--n === 0) { + self.matches[index] = set; + cb(); + } + }); + }); }; - function parseJson(_filename, content) { - return json.parse(content); - } - exports.defaultConfigFilenames = Object.freeze(searchPlaces.concat()); - var defaultConfigLoader = void 0; - var ConfigLoader = class { - /** - * Use `createConfigLoader` - * @param cspellIO - CSpellIO interface for reading files. - */ - constructor(cspellIO) { - this.cspellIO = cspellIO; - this.cachedFiles = /* @__PURE__ */ new Map(); - this.cspellConfigExplorer = (0, cosmiconfig_1.cosmiconfig)("cspell", cspellCosmiconfig); - this.cspellConfigExplorerSync = (0, cosmiconfig_1.cosmiconfigSync)("cspell", cspellCosmiconfig); - this.searchConfigLRU = new AutoResolveLRUCache_js_1.AutoResolveLRUCache(CACHE_SIZE_SEARCH_CONFIG, (a, b) => a.searchFrom === b.searchFrom && a.pnpSettings === b.pnpSettings); - } - readSettings(filename, relativeToOrDefault, defaultValue) { - const relativeTo = (typeof relativeToOrDefault === "string" ? relativeToOrDefault : "") || process.cwd(); - defaultValue = defaultValue || (typeof relativeToOrDefault !== "string" ? relativeToOrDefault : void 0); - const ref = resolveFilename2(filename, relativeTo); - return this.importSettings(ref, defaultValue, defaultValue || PnPSettings_js_1.defaultPnPSettings); - } - async readSettingsAsync(filename, relativeTo, pnpSettings) { - const ref = resolveFilename2(filename, relativeTo || process.cwd()); - return this.importSettings(ref, void 0, pnpSettings || PnPSettings_js_1.defaultPnPSettings); - } - /** - * - * @param searchFrom the directory / file to start searching from. - * @param pnpSettings - related to Using Yarn PNP. - * @returns the resulting settings - */ - searchForConfig(searchFrom, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - pnpSettings = (0, PnPSettings_js_1.normalizePnPSettings)(pnpSettings); - return this.searchConfigLRU.get({ searchFrom, pnpSettings }, (p) => this._searchForConfig(p)); - } - _searchForConfig(params) { - return gcl().normalizeSearchForConfigResultAsync(params.searchFrom || process.cwd(), this.cspellConfigExplorer.search(params.searchFrom), params.pnpSettings).then((r) => r.filepath ? r.config : void 0); - } - getGlobalSettings() { - if (!this.globalSettings) { - const globalConf = (0, GlobalSettings_js_1.getRawGlobalSettings)(); - this.globalSettings = { - id: "global_config", - ...this.normalizeSettings(globalConf || {}, "./global_config", {}) - }; - } - return this.globalSettings; - } - clearCachedSettingsFiles() { - this.searchConfigLRU.clear(); - this.globalSettings = void 0; - this.cachedFiles.clear(); - this.cspellConfigExplorer.clearCaches(); - this.cspellConfigExplorerSync.clearCaches(); + Glob.prototype._mark = function(p) { + return common.mark(this, p); + }; + Glob.prototype._makeAbs = function(f) { + return common.makeAbs(this, f); + }; + Glob.prototype.abort = function() { + this.aborted = true; + this.emit("abort"); + }; + Glob.prototype.pause = function() { + if (!this.paused) { + this.paused = true; + this.emit("pause"); } - /** - * Read a config file and inject the fileRef. - * @param fileRef - filename plus context, injected into the resulting config. - */ - readConfig(fileRef) { - const { filename, error: error2 } = fileRef; - if (error2) { - fileRef.error = error2 instanceof ImportError_js_1.ImportError ? error2 : new ImportError_js_1.ImportError(`Failed to read config file: "${filename}"`, error2); - return { __importRef: fileRef }; + }; + Glob.prototype.resume = function() { + if (this.paused) { + this.emit("resume"); + this.paused = false; + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0); + this._emitQueue.length = 0; + for (var i = 0; i < eq.length; i++) { + var e = eq[i]; + this._emitMatch(e[0], e[1]); + } } - const s = {}; - try { - const r = this.cspellConfigExplorerSync.load(filename); - if (!r?.config) - throw new Error(`not found: "${filename}"`); - Object.assign(s, r.config); - (0, normalizeRawSettings_js_1.normalizeRawConfig)(s); - validateRawConfig(s, fileRef); - } catch (err) { - fileRef.error = err instanceof ImportError_js_1.ImportError ? err : new ImportError_js_1.ImportError(`Failed to read config file: "${filename}"`, err); - } - s.__importRef = fileRef; - return s; - } - importSettings(fileRef, defaultValues, pnpSettings) { - defaultValues = defaultValues ?? defaultSettings_js_1.defaultSettings; - const { filename } = fileRef; - const importRef = { ...fileRef }; - const cached = this.cachedFiles.get(filename); - if (cached) { - const cachedImportRef = cached.__importRef || importRef; - cachedImportRef.referencedBy = mergeSourceList(cachedImportRef.referencedBy || [], importRef.referencedBy); - cached.__importRef = cachedImportRef; - return cached; - } - const id = [path16.basename(path16.dirname(filename)), path16.basename(filename)].join("/"); - const name = ""; - const finalizeSettings = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ id, name, __importRef: importRef }); - this.cachedFiles.set(filename, finalizeSettings); - const settings = { ...defaultValues, id, name, ...this.readConfig(importRef) }; - Object.assign(finalizeSettings, this.normalizeSettings(settings, filename, pnpSettings)); - const finalizeSrc = { name: path16.basename(filename), ...finalizeSettings.source }; - finalizeSettings.source = { ...finalizeSrc, filename }; - this.cachedFiles.set(filename, finalizeSettings); - return finalizeSettings; - } - /** - * normalizeSettings handles correcting all relative paths, anchoring globs, and importing other config files. - * @param rawSettings - raw configuration settings - * @param pathToSettingsFile - path to the source file of the configuration settings. - */ - normalizeSettings(rawSettings, pathToSettingsFile, pnpSettings) { - const id = rawSettings.id || [path16.basename(path16.dirname(pathToSettingsFile)), path16.basename(pathToSettingsFile)].join("/"); - const name = rawSettings.name || id; - const { usePnP = pnpSettings.usePnP, pnpFiles = pnpSettings.pnpFiles } = rawSettings; - const pnpSettingsToUse = (0, PnPSettings_js_1.normalizePnPSettings)({ usePnP, pnpFiles }); - const pathToSettingsDir = path16.dirname(pathToSettingsFile); - loadPnPSync(pnpSettingsToUse, (0, Uri_js_1.toUri)(pathToSettingsDir)); - const settings = { - version: defaultSettings_js_1.defaultSettings.version, - ...rawSettings, - id, - name, - globRoot: resolveGlobRoot(rawSettings, pathToSettingsFile), - languageSettings: (0, normalizeRawSettings_js_1.normalizeLanguageSettings)(rawSettings.languageSettings) - }; - const pathToSettings = path16.dirname(pathToSettingsFile); - const normalizedDictionaryDefs = (0, normalizeRawSettings_js_1.normalizeDictionaryDefs)(settings, pathToSettingsFile); - const normalizedSettingsGlobs = (0, normalizeRawSettings_js_1.normalizeSettingsGlobs)(settings, pathToSettingsFile); - const normalizedOverrides = (0, normalizeRawSettings_js_1.normalizeOverrides)(settings, pathToSettingsFile); - const normalizedReporters = (0, normalizeRawSettings_js_1.normalizeReporters)(settings, pathToSettingsFile); - const normalizedGitignoreRoot = (0, normalizeRawSettings_js_1.normalizeGitignoreRoot)(settings, pathToSettingsFile); - const normalizedCacheSettings = (0, normalizeRawSettings_js_1.normalizeCacheSettings)(settings, pathToSettingsDir); - const imports = typeof settings.import === "string" ? [settings.import] : settings.import || []; - const source = settings.source || { - name: settings.name, - filename: pathToSettingsFile - }; - const fileSettings = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ - ...settings, - source, - ...normalizedDictionaryDefs, - ...normalizedSettingsGlobs, - ...normalizedOverrides, - ...normalizedReporters, - ...normalizedGitignoreRoot, - ...normalizedCacheSettings - }); - if (!imports.length) { - return fileSettings; + if (this._processQueue.length) { + var pq = this._processQueue.slice(0); + this._processQueue.length = 0; + for (var i = 0; i < pq.length; i++) { + var p = pq[i]; + this._processing--; + this._process(p[0], p[1], p[2], p[3]); + } } - const importedSettings = imports.map((name2) => resolveFilename2(name2, pathToSettings)).map((ref) => (ref.referencedBy = [source], ref)).map((ref) => this.importSettings(ref, void 0, pnpSettingsToUse)).reduce((a, b) => (0, CSpellSettingsServer_js_1.mergeSettings)(a, b)); - const finalizeSettings = (0, CSpellSettingsServer_js_1.mergeSettings)(importedSettings, fileSettings); - finalizeSettings.name = settings.name || finalizeSettings.name || ""; - finalizeSettings.id = settings.id || finalizeSettings.id || ""; - return finalizeSettings; } }; - exports.ConfigLoader = ConfigLoader; - var ConfigLoaderInternal = class extends ConfigLoader { - constructor(cspellIO) { - super(cspellIO); - this._readConfig = this.readConfig.bind(this); - this._normalizeSettings = this.normalizeSettings.bind(this); + Glob.prototype._process = function(pattern, index, inGlobStar, cb) { + assert20(this instanceof Glob); + assert20(typeof cb === "function"); + if (this.aborted) + return; + this._processing++; + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]); + return; } - get _cachedFiles() { - return this.cachedFiles; + var n = 0; + while (typeof pattern[n] === "string") { + n++; } - get _cspellConfigExplorer() { - return this.cspellConfigExplorer; + var prefix; + switch (n) { + case pattern.length: + this._processSimple(pattern.join("/"), index, cb); + return; + case 0: + prefix = null; + break; + default: + prefix = pattern.slice(0, n).join("/"); + break; } - get _cspellConfigExplorerSync() { - return this.cspellConfigExplorerSync; + var remain = pattern.slice(n); + var read2; + if (prefix === null) + read2 = "."; + else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) { + return typeof p === "string" ? p : "[*]"; + }).join("/"))) { + if (!prefix || !isAbsolute(prefix)) + prefix = "/" + prefix; + read2 = prefix; + } else + read2 = prefix; + var abs = this._makeAbs(read2); + if (childrenIgnored(this, read2)) + return cb(); + var isGlobStar = remain[0] === minimatch.GLOBSTAR; + if (isGlobStar) + this._processGlobStar(prefix, read2, abs, remain, index, inGlobStar, cb); + else + this._processReaddir(prefix, read2, abs, remain, index, inGlobStar, cb); + }; + Glob.prototype._processReaddir = function(prefix, read2, abs, remain, index, inGlobStar, cb) { + var self = this; + this._readdir(abs, inGlobStar, function(er, entries) { + return self._processReaddir2(prefix, read2, abs, remain, index, inGlobStar, entries, cb); + }); + }; + Glob.prototype._processReaddir2 = function(prefix, read2, abs, remain, index, inGlobStar, entries, cb) { + if (!entries) + return cb(); + var pn = remain[0]; + var negate = !!this.minimatch.negate; + var rawGlob = pn._glob; + var dotOk = this.dot || rawGlob.charAt(0) === "."; + var matchedEntries = []; + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (e.charAt(0) !== "." || dotOk) { + var m; + if (negate && !prefix) { + m = !e.match(pn); + } else { + m = e.match(pn); + } + if (m) + matchedEntries.push(e); + } } - async normalizeSearchForConfigResultAsync(searchPath, searchResult, pnpSettings) { - let result; - try { - result = await searchResult || void 0; - } catch (cause) { - result = new ImportError_js_1.ImportError(`Failed to find config file at: "${searchPath}"`, cause); - } - return this.normalizeSearchForConfigResult(searchPath, result, pnpSettings); - } - normalizeSearchForConfigResult(searchPath, searchResult, pnpSettings) { - const error2 = searchResult instanceof ImportError_js_1.ImportError ? searchResult : void 0; - const result = searchResult instanceof ImportError_js_1.ImportError ? void 0 : searchResult; - const filepath = result?.filepath; - if (filepath) { - const cached = cachedFiles().get(filepath); - if (cached) { - return { - config: cached, - filepath, - error: error2 - }; + var len = matchedEntries.length; + if (len === 0) + return cb(); + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = /* @__PURE__ */ Object.create(null); + for (var i = 0; i < len; i++) { + var e = matchedEntries[i]; + if (prefix) { + if (prefix !== "/") + e = prefix + "/" + e; + else + e = prefix + e; + } + if (e.charAt(0) === "/" && !this.nomount) { + e = path26.join(this.root, e); } + this._emitMatch(index, e); } - const { config = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({}) } = result || {}; - const filename = result?.filepath ?? searchPath; - const importRef = { filename, error: error2 }; - const id = [path16.basename(path16.dirname(filename)), path16.basename(filename)].join("/"); - const name = result?.filepath ? id : `Config not found: ${id}`; - const finalizeSettings = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ id, name, __importRef: importRef }); - const settings = { id, ...config }; - cachedFiles().set(filename, finalizeSettings); - Object.assign(finalizeSettings, this.normalizeSettings(settings, filename, pnpSettings)); - return { - config: finalizeSettings, - filepath, - error: error2 - }; + return cb(); } - }; - function mergeSourceList(orig, append) { - const collection = new Map(orig.map((s) => [s.name + (s.filename || ""), s])); - for (const s of append || []) { - const key = s.name + (s.filename || ""); - if (!collection.has(key)) { - collection.set(key, s); + remain.shift(); + for (var i = 0; i < len; i++) { + var e = matchedEntries[i]; + var newPattern; + if (prefix) { + if (prefix !== "/") + e = prefix + "/" + e; + else + e = prefix + e; } + this._process([e].concat(remain), index, inGlobStar, cb); } - return [...collection.values()]; - } - function searchForConfig2(searchFrom, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - return gcl().searchForConfig(searchFrom, pnpSettings); - } - exports.searchForConfig = searchForConfig2; - function searchForConfigSync(searchFrom, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - pnpSettings = (0, PnPSettings_js_1.normalizePnPSettings)(pnpSettings); - let searchResult; - try { - searchResult = cspellConfigExplorerSync().search(searchFrom) || void 0; - } catch (err) { - searchResult = new ImportError_js_1.ImportError(`Failed to find config file from: "${searchFrom}"`, err); + cb(); + }; + Glob.prototype._emitMatch = function(index, e) { + if (this.aborted) + return; + if (isIgnored(this, e)) + return; + if (this.paused) { + this._emitQueue.push([index, e]); + return; } - return gcl().normalizeSearchForConfigResult(searchFrom || process.cwd(), searchResult, pnpSettings).config; - } - exports.searchForConfigSync = searchForConfigSync; - async function loadConfig2(file, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - return gcl().readSettingsAsync(file, void 0, pnpSettings); - } - exports.loadConfig = loadConfig2; - function loadConfigSync(filename, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - const pnp = (0, PnPSettings_js_1.normalizePnPSettings)(pnpSettings); - return gcl().readSettings(filename, pnp); - } - exports.loadConfigSync = loadConfigSync; - function loadPnP(pnpSettings, searchFrom) { - if (!pnpSettings.usePnP) { - return Promise.resolve(void 0); + var abs = isAbsolute(e) ? e : this._makeAbs(e); + if (this.mark) + e = this._mark(e); + if (this.absolute) + e = abs; + if (this.matches[index][e]) + return; + if (this.nodir) { + var c = this.cache[abs]; + if (c === "DIR" || Array.isArray(c)) + return; } - const loader = (0, pnpLoader_js_1.pnpLoader)(pnpSettings.pnpFiles); - return loader.load(searchFrom); - } - exports.loadPnP = loadPnP; - function loadPnPSync(pnpSettings, searchFrom) { - if (!pnpSettings.usePnP) { - return void 0; + this.matches[index][e] = true; + var st = this.statCache[abs]; + if (st) + this.emit("stat", e, st); + this.emit("match", e); + }; + Glob.prototype._readdirInGlobStar = function(abs, cb) { + if (this.aborted) + return; + if (this.follow) + return this._readdir(abs, false, cb); + var lstatkey = "lstat\0" + abs; + var self = this; + var lstatcb = inflight(lstatkey, lstatcb_); + if (lstatcb) + self.fs.lstat(abs, lstatcb); + function lstatcb_(er, lstat) { + if (er && er.code === "ENOENT") + return cb(); + var isSym = lstat && lstat.isSymbolicLink(); + self.symlinks[abs] = isSym; + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = "FILE"; + cb(); + } else + self._readdir(abs, false, cb); } - const loader = (0, pnpLoader_js_1.pnpLoader)(pnpSettings.pnpFiles); - return loader.loadSync(searchFrom); - } - exports.loadPnPSync = loadPnPSync; - function readRawSettings(filename, relativeTo) { - relativeTo = relativeTo || process.cwd(); - const ref = resolveFilename2(filename, relativeTo); - return gcl()._readConfig(ref); - } - exports.readRawSettings = readRawSettings; - function resolveFilename2(filename, relativeTo) { - const r = (0, resolveFile_js_1.resolveFile)(filename, relativeTo); - return { - filename: r.filename, - error: r.found ? void 0 : new Error(`Failed to resolve file: "${filename}"`) - }; - } - function getGlobalSettings3() { - return gcl().getGlobalSettings(); - } - exports.getGlobalSettings = getGlobalSettings3; - function getCachedFileSize() { - return cachedFiles().size; - } - exports.getCachedFileSize = getCachedFileSize; - function clearCachedSettingsFiles() { - return gcl().clearCachedSettingsFiles(); - } - exports.clearCachedSettingsFiles = clearCachedSettingsFiles; - var nestedConfigDirectories = { - ".vscode": true, - ".config": true - }; - function resolveGlobRoot(settings, pathToSettingsFile) { - const settingsFileDirRaw = path16.dirname(pathToSettingsFile); - const settingsFileDirName = path16.basename(settingsFileDirRaw); - const isNestedConfig = settingsFileDirName in nestedConfigDirectories; - const isVSCode = settingsFileDirName === ".vscode"; - const settingsFileDir = isNestedConfig ? path16.dirname(settingsFileDirRaw) : settingsFileDirRaw; - const envGlobRoot = process.env[constants_js_1.ENV_CSPELL_GLOB_ROOT]; - const defaultGlobRoot = envGlobRoot ?? "${cwd}"; - const rawRoot = settings.globRoot ?? (settings.version === constants_js_1.configSettingsFileVersion0_1 || envGlobRoot && !settings.version || isVSCode && !settings.version ? defaultGlobRoot : settingsFileDir); - const globRoot = rawRoot.startsWith("${cwd}") ? rawRoot : path16.resolve(settingsFileDir, rawRoot); - return globRoot; - } - function validationMessage(msg, fileRef) { - return msg + ` - File: "${fileRef.filename}"`; - } - function validateRawConfigVersion(config, fileRef) { - const { version: version3 } = config; - if (version3 === void 0) + }; + Glob.prototype._readdir = function(abs, inGlobStar, cb) { + if (this.aborted) return; - if (typeof version3 !== "string") { - (0, logger_js_1.logError)(validationMessage(`Unsupported config file version: "${version3}", string expected`, fileRef)); + cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb); + if (!cb) return; + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb); + if (ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (!c || c === "FILE") + return cb(); + if (Array.isArray(c)) + return cb(null, c); } - if (setOfSupportedConfigVersions.has(version3)) + var self = this; + self.fs.readdir(abs, readdirCb(this, abs, cb)); + }; + function readdirCb(self, abs, cb) { + return function(er, entries) { + if (er) + self._readdirError(abs, er, cb); + else + self._readdirEntries(abs, entries, cb); + }; + } + Glob.prototype._readdirEntries = function(abs, entries, cb) { + if (this.aborted) return; - if (!/^\d+(\.\d+)*$/.test(version3)) { - (0, logger_js_1.logError)(validationMessage(`Unsupported config file version: "${version3}"`, fileRef)); + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (abs === "/") + e = abs + e; + else + e = abs + "/" + e; + this.cache[e] = true; + } + } + this.cache[abs] = entries; + return cb(null, entries); + }; + Glob.prototype._readdirError = function(f, er, cb) { + if (this.aborted) return; + switch (er.code) { + case "ENOTSUP": + case "ENOTDIR": + var abs = this._makeAbs(f); + this.cache[abs] = "FILE"; + if (abs === this.cwdAbs) { + var error2 = new Error(er.code + " invalid cwd " + this.cwd); + error2.path = this.cwd; + error2.code = er.code; + this.emit("error", error2); + this.abort(); + } + break; + case "ENOENT": + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[this._makeAbs(f)] = false; + break; + default: + this.cache[this._makeAbs(f)] = false; + if (this.strict) { + this.emit("error", er); + this.abort(); + } + if (!this.silent) + console.error("glob error", er); + break; } - const msg = version3 > constants_js_1.currentSettingsFileVersion ? `Newer config file version found: "${version3}". Supported version is "${constants_js_1.currentSettingsFileVersion}"` : `Legacy config file version found: "${version3}", upgrade to "${constants_js_1.currentSettingsFileVersion}"`; - (0, logger_js_1.logWarning)(validationMessage(msg, fileRef)); - } - function validateRawConfigExports(config, fileRef) { - if (config.default) { - throw new ImportError_js_1.ImportError(validationMessage("Module `export default` is not supported.\n Use `module.exports =` instead.", fileRef)); + return cb(); + }; + Glob.prototype._processGlobStar = function(prefix, read2, abs, remain, index, inGlobStar, cb) { + var self = this; + this._readdir(abs, inGlobStar, function(er, entries) { + self._processGlobStar2(prefix, read2, abs, remain, index, inGlobStar, entries, cb); + }); + }; + Glob.prototype._processGlobStar2 = function(prefix, read2, abs, remain, index, inGlobStar, entries, cb) { + if (!entries) + return cb(); + var remainWithoutGlobStar = remain.slice(1); + var gspref = prefix ? [prefix] : []; + var noGlobStar = gspref.concat(remainWithoutGlobStar); + this._process(noGlobStar, index, false, cb); + var isSym = this.symlinks[abs]; + var len = entries.length; + if (isSym && inGlobStar) + return cb(); + for (var i = 0; i < len; i++) { + var e = entries[i]; + if (e.charAt(0) === "." && !this.dot) + continue; + var instead = gspref.concat(entries[i], remainWithoutGlobStar); + this._process(instead, index, true, cb); + var below = gspref.concat(entries[i], remain); + this._process(below, index, true, cb); } - } - function validateRawConfig(config, fileRef) { - const validations = [validateRawConfigExports, validateRawConfigVersion]; - validations.forEach((fn) => fn(config, fileRef)); - } - function createConfigLoaderInternal(cspellIO) { - return new ConfigLoaderInternal(cspellIO ?? (0, cspell_io_1.getDefaultCSpellIO)()); - } - function createConfigLoader(cspellIO) { - return createConfigLoaderInternal(cspellIO); - } - exports.createConfigLoader = createConfigLoader; - function getDefaultConfigLoaderInternal() { - if (defaultConfigLoader) - return defaultConfigLoader; - return defaultConfigLoader = createConfigLoaderInternal(); - } - function getDefaultConfigLoader() { - return getDefaultConfigLoaderInternal(); - } - exports.getDefaultConfigLoader = getDefaultConfigLoader; - function cachedFiles() { - return gcl()._cachedFiles; - } - function cspellConfigExplorerSync() { - return gcl()._cspellConfigExplorerSync; - } - exports.__testing__ = { - getDefaultConfigLoaderInternal, - normalizeCacheSettings: normalizeRawSettings_js_1.normalizeCacheSettings, - validateRawConfigExports, - validateRawConfigVersion + cb(); }; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/extractImportErrors.js -var require_extractImportErrors = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/extractImportErrors.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractImportErrors = void 0; - function extractImportErrors2(settings) { - const imports = mergeImportRefs(settings); - return !imports ? [] : [...imports.values()].filter(isImportFileRefWithError); - } - exports.extractImportErrors = extractImportErrors2; - function mergeImportRefs(left, right = {}) { - const imports = new Map(left.__imports || []); - if (left.__importRef) { - imports.set(left.__importRef.filename, left.__importRef); + Glob.prototype._processSimple = function(prefix, index, cb) { + var self = this; + this._stat(prefix, function(er, exists) { + self._processSimple2(prefix, index, er, exists, cb); + }); + }; + Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) { + if (!this.matches[index]) + this.matches[index] = /* @__PURE__ */ Object.create(null); + if (!exists) + return cb(); + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix); + if (prefix.charAt(0) === "/") { + prefix = path26.join(this.root, prefix); + } else { + prefix = path26.resolve(this.root, prefix); + if (trail) + prefix += "/"; + } } - if (right.__importRef) { - imports.set(right.__importRef.filename, right.__importRef); + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/"); + this._emitMatch(index, prefix); + cb(); + }; + Glob.prototype._stat = function(f, cb) { + var abs = this._makeAbs(f); + var needDir = f.slice(-1) === "/"; + if (f.length > this.maxLength) + return cb(); + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (Array.isArray(c)) + c = "DIR"; + if (!needDir || c === "DIR") + return cb(null, c); + if (needDir && c === "FILE") + return cb(); } - const rightImports = right.__imports?.values() || []; - for (const ref of rightImports) { - imports.set(ref.filename, ref); + var exists; + var stat2 = this.statCache[abs]; + if (stat2 !== void 0) { + if (stat2 === false) + return cb(null, stat2); + else { + var type = stat2.isDirectory() ? "DIR" : "FILE"; + if (needDir && type === "FILE") + return cb(); + else + return cb(null, type, stat2); + } } - return imports.size ? imports : void 0; - } - function isImportFileRefWithError(ref) { - return !!ref.error; - } - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/readSettings.js -var require_readSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/readSettings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readSettings = void 0; - var configLoader_js_1 = require_configLoader(); - function readSettings(filename, relativeToOrDefault, defaultValue) { - const loader = (0, configLoader_js_1.getDefaultConfigLoader)(); - if (typeof relativeToOrDefault !== "string" || defaultValue === void 0) - return loader.readSettings(filename, relativeToOrDefault); - return loader.readSettings(filename, relativeToOrDefault, defaultValue); - } - exports.readSettings = readSettings; + var self = this; + var statcb = inflight("stat\0" + abs, lstatcb_); + if (statcb) + self.fs.lstat(abs, statcb); + function lstatcb_(er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + return self.fs.stat(abs, function(er2, stat3) { + if (er2) + self._stat2(f, abs, null, lstat, cb); + else + self._stat2(f, abs, er2, stat3, cb); + }); + } else { + self._stat2(f, abs, er, lstat, cb); + } + } + }; + Glob.prototype._stat2 = function(f, abs, er, stat2, cb) { + if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { + this.statCache[abs] = false; + return cb(); + } + var needDir = f.slice(-1) === "/"; + this.statCache[abs] = stat2; + if (abs.slice(-1) === "/" && stat2 && !stat2.isDirectory()) + return cb(null, false, stat2); + var c = true; + if (stat2) + c = stat2.isDirectory() ? "DIR" : "FILE"; + this.cache[abs] = this.cache[abs] || c; + if (needDir && c === "FILE") + return cb(); + return cb(null, c, stat2); + }; } }); -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/readSettingsFiles.js -var require_readSettingsFiles = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/readSettingsFiles.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readSettingsFiles = void 0; - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var defaultSettings_js_1 = require_defaultSettings(); - var readSettings_js_1 = require_readSettings(); - function readSettingsFiles(filenames) { - return filenames.map((filename) => (0, readSettings_js_1.readSettings)(filename)).reduce((a, b) => (0, CSpellSettingsServer_js_1.mergeSettings)(a, b), defaultSettings_js_1.defaultSettings); +// node_modules/rimraf/rimraf.js +var require_rimraf = __commonJS({ + "node_modules/rimraf/rimraf.js"(exports, module2) { + var assert20 = require("assert"); + var path26 = require("path"); + var fs9 = require("fs"); + var glob2 = void 0; + try { + glob2 = require_glob(); + } catch (_err) { } - exports.readSettingsFiles = readSettingsFiles; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/index.js -var require_configLoader2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readSettingsFiles = exports.readSettings = exports.extractImportErrors = exports.sectionCSpell = exports.searchForConfigSync = exports.searchForConfig = exports.readRawSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfigSync = exports.loadConfig = exports.getGlobalSettings = exports.getCachedFileSize = exports.defaultFileName = exports.defaultConfigFilenames = exports.createConfigLoader = exports.ConfigLoader = exports.clearCachedSettingsFiles = exports.__testing__ = void 0; - var configLoader_js_1 = require_configLoader(); - Object.defineProperty(exports, "__testing__", { enumerable: true, get: function() { - return configLoader_js_1.__testing__; - } }); - Object.defineProperty(exports, "clearCachedSettingsFiles", { enumerable: true, get: function() { - return configLoader_js_1.clearCachedSettingsFiles; - } }); - Object.defineProperty(exports, "ConfigLoader", { enumerable: true, get: function() { - return configLoader_js_1.ConfigLoader; - } }); - Object.defineProperty(exports, "createConfigLoader", { enumerable: true, get: function() { - return configLoader_js_1.createConfigLoader; - } }); - Object.defineProperty(exports, "defaultConfigFilenames", { enumerable: true, get: function() { - return configLoader_js_1.defaultConfigFilenames; - } }); - Object.defineProperty(exports, "defaultFileName", { enumerable: true, get: function() { - return configLoader_js_1.defaultFileName; - } }); - Object.defineProperty(exports, "getCachedFileSize", { enumerable: true, get: function() { - return configLoader_js_1.getCachedFileSize; - } }); - Object.defineProperty(exports, "getGlobalSettings", { enumerable: true, get: function() { - return configLoader_js_1.getGlobalSettings; - } }); - Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function() { - return configLoader_js_1.loadConfig; - } }); - Object.defineProperty(exports, "loadConfigSync", { enumerable: true, get: function() { - return configLoader_js_1.loadConfigSync; - } }); - Object.defineProperty(exports, "loadPnP", { enumerable: true, get: function() { - return configLoader_js_1.loadPnP; - } }); - Object.defineProperty(exports, "loadPnPSync", { enumerable: true, get: function() { - return configLoader_js_1.loadPnPSync; - } }); - Object.defineProperty(exports, "readRawSettings", { enumerable: true, get: function() { - return configLoader_js_1.readRawSettings; - } }); - Object.defineProperty(exports, "searchForConfig", { enumerable: true, get: function() { - return configLoader_js_1.searchForConfig; - } }); - Object.defineProperty(exports, "searchForConfigSync", { enumerable: true, get: function() { - return configLoader_js_1.searchForConfigSync; - } }); - Object.defineProperty(exports, "sectionCSpell", { enumerable: true, get: function() { - return configLoader_js_1.sectionCSpell; - } }); - var extractImportErrors_js_1 = require_extractImportErrors(); - Object.defineProperty(exports, "extractImportErrors", { enumerable: true, get: function() { - return extractImportErrors_js_1.extractImportErrors; - } }); - var readSettings_js_1 = require_readSettings(); - Object.defineProperty(exports, "readSettings", { enumerable: true, get: function() { - return readSettings_js_1.readSettings; - } }); - var readSettingsFiles_js_1 = require_readSettingsFiles(); - Object.defineProperty(exports, "readSettingsFiles", { enumerable: true, get: function() { - return readSettingsFiles_js_1.readSettingsFiles; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/link.js -var require_link = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/link.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; + var defaultGlobOpts = { + nosort: true, + silent: true + }; + var timeout = 0; + var isWindows2 = process.platform === "win32"; + var defaults = (options) => { + const methods = [ + "unlink", + "chmod", + "stat", + "lstat", + "rmdir", + "readdir" + ]; + methods.forEach((m) => { + options[m] = options[m] || fs9[m]; + m = m + "Sync"; + options[m] = options[m] || fs9[m]; + }); + options.maxBusyTries = options.maxBusyTries || 3; + options.emfileWait = options.emfileWait || 1e3; + if (options.glob === false) { + options.disableGlob = true; } - Object.defineProperty(o, k2, desc); - } : 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); + if (options.disableGlob !== true && glob2 === void 0) { + throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); } - __setModuleDefault(result, mod); - return result; + options.disableGlob = options.disableGlob || false; + options.glob = options.glob || defaultGlobOpts; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.removePathsFromGlobalImports = exports.addPathsToGlobalImports = exports.listGlobalImports = void 0; - var fs6 = __importStar(require("fs")); - var Path3 = __importStar(require("path")); - var util_js_1 = require_util(); - var index_js_1 = require_configLoader2(); - var GlobalSettings_js_1 = require_GlobalSettings(); - function listGlobalImports() { - const globalSettings = (0, GlobalSettings_js_1.getRawGlobalSettings)(); - const list = resolveImports(globalSettings).map(({ filename, settings, error: error2 }) => ({ - filename, - error: error2, - id: settings.id, - name: settings.name, - dictionaryDefinitions: settings.dictionaryDefinitions, - languageSettings: settings.languageSettings, - package: findPackageForCSpellConfig(Path3.dirname(filename)) - })); - return { - list, - globalSettings - }; - } - exports.listGlobalImports = listGlobalImports; - function isString2(s) { - return s !== void 0; - } - function addPathsToGlobalImports(paths) { - const resolvedSettings = paths.map(resolveSettings); - const hasError = resolvedSettings.filter((r) => !!r.error).length > 0; - if (hasError) { - return { - success: false, - resolvedSettings, - error: "Unable to resolve files." - }; + var rimraf = (p, options, cb) => { + if (typeof options === "function") { + cb = options; + options = {}; } - const rawGlobalSettings = (0, GlobalSettings_js_1.getRawGlobalSettings)(); - const resolvedImports = resolveImports(rawGlobalSettings); - const imports = new Set(resolvedImports.map((r) => r.resolvedToFilename || r.filename)); - resolvedSettings.map((s) => s.resolvedToFilename).filter(isString2).reduce((imports2, s) => imports2.add(s), imports); - const globalSettings = { - import: [...imports] + assert20(p, "rimraf: missing path"); + assert20.equal(typeof p, "string", "rimraf: path should be a string"); + assert20.equal(typeof cb, "function", "rimraf: callback function required"); + assert20(options, "rimraf: invalid options argument provided"); + assert20.equal(typeof options, "object", "rimraf: options should be object"); + defaults(options); + let busyTries = 0; + let errState = null; + let n = 0; + const next = (er) => { + errState = errState || er; + if (--n === 0) + cb(errState); }; - const error2 = (0, GlobalSettings_js_1.writeRawGlobalSettings)(globalSettings); - return { - success: !error2, - error: error2?.message, - resolvedSettings + const afterGlob = (er, results) => { + if (er) + return cb(er); + n = results.length; + if (n === 0) + return cb(); + results.forEach((p2) => { + const CB = (er2) => { + if (er2) { + if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) { + busyTries++; + return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100); + } + if (er2.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(() => rimraf_(p2, options, CB), timeout++); + } + if (er2.code === "ENOENT") + er2 = null; + } + timeout = 0; + next(er2); + }; + rimraf_(p2, options, CB); + }); }; - } - exports.addPathsToGlobalImports = addPathsToGlobalImports; - function removePathsFromGlobalImports(paths) { - const listResult = listGlobalImports(); - const toRemove = /* @__PURE__ */ new Set(); - function matchPackage(pathToRemove) { - return ({ package: pkg, id }) => pathToRemove === pkg?.name || pathToRemove === id; - } - function compareFilenames(fullPath, partialPath) { - if (fullPath === partialPath) - return true; - if (!fullPath.endsWith(partialPath)) - return false; - const c = fullPath[fullPath.length - partialPath.length - 1]; - return c === Path3.sep || c === Path3.posix.sep; - } - function matchFilename(pathToRemove) { - return Path3.dirname(pathToRemove) != "." ? ({ filename }) => compareFilenames(filename, pathToRemove) : () => false; - } - paths.map((a) => a.trim()).filter((a) => !!a).forEach((pathToRemove) => { - const excludePackage = matchPackage(pathToRemove); - const excludeFilename = matchFilename(pathToRemove); - const shouldExclude = (r) => excludePackage(r) || excludeFilename(r); - for (const r of listResult.list) { - if (shouldExclude(r)) { - toRemove.add(r.filename); + if (options.disableGlob || !glob2.hasMagic(p)) + return afterGlob(null, [p]); + options.lstat(p, (er, stat2) => { + if (!er) + return afterGlob(null, [p]); + glob2(p, options.glob, afterGlob); + }); + }; + var rimraf_ = (p, options, cb) => { + assert20(p); + assert20(options); + assert20(typeof cb === "function"); + options.lstat(p, (er, st) => { + if (er && er.code === "ENOENT") + return cb(null); + if (er && er.code === "EPERM" && isWindows2) + fixWinEPERM(p, options, er, cb); + if (st && st.isDirectory()) + return rmdir(p, options, er, cb); + options.unlink(p, (er2) => { + if (er2) { + if (er2.code === "ENOENT") + return cb(null); + if (er2.code === "EPERM") + return isWindows2 ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb); + if (er2.code === "EISDIR") + return rmdir(p, options, er2, cb); } - } + return cb(er2); + }); }); - const toImport = normalizeImports(listResult.globalSettings.import).filter((p) => !toRemove.has(p)); - const updatedSettings = { - import: toImport - }; - const error2 = toRemove.size > 0 ? (0, GlobalSettings_js_1.writeRawGlobalSettings)(updatedSettings) : void 0; - return { - success: true, - removed: [...toRemove], - error: error2?.toString() - }; - } - exports.removePathsFromGlobalImports = removePathsFromGlobalImports; - function resolveSettings(filename) { - const settings = (0, index_js_1.readRawSettings)(filename); - const ref = settings.__importRef; - const resolvedToFilename = ref?.filename; - const error2 = ref?.error?.message || !resolvedToFilename && "File not Found" || void 0; - return (0, util_js_1.clean)({ - filename, - resolvedToFilename, - error: error2, - settings + }; + var fixWinEPERM = (p, options, er, cb) => { + assert20(p); + assert20(options); + assert20(typeof cb === "function"); + options.chmod(p, 438, (er2) => { + if (er2) + cb(er2.code === "ENOENT" ? null : er); + else + options.stat(p, (er3, stats) => { + if (er3) + cb(er3.code === "ENOENT" ? null : er); + else if (stats.isDirectory()) + rmdir(p, options, er, cb); + else + options.unlink(p, cb); + }); }); - } - function normalizeImports(imports) { - return typeof imports === "string" ? [imports] : imports || []; - } - function resolveImports(s) { - const imported = normalizeImports(s.import); - return imported.map(resolveSettings); - } - function findPackageForCSpellConfig(pathToConfig) { + }; + var fixWinEPERMSync = (p, options, er) => { + assert20(p); + assert20(options); try { - const filename = Path3.join(pathToConfig, "package.json"); - const pkg = JSON.parse(fs6.readFileSync(filename, "utf8")); - return { - filename, - name: pkg["name"] - }; - } catch (e) { - return void 0; + options.chmodSync(p, 438); + } catch (er2) { + if (er2.code === "ENOENT") + return; + else + throw er; } - } - exports.__testing__ = { - findPackageForCSpellConfig + let stats; + try { + stats = options.statSync(p); + } catch (er3) { + if (er3.code === "ENOENT") + return; + else + throw er; + } + if (stats.isDirectory()) + rmdirSync(p, options, er); + else + options.unlinkSync(p); }; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/index.link.js -var require_index_link = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/index.link.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.removePathsFromGlobalImports = exports.listGlobalImports = exports.addPathsToGlobalImports = void 0; - var link_js_1 = require_link(); - Object.defineProperty(exports, "addPathsToGlobalImports", { enumerable: true, get: function() { - return link_js_1.addPathsToGlobalImports; - } }); - Object.defineProperty(exports, "listGlobalImports", { enumerable: true, get: function() { - return link_js_1.listGlobalImports; - } }); - Object.defineProperty(exports, "removePathsFromGlobalImports", { enumerable: true, get: function() { - return link_js_1.removePathsFromGlobalImports; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/util/search.js -var require_search = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/search.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.binarySearch = void 0; - function binarySearch(arr, item, leftOffset, rightOffset) { - let left = Math.max(leftOffset ?? 0, 0); - let right = Math.min(rightOffset ?? arr.length, arr.length); - while (left < right) { - const pos = left + right >> 1; - if (arr[pos] < item) { - left = pos + 1; - } else { - right = pos; + var rmdir = (p, options, originalEr, cb) => { + assert20(p); + assert20(options); + assert20(typeof cb === "function"); + options.rmdir(p, (er) => { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb); + else if (er && er.code === "ENOTDIR") + cb(originalEr); + else + cb(er); + }); + }; + var rmkids = (p, options, cb) => { + assert20(p); + assert20(options); + assert20(typeof cb === "function"); + options.readdir(p, (er, files) => { + if (er) + return cb(er); + let n = files.length; + if (n === 0) + return options.rmdir(p, cb); + let errState; + files.forEach((f) => { + rimraf(path26.join(p, f), options, (er2) => { + if (errState) + return; + if (er2) + return cb(errState = er2); + if (--n === 0) + options.rmdir(p, cb); + }); + }); + }); + }; + var rimrafSync = (p, options) => { + options = options || {}; + defaults(options); + assert20(p, "rimraf: missing path"); + assert20.equal(typeof p, "string", "rimraf: path should be a string"); + assert20(options, "rimraf: missing options"); + assert20.equal(typeof options, "object", "rimraf: options should be object"); + let results; + if (options.disableGlob || !glob2.hasMagic(p)) { + results = [p]; + } else { + try { + options.lstatSync(p); + results = [p]; + } catch (er) { + results = glob2.sync(p, options.glob); } } - return left; - } - exports.binarySearch = binarySearch; + if (!results.length) + return; + for (let i = 0; i < results.length; i++) { + const p2 = results[i]; + let st; + try { + st = options.lstatSync(p2); + } catch (er) { + if (er.code === "ENOENT") + return; + if (er.code === "EPERM" && isWindows2) + fixWinEPERMSync(p2, options, er); + } + try { + if (st && st.isDirectory()) + rmdirSync(p2, options, null); + else + options.unlinkSync(p2); + } catch (er) { + if (er.code === "ENOENT") + return; + if (er.code === "EPERM") + return isWindows2 ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er); + if (er.code !== "EISDIR") + throw er; + rmdirSync(p2, options, er); + } + } + }; + var rmdirSync = (p, options, originalEr) => { + assert20(p); + assert20(options); + try { + options.rmdirSync(p); + } catch (er) { + if (er.code === "ENOENT") + return; + if (er.code === "ENOTDIR") + throw originalEr; + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options); + } + }; + var rmkidsSync = (p, options) => { + assert20(p); + assert20(options); + options.readdirSync(p).forEach((f) => rimrafSync(path26.join(p, f), options)); + const retries = isWindows2 ? 100 : 1; + let i = 0; + do { + let threw = true; + try { + const ret = options.rmdirSync(p, options); + threw = false; + return ret; + } finally { + if (++i < retries && threw) + continue; + } + } while (true); + }; + module2.exports = rimraf; + rimraf.sync = rimrafSync; } }); -// node_modules/cspell-lib/dist/cjs/util/text.js -var require_text2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/text.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.removeAccents = exports.calculateTextDocumentOffsets = exports.extractText = exports.textOffset = exports.matchCase = exports.camelToSnake = exports.snakeToCamel = exports.lcFirst = exports.ucFirst = exports.isFirstCharacterLower = exports.isFirstCharacterUpper = exports.isLowerCase = exports.isUpperCase = exports.extractWordsFromCodeTextOffset = exports.extractWordsFromCode = exports.extractPossibleWordsFromTextOffset = exports.cleanTextOffset = exports.cleanText = exports.extractWordsFromTextOffset = exports.extractWordsFromText = exports.extractLinesOfText = exports.matchToTextOffset = exports.matchStringToTextOffset = exports.match = exports.splitCamelCaseWord = exports.splitCamelCaseWordWithOffset = exports.stringToRegExp = void 0; - var sync_1 = require_sync(); - var gensequence_1 = require_dist2(); - var search_js_1 = require_search(); - var textRegex_js_1 = require_textRegex(); - var Uri_js_1 = require_Uri(); - var util_js_1 = require_util(); - var textRegex_js_2 = require_textRegex(); - Object.defineProperty(exports, "stringToRegExp", { enumerable: true, get: function() { - return textRegex_js_2.stringToRegExp; - } }); - function splitCamelCaseWordWithOffset(wo) { - return splitCamelCaseWord(wo.text).map((0, util_js_1.scanMap)((last, text) => ({ text, offset: last.offset + last.text.length }), { - text: "", - offset: wo.offset - })); - } - exports.splitCamelCaseWordWithOffset = splitCamelCaseWordWithOffset; - function splitCamelCaseWord(word) { - const wPrime = word.replace(textRegex_js_1.regExUpperSOrIng, (s) => s[0] + s.slice(1).toLowerCase()); - const separator = "_<^*_*^>_"; - const pass1 = wPrime.replace(textRegex_js_1.regExSplitWords, "$1" + separator + "$2"); - const pass2 = pass1.replace(textRegex_js_1.regExSplitWords2, "$1" + separator + "$2"); - return pass2.split(separator); - } - exports.splitCamelCaseWord = splitCamelCaseWord; - function match(reg, text) { - return (0, gensequence_1.sequenceFromRegExpMatch)(reg, text); - } - exports.match = match; - function matchStringToTextOffset(reg, text) { - return matchToTextOffset(reg, { text, offset: 0 }); - } - exports.matchStringToTextOffset = matchStringToTextOffset; - function matchToTextOffset(reg, text) { - const textOffset2 = text; - const fnOffsetMap = offsetMap(textOffset2.offset); - textOffset2.text.matchAll(reg); - return (0, sync_1.pipe)(match(reg, textOffset2.text), (0, sync_1.opMap)((m) => fnOffsetMap({ text: m[0], offset: m.index || 0 }))); - } - exports.matchToTextOffset = matchToTextOffset; - function* extractLinesOfText(text) { - let i = 0; - for (let j = text.indexOf("\n", i); j >= 0; j = text.indexOf("\n", i)) { - const end = j + 1; - yield { text: text.slice(i, end), offset: i }; - i = end; - } - yield { text: text.slice(i, text.length), offset: i }; - } - exports.extractLinesOfText = extractLinesOfText; - function extractWordsFromText(text) { - return extractWordsFromTextOffset(textOffset(text)); - } - exports.extractWordsFromText = extractWordsFromText; - function extractWordsFromTextOffset(text) { - const reg = new RegExp(textRegex_js_1.regExWords); - return matchToTextOffset(reg, cleanTextOffset(text)); - } - exports.extractWordsFromTextOffset = extractWordsFromTextOffset; - function cleanText(text) { - text = text.replace(textRegex_js_1.regExIgnoreCharacters, (match2) => " ".repeat(match2.length)); - return text; - } - exports.cleanText = cleanText; - function cleanTextOffset(text) { - return { - text: cleanText(text.text), - offset: text.offset - }; - } - exports.cleanTextOffset = cleanTextOffset; - function extractPossibleWordsFromTextOffset(text) { - const reg = new RegExp(textRegex_js_1.regExWordsAndDigits); - return matchToTextOffset(reg, text); - } - exports.extractPossibleWordsFromTextOffset = extractPossibleWordsFromTextOffset; - function extractWordsFromCode(text) { - return extractWordsFromCodeTextOffset(textOffset(text)); - } - exports.extractWordsFromCode = extractWordsFromCode; - function extractWordsFromCodeTextOffset(textOffset2) { - return (0, sync_1.pipe)(extractWordsFromTextOffset(textOffset2), (0, sync_1.opConcatMap)(splitCamelCaseWordWithOffset)); - } - exports.extractWordsFromCodeTextOffset = extractWordsFromCodeTextOffset; - function isUpperCase(word) { - return !!word.match(textRegex_js_1.regExAllUpper); - } - exports.isUpperCase = isUpperCase; - function isLowerCase(word) { - return !!word.match(textRegex_js_1.regExAllLower); - } - exports.isLowerCase = isLowerCase; - function isFirstCharacterUpper(word) { - return isUpperCase(word.slice(0, 1)); - } - exports.isFirstCharacterUpper = isFirstCharacterUpper; - function isFirstCharacterLower(word) { - return isLowerCase(word.slice(0, 1)); - } - exports.isFirstCharacterLower = isFirstCharacterLower; - function ucFirst(word) { - return word.slice(0, 1).toUpperCase() + word.slice(1); - } - exports.ucFirst = ucFirst; - function lcFirst(word) { - return word.slice(0, 1).toLowerCase() + word.slice(1); - } - exports.lcFirst = lcFirst; - function snakeToCamel(word) { - return word.split("_").map(ucFirst).join(""); - } - exports.snakeToCamel = snakeToCamel; - function camelToSnake(word) { - return splitCamelCaseWord(word).join("_").toLowerCase(); - } - exports.camelToSnake = camelToSnake; - function matchCase(example, word) { - if (example.match(textRegex_js_1.regExFirstUpper)) { - return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase(); - } - if (example.match(textRegex_js_1.regExAllLower)) { - return word.toLowerCase(); - } - if (example.match(textRegex_js_1.regExAllUpper)) { - return word.toUpperCase(); - } - if (isFirstCharacterUpper(example)) { - return ucFirst(word); - } - if (isFirstCharacterLower(example)) { - return lcFirst(word); - } - return word; - } - exports.matchCase = matchCase; - function textOffset(text, offset = 0) { - return { text, offset }; - } - exports.textOffset = textOffset; - function extractText(textOffset2, startPos, endPos) { - const { text, offset: orig } = textOffset2; - const a = Math.max(startPos - orig, 0); - const b = Math.max(endPos - orig, 0); - return text.slice(a, b); - } - exports.extractText = extractText; - function offsetMap(offset) { - return (xo) => ({ ...xo, offset: xo.offset + offset }); - } - function calculateTextDocumentOffsets(uri, doc, wordOffsets) { - const lines = [ - -1, - ...(0, sync_1.pipe)(match(/\n/g, doc), (0, sync_1.opMap)((a) => a.index)), - doc.length - ]; - let lastRow = -1; - let lastOffset = doc.length + 1; - let lastLineRow = -1; - let lastLine; - function findRowCol(offset) { - const row = (0, search_js_1.binarySearch)(lines, offset, offset >= lastOffset ? lastRow : void 0); - const col = offset - lines[Math.max(0, row - 1)]; - lastOffset = offset; - lastRow = row; - return [row, col]; - } - function extractLine(row) { - const offset = lines[row - 1] + 1; - const text = doc.slice(offset, lines[row] + 1); - return { text, offset }; - } - function calcLine(row) { - const last = lastLineRow === row ? lastLine : void 0; - lastLineRow = row; - const r = last ?? extractLine(row); - lastLine = r; - return r; +// node_modules/flat-cache/src/del.js +var require_del = __commonJS({ + "node_modules/flat-cache/src/del.js"(exports, module2) { + var rimraf = require_rimraf().sync; + var fs9 = require("fs"); + module2.exports = function del(file) { + if (fs9.existsSync(file)) { + rimraf(file, { + glob: false + }); + return true; } - const _uri = (0, Uri_js_1.toUri)(uri).toString(); - return wordOffsets.map((wo) => { - const [row, col] = findRowCol(wo.offset); - return { ...wo, row, col, doc, uri: _uri, line: calcLine(row) }; - }); - } - exports.calculateTextDocumentOffsets = calculateTextDocumentOffsets; - function removeAccents(text) { - return text.normalize("NFD").replace(textRegex_js_1.regExAccents, ""); - } - exports.removeAccents = removeAccents; - exports.__testing__ = { - regExWords: textRegex_js_1.regExWords, - regExWordsAndDigits: textRegex_js_1.regExWordsAndDigits + return false; }; } }); -// node_modules/cspell-lib/dist/cjs/LanguageIds.js -var require_LanguageIds = __commonJS({ - "node_modules/cspell-lib/dist/cjs/LanguageIds.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getLanguagesForBasename = exports.getLanguagesForExt = exports.buildLanguageExtensionMapSet = exports.isGenerated = exports.isGeneratedFile = exports.isGeneratedExt = exports.isBinary = exports.isBinaryFile = exports.isBinaryExt = exports.languageIds = exports.generatedFiles = exports.binaryLanguages = exports.languageExtensionDefinitions = void 0; - var AutoResolve_js_1 = require_AutoResolve(); - exports.languageExtensionDefinitions = [ - { id: "ada", extensions: [".adb", ".ads"] }, - { id: "apiblueprint", extensions: [".apib", ".apiblueprint"] }, - { id: "asciidoc", extensions: [".adoc", ".asc", ".asciidoc"] }, - { id: "bat", extensions: [".bat", ".cmd"] }, - { id: "clojure", extensions: [".clj", ".cljs", ".cljx", ".clojure", ".edn"] }, - { id: "coffeescript", extensions: [".coffee", ".cson"] }, - { id: "c", extensions: [".c"] }, - // cspell:ignore cmake - { id: "cmake", extensions: [".cmake"], filenames: ["CMakeLists.txt"] }, - { - id: "cpp", - extensions: [".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".h", ".mm", ".ino", ".inl"] - }, - { id: "csharp", extensions: [".cs"] }, - { id: "css", extensions: [".css"] }, - { id: "dhall", extensions: [".dhall"] }, - { id: "diff", extensions: [".diff", ".patch", ".rej"] }, - { id: "dockerfile", extensions: [".dockerfile"], filenames: ["Dockerfile"] }, - { id: "elixir", extensions: [".ex", ".exs"] }, - { id: "fsharp", extensions: [".fs", ".fsi", ".fsx", ".fsscript"] }, - { id: "go", extensions: [".go"] }, - { id: "groovy", extensions: [".groovy", ".gvy", ".gradle"] }, - { id: "handlebars", extensions: [".handlebars", ".hbs"] }, - { id: "haskell", extensions: [".hs", ".lhs"] }, - { - id: "html", - extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm", ".volt", ".vue"] +// node_modules/flat-cache/src/cache.js +var require_cache = __commonJS({ + "node_modules/flat-cache/src/cache.js"(exports, module2) { + var path26 = require("path"); + var fs9 = require("fs"); + var utils = require_utils9(); + var del = require_del(); + var writeJSON = utils.writeJSON; + var cache2 = { + /** + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted + * then the cache module directory `./cache` will be used instead + * + * @method load + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + */ + load: function(docId, cacheDir) { + var me = this; + me._visited = {}; + me._persisted = {}; + me._pathToFile = cacheDir ? path26.resolve(cacheDir, docId) : path26.resolve(__dirname, "../.cache/", docId); + if (fs9.existsSync(me._pathToFile)) { + me._persisted = utils.tryParse(me._pathToFile, {}); + } }, - { id: "ini", extensions: [".ini", ".conf"] }, - { id: "properties", extensions: [".properties", ".gitconfig", ".cfg", ".conf"] }, - { id: "jade", extensions: [".jade", ".pug"] }, - { id: "java", extensions: [".java", ".jav"] }, - { id: "javascriptreact", extensions: [".jsx"] }, - { id: "javascript", extensions: [".js", ".mjs", ".es6", ".cjs"] }, - { - id: "json", - extensions: [".json", ".jsonc", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc", ".babelrc", ".webmanifest"] + /** + * Load the cache from the provided file + * @method loadFile + * @param {String} pathToFile the path to the file containing the info for the cache + */ + loadFile: function(pathToFile) { + var me = this; + var dir = path26.dirname(pathToFile); + var fName = path26.basename(pathToFile); + me.load(fName, dir); }, - { id: "jsonc", extensions: [".jsonc"] }, - { id: "jsonc", extensions: [".code-workspace"], filenames: [".code-workspace"] }, - { id: "jungle", extensions: [".jungle"] }, - { id: "less", extensions: [".less"] }, - { id: "literate haskell", extensions: [".lhs"] }, - { id: "lua", extensions: [".lua"] }, - { id: "makefile", extensions: [".mk"] }, - { id: "markdown", extensions: [".md", ".mdown", ".markdown", ".markdn"] }, - { id: "mdx", extensions: [".mdx"] }, - { id: "monkeyc", extensions: [".mc", ".mb"] }, - { id: "objective-c", extensions: [".m"] }, - { id: "perl", extensions: [".pl", ".pm", ".pod", ".t", ".PL", ".psgi"] }, - { id: "perl6", extensions: [".p6", ".pl6", ".pm6", ".nqp"] }, - { id: "php", extensions: [".php", ".php4", ".php5", ".phtml", ".ctp"] }, - { id: "plaintext", extensions: [".txt"] }, - { id: "powershell", extensions: [".ps1", ".psm1", ".psd1", ".pssc", ".psrc"] }, - { id: "purescript", extensions: [".purs"] }, - { id: "python", extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"] }, - { id: "r", extensions: [".r", ".R", ".rhistory", ".rprofile", ".rt"] }, - { id: "razor", extensions: [".cshtml"] }, - { id: "ruby", extensions: [".rb", ".rbx", ".rjs", ".gemspec", ".rake", ".ru"] }, - { id: "ruby", extensions: [], filenames: ["Gemfile"] }, - { id: "rust", extensions: [".rs"] }, - { id: "scala", extensions: [".scala", ".sc", ".sbt"] }, - { id: "scss", extensions: [".scss"] }, - { id: "shaderlab", extensions: [".shader", ".cginc"] }, - { - id: "shellscript", - extensions: [ - ".sh", - ".bash", - ".bashrc", - ".bash_aliases", - ".bash_profile", - ".bash_login", - ".ebuild", - ".install", - ".profile", - ".bash_logout", - ".zsh", - ".zshrc", - ".zprofile", - ".zlogin", - ".zlogout", - ".zshenv", - ".zsh-theme" - ] + /** + * Returns the entire persisted object + * @method all + * @returns {*} + */ + all: function() { + return this._persisted; }, - { id: "sql", extensions: [".sql", ".dsql"] }, - { id: "svelte", extensions: [".svelte"] }, - { id: "swift", extensions: [".swift"] }, - { id: "toml", extensions: [".toml"] }, - { id: "typescript", extensions: [".ts", ".cts", ".mts"] }, - { id: "typescriptreact", extensions: [".tsx"] }, - { id: "vb", extensions: [".vb", ".brs", ".vbs", ".bas"] }, - { id: "vue", extensions: [".vue"] }, - { - id: "xml", - extensions: [ - ".ascx", - ".atom", - ".axml", - ".bpmn", - ".config", - ".cpt", - ".csl", - ".csproj.user", - ".csproj", - ".dita", - ".ditamap", - ".dtd", - ".dtml", - ".ent", - ".fsproj", - ".fxml", - ".iml", - ".isml", - ".jmx", - ".launch", - ".menu", - ".mod", - ".mxml", - ".nuspec", - ".opml", - ".owl", - ".proj", - ".pt", - ".pubxml.user", - ".pubxml", - ".rdf", - ".rng", - ".rss", - ".shproj", - ".storyboard", - ".svg", - ".targets", - ".tld", - ".tmx", - ".vbproj.user", - ".vbproj", - ".vcxproj.filters", - ".vcxproj", - ".wsdl", - ".wxi", - ".wxl", - ".wxs", - ".xaml", - ".xbl", - ".xib", - ".xlf", - ".xliff", - ".xml", - ".xoml", - ".xpdl", - ".xsd", - ".xul" - ] + keys: function() { + return Object.keys(this._persisted); }, - { id: "wheel", extensions: [".whl"], format: "Binary" }, - { id: "xsl", extensions: [".xsl", ".xslt"] }, - { id: "yaml", extensions: [".eyaml", ".eyml", ".yaml", ".yml"] }, - { id: "latex", extensions: [".tex"] }, - { id: "map", extensions: [".map"] }, - { id: "pdf", extensions: [".pdf"] }, - { id: "rsa", extensions: [".pub"], filenames: ["id_rsa", "id_rsa.pub"] }, - { id: "pem", extensions: [".private-key.pem", ".pem"] }, - { id: "pem-private-key", extensions: [".private-key.pem"] }, - // - // Special file types used to prevent spell checking. - // - { - id: "image", - extensions: [ - ".bmp", - ".exr", - ".gif", - ".ico", - ".jpeg", - ".jpg", - ".pbm", - ".pgm", - ".png", - ".ppm", - ".ras", - ".sgi", - ".tiff", - ".webp", - ".xbm" - ], - format: "Binary", - description: "Some image extensions" + /** + * sets a key to a given value + * @method setKey + * @param key {string} the key to set + * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify + */ + setKey: function(key, value) { + this._visited[key] = true; + this._persisted[key] = value; }, - // cspell:ignore woff - { - id: "binary", - extensions: [".gz", ".exe", ".dll", ".lib", ".obj", ".o", ".eot", ".cur", ".zip"], - format: "Binary" + /** + * remove a given key from the cache + * @method removeKey + * @param key {String} the key to remove from the object + */ + removeKey: function(key) { + delete this._visited[key]; + delete this._persisted[key]; }, - { - id: "fonts", - extensions: [".ttf", ".woff", ".woff2"], - format: "Binary" + /** + * Return the value of the provided key + * @method getKey + * @param key {String} the name of the key to retrieve + * @returns {*} the value from the key + */ + getKey: function(key) { + this._visited[key] = true; + return this._persisted[key]; }, - { - id: "video", - extensions: [".mov", ".mpg"], - format: "Binary" + /** + * Remove keys that were not accessed/set since the + * last time the `prune` method was called. + * @method _prune + * @private + */ + _prune: function() { + var me = this; + var obj = {}; + var keys2 = Object.keys(me._visited); + if (keys2.length === 0) { + return; + } + keys2.forEach(function(key) { + obj[key] = me._persisted[key]; + }); + me._visited = {}; + me._persisted = obj; }, - { - id: "lock", - extensions: [".lock"], - filenames: ["package-lock.json"] + /** + * Save the state of the cache identified by the docId to disk + * as a JSON structure + * @param [noPrune=false] {Boolean} whether to remove from cache the non visited files + * @method save + */ + save: function(noPrune) { + var me = this; + !noPrune && me._prune(); + writeJSON(me._pathToFile, me._persisted); }, - { - id: "cache_files", - extensions: [], - // cspell:ignore eslintcache - filenames: [".cspellcache", ".DS_Store", ".eslintcache"] + /** + * remove the file where the cache is persisted + * @method removeCacheFile + * @return {Boolean} true or false if the file was successfully deleted + */ + removeCacheFile: function() { + return del(this._pathToFile); }, - { id: "dll", extensions: [".dll"], format: "Binary" }, - { id: "exe", extensions: [".exe"], format: "Binary" }, - { id: "object-file", extensions: [".o", ".obj"], format: "Binary" }, - { id: "jar", extensions: [".jar"], format: "Binary" }, - { id: "spv", extensions: [".spv"], format: "Binary", description: "SPSS Output Document" }, - { id: "mdb", extensions: [".mdb"], format: "Binary", description: "Microsoft Access DB" }, - { id: "webm", extensions: [".webm"], format: "Binary", description: "WebM is an audiovisual media file format." }, - { id: "trie", extensions: [".trie"], format: "Binary", description: "CSpell dictionary file." } - ]; - var binaryFormatIds = exports.languageExtensionDefinitions.filter((d) => d.format === "Binary").map((d) => d.id); - exports.binaryLanguages = new Set(["binary", "image", "video", "fonts"].concat(binaryFormatIds)); - exports.generatedFiles = /* @__PURE__ */ new Set([...exports.binaryLanguages, "map", "lock", "pdf", "cache_files", "rsa", "pem", "trie"]); - exports.languageIds = exports.languageExtensionDefinitions.map(({ id }) => id); - var mapExtensionToSetOfLanguageIds = buildLanguageExtensionMapSet(exports.languageExtensionDefinitions); - var mapExtensionToLanguageIds = buildExtensionToLanguageIdMap(mapExtensionToSetOfLanguageIds); - function isBinaryExt(ext) { - return isBinary(getLanguagesForExt(ext)); - } - exports.isBinaryExt = isBinaryExt; - function isBinaryFile3(basename3) { - return isBinary(getLanguagesForBasename(basename3)); - } - exports.isBinaryFile = isBinaryFile3; - function isBinary(languageId) { - return doesSetContainAnyOf(exports.binaryLanguages, languageId); - } - exports.isBinary = isBinary; - function isGeneratedExt(ext) { - return isGenerated(getLanguagesForExt(ext)); - } - exports.isGeneratedExt = isGeneratedExt; - function isGeneratedFile(basename3) { - return isGenerated(getLanguagesForBasename(basename3)); - } - exports.isGeneratedFile = isGeneratedFile; - function isGenerated(languageId) { - return doesSetContainAnyOf(exports.generatedFiles, languageId); - } - exports.isGenerated = isGenerated; - function doesSetContainAnyOf(setOfIds, languageId) { - if (typeof languageId === "string") { - return setOfIds.has(languageId); - } - for (const id of languageId) { - if (setOfIds.has(id)) { - return true; - } - } - return false; - } - function buildLanguageExtensionMapSet(defs) { - return defs.reduce((map, def) => { - function addId(value) { - (0, AutoResolve_js_1.autoResolve)(map, value, () => /* @__PURE__ */ new Set()).add(def.id); - } - def.extensions.forEach(addId); - def.filenames?.forEach(addId); - return map; - }, /* @__PURE__ */ new Map()); - } - exports.buildLanguageExtensionMapSet = buildLanguageExtensionMapSet; - function buildExtensionToLanguageIdMap(map) { - return new Map([...map].map(([k, s]) => [k, [...s]])); - } - function _getLanguagesForExt(ext) { - return mapExtensionToLanguageIds.get(ext) || mapExtensionToLanguageIds.get("." + ext); - } - function getLanguagesForExt(ext) { - return _getLanguagesForExt(ext) || _getLanguagesForExt(ext.toLowerCase()) || []; - } - exports.getLanguagesForExt = getLanguagesForExt; - function _getLanguagesForBasename(basename3) { - const found = mapExtensionToLanguageIds.get(basename3); - if (found) - return found; - for (let pos = basename3.indexOf("."); pos >= 0; pos = basename3.indexOf(".", pos + 1)) { - const ids = mapExtensionToLanguageIds.get(basename3.slice(pos)); - if (ids) - return ids; - } - return void 0; - } - function getLanguagesForBasename(basename3) { - return _getLanguagesForBasename(basename3) || _getLanguagesForBasename(basename3.toLowerCase()) || []; - } - exports.getLanguagesForBasename = getLanguagesForBasename; - } -}); - -// node_modules/cspell-lib/dist/cjs/Document/normalizeLanguageIds.js -var require_normalizeLanguageIds = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Document/normalizeLanguageIds.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeLanguageIds = void 0; - function normalizeLanguageIds(languageId) { - return (Array.isArray(languageId) ? languageId.join(",") : languageId).split(",").map((s) => s.trim()); - } - exports.normalizeLanguageIds = normalizeLanguageIds; - } -}); - -// node_modules/cspell-lib/dist/cjs/Document/isBinaryDoc.js -var require_isBinaryDoc = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Document/isBinaryDoc.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isBinaryFile = exports.isBinaryDoc = void 0; - var LanguageIds_js_1 = require_LanguageIds(); - var Uri_js_1 = require_Uri(); - var normalizeLanguageIds_js_1 = require_normalizeLanguageIds(); - function isBinaryDoc(document) { - return isBinaryFile3((0, Uri_js_1.toUri)(document.uri), document.languageId); - } - exports.isBinaryDoc = isBinaryDoc; - function isBinaryFile3(filename, languageId) { - const filenameUri = (0, Uri_js_1.toUri)(filename); - if (languageId) { - const ids = (0, normalizeLanguageIds_js_1.normalizeLanguageIds)(languageId); - if (ids.length) - return (0, LanguageIds_js_1.isGenerated)(ids); + /** + * Destroy the file cache and cache content. + * @method destroy + */ + destroy: function() { + var me = this; + me._visited = {}; + me._persisted = {}; + me.removeCacheFile(); } - const file = (0, Uri_js_1.basename)(filenameUri); - return (0, LanguageIds_js_1.isGeneratedFile)(file); - } - exports.isBinaryFile = isBinaryFile3; - } -}); - -// node_modules/vscode-languageserver-textdocument/lib/umd/main.js -var require_main = __commonJS({ - "node_modules/vscode-languageserver-textdocument/lib/umd/main.js"(exports, module2) { - var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); }; - (function(factory) { - if (typeof module2 === "object" && typeof module2.exports === "object") { - var v = factory(require, exports); - if (v !== void 0) - module2.exports = v; - } else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); + module2.exports = { + /** + * Alias for create. Should be considered depreacted. Will be removed in next releases + * + * @method load + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + * @returns {cache} cache instance + */ + load: function(docId, cacheDir) { + return this.create(docId, cacheDir); + }, + /** + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. + * + * @method create + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + * @returns {cache} cache instance + */ + create: function(docId, cacheDir) { + var obj = Object.create(cache2); + obj.load(docId, cacheDir); + return obj; + }, + createFromFile: function(filePath) { + var obj = Object.create(cache2); + obj.loadFile(filePath); + return obj; + }, + /** + * Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly + * + * @method clearCache + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param cacheDir {String} the directory where the cache file was written + * @returns {Boolean} true if the cache folder was deleted. False otherwise + */ + clearCacheById: function(docId, cacheDir) { + var filePath = cacheDir ? path26.resolve(cacheDir, docId) : path26.resolve(__dirname, "../.cache/", docId); + return del(filePath); + }, + /** + * Remove all cache stored in the cache directory + * @method clearAll + * @returns {Boolean} true if the cache folder was deleted. False otherwise + */ + clearAll: function(cacheDir) { + var filePath = cacheDir ? path26.resolve(cacheDir) : path26.resolve(__dirname, "../.cache/"); + return del(filePath); } - })(function(require2, exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TextDocument = void 0; - var FullTextDocument = ( - /** @class */ - function() { - function FullTextDocument2(uri, languageId, version3, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version3; - this._content = content; - this._lineOffsets = void 0; - } - Object.defineProperty(FullTextDocument2.prototype, "uri", { - get: function() { - return this._uri; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FullTextDocument2.prototype, "languageId", { - get: function() { - return this._languageId; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FullTextDocument2.prototype, "version", { - get: function() { - return this._version; - }, - enumerable: false, - configurable: true - }); - FullTextDocument2.prototype.getText = function(range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument2.prototype.update = function(changes, version3) { - for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { - var change = changes_1[_i]; - if (FullTextDocument2.isIncremental(change)) { - var range = getWellformedRange(change.range); - var startOffset = this.offsetAt(range.start); - var endOffset = this.offsetAt(range.end); - this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); - var startLine = Math.max(range.start.line, 0); - var endLine = Math.max(range.end.line, 0); - var lineOffsets = this._lineOffsets; - var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); - if (endLine - startLine === addedLineOffsets.length) { - for (var i = 0, len = addedLineOffsets.length; i < len; i++) { - lineOffsets[i + startLine + 1] = addedLineOffsets[i]; - } - } else { - if (addedLineOffsets.length < 1e4) { - lineOffsets.splice.apply(lineOffsets, __spreadArray([startLine + 1, endLine - startLine], addedLineOffsets, false)); - } else { - this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); - } - } - var diff = change.text.length - (endOffset - startOffset); - if (diff !== 0) { - for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { - lineOffsets[i] = lineOffsets[i] + diff; - } - } - } else if (FullTextDocument2.isFull(change)) { - this._content = change.text; - this._lineOffsets = void 0; - } else { - throw new Error("Unknown change event received"); + }; + } +}); + +// node_modules/file-entry-cache/cache.js +var require_cache2 = __commonJS({ + "node_modules/file-entry-cache/cache.js"(exports, module2) { + var path26 = require("path"); + var crypto6 = require("crypto"); + module2.exports = { + createFromFile: function(filePath, useChecksum) { + var fname = path26.basename(filePath); + var dir = path26.dirname(filePath); + return this.create(fname, dir, useChecksum); + }, + create: function(cacheId, _path, useChecksum) { + var fs9 = require("fs"); + var flatCache = require_cache(); + var cache2 = flatCache.load(cacheId, _path); + var normalizedEntries = {}; + var removeNotFoundFiles = function removeNotFoundFiles2() { + const cachedEntries = cache2.keys(); + cachedEntries.forEach(function remover(fPath) { + try { + fs9.statSync(fPath); + } catch (err) { + if (err.code === "ENOENT") { + cache2.removeKey(fPath); } } - this._version = version3; - }; - FullTextDocument2.prototype.getLineOffsets = function() { - if (this._lineOffsets === void 0) { - this._lineOffsets = computeLineOffsets(this._content, true); - } - return this._lineOffsets; - }; - FullTextDocument2.prototype.positionAt = function(offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return { line: 0, character: offset }; - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } else { - low = mid + 1; + }); + }; + removeNotFoundFiles(); + return { + /** + * the flat cache storage used to persist the metadata of the `files + * @type {Object} + */ + cache: cache2, + /** + * Given a buffer, calculate md5 hash of its content. + * @method getHash + * @param {Buffer} buffer buffer to calculate hash on + * @return {String} content hash digest + */ + getHash: function(buffer) { + return crypto6.createHash("md5").update(buffer).digest("hex"); + }, + /** + * Return whether or not a file has changed since last time reconcile was called. + * @method hasFileChanged + * @param {String} file the filepath to check + * @return {Boolean} wheter or not the file has changed + */ + hasFileChanged: function(file) { + return this.getFileDescriptor(file).changed; + }, + /** + * given an array of file paths it return and object with three arrays: + * - changedFiles: Files that changed since previous run + * - notChangedFiles: Files that haven't change + * - notFoundFiles: Files that were not found, probably deleted + * + * @param {Array} files the files to analyze and compare to the previous seen files + * @return {[type]} [description] + */ + analyzeFiles: function(files) { + var me = this; + files = files || []; + var res = { + changedFiles: [], + notFoundFiles: [], + notChangedFiles: [] + }; + me.normalizeEntries(files).forEach(function(entry) { + if (entry.changed) { + res.changedFiles.push(entry.key); + return; + } + if (entry.notFound) { + res.notFoundFiles.push(entry.key); + return; } + res.notChangedFiles.push(entry.key); + }); + return res; + }, + getFileDescriptor: function(file) { + var fstat; + try { + fstat = fs9.statSync(file); + } catch (ex) { + this.removeEntry(file); + return { key: file, notFound: true, err: ex }; } - var line = low - 1; - return { line, character: offset - lineOffsets[line] }; - }; - FullTextDocument2.prototype.offsetAt = function(position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } else if (position.line < 0) { - return 0; + if (useChecksum) { + return this._getFileDescriptorUsingChecksum(file); } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument2.prototype, "lineCount", { - get: function() { - return this.getLineOffsets().length; - }, - enumerable: false, - configurable: true - }); - FullTextDocument2.isIncremental = function(event) { - var candidate = event; - return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number"); - }; - FullTextDocument2.isFull = function(event) { - var candidate = event; - return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0; - }; - return FullTextDocument2; - }() - ); - var TextDocument; - (function(TextDocument2) { - function create(uri, languageId, version3, content) { - return new FullTextDocument(uri, languageId, version3, content); - } - TextDocument2.create = create; - function update(document, changes, version3) { - if (document instanceof FullTextDocument) { - document.update(changes, version3); - return document; - } else { - throw new Error("TextDocument.update: document must be created by TextDocument.create"); - } - } - TextDocument2.update = update; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits.map(getWellformedEdit), function(a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; + return this._getFileDescriptorUsingMtimeAndSize(file, fstat); + }, + _getFileDescriptorUsingMtimeAndSize: function(file, fstat) { + var meta = cache2.getKey(file); + var cacheExists = !!meta; + var cSize = fstat.size; + var cTime = fstat.mtime.getTime(); + var isDifferentDate; + var isDifferentSize; + if (!meta) { + meta = { size: cSize, mtime: cTime }; + } else { + isDifferentDate = cTime !== meta.mtime; + isDifferentSize = cSize !== meta.size; } - return diff; - }); - var lastModifiedOffset = 0; - var spans = []; - for (var _i = 0, sortedEdits_1 = sortedEdits; _i < sortedEdits_1.length; _i++) { - var e = sortedEdits_1[_i]; - var startOffset = document.offsetAt(e.range.start); - if (startOffset < lastModifiedOffset) { - throw new Error("Overlapping edit"); - } else if (startOffset > lastModifiedOffset) { - spans.push(text.substring(lastModifiedOffset, startOffset)); + var nEntry = normalizedEntries[file] = { + key: file, + changed: !cacheExists || isDifferentDate || isDifferentSize, + meta + }; + return nEntry; + }, + _getFileDescriptorUsingChecksum: function(file) { + var meta = cache2.getKey(file); + var cacheExists = !!meta; + var contentBuffer; + try { + contentBuffer = fs9.readFileSync(file); + } catch (ex) { + contentBuffer = ""; } - if (e.newText.length) { - spans.push(e.newText); + var isDifferent = true; + var hash = this.getHash(contentBuffer); + if (!meta) { + meta = { hash }; + } else { + isDifferent = hash !== meta.hash; } - lastModifiedOffset = document.offsetAt(e.range.end); - } - spans.push(text.substr(lastModifiedOffset)); - return spans.join(""); - } - TextDocument2.applyEdits = applyEdits; - })(TextDocument = exports2.TextDocument || (exports2.TextDocument = {})); - function mergeSort(data, compare2) { - if (data.length <= 1) { - return data; - } - var p = data.length / 2 | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare2); - mergeSort(right, compare2); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare2(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - data[i++] = left[leftIdx++]; - } else { - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } - function computeLineOffsets(text, isAtLineStart, textOffset) { - if (textOffset === void 0) { - textOffset = 0; - } - var result = isAtLineStart ? [textOffset] : []; - for (var i = 0; i < text.length; i++) { - var ch = text.charCodeAt(i); - if (ch === 13 || ch === 10) { - if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) { - i++; + var nEntry = normalizedEntries[file] = { + key: file, + changed: !cacheExists || isDifferent, + meta + }; + return nEntry; + }, + /** + * Return the list o the files that changed compared + * against the ones stored in the cache + * + * @method getUpdated + * @param files {Array} the array of files to compare against the ones in the cache + * @returns {Array} + */ + getUpdatedFiles: function(files) { + var me = this; + files = files || []; + return me.normalizeEntries(files).filter(function(entry) { + return entry.changed; + }).map(function(entry) { + return entry.key; + }); + }, + /** + * return the list of files + * @method normalizeEntries + * @param files + * @returns {*} + */ + normalizeEntries: function(files) { + files = files || []; + var me = this; + var nEntries = files.map(function(file) { + return me.getFileDescriptor(file); + }); + return nEntries; + }, + /** + * Remove an entry from the file-entry-cache. Useful to force the file to still be considered + * modified the next time the process is run + * + * @method removeEntry + * @param entryName + */ + removeEntry: function(entryName) { + delete normalizedEntries[entryName]; + cache2.removeKey(entryName); + }, + /** + * Delete the cache file from the disk + * @method deleteCacheFile + */ + deleteCacheFile: function() { + cache2.removeCacheFile(); + }, + /** + * remove the cache from the file and clear the memory cache + */ + destroy: function() { + normalizedEntries = {}; + cache2.destroy(); + }, + _getMetaForFileUsingCheckSum: function(cacheEntry) { + var contentBuffer = fs9.readFileSync(cacheEntry.key); + var hash = this.getHash(contentBuffer); + var meta = Object.assign(cacheEntry.meta, { hash }); + delete meta.size; + delete meta.mtime; + return meta; + }, + _getMetaForFileUsingMtimeAndSize: function(cacheEntry) { + var stat2 = fs9.statSync(cacheEntry.key); + var meta = Object.assign(cacheEntry.meta, { + size: stat2.size, + mtime: stat2.mtime.getTime() + }); + delete meta.hash; + return meta; + }, + /** + * Sync the files and persist them to the cache + * @method reconcile + */ + reconcile: function(noPrune) { + removeNotFoundFiles(); + noPrune = typeof noPrune === "undefined" ? true : noPrune; + var entries = normalizedEntries; + var keys2 = Object.keys(entries); + if (keys2.length === 0) { + return; } - result.push(textOffset + i + 1); + var me = this; + keys2.forEach(function(entryName) { + var cacheEntry = entries[entryName]; + try { + var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry); + cache2.setKey(entryName, meta); + } catch (err) { + if (err.code !== "ENOENT") { + throw err; + } + } + }); + cache2.save(noPrune); } - } - return result; - } - function getWellformedRange(range) { - var start = range.start; - var end = range.end; - if (start.line > end.line || start.line === end.line && start.character > end.character) { - return { start: end, end: start }; - } - return range; - } - function getWellformedEdit(textEdit) { - var range = getWellformedRange(textEdit.range); - if (range !== textEdit.range) { - return { newText: textEdit.newText, range }; - } - return textEdit; + }; } - }); + }; } }); -// node_modules/cspell-lib/dist/cjs/Models/TextDocument.js -var require_TextDocument = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Models/TextDocument.js"(exports) { +// node_modules/cspell/dist/lib/file-entry-cache.cjs +var require_file_entry_cache = __commonJS({ + "node_modules/cspell/dist/lib/file-entry-cache.cjs"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) @@ -43105,18429 +35604,16972 @@ var require_TextDocument = __commonJS({ __setModuleDefault(result, mod); return result; }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.isTextDocument = exports.loadTextDocument = exports.updateTextDocument = exports.createTextDocument = void 0; - var assert_1 = __importDefault(require("assert")); - var fs_1 = require("fs"); - var vscode_languageserver_textdocument_1 = require_main(); - var LanguageIds_js_1 = require_LanguageIds(); - var Uri = __importStar(require_Uri()); - var TextDocumentImpl = class { - constructor(uri, text, languageId, locale, version3) { - this.uri = uri; - this.languageId = languageId; - this.locale = locale; - const primaryLanguageId = typeof languageId === "string" ? languageId : languageId[0] || "plaintext"; - this.vsTextDoc = vscode_languageserver_textdocument_1.TextDocument.create(uri.toString(), primaryLanguageId, version3, text); - } - get version() { - return this.vsTextDoc.version; - } - get text() { - return this.vsTextDoc.getText(); - } - positionAt(offset) { - return this.vsTextDoc.positionAt(offset); - } - offsetAt(position) { - return this.vsTextDoc.offsetAt(position); - } - lineAt(offset) { - const position = this.vsTextDoc.positionAt(offset); - return this.getLine(position.line); - } - getLine(lineNum) { - const position = { line: lineNum, character: 0 }; - const end = { line: lineNum + 1, character: 0 }; - const range = { - start: position, - end - }; - const lineOffset = this.vsTextDoc.offsetAt(position); - const text = this.vsTextDoc.getText(range); - return { - text, - offset: lineOffset, - position - }; - } - /** - * Iterate over the lines of a document one-by-one. - * Changing the document between iterations can change the result - */ - *getLines() { - const range = { - start: { line: 0, character: 0 }, - end: { line: 1, character: 0 } - }; - while (this.vsTextDoc.offsetAt(range.end) > this.vsTextDoc.offsetAt(range.start)) { - const offset = this.vsTextDoc.offsetAt(range.start); - yield { - text: this.vsTextDoc.getText(range), - offset, - position: range.start - }; - ++range.start.line; - ++range.end.line; - } - } - /** - * Apply edits to the text. - * Note: the edits are applied one after the other. - * @param edits - changes to the text - * @param version - optional version to use. - * @returns this - */ - update(edits, version3) { - version3 = version3 ?? this.version + 1; - for (const edit of edits) { - const vsEdit = edit.range ? { - range: { start: this.positionAt(edit.range[0]), end: this.positionAt(edit.range[1]) }, - text: edit.text - } : edit; - vscode_languageserver_textdocument_1.TextDocument.update(this.vsTextDoc, [vsEdit], version3); - } - return this; - } - }; - function createTextDocument({ uri, content, languageId, locale, version: version3 }) { - version3 = version3 ?? 1; - uri = Uri.toUri(uri); - languageId = languageId ?? (0, LanguageIds_js_1.getLanguagesForBasename)(Uri.basename(uri)); - languageId = languageId.length === 0 ? "text" : languageId; - return new TextDocumentImpl(uri, content, languageId, locale, version3); - } - exports.createTextDocument = createTextDocument; - function updateTextDocument(doc, edits, version3) { - (0, assert_1.default)(isTextDocumentImpl(doc), "Unknown TextDocument type"); - return doc.update(edits, version3); - } - exports.updateTextDocument = updateTextDocument; - function isTextDocumentImpl(doc) { - return doc instanceof TextDocumentImpl; - } - async function loadTextDocument(filename, languageId) { - const uri = Uri.toUri(filename); - const content = await fs_1.promises.readFile(Uri.uriToFilePath(uri), "utf8"); - return createTextDocument({ uri, languageId, content }); + exports.createFromFile = void 0; + var fileEntryCache = __importStar(require_cache2()); + function createFromFile3(pathToCache, useChecksum) { + return fileEntryCache.createFromFile(pathToCache, useChecksum); } - exports.loadTextDocument = loadTextDocument; - exports.isTextDocument = isTextDocumentImpl; + exports.createFromFile = createFromFile3; } }); -// node_modules/cspell-lib/dist/cjs/Document/resolveDocument.js -var require_resolveDocument = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Document/resolveDocument.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveDocument = exports.resolveDocumentToTextDocument = exports.documentToTextDocument = exports.fileToTextDocument = exports.fileToDocument = void 0; - var promises_1 = require("fs/promises"); - var TextDocument_js_1 = require_TextDocument(); - var Uri = __importStar(require_Uri()); - var util_js_1 = require_util(); - var defaultEncoding = "utf8"; - function fileToDocument2(file, text, languageId, locale) { - return (0, util_js_1.clean)({ - uri: Uri.toUri(file).toString(), - text, - languageId, - locale - }); - } - exports.fileToDocument = fileToDocument2; - async function fileToTextDocument(file) { - return documentToTextDocument(await resolveDocument(fileToDocument2(file))); - } - exports.fileToTextDocument = fileToTextDocument; - function documentToTextDocument(document) { - const { uri, text: content, languageId, locale } = document; - return (0, TextDocument_js_1.createTextDocument)({ uri, content, languageId, locale }); - } - exports.documentToTextDocument = documentToTextDocument; - async function resolveDocumentToTextDocument(doc) { - return documentToTextDocument(await resolveDocument(doc)); - } - exports.resolveDocumentToTextDocument = resolveDocumentToTextDocument; - async function readDocument(filename, encoding = defaultEncoding) { - const text = await (0, promises_1.readFile)(filename, encoding); - const uri = Uri.toUri(filename).toString(); - return { - uri, - text - }; - } - function resolveDocument(document, encoding) { - if (isDocumentWithText(document)) - return Promise.resolve(document); - const uri = Uri.toUri(document.uri); - if (uri.scheme !== "file") { - throw new Error(`Unsupported schema: "${uri.scheme}", open "${uri.toString()}"`); +// node_modules/import-meta-resolve/lib/errors.js +function formatList(array, type = "and") { + return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`; +} +function createError(sym, value, def) { + messages.set(sym, value); + return makeNodeErrorWithCode(def, sym); +} +function makeNodeErrorWithCode(Base, key) { + return NodeError; + function NodeError(...args) { + const limit = Error.stackTraceLimit; + if (isErrorStackTraceLimitWritable()) + Error.stackTraceLimit = 0; + const error2 = new Base(); + if (isErrorStackTraceLimitWritable()) + Error.stackTraceLimit = limit; + const message = getMessage(key, args, error2); + Object.defineProperties(error2, { + // Note: no need to implement `kIsNodeError` symbol, would be hard, + // probably. + message: { + value: message, + enumerable: false, + writable: true, + configurable: true + }, + toString: { + /** @this {Error} */ + value() { + return `${this.name} [${key}]: ${this.message}`; + }, + enumerable: false, + writable: true, + configurable: true } - return readDocument(Uri.uriToFilePath(uri), encoding); - } - exports.resolveDocument = resolveDocument; - function isDocumentWithText(doc) { - return doc.text !== void 0; - } - } -}); - -// node_modules/cspell-lib/dist/cjs/Document/index.js -var require_Document = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Document/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fileToTextDocument = exports.fileToDocument = exports.isBinaryFile = void 0; - var isBinaryDoc_js_1 = require_isBinaryDoc(); - Object.defineProperty(exports, "isBinaryFile", { enumerable: true, get: function() { - return isBinaryDoc_js_1.isBinaryFile; - } }); - var resolveDocument_js_1 = require_resolveDocument(); - Object.defineProperty(exports, "fileToDocument", { enumerable: true, get: function() { - return resolveDocument_js_1.fileToDocument; - } }); - Object.defineProperty(exports, "fileToTextDocument", { enumerable: true, get: function() { - return resolveDocument_js_1.fileToTextDocument; - } }); + }); + captureLargerStackTrace(error2); + error2.code = key; + return error2; } -}); - -// node_modules/cspell-lib/dist/cjs/FeatureFlags/FeatureFlags.js -var require_FeatureFlags = __commonJS({ - "node_modules/cspell-lib/dist/cjs/FeatureFlags/FeatureFlags.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSystemFeatureFlags = exports.UnknownFeatureFlagError = exports.FeatureFlags = void 0; - var systemFeatureFlags; - var FeatureFlags = class { - constructor(flags = []) { - this.flagValues = /* @__PURE__ */ new Map(); - this.flags = new Map(flags.map((f) => [f.name, f])); - } - register(flagOrName, description) { - if (typeof flagOrName === "string") { - return this.register({ name: flagOrName, description: description || "" }); - } - this.flags.set(flagOrName.name, flagOrName); - return this; - } - getFlag(flag) { - return this.flagValues.get(flag); - } - getFlagBool(flag) { - return toBool(this.getFlag(flag)); - } - setFlag(flag, value = true) { - if (!this.flags.has(flag)) { - throw new UnknownFeatureFlagError(flag); - } - this.flagValues.set(flag, value); - return this; - } - getFlagInfo(flag) { - return this.flags.get(flag); - } - getFlags() { - return [...this.flags.values()]; - } - getFlagValues() { - return new Map(this.flagValues); - } - reset() { - this.flagValues.clear(); - return this; - } - }; - exports.FeatureFlags = FeatureFlags; - var UnknownFeatureFlagError = class extends Error { - constructor(flag) { - super(`Unknown feature flag: ${flag}`); - this.flag = flag; - } - }; - exports.UnknownFeatureFlagError = UnknownFeatureFlagError; - function getSystemFeatureFlags2() { - return systemFeatureFlags || (systemFeatureFlags = new FeatureFlags()); - } - exports.getSystemFeatureFlags = getSystemFeatureFlags2; - var boolValues = { - 0: false, - 1: true, - f: false, - false: false, - n: false, - no: false, - t: true, - true: true, - y: true, - yes: true - }; - function toBool(value) { - if (typeof value !== "string") - return value; - return boolValues[value.toLowerCase()]; +} +function isErrorStackTraceLimitWritable() { + try { + if (import_node_v8.default.startupSnapshot.isBuildingSnapshot()) { + return false; } + } catch { } -}); - -// node_modules/cspell-lib/dist/cjs/FeatureFlags/index.js -var require_FeatureFlags2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/FeatureFlags/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.UnknownFeatureFlagError = exports.getSystemFeatureFlags = exports.FeatureFlags = void 0; - var FeatureFlags_js_1 = require_FeatureFlags(); - Object.defineProperty(exports, "FeatureFlags", { enumerable: true, get: function() { - return FeatureFlags_js_1.FeatureFlags; - } }); - Object.defineProperty(exports, "getSystemFeatureFlags", { enumerable: true, get: function() { - return FeatureFlags_js_1.getSystemFeatureFlags; - } }); - Object.defineProperty(exports, "UnknownFeatureFlagError", { enumerable: true, get: function() { - return FeatureFlags_js_1.UnknownFeatureFlagError; - } }); - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/grammarTypesHelpers.js -var require_grammarTypesHelpers = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/grammarTypesHelpers.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isGrammar = exports.isPatternPatterns = exports.isPatternBeginEnd = exports.isPatternMatch = exports.isPatternInclude = void 0; - function isPatternInclude(p) { - return !!p.include; - } - exports.isPatternInclude = isPatternInclude; - var TypeofMatch = { - object: true, - string: true - }; - var TypeofBegin = TypeofMatch; - var TypeofEnd = { ...TypeofBegin, undefined: true }; - function isPatternMatch(pattern) { - const p = pattern; - return !!p.match && typeof p.match in TypeofMatch; - } - exports.isPatternMatch = isPatternMatch; - function isPatternBeginEnd(pattern) { - const p = pattern; - return p.begin !== void 0 && typeof p.begin in TypeofBegin && typeof p.end in TypeofEnd; - } - exports.isPatternBeginEnd = isPatternBeginEnd; - function isPatternPatterns(p) { - return Array.isArray(p.patterns); - } - exports.isPatternPatterns = isPatternPatterns; - function isGrammar(g) { - return g.scopeName !== void 0; - } - exports.isGrammar = isGrammar; + const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit"); + if (desc === void 0) { + return Object.isExtensible(Error); } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/matchResult.js -var require_matchResult = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/matchResult.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createSimpleMatchResult = exports.createMatchResult = exports.segmentMatch = void 0; - function segmentMatch(mr) { - const { matches, index, groups, input } = mr; - const segments = []; - let p = index; - for (let groupNum = 0; groupNum < matches.length; ++groupNum) { - const m = matches[groupNum]; - if (!m) - continue; - const idx0 = input.indexOf(m, p); - const idx = idx0 >= p ? idx0 : input.lastIndexOf(m, p); - if (idx < 0) - continue; - segments.push({ match: m, index: idx, groupNum, groupName: void 0 }); - p = idx; - } - const textToSeg = new Map(segments.map((s) => [s.match, s])); - for (const [name, value] of Object.entries(groups)) { - const s = value && textToSeg.get(value); - if (!s) - continue; - s.groupName = s.groupName ? Array.isArray(s.groupName) ? s.groupName.concat([name]) : [s.groupName, name] : name; - } - return segments; - } - exports.segmentMatch = segmentMatch; - function createMatchResult(r, lineNumber) { - const groups = /* @__PURE__ */ Object.create(null); - r.groups && Object.assign(groups, r.groups); - const matches = r; - const match = r[0]; - return { index: r.index, input: r.input, match, matches, groups, lineNumber }; - } - exports.createMatchResult = createMatchResult; - function createSimpleMatchResult(match, input, index, lineNumber) { - const groups = /* @__PURE__ */ Object.create(null); - return { index, input, match, matches: [match], groups, lineNumber }; - } - exports.createSimpleMatchResult = createSimpleMatchResult; + return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0; +} +function hideStackFrames(fn) { + const hidden = nodeInternalPrefix + fn.name; + Object.defineProperty(fn, "name", { value: hidden }); + return fn; +} +function getMessage(key, args, self) { + const message = messages.get(key); + (0, import_node_assert.default)(message !== void 0, "expected `message` to be found"); + if (typeof message === "function") { + (0, import_node_assert.default)( + message.length <= args.length, + // Default options do not count. + `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).` + ); + return Reflect.apply(message, self, args); } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/scope.js -var require_scope = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/scope.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ScopePool = exports.Scope = void 0; - var assert_1 = __importDefault(require("assert")); - var Scope = class _Scope { - constructor(value, parent) { - this.value = value; - this.parent = parent; - } - /** - * Convert the scope hierarchy to a string - * @param ltr - return ancestry from left-to-right - * @returns the scope hierarchy as a string separated by a space. - */ - toString(ltr = false) { - if (!this.parent) - return this.value; - return ltr ? this.parent.toString(ltr) + " " + this.value : this.value + " " + this.parent.toString(ltr); - } - static isScope(value) { - return value instanceof _Scope; - } - }; - exports.Scope = Scope; - var ScopePool = class { - constructor() { - this.pool = /* @__PURE__ */ new Map(); - } - /** - * Get a Scope that matches the scope. This method is idempotent. - * @param scopeValue - a single scope value: i.e. `source.ts` - * @param parent - optional parent Scope - */ - getScope(scopeValue, parent) { - const foundPoolMap = this.pool.get(scopeValue); - const poolMap = foundPoolMap || /* @__PURE__ */ new Map(); - if (poolMap !== foundPoolMap) { - this.pool.set(scopeValue, poolMap); - } - const foundScope = poolMap.get(parent); - if (foundScope) - return foundScope.v; - const scope = new Scope(scopeValue, parent); - poolMap.set(parent, { v: scope }); - return scope; - } - parseScope(scopes, ltr = false) { - if (Scope.isScope(scopes)) - return scopes; - if (isScopeLike(scopes)) { - const parent = scopes.parent ? this.parseScope(scopes.parent) : void 0; - return this.getScope(scopes.value, parent); - } - return this.parseScopeString(scopes, ltr); - } - parseScopeString(scopes, ltr) { - scopes = Array.isArray(scopes) ? scopes : scopes.split(" "); - const parentToChild = ltr ? scopes : scopes.reverse(); - let parent = void 0; - for (const value of parentToChild) { - parent = this.getScope(value, parent); - } - (0, assert_1.default)(parent, "Empty scope is not allowed."); - return parent; - } - }; - exports.ScopePool = ScopePool; - function isScopeLike(value) { - return typeof value === "object" && !Array.isArray(value) && value.value !== void 0; - } + const regex = /%[dfijoOs]/g; + let expectedLength = 0; + while (regex.exec(message) !== null) + expectedLength++; + (0, import_node_assert.default)( + expectedLength === args.length, + `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).` + ); + if (args.length === 0) + return message; + args.unshift(message); + return Reflect.apply(import_node_util.format, null, args); +} +function determineSpecificType(value) { + if (value === null || value === void 0) { + return String(value); } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/grammarNormalizer.js -var require_grammarNormalizer = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/grammarNormalizer.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractScope = exports.nPattern = exports.normalizeGrammar = void 0; - var grammarTypesHelpers_js_1 = require_grammarTypesHelpers(); - var matchResult_js_1 = require_matchResult(); - var scope_js_1 = require_scope(); - function normalizeGrammar(grammar) { - return new ImplNGrammar(grammar); - } - exports.normalizeGrammar = normalizeGrammar; - var SpecialRepositoryReferences = { - $self: true, - $base: true - }; - function nPattern(p) { - if ((0, grammarTypesHelpers_js_1.isPatternMatch)(p)) - return normalizePatternMatch(p); - if ((0, grammarTypesHelpers_js_1.isPatternBeginEnd)(p)) - return normalizePatternBeginEnd(p); - if ((0, grammarTypesHelpers_js_1.isPatternInclude)(p)) - return normalizePatternInclude(p); - if ((0, grammarTypesHelpers_js_1.isPatternPatterns)(p)) - return normalizePatternsPatterns(p); - return normalizePatternName(p); - } - exports.nPattern = nPattern; - function normalizePatternMatch(p) { - const regExec = makeTestMatchFn(p.match); - const self = { - ...p, - captures: normalizeCapture(p.captures), - findMatch - }; - function findMatch(line, parentRule) { - const match = regExec(line); - if (!match) - return void 0; - const rule = factoryRule(parentRule, self); - return { rule, match, line }; - } - return self; - } - function normalizePatternBeginEnd(p) { - const patterns = normalizePatterns(p.patterns); - const self = { - ...p, - captures: normalizeCapture(p.captures), - beginCaptures: normalizeCapture(p.beginCaptures), - endCaptures: normalizeCapture(p.endCaptures), - patterns, - findMatch - }; - function findMatch(line, parentRule) { - const match = testBegin(line); - if (!match) - return void 0; - const rule = factoryRule(parentRule, self, findNext, end); - return { rule, match, line }; - } - const testBegin = makeTestMatchFn(p.begin); - const testEnd = p.end !== void 0 ? makeTestMatchFn(p.end) : () => void 0; - function findNext(line) { - return patterns && findInPatterns(patterns, line, this); - } - function end(line) { - return testEnd(line); - } - return self; - } - function normalizePatternName(p) { - const patterns = void 0; - const self = { - ...p, - patterns, - findMatch - }; - function findMatch(line, parentRule) { - const rule = factoryRule(parentRule, self); - const input = line.text.slice(line.offset); - const match = (0, matchResult_js_1.createSimpleMatchResult)(input, input, line.offset, line.lineNumber); - return { rule, match, line }; - } - return self; - } - function normalizePatternInclude(p) { - const { include } = p; - return include.startsWith("#") || include in SpecialRepositoryReferences ? normalizePatternIncludeRef(p) : normalizePatternIncludeExt(p); - } - function normalizePatternIncludeRef(p) { - const { include, ...rest } = p; - const reference = include.startsWith("#") ? include.slice(1) : include; - const self = { - ...rest, - reference, - findMatch - }; - function findMatch(line, parentRule) { - const pat = parentRule.repository[reference]; - if (pat === void 0) - throw new Error(`Unknown Include Reference ${include}`); - return pat.findMatch(line, parentRule); - } - return self; - } - function normalizePatternIncludeExt(p) { - function findMatch(_line) { - return void 0; - } - const self = { - ...p, - findMatch - }; - return self; - } - function normalizePatternsPatterns(p) { - return new ImplNPatternPatterns(p); - } - function findInPatterns(patterns, line, rule) { - let r = void 0; - for (const pat of patterns) { - if (pat.disabled) - continue; - const er = pat.findMatch(line, rule); - if (er?.match !== void 0 && !er.rule.pattern.disabled) { - r = r && r.match && r.match.index <= er.match.index && r || er; - } - } - return r; - } - function normalizePatterns(patterns) { - if (!patterns) - return void 0; - return patterns.map((p) => typeof p === "string" ? { include: p } : p).map(nPattern); - } - var emptyRepository = Object.freeze(/* @__PURE__ */ Object.create(null)); - function normalizePatternRepository(rep) { - if (!rep) - return emptyRepository; - return normalizeRepository(rep); - } - function normalizeRepository(rep) { - const repository = /* @__PURE__ */ Object.create(null); - for (const [key, pat] of Object.entries(rep)) { - repository[key] = nPattern(pat); - } - return repository; - } - var ruleCounter = 0; - function factoryRuleBase(parent, pattern, repository, grammar, findNext, end) { - const depth = parent ? parent.depth + 1 : 0; - return { - id: ruleCounter++, - grammar, - pattern, - parent, - repository, - depth, - findNext, - end - }; - } - function factoryRule(parent, pattern, findNext, end) { - return factoryRuleBase(parent, pattern, parent.repository, parent.grammar, findNext, end); - } - function normalizeCapture(cap) { - if (cap === void 0) - return void 0; - if (typeof cap === "string") - return { [0]: cap }; - const capture = /* @__PURE__ */ Object.create(null); - for (const [key, pat] of Object.entries(cap)) { - capture[key] = typeof pat === "string" ? pat : normalizePatternName(pat).name; - } - return capture; - } - function makeTestMatchFn(reg) { - if (typeof reg === "string") - return matchString(reg); - return matchRegExp(reg); - } - function matchString(s) { - return (line) => { - const input = line.text; - const index = input.indexOf(s, line.offset); - if (index < 0) - return void 0; - return (0, matchResult_js_1.createSimpleMatchResult)(s, input, index, line.lineNumber); - }; - } - function matchRegExp(r) { - return (line) => { - const rg = RegExp(r, "gm"); - rg.lastIndex = line.offset; - const m = rg.exec(line.text); - return (m && (0, matchResult_js_1.createMatchResult)(m, line.lineNumber)) ?? void 0; - }; - } - function extractScope(er, isContent = true) { - const scope = []; - for (let rule = er; rule; rule = rule.parent) { - const pattern = rule.pattern; - const { name, contentName } = pattern; - if (contentName && isContent) { - scope.push(contentName); - } - if (name !== void 0) { - scope.push(name); - } - isContent = true; - } - return er.grammar.scopePool.parseScope(scope); - } - exports.extractScope = extractScope; - var ImplNGrammar = class { - constructor(grammar) { - this.scopeName = grammar.scopeName; - this.name = grammar.scopeName; - this.comment = grammar.comment; - this.disabled = grammar.disabled; - this.grammarName = grammar.name; - const self = nPattern({ - patterns: [{ patterns: grammar.patterns }] - }); - const repository = normalizePatternRepository(grammar.repository); - this.patterns = self.patterns; - this.repository = repository; - this.self = self; - this.scopePool = new scope_js_1.ScopePool(); - } - begin(parentRule) { - const patterns = this.patterns; - function grammarToRule(grammar, baseGrammar, parent) { - const repository = /* @__PURE__ */ Object.create(null); - Object.assign(repository, grammar.repository); - repository["$self"] = grammar.self; - repository["$base"] = repository["$base"] || baseGrammar.self; - function findNext(line) { - return findInPatterns(patterns, line, this); - } - function end(_line) { - return void 0; - } - return factoryRuleBase(parent, grammar, repository, grammar, findNext, end); - } - return grammarToRule(this, parentRule?.grammar ?? this, parentRule); - } - }; - var ImplNPatternPatterns = class { - constructor(p) { - const { name, comment, disabled, ...rest } = p; - this.patterns = normalizePatterns(rest.patterns); - this.name = name; - this.comment = comment; - this.disabled = disabled; - } - findMatch(line, parentRule) { - const patterns = this.patterns; - const rule = factoryRule(parentRule, this, findNext); - function findNext(line2) { - return findInPatterns(patterns, line2, this); - } - return rule.findNext?.(line); - } - }; + if (typeof value === "function" && value.name) { + return `function ${value.name}`; } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/grammar.js -var require_grammar = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/grammar.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.compileGrammar = void 0; - var grammarNormalizer_js_1 = require_grammarNormalizer(); - function compileGrammar(grammar) { - return (0, grammarNormalizer_js_1.normalizeGrammar)(grammar); + if (typeof value === "object") { + if (value.constructor && value.constructor.name) { + return `an instance of ${value.constructor.name}`; } - exports.compileGrammar = compileGrammar; + return `${(0, import_node_util.inspect)(value, { depth: -1 })}`; } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/util.js -var require_util7 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDefined = void 0; - function isDefined2(t) { - return t !== void 0 && t !== null; - } - exports.isDefined = isDefined2; + let inspected = (0, import_node_util.inspect)(value, { colors: false }); + if (inspected.length > 28) { + inspected = `${inspected.slice(0, 25)}...`; } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/processors/procMatchingRule.js -var require_procMatchingRule = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/processors/procMatchingRule.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.applyCaptures = exports.applyCaptureToEnd = exports.applyCaptureToBeginOrMatch = void 0; - var grammarNormalizer_js_1 = require_grammarNormalizer(); - var matchResult_js_1 = require_matchResult(); - var util_js_1 = require_util7(); - function applyCaptureToBeginOrMatch(matchRuleResult) { - const { match, rule } = matchRuleResult; - const bePattern = rule.pattern; - const captures = bePattern.beginCaptures ?? bePattern.captures; - return applyCaptures(rule, match, captures); - } - exports.applyCaptureToBeginOrMatch = applyCaptureToBeginOrMatch; - function applyCaptureToEnd(rule, match) { - const { pattern } = rule; - const bePattern = pattern; - const captures = bePattern.endCaptures ?? bePattern.captures; - return applyCaptures(rule, match, captures); - } - exports.applyCaptureToEnd = applyCaptureToEnd; - function applyCaptures(rule, match, captures) { - const scope = (0, grammarNormalizer_js_1.extractScope)(rule, false); - const pool = rule.grammar.scopePool; - const text = match.match; - const input = match.input; - const range = [match.index, match.index + text.length, match.lineNumber]; - if (!text && !captures) - return []; - if (!captures) { - const tokenized = { - scope, - text, - range - }; - return [tokenized]; - } - const captureScopes = new Map(Object.entries(captures)); - const cap0 = captureScopes.get("0"); - if (captureScopes.size === 1 && cap0) { - const tokenized = { - scope: rule.grammar.scopePool.getScope(cap0, scope), - text, - range - }; - return [tokenized]; - } - const min = match.index; - const max = match.index + text.length; - function trimSegment(seg) { - const { index, match: match2 } = seg; - const right = match2.length; - if (index >= min && right <= max) - return seg; - if (index >= max || right < min) - return void 0; - const a = Math.max(index, min) - index; - const b = Math.min(right, max) - index; - const text2 = match2.slice(a, b); - return { - ...seg, - index: index + a, - match: text2 - }; - } - const segments = (0, matchResult_js_1.segmentMatch)(match).map(trimSegment).filter(util_js_1.isDefined); - function processSegments(segments2) { - const base = segments2[0]; - const root = { - a: base.index, - b: base.index + base.match.length, - s: { seg: base } - }; - let m; - for (let i = 1; i < segments2.length; ++i) { - const seg = segments2[i]; - const index = seg.index; - const end = index + seg.match.length; - m = m && m.a <= index ? m : root; - while (m && m.b <= index) { - m = m.n; - } - while (m && m.a < end) { - if (m.a < index) { - const n = { ...m, a: index }; - m.n = n; - m.b = index; - m = n; - } - if (m.b > end) { - const n = { ...m, a: end }; - m.b = end; - m.n = n; - } - m.s = { seg, next: m.s }; - m = m.n; + return `type ${typeof value} (${inspected})`; +} +var import_node_v8, import_node_process3, import_node_assert, import_node_util, isWindows, own, classRegExp, kTypes, codes2, messages, nodeInternalPrefix, userStackTraceLimit, captureLargerStackTrace; +var init_errors = __esm({ + "node_modules/import-meta-resolve/lib/errors.js"() { + import_node_v8 = __toESM(require("node:v8"), 1); + import_node_process3 = __toESM(require("node:process"), 1); + import_node_assert = __toESM(require("node:assert"), 1); + import_node_util = require("node:util"); + isWindows = import_node_process3.default.platform === "win32"; + own = {}.hasOwnProperty; + classRegExp = /^([A-Z][a-z\d]*)+$/; + kTypes = /* @__PURE__ */ new Set([ + "string", + "function", + "number", + "object", + // Accept 'Function' and 'Object' as alternative to the lower cased version. + "Function", + "Object", + "boolean", + "bigint", + "symbol" + ]); + codes2 = {}; + messages = /* @__PURE__ */ new Map(); + nodeInternalPrefix = "__node_internal_"; + codes2.ERR_INVALID_ARG_TYPE = createError( + "ERR_INVALID_ARG_TYPE", + /** + * @param {string} name + * @param {Array | string} expected + * @param {unknown} actual + */ + (name, expected, actual) => { + (0, import_node_assert.default)(typeof name === "string", "'name' must be a string"); + if (!Array.isArray(expected)) { + expected = [expected]; + } + let message = "The "; + if (name.endsWith(" argument")) { + message += `${name} `; + } else { + const type = name.includes(".") ? "property" : "argument"; + message += `"${name}" ${type} `; + } + message += "must be "; + const types = []; + const instances = []; + const other = []; + for (const value of expected) { + (0, import_node_assert.default)( + typeof value === "string", + "All expected entries have to be of type string" + ); + if (kTypes.has(value)) { + types.push(value.toLowerCase()); + } else if (classRegExp.exec(value) === null) { + (0, import_node_assert.default)( + value !== "object", + 'The value "object" should be written as "Object"' + ); + other.push(value); + } else { + instances.push(value); } } - return root; - } - function segChainToScope(chain) { - function* _chain(chain2) { - while (chain2) { - const seg = chain2.seg; - if (seg.groupName) { - if (Array.isArray(seg.groupName)) { - yield* seg.groupName; - } else { - yield seg.groupName; - } - } - yield seg.groupNum.toString(); - chain2 = chain2.next; + if (instances.length > 0) { + const pos = types.indexOf("object"); + if (pos !== -1) { + types.slice(pos, 1); + instances.push("Object"); } } - const scopeValues = [..._chain(chain)].map((cap) => captureScopes.get(cap)).filter(util_js_1.isDefined).reverse(); - return scopeValues.reduce((s, v) => pool.getScope(v, s), scope); - } - const merged = processSegments(segments); - function* emit(m) { - while (m) { - const t = { - text: input.slice(m.a, m.b), - range: [m.a, m.b, match.lineNumber], - scope: segChainToScope(m.s) - }; - yield t; - m = m.n; + if (types.length > 0) { + message += `${types.length > 1 ? "one of type" : "of type"} ${formatList( + types, + "or" + )}`; + if (instances.length > 0 || other.length > 0) + message += " or "; } - } - const parsedText = [...emit(merged)]; - return parsedText; - } - exports.applyCaptures = applyCaptures; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/tokenizeLine.js -var require_tokenizeLine = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/tokenizeLine.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.tokenizeTextIterable = exports.tokenizeText = exports.tokenizeLine = void 0; - var assert_1 = __importDefault(require("assert")); - var grammarNormalizer_js_1 = require_grammarNormalizer(); - var procMatchingRule_js_1 = require_procMatchingRule(); - function tokenizeLine(line, rule) { - const text = line.text; - const lineLen = line.text.length; - const parsedText = []; - let ctx = buildContext({ ...line, offset: 0, anchor: -1 }, rule); - while (ctx.line.offset <= lineLen) { - let endMatch = ctx.rule.end?.(ctx.line); - while (endMatch?.index === ctx.line.offset) { - parsedText.push(...(0, procMatchingRule_js_1.applyCaptureToEnd)(ctx.rule, endMatch)); - ctx = findParentWithEnd(ctx); - ctx.line.offset = endMatch.index + endMatch.match.length; - endMatch = ctx.rule.end?.(ctx.line); - } - if (ctx.line.offset >= lineLen) - break; - const { line: line2, rule: rule2 } = ctx; - const offset = line2.offset; - const match = rule2.findNext?.(line2); - const limit = endMatch?.index ?? lineLen; - const emitTil = match ? Math.min(match.match.index, limit) : limit; - if (offset < emitTil) { - const scope = (0, grammarNormalizer_js_1.extractScope)(rule2); - const start = offset; - const end = emitTil; - parsedText.push({ - scope, - text: text.slice(start, end), - range: [start, end, line2.lineNumber] - }); - ctx.line.offset = emitTil; + if (instances.length > 0) { + message += `an instance of ${formatList(instances, "or")}`; + if (other.length > 0) + message += " or "; } - if (!match || endMatch && endMatch.index <= match.match.index) { - continue; + if (other.length > 0) { + if (other.length > 1) { + message += `one of ${formatList(other, "or")}`; + } else { + if (other[0].toLowerCase() !== other[0]) + message += "an "; + message += `${other[0]}`; + } } - parsedText.push(...(0, procMatchingRule_js_1.applyCaptureToBeginOrMatch)(match)); - line2.anchor = match.match.index + match.match.match.length; - line2.offset = line2.anchor; - ctx = findNearestWithEnd(buildContext(line2, match.rule)); - } - return toParseLineResult(line, ctx.rule, parsedText); - } - exports.tokenizeLine = tokenizeLine; - function tokenizeText(text, grammar) { - return [...tokenizeTextIterable(text, grammar)]; - } - exports.tokenizeText = tokenizeText; - function* tokenizeTextIterable(text, grammar) { - const lines = text.split(/(?<=\r\n|\n|\r(?!\n))/); - const rule = grammar.begin(); - let documentOffset = 0; - let tr = tokenizeLine({ text: lines[0], lineNumber: 0, documentOffset }, rule); - documentOffset += lines[0].length; - yield toParsedLine(tr); - for (let i = 1; i < lines.length; ++i) { - const line = { text: lines[i], lineNumber: i, documentOffset }; - documentOffset += line.text.length; - tr = tr.parse(line); - yield toParsedLine(tr); - } - } - exports.tokenizeTextIterable = tokenizeTextIterable; - function toParsedLine(pr) { - const { tokens: parsedText, line, offset } = pr; - return { tokens: parsedText, line, offset }; - } - function toParseLineResult(line, rule, parsedText) { - return { - tokens: parsedText, - line, - offset: line.documentOffset, - parse: (line2) => tokenizeLine(line2, rule) - }; - } - function buildContext(line, rule) { - const rules = calcRuleStack(rule); - const numRules = rules.length; - const rootNum = numRules - 1; - const rootRule = rules[rootNum]; - const rootContext = { - line, - rule: rootRule - }; - let ctx = rootContext; - for (let i = rootNum - 1; i >= 0; --i) { - const rule2 = rules[i]; - const line2 = ctx.line; - ctx = { - line: line2, - rule: rule2, - parent: ctx - }; - } - return ctx; - } - function calcRuleStack(rule) { - const rules = []; - let r = rule; - while (r) { - rules.push(r); - r = r.parent; - } - return rules; - } - function must(t, msg = "Must be defined") { - (0, assert_1.default)(t !== void 0 && t !== null, msg); - return t; - } - function findParentWithEnd(ctx) { - return findNearestWithEnd(must(ctx.parent)); - } - function findNearestWithEnd(ctx) { - while (!ctx.rule.end) { - ctx = must(ctx.parent); - } - return ctx; - } - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/index.js -var require_parser = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.tokenizeText = exports.tokenizeLine = exports.compileGrammar = void 0; - var grammar_js_1 = require_grammar(); - Object.defineProperty(exports, "compileGrammar", { enumerable: true, get: function() { - return grammar_js_1.compileGrammar; - } }); - var tokenizeLine_js_1 = require_tokenizeLine(); - Object.defineProperty(exports, "tokenizeLine", { enumerable: true, get: function() { - return tokenizeLine_js_1.tokenizeLine; - } }); - Object.defineProperty(exports, "tokenizeText", { enumerable: true, get: function() { - return tokenizeLine_js_1.tokenizeText; - } }); - } -}); - -// node_modules/cspell-grammar/dist/cjs/grammars/typescript.js -var require_typescript = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/grammars/typescript.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.grammar = void 0; - var repository = { - statements: { - name: "code.ts", - patterns: [ - "#keyword", - "#regexp", - "#string", - "#comment", - "#braces", - "#punctuation", - "#space", - { name: "identifier", match: /[^\s;,!|&:^%{}[\]()*/+=<>]+/ } - ] - }, - keyword: { - patterns: ["#keywordBase", "#standardTypes", "#standardLib"] - }, - keywordBase: { - name: "keyword.typescript.ts", - match: /\b(?:any|as|async|await|bigint|boolean|break|case|catch|const|continue|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|in|instanceof|interface|import|let|map|module|new|new|null|number|of|package|private|public|require|return|set|static|string|super|switch|this|throw|true|try|type|typeof|unknown|undefined|var|void|while|yield)\b/ - }, - standardTypes: { - name: "keyword.type.ts", - match: /\b(?:Promise|Record|Omit|Extract|Exclude|BigInt|Array)\b/ - }, - standardLib: { - name: "keyword.lib.ts", - match: /\b(?:console|process|window)\b/ - }, - string: { - patterns: ["#string_q_single", "#string_q_double", "#string_template"] - }, - string_q_single: { - name: "string.quoted.single.ts", - begin: "'", - end: /'|((?:[^\\\n])$)/, - captures: "punctuation.string.ts", - patterns: [{ include: "#string_character_escape" }] - }, - string_q_double: { - name: "string.quoted.double.ts", - begin: '"', - end: /"|((?:[^\\\n])$)/, - captures: "punctuation.string.ts", - patterns: [{ include: "#string_character_escape" }] + message += `. Received ${determineSpecificType(actual)}`; + return message; }, - string_template: { - name: "string.template.ts", - begin: "`", - end: "`", - captures: "punctuation.string.ts", - patterns: [ - { - name: "meta.template.expression.ts", - contentName: "meta.embedded.line.ts", - begin: "${", - end: "}", - patterns: ["#statements"], - captures: "punctuation.definition.template.expression.ts" - }, - { include: "#string_character_escape" } - ] + TypeError + ); + codes2.ERR_INVALID_MODULE_SPECIFIER = createError( + "ERR_INVALID_MODULE_SPECIFIER", + /** + * @param {string} request + * @param {string} reason + * @param {string} [base] + */ + (request, reason, base = void 0) => { + return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`; }, - string_character_escape: { - name: "constant.character.escape.ts", - match: /\\(x[0-9A-Fa-f]{2}|[0-3][0-7]{0,2}|[4-7][0-7]?|u[0-9A-Fa-f]{4}|.|\r?\n?$)/ + TypeError + ); + codes2.ERR_INVALID_PACKAGE_CONFIG = createError( + "ERR_INVALID_PACKAGE_CONFIG", + /** + * @param {string} path + * @param {string} [base] + * @param {string} [message] + */ + (path26, base, message) => { + return `Invalid package config ${path26}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`; }, - braces: { - patterns: [ - { - begin: "(", - end: ")", - captures: "punctuation.meta.brace.ts", - patterns: ["#statements"], - name: "meta.brace.ts", - contentName: "code.ts" - }, - { - begin: "{", - end: "}", - captures: "punctuation.meta.brace.ts", - patterns: ["#statements"], - name: "meta.brace.ts", - contentName: "code.ts" - }, - { - begin: "[", - end: "]", - captures: "punctuation.meta.brace.ts", - patterns: ["#statements"], - name: "meta.brace.ts", - contentName: "code.ts" - } - ] + Error + ); + codes2.ERR_INVALID_PACKAGE_TARGET = createError( + "ERR_INVALID_PACKAGE_TARGET", + /** + * @param {string} pkgPath + * @param {string} key + * @param {unknown} target + * @param {boolean} [isImport=false] + * @param {string} [base] + */ + (pkgPath, key, target, isImport = false, base = void 0) => { + const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./"); + if (key === ".") { + (0, import_node_assert.default)(isImport === false); + return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`; + } + return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify( + target + )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`; }, - punctuation: { - name: "punctuation.ts", - match: /[-;:,!|&^%*/+=<>\n\r]/ + Error + ); + codes2.ERR_MODULE_NOT_FOUND = createError( + "ERR_MODULE_NOT_FOUND", + /** + * @param {string} path + * @param {string} base + * @param {string} [type] + */ + (path26, base, type = "package") => { + return `Cannot find ${type} '${path26}' imported from ${base}`; }, - space: { - name: "punctuation.space.ts", - match: /\s+/ + Error + ); + codes2.ERR_NETWORK_IMPORT_DISALLOWED = createError( + "ERR_NETWORK_IMPORT_DISALLOWED", + "import of '%s' by %s is not supported: %s", + Error + ); + codes2.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError( + "ERR_PACKAGE_IMPORT_NOT_DEFINED", + /** + * @param {string} specifier + * @param {string} packagePath + * @param {string} base + */ + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`; }, - comment: { - patterns: [ - { - name: "comment.line.ts", - comment: "line comment", - begin: "//", - end: /(?=$)/, - captures: "punctuation.definition.comment.ts" - }, - { - name: "comment.block.documentation.ts", - comment: "DocBlock", - begin: /\/\*\*(?!\/)/, - captures: "punctuation.definition.comment.ts", - end: "*/" - }, - { - name: "comment.block.ts", - begin: "/*", - end: "*/", - captures: "punctuation.definition.comment.ts" - } - ] + TypeError + ); + codes2.ERR_PACKAGE_PATH_NOT_EXPORTED = createError( + "ERR_PACKAGE_PATH_NOT_EXPORTED", + /** + * @param {string} pkgPath + * @param {string} subpath + * @param {string} [base] + */ + (pkgPath, subpath, base = void 0) => { + if (subpath === ".") + return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; + return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; }, - regexp: { - name: "regexp.ts", - begin: /\/(?![/*])/, - end: /\/([a-z]*)/i, - beginCaptures: "punctuation.begin.regexp.ts", - endCaptures: "punctuation.end.regexp.ts", - patterns: ["#regexp_escape", "#regexp_brace"] + Error + ); + codes2.ERR_UNSUPPORTED_DIR_IMPORT = createError( + "ERR_UNSUPPORTED_DIR_IMPORT", + "Directory import '%s' is not supported resolving ES modules imported from %s", + Error + ); + codes2.ERR_UNKNOWN_FILE_EXTENSION = createError( + "ERR_UNKNOWN_FILE_EXTENSION", + /** + * @param {string} ext + * @param {string} path + */ + (ext, path26) => { + return `Unknown file extension "${ext}" for ${path26}`; }, - regexp_escape: { - name: "escape.regexp.ts", - match: /\\./ + TypeError + ); + codes2.ERR_INVALID_ARG_VALUE = createError( + "ERR_INVALID_ARG_VALUE", + /** + * @param {string} name + * @param {unknown} value + * @param {string} [reason='is invalid'] + */ + (name, value, reason = "is invalid") => { + let inspected = (0, import_node_util.inspect)(value); + if (inspected.length > 128) { + inspected = `${inspected.slice(0, 128)}...`; + } + const type = name.includes(".") ? "property" : "argument"; + return `The ${type} '${name}' ${reason}. Received ${inspected}`; }, - regexp_brace: { - name: "brace.regexp.ts", - begin: "[", - end: "]", - contentName: "character-class.regexp.ts", - patterns: ["#regexp_escape"] - } - }; - exports.grammar = { - name: "TypeScript", - scopeName: "source.ts", - patterns: [ - { - name: "comment.line.shebang.ts", - match: /^#!.*(?=$)/ - }, - { - include: "#statements" + TypeError + // Note: extra classes have been shaken out. + // , RangeError + ); + codes2.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError( + "ERR_UNSUPPORTED_ESM_URL_SCHEME", + /** + * @param {URL} url + * @param {Array} supported + */ + (url, supported) => { + let message = `Only URLs with a scheme in: ${formatList( + supported + )} are supported by the default ESM loader`; + if (isWindows && url.protocol.length === 2) { + message += ". On Windows, absolute paths must be valid file:// URLs"; } - ], - repository - }; - } -}); - -// node_modules/cspell-grammar/dist/cjs/mappers/appendMappedText.js -var require_appendMappedText = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/mappers/appendMappedText.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.appendMappedText = void 0; - var assert_1 = __importDefault(require("assert")); - function appendMappedText(a, b) { - if (!a.map && !b.map) { - return { text: a.text + b.text }; - } - const aLen = a.text.length; - const bLen = b.text.length; - const aMap = [0, 0].concat(a.map || [0, 0, aLen, aLen]); - const bMap = [0, 0].concat(b.map || [0, 0, bLen, bLen]); - (0, assert_1.default)(aMap[aMap.length - 1] === aLen); - (0, assert_1.default)(bMap[bMap.length - 1] === bLen); - (0, assert_1.default)((aMap.length & 1) === 0); - (0, assert_1.default)((bMap.length & 1) === 0); - return { - text: a.text + b.text, - map: joinMaps(aMap, bMap) - }; - } - exports.appendMappedText = appendMappedText; - function joinMaps(aMap, bMap) { - const n = aMap.length - 1; - const offsets = [aMap[n - 1], aMap[n]]; - const ab = aMap.concat(bMap.map((v, i) => v + offsets[i & 1])); - const r = [0, 0]; - let last0 = 0, last1 = 0; - for (let i = 0; i < ab.length; i += 2) { - const v0 = ab[i]; - const v12 = ab[i + 1]; - if (v0 === last0 && v12 === last1) { - continue; + message += `. Received protocol '${url.protocol}'`; + return message; + }, + Error + ); + captureLargerStackTrace = hideStackFrames( + /** + * @param {Error} error + * @returns {Error} + */ + // @ts-expect-error: fine + function(error2) { + const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); + if (stackTraceLimitIsWritable) { + userStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Number.POSITIVE_INFINITY; } - r.push(v0, v12); - last0 = v0; - last1 = v12; + Error.captureStackTrace(error2); + if (stackTraceLimitIsWritable) + Error.stackTraceLimit = userStackTraceLimit; + return error2; } - return r; - } + ); } }); -// node_modules/cspell-grammar/dist/cjs/mappers/typescript.js -var require_typescript2 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/mappers/typescript.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mapRawString = void 0; - var hexChars = { - "0": 0, - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "9": 9, - A: 10, - B: 11, - C: 12, - D: 13, - E: 14, - F: 15, - a: 10, - b: 11, - c: 12, - d: 13, - e: 14, - f: 15 - }; - var escapeChars = { - t: " ", - n: "\n", - r: "\r", - b: "\b", - "\\": "\\", - '"': '"', - "'": "'", - "\n": "" - }; - function mapRawString(text) { - const end = text.length; - let t = ""; - const map = []; - const isHex = /^[0-9a-fA-F]+$/; - let i, j; - for (i = 0, j = 0; i < end; ++i) { - let parsed; - const ti = text[i]; - if (ti === "\\") { - map.push(i, j); - const tc = text[++i]; - const ec = escapeChars[tc]; - if (ec) { - t += ec; - j += ec.length; - map.push(i, j); - continue; - } - switch (tc) { - case "u": - { - let char; - let end2; - if (text[i + 1] !== "{") { - const digits = text.slice(i + 1, i + 5); - parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; - char = isNaN(parsed) ? "" : String.fromCharCode(parsed); - end2 = i + 4; - } else { - for (end2 = i + 2; text[end2] in hexChars; ++end2) { - } - if (text[end2] !== "}") { - char = ""; - } else { - const digits = text.slice(i + 2, end2); - parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; - char = isNaN(parsed) ? "" : String.fromCodePoint(parsed); - } - } - if (!char) { - t += tc; - j += 1; - } else { - t += char; - j += char.length; - i = end2; - } - } - break; - case "x": - { - const digits = text.slice(i + 1, i + 3); - parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; - if (isNaN(parsed)) { - t += tc; - j += 1; - } else { - t += String.fromCharCode(parsed); - i += 2; - ++j; - } - } - break; - case "0": - t += "0"; - j += 1; - break; - case "\r": - i += text[i + 1] === "\n" ? 1 : 0; - break; - case "\n": - break; - case void 0: - break; - default: - t += tc; - ++j; - break; - } - map.push(i + 1, j); - continue; - } - t += ti; - ++j; - } - if (map.length) { - const ii = map[map.length - 2]; - const jj = map[map.length - 1]; - if (ii !== i || jj !== j) { - map.push(i, j); - } - } - return { - text: t, - map - }; - } - exports.mapRawString = mapRawString; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/parser.js -var require_parser2 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/parser.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createParser = exports.parseDocument = void 0; - var sync_1 = require_sync(); - var tokenizeLine_js_1 = require_tokenizeLine(); - function parseDocument(grammar, _filename, content, emitter = (line) => console.log(line)) { - const r = (0, tokenizeLine_js_1.tokenizeText)(content, grammar); - const tokens = (0, sync_1.pipe)(r, (0, sync_1.opMap)((tl) => tl.tokens.map((t) => ({ t, l: tl.line }))), (0, sync_1.opFlatten)(), (0, sync_1.opFilter)((t) => !t.t.scope.value.startsWith("punctuation"))); - for (const { t: token, l: line } of tokens) { - emitter(`${(token.range[2] ?? line.lineNumber) + 1}:${token.range[0] + 1} ${JSON.stringify(token.text)} ${token.scope.toString()}`); - } - } - exports.parseDocument = parseDocument; - function mapTokenizedLine(tl) { - return tl.tokens.map((t) => ({ - text: t.text, - range: [tl.offset + t.range[0], tl.offset + t.range[1]], - scope: t.scope - })); - } - function mapTokenizedLines(itl) { - return (0, sync_1.pipe)(itl, (0, sync_1.opMap)(mapTokenizedLine), (0, sync_1.opFlatten)()); - } - function createParser(grammar, name, transform = mapTokenizedLines) { - function parse3(content, filename) { - const parsedTexts = (0, sync_1.pipe)((0, tokenizeLine_js_1.tokenizeTextIterable)(content, grammar), transform); - return { content, filename, parsedTexts }; - } - return { name, parse: parse3 }; - } - exports.createParser = createParser; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parsers/typescript/TypeScriptParser.js -var require_TypeScriptParser = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parsers/typescript/TypeScriptParser.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parser = void 0; - var sync_1 = require_sync(); - var typescript_js_1 = require_typescript(); - var appendMappedText_js_1 = require_appendMappedText(); - var typescript_js_2 = require_typescript2(); - var grammar_js_1 = require_grammar(); - var parser_js_1 = require_parser2(); - var scope_js_1 = require_scope(); - var tsGrammar = (0, grammar_js_1.compileGrammar)(typescript_js_1.grammar); - var pool = new scope_js_1.ScopePool(); - var useScope = /* @__PURE__ */ new WeakMap(); - function* transform(texts) { - for (const parsed of texts) { - if (doesScopeMatch(parsed.scope, "constant.character.escape.ts")) { - const mapped = (0, typescript_js_2.mapRawString)(parsed.text); - const scope = parsed.scope ? pool.parseScope(parsed.scope) : void 0; - yield { - text: mapped.text, - scope: scope?.parent, - map: mapped.map, - range: parsed.range - }; - continue; - } - yield parsed; - } - } - function* mergeStringResults(results) { - let last; - for (const next of results) { - if (!doesScopeMatch(next.scope, "string.")) { - if (last) { - yield last; - last = void 0; - } - yield next; - continue; - } - if (!last) { - last = next; - continue; - } - if (next.scope !== last.scope || last.range[1] !== next.range[0]) { - yield last; - last = next; - continue; - } - last = mergeParsedText(last, next); - } - if (last) - yield last; - } - function mergeParsedText(a, b) { - const abT = (0, appendMappedText_js_1.appendMappedText)(a, b); - const ab = { - text: abT.text, - scope: a.scope, - range: [a.range[0], b.range[1]], - map: abT.map, - delegate: a.delegate - }; - return ab; - } - function filterScope(scope) { - const cached = useScope.get(scope); - if (cached !== void 0) - return cached; - const value = scope.value; - const use = !value.startsWith("punctuation") && !value.startsWith("keyword."); - useScope.set(scope, use); - return use; - } - function mapTokenizedLine(tl) { - return tl.tokens.filter((t) => filterScope(t.scope)).map((t) => ({ - text: t.text, - range: [tl.offset + t.range[0], tl.offset + t.range[1]], - scope: t.scope - })); - } - function mapTokenizedLines(itl) { - return (0, sync_1.pipe)(itl, (0, sync_1.opMap)(mapTokenizedLine), (0, sync_1.opFlatten)(), transform, mergeStringResults); - } - exports.parser = (0, parser_js_1.createParser)(tsGrammar, "typescript", mapTokenizedLines); - function doesScopeMatch(s, match) { - if (!s) - return false; - return typeof s === "string" ? s.startsWith(match) : s.value.startsWith(match); +// node_modules/import-meta-resolve/lib/package-json-reader.js +function read(jsonPath) { + try { + const string = import_node_fs2.default.readFileSync( + import_node_path3.default.toNamespacedPath(import_node_path3.default.join(import_node_path3.default.dirname(jsonPath), "package.json")), + "utf8" + ); + return { string }; + } catch (error2) { + const exception = ( + /** @type {ErrnoException} */ + error2 + ); + if (exception.code === "ENOENT") { + return { string: void 0 }; } + throw exception; } -}); - -// node_modules/cspell-grammar/dist/cjs/parsers/typescript/index.js -var require_typescript3 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parsers/typescript/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parser = void 0; - var TypeScriptParser_js_1 = require_TypeScriptParser(); - Object.defineProperty(exports, "parser", { enumerable: true, get: function() { - return TypeScriptParser_js_1.parser; - } }); +} +var import_node_fs2, import_node_path3, reader, package_json_reader_default; +var init_package_json_reader = __esm({ + "node_modules/import-meta-resolve/lib/package-json-reader.js"() { + import_node_fs2 = __toESM(require("node:fs"), 1); + import_node_path3 = __toESM(require("node:path"), 1); + reader = { read }; + package_json_reader_default = reader; } }); -// node_modules/cspell-grammar/dist/cjs/parsers/index.js -var require_parsers = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parsers/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parsers = void 0; - var index_js_1 = require_typescript3(); - exports.parsers = [index_js_1.parser]; +// node_modules/import-meta-resolve/lib/package-config.js +function getPackageConfig(path26, specifier, base) { + const existing = packageJsonCache.get(path26); + if (existing !== void 0) { + return existing; } -}); - -// node_modules/cspell-grammar/dist/cjs/index.js -var require_cjs6 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parsers = exports.tokenizeText = exports.tokenizeLine = exports.compileGrammar = void 0; - var index_js_1 = require_parser(); - Object.defineProperty(exports, "compileGrammar", { enumerable: true, get: function() { - return index_js_1.compileGrammar; - } }); - Object.defineProperty(exports, "tokenizeLine", { enumerable: true, get: function() { - return index_js_1.tokenizeLine; - } }); - Object.defineProperty(exports, "tokenizeText", { enumerable: true, get: function() { - return index_js_1.tokenizeText; - } }); - var index_js_2 = require_parsers(); - Object.defineProperty(exports, "parsers", { enumerable: true, get: function() { - return index_js_2.parsers; - } }); + const source = package_json_reader_default.read(path26).string; + if (source === void 0) { + const packageConfig2 = { + pjsonPath: path26, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJsonCache.set(path26, packageConfig2); + return packageConfig2; } -}); - -// node_modules/cspell-lib/dist/lib-cjs/pkg-info.cjs -var require_pkg_info = __commonJS({ - "node_modules/cspell-lib/dist/lib-cjs/pkg-info.cjs"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.srcDirectory = void 0; - exports.srcDirectory = __dirname; + let packageJson; + try { + packageJson = JSON.parse(source); + } catch (error2) { + const exception = ( + /** @type {ErrnoException} */ + error2 + ); + throw new ERR_INVALID_PACKAGE_CONFIG( + path26, + (base ? `"${specifier}" from ` : "") + (0, import_node_url3.fileURLToPath)(base || specifier), + exception.message + ); } -}); - -// node_modules/cspell-lib/dist/lib-cjs/index.cjs -var require_lib_cjs = __commonJS({ - "node_modules/cspell-lib/dist/lib-cjs/index.cjs"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.srcDirectory = void 0; - var pkg_info_cjs_1 = require_pkg_info(); - Object.defineProperty(exports, "srcDirectory", { enumerable: true, get: function() { - return pkg_info_cjs_1.srcDirectory; - } }); + const { exports, imports, main, name, type } = packageJson; + const packageConfig = { + pjsonPath: path26, + exists: true, + main: typeof main === "string" ? main : void 0, + name: typeof name === "string" ? name : void 0, + type: type === "module" || type === "commonjs" ? type : "none", + // @ts-expect-error Assume `Record`. + exports, + // @ts-expect-error Assume `Record`. + imports: imports && typeof imports === "object" ? imports : void 0 + }; + packageJsonCache.set(path26, packageConfig); + return packageConfig; +} +function getPackageScopeConfig(resolved) { + let packageJsonUrl = new import_node_url3.URL("package.json", resolved); + while (true) { + const packageJsonPath2 = packageJsonUrl.pathname; + if (packageJsonPath2.endsWith("node_modules/package.json")) + break; + const packageConfig2 = getPackageConfig( + (0, import_node_url3.fileURLToPath)(packageJsonUrl), + resolved + ); + if (packageConfig2.exists) + return packageConfig2; + const lastPackageJsonUrl = packageJsonUrl; + packageJsonUrl = new import_node_url3.URL("../package.json", packageJsonUrl); + if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname) + break; } -}); - -// node_modules/cspell-lib/dist/cjs/Models/PatternRegExp.js -var require_PatternRegExp = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Models/PatternRegExp.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PatternRegExp = void 0; - var PatternRegExp = class extends RegExp { - constructor(pattern) { - super(pattern); - } - toJSON() { - return this.toString(); - } - }; - exports.PatternRegExp = PatternRegExp; + const packageJsonPath = (0, import_node_url3.fileURLToPath)(packageJsonUrl); + const packageConfig = { + pjsonPath: packageJsonPath, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJsonCache.set(packageJsonPath, packageConfig); + return packageConfig; +} +var import_node_url3, ERR_INVALID_PACKAGE_CONFIG, packageJsonCache; +var init_package_config = __esm({ + "node_modules/import-meta-resolve/lib/package-config.js"() { + import_node_url3 = require("node:url"); + init_errors(); + init_package_json_reader(); + ({ ERR_INVALID_PACKAGE_CONFIG } = codes2); + packageJsonCache = /* @__PURE__ */ new Map(); } }); -// node_modules/cspell-lib/dist/cjs/Settings/LanguageSettings.js -var require_LanguageSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/LanguageSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.calcSettingsForLanguageId = exports.calcUserSettingsForLanguage = exports.calcSettingsForLanguage = exports.isValidLocaleIntlFormat = exports.isLocaleInSet = exports.normalizeLocaleIntl = exports.normalizeLocale = exports.normalizeLanguageId = exports.getDefaultLanguageSettings = void 0; - var AutoResolve_js_1 = require_AutoResolve(); - var util_js_1 = require_util(); - var SpellSettings = __importStar(require_CSpellSettingsServer()); - var defaultLocale = "en"; - var defaultLanguageSettings = []; - function getDefaultLanguageSettings() { - return defaultLanguageSettings; - } - exports.getDefaultLanguageSettings = getDefaultLanguageSettings; - function localesToList(locales) { - return stringToList(locales.replace(/\s+/g, ",")); - } - function stringToList(sList) { - return sList.replace(/[|;]/g, ",").split(",").map((s) => s.trim()).filter((s) => !!s); - } - function memorizer(resolver) { - const cache = (0, AutoResolve_js_1.createAutoResolveCache)(); - return (k) => cache.get(k, resolver); - } - var _normalizeLanguageId = memorizer(__normalizeLanguageId); - function __normalizeLanguageId(langId) { - const langIds = stringToList(langId); - return new Set(langIds.map((a) => a.toLowerCase())); - } - function normalizeLanguageId(langId) { - return _normalizeLanguageId(typeof langId === "string" ? langId : langId.join(",")); - } - exports.normalizeLanguageId = normalizeLanguageId; - var _normalizeLocale = memorizer(__normalizeLocale); - function __normalizeLocale(locale) { - const locales = localesToList(locale); - return new Set(locales.map((locale2) => locale2.toLowerCase().replace(/[^a-z]/g, ""))); - } - function normalizeLocale(locale) { - locale = typeof locale === "string" ? locale : locale.join(","); - return _normalizeLocale(locale); - } - exports.normalizeLocale = normalizeLocale; - function normalizeLocaleIntl(locale) { - const values = [...normalizeLocale(locale)].map((locale2) => locale2.replace(/^([a-z]{2})-?([a-z]{2})$/, (_, lang, locale3) => locale3 ? `${lang}-${locale3.toUpperCase()}` : lang)); - return new Set(values); - } - exports.normalizeLocaleIntl = normalizeLocaleIntl; - function isLocaleInSet(locale, setOfLocals) { - const locales = normalizeLocale(locale); - return (0, util_js_1.doSetsIntersect)(locales, setOfLocals); - } - exports.isLocaleInSet = isLocaleInSet; - var regExpValidIntlLocaleStrict = /^[a-z]{2}(-[A-Z]{2})?$/; - var regExpValidIntlLocale = new RegExp(regExpValidIntlLocaleStrict, "i"); - function isValidLocaleIntlFormat(locale, strict = false) { - if (typeof locale === "string") - return strict ? regExpValidIntlLocaleStrict.test(locale) : regExpValidIntlLocale.test(locale); - for (const item of locale) { - if (!isValidLocaleIntlFormat(item, strict)) - return false; - } - return locale.length > 0; - } - exports.isValidLocaleIntlFormat = isValidLocaleIntlFormat; - var cacheCalcSettingsForLanguage = /* @__PURE__ */ new WeakMap(); - function calcSettingsForLanguage(languageSettings, languageId, locale) { - const mapLang = (0, AutoResolve_js_1.autoResolveWeak)(cacheCalcSettingsForLanguage, languageSettings, () => /* @__PURE__ */ new Map()); - const mapLocale = (0, AutoResolve_js_1.autoResolve)(mapLang, languageId, () => /* @__PURE__ */ new Map()); - return (0, AutoResolve_js_1.autoResolve)(mapLocale, locale, () => _calcSettingsForLanguage(languageSettings, languageId, locale)); - } - exports.calcSettingsForLanguage = calcSettingsForLanguage; - function _calcSettingsForLanguage(languageSettings, languageId, locale) { - languageId = languageId.toLowerCase(); - const allowedLocals = normalizeLocale(locale); - const ls = languageSettings.filter((s) => doesLanguageSettingMatchLanguageId(s, languageId)).filter((s) => !s.locale || s.locale === "*" || isLocaleInSet(s.locale, allowedLocals)).map((langSetting) => { - const { languageId: _languageId, locale: _locale, ...s } = langSetting; - return s; - }).reduce((langSetting, setting) => SpellSettings.mergeSettings(langSetting, setting), {}); - ls.languageId = languageId; - ls.locale = locale; - return ls; - } - var cacheDoesLanguageSettingMatchLanguageId = /* @__PURE__ */ new WeakMap(); - function doesLanguageSettingMatchLanguageId(s, languageId) { - const r = cacheDoesLanguageSettingMatchLanguageId.get(s) ?? /* @__PURE__ */ new Map(); - const f = r.get(languageId); - if (f !== void 0) { - return f; - } - const v = _doesLanguageSettingMatchLanguageId(s, languageId); - r.set(languageId, v); - cacheDoesLanguageSettingMatchLanguageId.set(s, r); - return v; - } - function _doesLanguageSettingMatchLanguageId(s, languageId) { - const languageSettingsLanguageIds = s.languageId; - if (!languageSettingsLanguageIds || languageSettingsLanguageIds === "*") - return true; - const ids = normalizeLanguageId(languageSettingsLanguageIds); - if (ids.has(languageId)) - return true; - if (ids.has("!" + languageId)) - return false; - const numExcludes = [...ids].filter((id) => id.startsWith("!")).length; - return numExcludes === ids.size; - } - function calcUserSettingsForLanguage(settings, languageId) { - const { languageSettings = [], language: locale = defaultLocale, allowCompoundWords, enabled } = settings; - const langSettings = { - allowCompoundWords, - enabled, - ...calcSettingsForLanguage(languageSettings, languageId, locale) - }; - return SpellSettings.mergeSettings(settings, langSettings); - } - exports.calcUserSettingsForLanguage = calcUserSettingsForLanguage; - function calcSettingsForLanguageId(baseSettings, languageId) { - const langIds = ["*", ...normalizeLanguageId(languageId)]; - const langSettings = langIds.reduce((settings, languageId2) => { - return calcUserSettingsForLanguage(settings, languageId2); - }, baseSettings); - return langSettings; - } - exports.calcSettingsForLanguageId = calcSettingsForLanguageId; +// node_modules/import-meta-resolve/lib/resolve-get-package-type.js +function getPackageType(url) { + const packageConfig = getPackageScopeConfig(url); + return packageConfig.type; +} +var init_resolve_get_package_type = __esm({ + "node_modules/import-meta-resolve/lib/resolve-get-package-type.js"() { + init_package_config(); } }); -// node_modules/cspell-lib/dist/cjs/Settings/RegExpPatterns.js -var require_RegExpPatterns = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/RegExpPatterns.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.regExHashStrings = exports.regExSha = exports.regExRepeatedChar = exports.regExEmail = exports.rexExPythonStyleComments = exports.regExCStyleComments = exports.regExString = exports.regExPhpHereDoc = exports.regExBase64MultiLine = exports.regExBase64SingleLine = exports.regExBase64 = exports.regExEscapeCharacters = exports.regExSshRSA = exports.regExCert = exports.regExPublicKey = exports.regExIgnoreSpellingDirectives = exports.regExSpellingGuardLine = exports.regExSpellingGuardNext = exports.regExSpellingGuardBlock = exports.regExUnicodeRef = exports.regExUUID = exports.regExCSSHexValue = exports.regExCStyleHexValue = exports.regExCommitHashLink = exports.regExCommitHash = exports.regExMatchCommonHexFormats = exports.regExHRef = exports.regExMatchUrls = void 0; - exports.regExMatchUrls = /(?:https?|ftp):\/\/[^\s"]+/gi; - exports.regExHRef = /\bhref\s*=\s*".*?"/gi; - exports.regExMatchCommonHexFormats = /(?:#[0-9a-f]{3,8})|(?:0x[0-9a-f]+)|(?:\\u[0-9a-f]{4})|(?:\\x\{[0-9a-f]{4}\})/gi; - exports.regExCommitHash = /\b(?![a-f]+\b)(?:0x)?[0-9a-f]{7,}\b/gi; - exports.regExCommitHashLink = /\[[0-9a-f]{7,}\]/gi; - exports.regExCStyleHexValue = /\b0x[0-9a-f]+\b/gi; - exports.regExCSSHexValue = /#[0-9a-f]{3,8}\b/gi; - exports.regExUUID = /\b[0-9a-fx]{8}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{12}\b/gi; - exports.regExUnicodeRef = /\bU\+[0-9a-f]{4,5}(?:-[0-9a-f]{4,5})?/gi; - exports.regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b(?!-)[\s\S]*?((?:\1\s*enable\b)|$)/gi; - exports.regExSpellingGuardNext = /\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi; - exports.regExSpellingGuardLine = /^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim; - exports.regExIgnoreSpellingDirectives = /\bc?spell(?:-?checker)?::?\s*ignoreRegExp.*/gim; - exports.regExPublicKey = /-{5}BEGIN\s+((?:RSA\s+)?PUBLIC\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g; - exports.regExCert = /-{5}BEGIN\s+(CERTIFICATE|(?:RSA\s+)?(?:PRIVATE|PUBLIC)\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g; - exports.regExSshRSA = /ssh-rsa\s+[a-z0-9/+]{28,}={0,3}(?![a-z0-9/+=])/gi; - exports.regExEscapeCharacters = /\\(?:[anrvtbf]|[xu][a-f0-9]+)/gi; - exports.regExBase64 = /(??/gi; - exports.regExRepeatedChar = /^(\w)\1{3,}$/i; - exports.regExSha = /\bsha\d+-[a-z0-9+/]{25,}={0,3}/gi; - exports.regExHashStrings = /(?:\b(?:sha\d+|md5|base64|crypt|bcrypt|scrypt|security-token|assertion)[-,:$=]|#code[/])[-\w/+%.]{25,}={0,3}(?:(['"])\s*\+?\s*\1?[-\w/+%.]+={0,3})*(?![-\w/+=%.])/gi; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/DefaultSettings.js -var require_DefaultSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/DefaultSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDefaultBundledSettings = exports.getDefaultSettings = exports._defaultSettings = exports._defaultSettingsBasis = void 0; - var cspell_grammar_1 = require_cjs6(); - var index_cjs_1 = require_lib_cjs(); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var PatternRegExp_js_1 = require_PatternRegExp(); - var resolveFile_js_1 = require_resolveFile(); - var index_js_1 = require_configLoader2(); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var LanguageSettings = __importStar(require_LanguageSettings()); - var RegPat = __importStar(require_RegExpPatterns()); - var defaultConfigFileModuleRef = "@cspell/cspell-bundled-dicts/cspell-default.json"; - var defaultConfigFile = resolveConfigModule(defaultConfigFileModuleRef); - var regExpSpellCheckerDisable = [ - new PatternRegExp_js_1.PatternRegExp(RegPat.regExSpellingGuardBlock), - new PatternRegExp_js_1.PatternRegExp(RegPat.regExSpellingGuardLine), - new PatternRegExp_js_1.PatternRegExp(RegPat.regExSpellingGuardNext) - ]; - var predefinedPatterns = [ - // Exclude patterns - { name: "CommitHash", pattern: RegPat.regExCommitHash }, - { name: "CommitHashLink", pattern: RegPat.regExCommitHashLink }, - { name: "CStyleHexValue", pattern: RegPat.regExCStyleHexValue }, - { name: "CSSHexValue", pattern: RegPat.regExCSSHexValue }, - { name: "Urls", pattern: RegPat.regExMatchUrls }, - { name: "HexValues", pattern: RegPat.regExMatchCommonHexFormats }, - { name: "SpellCheckerDisable", pattern: regExpSpellCheckerDisable }, - { name: "PublicKey", pattern: RegPat.regExPublicKey }, - { name: "RsaCert", pattern: RegPat.regExCert }, - { name: "SshRsa", pattern: RegPat.regExSshRSA }, - { name: "EscapeCharacters", pattern: RegPat.regExEscapeCharacters }, - { name: "Base64", pattern: RegPat.regExBase64 }, - { name: "Base64SingleLine", pattern: RegPat.regExBase64SingleLine }, - { name: "Base64MultiLine", pattern: RegPat.regExBase64MultiLine }, - { name: "Email", pattern: RegPat.regExEmail }, - { name: "SHA", pattern: RegPat.regExSha }, - { name: "HashStrings", pattern: RegPat.regExHashStrings }, - { name: "UnicodeRef", pattern: RegPat.regExUnicodeRef }, - { name: "UUID", pattern: RegPat.regExUUID }, - { name: "href", pattern: RegPat.regExHRef }, - { name: "SpellCheckerDisableBlock", pattern: RegPat.regExSpellingGuardBlock }, - { name: "SpellCheckerDisableLine", pattern: RegPat.regExSpellingGuardLine }, - { name: "SpellCheckerDisableNext", pattern: RegPat.regExSpellingGuardNext }, - { name: "SpellCheckerIgnoreInDocSetting", pattern: RegPat.regExIgnoreSpellingDirectives }, - // Include Patterns - { name: "PhpHereDoc", pattern: RegPat.regExPhpHereDoc }, - { name: "string", pattern: RegPat.regExString }, - { name: "CStyleComment", pattern: RegPat.regExCStyleComments }, - { name: "Everything", pattern: ".*" } - ]; - var defaultRegExpPatterns = [...predefinedPatterns].map(normalizePattern2); - var definedDefaultRegExpExcludeList = [ - "SpellCheckerDisable", - "SpellCheckerIgnoreInDocSetting", - "Urls", - "Email", - "RsaCert", - "SshRsa", - "Base64MultiLine", - "Base64SingleLine", - "CommitHash", - "CommitHashLink", - "CStyleHexValue", - "CSSHexValue", - "SHA", - "HashStrings", - "UnicodeRef", - "UUID" - ]; - var defaultRegExpExcludeList = definedDefaultRegExpExcludeList; - exports._defaultSettingsBasis = Object.freeze((0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ - id: "static_defaults", - language: "en", - name: "Static Defaults", - enabled: true, - enabledLanguageIds: [], - maxNumberOfProblems: 100, - numSuggestions: 10, - suggestionsTimeout: 500, - suggestionNumChanges: 3, - words: [], - userWords: [], - ignorePaths: [], - allowCompoundWords: false, - patterns: defaultRegExpPatterns, - ignoreRegExpList: [], - languageSettings: [], - source: { name: "defaultSettings" }, - reporters: [], - plugins: [{ parsers: cspell_grammar_1.parsers }] - })); - exports._defaultSettings = Object.freeze((0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ - ...exports._defaultSettingsBasis, - enabledLanguageIds: [ - "ada", - "csharp", - "go", - "javascript", - "javascriptreact", - "json", - "markdown", - "mdx", - "php", - "plaintext", - "python", - "text", - "typescript", - "typescriptreact", - "haskell", - "html", - "css", - "less", - "scss", - "latex", - "ruby", - "rust", - "shellscript", - "toml" - ], - ignoreRegExpList: defaultRegExpExcludeList, - languageSettings: LanguageSettings.getDefaultLanguageSettings() - })); - var getSettings = function() { - let settings = void 0; - return function(useDefaultDictionaries) { - if (!useDefaultDictionaries) { - return exports._defaultSettingsBasis; - } - if (!settings) { - const jsonSettings = (0, index_js_1.readSettings)(defaultConfigFile); - settings = (0, CSpellSettingsServer_js_1.mergeSettings)(exports._defaultSettings, jsonSettings); - if (jsonSettings.name !== void 0) { - settings.name = jsonSettings.name; - } else { - delete settings.name; - } - } - return settings; - }; - }(); - function resolveConfigModule(configModuleName) { - return (0, resolveFile_js_1.resolveFile)(configModuleName, index_cjs_1.srcDirectory).filename; - } - function normalizePattern2(pat) { - const { name, pattern, description } = pat; - if (!(pattern instanceof RegExp)) - return pat; - return { - name, - pattern: new PatternRegExp_js_1.PatternRegExp(pattern), - description - }; - } - function getDefaultSettings3(useDefaultDictionaries = true) { - return getSettings(useDefaultDictionaries); +// node_modules/import-meta-resolve/lib/get-format.js +function mimeToFormat(mime) { + if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) + return "module"; + if (mime === "application/json") + return "json"; + return null; +} +function getDataProtocolModuleFormat(parsed) { + const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec( + parsed.pathname + ) || [null, null, null]; + return mimeToFormat(mime); +} +function extname(url) { + const pathname = url.pathname; + let index = pathname.length; + while (index--) { + const code = pathname.codePointAt(index); + if (code === 47) { + return ""; } - exports.getDefaultSettings = getDefaultSettings3; - function getDefaultBundledSettings() { - return getDefaultSettings3(); + if (code === 46) { + return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index); } - exports.getDefaultBundledSettings = getDefaultBundledSettings; } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/index.js -var require_Settings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDefaultSettings = exports.getDefaultBundledSettings = exports.mergeSettings = exports.mergeInDocSettings = exports.getSources = exports.finalizeSettings = exports.extractDependencies = exports.checkFilenameMatchesGlob = exports.calcOverrideSettings = exports.ImportError = exports.sectionCSpell = exports.searchForConfig = exports.readSettingsFiles = exports.readSettings = exports.readRawSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfig = exports.getGlobalSettings = exports.getCachedFileSize = exports.extractImportErrors = exports.defaultFileName = exports.defaultConfigFilenames = exports.clearCachedSettingsFiles = exports.ENV_CSPELL_GLOB_ROOT = exports.currentSettingsFileVersion = void 0; - var constants_js_1 = require_constants3(); - Object.defineProperty(exports, "currentSettingsFileVersion", { enumerable: true, get: function() { - return constants_js_1.currentSettingsFileVersion; - } }); - Object.defineProperty(exports, "ENV_CSPELL_GLOB_ROOT", { enumerable: true, get: function() { - return constants_js_1.ENV_CSPELL_GLOB_ROOT; - } }); - var index_js_1 = require_configLoader2(); - Object.defineProperty(exports, "clearCachedSettingsFiles", { enumerable: true, get: function() { - return index_js_1.clearCachedSettingsFiles; - } }); - Object.defineProperty(exports, "defaultConfigFilenames", { enumerable: true, get: function() { - return index_js_1.defaultConfigFilenames; - } }); - Object.defineProperty(exports, "defaultFileName", { enumerable: true, get: function() { - return index_js_1.defaultFileName; - } }); - Object.defineProperty(exports, "extractImportErrors", { enumerable: true, get: function() { - return index_js_1.extractImportErrors; - } }); - Object.defineProperty(exports, "getCachedFileSize", { enumerable: true, get: function() { - return index_js_1.getCachedFileSize; - } }); - Object.defineProperty(exports, "getGlobalSettings", { enumerable: true, get: function() { - return index_js_1.getGlobalSettings; - } }); - Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function() { - return index_js_1.loadConfig; - } }); - Object.defineProperty(exports, "loadPnP", { enumerable: true, get: function() { - return index_js_1.loadPnP; - } }); - Object.defineProperty(exports, "loadPnPSync", { enumerable: true, get: function() { - return index_js_1.loadPnPSync; - } }); - Object.defineProperty(exports, "readRawSettings", { enumerable: true, get: function() { - return index_js_1.readRawSettings; - } }); - Object.defineProperty(exports, "readSettings", { enumerable: true, get: function() { - return index_js_1.readSettings; - } }); - Object.defineProperty(exports, "readSettingsFiles", { enumerable: true, get: function() { - return index_js_1.readSettingsFiles; - } }); - Object.defineProperty(exports, "searchForConfig", { enumerable: true, get: function() { - return index_js_1.searchForConfig; - } }); - Object.defineProperty(exports, "sectionCSpell", { enumerable: true, get: function() { - return index_js_1.sectionCSpell; - } }); - var ImportError_js_1 = require_ImportError(); - Object.defineProperty(exports, "ImportError", { enumerable: true, get: function() { - return ImportError_js_1.ImportError; - } }); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - Object.defineProperty(exports, "calcOverrideSettings", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.calcOverrideSettings; - } }); - Object.defineProperty(exports, "checkFilenameMatchesGlob", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.checkFilenameMatchesGlob; - } }); - Object.defineProperty(exports, "extractDependencies", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.extractDependencies; - } }); - Object.defineProperty(exports, "finalizeSettings", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.finalizeSettings; - } }); - Object.defineProperty(exports, "getSources", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.getSources; - } }); - Object.defineProperty(exports, "mergeInDocSettings", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.mergeInDocSettings; - } }); - Object.defineProperty(exports, "mergeSettings", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.mergeSettings; - } }); - var DefaultSettings_js_1 = require_DefaultSettings(); - Object.defineProperty(exports, "getDefaultBundledSettings", { enumerable: true, get: function() { - return DefaultSettings_js_1.getDefaultBundledSettings; - } }); - Object.defineProperty(exports, "getDefaultSettings", { enumerable: true, get: function() { - return DefaultSettings_js_1.getDefaultSettings; - } }); + return ""; +} +function getFileProtocolModuleFormat(url, _context, ignoreErrors) { + const ext = extname(url); + if (ext === ".js") { + return getPackageType(url) === "module" ? "module" : "commonjs"; } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/AutoCache.js -var require_AutoCache = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/AutoCache.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractStats = exports.autoCache = exports.createCache01 = void 0; - var CACHE_SIZE = 100; - var Cache01 = class { - constructor(maxSize) { - this.maxSize = maxSize; - this.count = 0; - this.cache0 = /* @__PURE__ */ Object.create(null); - this.cache1 = /* @__PURE__ */ Object.create(null); - this.hits = 0; - this.misses = 0; - this.swaps = 0; - } - get(key) { - const cache0 = this.cache0; - const cache1 = this.cache1; - if (key in cache0) { - ++this.hits; - return cache0[key]; - } - if (key in cache1) { - ++this.hits; - ++this.count; - const r = cache1[key]; - cache0[key] = r; - return r; - } - ++this.misses; - return void 0; - } - set(key, value) { - if (this.count >= this.maxSize) { - this.cache1 = this.cache0; - this.cache0 = /* @__PURE__ */ Object.create(null); - this.swaps++; - this.count = 0; - } - ++this.count; - this.cache0[key] = value; - return this; - } - }; - function createCache01(size) { - return new Cache01(size); - } - exports.createCache01 = createCache01; - function autoCache(fn, size = CACHE_SIZE) { - const cache = createCache01(size); - const ac = get; - ac.hits = 0; - ac.misses = 0; - ac.swaps = 0; - function get(k) { - const f = cache.get(k); - if (f !== void 0) { - ++ac.hits; - return f; - } - const r = fn(k); - cache.set(k, r); - ac.swaps = cache.swaps; - ++ac.misses; - return r; - } - return ac; - } - exports.autoCache = autoCache; - function extractStats(ac) { - const { hits, misses, swaps } = ac; - return { hits, misses, swaps }; - } - exports.extractStats = extractStats; + const format6 = extensionFormatMap[ext]; + if (format6) + return format6; + if (ignoreErrors) { + return void 0; } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/text.js -var require_text3 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/text.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.removeUnboundAccents = exports.removeAccents = exports.matchCase = exports.lcFirst = exports.ucFirst = exports.isFirstCharacterLower = exports.isFirstCharacterUpper = exports.isLowerCase = exports.isUpperCase = void 0; - var regExFirstUpper = /^\p{Lu}\p{M}?\p{Ll}+$/u; - var regExAllUpper = /^(?:\p{Lu}\p{M}?)+$/u; - var regExAllLower = /^(?:\p{Ll}\p{M}?)+$/u; - var regExAccents = /\p{M}/gu; - function isUpperCase(word) { - return !!word.match(regExAllUpper); - } - exports.isUpperCase = isUpperCase; - function isLowerCase(word) { - return !!word.match(regExAllLower); - } - exports.isLowerCase = isLowerCase; - function isFirstCharacterUpper(word) { - return isUpperCase(word.slice(0, 1)); - } - exports.isFirstCharacterUpper = isFirstCharacterUpper; - function isFirstCharacterLower(word) { - return isLowerCase(word.slice(0, 1)); - } - exports.isFirstCharacterLower = isFirstCharacterLower; - function ucFirst(word) { - return word.slice(0, 1).toUpperCase() + word.slice(1); - } - exports.ucFirst = ucFirst; - function lcFirst(word) { - return word.slice(0, 1).toLowerCase() + word.slice(1); - } - exports.lcFirst = lcFirst; - function matchCase(example, word) { - if (example.match(regExFirstUpper)) { - return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase(); - } - if (example.match(regExAllLower)) { - return word.toLowerCase(); - } - if (example.match(regExAllUpper)) { - return word.toUpperCase(); - } - if (isFirstCharacterUpper(example)) { - return ucFirst(word); - } - if (isFirstCharacterLower(example)) { - return lcFirst(word); - } - return word; - } - exports.matchCase = matchCase; - function removeAccents(text) { - return text.normalize("NFD").replace(regExAccents, ""); - } - exports.removeAccents = removeAccents; - function removeUnboundAccents(text) { - return text.replace(regExAccents, ""); - } - exports.removeUnboundAccents = removeUnboundAccents; + const filepath = (0, import_node_url4.fileURLToPath)(url); + throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath); +} +function getHttpProtocolModuleFormat() { +} +function defaultGetFormatWithoutErrors(url, context) { + if (!hasOwnProperty.call(protocolHandlers, url.protocol)) { + return null; } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryMethods.js -var require_SpellingDictionaryMethods = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryMethods.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testMethods__ = exports.createWeightMapFromDictionaryInformation = exports.suggestArgsToSuggestOptions = exports.canonicalSearchOptions = exports.hasOptionToSearchOption = exports.wordSuggestForms = exports.wordSuggestFormsArray = exports.wordSearchForms = exports.defaultNumSuggestions = exports.suggestionCollector = exports.impersonateCollector = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var text_js_1 = require_text3(); - var cspell_trie_lib_2 = require_cjs5(); - Object.defineProperty(exports, "impersonateCollector", { enumerable: true, get: function() { - return cspell_trie_lib_2.impersonateCollector; - } }); - Object.defineProperty(exports, "suggestionCollector", { enumerable: true, get: function() { - return cspell_trie_lib_2.suggestionCollector; - } }); - exports.defaultNumSuggestions = 10; - function wordSearchFormsArray(word, isDictionaryCaseSensitive, ignoreCase) { - return [...wordSearchForms(word, isDictionaryCaseSensitive, ignoreCase)]; - } - function wordSearchForms(word, isDictionaryCaseSensitive, ignoreCase) { - const forms = /* @__PURE__ */ new Set(); - word = word.normalize("NFC"); - const wordLc = word.toLowerCase(); - if (ignoreCase) { - if (isDictionaryCaseSensitive) { - forms.add(wordLc); - } else { - forms.add(wordLc); - forms.add((0, text_js_1.removeUnboundAccents)(wordLc)); - } - } else { - if (isDictionaryCaseSensitive) { - forms.add(word); - forms.add(wordLc); - if ((0, text_js_1.isUpperCase)(word)) { - forms.add((0, text_js_1.ucFirst)(wordLc)); - } - } else { - forms.add(wordLc); - forms.add((0, text_js_1.removeUnboundAccents)(wordLc)); - } - } - return forms; - } - exports.wordSearchForms = wordSearchForms; - function wordSuggestFormsArray(word) { - return [...wordSuggestForms(word)]; - } - exports.wordSuggestFormsArray = wordSuggestFormsArray; - function wordSuggestForms(word) { - word = word.normalize("NFC"); - const forms = /* @__PURE__ */ new Set([word]); - const wordLc = word.toLowerCase(); - forms.add(wordLc); - return forms; - } - exports.wordSuggestForms = wordSuggestForms; - var DEFAULT_HAS_OPTIONS = Object.freeze({}); - function hasOptionToSearchOption(opt) { - return canonicalSearchOptions(!opt ? DEFAULT_HAS_OPTIONS : opt); - } - exports.hasOptionToSearchOption = hasOptionToSearchOption; - var canonicalSearchOptionsMap = /* @__PURE__ */ new Map(); - var knownCanonicalOptions = /* @__PURE__ */ new WeakMap(); - function canonicalSearchOptions(opt) { - const known = knownCanonicalOptions.get(opt); - if (known) - return known; - const { ignoreCase, useCompounds } = opt; - const foundLevel1Map = canonicalSearchOptionsMap.get(ignoreCase); - const useLevel1Map = foundLevel1Map || /* @__PURE__ */ new Map(); - if (!foundLevel1Map) { - canonicalSearchOptionsMap.set(ignoreCase, useLevel1Map); - } - const foundCanOpts = useLevel1Map.get(useCompounds); - const canOpts = foundCanOpts || Object.freeze({ ignoreCase, useCompounds }); - if (!foundCanOpts) { - useLevel1Map.set(useCompounds, canOpts); - } - knownCanonicalOptions.set(opt, canOpts); - return canOpts; - } - exports.canonicalSearchOptions = canonicalSearchOptions; - function suggestArgsToSuggestOptions(args) { - const [_word, options, compoundMethod, numChanges, ignoreCase] = args; - const suggestOptions = typeof options === "object" ? options : { - numSuggestions: options, - compoundMethod, - numChanges, - ignoreCase - }; - return suggestOptions; - } - exports.suggestArgsToSuggestOptions = suggestArgsToSuggestOptions; - function createWeightMapFromDictionaryInformation(di) { - return di ? (0, cspell_trie_lib_1.mapDictionaryInformationToWeightMap)(di) : void 0; - } - exports.createWeightMapFromDictionaryInformation = createWeightMapFromDictionaryInformation; - exports.__testMethods__ = { - wordSearchForms, - wordSearchFormsArray + return protocolHandlers[url.protocol](url, context, true) || null; +} +var import_node_url4, ERR_UNKNOWN_FILE_EXTENSION, hasOwnProperty, extensionFormatMap, protocolHandlers; +var init_get_format = __esm({ + "node_modules/import-meta-resolve/lib/get-format.js"() { + import_node_url4 = require("node:url"); + init_resolve_get_package_type(); + init_errors(); + ({ ERR_UNKNOWN_FILE_EXTENSION } = codes2); + hasOwnProperty = {}.hasOwnProperty; + extensionFormatMap = { + // @ts-expect-error: hush. + __proto__: null, + ".cjs": "commonjs", + ".js": "module", + ".json": "json", + ".mjs": "module" }; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/CachingDictionary.js -var require_CachingDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/CachingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createCachingDictionary = void 0; - var AutoCache_js_1 = require_AutoCache(); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - var dictionaryCounter = 0; - var DefaultAutoCacheSize = 1e3; - var CachedDict = class { - constructor(dict, options) { - this.dict = dict; - this.options = options; - this.id = ++dictionaryCounter; - this.has = (0, AutoCache_js_1.autoCache)((word) => this.dict.has(word, this.options), DefaultAutoCacheSize); - this.isNoSuggestWord = (0, AutoCache_js_1.autoCache)((word) => this.dict.isNoSuggestWord(word, this.options), DefaultAutoCacheSize); - this.isForbidden = (0, AutoCache_js_1.autoCache)((word) => this.dict.isForbidden(word), DefaultAutoCacheSize); - this.getPreferredSuggestions = (0, AutoCache_js_1.autoCache)((word) => this.dict.getPreferredSuggestions?.(word), DefaultAutoCacheSize); - this.name = dict.name; - } - stats() { - return { - name: this.name, - id: this.id, - has: (0, AutoCache_js_1.extractStats)(this.has), - isNoSuggestWord: (0, AutoCache_js_1.extractStats)(this.isNoSuggestWord), - isForbidden: (0, AutoCache_js_1.extractStats)(this.isForbidden), - getPreferredSuggestions: (0, AutoCache_js_1.extractStats)(this.getPreferredSuggestions) - }; + protocolHandlers = { + // @ts-expect-error: hush. + __proto__: null, + "data:": getDataProtocolModuleFormat, + "file:": getFileProtocolModuleFormat, + "http:": getHttpProtocolModuleFormat, + "https:": getHttpProtocolModuleFormat, + "node:"() { + return "builtin"; } }; - var knownDicts = /* @__PURE__ */ new Map(); - function createCachingDictionary(dict, options) { - options = (0, SpellingDictionaryMethods_js_1.canonicalSearchOptions)(options); - let knownOptions = knownDicts.get(options); - if (!knownOptions) { - knownOptions = /* @__PURE__ */ new WeakMap(); - knownDicts.set(options, knownOptions); - } - const known = knownOptions.get(dict); - if (known) - return known; - const cached = new CachedDict(dict, options); - knownOptions.set(dict, cached); - return cached; - } - exports.createCachingDictionary = createCachingDictionary; } }); -// node_modules/cspell-dictionary/dist/cjs/util/AutoResolve.js -var require_AutoResolve2 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/AutoResolve.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createAutoResolveWeakCache = exports.AutoResolveWeakCache = exports.autoResolveWeak = exports.createAutoResolveCache = exports.AutoResolveCache = exports.autoResolve = void 0; - function autoResolve(map, key, resolve10) { - const found = map.get(key); - if (found !== void 0 || map.has(key)) - return found; - const value = resolve10(key); - map.set(key, value); - return value; - } - exports.autoResolve = autoResolve; - var AutoResolveCache = class { - constructor() { - this.map = /* @__PURE__ */ new Map(); - } - get(k, resolve10) { - return resolve10 ? autoResolve(this.map, k, resolve10) : this.map.get(k); - } - has(k) { - return this.map.has(k); - } - set(k, v) { - this.map.set(k, v); - return this; - } - }; - exports.AutoResolveCache = AutoResolveCache; - function createAutoResolveCache() { - return new AutoResolveCache(); - } - exports.createAutoResolveCache = createAutoResolveCache; - function autoResolveWeak(map, key, resolve10) { - const found = map.get(key); - if (found !== void 0 || map.has(key)) - return found; - const value = resolve10(key); - map.set(key, value); - return value; - } - exports.autoResolveWeak = autoResolveWeak; - var AutoResolveWeakCache = class { - constructor() { - this.map = /* @__PURE__ */ new WeakMap(); - } - get(k, resolve10) { - return resolve10 ? autoResolveWeak(this.map, k, resolve10) : this.map.get(k); - } - has(k) { - return this.map.has(k); - } - set(k, v) { - this.map.set(k, v); - return this; - } - }; - exports.AutoResolveWeakCache = AutoResolveWeakCache; - function createAutoResolveWeakCache() { - return new AutoResolveWeakCache(); +// node_modules/import-meta-resolve/lib/utils.js +function getDefaultConditions() { + return DEFAULT_CONDITIONS; +} +function getDefaultConditionsSet() { + return DEFAULT_CONDITIONS_SET; +} +function getConditionsSet(conditions) { + if (conditions !== void 0 && conditions !== getDefaultConditions()) { + if (!Array.isArray(conditions)) { + throw new ERR_INVALID_ARG_VALUE( + "conditions", + conditions, + "expected an array" + ); } - exports.createAutoResolveWeakCache = createAutoResolveWeakCache; + return new Set(conditions); } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/util.js -var require_util8 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDefined = void 0; - function isDefined2(v) { - return v !== void 0; - } - exports.isDefined = isDefined2; + return getDefaultConditionsSet(); +} +var ERR_INVALID_ARG_VALUE, DEFAULT_CONDITIONS, DEFAULT_CONDITIONS_SET; +var init_utils = __esm({ + "node_modules/import-meta-resolve/lib/utils.js"() { + init_errors(); + ({ ERR_INVALID_ARG_VALUE } = codes2); + DEFAULT_CONDITIONS = Object.freeze(["node", "import"]); + DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS); } }); -// node_modules/fast-equals/dist/fast-equals.cjs.js -var require_fast_equals_cjs = __commonJS({ - "node_modules/fast-equals/dist/fast-equals.cjs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - function createDefaultIsNestedEqual(comparator) { - return function isEqual(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, meta) { - return comparator(a, b, meta); - }; - } - function createIsCircular(areItemsEqual) { - return function isCircular(a, b, isEqual, cache) { - if (!a || !b || typeof a !== "object" || typeof b !== "object") { - return areItemsEqual(a, b, isEqual, cache); - } - var cachedA = cache.get(a); - var cachedB = cache.get(b); - if (cachedA && cachedB) { - return cachedA === b && cachedB === a; - } - cache.set(a, b); - cache.set(b, a); - var result = areItemsEqual(a, b, isEqual, cache); - cache.delete(a); - cache.delete(b); - return result; - }; +// node_modules/import-meta-resolve/lib/resolve.js +function emitInvalidSegmentDeprecation(target, request, match2, packageJsonUrl, internal, base, isTarget) { + const pjsonPath = (0, import_node_url5.fileURLToPath)(packageJsonUrl); + const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null; + import_node_process4.default.emitWarning( + `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match2 ? "" : `matched to "${match2}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, import_node_url5.fileURLToPath)(base)}` : ""}.`, + "DeprecationWarning", + "DEP0166" + ); +} +function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) { + const format6 = defaultGetFormatWithoutErrors(url, { parentURL: base.href }); + if (format6 !== "module") + return; + const path26 = (0, import_node_url5.fileURLToPath)(url.href); + const pkgPath = (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)); + const basePath = (0, import_node_url5.fileURLToPath)(base); + if (main) + import_node_process4.default.emitWarning( + `Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, excluding the full filename and extension to the resolved file at "${path26.slice( + pkgPath.length + )}", imported from ${basePath}. + Automatic extension resolution of the "main" field isdeprecated for ES modules.`, + "DeprecationWarning", + "DEP0151" + ); + else + import_node_process4.default.emitWarning( + `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path26.slice( + pkgPath.length + )}", imported from ${basePath}. +Default "index" lookups for the main are deprecated for ES modules.`, + "DeprecationWarning", + "DEP0151" + ); +} +function tryStatSync(path26) { + try { + return (0, import_node_fs3.statSync)(path26); + } catch { + return new import_node_fs3.Stats(); + } +} +function fileExists(url) { + const stats = (0, import_node_fs3.statSync)(url, { throwIfNoEntry: false }); + const isFile2 = stats ? stats.isFile() : void 0; + return isFile2 === null || isFile2 === void 0 ? false : isFile2; +} +function legacyMainResolve(packageJsonUrl, packageConfig, base) { + let guess; + if (packageConfig.main !== void 0) { + guess = new import_node_url5.URL(packageConfig.main, packageJsonUrl); + if (fileExists(guess)) + return guess; + const tries2 = [ + `./${packageConfig.main}.js`, + `./${packageConfig.main}.json`, + `./${packageConfig.main}.node`, + `./${packageConfig.main}/index.js`, + `./${packageConfig.main}/index.json`, + `./${packageConfig.main}/index.node` + ]; + let i2 = -1; + while (++i2 < tries2.length) { + guess = new import_node_url5.URL(tries2[i2], packageJsonUrl); + if (fileExists(guess)) + break; + guess = void 0; } - function merge(a, b) { - var merged = {}; - for (var key in a) { - merged[key] = a[key]; + if (guess) { + emitLegacyIndexDeprecation( + guess, + packageJsonUrl, + base, + packageConfig.main + ); + return guess; + } + } + const tries = ["./index.js", "./index.json", "./index.node"]; + let i = -1; + while (++i < tries.length) { + guess = new import_node_url5.URL(tries[i], packageJsonUrl); + if (fileExists(guess)) + break; + guess = void 0; + } + if (guess) { + emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main); + return guess; + } + throw new ERR_MODULE_NOT_FOUND( + (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)), + (0, import_node_url5.fileURLToPath)(base) + ); +} +function finalizeResolution(resolved, base, preserveSymlinks) { + if (encodedSepRegEx.exec(resolved.pathname) !== null) + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved.pathname, + 'must not include encoded "/" or "\\" characters', + (0, import_node_url5.fileURLToPath)(base) + ); + const filePath = (0, import_node_url5.fileURLToPath)(resolved); + const stats = tryStatSync( + filePath.endsWith("/") ? filePath.slice(-1) : filePath + ); + if (stats.isDirectory()) { + const error2 = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, (0, import_node_url5.fileURLToPath)(base)); + error2.url = String(resolved); + throw error2; + } + if (!stats.isFile()) { + throw new ERR_MODULE_NOT_FOUND( + filePath || resolved.pathname, + base && (0, import_node_url5.fileURLToPath)(base), + "module" + ); + } + if (!preserveSymlinks) { + const real = (0, import_node_fs3.realpathSync)(filePath); + const { search, hash } = resolved; + resolved = (0, import_node_url5.pathToFileURL)(real + (filePath.endsWith(import_node_path4.default.sep) ? "/" : "")); + resolved.search = search; + resolved.hash = hash; + } + return resolved; +} +function importNotDefined(specifier, packageJsonUrl, base) { + return new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJsonUrl && (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)), + (0, import_node_url5.fileURLToPath)(base) + ); +} +function exportsNotFound(subpath, packageJsonUrl, base) { + return new ERR_PACKAGE_PATH_NOT_EXPORTED( + (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)), + subpath, + base && (0, import_node_url5.fileURLToPath)(base) + ); +} +function throwInvalidSubpath(request, match2, packageJsonUrl, internal, base) { + const reason = `request is not a valid match in pattern "${match2}" for the "${internal ? "imports" : "exports"}" resolution of ${(0, import_node_url5.fileURLToPath)(packageJsonUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER( + request, + reason, + base && (0, import_node_url5.fileURLToPath)(base) + ); +} +function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) { + target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`; + return new ERR_INVALID_PACKAGE_TARGET( + (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)), + subpath, + target, + internal, + base && (0, import_node_url5.fileURLToPath)(base) + ); +} +function resolvePackageTargetString(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap, conditions) { + if (subpath !== "" && !pattern && target[target.length - 1] !== "/") + throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base); + if (!target.startsWith("./")) { + if (internal && !target.startsWith("../") && !target.startsWith("/")) { + let isURL2 = false; + try { + new import_node_url5.URL(target); + isURL2 = true; + } catch { } - for (var key in b) { - merged[key] = b[key]; + if (!isURL2) { + const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target + subpath; + return packageResolve(exportTarget, packageJsonUrl, conditions); } - return merged; - } - function isPlainObject(value) { - return value.constructor === Object || value.constructor == null; - } - function isPromiseLike(value) { - return typeof value.then === "function"; } - function sameValueZeroEqual(a, b) { - return a === b || a !== a && b !== b; + throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base); + } + if (invalidSegmentRegEx.exec(target.slice(2)) !== null) { + if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) { + if (!isPathMap) { + const request = pattern ? match2.replace("*", () => subpath) : match2 + subpath; + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target; + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match2, + packageJsonUrl, + internal, + base, + true + ); + } + } else { + throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base); } - var ARGUMENTS_TAG = "[object Arguments]"; - var BOOLEAN_TAG = "[object Boolean]"; - var DATE_TAG = "[object Date]"; - var REG_EXP_TAG = "[object RegExp]"; - var MAP_TAG = "[object Map]"; - var NUMBER_TAG = "[object Number]"; - var OBJECT_TAG = "[object Object]"; - var SET_TAG = "[object Set]"; - var STRING_TAG = "[object String]"; - var toString = Object.prototype.toString; - function createComparator(_a) { - var areArraysEqual2 = _a.areArraysEqual, areDatesEqual2 = _a.areDatesEqual, areMapsEqual2 = _a.areMapsEqual, areObjectsEqual2 = _a.areObjectsEqual, areRegExpsEqual2 = _a.areRegExpsEqual, areSetsEqual2 = _a.areSetsEqual, createIsNestedEqual = _a.createIsNestedEqual; - var isEqual = createIsNestedEqual(comparator); - function comparator(a, b, meta) { - if (a === b) { - return true; - } - if (!a || !b || typeof a !== "object" || typeof b !== "object") { - return a !== a && b !== b; - } - if (isPlainObject(a) && isPlainObject(b)) { - return areObjectsEqual2(a, b, isEqual, meta); - } - var aArray = Array.isArray(a); - var bArray = Array.isArray(b); - if (aArray || bArray) { - return aArray === bArray && areArraysEqual2(a, b, isEqual, meta); - } - var aTag = toString.call(a); - if (aTag !== toString.call(b)) { - return false; - } - if (aTag === DATE_TAG) { - return areDatesEqual2(a, b, isEqual, meta); - } - if (aTag === REG_EXP_TAG) { - return areRegExpsEqual2(a, b, isEqual, meta); - } - if (aTag === MAP_TAG) { - return areMapsEqual2(a, b, isEqual, meta); - } - if (aTag === SET_TAG) { - return areSetsEqual2(a, b, isEqual, meta); - } - if (aTag === OBJECT_TAG || aTag === ARGUMENTS_TAG) { - return isPromiseLike(a) || isPromiseLike(b) ? false : areObjectsEqual2(a, b, isEqual, meta); - } - if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) { - return sameValueZeroEqual(a.valueOf(), b.valueOf()); - } - return false; + } + const resolved = new import_node_url5.URL(target, packageJsonUrl); + const resolvedPath = resolved.pathname; + const packagePath = new import_node_url5.URL(".", packageJsonUrl).pathname; + if (!resolvedPath.startsWith(packagePath)) + throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base); + if (subpath === "") + return resolved; + if (invalidSegmentRegEx.exec(subpath) !== null) { + const request = pattern ? match2.replace("*", () => subpath) : match2 + subpath; + if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) { + if (!isPathMap) { + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target; + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match2, + packageJsonUrl, + internal, + base, + false + ); } - return comparator; + } else { + throwInvalidSubpath(request, match2, packageJsonUrl, internal, base); } - function areArraysEqual(a, b, isEqual, meta) { - var index = a.length; - if (b.length !== index) { - return false; + } + if (pattern) { + return new import_node_url5.URL( + RegExpPrototypeSymbolReplace.call( + patternRegEx, + resolved.href, + () => subpath + ) + ); + } + return new import_node_url5.URL(subpath, resolved); +} +function isArrayIndex(key) { + const keyNumber = Number(key); + if (`${keyNumber}` !== key) + return false; + return keyNumber >= 0 && keyNumber < 4294967295; +} +function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) { + if (typeof target === "string") { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJsonUrl, + base, + pattern, + internal, + isPathMap, + conditions + ); + } + if (Array.isArray(target)) { + const targetList = target; + if (targetList.length === 0) + return null; + let lastException; + let i = -1; + while (++i < targetList.length) { + const targetItem = targetList[i]; + let resolveResult; + try { + resolveResult = resolvePackageTarget( + packageJsonUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ); + } catch (error2) { + const exception = ( + /** @type {ErrnoException} */ + error2 + ); + lastException = exception; + if (exception.code === "ERR_INVALID_PACKAGE_TARGET") + continue; + throw error2; } - while (index-- > 0) { - if (!isEqual(a[index], b[index], index, index, a, b, meta)) { - return false; - } + if (resolveResult === void 0) + continue; + if (resolveResult === null) { + lastException = null; + continue; } - return true; + return resolveResult; } - var areArraysEqualCircular = createIsCircular(areArraysEqual); - function areDatesEqual(a, b) { - return sameValueZeroEqual(a.valueOf(), b.valueOf()); + if (lastException === void 0 || lastException === null) { + return null; } - function areMapsEqual(a, b, isEqual, meta) { - var isValueEqual = a.size === b.size; - if (!isValueEqual) { - return false; - } - if (!a.size) { - return true; + throw lastException; + } + if (typeof target === "object" && target !== null) { + const keys2 = Object.getOwnPropertyNames(target); + let i = -1; + while (++i < keys2.length) { + const key = keys2[i]; + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG2( + (0, import_node_url5.fileURLToPath)(packageJsonUrl), + base, + '"exports" cannot contain numeric property keys.' + ); } - var matchedIndices = {}; - var indexA = 0; - a.forEach(function(aValue, aKey) { - if (!isValueEqual) { - return; - } - var hasMatch = false; - var matchIndexB = 0; - b.forEach(function(bValue, bKey) { - if (!hasMatch && !matchedIndices[matchIndexB] && (hasMatch = isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) && isEqual(aValue, bValue, aKey, bKey, a, b, meta))) { - matchedIndices[matchIndexB] = true; - } - matchIndexB++; - }); - indexA++; - isValueEqual = hasMatch; - }); - return isValueEqual; } - var areMapsEqualCircular = createIsCircular(areMapsEqual); - var OWNER = "_owner"; - var hasOwnProperty2 = Object.prototype.hasOwnProperty; - function areObjectsEqual(a, b, isEqual, meta) { - var keysA = Object.keys(a); - var index = keysA.length; - if (Object.keys(b).length !== index) { - return false; - } - var key; - while (index-- > 0) { - key = keysA[index]; - if (key === OWNER) { - var reactElementA = !!a.$$typeof; - var reactElementB = !!b.$$typeof; - if ((reactElementA || reactElementB) && reactElementA !== reactElementB) { - return false; - } - } - if (!hasOwnProperty2.call(b, key) || !isEqual(a[key], b[key], key, key, a, b, meta)) { - return false; - } + i = -1; + while (++i < keys2.length) { + const key = keys2[i]; + if (key === "default" || conditions && conditions.has(key)) { + const conditionalTarget = ( + /** @type {unknown} */ + target[key] + ); + const resolveResult = resolvePackageTarget( + packageJsonUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ); + if (resolveResult === void 0) + continue; + return resolveResult; } - return true; } - var areObjectsEqualCircular = createIsCircular(areObjectsEqual); - function areRegExpsEqual(a, b) { - return a.source === b.source && a.flags === b.flags; + return null; + } + if (target === null) { + return null; + } + throw invalidPackageTarget( + packageSubpath, + target, + packageJsonUrl, + internal, + base + ); +} +function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { + if (typeof exports === "string" || Array.isArray(exports)) + return true; + if (typeof exports !== "object" || exports === null) + return false; + const keys2 = Object.getOwnPropertyNames(exports); + let isConditionalSugar = false; + let i = 0; + let j = -1; + while (++j < keys2.length) { + const key = keys2[j]; + const curIsConditionalSugar = key === "" || key[0] !== "."; + if (i++ === 0) { + isConditionalSugar = curIsConditionalSugar; + } else if (isConditionalSugar !== curIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG2( + (0, import_node_url5.fileURLToPath)(packageJsonUrl), + base, + `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` + ); } - function areSetsEqual(a, b, isEqual, meta) { - var isValueEqual = a.size === b.size; - if (!isValueEqual) { - return false; + } + return isConditionalSugar; +} +function emitTrailingSlashPatternDeprecation(match2, pjsonUrl, base) { + const pjsonPath = (0, import_node_url5.fileURLToPath)(pjsonUrl); + if (emittedPackageWarnings.has(pjsonPath + "|" + match2)) + return; + emittedPackageWarnings.add(pjsonPath + "|" + match2); + import_node_process4.default.emitWarning( + `Use of deprecated trailing slash pattern mapping "${match2}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, import_node_url5.fileURLToPath)(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, + "DeprecationWarning", + "DEP0155" + ); +} +function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) { + let exports = packageConfig.exports; + if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) { + exports = { ".": exports }; + } + if (own2.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) { + const target = exports[packageSubpath]; + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + "", + packageSubpath, + base, + false, + false, + false, + conditions + ); + if (resolveResult === null || resolveResult === void 0) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); + } + return resolveResult; + } + let bestMatch = ""; + let bestMatchSubpath = ""; + const keys2 = Object.getOwnPropertyNames(exports); + let i = -1; + while (++i < keys2.length) { + const key = keys2[i]; + const patternIndex = key.indexOf("*"); + if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) { + if (packageSubpath.endsWith("/")) { + emitTrailingSlashPatternDeprecation( + packageSubpath, + packageJsonUrl, + base + ); } - if (!a.size) { - return true; + const patternTrailer = key.slice(patternIndex + 1); + if (packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) { + bestMatch = key; + bestMatchSubpath = packageSubpath.slice( + patternIndex, + packageSubpath.length - patternTrailer.length + ); } - var matchedIndices = {}; - a.forEach(function(aValue, aKey) { - if (!isValueEqual) { - return; - } - var hasMatch = false; - var matchIndex = 0; - b.forEach(function(bValue, bKey) { - if (!hasMatch && !matchedIndices[matchIndex] && (hasMatch = isEqual(aValue, bValue, aKey, bKey, a, b, meta))) { - matchedIndices[matchIndex] = true; - } - matchIndex++; - }); - isValueEqual = hasMatch; - }); - return isValueEqual; } - var areSetsEqualCircular = createIsCircular(areSetsEqual); - var DEFAULT_CONFIG = Object.freeze({ - areArraysEqual, - areDatesEqual, - areMapsEqual, - areObjectsEqual, - areRegExpsEqual, - areSetsEqual, - createIsNestedEqual: createDefaultIsNestedEqual - }); - var DEFAULT_CIRCULAR_CONFIG = Object.freeze({ - areArraysEqual: areArraysEqualCircular, - areDatesEqual, - areMapsEqual: areMapsEqualCircular, - areObjectsEqual: areObjectsEqualCircular, - areRegExpsEqual, - areSetsEqual: areSetsEqualCircular, - createIsNestedEqual: createDefaultIsNestedEqual - }); - var isDeepEqual = createComparator(DEFAULT_CONFIG); - function deepEqual(a, b) { - return isDeepEqual(a, b, void 0); - } - var isShallowEqual = createComparator(merge(DEFAULT_CONFIG, { createIsNestedEqual: function() { - return sameValueZeroEqual; - } })); - function shallowEqual(a, b) { - return isShallowEqual(a, b, void 0); - } - var isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG); - function circularDeepEqual(a, b) { - return isCircularDeepEqual(a, b, /* @__PURE__ */ new WeakMap()); - } - var isCircularShallowEqual = createComparator(merge(DEFAULT_CIRCULAR_CONFIG, { - createIsNestedEqual: function() { - return sameValueZeroEqual; - } - })); - function circularShallowEqual(a, b) { - return isCircularShallowEqual(a, b, /* @__PURE__ */ new WeakMap()); - } - function createCustomEqual(getComparatorOptions) { - return createComparator(merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG))); - } - function createCustomCircularEqual(getComparatorOptions) { - var comparator = createComparator(merge(DEFAULT_CIRCULAR_CONFIG, getComparatorOptions(DEFAULT_CIRCULAR_CONFIG))); - return function(a, b, meta) { - if (meta === void 0) { - meta = /* @__PURE__ */ new WeakMap(); - } - return comparator(a, b, meta); - }; + } + if (bestMatch) { + const target = ( + /** @type {unknown} */ + exports[bestMatch] + ); + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + false, + packageSubpath.endsWith("/"), + conditions + ); + if (resolveResult === null || resolveResult === void 0) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); } - exports.circularDeepEqual = circularDeepEqual; - exports.circularShallowEqual = circularShallowEqual; - exports.createCustomCircularEqual = createCustomCircularEqual; - exports.createCustomEqual = createCustomEqual; - exports.deepEqual = deepEqual; - exports.sameValueZeroEqual = sameValueZeroEqual; - exports.shallowEqual = shallowEqual; + return resolveResult; } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/simpleCache.js -var require_simpleCache = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/simpleCache.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AutoCache = exports.SimpleCache = exports.AutoWeakCache = exports.SimpleWeakCache = void 0; - var SimpleWeakCache = class { - constructor(size) { - this.size = size; - this.L0 = /* @__PURE__ */ new WeakMap(); - this.L1 = /* @__PURE__ */ new WeakMap(); - this.L2 = /* @__PURE__ */ new WeakMap(); - this.sizeL0 = 0; - } - has(key) { - for (const c of this.caches()) { - if (c.has(key)) - return true; + throw exportsNotFound(packageSubpath, packageJsonUrl, base); +} +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf("*"); + const bPatternIndex = b.indexOf("*"); + const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + if (baseLengthA > baseLengthB) + return -1; + if (baseLengthB > baseLengthA) + return 1; + if (aPatternIndex === -1) + return 1; + if (bPatternIndex === -1) + return -1; + if (a.length > b.length) + return -1; + if (b.length > a.length) + return 1; + return 0; +} +function packageImportsResolve(name, base, conditions) { + if (name === "#" || name.startsWith("#/") || name.endsWith("/")) { + const reason = "is not a valid internal imports specifier name"; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, (0, import_node_url5.fileURLToPath)(base)); + } + let packageJsonUrl; + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + packageJsonUrl = (0, import_node_url5.pathToFileURL)(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (own2.call(imports, name) && !name.includes("*")) { + const resolveResult = resolvePackageTarget( + packageJsonUrl, + imports[name], + "", + name, + base, + false, + true, + false, + conditions + ); + if (resolveResult !== null && resolveResult !== void 0) { + return resolveResult; } - return false; - } - get(key) { - for (const c of this.caches()) { - const entry = c.get(key); - if (entry) { - if (c !== this.L0) { - this._set(key, entry); + } else { + let bestMatch = ""; + let bestMatchSubpath = ""; + const keys2 = Object.getOwnPropertyNames(imports); + let i = -1; + while (++i < keys2.length) { + const key = keys2[i]; + const patternIndex = key.indexOf("*"); + if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) { + const patternTrailer = key.slice(patternIndex + 1); + if (name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) { + bestMatch = key; + bestMatchSubpath = name.slice( + patternIndex, + name.length - patternTrailer.length + ); } - return entry.v; } } - return void 0; - } - set(key, value) { - this._set(key, { v: value }); - } - _set(key, entry) { - if (this.L0.has(key)) { - this.L0.set(key, entry); - return this; - } - if (this.sizeL0 >= this.size) { - this.rotate(); - } - this.sizeL0 += 1; - this.L0.set(key, entry); - } - caches() { - return [this.L0, this.L1, this.L2]; - } - rotate() { - this.L2 = this.L1; - this.L1 = this.L0; - this.L0 = /* @__PURE__ */ new WeakMap(); - this.sizeL0 = 0; - } - }; - exports.SimpleWeakCache = SimpleWeakCache; - var AutoWeakCache = class extends SimpleWeakCache { - constructor(factory, size) { - super(size); - this.factory = factory; - } - get(key) { - const v = super.get(key); - if (v !== void 0) - return v; - const val = this.factory(key); - this.set(key, val); - return val; - } - }; - exports.AutoWeakCache = AutoWeakCache; - var SimpleCache = class { - constructor(size) { - this.size = size; - this.L0 = /* @__PURE__ */ new Map(); - this.L1 = /* @__PURE__ */ new Map(); - this.L2 = /* @__PURE__ */ new Map(); - } - has(key) { - for (const c of this.caches()) { - if (c.has(key)) - return true; - } - return false; - } - get(key) { - for (const c of this.caches()) { - const entry = c.get(key); - if (entry) { - if (c !== this.L0) { - this._set(key, entry); - } - return entry.v; + if (bestMatch) { + const target = imports[bestMatch]; + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + true, + false, + conditions + ); + if (resolveResult !== null && resolveResult !== void 0) { + return resolveResult; } } - return void 0; - } - set(key, value) { - this._set(key, { v: value }); - } - _set(key, entry) { - if (this.L0.has(key)) { - this.L0.set(key, entry); - return this; - } - if (this.L0.size >= this.size) { - this.rotate(); - } - this.L0.set(key, entry); - } - caches() { - return [this.L0, this.L1, this.L2]; - } - rotate() { - this.L2 = this.L1; - this.L1 = this.L0; - this.L0 = /* @__PURE__ */ new Map(); - } - }; - exports.SimpleCache = SimpleCache; - var AutoCache = class extends SimpleCache { - constructor(factory, size) { - super(size); - this.factory = factory; - } - get(key) { - const v = super.get(key); - if (v !== void 0) - return v; - const val = this.factory(key); - this.set(key, val); - return val; - } - }; - exports.AutoCache = AutoCache; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionary.js -var require_SpellingDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultOptions = exports.CompoundWordsMethod = void 0; - var cspell_trie_lib_1 = require_cjs5(); - Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function() { - return cspell_trie_lib_1.CompoundWordsMethod; - } }); - exports.defaultOptions = Object.freeze({ - weightMap: void 0 - }); - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/clean.js -var require_clean2 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/clean.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.clean = void 0; - function clean2(src) { - const r = src; - for (const key of Object.keys(r)) { - if (r[key] === void 0) { - delete r[key]; - } } - return r; } - exports.clean = clean2; } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/regexHelper.js -var require_regexHelper = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/regexHelper.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.escapeRegEx = void 0; - function escapeRegEx(s) { - return s.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); + throw importNotDefined(name, packageJsonUrl, base); +} +function parsePackageName(specifier, base) { + let separatorIndex = specifier.indexOf("/"); + let validPackageName = true; + let isScoped = false; + if (specifier[0] === "@") { + isScoped = true; + if (separatorIndex === -1 || specifier.length === 0) { + validPackageName = false; + } else { + separatorIndex = specifier.indexOf("/", separatorIndex + 1); } - exports.escapeRegEx = escapeRegEx; } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/repMap.js -var require_repMap = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/repMap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.createRepMapper = exports.createMapper = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var regexHelper_js_1 = require_regexHelper(); - var util_js_1 = require_util8(); - function createMapper(repMap, ignoreCharset) { - if (!repMap && !ignoreCharset) - return (a) => a; - repMap = repMap || []; - const charsetMap = charsetToRepMapRegEx(ignoreCharset); - if (charsetMap) { - repMap = repMap.concat(charsetMap); - } - const filteredMap = repMap.filter(([match, _]) => !!match); - if (!filteredMap.length) { - return (a) => a; - } - const regEx = createMapperRegExp(repMap); - const values = repMap.filter(([match, _]) => !!match).map(([_, into]) => into); - function resolve10(m, ...matches) { - const index = matches.findIndex((a) => !!a); - return 0 <= index && index < values.length ? values[index] : m; - } - return function(s) { - return s.replace(regEx, resolve10); - }; - } - exports.createMapper = createMapper; - function charsetToRepMapRegEx(charset, replaceWith = "") { - if (!charset) - return void 0; - return charset.split("|").map((chars) => `[${chars.replace(/[\][\\]/g, "\\$&")}]`).map((map) => [map, replaceWith]); - } - function charsetToRepMap(charset, replaceWith = "") { - if (!charset) - return void 0; - return charset.split("|").flatMap((chars) => [...(0, cspell_trie_lib_1.expandCharacterSet)(chars)]).map((char) => [char, replaceWith]); - } - function expandReplaceMap(repMap) { - return repMap.flatMap(([from, replaceWith]) => from.split("|").map((w) => [w, replaceWith])); + const packageName2 = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex); + if (invalidPackageNameRegEx.exec(packageName2) !== null) { + validPackageName = false; + } + if (!validPackageName) { + throw new ERR_INVALID_MODULE_SPECIFIER( + specifier, + "is not a valid package name", + (0, import_node_url5.fileURLToPath)(base) + ); + } + const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)); + return { packageName: packageName2, packageSubpath, isScoped }; +} +function packageResolve(specifier, base, conditions) { + if (import_node_module.builtinModules.includes(specifier)) { + return new import_node_url5.URL("node:" + specifier); + } + const { packageName: packageName2, packageSubpath, isScoped } = parsePackageName( + specifier, + base + ); + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + const packageJsonUrl2 = (0, import_node_url5.pathToFileURL)(packageConfig.pjsonPath); + if (packageConfig.name === packageName2 && packageConfig.exports !== void 0 && packageConfig.exports !== null) { + return packageExportsResolve( + packageJsonUrl2, + packageSubpath, + packageConfig, + base, + conditions + ); } - function createMapperRegExp(repMap) { - const filteredMap = repMap.filter(([match, _]) => !!match); - if (!filteredMap.length) { - return /$^/; - } - const regExStr = filteredMap.map(([from, _]) => from).map((s) => { - try { - const r = s.match(/\(/) ? s.replace(/\((?=.*\))/g, "(?:").replace(/\(\?:\?/g, "(?") : s; - new RegExp(r); - s = r; - } catch (err) { - return (0, regexHelper_js_1.escapeRegEx)(s); - } - return s; - }).map((s) => `(${s})`).join("|"); - const regEx = new RegExp(regExStr, "g"); - return regEx; - } - function createRepMapper(repMap, ignoreCharset) { - if (!repMap && !ignoreCharset) - return (word) => [word]; - const trie = createTrie(repMap, ignoreCharset); - return (word) => { - const edits = calcAllEdits(trie, word); - return applyEdits(word, edits); - }; + } + let packageJsonUrl = new import_node_url5.URL( + "./node_modules/" + packageName2 + "/package.json", + base + ); + let packageJsonPath = (0, import_node_url5.fileURLToPath)(packageJsonUrl); + let lastPath; + do { + const stat2 = tryStatSync(packageJsonPath.slice(0, -13)); + if (!stat2.isDirectory()) { + lastPath = packageJsonPath; + packageJsonUrl = new import_node_url5.URL( + (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName2 + "/package.json", + packageJsonUrl + ); + packageJsonPath = (0, import_node_url5.fileURLToPath)(packageJsonUrl); + continue; } - exports.createRepMapper = createRepMapper; - function applyEdits(word, edits) { - if (!edits.length) - return [word]; - const letterEdits = []; - for (let i = 0; i < word.length; ++i) { - letterEdits[i] = { edits: [{ b: i, e: i + 1, r: word[i] }], suffixes: [] }; - } - letterEdits[word.length] = { edits: [], suffixes: [""] }; - for (const edit of edits) { - const le = letterEdits[edit.b]; - le.edits.push(edit); - } - for (let i = word.length - 1; i >= 0; --i) { - const le = letterEdits[i]; - const sfx = le.suffixes; - for (const edit of le.edits) { - const pfx = edit.r; - const nSfx = letterEdits[edit.e].suffixes; - for (const s of nSfx) { - sfx.push(pfx + s); - } - } - } - const results = new Set(letterEdits[0].suffixes); - return [...results]; + const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base); + if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) { + return packageExportsResolve( + packageJsonUrl, + packageSubpath, + packageConfig2, + base, + conditions + ); } - function calcAllEdits(root, word) { - const edits = []; - function walk(node, b, e) { - if (node.rep) { - node.rep.forEach((r) => edits.push({ b, e, r })); - } - if (e === word.length || !node.children) - return; - const n = node.children[word[e]]; - if (!n) - return; - walk(n, b, e + 1); - } - for (let i = 0; i < word.length; ++i) { - walk(root, i, i); - } - return edits; + if (packageSubpath === ".") { + return legacyMainResolve(packageJsonUrl, packageConfig2, base); } - function createTrie(repMap, ignoreCharset) { - const combined = [repMap, charsetToRepMap(ignoreCharset)].filter(util_js_1.isDefined).flatMap((a) => a); - const expanded = expandReplaceMap(combined); - const trieRoot = /* @__PURE__ */ Object.create(null); - expanded.forEach(([match, replaceWith]) => addToTrie(trieRoot, match, replaceWith)); - return trieRoot; + return new import_node_url5.URL(packageSubpath, packageJsonUrl); + } while (packageJsonPath.length !== lastPath.length); + throw new ERR_MODULE_NOT_FOUND(packageName2, (0, import_node_url5.fileURLToPath)(base)); +} +function isRelativeSpecifier(specifier) { + if (specifier[0] === ".") { + if (specifier.length === 1 || specifier[1] === "/") + return true; + if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) { + return true; } - function addToTrie(node, match, replaceWith) { - while (match) { - const children = node.children || (node.children = /* @__PURE__ */ Object.create(null)); - const k = match[0]; - const childNode = children[k] || (children[k] = /* @__PURE__ */ Object.create(null)); - node = childNode; - match = match.slice(1); + } + return false; +} +function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { + if (specifier === "") + return false; + if (specifier[0] === "/") + return true; + return isRelativeSpecifier(specifier); +} +function moduleResolve(specifier, base, conditions, preserveSymlinks) { + const protocol = base.protocol; + const isRemote = protocol === "http:" || protocol === "https:"; + let resolved; + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + resolved = new import_node_url5.URL(specifier, base); + } else if (!isRemote && specifier[0] === "#") { + resolved = packageImportsResolve(specifier, base, conditions); + } else { + try { + resolved = new import_node_url5.URL(specifier); + } catch { + if (!isRemote) { + resolved = packageResolve(specifier, base, conditions); } - const s = new Set(node.rep || []); - s.add(replaceWith); - node.rep = [...s]; } - exports.__testing__ = { - charsetToRepMap: charsetToRepMapRegEx, - createMapperRegExp, - createTrie, - calcAllEdits, - applyEdits - }; } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/defaults.js -var require_defaults = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/defaults.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isForbiddenIgnoreCaseAndAccents = exports.ignoreCase = void 0; - exports.ignoreCase = true; - exports.isForbiddenIgnoreCaseAndAccents = false; + (0, import_node_assert2.default)(resolved !== void 0, "expected to be defined"); + if (resolved.protocol !== "file:") { + return resolved; } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryFromTrie.js -var require_SpellingDictionaryFromTrie = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryFromTrie.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.createSpellingDictionaryFromTrieFile = exports.SpellingDictionaryFromTrie = void 0; - var sync_1 = require_sync(); - var cspell_trie_lib_1 = require_cjs5(); - var AutoCache_js_1 = require_AutoCache(); - var clean_js_1 = require_clean2(); - var repMap_js_1 = require_repMap(); - var Defaults = __importStar(require_defaults()); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - var findWordOptionsCaseSensitive = Object.freeze({ caseSensitive: true }); - var findWordOptionsNotCaseSensitive = Object.freeze({ caseSensitive: false }); - var SpellingDictionaryFromTrie = class { - constructor(trie, name, options, source = "from trie", size) { - this.trie = trie; - this.name = name; - this.options = options; - this.source = source; - this._size = 0; - this.knownWords = /* @__PURE__ */ new Set(); - this.unknownWords = /* @__PURE__ */ new Set(); - this.type = "SpellingDictionaryFromTrie"; - this._find = findCache((word, useCompounds, ignoreCase) => this.findAnyForm(word, useCompounds, ignoreCase)); - this._isForbidden = (0, AutoCache_js_1.autoCache)((word) => { - return this.trie.isForbiddenWord(word); - }); - this.mapWord = (0, repMap_js_1.createMapper)(options.repMap, options.dictionaryInformation?.ignore); - this.remapWord = (0, repMap_js_1.createRepMapper)(options.repMap, options.dictionaryInformation?.ignore); - this.isDictionaryCaseSensitive = options.caseSensitive ?? !trie.isLegacy; - this.containsNoSuggestWords = options.noSuggest || false; - this._size = size || 0; - this.weightMap = options.weightMap || (0, SpellingDictionaryMethods_js_1.createWeightMapFromDictionaryInformation)(options.dictionaryInformation); - } - get size() { - if (!this._size) { - const i = this.trie.iterate(); - let deeper = true; - let size = 0; - for (let r = i.next(); !r.done; r = i.next(deeper)) { - size += 1; - deeper = r.value.text.length < 5; - } - this._size = size; - } - return this._size; - } - has(word, hasOptions) { - const { useCompounds, ignoreCase } = this.resolveOptions(hasOptions); - const r = this._find(word, useCompounds, ignoreCase); - return !!r && !r.forbidden && !!r.found; - } - find(word, hasOptions) { - const { useCompounds, ignoreCase } = this.resolveOptions(hasOptions); - const r = this._find(word, useCompounds, ignoreCase); - const { forbidden = this.isForbidden(word) } = r || {}; - if (!r && !forbidden) - return void 0; - const { found = forbidden ? word : false } = r || {}; - const noSuggest = found !== false && this.containsNoSuggestWords; - return { found, forbidden, noSuggest }; - } - resolveOptions(hasOptions) { - const { useCompounds = this.options.useCompounds, ignoreCase = Defaults.ignoreCase } = (0, SpellingDictionaryMethods_js_1.hasOptionToSearchOption)(hasOptions); - return { useCompounds, ignoreCase }; - } - findAnyForm(word, useCompounds, ignoreCase) { - const outerForms = outerWordForms(word, this.remapWord ? this.remapWord : (word2) => [this.mapWord(word2)]); - for (const form of outerForms) { - const r = this._findAnyForm(form, useCompounds, ignoreCase); - if (r) - return r; - } - return void 0; - } - _findAnyForm(mWord, useCompounds, ignoreCase) { - const opts = ignoreCase ? findWordOptionsNotCaseSensitive : findWordOptionsCaseSensitive; - const findResult = this.trie.findWord(mWord, opts); - if (findResult.found !== false) { - return findResult; - } - const forms = (0, SpellingDictionaryMethods_js_1.wordSearchForms)(mWord, this.isDictionaryCaseSensitive, ignoreCase); - for (const w of forms) { - const findResult2 = this.trie.findWord(w, opts); - if (findResult2.found !== false) { - return findResult2; - } - } - if (useCompounds) { - const optsUseCompounds = { ...opts, useLegacyWordCompounds: useCompounds }; - for (const w of forms) { - const findResult2 = this.trie.findWord(w, optsUseCompounds); - if (findResult2.found !== false) { - return findResult2; - } - } - } - return void 0; - } - isNoSuggestWord(word, options) { - return this.containsNoSuggestWords ? this.has(word, options) : false; - } - isForbidden(word, _ignoreCaseAndAccents) { - return this._isForbidden(word); - } - suggest(...args) { - const [word] = args; - const suggestOptions = (0, SpellingDictionaryMethods_js_1.suggestArgsToSuggestOptions)(args); - return this._suggest(word, suggestOptions); - } - _suggest(word, suggestOptions) { - const { numSuggestions = SpellingDictionaryMethods_js_1.defaultNumSuggestions, numChanges, includeTies, ignoreCase, timeout } = suggestOptions; - function filter(_word) { - return true; + return finalizeResolution(resolved, base, preserveSymlinks); +} +function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { + if (parsedParentURL) { + const parentProtocol = parsedParentURL.protocol; + if (parentProtocol === "http:" || parentProtocol === "https:") { + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + const parsedProtocol = parsed?.protocol; + if (parsedProtocol && parsedProtocol !== "https:" && parsedProtocol !== "http:") { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "remote imports cannot import from a local location." + ); } - const collector = (0, cspell_trie_lib_1.suggestionCollector)(word, (0, clean_js_1.clean)({ - numSuggestions, - filter, - changeLimit: numChanges, - includeTies, - ignoreCase, - timeout, - weightMap: this.weightMap - })); - this.genSuggestions(collector, suggestOptions); - return collector.suggestions.map((r) => ({ ...r, word: r.word })); - } - genSuggestions(collector, suggestOptions) { - if (this.options.noSuggest) - return; - const _compoundMethod = suggestOptions.compoundMethod ?? (this.options.useCompounds ? cspell_trie_lib_1.CompoundWordsMethod.JOIN_WORDS : cspell_trie_lib_1.CompoundWordsMethod.NONE); - (0, SpellingDictionaryMethods_js_1.wordSuggestFormsArray)(collector.word).forEach((w) => this.trie.genSuggestions((0, SpellingDictionaryMethods_js_1.impersonateCollector)(collector, w), _compoundMethod)); - } - getErrors() { - return []; + return { url: parsed?.href || "" }; } - }; - exports.SpellingDictionaryFromTrie = SpellingDictionaryFromTrie; - SpellingDictionaryFromTrie.cachedWordsLimit = 5e4; - function createSpellingDictionaryFromTrieFile(data, name, source, options) { - data = typeof data === "string" ? data.split("\n") : data; - const trieNode = (0, cspell_trie_lib_1.importTrie)(data); - const trie = new cspell_trie_lib_1.Trie(trieNode); - return new SpellingDictionaryFromTrie(trie, name, options, source); - } - exports.createSpellingDictionaryFromTrieFile = createSpellingDictionaryFromTrieFile; - function findCache(fn, size = 2e3) { - const cache = (0, AutoCache_js_1.createCache01)(size); - function find(word, useCompounds, ignoreCase) { - const r = cache.get(word); - if (r !== void 0) { - if (r.useCompounds === useCompounds && r.ignoreCase === ignoreCase) { - return r.findResult; - } - } - const findResult = fn(word, useCompounds, ignoreCase); - cache.set(word, { useCompounds, ignoreCase, findResult }); - return findResult; + if (import_node_module.builtinModules.includes(specifier)) { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "remote imports cannot import from a local location." + ); } - return find; + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "only relative and absolute specifiers are supported." + ); } - function outerWordForms(word, mapWord) { - const forms = (0, sync_1.pipe)([word], (0, sync_1.opConcatMap)((word2) => [word2, word2.normalize("NFC"), word2.normalize("NFD")]), (0, sync_1.opConcatMap)((word2) => [word2, ...mapWord(word2)])); - return new Set(forms); + } +} +function isURL(self) { + return Boolean( + self && typeof self === "object" && "href" in self && typeof self.href === "string" && "protocol" in self && typeof self.protocol === "string" && self.href && self.protocol + ); +} +function throwIfInvalidParentURL(parentURL) { + if (parentURL === void 0) { + return; + } + if (typeof parentURL !== "string" && !isURL(parentURL)) { + throw new codes2.ERR_INVALID_ARG_TYPE( + "parentURL", + ["string", "URL"], + parentURL + ); + } +} +function throwIfUnsupportedURLProtocol(url) { + const protocol = url.protocol; + if (protocol !== "file:" && protocol !== "data:" && protocol !== "node:") { + throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url); + } +} +function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports2) { + const protocol = parsed?.protocol; + if (protocol && protocol !== "file:" && protocol !== "data:" && (!experimentalNetworkImports2 || protocol !== "https:" && protocol !== "http:")) { + throw new ERR_UNSUPPORTED_ESM_URL_SCHEME( + parsed, + ["file", "data"].concat( + experimentalNetworkImports2 ? ["https", "http"] : [] + ) + ); + } +} +function defaultResolve(specifier, context = {}) { + const { parentURL } = context; + (0, import_node_assert2.default)(parentURL !== void 0, "expected `parentURL` to be defined"); + throwIfInvalidParentURL(parentURL); + let parsedParentURL; + if (parentURL) { + try { + parsedParentURL = new import_node_url5.URL(parentURL); + } catch { } - exports.__testing__ = { outerWordForms }; } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/createSpellingDictionary.js -var require_createSpellingDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/createSpellingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFailedToLoadDictionary = exports.createSpellingDictionary = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var fast_equals_1 = require_fast_equals_cjs(); - var simpleCache_js_1 = require_simpleCache(); - var SpellingDictionary_js_1 = require_SpellingDictionary(); - var SpellingDictionaryFromTrie_js_1 = require_SpellingDictionaryFromTrie(); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - var cachedDictionaries = new simpleCache_js_1.AutoWeakCache(_createSpellingDictionary, 64); - var maxSetSize = 3; - var cachedParamsByWordList = new simpleCache_js_1.SimpleCache(64); - function createSpellingDictionary(wordList, name, source, options) { - const params = [wordList, name, source, options]; - if (!Array.isArray(wordList)) { - return _createSpellingDictionary(params); - } - const cached = cachedParamsByWordList.get(name) || /* @__PURE__ */ new Set(); - for (const cachedParams of cached) { - if ((0, fast_equals_1.deepEqual)(params, cachedParams)) { - return cachedDictionaries.get(cachedParams); - } - } - if (cached.size > maxSetSize) - cached.clear(); - cached.add(params); - cachedParamsByWordList.set(name, cached); - return cachedDictionaries.get(params); - } - exports.createSpellingDictionary = createSpellingDictionary; - function _createSpellingDictionary(params) { - const [wordList, name, source, options] = params; - const parseOptions = { stripCaseAndAccents: options?.supportNonStrictSearches ?? true }; - const words = (0, cspell_trie_lib_1.parseDictionaryLines)(wordList, parseOptions); - const trie = (0, cspell_trie_lib_1.buildTrieFast)(words); - const opts = { ...options || SpellingDictionary_js_1.defaultOptions }; - if (opts.weightMap === void 0 && opts.dictionaryInformation) { - opts.weightMap = (0, SpellingDictionaryMethods_js_1.createWeightMapFromDictionaryInformation)(opts.dictionaryInformation); - } - return new SpellingDictionaryFromTrie_js_1.SpellingDictionaryFromTrie(trie, name, opts, source); - } - function createFailedToLoadDictionary(name, source, error2, options) { - options = options || {}; - return { - name, - source, - type: "error", - containsNoSuggestWords: false, - has: () => false, - find: () => void 0, - isNoSuggestWord: () => false, - isForbidden: () => false, - suggest: () => [], - mapWord: (a) => a, - genSuggestions: () => { - return; - }, - size: 0, - options, - isDictionaryCaseSensitive: false, - getErrors: () => [error2] - }; + let parsed; + try { + parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new import_node_url5.URL(specifier, parsedParentURL) : new import_node_url5.URL(specifier); + const protocol = parsed.protocol; + if (protocol === "data:" || experimentalNetworkImports && (protocol === "https:" || protocol === "http:")) { + return { url: parsed.href, format: null }; } - exports.createFailedToLoadDictionary = createFailedToLoadDictionary; + } catch { + } + const maybeReturn = checkIfDisallowedImport( + specifier, + parsed, + parsedParentURL + ); + if (maybeReturn) + return maybeReturn; + if (parsed && parsed.protocol === "node:") + return { url: specifier }; + throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports); + const conditions = getConditionsSet(context.conditions); + const url = moduleResolve(specifier, new import_node_url5.URL(parentURL), conditions, false); + throwIfUnsupportedURLProtocol(url); + return { + // Do NOT cast `url` to a string: that will work even when there are real + // problems, silencing them + url: url.href, + format: defaultGetFormatWithoutErrors(url, { parentURL }) + }; +} +var import_node_assert2, import_node_fs3, import_node_process4, import_node_url5, import_node_path4, import_node_module, RegExpPrototypeSymbolReplace, experimentalNetworkImports, ERR_NETWORK_IMPORT_DISALLOWED, ERR_INVALID_MODULE_SPECIFIER, ERR_INVALID_PACKAGE_CONFIG2, ERR_INVALID_PACKAGE_TARGET, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_ESM_URL_SCHEME, own2, invalidSegmentRegEx, deprecatedInvalidSegmentRegEx, invalidPackageNameRegEx, patternRegEx, encodedSepRegEx, emittedPackageWarnings, doubleSlashRegEx; +var init_resolve = __esm({ + "node_modules/import-meta-resolve/lib/resolve.js"() { + import_node_assert2 = __toESM(require("node:assert"), 1); + import_node_fs3 = require("node:fs"); + import_node_process4 = __toESM(require("node:process"), 1); + import_node_url5 = require("node:url"); + import_node_path4 = __toESM(require("node:path"), 1); + import_node_module = require("node:module"); + init_get_format(); + init_errors(); + init_package_config(); + init_utils(); + RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]; + experimentalNetworkImports = false; + ({ + ERR_NETWORK_IMPORT_DISALLOWED, + ERR_INVALID_MODULE_SPECIFIER, + ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2, + ERR_INVALID_PACKAGE_TARGET, + ERR_MODULE_NOT_FOUND, + ERR_PACKAGE_IMPORT_NOT_DEFINED, + ERR_PACKAGE_PATH_NOT_EXPORTED, + ERR_UNSUPPORTED_DIR_IMPORT, + ERR_UNSUPPORTED_ESM_URL_SCHEME + } = codes2); + own2 = {}.hasOwnProperty; + invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; + deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; + invalidPackageNameRegEx = /^\.|%|\\/; + patternRegEx = /\*/g; + encodedSepRegEx = /%2f|%5c/i; + emittedPackageWarnings = /* @__PURE__ */ new Set(); + doubleSlashRegEx = /[/\\]{2}/; } }); -// node_modules/cspell-dictionary/dist/cjs/util/textMappers.js -var require_textMappers = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/textMappers.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mapperRemoveCaseAndAccents = exports.mapperNormalizeNFC = void 0; - var text_js_1 = require_text3(); - function* mapperNormalizeNFC(words) { - for (const word of words) { - yield word.normalize("NFC"); - } - } - exports.mapperNormalizeNFC = mapperNormalizeNFC; - function* mapperRemoveCaseAndAccents(words) { - for (const word of words) { - const lc = word.toLowerCase(); - yield lc; - const woAccents = (0, text_js_1.removeAccents)(lc); - if (lc !== woAccents) - yield woAccents; - } +// node_modules/import-meta-resolve/index.js +var import_meta_resolve_exports = {}; +__export(import_meta_resolve_exports, { + moduleResolve: () => moduleResolve, + resolve: () => resolve10 +}); +function resolve10(specifier, parent) { + if (!parent) { + throw new Error( + "Please pass `parent`: `import-meta-resolve` cannot ponyfill that" + ); + } + try { + return defaultResolve(specifier, { parentURL: parent }).url; + } catch (error2) { + const exception = ( + /** @type {ErrnoException} */ + error2 + ); + if (exception.code === "ERR_UNSUPPORTED_DIR_IMPORT" && typeof exception.url === "string") { + return exception.url; } - exports.mapperRemoveCaseAndAccents = mapperRemoveCaseAndAccents; + throw error2; + } +} +var init_import_meta_resolve = __esm({ + "node_modules/import-meta-resolve/index.js"() { + init_resolve(); + init_resolve(); } }); -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/util.js -var require_util9 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractIgnoreValues = exports.extractAllSuggestions = exports.createTyposDef = exports.appendToDef = exports.mergeDef = exports.mergeDefEntry = void 0; - var sync_1 = require_sync(); - function normalizeTyposDefValue(value) { - if (!value) - return false; - if (typeof value === "string") - return value; - const unique = [...new Set(value)]; - return unique.length > 1 ? unique : unique.length === 1 ? unique[0] : false; - } - function mergeDefEntry(targetDef, key, value) { - const curValue = targetDef[key]; - if (!curValue) { - targetDef[key] = normalizeTyposDefValue(value); - return targetDef; - } - if (!value) - return targetDef; - const newValue = Array.isArray(curValue) ? curValue : [curValue]; - if (Array.isArray(value)) { - newValue.push(...value); - } else { - newValue.push(value); - } - targetDef[key] = normalizeTyposDefValue(newValue); - return targetDef; - } - exports.mergeDefEntry = mergeDefEntry; - function mergeDef(targetDef, fromDef) { - for (const key of Object.keys(fromDef)) { - mergeDefEntry(targetDef, key, fromDef[key]); - } - return targetDef; - } - exports.mergeDef = mergeDef; - function appendToDef(def, entry) { - if (!entry) - return def; - if (typeof entry === "string") { - if (!def[entry]) { - def[entry] = false; - } - return def; - } - if (Array.isArray(entry)) { - const [key, ...sugs] = entry.map((s2) => s2.trim()); - if (!key) - return def; - const s = sugs.map((s2) => s2.trim()).filter((s2) => !!s2); - return mergeDefEntry(def, key, s); - } - return mergeDef(def, entry); - } - exports.appendToDef = appendToDef; - function createTyposDef(entries) { - const def = /* @__PURE__ */ Object.create(null); - if (!entries) - return def; - for (const [key, value] of entries) { - def[key] = isDefined2(value) ? value : false; +// src/main.ts +var core4 = __toESM(require_core()); +var import_github2 = __toESM(require_github()); +var import_context = __toESM(require_context()); + +// src/error.ts +var AppError = class extends Error { + constructor(message) { + super(message); + } +}; +function isError(e) { + if (!e) + return false; + if (typeof e !== "object") + return false; + const err = e; + return err.message !== void 0 && err.name !== void 0 && (err.stack === void 0 || typeof err.stack === "string"); +} +function isAppError(e) { + return e instanceof AppError; +} + +// src/action.ts +var core3 = __toESM(require_core()); + +// node_modules/cspell-glob/dist/esm/globHelper.mjs +var Path = __toESM(require("path"), 1); +var { posix } = Path; +var relRegExp = /^\.[\\/]/; +var isGlobalPatternRegExp = /^!*[*]{2}/; +function fileOrGlobToGlob(fileOrGlob, root, path26 = Path) { + const pathToGlob = path26.sep === "\\" ? (p) => p.replace(/\\/g, "/") : (p) => p; + const isGlobalPattern = false; + if (isGlobPatternWithOptionalRoot(fileOrGlob)) { + const useRoot = fileOrGlob.root ?? root; + const isGlobalPattern2 = isGlobPatternWithRoot(fileOrGlob) ? fileOrGlob.isGlobalPattern : isGlobalGlob(fileOrGlob.glob); + return { ...fileOrGlob, root: useRoot, isGlobalPattern: isGlobalPattern2 }; + } + if (doesRootContainPath(root, fileOrGlob, path26) || relRegExp.test(fileOrGlob)) { + const rel = path26.relative(root, path26.resolve(root, fileOrGlob)); + return { glob: pathToGlob(rel), root, isGlobalPattern }; + } + return { glob: pathToGlob(fileOrGlob), root, isGlobalPattern }; +} +function doesRootContainPath(root, child, path26) { + if (child.startsWith(root)) + return true; + const rel = path26.relative(root, child); + return !rel || rel !== child && !rel.startsWith("..") && !path26.isAbsolute(rel); +} +function isGlobPatternWithOptionalRoot(g) { + return typeof g !== "string" && typeof g.glob === "string"; +} +function isGlobPatternWithRoot(g) { + return typeof g.root === "string" && "isGlobalPattern" in g; +} +function isGlobPatternNormalized(g) { + if (!isGlobPatternWithOptionalRoot(g)) + return false; + if (!isGlobPatternWithRoot(g)) + return false; + const gr = g; + return "rawGlob" in gr && "rawRoot" in gr && typeof gr.rawGlob === "string"; +} +function normalizePattern(pattern, nested) { + pattern = pattern.replace(/^(!!)+/, ""); + const isNeg = pattern.startsWith("!"); + const prefix = isNeg ? "!" : ""; + pattern = isNeg ? pattern.slice(1) : pattern; + const patterns = nested ? normalizePatternNested(pattern) : normalizePatternGeneral(pattern); + return patterns.map((p) => prefix + p); +} +function normalizePatternNested(pattern) { + if (!pattern.includes("/")) { + if (pattern === "**") + return ["**"]; + return ["**/" + pattern, "**/" + pattern + "/**"]; + } + const hasLeadingSlash = pattern.startsWith("/"); + pattern = hasLeadingSlash ? pattern.slice(1) : pattern; + if (pattern.endsWith("/")) { + return hasLeadingSlash || pattern.slice(0, -1).includes("/") ? [pattern + "**/*"] : ["**/" + pattern + "**/*"]; + } + if (pattern.endsWith("**")) { + return [pattern]; + } + return [pattern, pattern + "/**"]; +} +function normalizePatternGeneral(pattern) { + pattern = pattern.startsWith("/") ? pattern.slice(1) : pattern; + pattern = pattern.endsWith("/") ? pattern + "**/*" : pattern; + return [pattern]; +} +function normalizeGlobPatterns(patterns, options) { + function* normalize3() { + for (const glob2 of patterns) { + if (isGlobPatternNormalized(glob2)) { + yield glob2; + continue; } - return def; - } - exports.createTyposDef = createTyposDef; - function extractAllSuggestions(typosDef) { - const allSugs = (0, sync_1.pipe)(Object.values(typosDef), (0, sync_1.opFilter)(hasSuggestions), (0, sync_1.opConcatMap)((v) => Array.isArray(v) ? v : [v])); - return new Set(allSugs); - } - exports.extractAllSuggestions = extractAllSuggestions; - function extractIgnoreValues(typosDef, ignorePrefix) { - const pfxLen = ignorePrefix.length; - return new Set(Object.keys(typosDef).filter((k) => k.startsWith(ignorePrefix)).map((k) => k.slice(pfxLen))); - } - exports.extractIgnoreValues = extractIgnoreValues; - function isDefined2(v) { - return v !== void 0 && v !== null; - } - function isString2(v) { - return typeof v === "string"; + yield* normalizeGlobPattern(glob2, options); } - function isArray(v) { - return Array.isArray(v); + } + return [...normalize3()]; +} +function normalizeGlobPattern(g, options) { + const { root, nodePath: path26 = Path, nested, cwd = Path.resolve() } = options; + g = !isGlobPatternWithOptionalRoot(g) ? { glob: g } : g; + const gr = { ...g, root: g.root ?? root }; + const rawRoot = gr.root; + const rawGlob = g.glob; + gr.glob = gr.glob.trim(); + if (gr.glob.startsWith("${cwd}")) { + gr.glob = gr.glob.replace("${cwd}", ""); + gr.root = "${cwd}"; + } + if (gr.root.startsWith("${cwd}")) { + gr.root = path26.resolve(gr.root.replace("${cwd}", cwd)); + } + const isGlobalPattern = isGlobalGlob(gr.glob); + gr.root = path26.resolve(root, path26.normalize(gr.root)); + const globs = normalizePattern(gr.glob, nested); + return globs.map((glob2) => ({ ...gr, glob: glob2, rawGlob, rawRoot, isGlobalPattern })); +} +function normalizeGlobToRoot(glob2, root, path26) { + function relToGlob(relativePath2) { + return path26.sep === "\\" ? relativePath2.replace(/\\/g, "/") : relativePath2; + } + if (glob2.root === root) { + return glob2; + } + const relFromRootToGlob = path26.relative(root, glob2.root); + if (!relFromRootToGlob) { + return glob2; + } + if (glob2.isGlobalPattern) { + return { ...glob2, root }; + } + const relFromGlobToRoot = path26.relative(glob2.root, root); + const globIsUnderRoot = relFromRootToGlob[0] !== "." && !path26.isAbsolute(relFromRootToGlob); + const rootIsUnderGlob = relFromGlobToRoot[0] !== "." && !path26.isAbsolute(relFromGlobToRoot); + if (!globIsUnderRoot && !rootIsUnderGlob) { + return glob2; + } + const isNeg = glob2.glob.startsWith("!"); + const g = isNeg ? glob2.glob.slice(1) : glob2.glob; + const prefix = isNeg ? "!" : ""; + if (globIsUnderRoot) { + const relGlob2 = relToGlob(relFromRootToGlob); + return { + ...glob2, + glob: prefix + posix.join(relGlob2, g), + root + }; + } + const relGlob = relToGlob(relFromGlobToRoot) + "/"; + const rebasedGlob = rebaseGlob(g, relGlob); + return rebasedGlob ? { ...glob2, glob: prefix + rebasedGlob, root } : glob2; +} +function rebaseGlob(glob2, rebaseTo) { + if (!rebaseTo || rebaseTo === "/") + return glob2; + if (glob2.startsWith("**")) + return glob2; + rebaseTo = rebaseTo.endsWith("/") ? rebaseTo : rebaseTo + "/"; + if (glob2.startsWith(rebaseTo)) { + return glob2.slice(rebaseTo.length); + } + const relParts = rebaseTo.split("/"); + const globParts = glob2.split("/"); + for (let i = 0; i < relParts.length && i < globParts.length; ++i) { + const relSeg = relParts[i]; + const globSeg = globParts[i]; + if (!relSeg || globSeg === "**") { + return globParts.slice(i).join("/"); } - function hasSuggestions(v) { - return isString2(v) || isArray(v); + if (relSeg !== globSeg && globSeg !== "*") { + break; } } -}); + return void 0; +} +function isGlobalGlob(glob2) { + return isGlobalPatternRegExp.test(glob2); +} -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/typosParser.js -var require_typosParser = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/typosParser.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; +// node_modules/cspell-glob/dist/esm/GlobMatcher.mjs +var import_micromatch = __toESM(require_micromatch(), 1); +var Path2 = __toESM(require("path"), 1); +var GlobMatcher = class { + constructor(patterns, rootOrOptions, _nodePath) { + _nodePath = _nodePath ?? Path2; + const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions ?? {}; + const { mode = "exclude" } = options; + const isExcludeMode = mode !== "include"; + _nodePath = options.nodePath ?? _nodePath; + const { root = _nodePath.resolve(), dot = isExcludeMode, nodePath = _nodePath, nested = isExcludeMode, cwd = process.cwd(), nobrace } = options; + const normalizedRoot = nodePath.resolve(nodePath.normalize(root)); + this.options = { root: normalizedRoot, dot, nodePath, nested, mode, nobrace, cwd }; + patterns = Array.isArray(patterns) ? patterns : typeof patterns === "string" ? patterns.split(/\r?\n/g) : [patterns]; + const globPatterns = normalizeGlobPatterns(patterns, this.options); + this.patternsNormalizedToRoot = globPatterns.map((g) => normalizeGlobToRoot(g, normalizedRoot, nodePath)).filter((g) => nodePath.relative(g.root, normalizedRoot) === ""); + this.patterns = globPatterns; + this.root = normalizedRoot; + this.path = nodePath; + this.dot = dot; + this.matchEx = buildMatcherFn(this.patterns, this.options); + } + /** + * Check to see if a filename matches any of the globs. + * If filename is relative, it is considered relative to the root. + * If filename is absolute and contained within the root, it will be made relative before being tested for a glob match. + * If filename is absolute and not contained within the root, it will be tested as is. + * @param filename full path of the file to check. + */ + match(filename) { + return this.matchEx(filename).matched; + } +}; +function buildMatcherFn(patterns, options) { + const { nodePath: path26, dot, nobrace } = options; + const makeReOptions = { dot, nobrace }; + const rules = patterns.map((pattern, index) => ({ pattern, index })).filter((r) => !!r.pattern.glob).filter((r) => !r.pattern.glob.startsWith("#")).map(({ pattern, index }) => { + const matchNeg = pattern.glob.match(/^!/); + const glob2 = pattern.glob.replace(/^!/, ""); + const isNeg = matchNeg && matchNeg[0].length & 1 && true || false; + const reg = import_micromatch.default.makeRe(glob2, makeReOptions); + const fn2 = (filename) => { + const match2 = filename.match(reg); + return !!match2; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseTyposFile = exports.parseTyposLine = exports.processEntriesToTyposDef = exports.sanitizeIntoTypoDef = exports.createTyposDefFromEntries = void 0; - var assert_1 = __importDefault(require("assert")); - var util_js_1 = require_util9(); - function assertString(v) { - (0, assert_1.default)(typeof v === "string", "A string was expected."); - return true; - } - var suggestionsSeparator = /[,]/; - var typoSuggestionsSeparator = /:|->/; - var typoEntrySeparator = /[\n;]/; - var inlineComment = /#.*/gm; - function createTyposDefFromEntries(entries) { - const def = /* @__PURE__ */ Object.create(null); - for (const entry of entries) { - (0, util_js_1.appendToDef)(def, entry); - } - return def; - } - exports.createTyposDefFromEntries = createTyposDefFromEntries; - function normalize(s) { - return s.normalize(); - } - function trimAndFilter(lines) { - return lines.map((s) => s.trim()).filter((s) => !!s).map(normalize); - } - function cleanSugs(rawSugs) { - const sugs = trimAndFilter(rawSugs); - return sugs.length === 1 ? sugs[0] : sugs.length ? sugs : false; - } - function splitSuggestionsValue(value) { - return cleanSugs(value.split(suggestionsSeparator)); - } - function sanitizeIntoTypoDef(dirtyDef) { - if (!dirtyDef || typeof dirtyDef !== "object") - return void 0; - const def = (0, util_js_1.createTyposDef)(); - for (const [rawKey, value] of Object.entries(dirtyDef)) { - const key = normalize(rawKey.trim()); - if (!key) - continue; - if (typeof value === "string") { - def[key] = splitSuggestionsValue(value); + return { pattern, index, isNeg, fn: fn2, reg }; + }); + const negRules = rules.filter((r) => r.isNeg); + const posRules = rules.filter((r) => !r.isNeg); + const fn = (filename) => { + filename = path26.resolve(path26.normalize(filename)); + function testRules(rules2, matched) { + for (const rule of rules2) { + const pattern = rule.pattern; + const root = pattern.root; + const isRelPat = !pattern.isGlobalPattern; + if (isRelPat && !doesRootContainPath(root, filename, path26)) { continue; } - if (Array.isArray(value)) { - const sugs = cleanSugs(value.filter(assertString)); - def[key] = sugs; - continue; + const relName = isRelPat ? path26.relative(root, filename) : filename; + const fname = path26.sep === "\\" ? relName.replace(/\\/g, "/") : relName; + if (rule.fn(fname)) { + return { + matched, + glob: pattern.glob, + root, + pattern, + index: rule.index, + isNeg: rule.isNeg + }; } - (0, assert_1.default)(value === false, "Unexpected suggestion type."); - def[key] = false; - } - return def; - } - exports.sanitizeIntoTypoDef = sanitizeIntoTypoDef; - function processEntriesToTyposDef(entries) { - const def = isIterable2(entries) ? reduceToTyposDef(entries) : entries; - const result = sanitizeIntoTypoDef(def); - (0, assert_1.default)(result); - return result; - } - exports.processEntriesToTyposDef = processEntriesToTyposDef; - function reduceToTyposDef(entries) { - const def = (0, util_js_1.createTyposDef)(); - for (const entry of entries) { - (0, util_js_1.appendToDef)(def, parseTyposLine(entry)); - } - return def; - } - function parseTyposLine(line) { - if (!line) - return void 0; - if (typeof line === "string") { - const def = (0, util_js_1.createTyposDef)(); - for (const subEntry of splitIntoLines(line)) { - const [left, right] = splitEntry(subEntry); - const typo = left.trim(); - if (!right) - return typo; - const sugs = splitSuggestionsValue(right); - def[typo] = sugs; - } - return def; - } - if (Array.isArray(line)) { - const [key, ...sugs] = line.filter(assertString).map((s) => s.trim()); - if (!key) - return void 0; - return [key, ...sugs]; } - return sanitizeIntoTypoDef(line); - } - exports.parseTyposLine = parseTyposLine; - function splitIntoLines(content) { - return trimAndFilter(normalize(content).split(typoEntrySeparator)); } - function splitEntry(line) { - return line.split(typoSuggestionsSeparator, 2); - } - function parseTyposFile(content) { - const lines = splitIntoLines(content.replace(inlineComment, "")); - return reduceToTyposDef(lines); - } - exports.parseTyposFile = parseTyposFile; - function isIterable2(v) { - return Symbol.iterator in v; - } - } -}); + return testRules(negRules, false) || testRules(posRules, true) || { matched: false }; + }; + return fn; +} -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/index.js -var require_Typos = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractAllSuggestions = exports.createTyposDef = exports.processEntriesToTyposDef = exports.parseTyposLine = exports.parseTyposFile = void 0; - var typosParser_js_1 = require_typosParser(); - Object.defineProperty(exports, "parseTyposFile", { enumerable: true, get: function() { - return typosParser_js_1.parseTyposFile; - } }); - Object.defineProperty(exports, "parseTyposLine", { enumerable: true, get: function() { - return typosParser_js_1.parseTyposLine; - } }); - Object.defineProperty(exports, "processEntriesToTyposDef", { enumerable: true, get: function() { - return typosParser_js_1.processEntriesToTyposDef; - } }); - var util_js_1 = require_util9(); - Object.defineProperty(exports, "createTyposDef", { enumerable: true, get: function() { - return util_js_1.createTyposDef; - } }); - Object.defineProperty(exports, "extractAllSuggestions", { enumerable: true, get: function() { - return util_js_1.extractAllSuggestions; - } }); +// src/action.ts +var path25 = __toESM(require("path")); + +// src/ActionParams.ts +var import_fs = require("fs"); +var defaultActionParams = { + github_token: "", + files: "", + incremental_files_only: "true", + config: "", + root: "", + inline: "warning", + strict: "true", + verbose: "false", + check_dot_files: "explicit" +}; +function applyDefaults(params) { + const results = { ...params }; + const alias = results; + for (const [key, value] of Object.entries(defaultActionParams)) { + alias[key] = alias[key] || value; } -}); + return results; +} +function validateToken(params) { + const token = params.github_token; + return !token ? "Missing GITHUB Token" : void 0; +} +function validateConfig(params) { + const config = params.config; + const success = !config || (0, import_fs.existsSync)(config); + return !success ? `Configuration file "${config}" not found.` : void 0; +} +function validateRoot(params) { + const root = params.root; + const success = !root || (0, import_fs.existsSync)(root); + return !success ? `Root path does not exist: "${root}"` : void 0; +} +function validateInlineLevel(params) { + const inline = params.inline; + const success = isInlineWorkflowCommand(inline); + return !success ? `Invalid inline level (${inline}), must be one of (error, warning, none)` : void 0; +} +var validateStrict = validateTrueFalse("strict", "Invalid strict setting, must be one of (true, false)"); +var validateIncrementalFilesOnly = validateTrueFalse( + "incremental_files_only", + "Invalid incremental_files_only setting, must be one of (true, false)" +); +var validateVerbose = validateTrueFalse("verbose", "Invalid verbose setting, must be one of (true, false)"); +function validateTrueFalse(key, msg) { + return (params) => { + const value = params[key]; + const success = value === "true" || value === "false"; + return !success ? msg : void 0; + }; +} +var inlineWorkflowCommandSet = { + error: true, + warning: true, + none: true +}; +function isInlineWorkflowCommand(cmd) { + return !!inlineWorkflowCommandSet[cmd]; +} +function validateActionParams(params, logError2) { + const validations = [ + validateToken, + validateConfig, + validateRoot, + validateInlineLevel, + validateStrict, + validateIncrementalFilesOnly, + validateVerbose + ]; + const success = validations.map((fn) => fn(params)).map((msg) => !msg || (logError2(msg), false)).reduce((a, b) => a && b, true); + if (!success) { + throw new AppError("Bad Configuration."); + } +} -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/TyposDictionary.js -var require_TyposDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/TyposDictionary.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createTyposDictionary = void 0; - var sync_1 = require_sync(); - var AutoResolve_js_1 = require_AutoResolve2(); - var textMappers_js_1 = require_textMappers(); - var defaults = __importStar(require_defaults()); - var index_js_1 = require_Typos(); - var util_js_1 = require_util9(); - var TyposDictionaryImpl = class { - constructor(name, source, typosDef, ignoreList) { - this.name = name; - this.source = source; - this.typosDef = typosDef; - this.options = {}; - this.type = "typos"; - this.isDictionaryCaseSensitive = true; - this.size = Object.keys(typosDef).length; - this.explicitIgnoreWords = (0, util_js_1.extractIgnoreValues)(typosDef, "!"); - this.suggestions = (0, util_js_1.extractAllSuggestions)(typosDef); - this.ignoreWords = new Set((0, sync_1.pipe)(this.explicitIgnoreWords, (0, sync_1.opAppend)(ignoreList || []))); - this.suggestionsLower = new Set((0, sync_1.pipe)(this.suggestions, textMappers_js_1.mapperRemoveCaseAndAccents)); - this.containsNoSuggestWords = this.ignoreWords.size > 0; - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param _word - the word - * @param _options - options - * @returns always false - */ - has(_word, _options) { - return false; - } - /** A more detailed search for a word, might take longer than `has` */ - find(word, options) { - const result = this._findForms(word, options?.ignoreCase ?? defaults.ignoreCase); - if (result === false) - return void 0; - const { found, ignore } = result; - return { found, forbidden: !ignore, noSuggest: ignore }; - } - _findForms(word, ignoreCaseAndAccents) { - const lcWord = word.toLowerCase(); - if (this.ignoreWords.has(word)) { - return { found: word, ignore: true }; - } - if (this.suggestions.has(word)) { - return false; - } - if (ignoreCaseAndAccents) { - if (this.suggestionsLower.has(lcWord)) { - return false; - } - if (this.ignoreWords.has(lcWord)) { - return { found: lcWord, ignore: true }; - } - } - if (word in this.typosDef) - return { found: word, ignore: false }; - if (lcWord in this.typosDef) - return { found: lcWord, ignore: false }; - return false; - } - isForbidden(word, ignoreCaseAndAccents = defaults.isForbiddenIgnoreCaseAndAccents) { - const found = this._findForms(word, ignoreCaseAndAccents); - return found !== false && !found.ignore; - } - isNoSuggestWord(word, options) { - const result = this.find(word, options); - return result?.noSuggest ?? false; - } - /** - * Determine if the word can appear in a list of suggestions. - * @param word - word - * @param ignoreCaseAndAccents - ignore case. - * @returns true if a word is suggested, otherwise false. - */ - isSuggestedWord(word, ignoreCaseAndAccents = defaults.isForbiddenIgnoreCaseAndAccents) { - if (this.suggestions.has(word)) - return true; - const lcWord = word.toLowerCase(); - return ignoreCaseAndAccents && (this.suggestions.has(lcWord) || this.suggestionsLower.has(lcWord)); - } - suggest(word) { - return this.getPreferredSuggestions(word); - } - _suggest(word) { - if (this.ignoreWords.has(word)) - return []; - if (!(word in this.typosDef)) - return void 0; - const sug = this.typosDef[word]; - const isPreferred = true; - if (!sug) - return []; - if (typeof sug === "string") { - return [ - { - word: sug, - cost: 1, - isPreferred - } - ]; - } - return sug.map((word2, index) => ({ word: word2, cost: index + 1, isPreferred })); - } - genSuggestions(collector) { - const sugs = this.suggest(collector.word); - sugs.forEach((result) => collector.add(result)); - } - getPreferredSuggestions(word) { - return this._suggest(word) || this._suggest(word.toLowerCase()) || []; - } - mapWord(word) { - return word; - } - getErrors() { - return []; +// src/getActionParams.ts +var core = __toESM(require_core()); +function getActionParams() { + return applyDefaults({ + github_token: core.getInput("github_token", { required: true }), + files: core.getInput("files"), + incremental_files_only: tf(core.getInput("incremental_files_only")), + config: core.getInput("config"), + root: core.getInput("root"), + inline: core.getInput("inline").toLowerCase(), + strict: tf(core.getInput("strict")), + verbose: tf(core.getInput("verbose")), + check_dot_files: tf(core.getInput("check_dot_files")) + }); +} +function tf(v) { + const mapValues = { + true: "true", + t: "true", + false: "false", + f: "false", + "0": "false", + "1": "true" + }; + v = typeof v === "boolean" || typeof v === "number" ? v ? "true" : "false" : v; + v = v.toString(); + v = v.toLowerCase(); + v = mapValues[v] || v; + return v; +} + +// src/github.ts +var import_plugin_rest_endpoint_methods = __toESM(require_dist_node11()); +async function getPullRequestFiles(git, prRef) { + const { owner, repo, pull_number } = prRef; + const { rest } = (0, import_plugin_rest_endpoint_methods.restEndpointMethods)(git); + const commits = await rest.pulls.listCommits({ owner, repo, pull_number }); + return fetchFilesForCommits(git, prRef, commits.data.map((c) => c.sha).filter(isString)); +} +function isString(s) { + return typeof s === "string"; +} +async function fetchFilesForCommits(git, context, commitIds) { + const files = /* @__PURE__ */ new Set(); + for await (const file of fetchFilesForCommitsX(git, context, commitIds)) { + files.add(file); + } + return files; +} +async function* fetchFilesForCommitsX(git, context, commitIds) { + const { owner, repo } = context; + const { rest } = (0, import_plugin_rest_endpoint_methods.restEndpointMethods)(git); + for (const ref of commitIds) { + const commit = await rest.repos.getCommit({ owner, repo, ref }); + const files = commit.data.files; + if (!files) + continue; + for (const f of files) { + if (f.filename) { + yield f.filename; } - }; - var createCache2 = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createTyposDictionary(entries, name, source) { - return createCache2.get(entries, () => { - const def = (0, index_js_1.processEntriesToTyposDef)(entries); - return new TyposDictionaryImpl(name, source, def); - }); } - exports.createTyposDictionary = createTyposDictionary; } -}); +} -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/FlagWordsDictionary.js -var require_FlagWordsDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/FlagWordsDictionary.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFlagWordsDictionary = void 0; - var sync_1 = require_sync(); - var cspell_trie_lib_1 = require_cjs5(); - var AutoResolve_js_1 = require_AutoResolve2(); - var Defaults = __importStar(require_defaults()); - var SpellingDictionary_js_1 = require_SpellingDictionary(); - var SpellingDictionaryFromTrie_js_1 = require_SpellingDictionaryFromTrie(); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - var TyposDictionary_js_1 = require_TyposDictionary(); - var FlagWordsDictionaryTrie = class extends SpellingDictionaryFromTrie_js_1.SpellingDictionaryFromTrie { - constructor(trie, name, source) { - super(trie, name, SpellingDictionary_js_1.defaultOptions, source); - this.name = name; - this.source = source; - this.containsNoSuggestWords = false; - this.options = {}; - this.isDictionaryCaseSensitive = true; - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param _word - the word - * @param _options - options - * @returns always false - */ - has(_word, _options) { - return false; - } - find(word, hasOptions) { - const f = super.find(word, hasOptions); - if (!f || !f.forbidden) - return void 0; - return f; - } - suggest() { - return []; - } - genSuggestions() { - return; - } +// src/reporter.ts +var core2 = __toESM(require_core()); +var import_command = __toESM(require_command()); +var import_vscode_uri = __toESM(require_umd()); +var path = __toESM(require("path")); +function nullEmitter(_msg) { +} +var CSpellReporterForGithubAction = class { + constructor(reportIssueCommand, options, logger = core2) { + this.reportIssueCommand = reportIssueCommand; + this.options = options; + this.logger = logger; + this.issues = []; + this.issueCounts = /* @__PURE__ */ new Map(); + this.result = { + files: -1, + filesWithIssues: /* @__PURE__ */ new Set(), + issues: -1, + errors: -1, + cachedFiles: 0 }; - var FlagWordsDictionary = class { - constructor(name, source, dictTypos, dictTrie) { - this.name = name; - this.source = source; - this.dictTypos = dictTypos; - this.dictTrie = dictTrie; - this.containsNoSuggestWords = false; - this.options = {}; - this.type = "flag-words"; - this.isDictionaryCaseSensitive = true; - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param word - the word - * @param options - options - * @returns always false - */ - has(word, options) { - return this.dictTypos.has(word, options) || this.dictTrie?.has(word, options) || false; - } - /** A more detailed search for a word, might take longer than `has` */ - find(word, options) { - const findTypos = this.dictTypos.find(word, options); - if (findTypos) - return findTypos; - const ignoreCase = options?.ignoreCase ?? Defaults.ignoreCase; - if (this.dictTypos.isSuggestedWord(word, ignoreCase)) - return void 0; - return this.dictTrie?.find(word, options); - } - isForbidden(word, ignoreCaseAndAccents = Defaults.isForbiddenIgnoreCaseAndAccents) { - const findResult = this.find(word, { ignoreCase: ignoreCaseAndAccents }); - return findResult?.forbidden || false; - } - isNoSuggestWord(word, options) { - return this.dictTrie?.isNoSuggestWord(word, options) || this.dictTypos.isNoSuggestWord(word, options); - } - suggest(...args) { - const [word] = args; - const suggestOptions = (0, SpellingDictionaryMethods_js_1.suggestArgsToSuggestOptions)(args); - return this.dictTypos.suggest(word, suggestOptions); - } - getPreferredSuggestions(word) { - return this.dictTypos.getPreferredSuggestions(word); - } - genSuggestions() { - return; - } - mapWord(word) { - return word; - } - get size() { - return this.dictTypos.size + (this.dictTrie?.size || 0); - } - getErrors() { - return []; - } + this.finished = false; + this.reporter = { + debug: (...args) => this._debug(...args), + error: (...args) => this._error(...args), + info: (...args) => this._info(...args), + issue: (...args) => this._issue(...args), + progress: (...args) => this._progress(...args), + result: (...args) => this._result(...args) }; - var createCache2 = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createFlagWordsDictionary(wordList, name, source) { - return createCache2.get(wordList, () => { - const testSpecialCharacters = /[~*+]/; - const { t: specialWords, f: typoWords } = bisect((0, cspell_trie_lib_1.parseDictionaryLines)(wordList, { stripCaseAndAccents: false }), (line) => testSpecialCharacters.test(line)); - const trieDict = specialWords.size ? buildTrieDict(specialWords, name, source) : void 0; - const typosDict = (0, TyposDictionary_js_1.createTyposDictionary)(typoWords, name, source); - if (!trieDict) - return typosDict; - return new FlagWordsDictionary(name, source, typosDict, trieDict); - }); + this.verbose = options.verbose; + } + _issue(issue) { + const { issues, issueCounts } = this; + const uri = issue.uri; + uri && issueCounts.set(uri, (issueCounts.get(uri) || 0) + 1); + issues.push(issue); + } + _info(message, _msgType) { + this._debug(message); + } + _debug(message) { + nullEmitter(message); + } + _progress(progress) { + if (!this.verbose || !isProgressFileComplete(progress)) { + return; } - exports.createFlagWordsDictionary = createFlagWordsDictionary; - var regExpCleanIgnore = /^(!!)+/; - function buildTrieDict(words, name, source) { - const trie = (0, cspell_trie_lib_1.buildTrieFast)((0, sync_1.pipe)(words, (0, sync_1.opMap)((w) => "!" + w), (0, sync_1.opMap)((w) => w.replace(regExpCleanIgnore, "")))); - return new FlagWordsDictionaryTrie(trie, name, source); - } - function bisect(values, predicate) { - const t = /* @__PURE__ */ new Set(); - const f = /* @__PURE__ */ new Set(); - for (const v of values) { - if (predicate(v)) { - t.add(v); - } else { - f.add(v); - } - } - return { t, f }; + const { issueCounts, logger } = this; + const issueCount = issueCounts.get(progress.filename) || 0; + const { fileNum, fileCount, filename, elapsedTimeMs } = progress; + const issues = issueCount ? ` issues: ${issueCount}` : ""; + const timeMsg = elapsedTimeMs ? `(${elapsedTimeMs.toFixed(2)}ms)` : "-"; + logger.info(`${fileNum}/${fileCount} ${filename}${issues} ${timeMsg}`); + } + _error(message, error2) { + const { logger } = this; + logger.error(`${message} + name: ${error2.name} + msg: ${error2.message} + stack: +${error2.stack} + `); + return; + } + _result(result) { + Object.assign(this.result, result); + this.finished = true; + const command = this.reportIssueCommand; + if (!["error", "warning"].includes(command)) { + return; } + const cwd = process.cwd(); + this.issues.forEach((item) => { + (0, import_command.issueCommand)( + command, + { + file: relative2(cwd, item.uri || ""), + line: item.row, + col: item.col + }, + `Unknown word (${item.text})` + ); + console.warn(`${relative2(cwd, item.uri || "")}:${item.row}:${item.col} Unknown word (${item.text})`); + }); } -}); +}; +function isProgressFileComplete(p) { + return p.type === "ProgressFileComplete"; +} +function relative2(cwd, fileUri) { + const fsPath = import_vscode_uri.URI.parse(fileUri).fsPath; + return path.relative(cwd, fsPath); +} -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/IgnoreWordsDictionary.js -var require_IgnoreWordsDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/IgnoreWordsDictionary.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createIgnoreWordsDictionary = void 0; - var sync_1 = require_sync(); - var cspell_trie_lib_1 = require_cjs5(); - var AutoResolve_js_1 = require_AutoResolve2(); - var createSpellingDictionary_js_1 = require_createSpellingDictionary(); - var Defaults = __importStar(require_defaults()); - var NormalizeForm = "NFC"; - var IgnoreWordsDictionary = class { - constructor(name, source, words) { - this.name = name; - this.source = source; - this.containsNoSuggestWords = true; - this.options = {}; - this.type = "ignore"; - this.isDictionaryCaseSensitive = true; - this.dict = new Set(words); - this.dictNonStrict = new Set((0, sync_1.pipe)(this.dict, (0, sync_1.opFilter)((w) => w.startsWith("~")), (0, sync_1.opMap)((w) => w.slice(1)))); - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param _word - the word - * @param _options - options - * @returns always false - */ - has(word, options) { - const nWord = word.normalize(NormalizeForm); - if (this.dict.has(nWord)) - return true; - const lcWord = nWord.toLowerCase(); - if (this.dict.has(lcWord)) - return true; - const ignoreCase = options?.ignoreCase ?? Defaults.ignoreCase; - return ignoreCase && (this.dictNonStrict.has(nWord) || this.dictNonStrict.has(lcWord)); - } - /** A more detailed search for a word, might take longer than `has` */ - find(word, options) { - const nWord = word.normalize(NormalizeForm); - if (this.dict.has(nWord)) - return { found: nWord, forbidden: false, noSuggest: true }; - const lcWord = nWord.toLowerCase(); - if (this.dict.has(lcWord)) - return { found: lcWord, forbidden: false, noSuggest: true }; - const ignoreCase = options?.ignoreCase ?? Defaults.ignoreCase; - if (!ignoreCase) - return void 0; - if (this.dictNonStrict.has(nWord)) - return { found: nWord, forbidden: false, noSuggest: true }; - return this.dictNonStrict.has(lcWord) && { found: lcWord, forbidden: false, noSuggest: true } || void 0; - } - isForbidden(_word, _ignoreCase) { - return false; - } - isNoSuggestWord(word, options) { - return this.has(word, options); - } - suggest() { - return []; - } - genSuggestions() { - return; - } - mapWord(word) { - return word; - } - get size() { - return this.dict.size; - } - getErrors() { - return []; - } - }; - var createCache2 = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createIgnoreWordsDictionary(wordList, name, source) { - return createCache2.get(wordList, () => { - const testSpecialCharacters = /[*+]/; - const words = [...(0, cspell_trie_lib_1.parseDictionaryLines)(wordList, { stripCaseAndAccents: true })].map((w) => w.normalize(NormalizeForm)); - const hasSpecial = words.findIndex((word) => testSpecialCharacters.test(word)) >= 0; - if (hasSpecial) { - return (0, createSpellingDictionary_js_1.createSpellingDictionary)(words, name, source, { - caseSensitive: true, - noSuggest: true, - weightMap: void 0, - supportNonStrictSearches: true - }); - } - return new IgnoreWordsDictionary(name, source, words); - }); - } - exports.createIgnoreWordsDictionary = createIgnoreWordsDictionary; +// node_modules/@cspell/cspell-pipe/dist/helpers/iteratorToIterable.js +function* iteratorToIterable(iterator) { + let n; + while (!(n = iterator.next()).done) { + yield n.value; } -}); +} +async function* asyncIteratorToAsyncIterable(iterator) { + let n; + while (!(n = await iterator.next()).done) { + yield n.value; + } +} -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryCollection.js -var require_SpellingDictionaryCollection = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryCollection.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.isSpellingDictionaryCollection = exports.createCollection = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var gensequence_1 = require_dist2(); - var util_js_1 = require_util8(); - var Defaults = __importStar(require_defaults()); - var SpellingDictionary_js_1 = require_SpellingDictionary(); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - function identityString(w) { - return w; - } - var SpellingDictionaryCollectionImpl = class { - constructor(dictionaries, name, source) { - this.dictionaries = dictionaries; - this.name = name; - this.options = { weightMap: void 0 }; - this.mapWord = identityString; - this.type = "SpellingDictionaryCollection"; - this._isNoSuggestWord = (word, options) => { - if (!this.containsNoSuggestWords) - return false; - return !!isNoSuggestWordInAnyDictionary(this.dictionaries, word, options || {}); - }; - this.dictionaries = this.dictionaries.sort((a, b) => b.size - a.size); - this.source = source || dictionaries.map((d) => d.name).join(", "); - this.isDictionaryCaseSensitive = this.dictionaries.reduce((a, b) => a || b.isDictionaryCaseSensitive, false); - this.containsNoSuggestWords = this.dictionaries.reduce((a, b) => a || b.containsNoSuggestWords, false); - } - has(word, hasOptions) { - const options = (0, SpellingDictionaryMethods_js_1.hasOptionToSearchOption)(hasOptions); - return !!isWordInAnyDictionary(this.dictionaries, word, options) && !this.isForbidden(word); - } - find(word, hasOptions) { - const options = (0, SpellingDictionaryMethods_js_1.hasOptionToSearchOption)(hasOptions); - return findInAnyDictionary(this.dictionaries, word, options); - } - isNoSuggestWord(word, options) { - return this._isNoSuggestWord(word, options); - } - isForbidden(word, ignoreCaseAndAccents) { - const ignoreCase = ignoreCaseAndAccents ?? Defaults.isForbiddenIgnoreCaseAndAccents; - return !!this._isForbiddenInDict(word, ignoreCase) && !this.isNoSuggestWord(word, { ignoreCase }); - } - suggest(...args) { - const [word] = args; - const suggestOptions = (0, SpellingDictionaryMethods_js_1.suggestArgsToSuggestOptions)(args); - return this._suggest(word, suggestOptions); - } - _suggest(word, suggestOptions) { - const { numSuggestions = SpellingDictionaryMethods_js_1.defaultNumSuggestions, numChanges, ignoreCase, includeTies, timeout } = suggestOptions; - const prefixNoCase = cspell_trie_lib_1.CASE_INSENSITIVE_PREFIX; - const filter = (word2, _cost) => { - return (ignoreCase || word2[0] !== prefixNoCase) && !this.isForbidden(word2) && !this.isNoSuggestWord(word2, suggestOptions); - }; - const collectorOptions = { - numSuggestions, - filter, - changeLimit: numChanges, - includeTies, - ignoreCase, - timeout - }; - const collector = (0, SpellingDictionaryMethods_js_1.suggestionCollector)(word, collectorOptions); - this.genSuggestions(collector, suggestOptions); - return collector.suggestions; - } - get size() { - return this.dictionaries.reduce((a, b) => a + b.size, 0); - } - getPreferredSuggestions(word) { - const sugs = this.dictionaries.flatMap((dict) => dict.getPreferredSuggestions?.(word)).filter(util_js_1.isDefined); - if (sugs.length <= 1) - return sugs; - const unique = /* @__PURE__ */ new Set(); - return sugs.filter((sug) => { - if (unique.has(sug.word)) - return false; - unique.add(sug.word); - return true; - }); - } - genSuggestions(collector, suggestOptions) { - const _suggestOptions = { ...suggestOptions }; - const { compoundMethod = SpellingDictionary_js_1.CompoundWordsMethod.SEPARATE_WORDS } = suggestOptions; - _suggestOptions.compoundMethod = this.options.useCompounds ? SpellingDictionary_js_1.CompoundWordsMethod.JOIN_WORDS : compoundMethod; - this.dictionaries.forEach((dict) => dict.genSuggestions(collector, _suggestOptions)); - } - getErrors() { - return this.dictionaries.reduce((errors, dict) => errors.concat(dict.getErrors?.() || []), []); - } - _isForbiddenInDict(word, ignoreCase) { - return isWordForbiddenInAnyDictionary(this.dictionaries, word, ignoreCase); - } - }; - function createCollection(dictionaries, name, source) { - return new SpellingDictionaryCollectionImpl(dictionaries, name, source); - } - exports.createCollection = createCollection; - function isWordInAnyDictionary(dicts, word, options) { - return (0, gensequence_1.genSequence)(dicts).first((dict) => dict.has(word, options)); - } - function findInAnyDictionary(dicts, word, options) { - const found = dicts.map((dict) => dict.find(word, options)).filter(util_js_1.isDefined); - if (!found.length) - return void 0; - return found.reduce((a, b) => ({ - found: a.forbidden ? a.found : b.forbidden ? b.found : a.found || b.found, - forbidden: a.forbidden || b.forbidden, - noSuggest: a.noSuggest || b.noSuggest - })); - } - function isNoSuggestWordInAnyDictionary(dicts, word, options) { - return (0, gensequence_1.genSequence)(dicts).first((dict) => dict.isNoSuggestWord(word, options)); - } - function isWordForbiddenInAnyDictionary(dicts, word, ignoreCase) { - return (0, gensequence_1.genSequence)(dicts).first((dict) => dict.isForbidden(word, ignoreCase)); - } - function isSpellingDictionaryCollection(dict) { - return dict instanceof SpellingDictionaryCollectionImpl; - } - exports.isSpellingDictionaryCollection = isSpellingDictionaryCollection; - exports.__testing__ = { - isWordInAnyDictionary, - isWordForbiddenInAnyDictionary - }; +// node_modules/@cspell/cspell-pipe/dist/helpers/util.js +function toPipeFn(syncFn, asyncFn) { + function _(i) { + return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); } -}); + return _; +} +function isAsyncIterable(i) { + return typeof i[Symbol.asyncIterator] === "function"; +} -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SuggestDictionary.js -var require_SuggestDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SuggestDictionary.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createSuggestDictionary = void 0; - var sync_1 = require_sync(); - var AutoResolve_js_1 = require_AutoResolve2(); - var textMappers_js_1 = require_textMappers(); - var defaults = __importStar(require_defaults()); - var index_js_1 = require_Typos(); - var util_js_1 = require_util9(); - var SuggestDictionaryImpl = class { - constructor(name, source, typosDef) { - this.name = name; - this.source = source; - this.typosDef = typosDef; - this.containsNoSuggestWords = false; - this.options = {}; - this.type = "suggest"; - this.isDictionaryCaseSensitive = true; - this.size = Object.keys(typosDef).length; - this.suggestions = (0, util_js_1.extractAllSuggestions)(typosDef); - this.suggestionsLower = new Set((0, sync_1.pipe)(this.suggestions, textMappers_js_1.mapperRemoveCaseAndAccents)); - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param _word - the word - * @param _options - options - * @returns always false - */ - has(_word, _options) { - return false; - } - /** A more detailed search for a word, might take longer than `has` */ - find(_word, _options) { - return void 0; - } - isForbidden(_word, _ignoreCaseAndAccents) { - return false; - } - isNoSuggestWord(_word, _options) { - return false; - } - /** - * Determine if the word can appear in a list of suggestions. - * @param word - word - * @param ignoreCaseAndAccents - ignore case. - * @returns true if a word is suggested, otherwise false. - */ - isSuggestedWord(word, ignoreCaseAndAccents = defaults.isForbiddenIgnoreCaseAndAccents) { - if (this.suggestions.has(word)) - return true; - const lcWord = word.toLowerCase(); - return ignoreCaseAndAccents && (this.suggestions.has(lcWord) || this.suggestionsLower.has(lcWord)); - } - suggest(word) { - return this.getPreferredSuggestions(word); - } - _suggest(word) { - if (!(word in this.typosDef)) - return void 0; - const sug = this.typosDef[word]; - const isPreferred = true; - if (!sug) - return []; - if (typeof sug === "string") { - return [ - { - word: sug, - cost: 1, - isPreferred - } - ]; - } - return sug.map((word2, index) => ({ word: word2, cost: index + 1, isPreferred })); - } - getPreferredSuggestions(word) { - return this._suggest(word) || this._suggest(word.toLowerCase()) || []; - } - genSuggestions(collector) { - const sugs = this.suggest(collector.word); - sugs.forEach((result) => collector.add(result)); - } - mapWord(word) { - return word; - } - getErrors() { - return []; - } - }; - var createCache2 = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createSuggestDictionary(entries, name, source) { - return createCache2.get(entries, () => { - const def = (0, index_js_1.processEntriesToTyposDef)(entries); - return new SuggestDictionaryImpl(name, source, def); - }); - } - exports.createSuggestDictionary = createSuggestDictionary; +// node_modules/@cspell/cspell-pipe/dist/helpers/toArray.js +function toArray(i) { + return isAsyncIterable(i) ? toArrayAsync(i) : toArraySync(i); +} +function toArraySync(iter) { + return [...iter]; +} +async function toArrayAsync(iter) { + const collection = []; + for await (const i of iter) { + collection.push(i); + } + return collection; +} + +// node_modules/@cspell/cspell-pipe/dist/helpers/toAsyncIterable.js +async function* mergeAsyncIterables(iter, ...rest) { + for await (const i of [iter, ...rest]) { + yield* i; } +} +var toAsyncIterable = mergeAsyncIterables; + +// node_modules/@cspell/cspell-pipe/dist/operators/index.js +var operators_exports = {}; +__export(operators_exports, { + opAppend: () => opAppend, + opAppendAsync: () => opAppendAsync, + opAppendSync: () => opAppendSync, + opAwaitAsync: () => opAwaitAsync, + opCombineAsync: () => opCombineAsync, + opCombineSync: () => opCombineSync, + opConcatMap: () => opConcatMap, + opConcatMapAsync: () => opConcatMapAsync, + opConcatMapSync: () => opConcatMapSync, + opFilter: () => opFilter, + opFilterAsync: () => opFilterAsync, + opFilterSync: () => opFilterSync, + opFirst: () => opFirst, + opFirstAsync: () => opFirstAsync, + opFirstSync: () => opFirstSync, + opFlatten: () => opFlatten, + opFlattenAsync: () => opFlattenAsync, + opFlattenSync: () => opFlattenSync, + opJoinStrings: () => opJoinStrings, + opJoinStringsAsync: () => opJoinStringsAsync, + opJoinStringsSync: () => opJoinStringsSync, + opLast: () => opLast, + opLastAsync: () => opLastAsync, + opLastSync: () => opLastSync, + opMap: () => opMap, + opMapAsync: () => opMapAsync, + opMapSync: () => opMapSync, + opReduceAsync: () => opReduceAsync, + opReduceSync: () => opReduceSync, + opSkip: () => opSkip, + opSkipAsync: () => opSkipAsync, + opSkipSync: () => opSkipSync, + opTake: () => opTake, + opTakeAsync: () => opTakeAsync, + opTakeSync: () => opTakeSync, + opTap: () => opTap, + opTapAsync: () => opTapAsync, + opTapSync: () => opTapSync, + opUnique: () => opUnique, + opUniqueAsync: () => opUniqueAsync, + opUniqueSync: () => opUniqueSync }); -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/createInlineSpellingDictionary.js -var require_createInlineSpellingDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/createInlineSpellingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createInlineSpellingDictionary = void 0; - var AutoResolve_js_1 = require_AutoResolve2(); - var util_js_1 = require_util8(); - var createSpellingDictionary_js_1 = require_createSpellingDictionary(); - var FlagWordsDictionary_js_1 = require_FlagWordsDictionary(); - var IgnoreWordsDictionary_js_1 = require_IgnoreWordsDictionary(); - var SpellingDictionaryCollection_js_1 = require_SpellingDictionaryCollection(); - var SuggestDictionary_js_1 = require_SuggestDictionary(); - var cache = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createInlineSpellingDictionary(inlineDict, source) { - return cache.get(inlineDict, () => { - const { words, flagWords, ignoreWords, suggestWords, name } = inlineDict; - const dictSources = [ - words && (0, createSpellingDictionary_js_1.createSpellingDictionary)(words, name + "-words", source, inlineDict), - flagWords && (0, FlagWordsDictionary_js_1.createFlagWordsDictionary)(flagWords, name + "-flag-words", source), - ignoreWords && (0, IgnoreWordsDictionary_js_1.createIgnoreWordsDictionary)(ignoreWords, name + "-ignore-words", source), - suggestWords && (0, SuggestDictionary_js_1.createSuggestDictionary)(suggestWords, name + "-suggest", source) - ].filter(util_js_1.isDefined); - return (0, SpellingDictionaryCollection_js_1.createCollection)(dictSources, name, source); - }); +// node_modules/@cspell/cspell-pipe/dist/operators/append.js +function opAppendAsync(...iterablesToAppend) { + async function* fn(iter) { + yield* iter; + for (const i of iterablesToAppend) { + yield* i; } - exports.createInlineSpellingDictionary = createInlineSpellingDictionary; } -}); + return fn; +} +function opAppendSync(...iterablesToAppend) { + function* fn(iter) { + yield* iter; + for (const i of iterablesToAppend) { + yield* i; + } + } + return fn; +} +function opAppend(...iterablesToAppend) { + function _(i) { + return isAsyncIterable(i) ? opAppendAsync(...iterablesToAppend)(i) : opAppendSync(...iterablesToAppend)(i); + } + return _; +} -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/index.js -var require_SpellingDictionary2 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createTyposDictionary = exports.createSuggestDictionary = exports.createSpellingDictionaryFromTrieFile = exports.createCollection = exports.createIgnoreWordsDictionary = exports.createForbiddenWordsDictionary = exports.createFlagWordsDictionary = exports.createSpellingDictionary = exports.createFailedToLoadDictionary = exports.createInlineSpellingDictionary = exports.createCachingDictionary = void 0; - var CachingDictionary_js_1 = require_CachingDictionary(); - Object.defineProperty(exports, "createCachingDictionary", { enumerable: true, get: function() { - return CachingDictionary_js_1.createCachingDictionary; - } }); - var createInlineSpellingDictionary_js_1 = require_createInlineSpellingDictionary(); - Object.defineProperty(exports, "createInlineSpellingDictionary", { enumerable: true, get: function() { - return createInlineSpellingDictionary_js_1.createInlineSpellingDictionary; - } }); - var createSpellingDictionary_js_1 = require_createSpellingDictionary(); - Object.defineProperty(exports, "createFailedToLoadDictionary", { enumerable: true, get: function() { - return createSpellingDictionary_js_1.createFailedToLoadDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function() { - return createSpellingDictionary_js_1.createSpellingDictionary; - } }); - var FlagWordsDictionary_js_1 = require_FlagWordsDictionary(); - Object.defineProperty(exports, "createFlagWordsDictionary", { enumerable: true, get: function() { - return FlagWordsDictionary_js_1.createFlagWordsDictionary; - } }); - Object.defineProperty(exports, "createForbiddenWordsDictionary", { enumerable: true, get: function() { - return FlagWordsDictionary_js_1.createFlagWordsDictionary; - } }); - var IgnoreWordsDictionary_js_1 = require_IgnoreWordsDictionary(); - Object.defineProperty(exports, "createIgnoreWordsDictionary", { enumerable: true, get: function() { - return IgnoreWordsDictionary_js_1.createIgnoreWordsDictionary; - } }); - var SpellingDictionaryCollection_js_1 = require_SpellingDictionaryCollection(); - Object.defineProperty(exports, "createCollection", { enumerable: true, get: function() { - return SpellingDictionaryCollection_js_1.createCollection; - } }); - var SpellingDictionaryFromTrie_js_1 = require_SpellingDictionaryFromTrie(); - Object.defineProperty(exports, "createSpellingDictionaryFromTrieFile", { enumerable: true, get: function() { - return SpellingDictionaryFromTrie_js_1.createSpellingDictionaryFromTrieFile; - } }); - var SuggestDictionary_js_1 = require_SuggestDictionary(); - Object.defineProperty(exports, "createSuggestDictionary", { enumerable: true, get: function() { - return SuggestDictionary_js_1.createSuggestDictionary; - } }); - var TyposDictionary_js_1 = require_TyposDictionary(); - Object.defineProperty(exports, "createTyposDictionary", { enumerable: true, get: function() { - return TyposDictionary_js_1.createTyposDictionary; - } }); +// node_modules/@cspell/cspell-pipe/dist/operators/await.js +async function* _asyncAwait(iter) { + for await (const v of iter) { + yield v; } -}); +} +function opAwaitAsync() { + return _asyncAwait; +} -// node_modules/cspell-dictionary/dist/cjs/index.js -var require_cjs7 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createSuggestDictionary = exports.createSpellingDictionaryFromTrieFile = exports.createSpellingDictionary = exports.createInlineSpellingDictionary = exports.createIgnoreWordsDictionary = exports.createForbiddenWordsDictionary = exports.createFlagWordsDictionary = exports.createFailedToLoadDictionary = exports.createCollection = exports.createCachingDictionary = void 0; - var index_js_1 = require_SpellingDictionary2(); - Object.defineProperty(exports, "createCachingDictionary", { enumerable: true, get: function() { - return index_js_1.createCachingDictionary; - } }); - Object.defineProperty(exports, "createCollection", { enumerable: true, get: function() { - return index_js_1.createCollection; - } }); - Object.defineProperty(exports, "createFailedToLoadDictionary", { enumerable: true, get: function() { - return index_js_1.createFailedToLoadDictionary; - } }); - Object.defineProperty(exports, "createFlagWordsDictionary", { enumerable: true, get: function() { - return index_js_1.createFlagWordsDictionary; - } }); - Object.defineProperty(exports, "createForbiddenWordsDictionary", { enumerable: true, get: function() { - return index_js_1.createForbiddenWordsDictionary; - } }); - Object.defineProperty(exports, "createIgnoreWordsDictionary", { enumerable: true, get: function() { - return index_js_1.createIgnoreWordsDictionary; - } }); - Object.defineProperty(exports, "createInlineSpellingDictionary", { enumerable: true, get: function() { - return index_js_1.createInlineSpellingDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function() { - return index_js_1.createSpellingDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionaryFromTrieFile", { enumerable: true, get: function() { - return index_js_1.createSpellingDictionaryFromTrieFile; - } }); - Object.defineProperty(exports, "createSuggestDictionary", { enumerable: true, get: function() { - return index_js_1.createSuggestDictionary; - } }); +// node_modules/@cspell/cspell-pipe/dist/operators/combine.js +function opCombineAsync(...fns) { + function combine4(iter) { + for (const fn of fns) { + iter = fn(iter); + } + return iter; } -}); + return combine4; +} +function opCombineSync(...fns) { + function combine4(iter) { + for (const fn of fns) { + iter = fn(iter); + } + return iter; + } + return combine4; +} -// node_modules/cspell-lib/dist/cjs/static.js -var require_static = __commonJS({ - "node_modules/cspell-lib/dist/cjs/static.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getCSpellIO = void 0; - var cspell_io_1 = require_cjs3(); - var cspellIO = new cspell_io_1.CSpellIONode(); - function getCSpellIO() { - return cspellIO; +// node_modules/@cspell/cspell-pipe/dist/operators/concatMap.js +function opConcatMapAsync(mapFn) { + async function* fn(iter) { + for await (const v of iter) { + yield* mapFn(v); } - exports.getCSpellIO = getCSpellIO; } -}); + return fn; +} +function opConcatMapSync(mapFn) { + function* fn(iter) { + for (const v of iter) { + yield* mapFn(v); + } + } + return fn; +} +var opConcatMap = (fn) => toPipeFn(opConcatMapSync(fn), opConcatMapAsync(fn)); -// node_modules/@cspell/strong-weak-map/dist/cjs/StrongWeakMap.js -var require_StrongWeakMap = __commonJS({ - "node_modules/@cspell/strong-weak-map/dist/cjs/StrongWeakMap.js"(exports) { - "use strict"; - var _a; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.StrongWeakMap = void 0; - var StrongWeakMap = class { - constructor(init) { - this[_a] = "StrongWeakMap"; - this.map = new Map(init?.map(([k, v]) => [k, new WeakRef(v)])); - } - clear() { - this.map.clear(); - } - /** - * @returns true if an element in the Map existed and has been removed, or false if the element does not exist. - */ - delete(key) { - return this.map.delete(key); - } - /** - * Executes a provided function once per each key/value pair in the Map, in insertion order. - */ - forEach(callbackfn, thisArg) { - if (thisArg) { - callbackfn = callbackfn.bind(thisArg); - } - for (const [key, value] of this) { - callbackfn(value, key, this); - } - } - /** - * Returns a specified element from the Map object. You will get a reference to the value object and any change made to that - * object will effectively modify it inside the Map. - * @returns Returns the element associated with the specified key. - * If no element is associated with the specified key, undefined is returned. - */ - get(key) { - const ref = this.map.get(key); - if (!ref) - return void 0; - const value = ref.deref(); - if (!value) { - this.map.delete(key); - return void 0; - } - return value; - } - /** - * Returns a specified element from the Map. If the element isn't found, the resolver function is called and the result is stored in the map and returned. - */ - autoGet(key, resolver) { - const found = this.get(key); - if (found) - return found; - const created = resolver(key); - this.set(key, created); - return created; - } - /** - * Note: has will cause the value object to live longer. - * See: [WeakRef - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) - * @returns boolean indicating whether an element with the specified key exists or not. - */ - has(key) { - const value = this.get(key); - return !!value; - } - /** - * Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. - */ - set(key, value) { - this.map.set(key, new WeakRef(value)); - return this; - } - /** - * @returns the number of elements in the Map. Note: it is possible that some of the values have been dereferenced - */ - get size() { - return this.map.size; - } - /** Returns an iterable of entries in the map. */ - [Symbol.iterator]() { - return this.entries(); - } - /** - * Returns an iterable of key, value pairs for every entry in the map. - */ - *entries() { - for (const key of this.map.keys()) { - const value = this.get(key); - if (!value) - continue; - yield [key, value]; - } - } - /** - * Returns an iterable of keys in the map - * - * Note: It is possible that the value associated with the key was released. - */ - keys() { - return this.map.keys(); - } - /** - * Returns an iterable of values in the map - */ - *values() { - for (const [_, value] of this) { - yield value; - } - } - /** - * Removes any keys that reference released objects. - */ - cleanKeys() { - [...this]; - return this; - } - }; - exports.StrongWeakMap = StrongWeakMap; - _a = Symbol.toStringTag; +// node_modules/@cspell/cspell-pipe/dist/operators/filter.js +function opFilterAsync(filterFn) { + async function* fn(iter) { + for await (const v of iter) { + const pass = await filterFn(v); + if (pass) + yield v; + } } -}); - -// node_modules/@cspell/strong-weak-map/dist/cjs/index.js -var require_cjs8 = __commonJS({ - "node_modules/@cspell/strong-weak-map/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.StrongWeakMap = void 0; - var StrongWeakMap_js_1 = require_StrongWeakMap(); - Object.defineProperty(exports, "StrongWeakMap", { enumerable: true, get: function() { - return StrongWeakMap_js_1.StrongWeakMap; - } }); + return fn; +} +function opFilterSync(filterFn) { + function* fn(iter) { + for (const v of iter) { + if (filterFn(v)) + yield v; + } } -}); + return fn; +} +function opFilter(fn) { + const asyncFn = opFilterAsync(fn); + const syncFn = opFilterSync(fn); + function _(i) { + return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + } + return _; +} -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/SpellingDictionaryError.js -var require_SpellingDictionaryError = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/SpellingDictionaryError.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isSpellingDictionaryLoadError = exports.SpellingDictionaryLoadError = void 0; - var SpellingDictionaryLoadError = class extends Error { - constructor(uri, options, cause, message) { - super(message); - this.uri = uri; - this.options = options; - this.cause = cause; - this.name = options.name; +// node_modules/@cspell/cspell-pipe/dist/operators/first.js +function opFirstAsync(firstFn) { + async function* fn(iter) { + for await (const v of iter) { + const pass = await firstFn(v); + if (pass) { + yield v; + break; } - }; - exports.SpellingDictionaryLoadError = SpellingDictionaryLoadError; - function isSpellingDictionaryLoadError2(e) { - return e instanceof SpellingDictionaryLoadError; } - exports.isSpellingDictionaryLoadError = isSpellingDictionaryLoadError2; } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryController/DictionaryLoader.js -var require_DictionaryLoader = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryController/DictionaryLoader.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DictionaryLoader = void 0; - var sync_1 = require_sync(); - var strong_weak_map_1 = require_cjs8(); - var cspell_dictionary_1 = require_cjs7(); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var AutoResolve_js_1 = require_AutoResolve(); - var errors_js_1 = require_errors3(); - var SpellingDictionaryError_js_1 = require_SpellingDictionaryError(); - var MAX_AGE = 1e4; - var loaders = { - S: loadSimpleWordList, - C: legacyWordList, - W: wordsPerLineWordList, - T: loadTrie, - default: loadSimpleWordList - }; - var loadersSync = { - S: loadSimpleWordListSync, - C: legacyWordListSync, - W: wordsPerLineWordListSync, - T: loadTrieSync, - default: loadSimpleWordListSync - }; - var LoadingState; - (function(LoadingState2) { - LoadingState2[LoadingState2["Loaded"] = 0] = "Loaded"; - LoadingState2[LoadingState2["Loading"] = 1] = "Loading"; - })(LoadingState || (LoadingState = {})); - var DictionaryLoader = class { - constructor(cspellIO) { - this.cspellIO = cspellIO; - this.dictionaryCache = new strong_weak_map_1.StrongWeakMap(); - this.inlineDictionaryCache = new AutoResolve_js_1.AutoResolveWeakCache(); - this.dictionaryCacheByDef = new strong_weak_map_1.StrongWeakMap(); - this.reader = toReader(cspellIO); - this.readerSync = toReaderSync(cspellIO); - } - loadDictionary(def) { - if ((0, CSpellSettingsInternalDef_js_1.isDictionaryDefinitionInlineInternal)(def)) { - return Promise.resolve(this.loadInlineDict(def)); - } - const { key, entry } = this.getCacheEntry(def); - if (entry) { - return entry.pending.then(([dictionary]) => dictionary); - } - const loadedEntry = this.loadEntry(def.path, def); - this.setCacheEntry(key, loadedEntry, def); - return loadedEntry.pending.then(([dictionary]) => dictionary); - } - loadDictionarySync(def) { - if ((0, CSpellSettingsInternalDef_js_1.isDictionaryDefinitionInlineInternal)(def)) { - return this.loadInlineDict(def); - } - const { key, entry } = this.getCacheEntry(def); - if (entry?.dictionary && entry.loadingState === LoadingState.Loaded) { - return entry.dictionary; - } - const loadedEntry = this.loadEntrySync(def.path, def); - this.setCacheEntry(key, loadedEntry, def); - return loadedEntry.dictionary; - } - /** - * Check to see if any of the cached dictionaries have changed. If one has changed, reload it. - * @param maxAge - Only check the dictionary if it has been at least `maxAge` ms since the last check. - * @param now - optional timestamp representing now. (Mostly used in testing) - */ - async refreshCacheEntries(maxAge = MAX_AGE, now = Date.now()) { - await Promise.all([...this.dictionaryCache.values()].map((entry) => this.refreshEntry(entry, maxAge, now))); - } - getCacheEntry(def) { - const defEntry = this.dictionaryCacheByDef.get(def); - if (defEntry) { - return defEntry; - } - const key = calcKey(def); - const entry = this.dictionaryCache.get(key); - if (entry) { - entry.options = def; - } - return { key, entry }; - } - setCacheEntry(key, entry, def) { - this.dictionaryCache.set(key, entry); - this.dictionaryCacheByDef.set(def, { key, entry }); - } - async refreshEntry(entry, maxAge, now) { - if (now - entry.ts >= maxAge) { - const sig = now + Math.random(); - entry.sig = sig; - entry.ts = now; - const pStat = this.getStat(entry.uri); - const [newStat] = await Promise.all([pStat, entry.pending]); - const hasChanged = !this.isEqual(newStat, entry.stat); - const sigMatches = entry.sig === sig; - if (sigMatches && hasChanged) { - entry.loadingState = LoadingState.Loading; - const key = calcKey(entry.options); - const newEntry = this.loadEntry(entry.uri, entry.options); - this.dictionaryCache.set(key, newEntry); - this.dictionaryCacheByDef.set(entry.options, { key, entry: newEntry }); - } - } - } - loadEntry(uri, options, now = Date.now()) { - options = this.normalizeOptions(uri, options); - const pDictionary = load(this.reader, uri, options).catch((e) => (0, cspell_dictionary_1.createFailedToLoadDictionary)(options.name, uri, new SpellingDictionaryError_js_1.SpellingDictionaryLoadError(uri, options, e, "failed to load"), options)); - const pStat = this.getStat(uri); - const pending = Promise.all([pDictionary, pStat]); - const sig = now + Math.random(); - const entry = { - uri, - options, - ts: now, - stat: void 0, - dictionary: void 0, - pending, - loadingState: LoadingState.Loading, - sig - }; - pending.then(([dictionary, stat2]) => { - entry.stat = stat2; - entry.dictionary = dictionary; - entry.loadingState = LoadingState.Loaded; - return; - }); - return entry; - } - loadEntrySync(uri, options, now = Date.now()) { - options = this.normalizeOptions(uri, options); - const stat2 = this.getStatSync(uri); - const sig = now + Math.random(); - try { - const dictionary = loadSync(this.readerSync, uri, options); - const pending = Promise.resolve([dictionary, stat2]); - return { - uri, - options, - ts: now, - stat: stat2, - dictionary, - pending, - loadingState: LoadingState.Loaded, - sig - }; - } catch (e) { - const error2 = (0, errors_js_1.toError)(e); - const dictionary = (0, cspell_dictionary_1.createFailedToLoadDictionary)(options.name, uri, new SpellingDictionaryError_js_1.SpellingDictionaryLoadError(uri, options, error2, "failed to load"), options); - const pending = Promise.resolve([dictionary, stat2]); - return { - uri, - options, - ts: now, - stat: stat2, - dictionary, - pending, - loadingState: LoadingState.Loaded, - sig - }; - } - } - getStat(uri) { - return this.cspellIO.getStat(uri).catch(errors_js_1.toError); - } - getStatSync(uri) { - try { - return this.cspellIO.getStatSync(uri); - } catch (e) { - return (0, errors_js_1.toError)(e); - } - } - isEqual(a, b) { - if (!b) - return false; - if (isError4(a)) { - return isError4(b) && a.message === b.message && a.name === b.name; - } - return !isError4(b) && !this.cspellIO.compareStats(a, b); - } - normalizeOptions(uri, options) { - if (options.name) - return options; - return { ...options, name: this.cspellIO.uriBasename(uri) }; - } - loadInlineDict(def) { - return this.inlineDictionaryCache.get(def, (def2) => (0, cspell_dictionary_1.createInlineSpellingDictionary)(def2, def2.__source || "memory")); + return fn; +} +function opFirstSync(firstFn) { + function* fn(iter) { + for (const v of iter) { + if (firstFn(v)) { + yield v; + break; } - }; - exports.DictionaryLoader = DictionaryLoader; - function toReader(cspellIO) { - return async function(filename) { - const res = await cspellIO.readFile(filename); - return res.content.split(/\n|\r\n|\r/); - }; } - function toReaderSync(cspellIO) { - return function(filename) { - const res = cspellIO.readFileSync(filename); - return res.content.split(/\n|\r\n|\r/); - }; + } + return fn; +} +function opFirst(fn) { + const asyncFn = opFirstAsync(fn); + const syncFn = opFirstSync(fn); + function _(i) { + return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + } + return _; +} + +// node_modules/@cspell/cspell-pipe/dist/operators/flatten.js +function opFlattenAsync() { + async function* fn(iter) { + for await (const v of iter) { + yield* v; } - var importantOptionKeys = ["name", "noSuggest", "useCompounds", "type"]; - function calcKey(def) { - const path16 = def.path; - const loaderType = determineType(path16, def); - const optValues = importantOptionKeys.map((k) => def[k]?.toString() || ""); - const parts = [path16, loaderType].concat(optValues); - return parts.join("|"); - } - function isError4(e) { - const err = e; - return !!err.message; - } - function determineType(uri, opts) { - const t = opts.type && opts.type in loaders && opts.type || "S"; - const defLoaderType = t; - const defType = uri.endsWith(".trie.gz") ? "T" : defLoaderType; - const regTrieTest = /\.trie\b/i; - return regTrieTest.test(uri) ? "T" : defType; - } - function load(reader2, uri, options) { - const type = determineType(uri, options); - const loader = loaders[type] || loaders.default; - return loader(reader2, uri, options); - } - function loadSync(reader2, uri, options) { - const type = determineType(uri, options); - const loader = loadersSync[type] || loaders.default; - return loader(reader2, uri, options); - } - async function legacyWordList(readLines, filename, options) { - const lines = await readLines(filename); - return _legacyWordListSync(lines, filename, options); - } - function legacyWordListSync(readLinesSync, filename, options) { - const lines = readLinesSync(filename); - return _legacyWordListSync(lines, filename, options); - } - function _legacyWordListSync(lines, filename, options) { - const words = (0, sync_1.pipe)( - lines, - // Remove comments - (0, sync_1.opMap)((line) => line.replace(/#.*/g, "")), - // Split on everything else - (0, sync_1.opConcatMap)((line) => line.split(/[^\w\p{L}\p{M}'’]+/gu)), - (0, sync_1.opFilter)((word) => !!word) - ); - return (0, cspell_dictionary_1.createSpellingDictionary)(words, options.name, filename, options); - } - async function wordsPerLineWordList(readLines, filename, options) { - const lines = await readLines(filename); - return _wordsPerLineWordList(lines, filename, options); - } - function wordsPerLineWordListSync(readLinesSync, filename, options) { - const lines = readLinesSync(filename); - return _wordsPerLineWordList(lines, filename, options); - } - function _wordsPerLineWordList(lines, filename, options) { - const words = (0, sync_1.pipe)( - lines, - // Remove comments - (0, sync_1.opMap)((line) => line.replace(/#.*/g, "")), - // Split on everything else - (0, sync_1.opConcatMap)((line) => line.split(/\s+/gu)), - (0, sync_1.opFilter)((word) => !!word) - ); - return (0, cspell_dictionary_1.createSpellingDictionary)(words, options.name, filename, options); + } + return fn; +} +function opFlattenSync() { + function* fn(iter) { + for (const v of iter) { + yield* v; } - async function loadSimpleWordList(reader2, filename, options) { - const lines = await reader2(filename); - return (0, cspell_dictionary_1.createSpellingDictionary)(lines, options.name, filename, options); + } + return fn; +} +var opFlatten = () => toPipeFn(opFlattenSync(), opFlattenAsync()); + +// node_modules/@cspell/cspell-pipe/dist/operators/joinStrings.js +function opJoinStringsAsync(joinCharacter = ",") { + async function* fn(iter) { + for await (const v of iter) { + const a = await toArray(v); + yield a.join(joinCharacter); } - function loadSimpleWordListSync(readLinesSync, filename, options) { - const lines = readLinesSync(filename); - return (0, cspell_dictionary_1.createSpellingDictionary)(lines, options.name, filename, options); + } + return fn; +} +function opJoinStringsSync(joinCharacter = ",") { + function* fn(iter) { + for (const v of iter) { + const a = toArray(v); + yield a.join(joinCharacter); } - async function loadTrie(readLines, filename, options) { - const lines = await readLines(filename); - return (0, cspell_dictionary_1.createSpellingDictionaryFromTrieFile)(lines, options.name, filename, options); + } + return fn; +} +var opJoinStrings = (joinCharacter) => toPipeFn(opJoinStringsSync(joinCharacter), opJoinStringsAsync(joinCharacter)); + +// node_modules/@cspell/cspell-pipe/dist/operators/last.js +var symNotFound = Symbol("LastNotFound"); +function opLastAsync(lastFn) { + async function* fn(iter) { + let last = symNotFound; + for await (const v of iter) { + const pass = await lastFn(v); + if (pass) { + last = v; + } } - function loadTrieSync(readLinesSync, filename, options) { - const lines = readLinesSync(filename); - return (0, cspell_dictionary_1.createSpellingDictionaryFromTrieFile)(lines, options.name, filename, options); + if (last !== symNotFound) + yield last; + } + return fn; +} +function opLastSync(lastFn) { + function* fn(iter) { + let last = symNotFound; + for (const v of iter) { + if (lastFn(v)) { + last = v; + } } + if (last !== symNotFound) + yield last; } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryController/index.js -var require_DictionaryController = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryController/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DictionaryLoader = void 0; - var DictionaryLoader_js_1 = require_DictionaryLoader(); - Object.defineProperty(exports, "DictionaryLoader", { enumerable: true, get: function() { - return DictionaryLoader_js_1.DictionaryLoader; - } }); + return fn; +} +function opLast(fn) { + const asyncFn = opLastAsync(fn); + const syncFn = opLastSync(fn); + function _(i) { + return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); } -}); + return _; +} -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryLoader.js -var require_DictionaryLoader2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryLoader.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.refreshCacheEntries = exports.loadDictionarySync = exports.loadDictionary = exports.getDictionaryLoader = void 0; - var static_js_1 = require_static(); - var index_js_1 = require_DictionaryController(); - var loader; - function getDictionaryLoader(cspellIO) { - if (loader) - return loader; - return loader = new index_js_1.DictionaryLoader(cspellIO || (0, static_js_1.getCSpellIO)()); - } - exports.getDictionaryLoader = getDictionaryLoader; - function loadDictionary(def) { - return getDictionaryLoader().loadDictionary(def); - } - exports.loadDictionary = loadDictionary; - function loadDictionarySync(def) { - return getDictionaryLoader().loadDictionarySync(def); +// node_modules/@cspell/cspell-pipe/dist/operators/map.js +function opMapAsync(mapFn) { + async function* fn(iter) { + for await (const v of iter) { + yield mapFn(v); } - exports.loadDictionarySync = loadDictionarySync; - async function refreshCacheEntries(maxAge, now) { - return getDictionaryLoader().refreshCacheEntries(maxAge, now); + } + return fn; +} +function opMapSync(mapFn) { + function* fn(iter) { + for (const v of iter) { + yield mapFn(v); } - exports.refreshCacheEntries = refreshCacheEntries; } -}); + return fn; +} +var opMap = (fn) => toPipeFn(opMapSync(fn), opMapAsync(fn)); -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/Dictionaries.js -var require_Dictionaries = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/Dictionaries.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDictionaryInternalSync = exports.getDictionaryInternal = exports.refreshDictionaryCache = exports.loadDictionaryDefsSync = exports.loadDictionaryDefs = void 0; - var cspell_dictionary_1 = require_cjs7(); - var DictionarySettings_js_1 = require_DictionarySettings(); - var util_js_1 = require_util(); - var DictionaryLoader_js_1 = require_DictionaryLoader2(); - function loadDictionaryDefs(defsToLoad) { - return defsToLoad.map(DictionaryLoader_js_1.loadDictionary); - } - exports.loadDictionaryDefs = loadDictionaryDefs; - function loadDictionaryDefsSync(defsToLoad) { - return defsToLoad.map(DictionaryLoader_js_1.loadDictionarySync); - } - exports.loadDictionaryDefsSync = loadDictionaryDefsSync; - function refreshDictionaryCache(maxAge) { - return (0, DictionaryLoader_js_1.refreshCacheEntries)(maxAge); - } - exports.refreshDictionaryCache = refreshDictionaryCache; - var emptyWords = Object.freeze([]); - async function getDictionaryInternal(settings) { - const spellDictionaries = await Promise.all(loadDictionaryDefs((0, DictionarySettings_js_1.calcDictionaryDefsToLoad)(settings))); - return _getDictionaryInternal(settings, spellDictionaries); - } - exports.getDictionaryInternal = getDictionaryInternal; - function getDictionaryInternalSync(settings) { - const spellDictionaries = loadDictionaryDefsSync((0, DictionarySettings_js_1.calcDictionaryDefsToLoad)(settings)); - return _getDictionaryInternal(settings, spellDictionaries); - } - exports.getDictionaryInternalSync = getDictionaryInternalSync; - function _getDictionaryInternal(settings, spellDictionaries) { - const { words = emptyWords, userWords = emptyWords, flagWords = emptyWords, ignoreWords = emptyWords, suggestWords = emptyWords } = settings; - const settingsWordsDictionary = (0, cspell_dictionary_1.createSpellingDictionary)(words, "[words]", "From Settings `words`", { - caseSensitive: true, - weightMap: void 0 - }); - const settingsUserWordsDictionary = userWords.length ? (0, cspell_dictionary_1.createSpellingDictionary)(userWords, "[userWords]", "From Settings `userWords`", { - caseSensitive: true, - weightMap: void 0 - }) : void 0; - const ignoreWordsDictionary = (0, cspell_dictionary_1.createIgnoreWordsDictionary)(ignoreWords, "[ignoreWords]", "From Settings `ignoreWords`"); - const flagWordsDictionary = (0, cspell_dictionary_1.createForbiddenWordsDictionary)(flagWords, "[flagWords]", "From Settings `flagWords`"); - const suggestWordsDictionary = (0, cspell_dictionary_1.createSuggestDictionary)(suggestWords, "[suggestWords]", "From Settings `suggestWords`"); - const dictionaries = [ - ...spellDictionaries, - settingsWordsDictionary, - settingsUserWordsDictionary, - ignoreWordsDictionary, - flagWordsDictionary, - suggestWordsDictionary - ].filter(util_js_1.isDefined); - return (0, cspell_dictionary_1.createCollection)(dictionaries, "dictionary collection"); - } - } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/SpellingDictionary.js -var require_SpellingDictionary3 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/SpellingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.CompoundWordsMethod = exports.createSpellingDictionary = exports.createInlineSpellingDictionary = exports.createCollection = void 0; - var cspell_dictionary_1 = require_cjs7(); - Object.defineProperty(exports, "createCollection", { enumerable: true, get: function() { - return cspell_dictionary_1.createCollection; - } }); - Object.defineProperty(exports, "createInlineSpellingDictionary", { enumerable: true, get: function() { - return cspell_dictionary_1.createInlineSpellingDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function() { - return cspell_dictionary_1.createSpellingDictionary; - } }); - var cspell_trie_lib_1 = require_cjs5(); - Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function() { - return cspell_trie_lib_1.CompoundWordsMethod; - } }); +// node_modules/@cspell/cspell-pipe/dist/operators/reduce.js +function opReduceAsync(reduceFn, initialValue) { + async function* reduce4(head, tail) { + for await (const v of tail) { + head = reduceFn(head, v); + } + yield head; } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/index.js -var require_SpellingDictionary4 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(require_Dictionaries(), exports); - __exportStar(require_SpellingDictionary3(), exports); - __exportStar(require_SpellingDictionaryError(), exports); + async function* fn(iter) { + const ht = initialValue === void 0 ? await headTailAsync(iter) : { head: await initialValue, tail: iter }; + if (!ht) + return; + yield* reduce4(ht.head, ht.tail); } -}); + return fn; +} +function opReduceSync(reduceFn, initialValue) { + function* reduce4(head, tail) { + for (const v of tail) { + head = reduceFn(head, v); + } + yield head; + } + function* fn(iter) { + const ht = initialValue === void 0 ? headTail(iter) : { head: initialValue, tail: iter }; + if (!ht) + return; + yield* reduce4(ht.head, ht.tail); + } + return fn; +} +function headTail(iter) { + const iterator = iter[Symbol.iterator](); + const first3 = iterator.next(); + if (first3.done) + return void 0; + return { head: first3.value, tail: iteratorToIterable(iterator) }; +} +async function headTailAsync(iter) { + const iterator = isIterable(iter) ? iter[Symbol.iterator]() : iter[Symbol.asyncIterator](); + const first3 = await iterator.next(); + if (first3.done) + return void 0; + return { head: first3.value, tail: asyncIteratorToAsyncIterable(iterator) }; +} +function isIterable(i) { + return typeof i[Symbol.iterator] === "function"; +} -// node_modules/cspell-lib/dist/cjs/Settings/InDocSettings.js -var require_InDocSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/InDocSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); +// node_modules/@cspell/cspell-pipe/dist/operators/skip.js +function opSkipAsync(count3) { + async function* fn(iter) { + for await (const v of iter) { + if (count3 > 0) { + --count3; + continue; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.internal = exports.getIgnoreRegExpFromDocument = exports.getIgnoreWordsFromDocument = exports.extractInDocDictionary = exports.regExSpellingGuardLine = exports.regExSpellingGuardNext = exports.regExSpellingGuardBlock = exports.validateInDocumentSettings = exports.getInDocumentSettings = void 0; - var sync_1 = require_sync(); - var gensequence_1 = require_dist2(); - var index_js_1 = require_SpellingDictionary4(); - var Text2 = __importStar(require_text2()); - var util_js_1 = require_util(); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var regExMatchRegEx = /\/.*\/[gimuy]*/; - var regExCSpellInDocDirective = /\b(?:spell-?checker|c?spell)::?(.*)/gi; - var regExCSpellDirectiveKey = /(?<=\b(?:spell-?checker|c?spell)::?)(?!:)(.*)/i; - var regExInFileSettings = [regExCSpellInDocDirective, /\b(LocalWords:?.*)/g]; - var officialDirectives = [ - "enable", - "disable", - "disable-line", - "disable-next", - "disable-next-line", - "word", - "words", - "ignore", - "ignoreWord", - "ignoreWords", - "ignore-word", - "ignore-words", - "includeRegExp", - "ignoreRegExp", - "local", - "locale", - "language", - "dictionaries", - "dictionary", - "forbid", - "forbidWord", - "forbid-word", - "flag", - "flagWord", - "flag-word", - "enableCompoundWords", - "enableAllowCompoundWords", - "disableCompoundWords", - "disableAllowCompoundWords", - "enableCaseSensitive", - "disableCaseSensitive" - ]; - var noSuggestDirectives = /* @__PURE__ */ new Set(["local"]); - var preferredDirectives = [ - "enable", - "disable", - "disable-line", - "disable-next-line", - "words", - "ignore", - "forbid", - "locale", - "dictionary", - "dictionaries", - "enableCaseSensitive", - "disableCaseSensitive" - ]; - var allDirectives = new Set(preferredDirectives.concat(officialDirectives)); - var allDirectiveSuggestions = [ - ...(0, sync_1.pipeSync)(allDirectives, (0, sync_1.opMap)((word) => ({ word }))) - ]; - var dictInDocSettings = (0, index_js_1.createSpellingDictionary)(allDirectives, "Directives", "Directive List", { - supportNonStrictSearches: false - }); - var EmptyWords = []; - Object.freeze(EmptyWords); - var staticInDocumentDictionaryName = `[in-document-dict]`; - function getInDocumentSettings(text) { - const collectedSettings = getPossibleInDocSettings(text).concatMap((a) => parseSettingMatch(a)).reduce((s, setting) => { - return (0, CSpellSettingsServer_js_1.mergeInDocSettings)(s, setting); - }, { id: "in-doc-settings" }); - const { words, flagWords, ignoreWords, suggestWords, dictionaries = [], dictionaryDefinitions = [], ...rest } = collectedSettings; - const dict = (words || flagWords || ignoreWords || suggestWords) && (0, util_js_1.clean)({ - name: staticInDocumentDictionaryName, - words, - flagWords, - ignoreWords, - suggestWords - }); - const dictSettings = dict ? { - dictionaries: dictionaries.concat(staticInDocumentDictionaryName), - dictionaryDefinitions: dictionaryDefinitions.concat(dict) - } : (0, util_js_1.clean)({ - dictionaries: dictionaries.length ? dictionaries : void 0, - dictionaryDefinitions: dictionaryDefinitions.length ? dictionaryDefinitions : void 0 - }); - const settings = { - ...rest, - ...dictSettings - }; - return settings; - } - exports.getInDocumentSettings = getInDocumentSettings; - function validateInDocumentSettings(docText, _settings) { - return (0, sync_1.pipeSync)(getPossibleInDocSettings(docText), (0, sync_1.opMap)(parseSettingMatchValidation), (0, sync_1.opFilter)(util_js_1.isDefined)); - } - exports.validateInDocumentSettings = validateInDocumentSettings; - var settingParsers = [ - [/^(?:enable|disable)(?:allow)?CompoundWords\b(?!-)/i, parseCompoundWords], - [/^(?:enable|disable)CaseSensitive\b(?!-)/i, parseCaseSensitive], - [/^enable\b(?!-)/i, parseEnable], - [/^disable(-line|-next(-line)?)?\b(?!-)/i, parseDisable], - [/^words?\b(?!-)/i, parseWords], - [/^ignore(?:-?words?)?\b(?!-)/i, parseIgnoreWords], - [/^(?:flag|forbid)(?:-?words?)?\b(?!-)/i, parseFlagWords], - [/^ignore_?Reg_?Exp\s+.+$/i, parseIgnoreRegExp], - [/^include_?Reg_?Exp\s+.+$/i, parseIncludeRegExp], - [/^locale?\b(?!-)/i, parseLocale], - [/^language\s\b(?!-)/i, parseLocale], - [/^dictionar(?:y|ies)\b(?!-)/i, parseDictionaries], - [/^LocalWords:/, (w) => parseWords(w.replace(/^LocalWords:?/gi, " "))] - ]; - exports.regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b[\s\S]*?((?:\1\s*enable\b)|$)/gi; - exports.regExSpellingGuardNext = /\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi; - exports.regExSpellingGuardLine = /^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim; - var emptySettings = Object.freeze({}); - var issueMessages = { - unknownDirective: "Unknown CSpell directive" - }; - function parseSettingMatchValidation(matchArray) { - const [fullMatch = ""] = matchArray; - const directiveMatch = fullMatch.match(regExCSpellDirectiveKey); - if (!directiveMatch) - return void 0; - const match = directiveMatch[1]; - const possibleSetting = match.trim(); - if (!possibleSetting) - return void 0; - const start = (matchArray.index || 0) + (directiveMatch.index || 0) + (match.length - match.trimStart().length); - const text = possibleSetting.replace(/^([-\w]+)?.*/, "$1"); - const end = start + text.length; - if (!text) - return void 0; - const matchingParsers = settingParsers.filter(([regex]) => regex.test(possibleSetting)); - if (matchingParsers.length > 0) - return void 0; - const dictSugs = dictInDocSettings.suggest(text, { ignoreCase: false }).map(({ word, isPreferred }) => isPreferred ? { word, isPreferred } : { word }).filter((a) => !noSuggestDirectives.has(a.word)); - const sugs = (0, sync_1.pipeSync)(dictSugs, (0, sync_1.opAppend)(allDirectiveSuggestions), filterUniqueSuggestions); - const suggestionsEx = [...sugs].slice(0, 8); - const suggestions = suggestionsEx.map((s) => s.word); - const issue = { - range: [start, end], - text, - message: issueMessages.unknownDirective, - suggestions, - suggestionsEx - }; - return issue; + yield v; } - function* filterUniqueSuggestions(sugs) { - const map = /* @__PURE__ */ new Map(); - for (const sug of sugs) { - const existing = map.get(sug.word); - if (existing) { - if (sug.isPreferred) { - existing.isPreferred = true; - } - } - yield sug; + } + return fn; +} +function opSkipSync(count3) { + function* fn(iter) { + for (const v of iter) { + if (count3 > 0) { + --count3; + continue; } + yield v; } - function parseSettingMatch(matchArray) { - const [, match = ""] = matchArray; - const possibleSetting = match.trim(); - return settingParsers.filter(([regex]) => regex.test(possibleSetting)).map(([, fn]) => fn).map((fn) => fn(possibleSetting)); - } - function parseCompoundWords(match) { - const allowCompoundWords = /enable/i.test(match); - return { allowCompoundWords }; - } - function parseCaseSensitive(match) { - const caseSensitive = /enable/i.test(match); - return { caseSensitive }; - } - function parseWords(match) { - const words = match.split(/[,\s;]+/g).slice(1).filter((a) => !!a); - return { words }; - } - function parseLocale(match) { - const parts = match.trim().split(/[\s,]+/); - const language = parts.slice(1).join(","); - return language ? { language } : emptySettings; + } + return fn; +} +var opSkip = (count3) => toPipeFn(opSkipSync(count3), opSkipAsync(count3)); + +// node_modules/@cspell/cspell-pipe/dist/operators/take.js +function opTakeAsync(count3) { + async function* fn(iter) { + if (count3 <= 0) + return; + for await (const v of iter) { + yield v; + if (--count3 <= 0) + return; } - function parseIgnoreWords(match) { - const wordsSetting = parseWords(match); - const ignoreWords = wordsSetting.words; - return ignoreWords && ignoreWords.length ? { ignoreWords } : emptySettings; + } + return fn; +} +function opTakeSync(count3) { + function* fn(iter) { + if (count3 <= 0) + return; + for (const v of iter) { + yield v; + if (--count3 <= 0) + return; } - function parseFlagWords(match) { - const wordsSetting = parseWords(match); - const flagWords = wordsSetting.words; - return flagWords && flagWords.length ? { flagWords } : emptySettings; + } + return fn; +} +var opTake = (count3) => toPipeFn(opTakeSync(count3), opTakeAsync(count3)); + +// node_modules/@cspell/cspell-pipe/dist/operators/tap.js +function opTapAsync(tapFn) { + async function* fn(iter) { + for await (const v of iter) { + tapFn(v); + yield v; } - function parseRegEx(match) { - const patterns = [match.replace(/^[^\s]+\s+/, "")].map((a) => { - const m = a.match(regExMatchRegEx); - if (m && m[0]) { - return m[0]; - } - return a.replace(/((?:[^\s]|\\ )+).*/, "$1"); - }); - return patterns; + } + return fn; +} +function opTapSync(tapFn) { + function* fn(iter) { + for (const v of iter) { + tapFn(v); + yield v; } - function parseIgnoreRegExp(match) { - const ignoreRegExpList = parseRegEx(match); - return { ignoreRegExpList }; + } + return fn; +} +var opTap = (fn) => toPipeFn(opTapSync(fn), opTapAsync(fn)); + +// node_modules/@cspell/cspell-pipe/dist/operators/unique.js +function opUniqueAsync(k) { + function fnK(k2) { + async function* fn2(iter) { + const s = /* @__PURE__ */ new Set(); + for await (const v of iter) { + const kk = k2(v); + if (s.has(kk)) + continue; + s.add(kk); + yield v; + } } - function parseIncludeRegExp(match) { - const includeRegExpList = parseRegEx(match); - return { includeRegExpList }; + return fn2; + } + async function* fn(iter) { + const s = /* @__PURE__ */ new Set(); + for await (const v of iter) { + if (s.has(v)) + continue; + s.add(v); + yield v; } - function parseDictionaries(match) { - const dictionaries = match.split(/[,\s]+/g).slice(1); - return { dictionaries }; + } + return k ? fnK(k) : fn; +} +function opUniqueSync(k) { + function fnK(key) { + function* fn2(iter) { + const s = /* @__PURE__ */ new Set(); + for (const v of iter) { + const kk = key(v); + if (s.has(kk)) + continue; + s.add(kk); + yield v; + } } - function getPossibleInDocSettings(text) { - return (0, gensequence_1.genSequence)(regExInFileSettings).concatMap((regexp) => Text2.match(regexp, text)); + return fn2; + } + function* fn(iter) { + const s = /* @__PURE__ */ new Set(); + for (const v of iter) { + if (s.has(v)) + continue; + s.add(v); + yield v; } - function getWordsFromDocument(text) { - const dict = extractInDocDictionary(getInDocumentSettings(text)); - return dict?.words || EmptyWords; + } + return k ? fnK(k) : fn; +} +var opUnique = (getKey) => toPipeFn(opUniqueSync(getKey), opUniqueAsync(getKey)); + +// node_modules/@cspell/cspell-pipe/dist/pipe.js +function pipeAsync(i, ...fns) { + const iter = toAsyncIterable(i); + return opCombineAsync(...fns)(iter); +} +function pipeSync(i, ...fns) { + return opCombineSync(...fns)(i); +} + +// node_modules/@cspell/cspell-pipe/dist/reduce.js +function reduceSync(iter, reduceFn, initialValue) { + const i = initialValue === void 0 ? pipeSync(iter, opReduceSync(reduceFn)) : pipeSync(iter, opReduceSync(reduceFn, initialValue)); + return [...i][0]; +} + +// node_modules/@cspell/cspell-pipe/dist/index.js +var operators = operators_exports; + +// node_modules/cspell-lib/dist/esm/util/Uri.mjs +var import_assert = __toESM(require("assert"), 1); +var import_vscodeUri = __toESM(require_vscodeUri(), 1); +var isFile = /^(?:[a-zA-Z]:|[/\\])/; +var isPossibleUri = /\w:\/\//; +var isUrl = /^(file:|stdin:|https?:|s?ftp:)/; +var STDIN_PROTOCOL = "stdin:"; +function toUri(uriOrFile) { + if (UriImpl.isUri(uriOrFile)) + return uriOrFile; + if (import_vscodeUri.URI.isUri(uriOrFile)) + return UriImpl.from(uriOrFile); + if (uriOrFile instanceof URL) + return UriImpl.parse(uriOrFile.toString()); + if (isUrlLike(uriOrFile)) + return UriImpl.parse(uriOrFile.href); + if (isUri(uriOrFile)) + return UriImpl.from(uriOrFile); + if (isUrl.test(uriOrFile)) + return UriImpl.parse(uriOrFile); + return isFile.test(uriOrFile) && !isPossibleUri.test(uriOrFile) ? UriImpl.file(normalizeDriveLetter(uriOrFile)) : UriImpl.parse(uriOrFile); +} +var hasDriveLetter = /^[A-Z]:/i; +function uriToFilePath(uri) { + const adj = uri.scheme === "stdin" ? { scheme: "file" } : {}; + return normalizeDriveLetter(import_vscodeUri.URI.from(UriImpl.from(uri, adj)).fsPath); +} +function normalizeDriveLetter(path26) { + return hasDriveLetter.test(path26) ? path26[0].toLowerCase() + path26.slice(1) : path26; +} +function isUrlLike(url) { + return !!url && typeof url === "object" && typeof url.href === "string" || false; +} +function isUri(uri) { + if (!uri || typeof uri !== "object") + return false; + if (UriImpl.isUri(uri)) + return true; + if (import_vscodeUri.URI.isUri(uri)) + return true; + const u = uri; + return typeof u.path === "string" && typeof u.scheme === "string"; +} +function basename(uri) { + return import_vscodeUri.Utils.basename(import_vscodeUri.URI.from(uri)); +} +var keys = ["scheme", "authority", "path", "query", "fragment"]; +var UriImpl = class _UriImpl { + constructor(uri) { + this.scheme = uri.scheme || ""; + uri.authority && (this.authority = uri.authority); + this.path = uri.path || ""; + uri.query && (this.query = uri.query); + uri.fragment && (this.fragment = uri.fragment); + } + toString() { + const path26 = this.path; + const base = `${this.scheme}://${this.authority || ""}${path26}`; + const query = this.query && `?${this.query}` || ""; + const fragment = this.fragment && `#${this.fragment}` || ""; + const url = base + query + fragment; + return encodeURI(url); + } + toJson() { + const { scheme, authority, path: path26, query, fragment } = this; + return { scheme, authority, path: path26, query, fragment }; + } + with(change) { + const { scheme, authority, path: path26, query, fragment } = this; + const u = { scheme, authority, path: path26, query, fragment }; + for (const key of keys) { + if (change[key] && typeof change[key] === "string") { + u[key] = change[key]; + } } - function parseEnable(_match) { - return {}; + return new _UriImpl(u); + } + static isUri(uri) { + return uri instanceof _UriImpl; + } + static from(uri, ...parts) { + let u = new _UriImpl(uri); + for (const part of parts) { + u = u.with(part); } - function parseDisable(_match) { - return {}; + return u; + } + static parse(uri) { + if (uri.startsWith(STDIN_PROTOCOL)) { + return _UriImpl.from(parseStdinUri(uri)); } - function extractInDocDictionary(settings) { - const inDocDicts = settings.dictionaryDefinitions?.filter((def) => def.name === staticInDocumentDictionaryName); - const dict = inDocDicts?.[0]; - return dict; + const u = import_vscodeUri.URI.parse(uri); + return _UriImpl.from(u); + } + static file(filename) { + return _UriImpl.from(import_vscodeUri.URI.file(normalizeFilePath(filename))); + } + static stdin(filePath = "") { + return _UriImpl.from(_UriImpl.file(filePath), { scheme: "stdin" }); + } +}; +function normalizeFilePath(path26) { + return normalizeDriveLetter(path26.replace(/\\/g, "/")); +} +function parseStdinUri(uri) { + (0, import_assert.default)(uri.startsWith(STDIN_PROTOCOL)); + const idxSlash = STDIN_PROTOCOL.length; + let idxSlashEnd = idxSlash; + for (; uri[idxSlashEnd] === "/"; ++idxSlashEnd) { + } + const pathStart = idxSlashEnd; + const iH = uri.indexOf("#", pathStart); + const idxHash = iH > 0 ? iH : uri.length; + const iQ = uri.indexOf("?", pathStart); + const idxQ = iQ > 0 && iQ < idxHash ? iQ : idxHash; + const pathEnd = idxQ; + const path26 = uri.slice(pathStart, pathEnd); + const query = idxQ < idxHash ? uri.slice(idxQ + 1, idxHash) : ""; + const hash = uri.slice(idxHash + 1); + const pathPrefix = idxSlashEnd - idxSlash > 2 ? "/" : ""; + return { + scheme: "stdin", + path: pathPrefix + normalizeFilePath(decodeURI(path26)), + query: decodeURI(query), + fragment: decodeURI(hash) + }; +} + +// node_modules/cspell-lib/dist/esm/util/util.mjs +function clean(src) { + const r = src; + for (const key of Object.keys(r)) { + if (r[key] === void 0 || r[key] === null) { + delete r[key]; } - exports.extractInDocDictionary = extractInDocDictionary; - function getIgnoreWordsFromDocument(text) { - const dict = extractInDocDictionary(getInDocumentSettings(text)); - return dict?.ignoreWords || EmptyWords; + } + return r; +} +function scanMap(accFn, init) { + let acc = init; + let first3 = true; + return function(value) { + if (first3 && acc === void 0) { + first3 = false; + acc = value; + return acc; } - exports.getIgnoreWordsFromDocument = getIgnoreWordsFromDocument; - function getIgnoreRegExpFromDocument(text) { - const { ignoreRegExpList = [] } = getInDocumentSettings(text); - return ignoreRegExpList; + acc = accFn(acc, value); + return acc; + }; +} +function isDefined(v) { + return v !== void 0; +} +function isArrayEqual(a, b) { + if (a === b) + return true; + let isMatch = a.length === b.length; + for (let i = 0; i < a.length && isMatch; ++i) { + isMatch = a[i] === b[i]; + } + return isMatch; +} +function doSetsIntersect(a, b) { + function compare4(a2, b2) { + for (const item of a2) { + if (b2.has(item)) + return true; } - exports.getIgnoreRegExpFromDocument = getIgnoreRegExpFromDocument; - exports.internal = { - getPossibleInDocSettings, - getWordsFromDocument, - parseWords, - parseCompoundWords, - parseIgnoreRegExp, - parseIgnoreWords, - staticInDocumentDictionaryName - }; + return false; } -}); + return a.size <= b.size ? compare4(a, b) : compare4(b, a); +} -// node_modules/cspell-lib/dist/cjs/Settings/TextDocumentSettings.js -var require_TextDocumentSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/TextDocumentSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractSettingsFromText = exports.combineTextAndLanguageSettings = void 0; - var CSpellSettingsServer = __importStar(require_CSpellSettingsServer()); - var InDocSettings_js_1 = require_InDocSettings(); - var LanguageSettings_js_1 = require_LanguageSettings(); - function combineTextAndLanguageSettings(settings, text, languageId) { - if (!text) { - return CSpellSettingsServer.toInternalSettings((0, LanguageSettings_js_1.calcSettingsForLanguageId)(settings, languageId)); - } - const docSettings = extractSettingsFromText(text); - const settingsForText = CSpellSettingsServer.mergeSettings(settings, docSettings); - const langSettings = (0, LanguageSettings_js_1.calcSettingsForLanguageId)(settingsForText, languageId); - return CSpellSettingsServer.mergeSettings(langSettings, docSettings); - } - exports.combineTextAndLanguageSettings = combineTextAndLanguageSettings; - function extractSettingsFromText(text) { - return (0, InDocSettings_js_1.getInDocumentSettings)(text); - } - exports.extractSettingsFromText = extractSettingsFromText; - } -}); +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/configLoader.mjs +var json = __toESM(require_src2(), 1); +var import_cosmiconfig = __toESM(require_dist(), 1); -// node_modules/cspell-lib/dist/cjs/textValidation/determineTextDocumentSettings.js -var require_determineTextDocumentSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/determineTextDocumentSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.determineTextDocumentSettings = void 0; - var path16 = __importStar(require("path")); - var LanguageIds_js_1 = require_LanguageIds(); - var index_js_1 = require_Settings(); - var TextDocumentSettings_js_1 = require_TextDocumentSettings(); - var Uri_js_1 = require_Uri(); - function determineTextDocumentSettings(doc, settings) { - const filename = (0, Uri_js_1.uriToFilePath)(doc.uri); - const settingsWithDefaults = (0, index_js_1.mergeSettings)((0, index_js_1.getDefaultSettings)(settings.loadDefaultConfiguration ?? true), (0, index_js_1.getGlobalSettings)(), settings); - const fileSettings = (0, index_js_1.calcOverrideSettings)(settingsWithDefaults, filename); - const languageIds = fileSettings?.languageId?.length ? fileSettings.languageId : doc.languageId ? doc.languageId : getLanguageForFilename(filename); - if (doc.locale) { - fileSettings.language = doc.locale; - } - return (0, TextDocumentSettings_js_1.combineTextAndLanguageSettings)(fileSettings, doc.text, languageIds); - } - exports.determineTextDocumentSettings = determineTextDocumentSettings; - function getLanguageForFilename(filename) { - const basename3 = path16.basename(filename); - return (0, LanguageIds_js_1.getLanguagesForBasename)(basename3); - } +// node_modules/@cspell/cspell-service-bus/dist/esm/errors.mjs +var ErrorUnhandledRequest = class extends Error { + constructor(request) { + super(`Unhandled Request: ${request.type}`); + this.request = request; } -}); - -// node_modules/@cspell/cspell-types/dist/cjs/configFields.js -var require_configFields = __commonJS({ - "node_modules/@cspell/cspell-types/dist/cjs/configFields.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ConfigFields = void 0; - exports.ConfigFields = { - allowCompoundWords: "allowCompoundWords", - cache: "cache", - caseSensitive: "caseSensitive", - description: "description", - dictionaries: "dictionaries", - dictionaryDefinitions: "dictionaryDefinitions", - enabled: "enabled", - enabledLanguageIds: "enabledLanguageIds", - enableFiletypes: "enableFiletypes", - enableGlobDot: "enableGlobDot", - failFast: "failFast", - features: "features", - files: "files", - flagWords: "flagWords", - gitignoreRoot: "gitignoreRoot", - globRoot: "globRoot", - ignorePaths: "ignorePaths", - ignoreRegExpList: "ignoreRegExpList", - ignoreWords: "ignoreWords", - import: "import", - includeRegExpList: "includeRegExpList", - language: "language", - languageId: "languageId", - languageSettings: "languageSettings", - loadDefaultConfiguration: "loadDefaultConfiguration", - maxDuplicateProblems: "maxDuplicateProblems", - maxNumberOfProblems: "maxNumberOfProblems", - minWordLength: "minWordLength", - name: "name", - noConfigSearch: "noConfigSearch", - noSuggestDictionaries: "noSuggestDictionaries", - numSuggestions: "numSuggestions", - overrides: "overrides", - patterns: "patterns", - pnpFiles: "pnpFiles", - readonly: "readonly", - reporters: "reporters", - showStatus: "showStatus", - spellCheckDelayMs: "spellCheckDelayMs", - suggestionNumChanges: "suggestionNumChanges", - suggestionsTimeout: "suggestionsTimeout", - suggestWords: "suggestWords", - useGitignore: "useGitignore", - usePnP: "usePnP", - userWords: "userWords", - validateDirectives: "validateDirectives", - words: "words", - // Experimental - parser: "parser" - }; - } -}); - -// node_modules/@cspell/cspell-types/dist/cjs/CSpellReporter.js -var require_CSpellReporter = __commonJS({ - "node_modules/@cspell/cspell-types/dist/cjs/CSpellReporter.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MessageTypes = exports.IssueType = void 0; - var IssueType2; - (function(IssueType3) { - IssueType3[IssueType3["spelling"] = 0] = "spelling"; - IssueType3[IssueType3["directive"] = 1] = "directive"; - })(IssueType2 = exports.IssueType || (exports.IssueType = {})); - exports.MessageTypes = { - Debug: "Debug", - Info: "Info", - Warning: "Warning" - }; +}; +var ErrorServiceRequestDepthExceeded = class extends Error { + constructor(request, depth) { + super(`Service Request Depth ${depth} Exceeded: ${request.type}`); + this.request = request; + this.depth = depth; } -}); - -// node_modules/@cspell/cspell-types/dist/cjs/index.js -var require_cjs9 = __commonJS({ - "node_modules/@cspell/cspell-types/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MessageTypes = exports.IssueType = exports.ConfigFields = void 0; - var configFields_js_1 = require_configFields(); - Object.defineProperty(exports, "ConfigFields", { enumerable: true, get: function() { - return configFields_js_1.ConfigFields; - } }); - var CSpellReporter_js_1 = require_CSpellReporter(); - Object.defineProperty(exports, "IssueType", { enumerable: true, get: function() { - return CSpellReporter_js_1.IssueType; - } }); - Object.defineProperty(exports, "MessageTypes", { enumerable: true, get: function() { - return CSpellReporter_js_1.MessageTypes; - } }); +}; +var UnhandledHandlerError = class extends Error { + constructor(handlerName, handlerDescription, cause) { + super(`Unhandled Error in Handler: ${handlerName}`); + this.handlerName = handlerName; + this.handlerDescription = handlerDescription; + this.cause = cause; } -}); +}; -// node_modules/cspell-lib/dist/cjs/util/memorizeLastCall.js -var require_memorizeLastCall2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/memorizeLastCall.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.memorizeLastCall = void 0; - var util_js_1 = require_util(); - function memorizeLastCall(fn) { - let last; - return (...p) => { - if (last && (0, util_js_1.isArrayEqual)(last.args, p)) { - return last.value; - } - const args = p; - const value = fn(...args); - last = { args, value }; - return value; - }; - } - exports.memorizeLastCall = memorizeLastCall; +// node_modules/@cspell/cspell-service-bus/dist/esm/request.mjs +var BaseServiceRequest = class { + constructor(type, params) { + this.type = type; + this.params = params; } -}); - -// node_modules/cspell-lib/dist/cjs/suggestions.js -var require_suggestions = __commonJS({ - "node_modules/cspell-lib/dist/cjs/suggestions.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SuggestionError = exports.calcSuggestionAdjustedToToMatchCase = exports.suggestionsForWord = exports.suggestionsForWords = void 0; - var assert_1 = __importDefault(require("assert")); - var index_js_1 = require_Settings(); - var LanguageSettings_js_1 = require_LanguageSettings(); - var index_js_2 = require_SpellingDictionary4(); - var AutoResolve_js_1 = require_AutoResolve(); - var memorizeLastCall_js_1 = require_memorizeLastCall2(); - var util = __importStar(require_util()); - var emptySuggestionOptions = Object.freeze({}); - var emptyCSpellSettings = Object.freeze({}); - async function* suggestionsForWords2(words, options, settings) { - for await (const word of words) { - yield await suggestionsForWord(word, options, settings); - } - } - exports.suggestionsForWords = suggestionsForWords2; - var memorizeSuggestions = (0, memorizeLastCall_js_1.memorizeLastCall)(cacheSuggestionsForWord); - function cacheSuggestionsForWord(options, settings) { - const cache = (0, AutoResolve_js_1.createAutoResolveCache)(); - return (word) => cache.get(word, (word2) => _suggestionsForWord(word2, options, settings)); - } - function suggestionsForWord(word, options = emptySuggestionOptions, settings = emptyCSpellSettings) { - return memorizeSuggestions(options, settings)(word); - } - exports.suggestionsForWord = suggestionsForWord; - async function _suggestionsForWord(word, options, settings) { - const { languageId, locale: language, includeDefaultConfig = true, dictionaries } = options; - async function determineDictionaries(config2) { - const withLocale = (0, index_js_1.mergeSettings)(config2, util.clean({ - language: language || config2.language - // dictionaries: dictionaries?.length ? dictionaries : config.dictionaries, - })); - const withLanguageId = (0, LanguageSettings_js_1.calcSettingsForLanguageId)(withLocale, languageId ?? withLocale.languageId ?? "plaintext"); - const settings2 = (0, index_js_1.finalizeSettings)(withLanguageId); - settings2.dictionaries = dictionaries?.length ? dictionaries : settings2.dictionaries || []; - validateDictionaries(settings2, dictionaries); - const dictionaryCollection2 = await (0, index_js_2.getDictionaryInternal)(settings2); - settings2.dictionaries = settings2.dictionaryDefinitions?.map((def) => def.name) || []; - const allDictionaryCollection2 = await (0, index_js_2.getDictionaryInternal)(settings2); - return { - dictionaryCollection: dictionaryCollection2, - allDictionaryCollection: allDictionaryCollection2 - }; - } - await (0, index_js_2.refreshDictionaryCache)(); - const config = includeDefaultConfig ? (0, index_js_1.mergeSettings)((0, index_js_1.getDefaultSettings)(settings.loadDefaultConfiguration ?? true), (0, index_js_1.getGlobalSettings)(), settings) : settings; - const { dictionaryCollection, allDictionaryCollection } = await determineDictionaries(config); - return _suggestionsForWordSync(word, options, settings, dictionaryCollection, allDictionaryCollection); - } - function _suggestionsForWordSync(word, options, settings, dictionaryCollection, allDictionaryCollection) { - const extendsDictionaryCollection = allDictionaryCollection || dictionaryCollection; - const { locale: language, strict = true, numChanges = 4, numSuggestions = 8, includeTies = true, includeDefaultConfig = true } = options; - const ignoreCase = !strict; - const config = includeDefaultConfig ? (0, index_js_1.mergeSettings)((0, index_js_1.getDefaultSettings)(settings.loadDefaultConfiguration ?? true), (0, index_js_1.getGlobalSettings)(), settings) : settings; - const opts = { ignoreCase, numChanges, numSuggestions, includeTies }; - const suggestionsByDictionary = dictionaryCollection.dictionaries.flatMap((dict) => dict.suggest(word, opts).map((r) => ({ ...r, dictName: dict.name }))); - const locale = adjustLocale(language || config.language || void 0); - const collator = Intl.Collator(locale); - const combined = limitResults(combine(suggestionsByDictionary.sort((a, b) => a.cost - b.cost || collator.compare(a.word, b.word))), numSuggestions, includeTies); - const sugsAdjusted = calcSuggestionAdjustedToToMatchCase(word, combined, locale, ignoreCase, extendsDictionaryCollection); - const allSugs = sugsAdjusted.map((sug) => { - const found = extendsDictionaryCollection.find(sug.word); - return { - ...sug, - forbidden: found?.forbidden || false, - noSuggest: found?.noSuggest || false - }; - }); - return { - word, - suggestions: limitResults(allSugs, numSuggestions, includeTies) - }; - } - function combine(suggestions) { - const words = /* @__PURE__ */ new Map(); - for (const sug of suggestions) { - const { word, cost, dictName, ...rest } = sug; - const f = words.get(word) || { word, cost, ...rest, dictionaries: [] }; - f.cost = Math.min(f.cost, cost); - f.dictionaries.push(dictName); - f.dictionaries.sort(); - words.set(word, f); - } - return [...words.values()]; - } - function adjustLocale(locale) { - if (!locale) - return void 0; - const locales = [...(0, LanguageSettings_js_1.normalizeLocaleIntl)(locale)].filter((locale2) => (0, LanguageSettings_js_1.isValidLocaleIntlFormat)(locale2)); - if (!locales.length) - return void 0; - if (locales.length === 1) - return locales[0]; - return locales; - } - function calcSuggestionAdjustedToToMatchCase(originalWord, sugs, locale, ignoreCase, dict) { - locale = adjustLocale(locale); - const knownSugs = new Set(sugs.map((sug) => sug.word)); - const matchStyle = { ...analyzeCase(originalWord), locale, ignoreCase }; - return sugs.map((sug) => { - const alt = matchCase(sug.word, !!sug.isPreferred, matchStyle); - if (alt === sug.word || knownSugs.has(alt)) - return sug; - const found = dict.find(alt); - if (!found || !found.forbidden || !found.noSuggest) { - knownSugs.add(alt); - return { ...sug, wordAdjustedToMatchCase: alt }; - } - return sug; - }); - } - exports.calcSuggestionAdjustedToToMatchCase = calcSuggestionAdjustedToToMatchCase; - function limitResults(suggestions, numSuggestions, includeTies) { - let cost = suggestions[0]?.cost; - let i = 0; - for (; i < suggestions.length; ++i) { - if (i >= numSuggestions && (!includeTies || suggestions[i].cost > cost)) { - break; - } - cost = suggestions[i].cost; - } - return suggestions.slice(0, i); - } - function validateDictionaries(settings, dictionaries) { - if (!dictionaries?.length) - return; - const knownDicts = new Set(settings.dictionaryDefinitions?.map((def) => def.name) || []); - for (const dict of dictionaries) { - if (!knownDicts.has(dict)) { - throw new SuggestionError2(`Unknown dictionary: "${dict}"`, "E_dictionary_unknown"); - } - } - } - function matchCase(word, isPreferred, style) { - const locale = style.locale; - if (style.isMixedCaps) { - return word; - } - if (hasCaps(word)) { - if (style.isAllCaps) - return word.toLocaleUpperCase(locale); - if (!style.ignoreCase || style.hasCaps || isPreferred) - return word; - if (isTitleCase(word) || isAllCaps(word)) - return word.toLocaleLowerCase(locale); - return word; - } - if (!style.hasCaps) - return word; - if (style.isAllCaps) - return word.toLocaleUpperCase(locale); - (0, assert_1.default)(style.isTitleCase); - return word.replace(/^\p{L}/u, (firstLetter) => firstLetter.toLocaleUpperCase(locale)); - } - var regExpHasCaps = /\p{Lu}/u; - var regExpIsAllCaps = /^[\P{L}\p{Lu}]+$/u; - var regExpIsTitleCase = /^\p{Lu}[\P{L}\p{Ll}]+$/u; - function analyzeCase(word) { - const hasCaps2 = regExpHasCaps.test(word); - const isAllCaps2 = hasCaps2 && regExpIsAllCaps.test(word); - const isTitleCase2 = hasCaps2 && !isAllCaps2 && regExpIsTitleCase.test(word); - const isMixedCaps = hasCaps2 && !isAllCaps2 && !isTitleCase2; - return { hasCaps: hasCaps2, isAllCaps: isAllCaps2, isMixedCaps, isTitleCase: isTitleCase2 }; - } - function hasCaps(word) { - return regExpHasCaps.test(word); - } - function isTitleCase(word) { - return regExpIsTitleCase.test(word); - } - function isAllCaps(word) { - return regExpIsAllCaps.test(word); - } - var SuggestionError2 = class extends Error { - constructor(message, code) { - super(message); - this.code = code; - } - }; - exports.SuggestionError = SuggestionError2; +}; +var ServiceRequestCls = class extends BaseServiceRequest { + constructor(type, params) { + super(type, params); } -}); +}; +function createResponse(value, _req) { + return { value }; +} +function createResponseFail(_request, error2) { + return { error: error2 }; +} +function isServiceResponseSuccess(res) { + return "value" in res && res.error === void 0; +} +function isServiceResponseFailure(res) { + return res.error !== void 0; +} -// node_modules/cspell-lib/dist/cjs/util/simpleCache.js -var require_simpleCache2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/simpleCache.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AutoCache = exports.SimpleCache = exports.AutoWeakCache = exports.SimpleWeakCache = void 0; - var SimpleWeakCache = class { - constructor(size) { - this.size = size; - this.L0 = /* @__PURE__ */ new WeakMap(); - this.L1 = /* @__PURE__ */ new WeakMap(); - this.L2 = /* @__PURE__ */ new WeakMap(); - this.sizeL0 = 0; - } - has(key) { - for (const c of this.caches()) { - if (c.has(key)) - return true; - } - return false; - } - get(key) { - for (const c of this.caches()) { - const entry = c.get(key); - if (entry) { - if (c !== this.L0) { - this._set(key, entry); - } - return entry.v; - } - } - return void 0; - } - set(key, value) { - this._set(key, { v: value }); - } - _set(key, entry) { - if (this.L0.has(key)) { - this.L0.set(key, entry); - return this; - } - if (this.sizeL0 >= this.size) { - this.rotate(); - } - this.sizeL0 += 1; - this.L0.set(key, entry); - } - caches() { - return [this.L0, this.L1, this.L2]; - } - rotate() { - this.L2 = this.L1; - this.L1 = this.L0; - this.L0 = /* @__PURE__ */ new WeakMap(); - this.sizeL0 = 0; - } - }; - exports.SimpleWeakCache = SimpleWeakCache; - var AutoWeakCache = class extends SimpleWeakCache { - constructor(factory, size) { - super(size); - this.factory = factory; - } - get(key) { - const v = super.get(key); - if (v !== void 0) - return v; - const val = this.factory(key); - this.set(key, val); - return val; - } - }; - exports.AutoWeakCache = AutoWeakCache; - var SimpleCache = class { - constructor(size) { - this.size = size; - this.L0 = /* @__PURE__ */ new Map(); - this.L1 = /* @__PURE__ */ new Map(); - this.L2 = /* @__PURE__ */ new Map(); - } - has(key) { - for (const c of this.caches()) { - if (c.has(key)) - return true; - } - return false; - } - get(key) { - for (const c of this.caches()) { - const entry = c.get(key); - if (entry) { - if (c !== this.L0) { - this._set(key, entry); - } - return entry.v; - } - } - return void 0; - } - set(key, value) { - this._set(key, { v: value }); - } - _set(key, entry) { - if (this.L0.has(key)) { - this.L0.set(key, entry); - return this; - } - if (this.L0.size >= this.size) { - this.rotate(); - } - this.L0.set(key, entry); - } - caches() { - return [this.L0, this.L1, this.L2]; - } - rotate() { - this.L2 = this.L1; - this.L1 = this.L0; - this.L0 = /* @__PURE__ */ new Map(); - } - }; - exports.SimpleCache = SimpleCache; - var AutoCache = class extends SimpleCache { - constructor(factory, size) { - super(size); - this.factory = factory; - } - get(key) { - const v = super.get(key); - if (v !== void 0) - return v; - const val = this.factory(key); - this.set(key, val); - return val; - } - }; - exports.AutoCache = AutoCache; +// node_modules/@cspell/cspell-service-bus/dist/esm/bus.mjs +var MAX_DEPTH = 10; +var ServiceBus = class { + constructor(handlers = []) { + this.handlers = []; + handlers.forEach((h) => this.addHandler(h)); } -}); - -// node_modules/cspell-lib/dist/cjs/util/timer.js -var require_timer2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/timer.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createLapRecorder = exports.polyHrTime = exports.toMilliseconds = exports.createTimer = void 0; - var _hrTime = process?.hrtime || polyHrTime; - function createTimer(hrTimeFn = _hrTime) { - let start = hrTimeFn(); - let lastLap = 0; - function elapsed() { - return toMilliseconds(hrTimeFn(start)); - } - return { - start() { - start = hrTimeFn(); - lastLap = 0; - }, - elapsed, - lap() { - const now = elapsed(); - const diff = now - lastLap; - lastLap = now; - return diff; - } - }; - } - exports.createTimer = createTimer; - function toMilliseconds(t) { - return (t[0] + t[1] * 1e-9) * 1e3; - } - exports.toMilliseconds = toMilliseconds; - function polyHrTime(time) { - const now = Date.now() - (time ? toMilliseconds(time) : 0); - const inSeconds = now * 1e-3; - const s = Math.floor(inSeconds); - const n = (inSeconds - s) * 1e9; - return [s, n]; - } - exports.polyHrTime = polyHrTime; - function createLapRecorder() { - const timer = createTimer(); - const times = []; - let lapTime = 0; - function lap(name) { - const now = timer.elapsed(); - const diff = now - lapTime; - times.push([name, diff, now]); - lapTime = diff; - } - function report() { - return times.map(([name, time]) => `${name}: ${time.toFixed(2)}`); + addHandler(handler, name = "anonymous", description) { + const h = typeof handler === "function" ? { fn: handler, name, description } : handler; + const { fn, name: _name, description: _description } = h; + this.handlers.push({ fn, name: _name, description: _description }); + return this; + } + dispatch(request) { + let depth = 0; + const dispatcher = { dispatch }; + const handler = this.reduceHandlers(this.handlers, request, dispatcher, this.defaultHandler); + function dispatch(request2) { + ++depth; + if (depth >= MAX_DEPTH) { + return createResponseFail(request2, new ErrorServiceRequestDepthExceeded(request2, depth)); } - return { - times, - lap, - report - }; + const response = handler(request2); + --depth; + return response; } - exports.createLapRecorder = createLapRecorder; + return dispatch(request); } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/defaultConstants.js -var require_defaultConstants = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/defaultConstants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.minWordSplitLen = exports.defaultMinWordLength = exports.defaultMaxDuplicateProblems = exports.defaultMaxNumberOfProblems = void 0; - exports.defaultMaxNumberOfProblems = 200; - exports.defaultMaxDuplicateProblems = 5; - exports.defaultMinWordLength = 4; - exports.minWordSplitLen = 3; + defaultHandler(request) { + return createResponseFail(request, new ErrorUnhandledRequest(request)); } -}); - -// node_modules/cspell-lib/dist/cjs/util/PairingHeap.js -var require_PairingHeap2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/PairingHeap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.heapMethods = exports.PairingHeap = void 0; - var PairingHeap = class { - constructor(compare2) { - this.compare = compare2; - this._size = 0; - } - add(v) { - this._heap = insert(this.compare, this._heap, v); - ++this._size; - return this; - } - dequeue() { - const n = this.next(); - if (n.done) - return void 0; - return n.value; - } - concat(i) { - for (const v of i) { - this.add(v); - } - return this; - } - next() { - if (!this._heap) { - return { value: void 0, done: true }; + reduceHandlers(handlers, request, dispatcher, defaultHandler) { + const _handlers = handlers.map((m) => ({ ...m, fn: m.fn(dispatcher) })); + const handler = _handlers.reduce((next, h) => { + const fn = h.fn(next); + return (req) => { + try { + return fn(req); + } catch (e) { + return createResponseFail(request, new UnhandledHandlerError(h.name, h.description, e)); } - const value = this._heap.v; - --this._size; - this._heap = removeHead(this.compare, this._heap); - return { value }; - } - peek() { - return this._heap?.v; - } - [Symbol.iterator]() { - return this; - } - get length() { - return this._size; - } - }; - exports.PairingHeap = PairingHeap; - function removeHead(compare2, heap) { - if (!heap || !heap.c) - return void 0; - return mergeSiblings(compare2, heap.c); - } - function insert(compare2, heap, v) { - const n = { - v, - s: void 0, - c: void 0 }; - if (!heap || compare2(v, heap.v) <= 0) { - n.c = heap; - return n; - } - n.s = heap.c; - heap.c = n; - return heap; - } - function merge(compare2, a, b) { - if (compare2(a.v, b.v) <= 0) { - a.s = void 0; - b.s = a.c; - a.c = b; - return a; - } - b.s = void 0; - a.s = b.c; - b.c = a; - return b; - } - function mergeSiblings(compare2, n) { - if (!n.s) - return n; - const s = n.s; - const ss = s.s; - const m = merge(compare2, n, s); - return ss ? merge(compare2, m, mergeSiblings(compare2, ss)) : m; - } - exports.heapMethods = { - insert, - merge, - mergeSiblings - }; + }, defaultHandler); + return handler; } -}); +}; -// node_modules/cspell-lib/dist/cjs/util/regexHelper.js -var require_regexHelper2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/regexHelper.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.escapeRegEx = void 0; - function escapeRegEx(s) { - return s.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); - } - exports.escapeRegEx = escapeRegEx; - } -}); +// node_modules/@cspell/cspell-service-bus/dist/esm/createRequestHandler.mjs +function createRequestHandler(requestDef, fn, name, description) { + return createIsRequestHandler(requestDef.is, fn, name ?? requestDef.type, description); +} +function createIsRequestHandlerFn(isA, fn) { + return (dispatcher) => (next) => (request) => isA(request) ? fn(request, next, dispatcher) : next(request); +} +function createIsRequestHandler(isA, fn, name, description) { + return { + fn: createIsRequestHandlerFn(isA, fn), + name, + description + }; +} -// node_modules/cspell-lib/dist/cjs/util/wordSplitter.js -var require_wordSplitter = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/wordSplitter.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.split = void 0; - var PairingHeap_js_1 = require_PairingHeap2(); - var regexHelper_js_1 = require_regexHelper2(); - var textRegex_js_1 = require_textRegex(); - var ignoreBreak = Object.freeze([]); - function split(line, offset, isValidWord, options = {}) { - const relWordToSplit = findNextWordText({ text: line.text, offset: offset - line.offset }); - const lineOffset = line.offset; - const requested = /* @__PURE__ */ new Map(); - const regExpIgnoreSegment = /^[-.+\d_eE'`\\\s]+$/; - if (!relWordToSplit.text) { - const text = rebaseTextOffset(relWordToSplit); - return { - line, - offset, - text, - words: [], - endOffset: text.offset + text.text.length - }; - } - const lineSegment = { - line, - relStart: relWordToSplit.offset, - relEnd: relWordToSplit.offset + relWordToSplit.text.length - }; - const possibleBreaks = generateWordBreaks(lineSegment, options); - if (!possibleBreaks.length) { - const text = rebaseTextOffset(relWordToSplit); - return { - line, - offset, - text, - words: [{ ...text, isFound: isValidWord(text) }], - endOffset: text.offset + text.text.length - }; - } - function rebaseTextOffset(relText) { - return { - ...relText, - offset: relText.offset + lineOffset - }; - } - function has(word) { - if (regExpIgnoreSegment.test(word.text)) { - return true; - } - const i = word.offset; - const j = word.text.length; - let v = i + (j << 20); - if (i < 1 << 20 && j < 1 << 11) { - const b = requested.get(v); - if (b !== void 0) - return b; - } else { - v = -1; - } - const r = isValidWord(rebaseTextOffset(word)); - if (v >= 0) { - requested.set(v, r); - } - return r; - } - possibleBreaks.push({ - offset: lineSegment.relEnd, - breaks: [ignoreBreak] - }); - const result = { - line, - offset, - text: rebaseTextOffset(relWordToSplit), - words: splitIntoWords(lineSegment, possibleBreaks, has).map(rebaseTextOffset), - endOffset: lineOffset + lineSegment.relEnd - }; - return result; - } - exports.split = split; - function findNextWordText({ text, offset }) { - const reg = new RegExp(textRegex_js_1.regExWordsAndDigits); - reg.lastIndex = offset; - const m = reg.exec(text); - if (!m) { - return { - text: "", - offset: offset + text.length - }; - } - if (textRegex_js_1.regExNumericLiteral.test(m[0])) { - return findNextWordText({ text, offset: offset + m[0].length }); - } - return { - text: m[0], - offset: m.index - }; - } - function generateWordBreaks(line, options) { - const camelBreaks = genWordBreakCamel(line); - const symbolBreaks = genSymbolBreaks(line); - const optionalBreaks = genOptionalWordBreaks(line, options.optionalWordBreakCharacters); - return mergeSortedBreaks(...camelBreaks, ...symbolBreaks, ...optionalBreaks); - } - function offsetRegEx(reg, offset) { - const r = new RegExp(reg); - r.lastIndex = offset; - return r; - } - function genWordBreakCamel(line) { - const breaksCamel1 = []; - const text = line.line.text.slice(0, line.relEnd); - for (const m of text.matchAll(offsetRegEx(textRegex_js_1.regExSplitWords, line.relStart))) { - if (m.index === void 0) - break; - const i = m.index + 1; - breaksCamel1.push({ - offset: m.index, - breaks: [[i, i], ignoreBreak] - }); - } - const breaksCamel2 = []; - for (const m of text.matchAll(offsetRegEx(textRegex_js_1.regExSplitWords2, line.relStart))) { - if (m.index === void 0) - break; - const i = m.index + m[1].length; - const j = i + 1; - breaksCamel2.push({ - offset: m.index, - breaks: [[i, i], [j, j], ignoreBreak] - }); - } - return [breaksCamel1, breaksCamel2]; - } - function calcBreaksForRegEx(line, reg, calcBreak) { - const sb = []; - const text = line.line.text.slice(0, line.relEnd); - for (const m of text.matchAll(offsetRegEx(reg, line.relStart))) { - const b = calcBreak(m); - if (b) { - sb.push(b); - } - } - return sb; - } - function genOptionalWordBreaks(line, optionalBreakCharacters) { - function calcBreaks(m) { - const i = m.index; - if (i === void 0) - return; - const j = i + m[0].length; - return { - offset: i, - breaks: [ - [i, j], - ignoreBreak - ] - }; - } - const breaks = [ - calcBreaksForRegEx(line, textRegex_js_1.regExDanglingQuote, calcBreaks), - calcBreaksForRegEx(line, textRegex_js_1.regExTrailingEndings, calcBreaks) - ]; - if (optionalBreakCharacters) { - const regex = new RegExp(`[${(0, regexHelper_js_1.escapeRegEx)(optionalBreakCharacters)}]`, "gu"); - breaks.push(calcBreaksForRegEx(line, regex, calcBreaks)); - } - return breaks; +// node_modules/@cspell/cspell-service-bus/dist/esm/requestFactory.mjs +function requestFactory(requestType) { + class RequestClass extends ServiceRequestCls { + constructor(params) { + super(requestType, params); } - function genSymbolBreaks(line) { - function calcBreaks(m) { - const i = m.index; - if (i === void 0) - return; - const j = i + m[0].length; - return { - offset: i, - breaks: [ - [i, j], - [i, i], - [j, j], - ignoreBreak - ] - }; - } - return [ - calcBreaksForRegEx(line, textRegex_js_1.regExPossibleWordBreaks, calcBreaks), - calcBreaksForRegEx(line, /\d+/g, calcBreaks), - calcBreaksForRegEx(line, textRegex_js_1.regExEscapeCharacters, calcBreaks) - ]; + static is(req) { + return req instanceof RequestClass && req.type === requestType; } - function splitIntoWords(lineSeg, breaks, has) { - const maxIndex = lineSeg.relEnd; - const maxAttempts = 1e3; - const knownPathsByIndex = /* @__PURE__ */ new Map(); - function makeCandidates(p, i, bi, currentCost) { - const len = maxIndex; - while (bi < breaks.length && breaks[bi].offset < i) { - bi += 1; - } - if (bi >= breaks.length) { - return []; - } - const br = breaks[bi]; - function c(bp) { - const d = bp.length < 2 ? len - i : (bp[0] - i) * 0.5 + len - bp[1]; - const ec = currentCost + d; - return { - p, - i, - bi, - bp, - c: currentCost, - ec, - text: void 0 - }; - } - return br.breaks.map(c); - } - function toTextOffset(text2, offset) { - const valid = has({ text: text2, offset }); - return { - text: text2, - offset, - isFound: valid - }; - } - function compare2(a, b) { - return a.ec - b.ec || b.i - a.i; - } - function pathToWords(node) { - const results = []; - for (let p = node; p; p = p.n) { - if (p.text) { - results.push(p.text); - } - } - return results; - } - function addToKnownPaths(candidate, path16) { - for (let can = candidate; can !== void 0; can = can.p) { - const t = can.text; - const i = can.i; - const cost = (!t || t.isFound ? 0 : t.text.length) + (path16?.c ?? 0); - const exitingPath = knownPathsByIndex.get(i); - if (exitingPath && exitingPath.c <= cost) { - return void 0; - } - const node = { - n: path16, - i, - c: cost, - text: t - }; - knownPathsByIndex.set(i, node); - path16 = node; - } - return path16; - } - let maxCost = lineSeg.relEnd - lineSeg.relStart; - const candidates = new PairingHeap_js_1.PairingHeap(compare2); - const text = lineSeg.line.text; - candidates.concat(makeCandidates(void 0, lineSeg.relStart, 0, 0)); - let attempts = 0; - let bestPath; - while (maxCost && candidates.length && attempts++ < maxAttempts) { - const best = candidates.dequeue(); - if (!best || best.c >= maxCost) { - continue; - } - if (best.bp.length) { - const i = best.bp[0]; - const j = best.bp[1]; - const t = i > best.i ? toTextOffset(text.slice(best.i, i), best.i) : void 0; - const cost = !t || t.isFound ? 0 : t.text.length; - const mc = maxIndex - j; - best.c += cost; - best.ec = best.c + mc; - best.text = t; - const possiblePath = knownPathsByIndex.get(j); - if (possiblePath) { - const f = addToKnownPaths(best, possiblePath); - bestPath = !bestPath || f && f.c < bestPath.c ? f : bestPath; - } else if (best.c < maxCost) { - const c = makeCandidates(t ? best : best.p, j, best.bi + 1, best.c); - candidates.concat(c); - } - } else { - const c = makeCandidates(best.p, best.i, best.bi + 1, best.c); - candidates.concat(c); - if (!c.length) { - const t = maxIndex > best.i ? toTextOffset(text.slice(best.i, maxIndex), best.i) : void 0; - const cost = !t || t.isFound ? 0 : t.text.length; - best.c += cost; - best.ec = best.c; - best.text = t; - const segText = t || best.p?.text || toTextOffset("", best.i); - const can = t ? { ...best, text: segText } : { ...best, ...best.p, text: segText }; - const f = addToKnownPaths(can, void 0); - bestPath = !bestPath || f && f.c < bestPath.c ? f : bestPath; - } - } - if (bestPath && bestPath.c < maxCost) { - maxCost = bestPath.c; - } - } - return pathToWords(bestPath); + static create(params) { + return new RequestClass(params); } - function mergeSortedBreaks(...maps) { - return [].concat(...maps).sort((a, b) => a.offset - b.offset); + static createRequestHandler(fn, name, description) { + return createRequestHandler(RequestClass, fn, name, description); } - exports.__testing__ = { - generateWordBreaks, - findNextWordText - }; } -}); + RequestClass.type = requestType; + return RequestClass; +} -// node_modules/cspell-lib/dist/cjs/textValidation/isWordValid.js -var require_isWordValid = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/isWordValid.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.isWordValidWithEscapeRetry = void 0; - function hasWordCheck(dict, word) { - word = word.includes("\\") ? word.replace(/\\/g, "") : word; - return dict.has(word); - } - function isWordValidWithEscapeRetry(dict, wo, line) { - const firstTry = hasWordCheck(dict, wo.text); - return firstTry || // Drop the first letter if it is preceded by a '\'. - line.text[wo.offset - line.offset - 1] === "\\" && hasWordCheck(dict, wo.text.slice(1)); - } - exports.isWordValidWithEscapeRetry = isWordValidWithEscapeRetry; - exports.__testing__ = { - hasWordCheck - }; +// node_modules/cspell-io/dist/esm/common/stat.mjs +function compareStats(left, right) { + if (left === right) + return 0; + if (left.eTag || right.eTag) + return left.eTag === right.eTag ? 0 : (left.eTag || "") < (right.eTag || "") ? -1 : 1; + const diff = left.size - right.size || left.mtimeMs - right.mtimeMs; + return diff < 0 ? -1 : diff > 0 ? 1 : 0; +} + +// node_modules/cspell-io/dist/esm/errors/ErrorNotImplemented.mjs +var ErrorNotImplemented = class extends Error { + constructor(method) { + super(`Method ${method} is not supported.`); + this.method = method; } -}); +}; -// node_modules/cspell-lib/dist/cjs/util/TextMap.js -var require_TextMap = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/TextMap.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.doesIntersect = exports.extractTextMapRangeOrigin = void 0; - var assert_1 = __importDefault(require("assert")); - function extractTextMapRangeOrigin(textMap, extractRange) { - const { text: srcTxt, range: srcRange, map: srcMap } = textMap; - const [r0, r1] = srcRange; - const startOrig = Math.min(Math.max(extractRange[0], r0), r1); - const endOrig = Math.min(Math.max(extractRange[1], r0), r1); - const a = startOrig - r0; - const b = endOrig - r0; - const range = [startOrig, endOrig]; - if (!srcMap || !srcMap.length || a === b) { - const text2 = srcTxt.slice(a, b); - return { text: text2, range }; - } - (0, assert_1.default)((srcMap.length & 1) === 0, "Map must be pairs of values."); - const mapLen = srcMap.length; - const mapEndSrc = srcMap[mapLen - 2]; - const mapEndDst = srcMap[mapLen - 1]; - const endDiff = srcTxt.length - mapEndDst; - const head = !srcMap[0] && !srcMap[1] ? [] : [0, 0]; - const tail = [mapEndSrc + endDiff, mapEndDst + endDiff]; - const sMap = head.concat(srcMap).concat(tail); - let idx = 0; - for (; idx < sMap.length && a >= sMap[idx]; idx += 2) { - } - const aIdx = idx; - idx -= 2; - const a0 = a - sMap[idx]; - const a1 = a0 + sMap[idx + 1]; - for (; idx < sMap.length && b > sMap[idx]; idx += 2) { - } - const bIdx = idx; - const b0 = b - sMap[idx]; - const b1 = b0 + sMap[idx + 1]; - const text = srcTxt.slice(a1, b1); - if (bIdx === aIdx) { - return { text, range }; - } - const ab = [a0, a1]; - const map = sMap.slice(aIdx, bIdx + 2).map((v, i) => v - ab[i & 1]); - return { text, range, map }; - } - exports.extractTextMapRangeOrigin = extractTextMapRangeOrigin; - function doesIntersect(textMap, rangeOrigin) { - const r = textMap.range; - return r[0] < rangeOrigin[1] && r[1] > rangeOrigin[0]; - } - exports.doesIntersect = doesIntersect; - } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/parsedText.js -var require_parsedText = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/parsedText.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createMappedTextSegmenter = exports.mapRangeToLocal = exports.mapRangeBackToOriginalPos = exports.mapIssueBackToOriginalPos = void 0; - var TextMap_js_1 = require_TextMap(); - function mapIssueBackToOriginalPos(mappedText, issue) { - if (!mappedText.map || mappedText.map.length === 0) - return issue; - const textOff = mapTextOffsetBackToOriginalPos(mappedText, issue); - return { - ...issue, - ...textOff - }; - } - exports.mapIssueBackToOriginalPos = mapIssueBackToOriginalPos; - function mapTextOffsetBackToOriginalPos(mappedText, textOff) { - if (!mappedText.map || !mappedText.map.length) - return textOff; - const off = textOff.offset - mappedText.range[0]; - const range = mapRangeBackToOriginalPos([off, off + (textOff.length ?? textOff.text.length)], mappedText.map); - return { - text: textOff.text, - offset: mappedText.range[0] + range[0], - length: range[1] - range[0] - }; - } - function mapRangeBackToOriginalPos(offRange, map) { - if (!map || !map.length) - return offRange; - const [start, end] = offRange; - let i = 0, j = 0, p = 1; - while (p < map.length && map[p] < start) { - i = map[p - 1]; - j = map[p]; - p += 2; - } - const iA = start - j + i; - while (p < map.length && map[p] < end) { - i = map[p - 1]; - j = map[p]; - p += 2; - } - const iB = end - j + i; - return [iA, iB]; - } - exports.mapRangeBackToOriginalPos = mapRangeBackToOriginalPos; - function mapRangeToLocal(rangeOrig, map) { - if (!map || !map.length) - return rangeOrig; - const [start, end] = rangeOrig; - let i = 0, j = 0, p = 0; - while (p < map.length && map[p] < start) { - i = map[p]; - j = map[p + 1]; - p += 2; - } - const jA = start - i + j; - while (p < map.length && map[p] < end) { - i = map[p]; - j = map[p + 1]; - p += 2; - } - const jB = end - i + j; - return [jA, jB]; - } - exports.mapRangeToLocal = mapRangeToLocal; - function createMappedTextSegmenter(includeRanges) { - let rangePos = 0; - function* segmenter(pText) { - if (!includeRanges.length) { - return; - } - const range = pText.range; - const textEndPos = range[1]; - let textStartPos = range[0]; - while (rangePos && (rangePos >= includeRanges.length || includeRanges[rangePos].startPos > textStartPos)) { - rangePos -= 1; - } - const cur = includeRanges[rangePos]; - if (textEndPos <= cur.endPos && textStartPos >= cur.startPos) { - yield pText; - return; - } - while (textStartPos < textEndPos) { - while (includeRanges[rangePos] && includeRanges[rangePos].endPos <= textStartPos) { - rangePos += 1; - } - if (!includeRanges[rangePos]) { - break; - } - const { startPos, endPos } = includeRanges[rangePos]; - if (textEndPos < startPos) { - break; - } - const a = Math.max(textStartPos, startPos); - const b = Math.min(textEndPos, endPos); - if (a !== b) { - yield (0, TextMap_js_1.extractTextMapRangeOrigin)(pText, [a, b]); - } - textStartPos = b; - } - } - return segmenter; - } - exports.createMappedTextSegmenter = createMappedTextSegmenter; +// node_modules/cspell-io/dist/esm/handlers/node/file.mjs +var import_assert2 = __toESM(require("assert"), 1); +var import_fs2 = require("fs"); +var import_url2 = require("url"); +var import_zlib = require("zlib"); + +// node_modules/cspell-io/dist/esm/common/arrayBuffers.mjs +function arrayBufferViewToBuffer(data) { + if (data instanceof Buffer) { + return data; } -}); + const buf = Buffer.from(data.buffer); + if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) { + return buf; + } + return buf.subarray(data.byteOffset, data.byteOffset + data.byteLength); +} +function copyArrayBufferView(data) { + return new Uint8Array(data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength)); +} -// node_modules/cspell-lib/dist/cjs/textValidation/lineValidatorFactory.js -var require_lineValidatorFactory = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/lineValidatorFactory.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.textValidatorFactory = exports.lineValidatorFactory = void 0; - var sync_1 = require_sync(); - var cspell_dictionary_1 = require_cjs7(); - var RxPat = __importStar(require_RegExpPatterns()); - var Text2 = __importStar(require_text2()); - var util_js_1 = require_util(); - var wordSplitter_js_1 = require_wordSplitter(); - var defaultConstants_js_1 = require_defaultConstants(); - var isWordValid_js_1 = require_isWordValid(); - var parsedText_js_1 = require_parsedText(); - function lineValidatorFactory(sDict, options) { - const { minWordLength = defaultConstants_js_1.defaultMinWordLength, flagWords = [], allowCompoundWords = false, ignoreCase = true } = options; - const hasWordOptions = { - ignoreCase, - useCompounds: allowCompoundWords || void 0 - // let the dictionaries decide on useCompounds if allow is false - }; - const dictCol = (0, cspell_dictionary_1.createCachingDictionary)(sDict, hasWordOptions); - const setOfFlagWords = new Set(flagWords); - const setOfKnownSuccessfulWords = /* @__PURE__ */ new Set(); - const rememberFilter = (fn2) => (v) => { - const keep = fn2(v); - if (!keep) { - setOfKnownSuccessfulWords.add(v.text); - } - return keep; - }; - const filterAlreadyChecked = (wo) => { - return !setOfKnownSuccessfulWords.has(wo.text); - }; - function testForFlaggedWord(wo) { - const text = wo.text; - return setOfFlagWords.has(text) || setOfFlagWords.has(text.toLowerCase()) || dictCol.isForbidden(text); - } - function isWordIgnored(word) { - return dictCol.isNoSuggestWord(word); - } - function getSuggestions(word) { - return dictCol.getPreferredSuggestions(word); - } - function isWordFlagged(word) { - const isIgnored = isWordIgnored(word.text); - const isFlagged = !isIgnored && testForFlaggedWord(word); - return isFlagged; - } - function annotateIsFlagged(word) { - word.isFlagged = isWordFlagged(word); - return word; - } - function annotateIssue(issue) { - const sugs = getSuggestions(issue.text); - if (sugs && sugs.length) { - issue.suggestionsEx = sugs; - } - return issue; - } - function checkWord(word) { - const isIgnored = isWordIgnored(word.text); - const { isFlagged = !isIgnored && testForFlaggedWord(word) } = word; - const isFound = isFlagged ? void 0 : isIgnored || (0, isWordValid_js_1.isWordValidWithEscapeRetry)(dictCol, word, word.line); - return (0, util_js_1.clean)({ ...word, isFlagged, isFound }); - } - const fn = (lineSegment) => { - function splitterIsValid(word) { - return setOfKnownSuccessfulWords.has(word.text) || !testForFlaggedWord(word) && (0, isWordValid_js_1.isWordValidWithEscapeRetry)(dictCol, word, lineSegment.line); - } - function checkFullWord(vr) { - if (vr.isFlagged) { - return [vr]; - } - const codeWordResults = (0, sync_1.toArray)((0, sync_1.pipe)( - Text2.extractWordsFromCodeTextOffset(vr), - (0, sync_1.opFilter)(filterAlreadyChecked), - (0, sync_1.opMap)((t) => ({ ...t, line: vr.line })), - (0, sync_1.opMap)(annotateIsFlagged), - (0, sync_1.opFilter)(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged)), - (0, sync_1.opMap)((wo) => wo.isFlagged ? wo : checkWord(wo)), - (0, sync_1.opFilter)(rememberFilter((wo) => wo.isFlagged || !wo.isFound)), - (0, sync_1.opFilter)(rememberFilter((wo) => !RxPat.regExRepeatedChar.test(wo.text))), - // get back the original text. - (0, sync_1.opMap)((wo) => ({ - ...wo, - text: Text2.extractText(lineSegment.segment, wo.offset, wo.offset + wo.text.length) - })) - )); - if (!codeWordResults.length || isWordIgnored(vr.text) || checkWord(vr).isFound) { - rememberFilter((_) => false)(vr); - return []; - } - return codeWordResults; - } - function checkPossibleWords(possibleWord) { - if (isWordFlagged(possibleWord)) { - const vr = { - ...possibleWord, - line: lineSegment.line, - isFlagged: true - }; - return [vr]; - } - const mismatches = (0, sync_1.toArray)((0, sync_1.pipe)(Text2.extractWordsFromTextOffset(possibleWord), (0, sync_1.opFilter)(filterAlreadyChecked), (0, sync_1.opMap)((wo) => ({ ...wo, line: lineSegment.line })), (0, sync_1.opMap)(annotateIsFlagged), (0, sync_1.opFilter)(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged)), (0, sync_1.opConcatMap)(checkFullWord))); - if (mismatches.length) { - const splitResult = (0, wordSplitter_js_1.split)(lineSegment.segment, possibleWord.offset, splitterIsValid); - const nonMatching = splitResult.words.filter((w) => !w.isFound); - if (nonMatching.length < mismatches.length) { - return nonMatching.map((w) => ({ ...w, line: lineSegment.line })).map(annotateIsFlagged); - } - } - return mismatches; - } - const checkedPossibleWords = (0, sync_1.pipe)(Text2.extractPossibleWordsFromTextOffset(lineSegment.segment), (0, sync_1.opFilter)(filterAlreadyChecked), (0, sync_1.opConcatMap)(checkPossibleWords), (0, sync_1.opMap)(annotateIssue)); - return checkedPossibleWords; - }; - return { fn, dict: dictCol }; - } - exports.lineValidatorFactory = lineValidatorFactory; - function textValidatorFactory(dict, options) { - const lineValidator = lineValidatorFactory(dict, options); - const lineValidatorFn = lineValidator.fn; - function validate2(pText) { - const { text, range: srcRange, map } = pText; - const srcOffset = srcRange[0]; - const segment = { text, offset: 0 }; - const lineSegment = { line: segment, segment }; - function mapBackToOriginSimple(vr) { - const { text: text2, offset, isFlagged, isFound, suggestionsEx } = vr; - const r = (0, parsedText_js_1.mapRangeBackToOriginalPos)([offset, offset + text2.length], map); - const range = [r[0] + srcOffset, r[1] + srcOffset]; - return { text: text2, range, isFlagged, isFound, suggestionsEx }; - } - return [...lineValidatorFn(lineSegment)].map(mapBackToOriginSimple); - } - return { - validate: validate2, - lineValidator - }; - } - exports.textValidatorFactory = textValidatorFactory; +// node_modules/cspell-io/dist/esm/common/encode-decode.mjs +var BOM_BE = 65279; +var BOM_LE = 65534; +function decodeUtf16LE(data) { + let buf = arrayBufferViewToBuffer(data); + const bom = buf[0] << 8 | buf[1]; + buf = bom === BOM_LE ? buf.subarray(2) : buf; + return buf.toString("utf16le"); +} +function decodeUtf16BE(buf) { + return decodeUtf16LE(swapBytes(buf)); +} +function decode(data, encoding) { + const buf = arrayBufferViewToBuffer(data); + switch (encoding) { + case "utf16be": + return decodeUtf16BE(buf); + case "utf16le": + return decodeUtf16LE(buf); } -}); + if (buf.length < 2 || encoding && !encoding.startsWith("utf")) + return buf.toString(encoding); + const bom = buf[0] << 8 | buf[1]; + if (bom === BOM_BE || buf[0] === 0 && buf[1] !== 0) + return decodeUtf16BE(buf); + if (bom === BOM_LE || buf[0] !== 0 && buf[1] === 0) + return decodeUtf16LE(buf); + return buf.toString(encoding); +} +function swapBytesInPlace(data) { + const buf = arrayBufferViewToBuffer(data); + buf.swap16(); + return buf; +} +function swapBytes(data) { + const buf = copyArrayBufferView(data); + return swapBytesInPlace(buf); +} -// node_modules/cspell-lib/dist/cjs/textValidation/settingsToValidateOptions.js -var require_settingsToValidateOptions = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/settingsToValidateOptions.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.settingsToValidateOptions = void 0; - function settingsToValidateOptions(settings) { - const opt = { - ...settings, - ignoreCase: !(settings.caseSensitive ?? false) - }; - return opt; - } - exports.settingsToValidateOptions = settingsToValidateOptions; +// node_modules/cspell-io/dist/esm/errors/error.mjs +function toError(e) { + if (e instanceof Error) + return e; + if (typeof e === "object" && e && typeof e.message === "string") { + return e; } -}); + return Error(e && e.toString()); +} -// node_modules/cspell-lib/dist/cjs/util/TextRange.js -var require_TextRange = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/TextRange.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; +// node_modules/cspell-io/dist/esm/node/file/util.mjs +var import_url = require("url"); +var isURLRegExp = /^(\w{2,64}:\/\/|data:)/i; +function isUrlLike2(filename) { + return filename instanceof URL || isURLRegExp.test(filename); +} +function toURL(filename) { + return filename instanceof URL || typeof filename !== "string" ? filename : isUrlLike2(filename) ? new URL(filename) : (0, import_url.pathToFileURL)(filename); +} +var regMatchFilename = /filename=([^;,]*)/; +function urlBasename(url) { + function guessDataUrlName(header) { + const filenameMatch = header.match(regMatchFilename); + if (filenameMatch) + return filenameMatch[1]; + const mime = header.split(";", 1)[0]; + return mime.replace(/\W/g, "."); + } + if (typeof url === "string" && url.startsWith("data:")) { + return guessDataUrlName(url.split(",", 1)[0].split(":", 2)[1]); + } + url = toURL(url); + if (url.protocol === "data:") { + return guessDataUrlName(url.pathname.split(",", 1)[0]); + } + return basename2(url.pathname); +} +function urlDirname(url) { + if (typeof url === "string" && url.startsWith("data:")) { + return toURL("data:"); + } + url = toURL(url); + if (url.protocol === "data:") { + return toURL("data:"); + } + return new URL(url.pathname.endsWith("/") ? ".." : ".", url); +} +function basename2(path26) { + path26 = path26.endsWith("/") ? path26.slice(0, path26.length - 1) : path26; + const idx2 = path26.lastIndexOf("/"); + return idx2 >= 0 ? path26.slice(idx2 + 1) || "" : path26; +} + +// node_modules/cspell-io/dist/esm/node/dataUrl.mjs +var dataUrlRegExHead = /^data:(?[^;,]*)(?(?:;[^=]+=[^;,]*)*)(?;base64)?$/; +function decodeDataUrl(url) { + url = url.toString(); + const [head, encodedData] = url.split(",", 2); + if (!head || encodedData === void 0) + throw Error("Not a data url"); + const match2 = head.match(dataUrlRegExHead); + if (!match2 || !match2.groups) + throw Error("Not a data url"); + const mediaType = match2.groups["mediaType"] || ""; + const rawAttributes = (match2.groups["attributes"] || "").split(";").filter((a) => !!a).map((entry) => entry.split("=", 2)).map(([key, value]) => [key, decodeURIComponent(value)]); + const attributes = new Map(rawAttributes); + const encoding = attributes.get("charset"); + const isBase64 = !!match2.groups["base64"]; + const data = isBase64 ? Buffer.from(encodedData, "base64url") : Buffer.from(decodeURIComponent(encodedData)); + return { mediaType, data, encoding, attributes }; +} + +// node_modules/cspell-io/dist/esm/node/file/fetch.mjs +var import_node_fetch = __toESM(require_lib3(), 1); + +// node_modules/cspell-io/dist/esm/node/file/FetchError.mjs +var FetchUrlError = class _FetchUrlError extends Error { + constructor(message, code, status, url) { + super(message); + this.code = code; + this.status = status; + this.url = url; + this.name = "FetchUrlError"; + } + static create(url, status, message) { + if (status === 404) + return new _FetchUrlError(message || "URL not found.", "ENOENT", status, url); + if (status >= 400 && status < 500) + return new _FetchUrlError(message || "Permission denied.", "EACCES", status, url); + return new _FetchUrlError(message || "Fatal Error", "ECONNREFUSED", status, url); + } +}; + +// node_modules/cspell-io/dist/esm/node/file/fetch.mjs +var fetch = import_node_fetch.default; +async function fetchHead(request) { + const r = await fetch(request, { method: "HEAD" }); + return r.headers; +} +async function fetchURL(url) { + const response = await fetch(url); + if (!response.ok) { + throw FetchUrlError.create(url, response.status); + } + return Buffer.from(await response.arrayBuffer()); +} + +// node_modules/cspell-io/dist/esm/node/file/stat.mjs +async function getStatHttp(url) { + const headers = await fetchHead(url); + const eTag = headers.get("etag") || void 0; + const guessSize = Number.parseInt(headers.get("content-length") || "0", 10); + return { + size: eTag ? -1 : guessSize, + mtimeMs: 0, + eTag + }; +} + +// node_modules/cspell-io/dist/esm/requests/RequestFsReadBinaryFile.mjs +var RequestType = "fs:readBinaryFile"; +var RequestFsReadBinaryFile = requestFactory(RequestType); +var RequestTypeSync = "fs:readBinaryFileSync"; +var RequestFsReadBinaryFileSync = requestFactory(RequestTypeSync); + +// node_modules/cspell-io/dist/esm/requests/RequestFsReadFile.mjs +var RequestType2 = "fs:readFile"; +var RequestFsReadFileText = requestFactory(RequestType2); + +// node_modules/cspell-io/dist/esm/requests/RequestFsReadFileSync.mjs +var RequestType3 = "fs:readFileSync"; +var RequestFsReadFileTextSync = requestFactory(RequestType3); + +// node_modules/cspell-io/dist/esm/requests/RequestFsStat.mjs +var RequestTypeStat = "fs:stat"; +var RequestFsStat = requestFactory(RequestTypeStat); +var RequestTypeStatSync = "fs:statSync"; +var RequestFsStatSync = requestFactory(RequestTypeStatSync); + +// node_modules/cspell-io/dist/esm/requests/RequestFsWriteFile.mjs +var RequestType4 = "fs:writeFile"; +var RequestFsWriteFile = requestFactory(RequestType4); + +// node_modules/cspell-io/dist/esm/requests/RequestZlibInflate.mjs +var RequestType5 = "zlib:inflate"; +var RequestZlibInflate = requestFactory(RequestType5); + +// node_modules/cspell-io/dist/esm/handlers/node/file.mjs +var isGzFileRegExp = /\.gz($|[?#])/; +function isGzFile(url) { + return isGzFileRegExp.test(url.pathname); +} +var handleRequestFsReadBinaryFile = RequestFsReadBinaryFile.createRequestHandler(({ params }) => createResponse(import_fs2.promises.readFile((0, import_url2.fileURLToPath)(params.url)).then((content) => ({ url: params.url, content }))), void 0, "Node: Read Binary File."); +var handleRequestFsReadBinaryFileSync = RequestFsReadBinaryFileSync.createRequestHandler(({ params }) => createResponse({ url: params.url, content: (0, import_fs2.readFileSync)((0, import_url2.fileURLToPath)(params.url)) }), void 0, "Node: Sync Read Binary File."); +var handleRequestFsReadFile = RequestFsReadFileText.createRequestHandler((req, _, dispatcher) => { + const { url, encoding } = req.params; + const res = dispatcher.dispatch(RequestFsReadBinaryFile.create({ url })); + if (!isServiceResponseSuccess(res)) { + (0, import_assert2.default)(isServiceResponseFailure(res)); + return createResponseFail(req, res.error); + } + return createResponse(res.value.then((res2) => { + const content = bufferToText(res2.content, encoding); + return { + url, + baseFilename: res2.baseFilename, + encoding, + ...content }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.extractRangeText = exports.excludeRanges = exports.findMatchingRangesForPatterns = exports.unionRanges = exports.findMatchingRanges = void 0; - var GS = __importStar(require_dist2()); - function toMatchRangeWithText(m) { - const index = m.index || 0; - const _text = m[0]; - return { - startPos: index, - endPos: index + _text.length, - text: _text - }; + })); +}, void 0, "Node: Read Text File."); +var handleRequestFsReadFileSync = RequestFsReadFileTextSync.createRequestHandler((req, _, dispatcher) => { + const { url, encoding } = req.params; + const res = dispatcher.dispatch(RequestFsReadBinaryFileSync.create({ url })); + if (!isServiceResponseSuccess(res)) { + (0, import_assert2.default)(isServiceResponseFailure(res)); + return createResponseFail(req, res.error); + } + return createResponse({ + encoding, + ...res.value, + ...bufferToText(res.value.content, encoding) + }); +}, void 0, "Node: Sync Read Text File."); +var handleRequestZlibInflate = RequestZlibInflate.createRequestHandler(({ params }) => createResponse((0, import_zlib.gunzipSync)(params.data).toString("utf-8")), void 0, "Node: gz deflate."); +var supportedFetchProtocols = { "http:": true, "https:": true }; +var handleRequestFsReadBinaryFileHttp = RequestFsReadBinaryFile.createRequestHandler((req, next) => { + const { url } = req.params; + if (!(url.protocol in supportedFetchProtocols)) + return next(req); + return createResponse(fetchURL(url).then((content) => ({ url, content }))); +}, void 0, "Node: Read Http(s) file."); +var handleRequestFsReadBinaryFileSyncData = RequestFsReadBinaryFileSync.createRequestHandler((req, next) => { + const { url } = req.params; + if (url.protocol !== "data:") + return next(req); + const data = decodeDataUrl(url); + return createResponse({ url, content: data.data, baseFilename: data.attributes.get("filename") }); +}, void 0, "Node: Read data: urls."); +var handleRequestFsReadBinaryFileData = RequestFsReadBinaryFile.createRequestHandler((req, next, dispatcher) => { + const { url } = req.params; + if (url.protocol !== "data:") + return next(req); + const res = dispatcher.dispatch(RequestFsReadBinaryFileSync.create(req.params)); + if (!isServiceResponseSuccess(res)) + return res; + return createResponse(Promise.resolve(res.value)); +}, void 0, "Node: Read data: urls."); +function bufferToText(data, encoding) { + const buf = arrayBufferViewToBuffer(data); + const gz = buf[0] === 31 && buf[1] === 139; + const content = gz ? decode((0, import_zlib.gunzipSync)(buf), encoding) : decode(buf, encoding); + return { content, gz }; +} +var handleRequestFsStat = RequestFsStat.createRequestHandler(({ params }) => createResponse(import_fs2.promises.stat((0, import_url2.fileURLToPath)(params.url))), void 0, "Node: fs.stat."); +var handleRequestFsStatSync = RequestFsStatSync.createRequestHandler((req) => { + const { params } = req; + try { + return createResponse((0, import_fs2.statSync)((0, import_url2.fileURLToPath)(params.url))); + } catch (e) { + return createResponseFail(req, toError(e)); + } +}, void 0, "Node: fs.stat."); +var handleRequestFsStatHttp = RequestFsStat.createRequestHandler((req, next) => { + const { url } = req.params; + if (!(url.protocol in supportedFetchProtocols)) + return next(req); + return createResponse(getStatHttp(url)); +}, void 0, "Node: http get stat"); +var handleRequestFsWriteFile = RequestFsWriteFile.createRequestHandler(({ params }) => createResponse(import_fs2.promises.writeFile(params.url, params.content)), void 0, "Node: fs.writeFile"); +var handleRequestFsWriteFileGz = RequestFsWriteFile.createRequestHandler((req, next) => { + const { url, content } = req.params; + if (!isGzFile(url)) + return next(req); + return createResponse(import_fs2.promises.writeFile(url, (0, import_zlib.gzipSync)(content))); +}, void 0, "Node: http get stat"); +function registerHandlers(serviceBus) { + const handlers = [ + handleRequestFsWriteFile, + handleRequestFsWriteFileGz, + handleRequestFsReadBinaryFile, + handleRequestFsReadBinaryFileSync, + handleRequestFsReadBinaryFileHttp, + handleRequestFsReadBinaryFileData, + handleRequestFsReadBinaryFileSyncData, + handleRequestFsReadFile, + handleRequestFsReadFileSync, + handleRequestZlibInflate, + handleRequestFsStatSync, + handleRequestFsStat, + handleRequestFsStatHttp + ]; + handlers.forEach((handler) => serviceBus.addHandler(handler)); +} + +// node_modules/cspell-io/dist/esm/CSpellIONode.mjs +var defaultCSpellIONode = void 0; +var CSpellIONode = class { + constructor(serviceBus = new ServiceBus()) { + this.serviceBus = serviceBus; + registerHandlers(serviceBus); + } + readFile(uriOrFilename, encoding = "utf8") { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsReadFileText.create({ url, encoding })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "readFile"); } - function findMatchingRanges(pattern, text) { - if (pattern.source === ".*") { - return [{ startPos: 0, endPos: text.length }]; - } - const regex = new RegExp(pattern); - if (!regex.global) { - const m = text.match(regex); - if (!m) - return []; - return [toMatchRangeWithText(m)]; - } - return [...text.matchAll(regex)].map(toMatchRangeWithText); + return res.value; + } + readFileSync(uriOrFilename, encoding = "utf8") { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsReadFileTextSync.create({ url, encoding })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "readFileSync"); + } + return res.value; + } + writeFile(uriOrFilename, content) { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsWriteFile.create({ url, content })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "writeFile"); } - exports.findMatchingRanges = findMatchingRanges; - function compareRanges(a, b) { - return a.startPos - b.startPos || a.endPos - b.endPos; + return res.value; + } + getStat(uriOrFilename) { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsStat.create({ url })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "getStat"); } - function unionRanges(ranges) { - return makeSortedMatchRangeArray([..._unionRanges(ranges)]); + return res.value; + } + getStatSync(uriOrFilename) { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsStatSync.create({ url })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "getStatSync"); } - exports.unionRanges = unionRanges; - function* _unionRanges(ranges) { - const sortedRanges = sortMatchRangeArray(ranges); - if (!sortedRanges.length) - return; - let { startPos, endPos } = sortedRanges[0]; - for (const r of ranges) { - if (r.startPos > endPos) { - yield { startPos, endPos }; - startPos = r.startPos; - endPos = r.endPos; - continue; - } - endPos = Math.max(endPos, r.endPos); - } - if (startPos < endPos) { - yield { startPos, endPos }; - } + return res.value; + } + compareStats(left, right) { + return compareStats(left, right); + } + toURL(uriOrFilename) { + return toURL(uriOrFilename); + } + uriBasename(uriOrFilename) { + return urlBasename(uriOrFilename); + } + uriDirname(uriOrFilename) { + return urlDirname(uriOrFilename); + } +}; +function genError(err, alt) { + return err || new ErrorNotImplemented(alt); +} +function getDefaultCSpellIO() { + if (defaultCSpellIONode) + return defaultCSpellIONode; + const cspellIO2 = new CSpellIONode(); + defaultCSpellIONode = cspellIO2; + return cspellIO2; +} + +// node_modules/cspell-io/dist/esm/node/file/fileReader.mjs +var Stream = __toESM(require("stream"), 1); +var import_util17 = require("util"); +var pipeline2 = (0, import_util17.promisify)(Stream.pipeline); + +// node_modules/cspell-io/dist/esm/node/file/fileWriter.mjs +var Stream2 = __toESM(require("stream"), 1); +var import_util19 = require("util"); +var pipeline4 = (0, import_util19.promisify)(Stream2.pipeline); + +// node_modules/cspell-io/dist/esm/file/file.mjs +var readFileText2 = function(filename, encoding) { + return getDefaultCSpellIO().readFile(filename, encoding).then((fr) => fr.content); +}; + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/configLoader.mjs +var path10 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/Models/CSpellSettingsInternalDef.mjs +var SymbolCSpellSettingsInternal = Symbol("CSpellSettingsInternal"); +function cleanCSpellSettingsInternal(parts = {}) { + const csi = clean(parts); + Object.assign(csi, { [SymbolCSpellSettingsInternal]: true }); + return csi; +} +function createCSpellSettingsInternal(parts = {}) { + return clean({ + ...parts, + [SymbolCSpellSettingsInternal]: true + }); +} +function isCSpellSettingsInternal(cs) { + return !!cs[SymbolCSpellSettingsInternal]; +} +function isDictionaryDefinitionInlineInternal(def) { + if (def.path) + return false; + const defInline = def; + return !!(defInline.words || defInline.flagWords || defInline.ignoreWords || defInline.suggestWords); +} + +// node_modules/cspell-lib/dist/esm/util/AutoResolveLRUCache.mjs +var import_assert3 = __toESM(require("assert"), 1); +var AutoResolveLRUCache = class { + constructor(maxSize, isEqual) { + this.maxSize = maxSize; + this.isEqual = isEqual; + this.list = {}; + this.count = 0; + this._misses = 0; + this._hits = 0; + this._added = 0; + this._removed = 0; + (0, import_assert3.default)(maxSize > 0); + } + get(params, fn) { + const isEqual = this.isEqual; + for (let n = this.list.n; n; n = n.n) { + if (isEqual(n.value.p, params)) { + this.addToHead(n); + ++this._hits; + return n.value.r; + } + } + ++this._misses; + if (!fn) + return void 0; + const value = { + p: params, + r: fn(params) + }; + this.addToHead({ value, n: void 0, p: void 0 }); + return value.r; + } + get size() { + return this.count; + } + get hits() { + return this._hits; + } + get misses() { + return this._misses; + } + get added() { + return this._added; + } + get removed() { + return this._removed; + } + clear() { + this._added = 0; + this._hits = 0; + this._misses = 0; + this._removed = 0; + this.list.n = void 0; + this.list.p = void 0; + this.count = 0; + } + addToHead(n) { + if (!this.list.n) { + this.list.n = n; + this.list.p = n; + n.n = void 0; + n.p = void 0; + this.count = 1; + this._added = 1; + return; } - function findMatchingRangesForPatterns(patterns, text) { - const matchedPatterns = GS.genSequence(patterns).concatMap((pattern) => findMatchingRanges(pattern, text)); - return unionRanges(matchedPatterns.toArray()); + if (this.list.n === n) + return; + if (this.list.p === n) { + this.list.p = n.p; + } + const isNew = !n.n && !n.p; + n.p && (n.p.n = n.n); + n.n && (n.n.p = n.p); + n.p = void 0; + n.n = this.list.n; + n.n && (n.n.p = n); + this.list.n = n; + const add = isNew && 1 || 0; + this._added += add; + this.count += add; + if (this.count > this.maxSize) { + const prev = this.list.p?.p; + (0, import_assert3.default)(prev); + prev.n = void 0; + this.list.p = prev; + ++this._removed; + --this.count; + } + } + stats() { + return { size: this.count, hits: this.hits, misses: this.misses, added: this.added, removed: this.removed }; + } + toJSON() { + return this.stats(); + } + static assertValid(cache2) { + assertValidateLL(cache2.list); + } +}; +function assertValidateLL(list) { + if (!list.n && !list.p) + return; + (0, import_assert3.default)(list.n, "Bad Next"); + (0, import_assert3.default)(list.p, "Bad Prev"); + const visited = /* @__PURE__ */ new Set(); + let n = list; + for (; n.n; n = n.n) { + (0, import_assert3.default)(!visited.has(n.n), "Circular"); + visited.add(n.n); + } + (0, import_assert3.default)(list.p === n, "Tail matches"); + visited.clear(); + n = list; + for (; n.p; n = n.p) { + (0, import_assert3.default)(!visited.has(n.p), "Circular"); + visited.add(n.p); + } + (0, import_assert3.default)(list.n === n, "Head matches"); +} + +// node_modules/cspell-lib/dist/esm/util/logger.mjs +var _logger = console; +function logError(...args) { + _logger.error(...args); +} +function logWarning(...args) { + _logger.warn(...args); +} +function setLogger(logger) { + const oldLogger = _logger; + _logger = logger; + return oldLogger; +} + +// node_modules/cspell-lib/dist/esm/util/resolveFile.mjs +var fs2 = __toESM(require("fs"), 1); +var os = __toESM(require("os"), 1); +var path2 = __toESM(require("path"), 1); +var import_resolve_from = __toESM(require_resolve_from2(), 1); +var import_resolve_global = __toESM(require_resolve_global(), 1); +var testNodeModules = /^node_modules\//; +function resolveFile(filename, relativeTo) { + filename = filename.replace(/^~/, os.homedir()); + const steps = [ + { filename, fn: tryUrl }, + { filename, fn: tryNodeResolve }, + { filename: path2.resolve(relativeTo, filename), fn: tryResolveExists }, + { filename: path2.resolve(filename), fn: tryResolveExists }, + { filename, fn: tryNodeResolveDefaultPaths }, + { filename, fn: tryResolveFrom }, + { filename: filename.replace(testNodeModules, ""), fn: tryResolveFrom }, + { filename, fn: tryResolveGlobal } + ]; + for (const step of steps) { + const r = step.fn(step.filename, relativeTo); + if (r.found) + return r; + } + return { filename: path2.resolve(relativeTo, filename), relativeTo, found: false }; +} +var isUrlRegExp = /^\w+:\/\//i; +function tryUrl(filename, relativeTo) { + if (isUrlRegExp.test(filename)) { + return { filename, relativeTo: void 0, found: true }; + } + if (isUrlRegExp.test(relativeTo)) { + const url = new URL(filename, relativeTo); + return { filename: url.href, relativeTo, found: true }; + } + return { filename, relativeTo: void 0, found: false }; +} +function tryNodeResolveDefaultPaths(filename) { + try { + const r = require.resolve(filename); + return { filename: r, relativeTo: void 0, found: true }; + } catch (_) { + return { filename, relativeTo: void 0, found: false }; + } +} +function tryNodeResolve(filename, relativeTo) { + const home = os.homedir(); + function calcPaths(p) { + const paths2 = [p]; + if (filename.startsWith(".") && (filename.startsWith("./") || filename.startsWith("." + path2.sep) || filename.startsWith(".."))) { + return paths2; } - exports.findMatchingRangesForPatterns = findMatchingRangesForPatterns; - function excludeRanges(includeRanges, excludeRanges2) { - return [..._excludeRanges(sortMatchRangeArray(includeRanges), sortMatchRangeArray(excludeRanges2))]; + for (; p && path2.dirname(p) !== p && p !== home; p = path2.dirname(p)) { + paths2.push(p); } - exports.excludeRanges = excludeRanges; - function* _excludeRanges(includeRanges, excludeRanges2) { - if (!includeRanges.length) - return; - if (!excludeRanges2.length) { - yield* includeRanges; - return; + return paths2; + } + const paths = calcPaths(path2.resolve(relativeTo)); + try { + const r = require.resolve(filename, { paths }); + return { filename: r, relativeTo, found: true }; + } catch (_) { + return { filename, relativeTo, found: false }; + } +} +function tryResolveGlobal(filename) { + const r = import_resolve_global.default.silent(filename); + return { filename: r || filename, relativeTo: void 0, found: !!r }; +} +function tryResolveExists(filename) { + return { filename, relativeTo: void 0, found: fs2.existsSync(filename) }; +} +function tryResolveFrom(filename, relativeTo) { + try { + return { filename: (0, import_resolve_from.default)(relativeTo, filename), relativeTo, found: true }; + } catch (error2) { + return { filename, relativeTo, found: false }; + } +} + +// node_modules/cspell-lib/dist/esm/Settings/constants.mjs +var configSettingsFileVersion0_1 = "0.1"; +var configSettingsFileVersion0_2 = "0.2"; +var currentSettingsFileVersion = configSettingsFileVersion0_2; +var ENV_CSPELL_GLOB_ROOT = "CSPELL_GLOB_ROOT"; + +// node_modules/cspell-lib/dist/esm/Settings/CSpellSettingsServer.mjs +var import_assert7 = __toESM(require("assert"), 1); +var path4 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/util/AutoResolve.mjs +function autoResolve(map3, key, resolve13) { + const found = map3.get(key); + if (found !== void 0 || map3.has(key)) + return found; + const value = resolve13(key); + map3.set(key, value); + return value; +} +var AutoResolveCache = class { + constructor() { + this.map = /* @__PURE__ */ new Map(); + } + get(k, resolve13) { + return resolve13 ? autoResolve(this.map, k, resolve13) : this.map.get(k); + } + has(k) { + return this.map.has(k); + } + set(k, v) { + this.map.set(k, v); + return this; + } +}; +function createAutoResolveCache() { + return new AutoResolveCache(); +} +function autoResolveWeak(map3, key, resolve13) { + const found = map3.get(key); + if (found !== void 0 || map3.has(key)) + return found; + const value = resolve13(key); + map3.set(key, value); + return value; +} +var AutoResolveWeakCache = class { + constructor() { + this.map = /* @__PURE__ */ new WeakMap(); + } + get(k, resolve13) { + return resolve13 ? autoResolveWeak(this.map, k, resolve13) : this.map.get(k); + } + has(k) { + return this.map.has(k); + } + set(k, v) { + this.map.set(k, v); + return this; + } +}; + +// node_modules/cspell-trie-lib/dist/lib/constants.js +var COMPOUND_FIX = "+"; +var OPTIONAL_COMPOUND_FIX = "*"; +var CASE_INSENSITIVE_PREFIX = "~"; +var FORBID_PREFIX = "!"; +var LINE_COMMENT = "#"; +var IDENTITY_PREFIX = "="; +var defaultTrieInfo = Object.freeze({ + compoundCharacter: COMPOUND_FIX, + forbiddenWordPrefix: FORBID_PREFIX, + stripCaseAndAccentsPrefix: CASE_INSENSITIVE_PREFIX, + isCaseAware: true +}); + +// node_modules/cspell-trie-lib/dist/lib/utils/memorizeLastCall.js +var SymEmpty = Symbol("memorizeLastCall"); +function memorizeLastCall(fn) { + let lastP = void 0; + let lastR = SymEmpty; + function calc(p) { + if (lastR !== SymEmpty && lastP === p) + return lastR; + lastP = p; + lastR = fn(p); + return lastR; + } + return calc; +} + +// node_modules/cspell-trie-lib/dist/lib/utils/mergeDefaults.js +function mergeDefaults(value, defaultValue) { + const result = { ...defaultValue }; + if (value) { + for (const [k, v] of Object.entries(value)) { + if (k in result) { + result[k] = v ?? result[k]; + } + } + } + return result; +} + +// node_modules/cspell-trie-lib/dist/lib/ITrieNode/find.js +var defaultLegacyMinCompoundLength = 3; +var _defaultFindOptions = { + matchCase: false, + compoundMode: "compound", + forbidPrefix: FORBID_PREFIX, + compoundFix: COMPOUND_FIX, + caseInsensitivePrefix: CASE_INSENSITIVE_PREFIX, + legacyMinCompoundLength: defaultLegacyMinCompoundLength +}; +var arrayCompoundModes = ["none", "compound", "legacy"]; +var knownCompoundModes = new Map(arrayCompoundModes.map((a) => [a, a])); +function findWord(root, word, options) { + return _findWord(root, word, createFindOptions(options)); +} +function findWordNode(root, word, options) { + return _findWordNode(root, word, createFindOptions(options)); +} +function _findWord(root, word, options) { + const { node: _, ...result } = _findWordNode(root, word, options); + return result; +} +function _findWordNode(root, word, options) { + const trieInfo = root.info; + const compoundMode = knownCompoundModes.get(options.compoundMode) || _defaultFindOptions.compoundMode; + const compoundPrefix = options.compoundMode === "compound" ? trieInfo.compoundCharacter ?? options.compoundFix : ""; + const ignoreCasePrefix = options.matchCase ? "" : trieInfo.stripCaseAndAccentsPrefix ?? options.caseInsensitivePrefix; + function __findCompound() { + const f = findCompoundWord(root, word, compoundPrefix, ignoreCasePrefix); + const result = { ...f }; + if (f.found !== false && f.compoundUsed) { + const r = !f.caseMatched ? walk(root, options.caseInsensitivePrefix) : root; + result.forbidden = isForbiddenWord(r, word, options.forbidPrefix); + } + return result; + } + function __findExact() { + const n = walk(root, word); + const isFound = isEndOfWordNode(n); + const result = { + found: isFound && word, + compoundUsed: false, + forbidden: isForbiddenWord(root, word, options.forbidPrefix), + node: n, + caseMatched: true + }; + return result; + } + switch (compoundMode) { + case "none": + return options.matchCase ? __findExact() : __findCompound(); + case "compound": + return __findCompound(); + case "legacy": + return findLegacyCompound(root, word, options); + } +} +function findLegacyCompound(root, word, options) { + const roots = [root]; + if (!options.matchCase) { + roots.push(walk(root, options.caseInsensitivePrefix)); + } + return findLegacyCompoundNode(roots, word, options.legacyMinCompoundLength); +} +function findCompoundNode(root, word, compoundCharacter, ignoreCasePrefix) { + const stack = [ + // { n: root, compoundPrefix: '', cr: undefined, caseMatched: true }, + { n: root, compoundPrefix: ignoreCasePrefix, cr: void 0, caseMatched: true } + ]; + const compoundPrefix = compoundCharacter || ignoreCasePrefix; + const possibleCompoundPrefix = ignoreCasePrefix && compoundCharacter ? ignoreCasePrefix + compoundCharacter : ""; + const w = word.normalize(); + function determineRoot(s) { + const prefix = s.compoundPrefix; + let r = root; + let i2; + for (i2 = 0; i2 < prefix.length && r; ++i2) { + r = r.get(prefix[i2]); + } + const caseMatched2 = s.caseMatched && prefix[0] !== ignoreCasePrefix; + return { + n: s.n, + compoundPrefix: prefix === compoundPrefix ? possibleCompoundPrefix : "", + cr: r, + caseMatched: caseMatched2 + }; + } + let compoundUsed = false; + let caseMatched = true; + let i = 0; + let node; + while (true) { + const s = stack[i]; + const h = w[i++]; + const n = s.cr || s.n; + const c = n?.get(h); + if (c && i < word.length) { + caseMatched = s.caseMatched; + stack[i] = { n: c, compoundPrefix, cr: void 0, caseMatched }; + } else if (!c || !c.eow) { + node = node || c; + while (--i > 0) { + const s2 = stack[i]; + if (!s2.compoundPrefix || !s2.n?.hasChildren()) + continue; + if (s2.n.get(compoundCharacter)) + break; } - let exIndex = 0; - const limit = excludeRanges2.length; - for (const incRange of includeRanges) { - const endPos = incRange.endPos; - let startPos = incRange.startPos; - for (; exIndex < limit; ++exIndex) { - const ex = excludeRanges2[exIndex]; - if (ex.startPos >= endPos) + if (i >= 0 && stack[i].compoundPrefix) { + compoundUsed = i > 0; + const r = determineRoot(stack[i]); + stack[i] = r; + if (!r.cr) { + break; + } + if (!i && !r.caseMatched) { + if (w !== w.toLowerCase()) { break; - if (ex.endPos <= startPos) - continue; - if (ex.startPos > startPos) { - yield { startPos, endPos: ex.startPos }; } - startPos = ex.endPos; - if (startPos >= endPos) - break; - } - if (startPos < endPos) { - yield { startPos, endPos }; } + } else { + break; } + } else { + node = c; + caseMatched = s.caseMatched; + break; } - function extractRangeText(text, ranges) { - return ranges.map(({ startPos, endPos }) => ({ - startPos, - endPos, - text: text.slice(startPos, endPos) - })); - } - exports.extractRangeText = extractRangeText; - var SymSortedMatchRangeArray = Symbol("SortedMatchRangeArray"); - function sortMatchRangeArray(values) { - if (isSortedMatchRangeArray(values)) - return values; - return makeSortedMatchRangeArray(values.sort(compareRanges)); - } - function isSortedMatchRangeArray(a) { - return a[SymSortedMatchRangeArray] === true; + } + const found = i && i === word.length && word || false; + const result = { found, compoundUsed, node, forbidden: void 0, caseMatched }; + return result; +} +function findCompoundWord(root, word, compoundCharacter, ignoreCasePrefix) { + const { found, compoundUsed, node, caseMatched } = findCompoundNode(root, word, compoundCharacter, ignoreCasePrefix); + if (!node || !node.eow) { + return { found: false, compoundUsed, node, forbidden: void 0, caseMatched }; + } + return { found, compoundUsed, node, forbidden: void 0, caseMatched }; +} +function findWordExact(root, word) { + return isEndOfWordNode(walk(root, word)); +} +function isEndOfWordNode(n) { + return !!n?.eow; +} +function walk(root, word) { + const w = word; + let n = root; + let i = 0; + while (n && i < word.length) { + const h = w[i++]; + n = n.get(h); + } + return n; +} +function findLegacyCompoundNode(roots, word, minCompoundLength) { + const root = roots[0]; + const numRoots = roots.length; + const stack = [ + { n: root, usedRoots: 1, subLength: 0, isCompound: false, cr: void 0, caseMatched: true } + ]; + const w = word; + const wLen = w.length; + let compoundUsed = false; + let caseMatched = true; + let i = 0; + let node; + while (true) { + const s = stack[i]; + const h = w[i++]; + const n = s.cr || s.n; + const c = n?.get(h); + if (c && i < wLen) { + stack[i] = { + n: c, + usedRoots: 0, + subLength: s.subLength + 1, + isCompound: s.isCompound, + cr: void 0, + caseMatched: s.caseMatched + }; + } else if (!c || !c.eow || c.eow && s.subLength < minCompoundLength - 1) { + while (--i > 0) { + const s2 = stack[i]; + if (s2.usedRoots < numRoots && s2.n?.eow && (s2.subLength >= minCompoundLength || !s2.subLength) && wLen - i >= minCompoundLength) { + break; + } + } + if (i > 0 || stack[i].usedRoots < numRoots) { + compoundUsed = i > 0; + const s2 = stack[i]; + s2.cr = roots[s2.usedRoots++]; + s2.subLength = 0; + s2.isCompound = compoundUsed; + s2.caseMatched = s2.caseMatched && s2.usedRoots <= 1; + } else { + break; + } + } else { + node = c; + caseMatched = s.caseMatched; + break; } - function makeSortedMatchRangeArray(sortedValues) { - const sorted = sortedValues; - sorted[SymSortedMatchRangeArray] = true; - Object.freeze(sorted); - return sorted; + } + function extractWord() { + if (!word || i < word.length) + return false; + const letters = []; + let subLen = 0; + for (let j = 0; j < i; ++j) { + const { subLength } = stack[j]; + if (subLength < subLen) { + letters.push("+"); + } + letters.push(word[j]); + subLen = subLength; + } + return letters.join(""); + } + const found = extractWord(); + const result = { found, compoundUsed, node, forbidden: void 0, caseMatched }; + return result; +} +function isForbiddenWord(root, word, forbiddenPrefix) { + return findWordExact(root?.get(forbiddenPrefix), word); +} +var createFindOptions = memorizeLastCall(_createFindOptions); +function _createFindOptions(options) { + return mergeDefaults(options, _defaultFindOptions); +} + +// node_modules/cspell-trie-lib/dist/lib/walker/walkerTypes.js +var JOIN_SEPARATOR = "+"; +var WORD_SEPARATOR = " "; +var CompoundWordsMethod; +(function(CompoundWordsMethod2) { + CompoundWordsMethod2[CompoundWordsMethod2["NONE"] = 0] = "NONE"; + CompoundWordsMethod2[CompoundWordsMethod2["SEPARATE_WORDS"] = 1] = "SEPARATE_WORDS"; + CompoundWordsMethod2[CompoundWordsMethod2["JOIN_WORDS"] = 2] = "JOIN_WORDS"; +})(CompoundWordsMethod || (CompoundWordsMethod = {})); + +// node_modules/cspell-trie-lib/dist/lib/ITrieNode/walker/walker.js +function* compoundWalker(root, compoundingMethod) { + const empty = Object.freeze([]); + const roots = { + [CompoundWordsMethod.NONE]: empty, + [CompoundWordsMethod.JOIN_WORDS]: [[JOIN_SEPARATOR, root]], + [CompoundWordsMethod.SEPARATE_WORDS]: [[WORD_SEPARATOR, root]] + }; + const rc = roots[compoundingMethod].length ? roots[compoundingMethod] : void 0; + function children(n) { + if (n.hasChildren()) { + const c = n.keys().map((k, i) => [k, n.child(i)]); + return n.eow && rc ? c.concat(rc) : c; + } + if (n.eow) { + return roots[compoundingMethod]; + } + return empty; + } + let depth = 0; + const stack = []; + stack[depth] = { t: "", c: children(root), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length) { + const [char, node] = s.c[s.ci++]; + const text = baseText + char; + const goDeeper = yield { text, node, depth }; + if (goDeeper ?? true) { + depth++; + baseText = text; + stack[depth] = { t: text, c: children(node), ci: 0 }; + } + s = stack[depth]; + } + depth -= 1; + } +} +function* nodeWalker(root) { + let depth = 0; + const stack = []; + stack[depth] = { t: "", n: root, c: root.keys(), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length && s.n) { + const idx2 = s.ci++; + const char = s.c[idx2]; + const node = s.n.child(idx2); + const text = baseText + char; + const goDeeper = yield { text, node, depth }; + if (goDeeper !== false) { + depth++; + baseText = text; + const s2 = stack[depth]; + const c = node.keys(); + if (s2) { + s2.t = text; + s2.n = node; + s2.c = c; + s2.ci = 0; + } else { + stack[depth] = { t: text, n: node, c, ci: 0 }; + } + } + s = stack[depth]; } - exports.__testing__ = { - makeSortedMatchRangeArray - }; + depth -= 1; } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/textValidator.js -var require_textValidator = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/textValidator.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); +} +function walker(root, compoundingMethod = CompoundWordsMethod.NONE) { + return compoundingMethod === CompoundWordsMethod.NONE ? nodeWalker(root) : compoundWalker(root, compoundingMethod); +} +function walkerWords(root) { + return walkerWordsITrie(root); +} +function* walkerWordsITrie(root) { + let depth = 0; + const stack = []; + stack[depth] = { t: "", n: root, c: root.keys(), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length && s.n) { + const char = s.c[s.ci++]; + const node = s.n.get(char); + if (!node) + continue; + const text = baseText + char; + if (node.eow) + yield text; + depth++; + baseText = text; + const c = node.keys(); + if (stack[depth]) { + s = stack[depth]; + s.t = text; + s.n = node; + s.c = c; + s.ci = 0; + } else { + stack[depth] = { t: text, n: node, c, ci: 0 }; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports._testMethods = exports.mapLineSegmentAgainstRangesFactory = exports.calcTextInclusionRanges = exports.validateText = void 0; - var sync_1 = require_sync(); - var Text2 = __importStar(require_text2()); - var TextRange = __importStar(require_TextRange()); - var defaultConstants_js_1 = require_defaultConstants(); - var lineValidatorFactory_js_1 = require_lineValidatorFactory(); - function validateText(text, dict, options) { - const { maxNumberOfProblems = defaultConstants_js_1.defaultMaxNumberOfProblems, maxDuplicateProblems = defaultConstants_js_1.defaultMaxDuplicateProblems } = options; - const mapOfProblems = /* @__PURE__ */ new Map(); - const includeRanges = calcTextInclusionRanges(text, options); - const lineValidator = (0, lineValidatorFactory_js_1.lineValidatorFactory)(dict, options); - const validator = lineValidator.fn; - const iter = (0, sync_1.pipe)(Text2.extractLinesOfText(text), (0, sync_1.opConcatMap)(mapLineToLineSegments(includeRanges)), (0, sync_1.opConcatMap)(validator), (0, sync_1.opFilter)((wo) => { - const word = wo.text; - const n = (mapOfProblems.get(word) || 0) + 1; - mapOfProblems.set(word, n); - return n <= maxDuplicateProblems; - }), (0, sync_1.opTake)(maxNumberOfProblems)); - return iter; - } - exports.validateText = validateText; - function calcTextInclusionRanges(text, options) { - const { ignoreRegExpList = [], includeRegExpList = [] } = options; - const filteredIncludeList = includeRegExpList.filter((a) => !!a); - const finalIncludeList = filteredIncludeList.length ? filteredIncludeList : [/.*/gim]; - const includeRanges = TextRange.excludeRanges(TextRange.findMatchingRangesForPatterns(finalIncludeList, text), TextRange.findMatchingRangesForPatterns(ignoreRegExpList, text)); - return includeRanges; - } - exports.calcTextInclusionRanges = calcTextInclusionRanges; - function mapLineToLineSegments(includeRanges) { - const mapAgainstRanges = mapLineSegmentAgainstRangesFactory(includeRanges); - return (line) => { - const segment = { line, segment: line }; - return mapAgainstRanges(segment); - }; + s = stack[depth]; } - function mapLineSegmentAgainstRangesFactory(includeRanges) { - let rangePos = 0; - const mapper = (lineSeg) => { - if (!includeRanges.length) { - return []; - } - const parts = []; - const { segment, line } = lineSeg; - const { text, offset, length } = segment; - const textEndPos = offset + (length ?? text.length); - let textStartPos = offset; - while (rangePos && (rangePos >= includeRanges.length || includeRanges[rangePos].startPos > textStartPos)) { - rangePos -= 1; - } - const cur = includeRanges[rangePos]; - if (textEndPos <= cur.endPos && textStartPos >= cur.startPos) { - return [lineSeg]; - } - while (textStartPos < textEndPos) { - while (includeRanges[rangePos] && includeRanges[rangePos].endPos <= textStartPos) { - rangePos += 1; - } - if (!includeRanges[rangePos]) { - break; - } - const { startPos, endPos } = includeRanges[rangePos]; - if (textEndPos < startPos) { - break; - } - const a = Math.max(textStartPos, startPos); - const b = Math.min(textEndPos, endPos); - if (a !== b) { - parts.push({ line, segment: { offset: a, text: text.slice(a - offset, b - offset) } }); - } - textStartPos = b; - } - return parts; - }; - return mapper; + depth -= 1; + } +} + +// node_modules/cspell-trie-lib/dist/lib/ITrieNode/trie-util.js +function iteratorTrieWords(node) { + return walkerWords(node); +} +function findNode(node, word) { + for (let i = 0; i < word.length; ++i) { + const n = node.get(word[i]); + if (!n) + return void 0; + node = n; + } + return node; +} +function countWords(root) { + const visited = /* @__PURE__ */ new Map(); + function walk4(n) { + const nestedCount = visited.get(n.id); + if (nestedCount !== void 0) { + return nestedCount; } - exports.mapLineSegmentAgainstRangesFactory = mapLineSegmentAgainstRangesFactory; - exports._testMethods = { - mapWordsAgainstRanges: mapLineSegmentAgainstRangesFactory - }; + let cnt = n.eow ? 1 : 0; + visited.set(n, cnt); + const size = n.size; + for (let i = 0; i < size; ++i) { + cnt += walk4(n.child(i)); + } + visited.set(n, cnt); + return cnt; } -}); + return walk4(root); +} -// node_modules/cspell-lib/dist/cjs/textValidation/docValidator.js -var require_docValidator = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/docValidator.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.shouldCheckDocument = exports.DocumentValidator = void 0; - var sync_1 = require_sync(); - var cspell_types_1 = require_cjs9(); - var assert_1 = __importDefault(require("assert")); - var cspell_glob_1 = require_cjs(); - var path_1 = __importDefault(require("path")); - var TextDocument_js_1 = require_TextDocument(); - var index_js_1 = require_configLoader2(); - var index_js_2 = require_Settings(); - var InDocSettings_js_1 = require_InDocSettings(); - var index_js_3 = require_SpellingDictionary4(); - var suggestions_js_1 = require_suggestions(); - var errors_js_1 = require_errors3(); - var simpleCache_js_1 = require_simpleCache2(); - var timer_js_1 = require_timer2(); - var Uri_js_1 = require_Uri(); - var defaultConstants_js_1 = require_defaultConstants(); - var determineTextDocumentSettings_js_1 = require_determineTextDocumentSettings(); - var lineValidatorFactory_js_1 = require_lineValidatorFactory(); - var parsedText_js_1 = require_parsedText(); - var settingsToValidateOptions_js_1 = require_settingsToValidateOptions(); - var textValidator_js_1 = require_textValidator(); - var ERROR_NOT_PREPARED = "Validator Must be prepared before calling this function."; - var skipValidation = false; - var DocumentValidator = class { - /** - * @param doc - Document to validate - * @param config - configuration to use (not finalized). - */ - constructor(doc, options, settings) { - this.settings = settings; - this._ready = false; - this.errors = []; - this._preparationTime = -1; - this._suggestions = new simpleCache_js_1.AutoCache((text) => this.genSuggestions(text), 1e3); - this._document = doc; - this.options = { ...options }; - const numSuggestions = this.options.numSuggestions ?? settings.numSuggestions; - if (numSuggestions !== void 0) { - this.options.numSuggestions = numSuggestions; - } - } - get ready() { - return this._ready; - } - /** - * Prepare to validate a document. - * This will load all the necessary configuration and dictionaries. - * - * @deprecated - * @deprecationMessage Use the async `prepare` method. - */ - prepareSync() { - if (this._ready) - return; - const timer = (0, timer_js_1.createTimer)(); - const { options, settings } = this; - const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; - const optionsConfigFile = options.configFile; - const localConfigFn = optionsConfigFile ? () => (0, index_js_1.loadConfigSync)(optionsConfigFile, settings) : useSearchForConfig ? () => searchForDocumentConfigSync(this._document, settings, settings) : void 0; - const localConfig = localConfigFn && (0, errors_js_1.wrapCall)(localConfigFn, (e) => this.addPossibleError(e))(); - this.addPossibleError(localConfig?.__importRef?.error); - const config = (0, index_js_2.mergeSettings)(settings, localConfig); - const docSettings = (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(this._document, config); - const dict = (0, index_js_3.getDictionaryInternalSync)(docSettings); - const matcher = new cspell_glob_1.GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); - const uri = this._document.uri; - const shouldCheck = !matcher.match((0, Uri_js_1.uriToFilePath)(uri)) && (docSettings.enabled ?? true); - const finalSettings = (0, index_js_2.finalizeSettings)(docSettings); - const validateOptions = (0, settingsToValidateOptions_js_1.settingsToValidateOptions)(finalSettings); - const includeRanges = (0, textValidator_js_1.calcTextInclusionRanges)(this._document.text, validateOptions); - const segmenter = (0, parsedText_js_1.createMappedTextSegmenter)(includeRanges); - const textValidator = (0, lineValidatorFactory_js_1.textValidatorFactory)(dict, validateOptions); - this._preparations = { - config, - dictionary: dict, - docSettings, - finalSettings, - shouldCheck, - validateOptions, - includeRanges, - segmenter, - textValidator, - localConfig, - localConfigFilepath: localConfig?.__importRef?.filename - }; - this._ready = true; - this._preparationTime = timer.elapsed(); - } - async prepare() { - if (this._ready) - return; - if (this._prepared) - return this._prepared; - this._prepared = this._prepareAsync(); - return this._prepared; - } - async _prepareAsync() { - (0, assert_1.default)(!this._ready); - const timer = (0, timer_js_1.createTimer)(); - const { options, settings } = this; - const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; - const pLocalConfig = options.configFile ? (0, index_js_2.loadConfig)(options.configFile, settings) : useSearchForConfig ? searchForDocumentConfig(this._document, settings, settings) : void 0; - const localConfig = await (0, errors_js_1.catchPromiseError)(pLocalConfig, (e) => this.addPossibleError(e)) || {}; - this.addPossibleError(localConfig?.__importRef?.error); - const config = (0, index_js_2.mergeSettings)(settings, localConfig); - const docSettings = (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(this._document, config); - const dict = await (0, index_js_3.getDictionaryInternal)(docSettings); - const matcher = new cspell_glob_1.GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); - const uri = this._document.uri; - const shouldCheck = !matcher.match((0, Uri_js_1.uriToFilePath)(uri)) && (docSettings.enabled ?? true); - const finalSettings = (0, index_js_2.finalizeSettings)(docSettings); - const validateOptions = (0, settingsToValidateOptions_js_1.settingsToValidateOptions)(finalSettings); - const includeRanges = (0, textValidator_js_1.calcTextInclusionRanges)(this._document.text, validateOptions); - const segmenter = (0, parsedText_js_1.createMappedTextSegmenter)(includeRanges); - const textValidator = (0, lineValidatorFactory_js_1.textValidatorFactory)(dict, validateOptions); - this._preparations = { - config, - dictionary: dict, - docSettings, - finalSettings, - shouldCheck, - validateOptions, - includeRanges, - segmenter, - textValidator, - localConfig, - localConfigFilepath: localConfig?.__importRef?.filename - }; - this._ready = true; - this._preparationTime = timer.elapsed(); - } - _updatePrep() { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const timer = (0, timer_js_1.createTimer)(); - const prep = this._preparations; - const docSettings = (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(this._document, prep.config); - const dict = (0, index_js_3.getDictionaryInternalSync)(docSettings); - const shouldCheck = docSettings.enabled ?? true; - const finalSettings = (0, index_js_2.finalizeSettings)(docSettings); - const validateOptions = (0, settingsToValidateOptions_js_1.settingsToValidateOptions)(finalSettings); - const includeRanges = (0, textValidator_js_1.calcTextInclusionRanges)(this._document.text, validateOptions); - const segmenter = (0, parsedText_js_1.createMappedTextSegmenter)(includeRanges); - const textValidator = (0, lineValidatorFactory_js_1.textValidatorFactory)(dict, validateOptions); - this._preparations = { - ...prep, - dictionary: dict, - docSettings, - shouldCheck, - validateOptions, - includeRanges, - segmenter, - textValidator - }; - this._preparationTime = timer.elapsed(); - } - /** - * The amount of time in ms to prepare for validation. - */ - get prepTime() { - return this._preparationTime; - } - get validateDirectives() { - return this.options.validateDirectives ?? this._preparations?.config.validateDirectives ?? false; - } - checkText(range, _text, scope) { - const text = this._document.text.slice(range[0], range[1]); - return this.check({ text, range, scope: scope.join(" ") }); - } - check(parsedText) { - (0, assert_1.default)(this._ready); - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const { segmenter, textValidator } = this._preparations; - const document = this._document; - let line = void 0; - function mapToIssue(issue) { - const { range, text, isFlagged, isFound, suggestionsEx } = issue; - const offset = range[0]; - const length = range[1] - range[0]; - (0, assert_1.default)(!line || line.offset <= offset); - if (!line || line.offset + line.text.length <= offset) { - line = document.lineAt(offset); - } - return { text, offset, line, length, isFlagged, isFound, suggestionsEx }; - } - const issues = [...(0, sync_1.pipeSync)(segmenter(parsedText), (0, sync_1.opConcatMap)(textValidator.validate), (0, sync_1.opMap)(mapToIssue))]; - if (!this.options.generateSuggestions) { - return issues.map((issue) => { - if (!issue.suggestionsEx) - return issue; - const suggestionsEx = this.adjustSuggestions(issue.text, issue.suggestionsEx); - const suggestions = suggestionsEx.map((s) => s.word); - return { ...issue, suggestionsEx, suggestions }; - }); - } - const withSugs = issues.map((t) => { - const text = t.text; - const suggestionsEx = this.getSuggestions(text); - t.suggestionsEx = suggestionsEx; - t.suggestions = suggestionsEx.map((s) => s.word); - return t; - }); - return withSugs; - } - /** - * Check a Document for Validation Issues. - * @param forceCheck - force a check even if the document would normally be excluded. - * @returns the validation issues. - */ - async checkDocumentAsync(forceCheck) { - await this.prepare(); - return this.checkDocument(forceCheck); - } - /** - * Check a Document for Validation Issues. - * - * Note: The validator must be prepared before calling this method. - * @param forceCheck - force a check even if the document would normally be excluded. - * @returns the validation issues. - */ - checkDocument(forceCheck = false) { - if (skipValidation) - return []; - (0, assert_1.default)(this._ready); - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const spellingIssues = forceCheck || this.shouldCheckDocument() ? [...this._checkParsedText(this._parse())] : []; - const directiveIssues = this.checkDocumentDirectives(); - const allIssues = spellingIssues.concat(directiveIssues).sort((a, b) => a.offset - b.offset); - return allIssues; - } - checkDocumentDirectives(forceCheck = false) { - (0, assert_1.default)(this._ready); - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const validateDirectives = forceCheck || this.validateDirectives; - if (!validateDirectives) - return []; - const document = this.document; - const issueType = cspell_types_1.IssueType.directive; - function toValidationIssue(dirIssue) { - const { text, range, suggestions, suggestionsEx, message } = dirIssue; - const offset = range[0]; - const pos = document.positionAt(offset); - const line = document.getLine(pos.line); - const issue = { text, offset, line, suggestions, suggestionsEx, message, issueType }; - return issue; - } - return [...(0, InDocSettings_js_1.validateInDocumentSettings)(this.document.text, this._preparations.config)].map(toValidationIssue); - } - get document() { - return this._document; - } - updateDocumentText(text) { - (0, TextDocument_js_1.updateTextDocument)(this._document, [{ text }]); - this._updatePrep(); - } - defaultParser() { - return (0, sync_1.pipeSync)(this.document.getLines(), (0, sync_1.opMap)((line) => { - const { text, offset } = line; - const range = [offset, offset + text.length]; - return { text, range }; - })); - } - *_checkParsedText(parsedTexts) { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const { maxNumberOfProblems = defaultConstants_js_1.defaultMaxNumberOfProblems, maxDuplicateProblems = defaultConstants_js_1.defaultMaxDuplicateProblems } = this._preparations.validateOptions; - let numProblems = 0; - const mapOfProblems = /* @__PURE__ */ new Map(); - for (const pText of parsedTexts) { - for (const issue of this.check(pText)) { - const { text } = issue; - const n = (mapOfProblems.get(text) || 0) + 1; - mapOfProblems.set(text, n); - if (n > maxDuplicateProblems) - continue; - yield issue; - if (++numProblems >= maxNumberOfProblems) - return; - } - } - } - addPossibleError(error2) { - if (!error2) - return; - error2 = this.errors.push((0, errors_js_1.toError)(error2)); - } - _parse() { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const parser = this._preparations.finalSettings.parserFn; - if (typeof parser !== "object") - return this.defaultParser(); - return parser.parse(this.document.text, this.document.uri.path).parsedTexts; - } - getSuggestions(text) { - return this._suggestions.get(text); - } - genSuggestions(text) { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const settings = this._preparations.docSettings; - const dict = this._preparations.dictionary; - const sugOptions = { - compoundMethod: 0, - numSuggestions: this.options.numSuggestions, - includeTies: false, - ignoreCase: !(settings.caseSensitive ?? false), - timeout: settings.suggestionsTimeout, - numChanges: settings.suggestionNumChanges - }; - const rawSuggestions = dict.suggest(text, sugOptions); - return this.adjustSuggestions(text, rawSuggestions); - } - adjustSuggestions(text, rawSuggestions) { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const settings = this._preparations.docSettings; - const ignoreCase = !(settings.caseSensitive ?? false); - const locale = this._preparations.config.language; - const dict = this._preparations.dictionary; - const sugsWithAlt = (0, suggestions_js_1.calcSuggestionAdjustedToToMatchCase)(text, rawSuggestions.map(mapSug), locale, ignoreCase, dict); - return sugsWithAlt.map(sanitizeSuggestion); - } - getFinalizedDocSettings() { - (0, assert_1.default)(this._ready); - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - return this._preparations.docSettings; - } - /** - * Returns true if the final result of the configuration calculation results - * in the document being enabled. Note: in some cases, checking the document - * might still make sense, for example, the `@cspell/eslint-plugin` relies on - * `eslint` configuration to make that determination. - * @returns true if the document settings have resolved to be `enabled` - */ - shouldCheckDocument() { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - return this._preparations.shouldCheck; - } - /** - * Internal `cspell-lib` use. - */ - _getPreparations() { - return this._preparations; - } - }; - exports.DocumentValidator = DocumentValidator; - function sanitizeSuggestion(sug) { - const { word, isPreferred, wordAdjustedToMatchCase } = sug; - if (isPreferred && wordAdjustedToMatchCase) - return { word, wordAdjustedToMatchCase, isPreferred }; - if (isPreferred) - return { word, isPreferred }; - if (wordAdjustedToMatchCase) - return { word, wordAdjustedToMatchCase }; - return { word }; - } - async function searchForDocumentConfig(document, defaultConfig, pnpSettings) { - const { uri } = document; - if (uri.scheme !== "file") - return Promise.resolve(defaultConfig); - return (0, index_js_2.searchForConfig)(path_1.default.dirname((0, Uri_js_1.uriToFilePath)(uri)), pnpSettings).then((s) => s || defaultConfig); - } - function mapSug(sug) { - return { cost: 999, ...sug }; - } - function searchForDocumentConfigSync(document, defaultConfig, pnpSettings) { - const { uri } = document; - if (uri.scheme !== "file") - defaultConfig; - return (0, index_js_1.searchForConfigSync)((0, Uri_js_1.uriToFilePath)(uri), pnpSettings) || defaultConfig; - } - async function shouldCheckDocument2(doc, options, settings) { - const errors = []; - function addPossibleError(error2) { - if (!error2) - return void 0; - error2 = errors.push((0, errors_js_1.toError)(error2)); - return void 0; +// node_modules/cspell-trie-lib/dist/lib/TrieNode/trie.js +function trieRootToITrieRoot(root) { + return ImplITrieRoot.toITrieNode(root); +} +function trieNodeToITrieNode(node) { + return ImplITrieNode.toITrieNode(node); +} +var EmptyKeys = Object.freeze([]); +var EmptyValues = Object.freeze([]); +var EmptyEntries = Object.freeze([]); +var ImplITrieNode = class _ImplITrieNode { + constructor(node) { + this.node = node; + this.id = node; + } + /** flag End of Word */ + get eow() { + return !!this.node.f; + } + /** number of children */ + get size() { + if (!this.node.c) + return 0; + return this.keys().length; + } + /** get keys to children */ + keys() { + if (this._keys) + return this._keys; + const keys2 = this.node.c ? Object.keys(this.node.c) : EmptyKeys; + this._keys = keys2; + return keys2; + } + /** get the child nodes */ + values() { + return !this.node.c ? EmptyValues : Object.values(this.node.c).map((n) => _ImplITrieNode.toITrieNode(n)); + } + entries() { + return !this.node.c ? EmptyEntries : Object.entries(this.node.c).map(([k, n]) => [k, _ImplITrieNode.toITrieNode(n)]); + } + /** get child ITrieNode */ + get(char) { + const n = this.node.c?.[char]; + if (!n) + return void 0; + return _ImplITrieNode.toITrieNode(n); + } + has(char) { + const c = this.node.c; + return c && char in c || false; + } + child(keyIdx) { + const char = this.keys()[keyIdx]; + const n = char && this.get(char); + if (!n) + throw new Error("Index out of range."); + return n; + } + hasChildren() { + return !!this.node.c; + } + static toITrieNode(node) { + return new this(node); + } +}; +var ImplITrieRoot = class extends ImplITrieNode { + constructor(root) { + super(root); + this.root = root; + const { stripCaseAndAccentsPrefix, compoundCharacter, forbiddenWordPrefix, isCaseAware } = root; + this.info = { stripCaseAndAccentsPrefix, compoundCharacter, forbiddenWordPrefix, isCaseAware }; + } + get eow() { + return false; + } + resolveId(id) { + const n = id; + return new ImplITrieNode(n); + } + static toITrieNode(node) { + return new this(node); + } +}; + +// node_modules/cspell-trie-lib/dist/lib/walker/walker.js +var useITrie = false; +var walkerWords2 = useITrie ? _walkerWords2 : _walkerWords; +function* _walkerWords(root) { + const empty = []; + function children(n) { + if (n.c) { + return Object.keys(n.c); + } + return empty; + } + let depth = 0; + const stack = []; + stack[depth] = { t: "", n: root.c, c: children(root), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length && s.n) { + const char = s.c[s.ci++]; + const node = s.n[char]; + const text = baseText + char; + if (node.f) + yield text; + depth++; + baseText = text; + const c = children(node); + if (stack[depth]) { + s = stack[depth]; + s.t = text; + s.n = node.c; + s.c = c; + s.ci = 0; + } else { + stack[depth] = { t: text, n: node.c, c, ci: 0 }; } - async function shouldCheck() { - const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; - const pLocalConfig = options.configFile ? (0, index_js_2.loadConfig)(options.configFile, settings) : useSearchForConfig ? searchForDocumentConfig(doc, settings, settings) : void 0; - const localConfig = await (0, errors_js_1.catchPromiseError)(pLocalConfig, addPossibleError) || {}; - addPossibleError(localConfig?.__importRef?.error); - const config = (0, index_js_2.mergeSettings)(settings, localConfig); - const matcher = new cspell_glob_1.GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); - const docSettings = (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(doc, config); - const uri = doc.uri; - return !matcher.match((0, Uri_js_1.uriToFilePath)(uri)) && (docSettings.enabled ?? true); + s = stack[depth]; + } + depth -= 1; + } +} +function _walkerWords2(root) { + return walkerWordsITrie2(trieNodeToITrieNode(root)); +} +function* walkerWordsITrie2(root) { + let depth = 0; + const stack = []; + stack[depth] = { t: "", n: root, c: root.keys(), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length && s.n) { + const char = s.c[s.ci++]; + const node = s.n.get(char); + if (!node) + continue; + const text = baseText + char; + if (node.eow) + yield text; + depth++; + baseText = text; + const c = node.keys(); + if (stack[depth]) { + s = stack[depth]; + s.t = text; + s.n = node; + s.c = c; + s.ci = 0; + } else { + stack[depth] = { t: text, n: node, c, ci: 0 }; } - return { errors, shouldCheck: await shouldCheck() }; + s = stack[depth]; } - exports.shouldCheckDocument = shouldCheckDocument2; - exports.__testing__ = { - sanitizeSuggestion - }; + depth -= 1; } -}); +} -// node_modules/cspell-lib/dist/cjs/textValidation/validator.js -var require_validator = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/validator.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateText = exports.diagSource = void 0; - var cspell_types_1 = require_cjs9(); - var TextDocument_js_1 = require_TextDocument(); - var Settings = __importStar(require_Settings()); - var InDocSettings_js_1 = require_InDocSettings(); - var index_js_1 = require_SpellingDictionary4(); - var settingsToValidateOptions_js_1 = require_settingsToValidateOptions(); - var textValidator_js_1 = require_textValidator(); - exports.diagSource = "cSpell Checker"; - async function validateText(text, settings, options = {}) { - const finalSettings = Settings.finalizeSettings(settings); - const dict = await (0, index_js_1.getDictionaryInternal)(finalSettings); - const spellingIssues = [...(0, textValidator_js_1.validateText)(text, dict, (0, settingsToValidateOptions_js_1.settingsToValidateOptions)(finalSettings))]; - const validationIssues = options.validateDirectives || finalSettings.validateDirectives ? (0, InDocSettings_js_1.validateInDocumentSettings)(text, settings) : []; - const issues = spellingIssues.concat(mapValidationIssues(text, validationIssues)); - if (!options.generateSuggestions) { - return issues; - } - const sugOptions = { - numSuggestions: options.numSuggestions, - compoundMethod: index_js_1.CompoundWordsMethod.NONE, - includeTies: false, - ignoreCase: !(settings.caseSensitive ?? false), - timeout: settings.suggestionsTimeout, - numChanges: settings.suggestionNumChanges - }; - const withSugs = issues.map((t) => { - const text2 = t.text; - const suggestionsEx = dict.suggest(text2, sugOptions).map(({ word, isPreferred }) => isPreferred ? { word, isPreferred } : { word }); - t.suggestions = suggestionsEx.map((s) => s.word); - t.suggestionsEx = suggestionsEx; - return t; - }); - return withSugs; +// node_modules/cspell-trie-lib/dist/lib/suggestions/genSuggestionsOptions.js +var defaultGenSuggestionOptions = { + compoundMethod: CompoundWordsMethod.NONE, + ignoreCase: true, + changeLimit: 5 +}; +var defaultSuggestionOptions = { + ...defaultGenSuggestionOptions, + numSuggestions: 8, + includeTies: true, + timeout: 5e3 +}; +var keyMapOfGenSuggestionOptionsStrict = { + changeLimit: "changeLimit", + compoundMethod: "compoundMethod", + ignoreCase: "ignoreCase", + compoundSeparator: "compoundSeparator" +}; +var keyMapOfSuggestionOptionsStrict = { + ...keyMapOfGenSuggestionOptionsStrict, + filter: "filter", + includeTies: "includeTies", + numSuggestions: "numSuggestions", + timeout: "timeout", + weightMap: "weightMap" +}; +function createSuggestionOptions(...opts) { + const options = { ...defaultSuggestionOptions }; + const keys2 = Object.keys(keyMapOfSuggestionOptionsStrict); + for (const opt of opts) { + for (const key of keys2) { + assign(options, opt, key); } - exports.validateText = validateText; - function mapValidationIssues(text, valIssues) { - const issues = [...valIssues]; - if (!issues.length) - return []; - const document = (0, TextDocument_js_1.createTextDocument)({ uri: "", content: text }); - const issueType = cspell_types_1.IssueType.directive; - function toValidationIssue(dirIssue) { - const { text: text2, range, suggestions, suggestionsEx, message } = dirIssue; - const offset = range[0]; - const pos = document.positionAt(offset); - const line = document.getLine(pos.line); - const issue = { text: text2, offset, line, suggestions, suggestionsEx, message, issueType }; - return issue; - } - return issues.map(toValidationIssue); + } + return options; +} +function assign(dest, src, k) { + dest[k] = src[k] ?? dest[k]; +} + +// node_modules/cspell-trie-lib/dist/lib/utils/PairingHeap.js +var PairingHeap = class { + constructor(compare4) { + this.compare = compare4; + this._size = 0; + } + /** Add an item to the heap. */ + add(v) { + this._heap = insert(this.compare, this._heap, v); + ++this._size; + return this; + } + /** take an item from the heap. */ + dequeue() { + const n = this.next(); + if (n.done) + return void 0; + return n.value; + } + /** Add items to the heap */ + concat(i) { + for (const v of i) { + this.add(v); } + return this; } -}); + /** get the next value */ + next() { + if (!this._heap) { + return { value: void 0, done: true }; + } + const value = this._heap.v; + --this._size; + this._heap = removeHead(this.compare, this._heap); + return { value }; + } + /** peek at the next value without removing it. */ + peek() { + return this._heap?.v; + } + [Symbol.iterator]() { + return this; + } + /** alias of `size` */ + get length() { + return this._size; + } + /** number of entries in the heap. */ + get size() { + return this._size; + } +}; +function removeHead(compare4, heap) { + if (!heap || !heap.c) + return void 0; + return mergeSiblings(compare4, heap.c); +} +function insert(compare4, heap, v) { + const n = { + v, + s: void 0, + c: void 0 + }; + if (!heap || compare4(v, heap.v) <= 0) { + n.c = heap; + return n; + } + n.s = heap.c; + heap.c = n; + return heap; +} +function merge(compare4, a, b) { + if (compare4(a.v, b.v) <= 0) { + a.s = void 0; + b.s = a.c; + a.c = b; + return a; + } + b.s = void 0; + a.s = b.c; + b.c = a; + return b; +} +function mergeSiblings(compare4, n) { + if (!n.s) + return n; + const s = n.s; + const ss = s.s; + const m = merge(compare4, n, s); + return ss ? merge(compare4, m, mergeSiblings(compare4, ss)) : m; +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/constants.js +var DEFAULT_COMPOUNDED_WORD_SEPARATOR = "\u2219"; +var opCosts = { + baseCost: 100, + swapCost: 75, + duplicateLetterCost: 80, + compound: 1, + visuallySimilar: 1, + firstLetterBias: 5, + wordBreak: 99, + wordLengthCostFactor: 0.5 +}; -// node_modules/cspell-lib/dist/cjs/textValidation/checkText.js -var require_checkText = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/checkText.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); +// node_modules/cspell-trie-lib/dist/lib/suggestions/orthography.js +var intl = new Intl.Collator("en", { sensitivity: "base" }); +var compare = intl.compare; +var visualLetterGroups = [ + // cspell:disable + forms("\u01CE\xE0\xE5\xC4\xC0A\xE3\xE2\xE1\u01DF\u1EB7\u1EAF\u1EA5\u0100\u0101\u0103\u0105a\xE4\xE6\u0250\u0251\u03B1\u0430\u1FB3") + "\u1FB3", + forms("Bb\u1E03\u0432\u044A\u044C"), + forms("\u010B\u010C\u010Dc\u0109\xE7C\xC7\u0107\u010A\u0421\u0441\u03C2"), + forms("\u1E0E\u1E0B\u1E0F\u1E11\u010F\u0111\u1E0DDd"), + forms("\u0113\xEB\xC8\xCA\xCB\u1EC1\xE9\xE8\u1EBF\u1EC7\u0115eE\u0112\u0117\u0119\u011B\xEA\u0259\u025B\u0451\u0401\u0435\u0292"), + forms("f\u1E1FF\uFB00"), + forms("\u0121\u0120\u011E\u01E7\u011D\u0123Gg\u0263"), + forms("\u0127\u0126\u0125\u1E25Hh\u1E24\u021F\u043D"), + forms("I\u012F\xEF\u0130\xCE\xCD\u012Bi\xCC\xEC\xED\xEE\u0131\u026A\u0268\u0457\u038A\u0399"), + forms("jJ\u0135"), + forms("\u0137Kk\u03BA\u043A\u045C"), + forms("\u1E37\u0142\u013E\u013CLl\u013A\u1E36\u03AF\u03B9"), + forms("M\u1E43\u1E41m"), + forms("n\u0146\xD1N\u1E47\u0148\u0147\xF1\u0144\u014B\u045D\u0438\u0439"), + forms("\xD2O\xF8\u022D\u014C\u014D\u0151\u1ECFo\xD6\xF2\u0231\u022F\xF3\xF4\xF5\xF6\u01A1\u0254\u03CC\u03B4\u043E"), + forms("P\u1E57p\u0440\u0420\u03C1"), + forms("Qq"), + forms("\u0159R\u1E5Br\u0155\u0157\u0453\u0433\u044F"), + forms("\u1E63\u0161\u0218\u1E62sS\u0160\u1E61\u015E\u015D\u015B\u0219\u0283\u03A3"), + forms("t\u021B\u021A\u0165T\u1E6D\u1E6C\u1E6B"), + forms("\xDC\xFC\xFB\u016A\u01B0\u016F\u016B\u0171\xFA\xDB\u016D\xD9\xF9u\u0173U"), + forms("Vv\u03BD"), + forms("\u0175wW\u1E83\u1E85\u1E81\u03C9\u0448"), + forms("xX\u0445"), + forms("\xFF\xFDY\u0177y\xDD\u1EF3\u0423\u045E\u0443"), + forms("Z\u1E93\u017E\u017D\u017C\u017B\u017Az") + // cspell:enable +]; +function forms(letters) { + const n = letters.normalize("NFC").replace(/\p{M}/gu, ""); + const na = n.normalize("NFD").replace(/\p{M}/gu, ""); + const s = new Set(n + n.toLowerCase() + n.toUpperCase() + na + na.toLowerCase() + na.toUpperCase()); + return [...s].join(""); +} +var visualLetterMaskMap = calcVisualLetterMasks(visualLetterGroups); +function calcVisualLetterMasks(groups) { + const map3 = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < groups.length; ++i) { + const m = 1 << i; + const g = groups[i]; + for (const c of g) { + map3[c] = (map3[c] || 0) | m; + } + } + return map3; +} + +// node_modules/cspell-trie-lib/dist/lib/distance/distanceAStarWeighted.js +var import_assert4 = __toESM(require("assert"), 1); + +// node_modules/cspell-trie-lib/dist/lib/distance/weightedMaps.js +var matchPossibleWordSeparators = /[+∙•・●]/g; +function createWeightMap(...defs) { + const map3 = _createWeightMap(); + addDefsToWeightMap(map3, defs); + return map3; +} +function addDefToWeightMap(map3, ...defs) { + return addDefsToWeightMap(map3, defs); +} +function addAdjustment(map3, ...adjustments) { + for (const adj of adjustments) { + map3.adjustments.set(adj.id, adj); + } + return map3; +} +function addDefsToWeightMap(map3, defs) { + function addSet(set, def) { + addSetToTrieCost(map3.insDel, set, def.insDel, def.penalty); + addSetToTrieTrieCost(map3.replace, set, def.replace, def.penalty); + addSetToTrieTrieCost(map3.swap, set, def.swap, def.penalty); + } + for (const _def of defs) { + const def = normalizeDef(_def); + const mapSets = splitMap(def); + mapSets.forEach((s) => addSet(s, def)); + } + return map3; +} +function _createWeightMap() { + return { + insDel: {}, + replace: {}, + swap: {}, + adjustments: /* @__PURE__ */ new Map() + }; +} +function lowest(a, b) { + if (a === void 0) + return b; + if (b === void 0) + return a; + return a <= b ? a : b; +} +function highest(a, b) { + if (a === void 0) + return b; + if (b === void 0) + return a; + return a >= b ? a : b; +} +function normalize(s) { + const f = /* @__PURE__ */ new Set([s]); + f.add(s.normalize("NFC")); + f.add(s.normalize("NFD")); + return f; +} +function* splitMapSubstringsIterable(map3) { + let seq = ""; + let mode = 0; + for (const char of map3) { + if (mode && char === ")") { + yield* normalize(seq); + mode = 0; + continue; + } + if (mode) { + seq += char; + continue; + } + if (char === "(") { + mode = 1; + seq = ""; + continue; + } + yield* normalize(char); + } +} +function splitMapSubstrings(map3) { + return [...splitMapSubstringsIterable(map3)]; +} +function splitMap(def) { + const { map: map3 } = def; + const sets = map3.split("|"); + return sets.map(splitMapSubstrings).filter((s) => s.length > 0); +} +function addToTrieCost(trie, str, cost, penalties) { + if (!str) + return; + let t = trie; + for (const c of str) { + const n = t.n = t.n || /* @__PURE__ */ Object.create(null); + t = n[c] = n[c] || /* @__PURE__ */ Object.create(null); + } + t.c = lowest(t.c, cost); + t.p = highest(t.p, penalties); +} +function addToTrieTrieCost(trie, left, right, cost, penalties) { + let t = trie; + for (const c of left) { + const n = t.n = t.n || /* @__PURE__ */ Object.create(null); + t = n[c] = n[c] || /* @__PURE__ */ Object.create(null); + } + const trieCost = t.t = t.t || /* @__PURE__ */ Object.create(null); + addToTrieCost(trieCost, right, cost, penalties); +} +function addSetToTrieCost(trie, set, cost, penalties) { + if (cost === void 0) + return; + for (const str of set) { + addToTrieCost(trie, str, cost, penalties); + } +} +function addSetToTrieTrieCost(trie, set, cost, penalties) { + if (cost === void 0) + return; + for (const left of set) { + for (const right of set) { + if (left === right) + continue; + addToTrieTrieCost(trie, left, right, cost, penalties); + } + } +} +function* searchTrieNodes(trie, str, i) { + const len = str.length; + for (let n = trie.n; i < len && n; ) { + const t = n[str[i]]; + if (!t) + return; + ++i; + yield { i, t }; + n = t.n; + } +} +function* findTrieCostPrefixes(trie, str, i) { + for (const n of searchTrieNodes(trie, str, i)) { + const { c, p } = n.t; + if (c !== void 0) { + yield { i: n.i, c, p: p || 0 }; + } + } +} +function* findTrieTrieCostPrefixes(trie, str, i) { + for (const n of searchTrieNodes(trie, str, i)) { + const t = n.t.t; + if (t !== void 0) { + yield { i: n.i, t }; + } + } +} +function createWeightCostCalculator(weightMap) { + return new _WeightCostCalculator(weightMap); +} +var _WeightCostCalculator = class { + constructor(weightMap) { + this.weightMap = weightMap; + } + *calcInsDelCosts(pos) { + const { a, ai, b, bi, c, p } = pos; + for (const del of findTrieCostPrefixes(this.weightMap.insDel, a, ai)) { + yield { a, b, ai: del.i, bi, c: c + del.c, p: p + del.p }; + } + for (const ins of findTrieCostPrefixes(this.weightMap.insDel, b, bi)) { + yield { a, b, ai, bi: ins.i, c: c + ins.c, p: p + ins.p }; + } + } + *calcReplaceCosts(pos) { + const { a, ai, b, bi, c, p } = pos; + for (const del of findTrieTrieCostPrefixes(this.weightMap.replace, a, ai)) { + for (const ins of findTrieCostPrefixes(del.t, b, bi)) { + yield { a, b, ai: del.i, bi: ins.i, c: c + ins.c, p: p + ins.p }; } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.genCheckText = exports.checkTextDocument = exports.IncludeExcludeFlag = exports.checkTextOld = exports.checkText = void 0; - var assert_1 = __importDefault(require("assert")); - var resolveDocument_js_1 = require_resolveDocument(); - var TextDocument_js_1 = require_TextDocument(); - var Settings = __importStar(require_Settings()); - var util_js_1 = require_util(); - var docValidator_js_1 = require_docValidator(); - var textValidator_js_1 = require_textValidator(); - var validator_js_1 = require_validator(); - async function checkText(text, settings) { - const languageId = settings.languageId || "plaintext"; - const doc = (0, util_js_1.clean)({ - uri: "", - text, - languageId: Array.isArray(languageId) ? languageId.join(",") : languageId, - locale: settings.language - }); - return checkTextDocument2(doc, { noConfigSearch: true }, { loadDefaultConfiguration: false, ...settings }); - } - exports.checkText = checkText; - async function checkTextOld(text, settings) { - const validationResult = (0, validator_js_1.validateText)(text, settings); - const finalSettings = Settings.finalizeSettings(settings); - const includeRanges = (0, textValidator_js_1.calcTextInclusionRanges)(text, finalSettings); - const issues = await validationResult; - return genResult(text, issues, includeRanges); - } - exports.checkTextOld = checkTextOld; - var IncludeExcludeFlag2; - (function(IncludeExcludeFlag3) { - IncludeExcludeFlag3["INCLUDE"] = "I"; - IncludeExcludeFlag3["EXCLUDE"] = "E"; - })(IncludeExcludeFlag2 || (exports.IncludeExcludeFlag = IncludeExcludeFlag2 = {})); - async function checkTextDocument2(doc, options, settings = {}) { - doc = (0, TextDocument_js_1.isTextDocument)(doc) ? doc : await (0, resolveDocument_js_1.resolveDocumentToTextDocument)(doc); - return genCheckText(new docValidator_js_1.DocumentValidator(doc, options, settings)); - } - exports.checkTextDocument = checkTextDocument2; - async function genCheckText(docValidator) { - await docValidator.prepare(); - const issues = docValidator.checkDocument(true); - const preparations = docValidator._getPreparations(); - (0, assert_1.default)(preparations); - return genResult(docValidator.document.text, issues, preparations.includeRanges); - } - exports.genCheckText = genCheckText; - function genResult(text, issues, includeRanges) { - const result = []; - let lastPos = 0; - for (const { startPos, endPos } of includeRanges) { - result.push({ - text: text.slice(lastPos, startPos), - startPos: lastPos, - endPos: startPos, - flagIE: IncludeExcludeFlag2.EXCLUDE - }); - result.push({ - text: text.slice(startPos, endPos), - startPos, - endPos, - flagIE: IncludeExcludeFlag2.INCLUDE - }); - lastPos = endPos; + } + } + *calcSwapCosts(pos) { + const { a, ai, b, bi, c, p } = pos; + const swap = this.weightMap.swap; + for (const left of findTrieTrieCostPrefixes(swap, a, ai)) { + for (const right of findTrieCostPrefixes(left.t, a, left.i)) { + const sw = a.slice(left.i, right.i) + a.slice(ai, left.i); + if (b.slice(bi).startsWith(sw)) { + const len = sw.length; + yield { a, b, ai: ai + len, bi: bi + len, c: c + right.c, p: p + right.p }; + } } - result.push({ - text: text.slice(lastPos), - startPos: lastPos, - endPos: text.length, - flagIE: IncludeExcludeFlag2.EXCLUDE - }); - function* merge() { - let i = 0; - for (const r of result) { - if (i >= issues.length || issues[i].offset >= r.endPos) { - yield r; - continue; - } - const span = { ...r }; - while (i < issues.length && issues[i].offset < span.endPos) { - const issue = issues[i]; - const endPos = issue.offset; - const text2 = span.text.slice(0, endPos - span.startPos); - const endPosError = issue.offset + issue.text.length; - yield { ...span, text: text2, endPos }; - yield { - ...span, - isError: true, - startPos: issue.offset, - endPos: endPosError, - text: issue.text - }; - span.text = span.text.slice(endPosError - span.startPos); - span.startPos = endPosError; - i += 1; - } - yield span; + } + } + calcAdjustment(word) { + let penalty = 0; + for (const adj of this.weightMap.adjustments.values()) { + if (adj.regexp.global) { + for (const _m of word.matchAll(adj.regexp)) { + penalty += adj.penalty; } + } else if (adj.regexp.test(word)) { + penalty += adj.penalty; } - return { - text, - items: [...merge()].filter((i) => i.startPos < i.endPos) - }; } + return penalty; } -}); +}; +function normalizeDef(def) { + const { map: map3, ...rest } = def; + return { ...rest, map: normalizeMap(map3) }; +} +function normalizeMap(map3) { + return map3.replace(matchPossibleWordSeparators, DEFAULT_COMPOUNDED_WORD_SEPARATOR); +} -// node_modules/cspell-lib/dist/cjs/textValidation/index.js -var require_textValidation = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateText = exports.calcTextInclusionRanges = exports.shouldCheckDocument = exports.DocumentValidator = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = void 0; - var checkText_js_1 = require_checkText(); - Object.defineProperty(exports, "checkText", { enumerable: true, get: function() { - return checkText_js_1.checkText; - } }); - Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function() { - return checkText_js_1.checkTextDocument; - } }); - Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function() { - return checkText_js_1.IncludeExcludeFlag; - } }); - var docValidator_js_1 = require_docValidator(); - Object.defineProperty(exports, "DocumentValidator", { enumerable: true, get: function() { - return docValidator_js_1.DocumentValidator; - } }); - Object.defineProperty(exports, "shouldCheckDocument", { enumerable: true, get: function() { - return docValidator_js_1.shouldCheckDocument; - } }); - var textValidator_js_1 = require_textValidator(); - Object.defineProperty(exports, "calcTextInclusionRanges", { enumerable: true, get: function() { - return textValidator_js_1.calcTextInclusionRanges; - } }); - var validator_js_1 = require_validator(); - Object.defineProperty(exports, "validateText", { enumerable: true, get: function() { - return validator_js_1.validateText; - } }); +// node_modules/cspell-trie-lib/dist/lib/distance/distanceAStarWeighted.js +function distanceAStarWeighted(wordA, wordB, map3, cost = 100) { + const calc = createWeightCostCalculator(map3); + const best = _distanceAStarWeightedEx(wordA, wordB, calc, cost); + const penalty = calc.calcAdjustment(wordB); + return best.c + best.p + penalty; +} +function _distanceAStarWeightedEx(wordA, wordB, map3, cost = 100) { + const a = "^" + wordA + "$"; + const b = "^" + wordB + "$"; + const aN = a.length; + const bN = b.length; + const candidates = new CandidatePool(aN, bN); + candidates.add({ ai: 0, bi: 0, c: 0, p: 0, f: void 0 }); + function opSub(n) { + const { ai, bi, c, p } = n; + if (ai < aN && bi < bN) { + const cc = a[ai] === b[bi] ? c : c + cost; + candidates.add({ ai: ai + 1, bi: bi + 1, c: cc, p, f: n }); + } } -}); - -// node_modules/cspell-lib/dist/cjs/spellCheckFile.js -var require_spellCheckFile = __commonJS({ - "node_modules/cspell-lib/dist/cjs/spellCheckFile.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.determineFinalDocumentSettings = exports.spellCheckDocument = exports.spellCheckFile = void 0; - var isBinaryDoc_js_1 = require_isBinaryDoc(); - var resolveDocument_js_1 = require_resolveDocument(); - var TextDocument_js_1 = require_TextDocument(); - var determineTextDocumentSettings_js_1 = require_determineTextDocumentSettings(); - var index_js_1 = require_textValidation(); - var errors_js_1 = require_errors3(); - var Uri_js_1 = require_Uri(); - function spellCheckFile(file, options, settings) { - const doc = { - uri: (0, Uri_js_1.toUri)(file).toString() - }; - return spellCheckDocument2(doc, options, settings); + function opIns(n) { + const { ai, bi, c, p } = n; + if (bi < bN) { + candidates.add({ ai, bi: bi + 1, c: c + cost, p, f: n }); } - exports.spellCheckFile = spellCheckFile; - async function spellCheckDocument2(document, options, settings) { - if ((0, isBinaryDoc_js_1.isBinaryDoc)(document)) { - return { - document, - options, - settingsUsed: settings, - localConfigFilepath: void 0, - issues: [], - checked: false, - errors: void 0 - }; + } + function opDel(n) { + const { ai, bi, c, p } = n; + if (ai < aN) { + candidates.add({ ai: ai + 1, bi, c: c + cost, p, f: n }); + } + } + function opSwap(n) { + const { ai, bi, c, p } = n; + if (a[ai] === b[bi + 1] && a[ai + 1] === b[bi]) { + candidates.add({ ai: ai + 2, bi: bi + 2, c: c + cost, p, f: n }); + } + } + function opMap2(n) { + const { ai, bi, c, p } = n; + const pos = { a, b, ai, bi, c, p }; + const costCalculations = [map3.calcInsDelCosts(pos), map3.calcSwapCosts(pos), map3.calcReplaceCosts(pos)]; + costCalculations.forEach((iter) => { + for (const nn of iter) { + candidates.add({ ...nn, f: n }); } - try { - return spellCheckFullDocument(await (0, resolveDocument_js_1.resolveDocument)(document), options, settings); - } catch (e) { - const errors = (0, errors_js_1.isError)(e) ? [e] : []; + }); + } + let best; + while (best = candidates.next()) { + if (best.ai === aN && best.bi === bN) + break; + opSwap(best); + opIns(best); + opDel(best); + opMap2(best); + opSub(best); + } + (0, import_assert4.default)(best); + return best; +} +var CandidatePool = class { + constructor(aN, bN) { + this.aN = aN; + this.bN = bN; + this.pool = new PairingHeap(compare2); + this.grid = []; + } + next() { + let n; + while (n = this.pool.dequeue()) { + if (!n.d) + return n; + } + return void 0; + } + add(n) { + const i = idx(n.ai, n.bi, this.bN); + const g = this.grid[i]; + if (!g) { + this.grid[i] = n; + this.pool.add(n); + return; + } + if (g.c <= n.c) + return; + g.d = true; + this.grid[i] = n; + this.pool.add(n); + } +}; +function idx(r, c, cols) { + return r * cols + c; +} +function compare2(a, b) { + return a.c - b.c || b.ai + b.bi - a.ai - a.bi; +} + +// node_modules/cspell-trie-lib/dist/lib/distance/levenshtein.js +var initialRow = ".".repeat(50).split("").map((_, i) => i); +Object.freeze(initialRow); + +// node_modules/cspell-trie-lib/dist/lib/distance/distance.js +var defaultCost = 100; +function editDistanceWeighted(wordA, wordB, weights, editCost = defaultCost) { + return distanceAStarWeighted(wordA, wordB, weights, editCost); +} + +// node_modules/cspell-trie-lib/dist/lib/utils/timer.js +function startTimer() { + const start = performance.now(); + return () => performance.now() - start; +} +function createPerfTimer() { + const timer = startTimer(); + const active = /* @__PURE__ */ new Map(); + const events = [{ name: "start", at: 0 }]; + function updateEvent(event, atTime = timer()) { + const elapsed = atTime - event.at; + event.elapsed = (event.elapsed || 0) + elapsed; + return elapsed; + } + function start(name) { + const event = createEvent(name || "start"); + events.push(event); + name && active.set(name, event); + return () => updateEvent(event); + } + function stop(name) { + const knownEvent = name && active.get(name); + if (knownEvent) { + return updateEvent(knownEvent); + } + return mark(name || "stop"); + } + function createEvent(name) { + return { name, at: timer() }; + } + function mark(name) { + const event = createEvent(name); + events.push(event); + return event.at; + } + function formatReport() { + const lineElements = [ + { name: "Event Name", at: "Time", elapsed: "Elapsed" }, + { name: "----------", at: "----", elapsed: "-------" }, + ...mapEvents() + ]; + function mapEvents() { + const stack = []; + return events.map((e) => { + for (let s = stack.pop(); s; s = stack.pop()) { + if (s >= e.at + (e.elapsed || 0)) { + stack.push(s); + break; + } + } + const d = stack.length; + if (e.elapsed) { + stack.push(e.at + e.elapsed); + } return { - document, - options, - settingsUsed: settings, - localConfigFilepath: void 0, - issues: [], - checked: false, - errors + name: "| ".repeat(d) + (e.name || "").replace(/\t/g, " "), + at: `${t(e.at)}`, + elapsed: e.elapsed ? `${t(e.elapsed)}` : "--" }; + }); + } + function t(ms) { + return ms.toFixed(3) + "ms"; + } + function m(v, s) { + return Math.max(v, s.length); + } + const lengths = lineElements.reduce((a, b) => ({ name: m(a.name, b.name), at: m(a.at, b.at), elapsed: m(a.elapsed, b.elapsed) }), { name: 0, at: 0, elapsed: 0 }); + const lines = lineElements.map((e) => `${e.at.padStart(lengths.at)} ${e.name.padEnd(lengths.name)} ${e.elapsed.padStart(lengths.elapsed)}`); + return lines.join("\n"); + } + function measureFn(name, fn) { + const s = start(name); + const v = fn(); + s(); + return v; + } + async function measureAsyncFn(name, fn) { + const s = start(name); + const v = await fn(); + s(); + return v; + } + function report(reporter = console.log) { + reporter(formatReport()); + } + return { + start, + stop, + mark, + elapsed: timer, + report, + formatReport, + measureFn, + measureAsyncFn + }; +} +var globalPerfTimer = void 0; +function getGlobalPerfTimer() { + const timer = globalPerfTimer || createPerfTimer(); + globalPerfTimer = timer; + return timer; +} + +// node_modules/cspell-trie-lib/dist/lib/utils/util.js +function isDefined3(a) { + return a !== void 0; +} +function cleanCopy(t) { + const r = { ...t }; + return clean2(r); +} +function clean2(t) { + for (const prop in t) { + if (t[prop] === void 0) { + delete t[prop]; + } + } + return t; +} +function unique(a) { + return [...new Set(a)]; +} +function regexQuote(text) { + return text.replace(/([[\]\-+(){},|*.\\])/g, "\\$1"); +} +function replaceAllFactory(match2, replaceWithText) { + const r = RegExp(regexQuote(match2), "g"); + return (text) => text.replace(r, replaceWithText); +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/suggestCollector.js +var defaultMaxNumberSuggestions = 10; +var BASE_COST = 100; +var MAX_NUM_CHANGES = 5; +var MAX_COST_SCALE = 0.5; +var MAX_ALLOWED_COST_SCALE = 1.03 * MAX_COST_SCALE; +var collator = new Intl.Collator(); +var regexSeparator = new RegExp(`[${regexQuote(WORD_SEPARATOR)}]`, "g"); +var wordLengthCost = [0, 50, 25, 5, 0]; +var EXTRA_WORD_COST = 5; +var DEFAULT_COLLECTOR_TIMEOUT = 1e3; +var symStopProcessing = Symbol("Collector Stop Processing"); +function compSuggestionResults(a, b) { + const aPref = a.isPreferred && -1 || 0; + const bPref = b.isPreferred && -1 || 0; + return aPref - bPref || a.cost - b.cost || a.word.length - b.word.length || collator.compare(a.word, b.word); +} +var defaultSuggestionCollectorOptions = Object.freeze({ + numSuggestions: defaultMaxNumberSuggestions, + filter: () => true, + changeLimit: MAX_NUM_CHANGES, + includeTies: false, + ignoreCase: true, + timeout: DEFAULT_COLLECTOR_TIMEOUT, + weightMap: void 0, + compoundSeparator: "", + compoundMethod: void 0 +}); +function suggestionCollector(wordToMatch, options) { + const { filter: filter3 = () => true, changeLimit = MAX_NUM_CHANGES, includeTies = false, ignoreCase: ignoreCase2 = true, timeout = DEFAULT_COLLECTOR_TIMEOUT, weightMap, compoundSeparator = defaultSuggestionCollectorOptions.compoundSeparator } = options; + const numSuggestions = Math.max(options.numSuggestions, 0) || 0; + const numSugToHold = weightMap ? numSuggestions * 2 : numSuggestions; + const sugs = /* @__PURE__ */ new Map(); + let maxCost = BASE_COST * Math.min(wordToMatch.length * MAX_ALLOWED_COST_SCALE, changeLimit); + const useSeparator = compoundSeparator || (weightMap ? DEFAULT_COMPOUNDED_WORD_SEPARATOR : defaultSuggestionCollectorOptions.compoundSeparator); + const fnCleanWord = !useSeparator || useSeparator === compoundSeparator ? (w) => w : replaceAllFactory(useSeparator, ""); + if (useSeparator && weightMap) { + addDefToWeightMap(weightMap, { map: useSeparator, insDel: 50 }); + } + const genSuggestionOptions = clean2({ + changeLimit, + ignoreCase: ignoreCase2, + compoundMethod: options.compoundMethod, + compoundSeparator: useSeparator + }); + let timeRemaining = timeout; + function dropMax() { + if (sugs.size < 2 || !numSuggestions) { + sugs.clear(); + return; + } + const sorted = [...sugs.values()].sort(compSuggestionResults); + let i = numSugToHold - 1; + maxCost = sorted[i].cost; + for (; i < sorted.length && sorted[i].cost <= maxCost; ++i) { + } + for (; i < sorted.length; ++i) { + sugs.delete(sorted[i].word); + } + } + function adjustCost(sug) { + if (sug.isPreferred) + return sug; + const words = sug.word.split(regexSeparator); + const extraCost = words.map((w) => wordLengthCost[w.length] || 0).reduce((a, b) => a + b, 0) + (words.length - 1) * EXTRA_WORD_COST; + return { word: sug.word, cost: sug.cost + extraCost }; + } + function collectSuggestion(suggestion) { + const { word, cost, isPreferred } = adjustCost(suggestion); + if (cost <= maxCost && filter3(suggestion.word, cost)) { + const known = sugs.get(word); + if (known) { + known.cost = Math.min(known.cost, cost); + known.isPreferred = known.isPreferred || isPreferred; + } else { + sugs.set(word, { word, cost, isPreferred }); + if (cost < maxCost && sugs.size > numSugToHold) { + dropMax(); + } } } - exports.spellCheckDocument = spellCheckDocument2; - async function spellCheckFullDocument(document, options, settings) { - const doc = (0, resolveDocument_js_1.documentToTextDocument)(document); - const docValOptions = options; - const docValidator = new index_js_1.DocumentValidator(doc, docValOptions, settings); - await docValidator.prepare(); - const prep = docValidator._getPreparations(); - if (docValidator.errors.length) { - return { - document, - options, - settingsUsed: prep?.localConfig || settings, - localConfigFilepath: prep?.localConfigFilepath, - issues: [], - checked: false, - errors: docValidator.errors - }; + return maxCost; + } + function collect2(src, timeout2, filter4) { + let stop = false; + timeout2 = timeout2 ?? timeRemaining; + timeout2 = Math.min(timeout2, timeRemaining); + if (timeout2 < 0) + return; + const timer = startTimer(); + let ir; + while (!(ir = src.next(stop || maxCost)).done) { + if (timer() > timeout2) { + stop = symStopProcessing; + } + const { value } = ir; + if (!value) + continue; + if (isSuggestionResult(value)) { + if (!filter4 || filter4(value.word, value.cost)) { + collectSuggestion(value); + } + continue; } - const issues = docValidator.checkDocument(); - const result = { - document, - options, - settingsUsed: docValidator.getFinalizedDocSettings(), - localConfigFilepath: prep?.localConfigFilepath, - issues, - checked: docValidator.shouldCheckDocument(), - errors: void 0 - }; - return result; } - function determineFinalDocumentSettings(document, settings) { - const doc = (0, TextDocument_js_1.createTextDocument)({ - uri: document.uri, - content: document.text, - languageId: document.languageId, - locale: document.locale - }); + timeRemaining -= timer(); + } + function cleanCompoundResult(sr) { + const { word, cost } = sr; + const cWord = fnCleanWord(word); + if (cWord !== word) { return { - document, - settings: (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(doc, settings) + word: cWord, + cost, + compoundWord: word, + isPreferred: void 0 }; } - exports.determineFinalDocumentSettings = determineFinalDocumentSettings; + return { ...sr }; } -}); - -// node_modules/cspell-lib/dist/cjs/trace.js -var require_trace = __commonJS({ - "node_modules/cspell-lib/dist/cjs/trace.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; + function suggestions() { + if (numSuggestions < 1 || !sugs.size) + return []; + const NF = "NFD"; + const nWordToMatch = wordToMatch.normalize(NF); + const rawValues = [...sugs.values()]; + const values = weightMap ? rawValues.map(({ word, cost, isPreferred }) => ({ + word, + cost: isPreferred ? cost : editDistanceWeighted(nWordToMatch, word.normalize(NF), weightMap, 110), + isPreferred + })) : rawValues; + const sorted = values.sort(compSuggestionResults).map(cleanCompoundResult); + let i = Math.min(sorted.length, numSuggestions) - 1; + const limit = includeTies ? sorted.length : Math.min(sorted.length, numSuggestions); + const iCost = sorted[i].cost; + const maxCost2 = Math.min(iCost, weightMap ? changeLimit * BASE_COST - 1 : iCost); + for (i = 1; i < limit && sorted[i].cost <= maxCost2; ++i) { + } + sorted.length = i; + return sorted; + } + const collector = { + collect: collect2, + add: function(suggestion) { + collectSuggestion(suggestion); + return this; + }, + get suggestions() { + return suggestions(); + }, + get maxCost() { + return maxCost; + }, + get word() { + return wordToMatch; + }, + get maxNumSuggestions() { + return numSuggestions; + }, + get changeLimit() { + return changeLimit; + }, + includesTies: includeTies, + ignoreCase: ignoreCase2, + symbolStopProcessing: symStopProcessing, + genSuggestionOptions + }; + return collector; +} +function impersonateCollector(collector, word) { + const r = Object.create(collector); + Object.defineProperty(r, "word", { value: word, writable: false }); + return r; +} +function isSuggestionResult(s) { + const r = s; + return !!r && typeof r === "object" && r?.cost !== void 0 && r.word != void 0; +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/suggestAStar.js +function comparePath(a, b) { + return a.c / (a.i + 1) - b.c / (b.i + 1) + (b.i - a.i); +} +function suggestAStar(trie, word, options = {}) { + const opts = createSuggestionOptions(options); + const collector = suggestionCollector(word, opts); + collector.collect(getSuggestionsAStar(trie, word, opts)); + return collector.suggestions; +} +function* getSuggestionsAStar(trie, srcWord, options = {}) { + const { compoundMethod, changeLimit, ignoreCase: ignoreCase2, weightMap } = createSuggestionOptions(options); + const visMap = visualLetterMaskMap; + const root = trie.getRoot(); + const rootIgnoreCase = ignoreCase2 && root.get(root.info.stripCaseAndAccentsPrefix) || void 0; + const pathHeap = new PairingHeap(comparePath); + const resultHeap = new PairingHeap(compareSuggestion); + const rootPNode = { n: root, i: 0, c: 0, s: "", p: void 0, t: createCostTrie() }; + const BC = opCosts.baseCost; + const VC = opCosts.visuallySimilar; + const DL = opCosts.duplicateLetterCost; + const wordSeparator = compoundMethod === CompoundWordsMethod.JOIN_WORDS ? JOIN_SEPARATOR : WORD_SEPARATOR; + const sc = specialChars(trie.info); + const comp = trie.info.compoundCharacter; + const compRoot = root.get(comp); + const compRootIgnoreCase = rootIgnoreCase && rootIgnoreCase.get(comp); + const emitted = /* @__PURE__ */ Object.create(null); + let limit = BC * Math.min(srcWord.length * opCosts.wordLengthCostFactor, changeLimit); + pathHeap.add(rootPNode); + if (rootIgnoreCase) { + pathHeap.add({ n: rootIgnoreCase, i: 0, c: 0, s: "", p: void 0, t: createCostTrie() }); + } + let best = pathHeap.dequeue(); + let maxSize = pathHeap.size; + let suggestionsGenerated = 0; + let nodesProcessed = 0; + let nodesProcessedLimit = 1e3; + let minGen = 1; + while (best) { + if (++nodesProcessed > nodesProcessedLimit) { + nodesProcessedLimit += 1e3; + if (suggestionsGenerated < minGen) { + break; } - Object.defineProperty(o, k2, desc); - } : 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); + minGen += suggestionsGenerated; + } + if (best.c > limit) { + best = pathHeap.dequeue(); + maxSize = Math.max(maxSize, pathHeap.size); + continue; + } + processPath(best); + for (const sug of resultHeap) { + ++suggestionsGenerated; + if (sug.cost > limit) + continue; + if (sug.word in emitted && emitted[sug.word] <= sug.cost) + continue; + const action2 = yield sug; + emitted[sug.word] = sug.cost; + if (typeof action2 === "number") { + limit = Math.min(action2, limit); + } + if (typeof action2 === "symbol") { + return; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.traceWordsAsync = exports.traceWords = void 0; - var gensequence_1 = require_dist2(); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var index_js_1 = require_Settings(); - var LanguageSettings_js_1 = require_LanguageSettings(); - var index_js_2 = require_SpellingDictionary4(); - var util = __importStar(require_util()); - async function traceWords(words, settings, options) { - const results = await util.asyncIterableToArray(traceWordsAsync2(words, settings, options)); - const s = (0, gensequence_1.genSequence)(results).concatMap((p) => p).toArray(); - return s; } - exports.traceWords = traceWords; - async function* traceWordsAsync2(words, settings, options) { - const { languageId, locale: language, ignoreCase = true, allowCompoundWords } = options || {}; - async function finalize(config2) { - const withLocale = (0, index_js_1.mergeSettings)(config2, util.clean({ - language: language || config2.language, - allowCompoundWords: allowCompoundWords ?? config2.allowCompoundWords - })); - const withLanguageId = (0, LanguageSettings_js_1.calcSettingsForLanguageId)(withLocale, languageId ?? withLocale.languageId ?? "plaintext"); - const settings2 = (0, index_js_1.finalizeSettings)(withLanguageId); - const dictionaries = (settings2.dictionaries || []).concat((settings2.dictionaryDefinitions || []).map((d) => d.name)).filter(util.uniqueFn); - const dictSettings = (0, CSpellSettingsServer_js_1.toInternalSettings)({ ...settings2, dictionaries }); - const dictBase = await (0, index_js_2.getDictionaryInternal)(settings2); - const dicts2 = await (0, index_js_2.getDictionaryInternal)(dictSettings); - const activeDictionaries2 = dictBase.dictionaries.map((d) => d.name); - return { - activeDictionaries: activeDictionaries2, - config: settings2, - dicts: dicts2 - }; + best = pathHeap.dequeue(); + maxSize = Math.max(maxSize, pathHeap.size); + } + return; + function compareSuggestion(a, b) { + const pa = a.isPreferred && 1 || 0; + const pb = b.isPreferred && 1 || 0; + return pb - pa || a.cost - b.cost || Math.abs(a.word.charCodeAt(0) - srcWord.charCodeAt(0)) - Math.abs(b.word.charCodeAt(0) - srcWord.charCodeAt(0)); + } + function processPath(p) { + const len = srcWord.length; + if (p.n.eow && p.i === len) { + const word = pNodeToWord(p); + const result = { word, cost: p.c }; + resultHeap.add(result); + } + calcEdges(p); + } + function calcEdges(p) { + const { n, i, t } = p; + const keys2 = n.keys(); + const s = srcWord[i]; + const sg = visMap[s] || 0; + const cost0 = p.c; + const cost = cost0 + BC + (i ? 0 : opCosts.firstLetterBias); + const costVis = cost0 + VC; + const costLegacyCompound = cost0 + opCosts.wordBreak; + const costCompound = cost0 + opCosts.compound; + if (s) { + const mIdx = keys2.indexOf(s); + if (mIdx >= 0) { + storePath(t, n.child(mIdx), i + 1, cost0, s, p, "=", s); + } + if (weightMap) { + processWeightMapEdges(p, weightMap); + } + const ns = srcWord[i + 1]; + if (s == ns && mIdx >= 0) { + storePath(t, n.child(mIdx), i + 2, cost0 + DL, s, p, "dd", s); + } + storePath(t, n, i + 1, cost, "", p, "d", ""); + for (let j = 0; j < keys2.length; ++j) { + const ss = keys2[j]; + if (j === mIdx || ss in sc) + continue; + const g = visMap[ss] || 0; + const c = sg & g ? costVis : cost; + storePath(t, n.child(j), i + 1, c, ss, p, "r", ss); } - await (0, index_js_2.refreshDictionaryCache)(); - const { config, dicts, activeDictionaries } = await finalize(settings); - const setOfActiveDicts = new Set(activeDictionaries); - const opts = util.clean({ ignoreCase, useCompounds: config.allowCompoundWords }); - function normalizeErrors(errors) { - if (!errors?.length) - return void 0; - return errors; - } - function processWord(word) { - return dicts.dictionaries.map((dict) => ({ dict, findResult: dict.find(word, opts) })).map(({ dict, findResult }) => ({ - word, - found: !!findResult?.found, - foundWord: findResult?.found || void 0, - forbidden: findResult?.forbidden || false, - noSuggest: findResult?.noSuggest || false, - dictName: dict.name, - dictSource: dict.source, - dictActive: setOfActiveDicts.has(dict.name), - configSource: config.name || "", - errors: normalizeErrors(dict.getErrors?.()) - })); + if (n.eow && i) { + if (compoundMethod) { + storePath(t, root, i, costLegacyCompound, wordSeparator, p, "L", wordSeparator); + } + } + if (ns) { + const n1 = n.get(ns); + const n2 = n1?.get(s); + if (n2) { + const ss = ns + s; + storePath(t, n2, i + 2, cost0 + opCosts.swapCost, ss, p, "s", ss); + } + } + } + if (compRoot && costCompound <= limit && keys2.includes(comp)) { + if (compRootIgnoreCase) { + storePath(t, compRootIgnoreCase, i, costCompound, "", p, "~+", "~+"); } - for await (const word of words) { - yield processWord(word); + storePath(t, compRoot, i, costCompound, "", p, "+", "+"); + } + if (cost <= limit) { + for (let j = 0; j < keys2.length; ++j) { + const char = keys2[j]; + if (char in sc) + continue; + storePath(t, n.child(j), i, cost, char, p, "i", char); } } - exports.traceWordsAsync = traceWordsAsync2; } -}); - -// node_modules/cspell-lib/dist/cjs/validator.js -var require_validator2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/validator.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = void 0; - var index_js_1 = require_textValidation(); - Object.defineProperty(exports, "checkText", { enumerable: true, get: function() { - return index_js_1.checkText; - } }); - Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function() { - return index_js_1.checkTextDocument; - } }); - Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function() { - return index_js_1.IncludeExcludeFlag; - } }); - Object.defineProperty(exports, "validateText", { enumerable: true, get: function() { - return index_js_1.validateText; - } }); + function processWeightMapEdges(p, weightMap2) { + delLetters(p, weightMap2, srcWord, storePath); + insLetters(p, weightMap2, srcWord, storePath); + repLetters(p, weightMap2, srcWord, storePath); + return; } -}); - -// node_modules/cspell-lib/dist/cjs/clearCachedFiles.js -var require_clearCachedFiles = __commonJS({ - "node_modules/cspell-lib/dist/cjs/clearCachedFiles.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.clearCachedFiles = void 0; - var index_js_1 = require_Settings(); - var index_js_2 = require_SpellingDictionary4(); - async function clearCachedFiles() { - await Promise.all([(0, index_js_1.clearCachedSettingsFiles)(), (0, index_js_2.refreshDictionaryCache)(0)]); + function storePath(t, n, i, c, s, p, a, ss) { + const tt = getCostTrie(t, ss); + const curr = tt.c[i]; + if (curr <= c || c > limit) + return void 0; + tt.c[i] = c; + pathHeap.add({ n, i, c, s, p, t: tt, a }); + } +} +function delLetters(pNode, weightMap, word, storePath) { + const { t, n } = pNode; + const trie = weightMap.insDel; + let ii = pNode.i; + const cost0 = pNode.c - pNode.i; + const len = word.length; + for (let nn = trie.n; ii < len && nn; ) { + const tt = nn[word[ii]]; + if (!tt) + return; + ++ii; + if (tt.c !== void 0) { + storePath(t, n, ii, cost0 + tt.c, "", pNode, "d", ""); } - exports.clearCachedFiles = clearCachedFiles; + nn = tt.n; } -}); - -// node_modules/cspell-lib/dist/cjs/getDictionary.js -var require_getDictionary = __commonJS({ - "node_modules/cspell-lib/dist/cjs/getDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDictionary = void 0; - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var index_js_1 = require_SpellingDictionary4(); - function getDictionary2(settings) { - return (0, index_js_1.getDictionaryInternal)((0, CSpellSettingsServer_js_1.toInternalSettings)(settings)); +} +function insLetters(p, weightMap, _word, storePath) { + const { t, i, c, n } = p; + const cost0 = c; + searchTrieCostNodesMatchingTrie2(weightMap.insDel, n, (s, tc, n2) => { + if (tc.c !== void 0) { + storePath(t, n2, i, cost0 + tc.c, s, p, "i", s); + } + }); +} +function repLetters(pNode, weightMap, word, storePath) { + const node = pNode.n; + const pt = pNode.t; + const cost0 = pNode.c; + const len = word.length; + const trie = weightMap.replace; + let i = pNode.i; + for (let n = trie.n; i < len && n; ) { + const t = n[word[i]]; + if (!t) + return; + ++i; + const tInsert = t.t; + if (tInsert) { + searchTrieCostNodesMatchingTrie2(tInsert, node, (s, tt, n2) => { + const c = tt.c; + if (c === void 0) { + return; + } + storePath(pt, n2, i, cost0 + c + (tt.p || 0), s, pNode, "r", s); + }); } - exports.getDictionary = getDictionary2; + n = t.n; } -}); +} +function createCostTrie() { + return { c: [], t: /* @__PURE__ */ Object.create(null) }; +} +function getCostTrie(t, s) { + if (s.length == 1) { + return t.t[s] ??= createCostTrie(); + } + if (!s) { + return t; + } + let tt = t; + for (const c of [...s]) { + tt = tt.t[c] ??= createCostTrie(); + } + return tt; +} +function pNodeToWord(p) { + const parts = []; + let n = p; + while (n) { + parts.push(n.s); + n = n.p; + } + parts.reverse(); + return parts.join(""); +} +function specialChars(options) { + const charSet = /* @__PURE__ */ Object.create(null); + for (const c of Object.values(options)) { + charSet[c] = true; + } + return charSet; +} +function searchTrieCostNodesMatchingTrie2(trie, node, emit, s = "") { + const n = trie.n; + if (!n) + return; + const keys2 = node.keys(); + for (let i = 0; i < keys2.length; ++i) { + const key = keys2[i]; + const t = n[key]; + if (!t) + continue; + const c = node.child(i); + const pfx = s + key; + emit(pfx, t, c); + if (t.n) { + searchTrieCostNodesMatchingTrie2(t, c, emit, pfx); + } + } +} -// node_modules/cspell-lib/dist/cjs/index.js -var require_cjs10 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.suggestionsForWord = exports.SuggestionError = exports.SpellingDictionaryLoadError = exports.refreshDictionaryCache = exports.isSpellingDictionaryLoadError = exports.createSpellingDictionaryCollection = exports.createSpellingDictionary = exports.CompoundWordsMethod = exports.spellCheckFile = exports.spellCheckDocument = exports.determineFinalDocumentSettings = exports.constructSettingsForText = exports.combineTextAndLanguageSettings = exports.defaultSettingsFilename = exports.sectionCSpell = exports.searchForConfig = exports.readSettingsFiles = exports.readSettings = exports.readRawSettings = exports.mergeSettings = exports.mergeInDocSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfig = exports.ImportError = exports.getSources = exports.getGlobalSettings = exports.getDefaultSettings = exports.getDefaultBundledSettings = exports.getCachedFileSize = exports.finalizeSettings = exports.extractImportErrors = exports.extractDependencies = exports.ENV_CSPELL_GLOB_ROOT = exports.defaultFileName = exports.defaultConfigFilenames = exports.currentSettingsFileVersion = exports.clearCachedSettingsFiles = exports.checkFilenameMatchesGlob = exports.calcOverrideSettings = exports.updateTextDocument = exports.createTextDocument = exports.getLanguagesForExt = exports.getLanguageIdsForBaseFilename = exports.UnknownFeatureFlagError = exports.getSystemFeatureFlags = exports.FeatureFlags = exports.isBinaryFile = exports.fileToTextDocument = exports.fileToDocument = void 0; - exports.getDictionary = exports.clearCachedFiles = exports.ExclusionHelper = exports.Text = exports.Link = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.asyncIterableToArray = exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = exports.resolveFile = exports.setLogger = exports.getLogger = exports.traceWordsAsync = exports.traceWords = exports.shouldCheckDocument = exports.DocumentValidator = exports.suggestionsForWords = void 0; - var ExclusionHelper = __importStar(require_exclusionHelper()); - exports.ExclusionHelper = ExclusionHelper; - var Link = __importStar(require_index_link()); - exports.Link = Link; - var Text2 = __importStar(require_text2()); - exports.Text = Text2; - var index_js_1 = require_Document(); - Object.defineProperty(exports, "fileToDocument", { enumerable: true, get: function() { - return index_js_1.fileToDocument; - } }); - Object.defineProperty(exports, "fileToTextDocument", { enumerable: true, get: function() { - return index_js_1.fileToTextDocument; - } }); - Object.defineProperty(exports, "isBinaryFile", { enumerable: true, get: function() { - return index_js_1.isBinaryFile; - } }); - var index_js_2 = require_FeatureFlags2(); - Object.defineProperty(exports, "FeatureFlags", { enumerable: true, get: function() { - return index_js_2.FeatureFlags; - } }); - Object.defineProperty(exports, "getSystemFeatureFlags", { enumerable: true, get: function() { - return index_js_2.getSystemFeatureFlags; - } }); - Object.defineProperty(exports, "UnknownFeatureFlagError", { enumerable: true, get: function() { - return index_js_2.UnknownFeatureFlagError; - } }); - var LanguageIds_js_1 = require_LanguageIds(); - Object.defineProperty(exports, "getLanguageIdsForBaseFilename", { enumerable: true, get: function() { - return LanguageIds_js_1.getLanguagesForBasename; - } }); - Object.defineProperty(exports, "getLanguagesForExt", { enumerable: true, get: function() { - return LanguageIds_js_1.getLanguagesForExt; - } }); - var TextDocument_js_1 = require_TextDocument(); - Object.defineProperty(exports, "createTextDocument", { enumerable: true, get: function() { - return TextDocument_js_1.createTextDocument; - } }); - Object.defineProperty(exports, "updateTextDocument", { enumerable: true, get: function() { - return TextDocument_js_1.updateTextDocument; - } }); - var index_js_3 = require_Settings(); - Object.defineProperty(exports, "calcOverrideSettings", { enumerable: true, get: function() { - return index_js_3.calcOverrideSettings; - } }); - Object.defineProperty(exports, "checkFilenameMatchesGlob", { enumerable: true, get: function() { - return index_js_3.checkFilenameMatchesGlob; - } }); - Object.defineProperty(exports, "clearCachedSettingsFiles", { enumerable: true, get: function() { - return index_js_3.clearCachedSettingsFiles; - } }); - Object.defineProperty(exports, "currentSettingsFileVersion", { enumerable: true, get: function() { - return index_js_3.currentSettingsFileVersion; - } }); - Object.defineProperty(exports, "defaultConfigFilenames", { enumerable: true, get: function() { - return index_js_3.defaultConfigFilenames; - } }); - Object.defineProperty(exports, "defaultFileName", { enumerable: true, get: function() { - return index_js_3.defaultFileName; - } }); - Object.defineProperty(exports, "ENV_CSPELL_GLOB_ROOT", { enumerable: true, get: function() { - return index_js_3.ENV_CSPELL_GLOB_ROOT; - } }); - Object.defineProperty(exports, "extractDependencies", { enumerable: true, get: function() { - return index_js_3.extractDependencies; - } }); - Object.defineProperty(exports, "extractImportErrors", { enumerable: true, get: function() { - return index_js_3.extractImportErrors; - } }); - Object.defineProperty(exports, "finalizeSettings", { enumerable: true, get: function() { - return index_js_3.finalizeSettings; - } }); - Object.defineProperty(exports, "getCachedFileSize", { enumerable: true, get: function() { - return index_js_3.getCachedFileSize; - } }); - Object.defineProperty(exports, "getDefaultBundledSettings", { enumerable: true, get: function() { - return index_js_3.getDefaultBundledSettings; - } }); - Object.defineProperty(exports, "getDefaultSettings", { enumerable: true, get: function() { - return index_js_3.getDefaultSettings; - } }); - Object.defineProperty(exports, "getGlobalSettings", { enumerable: true, get: function() { - return index_js_3.getGlobalSettings; - } }); - Object.defineProperty(exports, "getSources", { enumerable: true, get: function() { - return index_js_3.getSources; - } }); - Object.defineProperty(exports, "ImportError", { enumerable: true, get: function() { - return index_js_3.ImportError; - } }); - Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function() { - return index_js_3.loadConfig; - } }); - Object.defineProperty(exports, "loadPnP", { enumerable: true, get: function() { - return index_js_3.loadPnP; - } }); - Object.defineProperty(exports, "loadPnPSync", { enumerable: true, get: function() { - return index_js_3.loadPnPSync; - } }); - Object.defineProperty(exports, "mergeInDocSettings", { enumerable: true, get: function() { - return index_js_3.mergeInDocSettings; - } }); - Object.defineProperty(exports, "mergeSettings", { enumerable: true, get: function() { - return index_js_3.mergeSettings; - } }); - Object.defineProperty(exports, "readRawSettings", { enumerable: true, get: function() { - return index_js_3.readRawSettings; - } }); - Object.defineProperty(exports, "readSettings", { enumerable: true, get: function() { - return index_js_3.readSettings; - } }); - Object.defineProperty(exports, "readSettingsFiles", { enumerable: true, get: function() { - return index_js_3.readSettingsFiles; - } }); - Object.defineProperty(exports, "searchForConfig", { enumerable: true, get: function() { - return index_js_3.searchForConfig; - } }); - Object.defineProperty(exports, "sectionCSpell", { enumerable: true, get: function() { - return index_js_3.sectionCSpell; - } }); - var index_js_4 = require_Settings(); - Object.defineProperty(exports, "defaultSettingsFilename", { enumerable: true, get: function() { - return index_js_4.defaultFileName; - } }); - var TextDocumentSettings_js_1 = require_TextDocumentSettings(); - Object.defineProperty(exports, "combineTextAndLanguageSettings", { enumerable: true, get: function() { - return TextDocumentSettings_js_1.combineTextAndLanguageSettings; - } }); - Object.defineProperty(exports, "constructSettingsForText", { enumerable: true, get: function() { - return TextDocumentSettings_js_1.combineTextAndLanguageSettings; - } }); - var spellCheckFile_js_1 = require_spellCheckFile(); - Object.defineProperty(exports, "determineFinalDocumentSettings", { enumerable: true, get: function() { - return spellCheckFile_js_1.determineFinalDocumentSettings; - } }); - Object.defineProperty(exports, "spellCheckDocument", { enumerable: true, get: function() { - return spellCheckFile_js_1.spellCheckDocument; - } }); - Object.defineProperty(exports, "spellCheckFile", { enumerable: true, get: function() { - return spellCheckFile_js_1.spellCheckFile; - } }); - var index_js_5 = require_SpellingDictionary4(); - Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function() { - return index_js_5.CompoundWordsMethod; - } }); - Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function() { - return index_js_5.createSpellingDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionaryCollection", { enumerable: true, get: function() { - return index_js_5.createCollection; - } }); - Object.defineProperty(exports, "isSpellingDictionaryLoadError", { enumerable: true, get: function() { - return index_js_5.isSpellingDictionaryLoadError; - } }); - Object.defineProperty(exports, "refreshDictionaryCache", { enumerable: true, get: function() { - return index_js_5.refreshDictionaryCache; - } }); - Object.defineProperty(exports, "SpellingDictionaryLoadError", { enumerable: true, get: function() { - return index_js_5.SpellingDictionaryLoadError; - } }); - var suggestions_js_1 = require_suggestions(); - Object.defineProperty(exports, "SuggestionError", { enumerable: true, get: function() { - return suggestions_js_1.SuggestionError; - } }); - Object.defineProperty(exports, "suggestionsForWord", { enumerable: true, get: function() { - return suggestions_js_1.suggestionsForWord; - } }); - Object.defineProperty(exports, "suggestionsForWords", { enumerable: true, get: function() { - return suggestions_js_1.suggestionsForWords; - } }); - var index_js_6 = require_textValidation(); - Object.defineProperty(exports, "DocumentValidator", { enumerable: true, get: function() { - return index_js_6.DocumentValidator; - } }); - Object.defineProperty(exports, "shouldCheckDocument", { enumerable: true, get: function() { - return index_js_6.shouldCheckDocument; - } }); - var trace_js_1 = require_trace(); - Object.defineProperty(exports, "traceWords", { enumerable: true, get: function() { - return trace_js_1.traceWords; - } }); - Object.defineProperty(exports, "traceWordsAsync", { enumerable: true, get: function() { - return trace_js_1.traceWordsAsync; - } }); - var logger_js_1 = require_logger(); - Object.defineProperty(exports, "getLogger", { enumerable: true, get: function() { - return logger_js_1.getLogger; - } }); - Object.defineProperty(exports, "setLogger", { enumerable: true, get: function() { - return logger_js_1.setLogger; - } }); - var resolveFile_js_1 = require_resolveFile(); - Object.defineProperty(exports, "resolveFile", { enumerable: true, get: function() { - return resolveFile_js_1.resolveFile; - } }); - var validator_js_1 = require_validator2(); - Object.defineProperty(exports, "checkText", { enumerable: true, get: function() { - return validator_js_1.checkText; - } }); - Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function() { - return validator_js_1.checkTextDocument; - } }); - Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function() { - return validator_js_1.IncludeExcludeFlag; - } }); - Object.defineProperty(exports, "validateText", { enumerable: true, get: function() { - return validator_js_1.validateText; - } }); - __exportStar(require_cjs9(), exports); - var cspell_io_1 = require_cjs3(); - Object.defineProperty(exports, "asyncIterableToArray", { enumerable: true, get: function() { - return cspell_io_1.asyncIterableToArray; - } }); - Object.defineProperty(exports, "readFile", { enumerable: true, get: function() { - return cspell_io_1.readFile; - } }); - Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function() { - return cspell_io_1.readFileSync; - } }); - Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function() { - return cspell_io_1.writeToFile; - } }); - Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function() { - return cspell_io_1.writeToFileIterable; - } }); - Object.defineProperty(exports, "writeToFileIterableP", { enumerable: true, get: function() { - return cspell_io_1.writeToFileIterableP; - } }); - var clearCachedFiles_js_1 = require_clearCachedFiles(); - Object.defineProperty(exports, "clearCachedFiles", { enumerable: true, get: function() { - return clearCachedFiles_js_1.clearCachedFiles; - } }); - var getDictionary_js_1 = require_getDictionary(); - Object.defineProperty(exports, "getDictionary", { enumerable: true, get: function() { - return getDictionary_js_1.getDictionary; - } }); +// node_modules/cspell-trie-lib/dist/lib/utils/assert.js +function assert5(condition, message = "Assert Failed") { + if (condition) + return; + throw new Error(message); +} + +// node_modules/cspell-trie-lib/dist/lib/utils/mergeOptionalWithDefaults.js +function mergeOptionalWithDefaults(...options) { + return options.reduce((acc, opt) => mergeDefaults(opt, acc), defaultTrieInfo); +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlobBitMaskInfo.js +function extractInfo(info3) { + const { NodeMaskEOW, NodeMaskChildCharIndex, NodeChildRefShift } = info3; + return { + NodeMaskEOW, + NodeMaskChildCharIndex, + NodeChildRefShift + }; +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlobInternals.js +var FastTrieBlobInternals = class { + constructor(nodes, charIndex, charToIndexMap, maskInfo) { + this.nodes = nodes; + this.charIndex = charIndex; + this.charToIndexMap = charToIndexMap; + const { NodeMaskEOW, NodeMaskChildCharIndex, NodeChildRefShift } = maskInfo; + this.NodeMaskEOW = NodeMaskEOW; + this.NodeMaskChildCharIndex = NodeMaskChildCharIndex; + this.NodeChildRefShift = NodeChildRefShift; } -}); +}; -// node_modules/color-name/index.js -var require_color_name2 = __commonJS({ - "node_modules/color-name/index.js"(exports, module2) { - "use strict"; - module2.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] - }; +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlobIRoot.js +var EmptyKeys2 = Object.freeze([]); +var EmptyNodes = Object.freeze([]); +var FastTrieBlobINode = class _FastTrieBlobINode { + constructor(trie, nodeIdx) { + this.trie = trie; + this.nodeIdx = nodeIdx; + const node = trie.nodes[nodeIdx]; + this.node = node; + const value = node[0]; + this.eow = !!(value & trie.NodeMaskEOW); + this.size = node.length - 1; + this.id = nodeIdx; + } + keys() { + return this._keys ??= this.calcKeys(); + } + /** get keys to children */ + calcKeys() { + if (!this.size) + return EmptyKeys2; + const NodeMaskChildCharIndex = this.trie.NodeMaskChildCharIndex; + const charIndex = this.trie.charIndex; + const keys2 = Array(this.size); + const len = this.size; + const node = this.trie.nodes[this.nodeIdx]; + for (let i = 0; i < len; ++i) { + const entry = node[i + 1]; + const charIdx = entry & NodeMaskChildCharIndex; + keys2[i] = charIndex[charIdx]; + } + return Object.freeze(keys2); + } + values() { + if (!this.size) + return EmptyNodes; + const nodes = Array(this.size); + for (let i = 0; i < this.size; ++i) { + nodes[i] = this.child(i); + } + return nodes; + } + entries() { + const keys2 = this.keys(); + const values = this.values(); + const len = keys2.length; + const entries = Array(len); + for (let i = 0; i < len; ++i) { + entries[i] = [keys2[i], values[i]]; + } + return entries; + } + /** get child ITrieNode */ + get(char) { + const idx2 = this.getCharToIdxMap()[char]; + if (idx2 === void 0) + return void 0; + return this.child(idx2); } -}); + has(char) { + const idx2 = this.getCharToIdxMap()[char]; + return idx2 !== void 0; + } + hasChildren() { + return this.size > 0; + } + child(keyIdx) { + const node = this.trie.nodes[this.nodeIdx]; + const nodeIdx = node[keyIdx + 1] >>> this.trie.NodeChildRefShift; + return new _FastTrieBlobINode(this.trie, nodeIdx); + } + getCharToIdxMap() { + const m = this.charToIdx; + if (m) + return m; + const map3 = /* @__PURE__ */ Object.create(null); + const keys2 = this.keys(); + for (let i = 0; i < keys2.length; ++i) { + map3[keys2[i]] = i; + } + this.charToIdx = map3; + return map3; + } +}; +var FastTrieBlobIRoot = class extends FastTrieBlobINode { + constructor(trie, nodeIdx, info3) { + super(trie, nodeIdx); + this.info = info3; + } + resolveId(id) { + return new FastTrieBlobINode(this.trie, id); + } +}; -// node_modules/color-convert/conversions.js -var require_conversions2 = __commonJS({ - "node_modules/color-convert/conversions.js"(exports, module2) { - var cssKeywords = require_color_name2(); - var reverseKeywords = {}; - for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/TrieBlobIRoot.js +var TrieBlobInternals = class { + constructor(nodes, charIndex, charToIndexMap, maskInfo) { + this.nodes = nodes; + this.charIndex = charIndex; + this.charToIndexMap = charToIndexMap; + const { NodeMaskEOW, NodeMaskChildCharIndex, NodeMaskNumChildren, NodeChildRefShift } = maskInfo; + this.NodeMaskEOW = NodeMaskEOW; + this.NodeMaskNumChildren = NodeMaskNumChildren; + this.NodeMaskChildCharIndex = NodeMaskChildCharIndex; + this.NodeChildRefShift = NodeChildRefShift; + } +}; +var EmptyKeys3 = Object.freeze([]); +var EmptyNodes2 = Object.freeze([]); +var TrieBlobINode = class _TrieBlobINode { + constructor(trie, nodeIdx) { + this.trie = trie; + this.nodeIdx = nodeIdx; + const node = trie.nodes[nodeIdx]; + this.node = node; + this.eow = !!(node & trie.NodeMaskEOW); + this.size = node & trie.NodeMaskNumChildren; + this.id = nodeIdx; + } + /** get keys to children */ + keys() { + if (this._keys) + return this._keys; + if (!this.size) + return EmptyKeys3; + const NodeMaskChildCharIndex = this.trie.NodeMaskChildCharIndex; + const charIndex = this.trie.charIndex; + const keys2 = Array(this.size); + const offset = this.nodeIdx + 1; + const len = this.size; + for (let i = 0; i < len; ++i) { + const entry = this.trie.nodes[i + offset]; + const charIdx = entry & NodeMaskChildCharIndex; + keys2[i] = charIndex[charIdx]; + } + this._keys = keys2; + return keys2; + } + values() { + if (!this.size) + return EmptyNodes2; + const nodes = Array(this.size); + for (let i = 0; i < this.size; ++i) { + nodes[i] = this.child(i); + } + return nodes; + } + entries() { + const keys2 = this.keys(); + const values = this.values(); + const len = keys2.length; + const entries = Array(len); + for (let i = 0; i < len; ++i) { + entries[i] = [keys2[i], values[i]]; + } + return entries; + } + /** get child ITrieNode */ + get(char) { + const idx2 = this.getCharToIdxMap()[char]; + if (idx2 === void 0) + return void 0; + return this.child(idx2); + } + has(char) { + const idx2 = this.getCharToIdxMap()[char]; + return idx2 !== void 0; + } + hasChildren() { + return this.size > 0; + } + child(keyIdx) { + const n = this.trie.nodes[this.nodeIdx + keyIdx + 1]; + const nodeIdx = n >>> this.trie.NodeChildRefShift; + return new _TrieBlobINode(this.trie, nodeIdx); + } + getCharToIdxMap() { + const m = this.charToIdx; + if (m) + return m; + const map3 = /* @__PURE__ */ Object.create(null); + const keys2 = this.keys(); + for (let i = 0; i < keys2.length; ++i) { + map3[keys2[i]] = i; } - var convert = { - rgb: { channels: 3, labels: "rgb" }, - hsl: { channels: 3, labels: "hsl" }, - hsv: { channels: 3, labels: "hsv" }, - hwb: { channels: 3, labels: "hwb" }, - cmyk: { channels: 4, labels: "cmyk" }, - xyz: { channels: 3, labels: "xyz" }, - lab: { channels: 3, labels: "lab" }, - lch: { channels: 3, labels: "lch" }, - hex: { channels: 1, labels: ["hex"] }, - keyword: { channels: 1, labels: ["keyword"] }, - ansi16: { channels: 1, labels: ["ansi16"] }, - ansi256: { channels: 1, labels: ["ansi256"] }, - hcg: { channels: 3, labels: ["h", "c", "g"] }, - apple: { channels: 3, labels: ["r16", "g16", "b16"] }, - gray: { channels: 1, labels: ["gray"] } - }; - module2.exports = convert; - for (const model of Object.keys(convert)) { - if (!("channels" in convert[model])) { - throw new Error("missing channels property: " + model); - } - if (!("labels" in convert[model])) { - throw new Error("missing channel labels property: " + model); + this.charToIdx = map3; + return map3; + } +}; +var TrieBlobIRoot = class extends TrieBlobINode { + constructor(trie, nodeIdx, info3) { + super(trie, nodeIdx); + this.info = info3; + } + resolveId(id) { + return new TrieBlobINode(this.trie, id); + } +}; + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/TrieBlob.js +var NodeHeaderNumChildrenBits = 8; +var NodeHeaderNumChildrenShift = 0; +var HEADER_SIZE_UINT32 = 8; +var HEADER_SIZE = HEADER_SIZE_UINT32 * 4; +var HEADER_OFFSET = 0; +var HEADER_OFFSET_SIG = HEADER_OFFSET; +var HEADER_OFFSET_ENDIAN = HEADER_OFFSET_SIG + 8; +var HEADER_OFFSET_VERSION = HEADER_OFFSET_ENDIAN + 4; +var HEADER_OFFSET_NODES = HEADER_OFFSET_VERSION + 4; +var HEADER_OFFSET_NODES_LEN = HEADER_OFFSET_NODES + 4; +var HEADER_OFFSET_CHAR_INDEX = HEADER_OFFSET_NODES_LEN + 4; +var HEADER_OFFSET_CHAR_INDEX_LEN = HEADER_OFFSET_CHAR_INDEX + 4; +var HEADER = { + header: HEADER_OFFSET, + sig: HEADER_OFFSET_SIG, + version: HEADER_OFFSET_VERSION, + endian: HEADER_OFFSET_ENDIAN, + nodes: HEADER_OFFSET_NODES, + nodesLen: HEADER_OFFSET_NODES_LEN, + charIndex: HEADER_OFFSET_CHAR_INDEX, + charIndexLen: HEADER_OFFSET_CHAR_INDEX_LEN +}; +var headerSig = "TrieBlob"; +var version2 = "00.01.00"; +var endianSig = 67305985; +var TrieBlob = class _TrieBlob { + constructor(nodes, charIndex, info3) { + this.nodes = nodes; + this.charIndex = charIndex; + this.info = mergeOptionalWithDefaults(info3); + this.charToIndexMap = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < charIndex.length; ++i) { + const char = charIndex[i]; + this.charToIndexMap[char.normalize("NFC")] = i; + this.charToIndexMap[char.normalize("NFD")] = i; + } + this._forbidIdx = this._lookupNode(0, this.info.forbiddenWordPrefix); + } + has(word) { + return this._has(0, word); + } + isForbiddenWord(word) { + return !!this._forbidIdx && this._has(this._forbidIdx, word); + } + hasForbiddenWords() { + return !!this._forbidIdx; + } + getRoot() { + return this._iTrieRoot ??= this._getRoot(); + } + _getRoot() { + const trieData = new TrieBlobInternals(this.nodes, this.charIndex, this.charToIndexMap, { + NodeMaskEOW: _TrieBlob.NodeMaskEOW, + NodeMaskNumChildren: _TrieBlob.NodeMaskNumChildren, + NodeMaskChildCharIndex: _TrieBlob.NodeMaskChildCharIndex, + NodeChildRefShift: _TrieBlob.NodeChildRefShift + }); + return new TrieBlobIRoot(trieData, 0, this.info); + } + getNode(prefix) { + return findNode(this.getRoot(), prefix); + } + _has(nodeIdx, word) { + const NodeMaskNumChildren = _TrieBlob.NodeMaskNumChildren; + const NodeMaskChildCharIndex = _TrieBlob.NodeMaskChildCharIndex; + const NodeChildRefShift = _TrieBlob.NodeChildRefShift; + const nodes = this.nodes; + const len = word.length; + const charToIndexMap = this.charToIndexMap; + let node = nodes[nodeIdx]; + for (let p = 0; p < len; ++p, node = nodes[nodeIdx]) { + const letterIdx = charToIndexMap[word[p]]; + const count3 = node & NodeMaskNumChildren; + let i = count3; + for (; i > 0; --i) { + if ((nodes[i + nodeIdx] & NodeMaskChildCharIndex) === letterIdx) { + break; + } } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error("channel and label counts mismatch: " + model); + if (i < 1) + return false; + nodeIdx = nodes[i + nodeIdx] >>> NodeChildRefShift; + } + return (node & _TrieBlob.NodeMaskEOW) === _TrieBlob.NodeMaskEOW; + } + _lookupNode(nodeIdx, char) { + const NodeMaskNumChildren = _TrieBlob.NodeMaskNumChildren; + const NodeMaskChildCharIndex = _TrieBlob.NodeMaskChildCharIndex; + const NodeChildRefShift = _TrieBlob.NodeChildRefShift; + const nodes = this.nodes; + const charToIndexMap = this.charToIndexMap; + const node = nodes[nodeIdx]; + const letterIdx = charToIndexMap[char]; + const count3 = node & NodeMaskNumChildren; + let i = count3; + for (; i > 0; --i) { + if ((nodes[i + nodeIdx] & NodeMaskChildCharIndex) === letterIdx) { + return nodes[i + nodeIdx] >>> NodeChildRefShift; } - const { channels, labels } = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], "channels", { value: channels }); - Object.defineProperty(convert[model], "labels", { value: labels }); } - convert.rgb.hsl = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; + return void 0; + } + *words() { + const NodeMaskNumChildren = _TrieBlob.NodeMaskNumChildren; + const NodeMaskEOW = _TrieBlob.NodeMaskEOW; + const NodeMaskChildCharIndex = _TrieBlob.NodeMaskChildCharIndex; + const NodeChildRefShift = _TrieBlob.NodeChildRefShift; + const nodes = this.nodes; + const stack = [{ nodeIdx: 0, pos: 0, word: "" }]; + let depth = 0; + while (depth >= 0) { + const { nodeIdx, pos, word } = stack[depth]; + const node = nodes[nodeIdx]; + if (!pos && node & NodeMaskEOW) { + yield word; + } + const len = node & NodeMaskNumChildren; + if (pos >= len) { + --depth; + continue; } - h = Math.min(h * 60, 360); - if (h < 0) { - h += 360; + const nextPos = ++stack[depth].pos; + const entry = nodes[nodeIdx + nextPos]; + const charIdx = entry & NodeMaskChildCharIndex; + const letter = this.charIndex[charIdx]; + ++depth; + stack[depth] = { + nodeIdx: entry >>> NodeChildRefShift, + pos: 0, + word: word + letter + }; + } + } + get size() { + if (this._size) + return this._size; + const NodeMaskNumChildren = _TrieBlob.NodeMaskNumChildren; + const nodes = this.nodes; + let p = 0; + let count3 = 0; + while (p < nodes.length) { + ++count3; + p += (nodes[p] & NodeMaskNumChildren) + 1; + } + this._size = count3; + return count3; + } + toJSON() { + return { + charIndex: this.charIndex, + options: this.info, + nodes: splitString(Buffer.from(this.nodes.buffer, 128).toString("base64")) + }; + } + encodeBin() { + const charIndex = Buffer.from(this.charIndex.join("\n")); + const charIndexLen = charIndex.byteLength + 3 & ~3; + const nodeOffset = HEADER_SIZE + charIndexLen; + const size = nodeOffset + this.nodes.length * 4; + const useLittle = isLittleEndian(); + const buffer = Buffer.alloc(size); + const header = new DataView(buffer.buffer); + const nodeData = new Uint8Array(this.nodes.buffer); + buffer.write(headerSig, HEADER.sig, "utf8"); + buffer.write(version2, HEADER.version, "utf8"); + header.setUint32(HEADER.endian, endianSig, useLittle); + header.setUint32(HEADER.nodes, nodeOffset, useLittle); + header.setUint32(HEADER.nodesLen, this.nodes.length, useLittle); + header.setUint32(HEADER.charIndex, HEADER_SIZE, useLittle); + header.setUint32(HEADER.charIndexLen, charIndex.length, useLittle); + buffer.set(charIndex, HEADER_SIZE); + buffer.set(nodeData, nodeOffset); + return buffer; + } + static decodeBin(blob) { + if (!checkSig(blob)) { + throw new ErrorDecodeTrieBlob("Invalid TrieBlob Header"); + } + const header = new DataView(blob.buffer); + const useLittle = isLittleEndian(); + if (header.getUint32(HEADER.endian, useLittle) !== endianSig) { + if (header.getUint32(HEADER.endian, useLittle) !== endianSig) { + throw new ErrorDecodeTrieBlob("Invalid TrieBlob Header"); + } + } + const offsetNodes = header.getUint32(HEADER.nodes, useLittle); + const lenNodes = header.getUint32(HEADER.nodesLen, useLittle); + const offsetCharIndex = header.getUint32(HEADER.charIndex, useLittle); + const lenCharIndex = header.getUint32(HEADER.charIndexLen, useLittle); + const charIndex = Buffer.from(blob.subarray(offsetCharIndex, offsetCharIndex + lenCharIndex)).toString("utf8").split("\n"); + const nodes = new Uint32Array(blob.buffer).subarray(offsetNodes / 4, offsetNodes / 4 + lenNodes); + return new _TrieBlob(nodes, charIndex, defaultTrieInfo); + } +}; +TrieBlob.NodeMaskEOW = 256; +TrieBlob.NodeMaskNumChildren = (1 << NodeHeaderNumChildrenBits) - 1; +TrieBlob.NodeMaskNumChildrenShift = NodeHeaderNumChildrenShift; +TrieBlob.NodeChildRefShift = 8; +TrieBlob.NodeMaskChildCharIndex = 255; +function isLittleEndian() { + const buf = new Uint8Array([1, 2, 3, 4]); + const view = new DataView(buf.buffer); + return view.getUint32(0, true) === 67305985; +} +function checkSig(blob) { + if (blob.length < HEADER_SIZE) { + return false; + } + const buf = Buffer.from(blob, 0, headerSig.length); + if (buf.toString("utf8", 0, headerSig.length) !== headerSig) { + return false; + } + return true; +} +var ErrorDecodeTrieBlob = class extends Error { + constructor(message) { + super(message); + } +}; +function splitString(s, len = 64) { + const splits = []; + for (let i = 0; i < s.length; i += len) { + splits.push(s.slice(i, i + len)); + } + return splits; +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlob.js +var FastTrieBlob = class _FastTrieBlob { + constructor(nodes, charIndex, bitMasksInfo, options) { + this.nodes = nodes; + this.charIndex = charIndex; + this.bitMasksInfo = bitMasksInfo; + this._readonly = false; + this.info = mergeOptionalWithDefaults(options); + this.charToIndexMap = createCharToIndexMap(charIndex); + this._forbidIdx = this._lookupChar(0, this.info.forbiddenWordPrefix); + } + lookUpCharIndex(char) { + return this.charToIndexMap[char] ?? -1; + } + has(word) { + return this._has(0, word); + } + _has(nodeIdx, word) { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const nodes = this.nodes; + const len = word.length; + let node = nodes[nodeIdx]; + for (let p = 0; p < len; ++p, node = nodes[nodeIdx]) { + const letterIdx = this.lookUpCharIndex(word[p]); + const count3 = node.length; + let i = count3 - 1; + for (; i > 0; --i) { + if ((node[i] & NodeMaskChildCharIndex) === letterIdx) { + break; + } } - const l = (min + max) / 2; - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); + if (i < 1) + return false; + nodeIdx = node[i] >>> NodeChildRefShift; + if (!nodeIdx) + return false; + } + return !!(node[0] & NodeMaskEOW); + } + *words() { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const nodes = this.nodes; + const stack = [{ nodeIdx: 0, pos: 0, word: "" }]; + let depth = 0; + while (depth >= 0) { + const { nodeIdx, pos, word } = stack[depth]; + const node = nodes[nodeIdx]; + if (!pos && node[0] & NodeMaskEOW) { + yield word; + } + if (pos >= node.length - 1) { + --depth; + continue; } - return [h, s * 100, l * 100]; - }; - convert.rgb.hsv = function(rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function(c) { - return (v - c) / 6 / diff + 1 / 2; + const nextPos = ++stack[depth].pos; + const entry = node[nextPos]; + const charIdx = entry & NodeMaskChildCharIndex; + const letter = this.charIndex[charIdx]; + ++depth; + stack[depth] = { + nodeIdx: entry >>> NodeChildRefShift, + pos: 0, + word: word + letter }; - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = 1 / 3 + rdif - bdif; - } else if (b === v) { - h = 2 / 3 + gdif - rdif; - } - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } + } + } + toTrieBlob() { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const nodes = this.nodes; + function calcNodeToIndex(nodes2) { + let offset2 = 0; + const idx2 = Array(nodes2.length + 1); + for (let i = 0; i < nodes2.length; ++i) { + idx2[i] = offset2; + offset2 += nodes2[i].length; + } + idx2[nodes2.length] = offset2; + return idx2; + } + const nodeToIndex = calcNodeToIndex(nodes); + const nodeElementCount = nodeToIndex[nodeToIndex.length - 1]; + const binNodes = new Uint32Array(nodeElementCount); + const lenShift = TrieBlob.NodeMaskNumChildrenShift; + const refShift = TrieBlob.NodeChildRefShift; + let offset = 0; + for (let i = 0; i < nodes.length; ++i) { + const node = nodes[i]; + binNodes[offset++] = node.length - 1 << lenShift | node[0]; + for (let j = 1; j < node.length; ++j) { + const v = node[j]; + const nodeRef = v >>> NodeChildRefShift; + const charIndex = v & NodeMaskChildCharIndex; + binNodes[offset++] = nodeToIndex[nodeRef] << refShift | charIndex; + } + } + return new TrieBlob(binNodes, this.charIndex, this.info); + } + isReadonly() { + return this._readonly; + } + freeze() { + this._readonly = true; + return this; + } + static create(data, options) { + return new _FastTrieBlob(data.nodes, data.charIndex, extractInfo(data), options); + } + static toITrieNodeRoot(trie) { + return new FastTrieBlobIRoot(new FastTrieBlobInternals(trie.nodes, trie.charIndex, trie.charToIndexMap, trie.bitMasksInfo), 0, trie.info); + } + get iTrieRoot() { + return this._iTrieRoot ??= _FastTrieBlob.toITrieNodeRoot(this); + } + getRoot() { + return this.iTrieRoot; + } + getNode(prefix) { + return findNode(this.getRoot(), prefix); + } + isForbiddenWord(word) { + return !!this._forbidIdx && this._has(this._forbidIdx, word); + } + hasForbiddenWords() { + return !!this._forbidIdx; + } + /** number of nodes */ + get size() { + return this.nodes.length; + } + _lookupChar(nodeIdx, char) { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const nodes = this.nodes; + const node = nodes[nodeIdx]; + const letterIdx = this.lookUpCharIndex(char); + const count3 = node.length; + let i = count3 - 1; + for (; i > 0; --i) { + if ((node[i] & NodeMaskChildCharIndex) === letterIdx) { + return node[i] >>> NodeChildRefShift; } - return [ - h * 360, - s * 100, - v * 100 - ]; - }; - convert.rgb.hwb = function(rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - return [h, w * 100, b * 100]; - }; - convert.rgb.cmyk = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; - return [c * 100, m * 100, y * 100, k * 100]; - }; - function comparativeDistance(x, y) { - return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2; } - convert.rgb.keyword = function(rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; + return 0; + } +}; +FastTrieBlob.NodeMaskEOW = TrieBlob.NodeMaskEOW; +FastTrieBlob.NodeChildRefShift = TrieBlob.NodeChildRefShift; +FastTrieBlob.NodeMaskChildCharIndex = TrieBlob.NodeMaskChildCharIndex; +FastTrieBlob.DefaultBitMaskInfo = { + NodeMaskEOW: FastTrieBlob.NodeMaskEOW, + NodeMaskChildCharIndex: FastTrieBlob.NodeMaskChildCharIndex, + NodeChildRefShift: FastTrieBlob.NodeChildRefShift +}; +function createCharToIndexMap(charIndex) { + const map3 = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < charIndex.length; ++i) { + const char = charIndex[i]; + map3[char.normalize("NFC")] = i; + map3[char.normalize("NFD")] = i; + } + return map3; +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/resolveMap.js +function resolveMap(map3, key, resolve13) { + const r = map3.get(key); + if (r !== void 0) + return r; + const v = resolve13(key); + map3.set(key, v); + return v; +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlobBuilder.js +var FastTrieBlobBuilder = class _FastTrieBlobBuilder { + constructor(options, bitMasksInfo = _FastTrieBlobBuilder.DefaultBitMaskInfo) { + this.charToIndexMap = /* @__PURE__ */ Object.create(null); + this.charIndex = [""]; + this._readonly = false; + this._options = mergeOptionalWithDefaults(options); + this.bitMasksInfo = bitMasksInfo; + this.nodes = [[0], Object.freeze([_FastTrieBlobBuilder.NodeMaskEOW])]; + this.IdxEOW = 1; + } + setOptions(options) { + this._options = mergeOptionalWithDefaults(this.options, options); + return this.options; + } + get options() { + return this._options; + } + getCharIndex(char) { + let idx2 = this.charToIndexMap[char]; + if (idx2) + return idx2; + const charNFC = char.normalize("NFC"); + const charNFD = char.normalize("NFD"); + idx2 = this.charIndex.push(charNFC) - 1; + this.charToIndexMap[charNFC] = idx2; + this.charToIndexMap[charNFD] = idx2; + return idx2; + } + insert(word) { + if (this.isReadonly()) { + throw new Error("FastTrieBlob is readonly"); + } + if (typeof word === "string") { + return this._insert(word); + } + const words = word; + if (Array.isArray(words)) { + for (let i = 0; i < words.length; ++i) { + this._insert(words[i]); } - let currentClosestDistance = Infinity; - let currentClosestKeyword; - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - const distance = comparativeDistance(rgb, value); - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; + return this; + } + for (const w of words) { + this._insert(w); + } + return this; + } + getCursor() { + this._cursor ??= this.createCursor(); + return this._cursor; + } + createCursor() { + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const LetterMask = this.bitMasksInfo.NodeMaskChildCharIndex; + function childPos(node, letterIdx) { + for (let i = 1; i < node.length; ++i) { + if ((node[i] & LetterMask) === letterIdx) { + return i; } } - return currentClosestKeyword; - }; - convert.keyword.rgb = function(keyword) { - return cssKeywords[keyword]; + return 0; + } + assert5(this.nodes.length === 2); + const eow = 1; + const eowShifted = eow << NodeChildRefShift; + const nodes = this.nodes; + const stack = [{ nodeIdx: 0, pos: 0 }]; + let nodeIdx = 0; + let depth = 0; + const insertChar = (char) => { + if (nodes[nodeIdx] && Object.isFrozen(nodes[nodeIdx])) { + nodeIdx = nodes.push([...nodes[nodeIdx]]) - 1; + const { pos: pos2, nodeIdx: pNodeIdx } = stack[depth]; + const pNode = nodes[pNodeIdx]; + pNode[pos2] = pNode[pos2] & LetterMask | nodeIdx << NodeChildRefShift; + } + const node = nodes[nodeIdx] ?? [0]; + nodes[nodeIdx] = node; + const letterIdx = this.getCharIndex(char); + const hasIdx = childPos(node, letterIdx); + const childIdx = hasIdx ? node[hasIdx] >>> NodeChildRefShift : nodes.length; + const pos = hasIdx || node.push(childIdx << NodeChildRefShift | letterIdx) - 1; + ++depth; + const s = stack[depth]; + if (s) { + s.nodeIdx = nodeIdx; + s.pos = pos; + } else { + stack[depth] = { nodeIdx, pos }; + } + nodeIdx = childIdx; }; - convert.rgb.xyz = function(rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; - r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92; - g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92; - b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92; - const x = r * 0.4124 + g * 0.3576 + b * 0.1805; - const y = r * 0.2126 + g * 0.7152 + b * 0.0722; - const z = r * 0.0193 + g * 0.1192 + b * 0.9505; - return [x * 100, y * 100, z * 100]; + const markEOW = () => { + if (nodeIdx === eow) + return; + const node = nodes[nodeIdx]; + if (!node) { + const { pos, nodeIdx: pNodeIdx } = stack[depth]; + const pNode = nodes[pNodeIdx]; + pNode[pos] = pNode[pos] & LetterMask | eowShifted; + } else { + nodes[nodeIdx] = node; + node[0] |= NodeMaskEOW; + } + nodeIdx = eow; + }; + const reference = (nodeId) => { + const refNodeIdx = nodeId; + Object.freeze(nodes[refNodeIdx]); + const s = stack[depth]; + nodeIdx = s.nodeIdx; + const pos = s.pos; + const node = nodes[nodeIdx]; + node[pos] = refNodeIdx << NodeChildRefShift | node[pos] & LetterMask; + }; + const backStep = (num) => { + if (!num) + return; + assert5(num <= depth && num > 0); + depth -= num; + nodeIdx = stack[depth + 1].nodeIdx; }; - convert.rgb.lab = function(rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - x /= 95.047; - y /= 100; - z /= 108.883; - x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; - y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; - z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; - const l = 116 * y - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - return [l, a, b]; + const c = { + insertChar, + markEOW, + reference, + backStep }; - convert.hsl.rgb = function(hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } - const t1 = 2 * l - t2; - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } - if (t3 > 1) { - t3--; + return c; + } + _insert(word) { + word = word.trim(); + if (!word) + return this; + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const IdxEOW = this.IdxEOW; + const nodes = this.nodes; + const len = word.length; + let nodeIdx = 0; + for (let p = 0; p < len; ++p) { + const letterIdx = this.getCharIndex(word[p]); + const node = nodes[nodeIdx]; + const count3 = node.length; + let i = count3 - 1; + for (; i > 0; --i) { + if ((node[i] & NodeMaskChildCharIndex) === letterIdx) { + break; } - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; + } + if (i > 0) { + nodeIdx = node[i] >>> NodeChildRefShift; + if (nodeIdx === 1 && p < len - 1) { + nodeIdx = this.nodes.push([NodeMaskEOW]) - 1; + node[i] = nodeIdx << NodeChildRefShift | letterIdx; } - rgb[i] = val * 255; + continue; } - return rgb; - }; - convert.hsl.hsv = function(hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); - l *= 2; - s *= l <= 1 ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s); - return [h, sv * 100, v * 100]; - }; - convert.hsv.rgb = function(hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - s * f); - const t = 255 * v * (1 - s * (1 - f)); - v *= 255; - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; + nodeIdx = p < len - 1 ? this.nodes.push([0]) - 1 : IdxEOW; + node.push(nodeIdx << NodeChildRefShift | letterIdx); + } + if (nodeIdx > 1) { + const node = nodes[nodeIdx]; + node[0] |= NodeMaskEOW; + } + return this; + } + has(word) { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const nodes = this.nodes; + const len = word.length; + let nodeIdx = 0; + let node = nodes[nodeIdx]; + for (let p = 0; p < len; ++p, node = nodes[nodeIdx]) { + const letterIdx = this.charToIndexMap[word[p]]; + const count3 = node.length; + let i = count3 - 1; + for (; i > 0; --i) { + if ((node[i] & NodeMaskChildCharIndex) === letterIdx) { + break; + } } - }; - convert.hsv.hsl = function(hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= lmin <= 1 ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - return [h, sl * 100, l * 100]; - }; - convert.hwb.rgb = function(hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; - if ((i & 1) !== 0) { - f = 1 - f; - } - const n = wh + f * (v - wh); - let r; - let g; - let b; - switch (i) { - default: - case 6: - case 0: - r = v; - g = n; - b = wh; - break; - case 1: - r = n; - g = v; - b = wh; - break; - case 2: - r = wh; - g = v; - b = n; - break; - case 3: - r = wh; - g = n; - b = v; - break; - case 4: - r = n; - g = wh; - b = v; - break; - case 5: - r = v; - g = wh; - b = n; - break; - } - return [r * 255, g * 255, b * 255]; - }; - convert.cmyk.rgb = function(cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); - return [r * 255, g * 255, b * 255]; - }; - convert.xyz.rgb = function(xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; - r = x * 3.2406 + y * -1.5372 + z * -0.4986; - g = x * -0.9689 + y * 1.8758 + z * 0.0415; - b = x * 0.0557 + y * -0.204 + z * 1.057; - r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92; - g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92; - b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92; - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - return [r * 255, g * 255, b * 255]; - }; - convert.xyz.lab = function(xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - x /= 95.047; - y /= 100; - z /= 108.883; - x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; - y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; - z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; - const l = 116 * y - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - return [l, a, b]; - }; - convert.lab.xyz = function(lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; - x *= 95.047; - y *= 100; - z *= 108.883; - return [x, y, z]; - }; - convert.lab.lch = function(lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - if (h < 0) { - h += 360; - } - const c = Math.sqrt(a * a + b * b); - return [l, c, h]; - }; - convert.lch.lab = function(lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); - return [l, a, b]; - }; - convert.rgb.ansi16 = function(args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; - value = Math.round(value / 50); - if (value === 0) { - return 30; - } - let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255)); - if (value === 2) { - ansi += 60; - } - return ansi; - }; - convert.hsv.ansi16 = function(args) { - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); - }; - convert.rgb.ansi256 = function(args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; - if (r === g && g === b) { - if (r < 8) { - return 16; - } - if (r > 248) { - return 231; - } - return Math.round((r - 8) / 247 * 24) + 232; - } - const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); - return ansi; - }; - convert.ansi16.rgb = function(args) { - let color = args % 10; - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - color = color / 10.5 * 255; - return [color, color, color]; - } - const mult = (~~(args > 50) + 1) * 0.5; - const r = (color & 1) * mult * 255; - const g = (color >> 1 & 1) * mult * 255; - const b = (color >> 2 & 1) * mult * 255; - return [r, g, b]; - }; - convert.ansi256.rgb = function(args) { - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } - args -= 16; - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = rem % 6 / 5 * 255; - return [r, g, b]; - }; - convert.rgb.hex = function(args) { - const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255); - const string = integer.toString(16).toUpperCase(); - return "000000".substring(string.length) + string; - }; - convert.hex.rgb = function(args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - let colorString = match[0]; - if (match[0].length === 3) { - colorString = colorString.split("").map((char) => { - return char + char; - }).join(""); - } - const integer = parseInt(colorString, 16); - const r = integer >> 16 & 255; - const g = integer >> 8 & 255; - const b = integer & 255; - return [r, g, b]; - }; - convert.rgb.hcg = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = max - min; - let grayscale; - let hue; - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } - if (chroma <= 0) { - hue = 0; - } else if (max === r) { - hue = (g - b) / chroma % 6; - } else if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - hue /= 6; - hue %= 1; - return [hue * 360, chroma * 100, grayscale * 100]; - }; - convert.hsl.hcg = function(hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; - const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l); - let f = 0; - if (c < 1) { - f = (l - 0.5 * c) / (1 - c); - } - return [hsl[0], c * 100, f * 100]; - }; - convert.hsv.hcg = function(hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const c = s * v; - let f = 0; - if (c < 1) { - f = (v - c) / (1 - c); - } - return [hsv[0], c * 100, f * 100]; - }; - convert.hcg.rgb = function(hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; - if (c === 0) { - return [g * 255, g * 255, g * 255]; - } - const pure = [0, 0, 0]; - const hi = h % 1 * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; - pure[1] = v; - pure[2] = 0; - break; - case 1: - pure[0] = w; - pure[1] = 1; - pure[2] = 0; - break; - case 2: - pure[0] = 0; - pure[1] = 1; - pure[2] = v; - break; - case 3: - pure[0] = 0; - pure[1] = w; - pure[2] = 1; - break; - case 4: - pure[0] = v; - pure[1] = 0; - pure[2] = 1; - break; - default: - pure[0] = 1; - pure[1] = 0; - pure[2] = w; - } - mg = (1 - c) * g; - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; - }; - convert.hcg.hsv = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1 - c); - let f = 0; - if (v > 0) { - f = c / v; - } - return [hcg[0], f * 100, v * 100]; - }; - convert.hcg.hsl = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const l = g * (1 - c) + 0.5 * c; - let s = 0; - if (l > 0 && l < 0.5) { - s = c / (2 * l); - } else if (l >= 0.5 && l < 1) { - s = c / (2 * (1 - l)); - } - return [hcg[0], s * 100, l * 100]; - }; - convert.hcg.hwb = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; - }; - convert.hwb.hcg = function(hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; - if (c < 1) { - g = (v - c) / (1 - c); - } - return [hwb[0], c * 100, g * 100]; - }; - convert.apple.rgb = function(apple) { - return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; - }; - convert.rgb.apple = function(rgb) { - return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; - }; - convert.gray.rgb = function(args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; - }; - convert.gray.hsl = function(args) { - return [0, 0, args[0]]; - }; - convert.gray.hsv = convert.gray.hsl; - convert.gray.hwb = function(gray) { - return [0, 100, gray[0]]; - }; - convert.gray.cmyk = function(gray) { - return [0, 0, 0, gray[0]]; - }; - convert.gray.lab = function(gray) { - return [gray[0], 0, 0]; - }; - convert.gray.hex = function(gray) { - const val = Math.round(gray[0] / 100 * 255) & 255; - const integer = (val << 16) + (val << 8) + val; - const string = integer.toString(16).toUpperCase(); - return "000000".substring(string.length) + string; - }; - convert.rgb.gray = function(rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; + if (i < 1) + return false; + nodeIdx = node[i] >>> NodeChildRefShift; + } + return !!(node[0] & NodeMaskEOW); + } + isReadonly() { + return this._readonly; + } + freeze() { + this._readonly = true; + return this; + } + build() { + this.freeze(); + Object.freeze(this.nodes); + return FastTrieBlob.create(new FastTrieBlobInternals(this.nodes, this.charIndex, this.charToIndexMap, this.bitMasksInfo), this.options); + } + static fromWordList(words, options) { + const ft = new _FastTrieBlobBuilder(options); + return ft.insert(words).build(); + } + static fromTrieRoot(root) { + const bitMasksInfo = _FastTrieBlobBuilder.DefaultBitMaskInfo; + const NodeChildRefShift = bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = bitMasksInfo.NodeMaskEOW; + const tf2 = new _FastTrieBlobBuilder(void 0, bitMasksInfo); + const IdxEOW = tf2.IdxEOW; + const known = /* @__PURE__ */ new Map([[root, 0]]); + function resolveNode(n) { + if (n.f && !n.c) + return IdxEOW; + const node = [n.f ? NodeMaskEOW : 0]; + return tf2.nodes.push(node) - 1; + } + function walk4(n) { + const found = known.get(n); + if (found) + return found; + const nodeIdx = resolveMap(known, n, resolveNode); + const node = tf2.nodes[nodeIdx]; + if (!n.c) + return nodeIdx; + const children = Object.entries(n.c); + node.length = children.length + 1; + for (let p = 0; p < children.length; ++p) { + const [char, childNode] = children[p]; + const letterIdx = tf2.getCharIndex(char); + const childIdx = walk4(childNode); + node[p + 1] = childIdx << NodeChildRefShift | letterIdx; + } + return nodeIdx; + } + walk4(root); + return tf2.build(); + } +}; +FastTrieBlobBuilder.NodeMaskEOW = TrieBlob.NodeMaskEOW; +FastTrieBlobBuilder.NodeChildRefShift = TrieBlob.NodeChildRefShift; +FastTrieBlobBuilder.NodeMaskChildCharIndex = TrieBlob.NodeMaskChildCharIndex; +FastTrieBlobBuilder.DefaultBitMaskInfo = { + NodeMaskEOW: FastTrieBlobBuilder.NodeMaskEOW, + NodeMaskChildCharIndex: FastTrieBlobBuilder.NodeMaskChildCharIndex, + NodeChildRefShift: FastTrieBlobBuilder.NodeChildRefShift +}; + +// node_modules/cspell-trie-lib/dist/lib/utils/clean.js +function clean3(t) { + const copy = { ...t }; + for (const key of Object.keys(copy)) { + if (copy[key] === void 0) { + delete copy[key]; + } + } + return copy; +} + +// node_modules/cspell-trie-lib/dist/lib/ITrie.js +var defaultLegacyMinCompoundLength2 = 3; +var ITrieImpl = class _ITrieImpl { + constructor(data, numNodes) { + this.data = data; + this.numNodes = numNodes; + this.lastCreateFindOptionsMatchCaseMap = /* @__PURE__ */ new Map(); + this.root = data.getRoot(); + this._info = mergeOptionalWithDefaults(data.info); + this.hasForbidden = data.hasForbiddenWords(); + this._findOptionsDefaults = { + caseInsensitivePrefix: this._info.stripCaseAndAccentsPrefix, + compoundFix: this._info.compoundCharacter, + forbidPrefix: this._info.forbiddenWordPrefix }; } -}); - -// node_modules/color-convert/route.js -var require_route2 = __commonJS({ - "node_modules/color-convert/route.js"(exports, module2) { - var conversions = require_conversions2(); - function buildGraph() { - const graph = {}; - const models = Object.keys(conversions); - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - return graph; - } - function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; - graph[fromModel].distance = 0; - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - return graph; - } - function link(from, to) { - return function(args) { - return to(from(args)); - }; + /** + * Number of words in the Trie, the first call to this method might be expensive. + * Use `size` to get the number of nodes. + */ + numWords() { + this.count ??= countWords(this.root); + return this.count; + } + isNumWordsKnown() { + return this.count !== void 0; + } + get size() { + return this.data.size; + } + get info() { + return this._info; + } + get isCaseAware() { + return this.info.isCaseAware ?? true; + } + /** + * @param text - text to find in the Trie + */ + find(text) { + const options = this.createFindOptions({ compoundMode: "compound" }); + return findWordNode(this.data.getRoot(), text, options).node; + } + has(word, minLegacyCompoundLength) { + if (this.hasWord(word, false)) + return true; + if (minLegacyCompoundLength) { + const f = this.findWord(word, { useLegacyWordCompounds: minLegacyCompoundLength }); + return !!f.found; } - function wrapConversion(toModel, graph) { - const path16 = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path16.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - fn.conversion = path16; - return fn; + return false; + } + /** + * Determine if a word is in the dictionary. + * @param word - the exact word to search for - must be normalized. + * @param caseSensitive - false means also searching a dictionary where the words were normalized to lower case and accents removed. + * @returns true if the word was found and is not forbidden. + */ + hasWord(word, caseSensitive) { + const f = this.findWord(word, { caseSensitive }); + return !!f.found && !f.forbidden; + } + findWord(word, options) { + if (options?.useLegacyWordCompounds) { + const len = options.useLegacyWordCompounds !== true ? options.useLegacyWordCompounds : defaultLegacyMinCompoundLength2; + const findOptions2 = this.createFindOptions({ + legacyMinCompoundLength: len, + matchCase: options.caseSensitive + }); + return findLegacyCompound(this.root, word, findOptions2); } - module2.exports = function(fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; - if (node.parent === null) { - continue; - } - conversion[toModel] = wrapConversion(toModel, graph); - } - return conversion; - }; + const findOptions = this.createFindOptionsMatchCase(options?.caseSensitive); + return findWord(this.root, word, findOptions); } -}); + /** + * Determine if a word is in the forbidden word list. + * @param word the word to lookup. + */ + isForbiddenWord(word) { + return this.hasForbidden && isForbiddenWord(this.root, word, this.info.forbiddenWordPrefix); + } + /** + * Provides an ordered sequence of words with the prefix of text. + */ + completeWord(text) { + const n = this.find(text); + const compoundChar = this.info.compoundCharacter; + const subNodes = pipeSync(n ? iteratorTrieWords(n) : [], opFilterSync((w) => w[w.length - 1] !== compoundChar), opMapSync((suffix) => text + suffix)); + return pipeSync(n && n.eow ? [text] : [], opAppendSync(subNodes)); + } + /** + * Suggest spellings for `text`. The results are sorted by edit distance with changes near the beginning of a word having a greater impact. + * @param text - the text to search for + * @param maxNumSuggestions - the maximum number of suggestions to return. + * @param compoundMethod - Use to control splitting words. + * @param numChanges - the maximum number of changes allowed to text. This is an approximate value, since some changes cost less than others. + * the lower the value, the faster results are returned. Values less than 4 are best. + */ + suggest(text, options) { + return this.suggestWithCost(text, options).map((a) => a.word); + } + /** + * Suggest spellings for `text`. The results are sorted by edit distance with changes near the beginning of a word having a greater impact. + * The results include the word and adjusted edit cost. This is useful for merging results from multiple tries. + */ + suggestWithCost(text, options) { + const sep5 = options.compoundSeparator; + const weightMap = options.weightMap || this.weightMap; + const adjWord = sep5 ? replaceAllFactory(sep5, "") : (a) => a; + const optFilter = options.filter; + const filter3 = optFilter ? (word, cost) => { + const w = adjWord(word); + return !this.isForbiddenWord(w) && optFilter(w, cost); + } : (word) => !this.isForbiddenWord(adjWord(word)); + const opts = { ...options, filter: filter3, weightMap }; + return suggestAStar(this.data, text, opts); + } + /** + * genSuggestions will generate suggestions and send them to `collector`. `collector` is responsible for returning the max acceptable cost. + * Costs are measured in weighted changes. A cost of 100 is the same as 1 edit. Some edits are considered cheaper. + * Returning a MaxCost < 0 will effectively cause the search for suggestions to stop. + */ + genSuggestions(collector, compoundMethod) { + const filter3 = (word) => !this.isForbiddenWord(word); + const options = createSuggestionOptions(clean3({ compoundMethod, ...collector.genSuggestionOptions })); + const suggestions = getSuggestionsAStar(this.data, collector.word, options); + collector.collect(suggestions, void 0, filter3); + } + /** + * Returns an iterator that can be used to get all words in the trie. For some dictionaries, this can result in millions of words. + */ + words() { + return iteratorTrieWords(this.root); + } + /** + * Allows iteration over the entire tree. + * On the returned Iterator, calling .next(goDeeper: boolean), allows for controlling the depth. + */ + iterate() { + return walker(this.root); + } + static create(words, info3) { + const builder2 = new FastTrieBlobBuilder(info3); + builder2.insert(words); + const root = builder2.build(); + return new _ITrieImpl(root, void 0); + } + createFindOptions(options = {}) { + const findOptions = createFindOptions({ + ...this._findOptionsDefaults, + ...options + }); + return findOptions; + } + createFindOptionsMatchCase(matchCase3) { + const f = this.lastCreateFindOptionsMatchCaseMap.get(matchCase3); + if (f !== void 0) + return f; + const findOptions = this.createFindOptions({ matchCase: matchCase3 }); + this.lastCreateFindOptionsMatchCaseMap.set(matchCase3, findOptions); + return findOptions; + } +}; -// node_modules/color-convert/index.js -var require_color_convert2 = __commonJS({ - "node_modules/color-convert/index.js"(exports, module2) { - var conversions = require_conversions2(); - var route = require_route2(); - var convert = {}; - var models = Object.keys(conversions); - function wrapRaw(fn) { - const wrappedFn = function(...args) { - const arg0 = args[0]; - if (arg0 === void 0 || arg0 === null) { - return arg0; - } - if (arg0.length > 1) { - args = arg0; - } - return fn(args); - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; - } - return wrappedFn; +// node_modules/cspell-trie-lib/dist/lib/buildITrie.js +function buildITrieFromWords(words, info3 = {}) { + const builder2 = new FastTrieBlobBuilder(info3); + builder2.insert(words); + return new ITrieImpl(builder2.build()); +} + +// node_modules/cspell-trie-lib/dist/lib/TrieNode/TrieNode.js +var FLAG_WORD = 1; + +// node_modules/cspell-trie-lib/dist/lib/TrieNode/trie-util.js +function insert2(text, root = {}) { + let node = root; + for (let i = 0; i < text.length; ++i) { + const head = text[i]; + const c = node.c || /* @__PURE__ */ Object.create(null); + node.c = c; + node = c[head] || {}; + c[head] = node; + } + node.f = (node.f || 0) | FLAG_WORD; + return root; +} +function iteratorTrieWords2(node) { + return walkerWords2(node); +} +function createTrieRoot(options) { + const fullOptions = mergeOptionalWithDefaults(options); + return { + ...fullOptions, + c: /* @__PURE__ */ Object.create(null) + }; +} +function createTrieRootFromList(words, options) { + const root = createTrieRoot(options); + for (const word of words) { + if (word.length) { + insert2(word, root); } - function wrapRounded(fn) { - const wrappedFn = function(...args) { - const arg0 = args[0]; - if (arg0 === void 0 || arg0 === null) { - return arg0; - } - if (arg0.length > 1) { - args = arg0; - } - const result = fn(args); - if (typeof result === "object") { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - return result; - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; - } - return wrappedFn; + } + return root; +} +function countNodes(root) { + const seen = /* @__PURE__ */ new Set(); + function walk4(n) { + if (seen.has(n)) + return; + seen.add(n); + if (n.c) { + Object.values(n.c).forEach((n2) => walk4(n2)); + } + } + walk4(root); + return seen.size; +} +function checkCircular(root) { + const seen = /* @__PURE__ */ new Set(); + const inStack = /* @__PURE__ */ new Set(); + function walk4(n) { + if (seen.has(n)) + return { isCircular: false, allSeen: true }; + if (inStack.has(n)) { + const stack = [...inStack, n]; + const word = trieStackToWord(stack); + const pos = stack.indexOf(n); + return { isCircular: true, allSeen: false, ref: { stack, word, pos } }; + } + inStack.add(n); + let r = { isCircular: false, allSeen: true }; + if (n.c) { + r = Object.values(n.c).reduce((acc, n2) => { + if (acc.isCircular) + return acc; + const r2 = walk4(n2); + r2.allSeen = r2.allSeen && acc.allSeen; + return r2; + }, r); } - models.forEach((fromModel) => { - convert[fromModel] = {}; - Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }); - Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels }); - const routes = route(fromModel); - const routeModels = Object.keys(routes); - routeModels.forEach((toModel) => { - const fn = routes[toModel]; - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); - }); - module2.exports = convert; + if (r.allSeen) { + seen.add(n); + } + inStack.delete(n); + return r; } -}); - -// node_modules/ansi-styles/index.js -var require_ansi_styles2 = __commonJS({ - "node_modules/ansi-styles/index.js"(exports, module2) { - "use strict"; - var wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\x1B[${code + offset}m`; - }; - var wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\x1B[${38 + offset};5;${code}m`; - }; - var wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; - }; - var ansi2ansi = (n) => n; - var rgb2rgb = (r, g, b) => [r, g, b]; - var setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - return value; - }, - enumerable: true, - configurable: true - }); - }; - var colorConvert; - var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === void 0) { - colorConvert = require_color_convert2(); - } - const offset = isBackground ? 10 : 0; - const styles = {}; - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === "object") { - styles[name] = wrap(suite[targetSpace], offset); - } - } - return styles; - }; - function assembleStyles() { - const codes2 = /* @__PURE__ */ new Map(); - const 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], - 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], - 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], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - 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]; - codes2.set(style[0], style[1]); - } - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - Object.defineProperty(styles, "codes", { - value: codes2, - enumerable: false - }); - styles.color.close = "\x1B[39m"; - styles.bgColor.close = "\x1B[49m"; - setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false)); - setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false)); - setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false)); - setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true)); - setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true)); - setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true)); - return styles; + return walk4(root); +} +function reverseMapTrieNode(node) { + return node.c && new Map(Object.entries(node.c).map(([c, n]) => [n, c])); +} +function trieStackToWord(stack) { + let word = ""; + let lastMap = reverseMapTrieNode(stack[0]); + for (let i = 1; i < stack.length; ++i) { + const n = stack[i]; + const char = lastMap?.get(n); + if (char) { + word += char; } - Object.defineProperty(module2, "exports", { - enumerable: true, - get: assembleStyles - }); + lastMap = reverseMapTrieNode(n); } -}); + return word; +} +function isCircular(root) { + return checkCircular(root).isCircular; +} +function trieNodeToRoot(node, options) { + const newOptions = mergeOptionalWithDefaults(options); + return { + ...newOptions, + c: node.c || /* @__PURE__ */ Object.create(null) + }; +} -// node_modules/has-flag/index.js -var require_has_flag2 = __commonJS({ - "node_modules/has-flag/index.js"(exports, module2) { - "use strict"; - module2.exports = (flag, argv = process.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); - }; +// node_modules/cspell-trie-lib/dist/lib/consolidate.js +function consolidate(root) { + let count3 = 0; + const signatures = /* @__PURE__ */ new Map(); + const cached = /* @__PURE__ */ new Map(); + const knownMap = /* @__PURE__ */ new Map(); + if (isCircular(root)) { + throw new Error("Trie is circular."); } -}); - -// node_modules/supports-color/index.js -var require_supports_color2 = __commonJS({ - "node_modules/supports-color/index.js"(exports, module2) { - "use strict"; - var os = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag2(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + function signature(n) { + const isWord = n.f ? "*" : ""; + const ref = n.c ? JSON.stringify(Object.entries(n.c).map(([k, n2]) => [k, cached.get(n2)])) : ""; + return isWord + ref; + } + function findEow(n) { + if (n.f && !n.c) + return n; + let r; + if (n.c) { + for (const c of Object.values(n.c)) { + r = findEow(c); + if (r) + break; } } - function translateLevel(level) { - if (level === 0) { + return r; + } + function compareMaps(a, b) { + for (const e of a) { + if (b[e[0]] !== e[1]) return false; + } + return a.length === b.size; + } + function deepCopy(n) { + const k = knownMap.get(n); + if (k) { + return k; + } + const orig = n; + if (n.c) { + const children = Object.entries(n.c).map((c) => [c[0], deepCopy(c[1])]); + if (!compareMaps(children, n.c)) { + n = { f: n.f, c: Object.fromEntries(children) }; } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.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 (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version3 >= 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; + const sig = signature(n); + const ref = signatures.get(sig); + if (ref) { + knownMap.set(orig, ref); + return ref; } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); + Object.freeze(n); + signatures.set(sig, n); + cached.set(n, count3++); + knownMap.set(orig, n); + return n; + } + function process6(n) { + if (cached.has(n)) { + return n; } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; + if (Object.isFrozen(n)) { + return knownMap.get(n) || deepCopy(n); + } + if (n.c) { + const children = Object.entries(n.c).sort((a, b) => a[0] < b[0] ? -1 : 1).map(([k, n2]) => [k, process6(n2)]); + n.c = Object.fromEntries(children); + } + const sig = signature(n); + const ref = signatures.get(sig); + if (ref) { + return ref; + } + signatures.set(sig, n); + cached.set(n, count3++); + return n; + } + const eow = findEow(root) || { f: FLAG_WORD, c: void 0 }; + signatures.set(signature(eow), eow); + cached.set(eow, count3++); + return trieNodeToRoot(process6(root), root); +} + +// node_modules/cspell-trie-lib/dist/lib/TrieNode/find.js +var defaultLegacyMinCompoundLength3 = 3; +var _defaultFindOptions2 = { + matchCase: false, + compoundMode: "compound", + forbidPrefix: FORBID_PREFIX, + compoundFix: COMPOUND_FIX, + caseInsensitivePrefix: CASE_INSENSITIVE_PREFIX, + legacyMinCompoundLength: defaultLegacyMinCompoundLength3 +}; +var arrayCompoundModes2 = ["none", "compound", "legacy"]; +var knownCompoundModes2 = new Map(arrayCompoundModes2.map((a) => [a, a])); +function findWordExact2(root, word) { + return isEndOfWordNode2(walk2(root, word)); +} +function isEndOfWordNode2(n) { + return n?.f === FLAG_WORD; +} +function walk2(root, word) { + const w = word; + let n = root; + let i = 0; + while (n && i < word.length) { + const h = w[i++]; + n = n.c?.[h]; } -}); + return n; +} +var createFindOptions2 = memorizeLastCall(_createFindOptions2); +function _createFindOptions2(options) { + return mergeDefaults(options, _defaultFindOptions2); +} -// node_modules/chalk/source/util.js -var require_util10 = __commonJS({ - "node_modules/chalk/source/util.js"(exports, module2) { - "use strict"; - var 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.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - returnValue += string.substr(endIndex); - return returnValue; - }; - var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ""; - do { - const gotCR = string[index - 1] === "\r"; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix; - endIndex = index + 1; - index = string.indexOf("\n", endIndex); - } while (index !== -1); - returnValue += string.substr(endIndex); - return returnValue; - }; - module2.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex - }; +// node_modules/cspell-trie-lib/dist/lib/TrieNode/TrieNodeTrie.js +var TrieNodeTrie = class _TrieNodeTrie { + constructor(root) { + this.root = root; + this.info = mergeOptionalWithDefaults(root); } -}); + get iTrieRoot() { + return this._iTrieRoot || (this._iTrieRoot = trieRootToITrieRoot(this.root)); + } + getRoot() { + return this.iTrieRoot; + } + getNode(prefix) { + return findNode(this.getRoot(), prefix); + } + words() { + return iteratorTrieWords2(this.root); + } + has(word) { + return findWordExact2(this.root, word); + } + isForbiddenWord(word) { + return findWordExact2(this.root.c[this.root.forbiddenWordPrefix], word); + } + hasForbiddenWords() { + const root = this.root; + return !!root.c[root.forbiddenWordPrefix]; + } + get size() { + return this._size ??= countNodes(this.root); + } + static createFromWords(words, options) { + const root = createTrieRootFromList(words, options); + return new _TrieNodeTrie(root); + } + static createFromWordsAndConsolidate(words, options) { + const root = createTrieRootFromList(words, options); + return new _TrieNodeTrie(consolidate(root)); + } +}; -// node_modules/chalk/source/templates.js -var require_templates2 = __commonJS({ - "node_modules/chalk/source/templates.js"(exports, module2) { - "use strict"; - var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; - var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; - var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; - var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; - var ESCAPES = /* @__PURE__ */ new Map([ - ["n", "\n"], - ["r", "\r"], - ["t", " "], - ["b", "\b"], - ["f", "\f"], - ["v", "\v"], - ["0", "\0"], - ["\\", "\\"], - ["e", "\x1B"], - ["a", "\x07"] - ]); - function unescape2(c) { - const u = c[0] === "u"; - const bracket = c[1] === "{"; - if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } - return ESCAPES.get(c) || c; +// node_modules/gensequence/dist/esm/util/util.mjs +function* toIterableIterator(i) { + yield* i; +} + +// node_modules/gensequence/dist/esm/operators/operatorsBase.mjs +function* filter(i, fnFilter) { + for (const v of i) { + if (fnFilter(v)) { + yield v; } - function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if (matches = chunk.match(STRING_REGEX)) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape2(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } - return results; + } +} +function* skip(i, n) { + let a = 0; + for (const t of i) { + if (a >= n) { + yield t; } - function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; - const results = []; - let matches; - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } + a += 1; + } +} +function* take(i, n) { + let a = 0; + if (n) { + for (const t of i) { + if (a >= n) { + break; } - return results; + yield t; + a += 1; } - function buildStyle(chalk3, styles) { - const enabled = {}; - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } - let current = chalk3; - for (const [styleName, styles2] of Object.entries(enabled)) { - if (!Array.isArray(styles2)) { - continue; - } - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } - current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName]; - } - return current; + } +} +function* concat(i, j) { + yield* i; + yield* j; +} +function* concatMap(i, fn) { + for (const t of i) { + yield* fn(t); + } +} +function* combine(i, j, fnMap) { + const jit = j[Symbol.iterator](); + for (const r of i) { + const s = jit.next().value; + yield fnMap(r, s); + } +} +function map(i, fnMap) { + function* fn(i2, fnMap2) { + for (const v of i2) { + yield fnMap2(v); } - module2.exports = (chalk3, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape2(escapeCharacter)); - } else if (style) { - const string = chunk.join(""); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk3, styles)(string)); - styles.push({ inverse, styles: parseStyle(style) }); - } else if (close) { - if (styles.length === 0) { - throw new Error("Found extraneous } in Chalk template literal"); - } - chunks.push(buildStyle(chalk3, styles)(chunk.join(""))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); - chunks.push(chunk.join("")); - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`; - throw new Error(errMessage); - } - return chunks.join(""); - }; } -}); - -// node_modules/chalk/source/index.js -var require_source = __commonJS({ - "node_modules/chalk/source/index.js"(exports, module2) { - "use strict"; - var ansiStyles = require_ansi_styles2(); - var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color2(); - var { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex - } = require_util10(); - var { isArray } = Array; - var levelMapping = [ - "ansi", - "ansi", - "ansi256", - "ansi16m" - ]; - var styles = /* @__PURE__ */ Object.create(null); - var 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; - }; - var ChalkClass = class { - constructor(options) { - return chalkFactory(options); - } - }; - var chalkFactory = (options) => { - const chalk4 = {}; - applyOptions(chalk4, options); - chalk4.template = (...arguments_) => chalkTag(chalk4.template, ...arguments_); - Object.setPrototypeOf(chalk4, Chalk.prototype); - Object.setPrototypeOf(chalk4.template, chalk4); - chalk4.template.constructor = () => { - throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead."); - }; - chalk4.template.Instance = ChalkClass; - return chalk4.template; - }; - function Chalk(options) { - return chalkFactory(options); + return fn(i, fnMap); +} +function* scan(i, fnReduce, initValue) { + let index = 0; + if (initValue === void 0) { + index = 1; + const iter = i[Symbol.iterator](); + let r = iter.next(); + if (!r.done) + yield r.value; + initValue = r.value; + i = makeIterable(iter); + } + let prevValue = initValue; + for (const t of i) { + const nextValue = fnReduce(prevValue, t, index); + yield nextValue; + prevValue = nextValue; + index += 1; + } +} +function all(i, fn) { + for (const t of i) { + if (!fn(t)) { + return false; } - for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, { value: builder }); - return builder; - } - }; + } + return true; +} +function any(i, fn) { + for (const t of i) { + if (fn(t)) { + return true; } - styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, "visible", { value: builder }); - return builder; - } - }; - var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"]; - for (const model of usedModels) { - styles[model] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; + } + return false; +} +function count(i) { + return reduce2(i, (p) => p + 1, 0); +} +function first(i, fn, defaultValue) { + fn = fn || (() => true); + for (const t of i) { + if (fn(t)) { + return t; } - for (const model of usedModels) { - const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; + } + return defaultValue; +} +function forEach(i, fn) { + let index = 0; + for (const t of i) { + fn(t, index); + index += 1; + } +} +function max(i, selector = (t) => t) { + return reduce2(i, (p, c) => selector(c) > selector(p) ? c : p, void 0); +} +function min(i, selector = (t) => t) { + return reduce2(i, (p, c) => selector(c) < selector(p) ? c : p, void 0); +} +function reduce2(i, fnReduce, initialValue) { + const iter = makeIterable(i[Symbol.iterator]()); + let index = 0; + if (initialValue === void 0) { + index = 1; + const r = iter.next(); + initialValue = r.value; + } + let prevValue = initialValue; + for (const t of iter) { + const nextValue = fnReduce(prevValue, t, index); + prevValue = nextValue; + index += 1; + } + return prevValue; +} +async function reduceAsync2(i, fnReduce, initialValue) { + const iter = makeIterable(i[Symbol.iterator]()); + let index = 0; + if (initialValue === void 0) { + index = 1; + const r = iter.next(); + initialValue = r.value; + } + let previousValue = await initialValue; + for (const p of iter) { + const t = await p; + const nextValue = await fnReduce(previousValue, t, index); + previousValue = nextValue; + index += 1; + } + return previousValue; +} +async function reduceAsyncForAsyncIterator(i, fnReduce, initialValue) { + const iter = makeAsyncIterable(i[Symbol.asyncIterator]()); + let index = 0; + if (initialValue === void 0) { + index = 1; + const r = await iter.next(); + initialValue = r.value; + } + let previousValue = await initialValue; + for await (const t of iter) { + const nextValue = await fnReduce(previousValue, t, index); + previousValue = nextValue; + index += 1; + } + return previousValue; +} +function makeIterable(i) { + function* fromIterator(i2) { + for (let r = i2.next(); !r.done; r = i2.next()) { + yield r.value; } - var proto = Object.defineProperties(() => { - }, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; - } - } - }); - var 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; + } + function* fromIterable(i2) { + yield* i2; + } + return isIterable2(i) ? isIterableIterator(i) ? i : fromIterable(i) : fromIterator(i); +} +function isIterable2(i) { + return !!i[Symbol.iterator]; +} +function isIterableIterator(i) { + return typeof i.next == "function"; +} +function makeAsyncIterable(i) { + async function* fromIterable(i2) { + for (const v of i2) { + yield v; + } + } + async function* fromIterator(i2) { + for (let r = await i2.next(); !r.done; r = await i2.next()) { + yield r.value; + } + } + async function* fromAsyncIterable(i2) { + yield* i2; + } + return isAsyncIterable2(i) ? isAsyncIterableIterator(i) ? i : fromAsyncIterable(i) : isIterable2(i) ? fromIterable(i) : fromIterator(i); +} +function isAsyncIterable2(i) { + return !!i[Symbol.asyncIterator]; +} +function isAsyncIterableIterator(i) { + return typeof i.next == "function"; +} + +// node_modules/gensequence/dist/esm/operators/operators.mjs +function filter2(fnFilter) { + return (i) => filter(i, fnFilter); +} +function skip2(n) { + return (i) => skip(i, n); +} +function take2(n) { + return (i) => take(i, n); +} +function concat2(j) { + return (i) => concat(i, j); +} +function concatMap2(fn) { + return (i) => concatMap(i, fn); +} +function combine2(fnMap, j) { + return (i) => combine(i, j, fnMap); +} +function map2(fnMap) { + return (i) => map(i, fnMap); +} +function scan2(fnReduce, initValue) { + return (i) => scan(i, fnReduce, initValue); +} +function all2(fn) { + return (i) => all(i, fn); +} +function any2(fn) { + return (i) => any(i, fn); +} +function count2() { + return (i) => count(i); +} +function first2(fn, defaultValue) { + return (i) => first(i, fn, defaultValue); +} +function forEach2(fn) { + return (i) => forEach(i, fn); +} +function max2(selector) { + return (i) => max(i, selector); +} +function min2(selector) { + return (i) => min(i, selector); +} +function reduce3(fnReduce, initialValue) { + return (i) => reduce2(i, fnReduce, initialValue); +} +function reduceAsync3(fnReduceAsync, initialValue) { + return (i) => reduceAsync2(i, fnReduceAsync, initialValue); +} +function reduceAsyncForAsyncIterator2(fnReduceAsync, initialValue) { + return (i) => reduceAsyncForAsyncIterator(i, fnReduceAsync, initialValue); +} +function pipe(...fns) { + return (i) => { + for (const fn of fns) { + i = fn ? fn(i) : i; + } + return i; + }; +} + +// node_modules/gensequence/dist/esm/ImplSequence.mjs +var ImplSequence = class _ImplSequence { + constructor(i) { + this.i = i; + } + get iter() { + return typeof this.i === "function" ? this.i() : this.i; + } + get iterator() { + if (!this._iterator) { + this._iterator = this.iter[Symbol.iterator](); + } + return this._iterator; + } + inject(fn) { + const iter = this.i; + return () => fn(typeof iter === "function" ? iter() : iter); + } + chain(fn) { + return new _ImplSequence(this.inject(fn)); + } + [Symbol.iterator]() { + return this.iter[Symbol.iterator](); + } + next() { + return this.iterator.next(); + } + //// Filters + filter(fnFilter) { + return this.chain(filter2(fnFilter)); + } + skip(n) { + return this.chain(skip2(n)); + } + take(n) { + return this.chain(take2(n)); + } + //// Extenders + concat(j) { + return this.chain(concat2(j)); + } + concatMap(fn) { + return this.chain(concatMap2(fn)); + } + //// Mappers + combine(fn, j) { + return this.chain(combine2(fn, j)); + } + map(fn) { + return this.chain(map2(fn)); + } + scan(fnReduce, initValue) { + return this.chain(scan2(fnReduce, initValue)); + } + pipe(...fns) { + if (!fns.length) + return this; + return this.chain(pipe.apply(null, fns)); + } + // Reducers + all(fnFilter) { + return all2(fnFilter)(this.iter); + } + any(fnFilter) { + return any2(fnFilter)(this.iter); + } + count() { + return count2()(this.iter); + } + first(fnFilter, defaultValue) { + return first2(fnFilter, defaultValue)(this.iter); + } + forEach(fn) { + return forEach2(fn)(this.iter); + } + max(fnSelector) { + return max2(fnSelector)(this.iter); + } + min(fnSelector) { + return min2(fnSelector)(this.iter); + } + reduce(fnReduce, initValue) { + return reduce3(fnReduce, initValue)(this.iter); + } + reduceAsync(fnReduceAsync, initialValue) { + return reduceAsync3(fnReduceAsync, initialValue)(this.iter); + } + reduceToSequence(fnReduce, initialValue) { + return this.chain(reduce3(fnReduce, initialValue)); + } + //// Cast + toArray() { + return [...this.iter]; + } + toIterable() { + return toIterableIterator(this.iter); + } +}; + +// node_modules/gensequence/dist/esm/GenSequence.mjs +function genSequence(i) { + return new ImplSequence(i); +} +function sequenceFromRegExpMatch(pattern, text) { + function* doMatch() { + const regex = new RegExp(pattern); + let match2; + let lastIndex = void 0; + while (match2 = regex.exec(text)) { + if (match2.index === lastIndex) { + break; } - return { - open, - close, - openAll, - closeAll, - parent - }; - }; - var createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { - return applyStyle(builder, chalkTag(builder, ...arguments_)); - } - return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); - }; - Object.setPrototypeOf(builder, proto); - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; - return builder; - }; - var applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? "" : string; - } - let styler = self._styler; - if (styler === void 0) { - return string; + lastIndex = match2.index; + yield match2; + } + } + return genSequence(() => doMatch()); +} + +// node_modules/gensequence/dist/esm/ImplAsyncSequence.mjs +var ImplAsyncSequence = class { + constructor(i) { + this.i = i; + } + get iter() { + return typeof this.i === "function" ? this.i() : this.i; + } + [Symbol.asyncIterator]() { + return this.iter[Symbol.asyncIterator](); + } + reduceAsync(fnReduceAsync, initialValue) { + return reduceAsyncForAsyncIterator2(fnReduceAsync, initialValue)(this.iter); + } +}; + +// node_modules/gensequence/dist/esm/ImplSequenceBuilder.mjs +var ImplSequenceBuilder = class _ImplSequenceBuilder { + constructor(operators2 = []) { + this.operators = []; + this.operators = operators2; + } + build(i) { + return new ImplSequence(i).pipe(pipe.apply(null, this.operators)); + } + pipe(...fns) { + return new _ImplSequenceBuilder([...this.operators, ...fns]); + } + //// Filters + /** keep values where the fnFilter(t) returns true */ + filter(fnFilter) { + return this.pipe(filter2(fnFilter)); + } + skip(n) { + return this.pipe(skip2(n)); + } + take(n) { + return this.pipe(take2(n)); + } + //// Extenders + concat(j) { + return this.pipe(concat2(j)); + } + concatMap(fn) { + return this.pipe(concatMap2(fn)); + } + //// Mappers + combine(fn, j) { + return this.pipe(combine2(fn, j)); + } + /** map values from type T to type U */ + map(fnMap) { + return this.pipe(map2(fnMap)); + } + scan(fnReduce, initialValue) { + return this.pipe(scan2(fnReduce, initialValue)); + } +}; + +// node_modules/gensequence/dist/esm/builder.mjs +function makeBuilder(fn) { + return new ImplSequenceBuilder([fn]); +} +var builder = Object.freeze({ + pipe: (fn) => { + return makeBuilder(fn); + }, + //// Filters + /** keep values where the fnFilter(t) returns true */ + filter: (fnFilter) => { + return makeBuilder(filter2(fnFilter)); + }, + skip: (n) => { + return makeBuilder(skip2(n)); + }, + take: (n) => { + return makeBuilder(take2(n)); + }, + //// Extenders + concat: (j) => { + return makeBuilder(concat2(j)); + }, + concatMap: (fn) => { + return makeBuilder(concatMap2(fn)); + }, + //// Mappers + combine: (fn, j) => { + return makeBuilder(combine2(fn, j)); + }, + /** map values from type T to type U */ + map: (fnMap) => { + return makeBuilder(map2(fnMap)); + }, + scan: (fnReduce, initialValue) => { + return makeBuilder(scan2(fnReduce, initialValue)); + } +}); + +// node_modules/cspell-trie-lib/dist/lib/io/importExportV1.js +var EOW = "*"; +var DATA = EOW; +function* toIterableIterator2(iter) { + yield* iter; +} +function importTrie(linesX) { + let radix = 16; + const comment = /^\s*#/; + const iter = toIterableIterator2(linesX); + function parseHeaderRows(headerRows) { + const header = headerRows.slice(0, 2).join("\n"); + const headerReg2 = /^TrieXv1\nbase=(\d+)$/; + if (!headerReg2.test(header)) + throw new Error("Unknown file format"); + radix = Number.parseInt(header.replace(headerReg2, "$1"), 10); + } + function readHeader(iter2) { + const headerRows = []; + while (true) { + const next = iter2.next(); + if (next.done) { + break; } - const { openAll, closeAll } = styler; - if (string.indexOf("\x1B") !== -1) { - while (styler !== void 0) { - string = stringReplaceAll(string, styler.close, styler.open); - styler = styler.parent; - } + const line = next.value.trim(); + if (!line || comment.test(line)) { + continue; } - const lfIndex = string.indexOf("\n"); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + if (line === DATA) { + break; } - return openAll + string + closeAll; - }; - var template2; - var chalkTag = (chalk4, ...strings) => { - const [firstString] = strings; - if (!isArray(firstString) || !isArray(firstString.raw)) { - return strings.join(" "); + headerRows.push(line); + } + parseHeaderRows(headerRows); + } + const regNotEscapedCommas = /(^|[^\\]),/g; + const regUnescapeCommas = /__COMMA__/g; + const regUnescape = /[\\](.)/g; + const flagsWord = { f: FLAG_WORD }; + function splitLine2(line) { + const pattern = "$1__COMMA__"; + return line.replace(regNotEscapedCommas, pattern).split(regUnescapeCommas).map((a) => a.replace(regUnescape, "$1")); + } + function decodeLine2(line, nodes) { + const isWord = line[0] === EOW; + line = isWord ? line.slice(1) : line; + const flags = isWord ? flagsWord : {}; + const children = splitLine2(line).filter((a) => !!a).map((a) => [a[0], Number.parseInt(a.slice(1) || "0", radix)]).map(([k, i]) => [k, nodes[i]]); + const cNode = children.length ? { c: Object.fromEntries(children) } : {}; + return { ...cNode, ...flags }; + } + readHeader(iter); + const n = genSequence([DATA]).concat(iter).map((a) => a.replace(/\r?\n/, "")).filter((a) => !!a).reduce((acc, line) => { + const { lines, nodes } = acc; + const root = decodeLine2(line, nodes); + nodes[lines] = root; + return { lines: lines + 1, root, nodes }; + }, { lines: 0, nodes: [], root: {} }); + return trieNodeToRoot(n.root, { isCaseAware: false }); +} + +// node_modules/cspell-trie-lib/dist/lib/io/importExportV2.js +var EOW2 = "*"; +var DATA2 = "__DATA__"; +function* toIterableIterator3(iter) { + yield* iter; +} +function importTrie2(linesX) { + let radix = 16; + const comment = /^\s*#/; + const iter = toIterableIterator3(linesX); + function parseHeaderRows(headerRows) { + const header = headerRows.slice(0, 2).join("\n"); + const headerReg2 = /^TrieXv2\nbase=(\d+)$/; + if (!headerReg2.test(header)) + throw new Error("Unknown file format"); + radix = Number.parseInt(header.replace(headerReg2, "$1"), 10); + } + function readHeader(iter2) { + const headerRows = []; + while (true) { + const next = iter2.next(); + if (next.done) { + break; } - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), - String(firstString.raw[i]) - ); + const line = next.value.trim(); + if (!line || comment.test(line)) { + continue; } - if (template2 === void 0) { - template2 = require_templates2(); + if (line === DATA2) { + break; } - return template2(chalk4, parts.join("")); - }; - Object.defineProperties(Chalk.prototype, styles); - var chalk3 = Chalk(); - chalk3.supportsColor = stdoutColor; - chalk3.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 }); - chalk3.stderr.supportsColor = stderrColor; - module2.exports = chalk3; + headerRows.push(line); + } + parseHeaderRows(headerRows); } -}); - -// node_modules/cspell/dist/lib/uri.cjs -var require_uri = __commonJS({ - "node_modules/cspell/dist/lib/uri.cjs"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Utils = exports.URI = void 0; - var vscode_uri_1 = require_umd(); - Object.defineProperty(exports, "URI", { enumerable: true, get: function() { - return vscode_uri_1.URI; - } }); - Object.defineProperty(exports, "Utils", { enumerable: true, get: function() { - return vscode_uri_1.Utils; - } }); + function parseLine(line, base) { + const isWord = line[1] === EOW2; + const refOffset = isWord ? 2 : 1; + const refs = line.slice(refOffset).split(",").filter((a) => !!a).map((r) => parseInt(r, base)); + return { + letter: line[0], + isWord, + refs + }; + } + const flagsWord = { f: FLAG_WORD }; + function decodeLine2(line, nodes) { + const { letter, isWord, refs } = parseLine(line, radix); + const flags = isWord ? flagsWord : {}; + const children = refs.map((r) => nodes[r]).sort((a, b) => a.s < b.s ? -1 : 1).map((n2) => [n2.s, n2]); + const cNode = children.length ? { c: Object.fromEntries(children) } : {}; + return { s: letter, ...cNode, ...flags }; + } + readHeader(iter); + const n = genSequence(iter).map((a) => a.replace(/\r?\n/, "")).filter((a) => !!a).reduce((acc, line) => { + const { nodes } = acc; + const root = decodeLine2(line, nodes); + nodes.push(root); + return { root, nodes }; + }, { nodes: [], root: { s: "", c: /* @__PURE__ */ Object.create(null) } }); + return trieNodeToRoot(n.root, { isCaseAware: false }); +} + +// node_modules/cspell-trie-lib/dist/lib/io/constants.js +var EOW3 = "$"; +var BACK = "<"; +var EOL = "\n"; +var LF = "\r"; +var REF = "#"; +var REF_REL = "@"; +var EOR = ";"; +var ESCAPE = "\\"; + +// node_modules/cspell-trie-lib/dist/lib/io/importExportV4.js +var REF_INDEX_BEGIN = "["; +var REF_INDEX_END = "]"; +var INLINE_DATA_COMMENT_LINE = "/"; +var specialCharacters = stringToCharSet([EOW3, BACK, EOL, REF, REF_REL, EOR, ESCAPE, LF, REF_INDEX_BEGIN, REF_INDEX_END, INLINE_DATA_COMMENT_LINE].concat("0123456789".split("")).concat("`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|".split("")).join("")); +var SPECIAL_CHARACTERS_MAP = [ + ["\n", "\\n"], + ["\r", "\\r"], + ["\\", "\\\\"] +]; +var specialCharacterMap = stringToCharMap(SPECIAL_CHARACTERS_MAP); +var characterMap = stringToCharMap(SPECIAL_CHARACTERS_MAP.map((a) => [a[1], a[0]])); +var specialPrefix = stringToCharSet("~!"); +var DATA3 = "__DATA__"; +function importTrie3(linesX) { + linesX = typeof linesX === "string" ? linesX.split(/^/m) : linesX; + let radix = 10; + const comment = /^\s*#/; + const iter = tapIterable(pipeSync(linesX, opConcatMapSync((a) => a.split(/^/m)))); + function parseHeaderRows(headerRows) { + const header = headerRows.slice(0, 2).join("\n"); + const headerReg2 = /^TrieXv[34]\nbase=(\d+)$/; + if (!headerReg2.test(header)) + throw new Error("Unknown file format"); + radix = Number.parseInt(header.replace(headerReg2, "$1"), 10); + } + function readHeader(iter2) { + const headerRows = []; + for (const value of iter2) { + const line = value.trim(); + if (!line || comment.test(line)) + continue; + if (line === DATA3) + break; + headerRows.push(line); + } + parseHeaderRows(headerRows); + } + readHeader(iter); + const root = parseStream(radix, iter); + return root; +} +var numbersSet = stringToCharSet("0123456789"); +function parseStream(radix, iter) { + const eow = Object.freeze({ f: 1 }); + let refIndex = []; + const root = trieNodeToRoot({}, {}); + function parseReference(acc, s) { + const isIndexRef = s === REF_REL; + let ref = ""; + function parser2(acc2, s2) { + if (s2 === EOR || radix === 10 && !(s2 in numbersSet)) { + const { root: root2, nodes: nodes2, stack } = acc2; + const r = parseInt(ref, radix); + const top = stack[stack.length - 1]; + const p = stack[stack.length - 2].node; + const n = isIndexRef ? refIndex[r] : r; + p.c && (p.c[top.s] = nodes2[n]); + const rr = { root: root2, nodes: nodes2, stack, parser: void 0 }; + return s2 === EOR ? rr : parserMain(rr, s2); + } + ref = ref + s2; + return acc2; + } + const { nodes } = acc; + nodes.pop(); + return { ...acc, nodes, parser: parser2 }; + } + function parseEscapeCharacter(acc, _) { + let prev = ""; + const parser2 = function(acc2, s) { + if (prev) { + s = characterMap[prev + s] || s; + return parseCharacter({ ...acc2, parser: void 0 }, s); + } + if (s === ESCAPE) { + prev = s; + return acc2; + } + return parseCharacter({ ...acc2, parser: void 0 }, s); + }; + return { ...acc, parser: parser2 }; + } + function parseComment(acc, s) { + const endOfComment = s; + let isEscaped = false; + function parser2(acc2, s2) { + if (isEscaped) { + isEscaped = false; + return acc2; + } + if (s2 === ESCAPE) { + isEscaped = true; + return acc2; + } + if (s2 === endOfComment) { + return { ...acc2, parser: void 0 }; + } + return acc2; + } + return { ...acc, parser: parser2 }; + } + function parseCharacter(acc, s) { + const parser2 = void 0; + const { root: root2, nodes, stack } = acc; + const top = stack[stack.length - 1]; + const node = top.node; + const c = node.c ?? /* @__PURE__ */ Object.create(null); + const n = { f: void 0, c: void 0, n: nodes.length }; + c[s] = n; + node.c = c; + stack.push({ node: n, s }); + nodes.push(n); + return { root: root2, nodes, stack, parser: parser2 }; + } + function parseEOW(acc, _) { + const parser2 = parseBack; + const { root: root2, nodes, stack } = acc; + const top = stack[stack.length - 1]; + const node = top.node; + node.f = FLAG_WORD; + if (!node.c) { + top.node = eow; + const p = stack[stack.length - 2].node; + p.c && (p.c[top.s] = eow); + nodes.pop(); + } + stack.pop(); + return { root: root2, nodes, stack, parser: parser2 }; + } + const charactersBack = stringToCharSet(BACK + "23456789"); + function parseBack(acc, s) { + if (!(s in charactersBack)) { + return parserMain({ ...acc, parser: void 0 }, s); + } + let n = s === BACK ? 1 : parseInt(s, 10) - 1; + const { stack } = acc; + while (n-- > 0) { + stack.pop(); + } + return { ...acc, parser: parseBack }; + } + function parseIgnore(acc, _) { + return acc; + } + const parsers3 = createStringLookupMap([ + [EOW3, parseEOW], + [BACK, parseBack], + [REF, parseReference], + [REF_REL, parseReference], + [ESCAPE, parseEscapeCharacter], + [EOL, parseIgnore], + [LF, parseIgnore], + [INLINE_DATA_COMMENT_LINE, parseComment] + ]); + function parserMain(acc, s) { + const parser2 = acc.parser ?? parsers3[s] ?? parseCharacter; + return parser2(acc, s); + } + const charsetSpaces = stringToCharSet(" \r\n "); + function parseReferenceIndex(acc, s) { + let json2 = ""; + function parserStart(acc2, s2) { + if (s2 === REF_INDEX_BEGIN) { + json2 = json2 + s2; + return { ...acc2, parser: parser2 }; + } + if (s2 in charsetSpaces) { + return acc2; + } + return parserMain({ ...acc2, parser: void 0 }, s2); + } + function parser2(acc2, s2) { + json2 = json2 + s2; + if (s2 === REF_INDEX_END) { + refIndex = json2.replace(/[\s[\]]/g, "").split(",").map((n) => parseInt(n, radix)); + return { ...acc2, parser: void 0 }; + } + return acc2; + } + return parserStart({ ...acc, parser: parserStart }, s); + } + reduceSync(pipeSync(iter, opConcatMapSync((a) => a.split(""))), parserMain, { + nodes: [root], + root, + stack: [{ node: root, s: "" }], + parser: parseReferenceIndex + }); + return root; +} +function stringToCharSet(values) { + const set = /* @__PURE__ */ Object.create(null); + const len = values.length; + for (let i = 0; i < len; ++i) { + set[values[i]] = true; } -}); - -// node_modules/cspell/package.json -var require_package = __commonJS({ - "node_modules/cspell/package.json"(exports, module2) { - module2.exports = { - name: "cspell", - version: "6.31.3", - description: "A Spelling Checker for Code!", - funding: "https://github.com/streetsidesoftware/cspell?sponsor=1", - bin: { - cspell: "bin.js", - "cspell-esm": "bin.mjs" - }, - type: "commonjs", - main: "dist/cjs/index.js", - types: "dist/cjs/index.d.ts", - module: "dist/esm/index.mjs", - exports: { - ".": { - import: "./dist/esm/index.mjs", - require: "./dist/cjs/index.js" - }, - "./app": { - import: "./dist/esm/app.mjs", - require: "./dist/cjs/app.js" - }, - "./bin": { - import: "./bin.mjs", - require: "./bin.js" - }, - "./application": { - import: "./dist/esm/application.mjs", - require: "./dist/cjs/application.js" - } - }, - files: [ - "bin.js", - "bin.mjs", - "dist", - "!dist/esm/**/*.js", - "!dist/esm/**/*.ts", - "!**/*.tsbuildInfo", - "!**/__mocks__", - "!**/test/**", - "!**/*.test.*", - "!**/*.spec.*", - "!**/*.map" - ], - scripts: { - clean: "shx rm -rf dist coverage temp .tsbuildinfo", - build: "tsc -b . && ts2mjs dist/esm && pnpm run build:api", - "build:api": "rollup -c rollup.config.mjs", - "build:cjs": "tsc -b tsconfig.cjs.json", - "build:esm": "tsc -b tsconfig.esm.json", - "build:esm:ts2mjs": "tsc -b tsconfig.esm.json && ts2mjs dist/esm", - "build:lib": "tsc -b src/lib/tsconfig.json", - "build:readme": "pnpm build:readme:help", - "build:readme:help": "pnpm build:readme:help:lint && pnpm build:readme:help:trace && inject-markdown README.md && prettier -w README.md", - "build:readme:help:lint": "./bin.js lint --help > static/help-lint.txt", - "build:readme:help:trace": "./bin.js trace --help > static/help-trace.txt", - "clean-build": "pnpm run clean && pnpm run build", - coverage: "pnpm coverage:vitest && pnpm coverage:fix", - "coverage:vitest": "vitest run --coverage", - "coverage:fix": 'nyc report --temp-dir "$(pwd)/coverage" --reporter lcov --report-dir "$(pwd)/coverage" --cwd ../..', - "test:watch": "vitest", - test: "vitest run", - watch: "tsc -b . -w", - compile: "tsc -p .", - "test-watch": "vitest", - prepublishOnly: "pnpm run clean-build", - "test:update-snapshot": "vitest run --update" - }, - repository: { - type: "git", - url: "git+https://github.com/streetsidesoftware/cspell.git" - }, - keywords: [ - "spell", - "checker", - "code", - "camel", - "case", - "spelling", - "spell checker", - "spelling checker", - "lint" - ], - author: "Jason Dent", - license: "MIT", - bugs: { - url: "https://github.com/streetsidesoftware/cspell/issues" - }, - homepage: "https://streetsidesoftware.github.io/cspell/", - dependencies: { - "@cspell/cspell-json-reporter": "6.31.3", - "@cspell/cspell-pipe": "6.31.3", - "@cspell/cspell-types": "6.31.3", - "@cspell/dynamic-import": "6.31.3", - chalk: "^4.1.2", - commander: "^10.0.0", - "cspell-gitignore": "6.31.3", - "cspell-glob": "6.31.3", - "cspell-io": "6.31.3", - "cspell-lib": "6.31.3", - "fast-glob": "^3.2.12", - "fast-json-stable-stringify": "^2.1.0", - "file-entry-cache": "^6.0.1", - "get-stdin": "^8.0.0", - imurmurhash: "^0.1.4", - semver: "^7.3.8", - "strip-ansi": "^6.0.1", - "vscode-uri": "^3.0.7" - }, - engines: { - node: ">=14" - }, - devDependencies: { - "@types/file-entry-cache": "^5.0.2", - "@types/glob": "^8.1.0", - "@types/imurmurhash": "^0.1.1", - "@types/micromatch": "^4.0.2", - "@types/semver": "^7.3.13", - micromatch: "^4.0.5", - minimatch: "^7.4.4" - }, - gitHead: "0e8ca7b32f21aea40ade645172ef93017e6a143d" - }; + return set; +} +function stringToCharMap(values) { + return createStringLookupMap(values); +} +function createStringLookupMap(values) { + const map3 = /* @__PURE__ */ Object.create(null); + const len = values.length; + for (let i = 0; i < len; ++i) { + map3[values[i][0]] = values[i][1]; } -}); + return map3; +} +function tapIterable(iterable) { + let lastValue; + let iter; + function getNext() { + if (lastValue && lastValue.done) { + return { ...lastValue }; + } + iter = iter || iterable[Symbol.iterator](); + lastValue = iter.next(); + return lastValue; + } + function* iterableFn() { + let next; + while (!(next = getNext()).done) { + yield next.value; + } + } + return { + [Symbol.iterator]: iterableFn + }; +} -// node_modules/cspell/dist/lib/pkgInfo.cjs -var require_pkgInfo = __commonJS({ - "node_modules/cspell/dist/lib/pkgInfo.cjs"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); +// node_modules/cspell-trie-lib/dist/lib/TrieNode/TrieNodeBuilder.js +var EOW4 = Object.freeze({ f: 1, k: true }); + +// node_modules/cspell-trie-lib/dist/lib/io/importV3.js +var specialCharacterMap2 = /* @__PURE__ */ new Map([ + ["\n", "\\n"], + ["\r", "\\r"], + ["\\", "\\\\"] +]); +var characterMap2 = new Map([...specialCharacterMap2].map((a) => [a[1], a[0]])); +var DATA4 = "__DATA__"; +function importTrieV3WithBuilder(builder2, srcLines) { + const timer = getGlobalPerfTimer(); + const timerStart = timer.start("importTrieV3"); + const dataLines = typeof srcLines === "string" ? srcLines.split("\n") : Array.isArray(srcLines) ? srcLines : [...srcLines]; + let radix = 16; + const comment = /^\s*#/; + function parseHeaderRows(headerRows) { + const header = headerRows.slice(0, 2).join("\n"); + const headerReg2 = /^TrieXv3\nbase=(\d+)$/; + if (!headerReg2.test(header)) + throw new Error("Unknown file format"); + radix = Number.parseInt(header.replace(headerReg2, "$1"), 10); + } + function findStartOfData(data) { + for (let i = 0; i < data.length; ++i) { + const line = data[i]; + if (line.includes(DATA4)) { + return i; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.npmPackage = exports.pkgDir = void 0; - var path16 = __importStar(require("path")); - exports.pkgDir = path16.join(__dirname, "../.."); - exports.npmPackage = require_package(); + } + return -1; } -}); - -// node_modules/get-stdin/index.js -var require_get_stdin = __commonJS({ - "node_modules/get-stdin/index.js"(exports, module2) { - "use strict"; - var { stdin } = process; - module2.exports = async () => { - let result = ""; - if (stdin.isTTY) { - return result; + function readHeader(data) { + const headerRows = []; + for (const hLine of data) { + const line = hLine.trim(); + if (!line || comment.test(line)) { + continue; } - stdin.setEncoding("utf8"); - for await (const chunk of stdin) { - result += chunk; + if (line === DATA4) { + break; } - return result; - }; - module2.exports.buffer = async () => { - const result = []; - let length = 0; - if (stdin.isTTY) { - return Buffer.concat([]); + headerRows.push(line); + } + parseHeaderRows(headerRows); + } + const startOfData = findStartOfData(dataLines); + if (startOfData < 0) { + throw new Error("Unknown file format"); + } + readHeader(dataLines.slice(0, startOfData)); + const cursor = builder2.getCursor(); + let node = { + cursor, + parser: void 0 + }; + const parser2 = parseStream2(radix); + const timerParse = timer.start("importTrieV3.parse"); + for (let i = startOfData + 1; i < dataLines.length; ++i) { + const line = dataLines[i]; + for (let j = 0; j < line.length; ++j) { + node = parser2(node, line[j]); + } + } + timerParse(); + timerStart(); + return builder2.build(); +} +function parseStream2(radix) { + function parseReference(acc, _) { + let ref = ""; + function parser2(acc2, s) { + if (s === EOR) { + const { cursor } = acc2; + const r = parseInt(ref, radix); + cursor.reference(r + 1); + acc2.parser = void 0; + return acc2; + } + ref = ref + s; + return acc2; + } + acc.parser = parser2; + return acc; + } + function parseEscapeCharacter(acc, _) { + let prev = ""; + const parser2 = function(acc2, s) { + if (prev) { + s = characterMap2.get(prev + s) || s; + acc2.parser = void 0; + return parseCharacter(acc2, s); + } + if (s === ESCAPE) { + prev = s; + return acc2; + } + acc2.parser = void 0; + return parseCharacter(acc2, s); + }; + acc.parser = parser2; + return acc; + } + function parseCharacter(acc, s) { + acc.cursor.insertChar(s); + acc.parser = void 0; + return acc; + } + function parseEOW(acc, _) { + acc.parser = parseBack; + acc.cursor.markEOW(); + acc.cursor.backStep(1); + return acc; + } + const charactersBack = stringToCharSet2(BACK + "23456789"); + function parseBack(acc, s) { + if (!(s in charactersBack)) { + acc.parser = void 0; + return parserMain(acc, s); + } + const n = s === BACK ? 1 : parseInt(s, 10) - 1; + acc.cursor.backStep(n); + acc.parser = parseBack; + return acc; + } + function parseIgnore(acc, _) { + return acc; + } + const parsers3 = /* @__PURE__ */ new Map([ + [EOW3, parseEOW], + [BACK, parseBack], + [REF, parseReference], + [ESCAPE, parseEscapeCharacter], + [EOL, parseIgnore], + [LF, parseIgnore] + ]); + function parserMain(acc, s) { + const parser2 = acc.parser ?? parsers3.get(s) ?? parseCharacter; + return parser2(acc, s); + } + return parserMain; +} +function stringToCharSet2(values) { + const set = /* @__PURE__ */ Object.create(null); + const len = values.length; + for (let i = 0; i < len; ++i) { + set[values[i]] = true; + } + return set; +} + +// node_modules/cspell-trie-lib/dist/lib/io/importV3FastBlob.js +function importTrieV3AsFastTrieBlob(srcLines) { + return importTrieV3WithBuilder(new FastTrieBlobBuilder(), srcLines); +} + +// node_modules/cspell-trie-lib/dist/lib/io/decode.js +function decodeTrieData(raw) { + return decodeStringFormat(typeof raw === "string" ? raw : raw.toString("utf8")); +} +function decodeStringFormat(data) { + return importTrie4(data); +} +var deserializers = [ + (data) => new TrieNodeTrie(importTrie(data)), + (data) => new TrieNodeTrie(importTrie(data)), + (data) => new TrieNodeTrie(importTrie2(data)), + (data) => importTrieV3AsFastTrieBlob(data), + (data) => new TrieNodeTrie(importTrie3(data)) +]; +var headerReg = /^\s*TrieXv(\d+)/m; +function importTrie4(input) { + const lines = Array.isArray(input) ? input : typeof input === "string" ? input.split("\n") : [...input]; + function parseHeaderRows(headerRows) { + for (let i = 0; i < headerRows.length; ++i) { + const match2 = headerRows[i].match(headerReg); + if (match2) { + return parseInt(match2[1], 10); + } + } + throw new Error("Unknown file format"); + } + function readHeader(iter) { + const headerRows = []; + for (const entry of iter) { + const line = entry.trim(); + headerRows.push(line); + if (line === DATA || line === DATA2) { + break; } - for await (const chunk of stdin) { - result.push(chunk); - length += chunk.length; + } + return headerRows; + } + const headerLines = readHeader(lines); + const version4 = parseHeaderRows(headerLines); + const method = deserializers[version4]; + if (!method) { + throw new Error(`Unsupported version: ${version4}`); + } + return method(lines); +} + +// node_modules/cspell-trie-lib/dist/lib/decodeTrie.js +function decodeTrie(raw) { + const data = decodeTrieData(raw); + return new ITrieImpl(data); +} + +// node_modules/cspell-trie-lib/dist/lib/io/importExportV3.js +var specialCharacters2 = stringToCharSet3([EOW3, BACK, EOL, REF, EOR, ESCAPE, LF, "0123456789", "`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|"].join("")); +var specialPrefix2 = stringToCharSet3("~!"); +function stringToCharSet3(values) { + const set = /* @__PURE__ */ Object.create(null); + const len = values.length; + for (let i = 0; i < len; ++i) { + set[values[i]] = true; + } + return set; +} + +// node_modules/cspell-trie-lib/dist/lib/models/locale/knownLocales.js +var codes = [ + // ['code', 'language'[', ''locale']], + ["af", "Afrikaans"], + ["af-NA", "Afrikaans", "Namibia"], + ["af-ZA", "Afrikaans", "South Africa"], + ["ak", "Akan"], + ["ak-GH", "Akan", "Ghana"], + ["am", "Amharic"], + ["am-ET", "Amharic", "Ethiopia"], + ["ar", "Arabic"], + ["ar-1", "Arabic"], + ["ar-AE", "Arabic", "United Arab Emirates"], + ["ar-BH", "Arabic", "Bahrain"], + ["ar-DJ", "Arabic", "Djibouti"], + ["ar-DZ", "Arabic", "Algeria"], + ["ar-EG", "Arabic", "Egypt"], + ["ar-EH", "Arabic"], + ["ar-ER", "Arabic", "Eritrea"], + ["ar-IL", "Arabic", "Israel"], + ["ar-IQ", "Arabic", "Iraq"], + ["ar-JO", "Arabic", "Jordan"], + ["ar-KM", "Arabic", "Comoros"], + ["ar-KW", "Arabic", "Kuwait"], + ["ar-LB", "Arabic", "Lebanon"], + ["ar-LY", "Arabic", "Libya"], + ["ar-MA", "Arabic", "Morocco"], + ["ar-MR", "Arabic", "Mauritania"], + ["ar-OM", "Arabic", "Oman"], + ["ar-PS", "Arabic"], + ["ar-QA", "Arabic", "Qatar"], + ["ar-SA", "Arabic", "Saudi Arabia"], + ["ar-SD", "Arabic", "Sudan"], + ["ar-SO", "Arabic", "Somalia"], + ["ar-SS", "Arabic"], + ["ar-SY", "Arabic", "Syria"], + ["ar-TD", "Arabic", "Chad"], + ["ar-TN", "Arabic", "Tunisia"], + ["ar-YE", "Arabic", "Yemen"], + ["as", "Assamese"], + ["as-IN", "Assamese", "India"], + ["az", "Azerbaijani"], + ["az-AZ", "Azerbaijani", "Azerbaijan"], + ["be", "Belarusian"], + ["be-BY", "Belarusian", "Belarus"], + ["bg", "Bulgarian"], + ["bg-BG", "Bulgarian", "Bulgaria"], + ["bm", "Bambara"], + ["bm-ML", "Bambara", "Mali"], + ["bn", "Bengali"], + ["bn-BD", "Bengali", "Bangladesh"], + ["bn-IN", "Bengali", "India"], + ["bo", "Tibetan"], + ["bo-CN", "Tibetan", "China"], + ["bo-IN", "Tibetan", "India"], + ["br", "Breton"], + ["br-FR", "Breton", "France"], + ["bs", "Bosnian"], + ["bs-BA", "Bosnian", "Bosnia and Herzegovina"], + ["ca", "Catalan"], + ["ca-AD", "Catalan", "Andorra"], + ["ca-ES", "Catalan", "Spain"], + ["ca-FR", "Catalan", "France"], + ["ca-IT", "Catalan", "Italy"], + ["ce", "Chechen"], + ["ce-RU", "Chechen", "Russia"], + ["cs", "Czech"], + ["cs-CZ", "Czech", "Czech Republic"], + ["cu", "Old Slavonic"], + ["cu-RU", "Old Slavonic", "Russia"], + ["cy", "Welsh"], + ["cy-GB", "Welsh", "United Kingdom"], + ["da", "Danish"], + ["da-DK", "Danish", "Denmark"], + ["da-GL", "Danish", "Greenland"], + ["de", "German"], + ["de-AT", "German", "Austria"], + ["de-BE", "German", "Belgium"], + ["de-CH", "German", "Switzerland"], + ["de-DE", "German", "Germany"], + ["de-IT", "German", "Italy"], + ["de-LI", "German", "Liechtenstein"], + ["de-LU", "German", "Luxembourg"], + ["dz", "Dzongkha"], + ["dz-BT", "Dzongkha", "Bhutan"], + ["ee", "Ewe"], + ["ee-GH", "Ewe", "Ghana"], + ["ee-TG", "Ewe", "Togo"], + ["el", "Greek", "Modern (1453-)"], + ["el-CY", "Greek", "Cyprus"], + ["el-GR", "Greek", "Greece"], + ["en", "English"], + ["en-AG", "English", "Antigua and Barbuda"], + ["en-AI", "English", "Anguilla"], + ["en-AS", "English", "American Samoa"], + ["en-AT", "English", "Austria"], + ["en-AU", "English", "Australia"], + ["en-BB", "English", "Barbados"], + ["en-BE", "English", "Belgium"], + ["en-BI", "English", "Burundi"], + ["en-BM", "English", "Bermuda"], + ["en-BS", "English", "Bahamas"], + ["en-BW", "English", "Botswana"], + ["en-BZ", "English", "Belize"], + ["en-CA", "English", "Canada"], + ["en-CC", "English", "Cocos (Keeling) Islands"], + ["en-CH", "English", "Switzerland"], + ["en-CK", "English", "Cook Islands"], + ["en-CM", "English", "Cameroon"], + ["en-CX", "English", "Christmas Island"], + ["en-CY", "English", "Cyprus"], + ["en-DE", "English", "Germany"], + ["en-DG", "English"], + ["en-DK", "English", "Denmark"], + ["en-DM", "English", "Dominica"], + ["en-ER", "English", "Eritrea"], + ["en-FI", "English", "Finland"], + ["en-FJ", "English", "Fiji"], + ["en-FK", "English", "Falkland Islands (Islas Malvinas)"], + ["en-FM", "English", "Micronesia"], + ["en-GB", "English", "United Kingdom"], + ["en-GD", "English", "Grenada"], + ["en-GG", "English", "Guernsey"], + ["en-GH", "English", "Ghana"], + ["en-GI", "English", "Gibraltar"], + ["en-GM", "English", "Gambia"], + ["en-GU", "English", "Guam"], + ["en-GY", "English", "Guyana"], + ["en-HK", "English", "Hong Kong"], + ["en-IE", "English", "Ireland"], + ["en-IL", "English", "Israel"], + ["en-IM", "English", "Isle of Man"], + ["en-IN", "English", "India"], + ["en-IO", "English", "British Indian Ocean Territory"], + ["en-JE", "English", "Jersey"], + ["en-JM", "English", "Jamaica"], + ["en-KE", "English", "Kenya"], + ["en-KI", "English", "Kiribati"], + ["en-KN", "English", "Saint Kitts and Nevis"], + ["en-KY", "English", "Cayman Islands"], + ["en-LC", "English", "Saint Lucia"], + ["en-LR", "English", "Liberia"], + ["en-LS", "English", "Lesotho"], + ["en-MG", "English", "Madagascar"], + ["en-MH", "English", "Marshall Islands"], + ["en-MO", "English", "Macau"], + ["en-MP", "English", "Northern Mariana Islands"], + ["en-MS", "English", "Montserrat"], + ["en-MT", "English", "Malta"], + ["en-MU", "English", "Mauritius"], + ["en-MW", "English", "Malawi"], + ["en-MY", "English", "Malaysia"], + ["en-NA", "English", "Namibia"], + ["en-NF", "English", "Norfolk Island"], + ["en-NG", "English", "Nigeria"], + ["en-NL", "English", "Netherlands"], + ["en-NR", "English", "Nauru"], + ["en-NU", "English", "Niue"], + ["en-NZ", "English", "New Zealand"], + ["en-PG", "English", "Papua New Guinea"], + ["en-PH", "English", "Philippines"], + ["en-PK", "English", "Pakistan"], + ["en-PN", "English", "Pitcairn Islands"], + ["en-PR", "English", "Puerto Rico"], + ["en-PW", "English", "Palau"], + ["en-RW", "English", "Rwanda"], + ["en-SB", "English", "Solomon Islands"], + ["en-SC", "English", "Seychelles"], + ["en-SD", "English", "Sudan"], + ["en-SE", "English", "Sweden"], + ["en-SG", "English", "Singapore"], + ["en-SH", "English", "Saint Helena"], + ["en-SI", "English", "Slovenia"], + ["en-SL", "English", "Sierra Leone"], + ["en-SS", "English"], + ["en-SX", "English"], + ["en-SZ", "English", "Swaziland"], + ["en-TC", "English", "Turks and Caicos Islands"], + ["en-TK", "English", "Tokelau"], + ["en-TO", "English", "Tonga"], + ["en-TT", "English", "Trinidad and Tobago"], + ["en-TV", "English", "Tuvalu"], + ["en-TZ", "English", "Tanzania"], + ["en-UG", "English", "Uganda"], + ["en-UM", "English", "Baker Island"], + ["en-US", "English", "United States"], + ["en-VC", "English", "Saint Vincent and the Grenadines"], + ["en-VG", "English", "British Virgin Islands"], + ["en-VI", "English", "U.S. Virgin Islands"], + ["en-VU", "English", "Vanuatu"], + ["en-WS", "English", "Samoa"], + ["en-ZA", "English", "South Africa"], + ["en-ZM", "English", "Zambia"], + ["en-ZW", "English", "Zimbabwe"], + ["eo", "Esperanto"], + ["es", "Spanish"], + ["es-AR", "Spanish", "Argentina"], + ["es-BO", "Spanish", "Bolivia"], + ["es-BR", "Spanish", "Brazil"], + ["es-BZ", "Spanish", "Belize"], + ["es-CL", "Spanish", "Chile"], + ["es-CO", "Spanish", "Colombia"], + ["es-CR", "Spanish", "Costa Rica"], + ["es-CU", "Spanish", "Cuba"], + ["es-DO", "Spanish", "Dominican Republic"], + ["es-EA", "Spanish"], + ["es-EC", "Spanish", "Ecuador"], + ["es-ES", "Spanish", "Spain"], + ["es-GQ", "Spanish", "Equatorial Guinea"], + ["es-GT", "Spanish", "Guatemala"], + ["es-HN", "Spanish", "Honduras"], + ["es-IC", "Spanish"], + ["es-MX", "Spanish", "Mexico"], + ["es-NI", "Spanish", "Nicaragua"], + ["es-PA", "Spanish", "Panama"], + ["es-PE", "Spanish", "Peru"], + ["es-PH", "Spanish", "Philippines"], + ["es-PR", "Spanish", "Puerto Rico"], + ["es-PY", "Spanish", "Paraguay"], + ["es-SV", "Spanish", "El Salvador"], + ["es-US", "Spanish", "United States"], + ["es-UY", "Spanish", "Uruguay"], + ["es-VE", "Spanish", "Venezuela"], + ["et", "Estonian"], + ["et-EE", "Estonian", "Estonia"], + ["eu", "Basque"], + ["eu-ES", "Basque", "Spain"], + ["fa", "Persian"], + ["fa-AF", "Persian", "Afghanistan"], + ["fa-IR", "Persian", "Iran"], + ["ff", "Fulah"], + ["ff-CM", "Fulah", "Cameroon"], + ["ff-GN", "Fulah", "Guinea"], + ["ff-MR", "Fulah", "Mauritania"], + ["ff-SN", "Fulah", "Senegal"], + ["fi", "Finnish"], + ["fi-FI", "Finnish", "Finland"], + ["fo", "Faroese"], + ["fo-DK", "Faroese", "Denmark"], + ["fo-FO", "Faroese", "Faroe Islands"], + ["fr", "French"], + ["fr-BE", "French", "Belgium"], + ["fr-BF", "French", "Burkina Faso"], + ["fr-BI", "French", "Burundi"], + ["fr-BJ", "French", "Benin"], + ["fr-BL", "French"], + ["fr-CA", "French", "Canada"], + ["fr-CD", "French", "Congo"], + ["fr-CF", "French", "Central African Republic"], + ["fr-CG", "French", "Congo"], + ["fr-CH", "French", "Switzerland"], + ["fr-CI", "French, Cote d'Ivoire (Ivory Coast)"], + ["fr-CM", "French", "Cameroon"], + ["fr-DJ", "French", "Djibouti"], + ["fr-DZ", "French", "Algeria"], + ["fr-FR", "French", "France"], + ["fr-GA", "French", "Gabon"], + ["fr-GF", "French", "French Guiana"], + ["fr-GN", "French", "Guinea"], + ["fr-GP", "French", "Saint Barthelemy"], + ["fr-GQ", "French", "Equatorial Guinea"], + ["fr-HT", "French", "Haiti"], + ["fr-KM", "French", "Comoros"], + ["fr-LU", "French", "Luxembourg"], + ["fr-MA", "French", "Morocco"], + ["fr-MC", "French", "Monaco"], + ["fr-MF", "French"], + ["fr-MG", "French", "Madagascar"], + ["fr-ML", "French", "Mali"], + ["fr-MQ", "French", "Martinique"], + ["fr-MR", "French", "Mauritania"], + ["fr-MU", "French", "Mauritius"], + ["fr-NC", "French", "New Caledonia"], + ["fr-NE", "French", "Niger"], + ["fr-PF", "French", "French Polynesia"], + ["fr-PM", "French", "Saint Pierre and Miquelon"], + ["fr-RE", "French", "Reunion"], + ["fr-RW", "French", "Rwanda"], + ["fr-SC", "French", "Seychelles"], + ["fr-SN", "French", "Senegal"], + ["fr-SY", "French", "Syria"], + ["fr-TD", "French", "Chad"], + ["fr-TG", "French", "Togo"], + ["fr-TN", "French", "Tunisia"], + ["fr-VU", "French", "Vanuatu"], + ["fr-WF", "French", "Wallis and Futuna"], + ["fr-YT", "French", "Mayotte"], + ["fy", "Western Frisian"], + ["fy-NL", "Western Frisian", "Netherlands"], + ["ga", "Irish"], + ["ga-IE", "Irish", "Ireland"], + ["gd", "Gaelic"], + ["gd-GB", "Gaelic", "United Kingdom"], + ["gl", "Galician"], + ["gl-ES", "Galician", "Spain"], + ["gu", "Gujarati"], + ["gu-IN", "Gujarati", "India"], + ["gv", "Manx"], + ["gv-IM", "Manx", "Isle of Man"], + ["ha", "Hausa"], + ["ha-GH", "Hausa", "Ghana"], + ["ha-NE", "Hausa", "Niger"], + ["ha-NG", "Hausa", "Nigeria"], + ["he", "Hebrew"], + ["he-IL", "Hebrew", "Israel"], + ["hi", "Hindi"], + ["hi-IN", "Hindi", "India"], + ["hr", "Croatian"], + ["hr-BA", "Croatian", "Bosnia and Herzegovina"], + ["hr-HR", "Croatian", "Croatia"], + ["hu", "Hungarian"], + ["hu-HU", "Hungarian", "Hungary"], + ["hy", "Armenian"], + ["hy-AM", "Armenian", "Armenia"], + ["id", "Indonesian"], + ["id-ID", "Indonesian", "Indonesia"], + ["ig", "Igbo"], + ["ig-NG", "Igbo", "Nigeria"], + ["ii", "Sichuan Yi"], + ["ii-CN", "Sichuan Yi", "China"], + ["is", "Icelandic"], + ["is-IS", "Icelandic", "Iceland"], + ["it", "Italian"], + ["it-CH", "Italian", "Switzerland"], + ["it-IT", "Italian", "Italy"], + ["it-SM", "Italian", "San Marino"], + ["it-VA", "Italian", "Vatican City"], + ["ja", "Japanese"], + ["ja-JP", "Japanese", "Japan"], + ["ka", "Georgian"], + ["ka-GE", "Georgian", "Georgia"], + ["ki", "Kikuyu"], + ["ki-KE", "Kikuyu", "Kenya"], + ["kk", "Kazakh"], + ["kk-KZ", "Kazakh", "Kazakhstan"], + ["kl", "Kalaallisut"], + ["kl-GL", "Kalaallisut", "Greenland"], + ["km", "Central Khmer"], + ["km-KH", "Central Khmer", "Cambodia"], + ["kn", "Kannada"], + ["kn-IN", "Kannada", "India"], + ["ko", "Korean"], + ["ko-KP", "Korean", "Korea"], + ["ko-KR", "Korean", "Korea"], + ["ks", "Kashmiri"], + ["ks-IN", "Kashmiri", "India"], + ["kw", "Cornish"], + ["kw-GB", "Cornish", "United Kingdom"], + ["ky", "Kirghiz"], + ["ky-KG", "Kirghiz", "Kyrgyzstan"], + ["lb", "Luxembourgish"], + ["lb-LU", "Luxembourgish", "Luxembourg"], + ["lg", "Ganda"], + ["lg-UG", "Ganda", "Uganda"], + ["ln", "Lingala"], + ["ln-AO", "Lingala", "Angola"], + ["ln-CD", "Lingala", "Congo"], + ["ln-CF", "Lingala", "Central African Republic"], + ["ln-CG", "Lingala", "Congo"], + ["lo", "Lao"], + ["lo-LA", "Lao", "Laos"], + ["lt", "Lithuanian"], + ["lt-LT", "Lithuanian", "Lithuania"], + ["lu", "Luba-Katanga"], + ["lu-CD", "Luba-Katanga", "Congo"], + ["lv", "Latvian"], + ["lv-LV", "Latvian", "Latvia"], + ["mg", "Malagasy"], + ["mg-MG", "Malagasy", "Madagascar"], + ["mk", "Macedonian"], + ["mk-MK", "Macedonian", "Macedonia"], + ["ml", "Malayalam"], + ["ml-IN", "Malayalam", "India"], + ["mn", "Mongolian"], + ["mn-MN", "Mongolian", "Mongolia"], + ["mr", "Marathi"], + ["mr-IN", "Marathi", "India"], + ["ms", "Malay"], + ["ms-BN", "Malay", "Brunei"], + ["ms-MY", "Malay", "Malaysia"], + ["ms-SG", "Malay", "Singapore"], + ["mt", "Maltese"], + ["mt-MT", "Maltese", "Malta"], + ["my", "Burmese"], + ["my-MM", "Burmese", "Myanmar (Burma)"], + ["nb", "Bokm\xE5l Norwegian"], + ["nb-NO", "Bokm\xE5l Norwegian", "Norway"], + ["nb-SJ", "Bokm\xE5l Norwegian", "Svalbard"], + ["nd", "Ndebele, North"], + ["nd-ZW", "Ndebele, North", "Zimbabwe"], + ["ne", "Nepali"], + ["ne-IN", "Nepali", "India"], + ["ne-NP", "Nepali", "Nepal"], + ["nl", "Dutch"], + ["nl-AW", "Dutch", "Aruba"], + ["nl-BE", "Dutch", "Belgium"], + ["nl-BQ", "Dutch"], + ["nl-CW", "Dutch"], + ["nl-NL", "Dutch", "Netherlands"], + ["nl-SR", "Dutch", "Suriname"], + ["nl-SX", "Dutch"], + ["nn", "Norwegian Nynorsk"], + ["nn-NO", "Norwegian Nynorsk", "Norway"], + ["om", "Oromo"], + ["om-ET", "Oromo", "Ethiopia"], + ["om-KE", "Oromo", "Kenya"], + ["or", "Oriya"], + ["or-IN", "Oriya", "India"], + ["os", "Ossetian"], + ["os-GE", "Ossetian", "Georgia"], + ["os-RU", "Ossetian", "Russia"], + ["pa", "Panjabi"], + ["pa-IN", "Panjabi", "India"], + ["pa-PK", "Panjabi", "Pakistan"], + ["pl", "Polish"], + ["pl-PL", "Polish", "Poland"], + ["ps", "Pushto"], + ["ps-AF", "Pushto", "Afghanistan"], + ["pt", "Portuguese"], + ["pt-AO", "Portuguese", "Angola"], + ["pt-BR", "Portuguese", "Brazil"], + ["pt-CH", "Portuguese", "Switzerland"], + ["pt-CV", "Portuguese", "Cape Verde"], + ["pt-GQ", "Portuguese", "Equatorial Guinea"], + ["pt-GW", "Portuguese", "Guinea-Bissau"], + ["pt-LU", "Portuguese", "Luxembourg"], + ["pt-MO", "Portuguese", "Macau"], + ["pt-MZ", "Portuguese", "Mozambique"], + ["pt-PT", "Portuguese", "Portugal"], + ["pt-ST", "Portuguese", "Sao Tome and Principe"], + ["pt-TL", "Portuguese", "Timor-Leste (East Timor)"], + ["qu", "Quechua"], + ["qu-BO", "Quechua", "Bolivia"], + ["qu-EC", "Quechua", "Ecuador"], + ["qu-PE", "Quechua", "Peru"], + ["rm", "Romansh"], + ["rm-CH", "Romansh", "Switzerland"], + ["rn", "Rundi"], + ["rn-BI", "Rundi", "Burundi"], + ["ro", "Romanian"], + ["ro-MD", "Romanian", "Moldova"], + ["ro-RO", "Romanian", "Romania"], + ["ru", "Russian"], + ["ru-BY", "Russian", "Belarus"], + ["ru-KG", "Russian", "Kyrgyzstan"], + ["ru-KZ", "Russian", "Kazakhstan"], + ["ru-MD", "Russian", "Moldova"], + ["ru-RU", "Russian", "Russia"], + ["ru-UA", "Russian", "Ukraine"], + ["rw", "Kinyarwanda"], + ["rw-RW", "Kinyarwanda", "Rwanda"], + ["se", "Northern Sami"], + ["se-FI", "Northern Sami", "Finland"], + ["se-NO", "Northern Sami", "Norway"], + ["se-SE", "Northern Sami", "Sweden"], + ["sg", "Sango"], + ["sg-CF", "Sango", "Central African Republic"], + ["si", "Sinhala"], + ["si-LK", "Sinhala", "Sri Lanka"], + ["sk", "Slovak"], + ["sk-SK", "Slovak", "Slovakia"], + ["sl", "Slovenian"], + ["sl-SI", "Slovenian", "Slovenia"], + ["sn", "Shona"], + ["sn-ZW", "Shona", "Zimbabwe"], + ["so", "Somali"], + ["so-DJ", "Somali", "Djibouti"], + ["so-ET", "Somali", "Ethiopia"], + ["so-KE", "Somali", "Kenya"], + ["so-SO", "Somali", "Somalia"], + ["sq", "Albanian"], + ["sq-AL", "Albanian", "Albania"], + ["sq-MK", "Albanian", "Macedonia"], + ["sq-XK", "Albanian"], + ["sr", "Serbian"], + ["sr-BA", "Serbian", "Bosnia and Herzegovina"], + ["sr-ME", "Serbian", "Montenegro"], + ["sr-RS", "Serbian", "Serbia"], + ["sr-XK", "Serbian"], + ["sv", "Swedish"], + ["sv-AX", "Swedish", "Aland"], + ["sv-FI", "Swedish", "Finland"], + ["sv-SE", "Swedish", "Sweden"], + ["sw", "Swahili"], + ["sw-CD", "Swahili", "Congo"], + ["sw-KE", "Swahili", "Kenya"], + ["sw-TZ", "Swahili", "Tanzania"], + ["sw-UG", "Swahili", "Uganda"], + ["ta", "Tamil"], + ["ta-IN", "Tamil", "India"], + ["ta-LK", "Tamil", "Sri Lanka"], + ["ta-MY", "Tamil", "Malaysia"], + ["ta-SG", "Tamil", "Singapore"], + ["te", "Telugu"], + ["te-IN", "Telugu", "India"], + ["th", "Thai"], + ["th-TH", "Thai", "Thailand"], + ["ti", "Tigrinya"], + ["ti-ER", "Tigrinya", "Eritrea"], + ["ti-ET", "Tigrinya", "Ethiopia"], + ["tk", "Turkmen"], + ["tk-TM", "Turkmen", "Turkmenistan"], + ["to", "Tonga (Tonga Islands)"], + ["to-TO", "Tonga (Tonga Islands)", "Tonga"], + ["tr", "Turkish"], + ["tr-CY", "Turkish", "Cyprus"], + ["tr-TR", "Turkish", "Turkey"], + ["ug", "Uighur"], + ["ug-CN", "Uighur", "China"], + ["uk", "Ukrainian"], + ["uk-UA", "Ukrainian", "Ukraine"], + ["ur", "Urdu"], + ["ur-IN", "Urdu", "India"], + ["ur-PK", "Urdu", "Pakistan"], + ["uz", "Uzbek"], + ["uz-AF", "Uzbek", "Afghanistan"], + ["uz-UZ", "Uzbek", "Uzbekistan"], + ["vi", "Vietnamese"], + ["vi-VN", "Vietnamese", "Vietnam"], + ["vo", "Volap\xFCk"], + ["yi", "Yiddish"], + ["yi-1", "Yiddish"], + ["yo", "Yoruba"], + ["yo-BJ", "Yoruba", "Benin"], + ["yo-NG", "Yoruba", "Nigeria"], + ["zh", "Chinese"], + ["zh-CN", "Chinese", "China"], + ["zh-HK", "Chinese", "Hong Kong"], + ["zh-MO", "Chinese", "Macau"], + ["zh-SG", "Chinese", "Singapore"], + ["zh-TW", "Chinese", "China"], + ["zu", "Zulu"], + ["zu-ZA", "Zulu", "South Africa"] +]; + +// node_modules/cspell-trie-lib/dist/lib/models/locale/locale.js +var codesByLocale; +var Locale = class { + constructor(locale) { + this._raw = locale; + this._locale = normalizeLocale(locale); + } + get locale() { + return this._locale; + } + localInfo() { + return lookupLocaleInfo(this._locale); + } + isValid() { + return isStandardLocale(this._locale); + } + toJSON() { + return this.locale; + } + toString() { + return this.locale; + } +}; +var regExTwoLetter = /^[a-z]{2}$/i; +var regExLocaleWithCountry = /^([a-z]{2})[_-]?([a-z]{2,3})$/i; +var regExValidLocale = /^([a-z]{2})(?:-([A-Z]{2,3}))?$/; +function normalizeLocale(locale) { + locale = locale.trim(); + if (regExTwoLetter.test(locale)) + return locale.toLowerCase(); + const m = locale.match(regExLocaleWithCountry); + if (!m) + return locale; + const lang = m[1].toLowerCase(); + const variant = m[2].toUpperCase(); + return `${lang}-${variant}`; +} +function isStandardLocale(locale) { + return regExValidLocale.test(locale); +} +function lookupLocaleInfo(locale) { + codesByLocale = codesByLocale || buildLocaleLookup(); + return codesByLocale.get(locale); +} +function buildLocaleLookup() { + const info3 = codes.map(([locale, language, country]) => ({ locale, language, country })); + return new Map(info3.map((i) => [i.locale, i])); +} +function createLocale(locale) { + return new Locale(locale); +} +function parseLocale(locales) { + locales = typeof locales === "string" ? locales.split(",") : locales; + return locales.map(createLocale); +} + +// node_modules/cspell-trie-lib/dist/lib/mappers/mapCosts.js +var defaultEditCosts = { + accentCosts: 1, + baseCost: 100, + capsCosts: 1, + firstLetterPenalty: 4, + nonAlphabetCosts: 110 +}; +var defaultHunspellCosts = { + ...defaultEditCosts, + ioConvertCost: 30, + keyboardCost: 99, + mapCost: 25, + replaceCosts: 75, + tryCharCost: 100 +}; +function mapHunspellCosts(costs = {}) { + return { ...defaultHunspellCosts, ...cleanCopy(costs) }; +} +function mapEditCosts(costs = {}) { + return { ...defaultEditCosts, ...cleanCopy(costs) }; +} + +// node_modules/cspell-trie-lib/dist/lib/utils/text.js +function expandCharacterSet(line, rangeChar = "-") { + const charSet = /* @__PURE__ */ new Set(); + let mode = 0; + let prev = ""; + for (const char of line) { + if (mode) { + expandRange(prev, char).forEach((a) => charSet.add(a)); + mode = 0; + } + if (char === rangeChar) { + if (prev) { + mode = 1; + continue; } - return Buffer.concat(result, length); - }; + } + charSet.add(char); + prev = char; } -}); + if (mode) + charSet.add(rangeChar); + return charSet; +} +function expandRange(a, b) { + const values = []; + const end = b.codePointAt(0); + const begin = a.codePointAt(0); + if (!(begin && end)) + return values; + for (let i = begin; i <= end; ++i) { + values.push(String.fromCodePoint(i)); + } + return values; +} +function caseForms(letter, locale) { + const forms2 = /* @__PURE__ */ new Set([letter]); + function tryCases(s) { + forms2.add(s.toLocaleLowerCase(locale)); + forms2.add(s.toLocaleUpperCase(locale)); + } + tryCases(letter); + [...forms2].forEach(tryCases); + return [...forms2].filter((a) => !!a); +} +function accentForms(letter) { + const forms2 = /* @__PURE__ */ new Set([letter, letter.normalize("NFC"), letter.normalize("NFD")]); + return forms2; +} +function stripAccents(characters) { + return characters.normalize("NFD").replace(/\p{M}/gu, ""); +} +function stripNonAccents(characters) { + return characters.normalize("NFD").replace(/[^\p{M}]/gu, ""); +} -// node_modules/fast-glob/out/utils/array.js -var require_array2 = __commonJS({ - "node_modules/fast-glob/out/utils/array.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.splitWhen = exports.flatten = void 0; - function flatten(items) { - return items.reduce((collection, item) => [].concat(collection, item), []); +// node_modules/cspell-trie-lib/dist/lib/mappers/joinLetters.js +function joinLetters(letters) { + const v = [...letters]; + return v.map((a) => a.length > 1 || !a.length ? `(${a})` : a).join(""); +} + +// node_modules/cspell-trie-lib/dist/lib/mappers/mapToSuggestionCostDef.js +function parseAlphabet(cs, locale, editCost) { + const { cost, penalty } = cs; + const characters = expandCharacterSet(cs.characters); + const charForms = [ + ...pipeSync(characters, opMapSync((c) => caseForms(c, locale).sort())) + ]; + const alphabet = joinLetters([ + ...pipeSync(charForms, opFlattenSync(), opMapSync((letter) => accentForms(letter)), opFlattenSync(), opUniqueSync()) + ].sort()); + const sugAlpha = clean2({ + map: alphabet, + replace: cost, + insDel: cost, + swap: cost, + penalty + }); + return [ + sugAlpha, + parseAlphabetCaps(cs.characters, locale, editCost), + ...calcCostsForAccentedLetters(alphabet, locale, editCost) + ]; +} +function parseAlphabetCaps(alphabet, locale, editCost) { + const characters = expandCharacterSet(alphabet); + const charForms = [ + ...pipeSync(characters, opMapSync((c) => caseForms(c, locale).sort())) + ]; + const caps = charForms.map((a) => joinLetters(a)).join("|"); + const sugCaps = { + map: caps, + replace: editCost.capsCosts + }; + return sugCaps; +} +function calcFirstCharacterReplaceDefs(alphabets, editCost) { + return alphabets.map((cs) => calcFirstCharacterReplace(cs, editCost)); +} +function calcFirstCharacterReplace(cs, editCost) { + const mapOfFirstLetters = [ + ...pipeSync(expandCharacterSet(cs.characters), opUniqueSync(), opMapSync((letter) => `(^${letter})`)) + ].sort().join("") + "(^)"; + const penalty = editCost.firstLetterPenalty; + const cost = cs.cost - penalty; + return { + map: mapOfFirstLetters, + replace: cost, + penalty: penalty * 2 + }; +} +function parseAccents(cs, _editCost) { + const { cost, penalty } = cs; + const accents = joinLetters([ + ...pipeSync(expandCharacterSet(cs.characters), opMapSync((char) => stripNonAccents(char))) + ]); + if (!accents) + return void 0; + return clean2({ + map: accents, + replace: cost, + insDel: cost, + penalty + }); +} +function calcCostsForAccentedLetters(simpleMap, locale, costs) { + const charactersWithAccents = [ + ...pipeSync(splitMap2(simpleMap), opMapSync((char) => caseForms(char, locale)), opFlattenSync(), opMapSync((char) => [...accentForms(char)]), opFilterSync((forms2) => forms2.length > 1)) + ]; + const characters = pipeSync(charactersWithAccents, opMapSync((forms2) => /* @__PURE__ */ new Set([...forms2, ...forms2.map((char) => stripAccents(char))])), opMapSync((forms2) => [...forms2].sort()), opFilterSync((forms2) => forms2.length > 1), opMapSync(joinLetters), opUniqueSync()); + const replaceAccentMap = [...characters].join("|"); + const cost = costs.accentCosts; + const costToReplaceAccent = !replaceAccentMap ? [] : [{ map: replaceAccentMap, replace: cost }]; + const normalizeMap2 = charactersWithAccents.map((a) => a.sort()).map(joinLetters).join("|"); + const costToNormalizeAccent = !normalizeMap2 ? [] : [{ map: normalizeMap2, replace: 0 }]; + return [...costToReplaceAccent, ...costToNormalizeAccent]; +} +function* splitMap2(map3) { + let seq = ""; + let mode = 0; + for (const char of map3) { + if (mode && char === ")") { + yield seq; + mode = 0; + continue; } - exports.flatten = flatten; - function splitWhen(items, predicate) { - const result = [[]]; - let groupIndex = 0; - for (const item of items) { - if (predicate(item)) { - groupIndex++; - result[groupIndex] = []; - } else { - result[groupIndex].push(item); - } - } - return result; + if (mode) { + seq += char; + continue; } - exports.splitWhen = splitWhen; + if (char === "(") { + mode = 1; + seq = ""; + continue; + } + yield char; } -}); +} -// node_modules/fast-glob/out/utils/errno.js -var require_errno = __commonJS({ - "node_modules/fast-glob/out/utils/errno.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isEnoentCodeError = void 0; - function isEnoentCodeError(error2) { - return error2.code === "ENOENT"; - } - exports.isEnoentCodeError = isEnoentCodeError; +// node_modules/cspell-trie-lib/dist/lib/mappers/mapHunspellInformation.js +function hunspellInformationToSuggestionCostDef(hunInfo, locales) { + const costs = calcCosts(hunInfo.costs, locales); + const operations = [ + affKey, + affKeyCaps, + affMap, + affMapAccents, + affMapCaps, + affNoTry, + affRepConv, + affTry, + affTryAccents, + affTryFirstCharacterReplace + ]; + function parseAff(aff, costs2) { + const regSupportedAff = /^(?:MAP|KEY|TRY|NO-TRY|ICONV|OCONV|REP)\s/; + const rejectAff = /^(?:MAP|KEY|TRY|ICONV|OCONV|REP)\s+\d+$/; + const lines = aff.split("\n").map((a) => a.replace(/#.*/, "")).map((a) => a.trim()).filter((a) => regSupportedAff.test(a)).filter((a) => !rejectAff.test(a)); + const defs = pipeSync(lines, opMapSync((line) => pipeSync(operations, opMapSync((fn) => fn(line, costs2)), opMapSync(asArrayOf), opFlattenSync())), opFlattenSync(), opFilterSync(isDefined3)); + return [...defs]; + } + return parseAff(hunInfo.aff, costs); +} +function calcCosts(costs = {}, locale) { + const useLocale = locale?.length ? locale.map((loc) => loc.locale) : void 0; + const hunCosts = mapHunspellCosts(costs); + const c = { + ...hunCosts, + locale: useLocale + }; + return c; +} +var regExpMap = /^(?:MAP)\s+(\S+)$/; +function affMap(line, costs) { + const m = line.match(regExpMap); + if (!m) + return void 0; + const map3 = m[1]; + const cost = costs.mapCost; + return { + map: map3, + replace: cost, + swap: cost + }; +} +var regExpTry = /^(?:TRY)\s+(\S+)$/; +function affTry(line, costs) { + const m = line.match(regExpTry); + if (!m) + return void 0; + const cost = costs.tryCharCost; + const tryChars = m[1]; + const characters = tryChars; + return parseAlphabet({ + characters, + cost + }, costs.locale, costs); +} +function affTryFirstCharacterReplace(line, costs) { + const m = line.match(regExpTry); + if (!m) + return void 0; + const characters = m[1]; + const cost = costs.tryCharCost; + return calcFirstCharacterReplace({ + characters, + cost + }, costs); +} +var regExpNoTry = /^NO-TRY\s+(\S+)$/; +function affNoTry(line, costs) { + const m = line.match(regExpNoTry); + if (!m) + return void 0; + const map3 = m[1]; + return { + map: map3, + insDel: Math.max(costs.nonAlphabetCosts - costs.tryCharCost, 0), + penalty: costs.nonAlphabetCosts + costs.tryCharCost + }; +} +var regExpRepConv = /^(?:REP|(?:I|O)CONV)\s+(\S+)\s+(\S+)$/; +function affRepConv(line, costs) { + const m = line.match(regExpRepConv); + if (!m) + return void 0; + const cost = line.startsWith("REP") ? costs.replaceCosts : costs.ioConvertCost; + const from = m[1]; + let into = m[2]; + into = into.replace(/^0$/, ""); + if (from.startsWith("^") && !into.startsWith("^")) { + into = "^" + into; } -}); + if (from.endsWith("$") && !into.endsWith("$")) { + into = into + "$"; + } + return { + map: joinLetters([from, into]), + replace: cost + }; +} +var regExpKey = /^(?:KEY)\s+(\S+)$/; +function affKey(line, costs) { + const m = line.match(regExpKey); + if (!m) + return void 0; + const kbd = m[1]; + const pairs = [...splitMap2(kbd)].map(reducer((p, v) => ({ a: p.b, b: v }), { a: "|", b: "|" })).filter((ab) => ab.a !== "|" && ab.b !== "|").map(({ a, b }) => joinLetters([a, b])); + const pairsUpper = pairs.map((p) => p.toLocaleUpperCase(costs.locale)); + const map3 = unique(pairs.concat(pairsUpper)).join("|"); + const cost = costs.keyboardCost; + return { + map: map3, + replace: cost, + swap: cost + }; +} +function affKeyCaps(line, costs) { + const m = line.match(regExpKey); + if (!m) + return void 0; + return parseCaps(m[1], costs); +} +function affMapCaps(line, costs) { + const m = line.match(regExpMap); + if (!m) + return void 0; + return parseCaps(m[1], costs); +} +function affTryAccents(line, costs) { + const m = line.match(regExpTry); + if (!m) + return void 0; + return calcCostsForAccentedLetters(m[1], costs.locale, costs); +} +function affMapAccents(line, costs) { + const m = line.match(regExpMap); + if (!m) + return void 0; + return calcCostsForAccentedLetters(m[1], costs.locale, costs); +} +function parseCaps(value, costs) { + const locale = costs.locale; + const letters = [...splitMap2(value)].filter((a) => a !== "|"); + const withCases = letters.map((s) => caseForms(s, locale)).filter((forms2) => forms2.length > 1).map(joinLetters); + const map3 = unique(withCases).join("|"); + const cost = costs.capsCosts; + if (!map3) + return void 0; + return { + map: map3, + replace: cost + }; +} +function reducer(fn, initialVal) { + let acc = initialVal; + return (val, i) => acc = fn(acc, val, i); +} +function asArrayOf(v) { + return Array.isArray(v) ? v : [v]; +} -// node_modules/fast-glob/out/utils/fs.js -var require_fs = __commonJS({ - "node_modules/fast-glob/out/utils/fs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDirentFromStats = void 0; - var DirentFromStats = class { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); +// node_modules/cspell-trie-lib/dist/lib/mappers/mapDictionaryInfo.js +function mapDictionaryInformation(dictInfo) { + const _locale = dictInfo.locale; + const locale = _locale ? parseLocale(_locale).filter((loc) => loc.isValid()) : void 0; + const locales = locale?.map((loc) => loc.locale); + const costs = mapEditCosts(dictInfo.costs); + const defsEC = dictInfo.suggestionEditCosts || []; + const defsHI = dictInfo.hunspellInformation ? hunspellInformationToSuggestionCostDef(dictInfo.hunspellInformation, locale) : []; + return [ + ...defsEC, + ...processAlphabet(dictInfo.alphabet, locales, costs), + ...processAccents(dictInfo.accents, costs), + ...defsHI + ]; +} +function processAlphabet(alphabet, locale, editCost) { + const csAlphabet = toCharSets(alphabet, "a-zA-Z", editCost.baseCost); + return [ + ...pipeSync(csAlphabet, opMapSync((cs) => parseAlphabet(cs, locale, editCost)), opFlattenSync()), + ...calcFirstCharacterReplaceDefs(csAlphabet, editCost) + ]; +} +function toCharSets(cs, defaultValue, cost, penalty) { + cs = cs ?? defaultValue; + if (!cs) + return []; + if (typeof cs === "string") { + cs = [ + { + characters: cs, + cost } - }; - function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); - } - exports.createDirentFromStats = createDirentFromStats; + ]; } -}); + if (penalty !== void 0) { + cs.forEach((cs2) => cs2.penalty = penalty); + } + return cs; +} +function processAccents(accents, editCost) { + const cs = toCharSets(accents, "\u0300-\u0341", editCost.accentCosts); + return cs.map((cs2) => parseAccents(cs2, editCost)).filter(isDefined3); +} +function mapDictionaryInformationToAdjustment(dictInfo) { + if (!dictInfo.adjustments) + return []; + return dictInfo.adjustments.map(mapAdjustment); +} +function mapAdjustment(adj) { + const { id, regexp, penalty } = adj; + return { + id, + regexp: new RegExp(regexp), + penalty + }; +} -// node_modules/fast-glob/out/utils/path.js -var require_path = __commonJS({ - "node_modules/fast-glob/out/utils/path.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; - var os = require("os"); - var path16 = require("path"); - var IS_WINDOWS_PLATFORM = os.platform() === "win32"; - var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; - var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; - var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g; - var DOS_DEVICE_PATH_RE = /^\\\\([.?])/; - var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@{}])/g; - function unixify(filepath) { - return filepath.replace(/\\/g, "/"); - } - exports.unixify = unixify; - function makeAbsolute(cwd, filepath) { - return path16.resolve(cwd, filepath); - } - exports.makeAbsolute = makeAbsolute; - function removeLeadingDotSegment(entry) { - if (entry.charAt(0) === ".") { - const secondCharactery = entry.charAt(1); - if (secondCharactery === "/" || secondCharactery === "\\") { - return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); +// node_modules/cspell-trie-lib/dist/lib/mappers/mapDictionaryInfoToWeightMap.js +var defaultDefs = [ + { + map: "1234567890-.", + insDel: 1, + penalty: 200 + } +]; +var defaultAdjustments = [ + { + id: "compound-case-change", + regexp: /\p{Ll}∙\p{Lu}/gu, + penalty: 1e3 + }, + { + id: "short-compounds-1", + regexp: /^[^∙]{0,2}(?=∙)|∙[^∙]{0,2}(?=∙|$)/gm, + penalty: 100 + }, + { + id: "short-compounds-3", + regexp: /^[^∙]{3}(?=∙)|∙[^∙]{3}(?=∙|$)/gm, + penalty: 50 + } +]; +function mapDictionaryInformationToWeightMap(dictInfo) { + const defs = mapDictionaryInformation(dictInfo).concat(defaultDefs); + const adjustments = mapDictionaryInformationToAdjustment(dictInfo); + const map3 = createWeightMap(...defs); + addAdjustment(map3, ...defaultAdjustments, ...adjustments); + return map3; +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/suggest.js +var baseCost = opCosts.baseCost; +var swapCost = opCosts.swapCost; +var postSwapCost = swapCost - baseCost; +var mapSubCost = opCosts.visuallySimilar; +var maxCostScale = opCosts.wordLengthCostFactor; + +// node_modules/cspell-trie-lib/dist/lib/TrieBuilder.js +var SymbolFrozenNode = Symbol(); + +// node_modules/cspell-trie-lib/dist/lib/utils/normalizeWord.js +var normalizeWord = (text) => text.normalize(); +var normalizeWordForCaseInsensitive = (text) => { + const t = text.toLowerCase(); + return [t, t.normalize("NFD").replace(/\p{M}/gu, "")]; +}; + +// node_modules/cspell-trie-lib/dist/lib/SimpleDictionaryParser.js +var RegExpSplit = /[\s,;]/g; +var _defaultOptions = { + commentCharacter: LINE_COMMENT, + optionalCompoundCharacter: OPTIONAL_COMPOUND_FIX, + compoundCharacter: COMPOUND_FIX, + forbiddenPrefix: FORBID_PREFIX, + caseInsensitivePrefix: CASE_INSENSITIVE_PREFIX, + keepExactPrefix: IDENTITY_PREFIX, + stripCaseAndAccents: true, + stripCaseAndAccentsKeepDuplicate: false, + stripCaseAndAccentsOnForbidden: false, + split: false, + splitKeepBoth: false, + splitSeparator: RegExpSplit +}; +var defaultParseDictionaryOptions = Object.freeze(_defaultOptions); +var cSpellToolDirective = "cspell-dictionary:"; +function createDictionaryLineParserMapper(options) { + const _options = options || _defaultOptions; + const { commentCharacter = _defaultOptions.commentCharacter, optionalCompoundCharacter: optionalCompound = _defaultOptions.optionalCompoundCharacter, compoundCharacter: compound = _defaultOptions.compoundCharacter, caseInsensitivePrefix: ignoreCase2 = _defaultOptions.caseInsensitivePrefix, forbiddenPrefix: forbidden = _defaultOptions.forbiddenPrefix, keepExactPrefix: keepCase = _defaultOptions.keepExactPrefix, splitSeparator = _defaultOptions.splitSeparator, splitKeepBoth = _defaultOptions.splitKeepBoth, stripCaseAndAccentsKeepDuplicate = _defaultOptions.stripCaseAndAccentsKeepDuplicate, stripCaseAndAccentsOnForbidden = _defaultOptions.stripCaseAndAccentsOnForbidden } = _options; + let { stripCaseAndAccents = _defaultOptions.stripCaseAndAccents, split: split2 = _defaultOptions.split } = _options; + function isString3(line) { + return typeof line === "string"; + } + function trim(line) { + return line.trim(); + } + function removeComments(line) { + const idx2 = line.indexOf(commentCharacter); + if (idx2 < 0) + return line; + const idxDirective = line.indexOf(cSpellToolDirective, idx2); + if (idxDirective >= 0) { + const flags = line.slice(idxDirective).split(/[\s,;]/g).map((s) => s.trim()).filter((a) => !!a); + for (const flag of flags) { + switch (flag) { + case "split": + split2 = true; + break; + case "no-split": + split2 = false; + break; + case "no-generate-alternatives": + stripCaseAndAccents = false; + break; + case "generate-alternatives": + stripCaseAndAccents = true; + break; } } - return entry; - } - exports.removeLeadingDotSegment = removeLeadingDotSegment; - exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; - function escapeWindowsPath(pattern) { - return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); - } - exports.escapeWindowsPath = escapeWindowsPath; - function escapePosixPath(pattern) { - return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); } - exports.escapePosixPath = escapePosixPath; - exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; - function convertWindowsPathToPattern(filepath) { - return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/"); + return line.slice(0, idx2).trim(); + } + function filterEmptyLines(line) { + return !!line; + } + function* mapOptionalPrefix(line) { + if (line[0] === optionalCompound) { + const t = line.slice(1); + yield t; + yield compound + t; + } else { + yield line; } - exports.convertWindowsPathToPattern = convertWindowsPathToPattern; - function convertPosixPathToPattern(filepath) { - return escapePosixPath(filepath); + } + function* mapOptionalSuffix(line) { + if (line.slice(-1) === optionalCompound) { + const t = line.slice(0, -1); + yield t; + yield t + compound; + } else { + yield line; } - exports.convertPosixPathToPattern = convertPosixPathToPattern; } -}); - -// node_modules/is-extglob/index.js -var require_is_extglob = __commonJS({ - "node_modules/is-extglob/index.js"(exports, module2) { - module2.exports = function isExtglob(str) { - if (typeof str !== "string" || str === "") { - return false; - } - var match; - while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) { - if (match[2]) - return true; - str = str.slice(match.index + match[0].length); - } - return false; - }; + const doNotNormalizePrefix = /* @__PURE__ */ Object.create(null); + [ignoreCase2, keepCase, '"'].forEach((prefix) => doNotNormalizePrefix[prefix] = true); + if (!stripCaseAndAccentsOnForbidden) { + doNotNormalizePrefix[forbidden] = true; } -}); - -// node_modules/is-glob/index.js -var require_is_glob = __commonJS({ - "node_modules/is-glob/index.js"(exports, module2) { - var isExtglob = require_is_extglob(); - var chars = { "{": "}", "(": ")", "[": "]" }; - var strictCheck = function(str) { - if (str[0] === "!") { - return true; - } - var index = 0; - var pipeIndex = -2; - var closeSquareIndex = -2; - var closeCurlyIndex = -2; - var closeParenIndex = -2; - var backSlashIndex = -2; - while (index < str.length) { - if (str[index] === "*") { - return true; - } - if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) { - return true; - } - if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") { - if (closeSquareIndex < index) { - closeSquareIndex = str.indexOf("]", index); - } - if (closeSquareIndex > index) { - if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { - return true; - } - backSlashIndex = str.indexOf("\\", index); - if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { - return true; - } - } - } - if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") { - closeCurlyIndex = str.indexOf("}", index); - if (closeCurlyIndex > index) { - backSlashIndex = str.indexOf("\\", index); - if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { - return true; - } - } - } - if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") { - closeParenIndex = str.indexOf(")", index); - if (closeParenIndex > index) { - backSlashIndex = str.indexOf("\\", index); - if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { - return true; - } - } - } - if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") { - if (pipeIndex < index) { - pipeIndex = str.indexOf("|", index); - } - if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") { - closeParenIndex = str.indexOf(")", pipeIndex); - if (closeParenIndex > pipeIndex) { - backSlashIndex = str.indexOf("\\", pipeIndex); - if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { - return true; - } - } - } - } - if (str[index] === "\\") { - var open = str[index + 1]; - index += 2; - var close = chars[open]; - if (close) { - var n = str.indexOf(close, index); - if (n !== -1) { - index = n + 1; - } - } - if (str[index] === "!") { - return true; - } - } else { - index++; - } - } - return false; - }; - var relaxedCheck = function(str) { - if (str[0] === "!") { - return true; - } - var index = 0; - while (index < str.length) { - if (/[*?{}()[\]]/.test(str[index])) { - return true; - } - if (str[index] === "\\") { - var open = str[index + 1]; - index += 2; - var close = chars[open]; - if (close) { - var n = str.indexOf(close, index); - if (n !== -1) { - index = n + 1; - } - } - if (str[index] === "!") { - return true; - } - } else { - index++; - } - } - return false; - }; - module2.exports = function isGlob(str, options) { - if (typeof str !== "string" || str === "") { - return false; - } - if (isExtglob(str)) { - return true; - } - var check = strictCheck; - if (options && options.strict === false) { - check = relaxedCheck; - } - return check(str); - }; + function removeDoublePrefix(w) { + return w.startsWith(ignoreCase2 + ignoreCase2) ? w.slice(1) : w; } -}); - -// node_modules/glob-parent/index.js -var require_glob_parent = __commonJS({ - "node_modules/glob-parent/index.js"(exports, module2) { - "use strict"; - var isGlob = require_is_glob(); - var pathPosixDirname = require("path").posix.dirname; - var isWin32 = require("os").platform() === "win32"; - var slash = "/"; - var backslash = /\\/g; - var enclosure = /[\{\[].*[\}\]]$/; - var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; - var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; - module2.exports = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { - str = str.replace(backslash, slash); - } - if (enclosure.test(str)) { - str += slash; - } - str += "a"; - do { - str = pathPosixDirname(str); - } while (isGlob(str) || globby.test(str)); - return str.replace(escaped, "$1"); - }; + function stripKeepCasePrefixAndQuotes(word) { + word = word.replace(/"(.*?)"/g, "$1"); + return word[0] === keepCase ? word.slice(1) : word; } -}); - -// node_modules/fast-glob/out/utils/pattern.js -var require_pattern = __commonJS({ - "node_modules/fast-glob/out/utils/pattern.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; - var path16 = require("path"); - var globParent = require_glob_parent(); - var micromatch = require_micromatch(); - var GLOBSTAR = "**"; - var ESCAPE_SYMBOL = "\\"; - var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; - var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; - var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; - var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; - var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; - var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; - function isStaticPattern(pattern, options = {}) { - return !isDynamicPattern(pattern, options); - } - exports.isStaticPattern = isStaticPattern; - function isDynamicPattern(pattern, options = {}) { - if (pattern === "") { - return false; - } - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true; - } - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { - return true; + function _normalize(word) { + return normalizeWord(stripKeepCasePrefixAndQuotes(word)); + } + function* mapNormalize(word) { + const nWord = _normalize(word); + const forms2 = /* @__PURE__ */ new Set(); + forms2.add(nWord); + if (stripCaseAndAccents && !(word[0] in doNotNormalizePrefix)) { + for (const n of normalizeWordForCaseInsensitive(nWord)) { + (stripCaseAndAccentsKeepDuplicate || n !== nWord) && forms2.add(ignoreCase2 + n); } - return false; } - exports.isDynamicPattern = isDynamicPattern; - function hasBraceExpansion(pattern) { - const openingBraceIndex = pattern.indexOf("{"); - if (openingBraceIndex === -1) { - return false; - } - const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1); - if (closingBraceIndex === -1) { - return false; + yield* forms2; + } + function* splitWords(lines) { + for (const line of lines) { + if (split2) { + const lineEscaped = line.indexOf('"') >= 0 ? line.replace(/".*?"/g, (quoted) => " " + quoted.replace(/(\s)/g, "\\$1") + " ") : line; + const words = splitLine(lineEscaped, splitSeparator); + yield* words.map((escaped) => escaped.replace(/\\/g, "")); + if (!splitKeepBoth) + continue; } - const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); - return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); - } - function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; - } - exports.convertToPositivePattern = convertToPositivePattern; - function convertToNegativePattern(pattern) { - return "!" + pattern; - } - exports.convertToNegativePattern = convertToNegativePattern; - function isNegativePattern(pattern) { - return pattern.startsWith("!") && pattern[1] !== "("; - } - exports.isNegativePattern = isNegativePattern; - function isPositivePattern(pattern) { - return !isNegativePattern(pattern); - } - exports.isPositivePattern = isPositivePattern; - function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); + yield line; } - exports.getNegativePatterns = getNegativePatterns; - function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); + } + function* splitLines(paragraphs) { + for (const paragraph of paragraphs) { + yield* paragraph.split("\n"); } - exports.getPositivePatterns = getPositivePatterns; - function getPatternsInsideCurrentDirectory(patterns) { - return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); + } + const processLines = opCombineSync(opFilterSync(isString3), splitLines, opMapSync(removeComments), splitWords, opMapSync(trim), opFilterSync(filterEmptyLines), opConcatMapSync(mapOptionalPrefix), opConcatMapSync(mapOptionalSuffix), opConcatMapSync(mapNormalize), opMapSync(removeDoublePrefix)); + return processLines; +} +function parseDictionaryLines(lines, options) { + return createDictionaryLineParserMapper(options)(typeof lines === "string" ? [lines] : lines); +} +var RegExpToEncode = /\\([\s,;])/g; +var RegExpDecode = /<<(%[\da-f]{2})>>/gi; +function encodeLine(line) { + return line.replace(RegExpToEncode, (_, v) => "<<" + encodeURIComponent(v) + ">>"); +} +function decodeLine(line) { + return line.replace(RegExpDecode, (_, v) => "\\" + decodeURIComponent(v)); +} +function splitLine(line, regExp) { + return encodeLine(line).split(regExp).map((line2) => decodeLine(line2)); +} + +// node_modules/cspell-lib/dist/esm/Settings/DictionarySettings.mjs +var path3 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/Settings/DictionaryReferenceCollection.mjs +function createDictionaryReferenceCollection(dictionaries) { + return new _DictionaryReferenceCollection(dictionaries); +} +var _DictionaryReferenceCollection = class { + constructor(dictionaries) { + this.dictionaries = dictionaries; + this.collection = collect(dictionaries); + } + isEnabled(name) { + const entry = this.collection[name]; + return entry === void 0 ? void 0 : !!(entry & 1); + } + isBlocked(name) { + const entry = this.collection[name]; + return entry === void 0 ? void 0 : !(entry & 1); + } + enabled() { + return this.dictionaryIds.filter((n) => this.isEnabled(n)); + } + blocked() { + return this.dictionaryIds.filter((n) => this.isBlocked(n)); + } + get dictionaryIds() { + return Object.keys(this.collection); + } +}; +function collect(dictionaries) { + const refs = dictionaries.map(normalizeName).map(mapReference); + const col = {}; + for (const ref of refs) { + col[ref.name] = Math.max(ref.weight, col[ref.name] || 0); + } + return col; +} +function normalizeName(entry) { + return entry.normalize().trim(); +} +function mapReference(ref) { + const name = ref.replace(/^!+/, ""); + const weight = ref.length - name.length + 1; + return { name: name.trim(), weight }; +} + +// node_modules/cspell-lib/dist/esm/Settings/DictionarySettings.mjs +function filterDictDefsToLoad(dictRefCol, defs) { + const allActiveDefs = defs.filter(({ name }) => dictRefCol.isEnabled(name)).map(fixPath); + return [...new Map(allActiveDefs.map((d) => [d.name, d])).values()]; +} +function fixPath(def) { + if (def instanceof _DictionaryDefinitionInternalWithSource) { + return def; + } + const newPath = fixDicPath(def.path, def.file); + return { + ...def, + file: void 0, + path: newPath + }; +} +function fixDicPath(defPath, defFile) { + const parts = [defPath || "", defFile || ""].filter((p) => !!p); + return parts.length > 1 ? path3.join(...parts) : parts[0] || ""; +} +function mapDictDefsToInternal(defs, pathToSettingsFile) { + return defs?.map((def) => mapDictDefToInternal(def, pathToSettingsFile)); +} +var internalDefs = new AutoResolveWeakCache(); +function mapDictDefToInternal(def, pathToSettingsFile) { + return internalDefs.get(def, (def2) => _mapDictDefToInternal(def2, pathToSettingsFile)); +} +function _mapDictDefToInternal(def, pathToSettingsFile) { + if (isDictionaryDefinitionWithSource(def)) { + return def; + } + if (isDictionaryDefinitionInlineInternal(def)) { + return { ...def, __source: pathToSettingsFile }; + } + return new _DictionaryDefinitionInternalWithSource(def, pathToSettingsFile); +} +function determineName(filename, options) { + return options.name || path3.basename(filename); +} +function calcDictionaryDefsToLoad(settings) { + const { dictionaries = [], dictionaryDefinitions = [], noSuggestDictionaries = [] } = settings; + const colNoSug = createDictionaryReferenceCollection(noSuggestDictionaries); + const colDicts = createDictionaryReferenceCollection(dictionaries.concat(colNoSug.enabled())); + const modDefs = dictionaryDefinitions.map((def) => { + const enabled = colNoSug.isEnabled(def.name); + if (enabled === void 0) + return def; + return { ...def, noSuggest: enabled }; + }); + return filterDictDefsToLoad(colDicts, modDefs); +} +function isDictionaryDefinitionWithSource(d) { + return isDictionaryFileDefinitionInternalWithSource(d) || isDictionaryDefinitionInlineInternalWithSource(d); +} +function isDictionaryFileDefinitionInternalWithSource(def) { + return def instanceof _DictionaryDefinitionInternalWithSource; +} +function isDictionaryDefinitionInlineInternalWithSource(def) { + return isDictionaryDefinitionInlineInternal(def) && !!def.__source; +} +var _DictionaryDefinitionInternalWithSource = class { + constructor(def, __source) { + this.__source = __source; + const defAll = def; + const { path: relPath = "", file = "", addWords, description, dictionaryInformation, type, repMap, noSuggest, scope, useCompounds } = defAll; + const defaultPath = path3.dirname(__source); + const filePath = fixDicPath(relPath, file); + const name = determineName(filePath, def); + const r = resolveFile(filePath, defaultPath); + const ddi = { + name, + file: void 0, + path: r.filename, + addWords, + description, + dictionaryInformation, + type, + repMap, + noSuggest, + scope, + useCompounds + }; + Object.assign(this, clean(ddi)); + this.ddi = ddi; + this.name = ddi.name; + this.file = ddi.file; + this.path = ddi.path; + this._weightMap = this.dictionaryInformation ? mapDictionaryInformationToWeightMap(this.dictionaryInformation) : void 0; + } + get weightMap() { + return this._weightMap; + } + toJSON() { + return this.ddi; + } +}; + +// node_modules/cspell-lib/dist/esm/util/textRegex.mjs +var regExUpperSOrIng = /([\p{Lu}\p{M}]+\\?['’]?(?:s|ing|ies|es|ings|ed|ning))(?!\p{Ll})/gu; +var regExSplitWords = /(\p{Ll}\p{M}?)(\p{Lu})/gu; +var regExSplitWords2 = /(\p{Lu}\p{M}?)(\p{Lu}\p{M}?\p{Ll})/gu; +var regExWords = /\p{L}\p{M}?(?:(?:\\?['’])?\p{L}\p{M}?)*/gu; +var regExWordsAndDigits = /[\p{L}\w'’`.+-](?:(?:\\(?=[']))?[\p{L}\p{M}\w'’`.+-])*/gu; +var regExIgnoreCharacters = /[\p{sc=Hiragana}\p{sc=Han}\p{sc=Katakana}\u30A0-\u30FF\p{sc=Hangul}]/gu; +var regExFirstUpper = /^\p{Lu}\p{M}?\p{Ll}+$/u; +var regExAllUpper = /^(?:\p{Lu}\p{M}?)+$/u; +var regExAllLower = /^(?:\p{Ll}\p{M}?)+$/u; +var regExPossibleWordBreaks = /[-+_’'`.\s]/g; +var regExMatchRegExParts = /^\s*\/([\s\S]*?)\/([gimuxy]*)\s*$/; +var regExAccents = /\p{M}/gu; +var regExEscapeCharacters = /(?<=\\)[anrvtbf]/gi; +var regExDanglingQuote = /(?<=(?:^|(?!\p{M})\P{L})(?:\p{L}\p{M}?)?)[']/gu; +var regExTrailingEndings = /(?<=(?:\p{Lu}\p{M}?){2})['’]?(?:s|d|ings?|ies|e[ds]?|ning|th|nth)(?!\p{Ll})/gu; +var regExNumericLiteral = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/; +function stringToRegExp(pattern, defaultFlags = "gimu", forceFlags = "g") { + if (pattern instanceof RegExp) { + return pattern; + } + try { + const [, pat, flag] = [ + ...pattern.match(regExMatchRegExParts) || ["", pattern.trim(), defaultFlags], + forceFlags + ]; + if (pat) { + const regPattern = flag.includes("x") ? removeVerboseFromRegExp(pat) : pat; + const flags = [...new Set(forceFlags + flag)].join("").replace(/[^gimuy]/g, ""); + const regex = new RegExp(regPattern, flags); + return regex; } - exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; - function getPatternsOutsideCurrentDirectory(patterns) { - return patterns.filter(isPatternRelatedToParentDirectory); + } catch (e) { + } + return void 0; +} +var SPACES = { + " ": true, + "\n": true, + "\r": true, + " ": true +}; +function removeVerboseFromRegExp(pattern) { + function escape(acc) { + const char = pattern[acc.idx]; + if (char !== "\\") + return void 0; + const next = pattern[++acc.idx]; + acc.idx++; + if (next === "#") { + acc.result += "#"; + return acc; } - exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; - function isPatternRelatedToParentDirectory(pattern) { - return pattern.startsWith("..") || pattern.startsWith("./.."); + if (!(next in SPACES)) { + acc.result += "\\" + next; + return acc; } - exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; - function getBaseDirectory(pattern) { - return globParent(pattern, { flipBackslashes: false }); + acc.result += next; + if (next === "\r" && pattern[acc.idx] === "\n") { + acc.result += "\n"; + acc.idx++; } - exports.getBaseDirectory = getBaseDirectory; - function hasGlobStar(pattern) { - return pattern.includes(GLOBSTAR); + return acc; + } + function braces(acc) { + const char = pattern[acc.idx]; + if (char !== "[") + return void 0; + acc.result += char; + acc.idx++; + let escCount = 0; + while (acc.idx < pattern.length) { + const char2 = pattern[acc.idx]; + acc.result += char2; + acc.idx++; + if (char2 === "]" && !(escCount & 1)) + break; + escCount = char2 === "\\" ? escCount + 1 : 0; } - exports.hasGlobStar = hasGlobStar; - function endsWithSlashGlobStar(pattern) { - return pattern.endsWith("/" + GLOBSTAR); + return acc; + } + function spaces(acc) { + const char = pattern[acc.idx]; + if (!(char in SPACES)) + return void 0; + acc.idx++; + return acc; + } + function comments(acc) { + const char = pattern[acc.idx]; + if (char !== "#") + return void 0; + while (acc.idx < pattern.length && pattern[acc.idx] !== "\n") { + acc.idx++; } - exports.endsWithSlashGlobStar = endsWithSlashGlobStar; - function isAffectDepthOfReadingPattern(pattern) { - const basename3 = path16.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename3); + return acc; + } + function copy(acc) { + const char = pattern[acc.idx++]; + acc.result += char; + return acc; + } + const reducers = [escape, braces, spaces, comments, copy]; + const result = { idx: 0, result: "" }; + while (result.idx < pattern.length) { + for (const r of reducers) { + if (r(result)) + break; } - exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; - function expandPatternsWithBraceExpansion(patterns) { - return patterns.reduce((collection, pattern) => { - return collection.concat(expandBraceExpansion(pattern)); - }, []); - } - exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; - function expandBraceExpansion(pattern) { - const patterns = micromatch.braces(pattern, { expand: true, nodupes: true }); - patterns.sort((a, b) => a.length - b.length); - return patterns.filter((pattern2) => pattern2 !== ""); - } - exports.expandBraceExpansion = expandBraceExpansion; - function getPatternParts(pattern, options) { - let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); - if (parts.length === 0) { - parts = [pattern]; - } - if (parts[0].startsWith("/")) { - parts[0] = parts[0].slice(1); - parts.unshift(""); - } - return parts; - } - exports.getPatternParts = getPatternParts; - function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); - } - exports.makeRe = makeRe; - function convertPatternsToRe(patterns, options) { - return patterns.map((pattern) => makeRe(pattern, options)); - } - exports.convertPatternsToRe = convertPatternsToRe; - function matchAny(entry, patternsRe) { - return patternsRe.some((patternRe) => patternRe.test(entry)); - } - exports.matchAny = matchAny; - function removeDuplicateSlashes(pattern) { - return pattern.replace(DOUBLE_SLASH_RE, "/"); - } - exports.removeDuplicateSlashes = removeDuplicateSlashes; } -}); + return result.result; +} -// node_modules/merge2/index.js -var require_merge2 = __commonJS({ - "node_modules/merge2/index.js"(exports, module2) { - "use strict"; - var Stream3 = require("stream"); - var PassThrough2 = Stream3.PassThrough; - var slice = Array.prototype.slice; - module2.exports = merge2; - function merge2() { - const streamsQueue = []; - const args = slice.call(arguments); - let merging = false; - let options = args[args.length - 1]; - if (options && !Array.isArray(options) && options.pipe == null) { - args.pop(); - } else { - options = {}; - } - const doEnd = options.end !== false; - const doPipeError = options.pipeError === true; - if (options.objectMode == null) { - options.objectMode = true; - } - if (options.highWaterMark == null) { - options.highWaterMark = 64 * 1024; - } - const mergedStream = PassThrough2(options); - function addStream() { - for (let i = 0, len = arguments.length; i < len; i++) { - streamsQueue.push(pauseStreams(arguments[i], options)); - } - mergeStream(); - return this; - } - function mergeStream() { - if (merging) { - return; - } - merging = true; - let streams = streamsQueue.shift(); - if (!streams) { - process.nextTick(endStream); - return; - } - if (!Array.isArray(streams)) { - streams = [streams]; - } - let pipesCount = streams.length + 1; - function next() { - if (--pipesCount > 0) { - return; - } - merging = false; - mergeStream(); - } - function pipe(stream) { - function onend() { - stream.removeListener("merge2UnpipeEnd", onend); - stream.removeListener("end", onend); - if (doPipeError) { - stream.removeListener("error", onerror); - } - next(); - } - function onerror(err) { - mergedStream.emit("error", err); - } - if (stream._readableState.endEmitted) { - return next(); - } - stream.on("merge2UnpipeEnd", onend); - stream.on("end", onend); - if (doPipeError) { - stream.on("error", onerror); - } - stream.pipe(mergedStream, { end: false }); - stream.resume(); - } - for (let i = 0; i < streams.length; i++) { - pipe(streams[i]); - } - next(); - } - function endStream() { - merging = false; - mergedStream.emit("queueDrain"); - if (doEnd) { - mergedStream.end(); - } - } - mergedStream.setMaxListeners(0); - mergedStream.add = addStream; - mergedStream.on("unpipe", function(stream) { - stream.emit("merge2UnpipeEnd"); - }); - if (args.length) { - addStream.apply(null, args); - } - return mergedStream; - } - function pauseStreams(streams, options) { - if (!Array.isArray(streams)) { - if (!streams._readableState && streams.pipe) { - streams = streams.pipe(PassThrough2(options)); - } - if (!streams._readableState || !streams.pause || !streams.pipe) { - throw new Error("Only readable stream can be merged."); - } - streams.pause(); +// node_modules/cspell-lib/dist/esm/Settings/patterns.mjs +function resolvePatterns(regExpList = [], patternDefinitions = []) { + const patternMap = new Map(patternDefinitions.map((def) => [def.name.toLowerCase(), def.pattern])); + const resolved = /* @__PURE__ */ new Set(); + function resolvePattern(p) { + if (resolved.has(p)) + return void 0; + resolved.add(p); + return patternMap.get(p.toString().toLowerCase()) || p; + } + function* flatten(patterns) { + for (const pattern of patterns) { + if (Array.isArray(pattern)) { + yield* flatten(pattern.map(resolvePattern).filter(isDefined)); } else { - for (let i = 0, len = streams.length; i < len; i++) { - streams[i] = pauseStreams(streams[i], options); - } - } - return streams; - } + yield pattern; + } + } + } + const patternList = regExpList.map(resolvePattern).filter(isDefined); + return [...flatten(patternList)].map(toRegExp).filter(isDefined); +} +function toRegExp(pattern) { + return pattern instanceof RegExp ? new RegExp(pattern) : stringToRegExp(pattern, "gim", "g"); +} + +// node_modules/cspell-lib/dist/esm/Settings/CSpellSettingsServer.mjs +function mergeListUnique(left, right) { + if (!Array.isArray(left)) + return Array.isArray(right) ? right : void 0; + if (!Array.isArray(right)) + return left; + if (!right.length) + return left; + if (!left.length) + return right; + return [.../* @__PURE__ */ new Set([...left, ...right])]; +} +function mergeList(left, right) { + if (!Array.isArray(left)) + return Array.isArray(right) ? right : void 0; + if (!Array.isArray(right)) + return left; + if (!left.length) + return right; + if (!right.length) + return left; + return left.concat(right); +} +var emptyWords = []; +Object.freeze(emptyWords); +var cachedMerges = /* @__PURE__ */ new WeakMap(); +function _mergeWordsCached(left, right) { + const map3 = autoResolveWeak(cachedMerges, left, () => /* @__PURE__ */ new WeakMap()); + return autoResolveWeak(map3, right, () => left.concat(right)); +} +function mergeWordsCached(left, right) { + if (!Array.isArray(left) || !left.length) { + return Array.isArray(right) ? right.length ? right : emptyWords : void 0; + } + if (!Array.isArray(right) || !right.length) + return left; + return _mergeWordsCached(left, right); +} +function mergeObjects(left, right) { + if (!left || typeof left !== "object") + return !right || typeof right !== "object" ? void 0 : right; + if (!right || typeof right !== "object") + return left; + return { ...left, ...right }; +} +function replaceIfNotEmpty(left = [], right = []) { + const filtered = right.filter((a) => !!a); + if (filtered.length) { + return filtered; + } + return left; +} +function mergeSettings(left, ...settings) { + const rawSettings = settings.filter(isDefined).reduce(merge2, toInternalSettings(left)); + return clean(rawSettings); +} +function isEmpty(obj) { + return Object.keys(obj).length === 0 && obj.constructor === Object; +} +var mergeCache = new AutoResolveWeakCache(); +function merge2(left, right) { + const map3 = mergeCache.get(left, () => /* @__PURE__ */ new WeakMap()); + return autoResolveWeak(map3, right, () => _merge(left, right)); +} +function _merge(left, right) { + const _left = toInternalSettings(left); + const _right = toInternalSettings(right); + if (left === right) { + return _left; + } + if (isEmpty(right)) { + return _left; + } + if (isEmpty(left)) { + return _right; + } + if (isLeftAncestorOfRight(_left, _right)) { + return _right; + } + if (doesLeftHaveRightAncestor(_left, _right)) { + return _left; + } + const includeRegExpList = takeRightOtherwiseLeft(_left.includeRegExpList, _right.includeRegExpList); + const optionals = includeRegExpList?.length ? { includeRegExpList } : {}; + const version4 = max3(_left.version, _right.version); + const valuesToClear = { + name: void 0, + id: void 0, + description: void 0, + globRoot: void 0, + import: void 0, + __importRef: void 0 + }; + const settings = cleanCSpellSettingsInternal({ + ..._left, + ..._right, + ...optionals, + ...valuesToClear, + version: version4, + words: mergeWordsCached(_left.words, _right.words), + userWords: mergeWordsCached(_left.userWords, _right.userWords), + flagWords: mergeWordsCached(_left.flagWords, _right.flagWords), + ignoreWords: mergeWordsCached(_left.ignoreWords, _right.ignoreWords), + suggestWords: mergeWordsCached(_left.suggestWords, _right.suggestWords), + enabledLanguageIds: replaceIfNotEmpty(_left.enabledLanguageIds, _right.enabledLanguageIds), + enableFiletypes: mergeList(_left.enableFiletypes, _right.enableFiletypes), + ignoreRegExpList: mergeListUnique(_left.ignoreRegExpList, _right.ignoreRegExpList), + patterns: mergeListUnique(_left.patterns, _right.patterns), + dictionaryDefinitions: mergeListUnique(_left.dictionaryDefinitions, _right.dictionaryDefinitions), + dictionaries: mergeListUnique(_left.dictionaries, _right.dictionaries), + noSuggestDictionaries: mergeListUnique(_left.noSuggestDictionaries, _right.noSuggestDictionaries), + languageSettings: mergeList(_left.languageSettings, _right.languageSettings), + enabled: _right.enabled !== void 0 ? _right.enabled : _left.enabled, + files: mergeListUnique(_left.files, _right.files), + ignorePaths: versionBasedMergeList(_left.ignorePaths, _right.ignorePaths, version4), + overrides: versionBasedMergeList(_left.overrides, _right.overrides, version4), + features: mergeObjects(_left.features, _right.features), + source: mergeSources(_left, _right), + plugins: mergeList(_left.plugins, _right.plugins), + __imports: mergeImportRefs(_left, _right) + }); + return settings; +} +function versionBasedMergeList(left, right, version4) { + if (version4 === configSettingsFileVersion0_1) { + return takeRightOtherwiseLeft(left, right); } -}); - -// node_modules/fast-glob/out/utils/stream.js -var require_stream = __commonJS({ - "node_modules/fast-glob/out/utils/stream.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.merge = void 0; - var merge2 = require_merge2(); - function merge(streams) { - const mergedStream = merge2(streams); - streams.forEach((stream) => { - stream.once("error", (error2) => mergedStream.emit("error", error2)); - }); - mergedStream.once("close", () => propagateCloseEventToSources(streams)); - mergedStream.once("end", () => propagateCloseEventToSources(streams)); - return mergedStream; - } - exports.merge = merge; - function propagateCloseEventToSources(streams) { - streams.forEach((stream) => stream.emit("close")); - } + return mergeListUnique(left, right); +} +function isLeftAncestorOfRight(left, right) { + return hasAncestor(right, left, 0); +} +function doesLeftHaveRightAncestor(left, right) { + return hasAncestor(left, right, 1); +} +function hasAncestor(s, ancestor, side) { + const sources = s.source?.sources; + if (!sources) + return false; + const i = side ? sources.length - 1 : 0; + const src = sources[i]; + return src === ancestor || src && hasAncestor(src, ancestor, side) || false; +} +function mergeInDocSettings(left, right) { + const merged = { + ...mergeSettings(left, right), + includeRegExpList: mergeListUnique(left.includeRegExpList, right.includeRegExpList) + }; + return clean(merged); +} +function takeRightOtherwiseLeft(left, right) { + if (right?.length) { + return right; + } + return left || right; +} +function calcOverrideSettings(settings, filename) { + const _settings = toInternalSettings(settings); + const overrides = _settings.overrides || []; + const result = overrides.filter((override) => checkFilenameMatchesGlob(filename, override.filename)).reduce((settings2, override) => mergeSettings(settings2, override), _settings); + return result; +} +function finalizeSettings(settings) { + return _finalizeSettings(toInternalSettings(settings)); +} +function _finalizeSettings(settings) { + const finalized = { + ...settings, + finalized: true, + ignoreRegExpList: resolvePatterns(settings.ignoreRegExpList, settings.patterns), + includeRegExpList: resolvePatterns(settings.includeRegExpList, settings.patterns), + parserFn: resolveParser(settings) + }; + finalized.name = "Finalized " + (finalized.name || ""); + finalized.source = { name: settings.name || "src", sources: [settings] }; + return finalized; +} +var cacheInternalSettings = new AutoResolveWeakCache(); +function toInternalSettings(settings) { + if (settings === void 0) + return void 0; + if (isCSpellSettingsInternal(settings)) + return settings; + return cacheInternalSettings.get(settings, _toInternalSettings); +} +function _toInternalSettings(settings) { + const { dictionaryDefinitions: defs, ...rest } = settings; + const dictionaryDefinitions = mapDictDefsToInternal(defs, filenameToDirectory(settings.source?.filename) || resolveCwd()); + const setting = dictionaryDefinitions ? { ...rest, dictionaryDefinitions } : rest; + return cleanCSpellSettingsInternal(setting); +} +function filenameToDirectory(filename) { + return filename ? path4.dirname(filename) : void 0; +} +function checkFilenameMatchesGlob(filename, globs) { + const m = new GlobMatcher(globs); + return m.match(filename); +} +function mergeSources(left, right) { + return { + name: "merged", + sources: [left, right] + }; +} +function max3(a, b) { + if (a === void 0 || a === null) + return b; + if (b === void 0 || b === null) + return a; + return a > b ? a : b; +} +function mergeImportRefs(left, right = {}) { + const imports = new Map(left.__imports || []); + if (left.__importRef) { + imports.set(left.__importRef.filename, left.__importRef); } -}); - -// node_modules/fast-glob/out/utils/string.js -var require_string = __commonJS({ - "node_modules/fast-glob/out/utils/string.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isEmpty = exports.isString = void 0; - function isString2(input) { - return typeof input === "string"; - } - exports.isString = isString2; - function isEmpty(input) { - return input === ""; - } - exports.isEmpty = isEmpty; + if (right.__importRef) { + imports.set(right.__importRef.filename, right.__importRef); } -}); - -// node_modules/fast-glob/out/utils/index.js -var require_utils7 = __commonJS({ - "node_modules/fast-glob/out/utils/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; - var array = require_array2(); - exports.array = array; - var errno = require_errno(); - exports.errno = errno; - var fs6 = require_fs(); - exports.fs = fs6; - var path16 = require_path(); - exports.path = path16; - var pattern = require_pattern(); - exports.pattern = pattern; - var stream = require_stream(); - exports.stream = stream; - var string = require_string(); - exports.string = string; + const rightImports = right.__imports?.values() || []; + for (const ref of rightImports) { + imports.set(ref.filename, ref); } -}); - -// node_modules/fast-glob/out/managers/tasks.js -var require_tasks = __commonJS({ - "node_modules/fast-glob/out/managers/tasks.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; - var utils = require_utils7(); - function generate(input, settings) { - const patterns = processPatterns(input, settings); - const ignore = processPatterns(settings.ignore, settings); - const positivePatterns = getPositivePatterns(patterns); - const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); - const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); - const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); - const staticTasks = convertPatternsToTasks( - staticPatterns, - negativePatterns, - /* dynamic */ - false - ); - const dynamicTasks = convertPatternsToTasks( - dynamicPatterns, - negativePatterns, - /* dynamic */ - true - ); - return staticTasks.concat(dynamicTasks); - } - exports.generate = generate; - function processPatterns(input, settings) { - let patterns = input; - if (settings.braceExpansion) { - patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); - } - if (settings.baseNameMatch) { - patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`); - } - return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); - } - function convertPatternsToTasks(positive, negative, dynamic) { - const tasks = []; - const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); - const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); - const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); - const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); - tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); - if ("." in insideCurrentDirectoryGroup) { - tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic)); - } else { - tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); - } - return tasks; - } - exports.convertPatternsToTasks = convertPatternsToTasks; - function getPositivePatterns(patterns) { - return utils.pattern.getPositivePatterns(patterns); - } - exports.getPositivePatterns = getPositivePatterns; - function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils.pattern.convertToPositivePattern); - return positive; - } - exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; - function groupPatternsByBaseDirectory(patterns) { - const group = {}; - return patterns.reduce((collection, pattern) => { - const base = utils.pattern.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } else { - collection[base] = [pattern]; - } - return collection; - }, group); - } - exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; - function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map((base) => { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); - } - exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; - function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - dynamic, - positive, - negative, - base, - patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) - }; + return imports.size ? imports : void 0; +} +function extractDependencies(settings) { + const settingsI = toInternalSettings(settings); + const configFiles = [...mergeImportRefs(settingsI) || []].map(([filename]) => filename); + const dictionaryFiles = calcDictionaryDefsToLoad(settingsI).map((dict) => dict.path).filter((file) => !!file); + return { + configFiles, + dictionaryFiles + }; +} +function resolveCwd() { + const envGlobRoot = process.env[ENV_CSPELL_GLOB_ROOT]; + const cwd = envGlobRoot || process.cwd(); + return cwd; +} +function resolveParser(settings) { + if (!settings.parser) + return void 0; + if (typeof settings.parser === "function") + return settings.parser; + const parserName = settings.parser; + (0, import_assert7.default)(typeof parserName === "string"); + const parsers3 = extractParsers(settings.plugins); + const parser2 = parsers3.get(parserName); + (0, import_assert7.default)(parser2, `Parser "${parserName}" not found.`); + return parser2; +} +var parserCache = new AutoResolveWeakCache(); +var emptyParserMap = /* @__PURE__ */ new Map(); +function* parsers(plugins) { + for (const plugin of plugins) { + if (!plugin.parsers) + continue; + for (const parser2 of plugin.parsers) { + yield [parser2.name, parser2]; } - exports.convertPatternGroupToTask = convertPatternGroupToTask; } -}); +} +function mapPlugins(plugins) { + return new Map(parsers(plugins)); +} +function extractParsers(plugins) { + if (!plugins || !plugins.length) + return emptyParserMap; + return parserCache.get(plugins, mapPlugins); +} -// node_modules/@nodelib/fs.stat/out/providers/async.js -var require_async = __commonJS({ - "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.read = void 0; - function read2(path16, settings, callback) { - settings.fs.lstat(path16, (lstatError, lstat) => { - if (lstatError !== null) { - callFailureCallback(callback, lstatError); - return; - } - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - callSuccessCallback(callback, lstat); - return; - } - settings.fs.stat(path16, (statError, stat2) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - callFailureCallback(callback, statError); - return; - } - callSuccessCallback(callback, lstat); - return; - } - if (settings.markSymbolicLink) { - stat2.isSymbolicLink = () => true; - } - callSuccessCallback(callback, stat2); - }); - }); - } - exports.read = read2; - function callFailureCallback(callback, error2) { - callback(error2); - } - function callSuccessCallback(callback, result) { - callback(null, result); - } +// node_modules/cspell-lib/dist/esm/util/errors.mjs +var import_util34 = require("util"); +var allowStringOrUndefined = { + string: true, + undefined: true +}; +var allowNumberOrUndefined = { + number: true, + undefined: true +}; +function isErrnoException(e) { + if (!e || typeof e !== "object") + return false; + if (!isError2(e)) + return false; + const ex = e; + return typeof ex.errno in allowNumberOrUndefined && typeof ex.code in allowStringOrUndefined && typeof ex.path in allowStringOrUndefined; +} +function isError2(e) { + if (e instanceof Error) + return true; + if (!e || typeof e !== "object") + return false; + const ex = e; + return typeof ex.name == "string" && typeof ex.message == "string" && typeof ex.stack in allowStringOrUndefined; +} +function toError2(e, errorFactory = UnknownError) { + if (isError2(e)) + return e; + return new errorFactory(e); +} +var UnknownError = class extends Error { + constructor(cause) { + super((0, import_util34.format)(cause)); + this.cause = cause; } -}); - -// node_modules/@nodelib/fs.stat/out/providers/sync.js -var require_sync2 = __commonJS({ - "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.read = void 0; - function read2(path16, settings) { - const lstat = settings.fs.lstatSync(path16); - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - return lstat; - } - try { - const stat2 = settings.fs.statSync(path16); - if (settings.markSymbolicLink) { - stat2.isSymbolicLink = () => true; - } - return stat2; - } catch (error2) { - if (!settings.throwErrorOnBrokenSymbolicLink) { - return lstat; - } - throw error2; - } +}; +function catchPromiseError(p, handler) { + if (p === void 0) + return void 0; + return _catchPromiseError(p, handler); +} +function wrapCall(fn, handler) { + return (...p) => { + try { + return fn(...p); + } catch (e) { + return handler(e); } - exports.read = read2; + }; +} +async function _catchPromiseError(p, handler) { + try { + return await p; + } catch (e) { + return handler(e); } -}); +} -// node_modules/@nodelib/fs.stat/out/adapters/fs.js -var require_fs2 = __commonJS({ - "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; - var fs6 = require("fs"); - exports.FILE_SYSTEM_ADAPTER = { - lstat: fs6.lstat, - stat: fs6.stat, - lstatSync: fs6.lstatSync, - statSync: fs6.statSync - }; - function createFileSystemAdapter(fsMethods) { - if (fsMethods === void 0) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); - } - exports.createFileSystemAdapter = createFileSystemAdapter; - } -}); +// node_modules/configstore/index.js +var import_path2 = __toESM(require("path"), 1); +var import_os2 = __toESM(require("os"), 1); +var import_graceful_fs = __toESM(require_graceful_fs(), 1); -// node_modules/@nodelib/fs.stat/out/settings.js -var require_settings = __commonJS({ - "node_modules/@nodelib/fs.stat/out/settings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var fs6 = require_fs2(); - var Settings = class { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); - this.fs = fs6.createFileSystemAdapter(this._options.fs); - this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } - }; - exports.default = Settings; - } -}); +// node_modules/xdg-basedir/index.js +var import_os = __toESM(require("os"), 1); +var import_path = __toESM(require("path"), 1); +var homeDirectory = import_os.default.homedir(); +var { env } = process; +var xdgData = env.XDG_DATA_HOME || (homeDirectory ? import_path.default.join(homeDirectory, ".local", "share") : void 0); +var xdgConfig = env.XDG_CONFIG_HOME || (homeDirectory ? import_path.default.join(homeDirectory, ".config") : void 0); +var xdgState = env.XDG_STATE_HOME || (homeDirectory ? import_path.default.join(homeDirectory, ".local", "state") : void 0); +var xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? import_path.default.join(homeDirectory, ".cache") : void 0); +var xdgRuntime = env.XDG_RUNTIME_DIR || void 0; +var xdgDataDirectories = (env.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":"); +if (xdgData) { + xdgDataDirectories.unshift(xdgData); +} +var xdgConfigDirectories = (env.XDG_CONFIG_DIRS || "/etc/xdg").split(":"); +if (xdgConfig) { + xdgConfigDirectories.unshift(xdgConfig); +} -// node_modules/@nodelib/fs.stat/out/index.js -var require_out = __commonJS({ - "node_modules/@nodelib/fs.stat/out/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.statSync = exports.stat = exports.Settings = void 0; - var async = require_async(); - var sync = require_sync2(); - var settings_1 = require_settings(); - exports.Settings = settings_1.default; - function stat2(path16, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === "function") { - async.read(path16, getSettings(), optionsOrSettingsOrCallback); - return; +// node_modules/configstore/index.js +var import_write_file_atomic = __toESM(require_write_file_atomic(), 1); +var import_dot_prop = __toESM(require_dot_prop(), 1); + +// node_modules/crypto-random-string/index.js +var import_util35 = require("util"); +var import_crypto4 = __toESM(require("crypto"), 1); +var randomBytesAsync = (0, import_util35.promisify)(import_crypto4.default.randomBytes); +var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""); +var numericCharacters = "0123456789".split(""); +var distinguishableCharacters = "CDEHKMPRTUWXY012458".split(""); +var asciiPrintableCharacters = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""); +var alphanumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""); +var generateForCustomCharacters = (length, characters) => { + const characterCount = characters.length; + const maxValidSelector = Math.floor(65536 / characterCount) * characterCount - 1; + const entropyLength = 2 * Math.ceil(1.1 * length); + let string = ""; + let stringLength = 0; + while (stringLength < length) { + const entropy = import_crypto4.default.randomBytes(entropyLength); + let entropyPosition = 0; + while (entropyPosition < entropyLength && stringLength < length) { + const entropyValue = entropy.readUInt16LE(entropyPosition); + entropyPosition += 2; + if (entropyValue > maxValidSelector) { + continue; } - async.read(path16, getSettings(optionsOrSettingsOrCallback), callback); - } - exports.stat = stat2; - function statSync3(path16, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path16, settings); + string += characters[entropyValue % characterCount]; + stringLength++; } - exports.statSync = statSync3; - function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; + } + return string; +}; +var generateForCustomCharactersAsync = async (length, characters) => { + const characterCount = characters.length; + const maxValidSelector = Math.floor(65536 / characterCount) * characterCount - 1; + const entropyLength = 2 * Math.ceil(1.1 * length); + let string = ""; + let stringLength = 0; + while (stringLength < length) { + const entropy = await randomBytesAsync(entropyLength); + let entropyPosition = 0; + while (entropyPosition < entropyLength && stringLength < length) { + const entropyValue = entropy.readUInt16LE(entropyPosition); + entropyPosition += 2; + if (entropyValue > maxValidSelector) { + continue; } - return new settings_1.default(settingsOrOptions); + string += characters[entropyValue % characterCount]; + stringLength++; } } -}); - -// node_modules/queue-microtask/index.js -var require_queue_microtask = __commonJS({ - "node_modules/queue-microtask/index.js"(exports, module2) { - var promise; - module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => { - throw err; - }, 0)); + return string; +}; +var generateRandomBytes = (byteLength, type, length) => import_crypto4.default.randomBytes(byteLength).toString(type).slice(0, length); +var generateRandomBytesAsync = async (byteLength, type, length) => { + const buffer = await randomBytesAsync(byteLength); + return buffer.toString(type).slice(0, length); +}; +var allowedTypes = /* @__PURE__ */ new Set([ + void 0, + "hex", + "base64", + "url-safe", + "numeric", + "distinguishable", + "ascii-printable", + "alphanumeric" +]); +var createGenerator = (generateForCustomCharacters2, generateRandomBytes2) => ({ length, type, characters }) => { + if (!(length >= 0 && Number.isFinite(length))) { + throw new TypeError("Expected a `length` to be a non-negative finite number"); } -}); + if (type !== void 0 && characters !== void 0) { + throw new TypeError("Expected either `type` or `characters`"); + } + if (characters !== void 0 && typeof characters !== "string") { + throw new TypeError("Expected `characters` to be string"); + } + if (!allowedTypes.has(type)) { + throw new TypeError(`Unknown type: ${type}`); + } + if (type === void 0 && characters === void 0) { + type = "hex"; + } + if (type === "hex" || type === void 0 && characters === void 0) { + return generateRandomBytes2(Math.ceil(length * 0.5), "hex", length); + } + if (type === "base64") { + return generateRandomBytes2(Math.ceil(length * 0.75), "base64", length); + } + if (type === "url-safe") { + return generateForCustomCharacters2(length, urlSafeCharacters); + } + if (type === "numeric") { + return generateForCustomCharacters2(length, numericCharacters); + } + if (type === "distinguishable") { + return generateForCustomCharacters2(length, distinguishableCharacters); + } + if (type === "ascii-printable") { + return generateForCustomCharacters2(length, asciiPrintableCharacters); + } + if (type === "alphanumeric") { + return generateForCustomCharacters2(length, alphanumericCharacters); + } + if (characters.length === 0) { + throw new TypeError("Expected `characters` string length to be greater than or equal to 1"); + } + if (characters.length > 65536) { + throw new TypeError("Expected `characters` string length to be less or equal to 65536"); + } + return generateForCustomCharacters2(length, characters.split("")); +}; +var cryptoRandomString = createGenerator(generateForCustomCharacters, generateRandomBytes); +cryptoRandomString.async = createGenerator(generateForCustomCharactersAsync, generateRandomBytesAsync); +var crypto_random_string_default = cryptoRandomString; -// node_modules/run-parallel/index.js -var require_run_parallel = __commonJS({ - "node_modules/run-parallel/index.js"(exports, module2) { - module2.exports = runParallel; - var queueMicrotask2 = require_queue_microtask(); - function runParallel(tasks, cb) { - let results, pending, keys; - let isSync = true; - if (Array.isArray(tasks)) { - results = []; - pending = tasks.length; - } else { - keys = Object.keys(tasks); - results = {}; - pending = keys.length; - } - function done(err) { - function end() { - if (cb) - cb(err, results); - cb = null; - } - if (isSync) - queueMicrotask2(end); - else - end(); - } - function each(i, err, result) { - results[i] = result; - if (--pending === 0 || err) { - done(err); - } - } - if (!pending) { - done(null); - } else if (keys) { - keys.forEach(function(key) { - tasks[key](function(err, result) { - each(key, err, result); - }); - }); - } else { - tasks.forEach(function(task, i) { - task(function(err, result) { - each(i, err, result); - }); - }); - } - isSync = false; - } - } -}); - -// node_modules/@nodelib/fs.scandir/out/constants.js -var require_constants6 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; - var NODE_PROCESS_VERSION_PARTS = process.versions.node.split("."); - if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) { - throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); - } - var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); - var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); - var SUPPORTED_MAJOR_VERSION = 10; - var SUPPORTED_MINOR_VERSION = 10; - var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; - var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; - exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; - } -}); - -// node_modules/@nodelib/fs.scandir/out/utils/fs.js -var require_fs3 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDirentFromStats = void 0; - var DirentFromStats = class { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } - }; - function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); - } - exports.createDirentFromStats = createDirentFromStats; - } -}); - -// node_modules/@nodelib/fs.scandir/out/utils/index.js -var require_utils8 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fs = void 0; - var fs6 = require_fs3(); - exports.fs = fs6; - } -}); - -// node_modules/@nodelib/fs.scandir/out/providers/common.js -var require_common3 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.joinPathSegments = void 0; - function joinPathSegments(a, b, separator) { - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; - } - exports.joinPathSegments = joinPathSegments; - } -}); - -// node_modules/@nodelib/fs.scandir/out/providers/async.js -var require_async2 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; - var fsStat = require_out(); - var rpl = require_run_parallel(); - var constants_1 = require_constants6(); - var utils = require_utils8(); - var common = require_common3(); - function read2(directory, settings, callback) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - readdirWithFileTypes(directory, settings, callback); - return; - } - readdir(directory, settings, callback); - } - exports.read = read2; - function readdirWithFileTypes(directory, settings, callback) { - settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const entries = dirents.map((dirent) => ({ - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - })); - if (!settings.followSymbolicLinks) { - callSuccessCallback(callback, entries); - return; - } - const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); - rpl(tasks, (rplError, rplEntries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, rplEntries); - }); - }); - } - exports.readdirWithFileTypes = readdirWithFileTypes; - function makeRplTaskEntry(entry, settings) { - return (done) => { - if (!entry.dirent.isSymbolicLink()) { - done(null, entry); - return; - } - settings.fs.stat(entry.path, (statError, stats) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - done(statError); - return; - } - done(null, entry); - return; - } - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - done(null, entry); - }); - }; - } - function readdir(directory, settings, callback) { - settings.fs.readdir(directory, (readdirError, names) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const tasks = names.map((name) => { - const path16 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - return (done) => { - fsStat.stat(path16, settings.fsStatSettings, (error2, stats) => { - if (error2 !== null) { - done(error2); - return; - } - const entry = { - name, - path: path16, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - done(null, entry); - }); - }; - }); - rpl(tasks, (rplError, entries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, entries); - }); - }); - } - exports.readdir = readdir; - function callFailureCallback(callback, error2) { - callback(error2); - } - function callSuccessCallback(callback, result) { - callback(null, result); - } - } -}); - -// node_modules/@nodelib/fs.scandir/out/providers/sync.js -var require_sync3 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; - var fsStat = require_out(); - var constants_1 = require_constants6(); - var utils = require_utils8(); - var common = require_common3(); - function read2(directory, settings) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - return readdirWithFileTypes(directory, settings); - } - return readdir(directory, settings); - } - exports.read = read2; - function readdirWithFileTypes(directory, settings) { - const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); - return dirents.map((dirent) => { - const entry = { - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - }; - if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { - try { - const stats = settings.fs.statSync(entry.path); - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - } catch (error2) { - if (settings.throwErrorOnBrokenSymbolicLink) { - throw error2; - } - } - } - return entry; - }); - } - exports.readdirWithFileTypes = readdirWithFileTypes; - function readdir(directory, settings) { - const names = settings.fs.readdirSync(directory); - return names.map((name) => { - const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - const stats = fsStat.statSync(entryPath, settings.fsStatSettings); - const entry = { - name, - path: entryPath, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - return entry; - }); - } - exports.readdir = readdir; - } -}); - -// node_modules/@nodelib/fs.scandir/out/adapters/fs.js -var require_fs4 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; - var fs6 = require("fs"); - exports.FILE_SYSTEM_ADAPTER = { - lstat: fs6.lstat, - stat: fs6.stat, - lstatSync: fs6.lstatSync, - statSync: fs6.statSync, - readdir: fs6.readdir, - readdirSync: fs6.readdirSync - }; - function createFileSystemAdapter(fsMethods) { - if (fsMethods === void 0) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); - } - exports.createFileSystemAdapter = createFileSystemAdapter; - } -}); - -// node_modules/@nodelib/fs.scandir/out/settings.js -var require_settings2 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var path16 = require("path"); - var fsStat = require_out(); - var fs6 = require_fs4(); - var Settings = class { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); - this.fs = fs6.createFileSystemAdapter(this._options.fs); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path16.sep); - this.stats = this._getValue(this._options.stats, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - this.fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this.followSymbolicLinks, - fs: this.fs, - throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } - }; - exports.default = Settings; - } -}); - -// node_modules/@nodelib/fs.scandir/out/index.js -var require_out2 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Settings = exports.scandirSync = exports.scandir = void 0; - var async = require_async2(); - var sync = require_sync3(); - var settings_1 = require_settings2(); - exports.Settings = settings_1.default; - function scandir(path16, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === "function") { - async.read(path16, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path16, getSettings(optionsOrSettingsOrCallback), callback); - } - exports.scandir = scandir; - function scandirSync(path16, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path16, settings); - } - exports.scandirSync = scandirSync; - function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); - } - } -}); +// node_modules/unique-string/index.js +function uniqueString() { + return crypto_random_string_default({ length: 32 }); +} -// node_modules/reusify/reusify.js -var require_reusify = __commonJS({ - "node_modules/reusify/reusify.js"(exports, module2) { - "use strict"; - function reusify(Constructor) { - var head = new Constructor(); - var tail = head; - function get() { - var current = head; - if (current.next) { - head = current.next; - } else { - head = new Constructor(); - tail = head; - } - current.next = null; - return current; - } - function release(obj) { - tail.next = obj; - tail = obj; - } - return { - get, - release +// node_modules/configstore/index.js +var configDirectory = xdgConfig || import_path2.default.join(import_os2.default.tmpdir(), uniqueString()); +var permissionError = "You don't have access to this file."; +var mkdirOptions = { mode: 448, recursive: true }; +var writeFileOptions = { mode: 384 }; +var Configstore = class { + constructor(id, defaults, options = {}) { + const pathPrefix = options.globalConfigPath ? import_path2.default.join(id, "config.json") : import_path2.default.join("configstore", `${id}.json`); + this._path = options.configPath || import_path2.default.join(configDirectory, pathPrefix); + if (defaults) { + this.all = { + ...defaults, + ...this.all }; } - module2.exports = reusify; } -}); - -// node_modules/fastq/queue.js -var require_queue = __commonJS({ - "node_modules/fastq/queue.js"(exports, module2) { - "use strict"; - var reusify = require_reusify(); - function fastqueue(context, worker, concurrency) { - if (typeof context === "function") { - concurrency = worker; - worker = context; - context = null; - } - if (concurrency < 1) { - throw new Error("fastqueue concurrency must be greater than 1"); - } - var cache = reusify(Task); - var queueHead = null; - var queueTail = null; - var _running = 0; - var errorHandler = null; - var self = { - push, - drain: noop, - saturated: noop, - pause, - paused: false, - concurrency, - running, - resume, - idle, - length, - getQueue, - unshift, - empty: noop, - kill, - killAndDrain, - error: error2 - }; - return self; - function running() { - return _running; - } - function pause() { - self.paused = true; - } - function length() { - var current = queueHead; - var counter = 0; - while (current) { - current = current.next; - counter++; - } - return counter; - } - function getQueue() { - var current = queueHead; - var tasks = []; - while (current) { - tasks.push(current.value); - current = current.next; - } - return tasks; - } - function resume() { - if (!self.paused) - return; - self.paused = false; - for (var i = 0; i < self.concurrency; i++) { - _running++; - release(); - } - } - function idle() { - return _running === 0 && self.length() === 0; - } - function push(value, done) { - var current = cache.get(); - current.context = context; - current.release = release; - current.value = value; - current.callback = done || noop; - current.errorHandler = errorHandler; - if (_running === self.concurrency || self.paused) { - if (queueTail) { - queueTail.next = current; - queueTail = current; - } else { - queueHead = current; - queueTail = current; - self.saturated(); - } - } else { - _running++; - worker.call(context, current.value, current.worked); - } - } - function unshift(value, done) { - var current = cache.get(); - current.context = context; - current.release = release; - current.value = value; - current.callback = done || noop; - if (_running === self.concurrency || self.paused) { - if (queueHead) { - current.next = queueHead; - queueHead = current; - } else { - queueHead = current; - queueTail = current; - self.saturated(); - } - } else { - _running++; - worker.call(context, current.value, current.worked); - } + get all() { + try { + return JSON.parse(import_graceful_fs.default.readFileSync(this._path, "utf8")); + } catch (error2) { + if (error2.code === "ENOENT") { + return {}; } - function release(holder) { - if (holder) { - cache.release(holder); - } - var next = queueHead; - if (next) { - if (!self.paused) { - if (queueTail === queueHead) { - queueTail = null; - } - queueHead = next.next; - next.next = null; - worker.call(context, next.value, next.worked); - if (queueTail === null) { - self.empty(); - } - } else { - _running--; - } - } else if (--_running === 0) { - self.drain(); - } + if (error2.code === "EACCES") { + error2.message = `${error2.message} +${permissionError} +`; } - function kill() { - queueHead = null; - queueTail = null; - self.drain = noop; - } - function killAndDrain() { - queueHead = null; - queueTail = null; - self.drain(); - self.drain = noop; - } - function error2(handler) { - errorHandler = handler; - } - } - function noop() { - } - function Task() { - this.value = null; - this.callback = noop; - this.next = null; - this.release = noop; - this.context = null; - this.errorHandler = null; - var self = this; - this.worked = function worked(err, result) { - var callback = self.callback; - var errorHandler = self.errorHandler; - var val = self.value; - self.value = null; - self.callback = noop; - if (self.errorHandler) { - errorHandler(err, val); - } - callback.call(self.context, err, result); - self.release(self); - }; - } - function queueAsPromised(context, worker, concurrency) { - if (typeof context === "function") { - concurrency = worker; - worker = context; - context = null; - } - function asyncWrapper(arg, cb) { - worker.call(this, arg).then(function(res) { - cb(null, res); - }, cb); - } - var queue = fastqueue(context, asyncWrapper, concurrency); - var pushCb = queue.push; - var unshiftCb = queue.unshift; - queue.push = push; - queue.unshift = unshift; - queue.drained = drained; - return queue; - function push(value) { - var p = new Promise(function(resolve10, reject) { - pushCb(value, function(err, result) { - if (err) { - reject(err); - return; - } - resolve10(result); - }); - }); - p.catch(noop); - return p; - } - function unshift(value) { - var p = new Promise(function(resolve10, reject) { - unshiftCb(value, function(err, result) { - if (err) { - reject(err); - return; - } - resolve10(result); - }); - }); - p.catch(noop); - return p; - } - function drained() { - if (queue.idle()) { - return new Promise(function(resolve10) { - resolve10(); - }); - } - var previousDrain = queue.drain; - var p = new Promise(function(resolve10) { - queue.drain = function() { - previousDrain(); - resolve10(); - }; - }); - return p; - } - } - module2.exports = fastqueue; - module2.exports.promise = queueAsPromised; - } -}); - -// node_modules/@nodelib/fs.walk/out/readers/common.js -var require_common4 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; - function isFatalError(settings, error2) { - if (settings.errorFilter === null) { - return true; - } - return !settings.errorFilter(error2); - } - exports.isFatalError = isFatalError; - function isAppliedFilter(filter, value) { - return filter === null || filter(value); - } - exports.isAppliedFilter = isAppliedFilter; - function replacePathSegmentSeparator(filepath, separator) { - return filepath.split(/[/\\]/).join(separator); - } - exports.replacePathSegmentSeparator = replacePathSegmentSeparator; - function joinPathSegments(a, b, separator) { - if (a === "") { - return b; - } - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; - } - exports.joinPathSegments = joinPathSegments; - } -}); - -// node_modules/@nodelib/fs.walk/out/readers/reader.js -var require_reader = __commonJS({ - "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var common = require_common4(); - var Reader = class { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); - } - }; - exports.default = Reader; - } -}); - -// node_modules/@nodelib/fs.walk/out/readers/async.js -var require_async3 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var events_1 = require("events"); - var fsScandir = require_out2(); - var fastq = require_queue(); - var common = require_common4(); - var reader_1 = require_reader(); - var AsyncReader = class extends reader_1.default { - constructor(_root, _settings) { - super(_root, _settings); - this._settings = _settings; - this._scandir = fsScandir.scandir; - this._emitter = new events_1.EventEmitter(); - this._queue = fastq(this._worker.bind(this), this._settings.concurrency); - this._isFatalError = false; - this._isDestroyed = false; - this._queue.drain = () => { - if (!this._isFatalError) { - this._emitter.emit("end"); - } - }; - } - read() { - this._isFatalError = false; - this._isDestroyed = false; - setImmediate(() => { - this._pushToQueue(this._root, this._settings.basePath); - }); - return this._emitter; - } - get isDestroyed() { - return this._isDestroyed; - } - destroy() { - if (this._isDestroyed) { - throw new Error("The reader is already destroyed"); - } - this._isDestroyed = true; - this._queue.killAndDrain(); - } - onEntry(callback) { - this._emitter.on("entry", callback); - } - onError(callback) { - this._emitter.once("error", callback); - } - onEnd(callback) { - this._emitter.once("end", callback); - } - _pushToQueue(directory, base) { - const queueItem = { directory, base }; - this._queue.push(queueItem, (error2) => { - if (error2 !== null) { - this._handleError(error2); - } - }); - } - _worker(item, done) { - this._scandir(item.directory, this._settings.fsScandirSettings, (error2, entries) => { - if (error2 !== null) { - done(error2, void 0); - return; - } - for (const entry of entries) { - this._handleEntry(entry, item.base); - } - done(null, void 0); - }); - } - _handleError(error2) { - if (this._isDestroyed || !common.isFatalError(this._settings, error2)) { - return; - } - this._isFatalError = true; - this._isDestroyed = true; - this._emitter.emit("error", error2); - } - _handleEntry(entry, base) { - if (this._isDestroyed || this._isFatalError) { - return; - } - const fullpath = entry.path; - if (base !== void 0) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._emitEntry(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); - } - } - _emitEntry(entry) { - this._emitter.emit("entry", entry); - } - }; - exports.default = AsyncReader; - } -}); - -// node_modules/@nodelib/fs.walk/out/providers/async.js -var require_async4 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var async_1 = require_async3(); - var AsyncProvider = class { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._storage = []; - } - read(callback) { - this._reader.onError((error2) => { - callFailureCallback(callback, error2); - }); - this._reader.onEntry((entry) => { - this._storage.push(entry); - }); - this._reader.onEnd(() => { - callSuccessCallback(callback, this._storage); - }); - this._reader.read(); - } - }; - exports.default = AsyncProvider; - function callFailureCallback(callback, error2) { - callback(error2); - } - function callSuccessCallback(callback, entries) { - callback(null, entries); - } - } -}); - -// node_modules/@nodelib/fs.walk/out/providers/stream.js -var require_stream2 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var stream_1 = require("stream"); - var async_1 = require_async3(); - var StreamProvider = class { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._stream = new stream_1.Readable({ - objectMode: true, - read: () => { - }, - destroy: () => { - if (!this._reader.isDestroyed) { - this._reader.destroy(); - } - } - }); - } - read() { - this._reader.onError((error2) => { - this._stream.emit("error", error2); - }); - this._reader.onEntry((entry) => { - this._stream.push(entry); - }); - this._reader.onEnd(() => { - this._stream.push(null); - }); - this._reader.read(); - return this._stream; - } - }; - exports.default = StreamProvider; - } -}); - -// node_modules/@nodelib/fs.walk/out/readers/sync.js -var require_sync4 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var fsScandir = require_out2(); - var common = require_common4(); - var reader_1 = require_reader(); - var SyncReader = class extends reader_1.default { - constructor() { - super(...arguments); - this._scandir = fsScandir.scandirSync; - this._storage = []; - this._queue = /* @__PURE__ */ new Set(); - } - read() { - this._pushToQueue(this._root, this._settings.basePath); - this._handleQueue(); - return this._storage; - } - _pushToQueue(directory, base) { - this._queue.add({ directory, base }); - } - _handleQueue() { - for (const item of this._queue.values()) { - this._handleDirectory(item.directory, item.base); - } - } - _handleDirectory(directory, base) { - try { - const entries = this._scandir(directory, this._settings.fsScandirSettings); - for (const entry of entries) { - this._handleEntry(entry, base); - } - } catch (error2) { - this._handleError(error2); - } - } - _handleError(error2) { - if (!common.isFatalError(this._settings, error2)) { - return; - } - throw error2; - } - _handleEntry(entry, base) { - const fullpath = entry.path; - if (base !== void 0) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._pushToStorage(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); - } - } - _pushToStorage(entry) { - this._storage.push(entry); - } - }; - exports.default = SyncReader; - } -}); - -// node_modules/@nodelib/fs.walk/out/providers/sync.js -var require_sync5 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var sync_1 = require_sync4(); - var SyncProvider = class { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new sync_1.default(this._root, this._settings); - } - read() { - return this._reader.read(); - } - }; - exports.default = SyncProvider; - } -}); - -// node_modules/@nodelib/fs.walk/out/settings.js -var require_settings3 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/settings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var path16 = require("path"); - var fsScandir = require_out2(); - var Settings = class { - constructor(_options = {}) { - this._options = _options; - this.basePath = this._getValue(this._options.basePath, void 0); - this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); - this.deepFilter = this._getValue(this._options.deepFilter, null); - this.entryFilter = this._getValue(this._options.entryFilter, null); - this.errorFilter = this._getValue(this._options.errorFilter, null); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path16.sep); - this.fsScandirSettings = new fsScandir.Settings({ - followSymbolicLinks: this._options.followSymbolicLinks, - fs: this._options.fs, - pathSegmentSeparator: this._options.pathSegmentSeparator, - stats: this._options.stats, - throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } - }; - exports.default = Settings; - } -}); - -// node_modules/@nodelib/fs.walk/out/index.js -var require_out3 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; - var async_1 = require_async4(); - var stream_1 = require_stream2(); - var sync_1 = require_sync5(); - var settings_1 = require_settings3(); - exports.Settings = settings_1.default; - function walk(directory, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === "function") { - new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); - return; - } - new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); - } - exports.walk = walk; - function walkSync(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new sync_1.default(directory, settings); - return provider.read(); - } - exports.walkSync = walkSync; - function walkStream(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new stream_1.default(directory, settings); - return provider.read(); - } - exports.walkStream = walkStream; - function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); - } - } -}); - -// node_modules/fast-glob/out/readers/reader.js -var require_reader2 = __commonJS({ - "node_modules/fast-glob/out/readers/reader.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var path16 = require("path"); - var fsStat = require_out(); - var utils = require_utils7(); - var Reader = class { - constructor(_settings) { - this._settings = _settings; - this._fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this._settings.followSymbolicLinks, - fs: this._settings.fs, - throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks - }); - } - _getFullEntryPath(filepath) { - return path16.resolve(this._settings.cwd, filepath); - } - _makeEntry(stats, pattern) { - const entry = { - name: pattern, - path: pattern, - dirent: utils.fs.createDirentFromStats(pattern, stats) - }; - if (this._settings.stats) { - entry.stats = stats; - } - return entry; - } - _isFatalError(error2) { - return !utils.errno.isEnoentCodeError(error2) && !this._settings.suppressErrors; - } - }; - exports.default = Reader; - } -}); - -// node_modules/fast-glob/out/readers/stream.js -var require_stream3 = __commonJS({ - "node_modules/fast-glob/out/readers/stream.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var stream_1 = require("stream"); - var fsStat = require_out(); - var fsWalk = require_out3(); - var reader_1 = require_reader2(); - var ReaderStream = class extends reader_1.default { - constructor() { - super(...arguments); - this._walkStream = fsWalk.walkStream; - this._stat = fsStat.stat; - } - dynamic(root, options) { - return this._walkStream(root, options); - } - static(patterns, options) { - const filepaths = patterns.map(this._getFullEntryPath, this); - const stream = new stream_1.PassThrough({ objectMode: true }); - stream._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options).then((entry) => { - if (entry !== null && options.entryFilter(entry)) { - stream.push(entry); - } - if (index === filepaths.length - 1) { - stream.end(); - } - done(); - }).catch(done); - }; - for (let i = 0; i < filepaths.length; i++) { - stream.write(i); - } - return stream; - } - _getEntry(filepath, pattern, options) { - return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error2) => { - if (options.errorFilter(error2)) { - return null; - } - throw error2; - }); - } - _getStat(filepath) { - return new Promise((resolve10, reject) => { - this._stat(filepath, this._fsStatSettings, (error2, stats) => { - return error2 === null ? resolve10(stats) : reject(error2); - }); - }); - } - }; - exports.default = ReaderStream; - } -}); - -// node_modules/fast-glob/out/readers/async.js -var require_async5 = __commonJS({ - "node_modules/fast-glob/out/readers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var fsWalk = require_out3(); - var reader_1 = require_reader2(); - var stream_1 = require_stream3(); - var ReaderAsync = class extends reader_1.default { - constructor() { - super(...arguments); - this._walkAsync = fsWalk.walk; - this._readerStream = new stream_1.default(this._settings); - } - dynamic(root, options) { - return new Promise((resolve10, reject) => { - this._walkAsync(root, options, (error2, entries) => { - if (error2 === null) { - resolve10(entries); - } else { - reject(error2); - } - }); - }); - } - async static(patterns, options) { - const entries = []; - const stream = this._readerStream.static(patterns, options); - return new Promise((resolve10, reject) => { - stream.once("error", reject); - stream.on("data", (entry) => entries.push(entry)); - stream.once("end", () => resolve10(entries)); - }); - } - }; - exports.default = ReaderAsync; - } -}); - -// node_modules/fast-glob/out/providers/matchers/matcher.js -var require_matcher = __commonJS({ - "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var Matcher = class { - constructor(_patterns, _settings, _micromatchOptions) { - this._patterns = _patterns; - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this._storage = []; - this._fillStorage(); - } - _fillStorage() { - for (const pattern of this._patterns) { - const segments = this._getPatternSegments(pattern); - const sections = this._splitSegmentsIntoSections(segments); - this._storage.push({ - complete: sections.length <= 1, - pattern, - segments, - sections - }); - } - } - _getPatternSegments(pattern) { - const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); - return parts.map((part) => { - const dynamic = utils.pattern.isDynamicPattern(part, this._settings); - if (!dynamic) { - return { - dynamic: false, - pattern: part - }; - } - return { - dynamic: true, - pattern: part, - patternRe: utils.pattern.makeRe(part, this._micromatchOptions) - }; - }); - } - _splitSegmentsIntoSections(segments) { - return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); - } - }; - exports.default = Matcher; - } -}); - -// node_modules/fast-glob/out/providers/matchers/partial.js -var require_partial = __commonJS({ - "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var matcher_1 = require_matcher(); - var PartialMatcher = class extends matcher_1.default { - match(filepath) { - const parts = filepath.split("/"); - const levels = parts.length; - const patterns = this._storage.filter((info3) => !info3.complete || info3.segments.length > levels); - for (const pattern of patterns) { - const section = pattern.sections[0]; - if (!pattern.complete && levels > section.length) { - return true; - } - const match = parts.every((part, index) => { - const segment = pattern.segments[index]; - if (segment.dynamic && segment.patternRe.test(part)) { - return true; - } - if (!segment.dynamic && segment.pattern === part) { - return true; - } - return false; - }); - if (match) { - return true; - } - } - return false; - } - }; - exports.default = PartialMatcher; - } -}); - -// node_modules/fast-glob/out/providers/filters/deep.js -var require_deep = __commonJS({ - "node_modules/fast-glob/out/providers/filters/deep.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var partial_1 = require_partial(); - var DeepFilter = class { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - } - getFilter(basePath, positive, negative) { - const matcher = this._getMatcher(positive); - const negativeRe = this._getNegativePatternsRe(negative); - return (entry) => this._filter(basePath, entry, matcher, negativeRe); - } - _getMatcher(patterns) { - return new partial_1.default(patterns, this._settings, this._micromatchOptions); - } - _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); - return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); - } - _filter(basePath, entry, matcher, negativeRe) { - if (this._isSkippedByDeep(basePath, entry.path)) { - return false; - } - if (this._isSkippedSymbolicLink(entry)) { - return false; - } - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._isSkippedByPositivePatterns(filepath, matcher)) { - return false; - } - return this._isSkippedByNegativePatterns(filepath, negativeRe); - } - _isSkippedByDeep(basePath, entryPath) { - if (this._settings.deep === Infinity) { - return false; - } - return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; - } - _getEntryLevel(basePath, entryPath) { - const entryPathDepth = entryPath.split("/").length; - if (basePath === "") { - return entryPathDepth; - } - const basePathDepth = basePath.split("/").length; - return entryPathDepth - basePathDepth; - } - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); - } - _isSkippedByPositivePatterns(entryPath, matcher) { - return !this._settings.baseNameMatch && !matcher.match(entryPath); - } - _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils.pattern.matchAny(entryPath, patternsRe); - } - }; - exports.default = DeepFilter; - } -}); - -// node_modules/fast-glob/out/providers/filters/entry.js -var require_entry = __commonJS({ - "node_modules/fast-glob/out/providers/filters/entry.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var EntryFilter = class { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this.index = /* @__PURE__ */ new Map(); - } - getFilter(positive, negative) { - const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); - const negativeRe = utils.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); - return (entry) => this._filter(entry, positiveRe, negativeRe); - } - _filter(entry, positiveRe, negativeRe) { - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._settings.unique && this._isDuplicateEntry(filepath)) { - return false; - } - if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { - return false; - } - if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) { - return false; - } - const isDirectory = entry.dirent.isDirectory(); - const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory); - if (this._settings.unique && isMatched) { - this._createIndexRecord(filepath); - } - return isMatched; - } - _isDuplicateEntry(filepath) { - return this.index.has(filepath); - } - _createIndexRecord(filepath) { - this.index.set(filepath, void 0); - } - _onlyFileFilter(entry) { - return this._settings.onlyFiles && !entry.dirent.isFile(); - } - _onlyDirectoryFilter(entry) { - return this._settings.onlyDirectories && !entry.dirent.isDirectory(); - } - _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { - if (!this._settings.absolute) { - return false; - } - const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); - return utils.pattern.matchAny(fullpath, patternsRe); - } - _isMatchToPatterns(filepath, patternsRe, isDirectory) { - const isMatched = utils.pattern.matchAny(filepath, patternsRe); - if (!isMatched && isDirectory) { - return utils.pattern.matchAny(filepath + "/", patternsRe); - } - return isMatched; - } - }; - exports.default = EntryFilter; - } -}); - -// node_modules/fast-glob/out/providers/filters/error.js -var require_error2 = __commonJS({ - "node_modules/fast-glob/out/providers/filters/error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var ErrorFilter = class { - constructor(_settings) { - this._settings = _settings; - } - getFilter() { - return (error2) => this._isNonFatalError(error2); - } - _isNonFatalError(error2) { - return utils.errno.isEnoentCodeError(error2) || this._settings.suppressErrors; - } - }; - exports.default = ErrorFilter; - } -}); - -// node_modules/fast-glob/out/providers/transformers/entry.js -var require_entry2 = __commonJS({ - "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var EntryTransformer = class { - constructor(_settings) { - this._settings = _settings; - } - getTransformer() { - return (entry) => this._transform(entry); - } - _transform(entry) { - let filepath = entry.path; - if (this._settings.absolute) { - filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils.path.unixify(filepath); - } - if (this._settings.markDirectories && entry.dirent.isDirectory()) { - filepath += "/"; - } - if (!this._settings.objectMode) { - return filepath; - } - return Object.assign(Object.assign({}, entry), { path: filepath }); - } - }; - exports.default = EntryTransformer; - } -}); - -// node_modules/fast-glob/out/providers/provider.js -var require_provider = __commonJS({ - "node_modules/fast-glob/out/providers/provider.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var path16 = require("path"); - var deep_1 = require_deep(); - var entry_1 = require_entry(); - var error_1 = require_error2(); - var entry_2 = require_entry2(); - var Provider = class { - constructor(_settings) { - this._settings = _settings; - this.errorFilter = new error_1.default(this._settings); - this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); - this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); - this.entryTransformer = new entry_2.default(this._settings); - } - _getRootDirectory(task) { - return path16.resolve(this._settings.cwd, task.base); - } - _getReaderOptions(task) { - const basePath = task.base === "." ? "" : task.base; - return { - basePath, - pathSegmentSeparator: "/", - concurrency: this._settings.concurrency, - deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), - entryFilter: this.entryFilter.getFilter(task.positive, task.negative), - errorFilter: this.errorFilter.getFilter(), - followSymbolicLinks: this._settings.followSymbolicLinks, - fs: this._settings.fs, - stats: this._settings.stats, - throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, - transform: this.entryTransformer.getTransformer() - }; - } - _getMicromatchOptions() { - return { - dot: this._settings.dot, - matchBase: this._settings.baseNameMatch, - nobrace: !this._settings.braceExpansion, - nocase: !this._settings.caseSensitiveMatch, - noext: !this._settings.extglob, - noglobstar: !this._settings.globstar, - posix: true, - strictSlashes: false - }; - } - }; - exports.default = Provider; - } -}); - -// node_modules/fast-glob/out/providers/async.js -var require_async6 = __commonJS({ - "node_modules/fast-glob/out/providers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var async_1 = require_async5(); - var provider_1 = require_provider(); - var ProviderAsync = class extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new async_1.default(this._settings); - } - async read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = await this.api(root, task, options); - return entries.map((entry) => options.transform(entry)); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } - }; - exports.default = ProviderAsync; - } -}); - -// node_modules/fast-glob/out/providers/stream.js -var require_stream4 = __commonJS({ - "node_modules/fast-glob/out/providers/stream.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var stream_1 = require("stream"); - var stream_2 = require_stream3(); - var provider_1 = require_provider(); - var ProviderStream = class extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_2.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const source = this.api(root, task, options); - const destination = new stream_1.Readable({ objectMode: true, read: () => { - } }); - source.once("error", (error2) => destination.emit("error", error2)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end")); - destination.once("close", () => source.destroy()); - return destination; - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } - }; - exports.default = ProviderStream; - } -}); - -// node_modules/fast-glob/out/readers/sync.js -var require_sync6 = __commonJS({ - "node_modules/fast-glob/out/readers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var fsStat = require_out(); - var fsWalk = require_out3(); - var reader_1 = require_reader2(); - var ReaderSync = class extends reader_1.default { - constructor() { - super(...arguments); - this._walkSync = fsWalk.walkSync; - this._statSync = fsStat.statSync; - } - dynamic(root, options) { - return this._walkSync(root, options); - } - static(patterns, options) { - const entries = []; - for (const pattern of patterns) { - const filepath = this._getFullEntryPath(pattern); - const entry = this._getEntry(filepath, pattern, options); - if (entry === null || !options.entryFilter(entry)) { - continue; - } - entries.push(entry); - } - return entries; - } - _getEntry(filepath, pattern, options) { - try { - const stats = this._getStat(filepath); - return this._makeEntry(stats, pattern); - } catch (error2) { - if (options.errorFilter(error2)) { - return null; - } - throw error2; - } - } - _getStat(filepath) { - return this._statSync(filepath, this._fsStatSettings); - } - }; - exports.default = ReaderSync; - } -}); - -// node_modules/fast-glob/out/providers/sync.js -var require_sync7 = __commonJS({ - "node_modules/fast-glob/out/providers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var sync_1 = require_sync6(); - var provider_1 = require_provider(); - var ProviderSync = class extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new sync_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = this.api(root, task, options); - return entries.map(options.transform); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } - }; - exports.default = ProviderSync; - } -}); - -// node_modules/fast-glob/out/settings.js -var require_settings4 = __commonJS({ - "node_modules/fast-glob/out/settings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; - var fs6 = require("fs"); - var os = require("os"); - var CPU_COUNT = Math.max(os.cpus().length, 1); - exports.DEFAULT_FILE_SYSTEM_ADAPTER = { - lstat: fs6.lstat, - lstatSync: fs6.lstatSync, - stat: fs6.stat, - statSync: fs6.statSync, - readdir: fs6.readdir, - readdirSync: fs6.readdirSync - }; - var Settings = class { - constructor(_options = {}) { - this._options = _options; - this.absolute = this._getValue(this._options.absolute, false); - this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); - this.braceExpansion = this._getValue(this._options.braceExpansion, true); - this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); - this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); - this.cwd = this._getValue(this._options.cwd, process.cwd()); - this.deep = this._getValue(this._options.deep, Infinity); - this.dot = this._getValue(this._options.dot, false); - this.extglob = this._getValue(this._options.extglob, true); - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); - this.fs = this._getFileSystemMethods(this._options.fs); - this.globstar = this._getValue(this._options.globstar, true); - this.ignore = this._getValue(this._options.ignore, []); - this.markDirectories = this._getValue(this._options.markDirectories, false); - this.objectMode = this._getValue(this._options.objectMode, false); - this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); - this.onlyFiles = this._getValue(this._options.onlyFiles, true); - this.stats = this._getValue(this._options.stats, false); - this.suppressErrors = this._getValue(this._options.suppressErrors, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); - this.unique = this._getValue(this._options.unique, true); - if (this.onlyDirectories) { - this.onlyFiles = false; - } - if (this.stats) { - this.objectMode = true; - } - } - _getValue(option, value) { - return option === void 0 ? value : option; - } - _getFileSystemMethods(methods = {}) { - return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); - } - }; - exports.default = Settings; - } -}); - -// node_modules/fast-glob/out/index.js -var require_out4 = __commonJS({ - "node_modules/fast-glob/out/index.js"(exports, module2) { - "use strict"; - var taskManager = require_tasks(); - var async_1 = require_async6(); - var stream_1 = require_stream4(); - var sync_1 = require_sync7(); - var settings_1 = require_settings4(); - var utils = require_utils7(); - async function FastGlob(source, options) { - assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); - const result = await Promise.all(works); - return utils.array.flatten(result); - } - (function(FastGlob2) { - FastGlob2.glob = FastGlob2; - FastGlob2.globSync = sync; - FastGlob2.globStream = stream; - FastGlob2.async = FastGlob2; - function sync(source, options) { - assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); - } - FastGlob2.sync = sync; - function stream(source, options) { - assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - return utils.stream.merge(works); - } - FastGlob2.stream = stream; - function generateTasks(source, options) { - assertPatternsInput(source); - const patterns = [].concat(source); - const settings = new settings_1.default(options); - return taskManager.generate(patterns, settings); - } - FastGlob2.generateTasks = generateTasks; - function isDynamicPattern(source, options) { - assertPatternsInput(source); - const settings = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings); - } - FastGlob2.isDynamicPattern = isDynamicPattern; - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escape(source); - } - FastGlob2.escapePath = escapePath; - function convertPathToPattern(source) { - assertPatternsInput(source); - return utils.path.convertPathToPattern(source); - } - FastGlob2.convertPathToPattern = convertPathToPattern; - let posix3; - (function(posix4) { - function escapePath2(source) { - assertPatternsInput(source); - return utils.path.escapePosixPath(source); - } - posix4.escapePath = escapePath2; - function convertPathToPattern2(source) { - assertPatternsInput(source); - return utils.path.convertPosixPathToPattern(source); - } - posix4.convertPathToPattern = convertPathToPattern2; - })(posix3 = FastGlob2.posix || (FastGlob2.posix = {})); - let win32; - (function(win322) { - function escapePath2(source) { - assertPatternsInput(source); - return utils.path.escapeWindowsPath(source); - } - win322.escapePath = escapePath2; - function convertPathToPattern2(source) { - assertPatternsInput(source); - return utils.path.convertWindowsPathToPattern(source); - } - win322.convertPathToPattern = convertPathToPattern2; - })(win32 = FastGlob2.win32 || (FastGlob2.win32 = {})); - })(FastGlob || (FastGlob = {})); - function getWorks(source, _Provider, options) { - const patterns = [].concat(source); - const settings = new settings_1.default(options); - const tasks = taskManager.generate(patterns, settings); - const provider = new _Provider(settings); - return tasks.map(provider.read, provider); - } - function assertPatternsInput(input) { - const source = [].concat(input); - const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); - if (!isValidSource) { - throw new TypeError("Patterns must be a string (non empty) or an array of strings"); - } - } - module2.exports = FastGlob; - } -}); - -// node_modules/flatted/cjs/index.js -var require_cjs11 = __commonJS({ - "node_modules/flatted/cjs/index.js"(exports) { - "use strict"; - var { parse: $parse, stringify: $stringify } = JSON; - var { keys } = Object; - var Primitive = String; - var primitive = "string"; - var ignore = {}; - var object = "object"; - var noop = (_, value) => value; - var primitives = (value) => value instanceof Primitive ? Primitive(value) : value; - var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value; - var revive = (input, parsed, output, $) => { - const lazy = []; - for (let ke = keys(output), { length } = ke, y = 0; y < length; y++) { - const k = ke[y]; - const value = output[k]; - if (value instanceof Primitive) { - const tmp = input[value]; - if (typeof tmp === object && !parsed.has(tmp)) { - parsed.add(tmp); - output[k] = ignore; - lazy.push({ k, a: [input, parsed, tmp, $] }); - } else - output[k] = $.call(output, k, tmp); - } else if (output[k] !== ignore) - output[k] = $.call(output, k, value); - } - for (let { length } = lazy, i = 0; i < length; i++) { - const { k, a } = lazy[i]; - output[k] = $.call(output, k, revive.apply(null, a)); - } - return output; - }; - var set = (known, input, value) => { - const index = Primitive(input.push(value) - 1); - known.set(value, index); - return index; - }; - var parse3 = (text, reviver) => { - const input = $parse(text, Primitives).map(primitives); - const value = input[0]; - const $ = reviver || noop; - const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value; - return $.call({ "": tmp }, "", tmp); - }; - exports.parse = parse3; - var stringify2 = (value, replacer, space) => { - const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop; - const known = /* @__PURE__ */ new Map(); - const input = []; - const output = []; - let i = +set(known, input, $.call({ "": value }, "", value)); - let firstRun = !i; - while (i < input.length) { - firstRun = true; - output[i] = $stringify(input[i++], replace, space); - } - return "[" + output.join(",") + "]"; - function replace(key, value2) { - if (firstRun) { - firstRun = !firstRun; - return value2; - } - const after = $.call(this, key, value2); - switch (typeof after) { - case object: - if (after === null) - return after; - case primitive: - return known.get(after) || set(known, input, after); - } - return after; - } - }; - exports.stringify = stringify2; - var toJSON = (any) => $parse(stringify2(any)); - exports.toJSON = toJSON; - var fromJSON = (any) => parse3($stringify(any)); - exports.fromJSON = fromJSON; - } -}); - -// node_modules/flat-cache/src/utils.js -var require_utils9 = __commonJS({ - "node_modules/flat-cache/src/utils.js"(exports, module2) { - var fs6 = require("fs"); - var path16 = require("path"); - var flatted = require_cjs11(); - module2.exports = { - tryParse: function(filePath, defaultValue) { - var result; - try { - result = this.readJSON(filePath); - } catch (ex) { - result = defaultValue; - } - return result; - }, - /** - * Read json file synchronously using flatted - * - * @method readJSON - * @param {String} filePath Json filepath - * @returns {*} parse result - */ - readJSON: function(filePath) { - return flatted.parse( - fs6.readFileSync(filePath, { - encoding: "utf8" - }) - ); - }, - /** - * Write json file synchronously using circular-json - * - * @method writeJSON - * @param {String} filePath Json filepath - * @param {*} data Object to serialize - */ - writeJSON: function(filePath, data) { - fs6.mkdirSync(path16.dirname(filePath), { - recursive: true - }); - fs6.writeFileSync(filePath, flatted.stringify(data)); - } - }; - } -}); - -// node_modules/fs.realpath/old.js -var require_old = __commonJS({ - "node_modules/fs.realpath/old.js"(exports) { - var pathModule = require("path"); - var isWindows2 = process.platform === "win32"; - var fs6 = require("fs"); - var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - function rethrow() { - var callback; - if (DEBUG) { - var backtrace = new Error(); - callback = debugCallback; - } else - callback = missingCallback; - return callback; - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; - else if (!process.noDeprecation) { - var msg = "fs: missing callback " + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } - } - function maybeCallback(cb) { - return typeof cb === "function" ? cb : rethrow(); - } - var normalize = pathModule.normalize; - if (isWindows2) { - nextPartRe = /(.*?)(?:[\/\\]+|$)/g; - } else { - nextPartRe = /(.*?)(?:[\/]+|$)/g; - } - var nextPartRe; - if (isWindows2) { - splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; - } else { - splitRootRe = /^[\/]*/; - } - var splitRootRe; - exports.realpathSync = function realpathSync2(p, cache) { - p = pathModule.resolve(p); - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - var original = p, seenLinks = {}, knownHard = {}; - var pos; - var current; - var base; - var previous; - start(); - function start() { - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ""; - if (isWindows2 && !knownHard[base]) { - fs6.lstatSync(base); - knownHard[base] = true; - } - } - while (pos < p.length) { - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - if (knownHard[base] || cache && cache[base] === base) { - continue; - } - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - resolvedLink = cache[base]; - } else { - var stat2 = fs6.lstatSync(base); - if (!stat2.isSymbolicLink()) { - knownHard[base] = true; - if (cache) - cache[base] = base; - continue; - } - var linkTarget = null; - if (!isWindows2) { - var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs6.statSync(base); - linkTarget = fs6.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - if (cache) - cache[base] = resolvedLink; - if (!isWindows2) - seenLinks[id] = linkTarget; - } - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - if (cache) - cache[original] = p; - return p; - }; - exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== "function") { - cb = maybeCallback(cache); - cache = null; - } - p = pathModule.resolve(p); - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - var original = p, seenLinks = {}, knownHard = {}; - var pos; - var current; - var base; - var previous; - start(); - function start() { - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ""; - if (isWindows2 && !knownHard[base]) { - fs6.lstat(base, function(err) { - if (err) - return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - function LOOP() { - if (pos >= p.length) { - if (cache) - cache[original] = p; - return cb(null, p); - } - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - if (knownHard[base] || cache && cache[base] === base) { - return process.nextTick(LOOP); - } - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - return gotResolvedLink(cache[base]); - } - return fs6.lstat(base, gotStat); - } - function gotStat(err, stat2) { - if (err) - return cb(err); - if (!stat2.isSymbolicLink()) { - knownHard[base] = true; - if (cache) - cache[base] = base; - return process.nextTick(LOOP); - } - if (!isWindows2) { - var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs6.stat(base, function(err2) { - if (err2) - return cb(err2); - fs6.readlink(base, function(err3, target) { - if (!isWindows2) - seenLinks[id] = target; - gotTarget(err3, target); - }); - }); - } - function gotTarget(err, target, base2) { - if (err) - return cb(err); - var resolvedLink = pathModule.resolve(previous, target); - if (cache) - cache[base2] = resolvedLink; - gotResolvedLink(resolvedLink); - } - function gotResolvedLink(resolvedLink) { - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - }; - } -}); - -// node_modules/fs.realpath/index.js -var require_fs5 = __commonJS({ - "node_modules/fs.realpath/index.js"(exports, module2) { - module2.exports = realpath; - realpath.realpath = realpath; - realpath.sync = realpathSync2; - realpath.realpathSync = realpathSync2; - realpath.monkeypatch = monkeypatch; - realpath.unmonkeypatch = unmonkeypatch; - var fs6 = require("fs"); - var origRealpath = fs6.realpath; - var origRealpathSync = fs6.realpathSync; - var version3 = process.version; - var ok = /^v[0-5]\./.test(version3); - var old = require_old(); - function newError(er) { - return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG"); - } - function realpath(p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb); - } - if (typeof cache === "function") { - cb = cache; - cache = null; - } - origRealpath(p, cache, function(er, result) { - if (newError(er)) { - old.realpath(p, cache, cb); - } else { - cb(er, result); - } - }); - } - function realpathSync2(p, cache) { - if (ok) { - return origRealpathSync(p, cache); - } - try { - return origRealpathSync(p, cache); - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache); - } else { - throw er; - } - } - } - function monkeypatch() { - fs6.realpath = realpath; - fs6.realpathSync = realpathSync2; - } - function unmonkeypatch() { - fs6.realpath = origRealpath; - fs6.realpathSync = origRealpathSync; - } - } -}); - -// node_modules/concat-map/index.js -var require_concat_map = __commonJS({ - "node_modules/concat-map/index.js"(exports, module2) { - module2.exports = function(xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) - res.push.apply(res, x); - else - res.push(x); - } - return res; - }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; - }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str) { - if (a instanceof RegExp) - a = maybeMatch(a, str); - if (b instanceof RegExp) - b = maybeMatch(b, str); - var r = range(a, b, str); - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; - } - balanced.range = range; - function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - if (a === b) { - return [ai, bi]; - } - begs = []; - left = str.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [begs.pop(), bi]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - bi = str.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length) { - result = [left, right]; - } - } - return result; - } - } -}); - -// node_modules/brace-expansion/index.js -var require_brace_expansion = __commonJS({ - "node_modules/brace-expansion/index.js"(exports, module2) { - var concatMap = require_concat_map(); - var balanced = require_balanced_match(); - module2.exports = expandTop; - var escSlash = "\0SLASH" + Math.random() + "\0"; - var escOpen = "\0OPEN" + Math.random() + "\0"; - var escClose = "\0CLOSE" + Math.random() + "\0"; - var escComma = "\0COMMA" + Math.random() + "\0"; - var escPeriod = "\0PERIOD" + Math.random() + "\0"; - function numeric(str) { - return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); - } - function escapeBraces(str) { - return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str) { - return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str) { - if (!str) - return [""]; - var parts = []; - var m = balanced("{", "}", str); - if (!m) - return str.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); - } - parts.push.apply(parts, p); - return parts; - } - function expandTop(str) { - if (!str) - return []; - if (str.substr(0, 2) === "{}") { - str = "\\{\\}" + str.substr(2); - } - return expand(escapeBraces(str), true).map(unescapeBraces); - } - function embrace(str) { - return "{" + str + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte(i, y) { - return i >= y; - } - function expand(str, isTop) { - var expansions = []; - var m = balanced("{", "}", str); - if (!m || /\$$/.test(m.pre)) - return [str]; - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(",") >= 0; - if (!isSequence && !isOptions) { - if (m.post.match(/,.*\}/)) { - str = m.pre + "{" + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === "\\") - c = ""; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join("0"); - if (i < 0) - c = "-" + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); - }); - } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path16 = function() { - try { - return require("path"); - } catch (e) { - } - }() || { - sep: "/" - }; - minimatch.sep = path16.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set, c) { - set[c] = true; - return set; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(a, b) { - b = b || {}; - var t = {}; - Object.keys(a).forEach(function(k) { - t[k] = a[k]; - }); - Object.keys(b).forEach(function(k) { - t[k] = b[k]; - }); - return t; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; - } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) - options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; - } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); - } - assertValidPattern(pattern); - if (!options) - options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path16.sep !== "/") { - pattern = pattern.split(path16.sep).join("/"); - } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; - } - if (!pattern) { - this.empty = true; - return; - } - this.parseNegate(); - var set = this.globSet = this.braceExpand(); - if (options.debug) - this.debug = function debug() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set); - set = this.globParts = set.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set); - set = set.map(function(s, si, set2) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set); - set = set.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set); - this.set = set; - } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = false; - var options = this.options; - var negateOffset = 0; - if (options.nonegate) - return; - for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { - negate = !negate; - negateOffset++; - } - if (negateOffset) - this.pattern = pattern.substr(negateOffset); - this.negate = negate; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; - } - } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; - } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); - } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); - } - }; - Minimatch.prototype.parse = parse3; - var SUBPARSE = {}; - function parse3(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; - } - if (pattern === "") - return ""; - var re = ""; - var hasMagic = !!options.nocase; - var escaping = false; - var patternListStack = []; - var negativeLists = []; - var stateChar; - var inClass = false; - var reClassStart = -1; - var classStart = -1; - var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; - var self = this; - function clearStateChar() { - if (stateChar) { - switch (stateChar) { - case "*": - re += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; - } - self.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; - } - } - for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { - this.debug("%s %s %s %j", pattern, i, re, c); - if (escaping && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; - } - switch (c) { - case "/": { - return false; - } - case "\\": - clearStateChar(); - escaping = true; - continue; - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); - if (inClass) { - this.debug(" in class"); - if (c === "!" && i === classStart + 1) - c = "^"; - re += c; - continue; - } - self.debug("call clearStateChar %j", stateChar); - clearStateChar(); - stateChar = c; - if (options.noext) - clearStateChar(); - continue; - case "(": - if (inClass) { - re += "("; - continue; - } - if (!stateChar) { - re += "\\("; - continue; - } - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }); - re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; - this.debug("plType %j %j", stateChar, re); - stateChar = false; - continue; - case ")": - if (inClass || !patternListStack.length) { - re += "\\)"; - continue; - } - clearStateChar(); - hasMagic = true; - var pl = patternListStack.pop(); - re += pl.close; - if (pl.type === "!") { - negativeLists.push(pl); - } - pl.reEnd = re.length; - continue; - case "|": - if (inClass || !patternListStack.length || escaping) { - re += "\\|"; - escaping = false; - continue; - } - clearStateChar(); - re += "|"; - continue; - case "[": - clearStateChar(); - if (inClass) { - re += "\\" + c; - continue; - } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; - } - var cs = pattern.substring(classStart + 1, i); - try { - RegExp("[" + cs + "]"); - } catch (er) { - var sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; - hasMagic = hasMagic || sp[1]; - inClass = false; - continue; - } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; - } - re += c; - } - } - if (inClass) { - cs = pattern.substr(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; - } - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length); - this.debug("setting tail", re, pl); - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) { - if (!$2) { - $2 = "\\"; - } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; - } - clearStateChar(); - if (escaping) { - re += "\\\\"; - } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; - } - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n]; - var nlBefore = re.slice(0, nl.reStart); - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); - var nlAfter = re.slice(nl.reEnd); - nlLast += nlAfter; - var openParensBefore = nlBefore.split("(").length - 1; - var cleanAfter = nlAfter; - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); - } - nlAfter = cleanAfter; - var dollar = ""; - if (nlAfter === "" && isSub !== SUBPARSE) { - dollar = "$"; - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; - } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; - } - if (addPatternStart) { - re = patternStart + re; - } - if (isSub === SUBPARSE) { - return [re, hasMagic]; - } - if (!hasMagic) { - return globUnescape(pattern); - } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); - } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) - return this.regexp; - var set = this.set; - if (!set.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; - }).join("\\/"); - }).join("|"); - re = "^(?:" + re + ")$"; - if (this.negate) - re = "^(?!" + re + ").*$"; - try { - this.regexp = new RegExp(re, flags); - } catch (ex) { - this.regexp = false; - } - return this.regexp; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm2 = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm2.match(f); - }); - if (mm2.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(f, partial) { - if (typeof partial === "undefined") - partial = this.partial; - this.debug("match", f, this.pattern); - if (this.comment) - return false; - if (this.empty) - return f === ""; - if (f === "/" && partial) - return true; - var options = this.options; - if (path16.sep !== "/") { - f = f.split(path16.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set = this.set; - this.debug(this.pattern, "set", set); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) - break; - } - for (i = 0; i < set.length; i++) { - var pattern = set[i]; - var file = f; - if (options.matchBase && pattern.length === 1) { - file = [filename]; - } - var hit = this.matchOne(file, pattern, partial); - if (hit) { - if (options.flipNegate) - return true; - return !this.negate; - } - } - if (options.flipNegate) - return false; - return this.negate; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { - this.debug("matchOne loop"); - var p = pattern[pi]; - var f = file[fi]; - this.debug(pattern, p, f); - if (p === false) - return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") - return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) - return true; - } - return false; - } - var hit; - if (typeof p === "string") { - hit = f === p; - this.debug("string match", p, f, hit); - } else { - hit = f.match(p); - this.debug("pattern match", p, f, hit); - } - if (!hit) - return false; - } - if (fi === fl && pi === pl) { - return true; - } else if (fi === fl) { - return partial; - } else if (pi === pl) { - return fi === fl - 1 && file[fi] === ""; - } - throw new Error("wtf?"); - }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } - } -}); - -// node_modules/inherits/inherits_browser.js -var require_inherits_browser = __commonJS({ - "node_modules/inherits/inherits_browser.js"(exports, module2) { - if (typeof Object.create === "function") { - module2.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 { - module2.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, module2) { - try { - util = require("util"); - if (typeof util.inherits !== "function") - throw ""; - module2.exports = util.inherits; - } catch (e) { - module2.exports = require_inherits_browser(); - } - var util; - } -}); - -// node_modules/path-is-absolute/index.js -var require_path_is_absolute = __commonJS({ - "node_modules/path-is-absolute/index.js"(exports, module2) { - "use strict"; - function posix3(path16) { - return path16.charAt(0) === "/"; - } - function win32(path16) { - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path16); - var device = result[1] || ""; - var isUnc = Boolean(device && device.charAt(1) !== ":"); - return Boolean(result[2] || isUnc); - } - module2.exports = process.platform === "win32" ? win32 : posix3; - module2.exports.posix = posix3; - module2.exports.win32 = win32; - } -}); - -// node_modules/glob/common.js -var require_common5 = __commonJS({ - "node_modules/glob/common.js"(exports) { - exports.setopts = setopts; - exports.ownProp = ownProp; - exports.makeAbs = makeAbs; - exports.finish = finish; - exports.mark = mark; - exports.isIgnored = isIgnored; - exports.childrenIgnored = childrenIgnored; - function ownProp(obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field); - } - var fs6 = require("fs"); - var path16 = require("path"); - var minimatch = require_minimatch(); - var isAbsolute = require_path_is_absolute(); - var Minimatch = minimatch.Minimatch; - function alphasort(a, b) { - return a.localeCompare(b, "en"); - } - function setupIgnores(self, options) { - self.ignore = options.ignore || []; - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore]; - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap); - } - } - function ignoreMap(pattern) { - var gmatcher = null; - if (pattern.slice(-3) === "/**") { - var gpattern = pattern.replace(/(\/\*\*)+$/, ""); - gmatcher = new Minimatch(gpattern, { dot: true }); - } - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher - }; - } - function setopts(self, pattern, options) { - if (!options) - options = {}; - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar"); - } - pattern = "**/" + pattern; - } - self.silent = !!options.silent; - self.pattern = pattern; - self.strict = options.strict !== false; - self.realpath = !!options.realpath; - self.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null); - self.follow = !!options.follow; - self.dot = !!options.dot; - self.mark = !!options.mark; - self.nodir = !!options.nodir; - if (self.nodir) - self.mark = true; - self.sync = !!options.sync; - self.nounique = !!options.nounique; - self.nonull = !!options.nonull; - self.nosort = !!options.nosort; - self.nocase = !!options.nocase; - self.stat = !!options.stat; - self.noprocess = !!options.noprocess; - self.absolute = !!options.absolute; - self.fs = options.fs || fs6; - self.maxLength = options.maxLength || Infinity; - self.cache = options.cache || /* @__PURE__ */ Object.create(null); - self.statCache = options.statCache || /* @__PURE__ */ Object.create(null); - self.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null); - setupIgnores(self, options); - self.changedCwd = false; - var cwd = process.cwd(); - if (!ownProp(options, "cwd")) - self.cwd = cwd; - else { - self.cwd = path16.resolve(options.cwd); - self.changedCwd = self.cwd !== cwd; - } - self.root = options.root || path16.resolve(self.cwd, "/"); - self.root = path16.resolve(self.root); - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/"); - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd); - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/"); - self.nomount = !!options.nomount; - options.nonegate = true; - options.nocomment = true; - options.allowWindowsEscape = false; - self.minimatch = new Minimatch(pattern, options); - self.options = self.minimatch.options; - } - function finish(self) { - var nou = self.nounique; - var all = nou ? [] : /* @__PURE__ */ Object.create(null); - for (var i = 0, l = self.matches.length; i < l; i++) { - var matches = self.matches[i]; - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - var literal = self.minimatch.globSet[i]; - if (nou) - all.push(literal); - else - all[literal] = true; - } - } else { - var m = Object.keys(matches); - if (nou) - all.push.apply(all, m); - else - m.forEach(function(m2) { - all[m2] = true; - }); - } - } - if (!nou) - all = Object.keys(all); - if (!self.nosort) - all = all.sort(alphasort); - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]); - } - if (self.nodir) { - all = all.filter(function(e) { - var notDir = !/\/$/.test(e); - var c = self.cache[e] || self.cache[makeAbs(self, e)]; - if (notDir && c) - notDir = c !== "DIR" && !Array.isArray(c); - return notDir; - }); - } - } - if (self.ignore.length) - all = all.filter(function(m2) { - return !isIgnored(self, m2); - }); - self.found = all; - } - function mark(self, p) { - var abs = makeAbs(self, p); - var c = self.cache[abs]; - var m = p; - if (c) { - var isDir2 = c === "DIR" || Array.isArray(c); - var slash = p.slice(-1) === "/"; - if (isDir2 && !slash) - m += "/"; - else if (!isDir2 && slash) - m = m.slice(0, -1); - if (m !== p) { - var mabs = makeAbs(self, m); - self.statCache[mabs] = self.statCache[abs]; - self.cache[mabs] = self.cache[abs]; - } - } - return m; - } - function makeAbs(self, f) { - var abs = f; - if (f.charAt(0) === "/") { - abs = path16.join(self.root, f); - } else if (isAbsolute(f) || f === "") { - abs = f; - } else if (self.changedCwd) { - abs = path16.resolve(self.cwd, f); - } else { - abs = path16.resolve(f); - } - if (process.platform === "win32") - abs = abs.replace(/\\/g, "/"); - return abs; - } - function isIgnored(self, path17) { - if (!self.ignore.length) - return false; - return self.ignore.some(function(item) { - return item.matcher.match(path17) || !!(item.gmatcher && item.gmatcher.match(path17)); - }); - } - function childrenIgnored(self, path17) { - if (!self.ignore.length) - return false; - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path17)); - }); - } - } -}); - -// node_modules/glob/sync.js -var require_sync8 = __commonJS({ - "node_modules/glob/sync.js"(exports, module2) { - module2.exports = globSync; - globSync.GlobSync = GlobSync; - var rp = require_fs5(); - var minimatch = require_minimatch(); - var Minimatch = minimatch.Minimatch; - var Glob = require_glob().Glob; - var util = require("util"); - var path16 = require("path"); - var assert7 = require("assert"); - var isAbsolute = require_path_is_absolute(); - var common = require_common5(); - var setopts = common.setopts; - var ownProp = common.ownProp; - var childrenIgnored = common.childrenIgnored; - var isIgnored = common.isIgnored; - function globSync(pattern, options) { - if (typeof options === "function" || arguments.length === 3) - throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); - return new GlobSync(pattern, options).found; - } - function GlobSync(pattern, options) { - if (!pattern) - throw new Error("must provide pattern"); - if (typeof options === "function" || arguments.length === 3) - throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options); - setopts(this, pattern, options); - if (this.noprocess) - return this; - var n = this.minimatch.set.length; - this.matches = new Array(n); - for (var i = 0; i < n; i++) { - this._process(this.minimatch.set[i], i, false); - } - this._finish(); - } - GlobSync.prototype._finish = function() { - assert7.ok(this instanceof GlobSync); - if (this.realpath) { - var self = this; - this.matches.forEach(function(matchset, index) { - var set = self.matches[index] = /* @__PURE__ */ Object.create(null); - for (var p in matchset) { - try { - p = self._makeAbs(p); - var real = rp.realpathSync(p, self.realpathCache); - set[real] = true; - } catch (er) { - if (er.syscall === "stat") - set[self._makeAbs(p)] = true; - else - throw er; - } - } - }); - } - common.finish(this); - }; - GlobSync.prototype._process = function(pattern, index, inGlobStar) { - assert7.ok(this instanceof GlobSync); - var n = 0; - while (typeof pattern[n] === "string") { - n++; - } - var prefix; - switch (n) { - case pattern.length: - this._processSimple(pattern.join("/"), index); - return; - case 0: - prefix = null; - break; - default: - prefix = pattern.slice(0, n).join("/"); - break; - } - var remain = pattern.slice(n); - var read2; - if (prefix === null) - read2 = "."; - else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) { - return typeof p === "string" ? p : "[*]"; - }).join("/"))) { - if (!prefix || !isAbsolute(prefix)) - prefix = "/" + prefix; - read2 = prefix; - } else - read2 = prefix; - var abs = this._makeAbs(read2); - if (childrenIgnored(this, read2)) - return; - var isGlobStar = remain[0] === minimatch.GLOBSTAR; - if (isGlobStar) - this._processGlobStar(prefix, read2, abs, remain, index, inGlobStar); - else - this._processReaddir(prefix, read2, abs, remain, index, inGlobStar); - }; - GlobSync.prototype._processReaddir = function(prefix, read2, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar); - if (!entries) - return; - var pn = remain[0]; - var negate = !!this.minimatch.negate; - var rawGlob = pn._glob; - var dotOk = this.dot || rawGlob.charAt(0) === "."; - var matchedEntries = []; - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - if (e.charAt(0) !== "." || dotOk) { - var m; - if (negate && !prefix) { - m = !e.match(pn); - } else { - m = e.match(pn); - } - if (m) - matchedEntries.push(e); - } - } - var len = matchedEntries.length; - if (len === 0) - return; - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = /* @__PURE__ */ Object.create(null); - for (var i = 0; i < len; i++) { - var e = matchedEntries[i]; - if (prefix) { - if (prefix.slice(-1) !== "/") - e = prefix + "/" + e; - else - e = prefix + e; - } - if (e.charAt(0) === "/" && !this.nomount) { - e = path16.join(this.root, e); - } - this._emitMatch(index, e); - } - return; - } - remain.shift(); - for (var i = 0; i < len; i++) { - var e = matchedEntries[i]; - var newPattern; - if (prefix) - newPattern = [prefix, e]; - else - newPattern = [e]; - this._process(newPattern.concat(remain), index, inGlobStar); - } - }; - GlobSync.prototype._emitMatch = function(index, e) { - if (isIgnored(this, e)) - return; - var abs = this._makeAbs(e); - if (this.mark) - e = this._mark(e); - if (this.absolute) { - e = abs; - } - if (this.matches[index][e]) - return; - if (this.nodir) { - var c = this.cache[abs]; - if (c === "DIR" || Array.isArray(c)) - return; - } - this.matches[index][e] = true; - if (this.stat) - this._stat(e); - }; - GlobSync.prototype._readdirInGlobStar = function(abs) { - if (this.follow) - return this._readdir(abs, false); - var entries; - var lstat; - var stat2; - try { - lstat = this.fs.lstatSync(abs); - } catch (er) { - if (er.code === "ENOENT") { - return null; - } - } - var isSym = lstat && lstat.isSymbolicLink(); - this.symlinks[abs] = isSym; - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = "FILE"; - else - entries = this._readdir(abs, false); - return entries; - }; - GlobSync.prototype._readdir = function(abs, inGlobStar) { - var entries; - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs); - if (ownProp(this.cache, abs)) { - var c = this.cache[abs]; - if (!c || c === "FILE") - return null; - if (Array.isArray(c)) - return c; - } - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)); - } catch (er) { - this._readdirError(abs, er); - return null; - } - }; - GlobSync.prototype._readdirEntries = function(abs, entries) { - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - if (abs === "/") - e = abs + e; - else - e = abs + "/" + e; - this.cache[e] = true; - } - } - this.cache[abs] = entries; - return entries; - }; - GlobSync.prototype._readdirError = function(f, er) { - switch (er.code) { - case "ENOTSUP": - case "ENOTDIR": - var abs = this._makeAbs(f); - this.cache[abs] = "FILE"; - if (abs === this.cwdAbs) { - var error2 = new Error(er.code + " invalid cwd " + this.cwd); - error2.path = this.cwd; - error2.code = er.code; - throw error2; - } - break; - case "ENOENT": - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": - this.cache[this._makeAbs(f)] = false; - break; - default: - this.cache[this._makeAbs(f)] = false; - if (this.strict) - throw er; - if (!this.silent) - console.error("glob error", er); - break; - } - }; - GlobSync.prototype._processGlobStar = function(prefix, read2, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar); - if (!entries) - return; - var remainWithoutGlobStar = remain.slice(1); - var gspref = prefix ? [prefix] : []; - var noGlobStar = gspref.concat(remainWithoutGlobStar); - this._process(noGlobStar, index, false); - var len = entries.length; - var isSym = this.symlinks[abs]; - if (isSym && inGlobStar) - return; - for (var i = 0; i < len; i++) { - var e = entries[i]; - if (e.charAt(0) === "." && !this.dot) - continue; - var instead = gspref.concat(entries[i], remainWithoutGlobStar); - this._process(instead, index, true); - var below = gspref.concat(entries[i], remain); - this._process(below, index, true); - } - }; - GlobSync.prototype._processSimple = function(prefix, index) { - var exists = this._stat(prefix); - if (!this.matches[index]) - this.matches[index] = /* @__PURE__ */ Object.create(null); - if (!exists) - return; - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix); - if (prefix.charAt(0) === "/") { - prefix = path16.join(this.root, prefix); - } else { - prefix = path16.resolve(this.root, prefix); - if (trail) - prefix += "/"; - } - } - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/"); - this._emitMatch(index, prefix); - }; - GlobSync.prototype._stat = function(f) { - var abs = this._makeAbs(f); - var needDir = f.slice(-1) === "/"; - if (f.length > this.maxLength) - return false; - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs]; - if (Array.isArray(c)) - c = "DIR"; - if (!needDir || c === "DIR") - return c; - if (needDir && c === "FILE") - return false; - } - var exists; - var stat2 = this.statCache[abs]; - if (!stat2) { - var lstat; - try { - lstat = this.fs.lstatSync(abs); - } catch (er) { - if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { - this.statCache[abs] = false; - return false; - } - } - if (lstat && lstat.isSymbolicLink()) { - try { - stat2 = this.fs.statSync(abs); - } catch (er) { - stat2 = lstat; - } - } else { - stat2 = lstat; - } - } - this.statCache[abs] = stat2; - var c = true; - if (stat2) - c = stat2.isDirectory() ? "DIR" : "FILE"; - this.cache[abs] = this.cache[abs] || c; - if (needDir && c === "FILE") - return false; - return c; - }; - GlobSync.prototype._mark = function(p) { - return common.mark(this, p); - }; - GlobSync.prototype._makeAbs = function(f) { - return common.makeAbs(this, f); - }; - } -}); - -// node_modules/inflight/inflight.js -var require_inflight = __commonJS({ - "node_modules/inflight/inflight.js"(exports, module2) { - var wrappy = require_wrappy(); - var reqs = /* @__PURE__ */ Object.create(null); - var once = require_once(); - module2.exports = wrappy(inflight); - function inflight(key, cb) { - if (reqs[key]) { - reqs[key].push(cb); - return null; - } else { - reqs[key] = [cb]; - return makeres(key); - } - } - function makeres(key) { - return once(function RES() { - var cbs = reqs[key]; - var len = cbs.length; - var args = slice(arguments); - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args); - } - } finally { - if (cbs.length > len) { - cbs.splice(0, len); - process.nextTick(function() { - RES.apply(null, args); - }); - } else { - delete reqs[key]; - } - } - }); - } - function slice(args) { - var length = args.length; - var array = []; - for (var i = 0; i < length; i++) - array[i] = args[i]; - return array; - } - } -}); - -// node_modules/glob/glob.js -var require_glob = __commonJS({ - "node_modules/glob/glob.js"(exports, module2) { - module2.exports = glob2; - var rp = require_fs5(); - var minimatch = require_minimatch(); - var Minimatch = minimatch.Minimatch; - var inherits = require_inherits(); - var EE = require("events").EventEmitter; - var path16 = require("path"); - var assert7 = require("assert"); - var isAbsolute = require_path_is_absolute(); - var globSync = require_sync8(); - var common = require_common5(); - var setopts = common.setopts; - var ownProp = common.ownProp; - var inflight = require_inflight(); - var util = require("util"); - var childrenIgnored = common.childrenIgnored; - var isIgnored = common.isIgnored; - var once = require_once(); - function glob2(pattern, options, cb) { - if (typeof options === "function") - cb = options, options = {}; - if (!options) - options = {}; - if (options.sync) { - if (cb) - throw new TypeError("callback provided to sync glob"); - return globSync(pattern, options); - } - return new Glob(pattern, options, cb); - } - glob2.sync = globSync; - var GlobSync = glob2.GlobSync = globSync.GlobSync; - glob2.glob = glob2; - function extend(origin, add) { - if (add === null || typeof add !== "object") { - return origin; - } - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; - } - glob2.hasMagic = function(pattern, options_) { - var options = extend({}, options_); - options.noprocess = true; - var g = new Glob(pattern, options); - var set = g.minimatch.set; - if (!pattern) - return false; - if (set.length > 1) - return true; - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== "string") - return true; - } - return false; - }; - glob2.Glob = Glob; - inherits(Glob, EE); - function Glob(pattern, options, cb) { - if (typeof options === "function") { - cb = options; - options = null; - } - if (options && options.sync) { - if (cb) - throw new TypeError("callback provided to sync glob"); - return new GlobSync(pattern, options); - } - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb); - setopts(this, pattern, options); - this._didRealPath = false; - var n = this.minimatch.set.length; - this.matches = new Array(n); - if (typeof cb === "function") { - cb = once(cb); - this.on("error", cb); - this.on("end", function(matches) { - cb(null, matches); - }); - } - var self = this; - this._processing = 0; - this._emitQueue = []; - this._processQueue = []; - this.paused = false; - if (this.noprocess) - return this; - if (n === 0) - return done(); - var sync = true; - for (var i = 0; i < n; i++) { - this._process(this.minimatch.set[i], i, false, done); - } - sync = false; - function done() { - --self._processing; - if (self._processing <= 0) { - if (sync) { - process.nextTick(function() { - self._finish(); - }); - } else { - self._finish(); - } - } - } - } - Glob.prototype._finish = function() { - assert7(this instanceof Glob); - if (this.aborted) - return; - if (this.realpath && !this._didRealpath) - return this._realpath(); - common.finish(this); - this.emit("end", this.found); - }; - Glob.prototype._realpath = function() { - if (this._didRealpath) - return; - this._didRealpath = true; - var n = this.matches.length; - if (n === 0) - return this._finish(); - var self = this; - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next); - function next() { - if (--n === 0) - self._finish(); - } - }; - Glob.prototype._realpathSet = function(index, cb) { - var matchset = this.matches[index]; - if (!matchset) - return cb(); - var found = Object.keys(matchset); - var self = this; - var n = found.length; - if (n === 0) - return cb(); - var set = this.matches[index] = /* @__PURE__ */ Object.create(null); - found.forEach(function(p, i) { - p = self._makeAbs(p); - rp.realpath(p, self.realpathCache, function(er, real) { - if (!er) - set[real] = true; - else if (er.syscall === "stat") - set[p] = true; - else - self.emit("error", er); - if (--n === 0) { - self.matches[index] = set; - cb(); - } - }); - }); - }; - Glob.prototype._mark = function(p) { - return common.mark(this, p); - }; - Glob.prototype._makeAbs = function(f) { - return common.makeAbs(this, f); - }; - Glob.prototype.abort = function() { - this.aborted = true; - this.emit("abort"); - }; - Glob.prototype.pause = function() { - if (!this.paused) { - this.paused = true; - this.emit("pause"); - } - }; - Glob.prototype.resume = function() { - if (this.paused) { - this.emit("resume"); - this.paused = false; - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0); - this._emitQueue.length = 0; - for (var i = 0; i < eq.length; i++) { - var e = eq[i]; - this._emitMatch(e[0], e[1]); - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0); - this._processQueue.length = 0; - for (var i = 0; i < pq.length; i++) { - var p = pq[i]; - this._processing--; - this._process(p[0], p[1], p[2], p[3]); - } - } - } - }; - Glob.prototype._process = function(pattern, index, inGlobStar, cb) { - assert7(this instanceof Glob); - assert7(typeof cb === "function"); - if (this.aborted) - return; - this._processing++; - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]); - return; - } - var n = 0; - while (typeof pattern[n] === "string") { - n++; - } - var prefix; - switch (n) { - case pattern.length: - this._processSimple(pattern.join("/"), index, cb); - return; - case 0: - prefix = null; - break; - default: - prefix = pattern.slice(0, n).join("/"); - break; - } - var remain = pattern.slice(n); - var read2; - if (prefix === null) - read2 = "."; - else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) { - return typeof p === "string" ? p : "[*]"; - }).join("/"))) { - if (!prefix || !isAbsolute(prefix)) - prefix = "/" + prefix; - read2 = prefix; - } else - read2 = prefix; - var abs = this._makeAbs(read2); - if (childrenIgnored(this, read2)) - return cb(); - var isGlobStar = remain[0] === minimatch.GLOBSTAR; - if (isGlobStar) - this._processGlobStar(prefix, read2, abs, remain, index, inGlobStar, cb); - else - this._processReaddir(prefix, read2, abs, remain, index, inGlobStar, cb); - }; - Glob.prototype._processReaddir = function(prefix, read2, abs, remain, index, inGlobStar, cb) { - var self = this; - this._readdir(abs, inGlobStar, function(er, entries) { - return self._processReaddir2(prefix, read2, abs, remain, index, inGlobStar, entries, cb); - }); - }; - Glob.prototype._processReaddir2 = function(prefix, read2, abs, remain, index, inGlobStar, entries, cb) { - if (!entries) - return cb(); - var pn = remain[0]; - var negate = !!this.minimatch.negate; - var rawGlob = pn._glob; - var dotOk = this.dot || rawGlob.charAt(0) === "."; - var matchedEntries = []; - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - if (e.charAt(0) !== "." || dotOk) { - var m; - if (negate && !prefix) { - m = !e.match(pn); - } else { - m = e.match(pn); - } - if (m) - matchedEntries.push(e); - } - } - var len = matchedEntries.length; - if (len === 0) - return cb(); - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = /* @__PURE__ */ Object.create(null); - for (var i = 0; i < len; i++) { - var e = matchedEntries[i]; - if (prefix) { - if (prefix !== "/") - e = prefix + "/" + e; - else - e = prefix + e; - } - if (e.charAt(0) === "/" && !this.nomount) { - e = path16.join(this.root, e); - } - this._emitMatch(index, e); - } - return cb(); - } - remain.shift(); - for (var i = 0; i < len; i++) { - var e = matchedEntries[i]; - var newPattern; - if (prefix) { - if (prefix !== "/") - e = prefix + "/" + e; - else - e = prefix + e; - } - this._process([e].concat(remain), index, inGlobStar, cb); - } - cb(); - }; - Glob.prototype._emitMatch = function(index, e) { - if (this.aborted) - return; - if (isIgnored(this, e)) - return; - if (this.paused) { - this._emitQueue.push([index, e]); - return; - } - var abs = isAbsolute(e) ? e : this._makeAbs(e); - if (this.mark) - e = this._mark(e); - if (this.absolute) - e = abs; - if (this.matches[index][e]) - return; - if (this.nodir) { - var c = this.cache[abs]; - if (c === "DIR" || Array.isArray(c)) - return; - } - this.matches[index][e] = true; - var st = this.statCache[abs]; - if (st) - this.emit("stat", e, st); - this.emit("match", e); - }; - Glob.prototype._readdirInGlobStar = function(abs, cb) { - if (this.aborted) - return; - if (this.follow) - return this._readdir(abs, false, cb); - var lstatkey = "lstat\0" + abs; - var self = this; - var lstatcb = inflight(lstatkey, lstatcb_); - if (lstatcb) - self.fs.lstat(abs, lstatcb); - function lstatcb_(er, lstat) { - if (er && er.code === "ENOENT") - return cb(); - var isSym = lstat && lstat.isSymbolicLink(); - self.symlinks[abs] = isSym; - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = "FILE"; - cb(); - } else - self._readdir(abs, false, cb); - } - }; - Glob.prototype._readdir = function(abs, inGlobStar, cb) { - if (this.aborted) - return; - cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb); - if (!cb) - return; - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb); - if (ownProp(this.cache, abs)) { - var c = this.cache[abs]; - if (!c || c === "FILE") - return cb(); - if (Array.isArray(c)) - return cb(null, c); - } - var self = this; - self.fs.readdir(abs, readdirCb(this, abs, cb)); - }; - function readdirCb(self, abs, cb) { - return function(er, entries) { - if (er) - self._readdirError(abs, er, cb); - else - self._readdirEntries(abs, entries, cb); - }; - } - Glob.prototype._readdirEntries = function(abs, entries, cb) { - if (this.aborted) - return; - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - if (abs === "/") - e = abs + e; - else - e = abs + "/" + e; - this.cache[e] = true; - } - } - this.cache[abs] = entries; - return cb(null, entries); - }; - Glob.prototype._readdirError = function(f, er, cb) { - if (this.aborted) - return; - switch (er.code) { - case "ENOTSUP": - case "ENOTDIR": - var abs = this._makeAbs(f); - this.cache[abs] = "FILE"; - if (abs === this.cwdAbs) { - var error2 = new Error(er.code + " invalid cwd " + this.cwd); - error2.path = this.cwd; - error2.code = er.code; - this.emit("error", error2); - this.abort(); - } - break; - case "ENOENT": - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": - this.cache[this._makeAbs(f)] = false; - break; - default: - this.cache[this._makeAbs(f)] = false; - if (this.strict) { - this.emit("error", er); - this.abort(); - } - if (!this.silent) - console.error("glob error", er); - break; - } - return cb(); - }; - Glob.prototype._processGlobStar = function(prefix, read2, abs, remain, index, inGlobStar, cb) { - var self = this; - this._readdir(abs, inGlobStar, function(er, entries) { - self._processGlobStar2(prefix, read2, abs, remain, index, inGlobStar, entries, cb); - }); - }; - Glob.prototype._processGlobStar2 = function(prefix, read2, abs, remain, index, inGlobStar, entries, cb) { - if (!entries) - return cb(); - var remainWithoutGlobStar = remain.slice(1); - var gspref = prefix ? [prefix] : []; - var noGlobStar = gspref.concat(remainWithoutGlobStar); - this._process(noGlobStar, index, false, cb); - var isSym = this.symlinks[abs]; - var len = entries.length; - if (isSym && inGlobStar) - return cb(); - for (var i = 0; i < len; i++) { - var e = entries[i]; - if (e.charAt(0) === "." && !this.dot) - continue; - var instead = gspref.concat(entries[i], remainWithoutGlobStar); - this._process(instead, index, true, cb); - var below = gspref.concat(entries[i], remain); - this._process(below, index, true, cb); - } - cb(); - }; - Glob.prototype._processSimple = function(prefix, index, cb) { - var self = this; - this._stat(prefix, function(er, exists) { - self._processSimple2(prefix, index, er, exists, cb); - }); - }; - Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) { - if (!this.matches[index]) - this.matches[index] = /* @__PURE__ */ Object.create(null); - if (!exists) - return cb(); - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix); - if (prefix.charAt(0) === "/") { - prefix = path16.join(this.root, prefix); - } else { - prefix = path16.resolve(this.root, prefix); - if (trail) - prefix += "/"; - } - } - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/"); - this._emitMatch(index, prefix); - cb(); - }; - Glob.prototype._stat = function(f, cb) { - var abs = this._makeAbs(f); - var needDir = f.slice(-1) === "/"; - if (f.length > this.maxLength) - return cb(); - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs]; - if (Array.isArray(c)) - c = "DIR"; - if (!needDir || c === "DIR") - return cb(null, c); - if (needDir && c === "FILE") - return cb(); - } - var exists; - var stat2 = this.statCache[abs]; - if (stat2 !== void 0) { - if (stat2 === false) - return cb(null, stat2); - else { - var type = stat2.isDirectory() ? "DIR" : "FILE"; - if (needDir && type === "FILE") - return cb(); - else - return cb(null, type, stat2); - } - } - var self = this; - var statcb = inflight("stat\0" + abs, lstatcb_); - if (statcb) - self.fs.lstat(abs, statcb); - function lstatcb_(er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - return self.fs.stat(abs, function(er2, stat3) { - if (er2) - self._stat2(f, abs, null, lstat, cb); - else - self._stat2(f, abs, er2, stat3, cb); - }); - } else { - self._stat2(f, abs, er, lstat, cb); - } - } - }; - Glob.prototype._stat2 = function(f, abs, er, stat2, cb) { - if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { - this.statCache[abs] = false; - return cb(); - } - var needDir = f.slice(-1) === "/"; - this.statCache[abs] = stat2; - if (abs.slice(-1) === "/" && stat2 && !stat2.isDirectory()) - return cb(null, false, stat2); - var c = true; - if (stat2) - c = stat2.isDirectory() ? "DIR" : "FILE"; - this.cache[abs] = this.cache[abs] || c; - if (needDir && c === "FILE") - return cb(); - return cb(null, c, stat2); - }; - } -}); - -// node_modules/rimraf/rimraf.js -var require_rimraf = __commonJS({ - "node_modules/rimraf/rimraf.js"(exports, module2) { - var assert7 = require("assert"); - var path16 = require("path"); - var fs6 = require("fs"); - var glob2 = void 0; - try { - glob2 = require_glob(); - } catch (_err) { - } - var defaultGlobOpts = { - nosort: true, - silent: true - }; - var timeout = 0; - var isWindows2 = process.platform === "win32"; - var defaults = (options) => { - const methods = [ - "unlink", - "chmod", - "stat", - "lstat", - "rmdir", - "readdir" - ]; - methods.forEach((m) => { - options[m] = options[m] || fs6[m]; - m = m + "Sync"; - options[m] = options[m] || fs6[m]; - }); - options.maxBusyTries = options.maxBusyTries || 3; - options.emfileWait = options.emfileWait || 1e3; - if (options.glob === false) { - options.disableGlob = true; - } - if (options.disableGlob !== true && glob2 === void 0) { - throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); - } - options.disableGlob = options.disableGlob || false; - options.glob = options.glob || defaultGlobOpts; - }; - var rimraf = (p, options, cb) => { - if (typeof options === "function") { - cb = options; - options = {}; - } - assert7(p, "rimraf: missing path"); - assert7.equal(typeof p, "string", "rimraf: path should be a string"); - assert7.equal(typeof cb, "function", "rimraf: callback function required"); - assert7(options, "rimraf: invalid options argument provided"); - assert7.equal(typeof options, "object", "rimraf: options should be object"); - defaults(options); - let busyTries = 0; - let errState = null; - let n = 0; - const next = (er) => { - errState = errState || er; - if (--n === 0) - cb(errState); - }; - const afterGlob = (er, results) => { - if (er) - return cb(er); - n = results.length; - if (n === 0) - return cb(); - results.forEach((p2) => { - const CB = (er2) => { - if (er2) { - if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) { - busyTries++; - return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100); - } - if (er2.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(() => rimraf_(p2, options, CB), timeout++); - } - if (er2.code === "ENOENT") - er2 = null; - } - timeout = 0; - next(er2); - }; - rimraf_(p2, options, CB); - }); - }; - if (options.disableGlob || !glob2.hasMagic(p)) - return afterGlob(null, [p]); - options.lstat(p, (er, stat2) => { - if (!er) - return afterGlob(null, [p]); - glob2(p, options.glob, afterGlob); - }); - }; - var rimraf_ = (p, options, cb) => { - assert7(p); - assert7(options); - assert7(typeof cb === "function"); - options.lstat(p, (er, st) => { - if (er && er.code === "ENOENT") - return cb(null); - if (er && er.code === "EPERM" && isWindows2) - fixWinEPERM(p, options, er, cb); - if (st && st.isDirectory()) - return rmdir(p, options, er, cb); - options.unlink(p, (er2) => { - if (er2) { - if (er2.code === "ENOENT") - return cb(null); - if (er2.code === "EPERM") - return isWindows2 ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb); - if (er2.code === "EISDIR") - return rmdir(p, options, er2, cb); - } - return cb(er2); - }); - }); - }; - var fixWinEPERM = (p, options, er, cb) => { - assert7(p); - assert7(options); - assert7(typeof cb === "function"); - options.chmod(p, 438, (er2) => { - if (er2) - cb(er2.code === "ENOENT" ? null : er); - else - options.stat(p, (er3, stats) => { - if (er3) - cb(er3.code === "ENOENT" ? null : er); - else if (stats.isDirectory()) - rmdir(p, options, er, cb); - else - options.unlink(p, cb); - }); - }); - }; - var fixWinEPERMSync = (p, options, er) => { - assert7(p); - assert7(options); - try { - options.chmodSync(p, 438); - } catch (er2) { - if (er2.code === "ENOENT") - return; - else - throw er; - } - let stats; - try { - stats = options.statSync(p); - } catch (er3) { - if (er3.code === "ENOENT") - return; - else - throw er; - } - if (stats.isDirectory()) - rmdirSync(p, options, er); - else - options.unlinkSync(p); - }; - var rmdir = (p, options, originalEr, cb) => { - assert7(p); - assert7(options); - assert7(typeof cb === "function"); - options.rmdir(p, (er) => { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb); - else if (er && er.code === "ENOTDIR") - cb(originalEr); - else - cb(er); - }); - }; - var rmkids = (p, options, cb) => { - assert7(p); - assert7(options); - assert7(typeof cb === "function"); - options.readdir(p, (er, files) => { - if (er) - return cb(er); - let n = files.length; - if (n === 0) - return options.rmdir(p, cb); - let errState; - files.forEach((f) => { - rimraf(path16.join(p, f), options, (er2) => { - if (errState) - return; - if (er2) - return cb(errState = er2); - if (--n === 0) - options.rmdir(p, cb); - }); - }); - }); - }; - var rimrafSync = (p, options) => { - options = options || {}; - defaults(options); - assert7(p, "rimraf: missing path"); - assert7.equal(typeof p, "string", "rimraf: path should be a string"); - assert7(options, "rimraf: missing options"); - assert7.equal(typeof options, "object", "rimraf: options should be object"); - let results; - if (options.disableGlob || !glob2.hasMagic(p)) { - results = [p]; - } else { - try { - options.lstatSync(p); - results = [p]; - } catch (er) { - results = glob2.sync(p, options.glob); - } - } - if (!results.length) - return; - for (let i = 0; i < results.length; i++) { - const p2 = results[i]; - let st; - try { - st = options.lstatSync(p2); - } catch (er) { - if (er.code === "ENOENT") - return; - if (er.code === "EPERM" && isWindows2) - fixWinEPERMSync(p2, options, er); - } - try { - if (st && st.isDirectory()) - rmdirSync(p2, options, null); - else - options.unlinkSync(p2); - } catch (er) { - if (er.code === "ENOENT") - return; - if (er.code === "EPERM") - return isWindows2 ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er); - if (er.code !== "EISDIR") - throw er; - rmdirSync(p2, options, er); - } - } - }; - var rmdirSync = (p, options, originalEr) => { - assert7(p); - assert7(options); - try { - options.rmdirSync(p); - } catch (er) { - if (er.code === "ENOENT") - return; - if (er.code === "ENOTDIR") - throw originalEr; - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options); - } - }; - var rmkidsSync = (p, options) => { - assert7(p); - assert7(options); - options.readdirSync(p).forEach((f) => rimrafSync(path16.join(p, f), options)); - const retries = isWindows2 ? 100 : 1; - let i = 0; - do { - let threw = true; - try { - const ret = options.rmdirSync(p, options); - threw = false; - return ret; - } finally { - if (++i < retries && threw) - continue; - } - } while (true); - }; - module2.exports = rimraf; - rimraf.sync = rimrafSync; - } -}); - -// node_modules/flat-cache/src/del.js -var require_del = __commonJS({ - "node_modules/flat-cache/src/del.js"(exports, module2) { - var rimraf = require_rimraf().sync; - var fs6 = require("fs"); - module2.exports = function del(file) { - if (fs6.existsSync(file)) { - rimraf(file, { - glob: false - }); - return true; - } - return false; - }; - } -}); - -// node_modules/flat-cache/src/cache.js -var require_cache = __commonJS({ - "node_modules/flat-cache/src/cache.js"(exports, module2) { - var path16 = require("path"); - var fs6 = require("fs"); - var utils = require_utils9(); - var del = require_del(); - var writeJSON = utils.writeJSON; - var cache = { - /** - * Load a cache identified by the given Id. If the element does not exists, then initialize an empty - * cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted - * then the cache module directory `./cache` will be used instead - * - * @method load - * @param docId {String} the id of the cache, would also be used as the name of the file cache - * @param [cacheDir] {String} directory for the cache entry - */ - load: function(docId, cacheDir) { - var me = this; - me._visited = {}; - me._persisted = {}; - me._pathToFile = cacheDir ? path16.resolve(cacheDir, docId) : path16.resolve(__dirname, "../.cache/", docId); - if (fs6.existsSync(me._pathToFile)) { - me._persisted = utils.tryParse(me._pathToFile, {}); - } - }, - /** - * Load the cache from the provided file - * @method loadFile - * @param {String} pathToFile the path to the file containing the info for the cache - */ - loadFile: function(pathToFile) { - var me = this; - var dir = path16.dirname(pathToFile); - var fName = path16.basename(pathToFile); - me.load(fName, dir); - }, - /** - * Returns the entire persisted object - * @method all - * @returns {*} - */ - all: function() { - return this._persisted; - }, - keys: function() { - return Object.keys(this._persisted); - }, - /** - * sets a key to a given value - * @method setKey - * @param key {string} the key to set - * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify - */ - setKey: function(key, value) { - this._visited[key] = true; - this._persisted[key] = value; - }, - /** - * remove a given key from the cache - * @method removeKey - * @param key {String} the key to remove from the object - */ - removeKey: function(key) { - delete this._visited[key]; - delete this._persisted[key]; - }, - /** - * Return the value of the provided key - * @method getKey - * @param key {String} the name of the key to retrieve - * @returns {*} the value from the key - */ - getKey: function(key) { - this._visited[key] = true; - return this._persisted[key]; - }, - /** - * Remove keys that were not accessed/set since the - * last time the `prune` method was called. - * @method _prune - * @private - */ - _prune: function() { - var me = this; - var obj = {}; - var keys = Object.keys(me._visited); - if (keys.length === 0) { - return; - } - keys.forEach(function(key) { - obj[key] = me._persisted[key]; - }); - me._visited = {}; - me._persisted = obj; - }, - /** - * Save the state of the cache identified by the docId to disk - * as a JSON structure - * @param [noPrune=false] {Boolean} whether to remove from cache the non visited files - * @method save - */ - save: function(noPrune) { - var me = this; - !noPrune && me._prune(); - writeJSON(me._pathToFile, me._persisted); - }, - /** - * remove the file where the cache is persisted - * @method removeCacheFile - * @return {Boolean} true or false if the file was successfully deleted - */ - removeCacheFile: function() { - return del(this._pathToFile); - }, - /** - * Destroy the file cache and cache content. - * @method destroy - */ - destroy: function() { - var me = this; - me._visited = {}; - me._persisted = {}; - me.removeCacheFile(); - } - }; - module2.exports = { - /** - * Alias for create. Should be considered depreacted. Will be removed in next releases - * - * @method load - * @param docId {String} the id of the cache, would also be used as the name of the file cache - * @param [cacheDir] {String} directory for the cache entry - * @returns {cache} cache instance - */ - load: function(docId, cacheDir) { - return this.create(docId, cacheDir); - }, - /** - * Load a cache identified by the given Id. If the element does not exists, then initialize an empty - * cache storage. - * - * @method create - * @param docId {String} the id of the cache, would also be used as the name of the file cache - * @param [cacheDir] {String} directory for the cache entry - * @returns {cache} cache instance - */ - create: function(docId, cacheDir) { - var obj = Object.create(cache); - obj.load(docId, cacheDir); - return obj; - }, - createFromFile: function(filePath) { - var obj = Object.create(cache); - obj.loadFile(filePath); - return obj; - }, - /** - * Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly - * - * @method clearCache - * @param docId {String} the id of the cache, would also be used as the name of the file cache - * @param cacheDir {String} the directory where the cache file was written - * @returns {Boolean} true if the cache folder was deleted. False otherwise - */ - clearCacheById: function(docId, cacheDir) { - var filePath = cacheDir ? path16.resolve(cacheDir, docId) : path16.resolve(__dirname, "../.cache/", docId); - return del(filePath); - }, - /** - * Remove all cache stored in the cache directory - * @method clearAll - * @returns {Boolean} true if the cache folder was deleted. False otherwise - */ - clearAll: function(cacheDir) { - var filePath = cacheDir ? path16.resolve(cacheDir) : path16.resolve(__dirname, "../.cache/"); - return del(filePath); - } - }; - } -}); - -// node_modules/file-entry-cache/cache.js -var require_cache2 = __commonJS({ - "node_modules/file-entry-cache/cache.js"(exports, module2) { - var path16 = require("path"); - var crypto5 = require("crypto"); - module2.exports = { - createFromFile: function(filePath, useChecksum) { - var fname = path16.basename(filePath); - var dir = path16.dirname(filePath); - return this.create(fname, dir, useChecksum); - }, - create: function(cacheId, _path, useChecksum) { - var fs6 = require("fs"); - var flatCache = require_cache(); - var cache = flatCache.load(cacheId, _path); - var normalizedEntries = {}; - var removeNotFoundFiles = function removeNotFoundFiles2() { - const cachedEntries = cache.keys(); - cachedEntries.forEach(function remover(fPath) { - try { - fs6.statSync(fPath); - } catch (err) { - if (err.code === "ENOENT") { - cache.removeKey(fPath); - } - } - }); - }; - removeNotFoundFiles(); - return { - /** - * the flat cache storage used to persist the metadata of the `files - * @type {Object} - */ - cache, - /** - * Given a buffer, calculate md5 hash of its content. - * @method getHash - * @param {Buffer} buffer buffer to calculate hash on - * @return {String} content hash digest - */ - getHash: function(buffer) { - return crypto5.createHash("md5").update(buffer).digest("hex"); - }, - /** - * Return whether or not a file has changed since last time reconcile was called. - * @method hasFileChanged - * @param {String} file the filepath to check - * @return {Boolean} wheter or not the file has changed - */ - hasFileChanged: function(file) { - return this.getFileDescriptor(file).changed; - }, - /** - * given an array of file paths it return and object with three arrays: - * - changedFiles: Files that changed since previous run - * - notChangedFiles: Files that haven't change - * - notFoundFiles: Files that were not found, probably deleted - * - * @param {Array} files the files to analyze and compare to the previous seen files - * @return {[type]} [description] - */ - analyzeFiles: function(files) { - var me = this; - files = files || []; - var res = { - changedFiles: [], - notFoundFiles: [], - notChangedFiles: [] - }; - me.normalizeEntries(files).forEach(function(entry) { - if (entry.changed) { - res.changedFiles.push(entry.key); - return; - } - if (entry.notFound) { - res.notFoundFiles.push(entry.key); - return; - } - res.notChangedFiles.push(entry.key); - }); - return res; - }, - getFileDescriptor: function(file) { - var fstat; - try { - fstat = fs6.statSync(file); - } catch (ex) { - this.removeEntry(file); - return { key: file, notFound: true, err: ex }; - } - if (useChecksum) { - return this._getFileDescriptorUsingChecksum(file); - } - return this._getFileDescriptorUsingMtimeAndSize(file, fstat); - }, - _getFileDescriptorUsingMtimeAndSize: function(file, fstat) { - var meta = cache.getKey(file); - var cacheExists = !!meta; - var cSize = fstat.size; - var cTime = fstat.mtime.getTime(); - var isDifferentDate; - var isDifferentSize; - if (!meta) { - meta = { size: cSize, mtime: cTime }; - } else { - isDifferentDate = cTime !== meta.mtime; - isDifferentSize = cSize !== meta.size; - } - var nEntry = normalizedEntries[file] = { - key: file, - changed: !cacheExists || isDifferentDate || isDifferentSize, - meta - }; - return nEntry; - }, - _getFileDescriptorUsingChecksum: function(file) { - var meta = cache.getKey(file); - var cacheExists = !!meta; - var contentBuffer; - try { - contentBuffer = fs6.readFileSync(file); - } catch (ex) { - contentBuffer = ""; - } - var isDifferent = true; - var hash = this.getHash(contentBuffer); - if (!meta) { - meta = { hash }; - } else { - isDifferent = hash !== meta.hash; - } - var nEntry = normalizedEntries[file] = { - key: file, - changed: !cacheExists || isDifferent, - meta - }; - return nEntry; - }, - /** - * Return the list o the files that changed compared - * against the ones stored in the cache - * - * @method getUpdated - * @param files {Array} the array of files to compare against the ones in the cache - * @returns {Array} - */ - getUpdatedFiles: function(files) { - var me = this; - files = files || []; - return me.normalizeEntries(files).filter(function(entry) { - return entry.changed; - }).map(function(entry) { - return entry.key; - }); - }, - /** - * return the list of files - * @method normalizeEntries - * @param files - * @returns {*} - */ - normalizeEntries: function(files) { - files = files || []; - var me = this; - var nEntries = files.map(function(file) { - return me.getFileDescriptor(file); - }); - return nEntries; - }, - /** - * Remove an entry from the file-entry-cache. Useful to force the file to still be considered - * modified the next time the process is run - * - * @method removeEntry - * @param entryName - */ - removeEntry: function(entryName) { - delete normalizedEntries[entryName]; - cache.removeKey(entryName); - }, - /** - * Delete the cache file from the disk - * @method deleteCacheFile - */ - deleteCacheFile: function() { - cache.removeCacheFile(); - }, - /** - * remove the cache from the file and clear the memory cache - */ - destroy: function() { - normalizedEntries = {}; - cache.destroy(); - }, - _getMetaForFileUsingCheckSum: function(cacheEntry) { - var contentBuffer = fs6.readFileSync(cacheEntry.key); - var hash = this.getHash(contentBuffer); - var meta = Object.assign(cacheEntry.meta, { hash }); - delete meta.size; - delete meta.mtime; - return meta; - }, - _getMetaForFileUsingMtimeAndSize: function(cacheEntry) { - var stat2 = fs6.statSync(cacheEntry.key); - var meta = Object.assign(cacheEntry.meta, { - size: stat2.size, - mtime: stat2.mtime.getTime() - }); - delete meta.hash; - return meta; - }, - /** - * Sync the files and persist them to the cache - * @method reconcile - */ - reconcile: function(noPrune) { - removeNotFoundFiles(); - noPrune = typeof noPrune === "undefined" ? true : noPrune; - var entries = normalizedEntries; - var keys = Object.keys(entries); - if (keys.length === 0) { - return; - } - var me = this; - keys.forEach(function(entryName) { - var cacheEntry = entries[entryName]; - try { - var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry); - cache.setKey(entryName, meta); - } catch (err) { - if (err.code !== "ENOENT") { - throw err; - } - } - }); - cache.save(noPrune); - } - }; + if (error2.name === "SyntaxError") { + import_write_file_atomic.default.sync(this._path, "", writeFileOptions); + return {}; } - }; + throw error2; + } } -}); + set all(value) { + try { + import_graceful_fs.default.mkdirSync(import_path2.default.dirname(this._path), mkdirOptions); + import_write_file_atomic.default.sync(this._path, JSON.stringify(value, void 0, " "), writeFileOptions); + } catch (error2) { + if (error2.code === "EACCES") { + error2.message = `${error2.message} +${permissionError} +`; + } + throw error2; + } + } + get size() { + return Object.keys(this.all || {}).length; + } + get(key) { + return import_dot_prop.default.get(this.all, key); + } + set(key, value) { + const config = this.all; + if (arguments.length === 1) { + for (const k of Object.keys(key)) { + import_dot_prop.default.set(config, k, key[k]); + } + } else { + import_dot_prop.default.set(config, key, value); + } + this.all = config; + } + has(key) { + return import_dot_prop.default.has(this.all, key); + } + delete(key) { + const config = this.all; + import_dot_prop.default.delete(config, key); + this.all = config; + } + clear() { + this.all = {}; + } + get path() { + return this._path; + } +}; -// node_modules/cspell/dist/lib/file-entry-cache.cjs -var require_file_entry_cache = __commonJS({ - "node_modules/cspell/dist/lib/file-entry-cache.cjs"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; +// node_modules/cspell-lib/dist/esm/Settings/cfgStore.mjs +var ConfigStore = Configstore; + +// node_modules/cspell-lib/dist/esm/Settings/GlobalSettings.mjs +var packageName = "cspell"; +function getRawGlobalSettings() { + const name = "CSpell Configstore"; + const globalConf = { + source: { + name, + filename: void 0 + } + }; + try { + const cfgStore = new ConfigStore(packageName); + const cfg = cfgStore.all; + if (cfg && Object.keys(cfg).length) { + Object.assign(globalConf, cfg); + globalConf.source = { + name, + filename: cfgStore.path + }; + } + } catch (error2) { + if (!isErrnoException(error2) || !error2.code || !["ENOENT", "EACCES", "ENOTDIR", "EISDIR"].includes(error2.code)) { + logError(error2); + } + } + return globalConf; +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/ImportError.mjs +var ImportError = class extends Error { + constructor(msg, cause) { + super(msg); + this.cause = isError2(cause) ? cause : void 0; + } +}; +var UnsupportedPnpFile = class extends Error { + constructor(msg) { + super(msg); + } +}; + +// node_modules/cspell-lib/dist/esm/Settings/Controller/pnpLoader.mjs +var import_clear_module = __toESM(require_clear_module(), 1); + +// node_modules/cspell-lib/node_modules/find-up/index.js +var import_node_path2 = __toESM(require("node:path"), 1); +var import_node_url2 = require("node:url"); + +// node_modules/cspell-lib/node_modules/locate-path/index.js +var import_node_process = __toESM(require("node:process"), 1); +var import_node_path = __toESM(require("node:path"), 1); +var import_node_fs = __toESM(require("node:fs"), 1); +var import_node_url = require("node:url"); + +// node_modules/cspell-lib/node_modules/yocto-queue/index.js +var Node = class { + value; + next; + constructor(value) { + this.value = value; + } +}; +var 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/cspell-lib/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, resolve13, args) => { + activeCount++; + const result = (async () => fn(...args))(); + resolve13(result); + try { + await result; + } catch { + } + next(); + }; + const enqueue = (fn, resolve13, args) => { + queue.enqueue(run2.bind(void 0, fn, resolve13, args)); + (async () => { + await Promise.resolve(); + if (activeCount < concurrency && queue.size > 0) { + queue.dequeue()(); } - Object.defineProperty(o, k2, desc); - } : 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.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); + })(); + }; + const generator = (fn, ...args) => new Promise((resolve13) => { + enqueue(fn, resolve13, args); + }); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.size + }, + clearQueue: { + value: () => { + queue.clear(); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFromFile = void 0; - var file_entry_cache = __importStar(require_cache2()); - function createFromFile3(pathToCache, useChecksum) { - return file_entry_cache.createFromFile(pathToCache, useChecksum); } - exports.createFromFile = createFromFile3; + }); + return generator; +} + +// node_modules/cspell-lib/node_modules/p-locate/index.js +var EndError = class extends Error { + constructor(value) { + super(); + this.value = value; + } +}; +var testElement = async (element, tester) => tester(await element); +var finder = async (element) => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + return false; +}; +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 (error2) { + if (error2 instanceof EndError) { + return error2.value; + } + throw error2; + } +} + +// node_modules/cspell-lib/node_modules/locate-path/index.js +var typeMappings = { + directory: "isDirectory", + file: "isFile" +}; +function checkType(type) { + if (Object.hasOwnProperty.call(typeMappings, type)) { + return; + } + throw new Error(`Invalid type specified: ${type}`); +} +var matchType = (type, stat2) => stat2[typeMappings[type]](); +var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath; +async function locatePath(paths, { + cwd = import_node_process.default.cwd(), + type = "file", + allowSymlinks = true, + concurrency, + preserveOrder +} = {}) { + checkType(type); + cwd = toPath(cwd); + const statFunction = allowSymlinks ? import_node_fs.promises.stat : import_node_fs.promises.lstat; + return pLocate(paths, async (path_) => { + try { + const stat2 = await statFunction(import_node_path.default.resolve(cwd, path_)); + return matchType(type, stat2); + } catch { + return false; + } + }, { concurrency, preserveOrder }); +} +function locatePathSync(paths, { + cwd = import_node_process.default.cwd(), + type = "file", + allowSymlinks = true +} = {}) { + checkType(type); + cwd = toPath(cwd); + const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync; + for (const path_ of paths) { + try { + const stat2 = statFunction(import_node_path.default.resolve(cwd, path_), { + throwIfNoEntry: false + }); + if (!stat2) { + continue; + } + if (matchType(type, stat2)) { + return path_; + } + } catch { + } + } +} + +// node_modules/cspell-lib/node_modules/find-up/index.js +var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath; +var findUpStop = Symbol("findUpStop"); +async function findUpMultiple(name, options = {}) { + let directory = import_node_path2.default.resolve(toPath2(options.cwd) || ""); + const { root } = import_node_path2.default.parse(directory); + const stopAt = import_node_path2.default.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(import_node_path2.default.resolve(directory, foundPath)); + } + if (directory === stopAt || matches.length >= limit) { + break; + } + directory = import_node_path2.default.dirname(directory); + } + return matches; +} +function findUpMultipleSync(name, options = {}) { + let directory = import_node_path2.default.resolve(toPath2(options.cwd) || ""); + const { root } = import_node_path2.default.parse(directory); + const stopAt = options.stopAt || root; + const limit = options.limit || Number.POSITIVE_INFINITY; + const paths = [name].flat(); + const runMatcher = (locateOptions) => { + if (typeof name !== "function") { + return locatePathSync(paths, locateOptions); + } + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === "string") { + return locatePathSync([foundPath], locateOptions); + } + return foundPath; + }; + const matches = []; + while (true) { + const foundPath = runMatcher({ ...options, cwd: directory }); + if (foundPath === findUpStop) { + break; + } + if (foundPath) { + matches.push(import_node_path2.default.resolve(directory, foundPath)); + } + if (directory === stopAt || matches.length >= limit) { + break; + } + directory = import_node_path2.default.dirname(directory); + } + return matches; +} +async function findUp(name, options = {}) { + const matches = await findUpMultiple(name, { ...options, limit: 1 }); + return matches[0]; +} +function findUpSync(name, options = {}) { + const matches = findUpMultipleSync(name, { ...options, limit: 1 }); + return matches[0]; +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/pnpLoader.mjs +var import_import_fresh = __toESM(require_import_fresh(), 1); +var defaultPnpFiles = [".pnp.cjs", ".pnp.js"]; +var supportedSchemas = /* @__PURE__ */ new Set(["file"]); +var cachedRequests = /* @__PURE__ */ new Map(); +var lock = void 0; +var cachedPnpImportsSync = /* @__PURE__ */ new Map(); +var cachedRequestsSync = /* @__PURE__ */ new Map(); +var PnpLoader = class { + constructor(pnpFiles = defaultPnpFiles) { + this.pnpFiles = pnpFiles; + this.cacheKeySuffix = ":" + pnpFiles.join(); + } + /** + * Request that the nearest .pnp file gets loaded + * @param uriDirectory starting directory + * @returns promise - rejects on error - success if loaded or not found. + */ + async load(uriDirectory) { + if (!supportedSchemas.has(uriDirectory.scheme)) + return void 0; + await lock; + const cacheKey = this.calcKey(uriDirectory); + const cached = cachedRequests.get(cacheKey); + if (cached) + return cached; + const r = findPnpAndLoad(uriDirectory, this.pnpFiles); + cachedRequests.set(cacheKey, r); + const result = await r; + cachedRequestsSync.set(cacheKey, result); + return result; + } + async peek(uriDirectory) { + if (!supportedSchemas.has(uriDirectory.scheme)) + return void 0; + await lock; + const cacheKey = this.calcKey(uriDirectory); + return cachedRequests.get(cacheKey) ?? Promise.resolve(void 0); + } + /** + * Request that the nearest .pnp file gets loaded + * @param uriDirectory starting directory + * @returns promise - rejects on error - success if loaded or not found. + */ + loadSync(uriDirectory) { + if (!supportedSchemas.has(uriDirectory.scheme)) + return void 0; + const cacheKey = this.calcKey(uriDirectory); + const cached = cachedRequestsSync.get(cacheKey); + if (cached) + return cached; + const r = findPnpAndLoadSync(uriDirectory, this.pnpFiles); + cachedRequestsSync.set(cacheKey, r); + cachedRequests.set(cacheKey, Promise.resolve(r)); + return r; + } + peekSync(uriDirectory) { + if (!supportedSchemas.has(uriDirectory.scheme)) + return void 0; + const cacheKey = this.calcKey(uriDirectory); + return cachedRequestsSync.get(cacheKey); + } + /** + * Clears the cached so .pnp files will get reloaded on request. + */ + clearCache() { + return clearPnPGlobalCache(); + } + calcKey(uriDirectory) { + return uriDirectory.toString() + this.cacheKeySuffix; + } +}; +function pnpLoader(pnpFiles) { + return new PnpLoader(pnpFiles); +} +async function findPnpAndLoad(uriDirectory, pnpFiles) { + const found = await findUp(pnpFiles, { cwd: uriToFilePath(uriDirectory) }); + return loadPnpIfNeeded(found); +} +function findPnpAndLoadSync(uriDirectory, pnpFiles) { + const found = findUpSync(pnpFiles, { cwd: uriToFilePath(uriDirectory) }); + return loadPnpIfNeeded(found); +} +function loadPnpIfNeeded(found) { + if (!found) + return void 0; + const c = cachedPnpImportsSync.get(found); + if (c || cachedPnpImportsSync.has(found)) + return c; + const r = loadPnp(found); + cachedPnpImportsSync.set(found, r); + return r; +} +function loadPnp(pnpFile) { + const pnp = (0, import_import_fresh.default)(pnpFile); + if (pnp.setup) { + pnp.setup(); + return toUri(pnpFile); } + throw new UnsupportedPnpFile(`Unsupported pnp file: "${pnpFile}"`); +} +function clearPnPGlobalCache() { + if (lock) + return lock; + lock = _cleanCache().finally(() => { + lock = void 0; + }); + return lock; +} +async function _cleanCache() { + await Promise.all([...cachedRequests.values()].map(rejectToUndefined)); + const modules = [...cachedPnpImportsSync.values()]; + modules.forEach((r) => r && import_clear_module.default.single(uriToFilePath(r))); + cachedRequests.clear(); + cachedRequestsSync.clear(); + cachedPnpImportsSync.clear(); + return void 0; +} +function rejectToUndefined(p) { + return p.catch(() => void 0); +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/defaultSettings.mjs +var defaultSettings = createCSpellSettingsInternal({ + id: "default", + name: "default", + version: currentSettingsFileVersion }); -// node_modules/import-meta-resolve/lib/errors.js -function formatList(array, type = "and") { - return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`; +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/normalizeRawSettings.mjs +var path9 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/toGlobDef.mjs +function toGlobDef(g, root, source) { + if (g === void 0) + return void 0; + if (Array.isArray(g)) { + return g.map((g2) => toGlobDef(g2, root, source)); + } + if (typeof g === "string") { + const glob2 = { glob: g }; + if (root !== void 0) { + glob2.root = root; + } + return toGlobDef(glob2, root, source); + } + if (source) { + return { ...g, source }; + } + return g; } -function createError(sym, value, def) { - messages.set(sym, value); - return makeNodeErrorWithCode(def, sym); + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/normalizeRawSettings.mjs +function normalizeRawConfig(config) { + if (typeof config.version === "number") { + config.version = config.version.toString(); + } } -function makeNodeErrorWithCode(Base, key) { - return NodeError; - function NodeError(...args) { - const limit = Error.stackTraceLimit; - if (isErrorStackTraceLimitWritable()) - Error.stackTraceLimit = 0; - const error2 = new Base(); - if (isErrorStackTraceLimitWritable()) - Error.stackTraceLimit = limit; - const message = getMessage(key, args, error2); - Object.defineProperties(error2, { - // Note: no need to implement `kIsNodeError` symbol, would be hard, - // probably. - message: { - value: message, - enumerable: false, - writable: true, - configurable: true - }, - toString: { - /** @this {Error} */ - value() { - return `${this.name} [${key}]: ${this.message}`; - }, - enumerable: false, - writable: true, - configurable: true - } +function normalizeDictionaryDefs(settings, pathToSettingsFile) { + const dictionaryDefinitions = mapDictDefsToInternal(settings.dictionaryDefinitions, pathToSettingsFile); + const languageSettings = settings.languageSettings?.map((langSetting) => clean({ + ...langSetting, + dictionaryDefinitions: mapDictDefsToInternal(langSetting.dictionaryDefinitions, pathToSettingsFile) + })); + return clean({ + dictionaryDefinitions, + languageSettings + }); +} +function normalizeOverrides(settings, pathToSettingsFile) { + const { globRoot = path9.dirname(pathToSettingsFile) } = settings; + const overrides = settings.overrides?.map((override) => { + const filename = toGlobDef(override.filename, globRoot, pathToSettingsFile); + const { dictionaryDefinitions, languageSettings } = normalizeDictionaryDefs(override, pathToSettingsFile); + return clean({ + ...override, + filename, + dictionaryDefinitions, + languageSettings: normalizeLanguageSettings(languageSettings) }); - captureLargerStackTrace(error2); - error2.code = key; - return error2; + }); + return overrides ? { overrides } : {}; +} +function normalizeReporters(settings, pathToSettingsFile) { + if (settings.reporters === void 0) + return {}; + const folder = path9.dirname(pathToSettingsFile); + function resolve13(s) { + if (s === "default") + return s; + const r = resolveFile(s, folder); + if (!r.found) { + throw new Error(`Not found: "${s}"`); + } + return r.filename; + } + function resolveReporter(s) { + if (typeof s === "string") { + return resolve13(s); + } + if (!Array.isArray(s) || typeof s[0] !== "string") + throw new Error("Invalid Reporter"); + const [r, ...rest] = s; + return [resolve13(r), ...rest]; + } + return { + reporters: settings.reporters.map(resolveReporter) + }; +} +function normalizeLanguageSettings(languageSettings) { + if (!languageSettings) + return void 0; + function fixLocale(s) { + const { local: locale, ...rest } = s; + return clean({ locale, ...rest }); + } + return languageSettings.map(fixLocale); +} +function normalizeGitignoreRoot(settings, pathToSettingsFile) { + const { gitignoreRoot } = settings; + if (!gitignoreRoot) + return {}; + const dir = path9.dirname(pathToSettingsFile); + const roots = Array.isArray(gitignoreRoot) ? gitignoreRoot : [gitignoreRoot]; + return { + gitignoreRoot: roots.map((p) => path9.resolve(dir, p)) + }; +} +function normalizeSettingsGlobs(settings, pathToSettingsFile) { + const { globRoot } = settings; + if (settings.ignorePaths === void 0) + return {}; + const ignorePaths = toGlobDef(settings.ignorePaths, globRoot, pathToSettingsFile); + return { + ignorePaths + }; +} +function normalizeCacheSettings(settings, pathToSettingsDir) { + const { cache: cache2 } = settings; + if (cache2 === void 0) + return {}; + const { cacheLocation } = cache2; + if (cacheLocation === void 0) + return { cache: cache2 }; + return { cache: { ...cache2, cacheLocation: resolveFilePath(cacheLocation, pathToSettingsDir) } }; +} +function resolveFilePath(filename, pathToSettingsFile) { + const cwd = process.cwd(); + return path9.resolve(pathToSettingsFile, filename.replace("${cwd}", cwd)); +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/PnPSettings.mjs +var defaultPnPSettings = Object.freeze({}); +var lastPnP = defaultPnPSettings; +function normalizePnPSettings(settings) { + if (equal(lastPnP, settings)) + return lastPnP; + if (equal(defaultPnPSettings, settings)) + return defaultPnPSettings; + const { usePnP, pnpFiles } = settings; + return lastPnP = clean({ usePnP, pnpFiles }); +} +function equal(a, b) { + return a === b || a.usePnP === b.usePnP && (a.pnpFiles === b.pnpFiles || a.pnpFiles?.join("|") === b.pnpFiles?.join("|")); +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/configLoader.mjs +var supportedCSpellConfigVersions = [configSettingsFileVersion0_2]; +var setOfSupportedConfigVersions = Object.freeze(new Set(supportedCSpellConfigVersions)); +var gcl = getDefaultConfigLoaderInternal; +var CACHE_SIZE_SEARCH_CONFIG = 32; +var searchPlaces = Object.freeze([ + "package.json", + // Original locations + ".cspell.json", + "cspell.json", + ".cSpell.json", + "cSpell.json", + // Original locations jsonc + ".cspell.jsonc", + "cspell.jsonc", + // Alternate locations + ".vscode/cspell.json", + ".vscode/cSpell.json", + ".vscode/.cspell.json", + // Standard Locations + "cspell.config.json", + "cspell.config.jsonc", + "cspell.config.yaml", + "cspell.config.yml", + "cspell.yaml", + "cspell.yml", + // Dynamic config is looked for last + "cspell.config.js", + "cspell.config.cjs", + // .config + ".config/.cspell.json", + ".config/cspell.json", + ".config/.cSpell.json", + ".config/cSpell.json", + ".config/.cspell.jsonc", + ".config/cspell.jsonc", + ".config/cspell.config.json", + ".config/cspell.config.jsonc", + ".config/cspell.config.yaml", + ".config/cspell.config.yml", + ".config/cspell.yaml", + ".config/cspell.yml", + ".config/cspell.config.js", + ".config/cspell.config.cjs" +]); +var cspellCosmiconfig = { + searchPlaces: searchPlaces.concat(), + loaders: { + ".json": parseJson, + ".jsonc": parseJson } +}; +function parseJson(_filename, content) { + return json.parse(content); } -function isErrorStackTraceLimitWritable() { - try { - if (import_node_v8.default.startupSnapshot.isBuildingSnapshot()) { - return false; +var defaultConfigFilenames = Object.freeze(searchPlaces.concat()); +var defaultConfigLoader = void 0; +var ConfigLoader = class { + /** + * Use `createConfigLoader` + * @param cspellIO - CSpellIO interface for reading files. + */ + constructor(cspellIO2) { + this.cspellIO = cspellIO2; + this.cachedFiles = /* @__PURE__ */ new Map(); + this.cspellConfigExplorer = (0, import_cosmiconfig.cosmiconfig)("cspell", cspellCosmiconfig); + this.cspellConfigExplorerSync = (0, import_cosmiconfig.cosmiconfigSync)("cspell", cspellCosmiconfig); + this.searchConfigLRU = new AutoResolveLRUCache(CACHE_SIZE_SEARCH_CONFIG, (a, b) => a.searchFrom === b.searchFrom && a.pnpSettings === b.pnpSettings); + } + readSettings(filename, relativeToOrDefault, defaultValue) { + const relativeTo = (typeof relativeToOrDefault === "string" ? relativeToOrDefault : "") || process.cwd(); + defaultValue = defaultValue || (typeof relativeToOrDefault !== "string" ? relativeToOrDefault : void 0); + const ref = resolveFilename(filename, relativeTo); + return this.importSettings(ref, defaultValue, defaultValue || defaultPnPSettings); + } + async readSettingsAsync(filename, relativeTo, pnpSettings) { + const ref = resolveFilename(filename, relativeTo || process.cwd()); + return this.importSettings(ref, void 0, pnpSettings || defaultPnPSettings); + } + /** + * + * @param searchFrom the directory / file to start searching from. + * @param pnpSettings - related to Using Yarn PNP. + * @returns the resulting settings + */ + searchForConfig(searchFrom, pnpSettings = defaultPnPSettings) { + pnpSettings = normalizePnPSettings(pnpSettings); + return this.searchConfigLRU.get({ searchFrom, pnpSettings }, (p) => this._searchForConfig(p)); + } + _searchForConfig(params) { + return gcl().normalizeSearchForConfigResultAsync(params.searchFrom || process.cwd(), this.cspellConfigExplorer.search(params.searchFrom), params.pnpSettings).then((r) => r.filepath ? r.config : void 0); + } + getGlobalSettings() { + if (!this.globalSettings) { + const globalConf = getRawGlobalSettings(); + this.globalSettings = { + id: "global_config", + ...this.normalizeSettings(globalConf || {}, "./global_config", {}) + }; } - } catch { + return this.globalSettings; } - const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit"); - if (desc === void 0) { - return Object.isExtensible(Error); + clearCachedSettingsFiles() { + this.searchConfigLRU.clear(); + this.globalSettings = void 0; + this.cachedFiles.clear(); + this.cspellConfigExplorer.clearCaches(); + this.cspellConfigExplorerSync.clearCaches(); } - return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0; + /** + * Read a config file and inject the fileRef. + * @param fileRef - filename plus context, injected into the resulting config. + */ + readConfig(fileRef) { + const { filename, error: error2 } = fileRef; + if (error2) { + fileRef.error = error2 instanceof ImportError ? error2 : new ImportError(`Failed to read config file: "${filename}"`, error2); + return { __importRef: fileRef }; + } + const s = {}; + try { + const r = this.cspellConfigExplorerSync.load(filename); + if (!r?.config) + throw new Error(`not found: "${filename}"`); + Object.assign(s, r.config); + normalizeRawConfig(s); + validateRawConfig(s, fileRef); + } catch (err) { + fileRef.error = err instanceof ImportError ? err : new ImportError(`Failed to read config file: "${filename}"`, err); + } + s.__importRef = fileRef; + return s; + } + importSettings(fileRef, defaultValues, pnpSettings) { + defaultValues = defaultValues ?? defaultSettings; + const { filename } = fileRef; + const importRef = { ...fileRef }; + const cached = this.cachedFiles.get(filename); + if (cached) { + const cachedImportRef = cached.__importRef || importRef; + cachedImportRef.referencedBy = mergeSourceList(cachedImportRef.referencedBy || [], importRef.referencedBy); + cached.__importRef = cachedImportRef; + return cached; + } + const id = [path10.basename(path10.dirname(filename)), path10.basename(filename)].join("/"); + const name = ""; + const finalizeSettings2 = createCSpellSettingsInternal({ id, name, __importRef: importRef }); + this.cachedFiles.set(filename, finalizeSettings2); + const settings = { ...defaultValues, id, name, ...this.readConfig(importRef) }; + Object.assign(finalizeSettings2, this.normalizeSettings(settings, filename, pnpSettings)); + const finalizeSrc = { name: path10.basename(filename), ...finalizeSettings2.source }; + finalizeSettings2.source = { ...finalizeSrc, filename }; + this.cachedFiles.set(filename, finalizeSettings2); + return finalizeSettings2; + } + /** + * normalizeSettings handles correcting all relative paths, anchoring globs, and importing other config files. + * @param rawSettings - raw configuration settings + * @param pathToSettingsFile - path to the source file of the configuration settings. + */ + normalizeSettings(rawSettings, pathToSettingsFile, pnpSettings) { + const id = rawSettings.id || [path10.basename(path10.dirname(pathToSettingsFile)), path10.basename(pathToSettingsFile)].join("/"); + const name = rawSettings.name || id; + const { usePnP = pnpSettings.usePnP, pnpFiles = pnpSettings.pnpFiles } = rawSettings; + const pnpSettingsToUse = normalizePnPSettings({ usePnP, pnpFiles }); + const pathToSettingsDir = path10.dirname(pathToSettingsFile); + loadPnPSync(pnpSettingsToUse, toUri(pathToSettingsDir)); + const settings = { + version: defaultSettings.version, + ...rawSettings, + id, + name, + globRoot: resolveGlobRoot(rawSettings, pathToSettingsFile), + languageSettings: normalizeLanguageSettings(rawSettings.languageSettings) + }; + const pathToSettings = path10.dirname(pathToSettingsFile); + const normalizedDictionaryDefs = normalizeDictionaryDefs(settings, pathToSettingsFile); + const normalizedSettingsGlobs = normalizeSettingsGlobs(settings, pathToSettingsFile); + const normalizedOverrides = normalizeOverrides(settings, pathToSettingsFile); + const normalizedReporters = normalizeReporters(settings, pathToSettingsFile); + const normalizedGitignoreRoot = normalizeGitignoreRoot(settings, pathToSettingsFile); + const normalizedCacheSettings = normalizeCacheSettings(settings, pathToSettingsDir); + const imports = typeof settings.import === "string" ? [settings.import] : settings.import || []; + const source = settings.source || { + name: settings.name, + filename: pathToSettingsFile + }; + const fileSettings = createCSpellSettingsInternal({ + ...settings, + source, + ...normalizedDictionaryDefs, + ...normalizedSettingsGlobs, + ...normalizedOverrides, + ...normalizedReporters, + ...normalizedGitignoreRoot, + ...normalizedCacheSettings + }); + if (!imports.length) { + return fileSettings; + } + const importedSettings = imports.map((name2) => resolveFilename(name2, pathToSettings)).map((ref) => (ref.referencedBy = [source], ref)).map((ref) => this.importSettings(ref, void 0, pnpSettingsToUse)).reduce((a, b) => mergeSettings(a, b)); + const finalizeSettings2 = mergeSettings(importedSettings, fileSettings); + finalizeSettings2.name = settings.name || finalizeSettings2.name || ""; + finalizeSettings2.id = settings.id || finalizeSettings2.id || ""; + return finalizeSettings2; + } +}; +var ConfigLoaderInternal = class extends ConfigLoader { + constructor(cspellIO2) { + super(cspellIO2); + this._readConfig = this.readConfig.bind(this); + this._normalizeSettings = this.normalizeSettings.bind(this); + } + get _cachedFiles() { + return this.cachedFiles; + } + get _cspellConfigExplorer() { + return this.cspellConfigExplorer; + } + get _cspellConfigExplorerSync() { + return this.cspellConfigExplorerSync; + } + async normalizeSearchForConfigResultAsync(searchPath, searchResult, pnpSettings) { + let result; + try { + result = await searchResult || void 0; + } catch (cause) { + result = new ImportError(`Failed to find config file at: "${searchPath}"`, cause); + } + return this.normalizeSearchForConfigResult(searchPath, result, pnpSettings); + } + normalizeSearchForConfigResult(searchPath, searchResult, pnpSettings) { + const error2 = searchResult instanceof ImportError ? searchResult : void 0; + const result = searchResult instanceof ImportError ? void 0 : searchResult; + const filepath = result?.filepath; + if (filepath) { + const cached = cachedFiles().get(filepath); + if (cached) { + return { + config: cached, + filepath, + error: error2 + }; + } + } + const { config = createCSpellSettingsInternal({}) } = result || {}; + const filename = result?.filepath ?? searchPath; + const importRef = { filename, error: error2 }; + const id = [path10.basename(path10.dirname(filename)), path10.basename(filename)].join("/"); + const name = result?.filepath ? id : `Config not found: ${id}`; + const finalizeSettings2 = createCSpellSettingsInternal({ id, name, __importRef: importRef }); + const settings = { id, ...config }; + cachedFiles().set(filename, finalizeSettings2); + Object.assign(finalizeSettings2, this.normalizeSettings(settings, filename, pnpSettings)); + return { + config: finalizeSettings2, + filepath, + error: error2 + }; + } +}; +function mergeSourceList(orig, append) { + const collection = new Map(orig.map((s) => [s.name + (s.filename || ""), s])); + for (const s of append || []) { + const key = s.name + (s.filename || ""); + if (!collection.has(key)) { + collection.set(key, s); + } + } + return [...collection.values()]; } -function hideStackFrames(fn) { - const hidden = nodeInternalPrefix + fn.name; - Object.defineProperty(fn, "name", { value: hidden }); - return fn; +function searchForConfig(searchFrom, pnpSettings = defaultPnPSettings) { + return gcl().searchForConfig(searchFrom, pnpSettings); } -function getMessage(key, args, self) { - const message = messages.get(key); - (0, import_node_assert.default)(typeof message !== "undefined", "expected `message` to be found"); - if (typeof message === "function") { - (0, import_node_assert.default)( - message.length <= args.length, - // Default options do not count. - `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).` - ); - return Reflect.apply(message, self, args); +function searchForConfigSync(searchFrom, pnpSettings = defaultPnPSettings) { + pnpSettings = normalizePnPSettings(pnpSettings); + let searchResult; + try { + searchResult = cspellConfigExplorerSync().search(searchFrom) || void 0; + } catch (err) { + searchResult = new ImportError(`Failed to find config file from: "${searchFrom}"`, err); } - const regex = /%[dfijoOs]/g; - let expectedLength = 0; - while (regex.exec(message) !== null) - expectedLength++; - (0, import_node_assert.default)( - expectedLength === args.length, - `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).` - ); - if (args.length === 0) - return message; - args.unshift(message); - return Reflect.apply(import_node_util.format, null, args); + return gcl().normalizeSearchForConfigResult(searchFrom || process.cwd(), searchResult, pnpSettings).config; } -var import_node_v8, import_node_process, import_node_assert, import_node_util, isWindows, own, codes, messages, nodeInternalPrefix, userStackTraceLimit, captureLargerStackTrace; -var init_errors = __esm({ - "node_modules/import-meta-resolve/lib/errors.js"() { - import_node_v8 = __toESM(require("node:v8"), 1); - import_node_process = __toESM(require("node:process"), 1); - import_node_assert = __toESM(require("node:assert"), 1); - import_node_util = require("node:util"); - isWindows = import_node_process.default.platform === "win32"; - own = {}.hasOwnProperty; - codes = {}; - messages = /* @__PURE__ */ new Map(); - nodeInternalPrefix = "__node_internal_"; - codes.ERR_INVALID_MODULE_SPECIFIER = createError( - "ERR_INVALID_MODULE_SPECIFIER", - /** - * @param {string} request - * @param {string} reason - * @param {string} [base] - */ - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`; - }, - TypeError - ); - codes.ERR_INVALID_PACKAGE_CONFIG = createError( - "ERR_INVALID_PACKAGE_CONFIG", - /** - * @param {string} path - * @param {string} [base] - * @param {string} [message] - */ - (path16, base, message) => { - return `Invalid package config ${path16}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`; - }, - Error - ); - codes.ERR_INVALID_PACKAGE_TARGET = createError( - "ERR_INVALID_PACKAGE_TARGET", - /** - * @param {string} pkgPath - * @param {string} key - * @param {unknown} target - * @param {boolean} [isImport=false] - * @param {string} [base] - */ - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./"); - if (key === ".") { - (0, import_node_assert.default)(isImport === false); - return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`; - } - return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`; - }, - Error - ); - codes.ERR_MODULE_NOT_FOUND = createError( - "ERR_MODULE_NOT_FOUND", - /** - * @param {string} path - * @param {string} base - * @param {string} [type] - */ - (path16, base, type = "package") => { - return `Cannot find ${type} '${path16}' imported from ${base}`; - }, - Error - ); - codes.ERR_NETWORK_IMPORT_DISALLOWED = createError( - "ERR_NETWORK_IMPORT_DISALLOWED", - "import of '%s' by %s is not supported: %s", - Error - ); - codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError( - "ERR_PACKAGE_IMPORT_NOT_DEFINED", - /** - * @param {string} specifier - * @param {string} packagePath - * @param {string} base - */ - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`; - }, - TypeError - ); - codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - /** - * @param {string} pkgPath - * @param {string} subpath - * @param {string} [base] - */ - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error - ); - codes.ERR_UNSUPPORTED_DIR_IMPORT = createError( - "ERR_UNSUPPORTED_DIR_IMPORT", - "Directory import '%s' is not supported resolving ES modules imported from %s", - Error - ); - codes.ERR_UNKNOWN_FILE_EXTENSION = createError( - "ERR_UNKNOWN_FILE_EXTENSION", - /** - * @param {string} ext - * @param {string} path - */ - (ext, path16) => { - return `Unknown file extension "${ext}" for ${path16}`; - }, - TypeError - ); - codes.ERR_INVALID_ARG_VALUE = createError( - "ERR_INVALID_ARG_VALUE", - /** - * @param {string} name - * @param {unknown} value - * @param {string} [reason='is invalid'] - */ - (name, value, reason = "is invalid") => { - let inspected = (0, import_node_util.inspect)(value); - if (inspected.length > 128) { - inspected = `${inspected.slice(0, 128)}...`; - } - const type = name.includes(".") ? "property" : "argument"; - return `The ${type} '${name}' ${reason}. Received ${inspected}`; - }, - TypeError - // Note: extra classes have been shaken out. - // , RangeError - ); - codes.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError( - "ERR_UNSUPPORTED_ESM_URL_SCHEME", - /** - * @param {URL} url - * @param {Array} supported - */ - (url, supported) => { - let message = `Only URLs with a scheme in: ${formatList( - supported - )} are supported by the default ESM loader`; - if (isWindows && url.protocol.length === 2) { - message += ". On Windows, absolute paths must be valid file:// URLs"; - } - message += `. Received protocol '${url.protocol}'`; - return message; - }, - Error - ); - captureLargerStackTrace = hideStackFrames( - /** - * @param {Error} error - * @returns {Error} - */ - // @ts-expect-error: fine - function(error2) { - const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); - if (stackTraceLimitIsWritable) { - userStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = Number.POSITIVE_INFINITY; - } - Error.captureStackTrace(error2); - if (stackTraceLimitIsWritable) - Error.stackTraceLimit = userStackTraceLimit; - return error2; - } - ); +async function loadConfig(file, pnpSettings = defaultPnPSettings) { + return gcl().readSettingsAsync(file, void 0, pnpSettings); +} +function loadConfigSync(filename, pnpSettings = defaultPnPSettings) { + const pnp = normalizePnPSettings(pnpSettings); + return gcl().readSettings(filename, pnp); +} +function loadPnPSync(pnpSettings, searchFrom) { + if (!pnpSettings.usePnP) { + return void 0; + } + const loader2 = pnpLoader(pnpSettings.pnpFiles); + return loader2.loadSync(searchFrom); +} +function resolveFilename(filename, relativeTo) { + const r = resolveFile(filename, relativeTo); + return { + filename: r.filename, + error: r.found ? void 0 : new Error(`Failed to resolve file: "${filename}"`) + }; +} +function getGlobalSettings() { + return gcl().getGlobalSettings(); +} +var nestedConfigDirectories = { + ".vscode": true, + ".config": true +}; +function resolveGlobRoot(settings, pathToSettingsFile) { + const settingsFileDirRaw = path10.dirname(pathToSettingsFile); + const settingsFileDirName = path10.basename(settingsFileDirRaw); + const isNestedConfig = settingsFileDirName in nestedConfigDirectories; + const isVSCode = settingsFileDirName === ".vscode"; + const settingsFileDir = isNestedConfig ? path10.dirname(settingsFileDirRaw) : settingsFileDirRaw; + const envGlobRoot = process.env[ENV_CSPELL_GLOB_ROOT]; + const defaultGlobRoot = envGlobRoot ?? "${cwd}"; + const rawRoot = settings.globRoot ?? (settings.version === configSettingsFileVersion0_1 || envGlobRoot && !settings.version || isVSCode && !settings.version ? defaultGlobRoot : settingsFileDir); + const globRoot = rawRoot.startsWith("${cwd}") ? rawRoot : path10.resolve(settingsFileDir, rawRoot); + return globRoot; +} +function validationMessage(msg, fileRef) { + return msg + ` + File: "${fileRef.filename}"`; +} +function validateRawConfigVersion(config, fileRef) { + const { version: version4 } = config; + if (version4 === void 0) + return; + if (typeof version4 !== "string") { + logError(validationMessage(`Unsupported config file version: "${version4}", string expected`, fileRef)); + return; + } + if (setOfSupportedConfigVersions.has(version4)) + return; + if (!/^\d+(\.\d+)*$/.test(version4)) { + logError(validationMessage(`Unsupported config file version: "${version4}"`, fileRef)); + return; + } + const msg = version4 > currentSettingsFileVersion ? `Newer config file version found: "${version4}". Supported version is "${currentSettingsFileVersion}"` : `Legacy config file version found: "${version4}", upgrade to "${currentSettingsFileVersion}"`; + logWarning(validationMessage(msg, fileRef)); +} +function validateRawConfigExports(config, fileRef) { + if (config.default) { + throw new ImportError(validationMessage("Module `export default` is not supported.\n Use `module.exports =` instead.", fileRef)); + } +} +function validateRawConfig(config, fileRef) { + const validations = [validateRawConfigExports, validateRawConfigVersion]; + validations.forEach((fn) => fn(config, fileRef)); +} +function createConfigLoaderInternal(cspellIO2) { + return new ConfigLoaderInternal(cspellIO2 ?? getDefaultCSpellIO()); +} +function getDefaultConfigLoaderInternal() { + if (defaultConfigLoader) + return defaultConfigLoader; + return defaultConfigLoader = createConfigLoaderInternal(); +} +function getDefaultConfigLoader() { + return getDefaultConfigLoaderInternal(); +} +function cachedFiles() { + return gcl()._cachedFiles; +} +function cspellConfigExplorerSync() { + return gcl()._cspellConfigExplorerSync; +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/extractImportErrors.mjs +function extractImportErrors(settings) { + const imports = mergeImportRefs2(settings); + return !imports ? [] : [...imports.values()].filter(isImportFileRefWithError); +} +function mergeImportRefs2(left, right = {}) { + const imports = new Map(left.__imports || []); + if (left.__importRef) { + imports.set(left.__importRef.filename, left.__importRef); + } + if (right.__importRef) { + imports.set(right.__importRef.filename, right.__importRef); + } + const rightImports = right.__imports?.values() || []; + for (const ref of rightImports) { + imports.set(ref.filename, ref); + } + return imports.size ? imports : void 0; +} +function isImportFileRefWithError(ref) { + return !!ref.error; +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/readSettings.mjs +function readSettings(filename, relativeToOrDefault, defaultValue) { + const loader2 = getDefaultConfigLoader(); + if (typeof relativeToOrDefault !== "string" || defaultValue === void 0) + return loader2.readSettings(filename, relativeToOrDefault); + return loader2.readSettings(filename, relativeToOrDefault, defaultValue); +} + +// node_modules/cspell-lib/dist/esm/util/text.mjs +var text_exports = {}; +__export(text_exports, { + __testing__: () => __testing__2, + calculateTextDocumentOffsets: () => calculateTextDocumentOffsets, + camelToSnake: () => camelToSnake, + cleanText: () => cleanText, + cleanTextOffset: () => cleanTextOffset, + extractLinesOfText: () => extractLinesOfText, + extractPossibleWordsFromTextOffset: () => extractPossibleWordsFromTextOffset, + extractText: () => extractText, + extractWordsFromCode: () => extractWordsFromCode, + extractWordsFromCodeTextOffset: () => extractWordsFromCodeTextOffset, + extractWordsFromText: () => extractWordsFromText, + extractWordsFromTextOffset: () => extractWordsFromTextOffset, + isFirstCharacterLower: () => isFirstCharacterLower, + isFirstCharacterUpper: () => isFirstCharacterUpper, + isLowerCase: () => isLowerCase, + isUpperCase: () => isUpperCase, + lcFirst: () => lcFirst, + match: () => match, + matchCase: () => matchCase, + matchStringToTextOffset: () => matchStringToTextOffset, + matchToTextOffset: () => matchToTextOffset, + removeAccents: () => removeAccents, + snakeToCamel: () => snakeToCamel, + splitCamelCaseWord: () => splitCamelCaseWord, + splitCamelCaseWordWithOffset: () => splitCamelCaseWordWithOffset, + stringToRegExp: () => stringToRegExp, + textOffset: () => textOffset, + ucFirst: () => ucFirst +}); + +// node_modules/cspell-lib/dist/esm/util/search.mjs +function binarySearch(arr, item, leftOffset, rightOffset) { + let left = Math.max(leftOffset ?? 0, 0); + let right = Math.min(rightOffset ?? arr.length, arr.length); + while (left < right) { + const pos = left + right >> 1; + if (arr[pos] < item) { + left = pos + 1; + } else { + right = pos; + } } -}); + return left; +} -// node_modules/import-meta-resolve/lib/package-json-reader.js -function read(jsonPath) { - try { - const string = import_node_fs.default.readFileSync( - import_node_path.default.toNamespacedPath(import_node_path.default.join(import_node_path.default.dirname(jsonPath), "package.json")), - "utf8" - ); - return { string }; - } catch (error2) { - const exception = ( - /** @type {ErrnoException} */ - error2 - ); - if (exception.code === "ENOENT") { - return { string: void 0 }; +// node_modules/cspell-lib/dist/esm/util/text.mjs +function splitCamelCaseWordWithOffset(wo) { + return splitCamelCaseWord(wo.text).map(scanMap((last, text) => ({ text, offset: last.offset + last.text.length }), { + text: "", + offset: wo.offset + })); +} +function splitCamelCaseWord(word) { + const wPrime = word.replace(regExUpperSOrIng, (s) => s[0] + s.slice(1).toLowerCase()); + const separator = "_<^*_*^>_"; + const pass1 = wPrime.replace(regExSplitWords, "$1" + separator + "$2"); + const pass2 = pass1.replace(regExSplitWords2, "$1" + separator + "$2"); + return pass2.split(separator); +} +function match(reg, text) { + return sequenceFromRegExpMatch(reg, text); +} +function matchStringToTextOffset(reg, text) { + return matchToTextOffset(reg, { text, offset: 0 }); +} +function matchToTextOffset(reg, text) { + const textOffset2 = text; + const fnOffsetMap = offsetMap(textOffset2.offset); + textOffset2.text.matchAll(reg); + return pipeSync(match(reg, textOffset2.text), opMapSync((m) => fnOffsetMap({ text: m[0], offset: m.index || 0 }))); +} +function* extractLinesOfText(text) { + let i = 0; + for (let j = text.indexOf("\n", i); j >= 0; j = text.indexOf("\n", i)) { + const end = j + 1; + yield { text: text.slice(i, end), offset: i }; + i = end; + } + yield { text: text.slice(i, text.length), offset: i }; +} +function extractWordsFromText(text) { + return extractWordsFromTextOffset(textOffset(text)); +} +function extractWordsFromTextOffset(text) { + const reg = new RegExp(regExWords); + return matchToTextOffset(reg, cleanTextOffset(text)); +} +function cleanText(text) { + text = text.replace(regExIgnoreCharacters, (match2) => " ".repeat(match2.length)); + return text; +} +function cleanTextOffset(text) { + return { + text: cleanText(text.text), + offset: text.offset + }; +} +function extractPossibleWordsFromTextOffset(text) { + const reg = new RegExp(regExWordsAndDigits); + return matchToTextOffset(reg, text); +} +function extractWordsFromCode(text) { + return extractWordsFromCodeTextOffset(textOffset(text)); +} +function extractWordsFromCodeTextOffset(textOffset2) { + return pipeSync(extractWordsFromTextOffset(textOffset2), opConcatMapSync(splitCamelCaseWordWithOffset)); +} +function isUpperCase(word) { + return !!word.match(regExAllUpper); +} +function isLowerCase(word) { + return !!word.match(regExAllLower); +} +function isFirstCharacterUpper(word) { + return isUpperCase(word.slice(0, 1)); +} +function isFirstCharacterLower(word) { + return isLowerCase(word.slice(0, 1)); +} +function ucFirst(word) { + return word.slice(0, 1).toUpperCase() + word.slice(1); +} +function lcFirst(word) { + return word.slice(0, 1).toLowerCase() + word.slice(1); +} +function snakeToCamel(word) { + return word.split("_").map(ucFirst).join(""); +} +function camelToSnake(word) { + return splitCamelCaseWord(word).join("_").toLowerCase(); +} +function matchCase(example, word) { + if (example.match(regExFirstUpper)) { + return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase(); + } + if (example.match(regExAllLower)) { + return word.toLowerCase(); + } + if (example.match(regExAllUpper)) { + return word.toUpperCase(); + } + if (isFirstCharacterUpper(example)) { + return ucFirst(word); + } + if (isFirstCharacterLower(example)) { + return lcFirst(word); + } + return word; +} +function textOffset(text, offset = 0) { + return { text, offset }; +} +function extractText(textOffset2, startPos, endPos) { + const { text, offset: orig } = textOffset2; + const a = Math.max(startPos - orig, 0); + const b = Math.max(endPos - orig, 0); + return text.slice(a, b); +} +function offsetMap(offset) { + return (xo) => ({ ...xo, offset: xo.offset + offset }); +} +function calculateTextDocumentOffsets(uri, doc, wordOffsets) { + const lines = [ + -1, + ...pipeSync(match(/\n/g, doc), opMapSync((a) => a.index)), + doc.length + ]; + let lastRow = -1; + let lastOffset = doc.length + 1; + let lastLineRow = -1; + let lastLine; + function findRowCol(offset) { + const row = binarySearch(lines, offset, offset >= lastOffset ? lastRow : void 0); + const col = offset - lines[Math.max(0, row - 1)]; + lastOffset = offset; + lastRow = row; + return [row, col]; + } + function extractLine(row) { + const offset = lines[row - 1] + 1; + const text = doc.slice(offset, lines[row] + 1); + return { text, offset }; + } + function calcLine(row) { + const last = lastLineRow === row ? lastLine : void 0; + lastLineRow = row; + const r = last ?? extractLine(row); + lastLine = r; + return r; + } + const _uri = toUri(uri).toString(); + return wordOffsets.map((wo) => { + const [row, col] = findRowCol(wo.offset); + return { ...wo, row, col, doc, uri: _uri, line: calcLine(row) }; + }); +} +function removeAccents(text) { + return text.normalize("NFD").replace(regExAccents, ""); +} +var __testing__2 = { + regExWords, + regExWordsAndDigits +}; + +// node_modules/cspell-lib/dist/esm/LanguageIds.mjs +var languageExtensionDefinitions = [ + { id: "ada", extensions: [".adb", ".ads"] }, + { id: "apiblueprint", extensions: [".apib", ".apiblueprint"] }, + { id: "asciidoc", extensions: [".adoc", ".asc", ".asciidoc"] }, + { id: "bat", extensions: [".bat", ".cmd"] }, + { id: "clojure", extensions: [".clj", ".cljs", ".cljx", ".clojure", ".edn"] }, + { id: "coffeescript", extensions: [".coffee", ".cson"] }, + { id: "c", extensions: [".c"] }, + // cspell:ignore cmake + { id: "cmake", extensions: [".cmake"], filenames: ["CMakeLists.txt"] }, + { + id: "cpp", + extensions: [".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".h", ".mm", ".ino", ".inl"] + }, + { id: "csharp", extensions: [".cs"] }, + { id: "css", extensions: [".css"] }, + { id: "dhall", extensions: [".dhall"] }, + { id: "diff", extensions: [".diff", ".patch", ".rej"] }, + { id: "dockerfile", extensions: [".dockerfile"], filenames: ["Dockerfile"] }, + { id: "elixir", extensions: [".ex", ".exs"] }, + { id: "fsharp", extensions: [".fs", ".fsi", ".fsx", ".fsscript"] }, + { id: "go", extensions: [".go"] }, + { id: "groovy", extensions: [".groovy", ".gvy", ".gradle"] }, + { id: "handlebars", extensions: [".handlebars", ".hbs"] }, + { id: "haskell", extensions: [".hs", ".lhs"] }, + { + id: "html", + extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm", ".volt", ".vue"] + }, + { id: "ini", extensions: [".ini", ".conf"] }, + { id: "properties", extensions: [".properties", ".gitconfig", ".cfg", ".conf"] }, + { id: "jade", extensions: [".jade", ".pug"] }, + { id: "java", extensions: [".java", ".jav"] }, + { id: "javascriptreact", extensions: [".jsx"] }, + { id: "javascript", extensions: [".js", ".mjs", ".es6", ".cjs"] }, + { + id: "json", + extensions: [".json", ".jsonc", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc", ".babelrc", ".webmanifest"] + }, + { id: "jsonc", extensions: [".jsonc"] }, + { id: "jsonc", extensions: [".code-workspace"], filenames: [".code-workspace"] }, + { id: "jungle", extensions: [".jungle"] }, + { id: "less", extensions: [".less"] }, + { id: "literate haskell", extensions: [".lhs"] }, + { id: "lua", extensions: [".lua"] }, + { id: "makefile", extensions: [".mk"] }, + { id: "markdown", extensions: [".md", ".mdown", ".markdown", ".markdn"] }, + { id: "mdx", extensions: [".mdx"] }, + { id: "monkeyc", extensions: [".mc", ".mb"] }, + { id: "objective-c", extensions: [".m"] }, + { id: "perl", extensions: [".pl", ".pm", ".pod", ".t", ".PL", ".psgi"] }, + { id: "perl6", extensions: [".p6", ".pl6", ".pm6", ".nqp"] }, + { id: "php", extensions: [".php", ".php4", ".php5", ".phtml", ".ctp"] }, + { id: "plaintext", extensions: [".txt"] }, + { id: "powershell", extensions: [".ps1", ".psm1", ".psd1", ".pssc", ".psrc"] }, + { id: "purescript", extensions: [".purs"] }, + { id: "python", extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"] }, + { id: "r", extensions: [".r", ".R", ".rhistory", ".rprofile", ".rt"] }, + { id: "razor", extensions: [".cshtml"] }, + { id: "ruby", extensions: [".rb", ".rbx", ".rjs", ".gemspec", ".rake", ".ru"] }, + { id: "ruby", extensions: [], filenames: ["Gemfile"] }, + { id: "rust", extensions: [".rs"] }, + { id: "scala", extensions: [".scala", ".sc", ".sbt"] }, + { id: "scss", extensions: [".scss"] }, + { id: "shaderlab", extensions: [".shader", ".cginc"] }, + { + id: "shellscript", + extensions: [ + ".sh", + ".bash", + ".bashrc", + ".bash_aliases", + ".bash_profile", + ".bash_login", + ".ebuild", + ".install", + ".profile", + ".bash_logout", + ".zsh", + ".zshrc", + ".zprofile", + ".zlogin", + ".zlogout", + ".zshenv", + ".zsh-theme" + ] + }, + { id: "sql", extensions: [".sql", ".dsql"] }, + { id: "svelte", extensions: [".svelte"] }, + { id: "swift", extensions: [".swift"] }, + { id: "toml", extensions: [".toml"] }, + { id: "typescript", extensions: [".ts", ".cts", ".mts"] }, + { id: "typescriptreact", extensions: [".tsx"] }, + { id: "vb", extensions: [".vb", ".brs", ".vbs", ".bas"] }, + { id: "vue", extensions: [".vue"] }, + { + id: "xml", + extensions: [ + ".ascx", + ".atom", + ".axml", + ".bpmn", + ".config", + ".cpt", + ".csl", + ".csproj.user", + ".csproj", + ".dita", + ".ditamap", + ".dtd", + ".dtml", + ".ent", + ".fsproj", + ".fxml", + ".iml", + ".isml", + ".jmx", + ".launch", + ".menu", + ".mod", + ".mxml", + ".nuspec", + ".opml", + ".owl", + ".proj", + ".pt", + ".pubxml.user", + ".pubxml", + ".rdf", + ".rng", + ".rss", + ".shproj", + ".storyboard", + ".svg", + ".targets", + ".tld", + ".tmx", + ".vbproj.user", + ".vbproj", + ".vcxproj.filters", + ".vcxproj", + ".wsdl", + ".wxi", + ".wxl", + ".wxs", + ".xaml", + ".xbl", + ".xib", + ".xlf", + ".xliff", + ".xml", + ".xoml", + ".xpdl", + ".xsd", + ".xul" + ] + }, + { id: "wheel", extensions: [".whl"], format: "Binary" }, + { id: "xsl", extensions: [".xsl", ".xslt"] }, + { id: "yaml", extensions: [".eyaml", ".eyml", ".yaml", ".yml"] }, + { id: "latex", extensions: [".tex"] }, + { id: "map", extensions: [".map"] }, + { id: "pdf", extensions: [".pdf"] }, + { id: "rsa", extensions: [".pub"], filenames: ["id_rsa", "id_rsa.pub"] }, + { id: "pem", extensions: [".private-key.pem", ".pem"] }, + { id: "pem-private-key", extensions: [".private-key.pem"] }, + // + // Special file types used to prevent spell checking. + // + { + id: "image", + extensions: [ + ".bmp", + ".exr", + ".gif", + ".ico", + ".jpeg", + ".jpg", + ".pbm", + ".pgm", + ".png", + ".ppm", + ".ras", + ".sgi", + ".tiff", + ".webp", + ".xbm" + ], + format: "Binary", + description: "Some image extensions" + }, + // cspell:ignore woff + { + id: "binary", + extensions: [".gz", ".exe", ".dll", ".lib", ".obj", ".o", ".eot", ".cur", ".zip"], + format: "Binary" + }, + { + id: "fonts", + extensions: [".ttf", ".woff", ".woff2"], + format: "Binary" + }, + { + id: "video", + extensions: [".mov", ".mpg"], + format: "Binary" + }, + { + id: "lock", + extensions: [".lock"], + filenames: ["package-lock.json"] + }, + { + id: "cache_files", + extensions: [], + // cspell:ignore eslintcache + filenames: [".cspellcache", ".DS_Store", ".eslintcache"] + }, + { id: "dll", extensions: [".dll"], format: "Binary" }, + { id: "exe", extensions: [".exe"], format: "Binary" }, + { id: "object-file", extensions: [".o", ".obj"], format: "Binary" }, + { id: "jar", extensions: [".jar"], format: "Binary" }, + { id: "spv", extensions: [".spv"], format: "Binary", description: "SPSS Output Document" }, + { id: "mdb", extensions: [".mdb"], format: "Binary", description: "Microsoft Access DB" }, + { id: "webm", extensions: [".webm"], format: "Binary", description: "WebM is an audiovisual media file format." }, + { id: "trie", extensions: [".trie"], format: "Binary", description: "CSpell dictionary file." } +]; +var binaryFormatIds = languageExtensionDefinitions.filter((d) => d.format === "Binary").map((d) => d.id); +var binaryLanguages = new Set(["binary", "image", "video", "fonts"].concat(binaryFormatIds)); +var generatedFiles = /* @__PURE__ */ new Set([...binaryLanguages, "map", "lock", "pdf", "cache_files", "rsa", "pem", "trie"]); +var languageIds = languageExtensionDefinitions.map(({ id }) => id); +var mapExtensionToSetOfLanguageIds = buildLanguageExtensionMapSet(languageExtensionDefinitions); +var mapExtensionToLanguageIds = buildExtensionToLanguageIdMap(mapExtensionToSetOfLanguageIds); +function isGeneratedFile(basename7) { + return isGenerated(getLanguagesForBasename(basename7)); +} +function isGenerated(languageId) { + return doesSetContainAnyOf(generatedFiles, languageId); +} +function doesSetContainAnyOf(setOfIds, languageId) { + if (typeof languageId === "string") { + return setOfIds.has(languageId); + } + for (const id of languageId) { + if (setOfIds.has(id)) { + return true; } - throw exception; } + return false; } -var import_node_fs, import_node_path, reader, package_json_reader_default; -var init_package_json_reader = __esm({ - "node_modules/import-meta-resolve/lib/package-json-reader.js"() { - import_node_fs = __toESM(require("node:fs"), 1); - import_node_path = __toESM(require("node:path"), 1); - reader = { read }; - package_json_reader_default = reader; +function buildLanguageExtensionMapSet(defs) { + return defs.reduce((map3, def) => { + function addId(value) { + autoResolve(map3, value, () => /* @__PURE__ */ new Set()).add(def.id); + } + def.extensions.forEach(addId); + def.filenames?.forEach(addId); + return map3; + }, /* @__PURE__ */ new Map()); +} +function buildExtensionToLanguageIdMap(map3) { + return new Map([...map3].map(([k, s]) => [k, [...s]])); +} +function _getLanguagesForBasename(basename7) { + const found = mapExtensionToLanguageIds.get(basename7); + if (found) + return found; + for (let pos = basename7.indexOf("."); pos >= 0; pos = basename7.indexOf(".", pos + 1)) { + const ids = mapExtensionToLanguageIds.get(basename7.slice(pos)); + if (ids) + return ids; } -}); + return void 0; +} +function getLanguagesForBasename(basename7) { + return _getLanguagesForBasename(basename7) || _getLanguagesForBasename(basename7.toLowerCase()) || []; +} -// node_modules/import-meta-resolve/lib/package-config.js -function getPackageConfig(path16, specifier, base) { - const existing = packageJsonCache.get(path16); - if (existing !== void 0) { - return existing; +// node_modules/cspell-lib/dist/esm/Document/normalizeLanguageIds.mjs +function normalizeLanguageIds(languageId) { + return (Array.isArray(languageId) ? languageId.join(",") : languageId).split(",").map((s) => s.trim()); +} + +// node_modules/cspell-lib/dist/esm/Document/isBinaryDoc.mjs +function isBinaryDoc(document) { + return isBinaryFile(toUri(document.uri), document.languageId); +} +function isBinaryFile(filename, languageId) { + const filenameUri = toUri(filename); + if (languageId) { + const ids = normalizeLanguageIds(languageId); + if (ids.length) + return isGenerated(ids); } - const source = package_json_reader_default.read(path16).string; - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path16, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 + const file = basename(filenameUri); + return isGeneratedFile(file); +} + +// node_modules/cspell-lib/dist/esm/Document/resolveDocument.mjs +var import_promises = require("fs/promises"); + +// node_modules/cspell-lib/dist/esm/Models/TextDocument.mjs +var import_assert8 = __toESM(require("assert"), 1); +var import_vscode_languageserver_textdocument = __toESM(require_main(), 1); +var TextDocumentImpl = class { + constructor(uri, text, languageId, locale, version4) { + this.uri = uri; + this.languageId = languageId; + this.locale = locale; + const primaryLanguageId = typeof languageId === "string" ? languageId : languageId[0] || "plaintext"; + this.vsTextDoc = import_vscode_languageserver_textdocument.TextDocument.create(uri.toString(), primaryLanguageId, version4, text); + } + get version() { + return this.vsTextDoc.version; + } + get text() { + return this.vsTextDoc.getText(); + } + positionAt(offset) { + return this.vsTextDoc.positionAt(offset); + } + offsetAt(position) { + return this.vsTextDoc.offsetAt(position); + } + lineAt(offset) { + const position = this.vsTextDoc.positionAt(offset); + return this.getLine(position.line); + } + getLine(lineNum) { + const position = { line: lineNum, character: 0 }; + const end = { line: lineNum + 1, character: 0 }; + const range = { + start: position, + end + }; + const lineOffset = this.vsTextDoc.offsetAt(position); + const text = this.vsTextDoc.getText(range); + return { + text, + offset: lineOffset, + position }; - packageJsonCache.set(path16, packageConfig2); - return packageConfig2; } - let packageJson; - try { - packageJson = JSON.parse(source); - } catch (error2) { - const exception = ( - /** @type {ErrnoException} */ - error2 - ); - throw new ERR_INVALID_PACKAGE_CONFIG( - path16, - (base ? `"${specifier}" from ` : "") + (0, import_node_url.fileURLToPath)(base || specifier), - exception.message - ); + /** + * Iterate over the lines of a document one-by-one. + * Changing the document between iterations can change the result + */ + *getLines() { + const range = { + start: { line: 0, character: 0 }, + end: { line: 1, character: 0 } + }; + while (this.vsTextDoc.offsetAt(range.end) > this.vsTextDoc.offsetAt(range.start)) { + const offset = this.vsTextDoc.offsetAt(range.start); + yield { + text: this.vsTextDoc.getText(range), + offset, + position: range.start + }; + ++range.start.line; + ++range.end.line; + } } - const { exports, imports, main, name, type } = packageJson; - const packageConfig = { - pjsonPath: path16, - exists: true, - main: typeof main === "string" ? main : void 0, - name: typeof name === "string" ? name : void 0, - type: type === "module" || type === "commonjs" ? type : "none", - // @ts-expect-error Assume `Record`. - exports, - // @ts-expect-error Assume `Record`. - imports: imports && typeof imports === "object" ? imports : void 0 + /** + * Apply edits to the text. + * Note: the edits are applied one after the other. + * @param edits - changes to the text + * @param version - optional version to use. + * @returns this + */ + update(edits, version4) { + version4 = version4 ?? this.version + 1; + for (const edit of edits) { + const vsEdit = edit.range ? { + range: { start: this.positionAt(edit.range[0]), end: this.positionAt(edit.range[1]) }, + text: edit.text + } : edit; + import_vscode_languageserver_textdocument.TextDocument.update(this.vsTextDoc, [vsEdit], version4); + } + return this; + } +}; +function createTextDocument({ uri, content, languageId, locale, version: version4 }) { + version4 = version4 ?? 1; + uri = toUri(uri); + languageId = languageId ?? getLanguagesForBasename(basename(uri)); + languageId = languageId.length === 0 ? "text" : languageId; + return new TextDocumentImpl(uri, content, languageId, locale, version4); +} +function updateTextDocument(doc, edits, version4) { + (0, import_assert8.default)(isTextDocumentImpl(doc), "Unknown TextDocument type"); + return doc.update(edits, version4); +} +function isTextDocumentImpl(doc) { + return doc instanceof TextDocumentImpl; +} + +// node_modules/cspell-lib/dist/esm/Document/resolveDocument.mjs +var defaultEncoding = "utf8"; +function fileToDocument(file, text, languageId, locale) { + return clean({ + uri: toUri(file).toString(), + text, + languageId, + locale + }); +} +function documentToTextDocument(document) { + const { uri, text: content, languageId, locale } = document; + return createTextDocument({ uri, content, languageId, locale }); +} +async function readDocument(filename, encoding = defaultEncoding) { + const text = await (0, import_promises.readFile)(filename, encoding); + const uri = toUri(filename).toString(); + return { + uri, + text }; - packageJsonCache.set(path16, packageConfig); - return packageConfig; } -function getPackageScopeConfig(resolved) { - let packageJsonUrl = new import_node_url.URL("package.json", resolved); - while (true) { - const packageJsonPath2 = packageJsonUrl.pathname; - if (packageJsonPath2.endsWith("node_modules/package.json")) - break; - const packageConfig2 = getPackageConfig( - (0, import_node_url.fileURLToPath)(packageJsonUrl), - resolved - ); - if (packageConfig2.exists) - return packageConfig2; - const lastPackageJsonUrl = packageJsonUrl; - packageJsonUrl = new import_node_url.URL("../package.json", packageJsonUrl); - if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname) - break; +function resolveDocument(document, encoding) { + if (isDocumentWithText(document)) + return Promise.resolve(document); + const uri = toUri(document.uri); + if (uri.scheme !== "file") { + throw new Error(`Unsupported schema: "${uri.scheme}", open "${uri.toString()}"`); } - const packageJsonPath = (0, import_node_url.fileURLToPath)(packageJsonUrl); - const packageConfig = { - pjsonPath: packageJsonPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJsonCache.set(packageJsonPath, packageConfig); - return packageConfig; + return readDocument(uriToFilePath(uri), encoding); } -var import_node_url, ERR_INVALID_PACKAGE_CONFIG, packageJsonCache; -var init_package_config = __esm({ - "node_modules/import-meta-resolve/lib/package-config.js"() { - import_node_url = require("node:url"); - init_errors(); - init_package_json_reader(); - ({ ERR_INVALID_PACKAGE_CONFIG } = codes); - packageJsonCache = /* @__PURE__ */ new Map(); +function isDocumentWithText(doc) { + return doc.text !== void 0; +} + +// node_modules/cspell-lib/dist/esm/FeatureFlags/FeatureFlags.mjs +var systemFeatureFlags; +var FeatureFlags = class { + constructor(flags = []) { + this.flagValues = /* @__PURE__ */ new Map(); + this.flags = new Map(flags.map((f) => [f.name, f])); } -}); + register(flagOrName, description) { + if (typeof flagOrName === "string") { + return this.register({ name: flagOrName, description: description || "" }); + } + this.flags.set(flagOrName.name, flagOrName); + return this; + } + getFlag(flag) { + return this.flagValues.get(flag); + } + getFlagBool(flag) { + return toBool(this.getFlag(flag)); + } + setFlag(flag, value = true) { + if (!this.flags.has(flag)) { + throw new UnknownFeatureFlagError(flag); + } + this.flagValues.set(flag, value); + return this; + } + getFlagInfo(flag) { + return this.flags.get(flag); + } + getFlags() { + return [...this.flags.values()]; + } + getFlagValues() { + return new Map(this.flagValues); + } + reset() { + this.flagValues.clear(); + return this; + } +}; +var UnknownFeatureFlagError = class extends Error { + constructor(flag) { + super(`Unknown feature flag: ${flag}`); + this.flag = flag; + } +}; +function getSystemFeatureFlags() { + return systemFeatureFlags || (systemFeatureFlags = new FeatureFlags()); +} +var boolValues = { + 0: false, + 1: true, + f: false, + false: false, + n: false, + no: false, + t: true, + true: true, + y: true, + yes: true +}; +function toBool(value) { + if (typeof value !== "string") + return value; + return boolValues[value.toLowerCase()]; +} -// node_modules/import-meta-resolve/lib/resolve-get-package-type.js -function getPackageType(url) { - const packageConfig = getPackageScopeConfig(url); - return packageConfig.type; +// node_modules/cspell-grammar/dist/parser/grammarTypesHelpers.js +function isPatternInclude(p) { + return !!p.include; } -var init_resolve_get_package_type = __esm({ - "node_modules/import-meta-resolve/lib/resolve-get-package-type.js"() { - init_package_config(); +var TypeofMatch = { + object: true, + string: true +}; +var TypeofBegin = TypeofMatch; +var TypeofEnd = { ...TypeofBegin, undefined: true }; +function isPatternMatch(pattern) { + const p = pattern; + return !!p.match && typeof p.match in TypeofMatch; +} +function isPatternBeginEnd(pattern) { + const p = pattern; + return p.begin !== void 0 && typeof p.begin in TypeofBegin && typeof p.end in TypeofEnd; +} +function isPatternPatterns(p) { + return Array.isArray(p.patterns); +} + +// node_modules/cspell-grammar/dist/parser/matchResult.js +function segmentMatch(mr) { + const { matches, index, groups, input } = mr; + const segments = []; + let p = index; + for (let groupNum = 0; groupNum < matches.length; ++groupNum) { + const m = matches[groupNum]; + if (!m) + continue; + const idx0 = input.indexOf(m, p); + const idx2 = idx0 >= p ? idx0 : input.lastIndexOf(m, p); + if (idx2 < 0) + continue; + segments.push({ match: m, index: idx2, groupNum, groupName: void 0 }); + p = idx2; } -}); - -// node_modules/import-meta-resolve/lib/get-format.js -function mimeToFormat(mime) { - if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) - return "module"; - if (mime === "application/json") - return "json"; - return null; + const textToSeg = new Map(segments.map((s) => [s.match, s])); + for (const [name, value] of Object.entries(groups)) { + const s = value && textToSeg.get(value); + if (!s) + continue; + s.groupName = s.groupName ? Array.isArray(s.groupName) ? s.groupName.concat([name]) : [s.groupName, name] : name; + } + return segments; } -function getDataProtocolModuleFormat(parsed) { - const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec( - parsed.pathname - ) || [null, null, null]; - return mimeToFormat(mime); +function createMatchResult(r, lineNumber) { + const groups = /* @__PURE__ */ Object.create(null); + r.groups && Object.assign(groups, r.groups); + const matches = r; + const match2 = r[0]; + return { index: r.index, input: r.input, match: match2, matches, groups, lineNumber }; } -function getFileProtocolModuleFormat(url, _context, ignoreErrors) { - const filepath = (0, import_node_url2.fileURLToPath)(url); - const ext = import_node_path2.default.extname(filepath); - if (ext === ".js") { - return getPackageType(url) === "module" ? "module" : "commonjs"; +function createSimpleMatchResult(match2, input, index, lineNumber) { + const groups = /* @__PURE__ */ Object.create(null); + return { index, input, match: match2, matches: [match2], groups, lineNumber }; +} + +// node_modules/cspell-grammar/dist/parser/scope.js +var import_assert9 = __toESM(require("assert"), 1); +var Scope = class _Scope { + constructor(value, parent) { + this.value = value; + this.parent = parent; } - const format5 = extensionFormatMap[ext]; - if (format5) - return format5; - if (ignoreErrors) { - return void 0; + /** + * Convert the scope hierarchy to a string + * @param ltr - return ancestry from left-to-right + * @returns the scope hierarchy as a string separated by a space. + */ + toString(ltr = false) { + if (!this.parent) + return this.value; + return ltr ? this.parent.toString(ltr) + " " + this.value : this.value + " " + this.parent.toString(ltr); } - throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath); + static isScope(value) { + return value instanceof _Scope; + } +}; +var ScopePool = class { + constructor() { + this.pool = /* @__PURE__ */ new Map(); + } + /** + * Get a Scope that matches the scope. This method is idempotent. + * @param scopeValue - a single scope value: i.e. `source.ts` + * @param parent - optional parent Scope + */ + getScope(scopeValue, parent) { + const foundPoolMap = this.pool.get(scopeValue); + const poolMap = foundPoolMap || /* @__PURE__ */ new Map(); + if (poolMap !== foundPoolMap) { + this.pool.set(scopeValue, poolMap); + } + const foundScope = poolMap.get(parent); + if (foundScope) + return foundScope.v; + const scope = new Scope(scopeValue, parent); + poolMap.set(parent, { v: scope }); + return scope; + } + parseScope(scopes, ltr = false) { + if (Scope.isScope(scopes)) + return scopes; + if (isScopeLike(scopes)) { + const parent = scopes.parent ? this.parseScope(scopes.parent) : void 0; + return this.getScope(scopes.value, parent); + } + return this.parseScopeString(scopes, ltr); + } + parseScopeString(scopes, ltr) { + scopes = Array.isArray(scopes) ? scopes : scopes.split(" "); + const parentToChild = ltr ? scopes : scopes.reverse(); + let parent = void 0; + for (const value of parentToChild) { + parent = this.getScope(value, parent); + } + (0, import_assert9.default)(parent, "Empty scope is not allowed."); + return parent; + } +}; +function isScopeLike(value) { + return typeof value === "object" && !Array.isArray(value) && value.value !== void 0; } -function getHttpProtocolModuleFormat() { + +// node_modules/cspell-grammar/dist/parser/grammarNormalizer.js +function normalizeGrammar(grammar2) { + return new ImplNGrammar(grammar2); } -function defaultGetFormatWithoutErrors(url, context) { - if (!hasOwnProperty.call(protocolHandlers, url.protocol)) { - return null; +var SpecialRepositoryReferences = { + $self: true, + $base: true +}; +function nPattern(p) { + if (isPatternMatch(p)) + return normalizePatternMatch(p); + if (isPatternBeginEnd(p)) + return normalizePatternBeginEnd(p); + if (isPatternInclude(p)) + return normalizePatternInclude(p); + if (isPatternPatterns(p)) + return normalizePatternsPatterns(p); + return normalizePatternName(p); +} +function normalizePatternMatch(p) { + const regExec = makeTestMatchFn(p.match); + const self = { + ...p, + captures: normalizeCapture(p.captures), + findMatch + }; + function findMatch(line, parentRule) { + const match2 = regExec(line); + if (!match2) + return void 0; + const rule = factoryRule(parentRule, self); + return { rule, match: match2, line }; + } + return self; +} +function normalizePatternBeginEnd(p) { + const patterns = normalizePatterns(p.patterns); + const self = { + ...p, + captures: normalizeCapture(p.captures), + beginCaptures: normalizeCapture(p.beginCaptures), + endCaptures: normalizeCapture(p.endCaptures), + patterns, + findMatch + }; + function findMatch(line, parentRule) { + const match2 = testBegin(line); + if (!match2) + return void 0; + const rule = factoryRule(parentRule, self, findNext, end); + return { rule, match: match2, line }; } - return protocolHandlers[url.protocol](url, context, true) || null; + const testBegin = makeTestMatchFn(p.begin); + const testEnd = p.end !== void 0 ? makeTestMatchFn(p.end) : () => void 0; + function findNext(line) { + return patterns && findInPatterns(patterns, line, this); + } + function end(line) { + return testEnd(line); + } + return self; } -var import_node_path2, import_node_url2, ERR_UNKNOWN_FILE_EXTENSION, hasOwnProperty, extensionFormatMap, protocolHandlers; -var init_get_format = __esm({ - "node_modules/import-meta-resolve/lib/get-format.js"() { - import_node_path2 = __toESM(require("node:path"), 1); - import_node_url2 = require("node:url"); - init_resolve_get_package_type(); - init_errors(); - ({ ERR_UNKNOWN_FILE_EXTENSION } = codes); - hasOwnProperty = {}.hasOwnProperty; - extensionFormatMap = { - // @ts-expect-error: hush. - __proto__: null, - ".cjs": "commonjs", - ".js": "module", - ".json": "json", - ".mjs": "module" - }; - protocolHandlers = { - // @ts-expect-error: hush. - __proto__: null, - "data:": getDataProtocolModuleFormat, - "file:": getFileProtocolModuleFormat, - "http:": getHttpProtocolModuleFormat, - "https:": getHttpProtocolModuleFormat, - "node:"() { - return "builtin"; - } - }; +function normalizePatternName(p) { + const patterns = void 0; + const self = { + ...p, + patterns, + findMatch + }; + function findMatch(line, parentRule) { + const rule = factoryRule(parentRule, self); + const input = line.text.slice(line.offset); + const match2 = createSimpleMatchResult(input, input, line.offset, line.lineNumber); + return { rule, match: match2, line }; + } + return self; +} +function normalizePatternInclude(p) { + const { include } = p; + return include.startsWith("#") || include in SpecialRepositoryReferences ? normalizePatternIncludeRef(p) : normalizePatternIncludeExt(p); +} +function normalizePatternIncludeRef(p) { + const { include, ...rest } = p; + const reference = include.startsWith("#") ? include.slice(1) : include; + const self = { + ...rest, + reference, + findMatch + }; + function findMatch(line, parentRule) { + const pat = parentRule.repository[reference]; + if (pat === void 0) + throw new Error(`Unknown Include Reference ${include}`); + return pat.findMatch(line, parentRule); } -}); - -// node_modules/import-meta-resolve/lib/utils.js -function getDefaultConditions() { - return DEFAULT_CONDITIONS; + return self; } -function getDefaultConditionsSet() { - return DEFAULT_CONDITIONS_SET; +function normalizePatternIncludeExt(p) { + function findMatch(_line) { + return void 0; + } + const self = { + ...p, + findMatch + }; + return self; } -function getConditionsSet(conditions) { - if (conditions !== void 0 && conditions !== getDefaultConditions()) { - if (!Array.isArray(conditions)) { - throw new ERR_INVALID_ARG_VALUE( - "conditions", - conditions, - "expected an array" - ); +function normalizePatternsPatterns(p) { + return new ImplNPatternPatterns(p); +} +function findInPatterns(patterns, line, rule) { + let r = void 0; + for (const pat of patterns) { + if (pat.disabled) + continue; + const er = pat.findMatch(line, rule); + if (er?.match !== void 0 && !er.rule.pattern.disabled) { + r = r && r.match && r.match.index <= er.match.index && r || er; } - return new Set(conditions); } - return getDefaultConditionsSet(); + return r; } -var ERR_INVALID_ARG_VALUE, DEFAULT_CONDITIONS, DEFAULT_CONDITIONS_SET; -var init_utils = __esm({ - "node_modules/import-meta-resolve/lib/utils.js"() { - init_errors(); - ({ ERR_INVALID_ARG_VALUE } = codes); - DEFAULT_CONDITIONS = Object.freeze(["node", "import"]); - DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS); - } -}); - -// node_modules/import-meta-resolve/lib/resolve.js -function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) { - const pjsonPath = (0, import_node_url3.fileURLToPath)(packageJsonUrl); - const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null; - import_node_process2.default.emitWarning( - `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, import_node_url3.fileURLToPath)(base)}` : ""}.`, - "DeprecationWarning", - "DEP0166" - ); +function normalizePatterns(patterns) { + if (!patterns) + return void 0; + return patterns.map((p) => typeof p === "string" ? { include: p } : p).map(nPattern); } -function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) { - const format5 = defaultGetFormatWithoutErrors(url, { parentURL: base.href }); - if (format5 !== "module") - return; - const path16 = (0, import_node_url3.fileURLToPath)(url.href); - const pkgPath = (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)); - const basePath = (0, import_node_url3.fileURLToPath)(base); - if (main) - import_node_process2.default.emitWarning( - `Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, excluding the full filename and extension to the resolved file at "${path16.slice( - pkgPath.length - )}", imported from ${basePath}. - Automatic extension resolution of the "main" field isdeprecated for ES modules.`, - "DeprecationWarning", - "DEP0151" - ); - else - import_node_process2.default.emitWarning( - `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path16.slice( - pkgPath.length - )}", imported from ${basePath}. -Default "index" lookups for the main are deprecated for ES modules.`, - "DeprecationWarning", - "DEP0151" - ); +var emptyRepository = Object.freeze(/* @__PURE__ */ Object.create(null)); +function normalizePatternRepository(rep) { + if (!rep) + return emptyRepository; + return normalizeRepository(rep); } -function tryStatSync(path16) { - try { - return (0, import_node_fs2.statSync)(path16); - } catch { - return new import_node_fs2.Stats(); +function normalizeRepository(rep) { + const repository2 = /* @__PURE__ */ Object.create(null); + for (const [key, pat] of Object.entries(rep)) { + repository2[key] = nPattern(pat); } + return repository2; } -function fileExists(url) { - const stats = (0, import_node_fs2.statSync)(url, { throwIfNoEntry: false }); - const isFile = stats ? stats.isFile() : void 0; - return isFile === null || isFile === void 0 ? false : isFile; +var ruleCounter = 0; +function factoryRuleBase(parent, pattern, repository2, grammar2, findNext, end) { + const depth = parent ? parent.depth + 1 : 0; + return { + id: ruleCounter++, + grammar: grammar2, + pattern, + parent, + repository: repository2, + depth, + findNext, + end + }; } -function legacyMainResolve(packageJsonUrl, packageConfig, base) { - let guess; - if (packageConfig.main !== void 0) { - guess = new import_node_url3.URL(packageConfig.main, packageJsonUrl); - if (fileExists(guess)) - return guess; - const tries2 = [ - `./${packageConfig.main}.js`, - `./${packageConfig.main}.json`, - `./${packageConfig.main}.node`, - `./${packageConfig.main}/index.js`, - `./${packageConfig.main}/index.json`, - `./${packageConfig.main}/index.node` - ]; - let i2 = -1; - while (++i2 < tries2.length) { - guess = new import_node_url3.URL(tries2[i2], packageJsonUrl); - if (fileExists(guess)) - break; - guess = void 0; - } - if (guess) { - emitLegacyIndexDeprecation( - guess, - packageJsonUrl, - base, - packageConfig.main - ); - return guess; +function factoryRule(parent, pattern, findNext, end) { + return factoryRuleBase(parent, pattern, parent.repository, parent.grammar, findNext, end); +} +function normalizeCapture(cap) { + if (cap === void 0) + return void 0; + if (typeof cap === "string") + return { [0]: cap }; + const capture = /* @__PURE__ */ Object.create(null); + for (const [key, pat] of Object.entries(cap)) { + capture[key] = typeof pat === "string" ? pat : normalizePatternName(pat).name; + } + return capture; +} +function makeTestMatchFn(reg) { + if (typeof reg === "string") + return matchString(reg); + return matchRegExp(reg); +} +function matchString(s) { + return (line) => { + const input = line.text; + const index = input.indexOf(s, line.offset); + if (index < 0) + return void 0; + return createSimpleMatchResult(s, input, index, line.lineNumber); + }; +} +function matchRegExp(r) { + return (line) => { + const rg = RegExp(r, "gm"); + rg.lastIndex = line.offset; + const m = rg.exec(line.text); + return (m && createMatchResult(m, line.lineNumber)) ?? void 0; + }; +} +function extractScope(er, isContent = true) { + const scope = []; + for (let rule = er; rule; rule = rule.parent) { + const pattern = rule.pattern; + const { name, contentName } = pattern; + if (contentName && isContent) { + scope.push(contentName); + } + if (name !== void 0) { + scope.push(name); + } + isContent = true; + } + return er.grammar.scopePool.parseScope(scope); +} +var ImplNGrammar = class { + constructor(grammar2) { + this.scopeName = grammar2.scopeName; + this.name = grammar2.scopeName; + this.comment = grammar2.comment; + this.disabled = grammar2.disabled; + this.grammarName = grammar2.name; + const self = nPattern({ + patterns: [{ patterns: grammar2.patterns }] + }); + const repository2 = normalizePatternRepository(grammar2.repository); + this.patterns = self.patterns; + this.repository = repository2; + this.self = self; + this.scopePool = new ScopePool(); + } + begin(parentRule) { + const patterns = this.patterns; + function grammarToRule(grammar2, baseGrammar, parent) { + const repository2 = /* @__PURE__ */ Object.create(null); + Object.assign(repository2, grammar2.repository); + repository2["$self"] = grammar2.self; + repository2["$base"] = repository2["$base"] || baseGrammar.self; + function findNext(line) { + return findInPatterns(patterns, line, this); + } + function end(_line) { + return void 0; + } + return factoryRuleBase(parent, grammar2, repository2, grammar2, findNext, end); } + return grammarToRule(this, parentRule?.grammar ?? this, parentRule); } - const tries = ["./index.js", "./index.json", "./index.node"]; - let i = -1; - while (++i < tries.length) { - guess = new import_node_url3.URL(tries[i], packageJsonUrl); - if (fileExists(guess)) - break; - guess = void 0; +}; +var ImplNPatternPatterns = class { + constructor(p) { + const { name, comment, disabled, ...rest } = p; + this.patterns = normalizePatterns(rest.patterns); + this.name = name; + this.comment = comment; + this.disabled = disabled; + } + findMatch(line, parentRule) { + const patterns = this.patterns; + const rule = factoryRule(parentRule, this, findNext); + function findNext(line2) { + return findInPatterns(patterns, line2, this); + } + return rule.findNext?.(line); } - if (guess) { - emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main); - return guess; +}; + +// node_modules/cspell-grammar/dist/parser/grammar.js +function compileGrammar(grammar2) { + return normalizeGrammar(grammar2); +} + +// node_modules/cspell-grammar/dist/parser/tokenizeLine.js +var import_assert10 = __toESM(require("assert"), 1); + +// node_modules/cspell-grammar/dist/parser/util.js +function isDefined4(t) { + return t !== void 0 && t !== null; +} + +// node_modules/cspell-grammar/dist/parser/processors/procMatchingRule.js +function applyCaptureToBeginOrMatch(matchRuleResult) { + const { match: match2, rule } = matchRuleResult; + const bePattern = rule.pattern; + const captures = bePattern.beginCaptures ?? bePattern.captures; + return applyCaptures(rule, match2, captures); +} +function applyCaptureToEnd(rule, match2) { + const { pattern } = rule; + const bePattern = pattern; + const captures = bePattern.endCaptures ?? bePattern.captures; + return applyCaptures(rule, match2, captures); +} +function applyCaptures(rule, match2, captures) { + const scope = extractScope(rule, false); + const pool2 = rule.grammar.scopePool; + const text = match2.match; + const input = match2.input; + const range = [match2.index, match2.index + text.length, match2.lineNumber]; + if (!text && !captures) + return []; + if (!captures) { + const tokenized = { + scope, + text, + range + }; + return [tokenized]; } - throw new ERR_MODULE_NOT_FOUND( - (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)), - (0, import_node_url3.fileURLToPath)(base) - ); -} -function finalizeResolution(resolved, base, preserveSymlinks) { - if (encodedSepRegEx.exec(resolved.pathname) !== null) - throw new ERR_INVALID_MODULE_SPECIFIER( - resolved.pathname, - 'must not include encoded "/" or "\\" characters', - (0, import_node_url3.fileURLToPath)(base) - ); - const filePath = (0, import_node_url3.fileURLToPath)(resolved); - const stats = tryStatSync( - filePath.endsWith("/") ? filePath.slice(-1) : filePath - ); - if (stats.isDirectory()) { - const error2 = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, (0, import_node_url3.fileURLToPath)(base)); - error2.url = String(resolved); - throw error2; + const captureScopes = new Map(Object.entries(captures)); + const cap0 = captureScopes.get("0"); + if (captureScopes.size === 1 && cap0) { + const tokenized = { + scope: rule.grammar.scopePool.getScope(cap0, scope), + text, + range + }; + return [tokenized]; + } + const min3 = match2.index; + const max4 = match2.index + text.length; + function trimSegment(seg) { + const { index, match: match3 } = seg; + const right = match3.length; + if (index >= min3 && right <= max4) + return seg; + if (index >= max4 || right < min3) + return void 0; + const a = Math.max(index, min3) - index; + const b = Math.min(right, max4) - index; + const text2 = match3.slice(a, b); + return { + ...seg, + index: index + a, + match: text2 + }; + } + const segments = segmentMatch(match2).map(trimSegment).filter(isDefined4); + function processSegments(segments2) { + const base = segments2[0]; + const root = { + a: base.index, + b: base.index + base.match.length, + s: { seg: base } + }; + let m; + for (let i = 1; i < segments2.length; ++i) { + const seg = segments2[i]; + const index = seg.index; + const end = index + seg.match.length; + m = m && m.a <= index ? m : root; + while (m && m.b <= index) { + m = m.n; + } + while (m && m.a < end) { + if (m.a < index) { + const n = { ...m, a: index }; + m.n = n; + m.b = index; + m = n; + } + if (m.b > end) { + const n = { ...m, a: end }; + m.b = end; + m.n = n; + } + m.s = { seg, next: m.s }; + m = m.n; + } + } + return root; + } + function segChainToScope(chain) { + function* _chain(chain2) { + while (chain2) { + const seg = chain2.seg; + if (seg.groupName) { + if (Array.isArray(seg.groupName)) { + yield* seg.groupName; + } else { + yield seg.groupName; + } + } + yield seg.groupNum.toString(); + chain2 = chain2.next; + } + } + const scopeValues = [..._chain(chain)].map((cap) => captureScopes.get(cap)).filter(isDefined4).reverse(); + return scopeValues.reduce((s, v) => pool2.getScope(v, s), scope); } - if (!stats.isFile()) { - throw new ERR_MODULE_NOT_FOUND( - filePath || resolved.pathname, - base && (0, import_node_url3.fileURLToPath)(base), - "module" - ); + const merged = processSegments(segments); + function* emit(m) { + while (m) { + const t = { + text: input.slice(m.a, m.b), + range: [m.a, m.b, match2.lineNumber], + scope: segChainToScope(m.s) + }; + yield t; + m = m.n; + } } - if (!preserveSymlinks) { - const real = (0, import_node_fs2.realpathSync)(filePath); - const { search, hash } = resolved; - resolved = (0, import_node_url3.pathToFileURL)(real + (filePath.endsWith(import_node_path3.default.sep) ? "/" : "")); - resolved.search = search; - resolved.hash = hash; + const parsedText = [...emit(merged)]; + return parsedText; +} + +// node_modules/cspell-grammar/dist/parser/tokenizeLine.js +function tokenizeLine(line, rule) { + const text = line.text; + const lineLen = line.text.length; + const parsedText = []; + let ctx = buildContext({ ...line, offset: 0, anchor: -1 }, rule); + while (ctx.line.offset <= lineLen) { + let endMatch = ctx.rule.end?.(ctx.line); + while (endMatch?.index === ctx.line.offset) { + parsedText.push(...applyCaptureToEnd(ctx.rule, endMatch)); + ctx = findParentWithEnd(ctx); + ctx.line.offset = endMatch.index + endMatch.match.length; + endMatch = ctx.rule.end?.(ctx.line); + } + if (ctx.line.offset >= lineLen) + break; + const { line: line2, rule: rule2 } = ctx; + const offset = line2.offset; + const match2 = rule2.findNext?.(line2); + const limit = endMatch?.index ?? lineLen; + const emitTil = match2 ? Math.min(match2.match.index, limit) : limit; + if (offset < emitTil) { + const scope = extractScope(rule2); + const start = offset; + const end = emitTil; + parsedText.push({ + scope, + text: text.slice(start, end), + range: [start, end, line2.lineNumber] + }); + ctx.line.offset = emitTil; + } + if (!match2 || endMatch && endMatch.index <= match2.match.index) { + continue; + } + parsedText.push(...applyCaptureToBeginOrMatch(match2)); + line2.anchor = match2.match.index + match2.match.match.length; + line2.offset = line2.anchor; + ctx = findNearestWithEnd(buildContext(line2, match2.rule)); } - return resolved; + return toParseLineResult(line, ctx.rule, parsedText); } -function importNotDefined(specifier, packageJsonUrl, base) { - return new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJsonUrl && (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)), - (0, import_node_url3.fileURLToPath)(base) - ); +function* tokenizeTextIterable(text, grammar2) { + const lines = text.split(/(?<=\r\n|\n|\r(?!\n))/); + const rule = grammar2.begin(); + let documentOffset = 0; + let tr = tokenizeLine({ text: lines[0], lineNumber: 0, documentOffset }, rule); + documentOffset += lines[0].length; + yield toParsedLine(tr); + for (let i = 1; i < lines.length; ++i) { + const line = { text: lines[i], lineNumber: i, documentOffset }; + documentOffset += line.text.length; + tr = tr.parse(line); + yield toParsedLine(tr); + } } -function exportsNotFound(subpath, packageJsonUrl, base) { - return new ERR_PACKAGE_PATH_NOT_EXPORTED( - (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)), - subpath, - base && (0, import_node_url3.fileURLToPath)(base) - ); +function toParsedLine(pr) { + const { tokens: parsedText, line, offset } = pr; + return { tokens: parsedText, line, offset }; } -function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) { - const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${(0, import_node_url3.fileURLToPath)(packageJsonUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - request, - reason, - base && (0, import_node_url3.fileURLToPath)(base) - ); +function toParseLineResult(line, rule, parsedText) { + return { + tokens: parsedText, + line, + offset: line.documentOffset, + parse: (line2) => tokenizeLine(line2, rule) + }; } -function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) { - target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`; - return new ERR_INVALID_PACKAGE_TARGET( - (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)), - subpath, - target, - internal, - base && (0, import_node_url3.fileURLToPath)(base) - ); +function buildContext(line, rule) { + const rules = calcRuleStack(rule); + const numRules = rules.length; + const rootNum = numRules - 1; + const rootRule = rules[rootNum]; + const rootContext = { + line, + rule: rootRule + }; + let ctx = rootContext; + for (let i = rootNum - 1; i >= 0; --i) { + const rule2 = rules[i]; + const line2 = ctx.line; + ctx = { + line: line2, + rule: rule2, + parent: ctx + }; + } + return ctx; +} +function calcRuleStack(rule) { + const rules = []; + let r = rule; + while (r) { + rules.push(r); + r = r.parent; + } + return rules; +} +function must(t, msg = "Must be defined") { + (0, import_assert10.default)(t !== void 0 && t !== null, msg); + return t; +} +function findParentWithEnd(ctx) { + return findNearestWithEnd(must(ctx.parent)); +} +function findNearestWithEnd(ctx) { + while (!ctx.rule.end) { + ctx = must(ctx.parent); + } + return ctx; +} + +// node_modules/cspell-grammar/dist/grammars/typescript.js +var repository = { + statements: { + name: "code.ts", + patterns: [ + "#keyword", + "#regexp", + "#string", + "#comment", + "#braces", + "#punctuation", + "#space", + { name: "identifier", match: /[^\s;,!|&:^%{}[\]()*/+=<>]+/ } + ] + }, + keyword: { + patterns: ["#keywordBase", "#standardTypes", "#standardLib"] + }, + keywordBase: { + name: "keyword.typescript.ts", + match: /\b(?:any|as|async|await|bigint|boolean|break|case|catch|const|continue|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|in|instanceof|interface|import|let|map|module|new|new|null|number|of|package|private|public|require|return|set|static|string|super|switch|this|throw|true|try|type|typeof|unknown|undefined|var|void|while|yield)\b/ + }, + standardTypes: { + name: "keyword.type.ts", + match: /\b(?:Promise|Record|Omit|Extract|Exclude|BigInt|Array)\b/ + }, + standardLib: { + name: "keyword.lib.ts", + match: /\b(?:console|process|window)\b/ + }, + string: { + patterns: ["#string_q_single", "#string_q_double", "#string_template"] + }, + string_q_single: { + name: "string.quoted.single.ts", + begin: "'", + end: /'|((?:[^\\\n])$)/, + captures: "punctuation.string.ts", + patterns: [{ include: "#string_character_escape" }] + }, + string_q_double: { + name: "string.quoted.double.ts", + begin: '"', + end: /"|((?:[^\\\n])$)/, + captures: "punctuation.string.ts", + patterns: [{ include: "#string_character_escape" }] + }, + string_template: { + name: "string.template.ts", + begin: "`", + end: "`", + captures: "punctuation.string.ts", + patterns: [ + { + name: "meta.template.expression.ts", + contentName: "meta.embedded.line.ts", + begin: "${", + end: "}", + patterns: ["#statements"], + captures: "punctuation.definition.template.expression.ts" + }, + { include: "#string_character_escape" } + ] + }, + string_character_escape: { + name: "constant.character.escape.ts", + match: /\\(x[0-9A-Fa-f]{2}|[0-3][0-7]{0,2}|[4-7][0-7]?|u[0-9A-Fa-f]{4}|.|\r?\n?$)/ + }, + braces: { + patterns: [ + { + begin: "(", + end: ")", + captures: "punctuation.meta.brace.ts", + patterns: ["#statements"], + name: "meta.brace.ts", + contentName: "code.ts" + }, + { + begin: "{", + end: "}", + captures: "punctuation.meta.brace.ts", + patterns: ["#statements"], + name: "meta.brace.ts", + contentName: "code.ts" + }, + { + begin: "[", + end: "]", + captures: "punctuation.meta.brace.ts", + patterns: ["#statements"], + name: "meta.brace.ts", + contentName: "code.ts" + } + ] + }, + punctuation: { + name: "punctuation.ts", + match: /[-;:,!|&^%*/+=<>\n\r]/ + }, + space: { + name: "punctuation.space.ts", + match: /\s+/ + }, + comment: { + patterns: [ + { + name: "comment.line.ts", + comment: "line comment", + begin: "//", + end: /(?=$)/, + captures: "punctuation.definition.comment.ts" + }, + { + name: "comment.block.documentation.ts", + comment: "DocBlock", + begin: /\/\*\*(?!\/)/, + captures: "punctuation.definition.comment.ts", + end: "*/" + }, + { + name: "comment.block.ts", + begin: "/*", + end: "*/", + captures: "punctuation.definition.comment.ts" + } + ] + }, + regexp: { + name: "regexp.ts", + begin: /\/(?![/*])/, + end: /\/([a-z]*)/i, + beginCaptures: "punctuation.begin.regexp.ts", + endCaptures: "punctuation.end.regexp.ts", + patterns: ["#regexp_escape", "#regexp_brace"] + }, + regexp_escape: { + name: "escape.regexp.ts", + match: /\\./ + }, + regexp_brace: { + name: "brace.regexp.ts", + begin: "[", + end: "]", + contentName: "character-class.regexp.ts", + patterns: ["#regexp_escape"] + } +}; +var grammar = { + name: "TypeScript", + scopeName: "source.ts", + patterns: [ + { + name: "comment.line.shebang.ts", + match: /^#!.*(?=$)/ + }, + { + include: "#statements" + } + ], + repository +}; + +// node_modules/cspell-grammar/dist/mappers/appendMappedText.js +var import_assert11 = __toESM(require("assert"), 1); +function appendMappedText(a, b) { + if (!a.map && !b.map) { + return { text: a.text + b.text }; + } + const aLen = a.text.length; + const bLen = b.text.length; + const aMap = [0, 0].concat(a.map || [0, 0, aLen, aLen]); + const bMap = [0, 0].concat(b.map || [0, 0, bLen, bLen]); + (0, import_assert11.default)(aMap[aMap.length - 1] === aLen); + (0, import_assert11.default)(bMap[bMap.length - 1] === bLen); + (0, import_assert11.default)((aMap.length & 1) === 0); + (0, import_assert11.default)((bMap.length & 1) === 0); + return { + text: a.text + b.text, + map: joinMaps(aMap, bMap) + }; } -function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); - if (!target.startsWith("./")) { - if (internal && !target.startsWith("../") && !target.startsWith("/")) { - let isURL = false; - try { - new import_node_url3.URL(target); - isURL = true; - } catch { +function joinMaps(aMap, bMap) { + const n = aMap.length - 1; + const offsets = [aMap[n - 1], aMap[n]]; + const ab = aMap.concat(bMap.map((v, i) => v + offsets[i & 1])); + const r = [0, 0]; + let last0 = 0, last1 = 0; + for (let i = 0; i < ab.length; i += 2) { + const v0 = ab[i]; + const v12 = ab[i + 1]; + if (v0 === last0 && v12 === last1) { + continue; + } + r.push(v0, v12); + last0 = v0; + last1 = v12; + } + return r; +} + +// node_modules/cspell-grammar/dist/mappers/typescript.js +var hexChars = { + "0": 0, + "1": 1, + "2": 2, + "3": 3, + "4": 4, + "5": 5, + "6": 6, + "7": 7, + "8": 8, + "9": 9, + A: 10, + B: 11, + C: 12, + D: 13, + E: 14, + F: 15, + a: 10, + b: 11, + c: 12, + d: 13, + e: 14, + f: 15 +}; +var escapeChars = { + t: " ", + n: "\n", + r: "\r", + b: "\b", + "\\": "\\", + '"': '"', + "'": "'", + "\n": "" +}; +function mapRawString(text) { + const end = text.length; + let t = ""; + const map3 = []; + const isHex = /^[0-9a-fA-F]+$/; + let i, j; + for (i = 0, j = 0; i < end; ++i) { + let parsed; + const ti = text[i]; + if (ti === "\\") { + map3.push(i, j); + const tc = text[++i]; + const ec = escapeChars[tc]; + if (ec) { + t += ec; + j += ec.length; + map3.push(i, j); + continue; } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call( - patternRegEx, - target, - () => subpath - ) : target + subpath; - return packageResolve(exportTarget, packageJsonUrl, conditions); + switch (tc) { + case "u": + { + let char; + let end2; + if (text[i + 1] !== "{") { + const digits = text.slice(i + 1, i + 5); + parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; + char = isNaN(parsed) ? "" : String.fromCharCode(parsed); + end2 = i + 4; + } else { + for (end2 = i + 2; text[end2] in hexChars; ++end2) { + } + if (text[end2] !== "}") { + char = ""; + } else { + const digits = text.slice(i + 2, end2); + parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; + char = isNaN(parsed) ? "" : String.fromCodePoint(parsed); + } + } + if (!char) { + t += tc; + j += 1; + } else { + t += char; + j += char.length; + i = end2; + } + } + break; + case "x": + { + const digits = text.slice(i + 1, i + 3); + parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; + if (isNaN(parsed)) { + t += tc; + j += 1; + } else { + t += String.fromCharCode(parsed); + i += 2; + ++j; + } + } + break; + case "0": + t += "0"; + j += 1; + break; + case "\r": + i += text[i + 1] === "\n" ? 1 : 0; + break; + case "\n": + break; + case void 0: + break; + default: + t += tc; + ++j; + break; } + map3.push(i + 1, j); + continue; } - throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + t += ti; + ++j; } - if (invalidSegmentRegEx.exec(target.slice(2)) !== null) { - if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) { - if (!isPathMap) { - const request = pattern ? match.replace("*", () => subpath) : match + subpath; - const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( - patternRegEx, - target, - () => subpath - ) : target; - emitInvalidSegmentDeprecation( - resolvedTarget, - request, - match, - packageJsonUrl, - internal, - base, - true - ); - } - } else { - throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + if (map3.length) { + const ii = map3[map3.length - 2]; + const jj = map3[map3.length - 1]; + if (ii !== i || jj !== j) { + map3.push(i, j); } } - const resolved = new import_node_url3.URL(target, packageJsonUrl); - const resolvedPath = resolved.pathname; - const packagePath = new import_node_url3.URL(".", packageJsonUrl).pathname; - if (!resolvedPath.startsWith(packagePath)) - throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); - if (subpath === "") - return resolved; - if (invalidSegmentRegEx.exec(subpath) !== null) { - const request = pattern ? match.replace("*", () => subpath) : match + subpath; - if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) { - if (!isPathMap) { - const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( - patternRegEx, - target, - () => subpath - ) : target; - emitInvalidSegmentDeprecation( - resolvedTarget, - request, - match, - packageJsonUrl, - internal, - base, - false - ); - } - } else { - throwInvalidSubpath(request, match, packageJsonUrl, internal, base); + return { + text: t, + map: map3 + }; +} + +// node_modules/cspell-grammar/dist/parser/parser.js +function mapTokenizedLine(tl) { + return tl.tokens.map((t) => ({ + text: t.text, + range: [tl.offset + t.range[0], tl.offset + t.range[1]], + scope: t.scope + })); +} +function mapTokenizedLines(itl) { + return pipeSync(itl, opMapSync(mapTokenizedLine), opFlattenSync()); +} +function createParser(grammar2, name, transform2 = mapTokenizedLines) { + function parse4(content, filename) { + const parsedTexts = pipeSync(tokenizeTextIterable(content, grammar2), transform2); + return { content, filename, parsedTexts }; + } + return { name, parse: parse4 }; +} + +// node_modules/cspell-grammar/dist/parsers/typescript/TypeScriptParser.js +var tsGrammar = compileGrammar(grammar); +var pool = new ScopePool(); +var useScope = /* @__PURE__ */ new WeakMap(); +function* transform(texts) { + for (const parsed of texts) { + if (doesScopeMatch(parsed.scope, "constant.character.escape.ts")) { + const mapped = mapRawString(parsed.text); + const scope = parsed.scope ? pool.parseScope(parsed.scope) : void 0; + yield { + text: mapped.text, + scope: scope?.parent, + map: mapped.map, + range: parsed.range + }; + continue; } + yield parsed; } - if (pattern) { - return new import_node_url3.URL( - RegExpPrototypeSymbolReplace.call( - patternRegEx, - resolved.href, - () => subpath - ) - ); +} +function* mergeStringResults(results) { + let last; + for (const next of results) { + if (!doesScopeMatch(next.scope, "string.")) { + if (last) { + yield last; + last = void 0; + } + yield next; + continue; + } + if (!last) { + last = next; + continue; + } + if (next.scope !== last.scope || last.range[1] !== next.range[0]) { + yield last; + last = next; + continue; + } + last = mergeParsedText(last, next); } - return new import_node_url3.URL(subpath, resolved); + if (last) + yield last; } -function isArrayIndex(key) { - const keyNumber = Number(key); - if (`${keyNumber}` !== key) +function mergeParsedText(a, b) { + const abT = appendMappedText(a, b); + const ab = { + text: abT.text, + scope: a.scope, + range: [a.range[0], b.range[1]], + map: abT.map, + delegate: a.delegate + }; + return ab; +} +function filterScope(scope) { + const cached = useScope.get(scope); + if (cached !== void 0) + return cached; + const value = scope.value; + const use = !value.startsWith("punctuation") && !value.startsWith("keyword."); + useScope.set(scope, use); + return use; +} +function mapTokenizedLine2(tl) { + return tl.tokens.filter((t) => filterScope(t.scope)).map((t) => ({ + text: t.text, + range: [tl.offset + t.range[0], tl.offset + t.range[1]], + scope: t.scope + })); +} +function mapTokenizedLines2(itl) { + return pipeSync(itl, opMapSync(mapTokenizedLine2), opFlattenSync(), transform, mergeStringResults); +} +var parser = createParser(tsGrammar, "typescript", mapTokenizedLines2); +function doesScopeMatch(s, match2) { + if (!s) return false; - return keyNumber >= 0 && keyNumber < 4294967295; + return typeof s === "string" ? s.startsWith(match2) : s.value.startsWith(match2); } -function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJsonUrl, - base, - pattern, - internal, - isPathMap, - conditions - ); + +// node_modules/cspell-grammar/dist/parsers/index.js +var parsers2 = [parser]; + +// node_modules/cspell-lib/dist/esm/Settings/DefaultSettings.mjs +var import_lib_cjs = __toESM(require_lib_cjs(), 1); + +// node_modules/cspell-lib/dist/esm/Models/PatternRegExp.mjs +var PatternRegExp = class extends RegExp { + constructor(pattern) { + super(pattern); } - if (Array.isArray(target)) { - const targetList = target; - if (targetList.length === 0) - return null; - let lastException; - let i = -1; - while (++i < targetList.length) { - const targetItem = targetList[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJsonUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - isPathMap, - conditions - ); - } catch (error2) { - const exception = ( - /** @type {ErrnoException} */ - error2 - ); - lastException = exception; - if (exception.code === "ERR_INVALID_PACKAGE_TARGET") - continue; - throw error2; - } - if (resolveResult === void 0) - continue; - if (resolveResult === null) { - lastException = null; - continue; + toJSON() { + return this.toString(); + } +}; + +// node_modules/cspell-lib/dist/esm/Settings/LanguageSettings.mjs +var defaultLocale = "en"; +var defaultLanguageSettings = []; +function getDefaultLanguageSettings() { + return defaultLanguageSettings; +} +function localesToList(locales) { + return stringToList(locales.replace(/\s+/g, ",")); +} +function stringToList(sList) { + return sList.replace(/[|;]/g, ",").split(",").map((s) => s.trim()).filter((s) => !!s); +} +function memorizer(resolver) { + const cache2 = createAutoResolveCache(); + return (k) => cache2.get(k, resolver); +} +var _normalizeLanguageId = memorizer(__normalizeLanguageId); +function __normalizeLanguageId(langId) { + const langIds = stringToList(langId); + return new Set(langIds.map((a) => a.toLowerCase())); +} +function normalizeLanguageId(langId) { + return _normalizeLanguageId(typeof langId === "string" ? langId : langId.join(",")); +} +var _normalizeLocale = memorizer(__normalizeLocale); +function __normalizeLocale(locale) { + const locales = localesToList(locale); + return new Set(locales.map((locale2) => locale2.toLowerCase().replace(/[^a-z]/g, ""))); +} +function normalizeLocale2(locale) { + locale = typeof locale === "string" ? locale : locale.join(","); + return _normalizeLocale(locale); +} +function normalizeLocaleIntl(locale) { + const values = [...normalizeLocale2(locale)].map((locale2) => locale2.replace(/^([a-z]{2})-?([a-z]{2})$/, (_, lang, locale3) => locale3 ? `${lang}-${locale3.toUpperCase()}` : lang)); + return new Set(values); +} +function isLocaleInSet(locale, setOfLocals) { + const locales = normalizeLocale2(locale); + return doSetsIntersect(locales, setOfLocals); +} +var regExpValidIntlLocaleStrict = /^[a-z]{2}(-[A-Z]{2})?$/; +var regExpValidIntlLocale = new RegExp(regExpValidIntlLocaleStrict, "i"); +function isValidLocaleIntlFormat(locale, strict = false) { + if (typeof locale === "string") + return strict ? regExpValidIntlLocaleStrict.test(locale) : regExpValidIntlLocale.test(locale); + for (const item of locale) { + if (!isValidLocaleIntlFormat(item, strict)) + return false; + } + return locale.length > 0; +} +var cacheCalcSettingsForLanguage = /* @__PURE__ */ new WeakMap(); +function calcSettingsForLanguage(languageSettings, languageId, locale) { + const mapLang = autoResolveWeak(cacheCalcSettingsForLanguage, languageSettings, () => /* @__PURE__ */ new Map()); + const mapLocale = autoResolve(mapLang, languageId, () => /* @__PURE__ */ new Map()); + return autoResolve(mapLocale, locale, () => _calcSettingsForLanguage(languageSettings, languageId, locale)); +} +function _calcSettingsForLanguage(languageSettings, languageId, locale) { + languageId = languageId.toLowerCase(); + const allowedLocals = normalizeLocale2(locale); + const ls = languageSettings.filter((s) => doesLanguageSettingMatchLanguageId(s, languageId)).filter((s) => !s.locale || s.locale === "*" || isLocaleInSet(s.locale, allowedLocals)).map((langSetting) => { + const { languageId: _languageId, locale: _locale, ...s } = langSetting; + return s; + }).reduce((langSetting, setting) => mergeSettings(langSetting, setting), {}); + ls.languageId = languageId; + ls.locale = locale; + return ls; +} +var cacheDoesLanguageSettingMatchLanguageId = /* @__PURE__ */ new WeakMap(); +function doesLanguageSettingMatchLanguageId(s, languageId) { + const r = cacheDoesLanguageSettingMatchLanguageId.get(s) ?? /* @__PURE__ */ new Map(); + const f = r.get(languageId); + if (f !== void 0) { + return f; + } + const v = _doesLanguageSettingMatchLanguageId(s, languageId); + r.set(languageId, v); + cacheDoesLanguageSettingMatchLanguageId.set(s, r); + return v; +} +function _doesLanguageSettingMatchLanguageId(s, languageId) { + const languageSettingsLanguageIds = s.languageId; + if (!languageSettingsLanguageIds || languageSettingsLanguageIds === "*") + return true; + const ids = normalizeLanguageId(languageSettingsLanguageIds); + if (ids.has(languageId)) + return true; + if (ids.has("!" + languageId)) + return false; + const numExcludes = [...ids].filter((id) => id.startsWith("!")).length; + return numExcludes === ids.size; +} +function calcUserSettingsForLanguage(settings, languageId) { + const { languageSettings = [], language: locale = defaultLocale, allowCompoundWords, enabled } = settings; + const langSettings = { + allowCompoundWords, + enabled, + ...calcSettingsForLanguage(languageSettings, languageId, locale) + }; + return mergeSettings(settings, langSettings); +} +function calcSettingsForLanguageId(baseSettings, languageId) { + const langIds = ["*", ...normalizeLanguageId(languageId)]; + const langSettings = langIds.reduce((settings, languageId2) => { + return calcUserSettingsForLanguage(settings, languageId2); + }, baseSettings); + return langSettings; +} + +// node_modules/cspell-lib/dist/esm/Settings/RegExpPatterns.mjs +var regExMatchUrls = /(?:https?|ftp):\/\/[^\s"]+/gi; +var regExHRef = /\bhref\s*=\s*".*?"/gi; +var regExMatchCommonHexFormats = /(?:#[0-9a-f]{3,8})|(?:0x[0-9a-f]+)|(?:\\u[0-9a-f]{4})|(?:\\x\{[0-9a-f]{4}\})/gi; +var regExCommitHash = /\b(?![a-f]+\b)(?:0x)?[0-9a-f]{7,}\b/gi; +var regExCommitHashLink = /\[[0-9a-f]{7,}\]/gi; +var regExCStyleHexValue = /\b0x[0-9a-f]+\b/gi; +var regExCSSHexValue = /#[0-9a-f]{3,8}\b/gi; +var regExUUID = /\b[0-9a-fx]{8}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{12}\b/gi; +var regExUnicodeRef = /\bU\+[0-9a-f]{4,5}(?:-[0-9a-f]{4,5})?/gi; +var regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b(?!-)[\s\S]*?((?:\1\s*enable\b)|$)/gi; +var regExSpellingGuardNext = /\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi; +var regExSpellingGuardLine = /^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim; +var regExIgnoreSpellingDirectives = /\bc?spell(?:-?checker)?::?\s*ignoreRegExp.*/gim; +var regExPublicKey = /-{5}BEGIN\s+((?:RSA\s+)?PUBLIC\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g; +var regExCert = /-{5}BEGIN\s+(CERTIFICATE|(?:RSA\s+)?(?:PRIVATE|PUBLIC)\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g; +var regExSshRSA = /ssh-rsa\s+[a-z0-9/+]{28,}={0,3}(?![a-z0-9/+=])/gi; +var regExEscapeCharacters2 = /\\(?:[anrvtbf]|[xu][a-f0-9]+)/gi; +var regExBase64 = /(??/gi; +var regExRepeatedChar = /^(\w)\1{3,}$/i; +var regExSha = /\bsha\d+-[a-z0-9+/]{25,}={0,3}/gi; +var regExHashStrings = /(?:\b(?:sha\d+|md5|base64|crypt|bcrypt|scrypt|security-token|assertion)[-,:$=]|#code[/])[-\w/+%.]{25,}={0,3}(?:(['"])\s*\+?\s*\1?[-\w/+%.]+={0,3})*(?![-\w/+=%.])/gi; + +// node_modules/cspell-lib/dist/esm/Settings/DefaultSettings.mjs +var defaultConfigFileModuleRef = "@cspell/cspell-bundled-dicts/cspell-default.json"; +var defaultConfigFile = resolveConfigModule(defaultConfigFileModuleRef); +var regExpSpellCheckerDisable = [ + new PatternRegExp(regExSpellingGuardBlock), + new PatternRegExp(regExSpellingGuardLine), + new PatternRegExp(regExSpellingGuardNext) +]; +var predefinedPatterns = [ + // Exclude patterns + { name: "CommitHash", pattern: regExCommitHash }, + { name: "CommitHashLink", pattern: regExCommitHashLink }, + { name: "CStyleHexValue", pattern: regExCStyleHexValue }, + { name: "CSSHexValue", pattern: regExCSSHexValue }, + { name: "Urls", pattern: regExMatchUrls }, + { name: "HexValues", pattern: regExMatchCommonHexFormats }, + { name: "SpellCheckerDisable", pattern: regExpSpellCheckerDisable }, + { name: "PublicKey", pattern: regExPublicKey }, + { name: "RsaCert", pattern: regExCert }, + { name: "SshRsa", pattern: regExSshRSA }, + { name: "EscapeCharacters", pattern: regExEscapeCharacters2 }, + { name: "Base64", pattern: regExBase64 }, + { name: "Base64SingleLine", pattern: regExBase64SingleLine }, + { name: "Base64MultiLine", pattern: regExBase64MultiLine }, + { name: "Email", pattern: regExEmail }, + { name: "SHA", pattern: regExSha }, + { name: "HashStrings", pattern: regExHashStrings }, + { name: "UnicodeRef", pattern: regExUnicodeRef }, + { name: "UUID", pattern: regExUUID }, + { name: "href", pattern: regExHRef }, + { name: "SpellCheckerDisableBlock", pattern: regExSpellingGuardBlock }, + { name: "SpellCheckerDisableLine", pattern: regExSpellingGuardLine }, + { name: "SpellCheckerDisableNext", pattern: regExSpellingGuardNext }, + { name: "SpellCheckerIgnoreInDocSetting", pattern: regExIgnoreSpellingDirectives }, + // Include Patterns + { name: "PhpHereDoc", pattern: regExPhpHereDoc }, + { name: "string", pattern: regExString }, + { name: "CStyleComment", pattern: regExCStyleComments }, + { name: "Everything", pattern: ".*" } +]; +var defaultRegExpPatterns = [...predefinedPatterns].map(normalizePattern2); +var definedDefaultRegExpExcludeList = [ + "SpellCheckerDisable", + "SpellCheckerIgnoreInDocSetting", + "Urls", + "Email", + "RsaCert", + "SshRsa", + "Base64MultiLine", + "Base64SingleLine", + "CommitHash", + "CommitHashLink", + "CStyleHexValue", + "CSSHexValue", + "SHA", + "HashStrings", + "UnicodeRef", + "UUID" +]; +var defaultRegExpExcludeList = definedDefaultRegExpExcludeList; +var _defaultSettingsBasis = Object.freeze(createCSpellSettingsInternal({ + id: "static_defaults", + language: "en", + name: "Static Defaults", + enabled: true, + enabledLanguageIds: [], + maxNumberOfProblems: 100, + numSuggestions: 10, + suggestionsTimeout: 500, + suggestionNumChanges: 3, + words: [], + userWords: [], + ignorePaths: [], + allowCompoundWords: false, + patterns: defaultRegExpPatterns, + ignoreRegExpList: [], + languageSettings: [], + source: { name: "defaultSettings" }, + reporters: [], + plugins: [{ parsers: parsers2 }] +})); +var _defaultSettings = Object.freeze(createCSpellSettingsInternal({ + ..._defaultSettingsBasis, + enabledLanguageIds: [ + "ada", + "csharp", + "go", + "javascript", + "javascriptreact", + "json", + "markdown", + "mdx", + "php", + "plaintext", + "python", + "text", + "typescript", + "typescriptreact", + "haskell", + "html", + "css", + "less", + "scss", + "latex", + "ruby", + "rust", + "shellscript", + "toml" + ], + ignoreRegExpList: defaultRegExpExcludeList, + languageSettings: getDefaultLanguageSettings() +})); +var getSettings = function() { + let settings = void 0; + return function(useDefaultDictionaries) { + if (!useDefaultDictionaries) { + return _defaultSettingsBasis; + } + if (!settings) { + const jsonSettings = readSettings(defaultConfigFile); + settings = mergeSettings(_defaultSettings, jsonSettings); + if (jsonSettings.name !== void 0) { + settings.name = jsonSettings.name; + } else { + delete settings.name; } - return resolveResult; } - if (lastException === void 0 || lastException === null) { - return null; + return settings; + }; +}(); +function resolveConfigModule(configModuleName) { + return resolveFile(configModuleName, import_lib_cjs.srcDirectory).filename; +} +function normalizePattern2(pat) { + const { name, pattern, description } = pat; + if (!(pattern instanceof RegExp)) + return pat; + return { + name, + pattern: new PatternRegExp(pattern), + description + }; +} +function getDefaultSettings(useDefaultDictionaries = true) { + return getSettings(useDefaultDictionaries); +} + +// node_modules/cspell-dictionary/dist/util/AutoCache.js +var CACHE_SIZE = 100; +var Cache01 = class { + constructor(maxSize) { + this.maxSize = maxSize; + this.count = 0; + this.cache0 = /* @__PURE__ */ Object.create(null); + this.cache1 = /* @__PURE__ */ Object.create(null); + this.hits = 0; + this.misses = 0; + this.swaps = 0; + } + get(key) { + const cache0 = this.cache0; + const cache1 = this.cache1; + if (key in cache0) { + ++this.hits; + return cache0[key]; + } + if (key in cache1) { + ++this.hits; + ++this.count; + const r = cache1[key]; + cache0[key] = r; + return r; } - throw lastException; + ++this.misses; + return void 0; } - if (typeof target === "object" && target !== null) { - const keys = Object.getOwnPropertyNames(target); - let i = -1; - while (++i < keys.length) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG2( - (0, import_node_url3.fileURLToPath)(packageJsonUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - i = -1; - while (++i < keys.length) { - const key = keys[i]; - if (key === "default" || conditions && conditions.has(key)) { - const conditionalTarget = ( - /** @type {unknown} */ - target[key] - ); - const resolveResult = resolvePackageTarget( - packageJsonUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - isPathMap, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } + set(key, value) { + if (this.count >= this.maxSize) { + this.cache1 = this.cache0; + this.cache0 = /* @__PURE__ */ Object.create(null); + this.swaps++; + this.count = 0; } - return null; + ++this.count; + this.cache0[key] = value; + return this; } - if (target === null) { - return null; +}; +function createCache01(size) { + return new Cache01(size); +} +function autoCache(fn, size = CACHE_SIZE) { + const cache2 = createCache01(size); + const ac = get; + ac.hits = 0; + ac.misses = 0; + ac.swaps = 0; + function get(k) { + const f = cache2.get(k); + if (f !== void 0) { + ++ac.hits; + return f; + } + const r = fn(k); + cache2.set(k, r); + ac.swaps = cache2.swaps; + ++ac.misses; + return r; } - throw invalidPackageTarget( - packageSubpath, - target, - packageJsonUrl, - internal, - base - ); + return ac; } -function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { - if (typeof exports === "string" || Array.isArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = Object.getOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - let j = -1; - while (++j < keys.length) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG2( - (0, import_node_url3.fileURLToPath)(packageJsonUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); +function extractStats(ac) { + const { hits, misses, swaps } = ac; + return { hits, misses, swaps }; +} + +// node_modules/cspell-dictionary/dist/util/text.js +var regExAllUpper2 = /^(?:\p{Lu}\p{M}?)+$/u; +var regExAccents2 = /\p{M}/gu; +function isUpperCase2(word) { + return !!word.match(regExAllUpper2); +} +function ucFirst2(word) { + return word.slice(0, 1).toUpperCase() + word.slice(1); +} +function removeAccents2(text) { + return text.normalize("NFD").replace(regExAccents2, ""); +} +function removeUnboundAccents(text) { + return text.replace(regExAccents2, ""); +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SpellingDictionaryMethods.js +var defaultNumSuggestions = 10; +function wordSearchForms(word, isDictionaryCaseSensitive, ignoreCase2) { + const forms2 = /* @__PURE__ */ new Set(); + word = word.normalize("NFC"); + const wordLc = word.toLowerCase(); + if (ignoreCase2) { + if (isDictionaryCaseSensitive) { + forms2.add(wordLc); + } else { + forms2.add(wordLc); + forms2.add(removeUnboundAccents(wordLc)); } + } else { + if (isDictionaryCaseSensitive) { + forms2.add(word); + forms2.add(wordLc); + if (isUpperCase2(word)) { + forms2.add(ucFirst2(wordLc)); + } + } else { + forms2.add(wordLc); + forms2.add(removeUnboundAccents(wordLc)); + } + } + return forms2; +} +function wordSuggestFormsArray(word) { + return [...wordSuggestForms(word)]; +} +function wordSuggestForms(word) { + word = word.normalize("NFC"); + const forms2 = /* @__PURE__ */ new Set([word]); + const wordLc = word.toLowerCase(); + forms2.add(wordLc); + return forms2; +} +var DEFAULT_HAS_OPTIONS = Object.freeze({}); +function hasOptionToSearchOption(opt) { + return canonicalSearchOptions(!opt ? DEFAULT_HAS_OPTIONS : opt); +} +var canonicalSearchOptionsMap = /* @__PURE__ */ new Map(); +var knownCanonicalOptions = /* @__PURE__ */ new WeakMap(); +function canonicalSearchOptions(opt) { + const known = knownCanonicalOptions.get(opt); + if (known) + return known; + const { ignoreCase: ignoreCase2, useCompounds } = opt; + const foundLevel1Map = canonicalSearchOptionsMap.get(ignoreCase2); + const useLevel1Map = foundLevel1Map || /* @__PURE__ */ new Map(); + if (!foundLevel1Map) { + canonicalSearchOptionsMap.set(ignoreCase2, useLevel1Map); + } + const foundCanOpts = useLevel1Map.get(useCompounds); + const canOpts = foundCanOpts || Object.freeze({ ignoreCase: ignoreCase2, useCompounds }); + if (!foundCanOpts) { + useLevel1Map.set(useCompounds, canOpts); + } + knownCanonicalOptions.set(opt, canOpts); + return canOpts; +} +function createWeightMapFromDictionaryInformation(di) { + return di ? mapDictionaryInformationToWeightMap(di) : void 0; +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/CachingDictionary.js +var dictionaryCounter = 0; +var DefaultAutoCacheSize = 1e3; +var CachedDict = class { + constructor(dict, options) { + this.dict = dict; + this.options = options; + this.id = ++dictionaryCounter; + this.has = autoCache((word) => this.dict.has(word, this.options), DefaultAutoCacheSize); + this.isNoSuggestWord = autoCache((word) => this.dict.isNoSuggestWord(word, this.options), DefaultAutoCacheSize); + this.isForbidden = autoCache((word) => this.dict.isForbidden(word), DefaultAutoCacheSize); + this.getPreferredSuggestions = autoCache((word) => this.dict.getPreferredSuggestions?.(word), DefaultAutoCacheSize); + this.name = dict.name; + } + stats() { + return { + name: this.name, + id: this.id, + has: extractStats(this.has), + isNoSuggestWord: extractStats(this.isNoSuggestWord), + isForbidden: extractStats(this.isForbidden), + getPreferredSuggestions: extractStats(this.getPreferredSuggestions) + }; } - return isConditionalSugar; +}; +var knownDicts = /* @__PURE__ */ new Map(); +function createCachingDictionary(dict, options) { + options = canonicalSearchOptions(options); + let knownOptions = knownDicts.get(options); + if (!knownOptions) { + knownOptions = /* @__PURE__ */ new WeakMap(); + knownDicts.set(options, knownOptions); + } + const known = knownOptions.get(dict); + if (known) + return known; + const cached = new CachedDict(dict, options); + knownOptions.set(dict, cached); + return cached; +} + +// node_modules/cspell-dictionary/dist/util/AutoResolve.js +function autoResolveWeak2(map3, key, resolve13) { + const found = map3.get(key); + if (found !== void 0 || map3.has(key)) + return found; + const value = resolve13(key); + map3.set(key, value); + return value; +} +var AutoResolveWeakCache2 = class { + constructor() { + this.map = /* @__PURE__ */ new WeakMap(); + } + get(k, resolve13) { + return resolve13 ? autoResolveWeak2(this.map, k, resolve13) : this.map.get(k); + } + has(k) { + return this.map.has(k); + } + set(k, v) { + this.map.set(k, v); + return this; + } +}; +function createAutoResolveWeakCache() { + return new AutoResolveWeakCache2(); } -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = (0, import_node_url3.fileURLToPath)(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - import_node_process2.default.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, import_node_url3.fileURLToPath)(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); + +// node_modules/cspell-dictionary/dist/util/util.js +function isDefined5(v) { + return v !== void 0; } -function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) { - let exports = packageConfig.exports; - if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) { - exports = { ".": exports }; + +// node_modules/cspell-dictionary/dist/SpellingDictionary/createSpellingDictionary.js +var import_fast_equals = __toESM(require_fast_equals_cjs(), 1); + +// node_modules/cspell-dictionary/dist/util/simpleCache.js +var SimpleWeakCache = class { + constructor(size) { + this.size = size; + this.L0 = /* @__PURE__ */ new WeakMap(); + this.L1 = /* @__PURE__ */ new WeakMap(); + this.L2 = /* @__PURE__ */ new WeakMap(); + this.sizeL0 = 0; } - if (own2.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJsonUrl, - target, - "", - packageSubpath, - base, - false, - false, - false, - conditions - ); - if (resolveResult === null || resolveResult === void 0) { - throw exportsNotFound(packageSubpath, packageJsonUrl, base); + has(key) { + for (const c of this.caches()) { + if (c.has(key)) + return true; } - return resolveResult; + return false; } - let bestMatch = ""; - let bestMatchSubpath = ""; - const keys = Object.getOwnPropertyNames(exports); - let i = -1; - while (++i < keys.length) { - const key = keys[i]; - const patternIndex = key.indexOf("*"); - if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) { - if (packageSubpath.endsWith("/")) { - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJsonUrl, - base - ); - } - const patternTrailer = key.slice(patternIndex + 1); - if (packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = packageSubpath.slice( - patternIndex, - packageSubpath.length - patternTrailer.length - ); + get(key) { + for (const c of this.caches()) { + const entry = c.get(key); + if (entry) { + if (c !== this.L0) { + this._set(key, entry); + } + return entry.v; } } + return void 0; } - if (bestMatch) { - const target = ( - /** @type {unknown} */ - exports[bestMatch] - ); - const resolveResult = resolvePackageTarget( - packageJsonUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - packageSubpath.endsWith("/"), - conditions - ); - if (resolveResult === null || resolveResult === void 0) { - throw exportsNotFound(packageSubpath, packageJsonUrl, base); + set(key, value) { + this._set(key, { v: value }); + } + _set(key, entry) { + if (this.L0.has(key)) { + this.L0.set(key, entry); + return this; } - return resolveResult; + if (this.sizeL0 >= this.size) { + this.rotate(); + } + this.sizeL0 += 1; + this.L0.set(key, entry); } - throw exportsNotFound(packageSubpath, packageJsonUrl, base); -} -function patternKeyCompare(a, b) { - const aPatternIndex = a.indexOf("*"); - const bPatternIndex = b.indexOf("*"); - const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; - const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; - if (baseLengthA > baseLengthB) - return -1; - if (baseLengthB > baseLengthA) - return 1; - if (aPatternIndex === -1) - return 1; - if (bPatternIndex === -1) - return -1; - if (a.length > b.length) - return -1; - if (b.length > a.length) - return 1; - return 0; -} -function packageImportsResolve(name, base, conditions) { - if (name === "#" || name.startsWith("#/") || name.endsWith("/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, (0, import_node_url3.fileURLToPath)(base)); + caches() { + return [this.L0, this.L1, this.L2]; } - let packageJsonUrl; - const packageConfig = getPackageScopeConfig(base); - if (packageConfig.exists) { - packageJsonUrl = (0, import_node_url3.pathToFileURL)(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (own2.call(imports, name) && !name.includes("*")) { - const resolveResult = resolvePackageTarget( - packageJsonUrl, - imports[name], - "", - name, - base, - false, - true, - false, - conditions - ); - if (resolveResult !== null && resolveResult !== void 0) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath = ""; - const keys = Object.getOwnPropertyNames(imports); - let i = -1; - while (++i < keys.length) { - const key = keys[i]; - const patternIndex = key.indexOf("*"); - if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) { - const patternTrailer = key.slice(patternIndex + 1); - if (name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = name.slice( - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJsonUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - false, - conditions - ); - if (resolveResult !== null && resolveResult !== void 0) { - return resolveResult; - } + rotate() { + this.L2 = this.L1; + this.L1 = this.L0; + this.L0 = /* @__PURE__ */ new WeakMap(); + this.sizeL0 = 0; + } +}; +var AutoWeakCache = class extends SimpleWeakCache { + constructor(factory, size) { + super(size); + this.factory = factory; + } + get(key) { + const v = super.get(key); + if (v !== void 0) + return v; + const val = this.factory(key); + this.set(key, val); + return val; + } +}; +var SimpleCache = class { + constructor(size) { + this.size = size; + this.L0 = /* @__PURE__ */ new Map(); + this.L1 = /* @__PURE__ */ new Map(); + this.L2 = /* @__PURE__ */ new Map(); + } + has(key) { + for (const c of this.caches()) { + if (c.has(key)) + return true; + } + return false; + } + get(key) { + for (const c of this.caches()) { + const entry = c.get(key); + if (entry) { + if (c !== this.L0) { + this._set(key, entry); } + return entry.v; } } + return void 0; } - throw importNotDefined(name, packageJsonUrl, base); -} -function parsePackageName(specifier, base) { - let separatorIndex = specifier.indexOf("/"); - let validPackageName = true; - let isScoped = false; - if (specifier[0] === "@") { - isScoped = true; - if (separatorIndex === -1 || specifier.length === 0) { - validPackageName = false; - } else { - separatorIndex = specifier.indexOf("/", separatorIndex + 1); + set(key, value) { + this._set(key, { v: value }); + } + _set(key, entry) { + if (this.L0.has(key)) { + this.L0.set(key, entry); + return this; } + if (this.L0.size >= this.size) { + this.rotate(); + } + this.L0.set(key, entry); } - const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex); - if (invalidPackageNameRegEx.exec(packageName) !== null) { - validPackageName = false; + caches() { + return [this.L0, this.L1, this.L2]; } - if (!validPackageName) { - throw new ERR_INVALID_MODULE_SPECIFIER( - specifier, - "is not a valid package name", - (0, import_node_url3.fileURLToPath)(base) - ); + rotate() { + this.L2 = this.L1; + this.L1 = this.L0; + this.L0 = /* @__PURE__ */ new Map(); } - const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)); - return { packageName, packageSubpath, isScoped }; +}; + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SpellingDictionary.js +var defaultOptions = Object.freeze({ + weightMap: void 0 +}); + +// node_modules/cspell-dictionary/dist/util/clean.js +function clean4(src) { + const r = src; + for (const key of Object.keys(r)) { + if (r[key] === void 0) { + delete r[key]; + } + } + return r; } -function packageResolve(specifier, base, conditions) { - if (import_node_module.builtinModules.includes(specifier)) { - return new import_node_url3.URL("node:" + specifier); + +// node_modules/cspell-dictionary/dist/util/regexHelper.js +function escapeRegEx(s) { + return s.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} + +// node_modules/cspell-dictionary/dist/util/repMap.js +function createMapper(repMap, ignoreCharset) { + if (!repMap && !ignoreCharset) + return (a) => a; + repMap = repMap || []; + const charsetMap = charsetToRepMapRegEx(ignoreCharset); + if (charsetMap) { + repMap = repMap.concat(charsetMap); } - const { packageName, packageSubpath, isScoped } = parsePackageName( - specifier, - base - ); - const packageConfig = getPackageScopeConfig(base); - if (packageConfig.exists) { - const packageJsonUrl2 = (0, import_node_url3.pathToFileURL)(packageConfig.pjsonPath); - if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) { - return packageExportsResolve( - packageJsonUrl2, - packageSubpath, - packageConfig, - base, - conditions - ); + const filteredMap = repMap.filter(([match2, _]) => !!match2); + if (!filteredMap.length) { + return (a) => a; + } + const regEx = createMapperRegExp(repMap); + const values = repMap.filter(([match2, _]) => !!match2).map(([_, into]) => into); + function resolve13(m, ...matches) { + const index = matches.findIndex((a) => !!a); + return 0 <= index && index < values.length ? values[index] : m; + } + return function(s) { + return s.replace(regEx, resolve13); + }; +} +function charsetToRepMapRegEx(charset, replaceWith = "") { + if (!charset) + return void 0; + return charset.split("|").map((chars) => `[${chars.replace(/[\][\\]/g, "\\$&")}]`).map((map3) => [map3, replaceWith]); +} +function charsetToRepMap(charset, replaceWith = "") { + if (!charset) + return void 0; + return charset.split("|").flatMap((chars) => [...expandCharacterSet(chars)]).map((char) => [char, replaceWith]); +} +function expandReplaceMap(repMap) { + return repMap.flatMap(([from, replaceWith]) => from.split("|").map((w) => [w, replaceWith])); +} +function createMapperRegExp(repMap) { + const filteredMap = repMap.filter(([match2, _]) => !!match2); + if (!filteredMap.length) { + return /$^/; + } + const regExStr = filteredMap.map(([from, _]) => from).map((s) => { + try { + const r = s.match(/\(/) ? s.replace(/\((?=.*\))/g, "(?:").replace(/\(\?:\?/g, "(?") : s; + new RegExp(r); + s = r; + } catch (err) { + return escapeRegEx(s); + } + return s; + }).map((s) => `(${s})`).join("|"); + const regEx = new RegExp(regExStr, "g"); + return regEx; +} +function createRepMapper(repMap, ignoreCharset) { + if (!repMap && !ignoreCharset) + return (word) => [word]; + const trie = createTrie(repMap, ignoreCharset); + return (word) => { + const edits = calcAllEdits(trie, word); + return applyEdits(word, edits); + }; +} +function applyEdits(word, edits) { + if (!edits.length) + return [word]; + const letterEdits = []; + for (let i = 0; i < word.length; ++i) { + letterEdits[i] = { edits: [{ b: i, e: i + 1, r: word[i] }], suffixes: [] }; + } + letterEdits[word.length] = { edits: [], suffixes: [""] }; + for (const edit of edits) { + const le = letterEdits[edit.b]; + le.edits.push(edit); + } + for (let i = word.length - 1; i >= 0; --i) { + const le = letterEdits[i]; + const sfx = le.suffixes; + for (const edit of le.edits) { + const pfx = edit.r; + const nSfx = letterEdits[edit.e].suffixes; + for (const s of nSfx) { + sfx.push(pfx + s); + } } } - let packageJsonUrl = new import_node_url3.URL( - "./node_modules/" + packageName + "/package.json", - base - ); - let packageJsonPath = (0, import_node_url3.fileURLToPath)(packageJsonUrl); - let lastPath; - do { - const stat2 = tryStatSync(packageJsonPath.slice(0, -13)); - if (!stat2.isDirectory()) { - lastPath = packageJsonPath; - packageJsonUrl = new import_node_url3.URL( - (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", - packageJsonUrl - ); - packageJsonPath = (0, import_node_url3.fileURLToPath)(packageJsonUrl); - continue; + const results = new Set(letterEdits[0].suffixes); + return [...results]; +} +function calcAllEdits(root, word) { + const edits = []; + function walk4(node, b, e) { + if (node.rep) { + node.rep.forEach((r) => edits.push({ b, e, r })); } - const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base); - if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) { - return packageExportsResolve( - packageJsonUrl, - packageSubpath, - packageConfig2, - base, - conditions - ); + if (e === word.length || !node.children) + return; + const n = node.children[word[e]]; + if (!n) + return; + walk4(n, b, e + 1); + } + for (let i = 0; i < word.length; ++i) { + walk4(root, i, i); + } + return edits; +} +function createTrie(repMap, ignoreCharset) { + const combined = [repMap, charsetToRepMap(ignoreCharset)].filter(isDefined5).flatMap((a) => a); + const expanded = expandReplaceMap(combined); + const trieRoot = /* @__PURE__ */ Object.create(null); + expanded.forEach(([match2, replaceWith]) => addToTrie(trieRoot, match2, replaceWith)); + return trieRoot; +} +function addToTrie(node, match2, replaceWith) { + while (match2) { + const children = node.children || (node.children = /* @__PURE__ */ Object.create(null)); + const k = match2[0]; + const childNode = children[k] || (children[k] = /* @__PURE__ */ Object.create(null)); + node = childNode; + match2 = match2.slice(1); + } + const s = new Set(node.rep || []); + s.add(replaceWith); + node.rep = [...s]; +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/defaults.js +var ignoreCase = true; +var isForbiddenIgnoreCaseAndAccents = false; + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SpellingDictionaryFromTrie.js +var findWordOptionsCaseSensitive = Object.freeze({ caseSensitive: true }); +var findWordOptionsNotCaseSensitive = Object.freeze({ caseSensitive: false }); +var SpellingDictionaryFromTrie = class { + constructor(trie, name, options, source = "from trie", size) { + this.trie = trie; + this.name = name; + this.options = options; + this.source = source; + this._size = 0; + this.knownWords = /* @__PURE__ */ new Set(); + this.unknownWords = /* @__PURE__ */ new Set(); + this.type = "SpellingDictionaryFromTrie"; + this._find = findCache((word, useCompounds, ignoreCase2) => this.findAnyForm(word, useCompounds, ignoreCase2)); + this._isForbidden = autoCache((word) => { + return this.trie.isForbiddenWord(word); + }); + this.mapWord = createMapper(options.repMap, options.dictionaryInformation?.ignore); + this.remapWord = createRepMapper(options.repMap, options.dictionaryInformation?.ignore); + this.isDictionaryCaseSensitive = options.caseSensitive ?? trie.isCaseAware; + this.containsNoSuggestWords = options.noSuggest || false; + this._size = size || 0; + this.weightMap = options.weightMap || createWeightMapFromDictionaryInformation(options.dictionaryInformation); + } + get size() { + if (!this._size) { + const i = this.trie.iterate(); + let deeper = true; + let size = 0; + for (let r = i.next(); !r.done; r = i.next(deeper)) { + size += 1; + deeper = r.value.text.length < 5; + } + this._size = size; + } + return this._size; + } + has(word, hasOptions) { + const { useCompounds, ignoreCase: ignoreCase2 } = this.resolveOptions(hasOptions); + const r = this._find(word, useCompounds, ignoreCase2); + return !!r && !r.forbidden && !!r.found; + } + find(word, hasOptions) { + const { useCompounds, ignoreCase: ignoreCase2 } = this.resolveOptions(hasOptions); + const r = this._find(word, useCompounds, ignoreCase2); + const { forbidden = this.isForbidden(word) } = r || {}; + if (!r && !forbidden) + return void 0; + const { found = forbidden ? word : false } = r || {}; + const noSuggest = found !== false && this.containsNoSuggestWords; + return { found, forbidden, noSuggest }; + } + resolveOptions(hasOptions) { + const { useCompounds = this.options.useCompounds, ignoreCase: ignoreCase2 = ignoreCase } = hasOptionToSearchOption(hasOptions); + return { useCompounds, ignoreCase: ignoreCase2 }; + } + findAnyForm(word, useCompounds, ignoreCase2) { + const outerForms = outerWordForms(word, this.remapWord ? this.remapWord : (word2) => [this.mapWord(word2)]); + for (const form of outerForms) { + const r = this._findAnyForm(form, useCompounds, ignoreCase2); + if (r) + return r; } - if (packageSubpath === ".") { - return legacyMainResolve(packageJsonUrl, packageConfig2, base); + return void 0; + } + _findAnyForm(mWord, useCompounds, ignoreCase2) { + const opts = ignoreCase2 ? findWordOptionsNotCaseSensitive : findWordOptionsCaseSensitive; + const findResult = this.trie.findWord(mWord, opts); + if (findResult.found !== false) { + return findResult; } - return new import_node_url3.URL(packageSubpath, packageJsonUrl); - } while (packageJsonPath.length !== lastPath.length); - throw new ERR_MODULE_NOT_FOUND(packageName, (0, import_node_url3.fileURLToPath)(base)); -} -function isRelativeSpecifier(specifier) { - if (specifier[0] === ".") { - if (specifier.length === 1 || specifier[1] === "/") - return true; - if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) { + const forms2 = wordSearchForms(mWord, this.isDictionaryCaseSensitive, ignoreCase2); + for (const w of forms2) { + const findResult2 = this.trie.findWord(w, opts); + if (findResult2.found !== false) { + return findResult2; + } + } + if (useCompounds) { + const optsUseCompounds = { ...opts, useLegacyWordCompounds: useCompounds }; + for (const w of forms2) { + const findResult2 = this.trie.findWord(w, optsUseCompounds); + if (findResult2.found !== false) { + return findResult2; + } + } + } + return void 0; + } + isNoSuggestWord(word, options) { + return this.containsNoSuggestWords ? this.has(word, options) : false; + } + isForbidden(word, _ignoreCaseAndAccents) { + return this._isForbidden(word); + } + suggest(word, suggestOptions = {}) { + return this._suggest(word, suggestOptions); + } + _suggest(word, suggestOptions) { + const { numSuggestions = defaultNumSuggestions, numChanges, includeTies, ignoreCase: ignoreCase2, timeout } = suggestOptions; + function filter3(_word) { return true; } + const collector = suggestionCollector(word, clean4({ + numSuggestions, + filter: filter3, + changeLimit: numChanges, + includeTies, + ignoreCase: ignoreCase2, + timeout, + weightMap: this.weightMap + })); + this.genSuggestions(collector, suggestOptions); + return collector.suggestions.map((r) => ({ ...r, word: r.word })); + } + genSuggestions(collector, suggestOptions) { + if (this.options.noSuggest) + return; + const _compoundMethod = suggestOptions.compoundMethod ?? (this.options.useCompounds ? CompoundWordsMethod.JOIN_WORDS : CompoundWordsMethod.NONE); + wordSuggestFormsArray(collector.word).forEach((w) => this.trie.genSuggestions(impersonateCollector(collector, w), _compoundMethod)); + } + getErrors() { + return []; + } +}; +SpellingDictionaryFromTrie.cachedWordsLimit = 5e4; +function createSpellingDictionaryFromTrieFile(data, name, source, options) { + const trie = decodeTrie(data); + return new SpellingDictionaryFromTrie(trie, name, options, source); +} +function findCache(fn, size = 2e3) { + const cache2 = createCache01(size); + function find(word, useCompounds, ignoreCase2) { + const r = cache2.get(word); + if (r !== void 0) { + if (r.useCompounds === useCompounds && r.ignoreCase === ignoreCase2) { + return r.findResult; + } + } + const findResult = fn(word, useCompounds, ignoreCase2); + cache2.set(word, { useCompounds, ignoreCase: ignoreCase2, findResult }); + return findResult; + } + return find; +} +function outerWordForms(word, mapWord) { + const forms2 = pipeSync([word], opConcatMapSync((word2) => [word2, word2.normalize("NFC"), word2.normalize("NFD")]), opConcatMapSync((word2) => [word2, ...mapWord(word2)])); + return new Set(forms2); +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/createSpellingDictionary.js +var cachedDictionaries = new AutoWeakCache(_createSpellingDictionary, 64); +var maxSetSize = 3; +var cachedParamsByWordList = new SimpleCache(64); +function createSpellingDictionary(wordList, name, source, options) { + const params = [wordList, name, source, options]; + if (!Array.isArray(wordList)) { + return _createSpellingDictionary(params); + } + const cached = cachedParamsByWordList.get(name) || /* @__PURE__ */ new Set(); + for (const cachedParams of cached) { + if ((0, import_fast_equals.deepEqual)(params, cachedParams)) { + return cachedDictionaries.get(cachedParams); + } + } + if (cached.size > maxSetSize) + cached.clear(); + cached.add(params); + cachedParamsByWordList.set(name, cached); + return cachedDictionaries.get(params); +} +function _createSpellingDictionary(params) { + const [wordList, name, source, options] = params; + const parseOptions = { stripCaseAndAccents: options?.supportNonStrictSearches ?? true }; + const words = parseDictionaryLines(wordList, parseOptions); + const trie = buildITrieFromWords(words); + const opts = { ...options || defaultOptions }; + if (opts.weightMap === void 0 && opts.dictionaryInformation) { + opts.weightMap = createWeightMapFromDictionaryInformation(opts.dictionaryInformation); + } + return new SpellingDictionaryFromTrie(trie, name, opts, source); +} +function createFailedToLoadDictionary(name, source, error2, options) { + options = options || {}; + return { + name, + source, + type: "error", + containsNoSuggestWords: false, + has: () => false, + find: () => void 0, + isNoSuggestWord: () => false, + isForbidden: () => false, + suggest: () => [], + mapWord: (a) => a, + genSuggestions: () => { + return; + }, + size: 0, + options, + isDictionaryCaseSensitive: false, + getErrors: () => [error2] + }; +} + +// node_modules/cspell-dictionary/dist/util/textMappers.js +function* mapperRemoveCaseAndAccents(words) { + for (const word of words) { + const lc = word.toLowerCase(); + yield lc; + const woAccents = removeAccents2(lc); + if (lc !== woAccents) + yield woAccents; } - return false; } -function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { - if (specifier === "") + +// node_modules/cspell-dictionary/dist/SpellingDictionary/Typos/typosParser.js +var import_assert12 = __toESM(require("assert"), 1); + +// node_modules/cspell-dictionary/dist/SpellingDictionary/Typos/util.js +function normalizeTyposDefValue(value) { + if (!value) return false; - if (specifier[0] === "/") - return true; - return isRelativeSpecifier(specifier); -} -function moduleResolve(specifier, base, conditions, preserveSymlinks) { - const isRemote = base.protocol === "http:" || base.protocol === "https:"; - let resolved; - if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { - resolved = new import_node_url3.URL(specifier, base); - } else if (!isRemote && specifier[0] === "#") { - resolved = packageImportsResolve(specifier, base, conditions); + if (typeof value === "string") + return value; + const unique2 = [...new Set(value)]; + return unique2.length > 1 ? unique2 : unique2.length === 1 ? unique2[0] : false; +} +function mergeDefEntry(targetDef, key, value) { + const curValue = targetDef[key]; + if (!curValue) { + targetDef[key] = normalizeTyposDefValue(value); + return targetDef; + } + if (!value) + return targetDef; + const newValue = Array.isArray(curValue) ? curValue : [curValue]; + if (Array.isArray(value)) { + newValue.push(...value); } else { - try { - resolved = new import_node_url3.URL(specifier); - } catch { - if (!isRemote) { - resolved = packageResolve(specifier, base, conditions); - } + newValue.push(value); + } + targetDef[key] = normalizeTyposDefValue(newValue); + return targetDef; +} +function mergeDef(targetDef, fromDef) { + for (const key of Object.keys(fromDef)) { + mergeDefEntry(targetDef, key, fromDef[key]); + } + return targetDef; +} +function appendToDef(def, entry) { + if (!entry) + return def; + if (typeof entry === "string") { + if (!def[entry]) { + def[entry] = false; } + return def; } - (0, import_node_assert2.default)(typeof resolved !== "undefined", "expected to be defined"); - if (resolved.protocol !== "file:") { - return resolved; + if (Array.isArray(entry)) { + const [key, ...sugs] = entry.map((s2) => s2.trim()); + if (!key) + return def; + const s = sugs.map((s2) => s2.trim()).filter((s2) => !!s2); + return mergeDefEntry(def, key, s); } - return finalizeResolution(resolved, base, preserveSymlinks); + return mergeDef(def, entry); } -function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { - if (parsed && parsedParentURL && (parsedParentURL.protocol === "http:" || parsedParentURL.protocol === "https:")) { - if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { - if (parsed && parsed.protocol !== "https:" && parsed.protocol !== "http:") { - throw new ERR_NETWORK_IMPORT_DISALLOWED( - specifier, - parsedParentURL, - "remote imports cannot import from a local location." - ); - } - return { url: parsed.href }; +function createTyposDef(entries) { + const def = /* @__PURE__ */ Object.create(null); + if (!entries) + return def; + for (const [key, value] of entries) { + def[key] = isDefined6(value) ? value : false; + } + return def; +} +function extractAllSuggestions(typosDef) { + const allSugs = pipeSync(Object.values(typosDef), opFilterSync(hasSuggestions), opConcatMapSync((v) => Array.isArray(v) ? v : [v])); + return new Set(allSugs); +} +function extractIgnoreValues(typosDef, ignorePrefix) { + const pfxLen = ignorePrefix.length; + return new Set(Object.keys(typosDef).filter((k) => k.startsWith(ignorePrefix)).map((k) => k.slice(pfxLen))); +} +function isDefined6(v) { + return v !== void 0 && v !== null; +} +function isString2(v) { + return typeof v === "string"; +} +function isArray(v) { + return Array.isArray(v); +} +function hasSuggestions(v) { + return isString2(v) || isArray(v); +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/Typos/typosParser.js +function assertString(v) { + (0, import_assert12.default)(typeof v === "string", "A string was expected."); + return true; +} +var suggestionsSeparator = /[,]/; +var typoSuggestionsSeparator = /:|->/; +var typoEntrySeparator = /[\n;]/; +function normalize2(s) { + return s.normalize(); +} +function trimAndFilter(lines) { + return lines.map((s) => s.trim()).filter((s) => !!s).map(normalize2); +} +function cleanSugs(rawSugs) { + const sugs = trimAndFilter(rawSugs); + return sugs.length === 1 ? sugs[0] : sugs.length ? sugs : false; +} +function splitSuggestionsValue(value) { + return cleanSugs(value.split(suggestionsSeparator)); +} +function sanitizeIntoTypoDef(dirtyDef) { + if (!dirtyDef || typeof dirtyDef !== "object") + return void 0; + const def = createTyposDef(); + for (const [rawKey, value] of Object.entries(dirtyDef)) { + const key = normalize2(rawKey.trim()); + if (!key) + continue; + if (typeof value === "string") { + def[key] = splitSuggestionsValue(value); + continue; } - if (import_node_module.builtinModules.includes(specifier)) { - throw new ERR_NETWORK_IMPORT_DISALLOWED( - specifier, - parsedParentURL, - "remote imports cannot import from a local location." - ); + if (Array.isArray(value)) { + const sugs = cleanSugs(value.filter(assertString)); + def[key] = sugs; + continue; } - throw new ERR_NETWORK_IMPORT_DISALLOWED( - specifier, - parsedParentURL, - "only relative and absolute specifiers are supported." - ); + (0, import_assert12.default)(value === false, "Unexpected suggestion type."); + def[key] = false; } + return def; } -function throwIfUnsupportedURLProtocol(url) { - if (url.protocol !== "file:" && url.protocol !== "data:" && url.protocol !== "node:") { - throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url); +function processEntriesToTyposDef(entries) { + const def = isIterable3(entries) ? reduceToTyposDef(entries) : entries; + const result = sanitizeIntoTypoDef(def); + (0, import_assert12.default)(result); + return result; +} +function reduceToTyposDef(entries) { + const def = createTyposDef(); + for (const entry of entries) { + appendToDef(def, parseTyposLine(entry)); } + return def; } -function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports2) { - if (parsed && parsed.protocol !== "file:" && parsed.protocol !== "data:" && (!experimentalNetworkImports2 || parsed.protocol !== "https:" && parsed.protocol !== "http:")) { - throw new ERR_UNSUPPORTED_ESM_URL_SCHEME( - parsed, - ["file", "data"].concat( - experimentalNetworkImports2 ? ["https", "http"] : [] - ) - ); +function parseTyposLine(line) { + if (!line) + return void 0; + if (typeof line === "string") { + const def = createTyposDef(); + for (const subEntry of splitIntoLines(line)) { + const [left, right] = splitEntry(subEntry); + const typo = left.trim(); + if (!right) + return typo; + const sugs = splitSuggestionsValue(right); + def[typo] = sugs; + } + return def; + } + if (Array.isArray(line)) { + const [key, ...sugs] = line.filter(assertString).map((s) => s.trim()); + if (!key) + return void 0; + return [key, ...sugs]; } + return sanitizeIntoTypoDef(line); } -function defaultResolve(specifier, context = {}) { - const { parentURL } = context; - (0, import_node_assert2.default)(typeof parentURL !== "undefined", "expected `parentURL` to be defined"); - let parsedParentURL; - if (parentURL) { - try { - parsedParentURL = new import_node_url3.URL(parentURL); - } catch { +function splitIntoLines(content) { + return trimAndFilter(normalize2(content).split(typoEntrySeparator)); +} +function splitEntry(line) { + return line.split(typoSuggestionsSeparator, 2); +} +function isIterable3(v) { + return Symbol.iterator in v; +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/TyposDictionary.js +var TyposDictionaryImpl = class { + constructor(name, source, typosDef, ignoreList) { + this.name = name; + this.source = source; + this.typosDef = typosDef; + this.options = {}; + this.type = "typos"; + this.isDictionaryCaseSensitive = true; + this.size = Object.keys(typosDef).length; + this.explicitIgnoreWords = extractIgnoreValues(typosDef, "!"); + this.suggestions = extractAllSuggestions(typosDef); + this.ignoreWords = new Set(pipeSync(this.explicitIgnoreWords, opAppendSync(ignoreList || []))); + this.suggestionsLower = new Set(pipeSync(this.suggestions, mapperRemoveCaseAndAccents)); + this.containsNoSuggestWords = this.ignoreWords.size > 0; + } + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param _word - the word + * @param _options - options + * @returns always false + */ + has(_word, _options) { + return false; + } + /** A more detailed search for a word, might take longer than `has` */ + find(word, options) { + const result = this._findForms(word, options?.ignoreCase ?? ignoreCase); + if (result === false) + return void 0; + const { found, ignore } = result; + return { found, forbidden: !ignore, noSuggest: ignore }; + } + _findForms(word, ignoreCaseAndAccents) { + const lcWord = word.toLowerCase(); + if (this.ignoreWords.has(word)) { + return { found: word, ignore: true }; + } + if (this.suggestions.has(word)) { + return false; + } + if (ignoreCaseAndAccents) { + if (this.suggestionsLower.has(lcWord)) { + return false; + } + if (this.ignoreWords.has(lcWord)) { + return { found: lcWord, ignore: true }; + } } + if (word in this.typosDef) + return { found: word, ignore: false }; + if (lcWord in this.typosDef) + return { found: lcWord, ignore: false }; + return false; } - let parsed; - try { - parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new import_node_url3.URL(specifier, parsedParentURL) : new import_node_url3.URL(specifier); - if (parsed.protocol === "data:" || experimentalNetworkImports && (parsed.protocol === "https:" || parsed.protocol === "http:")) { - return { url: parsed.href, format: null }; + isForbidden(word, ignoreCaseAndAccents = isForbiddenIgnoreCaseAndAccents) { + const found = this._findForms(word, ignoreCaseAndAccents); + return found !== false && !found.ignore; + } + isNoSuggestWord(word, options) { + const result = this.find(word, options); + return result?.noSuggest ?? false; + } + /** + * Determine if the word can appear in a list of suggestions. + * @param word - word + * @param ignoreCaseAndAccents - ignore case. + * @returns true if a word is suggested, otherwise false. + */ + isSuggestedWord(word, ignoreCaseAndAccents = isForbiddenIgnoreCaseAndAccents) { + if (this.suggestions.has(word)) + return true; + const lcWord = word.toLowerCase(); + return ignoreCaseAndAccents && (this.suggestions.has(lcWord) || this.suggestionsLower.has(lcWord)); + } + suggest(word) { + return this.getPreferredSuggestions(word); + } + _suggest(word) { + if (this.ignoreWords.has(word)) + return []; + if (!(word in this.typosDef)) + return void 0; + const sug = this.typosDef[word]; + const isPreferred = true; + if (!sug) + return []; + if (typeof sug === "string") { + return [ + { + word: sug, + cost: 1, + isPreferred + } + ]; } - } catch { + return sug.map((word2, index) => ({ word: word2, cost: index + 1, isPreferred })); } - const maybeReturn = checkIfDisallowedImport( - specifier, - parsed, - parsedParentURL - ); - if (maybeReturn) - return maybeReturn; - if (parsed && parsed.protocol === "node:") - return { url: specifier }; - throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports); - const conditions = getConditionsSet(context.conditions); - const url = moduleResolve(specifier, new import_node_url3.URL(parentURL), conditions, false); - throwIfUnsupportedURLProtocol(url); - return { - // Do NOT cast `url` to a string: that will work even when there are real - // problems, silencing them - url: url.href, - format: defaultGetFormatWithoutErrors(url, { parentURL }) - }; -} -var import_node_assert2, import_node_fs2, import_node_process2, import_node_url3, import_node_path3, import_node_module, RegExpPrototypeSymbolReplace, experimentalNetworkImports, ERR_NETWORK_IMPORT_DISALLOWED, ERR_INVALID_MODULE_SPECIFIER, ERR_INVALID_PACKAGE_CONFIG2, ERR_INVALID_PACKAGE_TARGET, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_ESM_URL_SCHEME, own2, invalidSegmentRegEx, deprecatedInvalidSegmentRegEx, invalidPackageNameRegEx, patternRegEx, encodedSepRegEx, emittedPackageWarnings, doubleSlashRegEx; -var init_resolve = __esm({ - "node_modules/import-meta-resolve/lib/resolve.js"() { - import_node_assert2 = __toESM(require("node:assert"), 1); - import_node_fs2 = require("node:fs"); - import_node_process2 = __toESM(require("node:process"), 1); - import_node_url3 = require("node:url"); - import_node_path3 = __toESM(require("node:path"), 1); - import_node_module = require("node:module"); - init_get_format(); - init_errors(); - init_package_config(); - init_utils(); - RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]; - experimentalNetworkImports = false; - ({ - ERR_NETWORK_IMPORT_DISALLOWED, - ERR_INVALID_MODULE_SPECIFIER, - ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2, - ERR_INVALID_PACKAGE_TARGET, - ERR_MODULE_NOT_FOUND, - ERR_PACKAGE_IMPORT_NOT_DEFINED, - ERR_PACKAGE_PATH_NOT_EXPORTED, - ERR_UNSUPPORTED_DIR_IMPORT, - ERR_UNSUPPORTED_ESM_URL_SCHEME - } = codes); - own2 = {}.hasOwnProperty; - invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; - deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; - invalidPackageNameRegEx = /^\.|%|\\/; - patternRegEx = /\*/g; - encodedSepRegEx = /%2f|%5c/i; - emittedPackageWarnings = /* @__PURE__ */ new Set(); - doubleSlashRegEx = /[/\\]{2}/; + genSuggestions(collector) { + const sugs = this.suggest(collector.word); + sugs.forEach((result) => collector.add(result)); } -}); - -// node_modules/import-meta-resolve/index.js -var import_meta_resolve_exports = {}; -__export(import_meta_resolve_exports, { - moduleResolve: () => moduleResolve, - resolve: () => resolve7 -}); -async function resolve7(specifier, parent) { - if (!parent) { - throw new Error( - "Please pass `parent`: `import-meta-resolve` cannot ponyfill that" - ); + getPreferredSuggestions(word) { + return this._suggest(word) || this._suggest(word.toLowerCase()) || []; } - try { - return defaultResolve(specifier, { parentURL: parent }).url; - } catch (error2) { - const exception = ( - /** @type {ErrnoException} */ - error2 - ); - return exception.code === "ERR_UNSUPPORTED_DIR_IMPORT" && typeof exception.url === "string" ? exception.url : Promise.reject(error2); + mapWord(word) { + return word; } -} -var init_import_meta_resolve = __esm({ - "node_modules/import-meta-resolve/index.js"() { - init_resolve(); - init_resolve(); + getErrors() { + return []; } -}); - -// src/main.ts -var core4 = __toESM(require_core()); -var import_github2 = __toESM(require_github()); -var import_context = __toESM(require_context()); +}; +var createCache = createAutoResolveWeakCache(); +function createTyposDictionary(entries, name, source) { + return createCache.get(entries, () => { + const def = processEntriesToTyposDef(entries); + return new TyposDictionaryImpl(name, source, def); + }); +} -// src/error.ts -var AppError = class extends Error { - constructor(message) { - super(message); +// node_modules/cspell-dictionary/dist/SpellingDictionary/FlagWordsDictionary.js +var FlagWordsDictionaryTrie = class extends SpellingDictionaryFromTrie { + constructor(trie, name, source) { + super(trie, name, defaultOptions, source); + this.name = name; + this.source = source; + this.containsNoSuggestWords = false; + this.options = {}; + this.isDictionaryCaseSensitive = true; } -}; -function isError(e) { - if (!e) - return false; - if (typeof e !== "object") + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param _word - the word + * @param _options - options + * @returns always false + */ + has(_word, _options) { return false; - const err = e; - return err.message !== void 0 && err.name !== void 0 && (err.stack === void 0 || typeof err.stack === "string"); + } + find(word, hasOptions) { + const f = super.find(word, hasOptions); + if (!f || !f.forbidden) + return void 0; + return f; + } + suggest() { + return []; + } + genSuggestions() { + return; + } +}; +var FlagWordsDictionary = class { + constructor(name, source, dictTypos, dictTrie) { + this.name = name; + this.source = source; + this.dictTypos = dictTypos; + this.dictTrie = dictTrie; + this.containsNoSuggestWords = false; + this.options = {}; + this.type = "flag-words"; + this.isDictionaryCaseSensitive = true; + } + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param word - the word + * @param options - options + * @returns always false + */ + has(word, options) { + return this.dictTypos.has(word, options) || this.dictTrie?.has(word, options) || false; + } + /** A more detailed search for a word, might take longer than `has` */ + find(word, options) { + const findTypos = this.dictTypos.find(word, options); + if (findTypos) + return findTypos; + const ignoreCase2 = options?.ignoreCase ?? ignoreCase; + if (this.dictTypos.isSuggestedWord(word, ignoreCase2)) + return void 0; + return this.dictTrie?.find(word, options); + } + isForbidden(word, ignoreCaseAndAccents = isForbiddenIgnoreCaseAndAccents) { + const findResult = this.find(word, { ignoreCase: ignoreCaseAndAccents }); + return findResult?.forbidden || false; + } + isNoSuggestWord(word, options) { + return this.dictTrie?.isNoSuggestWord(word, options) || this.dictTypos.isNoSuggestWord(word, options); + } + suggest(word, suggestOptions = {}) { + return this.dictTypos.suggest(word, suggestOptions); + } + getPreferredSuggestions(word) { + return this.dictTypos.getPreferredSuggestions(word); + } + genSuggestions() { + return; + } + mapWord(word) { + return word; + } + get size() { + return this.dictTypos.size + (this.dictTrie?.size || 0); + } + getErrors() { + return []; + } +}; +var createCache2 = createAutoResolveWeakCache(); +function createFlagWordsDictionary(wordList, name, source) { + return createCache2.get(wordList, () => { + const testSpecialCharacters = /[~*+]/; + const { t: specialWords, f: typoWords } = bisect(parseDictionaryLines(wordList, { stripCaseAndAccents: false }), (line) => testSpecialCharacters.test(line)); + const trieDict = specialWords.size ? buildTrieDict(specialWords, name, source) : void 0; + const typosDict = createTyposDictionary(typoWords, name, source); + if (!trieDict) + return typosDict; + return new FlagWordsDictionary(name, source, typosDict, trieDict); + }); } -function isAppError(e) { - return e instanceof AppError; +var regExpCleanIgnore = /^(!!)+/; +function buildTrieDict(words, name, source) { + const trie = buildITrieFromWords(pipeSync(words, opMapSync((w) => "!" + w), opMapSync((w) => w.replace(regExpCleanIgnore, "")))); + return new FlagWordsDictionaryTrie(trie, name, source); +} +function bisect(values, predicate) { + const t = /* @__PURE__ */ new Set(); + const f = /* @__PURE__ */ new Set(); + for (const v of values) { + if (predicate(v)) { + t.add(v); + } else { + f.add(v); + } + } + return { t, f }; } -// src/action.ts -var core3 = __toESM(require_core()); - -// node_modules/cspell-glob/dist/esm/globHelper.mjs -var Path = __toESM(require("path"), 1); -var { posix } = Path; -var relRegExp = /^\.[\\/]/; -var isGlobalPatternRegExp = /^!*[*]{2}/; -function fileOrGlobToGlob(fileOrGlob, root, path16 = Path) { - const pathToGlob = path16.sep === "\\" ? (p) => p.replace(/\\/g, "/") : (p) => p; - const isGlobalPattern = false; - if (isGlobPatternWithOptionalRoot(fileOrGlob)) { - const useRoot = fileOrGlob.root ?? root; - const isGlobalPattern2 = isGlobPatternWithRoot(fileOrGlob) ? fileOrGlob.isGlobalPattern : isGlobalGlob(fileOrGlob.glob); - return { ...fileOrGlob, root: useRoot, isGlobalPattern: isGlobalPattern2 }; +// node_modules/cspell-dictionary/dist/SpellingDictionary/IgnoreWordsDictionary.js +var NormalizeForm = "NFC"; +var IgnoreWordsDictionary = class { + constructor(name, source, words) { + this.name = name; + this.source = source; + this.containsNoSuggestWords = true; + this.options = {}; + this.type = "ignore"; + this.isDictionaryCaseSensitive = true; + this.dict = new Set(words); + this.dictNonStrict = new Set(pipeSync(this.dict, opFilterSync((w) => w.startsWith("~")), opMapSync((w) => w.slice(1)))); } - if (doesRootContainPath(root, fileOrGlob, path16) || relRegExp.test(fileOrGlob)) { - const rel = path16.relative(root, path16.resolve(root, fileOrGlob)); - return { glob: pathToGlob(rel), root, isGlobalPattern }; + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param _word - the word + * @param _options - options + * @returns always false + */ + has(word, options) { + const nWord = word.normalize(NormalizeForm); + if (this.dict.has(nWord)) + return true; + const lcWord = nWord.toLowerCase(); + if (this.dict.has(lcWord)) + return true; + const ignoreCase2 = options?.ignoreCase ?? ignoreCase; + return ignoreCase2 && (this.dictNonStrict.has(nWord) || this.dictNonStrict.has(lcWord)); + } + /** A more detailed search for a word, might take longer than `has` */ + find(word, options) { + const nWord = word.normalize(NormalizeForm); + if (this.dict.has(nWord)) + return { found: nWord, forbidden: false, noSuggest: true }; + const lcWord = nWord.toLowerCase(); + if (this.dict.has(lcWord)) + return { found: lcWord, forbidden: false, noSuggest: true }; + const ignoreCase2 = options?.ignoreCase ?? ignoreCase; + if (!ignoreCase2) + return void 0; + if (this.dictNonStrict.has(nWord)) + return { found: nWord, forbidden: false, noSuggest: true }; + return this.dictNonStrict.has(lcWord) && { found: lcWord, forbidden: false, noSuggest: true } || void 0; } - return { glob: pathToGlob(fileOrGlob), root, isGlobalPattern }; + isForbidden(_word, _ignoreCase) { + return false; + } + isNoSuggestWord(word, options) { + return this.has(word, options); + } + suggest() { + return []; + } + genSuggestions() { + return; + } + mapWord(word) { + return word; + } + get size() { + return this.dict.size; + } + getErrors() { + return []; + } +}; +var createCache3 = createAutoResolveWeakCache(); +function createIgnoreWordsDictionary(wordList, name, source) { + return createCache3.get(wordList, () => { + const testSpecialCharacters = /[*+]/; + const words = [...parseDictionaryLines(wordList, { stripCaseAndAccents: true })].map((w) => w.normalize(NormalizeForm)); + const hasSpecial = words.findIndex((word) => testSpecialCharacters.test(word)) >= 0; + if (hasSpecial) { + return createSpellingDictionary(words, name, source, { + caseSensitive: true, + noSuggest: true, + weightMap: void 0, + supportNonStrictSearches: true + }); + } + return new IgnoreWordsDictionary(name, source, words); + }); } -function doesRootContainPath(root, child, path16) { - if (child.startsWith(root)) - return true; - const rel = path16.relative(root, child); - return !rel || rel !== child && !rel.startsWith("..") && !path16.isAbsolute(rel); + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SpellingDictionaryCollection.js +function identityString(w) { + return w; } -function isGlobPatternWithOptionalRoot(g) { - return typeof g !== "string" && typeof g.glob === "string"; +var SpellingDictionaryCollectionImpl = class { + constructor(dictionaries, name, source) { + this.dictionaries = dictionaries; + this.name = name; + this.options = { weightMap: void 0 }; + this.mapWord = identityString; + this.type = "SpellingDictionaryCollection"; + this._isNoSuggestWord = (word, options) => { + if (!this.containsNoSuggestWords) + return false; + return !!isNoSuggestWordInAnyDictionary(this.dictionaries, word, options || {}); + }; + this.dictionaries = this.dictionaries.sort((a, b) => b.size - a.size); + this.source = source || dictionaries.map((d) => d.name).join(", "); + this.isDictionaryCaseSensitive = this.dictionaries.reduce((a, b) => a || b.isDictionaryCaseSensitive, false); + this.containsNoSuggestWords = this.dictionaries.reduce((a, b) => a || b.containsNoSuggestWords, false); + } + has(word, hasOptions) { + const options = hasOptionToSearchOption(hasOptions); + return !!isWordInAnyDictionary(this.dictionaries, word, options) && !this.isForbidden(word); + } + find(word, hasOptions) { + const options = hasOptionToSearchOption(hasOptions); + return findInAnyDictionary(this.dictionaries, word, options); + } + isNoSuggestWord(word, options) { + return this._isNoSuggestWord(word, options); + } + isForbidden(word, ignoreCaseAndAccents) { + const ignoreCase2 = ignoreCaseAndAccents ?? isForbiddenIgnoreCaseAndAccents; + return !!this._isForbiddenInDict(word, ignoreCase2) && !this.isNoSuggestWord(word, { ignoreCase: ignoreCase2 }); + } + suggest(word, suggestOptions = {}) { + return this._suggest(word, suggestOptions); + } + _suggest(word, suggestOptions) { + const { numSuggestions = defaultNumSuggestions, numChanges, ignoreCase: ignoreCase2, includeTies, timeout } = suggestOptions; + const prefixNoCase = CASE_INSENSITIVE_PREFIX; + const filter3 = (word2, _cost) => { + return (ignoreCase2 || word2[0] !== prefixNoCase) && !this.isForbidden(word2) && !this.isNoSuggestWord(word2, suggestOptions); + }; + const collectorOptions = { + numSuggestions, + filter: filter3, + changeLimit: numChanges, + includeTies, + ignoreCase: ignoreCase2, + timeout + }; + const collector = suggestionCollector(word, collectorOptions); + this.genSuggestions(collector, suggestOptions); + return collector.suggestions; + } + get size() { + return this.dictionaries.reduce((a, b) => a + b.size, 0); + } + getPreferredSuggestions(word) { + const sugs = this.dictionaries.flatMap((dict) => dict.getPreferredSuggestions?.(word)).filter(isDefined5); + if (sugs.length <= 1) + return sugs; + const unique2 = /* @__PURE__ */ new Set(); + return sugs.filter((sug) => { + if (unique2.has(sug.word)) + return false; + unique2.add(sug.word); + return true; + }); + } + genSuggestions(collector, suggestOptions) { + const _suggestOptions = { ...suggestOptions }; + const { compoundMethod = CompoundWordsMethod.SEPARATE_WORDS } = suggestOptions; + _suggestOptions.compoundMethod = this.options.useCompounds ? CompoundWordsMethod.JOIN_WORDS : compoundMethod; + this.dictionaries.forEach((dict) => dict.genSuggestions(collector, _suggestOptions)); + } + getErrors() { + return this.dictionaries.reduce((errors, dict) => errors.concat(dict.getErrors?.() || []), []); + } + _isForbiddenInDict(word, ignoreCase2) { + return isWordForbiddenInAnyDictionary(this.dictionaries, word, ignoreCase2); + } +}; +function createCollection(dictionaries, name, source) { + return new SpellingDictionaryCollectionImpl(dictionaries, name, source); } -function isGlobPatternWithRoot(g) { - return typeof g.root === "string" && "isGlobalPattern" in g; +function isWordInAnyDictionary(dicts, word, options) { + return genSequence(dicts).first((dict) => dict.has(word, options)); } -function isGlobPatternNormalized(g) { - if (!isGlobPatternWithOptionalRoot(g)) +function findInAnyDictionary(dicts, word, options) { + const found = dicts.map((dict) => dict.find(word, options)).filter(isDefined5); + if (!found.length) + return void 0; + return found.reduce((a, b) => ({ + found: a.forbidden ? a.found : b.forbidden ? b.found : a.found || b.found, + forbidden: a.forbidden || b.forbidden, + noSuggest: a.noSuggest || b.noSuggest + })); +} +function isNoSuggestWordInAnyDictionary(dicts, word, options) { + return genSequence(dicts).first((dict) => dict.isNoSuggestWord(word, options)); +} +function isWordForbiddenInAnyDictionary(dicts, word, ignoreCase2) { + return genSequence(dicts).first((dict) => dict.isForbidden(word, ignoreCase2)); +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SuggestDictionary.js +var SuggestDictionaryImpl = class { + constructor(name, source, typosDef) { + this.name = name; + this.source = source; + this.typosDef = typosDef; + this.containsNoSuggestWords = false; + this.options = {}; + this.type = "suggest"; + this.isDictionaryCaseSensitive = true; + this.size = Object.keys(typosDef).length; + this.suggestions = extractAllSuggestions(typosDef); + this.suggestionsLower = new Set(pipeSync(this.suggestions, mapperRemoveCaseAndAccents)); + } + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param _word - the word + * @param _options - options + * @returns always false + */ + has(_word, _options) { return false; - if (!isGlobPatternWithRoot(g)) + } + /** A more detailed search for a word, might take longer than `has` */ + find(_word, _options) { + return void 0; + } + isForbidden(_word, _ignoreCaseAndAccents) { return false; - const gr = g; - return "rawGlob" in gr && "rawRoot" in gr && typeof gr.rawGlob === "string"; -} -function normalizePattern(pattern, nested) { - pattern = pattern.replace(/^(!!)+/, ""); - const isNeg = pattern.startsWith("!"); - const prefix = isNeg ? "!" : ""; - pattern = isNeg ? pattern.slice(1) : pattern; - const patterns = nested ? normalizePatternNested(pattern) : normalizePatternGeneral(pattern); - return patterns.map((p) => prefix + p); -} -function normalizePatternNested(pattern) { - if (!pattern.includes("/")) { - if (pattern === "**") - return ["**"]; - return ["**/" + pattern, "**/" + pattern + "/**"]; } - const hasLeadingSlash = pattern.startsWith("/"); - pattern = hasLeadingSlash ? pattern.slice(1) : pattern; - if (pattern.endsWith("/")) { - return hasLeadingSlash || pattern.slice(0, -1).includes("/") ? [pattern + "**/*"] : ["**/" + pattern + "**/*"]; + isNoSuggestWord(_word, _options) { + return false; } - if (pattern.endsWith("**")) { - return [pattern]; + /** + * Determine if the word can appear in a list of suggestions. + * @param word - word + * @param ignoreCaseAndAccents - ignore case. + * @returns true if a word is suggested, otherwise false. + */ + isSuggestedWord(word, ignoreCaseAndAccents = isForbiddenIgnoreCaseAndAccents) { + if (this.suggestions.has(word)) + return true; + const lcWord = word.toLowerCase(); + return ignoreCaseAndAccents && (this.suggestions.has(lcWord) || this.suggestionsLower.has(lcWord)); } - return [pattern, pattern + "/**"]; -} -function normalizePatternGeneral(pattern) { - pattern = pattern.startsWith("/") ? pattern.slice(1) : pattern; - pattern = pattern.endsWith("/") ? pattern + "**/*" : pattern; - return [pattern]; -} -function normalizeGlobPatterns(patterns, options) { - function* normalize() { - for (const glob2 of patterns) { - if (isGlobPatternNormalized(glob2)) { - yield glob2; - continue; - } - yield* normalizeGlobPattern(glob2, options); + suggest(word) { + return this.getPreferredSuggestions(word); + } + _suggest(word) { + if (!(word in this.typosDef)) + return void 0; + const sug = this.typosDef[word]; + const isPreferred = true; + if (!sug) + return []; + if (typeof sug === "string") { + return [ + { + word: sug, + cost: 1, + isPreferred + } + ]; } + return sug.map((word2, index) => ({ word: word2, cost: index + 1, isPreferred })); } - return [...normalize()]; -} -function normalizeGlobPattern(g, options) { - const { root, nodePath: path16 = Path, nested, cwd = Path.resolve() } = options; - g = !isGlobPatternWithOptionalRoot(g) ? { glob: g } : g; - const gr = { ...g, root: g.root ?? root }; - const rawRoot = gr.root; - const rawGlob = g.glob; - gr.glob = gr.glob.trim(); - if (gr.glob.startsWith("${cwd}")) { - gr.glob = gr.glob.replace("${cwd}", ""); - gr.root = "${cwd}"; + getPreferredSuggestions(word) { + return this._suggest(word) || this._suggest(word.toLowerCase()) || []; } - if (gr.root.startsWith("${cwd}")) { - gr.root = path16.resolve(gr.root.replace("${cwd}", cwd)); + genSuggestions(collector) { + const sugs = this.suggest(collector.word); + sugs.forEach((result) => collector.add(result)); } - const isGlobalPattern = isGlobalGlob(gr.glob); - gr.root = path16.resolve(root, path16.normalize(gr.root)); - const globs = normalizePattern(gr.glob, nested); - return globs.map((glob2) => ({ ...gr, glob: glob2, rawGlob, rawRoot, isGlobalPattern })); + mapWord(word) { + return word; + } + getErrors() { + return []; + } +}; +var createCache4 = createAutoResolveWeakCache(); +function createSuggestDictionary(entries, name, source) { + return createCache4.get(entries, () => { + const def = processEntriesToTyposDef(entries); + return new SuggestDictionaryImpl(name, source, def); + }); } -function normalizeGlobToRoot(glob2, root, path16) { - function relToGlob(relativePath2) { - return path16.sep === "\\" ? relativePath2.replace(/\\/g, "/") : relativePath2; + +// node_modules/cspell-dictionary/dist/SpellingDictionary/createInlineSpellingDictionary.js +var cache = createAutoResolveWeakCache(); +function createInlineSpellingDictionary(inlineDict, source) { + return cache.get(inlineDict, () => { + const { words, flagWords, ignoreWords, suggestWords, name } = inlineDict; + const dictSources = [ + words && createSpellingDictionary(words, name + "-words", source, inlineDict), + flagWords && createFlagWordsDictionary(flagWords, name + "-flag-words", source), + ignoreWords && createIgnoreWordsDictionary(ignoreWords, name + "-ignore-words", source), + suggestWords && createSuggestDictionary(suggestWords, name + "-suggest", source) + ].filter(isDefined5); + return createCollection(dictSources, name, source); + }); +} + +// node_modules/cspell-lib/dist/esm/static.mjs +var cspellIO = new CSpellIONode(); +function getCSpellIO() { + return cspellIO; +} + +// node_modules/@cspell/strong-weak-map/dist/esm/StrongWeakMap.mjs +var _a; +var StrongWeakMap = class { + constructor(init) { + this[_a] = "StrongWeakMap"; + this.map = new Map(init?.map(([k, v]) => [k, new WeakRef(v)])); } - if (glob2.root === root) { - return glob2; + clear() { + this.map.clear(); } - const relFromRootToGlob = path16.relative(root, glob2.root); - if (!relFromRootToGlob) { - return glob2; + /** + * @returns true if an element in the Map existed and has been removed, or false if the element does not exist. + */ + delete(key) { + return this.map.delete(key); } - if (glob2.isGlobalPattern) { - return { ...glob2, root }; + /** + * Executes a provided function once per each key/value pair in the Map, in insertion order. + */ + forEach(callbackfn, thisArg) { + if (thisArg) { + callbackfn = callbackfn.bind(thisArg); + } + for (const [key, value] of this) { + callbackfn(value, key, this); + } } - const relFromGlobToRoot = path16.relative(glob2.root, root); - const globIsUnderRoot = relFromRootToGlob[0] !== "." && !path16.isAbsolute(relFromRootToGlob); - const rootIsUnderGlob = relFromGlobToRoot[0] !== "." && !path16.isAbsolute(relFromGlobToRoot); - if (!globIsUnderRoot && !rootIsUnderGlob) { - return glob2; + /** + * Returns a specified element from the Map object. You will get a reference to the value object and any change made to that + * object will effectively modify it inside the Map. + * @returns Returns the element associated with the specified key. + * If no element is associated with the specified key, undefined is returned. + */ + get(key) { + const ref = this.map.get(key); + if (!ref) + return void 0; + const value = ref.deref(); + if (!value) { + this.map.delete(key); + return void 0; + } + return value; } - const isNeg = glob2.glob.startsWith("!"); - const g = isNeg ? glob2.glob.slice(1) : glob2.glob; - const prefix = isNeg ? "!" : ""; - if (globIsUnderRoot) { - const relGlob2 = relToGlob(relFromRootToGlob); - return { - ...glob2, - glob: prefix + posix.join(relGlob2, g), - root - }; + /** + * Returns a specified element from the Map. If the element isn't found, the resolver function is called and the result is stored in the map and returned. + */ + autoGet(key, resolver) { + const found = this.get(key); + if (found) + return found; + const created = resolver(key); + this.set(key, created); + return created; } - const relGlob = relToGlob(relFromGlobToRoot) + "/"; - const rebasedGlob = rebaseGlob(g, relGlob); - return rebasedGlob ? { ...glob2, glob: prefix + rebasedGlob, root } : glob2; -} -function rebaseGlob(glob2, rebaseTo) { - if (!rebaseTo || rebaseTo === "/") - return glob2; - if (glob2.startsWith("**")) - return glob2; - rebaseTo = rebaseTo.endsWith("/") ? rebaseTo : rebaseTo + "/"; - if (glob2.startsWith(rebaseTo)) { - return glob2.slice(rebaseTo.length); + /** + * Note: has will cause the value object to live longer. + * See: [WeakRef - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) + * @returns boolean indicating whether an element with the specified key exists or not. + */ + has(key) { + const value = this.get(key); + return !!value; } - const relParts = rebaseTo.split("/"); - const globParts = glob2.split("/"); - for (let i = 0; i < relParts.length && i < globParts.length; ++i) { - const relSeg = relParts[i]; - const globSeg = globParts[i]; - if (!relSeg || globSeg === "**") { - return globParts.slice(i).join("/"); + /** + * Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + */ + set(key, value) { + this.map.set(key, new WeakRef(value)); + return this; + } + /** + * @returns the number of elements in the Map. Note: it is possible that some of the values have been dereferenced + */ + get size() { + return this.map.size; + } + /** Returns an iterable of entries in the map. */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + *entries() { + for (const key of this.map.keys()) { + const value = this.get(key); + if (!value) + continue; + yield [key, value]; } - if (relSeg !== globSeg && globSeg !== "*") { - break; + } + /** + * Returns an iterable of keys in the map + * + * Note: It is possible that the value associated with the key was released. + */ + keys() { + return this.map.keys(); + } + /** + * Returns an iterable of values in the map + */ + *values() { + for (const [_, value] of this) { + yield value; } } - return void 0; -} -function isGlobalGlob(glob2) { - return isGlobalPatternRegExp.test(glob2); -} + /** + * Removes any keys that reference released objects. + */ + cleanKeys() { + [...this]; + return this; + } +}; +_a = Symbol.toStringTag; -// node_modules/cspell-glob/dist/esm/GlobMatcher.mjs -var import_micromatch = __toESM(require_micromatch(), 1); -var Path2 = __toESM(require("path"), 1); -var GlobMatcher = class { - constructor(patterns, rootOrOptions, _nodePath) { - _nodePath = _nodePath ?? Path2; - const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions ?? {}; - const { mode = "exclude" } = options; - const isExcludeMode = mode !== "include"; - _nodePath = options.nodePath ?? _nodePath; - const { root = _nodePath.resolve(), dot = isExcludeMode, nodePath = _nodePath, nested = isExcludeMode, cwd = process.cwd(), nobrace } = options; - const normalizedRoot = nodePath.resolve(nodePath.normalize(root)); - this.options = { root: normalizedRoot, dot, nodePath, nested, mode, nobrace, cwd }; - patterns = Array.isArray(patterns) ? patterns : typeof patterns === "string" ? patterns.split(/\r?\n/g) : [patterns]; - const globPatterns = normalizeGlobPatterns(patterns, this.options); - this.patternsNormalizedToRoot = globPatterns.map((g) => normalizeGlobToRoot(g, normalizedRoot, nodePath)).filter((g) => nodePath.relative(g.root, normalizedRoot) === ""); - this.patterns = globPatterns; - this.root = normalizedRoot; - this.path = nodePath; - this.dot = dot; - this.matchEx = buildMatcherFn(this.patterns, this.options); +// node_modules/cspell-lib/dist/esm/SpellingDictionary/SpellingDictionaryError.mjs +var SpellingDictionaryLoadError = class extends Error { + constructor(uri, options, cause, message) { + super(message); + this.uri = uri; + this.options = options; + this.cause = cause; + this.name = options.name; + } +}; +function isSpellingDictionaryLoadError(e) { + return e instanceof SpellingDictionaryLoadError; +} + +// node_modules/cspell-lib/dist/esm/SpellingDictionary/DictionaryController/DictionaryLoader.mjs +var MAX_AGE = 1e4; +var loaders = { + S: loadSimpleWordList, + C: legacyWordList, + W: wordsPerLineWordList, + T: loadTrie, + default: loadSimpleWordList +}; +var loadersSync = { + S: loadSimpleWordListSync, + C: legacyWordListSync, + W: wordsPerLineWordListSync, + T: loadTrieSync, + default: loadSimpleWordListSync +}; +var LoadingState; +(function(LoadingState2) { + LoadingState2[LoadingState2["Loaded"] = 0] = "Loaded"; + LoadingState2[LoadingState2["Loading"] = 1] = "Loading"; +})(LoadingState || (LoadingState = {})); +var DictionaryLoader = class { + constructor(cspellIO2) { + this.cspellIO = cspellIO2; + this.dictionaryCache = new StrongWeakMap(); + this.inlineDictionaryCache = new AutoResolveWeakCache(); + this.dictionaryCacheByDef = new StrongWeakMap(); + this.reader = toReader(cspellIO2); + } + loadDictionary(def) { + if (isDictionaryDefinitionInlineInternal(def)) { + return Promise.resolve(this.loadInlineDict(def)); + } + const { key, entry } = this.getCacheEntry(def); + if (entry) { + return entry.pending.then(([dictionary]) => dictionary); + } + const loadedEntry = this.loadEntry(def.path, def); + this.setCacheEntry(key, loadedEntry, def); + return loadedEntry.pending.then(([dictionary]) => dictionary); + } + loadDictionarySync(def) { + if (isDictionaryDefinitionInlineInternal(def)) { + return this.loadInlineDict(def); + } + const { key, entry } = this.getCacheEntry(def); + if (entry?.dictionary && entry.loadingState === LoadingState.Loaded) { + return entry.dictionary; + } + const loadedEntry = this.loadEntrySync(def.path, def); + this.setCacheEntry(key, loadedEntry, def); + return loadedEntry.dictionary; + } + /** + * Check to see if any of the cached dictionaries have changed. If one has changed, reload it. + * @param maxAge - Only check the dictionary if it has been at least `maxAge` ms since the last check. + * @param now - optional timestamp representing now. (Mostly used in testing) + */ + async refreshCacheEntries(maxAge = MAX_AGE, now = Date.now()) { + await Promise.all([...this.dictionaryCache.values()].map((entry) => this.refreshEntry(entry, maxAge, now))); + } + getCacheEntry(def) { + const defEntry = this.dictionaryCacheByDef.get(def); + if (defEntry) { + return defEntry; + } + const key = calcKey(def); + const entry = this.dictionaryCache.get(key); + if (entry) { + entry.options = def; + } + return { key, entry }; + } + setCacheEntry(key, entry, def) { + this.dictionaryCache.set(key, entry); + this.dictionaryCacheByDef.set(def, { key, entry }); + } + async refreshEntry(entry, maxAge, now) { + if (now - entry.ts >= maxAge) { + const sig = now + Math.random(); + entry.sig = sig; + entry.ts = now; + const pStat = this.getStat(entry.uri); + const [newStat] = await Promise.all([pStat, entry.pending]); + const hasChanged = !this.isEqual(newStat, entry.stat); + const sigMatches = entry.sig === sig; + if (sigMatches && hasChanged) { + entry.loadingState = LoadingState.Loading; + const key = calcKey(entry.options); + const newEntry = this.loadEntry(entry.uri, entry.options); + this.dictionaryCache.set(key, newEntry); + this.dictionaryCacheByDef.set(entry.options, { key, entry: newEntry }); + } + } + } + loadEntry(uri, options, now = Date.now()) { + options = this.normalizeOptions(uri, options); + const pDictionary = load(this.reader, uri, options).catch((e) => createFailedToLoadDictionary(options.name, uri, new SpellingDictionaryLoadError(uri, options, e, "failed to load"), options)); + const pStat = this.getStat(uri); + const pending = Promise.all([pDictionary, pStat]); + const sig = now + Math.random(); + const entry = { + uri, + options, + ts: now, + stat: void 0, + dictionary: void 0, + pending, + loadingState: LoadingState.Loading, + sig + }; + pending.then(([dictionary, stat2]) => { + entry.stat = stat2; + entry.dictionary = dictionary; + entry.loadingState = LoadingState.Loaded; + return; + }); + return entry; + } + loadEntrySync(uri, options, now = Date.now()) { + options = this.normalizeOptions(uri, options); + const stat2 = this.getStatSync(uri); + const sig = now + Math.random(); + try { + const dictionary = loadSync(this.reader, uri, options); + const pending = Promise.resolve([dictionary, stat2]); + return { + uri, + options, + ts: now, + stat: stat2, + dictionary, + pending, + loadingState: LoadingState.Loaded, + sig + }; + } catch (e) { + const error2 = toError2(e); + const dictionary = createFailedToLoadDictionary(options.name, uri, new SpellingDictionaryLoadError(uri, options, error2, "failed to load"), options); + const pending = Promise.resolve([dictionary, stat2]); + return { + uri, + options, + ts: now, + stat: stat2, + dictionary, + pending, + loadingState: LoadingState.Loaded, + sig + }; + } + } + getStat(uri) { + return this.cspellIO.getStat(uri).catch(toError2); + } + getStatSync(uri) { + try { + return this.cspellIO.getStatSync(uri); + } catch (e) { + return toError2(e); + } + } + isEqual(a, b) { + if (!b) + return false; + if (isError3(a)) { + return isError3(b) && a.message === b.message && a.name === b.name; + } + return !isError3(b) && !this.cspellIO.compareStats(a, b); } - /** - * Check to see if a filename matches any of the globs. - * If filename is relative, it is considered relative to the root. - * If filename is absolute and contained within the root, it will be made relative before being tested for a glob match. - * If filename is absolute and not contained within the root, it will be tested as is. - * @param filename full path of the file to check. - */ - match(filename) { - return this.matchEx(filename).matched; + normalizeOptions(uri, options) { + if (options.name) + return options; + return { ...options, name: this.cspellIO.uriBasename(uri) }; + } + loadInlineDict(def) { + return this.inlineDictionaryCache.get(def, (def2) => createInlineSpellingDictionary(def2, def2.__source || "memory")); } }; -function buildMatcherFn(patterns, options) { - const { nodePath: path16, dot, nobrace } = options; - const makeReOptions = { dot, nobrace }; - const rules = patterns.map((pattern, index) => ({ pattern, index })).filter((r) => !!r.pattern.glob).filter((r) => !r.pattern.glob.startsWith("#")).map(({ pattern, index }) => { - const matchNeg = pattern.glob.match(/^!/); - const glob2 = pattern.glob.replace(/^!/, ""); - const isNeg = matchNeg && matchNeg[0].length & 1 && true || false; - const reg = import_micromatch.default.makeRe(glob2, makeReOptions); - const fn2 = (filename) => { - const match = filename.match(reg); - return !!match; - }; - return { pattern, index, isNeg, fn: fn2, reg }; - }); - const negRules = rules.filter((r) => r.isNeg); - const posRules = rules.filter((r) => !r.isNeg); - const fn = (filename) => { - filename = path16.resolve(path16.normalize(filename)); - function testRules(rules2, matched) { - for (const rule of rules2) { - const pattern = rule.pattern; - const root = pattern.root; - const isRelPat = !pattern.isGlobalPattern; - if (isRelPat && !doesRootContainPath(root, filename, path16)) { - continue; - } - const relName = isRelPat ? path16.relative(root, filename) : filename; - const fname = path16.sep === "\\" ? relName.replace(/\\/g, "/") : relName; - if (rule.fn(fname)) { - return { - matched, - glob: pattern.glob, - root, - pattern, - index: rule.index, - isNeg: rule.isNeg - }; - } - } - } - return testRules(negRules, false) || testRules(posRules, true) || { matched: false }; +function toReader(cspellIO2) { + return { + read: async (filename) => (await cspellIO2.readFile(filename)).content, + readLines: async (filename) => toLines((await cspellIO2.readFile(filename)).content), + readSync: (filename) => cspellIO2.readFileSync(filename).content, + readLinesSync: (filename) => toLines(cspellIO2.readFileSync(filename).content) }; - return fn; +} +var importantOptionKeys = ["name", "noSuggest", "useCompounds", "type"]; +function calcKey(def) { + const path26 = def.path; + const loaderType = determineType(path26, def); + const optValues = importantOptionKeys.map((k) => def[k]?.toString() || ""); + const parts = [path26, loaderType].concat(optValues); + return parts.join("|"); +} +function isError3(e) { + const err = e; + return !!err.message; +} +function determineType(uri, opts) { + const t = opts.type && opts.type in loaders && opts.type || "S"; + const defLoaderType = t; + const defType = uri.endsWith(".trie.gz") ? "T" : defLoaderType; + const regTrieTest = /\.trie\b/i; + return regTrieTest.test(uri) ? "T" : defType; +} +function load(reader2, uri, options) { + const type = determineType(uri, options); + const loader2 = loaders[type] || loaders.default; + return loader2(reader2, uri, options); +} +function loadSync(reader2, uri, options) { + const type = determineType(uri, options); + const loader2 = loadersSync[type] || loaders.default; + return loader2(reader2, uri, options); +} +async function legacyWordList(reader2, filename, options) { + const lines = await reader2.readLines(filename); + return _legacyWordListSync(lines, filename, options); +} +function legacyWordListSync(reader2, filename, options) { + const lines = reader2.readLinesSync(filename); + return _legacyWordListSync(lines, filename, options); +} +function _legacyWordListSync(lines, filename, options) { + const words = pipeSync( + lines, + // Remove comments + opMapSync((line) => line.replace(/#.*/g, "")), + // Split on everything else + opConcatMapSync((line) => line.split(/[^\w\p{L}\p{M}'’]+/gu)), + opFilterSync((word) => !!word) + ); + return createSpellingDictionary(words, options.name, filename, options); +} +async function wordsPerLineWordList(reader2, filename, options) { + const lines = await reader2.readLines(filename); + return _wordsPerLineWordList(lines, filename, options); +} +function wordsPerLineWordListSync(reader2, filename, options) { + const lines = reader2.readLinesSync(filename); + return _wordsPerLineWordList(lines, filename, options); +} +function _wordsPerLineWordList(lines, filename, options) { + const words = pipeSync( + lines, + // Remove comments + opMapSync((line) => line.replace(/#.*/g, "")), + // Split on everything else + opConcatMapSync((line) => line.split(/\s+/gu)), + opFilterSync((word) => !!word) + ); + return createSpellingDictionary(words, options.name, filename, options); +} +async function loadSimpleWordList(reader2, filename, options) { + const lines = await reader2.readLines(filename); + return createSpellingDictionary(lines, options.name, filename, options); +} +function loadSimpleWordListSync(reader2, filename, options) { + const lines = reader2.readLinesSync(filename); + return createSpellingDictionary(lines, options.name, filename, options); +} +async function loadTrie(reader2, filename, options) { + const content = await reader2.read(filename); + return createSpellingDictionaryFromTrieFile(content, options.name, filename, options); +} +function loadTrieSync(reader2, filename, options) { + const content = reader2.readSync(filename); + return createSpellingDictionaryFromTrieFile(content, options.name, filename, options); +} +function toLines(content) { + return content.split(/\n|\r\n|\r/); } -// src/action.ts -var path15 = __toESM(require("path")); +// node_modules/cspell-lib/dist/esm/SpellingDictionary/DictionaryLoader.mjs +var loader; +function getDictionaryLoader(cspellIO2) { + if (loader) + return loader; + return loader = new DictionaryLoader(cspellIO2 || getCSpellIO()); +} +function loadDictionary(def) { + return getDictionaryLoader().loadDictionary(def); +} +function loadDictionarySync(def) { + return getDictionaryLoader().loadDictionarySync(def); +} +async function refreshCacheEntries(maxAge, now) { + return getDictionaryLoader().refreshCacheEntries(maxAge, now); +} -// src/ActionParams.ts -var import_fs = require("fs"); -var defaultActionParams = { - github_token: "", - files: "", - incremental_files_only: "true", - config: "", - root: "", - inline: "warning", - strict: "true", - verbose: "false", - check_dot_files: "explicit" -}; -function applyDefaults(params) { - const results = { ...params }; - const alias = results; - for (const [key, value] of Object.entries(defaultActionParams)) { - alias[key] = alias[key] || value; - } - return results; +// node_modules/cspell-lib/dist/esm/SpellingDictionary/Dictionaries.mjs +function loadDictionaryDefs(defsToLoad) { + return defsToLoad.map(loadDictionary); } -function validateToken(params) { - const token = params.github_token; - return !token ? "Missing GITHUB Token" : void 0; +function loadDictionaryDefsSync(defsToLoad) { + return defsToLoad.map(loadDictionarySync); } -function validateConfig(params) { - const config = params.config; - const success = !config || (0, import_fs.existsSync)(config); - return !success ? `Configuration file "${config}" not found.` : void 0; +function refreshDictionaryCache(maxAge) { + return refreshCacheEntries(maxAge); } -function validateRoot(params) { - const root = params.root; - const success = !root || (0, import_fs.existsSync)(root); - return !success ? `Root path does not exist: "${root}"` : void 0; +var emptyWords2 = Object.freeze([]); +async function getDictionaryInternal(settings) { + const spellDictionaries = await Promise.all(loadDictionaryDefs(calcDictionaryDefsToLoad(settings))); + return _getDictionaryInternal(settings, spellDictionaries); } -function validateInlineLevel(params) { - const inline = params.inline; - const success = isInlineWorkflowCommand(inline); - return !success ? `Invalid inline level (${inline}), must be one of (error, warning, none)` : void 0; +function getDictionaryInternalSync(settings) { + const spellDictionaries = loadDictionaryDefsSync(calcDictionaryDefsToLoad(settings)); + return _getDictionaryInternal(settings, spellDictionaries); } -var validateStrict = validateTrueFalse("strict", "Invalid strict setting, must be one of (true, false)"); -var validateIncrementalFilesOnly = validateTrueFalse( - "incremental_files_only", - "Invalid incremental_files_only setting, must be one of (true, false)" -); -var validateVerbose = validateTrueFalse("verbose", "Invalid verbose setting, must be one of (true, false)"); -function validateTrueFalse(key, msg) { - return (params) => { - const value = params[key]; - const success = value === "true" || value === "false"; - return !success ? msg : void 0; +function _getDictionaryInternal(settings, spellDictionaries) { + const { words = emptyWords2, userWords = emptyWords2, flagWords = emptyWords2, ignoreWords = emptyWords2, suggestWords = emptyWords2 } = settings; + const settingsWordsDictionary = createSpellingDictionary(words, "[words]", "From Settings `words`", { + caseSensitive: true, + weightMap: void 0 + }); + const settingsUserWordsDictionary = userWords.length ? createSpellingDictionary(userWords, "[userWords]", "From Settings `userWords`", { + caseSensitive: true, + weightMap: void 0 + }) : void 0; + const ignoreWordsDictionary = createIgnoreWordsDictionary(ignoreWords, "[ignoreWords]", "From Settings `ignoreWords`"); + const flagWordsDictionary = createFlagWordsDictionary(flagWords, "[flagWords]", "From Settings `flagWords`"); + const suggestWordsDictionary = createSuggestDictionary(suggestWords, "[suggestWords]", "From Settings `suggestWords`"); + const dictionaries = [ + ...spellDictionaries, + settingsWordsDictionary, + settingsUserWordsDictionary, + ignoreWordsDictionary, + flagWordsDictionary, + suggestWordsDictionary + ].filter(isDefined); + return createCollection(dictionaries, "dictionary collection"); +} + +// node_modules/cspell-lib/dist/esm/Settings/InDocSettings.mjs +var regExMatchRegEx = /\/.*\/[gimuy]*/; +var regExCSpellInDocDirective = /\b(?:spell-?checker|c?spell)::?(.*)/gi; +var regExCSpellDirectiveKey = /(?<=\b(?:spell-?checker|c?spell)::?)(?!:)(.*)/i; +var regExInFileSettings = [regExCSpellInDocDirective, /\b(LocalWords:?.*)/g]; +var officialDirectives = [ + "enable", + "disable", + "disable-line", + "disable-next", + "disable-next-line", + "word", + "words", + "ignore", + "ignoreWord", + "ignoreWords", + "ignore-word", + "ignore-words", + "includeRegExp", + "ignoreRegExp", + "local", + "locale", + "language", + "dictionaries", + "dictionary", + "forbid", + "forbidWord", + "forbid-word", + "flag", + "flagWord", + "flag-word", + "enableCompoundWords", + "enableAllowCompoundWords", + "disableCompoundWords", + "disableAllowCompoundWords", + "enableCaseSensitive", + "disableCaseSensitive" +]; +var noSuggestDirectives = /* @__PURE__ */ new Set(["local"]); +var preferredDirectives = [ + "enable", + "disable", + "disable-line", + "disable-next-line", + "words", + "ignore", + "forbid", + "locale", + "dictionary", + "dictionaries", + "enableCaseSensitive", + "disableCaseSensitive" +]; +var allDirectives = new Set(preferredDirectives.concat(officialDirectives)); +var allDirectiveSuggestions = [ + ...pipeSync(allDirectives, opMapSync((word) => ({ word }))) +]; +var dictInDocSettings = createSpellingDictionary(allDirectives, "Directives", "Directive List", { + supportNonStrictSearches: false +}); +var EmptyWords = []; +Object.freeze(EmptyWords); +var staticInDocumentDictionaryName = `[in-document-dict]`; +function getInDocumentSettings(text) { + const collectedSettings = getPossibleInDocSettings(text).concatMap((a) => parseSettingMatch(a)).reduce((s, setting) => { + return mergeInDocSettings(s, setting); + }, { id: "in-doc-settings" }); + const { words, flagWords, ignoreWords, suggestWords, dictionaries = [], dictionaryDefinitions = [], ...rest } = collectedSettings; + const dict = (words || flagWords || ignoreWords || suggestWords) && clean({ + name: staticInDocumentDictionaryName, + words, + flagWords, + ignoreWords, + suggestWords + }); + const dictSettings = dict ? { + dictionaries: dictionaries.concat(staticInDocumentDictionaryName), + dictionaryDefinitions: dictionaryDefinitions.concat(dict) + } : clean({ + dictionaries: dictionaries.length ? dictionaries : void 0, + dictionaryDefinitions: dictionaryDefinitions.length ? dictionaryDefinitions : void 0 + }); + const settings = { + ...rest, + ...dictSettings }; -} -var inlineWorkflowCommandSet = { - error: true, - warning: true, - none: true + return settings; +} +function validateInDocumentSettings(docText, _settings) { + return pipeSync(getPossibleInDocSettings(docText), opMapSync(parseSettingMatchValidation), opFilterSync(isDefined)); +} +var settingParsers = [ + [/^(?:enable|disable)(?:allow)?CompoundWords\b(?!-)/i, parseCompoundWords], + [/^(?:enable|disable)CaseSensitive\b(?!-)/i, parseCaseSensitive], + [/^enable\b(?!-)/i, parseEnable], + [/^disable(-line|-next(-line)?)?\b(?!-)/i, parseDisable], + [/^words?\b(?!-)/i, parseWords], + [/^ignore(?:-?words?)?\b(?!-)/i, parseIgnoreWords], + [/^(?:flag|forbid)(?:-?words?)?\b(?!-)/i, parseFlagWords], + [/^ignore_?Reg_?Exp\s+.+$/i, parseIgnoreRegExp], + [/^include_?Reg_?Exp\s+.+$/i, parseIncludeRegExp], + [/^locale?\b(?!-)/i, parseLocale2], + [/^language\s\b(?!-)/i, parseLocale2], + [/^dictionar(?:y|ies)\b(?!-)/i, parseDictionaries], + [/^LocalWords:/, (w) => parseWords(w.replace(/^LocalWords:?/gi, " "))] +]; +var emptySettings = Object.freeze({}); +var issueMessages = { + unknownDirective: "Unknown CSpell directive" }; -function isInlineWorkflowCommand(cmd) { - return !!inlineWorkflowCommandSet[cmd]; +function parseSettingMatchValidation(matchArray) { + const [fullMatch = ""] = matchArray; + const directiveMatch = fullMatch.match(regExCSpellDirectiveKey); + if (!directiveMatch) + return void 0; + const match2 = directiveMatch[1]; + const possibleSetting = match2.trim(); + if (!possibleSetting) + return void 0; + const start = (matchArray.index || 0) + (directiveMatch.index || 0) + (match2.length - match2.trimStart().length); + const text = possibleSetting.replace(/^([-\w]+)?.*/, "$1"); + const end = start + text.length; + if (!text) + return void 0; + const matchingParsers = settingParsers.filter(([regex]) => regex.test(possibleSetting)); + if (matchingParsers.length > 0) + return void 0; + const dictSugs = dictInDocSettings.suggest(text, { ignoreCase: false }).map(({ word, isPreferred }) => isPreferred ? { word, isPreferred } : { word }).filter((a) => !noSuggestDirectives.has(a.word)); + const sugs = pipeSync(dictSugs, opAppendSync(allDirectiveSuggestions), filterUniqueSuggestions); + const suggestionsEx = [...sugs].slice(0, 8); + const suggestions = suggestionsEx.map((s) => s.word); + const issue = { + range: [start, end], + text, + message: issueMessages.unknownDirective, + suggestions, + suggestionsEx + }; + return issue; } -function validateActionParams(params, logError) { - const validations = [ - validateToken, - validateConfig, - validateRoot, - validateInlineLevel, - validateStrict, - validateIncrementalFilesOnly, - validateVerbose - ]; - const success = validations.map((fn) => fn(params)).map((msg) => !msg || (logError(msg), false)).reduce((a, b) => a && b, true); - if (!success) { - throw new AppError("Bad Configuration."); +function* filterUniqueSuggestions(sugs) { + const map3 = /* @__PURE__ */ new Map(); + for (const sug of sugs) { + const existing = map3.get(sug.word); + if (existing) { + if (sug.isPreferred) { + existing.isPreferred = true; + } + } + yield sug; } } - -// src/getActionParams.ts -var core = __toESM(require_core()); -function getActionParams() { - return applyDefaults({ - github_token: core.getInput("github_token", { required: true }), - files: core.getInput("files"), - incremental_files_only: tf(core.getInput("incremental_files_only")), - config: core.getInput("config"), - root: core.getInput("root"), - inline: core.getInput("inline").toLowerCase(), - strict: tf(core.getInput("strict")), - verbose: tf(core.getInput("verbose")), - check_dot_files: tf(core.getInput("check_dot_files")) +function parseSettingMatch(matchArray) { + const [, match2 = ""] = matchArray; + const possibleSetting = match2.trim(); + return settingParsers.filter(([regex]) => regex.test(possibleSetting)).map(([, fn]) => fn).map((fn) => fn(possibleSetting)); +} +function parseCompoundWords(match2) { + const allowCompoundWords = /enable/i.test(match2); + return { allowCompoundWords }; +} +function parseCaseSensitive(match2) { + const caseSensitive = /enable/i.test(match2); + return { caseSensitive }; +} +function parseWords(match2) { + const words = match2.split(/[,\s;]+/g).slice(1).filter((a) => !!a); + return { words }; +} +function parseLocale2(match2) { + const parts = match2.trim().split(/[\s,]+/); + const language = parts.slice(1).join(","); + return language ? { language } : emptySettings; +} +function parseIgnoreWords(match2) { + const wordsSetting = parseWords(match2); + const ignoreWords = wordsSetting.words; + return ignoreWords && ignoreWords.length ? { ignoreWords } : emptySettings; +} +function parseFlagWords(match2) { + const wordsSetting = parseWords(match2); + const flagWords = wordsSetting.words; + return flagWords && flagWords.length ? { flagWords } : emptySettings; +} +function parseRegEx(match2) { + const patterns = [match2.replace(/^[^\s]+\s+/, "")].map((a) => { + const m = a.match(regExMatchRegEx); + if (m && m[0]) { + return m[0]; + } + return a.replace(/((?:[^\s]|\\ )+).*/, "$1"); }); + return patterns; } -function tf(v) { - const mapValues = { - true: "true", - t: "true", - false: "false", - f: "false", - "0": "false", - "1": "true" - }; - v = typeof v === "boolean" || typeof v === "number" ? v ? "true" : "false" : v; - v = v.toString(); - v = v.toLowerCase(); - v = mapValues[v] || v; - return v; +function parseIgnoreRegExp(match2) { + const ignoreRegExpList = parseRegEx(match2); + return { ignoreRegExpList }; } - -// src/github.ts -var import_plugin_rest_endpoint_methods = __toESM(require_dist_node11()); -async function getPullRequestFiles(git, prRef) { - const { owner, repo, pull_number } = prRef; - const { rest } = (0, import_plugin_rest_endpoint_methods.restEndpointMethods)(git); - const commits = await rest.pulls.listCommits({ owner, repo, pull_number }); - return fetchFilesForCommits(git, prRef, commits.data.map((c) => c.sha).filter(isString)); +function parseIncludeRegExp(match2) { + const includeRegExpList = parseRegEx(match2); + return { includeRegExpList }; } -function isString(s) { - return typeof s === "string"; +function parseDictionaries(match2) { + const dictionaries = match2.split(/[,\s]+/g).slice(1); + return { dictionaries }; } -async function fetchFilesForCommits(git, context, commitIds) { - const files = /* @__PURE__ */ new Set(); - for await (const file of fetchFilesForCommitsX(git, context, commitIds)) { - files.add(file); +function getPossibleInDocSettings(text) { + return genSequence(regExInFileSettings).concatMap((regexp) => match(regexp, text)); +} +function parseEnable(_match) { + return {}; +} +function parseDisable(_match) { + return {}; +} + +// node_modules/cspell-lib/dist/esm/Settings/TextDocumentSettings.mjs +function combineTextAndLanguageSettings(settings, text, languageId) { + if (!text) { + return toInternalSettings(calcSettingsForLanguageId(settings, languageId)); } - return files; + const docSettings = extractSettingsFromText(text); + const settingsForText = mergeSettings(settings, docSettings); + const langSettings = calcSettingsForLanguageId(settingsForText, languageId); + return mergeSettings(langSettings, docSettings); } -async function* fetchFilesForCommitsX(git, context, commitIds) { - const { owner, repo } = context; - const { rest } = (0, import_plugin_rest_endpoint_methods.restEndpointMethods)(git); - for (const ref of commitIds) { - const commit = await rest.repos.getCommit({ owner, repo, ref }); - const files = commit.data.files; - if (!files) - continue; - for (const f of files) { - if (f.filename) { - yield f.filename; - } - } +function extractSettingsFromText(text) { + return getInDocumentSettings(text); +} + +// node_modules/cspell-lib/dist/esm/textValidation/determineTextDocumentSettings.mjs +var path11 = __toESM(require("path"), 1); +function determineTextDocumentSettings(doc, settings) { + const filename = uriToFilePath(doc.uri); + const settingsWithDefaults = mergeSettings(getDefaultSettings(settings.loadDefaultConfiguration ?? true), getGlobalSettings(), settings); + const fileSettings = calcOverrideSettings(settingsWithDefaults, filename); + const languageIds2 = fileSettings?.languageId?.length ? fileSettings.languageId : doc.languageId ? doc.languageId : getLanguageForFilename(filename); + if (doc.locale) { + fileSettings.language = doc.locale; } + return combineTextAndLanguageSettings(fileSettings, doc.text, languageIds2); +} +function getLanguageForFilename(filename) { + const basename7 = path11.basename(filename); + return getLanguagesForBasename(basename7); } -// src/reporter.ts -var core2 = __toESM(require_core()); -var import_command = __toESM(require_command()); -var import_vscode_uri = __toESM(require_umd()); -var path = __toESM(require("path")); -function nullEmitter(_msg) { +// node_modules/@cspell/cspell-types/dist/esm/CSpellReporter.mjs +var IssueType; +(function(IssueType2) { + IssueType2[IssueType2["spelling"] = 0] = "spelling"; + IssueType2[IssueType2["directive"] = 1] = "directive"; +})(IssueType || (IssueType = {})); +var MessageTypes = { + Debug: "Debug", + Info: "Info", + Warning: "Warning" +}; + +// node_modules/cspell-lib/dist/esm/textValidation/docValidator.mjs +var import_assert15 = __toESM(require("assert"), 1); +var import_path3 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/suggestions.mjs +var import_assert13 = __toESM(require("assert"), 1); + +// node_modules/cspell-lib/dist/esm/util/memorizeLastCall.mjs +function memorizeLastCall2(fn) { + let last; + return (...p) => { + if (last && isArrayEqual(last.args, p)) { + return last.value; + } + const args = p; + const value = fn(...args); + last = { args, value }; + return value; + }; } -var CSpellReporterForGithubAction = class { - constructor(reportIssueCommand, options, logger = core2) { - this.reportIssueCommand = reportIssueCommand; - this.options = options; - this.logger = logger; - this.issues = []; - this.issueCounts = /* @__PURE__ */ new Map(); - this.result = { - files: -1, - filesWithIssues: /* @__PURE__ */ new Set(), - issues: -1, - errors: -1, - cachedFiles: 0 - }; - this.finished = false; - this.reporter = { - debug: (...args) => this._debug(...args), - error: (...args) => this._error(...args), - info: (...args) => this._info(...args), - issue: (...args) => this._issue(...args), - progress: (...args) => this._progress(...args), - result: (...args) => this._result(...args) + +// node_modules/cspell-lib/dist/esm/suggestions.mjs +var emptySuggestionOptions = Object.freeze({}); +var emptyCSpellSettings = Object.freeze({}); +var memorizeSuggestions = memorizeLastCall2(cacheSuggestionsForWord); +function cacheSuggestionsForWord(options, settings) { + const cache2 = createAutoResolveCache(); + return (word) => cache2.get(word, (word2) => _suggestionsForWord(word2, options, settings)); +} +async function _suggestionsForWord(word, options, settings) { + const { languageId, locale: language, includeDefaultConfig = true, dictionaries } = options; + async function determineDictionaries(config2) { + const withLocale = mergeSettings(config2, clean({ + language: language || config2.language + // dictionaries: dictionaries?.length ? dictionaries : config.dictionaries, + })); + const withLanguageId = calcSettingsForLanguageId(withLocale, languageId ?? withLocale.languageId ?? "plaintext"); + const settings2 = finalizeSettings(withLanguageId); + settings2.dictionaries = dictionaries?.length ? dictionaries : settings2.dictionaries || []; + validateDictionaries(settings2, dictionaries); + const dictionaryCollection2 = await getDictionaryInternal(settings2); + settings2.dictionaries = settings2.dictionaryDefinitions?.map((def) => def.name) || []; + const allDictionaryCollection2 = await getDictionaryInternal(settings2); + return { + dictionaryCollection: dictionaryCollection2, + allDictionaryCollection: allDictionaryCollection2 + }; + } + await refreshDictionaryCache(); + const config = includeDefaultConfig ? mergeSettings(getDefaultSettings(settings.loadDefaultConfiguration ?? true), getGlobalSettings(), settings) : settings; + const { dictionaryCollection, allDictionaryCollection } = await determineDictionaries(config); + return _suggestionsForWordSync(word, options, settings, dictionaryCollection, allDictionaryCollection); +} +function _suggestionsForWordSync(word, options, settings, dictionaryCollection, allDictionaryCollection) { + const extendsDictionaryCollection = allDictionaryCollection || dictionaryCollection; + const { locale: language, strict = true, numChanges = 4, numSuggestions = 8, includeTies = true, includeDefaultConfig = true } = options; + const ignoreCase2 = !strict; + const config = includeDefaultConfig ? mergeSettings(getDefaultSettings(settings.loadDefaultConfiguration ?? true), getGlobalSettings(), settings) : settings; + const opts = { ignoreCase: ignoreCase2, numChanges, numSuggestions, includeTies }; + const suggestionsByDictionary = dictionaryCollection.dictionaries.flatMap((dict) => dict.suggest(word, opts).map((r) => ({ ...r, dictName: dict.name }))); + const locale = adjustLocale(language || config.language || void 0); + const collator2 = Intl.Collator(locale); + const combined = limitResults(combine3(suggestionsByDictionary.sort((a, b) => a.cost - b.cost || collator2.compare(a.word, b.word))), numSuggestions, includeTies); + const sugsAdjusted = calcSuggestionAdjustedToToMatchCase(word, combined, locale, ignoreCase2, extendsDictionaryCollection); + const allSugs = sugsAdjusted.map((sug) => { + const found = extendsDictionaryCollection.find(sug.word); + return { + ...sug, + forbidden: found?.forbidden || false, + noSuggest: found?.noSuggest || false }; - this.verbose = options.verbose; + }); + return { + word, + suggestions: limitResults(allSugs, numSuggestions, includeTies) + }; +} +function combine3(suggestions) { + const words = /* @__PURE__ */ new Map(); + for (const sug of suggestions) { + const { word, cost, dictName, ...rest } = sug; + const f = words.get(word) || { word, cost, ...rest, dictionaries: [] }; + f.cost = Math.min(f.cost, cost); + f.dictionaries.push(dictName); + f.dictionaries.sort(); + words.set(word, f); } - _issue(issue) { - const { issues, issueCounts } = this; - const uri = issue.uri; - uri && issueCounts.set(uri, (issueCounts.get(uri) || 0) + 1); - issues.push(issue); + return [...words.values()]; +} +function adjustLocale(locale) { + if (!locale) + return void 0; + const locales = [...normalizeLocaleIntl(locale)].filter((locale2) => isValidLocaleIntlFormat(locale2)); + if (!locales.length) + return void 0; + if (locales.length === 1) + return locales[0]; + return locales; +} +function calcSuggestionAdjustedToToMatchCase(originalWord, sugs, locale, ignoreCase2, dict) { + locale = adjustLocale(locale); + const knownSugs = new Set(sugs.map((sug) => sug.word)); + const matchStyle = { ...analyzeCase(originalWord), locale, ignoreCase: ignoreCase2 }; + return sugs.map((sug) => { + const alt = matchCase2(sug.word, !!sug.isPreferred, matchStyle); + if (alt === sug.word || knownSugs.has(alt)) + return sug; + const found = dict.find(alt); + if (!found || !found.forbidden || !found.noSuggest) { + knownSugs.add(alt); + return { ...sug, wordAdjustedToMatchCase: alt }; + } + return sug; + }); +} +function limitResults(suggestions, numSuggestions, includeTies) { + let cost = suggestions[0]?.cost; + let i = 0; + for (; i < suggestions.length; ++i) { + if (i >= numSuggestions && (!includeTies || suggestions[i].cost > cost)) { + break; + } + cost = suggestions[i].cost; } - _info(message, _msgType) { - this._debug(message); + return suggestions.slice(0, i); +} +function validateDictionaries(settings, dictionaries) { + if (!dictionaries?.length) + return; + const knownDicts2 = new Set(settings.dictionaryDefinitions?.map((def) => def.name) || []); + for (const dict of dictionaries) { + if (!knownDicts2.has(dict)) { + throw new SuggestionError(`Unknown dictionary: "${dict}"`, "E_dictionary_unknown"); + } } - _debug(message) { - nullEmitter(message); +} +function matchCase2(word, isPreferred, style) { + const locale = style.locale; + if (style.isMixedCaps) { + return word; } - _progress(progress) { - if (!this.verbose || !isProgressFileComplete(progress)) { - return; + if (hasCaps(word)) { + if (style.isAllCaps) + return word.toLocaleUpperCase(locale); + if (!style.ignoreCase || style.hasCaps || isPreferred) + return word; + if (isTitleCase(word) || isAllCaps(word)) + return word.toLocaleLowerCase(locale); + return word; + } + if (!style.hasCaps) + return word; + if (style.isAllCaps) + return word.toLocaleUpperCase(locale); + (0, import_assert13.default)(style.isTitleCase); + return word.replace(/^\p{L}/u, (firstLetter) => firstLetter.toLocaleUpperCase(locale)); +} +var regExpHasCaps = /\p{Lu}/u; +var regExpIsAllCaps = /^[\P{L}\p{Lu}]+$/u; +var regExpIsTitleCase = /^\p{Lu}[\P{L}\p{Ll}]+$/u; +function analyzeCase(word) { + const hasCaps2 = regExpHasCaps.test(word); + const isAllCaps2 = hasCaps2 && regExpIsAllCaps.test(word); + const isTitleCase2 = hasCaps2 && !isAllCaps2 && regExpIsTitleCase.test(word); + const isMixedCaps = hasCaps2 && !isAllCaps2 && !isTitleCase2; + return { hasCaps: hasCaps2, isAllCaps: isAllCaps2, isMixedCaps, isTitleCase: isTitleCase2 }; +} +function hasCaps(word) { + return regExpHasCaps.test(word); +} +function isTitleCase(word) { + return regExpIsTitleCase.test(word); +} +function isAllCaps(word) { + return regExpIsAllCaps.test(word); +} +var SuggestionError = class extends Error { + constructor(message, code) { + super(message); + this.code = code; + } +}; + +// node_modules/cspell-lib/dist/esm/util/simpleCache.mjs +var SimpleCache2 = class { + constructor(size) { + this.size = size; + this.L0 = /* @__PURE__ */ new Map(); + this.L1 = /* @__PURE__ */ new Map(); + this.L2 = /* @__PURE__ */ new Map(); + } + has(key) { + for (const c of this.caches()) { + if (c.has(key)) + return true; } - const { issueCounts, logger } = this; - const issueCount = issueCounts.get(progress.filename) || 0; - const { fileNum, fileCount, filename, elapsedTimeMs } = progress; - const issues = issueCount ? ` issues: ${issueCount}` : ""; - const timeMsg = elapsedTimeMs ? `(${elapsedTimeMs.toFixed(2)}ms)` : "-"; - logger.info(`${fileNum}/${fileCount} ${filename}${issues} ${timeMsg}`); + return false; } - _error(message, error2) { - const { logger } = this; - logger.error(`${message} - name: ${error2.name} - msg: ${error2.message} - stack: -${error2.stack} - `); - return; + get(key) { + for (const c of this.caches()) { + const entry = c.get(key); + if (entry) { + if (c !== this.L0) { + this._set(key, entry); + } + return entry.v; + } + } + return void 0; } - _result(result) { - Object.assign(this.result, result); - this.finished = true; - const command = this.reportIssueCommand; - if (!["error", "warning"].includes(command)) { - return; + set(key, value) { + this._set(key, { v: value }); + } + _set(key, entry) { + if (this.L0.has(key)) { + this.L0.set(key, entry); + return this; } - const cwd = process.cwd(); - this.issues.forEach((item) => { - (0, import_command.issueCommand)( - command, - { - file: relative2(cwd, item.uri || ""), - line: item.row, - col: item.col - }, - `Unknown word (${item.text})` - ); - console.warn(`${relative2(cwd, item.uri || "")}:${item.row}:${item.col} Unknown word (${item.text})`); - }); + if (this.L0.size >= this.size) { + this.rotate(); + } + this.L0.set(key, entry); } -}; -function isProgressFileComplete(p) { - return p.type === "ProgressFileComplete"; -} -function relative2(cwd, fileUri) { - const fsPath = import_vscode_uri.URI.parse(fileUri).fsPath; - return path.relative(cwd, fsPath); -} - -// node_modules/@cspell/cspell-pipe/dist/esm/helpers/iteratorToIterable.mjs -function* iteratorToIterable(iterator) { - let n; - while (!(n = iterator.next()).done) { - yield n.value; + caches() { + return [this.L0, this.L1, this.L2]; } -} -async function* asyncIteratorToAsyncIterable(iterator) { - let n; - while (!(n = await iterator.next()).done) { - yield n.value; + rotate() { + this.L2 = this.L1; + this.L1 = this.L0; + this.L0 = /* @__PURE__ */ new Map(); } -} - -// node_modules/@cspell/cspell-pipe/dist/esm/helpers/util.mjs -function toPipeFn(syncFn, asyncFn) { - function _(i) { - return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); +}; +var AutoCache = class extends SimpleCache2 { + constructor(factory, size) { + super(size); + this.factory = factory; + } + get(key) { + const v = super.get(key); + if (v !== void 0) + return v; + const val = this.factory(key); + this.set(key, val); + return val; } - return _; -} -function isAsyncIterable(i) { - return typeof i[Symbol.asyncIterator] === "function"; -} +}; -// node_modules/@cspell/cspell-pipe/dist/esm/helpers/toArray.mjs -function toArray(i) { - return isAsyncIterable(i) ? toArrayAsync(i) : toArraySync(i); -} -function toArraySync(iter) { - return [...iter]; -} -async function toArrayAsync(iter) { - const collection = []; - for await (const i of iter) { - collection.push(i); +// node_modules/cspell-lib/dist/esm/util/timer.mjs +var _hrTime = process?.hrtime || polyHrTime; +function createTimer(hrTimeFn = _hrTime) { + let start = hrTimeFn(); + let lastLap = 0; + function elapsed() { + return toMilliseconds(hrTimeFn(start)); } - return collection; + return { + start() { + start = hrTimeFn(); + lastLap = 0; + }, + elapsed, + lap() { + const now = elapsed(); + const diff = now - lastLap; + lastLap = now; + return diff; + } + }; } - -// node_modules/@cspell/cspell-pipe/dist/esm/helpers/toAsyncIterable.mjs -async function* mergeAsyncIterables(iter, ...rest) { - for await (const i of [iter, ...rest]) { - yield* i; - } +function toMilliseconds(t) { + return (t[0] + t[1] * 1e-9) * 1e3; +} +function polyHrTime(time) { + const now = Date.now() - (time ? toMilliseconds(time) : 0); + const inSeconds = now * 1e-3; + const s = Math.floor(inSeconds); + const n = (inSeconds - s) * 1e9; + return [s, n]; } -var toAsyncIterable = mergeAsyncIterables; -// node_modules/@cspell/cspell-pipe/dist/esm/operators/index.mjs -var operators_exports = {}; -__export(operators_exports, { - opAppend: () => opAppend, - opAppendAsync: () => opAppendAsync, - opAppendSync: () => opAppendSync, - opAwaitAsync: () => opAwaitAsync, - opCombineAsync: () => opCombineAsync, - opCombineSync: () => opCombineSync, - opConcatMap: () => opConcatMap, - opConcatMapAsync: () => opConcatMapAsync, - opConcatMapSync: () => opConcatMapSync, - opFilter: () => opFilter, - opFilterAsync: () => opFilterAsync, - opFilterSync: () => opFilterSync, - opFirst: () => opFirst, - opFirstAsync: () => opFirstAsync, - opFirstSync: () => opFirstSync, - opFlatten: () => opFlatten, - opFlattenAsync: () => opFlattenAsync, - opFlattenSync: () => opFlattenSync, - opJoinStrings: () => opJoinStrings, - opJoinStringsAsync: () => opJoinStringsAsync, - opJoinStringsSync: () => opJoinStringsSync, - opLast: () => opLast, - opLastAsync: () => opLastAsync, - opLastSync: () => opLastSync, - opMap: () => opMap, - opMapAsync: () => opMapAsync, - opMapSync: () => opMapSync, - opReduceAsync: () => opReduceAsync, - opReduceSync: () => opReduceSync, - opSkip: () => opSkip, - opSkipAsync: () => opSkipAsync, - opSkipSync: () => opSkipSync, - opTake: () => opTake, - opTakeAsync: () => opTakeAsync, - opTakeSync: () => opTakeSync, - opTap: () => opTap, - opTapAsync: () => opTapAsync, - opTapSync: () => opTapSync, - opUnique: () => opUnique, - opUniqueAsync: () => opUniqueAsync, - opUniqueSync: () => opUniqueSync -}); +// node_modules/cspell-lib/dist/esm/textValidation/defaultConstants.mjs +var defaultMaxNumberOfProblems = 200; +var defaultMaxDuplicateProblems = 5; +var defaultMinWordLength = 4; -// node_modules/@cspell/cspell-pipe/dist/esm/operators/append.mjs -function opAppendAsync(...iterablesToAppend) { - async function* fn(iter) { - yield* iter; - for (const i of iterablesToAppend) { - yield* i; +// node_modules/cspell-lib/dist/esm/util/PairingHeap.mjs +var PairingHeap2 = class { + constructor(compare4) { + this.compare = compare4; + this._size = 0; + } + add(v) { + this._heap = insert3(this.compare, this._heap, v); + ++this._size; + return this; + } + dequeue() { + const n = this.next(); + if (n.done) + return void 0; + return n.value; + } + concat(i) { + for (const v of i) { + this.add(v); } + return this; } - return fn; -} -function opAppendSync(...iterablesToAppend) { - function* fn(iter) { - yield* iter; - for (const i of iterablesToAppend) { - yield* i; + next() { + if (!this._heap) { + return { value: void 0, done: true }; } + const value = this._heap.v; + --this._size; + this._heap = removeHead2(this.compare, this._heap); + return { value }; } - return fn; + peek() { + return this._heap?.v; + } + [Symbol.iterator]() { + return this; + } + get length() { + return this._size; + } +}; +function removeHead2(compare4, heap) { + if (!heap || !heap.c) + return void 0; + return mergeSiblings2(compare4, heap.c); } -function opAppend(...iterablesToAppend) { - function _(i) { - return isAsyncIterable(i) ? opAppendAsync(...iterablesToAppend)(i) : opAppendSync(...iterablesToAppend)(i); +function insert3(compare4, heap, v) { + const n = { + v, + s: void 0, + c: void 0 + }; + if (!heap || compare4(v, heap.v) <= 0) { + n.c = heap; + return n; + } + n.s = heap.c; + heap.c = n; + return heap; +} +function merge3(compare4, a, b) { + if (compare4(a.v, b.v) <= 0) { + a.s = void 0; + b.s = a.c; + a.c = b; + return a; + } + b.s = void 0; + a.s = b.c; + b.c = a; + return b; +} +function mergeSiblings2(compare4, n) { + if (!n.s) + return n; + const s = n.s; + const ss = s.s; + const m = merge3(compare4, n, s); + return ss ? merge3(compare4, m, mergeSiblings2(compare4, ss)) : m; +} + +// node_modules/cspell-lib/dist/esm/util/regexHelper.mjs +function escapeRegEx2(s) { + return s.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} + +// node_modules/cspell-lib/dist/esm/util/wordSplitter.mjs +var ignoreBreak = Object.freeze([]); +function split(line, offset, isValidWord, options = {}) { + const relWordToSplit = findNextWordText({ text: line.text, offset: offset - line.offset }); + const lineOffset = line.offset; + const requested = /* @__PURE__ */ new Map(); + const regExpIgnoreSegment = /^[-.+\d_eE'`\\\s]+$/; + if (!relWordToSplit.text) { + const text = rebaseTextOffset(relWordToSplit); + return { + line, + offset, + text, + words: [], + endOffset: text.offset + text.text.length + }; } - return _; + const lineSegment = { + line, + relStart: relWordToSplit.offset, + relEnd: relWordToSplit.offset + relWordToSplit.text.length + }; + const possibleBreaks = generateWordBreaks(lineSegment, options); + if (!possibleBreaks.length) { + const text = rebaseTextOffset(relWordToSplit); + return { + line, + offset, + text, + words: [{ ...text, isFound: isValidWord(text) }], + endOffset: text.offset + text.text.length + }; + } + function rebaseTextOffset(relText) { + return { + ...relText, + offset: relText.offset + lineOffset + }; + } + function has2(word) { + if (regExpIgnoreSegment.test(word.text)) { + return true; + } + const i = word.offset; + const j = word.text.length; + let v = i + (j << 20); + if (i < 1 << 20 && j < 1 << 11) { + const b = requested.get(v); + if (b !== void 0) + return b; + } else { + v = -1; + } + const r = isValidWord(rebaseTextOffset(word)); + if (v >= 0) { + requested.set(v, r); + } + return r; + } + possibleBreaks.push({ + offset: lineSegment.relEnd, + breaks: [ignoreBreak] + }); + const result = { + line, + offset, + text: rebaseTextOffset(relWordToSplit), + words: splitIntoWords(lineSegment, possibleBreaks, has2).map(rebaseTextOffset), + endOffset: lineOffset + lineSegment.relEnd + }; + return result; } - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/await.mjs -async function* _asyncAwait(iter) { - for await (const v of iter) { - yield v; +function findNextWordText({ text, offset }) { + const reg = new RegExp(regExWordsAndDigits); + reg.lastIndex = offset; + const m = reg.exec(text); + if (!m) { + return { + text: "", + offset: offset + text.length + }; + } + if (regExNumericLiteral.test(m[0])) { + return findNextWordText({ text, offset: offset + m[0].length }); } + return { + text: m[0], + offset: m.index + }; } -function opAwaitAsync() { - return _asyncAwait; +function generateWordBreaks(line, options) { + const camelBreaks = genWordBreakCamel(line); + const symbolBreaks = genSymbolBreaks(line); + const optionalBreaks = genOptionalWordBreaks(line, options.optionalWordBreakCharacters); + return mergeSortedBreaks(...camelBreaks, ...symbolBreaks, ...optionalBreaks); } - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/combine.mjs -function opCombineAsync(...fns) { - function combine(iter) { - for (const fn of fns) { - iter = fn(iter); - } - return iter; - } - return combine; +function offsetRegEx(reg, offset) { + const r = new RegExp(reg); + r.lastIndex = offset; + return r; } -function opCombineSync(...fns) { - function combine(iter) { - for (const fn of fns) { - iter = fn(iter); - } - return iter; +function genWordBreakCamel(line) { + const breaksCamel1 = []; + const text = line.line.text.slice(0, line.relEnd); + for (const m of text.matchAll(offsetRegEx(regExSplitWords, line.relStart))) { + if (m.index === void 0) + break; + const i = m.index + 1; + breaksCamel1.push({ + offset: m.index, + breaks: [[i, i], ignoreBreak] + }); + } + const breaksCamel2 = []; + for (const m of text.matchAll(offsetRegEx(regExSplitWords2, line.relStart))) { + if (m.index === void 0) + break; + const i = m.index + m[1].length; + const j = i + 1; + breaksCamel2.push({ + offset: m.index, + breaks: [[i, i], [j, j], ignoreBreak] + }); } - return combine; + return [breaksCamel1, breaksCamel2]; } - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/concatMap.mjs -function opConcatMapAsync(mapFn) { - async function* fn(iter) { - for await (const v of iter) { - yield* mapFn(v); +function calcBreaksForRegEx(line, reg, calcBreak) { + const sb = []; + const text = line.line.text.slice(0, line.relEnd); + for (const m of text.matchAll(offsetRegEx(reg, line.relStart))) { + const b = calcBreak(m); + if (b) { + sb.push(b); } } - return fn; + return sb; } -function opConcatMapSync(mapFn) { - function* fn(iter) { - for (const v of iter) { - yield* mapFn(v); - } +function genOptionalWordBreaks(line, optionalBreakCharacters) { + function calcBreaks(m) { + const i = m.index; + if (i === void 0) + return; + const j = i + m[0].length; + return { + offset: i, + breaks: [ + [i, j], + ignoreBreak + ] + }; } - return fn; + const breaks = [ + calcBreaksForRegEx(line, regExDanglingQuote, calcBreaks), + calcBreaksForRegEx(line, regExTrailingEndings, calcBreaks) + ]; + if (optionalBreakCharacters) { + const regex = new RegExp(`[${escapeRegEx2(optionalBreakCharacters)}]`, "gu"); + breaks.push(calcBreaksForRegEx(line, regex, calcBreaks)); + } + return breaks; } -var opConcatMap = (fn) => toPipeFn(opConcatMapSync(fn), opConcatMapAsync(fn)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/filter.mjs -function opFilterAsync(filterFn) { - async function* fn(iter) { - for await (const v of iter) { - const pass = await filterFn(v); - if (pass) - yield v; - } +function genSymbolBreaks(line) { + function calcBreaks(m) { + const i = m.index; + if (i === void 0) + return; + const j = i + m[0].length; + return { + offset: i, + breaks: [ + [i, j], + [i, i], + [j, j], + ignoreBreak + ] + }; } - return fn; + return [ + calcBreaksForRegEx(line, regExPossibleWordBreaks, calcBreaks), + calcBreaksForRegEx(line, /\d+/g, calcBreaks), + calcBreaksForRegEx(line, regExEscapeCharacters, calcBreaks) + ]; } -function opFilterSync(filterFn) { - function* fn(iter) { - for (const v of iter) { - if (filterFn(v)) - yield v; +function splitIntoWords(lineSeg, breaks, has2) { + const maxIndex = lineSeg.relEnd; + const maxAttempts = 1e3; + const knownPathsByIndex = /* @__PURE__ */ new Map(); + function makeCandidates(p, i, bi, currentCost) { + const len = maxIndex; + while (bi < breaks.length && breaks[bi].offset < i) { + bi += 1; + } + if (bi >= breaks.length) { + return []; + } + const br = breaks[bi]; + function c(bp) { + const d = bp.length < 2 ? len - i : (bp[0] - i) * 0.5 + len - bp[1]; + const ec = currentCost + d; + return { + p, + i, + bi, + bp, + c: currentCost, + ec, + text: void 0 + }; } + return br.breaks.map(c); } - return fn; -} -function opFilter(fn) { - const asyncFn = opFilterAsync(fn); - const syncFn = opFilterSync(fn); - function _(i) { - return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + function toTextOffset(text2, offset) { + const valid = has2({ text: text2, offset }); + return { + text: text2, + offset, + isFound: valid + }; } - return _; -} - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/first.mjs -function opFirstAsync(firstFn) { - async function* fn(iter) { - for await (const v of iter) { - const pass = await firstFn(v); - if (pass) { - yield v; - break; + function compare4(a, b) { + return a.ec - b.ec || b.i - a.i; + } + function pathToWords(node) { + const results = []; + for (let p = node; p; p = p.n) { + if (p.text) { + results.push(p.text); } } + return results; } - return fn; -} -function opFirstSync(firstFn) { - function* fn(iter) { - for (const v of iter) { - if (firstFn(v)) { - yield v; + function addToKnownPaths(candidate, path26) { + for (let can = candidate; can !== void 0; can = can.p) { + const t = can.text; + const i = can.i; + const cost = (!t || t.isFound ? 0 : t.text.length) + (path26?.c ?? 0); + const exitingPath = knownPathsByIndex.get(i); + if (exitingPath && exitingPath.c <= cost) { + return void 0; + } + const node = { + n: path26, + i, + c: cost, + text: t + }; + knownPathsByIndex.set(i, node); + path26 = node; + } + return path26; + } + let maxCost = lineSeg.relEnd - lineSeg.relStart; + const candidates = new PairingHeap2(compare4); + const text = lineSeg.line.text; + candidates.concat(makeCandidates(void 0, lineSeg.relStart, 0, 0)); + let attempts = 0; + let bestPath; + while (maxCost && candidates.length && attempts++ < maxAttempts) { + const best = candidates.dequeue(); + if (!best || best.c >= maxCost) { + continue; + } + if (best.bp.length) { + const i = best.bp[0]; + const j = best.bp[1]; + const t = i > best.i ? toTextOffset(text.slice(best.i, i), best.i) : void 0; + const cost = !t || t.isFound ? 0 : t.text.length; + const mc = maxIndex - j; + best.c += cost; + best.ec = best.c + mc; + best.text = t; + const possiblePath = knownPathsByIndex.get(j); + if (possiblePath) { + const f = addToKnownPaths(best, possiblePath); + bestPath = !bestPath || f && f.c < bestPath.c ? f : bestPath; + } else if (best.c < maxCost) { + const c = makeCandidates(t ? best : best.p, j, best.bi + 1, best.c); + candidates.concat(c); + } + } else { + const c = makeCandidates(best.p, best.i, best.bi + 1, best.c); + candidates.concat(c); + if (!c.length) { + const t = maxIndex > best.i ? toTextOffset(text.slice(best.i, maxIndex), best.i) : void 0; + const cost = !t || t.isFound ? 0 : t.text.length; + best.c += cost; + best.ec = best.c; + best.text = t; + const segText = t || best.p?.text || toTextOffset("", best.i); + const can = t ? { ...best, text: segText } : { ...best, ...best.p, text: segText }; + const f = addToKnownPaths(can, void 0); + bestPath = !bestPath || f && f.c < bestPath.c ? f : bestPath; + } + } + if (bestPath && bestPath.c < maxCost) { + maxCost = bestPath.c; + } + } + return pathToWords(bestPath); +} +function mergeSortedBreaks(...maps) { + return [].concat(...maps).sort((a, b) => a.offset - b.offset); +} + +// node_modules/cspell-lib/dist/esm/textValidation/isWordValid.mjs +function hasWordCheck(dict, word) { + word = word.includes("\\") ? word.replace(/\\/g, "") : word; + return dict.has(word); +} +function isWordValidWithEscapeRetry(dict, wo, line) { + const firstTry = hasWordCheck(dict, wo.text); + return firstTry || // Drop the first letter if it is preceded by a '\'. + line.text[wo.offset - line.offset - 1] === "\\" && hasWordCheck(dict, wo.text.slice(1)); +} + +// node_modules/cspell-lib/dist/esm/util/TextMap.mjs +var import_assert14 = __toESM(require("assert"), 1); +function extractTextMapRangeOrigin(textMap, extractRange) { + const { text: srcTxt, range: srcRange, map: srcMap } = textMap; + const [r0, r1] = srcRange; + const startOrig = Math.min(Math.max(extractRange[0], r0), r1); + const endOrig = Math.min(Math.max(extractRange[1], r0), r1); + const a = startOrig - r0; + const b = endOrig - r0; + const range = [startOrig, endOrig]; + if (!srcMap || !srcMap.length || a === b) { + const text2 = srcTxt.slice(a, b); + return { text: text2, range }; + } + (0, import_assert14.default)((srcMap.length & 1) === 0, "Map must be pairs of values."); + const mapLen = srcMap.length; + const mapEndSrc = srcMap[mapLen - 2]; + const mapEndDst = srcMap[mapLen - 1]; + const endDiff = srcTxt.length - mapEndDst; + const head = !srcMap[0] && !srcMap[1] ? [] : [0, 0]; + const tail = [mapEndSrc + endDiff, mapEndDst + endDiff]; + const sMap = head.concat(srcMap).concat(tail); + let idx2 = 0; + for (; idx2 < sMap.length && a >= sMap[idx2]; idx2 += 2) { + } + const aIdx = idx2; + idx2 -= 2; + const a0 = a - sMap[idx2]; + const a1 = a0 + sMap[idx2 + 1]; + for (; idx2 < sMap.length && b > sMap[idx2]; idx2 += 2) { + } + const bIdx = idx2; + const b0 = b - sMap[idx2]; + const b1 = b0 + sMap[idx2 + 1]; + const text = srcTxt.slice(a1, b1); + if (bIdx === aIdx) { + return { text, range }; + } + const ab = [a0, a1]; + const map3 = sMap.slice(aIdx, bIdx + 2).map((v, i) => v - ab[i & 1]); + return { text, range, map: map3 }; +} + +// node_modules/cspell-lib/dist/esm/textValidation/parsedText.mjs +function mapRangeBackToOriginalPos(offRange, map3) { + if (!map3 || !map3.length) + return offRange; + const [start, end] = offRange; + let i = 0, j = 0, p = 1; + while (p < map3.length && map3[p] < start) { + i = map3[p - 1]; + j = map3[p]; + p += 2; + } + const iA = start - j + i; + while (p < map3.length && map3[p] < end) { + i = map3[p - 1]; + j = map3[p]; + p += 2; + } + const iB = end - j + i; + return [iA, iB]; +} +function createMappedTextSegmenter(includeRanges) { + let rangePos = 0; + function* segmenter(pText) { + if (!includeRanges.length) { + return; + } + const range = pText.range; + const textEndPos = range[1]; + let textStartPos = range[0]; + while (rangePos && (rangePos >= includeRanges.length || includeRanges[rangePos].startPos > textStartPos)) { + rangePos -= 1; + } + const cur = includeRanges[rangePos]; + if (textEndPos <= cur.endPos && textStartPos >= cur.startPos) { + yield pText; + return; + } + while (textStartPos < textEndPos) { + while (includeRanges[rangePos] && includeRanges[rangePos].endPos <= textStartPos) { + rangePos += 1; + } + if (!includeRanges[rangePos]) { + break; + } + const { startPos, endPos } = includeRanges[rangePos]; + if (textEndPos < startPos) { break; } + const a = Math.max(textStartPos, startPos); + const b = Math.min(textEndPos, endPos); + if (a !== b) { + yield extractTextMapRangeOrigin(pText, [a, b]); + } + textStartPos = b; } } - return fn; + return segmenter; } -function opFirst(fn) { - const asyncFn = opFirstAsync(fn); - const syncFn = opFirstSync(fn); - function _(i) { - return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + +// node_modules/cspell-lib/dist/esm/textValidation/lineValidatorFactory.mjs +function lineValidatorFactory(sDict, options) { + const { minWordLength = defaultMinWordLength, flagWords = [], allowCompoundWords = false, ignoreCase: ignoreCase2 = true } = options; + const hasWordOptions = { + ignoreCase: ignoreCase2, + useCompounds: allowCompoundWords || void 0 + // let the dictionaries decide on useCompounds if allow is false + }; + const dictCol = createCachingDictionary(sDict, hasWordOptions); + const setOfFlagWords = new Set(flagWords); + const setOfKnownSuccessfulWords = /* @__PURE__ */ new Set(); + const rememberFilter = (fn2) => (v) => { + const keep = fn2(v); + if (!keep) { + setOfKnownSuccessfulWords.add(v.text); + } + return keep; + }; + const filterAlreadyChecked = (wo) => { + return !setOfKnownSuccessfulWords.has(wo.text); + }; + function testForFlaggedWord(wo) { + const text = wo.text; + return setOfFlagWords.has(text) || setOfFlagWords.has(text.toLowerCase()) || dictCol.isForbidden(text); + } + function isWordIgnored(word) { + return dictCol.isNoSuggestWord(word); + } + function getSuggestions(word) { + return dictCol.getPreferredSuggestions(word); + } + function isWordFlagged(word) { + const isIgnored = isWordIgnored(word.text); + const isFlagged = !isIgnored && testForFlaggedWord(word); + return isFlagged; + } + function annotateIsFlagged(word) { + word.isFlagged = isWordFlagged(word); + return word; + } + function annotateIssue(issue) { + const sugs = getSuggestions(issue.text); + if (sugs && sugs.length) { + issue.suggestionsEx = sugs; + } + return issue; + } + function checkWord(word) { + const isIgnored = isWordIgnored(word.text); + const { isFlagged = !isIgnored && testForFlaggedWord(word) } = word; + const isFound = isFlagged ? void 0 : isIgnored || isWordValidWithEscapeRetry(dictCol, word, word.line); + return clean({ ...word, isFlagged, isFound }); + } + const fn = (lineSegment) => { + function splitterIsValid(word) { + return setOfKnownSuccessfulWords.has(word.text) || !testForFlaggedWord(word) && isWordValidWithEscapeRetry(dictCol, word, lineSegment.line); + } + function checkFullWord(vr) { + if (vr.isFlagged) { + return [vr]; + } + const codeWordResults = toArraySync(pipeSync( + extractWordsFromCodeTextOffset(vr), + opFilterSync(filterAlreadyChecked), + opMapSync((t) => ({ ...t, line: vr.line })), + opMapSync(annotateIsFlagged), + opFilterSync(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged)), + opMapSync((wo) => wo.isFlagged ? wo : checkWord(wo)), + opFilterSync(rememberFilter((wo) => wo.isFlagged || !wo.isFound)), + opFilterSync(rememberFilter((wo) => !regExRepeatedChar.test(wo.text))), + // get back the original text. + opMapSync((wo) => ({ + ...wo, + text: extractText(lineSegment.segment, wo.offset, wo.offset + wo.text.length) + })) + )); + if (!codeWordResults.length || isWordIgnored(vr.text) || checkWord(vr).isFound) { + rememberFilter((_) => false)(vr); + return []; + } + return codeWordResults; + } + function checkPossibleWords(possibleWord) { + if (isWordFlagged(possibleWord)) { + const vr = { + ...possibleWord, + line: lineSegment.line, + isFlagged: true + }; + return [vr]; + } + const mismatches = toArraySync(pipeSync(extractWordsFromTextOffset(possibleWord), opFilterSync(filterAlreadyChecked), opMapSync((wo) => ({ ...wo, line: lineSegment.line })), opMapSync(annotateIsFlagged), opFilterSync(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged)), opConcatMapSync(checkFullWord))); + if (mismatches.length) { + const splitResult = split(lineSegment.segment, possibleWord.offset, splitterIsValid); + const nonMatching = splitResult.words.filter((w) => !w.isFound); + if (nonMatching.length < mismatches.length) { + return nonMatching.map((w) => ({ ...w, line: lineSegment.line })).map(annotateIsFlagged); + } + } + return mismatches; + } + const checkedPossibleWords = pipeSync(extractPossibleWordsFromTextOffset(lineSegment.segment), opFilterSync(filterAlreadyChecked), opConcatMapSync(checkPossibleWords), opMapSync(annotateIssue)); + return checkedPossibleWords; + }; + return { fn, dict: dictCol }; +} +function textValidatorFactory(dict, options) { + const lineValidator = lineValidatorFactory(dict, options); + const lineValidatorFn = lineValidator.fn; + function validate2(pText) { + const { text, range: srcRange, map: map3 } = pText; + const srcOffset = srcRange[0]; + const segment = { text, offset: 0 }; + const lineSegment = { line: segment, segment }; + function mapBackToOriginSimple(vr) { + const { text: text2, offset, isFlagged, isFound, suggestionsEx } = vr; + const r = mapRangeBackToOriginalPos([offset, offset + text2.length], map3); + const range = [r[0] + srcOffset, r[1] + srcOffset]; + return { text: text2, range, isFlagged, isFound, suggestionsEx }; + } + return [...lineValidatorFn(lineSegment)].map(mapBackToOriginSimple); } - return _; + return { + validate: validate2, + lineValidator + }; } -// node_modules/@cspell/cspell-pipe/dist/esm/operators/flatten.mjs -function opFlattenAsync() { - async function* fn(iter) { - for await (const v of iter) { - yield* v; +// node_modules/cspell-lib/dist/esm/textValidation/settingsToValidateOptions.mjs +function settingsToValidateOptions(settings) { + const opt = { + ...settings, + ignoreCase: !(settings.caseSensitive ?? false) + }; + return opt; +} + +// node_modules/cspell-lib/dist/esm/util/TextRange.mjs +function toMatchRangeWithText(m) { + const index = m.index || 0; + const _text = m[0]; + return { + startPos: index, + endPos: index + _text.length, + text: _text + }; +} +function findMatchingRanges(pattern, text) { + if (pattern.source === ".*") { + return [{ startPos: 0, endPos: text.length }]; + } + const regex = new RegExp(pattern); + if (!regex.global) { + const m = text.match(regex); + if (!m) + return []; + return [toMatchRangeWithText(m)]; + } + return [...text.matchAll(regex)].map(toMatchRangeWithText); +} +function compareRanges(a, b) { + return a.startPos - b.startPos || a.endPos - b.endPos; +} +function unionRanges(ranges) { + return makeSortedMatchRangeArray([..._unionRanges(ranges)]); +} +function* _unionRanges(ranges) { + const sortedRanges = sortMatchRangeArray(ranges); + if (!sortedRanges.length) + return; + let { startPos, endPos } = sortedRanges[0]; + for (const r of ranges) { + if (r.startPos > endPos) { + yield { startPos, endPos }; + startPos = r.startPos; + endPos = r.endPos; + continue; } + endPos = Math.max(endPos, r.endPos); + } + if (startPos < endPos) { + yield { startPos, endPos }; } - return fn; } -function opFlattenSync() { - function* fn(iter) { - for (const v of iter) { - yield* v; +function findMatchingRangesForPatterns(patterns, text) { + const matchedPatterns = genSequence(patterns).concatMap((pattern) => findMatchingRanges(pattern, text)); + return unionRanges(matchedPatterns.toArray()); +} +function excludeRanges(includeRanges, excludeRanges2) { + return [..._excludeRanges(sortMatchRangeArray(includeRanges), sortMatchRangeArray(excludeRanges2))]; +} +function* _excludeRanges(includeRanges, excludeRanges2) { + if (!includeRanges.length) + return; + if (!excludeRanges2.length) { + yield* includeRanges; + return; + } + let exIndex = 0; + const limit = excludeRanges2.length; + for (const incRange of includeRanges) { + const endPos = incRange.endPos; + let startPos = incRange.startPos; + for (; exIndex < limit; ++exIndex) { + const ex = excludeRanges2[exIndex]; + if (ex.startPos >= endPos) + break; + if (ex.endPos <= startPos) + continue; + if (ex.startPos > startPos) { + yield { startPos, endPos: ex.startPos }; + } + startPos = ex.endPos; + if (startPos >= endPos) + break; + } + if (startPos < endPos) { + yield { startPos, endPos }; } } - return fn; } -var opFlatten = () => toPipeFn(opFlattenSync(), opFlattenAsync()); +var SymSortedMatchRangeArray = Symbol("SortedMatchRangeArray"); +function sortMatchRangeArray(values) { + if (isSortedMatchRangeArray(values)) + return values; + return makeSortedMatchRangeArray(values.sort(compareRanges)); +} +function isSortedMatchRangeArray(a) { + return a[SymSortedMatchRangeArray] === true; +} +function makeSortedMatchRangeArray(sortedValues) { + const sorted = sortedValues; + sorted[SymSortedMatchRangeArray] = true; + Object.freeze(sorted); + return sorted; +} -// node_modules/@cspell/cspell-pipe/dist/esm/operators/joinStrings.mjs -function opJoinStringsAsync(joinCharacter = ",") { - async function* fn(iter) { - for await (const v of iter) { - const a = await toArray(v); - yield a.join(joinCharacter); +// node_modules/cspell-lib/dist/esm/textValidation/textValidator.mjs +function calcTextInclusionRanges(text, options) { + const { ignoreRegExpList = [], includeRegExpList = [] } = options; + const filteredIncludeList = includeRegExpList.filter((a) => !!a); + const finalIncludeList = filteredIncludeList.length ? filteredIncludeList : [/.*/gim]; + const includeRanges = excludeRanges(findMatchingRangesForPatterns(finalIncludeList, text), findMatchingRangesForPatterns(ignoreRegExpList, text)); + return includeRanges; +} + +// node_modules/cspell-lib/dist/esm/textValidation/docValidator.mjs +var ERROR_NOT_PREPARED = "Validator Must be prepared before calling this function."; +var skipValidation = false; +var DocumentValidator = class { + /** + * @param doc - Document to validate + * @param config - configuration to use (not finalized). + */ + constructor(doc, options, settings) { + this.settings = settings; + this._ready = false; + this.errors = []; + this._preparationTime = -1; + this._suggestions = new AutoCache((text) => this.genSuggestions(text), 1e3); + this._document = doc; + this.options = { ...options }; + const numSuggestions = this.options.numSuggestions ?? settings.numSuggestions; + if (numSuggestions !== void 0) { + this.options.numSuggestions = numSuggestions; + } + } + get ready() { + return this._ready; + } + /** + * Prepare to validate a document. + * This will load all the necessary configuration and dictionaries. + * + * @deprecated + * @deprecationMessage Use the async `prepare` method. + */ + prepareSync() { + if (this._ready) + return; + const timer = createTimer(); + const { options, settings } = this; + const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; + const optionsConfigFile = options.configFile; + const localConfigFn = optionsConfigFile ? () => loadConfigSync(optionsConfigFile, settings) : useSearchForConfig ? () => searchForDocumentConfigSync(this._document, settings, settings) : void 0; + const localConfig = localConfigFn && wrapCall(localConfigFn, (e) => this.addPossibleError(e))(); + this.addPossibleError(localConfig?.__importRef?.error); + const config = mergeSettings(settings, localConfig); + const docSettings = determineTextDocumentSettings(this._document, config); + const dict = getDictionaryInternalSync(docSettings); + const matcher = new GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); + const uri = this._document.uri; + const shouldCheck = !matcher.match(uriToFilePath(uri)) && (docSettings.enabled ?? true); + const finalSettings = finalizeSettings(docSettings); + const validateOptions = settingsToValidateOptions(finalSettings); + const includeRanges = calcTextInclusionRanges(this._document.text, validateOptions); + const segmenter = createMappedTextSegmenter(includeRanges); + const textValidator = textValidatorFactory(dict, validateOptions); + this._preparations = { + config, + dictionary: dict, + docSettings, + finalSettings, + shouldCheck, + validateOptions, + includeRanges, + segmenter, + textValidator, + localConfig, + localConfigFilepath: localConfig?.__importRef?.filename + }; + this._ready = true; + this._preparationTime = timer.elapsed(); + } + async prepare() { + if (this._ready) + return; + if (this._prepared) + return this._prepared; + this._prepared = this._prepareAsync(); + return this._prepared; + } + async _prepareAsync() { + (0, import_assert15.default)(!this._ready); + const timer = createTimer(); + const { options, settings } = this; + const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; + const pLocalConfig = options.configFile ? loadConfig(options.configFile, settings) : useSearchForConfig ? searchForDocumentConfig(this._document, settings, settings) : void 0; + const localConfig = await catchPromiseError(pLocalConfig, (e) => this.addPossibleError(e)) || {}; + this.addPossibleError(localConfig?.__importRef?.error); + const config = mergeSettings(settings, localConfig); + const docSettings = determineTextDocumentSettings(this._document, config); + const dict = await getDictionaryInternal(docSettings); + const matcher = new GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); + const uri = this._document.uri; + const shouldCheck = !matcher.match(uriToFilePath(uri)) && (docSettings.enabled ?? true); + const finalSettings = finalizeSettings(docSettings); + const validateOptions = settingsToValidateOptions(finalSettings); + const includeRanges = calcTextInclusionRanges(this._document.text, validateOptions); + const segmenter = createMappedTextSegmenter(includeRanges); + const textValidator = textValidatorFactory(dict, validateOptions); + this._preparations = { + config, + dictionary: dict, + docSettings, + finalSettings, + shouldCheck, + validateOptions, + includeRanges, + segmenter, + textValidator, + localConfig, + localConfigFilepath: localConfig?.__importRef?.filename + }; + this._ready = true; + this._preparationTime = timer.elapsed(); + } + _updatePrep() { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const timer = createTimer(); + const prep = this._preparations; + const docSettings = determineTextDocumentSettings(this._document, prep.config); + const dict = getDictionaryInternalSync(docSettings); + const shouldCheck = docSettings.enabled ?? true; + const finalSettings = finalizeSettings(docSettings); + const validateOptions = settingsToValidateOptions(finalSettings); + const includeRanges = calcTextInclusionRanges(this._document.text, validateOptions); + const segmenter = createMappedTextSegmenter(includeRanges); + const textValidator = textValidatorFactory(dict, validateOptions); + this._preparations = { + ...prep, + dictionary: dict, + docSettings, + shouldCheck, + validateOptions, + includeRanges, + segmenter, + textValidator + }; + this._preparationTime = timer.elapsed(); + } + /** + * The amount of time in ms to prepare for validation. + */ + get prepTime() { + return this._preparationTime; + } + get validateDirectives() { + return this.options.validateDirectives ?? this._preparations?.config.validateDirectives ?? false; + } + checkText(range, _text, scope) { + const text = this._document.text.slice(range[0], range[1]); + return this.check({ text, range, scope: scope.join(" ") }); + } + check(parsedText) { + (0, import_assert15.default)(this._ready); + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const { segmenter, textValidator } = this._preparations; + const document = this._document; + let line = void 0; + function mapToIssue(issue) { + const { range, text, isFlagged, isFound, suggestionsEx } = issue; + const offset = range[0]; + const length = range[1] - range[0]; + (0, import_assert15.default)(!line || line.offset <= offset); + if (!line || line.offset + line.text.length <= offset) { + line = document.lineAt(offset); + } + return { text, offset, line, length, isFlagged, isFound, suggestionsEx }; + } + const issues = [...pipeSync(segmenter(parsedText), opConcatMapSync(textValidator.validate), opMapSync(mapToIssue))]; + if (!this.options.generateSuggestions) { + return issues.map((issue) => { + if (!issue.suggestionsEx) + return issue; + const suggestionsEx = this.adjustSuggestions(issue.text, issue.suggestionsEx); + const suggestions = suggestionsEx.map((s) => s.word); + return { ...issue, suggestionsEx, suggestions }; + }); } + const withSugs = issues.map((t) => { + const text = t.text; + const suggestionsEx = this.getSuggestions(text); + t.suggestionsEx = suggestionsEx; + t.suggestions = suggestionsEx.map((s) => s.word); + return t; + }); + return withSugs; } - return fn; -} -function opJoinStringsSync(joinCharacter = ",") { - function* fn(iter) { - for (const v of iter) { - const a = toArray(v); - yield a.join(joinCharacter); + /** + * Check a Document for Validation Issues. + * @param forceCheck - force a check even if the document would normally be excluded. + * @returns the validation issues. + */ + async checkDocumentAsync(forceCheck) { + await this.prepare(); + return this.checkDocument(forceCheck); + } + /** + * Check a Document for Validation Issues. + * + * Note: The validator must be prepared before calling this method. + * @param forceCheck - force a check even if the document would normally be excluded. + * @returns the validation issues. + */ + checkDocument(forceCheck = false) { + if (skipValidation) + return []; + (0, import_assert15.default)(this._ready); + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const spellingIssues = forceCheck || this.shouldCheckDocument() ? [...this._checkParsedText(this._parse())] : []; + const directiveIssues = this.checkDocumentDirectives(); + const allIssues = spellingIssues.concat(directiveIssues).sort((a, b) => a.offset - b.offset); + return allIssues; + } + checkDocumentDirectives(forceCheck = false) { + (0, import_assert15.default)(this._ready); + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const validateDirectives = forceCheck || this.validateDirectives; + if (!validateDirectives) + return []; + const document = this.document; + const issueType = IssueType.directive; + function toValidationIssue(dirIssue) { + const { text, range, suggestions, suggestionsEx, message } = dirIssue; + const offset = range[0]; + const pos = document.positionAt(offset); + const line = document.getLine(pos.line); + const issue = { text, offset, line, suggestions, suggestionsEx, message, issueType }; + return issue; } + return [...validateInDocumentSettings(this.document.text, this._preparations.config)].map(toValidationIssue); } - return fn; -} -var opJoinStrings = (joinCharacter) => toPipeFn(opJoinStringsSync(joinCharacter), opJoinStringsAsync(joinCharacter)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/last.mjs -var symNotFound = Symbol("LastNotFound"); -function opLastAsync(lastFn) { - async function* fn(iter) { - let last = symNotFound; - for await (const v of iter) { - const pass = await lastFn(v); - if (pass) { - last = v; + get document() { + return this._document; + } + updateDocumentText(text) { + updateTextDocument(this._document, [{ text }]); + this._updatePrep(); + } + defaultParser() { + return pipeSync(this.document.getLines(), opMapSync((line) => { + const { text, offset } = line; + const range = [offset, offset + text.length]; + return { text, range }; + })); + } + *_checkParsedText(parsedTexts) { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const { maxNumberOfProblems = defaultMaxNumberOfProblems, maxDuplicateProblems = defaultMaxDuplicateProblems } = this._preparations.validateOptions; + let numProblems = 0; + const mapOfProblems = /* @__PURE__ */ new Map(); + for (const pText of parsedTexts) { + for (const issue of this.check(pText)) { + const { text } = issue; + const n = (mapOfProblems.get(text) || 0) + 1; + mapOfProblems.set(text, n); + if (n > maxDuplicateProblems) + continue; + yield issue; + if (++numProblems >= maxNumberOfProblems) + return; } } - if (last !== symNotFound) - yield last; } - return fn; + addPossibleError(error2) { + if (!error2) + return; + error2 = this.errors.push(toError2(error2)); + } + _parse() { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const parser2 = this._preparations.finalSettings.parserFn; + if (typeof parser2 !== "object") + return this.defaultParser(); + return parser2.parse(this.document.text, this.document.uri.path).parsedTexts; + } + getSuggestions(text) { + return this._suggestions.get(text); + } + genSuggestions(text) { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const settings = this._preparations.docSettings; + const dict = this._preparations.dictionary; + const sugOptions = { + compoundMethod: 0, + numSuggestions: this.options.numSuggestions, + includeTies: false, + ignoreCase: !(settings.caseSensitive ?? false), + timeout: settings.suggestionsTimeout, + numChanges: settings.suggestionNumChanges + }; + const rawSuggestions = dict.suggest(text, sugOptions); + return this.adjustSuggestions(text, rawSuggestions); + } + adjustSuggestions(text, rawSuggestions) { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const settings = this._preparations.docSettings; + const ignoreCase2 = !(settings.caseSensitive ?? false); + const locale = this._preparations.config.language; + const dict = this._preparations.dictionary; + const sugsWithAlt = calcSuggestionAdjustedToToMatchCase(text, rawSuggestions.map(mapSug), locale, ignoreCase2, dict); + return sugsWithAlt.map(sanitizeSuggestion); + } + getFinalizedDocSettings() { + (0, import_assert15.default)(this._ready); + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + return this._preparations.docSettings; + } + /** + * Returns true if the final result of the configuration calculation results + * in the document being enabled. Note: in some cases, checking the document + * might still make sense, for example, the `@cspell/eslint-plugin` relies on + * `eslint` configuration to make that determination. + * @returns true if the document settings have resolved to be `enabled` + */ + shouldCheckDocument() { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + return this._preparations.shouldCheck; + } + /** + * Internal `cspell-lib` use. + */ + _getPreparations() { + return this._preparations; + } +}; +function sanitizeSuggestion(sug) { + const { word, isPreferred, wordAdjustedToMatchCase } = sug; + if (isPreferred && wordAdjustedToMatchCase) + return { word, wordAdjustedToMatchCase, isPreferred }; + if (isPreferred) + return { word, isPreferred }; + if (wordAdjustedToMatchCase) + return { word, wordAdjustedToMatchCase }; + return { word }; +} +async function searchForDocumentConfig(document, defaultConfig, pnpSettings) { + const { uri } = document; + if (uri.scheme !== "file") + return Promise.resolve(defaultConfig); + return searchForConfig(import_path3.default.dirname(uriToFilePath(uri)), pnpSettings).then((s) => s || defaultConfig); +} +function mapSug(sug) { + return { cost: 999, ...sug }; +} +function searchForDocumentConfigSync(document, defaultConfig, pnpSettings) { + const { uri } = document; + if (uri.scheme !== "file") + defaultConfig; + return searchForConfigSync(uriToFilePath(uri), pnpSettings) || defaultConfig; +} +async function shouldCheckDocument(doc, options, settings) { + const errors = []; + function addPossibleError(error2) { + if (!error2) + return void 0; + error2 = errors.push(toError2(error2)); + return void 0; + } + async function shouldCheck() { + const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; + const pLocalConfig = options.configFile ? loadConfig(options.configFile, settings) : useSearchForConfig ? searchForDocumentConfig(doc, settings, settings) : void 0; + const localConfig = await catchPromiseError(pLocalConfig, addPossibleError) || {}; + addPossibleError(localConfig?.__importRef?.error); + const config = mergeSettings(settings, localConfig); + const matcher = new GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); + const docSettings = determineTextDocumentSettings(doc, config); + const uri = doc.uri; + return !matcher.match(uriToFilePath(uri)) && (docSettings.enabled ?? true); + } + return { errors, shouldCheck: await shouldCheck() }; +} + +// node_modules/cspell-lib/dist/esm/textValidation/checkText.mjs +var IncludeExcludeFlag; +(function(IncludeExcludeFlag2) { + IncludeExcludeFlag2["INCLUDE"] = "I"; + IncludeExcludeFlag2["EXCLUDE"] = "E"; +})(IncludeExcludeFlag || (IncludeExcludeFlag = {})); + +// node_modules/cspell-lib/dist/esm/spellCheckFile.mjs +async function spellCheckDocument(document, options, settings) { + if (isBinaryDoc(document)) { + return { + document, + options, + settingsUsed: settings, + localConfigFilepath: void 0, + issues: [], + checked: false, + errors: void 0 + }; + } + try { + return spellCheckFullDocument(await resolveDocument(document), options, settings); + } catch (e) { + const errors = isError2(e) ? [e] : []; + return { + document, + options, + settingsUsed: settings, + localConfigFilepath: void 0, + issues: [], + checked: false, + errors + }; + } } -function opLastSync(lastFn) { - function* fn(iter) { - let last = symNotFound; - for (const v of iter) { - if (lastFn(v)) { - last = v; - } +async function spellCheckFullDocument(document, options, settings) { + const doc = documentToTextDocument(document); + const docValOptions = options; + const docValidator = new DocumentValidator(doc, docValOptions, settings); + await docValidator.prepare(); + const prep = docValidator._getPreparations(); + if (docValidator.errors.length) { + return { + document, + options, + settingsUsed: prep?.localConfig || settings, + localConfigFilepath: prep?.localConfigFilepath, + issues: [], + checked: false, + errors: docValidator.errors + }; + } + const issues = docValidator.checkDocument(); + const result = { + document, + options, + settingsUsed: docValidator.getFinalizedDocSettings(), + localConfigFilepath: prep?.localConfigFilepath, + issues, + checked: docValidator.shouldCheckDocument(), + errors: void 0 + }; + return result; +} + +// node_modules/cspell-lib/dist/esm/getDictionary.mjs +function getDictionary(settings) { + return getDictionaryInternal(toInternalSettings(settings)); +} + +// node_modules/chalk/source/vendor/ansi-styles/index.js +var ANSI_BACKGROUND_OFFSET = 10; +var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; +var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; +var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; +var 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] + } +}; +var modifierNames = Object.keys(styles.modifier); +var foregroundColorNames = Object.keys(styles.color); +var backgroundColorNames = Object.keys(styles.bgColor); +var colorNames = [...foregroundColorNames, ...backgroundColorNames]; +function assembleStyles() { + const codes3 = /* @__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]; + codes3.set(style[0], style[1]); } - if (last !== symNotFound) - yield last; + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + Object.defineProperty(styles, "codes", { + value: codes3, + 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 ansiStyles = assembleStyles(); +var ansi_styles_default = ansiStyles; + +// node_modules/chalk/source/vendor/supports-color/index.js +var import_node_process2 = __toESM(require("node:process"), 1); +var import_node_os = __toESM(require("node:os"), 1); +var import_node_tty = __toESM(require("node:tty"), 1); +function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process2.default.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); +} +var { env: env2 } = import_node_process2.default; +var flagForceColor; +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; +} +function envForceColor() { + 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); } - return fn; } -function opLast(fn) { - const asyncFn = opLastAsync(fn); - const syncFn = opLastSync(fn); - function _(i) { - return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); +function translateLevel(level) { + if (level === 0) { + return false; } - return _; + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; } - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/map.mjs -function opMapAsync(mapFn) { - async function* fn(iter) { - for await (const v of iter) { - yield mapFn(v); +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; } } - return fn; -} -function opMapSync(mapFn) { - function* fn(iter) { - for (const v of iter) { - yield mapFn(v); + if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) { + return 1; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min3 = forceColor || 0; + if (env2.TERM === "dumb") { + return min3; + } + if (import_node_process2.default.platform === "win32") { + const osRelease = import_node_os.default.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } + return 1; } - return fn; -} -var opMap = (fn) => toPipeFn(opMapSync(fn), opMapAsync(fn)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/reduce.mjs -function opReduceAsync(reduceFn, initialValue) { - async function* reduce2(head, tail) { - for await (const v of tail) { - head = reduceFn(head, v); + if ("CI" in env2) { + if ("GITHUB_ACTIONS" in env2 || "GITEA_ACTIONS" in env2) { + return 3; } - yield head; + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") { + return 1; + } + return min3; } - async function* fn(iter) { - const ht = initialValue === void 0 ? await headTailAsync(iter) : { head: await initialValue, tail: iter }; - if (!ht) - return; - yield* reduce2(ht.head, ht.tail); + if ("TEAMCITY_VERSION" in env2) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0; } - return fn; -} -function opReduceSync(reduceFn, initialValue) { - function* reduce2(head, tail) { - for (const v of tail) { - head = reduceFn(head, v); + if (env2.COLORTERM === "truecolor") { + return 3; + } + if (env2.TERM === "xterm-kitty") { + return 3; + } + if ("TERM_PROGRAM" in env2) { + const version4 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env2.TERM_PROGRAM) { + case "iTerm.app": { + return version4 >= 3 ? 3 : 2; + } + case "Apple_Terminal": { + return 2; + } } - yield head; } - function* fn(iter) { - const ht = initialValue === void 0 ? headTail(iter) : { head: initialValue, tail: iter }; - if (!ht) - return; - yield* reduce2(ht.head, ht.tail); + if (/-256(color)?$/i.test(env2.TERM)) { + return 2; } - return fn; -} -function headTail(iter) { - const iterator = iter[Symbol.iterator](); - const first = iterator.next(); - if (first.done) - return void 0; - return { head: first.value, tail: iteratorToIterable(iterator) }; + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) { + return 1; + } + if ("COLORTERM" in env2) { + return 1; + } + return min3; } -async function headTailAsync(iter) { - const iterator = isIterable(iter) ? iter[Symbol.iterator]() : iter[Symbol.asyncIterator](); - const first = await iterator.next(); - if (first.done) - return void 0; - return { head: first.value, tail: asyncIteratorToAsyncIterable(iterator) }; +function createSupportsColor(stream, options = {}) { + const level = _supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options + }); + return translateLevel(level); } -function isIterable(i) { - return typeof i[Symbol.iterator] === "function"; +var supportsColor = { + stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }), + stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) }) +}; +var 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; } -// node_modules/@cspell/cspell-pipe/dist/esm/operators/skip.mjs -function opSkipAsync(count) { - async function* fn(iter) { - for await (const v of iter) { - if (count > 0) { - --count; - continue; - } - yield v; +// node_modules/chalk/source/index.js +var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default; +var GENERATOR = Symbol("GENERATOR"); +var STYLER = Symbol("STYLER"); +var IS_EMPTY = Symbol("IS_EMPTY"); +var levelMapping = [ + "ansi", + "ansi", + "ansi256", + "ansi16m" +]; +var styles2 = /* @__PURE__ */ Object.create(null); +var 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; +}; +var chalkFactory = (options) => { + const chalk2 = (...strings) => strings.join(" "); + applyOptions(chalk2, options); + Object.setPrototypeOf(chalk2, createChalk.prototype); + return chalk2; +}; +function createChalk(options) { + return chalkFactory(options); +} +Object.setPrototypeOf(createChalk.prototype, Function.prototype); +for (const [styleName, style] of Object.entries(ansi_styles_default)) { + styles2[styleName] = { + get() { + const builder2 = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); + Object.defineProperty(this, styleName, { value: builder2 }); + return builder2; } - } - return fn; + }; } -function opSkipSync(count) { - function* fn(iter) { - for (const v of iter) { - if (count > 0) { - --count; - continue; - } - yield v; +styles2.visible = { + get() { + const builder2 = createBuilder(this, this[STYLER], true); + Object.defineProperty(this, "visible", { value: builder2 }); + return builder2; + } +}; +var 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_)); } - return fn; + if (model === "hex") { + return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_)); + } + return ansi_styles_default[type][model](...arguments_); +}; +var 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]); + }; + } + }; } -var opSkip = (count) => toPipeFn(opSkipSync(count), opSkipAsync(count)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/take.mjs -function opTakeAsync(count) { - async function* fn(iter) { - if (count <= 0) - return; - for await (const v of iter) { - yield v; - if (--count <= 0) - return; +var proto = Object.defineProperties(() => { +}, { + ...styles2, + level: { + enumerable: true, + get() { + return this[GENERATOR].level; + }, + set(level) { + this[GENERATOR].level = level; } } - return fn; -} -function opTakeSync(count) { - function* fn(iter) { - if (count <= 0) - return; - for (const v of iter) { - yield v; - if (--count <= 0) - return; +}); +var 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 + }; +}; +var createBuilder = (self, _styler, _isEmpty) => { + const builder2 = (...arguments_) => applyStyle(builder2, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); + Object.setPrototypeOf(builder2, proto); + builder2[GENERATOR] = self; + builder2[STYLER] = _styler; + builder2[IS_EMPTY] = _isEmpty; + return builder2; +}; +var 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; } } - return fn; -} -var opTake = (count) => toPipeFn(opTakeSync(count), opTakeAsync(count)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/tap.mjs -function opTapAsync(tapFn) { - async function* fn(iter) { - for await (const v of iter) { - tapFn(v); - yield v; + const lfIndex = string.indexOf("\n"); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } + return openAll + string + closeAll; +}; +Object.defineProperties(createChalk.prototype, styles2); +var chalk = createChalk(); +var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); +var source_default = chalk; + +// node_modules/chalk-template/index.js +var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.))|(?:{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(})|((?:.|[\r\n\f])+?)/gi; +var STYLE_REGEX = /(?:^|\.)(?:(?:(\w+)(?:\(([^)]*)\))?)|(?:#(?=[:a-fA-F\d]{2,})([a-fA-F\d]{6})?(?::([a-fA-F\d]{6}))?))/g; +var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; +var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; +var ESCAPES = /* @__PURE__ */ new Map([ + ["n", "\n"], + ["r", "\r"], + ["t", " "], + ["b", "\b"], + ["f", "\f"], + ["v", "\v"], + ["0", "\0"], + ["\\", "\\"], + ["e", "\x1B"], + ["a", "\x07"] +]); +function unescape2(c) { + const u = c[0] === "u"; + const bracket = c[1] === "{"; + if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) { + return String.fromCodePoint(Number.parseInt(c.slice(1), 16)); + } + if (u && bracket) { + return String.fromCodePoint(Number.parseInt(c.slice(2, -1), 16)); + } + return ESCAPES.get(c) || c; +} +function parseArguments(name, arguments_) { + const results = []; + const chunks = arguments_.trim().split(/\s*,\s*/g); + let matches; + for (const chunk of chunks) { + const number = Number(chunk); + if (!Number.isNaN(number)) { + results.push(number); + } else if (matches = chunk.match(STRING_REGEX)) { + results.push(matches[2].replace(ESCAPE_REGEX, (_, escape, character) => escape ? unescape2(escape) : character)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); } } - return fn; + return results; } -function opTapSync(tapFn) { - function* fn(iter) { - for (const v of iter) { - tapFn(v); - yield v; +function parseHex(hex) { + const n = Number.parseInt(hex, 16); + return [ + // eslint-disable-next-line no-bitwise + n >> 16 & 255, + // eslint-disable-next-line no-bitwise + n >> 8 & 255, + // eslint-disable-next-line no-bitwise + n & 255 + ]; +} +function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; + const results = []; + let matches; + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; + if (matches[2]) { + results.push([name, ...parseArguments(name, matches[2])]); + } else if (matches[3] || matches[4]) { + if (matches[3]) { + results.push(["rgb", ...parseHex(matches[3])]); + } + if (matches[4]) { + results.push(["bgRgb", ...parseHex(matches[4])]); + } + } else { + results.push([name]); } } - return fn; + return results; } -var opTap = (fn) => toPipeFn(opTapSync(fn), opTapAsync(fn)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/unique.mjs -function opUniqueAsync(k) { - function fnK(k2) { - async function* fn2(iter) { - const s = /* @__PURE__ */ new Set(); - for await (const v of iter) { - const kk = k2(v); - if (s.has(kk)) - continue; - s.add(kk); - yield v; +function makeTemplate(chalk2) { + function buildStyle(styles3) { + const enabled = {}; + for (const layer of styles3) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); } } - return fn2; - } - async function* fn(iter) { - const s = /* @__PURE__ */ new Set(); - for await (const v of iter) { - if (s.has(v)) + let current = chalk2; + for (const [styleName, styles4] of Object.entries(enabled)) { + if (!Array.isArray(styles4)) { continue; - s.add(v); - yield v; + } + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } + current = styles4.length > 0 ? current[styleName](...styles4) : current[styleName]; + } + return current; + } + function template3(string) { + const styles3 = []; + const chunks = []; + let chunk = []; + string.replace(TEMPLATE_REGEX, (_, escapeCharacter, inverse, style, close, character) => { + if (escapeCharacter) { + chunk.push(unescape2(escapeCharacter)); + } else if (style) { + const string2 = chunk.join(""); + chunk = []; + chunks.push(styles3.length === 0 ? string2 : buildStyle(styles3)(string2)); + styles3.push({ inverse, styles: parseStyle(style) }); + } else if (close) { + if (styles3.length === 0) { + throw new Error("Found extraneous } in Chalk template literal"); + } + chunks.push(buildStyle(styles3)(chunk.join(""))); + chunk = []; + styles3.pop(); + } else { + chunk.push(character); + } + }); + chunks.push(chunk.join("")); + if (styles3.length > 0) { + throw new Error(`Chalk template literal is missing ${styles3.length} closing bracket${styles3.length === 1 ? "" : "s"} (\`}\`)`); } + return chunks.join(""); } - return k ? fnK(k) : fn; + return template3; } -function opUniqueSync(k) { - function fnK(key) { - function* fn2(iter) { - const s = /* @__PURE__ */ new Set(); - for (const v of iter) { - const kk = key(v); - if (s.has(kk)) - continue; - s.add(kk); - yield v; - } +function makeChalkTemplate(template3) { + function chalkTemplate(firstString, ...arguments_) { + if (!Array.isArray(firstString) || !Array.isArray(firstString.raw)) { + throw new TypeError("A tagged template literal must be provided"); } - return fn2; - } - function* fn(iter) { - const s = /* @__PURE__ */ new Set(); - for (const v of iter) { - if (s.has(v)) - continue; - s.add(v); - yield v; + const parts = [firstString.raw[0]]; + for (let index = 1; index < firstString.raw.length; index++) { + parts.push( + String(arguments_[index - 1]).replace(/[{}\\]/g, "\\$&"), + String(firstString.raw[index]) + ); } + return template3(parts.join("")); } - return k ? fnK(k) : fn; -} -var opUnique = (getKey) => toPipeFn(opUniqueSync(getKey), opUniqueAsync(getKey)); - -// node_modules/@cspell/cspell-pipe/dist/esm/pipe.mjs -function pipeAsync(i, ...fns) { - const iter = toAsyncIterable(i); - return opCombineAsync(...fns)(iter); -} -function pipeSync(i, ...fns) { - return opCombineSync(...fns)(i); + return chalkTemplate; } - -// node_modules/@cspell/cspell-pipe/dist/esm/index.mjs -var operators = operators_exports; - -// node_modules/cspell/dist/esm/application.mjs -var import_cspell_lib4 = __toESM(require_cjs10(), 1); +var template = makeTemplate(source_default); +var chalk_template_default = makeChalkTemplate(template); +var templateStderr = makeTemplate(chalkStderr); +var chalkTemplateStderr = makeChalkTemplate(templateStderr); // node_modules/cspell/dist/esm/cli-reporter.mjs -var import_chalk = __toESM(require_source(), 1); -var import_cspell_lib = __toESM(require_cjs10(), 1); -var path2 = __toESM(require("path"), 1); +var path13 = __toESM(require("path"), 1); var import_uri = __toESM(require_uri(), 1); var templateIssue = `{green $filename}:{yellow $row:$col} - $message ({red $text}) $quickFix`; var templateIssueNoFix = `{green $filename}:{yellow $row:$col} - $message ({red $text})`; @@ -61535,9 +52577,9 @@ var templateIssueWithSuggestions = `{green $filename}:{yellow $row:$col} - $mess var templateIssueWithContext = `{green $filename}:{yellow $row:$col} $padRowCol- $message ({red $text})$padContext -- {gray $contextLeft}{red {underline $text}}{gray $contextRight}`; var templateIssueWithContextWithSuggestions = `{green $filename}:{yellow $row:$col} $padRowCol- $message ({red $text})$padContext -- {gray $contextLeft}{red {underline $text}}{gray $contextRight} Suggestions: {yellow [$suggestions]}`; -var templateIssueLegacy = `${import_chalk.default.green("$filename")}[$row, $col]: $message: ${import_chalk.default.red("$text")}`; +var templateIssueLegacy = `${source_default.green("$filename")}[$row, $col]: $message: ${source_default.red("$text")}`; var templateIssueWordsOnly = "$text"; -function genIssueEmitter(template2) { +function genIssueEmitter(template3) { const defaultWidth = 10; let maxWidth = defaultWidth; let uri; @@ -61547,29 +52589,29 @@ function genIssueEmitter(template2) { uri = issue.uri; } maxWidth = Math.max(maxWidth * 0.999, issue.text.length, 10); - console.log(formatIssue(template2, issue, Math.ceil(maxWidth))); + console.log(formatIssue(template3, issue, Math.ceil(maxWidth))); }; } function errorEmitter(message, error2) { - if ((0, import_cspell_lib.isSpellingDictionaryLoadError)(error2)) { + if (isSpellingDictionaryLoadError(error2)) { error2 = error2.cause; } - console.error(import_chalk.default.red(message), error2.toString()); + console.error(source_default.red(message), error2.toString()); } function nullEmitter2() { } function relativeFilename(filename, cwd = process.cwd()) { - const rel = path2.relative(cwd, filename); + const rel = path13.relative(cwd, filename); if (rel.startsWith("..")) return filename; - return "." + path2.sep + rel; + return "." + path13.sep + rel; } function relativeUriFilename(uri, fsPathRoot) { const fsPath = import_uri.URI.parse(uri).fsPath; - const rel = path2.relative(fsPathRoot, fsPath); + const rel = path13.relative(fsPathRoot, fsPath); if (rel.startsWith("..")) return fsPath; - return "." + path2.sep + rel; + return "." + path13.sep + rel; } function reportProgress(p) { if (p.type === "ProgressFileComplete") { @@ -61582,31 +52624,31 @@ function reportProgress(p) { function reportProgressFileBegin(p) { const fc = "" + p.fileCount; const fn = (" ".repeat(fc.length) + p.fileNum).slice(-fc.length); - const idx = fn + "/" + fc; - const filename = import_chalk.default.gray(relativeFilename(p.filename)); - process.stderr.write(`\r${idx} ${filename}`); + const idx2 = fn + "/" + fc; + const filename = source_default.gray(relativeFilename(p.filename)); + process.stderr.write(`\r${idx2} ${filename}`); } function reportProgressFileComplete(p) { const time = reportTime(p.elapsedTimeMs, !!p.cached); const skipped = p.processed === false ? " skipped" : ""; - const hasErrors = p.numErrors ? import_chalk.default.red` X` : ""; + const hasErrors = p.numErrors ? source_default.red` X` : ""; console.error(` ${time}${skipped}${hasErrors}`); } function reportTime(elapsedTimeMs, cached) { if (cached) - return import_chalk.default.green("cached"); + return source_default.green("cached"); if (elapsedTimeMs === void 0) return "-"; - const color = elapsedTimeMs < 1e3 ? import_chalk.default.white : elapsedTimeMs < 2e3 ? import_chalk.default.yellow : import_chalk.default.redBright; + const color = elapsedTimeMs < 1e3 ? source_default.white : elapsedTimeMs < 2e3 ? source_default.yellow : source_default.redBright; return color(elapsedTimeMs.toFixed(2) + "ms"); } function getReporter(options) { const issueTemplate = options.wordsOnly ? templateIssueWordsOnly : options.legacy ? templateIssueLegacy : options.showContext ? options.showSuggestions ? templateIssueWithContextWithSuggestions : templateIssueWithContext : options.showSuggestions ? templateIssueWithSuggestions : options.showSuggestions === false ? templateIssueNoFix : templateIssue; const { fileGlobs, silent, summary, issues, progress, verbose, debug } = options; const emitters = { - Debug: !silent && debug ? (s) => console.info(import_chalk.default.cyan(s)) : nullEmitter2, - Info: !silent && verbose ? (s) => console.info(import_chalk.default.yellow(s)) : nullEmitter2, - Warning: (s) => console.info(import_chalk.default.yellow(s)) + Debug: !silent && debug ? (s) => console.info(source_default.cyan(s)) : nullEmitter2, + Info: !silent && verbose ? (s) => console.info(source_default.yellow(s)) : nullEmitter2, + Warning: (s) => console.info(source_default.yellow(s)) }; function infoEmitter(message, msgType) { emitters[msgType]?.(message); @@ -61641,13 +52683,13 @@ function getReporter(options) { }; } function formatIssue(templateStr, issue, maxIssueTextWidth) { - function clean2(t2) { + function clean6(t2) { return t2.replace(/\s+/, " "); } const { uri = "", filename, row, col, text, context, offset } = issue; - const contextLeft = clean2(context.text.slice(0, offset - context.offset)); - const contextRight = clean2(context.text.slice(offset + text.length - context.offset)); - const contextFull = clean2(context.text); + const contextLeft = clean6(context.text.slice(0, offset - context.offset)); + const contextRight = clean6(context.text.slice(offset + text.length - context.offset)); + const contextFull = clean6(context.text); const padContext = " ".repeat(Math.max(maxIssueTextWidth - text.length, 0)); const rowText = row.toString(); const colText = col.toString(); @@ -61669,12 +52711,12 @@ function formatIssue(templateStr, issue, maxIssueTextWidth) { $uri: uri, $quickFix: formatQuickFix(issue) }; - const t = template(templateStr.replace(/\$message/g, message)); - return substitute((0, import_chalk.default)(t), substitutions).trimEnd(); + const t = template2(templateStr.replace(/\$message/g, message)); + return substitute(chalk_template_default(t), substitutions).trimEnd(); } function formatSuggestions(issue) { if (issue.suggestionsEx) { - return issue.suggestionsEx.map((sug) => sug.isPreferred ? import_chalk.default.italic(import_chalk.default.bold(sug.wordAdjustedToMatchCase || sug.word)) + "*" : sug.wordAdjustedToMatchCase || sug.word).join(", "); + return issue.suggestionsEx.map((sug) => sug.isPreferred ? source_default.italic(source_default.bold(sug.wordAdjustedToMatchCase || sug.word)) + "*" : sug.wordAdjustedToMatchCase || sug.word).join(", "); } if (issue.suggestions) { return issue.suggestions.join(", "); @@ -61687,7 +52729,7 @@ function formatQuickFix(issue) { const preferred = issue.suggestionsEx.filter((sug) => sug.isPreferred).map((sug) => sug.wordAdjustedToMatchCase || sug.word); if (!preferred.length) return ""; - const fixes = preferred.map((w) => import_chalk.default.italic(import_chalk.default.yellow(w))); + const fixes = preferred.map((w) => source_default.italic(source_default.yellow(w))); return `fix: (${fixes.join(", ")})`; } var TS = class extends Array { @@ -61696,14 +52738,14 @@ var TS = class extends Array { this.raw = [s]; } }; -function template(s) { +function template2(s) { return new TS(s); } function substitute(text, substitutions) { const subs = []; - for (const [match, replaceWith] of Object.entries(substitutions)) { - const len = match.length; - for (let i2 = text.indexOf(match); i2 >= 0; i2 = text.indexOf(match, i2 + 1)) { + for (const [match2, replaceWith] of Object.entries(substitutions)) { + const len = match2.length; + for (let i2 = text.indexOf(match2); i2 >= 0; i2 = text.indexOf(match2, i2 + 1)) { subs.push([i2, i2 + len, replaceWith]); } } @@ -61720,63 +52762,47 @@ function substitute(text, substitutions) { } // node_modules/cspell/dist/esm/featureFlags/featureFlags.mjs -var import_cspell_lib2 = __toESM(require_cjs10(), 1); function getFeatureFlags() { - return (0, import_cspell_lib2.getSystemFeatureFlags)(); + return getSystemFeatureFlags(); } -// node_modules/@cspell/cspell-types/dist/esm/CSpellReporter.mjs -var IssueType; -(function(IssueType2) { - IssueType2[IssueType2["spelling"] = 0] = "spelling"; - IssueType2[IssueType2["directive"] = 1] = "directive"; -})(IssueType || (IssueType = {})); -var MessageTypes = { - Debug: "Debug", - Info: "Info", - Warning: "Warning" -}; - -// node_modules/cspell/dist/esm/lint/lint.mjs -var import_chalk2 = __toESM(require_source(), 1); - -// node_modules/cspell-gitignore/dist/esm/GitIgnore.mjs -var path5 = __toESM(require("path"), 1); +// node_modules/cspell-gitignore/dist/GitIgnore.js +var path16 = __toESM(require("path"), 1); -// node_modules/cspell-gitignore/dist/esm/GitIgnoreFile.mjs -var import_fs2 = require("fs"); -var path4 = __toESM(require("path"), 1); +// node_modules/cspell-gitignore/dist/GitIgnoreFile.js +var import_fs3 = require("fs"); +var path15 = __toESM(require("path"), 1); -// node_modules/cspell-gitignore/dist/esm/helpers.mjs -var import_find_up = __toESM(require_find_up(), 1); -var path3 = __toESM(require("path"), 1); -function factoryPathHelper(path16) { +// node_modules/cspell-gitignore/dist/helpers.js +var import_find_up2 = __toESM(require_find_up(), 1); +var path14 = __toESM(require("path"), 1); +function factoryPathHelper(path26) { function directoryRoot2(directory) { - const p = path16.parse(directory); + const p = path26.parse(directory); return p.root; } async function findRepoRoot2(directory) { - const found = await (0, import_find_up.default)(".git", { cwd: directory, type: "directory" }); + const found = await (0, import_find_up2.default)(".git", { cwd: directory, type: "directory" }); if (!found) return void 0; - return path16.dirname(found); + return path26.dirname(found); } function isParentOf2(parent, child) { - const rel = path16.relative(parent, child); - return !!rel && !path16.isAbsolute(rel) && rel[0] !== "."; + const rel = path26.relative(parent, child); + return !!rel && !path26.isAbsolute(rel) && rel[0] !== "."; } function contains2(parent, child) { - const rel = path16.relative(parent, child); - return !rel || !path16.isAbsolute(rel) && rel[0] !== "."; + const rel = path26.relative(parent, child); + return !rel || !path26.isAbsolute(rel) && rel[0] !== "."; } function makeRelativeTo2(child, parent) { - const rel = path16.relative(parent, child); - if (path16.isAbsolute(rel) || rel[0] === ".") + const rel = path26.relative(parent, child); + if (path26.isAbsolute(rel) || rel[0] === ".") return void 0; return normalizePath3(rel); } - function normalizePath3(path17) { - return path17.replace(/\\/g, "/"); + function normalizePath3(path27) { + return path27.replace(/\\/g, "/"); } return { directoryRoot: directoryRoot2, @@ -61787,18 +52813,18 @@ function factoryPathHelper(path16) { makeRelativeTo: makeRelativeTo2 }; } -var defaultHelper = factoryPathHelper(path3); +var defaultHelper = factoryPathHelper(path14); var directoryRoot = defaultHelper.directoryRoot; var findRepoRoot = defaultHelper.findRepoRoot; var isParentOf = defaultHelper.isParentOf; var contains = defaultHelper.contains; var makeRelativeTo = defaultHelper.makeRelativeTo; var normalizePath = defaultHelper.normalizePath; -function isDefined(v) { +function isDefined7(v) { return v !== void 0 && v !== null; } -// node_modules/cspell-gitignore/dist/esm/GitIgnoreFile.mjs +// node_modules/cspell-gitignore/dist/GitIgnoreFile.js var GitIgnoreFile = class _GitIgnoreFile { constructor(matcher, gitignore) { this.matcher = matcher; @@ -61824,10 +52850,10 @@ var GitIgnoreFile = class _GitIgnoreFile { return this.matcher.patterns; } getGlobs(relativeTo) { - return this.getGlobPatters().map((pat) => globToString(pat, relativeTo)).filter(isDefined); + return this.getGlobPatters().map((pat) => globToString(pat, relativeTo)).filter(isDefined7); } static parseGitignore(content, gitignoreFilename) { - const options = { root: path4.dirname(gitignoreFilename) }; + const options = { root: path15.dirname(gitignoreFilename) }; const globs = content.split(/\r?\n/g).map((glob2, index) => ({ glob: glob2.replace(/^#.*/, ""), source: gitignoreFilename, @@ -61837,8 +52863,8 @@ var GitIgnoreFile = class _GitIgnoreFile { return new _GitIgnoreFile(globMatcher, gitignoreFilename); } static async loadGitignore(gitignore) { - gitignore = path4.resolve(gitignore); - const content = await import_fs2.promises.readFile(gitignore, "utf8"); + gitignore = path15.resolve(gitignore); + const content = await import_fs3.promises.readFile(gitignore, "utf8"); return this.parseGitignore(content, gitignore); } }; @@ -61875,7 +52901,7 @@ var GitIgnoreHierarchy = class { } }; async function loadGitIgnore(dir) { - const file = path4.join(dir, ".gitignore"); + const file = path15.join(dir, ".gitignore"); try { return await GitIgnoreFile.loadGitignore(file); } catch (e) { @@ -61902,7 +52928,7 @@ function globToString(glob2, relativeTo) { return (base ? base + "/" : "") + glob2.glob; } -// node_modules/cspell-gitignore/dist/esm/GitIgnore.mjs +// node_modules/cspell-gitignore/dist/GitIgnore.js var GitIgnore = class { /** * @param roots - (search roots) an optional array of root paths to prevent searching for `.gitignore` files above the root. @@ -61919,15 +52945,15 @@ var GitIgnore = class { return this.resolvedGitIgnoreHierarchies.get(directory); } isIgnoredQuick(file) { - const gh = this.findResolvedGitIgnoreHierarchy(path5.dirname(file)); + const gh = this.findResolvedGitIgnoreHierarchy(path16.dirname(file)); return gh?.isIgnored(file); } async isIgnored(file) { - const gh = await this.findGitIgnoreHierarchy(path5.dirname(file)); + const gh = await this.findGitIgnoreHierarchy(path16.dirname(file)); return gh.isIgnored(file); } async isIgnoredEx(file) { - const gh = await this.findGitIgnoreHierarchy(path5.dirname(file)); + const gh = await this.findGitIgnoreHierarchy(path16.dirname(file)); return gh.isIgnoredEx(file); } async findGitIgnoreHierarchy(directory) { @@ -61943,7 +52969,7 @@ var GitIgnore = class { } filterOutIgnored(files) { const iter = this.filterOutIgnoredAsync(files); - return isAsyncIterable2(files) ? iter : asyncIterableToArray(iter); + return isAsyncIterable3(files) ? iter : asyncIterableToArray2(iter); } async *filterOutIgnoredAsync(files) { for await (const file of files) { @@ -61957,7 +52983,7 @@ var GitIgnore = class { return this._sortedRoots; } addRoots(roots) { - const rootsToAdd = roots.map((p) => path5.resolve(p)).filter((r) => !this._roots.has(r)); + const rootsToAdd = roots.map((p) => path16.resolve(p)).filter((r) => !this._roots.has(r)); if (!rootsToAdd.length) return; rootsToAdd.forEach((r) => this._roots.add(r)); @@ -61977,7 +53003,7 @@ var GitIgnore = class { } async _findGitIgnoreHierarchy(directory) { const root = this.determineRoot(directory); - const parent = path5.dirname(directory); + const parent = path16.dirname(directory); const parentHierarchy = parent !== directory && contains(root, parent) ? await this.findGitIgnoreHierarchy(parent) : void 0; const git = await loadGitIgnore(directory); if (!git) { @@ -61993,11 +53019,11 @@ var GitIgnore = class { if (contains(r, directory)) return r; } - return path5.parse(directory).root; + return path16.parse(directory).root; } }; function resolveAndSortRoots(roots) { - const sortedRoots = roots.map((a) => path5.resolve(a)); + const sortedRoots = roots.map((a) => path16.resolve(a)); sortRoots(sortedRoots); Object.freeze(sortedRoots); return sortedRoots; @@ -62006,11 +53032,11 @@ function sortRoots(roots) { roots.sort((a, b) => a.length - b.length); return roots; } -function isAsyncIterable2(i) { +function isAsyncIterable3(i) { const as = i; return typeof as[Symbol.asyncIterator] === "function"; } -async function asyncIterableToArray(iter) { +async function asyncIterableToArray2(iter) { const r = []; for await (const t of iter) { r.push(t); @@ -62019,19 +53045,18 @@ async function asyncIterableToArray(iter) { } // node_modules/cspell/dist/esm/lint/lint.mjs -var cspell2 = __toESM(require_cjs10(), 1); -var path13 = __toESM(require("path"), 1); -var import_util23 = require("util"); +var path23 = __toESM(require("path"), 1); +var import_util57 = require("util"); var import_pkgInfo2 = __toESM(require_pkgInfo(), 1); var import_uri3 = __toESM(require_uri(), 1); // node_modules/cspell/dist/esm/util/cache/createCache.mjs -var import_assert3 = __toESM(require("assert"), 1); -var import_promises = require("fs/promises"); -var import_path3 = __toESM(require("path"), 1); +var import_assert17 = __toESM(require("assert"), 1); +var import_promises2 = require("fs/promises"); +var import_path6 = __toESM(require("path"), 1); // node_modules/cspell/dist/esm/util/errors.mjs -var import_util14 = require("util"); +var import_util54 = require("util"); var CheckFailed = class extends Error { constructor(message, exitCode = 1) { super(message); @@ -62057,17 +53082,17 @@ var IOError = class extends ApplicationError { return this.cause.code === "ENOENT"; } }; -function toError(e) { - if (isError2(e)) +function toError3(e) { + if (isError4(e)) return e; - const message = (0, import_util14.format)(e); + const message = (0, import_util54.format)(e); return { name: "error", message, toString: () => message }; } -function isError2(e) { +function isError4(e) { if (e instanceof Error) return true; if (!e || typeof e !== "object") @@ -62078,549 +53103,47 @@ function isError2(e) { function toApplicationError(e, message) { if (e instanceof ApplicationError && !message) return e; - const err = toError(e); + const err = toError3(e); return new ApplicationError(message ?? err.message, void 0, err); } // node_modules/cspell/dist/esm/util/cache/DiskCache.mjs -var import_assert2 = __toESM(require("assert"), 1); -var crypto4 = __toESM(require("crypto"), 1); -var fs4 = __toESM(require("fs"), 1); -var import_path2 = require("path"); - -// node_modules/@cspell/cspell-service-bus/dist/esm/errors.mjs -var ErrorUnhandledRequest = class extends Error { - constructor(request) { - super(`Unhandled Request: ${request.type}`); - this.request = request; - } -}; -var ErrorServiceRequestDepthExceeded = class extends Error { - constructor(request, depth) { - super(`Service Request Depth ${depth} Exceeded: ${request.type}`); - this.request = request; - this.depth = depth; - } -}; -var UnhandledHandlerError = class extends Error { - constructor(handlerName, handlerDescription, cause) { - super(`Unhandled Error in Handler: ${handlerName}`); - this.handlerName = handlerName; - this.handlerDescription = handlerDescription; - this.cause = cause; - } -}; - -// node_modules/@cspell/cspell-service-bus/dist/esm/request.mjs -var BaseServiceRequest = class { - constructor(type, params) { - this.type = type; - this.params = params; - } -}; -var ServiceRequestCls = class extends BaseServiceRequest { - constructor(type, params) { - super(type, params); - } -}; -function createResponse(value, _req) { - return { value }; -} -function createResponseFail(_request, error2) { - return { error: error2 }; -} -function isServiceResponseSuccess(res) { - return "value" in res && res.error === void 0; -} -function isServiceResponseFailure(res) { - return res.error !== void 0; -} - -// node_modules/@cspell/cspell-service-bus/dist/esm/bus.mjs -var MAX_DEPTH = 10; -var ServiceBus = class { - constructor(handlers = []) { - this.handlers = []; - handlers.forEach((h) => this.addHandler(h)); - } - addHandler(handler, name = "anonymous", description) { - const h = typeof handler === "function" ? { fn: handler, name, description } : handler; - const { fn, name: _name, description: _description } = h; - this.handlers.push({ fn, name: _name, description: _description }); - return this; - } - dispatch(request) { - let depth = 0; - const dispatcher = { dispatch }; - const handler = this.reduceHandlers(this.handlers, request, dispatcher, this.defaultHandler); - function dispatch(request2) { - ++depth; - if (depth >= MAX_DEPTH) { - return createResponseFail(request2, new ErrorServiceRequestDepthExceeded(request2, depth)); - } - const response = handler(request2); - --depth; - return response; - } - return dispatch(request); - } - defaultHandler(request) { - return createResponseFail(request, new ErrorUnhandledRequest(request)); - } - reduceHandlers(handlers, request, dispatcher, defaultHandler) { - const _handlers = handlers.map((m) => ({ ...m, fn: m.fn(dispatcher) })); - const handler = _handlers.reduce((next, h) => { - const fn = h.fn(next); - return (req) => { - try { - return fn(req); - } catch (e) { - return createResponseFail(request, new UnhandledHandlerError(h.name, h.description, e)); - } - }; - }, defaultHandler); - return handler; - } -}; - -// node_modules/@cspell/cspell-service-bus/dist/esm/createRequestHandler.mjs -function createRequestHandler(requestDef, fn, name, description) { - return createIsRequestHandler(requestDef.is, fn, name ?? requestDef.type, description); -} -function createIsRequestHandlerFn(isA, fn) { - return (dispatcher) => (next) => (request) => isA(request) ? fn(request, next, dispatcher) : next(request); -} -function createIsRequestHandler(isA, fn, name, description) { - return { - fn: createIsRequestHandlerFn(isA, fn), - name, - description - }; -} - -// node_modules/@cspell/cspell-service-bus/dist/esm/requestFactory.mjs -function requestFactory(requestType) { - class RequestClass extends ServiceRequestCls { - constructor(params) { - super(requestType, params); - } - static is(req) { - return req instanceof RequestClass && req.type === requestType; - } - static create(params) { - return new RequestClass(params); - } - static createRequestHandler(fn, name, description) { - return createRequestHandler(RequestClass, fn, name, description); - } - } - RequestClass.type = requestType; - return RequestClass; -} - -// node_modules/cspell-io/dist/esm/common/stat.mjs -function compareStats(left, right) { - if (left === right) - return 0; - if (left.eTag || right.eTag) - return left.eTag === right.eTag ? 0 : (left.eTag || "") < (right.eTag || "") ? -1 : 1; - const diff = left.size - right.size || left.mtimeMs - right.mtimeMs; - return diff < 0 ? -1 : diff > 0 ? 1 : 0; -} - -// node_modules/cspell-io/dist/esm/errors/ErrorNotImplemented.mjs -var ErrorNotImplemented = class extends Error { - constructor(method) { - super(`Method ${method} is not supported.`); - this.method = method; - } -}; - -// node_modules/cspell-io/dist/esm/handlers/node/file.mjs -var import_assert = __toESM(require("assert"), 1); -var import_fs3 = require("fs"); -var import_url2 = require("url"); -var import_zlib = require("zlib"); - -// node_modules/cspell-io/dist/esm/common/encode-decode.mjs -var BOM_BE = 65279; -var BOM_LE = 65534; -function decodeUtf16LE(buf) { - const bom = buf[0] << 8 | buf[1]; - buf = bom === BOM_LE ? buf.subarray(2) : buf; - return buf.toString("utf16le"); -} -function decodeUtf16BE(buf) { - return decodeUtf16LE(swapBytes(buf)); -} -function decode(buf, encoding) { - switch (encoding) { - case "utf16be": - return decodeUtf16BE(buf); - case "utf16le": - return decodeUtf16LE(buf); - } - if (buf.length < 2 || encoding && !encoding.startsWith("utf")) - return buf.toString(encoding); - const bom = buf[0] << 8 | buf[1]; - if (bom === BOM_BE || buf[0] === 0 && buf[1] !== 0) - return decodeUtf16BE(buf); - if (bom === BOM_LE || buf[0] !== 0 && buf[1] === 0) - return decodeUtf16LE(buf); - return buf.toString(encoding); -} -function swapBytesInPlace(buf) { - for (let i = 0; i < buf.length - 1; i += 2) { - const v = buf[i]; - buf[i] = buf[i + 1]; - buf[i + 1] = v; - } - return buf; -} -function swapBytes(buf) { - const tBuf = Buffer.from(buf); - return swapBytesInPlace(tBuf); -} - -// node_modules/cspell-io/dist/esm/errors/error.mjs -function toError2(e) { - if (e instanceof Error) - return e; - if (typeof e === "object" && e && typeof e.message === "string") { - return e; - } - return Error(e && e.toString()); -} - -// node_modules/cspell-io/dist/esm/node/file/util.mjs -var import_url = require("url"); -var isURLRegExp = /^(\w{2,64}:\/\/|data:)/i; -function isUrlLike(filename) { - return filename instanceof URL || isURLRegExp.test(filename); -} -function toURL(filename) { - return filename instanceof URL || typeof filename !== "string" ? filename : isUrlLike(filename) ? new URL(filename) : (0, import_url.pathToFileURL)(filename); -} -var regMatchFilename = /filename=([^;,]*)/; -function urlBasename(url) { - function guessDataUrlName(header) { - const filenameMatch = header.match(regMatchFilename); - if (filenameMatch) - return filenameMatch[1]; - const mime = header.split(";", 1)[0]; - return mime.replace(/\W/g, "."); - } - if (typeof url === "string" && url.startsWith("data:")) { - return guessDataUrlName(url.split(",", 1)[0].split(":", 2)[1]); - } - url = toURL(url); - if (url.protocol === "data:") { - return guessDataUrlName(url.pathname.split(",", 1)[0]); - } - return basename(url.pathname); -} -function urlDirname(url) { - if (typeof url === "string" && url.startsWith("data:")) { - return toURL("data:"); - } - url = toURL(url); - if (url.protocol === "data:") { - return toURL("data:"); - } - return new URL(url.pathname.endsWith("/") ? ".." : ".", url); -} -function basename(path16) { - path16 = path16.endsWith("/") ? path16.slice(0, path16.length - 1) : path16; - const idx = path16.lastIndexOf("/"); - return idx >= 0 ? path16.slice(idx + 1) || "" : path16; -} - -// node_modules/cspell-io/dist/esm/node/dataUrl.mjs -var dataUrlRegExHead = /^data:(?[^;,]*)(?(?:;[^=]+=[^;,]*)*)(?;base64)?$/; -function decodeDataUrl(url) { - url = url.toString(); - const [head, encodedData] = url.split(",", 2); - if (!head || encodedData === void 0) - throw Error("Not a data url"); - const match = head.match(dataUrlRegExHead); - if (!match || !match.groups) - throw Error("Not a data url"); - const mediaType = match.groups["mediaType"] || ""; - const rawAttributes = (match.groups["attributes"] || "").split(";").filter((a) => !!a).map((entry) => entry.split("=", 2)).map(([key, value]) => [key, decodeURIComponent(value)]); - const attributes = new Map(rawAttributes); - const encoding = attributes.get("charset"); - const isBase64 = !!match.groups["base64"]; - const data = isBase64 ? Buffer.from(encodedData, "base64url") : Buffer.from(decodeURIComponent(encodedData)); - return { mediaType, data, encoding, attributes }; -} - -// node_modules/cspell-io/dist/esm/node/file/fetch.mjs -var import_node_fetch = __toESM(require_lib3(), 1); +var import_assert16 = __toESM(require("assert"), 1); +var crypto5 = __toESM(require("crypto"), 1); +var fs7 = __toESM(require("fs"), 1); +var import_path5 = require("path"); -// node_modules/cspell-io/dist/esm/node/file/FetchError.mjs -var FetchUrlError = class _FetchUrlError extends Error { - constructor(message, code, status, url) { - super(message); - this.code = code; - this.status = status; - this.url = url; - this.name = "FetchUrlError"; - } - static create(url, status, message) { - if (status === 404) - return new _FetchUrlError(message || "URL not found.", "ENOENT", status, url); - if (status >= 400 && status < 500) - return new _FetchUrlError(message || "Permission denied.", "EACCES", status, url); - return new _FetchUrlError(message || "Fatal Error", "ECONNREFUSED", status, url); - } -}; - -// node_modules/cspell-io/dist/esm/node/file/fetch.mjs -var fetch = import_node_fetch.default; -async function fetchHead(request) { - const r = await fetch(request, { method: "HEAD" }); - return r.headers; -} -async function fetchURL(url) { - const response = await fetch(url); - if (!response.ok) { - throw FetchUrlError.create(url, response.status); - } - return Buffer.from(await response.arrayBuffer()); -} - -// node_modules/cspell-io/dist/esm/node/file/stat.mjs -async function getStatHttp(url) { - const headers = await fetchHead(url); - const eTag = headers.get("etag") || void 0; - const guessSize = Number.parseInt(headers.get("content-length") || "0", 10); - return { - size: eTag ? -1 : guessSize, - mtimeMs: 0, - eTag - }; -} - -// node_modules/cspell-io/dist/esm/requests/RequestFsReadBinaryFile.mjs -var RequestType = "fs:readBinaryFile"; -var RequestFsReadBinaryFile = requestFactory(RequestType); -var RequestTypeSync = "fs:readBinaryFileSync"; -var RequestFsReadBinaryFileSync = requestFactory(RequestTypeSync); - -// node_modules/cspell-io/dist/esm/requests/RequestFsReadFile.mjs -var RequestType2 = "fs:readFile"; -var RequestFsReadFile = requestFactory(RequestType2); - -// node_modules/cspell-io/dist/esm/requests/RequestFsReadFileSync.mjs -var RequestType3 = "fs:readFileSync"; -var RequestFsReadFileSync = requestFactory(RequestType3); - -// node_modules/cspell-io/dist/esm/requests/RequestFsStat.mjs -var RequestTypeStat = "fs:stat"; -var RequestFsStat = requestFactory(RequestTypeStat); -var RequestTypeStatSync = "fs:statSync"; -var RequestFsStatSync = requestFactory(RequestTypeStatSync); - -// node_modules/cspell-io/dist/esm/requests/RequestFsWriteFile.mjs -var RequestType4 = "fs:writeFile"; -var RequestFsWriteFile = requestFactory(RequestType4); - -// node_modules/cspell-io/dist/esm/requests/RequestZlibInflate.mjs -var RequestType5 = "zlib:inflate"; -var RequestZlibInflate = requestFactory(RequestType5); +// node_modules/cspell/dist/esm/util/fileHelper.mjs +var import_fs5 = require("fs"); -// node_modules/cspell-io/dist/esm/handlers/node/file.mjs -var isGzFileRegExp = /\.gz($|[?#])/; -function isGzFile(url) { - return isGzFileRegExp.test(url.pathname); -} -var handleRequestFsReadBinaryFile = RequestFsReadBinaryFile.createRequestHandler(({ params }) => createResponse(import_fs3.promises.readFile((0, import_url2.fileURLToPath)(params.url)).then((content) => ({ url: params.url, content }))), void 0, "Node: Read Binary File."); -var handleRequestFsReadBinaryFileSync = RequestFsReadBinaryFileSync.createRequestHandler(({ params }) => createResponse({ url: params.url, content: (0, import_fs3.readFileSync)((0, import_url2.fileURLToPath)(params.url)) }), void 0, "Node: Sync Read Binary File."); -var handleRequestFsReadFile = RequestFsReadFile.createRequestHandler((req, _, dispatcher) => { - const { url, encoding } = req.params; - const res = dispatcher.dispatch(RequestFsReadBinaryFile.create({ url })); - if (!isServiceResponseSuccess(res)) { - (0, import_assert.default)(isServiceResponseFailure(res)); - return createResponseFail(req, res.error); - } - return createResponse(res.value.then((res2) => ({ - url, - content: bufferToText(res2.content, encoding), - baseFilename: res2.baseFilename - }))); -}, void 0, "Node: Read Text File."); -var handleRequestFsReadFileSync = RequestFsReadFileSync.createRequestHandler((req, _, dispatcher) => { - const { url, encoding } = req.params; - const res = dispatcher.dispatch(RequestFsReadBinaryFileSync.create({ url })); - if (!isServiceResponseSuccess(res)) { - (0, import_assert.default)(isServiceResponseFailure(res)); - return createResponseFail(req, res.error); +// node_modules/get-stdin/index.js +var { stdin } = process; +async function getStdin() { + let result = ""; + if (stdin.isTTY) { + return result; } - return createResponse({ - ...res.value, - content: bufferToText(res.value.content, encoding) - }); -}, void 0, "Node: Sync Read Text File."); -var handleRequestZlibInflate = RequestZlibInflate.createRequestHandler(({ params }) => createResponse((0, import_zlib.gunzipSync)(params.data).toString("utf-8")), void 0, "Node: gz deflate."); -var supportedFetchProtocols = { "http:": true, "https:": true }; -var handleRequestFsReadBinaryFileHttp = RequestFsReadBinaryFile.createRequestHandler((req, next) => { - const { url } = req.params; - if (!(url.protocol in supportedFetchProtocols)) - return next(req); - return createResponse(fetchURL(url).then((content) => ({ url, content }))); -}, void 0, "Node: Read Http(s) file."); -var handleRequestFsReadBinaryFileSyncData = RequestFsReadBinaryFileSync.createRequestHandler((req, next) => { - const { url } = req.params; - if (url.protocol !== "data:") - return next(req); - const data = decodeDataUrl(url); - return createResponse({ url, content: data.data, baseFilename: data.attributes.get("filename") }); -}, void 0, "Node: Read data: urls."); -var handleRequestFsReadBinaryFileData = RequestFsReadBinaryFile.createRequestHandler((req, next, dispatcher) => { - const { url } = req.params; - if (url.protocol !== "data:") - return next(req); - const res = dispatcher.dispatch(RequestFsReadBinaryFileSync.create(req.params)); - if (!isServiceResponseSuccess(res)) - return res; - return createResponse(Promise.resolve(res.value)); -}, void 0, "Node: Read data: urls."); -function bufferToText(buf, encoding) { - return buf[0] === 31 && buf[1] === 139 ? decode((0, import_zlib.gunzipSync)(buf), encoding) : decode(buf, encoding); -} -var handleRequestFsStat = RequestFsStat.createRequestHandler(({ params }) => createResponse(import_fs3.promises.stat((0, import_url2.fileURLToPath)(params.url))), void 0, "Node: fs.stat."); -var handleRequestFsStatSync = RequestFsStatSync.createRequestHandler((req) => { - const { params } = req; - try { - return createResponse((0, import_fs3.statSync)((0, import_url2.fileURLToPath)(params.url))); - } catch (e) { - return createResponseFail(req, toError2(e)); + stdin.setEncoding("utf8"); + for await (const chunk of stdin) { + result += chunk; } -}, void 0, "Node: fs.stat."); -var handleRequestFsStatHttp = RequestFsStat.createRequestHandler((req, next) => { - const { url } = req.params; - if (!(url.protocol in supportedFetchProtocols)) - return next(req); - return createResponse(getStatHttp(url)); -}, void 0, "Node: http get stat"); -var handleRequestFsWriteFile = RequestFsWriteFile.createRequestHandler(({ params }) => createResponse(import_fs3.promises.writeFile(params.url, params.content)), void 0, "Node: fs.writeFile"); -var handleRequestFsWriteFileGz = RequestFsWriteFile.createRequestHandler((req, next) => { - const { url, content } = req.params; - if (!isGzFile(url)) - return next(req); - return createResponse(import_fs3.promises.writeFile(url, (0, import_zlib.gzipSync)(content))); -}, void 0, "Node: http get stat"); -function registerHandlers(serviceBus) { - const handlers = [ - handleRequestFsWriteFile, - handleRequestFsWriteFileGz, - handleRequestFsReadBinaryFile, - handleRequestFsReadBinaryFileSync, - handleRequestFsReadBinaryFileHttp, - handleRequestFsReadBinaryFileData, - handleRequestFsReadBinaryFileSyncData, - handleRequestFsReadFile, - handleRequestFsReadFileSync, - handleRequestZlibInflate, - handleRequestFsStatSync, - handleRequestFsStat, - handleRequestFsStatHttp - ]; - handlers.forEach((handler) => serviceBus.addHandler(handler)); + return result; } - -// node_modules/cspell-io/dist/esm/CSpellIONode.mjs -var defaultCSpellIONode = void 0; -var CSpellIONode = class { - constructor(serviceBus = new ServiceBus()) { - this.serviceBus = serviceBus; - registerHandlers(serviceBus); - } - readFile(uriOrFilename, encoding = "utf8") { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsReadFile.create({ url, encoding })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "readFile"); - } - return res.value; +getStdin.buffer = async () => { + const result = []; + let length = 0; + if (stdin.isTTY) { + return Buffer.concat([]); } - readFileSync(uriOrFilename, encoding = "utf8") { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsReadFileSync.create({ url, encoding })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "readFileSync"); - } - return res.value; + for await (const chunk of stdin) { + result.push(chunk); + length += chunk.length; } - writeFile(uriOrFilename, content) { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsWriteFile.create({ url, content })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "writeFile"); - } - return res.value; - } - getStat(uriOrFilename) { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsStat.create({ url })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "getStat"); - } - return res.value; - } - getStatSync(uriOrFilename) { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsStatSync.create({ url })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "getStatSync"); - } - return res.value; - } - compareStats(left, right) { - return compareStats(left, right); - } - toURL(uriOrFilename) { - return toURL(uriOrFilename); - } - uriBasename(uriOrFilename) { - return urlBasename(uriOrFilename); - } - uriDirname(uriOrFilename) { - return urlDirname(uriOrFilename); - } -}; -function genError(err, alt) { - return err || new ErrorNotImplemented(alt); -} -function getDefaultCSpellIO() { - if (defaultCSpellIONode) - return defaultCSpellIONode; - const cspellIO = new CSpellIONode(); - defaultCSpellIONode = cspellIO; - return cspellIO; -} - -// node_modules/cspell-io/dist/esm/node/file/fileReader.mjs -var Stream = __toESM(require("stream"), 1); -var import_util18 = require("util"); -var pipeline2 = (0, import_util18.promisify)(Stream.pipeline); - -// node_modules/cspell-io/dist/esm/node/file/fileWriter.mjs -var Stream2 = __toESM(require("stream"), 1); -var import_util20 = require("util"); -var pipeline4 = (0, import_util20.promisify)(Stream2.pipeline); - -// node_modules/cspell-io/dist/esm/file/file.mjs -var readFile2 = function(filename, encoding) { - return getDefaultCSpellIO().readFile(filename, encoding).then((fr) => fr.content); + return Buffer.concat(result, length); }; // node_modules/cspell/dist/esm/util/fileHelper.mjs -var cspell = __toESM(require_cjs10(), 1); -var import_cspell_lib3 = __toESM(require_cjs10(), 1); -var import_fs5 = require("fs"); -var import_get_stdin = __toESM(require_get_stdin(), 1); -var path7 = __toESM(require("path"), 1); +var path18 = __toESM(require("path"), 1); var import_url3 = require("url"); var import_uri2 = __toESM(require_uri(), 1); @@ -62636,11 +53159,11 @@ var FileProtocol = "file://"; // node_modules/cspell/dist/esm/util/glob.mjs var import_fast_glob = __toESM(require_out4(), 1); var import_fs4 = require("fs"); -var path6 = __toESM(require("path"), 1); -var import_path = require("path"); +var path17 = __toESM(require("path"), 1); +var import_path4 = require("path"); // node_modules/cspell/dist/esm/util/util.mjs -var uniqueFn = uniqueFilterFnGenerator; +var uniqueFn2 = uniqueFilterFnGenerator; function uniqueFilterFnGenerator(extractFn) { const values = /* @__PURE__ */ new Set(); const extractor = extractFn || ((a) => a); @@ -62651,7 +53174,7 @@ function uniqueFilterFnGenerator(extractFn) { return ret; }; } -function clean(src) { +function clean5(src) { const r = src; for (const key of Object.keys(r)) { if (r[key] === void 0) { @@ -62669,7 +53192,7 @@ async function globP(pattern, options) { const onlyFiles = options?.nodir; const dot = options?.dot; const patterns = typeof pattern === "string" ? [pattern] : pattern; - const useOptions = clean({ + const useOptions = clean5({ cwd, onlyFiles, dot, @@ -62677,9 +53200,9 @@ async function globP(pattern, options) { absolute: true, followSymbolicLinks: false }); - const compare2 = new Intl.Collator("en").compare; - const absolutePaths = (await (0, import_fast_glob.default)(patterns, useOptions)).sort(compare2); - const relativePaths = absolutePaths.map((absFilename) => path6.relative(cwd, absFilename)); + const compare4 = new Intl.Collator("en").compare; + const absolutePaths = (await (0, import_fast_glob.default)(patterns, useOptions)).sort(compare4); + const relativePaths = absolutePaths.map((absFilename) => path17.relative(cwd, absFilename)); return relativePaths; } function calcGlobs(commandLineExclude) { @@ -62744,11 +53267,11 @@ async function adjustPossibleDirectory(glob2, root) { if (isPossibleUrlRegExp.test(g.glob)) { return glob2; } - const dirPath = path6.resolve(g.root, g.glob); + const dirPath = path17.resolve(g.root, g.glob); try { const stat2 = await import_fs4.promises.stat(dirPath); if (stat2.isDirectory()) { - const useGlob = import_path.posix.join(posixPath(g.glob), "**"); + const useGlob = import_path4.posix.join(posixPath(g.glob), "**"); return typeof glob2 === "string" ? useGlob : { ...glob2, glob: useGlob }; } } catch (e) { @@ -62757,7 +53280,7 @@ async function adjustPossibleDirectory(glob2, root) { return glob2; } function posixPath(p) { - return path6.sep === "\\" ? p.replace(/\\/g, "/") : p; + return path17.sep === "\\" ? p.replace(/\\/g, "/") : p; } async function normalizeFileOrGlobsToRoot(globs, root) { const adjustedGlobs = await Promise.all(globs.map((g) => adjustPossibleDirectory(g, root))); @@ -62774,10 +53297,10 @@ function readStdin() { var doesMatchUrl = /^(file|stdin|https?):\/\//; async function readConfig(configFile, root) { if (configFile) { - const config2 = await cspell.loadConfig(configFile) || {}; + const config2 = await loadConfig(configFile) || {}; return { source: configFile, config: config2 }; } - const config = await cspell.searchForConfig(root); + const config = await searchForConfig(root); return { source: config?.__importRef?.filename || "None found", config: config || {} }; } function fileInfoToDocument(fileInfo, languageId, locale) { @@ -62786,67 +53309,67 @@ function fileInfoToDocument(fileInfo, languageId, locale) { locale = locale || void 0; const uri = filenameToUrlString(filename); if (uri.startsWith(STDINProtocol)) { - return clean({ + return clean5({ uri, text, languageId, locale }); } - return (0, import_cspell_lib3.fileToDocument)(uri, text, languageId, locale); + return fileToDocument(uri, text, languageId, locale); } function filenameToUrlString(filename, cwd = ".") { if (filename === STDIN) return "stdin:///"; if (filename.startsWith(STDINProtocol)) { const filePath = filename.slice(STDINProtocol.length); - const fullPath = path7.resolve(cwd, filePath); + const fullPath = path18.resolve(cwd, filePath); return (0, import_url3.pathToFileURL)(fullPath).toString(); } if (doesMatchUrl.test(filename)) return filename; - return (0, import_url3.pathToFileURL)(path7.resolve(cwd, filename)).toString(); + return (0, import_url3.pathToFileURL)(path18.resolve(cwd, filename)).toString(); } function filenameToUri(filename, cwd) { return import_uri2.URI.parse(filenameToUrlString(filename, cwd)); } -function isBinaryFile(filename, cwd) { +function isBinaryFile2(filename, cwd) { const uri = filenameToUri(filename, cwd); if (uri.scheme.startsWith("stdin")) return false; - return (0, import_cspell_lib3.isBinaryFile)(uri); + return isBinaryFile(uri); } -function resolveFilename(filename, cwd) { +function resolveFilename2(filename, cwd) { cwd = cwd || process.cwd(); if (filename === STDIN) return STDINProtocol; if (filename.startsWith(FileProtocol)) { - const url = new URL(filename.slice(FileProtocol.length), (0, import_url3.pathToFileURL)(cwd + path7.sep)); + const url = new URL(filename.slice(FileProtocol.length), (0, import_url3.pathToFileURL)(cwd + path18.sep)); return (0, import_url3.fileURLToPath)(url); } const scheme = filename.startsWith(STDINProtocol) ? STDINProtocol : ""; const pathname = filename.slice(scheme.length); - return scheme + path7.resolve(cwd, pathname); + return scheme + path18.resolve(cwd, pathname); } function readFileInfo(filename, encoding = UTF8, handleNotFound = false) { - filename = resolveFilename(filename); - const pText = filename.startsWith(STDINProtocol) ? (0, import_get_stdin.default)() : readFile2(filename, encoding); + filename = resolveFilename2(filename); + const pText = filename.startsWith(STDINProtocol) ? getStdin() : readFileText2(filename, encoding); return pText.then((text) => ({ text, filename }), (e) => { - const error2 = toError(e); + const error2 = toError3(e); return handleNotFound && error2.code === "EISDIR" ? Promise.resolve({ text: "", filename, errorCode: error2.code }) : handleNotFound && error2.code === "ENOENT" ? Promise.resolve({ text: "", filename, errorCode: error2.code }) : Promise.reject(new IOError(`Error reading file: "${filename}"`, error2)); }); } -function readFile3(filename, encoding = UTF8) { +function readFile2(filename, encoding = UTF8) { return readFileInfo(filename, encoding).then((info3) => info3.text); } async function findFiles(globPatterns, options) { - const stdin = []; - const globPats = globPatterns.filter((filename) => filename !== STDIN && !filename.startsWith(STDINProtocol) && !filename.startsWith(FileProtocol) ? true : (stdin.push(filename), false)); + const stdin2 = []; + const globPats = globPatterns.filter((filename) => filename !== STDIN && !filename.startsWith(STDINProtocol) && !filename.startsWith(FileProtocol) ? true : (stdin2.push(filename), false)); const globResults = globPats.length ? await globP(globPats, options) : []; const cwd = options.cwd || process.cwd(); - return [...stdin, ...globResults].map((filename) => resolveFilename(filename, cwd)); + return [...stdin2, ...globResults].map((filename) => resolveFilename2(filename, cwd)); } -var resolveFilenames = asyncMap(resolveFilename); +var resolveFilenames = asyncMap(resolveFilename2); function readFileListFiles(listFiles) { let useStdin = false; const files = listFiles.filter((file) => { @@ -62855,14 +53378,14 @@ function readFileListFiles(listFiles) { return !isStdin; }); const found = pipeAsync(files, asyncMap((file) => readFileListFile(file)), asyncAwait(), asyncFlatten()); - const stdin = useStdin ? readStdin() : []; - return pipeAsync(toAsyncIterable(found, stdin), resolveFilenames); + const stdin2 = useStdin ? readStdin() : []; + return pipeAsync(toAsyncIterable(found, stdin2), resolveFilenames); } async function readFileListFile(listFile) { try { - const relTo = path7.resolve(path7.dirname(listFile)); - const content = await readFile3(listFile); - const lines = content.split("\n").map((a) => a.trim()).filter((a) => !!a).map((file) => path7.resolve(relTo, file)); + const relTo = path18.resolve(path18.dirname(listFile)); + const content = await readFile2(listFile); + const lines = content.split("\n").map((a) => a.trim()).filter((a) => !!a).map((file) => path18.resolve(relTo, file)); return lines; } catch (err) { throw toApplicationError(err, `Error reading file list from: "${listFile}"`); @@ -62882,12 +53405,12 @@ function isNotDir(filename) { // node_modules/cspell/dist/esm/util/cache/fileEntryCache.mjs var import_fs6 = require("fs"); -var path8 = __toESM(require("path"), 1); +var path19 = __toESM(require("path"), 1); var import_worker_threads = require("worker_threads"); var fec = __toESM(require_file_entry_cache(), 1); function createFromFile2(pathToCache, useCheckSum, useRelative) { - const absPathToCache = path8.resolve(pathToCache); - const relDir = path8.dirname(absPathToCache); + const absPathToCache = path19.resolve(pathToCache); + const relDir = path19.dirname(absPathToCache); (0, import_fs6.mkdirSync)(relDir, { recursive: true }); const create = wrap(() => fec.createFromFile(absPathToCache, useCheckSum)); const feCache = create(); @@ -62900,13 +53423,13 @@ function createFromFile2(pathToCache, useCheckSum, useRelative) { }, hasFileChanged: wrap((cwd, file) => { console.log(file); - return feCache.hasFileChanged(resolveFile(cwd, file)); + return feCache.hasFileChanged(resolveFile2(cwd, file)); }), analyzeFiles: wrap((cwd, files) => { return feCache.analyzeFiles(resolveFiles(cwd, files)); }), getFileDescriptor: wrap((cwd, file) => { - return feCache.getFileDescriptor(resolveFile(cwd, file)); + return feCache.getFileDescriptor(resolveFile2(cwd, file)); }), getUpdatedFiles: wrap((cwd, files) => { return feCache.getUpdatedFiles(resolveFiles(cwd, files)); @@ -62916,7 +53439,7 @@ function createFromFile2(pathToCache, useCheckSum, useRelative) { }), removeEntry: wrap((cwd, file) => { console.log(file); - return feCache.removeEntry(resolveFile(cwd, file)); + return feCache.removeEntry(resolveFile2(cwd, file)); }), deleteCacheFile() { feCache.deleteCacheFile(); @@ -62929,14 +53452,14 @@ function createFromFile2(pathToCache, useCheckSum, useRelative) { }) }; return cacheWrapper; - function resolveFile(cwd, file) { + function resolveFile2(cwd, file) { if (!useRelative) return file; - const r = path8.relative(relDir, path8.resolve(cwd, file)); + const r = path19.relative(relDir, path19.resolve(cwd, file)); return normalizePath2(r); } function resolveFiles(cwd, files) { - return files?.map((file) => resolveFile(cwd, file)); + return files?.map((file) => resolveFile2(cwd, file)); } function wrap(fn) { return (...params) => { @@ -62955,7 +53478,7 @@ function normalizePath2(filePath) { } // node_modules/cspell/dist/esm/util/cache/ObjectCollection.mjs -var compare = Intl.Collator().compare; +var compare3 = Intl.Collator().compare; var ShallowObjectCollection = class { constructor() { this.tree = {}; @@ -62964,9 +53487,9 @@ var ShallowObjectCollection = class { if (typeof v !== "object" || v === null) { return v; } - const keys = Object.entries(v).filter((entry) => entry[1] !== void 0).sort((a, b) => compare(a[0], b[0])); + const keys2 = Object.entries(v).filter((entry) => entry[1] !== void 0).sort((a, b) => compare3(a[0], b[0])); let t = this.tree; - for (const [key, obj] of keys) { + for (const [key, obj] of keys2) { if (!t.c) { t.c = /* @__PURE__ */ new Map(); } @@ -63006,8 +53529,8 @@ var DiskCache = class { this.dependencyCacheTree = {}; this.objectCollection = new ShallowObjectCollection(); this.ocCacheFileResult = new ShallowObjectCollection(); - this.cacheFileLocation = (0, import_path2.resolve)(cacheFileLocation); - this.cacheDir = (0, import_path2.dirname)(this.cacheFileLocation); + this.cacheFileLocation = (0, import_path5.resolve)(cacheFileLocation); + this.cacheDir = (0, import_path5.dirname)(this.cacheFileLocation); this.fileEntryCache = createFromFile2(this.cacheFileLocation, useCheckSum, useUniversalCache); this.version = calcVersion(cspellVersion); } @@ -63100,11 +53623,11 @@ var DiskCache = class { return d; } getFileDep(file) { - (0, import_assert2.default)((0, import_path2.isAbsolute)(file), `Dependency must be absolute "${file}"`); + (0, import_assert16.default)((0, import_path5.isAbsolute)(file), `Dependency must be absolute "${file}"`); const f = this.toRelFile(file); let h; try { - const buffer = fs4.readFileSync(file); + const buffer = fs7.readFileSync(file); h = this.getHash(buffer); } catch (e) { return { f }; @@ -63122,18 +53645,18 @@ var DiskCache = class { return true; } getHash(buffer) { - return crypto4.createHash("md5").update(buffer).digest("hex"); + return crypto5.createHash("md5").update(buffer).digest("hex"); } resolveFile(file) { - return normalizePath2((0, import_path2.resolve)(this.cacheDir, file)); + return normalizePath2((0, import_path5.resolve)(this.cacheDir, file)); } toRelFile(file) { - return normalizePath2(this.useUniversalCache ? (0, import_path2.relative)(this.cacheDir, file) : file); + return normalizePath2(this.useUniversalCache ? (0, import_path5.relative)(this.cacheDir, file) : file); } }; -function getTreeEntry(tree, keys) { +function getTreeEntry(tree, keys2) { let r = tree; - for (const k of keys) { + for (const k of keys2) { r = r.c?.get(k); if (!r) return r; @@ -63164,8 +53687,8 @@ function setTreeEntry(tree, deps, update = false) { function compDep(a, b) { return a.f === b.f && a.h === b.h; } -function calcVersion(version3) { - return version3 + META_DATA_VERSION_SUFFIX; +function calcVersion(version4) { + return version4 + META_DATA_VERSION_SUFFIX; } // node_modules/cspell/dist/esm/util/cache/DummyCache.mjs @@ -63187,20 +53710,20 @@ var DummyCache = class { // node_modules/cspell/dist/esm/util/cache/createCache.mjs var DEFAULT_CACHE_LOCATION = ".cspellcache"; var versionSuffix = ""; -function createCache(options) { +function createCache5(options) { const { useCache, cacheLocation, cacheStrategy, reset } = options; - const location = import_path3.default.resolve(cacheLocation); + const location = import_path6.default.resolve(cacheLocation); const useChecksum = cacheStrategy === "content"; - const version3 = normalizeVersion(options.version); + const version4 = normalizeVersion(options.version); const useUniversal = options.cacheFormat === "universal"; - const cache = useCache ? new DiskCache(location, useChecksum, version3, useUniversal) : new DummyCache(); - reset && cache.reset(); - return cache; + const cache2 = useCache ? new DiskCache(location, useChecksum, version4, useUniversal) : new DummyCache(); + reset && cache2.reset(); + return cache2; } async function calcCacheSettings(config, cacheOptions, root) { const cs = config.cache ?? {}; const useCache = cacheOptions.cache ?? cs.useCache ?? false; - const cacheLocation = await resolveCacheLocation(import_path3.default.resolve(root, cacheOptions.cacheLocation ?? cs.cacheLocation ?? DEFAULT_CACHE_LOCATION)); + const cacheLocation = await resolveCacheLocation(import_path6.default.resolve(root, cacheOptions.cacheLocation ?? cs.cacheLocation ?? DEFAULT_CACHE_LOCATION)); const cacheStrategy = cacheOptions.cacheStrategy ?? cs.cacheStrategy ?? "metadata"; const cacheFormat = cacheOptions.cacheFormat ?? cs.cacheFormat ?? "legacy"; const optionals = {}; @@ -63218,27 +53741,27 @@ async function calcCacheSettings(config, cacheOptions, root) { } async function resolveCacheLocation(cacheLocation) { try { - const s = await (0, import_promises.stat)(cacheLocation); + const s = await (0, import_promises2.stat)(cacheLocation); if (s.isFile()) return cacheLocation; - return import_path3.default.join(cacheLocation, DEFAULT_CACHE_LOCATION); + return import_path6.default.join(cacheLocation, DEFAULT_CACHE_LOCATION); } catch (err) { - if (isError2(err) && err.code === "ENOENT") { + if (isError4(err) && err.code === "ENOENT") { return cacheLocation; } throw err; } } -function normalizeVersion(version3) { - const parts = version3.split(".").slice(0, 2); - (0, import_assert3.default)(parts.length === 2); +function normalizeVersion(version4) { + const parts = version4.split(".").slice(0, 2); + (0, import_assert17.default)(parts.length === 2); return parts.join(".") + versionSuffix; } // node_modules/cspell/dist/esm/util/prefetch.mjs -var import_assert4 = __toESM(require("assert"), 1); +var import_assert18 = __toESM(require("assert"), 1); function* prefetchIterable(iterable, size) { - (0, import_assert4.default)(size >= 0); + (0, import_assert18.default)(size >= 0); const iter = iterable[Symbol.iterator](); const buffer = []; for (let next = iter.next(); !next.done; next = iter.next()) { @@ -63253,7 +53776,7 @@ function* prefetchIterable(iterable, size) { } // node_modules/@cspell/dynamic-import/dist/esm/dynamicImport.mjs -var import_path4 = require("path"); +var import_path7 = require("path"); var import_url4 = require("url"); var isWindowsPath = /^[a-z]:\\/i; async function dynamicImportFrom(moduleName, paths) { @@ -63263,19 +53786,19 @@ async function dynamicImportFrom(moduleName, paths) { try { return await import(modulesNameToImport.toString()); } catch (e) { - const err = toError3(e); + const err = toError4(e); throw err; } } const importResolveModule = await Promise.resolve().then(() => (init_import_meta_resolve(), import_meta_resolve_exports)); - const { resolve: resolve10 } = importResolveModule; + const { resolve: resolve13 } = importResolveModule; let lastError = void 0; for (const parent of paths) { - const url = typeof parent === "string" ? parent.startsWith("file://") ? new URL(parent) : (0, import_url4.pathToFileURL)(parent + import_path4.sep) : parent; + const url = typeof parent === "string" ? parent.startsWith("file://") ? new URL(parent) : (0, import_url4.pathToFileURL)(parent + import_path7.sep) : parent; let resolved = ""; let location = ""; try { - resolved = await resolve10(modulesNameToImport.toString(), url.toString()); + resolved = resolve13(modulesNameToImport.toString(), url.toString()); location = isWindowsPath.test(resolved) ? (0, import_url4.pathToFileURL)(resolved).toString() : resolved; return await import(location); } catch (err) { @@ -63284,12 +53807,12 @@ async function dynamicImportFrom(moduleName, paths) { } throw lastError; } -function toError3(e) { - if (isError3(e)) +function toError4(e) { + if (isError5(e)) return e; return new Error(e?.toString()); } -function isError3(e) { +function isError5(e) { return e instanceof Error; } @@ -63333,7 +53856,7 @@ async function loadReporters(reporters, defaultReporter, config) { const { getReporter: getReporter2 } = await dynamicImportFrom(moduleName, [process.cwd(), import_pkgInfo.pkgDir]); return getReporter2(settings, config); } catch (e) { - throw new ApplicationError(`Failed to load reporter ${moduleName}: ${toError(e).message}`); + throw new ApplicationError(`Failed to load reporter ${moduleName}: ${toError3(e).message}`); } } reporters = !reporters || !reporters.length ? ["default"] : [...reporters]; @@ -63354,12 +53877,12 @@ function hrTimeToMs(hrTime) { } // node_modules/cspell/dist/esm/lint/lint.mjs -var version2 = import_pkgInfo2.npmPackage.version; +var version3 = import_pkgInfo2.npmPackage.version; var BATCH_SIZE = 8; var { opFilterAsync: opFilterAsync2 } = operators; async function runLint(cfg) { let { reporter } = cfg; - cspell2.setLogger(getLoggerFromReporter(reporter)); + setLogger(getLoggerFromReporter(reporter)); const configErrors = /* @__PURE__ */ new Set(); const timer = getTimeMeasurer(); const lintResult = await run2(); @@ -63369,19 +53892,19 @@ async function runLint(cfg) { console.log(`Elapsed Time: ${elapsed.toFixed(2)}ms`); } return lintResult; - function prefetch(filename, configInfo, cache) { - if (isBinaryFile(filename, cfg.root)) + function prefetch(filename, configInfo, cache2) { + if (isBinaryFile2(filename, cfg.root)) return { filename, result: Promise.resolve({ skip: true }) }; async function fetch2() { const getElapsedTimeMs = getTimeMeasurer(); - const cachedResult = await cache.getCachedLintResults(filename); + const cachedResult = await cache2.getCachedLintResults(filename); if (cachedResult) { reporter.debug(`Filename: ${filename}, using cache`); const fileResult = { ...cachedResult, elapsedTimeMs: getElapsedTimeMs() }; return { fileResult }; } const uri = filenameToUri(filename, cfg.root); - const checkResult = await cspell2.shouldCheckDocument({ uri }, {}, configInfo.config); + const checkResult = await shouldCheckDocument({ uri }, {}, configInfo.config); if (!checkResult.shouldCheck) return { skip: true }; const fileInfo = await readFileInfo(filename, void 0, true); @@ -63390,11 +53913,11 @@ async function runLint(cfg) { const result = fetch2(); return { filename, result }; } - async function processFile(filename, configInfo, cache, prefetch2) { + async function processFile(filename, configInfo, cache2, prefetch2) { if (prefetch2?.fileResult) return prefetch2.fileResult; const getElapsedTimeMs = getTimeMeasurer(); - const cachedResult = await cache.getCachedLintResults(filename); + const cachedResult = await cache2.getCachedLintResults(filename); if (cachedResult) { reporter.debug(`Filename: ${filename}, using cache`); return { ...cachedResult, elapsedTimeMs: getElapsedTimeMs() }; @@ -63412,7 +53935,7 @@ async function runLint(cfg) { const fileInfo = prefetch2?.fileInfo || await readFileInfo(filename, void 0, true); if (fileInfo.errorCode) { if (fileInfo.errorCode !== "EISDIR" && cfg.options.mustFindFiles) { - const err = toError(`File not found: "${filename}"`); + const err = toError3(`File not found: "${filename}"`); reporter.error("Linter:", err); result.errors += 1; } @@ -63426,13 +53949,13 @@ async function runLint(cfg) { try { const { showSuggestions: generateSuggestions, validateDirectives } = cfg.options; const numSuggestions = configInfo.config.numSuggestions ?? 5; - const validateOptions = clean({ generateSuggestions, numSuggestions, validateDirectives }); - const r = await cspell2.spellCheckDocument(doc, validateOptions, configInfo.config); + const validateOptions = clean5({ generateSuggestions, numSuggestions, validateDirectives }); + const r = await spellCheckDocument(doc, validateOptions, configInfo.config); spellResult = r; result.processed = r.checked; - result.issues = cspell2.Text.calculateTextDocumentOffsets(doc.uri, text, r.issues).map(mapIssue); + result.issues = text_exports.calculateTextDocumentOffsets(doc.uri, text, r.issues).map(mapIssue); } catch (e) { - reporter.error(`Failed to process "${filename}"`, toError(e)); + reporter.error(`Failed to process "${filename}"`, toError3(e)); result.errors += 1; } result.elapsedTimeMs = getElapsedTimeMs(); @@ -63454,17 +53977,17 @@ async function runLint(cfg) { reporter.debug(JSON.stringify(debugCfg, void 0, 2)); } const dep = calcDependencies(config); - cache.setCachedLintResults(result, dep.files); + cache2.setCachedLintResults(result, dep.files); return result; } function mapIssue({ doc: _, ...tdo }) { const context = cfg.showContext ? extractContext(tdo, cfg.showContext) : { text: tdo.line.text.trimEnd(), offset: tdo.line.offset }; - return clean({ ...tdo, context }); + return clean5({ ...tdo, context }); } async function processFiles(files, configInfo, cacheSettings) { const fileCount = files instanceof Array ? files.length : void 0; const status = runResult(); - const cache = createCache(cacheSettings); + const cache2 = createCache5(cacheSettings); const failFast = cfg.options.failFast ?? configInfo.config.failFast ?? false; const emitProgressBegin = (filename, fileNum, fileCount2) => reporter.progress({ type: "ProgressFileBegin", @@ -63472,7 +53995,7 @@ async function runLint(cfg) { fileCount: fileCount2, filename }); - const emitProgressComplete = (filename, fileNum, fileCount2, result) => reporter.progress(clean({ + const emitProgressComplete = (filename, fileNum, fileCount2, result) => reporter.progress(clean5({ type: "ProgressFileComplete", fileNum, fileCount: fileCount2, @@ -63483,14 +54006,14 @@ async function runLint(cfg) { cached: result?.cached })); function* prefetchFiles(files2) { - const iter = prefetchIterable(pipeSync(files2, opMapSync((filename) => prefetch(filename, configInfo, cache))), BATCH_SIZE); + const iter = prefetchIterable(pipeSync(files2, opMapSync((filename) => prefetch(filename, configInfo, cache2))), BATCH_SIZE); for (const v of iter) { yield v; } } async function* prefetchFilesAsync(files2) { for await (const filename of files2) { - yield prefetch(filename, configInfo, cache); + yield prefetch(filename, configInfo, cache2); } } const emptyResult = { @@ -63513,7 +54036,7 @@ async function runLint(cfg) { result: { ...emptyResult, fileInfo: { filename }, elapsedTimeMs: getElapsedTimeMs() } }; } - const result = await processFile(filename, configInfo, cache, fetchResult); + const result = await processFile(filename, configInfo, cache2, fetchResult); return { filename, fileNum: index, result }; } async function* loadAndProcessFiles() { @@ -63545,25 +54068,25 @@ async function runLint(cfg) { } status.errors += result.configErrors; } - cache.reconcile(); + cache2.reconcile(); return status; } function calcDependencies(config) { - const { configFiles, dictionaryFiles } = cspell2.extractDependencies(config); + const { configFiles, dictionaryFiles } = extractDependencies(config); return { files: configFiles.concat(dictionaryFiles) }; } async function reportConfigurationErrors(config) { - const errors = cspell2.extractImportErrors(config); - let count = 0; + const errors = extractImportErrors(config); + let count3 = 0; errors.forEach((ref) => { const key = ref.error.toString(); if (configErrors.has(key)) return; configErrors.add(key); - count += 1; + count3 += 1; reporter.error("Configuration", ref.error); }); - const dictCollection = await cspell2.getDictionary(config); + const dictCollection = await getDictionary(config); dictCollection.dictionaries.forEach((dict) => { const dictErrors = dict.getErrors?.() || []; const msg = `Dictionary Error with (${dict.name})`; @@ -63572,24 +54095,24 @@ async function runLint(cfg) { if (configErrors.has(key)) return; configErrors.add(key); - count += 1; + count3 += 1; reporter.error(msg, error2); }); }); - return count; + return count3; } function countConfigErrors(configInfo) { return reportConfigurationErrors(configInfo.config); } async function run2() { if (cfg.options.root) { - process.env[cspell2.ENV_CSPELL_GLOB_ROOT] = cfg.root; + process.env[ENV_CSPELL_GLOB_ROOT] = cfg.root; } const configInfo = await readConfig(cfg.configFile, cfg.root); if (cfg.options.defaultConfiguration !== void 0) { configInfo.config.loadDefaultConfiguration = cfg.options.defaultConfiguration; } - const reporterConfig = clean({ + const reporterConfig = clean5({ maxNumberOfProblems: configInfo.config.maxNumberOfProblems, maxDuplicateProblems: configInfo.config.maxDuplicateProblems, minWordLength: configInfo.config.minWordLength, @@ -63597,7 +54120,7 @@ async function runLint(cfg) { }); const reporters = cfg.options.reporter ?? configInfo.config.reporters; reporter = mergeReporters(...await loadReporters(reporters, cfg.reporter, reporterConfig)); - cspell2.setLogger(getLoggerFromReporter(reporter)); + setLogger(getLoggerFromReporter(reporter)); const globInfo = await determineGlobs(configInfo, cfg); const { fileGlobs, excludeGlobs } = globInfo; const hasFileLists = !!cfg.fileLists.length; @@ -63614,7 +54137,7 @@ async function runLint(cfg) { return runResult({ errors: configErrors2 }); const { root } = cfg; try { - const cacheSettings = await calcCacheSettings(configInfo.config, { ...cfg.options, version: version2 }, root); + const cacheSettings = await calcCacheSettings(configInfo.config, { ...cfg.options, version: version3 }, root); const files = await determineFilesToCheck(configInfo, cfg, reporter, globInfo); return await processFiles(files, configInfo, cacheSettings); } catch (e) { @@ -63639,7 +54162,7 @@ Options: } } function checkGlobs(globs, reporter) { - globs.filter((g) => g.startsWith("'") || g.endsWith("'")).map((glob2) => import_chalk2.default.yellow(glob2)).forEach((glob2) => reporter.error("Linter", new CheckFailed(`Glob starting or ending with ' (single quote) is not likely to match any files: ${glob2}.`))); + globs.filter((g) => g.startsWith("'") || g.endsWith("'")).map((glob2) => source_default.yellow(glob2)).forEach((glob2) => reporter.error("Linter", new CheckFailed(`Glob starting or ending with ' (single quote) is not likely to match any files: ${glob2}.`))); } async function determineGlobs(configInfo, cfg) { const useGitignore = cfg.options.gitignore ?? configInfo.config.useGitignore ?? false; @@ -63682,21 +54205,21 @@ async function determineFilesToCheck(configInfo, cfg, reporter, globInfo) { return files; } function isExcluded(filename, globMatcherExclude) { - if (cspell2.isBinaryFile(import_uri3.URI.file(filename))) { + if (isBinaryFile(import_uri3.URI.file(filename))) { return true; } const { root } = cfg; - const absFilename = path13.resolve(root, filename); + const absFilename = path23.resolve(root, filename); const r = globMatcherExclude.matchEx(absFilename); if (r.matched) { const { glob: glob2, source } = extractGlobSource(r.pattern); - reporter.info(`Excluded File: ${path13.relative(root, absFilename)}; Excluded by ${glob2} from ${source}`, MessageTypes.Info); + reporter.info(`Excluded File: ${path23.relative(root, absFilename)}; Excluded by ${glob2} from ${source}`, MessageTypes.Info); } return r.matched; } function filterFilesFn(globMatcherExclude) { const patterns = globMatcherExclude.patterns; - const excludeInfo = patterns.map(extractGlobSource).map(({ glob: glob2, source }) => `Glob: ${glob2} from ${source}`).filter(uniqueFn()); + const excludeInfo = patterns.map(extractGlobSource).map(({ glob: glob2, source }) => `Glob: ${glob2} from ${source}`).filter(uniqueFn2()); reporter.info(`Exclusion Globs: ${excludeInfo.join("\n ")} `, MessageTypes.Info); @@ -63738,24 +54261,24 @@ function extractGlobSource(g) { }; } function runResult(init = {}) { - const { files = 0, filesWithIssues = /* @__PURE__ */ new Set(), issues = 0, errors = 0, cachedFiles = 0 } = init; - return { files, filesWithIssues, issues, errors, cachedFiles }; + const { files = 0, filesWithIssues = /* @__PURE__ */ new Set(), issues = 0, errors = 0, cachedFiles: cachedFiles2 = 0 } = init; + return { files, filesWithIssues, issues, errors, cachedFiles: cachedFiles2 }; } function yesNo(value) { return value ? "Yes" : "No"; } function getLoggerFromReporter(reporter) { const log = (...params) => { - const msg = (0, import_util23.format)(...params); + const msg = (0, import_util57.format)(...params); reporter.info(msg, "Info"); }; const error2 = (...params) => { - const msg = (0, import_util23.format)(...params); + const msg = (0, import_util57.format)(...params); const err = { message: "", name: "error", toString: () => "" }; reporter.error(msg, err); }; const warn = (...params) => { - const msg = (0, import_util23.format)(...params); + const msg = (0, import_util57.format)(...params); reporter.info(msg, "Warning"); }; return { @@ -63771,7 +54294,7 @@ async function generateGitIgnore(roots) { const repo = await findRepoRoot(cwd) || cwd; root.push(repo); } - return new GitIgnore(root?.map((p) => path13.resolve(p))); + return new GitIgnore(root?.map((p) => path23.resolve(p))); } async function useFileLists(fileListFiles, includeGlobPatterns, root, dot) { includeGlobPatterns = includeGlobPatterns.length ? includeGlobPatterns : ["**"]; @@ -63786,14 +54309,14 @@ async function useFileLists(fileListFiles, includeGlobPatterns, root, dot) { } // node_modules/cspell/dist/esm/lint/LintRequest.mjs -var path14 = __toESM(require("path"), 1); +var path24 = __toESM(require("path"), 1); var defaultContextRange = 20; var LintRequest = class { constructor(fileGlobs, options, reporter) { this.fileGlobs = fileGlobs; this.options = options; this.reporter = reporter; - this.root = path14.resolve(options.root || process.cwd()); + this.root = path24.resolve(options.root || process.cwd()); this.configFile = options.config; this.excludes = calcExcludeGlobInfo(this.root, options.exclude); this.locale = options.locale || ""; @@ -63830,8 +54353,8 @@ var SimpleRepl = class { this.rl.on("history", (h) => (this._history = h, void 0)); } question(query) { - return new Promise((resolve10) => { - this.rl.question(query, resolve10); + return new Promise((resolve13) => { + this.rl.question(query, resolve13); }); } _completer(line) { @@ -63854,7 +54377,6 @@ var SimpleRepl = class { }; // node_modules/cspell/dist/esm/application.mjs -var import_cspell_lib5 = __toESM(require_cjs10(), 1); function lint(fileGlobs, options, reporter) { options = fixLegacy(options); const cfg = new LintRequest(fileGlobs, options, finalizeReporter(reporter) ?? getReporter({ ...options, fileGlobs })); @@ -64010,11 +54532,11 @@ function normalizeResult(result) { } function normalizeFiles(files) { const cwd = process.cwd(); - return [...files].map((file) => path15.relative(cwd, file)); + return [...files].map((file) => path25.relative(cwd, file)); } // src/main.ts -var import_util24 = require("util"); +var import_util58 = require("util"); function getGithubToken() { const t0 = core4.getInput("github_token", { required: true }); if (t0[0] !== "$") { @@ -64031,7 +54553,7 @@ async function run() { core4.info("Done."); } catch (error2) { console.error(error2); - core4.setFailed(isAppError(error2) ? error2.message : isError(error2) ? error2 : (0, import_util24.format)(error2)); + core4.setFailed(isAppError(error2) ? error2.message : isError(error2) ? error2 : (0, import_util58.format)(error2)); } } diff --git a/yarn.lock b/yarn.lock index e4cbc37b2..6979ca007 100644 --- a/yarn.lock +++ b/yarn.lock @@ -326,7 +326,60 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cspell/cspell-bundled-dicts@6.31.3", "@cspell/cspell-bundled-dicts@^6.31.3": +"@cspell/cspell-bundled-dicts@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-7.0.0.tgz#aea8a596a40748ed3e59ba4edd4fe73c0618d4f7" + integrity sha512-qfBAS4W35+loOfbprBDS8nN0Eitl9wmuPE8GQLbwYj9Qj+COlLg57KECeXF8cgGnHkahrIkc3t6V6eFF8nhXQw== + dependencies: + "@cspell/dict-ada" "^4.0.2" + "@cspell/dict-aws" "^4.0.0" + "@cspell/dict-bash" "^4.1.1" + "@cspell/dict-companies" "^3.0.19" + "@cspell/dict-cpp" "^5.0.4" + "@cspell/dict-cryptocurrencies" "^3.0.1" + "@cspell/dict-csharp" "^4.0.2" + "@cspell/dict-css" "^4.0.6" + "@cspell/dict-dart" "^2.0.3" + "@cspell/dict-django" "^4.1.0" + "@cspell/dict-docker" "^1.1.7" + "@cspell/dict-dotnet" "^5.0.0" + "@cspell/dict-elixir" "^4.0.3" + "@cspell/dict-en-common-misspellings" "^1.0.2" + "@cspell/dict-en-gb" "1.1.33" + "@cspell/dict-en_us" "^4.3.6" + "@cspell/dict-filetypes" "^3.0.1" + "@cspell/dict-fonts" "^4.0.0" + "@cspell/dict-fsharp" "^1.0.0" + "@cspell/dict-fullstack" "^3.1.5" + "@cspell/dict-gaming-terms" "^1.0.4" + "@cspell/dict-git" "^2.0.0" + "@cspell/dict-golang" "^6.0.2" + "@cspell/dict-haskell" "^4.0.1" + "@cspell/dict-html" "^4.0.3" + "@cspell/dict-html-symbol-entities" "^4.0.0" + "@cspell/dict-java" "^5.0.5" + "@cspell/dict-k8s" "^1.0.1" + "@cspell/dict-latex" "^4.0.0" + "@cspell/dict-lorem-ipsum" "^4.0.0" + "@cspell/dict-lua" "^4.0.1" + "@cspell/dict-node" "^4.0.2" + "@cspell/dict-npm" "^5.0.8" + "@cspell/dict-php" "^4.0.1" + "@cspell/dict-powershell" "^5.0.2" + "@cspell/dict-public-licenses" "^2.0.3" + "@cspell/dict-python" "^4.1.5" + "@cspell/dict-r" "^2.0.1" + "@cspell/dict-ruby" "^5.0.0" + "@cspell/dict-rust" "^4.0.1" + "@cspell/dict-scala" "^5.0.0" + "@cspell/dict-software-terms" "^3.2.1" + "@cspell/dict-sql" "^2.1.1" + "@cspell/dict-svelte" "^1.0.2" + "@cspell/dict-swift" "^2.0.1" + "@cspell/dict-typescript" "^3.1.1" + "@cspell/dict-vue" "^3.0.0" + +"@cspell/cspell-bundled-dicts@^6.31.3": version "6.31.3" resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-6.31.3.tgz#b9d7fc363b6ce3e0e49e945a563d9d012346ceb6" integrity sha512-KXy3qKWYzXOGYwqOGMCXHem3fV39iEmoKLiNhoWWry/SFdvAafmeY+LIDcQTXAcOQLkMDCwP2/rY/NadcWnrjg== @@ -378,29 +431,29 @@ "@cspell/dict-typescript" "^3.1.1" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-6.31.3.tgz#1911b6ef70d97821fa9d71ee9540efd67fc4a679" - integrity sha512-ZJwj2vT4lxncYxduXcxy0dCvjjMvXIfphbLSCN5CXvufrtupB4KlcjZUnOofCi4pfpp8qocCSn1lf2DU9xgUXA== +"@cspell/cspell-json-reporter@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-7.0.0.tgz#7d04d10b4c7df678847ac94bacf4bcc8740ad719" + integrity sha512-8OheTVzwwfOQqPZe3Enbe1F7Y0djjGunk5K7aC5MyXc3BuIV7Cx13xWo2gfAjiHBRuO5lqg9qidEfp6NE33amg== dependencies: - "@cspell/cspell-types" "6.31.3" + "@cspell/cspell-types" "7.0.0" -"@cspell/cspell-pipe@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-6.31.3.tgz#76e852728fb1b939c8fac045067b8259baa7d46e" - integrity sha512-Lv/y4Ya/TJyU1pf66yl1te7LneFZd3lZg1bN5oe1cPrKSmfWdiX48v7plTRecWd/OWyLGd0yN807v79A+/0W7A== +"@cspell/cspell-pipe@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-7.0.0.tgz#a1fdb9a8e31d445b4bf48c49c71cf36769ad9de2" + integrity sha512-MmQeLyyS5rZ/VvRtHGOLFUcCF9zy01WpWYthLZB61o96HCokqtlN4BBBPLYNxrotFNA4syVy9Si/wTxsC9oTiA== -"@cspell/cspell-service-bus@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-6.31.3.tgz#2bf2465a60bb6df8f9d301b33f45d37322f9dcab" - integrity sha512-x5j8j3n39KN8EXOAlv75CpircdpF5WEMCC5pcO916o6GBmJBy8SrdzdsBGJhVcYGGilqy6pf8R9RCZ3yAmG8gQ== +"@cspell/cspell-service-bus@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-7.0.0.tgz#b764fda9f8d02cfe6cc4df12a290ad4a2f4a94f8" + integrity sha512-0YMM5SJY+XooOTEoo5+xuqTBLO87FP6QR8OBLBDeWNHvON9M4TpeAAN5K+IM0vMSFzgt1aSSMJNO0HSmxn17Yw== -"@cspell/cspell-types@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-6.31.3.tgz#ff7493c435778fc76f5f6c6d786c86d12dc76790" - integrity sha512-wZ+t+lUsQJB65M31btZM4fH3K1CkRgE8pSeTiCwxYcnCL19pi4TMcEEMKdO8yFZMdocW4B7VRwzxNoQMw2ewBg== +"@cspell/cspell-types@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-7.0.0.tgz#d4fbe255c9e69b9785cf274e408cf183ba4f1ab3" + integrity sha512-b/Dee5lb362ODlEK+kQcUDJfCprDRUFWcddo5tyzsYm3ID08ll6+DzCtfRxf48isyX1tL7uBKMj/iIpAhRNu9Q== -"@cspell/dict-ada@^4.0.1": +"@cspell/dict-ada@^4.0.1", "@cspell/dict-ada@^4.0.2": version "4.0.2" resolved "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz#8da2216660aeb831a0d9055399a364a01db5805a" integrity sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA== @@ -410,17 +463,27 @@ resolved "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-3.0.0.tgz#7b2db82bb632c664c3d72b83267b93b9b0cafe60" integrity sha512-O1W6nd5y3Z00AMXQMzfiYrIJ1sTd9fB1oLr+xf/UD7b3xeHeMeYE2OtcWbt9uyeHim4tk+vkSTcmYEBKJgS5bQ== +"@cspell/dict-aws@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.0.tgz#ab71fe0c05d9ad662d27495e74361bdcb5b470eb" + integrity sha512-1YkCMWuna/EGIDN/zKkW+j98/55mxigftrSFgsehXhPld+ZMJM5J9UuBA88YfL7+/ETvBdd7mwW6IwWsC+/ltQ== + "@cspell/dict-bash@^4.1.1": version "4.1.1" resolved "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.1.tgz#fe28016096f44d4a09fe4c5bcaf6fa40f33d98c6" integrity sha512-8czAa/Mh96wu2xr0RXQEGMTBUGkTvYn/Pb0o+gqOO1YW+poXGQc3gx0YPqILDryP/KCERrNvkWUJz3iGbvwC2A== +"@cspell/dict-companies@^3.0.19": + version "3.0.19" + resolved "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.19.tgz#ac7ecaf7fe6568a93ca983a4f72bb64328864b2e" + integrity sha512-hO7rS4DhFA333qyvf89wIVoclCtXe/2sftY6aS0oMIH1bMZLjLx2B2sQJj6dCiu6gG/By1S9YZ0fXabiPk2Tkg== + "@cspell/dict-companies@^3.0.9": version "3.0.17" resolved "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.17.tgz#98c8bed74892a415f9471f77d11d2aa8f727b103" integrity sha512-vo1jbozgZWSzz2evIL26kLd35tVb+5kW/UTvTzAwaWutSWRloRyKx38nj2CaLJ2IFxBdiATteCFGTzKCvJJl6A== -"@cspell/dict-cpp@^5.0.2": +"@cspell/dict-cpp@^5.0.2", "@cspell/dict-cpp@^5.0.4": version "5.0.4" resolved "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.0.4.tgz#2c237dd5d690ee7464c612fd0ef8f2244359d97f" integrity sha512-Vmz/CCb2d91ES5juaO8+CFWeTa2AFsbpR8bkCPJq+P8cRP16+37tY0zNXEBSK/1ur4MakaRf76jeQBijpZxw0Q== @@ -435,12 +498,12 @@ resolved "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz#e55659dbe594e744d86b1baf0f3397fe57b1e283" integrity sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g== -"@cspell/dict-css@^4.0.5": +"@cspell/dict-css@^4.0.5", "@cspell/dict-css@^4.0.6": version "4.0.6" resolved "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.6.tgz#39cf199e68d6e17b9518938fa64368cec2f7f9ca" integrity sha512-2Lo8W2ezHmGgY8cWFr4RUwnjbndna5mokpCK/DuxGILQnuajR0J31ANQOXj/8iZM2phFB93ZzMNk/0c04TDfSQ== -"@cspell/dict-dart@^2.0.2": +"@cspell/dict-dart@^2.0.2", "@cspell/dict-dart@^2.0.3": version "2.0.3" resolved "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.0.3.tgz#75e7ffe47d5889c2c831af35acdd92ebdbd4cf12" integrity sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw== @@ -450,12 +513,12 @@ resolved "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-1.0.8.tgz#ceba98fb70ed872739d2c6e5cbc94020818450e8" integrity sha512-uGx0rd3BftfZ5mvXtPxvLNkQ33y0ylNw4GpBAAfF3hgGtifKdvLSmphOGuNgDYUPpJ0+e025bsvtN0/ZZCzWTg== -"@cspell/dict-django@^4.0.2": +"@cspell/dict-django@^4.0.2", "@cspell/dict-django@^4.1.0": version "4.1.0" resolved "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz#2d4b765daf3c83e733ef3e06887ea34403a4de7a" integrity sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w== -"@cspell/dict-docker@^1.1.6": +"@cspell/dict-docker@^1.1.6", "@cspell/dict-docker@^1.1.7": version "1.1.7" resolved "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz#bcf933283fbdfef19c71a642e7e8c38baf9014f2" integrity sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A== @@ -465,7 +528,7 @@ resolved "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.0.tgz#13690aafe14b240ad17a30225ac1ec29a5a6a510" integrity sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw== -"@cspell/dict-elixir@^4.0.2": +"@cspell/dict-elixir@^4.0.2", "@cspell/dict-elixir@^4.0.3": version "4.0.3" resolved "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz#57c25843e46cf3463f97da72d9ef8e37c818296f" integrity sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q== @@ -480,12 +543,12 @@ resolved "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^4.3.2": +"@cspell/dict-en_us@^4.3.2", "@cspell/dict-en_us@^4.3.6": version "4.3.6" resolved "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.6.tgz#1f554cf4e235af4e8d115c5924c87537b16a08d0" integrity sha512-odhgsjNZI9BtEOJdvqfAuv/3yz5aB1ngfBNaph7WSnYVt//9e3fhrElZ6/pIIkoyuGgeQPwz1fXt+tMgcnLSEQ== -"@cspell/dict-filetypes@^3.0.0": +"@cspell/dict-filetypes@^3.0.0", "@cspell/dict-filetypes@^3.0.1": version "3.0.1" resolved "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.1.tgz#61642b14af90894e6acf4c00f20ab2d097c1ed12" integrity sha512-8z8mY1IbrTyTRumx2vvD9yzRhNMk9SajM/GtI5hdMM2pPpNSp25bnuauzjRf300eqlqPY2MNb5MmhBFO014DJw== @@ -495,6 +558,16 @@ resolved "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-3.0.2.tgz#657d871cf627466765166cf18c448743c19317e2" integrity sha512-Z5QdbgEI7DV+KPXrAeDA6dDm/vTzyaW53SGlKqz6PI5VhkOjgkBXv3YtZjnxMZ4dY2ZIqq+RUK6qa9Pi8rQdGQ== +"@cspell/dict-fonts@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz#9bc8beb2a7b068b4fdb45cb994b36fd184316327" + integrity sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q== + +"@cspell/dict-fsharp@^1.0.0": + version "1.0.0" + resolved "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.0.tgz#420df73069f7bb8efe82bf823eef620647a571bc" + integrity sha512-dHPkMHwW4dWv3Lv9VWxHuVm4IylqvcfRBSnZ7usJTRThraetSVrOPIJwr6UJh7F5un/lGJx2lxWVApf2WQaB/A== + "@cspell/dict-fullstack@^3.1.5": version "3.1.5" resolved "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.1.5.tgz#35d18678161f214575cc613dd95564e05422a19c" @@ -510,7 +583,7 @@ resolved "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-2.0.0.tgz#fa5cb298845da9c69efc01c6af07a99097718dc9" integrity sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w== -"@cspell/dict-golang@^6.0.1": +"@cspell/dict-golang@^6.0.1", "@cspell/dict-golang@^6.0.2": version "6.0.2" resolved "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.2.tgz#dcba58b9e658c1cc713c19965a358185d15d1987" integrity sha512-5pyZn4AAiYukAW+gVMIMVmUSkIERFrDX2vtPDjg8PLQUhAHWiVeQSDjuOhq9/C5GCCEZU/zWSONkGiwLBBvV9A== @@ -550,6 +623,11 @@ resolved "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-3.0.0.tgz#c6347660fcab480b47bdcaec3b57e8c3abc4af68" integrity sha512-msEV24qEpzWZs2kcEicqYlhyBpR0amfDkJOs+iffC07si9ftqtQ+yP3lf1VFLpgqw3SQh1M1vtU7RD4sPrNlcQ== +"@cspell/dict-lorem-ipsum@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz#2793a5dbfde474a546b0caecc40c38fdf076306e" + integrity sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw== + "@cspell/dict-lua@^4.0.1": version "4.0.1" resolved "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.1.tgz#4c31975646cb2d71f1216c7aeaa0c5ab6994ea25" @@ -565,17 +643,22 @@ resolved "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.7.tgz#f2977579413a09d53fb385ed48f93184aad55aea" integrity sha512-6SegF0HsVaBTl6PlHjeErG8Av+tRYkUG1yaXUQIGWXU0A8oxhI0o4PuL65UWH5lkCKhJyGai69Cd0iytL0oVFg== +"@cspell/dict-npm@^5.0.8": + version "5.0.8" + resolved "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.8.tgz#51b2e6dd54f915a2e8725ff7fd75769cb645ff6e" + integrity sha512-KuqH8tEsFD6DPKqKwIfWr9E+admE3yghaC0AKXG8jPaf77N0lkctKaS3dm0oxWUXkYKA/eXj6LCtz3VcTyxFPg== + "@cspell/dict-php@^4.0.1": version "4.0.1" resolved "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.1.tgz#f3c5cd241f43a32b09355370fc6ce7bd50e6402c" integrity sha512-XaQ/JkSyq2c07MfRG54DjLi2CV+HHwS99DDCAao9Fq2JfkWroTQsUeek7wYZXJATrJVOULoV3HKih12x905AtQ== -"@cspell/dict-powershell@^5.0.1": +"@cspell/dict-powershell@^5.0.1", "@cspell/dict-powershell@^5.0.2": version "5.0.2" resolved "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.2.tgz#2b1d7d514354b6d7de405d5faaef30f8eca0ef09" integrity sha512-IHfWLme3FXE7vnOmMncSBxOsMTdNWd1Vcyhag03WS8oANSgX8IZ+4lMI00mF0ptlgchf16/OU8WsV4pZfikEFw== -"@cspell/dict-public-licenses@^2.0.2": +"@cspell/dict-public-licenses@^2.0.2", "@cspell/dict-public-licenses@^2.0.3": version "2.0.3" resolved "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.3.tgz#fa03649a5d6b8284e0c1da17eb449707df1a2a1c" integrity sha512-JSLEdpEYufQ1H+93UHi+axlqQm1fhgK6kpdLHp6uPHu//CsvETcqNVawjB+qOdI/g38JTMw5fBqSd0aGNxa6Dw== @@ -587,6 +670,13 @@ dependencies: "@cspell/dict-data-science" "^1.0.0" +"@cspell/dict-python@^4.1.5": + version "4.1.5" + resolved "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.1.5.tgz#0c5eab3f12a166c9339dec508d8b07b4dddab1d4" + integrity sha512-wWUWyHdyJtx5iG6Fz9rBQ17BtdpEsB17vmutao+gixQD28Jzb6XoLgDQ6606M0RnFjBSFhs5iT4CJBzlD2Kq6g== + dependencies: + "@cspell/dict-data-science" "^1.0.0" + "@cspell/dict-r@^2.0.1": version "2.0.1" resolved "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.1.tgz#73474fb7cce45deb9094ebf61083fbf5913f440a" @@ -612,7 +702,12 @@ resolved "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.2.0.tgz#41f5a7ff187298f04c9d564d45423afaddf637e0" integrity sha512-RI6sv4Bc4i42YH/ofVelv8lXpJRhCyS9IhI2BtejUoMXKhKA9gC01ATXOylx+oaQmj3t5ark4R50xKFRvC7ENA== -"@cspell/dict-sql@^2.1.0": +"@cspell/dict-software-terms@^3.2.1": + version "3.2.1" + resolved "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.2.1.tgz#655b52768d05d002d9fc18a0efa63eee66766b8b" + integrity sha512-+QXmyoONVc/3aNgKW+0F0u3XUCRTfNRkWKLZQA78i+9fOfde8ZT4JmROmZgRveH/MxD4n6pNFceIRcYI6C8WuQ== + +"@cspell/dict-sql@^2.1.0", "@cspell/dict-sql@^2.1.1": version "2.1.1" resolved "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.1.tgz#eb16c8bece4ff3154a193fe854a600ed0f75c64c" integrity sha512-v1mswi9NF40+UDUMuI148YQPEQvWjac72P6ZsjlRdLjEiQEEMEsTQ+zlkIdnzC9QCNyJaqD5Liq9Mn78/8Zxtw== @@ -637,17 +732,17 @@ resolved "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-6.31.3.tgz#f98ee7a8210e457b6f885be9a918b9608571b677" - integrity sha512-A6sT00+6UNGFksQ5SxW2ohNl6vUutai8F4jwJMHTjZL/9vivQpU7y5V4PpsfoPZtx3WZcbrzuTvJ+tLfdbWc4A== +"@cspell/dynamic-import@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-7.0.0.tgz#96f4ec55cca88939364abf4f0d51dc981ab959a1" + integrity sha512-GRSJvdQvVOC0y7Qla8eg6LLe8p8WnbnHLabGJGsqYfXgtfkUFev9v65kMybQSJt9qhDtGCRw6EN1UyaeeEtavQ== dependencies: - import-meta-resolve "^2.2.2" + import-meta-resolve "^3.0.0" -"@cspell/strong-weak-map@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-6.31.3.tgz#dd7470ce86c2372ec2cd889439c0f9808122b9c7" - integrity sha512-znwc9IlgGUPioHGshP/zyM8HsuYg1OY5S7HSiVXARh5H8RqcyBsnyn8abc0PPhqPrfDy9Fh5xHsAEPZ55dl1vQ== +"@cspell/strong-weak-map@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-7.0.0.tgz#a8a4d16c1d5c4a8892465b25685e3ef2c28236f0" + integrity sha512-DT1R30i3V7aJIGLt7x1igaMLHhYSFv6pgc9gNwXvZWFl1xm/f7Jx07GPXKKKhwwXd4vy7G5rhwo63F4Pt9i8Ng== "@esbuild/android-arm64@0.19.2": version "0.19.2" @@ -1619,6 +1714,11 @@ ansi-regex@^5.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -1873,6 +1973,13 @@ caniuse-lite@^1.0.30001503: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz#90fabae294215c3495807eb24fc809e11dc2f0a8" integrity sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA== +chalk-template@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.0.tgz#ffc55db6dd745e9394b85327c8ac8466edb7a7b1" + integrity sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg== + dependencies: + chalk "^5.2.0" + chalk@^2.0.0: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1882,7 +1989,7 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.2: +chalk@^4.0.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1890,6 +1997,11 @@ chalk@^4.0.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^5.2.0, chalk@^5.3.0: + version "5.3.0" + resolved "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + char-regex@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" @@ -1956,7 +2068,7 @@ color-name@~1.1.4: resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -commander@^10.0.0: +commander@^10.0.1: version "10.0.1" resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== @@ -1982,17 +2094,16 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -configstore@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" - integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== +configstore@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz#49eca2ebc80983f77e09394a1a56e0aca8235566" + integrity sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA== dependencies: - dot-prop "^5.2.0" - graceful-fs "^4.1.2" - make-dir "^3.0.0" - unique-string "^2.0.0" - write-file-atomic "^3.0.0" - xdg-basedir "^4.0.0" + dot-prop "^6.0.1" + graceful-fs "^4.2.6" + unique-string "^3.0.0" + write-file-atomic "^3.0.3" + xdg-basedir "^5.0.1" content-disposition@0.5.4: version "0.5.4" @@ -2058,73 +2169,75 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypto-random-string@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" - integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== +crypto-random-string@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz#5a3cc53d7dd86183df5da0312816ceeeb5bb1fc2" + integrity sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA== + dependencies: + type-fest "^1.0.1" -cspell-dictionary@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-6.31.3.tgz#5ab069e11e9c2231b01f66ecf250fff23215648c" - integrity sha512-3w5P3Md/tbHLVGPKVL0ePl1ObmNwhdDiEuZ2TXfm2oAIwg4aqeIrw42A2qmhaKLcuAIywpqGZsrGg8TviNNhig== +cspell-dictionary@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-7.0.0.tgz#c6df4d8c81cd0aa0f00a6f374005bf229b9b8d6e" + integrity sha512-CYB02vB870JfCtmi4Njuzw1nCjbyRCjoqlsAQgHkhRSevRKcjFrK3+XsBhNA3Zo4ek4P35+oS/I4vMOHu6cdCg== dependencies: - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" - cspell-trie-lib "6.31.3" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" + cspell-trie-lib "7.0.0" fast-equals "^4.0.3" gensequence "^5.0.2" -cspell-gitignore@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-6.31.3.tgz#324ff7c8f2e35b103eeec81a185d578bf37c42f0" - integrity sha512-vCfVG4ZrdwJnsZHl/cdp8AY+YNPL3Ga+0KR9XJsaz69EkQpgI6porEqehuwle7hiXw5e3L7xFwNEbpCBlxgLRA== +cspell-gitignore@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-7.0.0.tgz#8d003d562d803018624fb2816663d5dac9106877" + integrity sha512-9VVLuiVhntXO/It3K0nTDhxbPPc2nItvGLymItfUudfB0ZqgzBaomdoYZzXrcNOITjYiBXWCPuVOXLbyoL0DjQ== dependencies: - cspell-glob "6.31.3" + cspell-glob "7.0.0" find-up "^5.0.0" -cspell-glob@6.31.3, cspell-glob@^6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-6.31.3.tgz#99ed7e39f83735fbda9a77f13636a18fd54bef39" - integrity sha512-+koUJPSCOittQwhR0T1mj4xXT3N+ZnY2qQ53W6Gz9HY3hVfEEy0NpbwE/Uy7sIvFMbc426fK0tGXjXyIj72uhQ== +cspell-glob@7.0.0, cspell-glob@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-7.0.0.tgz#188d637357080598b5468a84bc432d69979fed21" + integrity sha512-Wl47kChIuSiuStofVSPdgvwi8BRD4tN03j+yhpJ1q+lWT023ctFacZy+Lc+L6nxaTUriDy5ET+UoooPMJ2PskA== dependencies: micromatch "^4.0.5" -cspell-grammar@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-6.31.3.tgz#1c8ebb9f623ec866d307c78ace9fa4ba73c94822" - integrity sha512-TZYaOLIGAumyHlm4w7HYKKKcR1ZgEMKt7WNjCFqq7yGVW7U+qyjQqR8jqnLiUTZl7c2Tque4mca7n0CFsjVv5A== +cspell-grammar@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-7.0.0.tgz#b008feef90723538bc5ecc5af90f222f87a5faf9" + integrity sha512-0k1qVvxMNwP4WXX1zIp3Ub+RQnUzjiBtB+BO4Lprnkp6/JuRndpBRDrXBsqNZBVzZ+JjyRSU1elNSN6/nudXvQ== dependencies: - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" -cspell-io@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-6.31.3.tgz#a62e95196027ab9c7c8a35d9ec347ded8d054658" - integrity sha512-yCnnQ5bTbngUuIAaT5yNSdI1P0Kc38uvC8aynNi7tfrCYOQbDu1F9/DcTpbdhrsCv+xUn2TB1YjuCmm0STfJlA== +cspell-io@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-7.0.0.tgz#ac6e96629fa7f329c71bb503dcca0e6233c57c99" + integrity sha512-pGf+XlMcOxZfO7NIwJYmje8D30OEUt2Vb7cfZ2nazdFf9/NfiZpYp3JHOT+n53DhbIXTfdmojXo5bVezPXA48g== dependencies: - "@cspell/cspell-service-bus" "6.31.3" - node-fetch "^2.6.9" + "@cspell/cspell-service-bus" "7.0.0" + node-fetch "^2.6.12" -cspell-lib@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-6.31.3.tgz#4b5034adb3af3e3d6acb49bbf251b9c18b280f50" - integrity sha512-Dv55aecaMvT/5VbNryKo0Zos8dtHon7e1K0z8DR4/kGZdQVT0bOFWeotSLhuaIqoNFdEt8ypfKbrIHIdbgt1Hg== +cspell-lib@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-7.0.0.tgz#df5940bc9151f83dbd93db0b8240527618670693" + integrity sha512-CJAa7uV4hrm8OTnWdFPONSUP1Dp7J7fVhKu15aTrpNASUMAHe5YWqFqInCg+0+XhdRpGGYjQKhd+khsXL5a+bg== dependencies: - "@cspell/cspell-bundled-dicts" "6.31.3" - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" - "@cspell/strong-weak-map" "6.31.3" + "@cspell/cspell-bundled-dicts" "7.0.0" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" + "@cspell/strong-weak-map" "7.0.0" clear-module "^4.1.2" comment-json "^4.2.3" - configstore "^5.0.1" + configstore "^6.0.0" cosmiconfig "8.0.0" - cspell-dictionary "6.31.3" - cspell-glob "6.31.3" - cspell-grammar "6.31.3" - cspell-io "6.31.3" - cspell-trie-lib "6.31.3" - fast-equals "^4.0.3" - find-up "^5.0.0" + cspell-dictionary "7.0.0" + cspell-glob "7.0.0" + cspell-grammar "7.0.0" + cspell-io "7.0.0" + cspell-trie-lib "7.0.0" + fast-equals "^5.0.1" + find-up "^6.3.0" gensequence "^5.0.2" import-fresh "^3.3.0" resolve-from "^5.0.0" @@ -2132,37 +2245,37 @@ cspell-lib@6.31.3: vscode-languageserver-textdocument "^1.0.8" vscode-uri "^3.0.7" -cspell-trie-lib@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-6.31.3.tgz#73060aa1e9926faeffe509f9f8b8fd74aa55d1a4" - integrity sha512-HNUcLWOZAvtM3E34U+7/mSSpO0F6nLd/kFlRIcvSvPb9taqKe8bnSa0Yyb3dsdMq9rMxUmuDQtF+J6arZK343g== +cspell-trie-lib@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-7.0.0.tgz#4b13d812b531d1670f505a1ef6b4cd37cde86933" + integrity sha512-mopXyfjNRVuYbrZcbBcLwOMrWeyTezh4w8zy+RywUmsF6IW6/HM2DkfE2BmH1IyE9af29lgQqdB5eDbJLWrP5A== dependencies: - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" gensequence "^5.0.2" -cspell@^6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell/-/cspell-6.31.3.tgz#d06176e7fe7ac80c4dd5c4a927139446e433385a" - integrity sha512-VeeShDLWVM6YPiU/imeGy0lmg6ki63tbLEa6hz20BExhzzpmINOP5nSTYtpY0H9zX9TrF/dLbI38TuuYnyG3Uw== - dependencies: - "@cspell/cspell-json-reporter" "6.31.3" - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" - "@cspell/dynamic-import" "6.31.3" - chalk "^4.1.2" - commander "^10.0.0" - cspell-gitignore "6.31.3" - cspell-glob "6.31.3" - cspell-io "6.31.3" - cspell-lib "6.31.3" - fast-glob "^3.2.12" +cspell@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell/-/cspell-7.0.0.tgz#f77e614c60254a6dd11f7a572e91904e395f2abf" + integrity sha512-E8wQP30bTLROJsSNwYnhhRUdzVa4vQo6zILv7PqgTCSaveg8Af1HEh4ocRPRhppRgIXDpccG27+ATlpEzxiPGQ== + dependencies: + "@cspell/cspell-json-reporter" "7.0.0" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" + "@cspell/dynamic-import" "7.0.0" + chalk "^5.3.0" + chalk-template "^1.1.0" + commander "^10.0.1" + cspell-gitignore "7.0.0" + cspell-glob "7.0.0" + cspell-io "7.0.0" + cspell-lib "7.0.0" + fast-glob "^3.3.1" fast-json-stable-stringify "^2.1.0" file-entry-cache "^6.0.1" - get-stdin "^8.0.0" - imurmurhash "^0.1.4" - semver "^7.3.8" - strip-ansi "^6.0.1" + get-stdin "^9.0.0" + semver "^7.5.4" + strip-ansi "^7.1.0" vscode-uri "^3.0.7" debug@2.6.9: @@ -2233,10 +2346,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dot-prop@^5.2.0: - version "5.3.0" - resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" - integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== +dot-prop@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" + integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA== dependencies: is-obj "^2.0.0" @@ -2524,7 +2637,12 @@ fast-equals@^4.0.3: resolved "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz#72884cc805ec3c6679b99875f6b7654f39f0e8c7" integrity sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg== -fast-glob@^3.2.12, fast-glob@^3.2.9: +fast-equals@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" + integrity sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ== + +fast-glob@^3.2.9: version "3.3.0" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz#7c40cb491e1e2ed5664749e87bfb516dbe8727c0" integrity sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA== @@ -2535,6 +2653,17 @@ fast-glob@^3.2.12, fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.3.1: + version "3.3.1" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -2602,6 +2731,14 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +find-up@^6.3.0: + version "6.3.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" + integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== + dependencies: + locate-path "^7.1.0" + path-exists "^5.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -2679,10 +2816,10 @@ get-package-type@^0.1.0: resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-stdin@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" - integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== +get-stdin@^9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575" + integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA== get-stream@^6.0.0: version "6.0.1" @@ -2746,7 +2883,7 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9: +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -2844,10 +2981,10 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" -import-meta-resolve@^2.2.2: - version "2.2.2" - resolved "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-2.2.2.tgz#75237301e72d1f0fbd74dbc6cca9324b164c2cc9" - integrity sha512-f8KcQ1D80V7RnqVm+/lirO9zkOxjGxhaTC1IPrBGd3MEfNgmNG67tSUO9gTi2F3Blr2Az6g1vocaxzkVnWl9MA== +import-meta-resolve@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.0.0.tgz#94a6aabc623874fbc2f3525ec1300db71c6cbc11" + integrity sha512-4IwhLhNNA8yy445rPjD/lWh++7hMDOml2eHtd58eG7h+qK3EryMuuRbsHGPikCoAgIkkDnckKfWSk2iDla/ejg== imurmurhash@^0.1.4: version "0.1.4" @@ -3453,6 +3590,13 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +locate-path@^7.1.0: + version "7.2.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" + integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== + dependencies: + p-locate "^6.0.0" + lodash-es@^4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" @@ -3634,7 +3778,7 @@ nock@^13.2.1: lodash "^4.17.21" propagate "^2.0.0" -node-fetch@^2.6.7, node-fetch@^2.6.9: +node-fetch@^2.6.12, node-fetch@^2.6.7: version "2.6.12" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== @@ -3732,6 +3876,13 @@ p-limit@^3.0.2, p-limit@^3.1.0: dependencies: yocto-queue "^0.1.0" +p-limit@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" + integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== + dependencies: + yocto-queue "^1.0.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -3746,6 +3897,13 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +p-locate@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" + integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== + dependencies: + p-limit "^4.0.0" + p-try@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -3785,6 +3943,11 @@ path-exists@^4.0.0: resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== +path-exists@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" + integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -4040,7 +4203,7 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.7, semver@^7.3.8, semver@^7.5.3: +semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -4198,6 +4361,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" @@ -4333,6 +4503,11 @@ type-fest@^0.21.3: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +type-fest@^1.0.1: + version "1.4.0" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" + integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== + type-is@~1.6.18: version "1.6.18" resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -4353,12 +4528,12 @@ typescript@^5.1.6: resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== -unique-string@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" - integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== +unique-string@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz#84a1c377aff5fd7a8bc6b55d8244b2bd90d75b9a" + integrity sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ== dependencies: - crypto-random-string "^2.0.0" + crypto-random-string "^4.0.0" universal-user-agent@^6.0.0: version "6.0.0" @@ -4478,7 +4653,7 @@ wrappy@1: resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^3.0.0: +write-file-atomic@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== @@ -4496,10 +4671,10 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -xdg-basedir@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" - integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== +xdg-basedir@^5.0.1: + version "5.1.0" + resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz#1efba19425e73be1bc6f2a6ceb52a3d2c884c0c9" + integrity sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ== y18n@^5.0.5: version "5.0.8" @@ -4538,3 +4713,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +yocto-queue@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" + integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==