vite-plugin-vue-devtools
Version:
A vite plugin for Vue DevTools
1,503 lines (1,482 loc) • 234 kB
JavaScript
import { createRequire } from "node:module";
import fs from "node:fs";
import path, { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { createViteServerRpc } from "@vue/devtools-core";
import { getViteRpcServer, setViteServerContext } from "@vue/devtools-kit";
import sirv from "sirv";
import { normalizePath } from "vite";
import Inspect from "vite-plugin-inspect";
import VueInspector from "vite-plugin-vue-inspector";
import fsp from "node:fs/promises";
//#region rolldown:runtime
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys$1 = __getOwnPropNames(from), i = 0, n = keys$1.length, key; i < n; i++) {
key = keys$1[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
var __require = /* @__PURE__ */ createRequire(import.meta.url);
//#endregion
//#region ../../node_modules/.pnpm/kolorist@1.8.0/node_modules/kolorist/dist/esm/index.mjs
let enabled = true;
const globalVar = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
/**
* Detect how much colors the current terminal supports
*/
let supportLevel = 0;
if (globalVar.process && globalVar.process.env && globalVar.process.stdout) {
const { FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, COLORTERM } = globalVar.process.env;
if (NODE_DISABLE_COLORS || NO_COLOR || FORCE_COLOR === "0") enabled = false;
else if (FORCE_COLOR === "1" || FORCE_COLOR === "2" || FORCE_COLOR === "3") enabled = true;
else if (TERM === "dumb") enabled = false;
else if ("CI" in globalVar.process.env && [
"TRAVIS",
"CIRCLECI",
"APPVEYOR",
"GITLAB_CI",
"GITHUB_ACTIONS",
"BUILDKITE",
"DRONE"
].some((vendor) => vendor in globalVar.process.env)) enabled = true;
else enabled = process.stdout.isTTY;
if (enabled) if (process.platform === "win32") supportLevel = 3;
else if (COLORTERM && (COLORTERM === "truecolor" || COLORTERM === "24bit")) supportLevel = 3;
else if (TERM && (TERM.endsWith("-256color") || TERM.endsWith("256"))) supportLevel = 2;
else supportLevel = 1;
}
let options = {
enabled,
supportLevel
};
function kolorist(start, end, level = 1) {
const open = `\x1b[${start}m`;
const close = `\x1b[${end}m`;
const regex = new RegExp(`\\x1b\\[${end}m`, "g");
return (str) => {
return options.enabled && options.supportLevel >= level ? open + ("" + str).replace(regex, open) + close : "" + str;
};
}
const reset = kolorist(0, 0);
const bold = kolorist(1, 22);
const dim = kolorist(2, 22);
const italic = kolorist(3, 23);
const underline = kolorist(4, 24);
const inverse = kolorist(7, 27);
const hidden = kolorist(8, 28);
const strikethrough = kolorist(9, 29);
const black = kolorist(30, 39);
const red = kolorist(31, 39);
const green = kolorist(32, 39);
const yellow = kolorist(33, 39);
const blue = kolorist(34, 39);
const magenta = kolorist(35, 39);
const cyan = kolorist(36, 39);
const white = kolorist(97, 39);
const gray = kolorist(90, 39);
const lightGray = kolorist(37, 39);
const lightRed = kolorist(91, 39);
const lightGreen = kolorist(92, 39);
const lightYellow = kolorist(93, 39);
const lightBlue = kolorist(94, 39);
const lightMagenta = kolorist(95, 39);
const lightCyan = kolorist(96, 39);
const bgBlack = kolorist(40, 49);
const bgRed = kolorist(41, 49);
const bgGreen = kolorist(42, 49);
const bgYellow = kolorist(43, 49);
const bgBlue = kolorist(44, 49);
const bgMagenta = kolorist(45, 49);
const bgCyan = kolorist(46, 49);
const bgWhite = kolorist(107, 49);
const bgGray = kolorist(100, 49);
const bgLightRed = kolorist(101, 49);
const bgLightGreen = kolorist(102, 49);
const bgLightYellow = kolorist(103, 49);
const bgLightBlue = kolorist(104, 49);
const bgLightMagenta = kolorist(105, 49);
const bgLightCyan = kolorist(106, 49);
const bgLightGray = kolorist(47, 49);
//#endregion
//#region src/dir.ts
const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
const DIR_CLIENT = resolve(DIR_DIST, "../client");
//#endregion
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
var require_array = __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.splitWhen = exports.flatten = void 0;
function flatten(items) {
return items.reduce((collection, item) => [].concat(collection, item), []);
}
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;
}
exports.splitWhen = splitWhen;
} });
//#endregion
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js
var require_errno = __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEnoentCodeError = void 0;
function isEnoentCodeError(error) {
return error.code === "ENOENT";
}
exports.isEnoentCodeError = isEnoentCodeError;
} });
//#endregion
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js
var require_fs$3 = __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.createDirentFromStats = void 0;
var DirentFromStats$1 = 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$1(name, stats) {
return new DirentFromStats$1(name, stats);
}
exports.createDirentFromStats = createDirentFromStats$1;
} });
//#endregion
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js
var require_path = __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js"(exports) {
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;
const os$1 = __require("os");
const path$10 = __require("path");
const IS_WINDOWS_PLATFORM = os$1.platform() === "win32";
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
/**
* All non-escaped special characters.
* Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters.
* Windows: (){}[], !+@ before (, ! at the beginning.
*/
const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
/**
* The device path (\\.\ or \\?\).
* https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths
*/
const DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
/**
* All backslashes except those escaping special characters.
* Windows: !()+@{}
* https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
*/
const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
/**
* Designed to work only with simple paths: `dir\\file`.
*/
function unixify(filepath) {
return filepath.replace(/\\/g, "/");
}
exports.unixify = unixify;
function makeAbsolute(cwd$1, filepath) {
return path$10.resolve(cwd$1, 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);
}
return entry;
}
exports.removeLeadingDotSegment = removeLeadingDotSegment;
exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
function escapeWindowsPath(pattern$1) {
return pattern$1.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
}
exports.escapeWindowsPath = escapeWindowsPath;
function escapePosixPath(pattern$1) {
return pattern$1.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.convertPosixPathToPattern = convertPosixPathToPattern;
} });
//#endregion
//#region ../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js
var require_is_extglob = __commonJS({ "../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js"(exports, module) {
/*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*/
module.exports = function isExtglob$1(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;
};
} });
//#endregion
//#region ../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js
var require_is_glob = __commonJS({ "../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js"(exports, module) {
/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
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;
};
module.exports = function isGlob$1(str, options$1) {
if (typeof str !== "string" || str === "") return false;
if (isExtglob(str)) return true;
var check = strictCheck;
if (options$1 && options$1.strict === false) check = relaxedCheck;
return check(str);
};
} });
//#endregion
//#region ../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js
var require_glob_parent = __commonJS({ "../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js"(exports, module) {
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;
/**
* @param {string} str
* @param {Object} opts
* @param {boolean} [opts.flipBackslashes=true]
* @returns {string}
*/
module.exports = function globParent$1(str, opts) {
var options$1 = Object.assign({ flipBackslashes: true }, opts);
if (options$1.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");
};
} });
//#endregion
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
var require_utils$3 = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js"(exports) {
exports.isInteger = (num) => {
if (typeof num === "number") return Number.isInteger(num);
if (typeof num === "string" && num.trim() !== "") return Number.isInteger(Number(num));
return false;
};
/**
* Find a node of the given type
*/
exports.find = (node, type) => node.nodes.find((node$1) => node$1.type === type);
/**
* Find a node of the given type
*/
exports.exceedsLimit = (min, max, step = 1, limit) => {
if (limit === false) return false;
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
return (Number(max) - Number(min)) / Number(step) >= limit;
};
/**
* Escape the given node with '\\' before node.value
*/
exports.escapeNode = (block, n = 0, type) => {
const node = block.nodes[n];
if (!node) return;
if (type && node.type === type || node.type === "open" || node.type === "close") {
if (node.escaped !== true) {
node.value = "\\" + node.value;
node.escaped = true;
}
}
};
/**
* Returns true if the given brace node should be enclosed in literal braces
*/
exports.encloseBrace = (node) => {
if (node.type !== "brace") return false;
if (node.commas >> 0 + node.ranges >> 0 === 0) {
node.invalid = true;
return true;
}
return false;
};
/**
* Returns true if a brace node is invalid.
*/
exports.isInvalidBrace = (block) => {
if (block.type !== "brace") return false;
if (block.invalid === true || block.dollar) return true;
if (block.commas >> 0 + block.ranges >> 0 === 0) {
block.invalid = true;
return true;
}
if (block.open !== true || block.close !== true) {
block.invalid = true;
return true;
}
return false;
};
/**
* Returns true if a node is an open or close node
*/
exports.isOpenOrClose = (node) => {
if (node.type === "open" || node.type === "close") return true;
return node.open === true || node.close === true;
};
/**
* Reduce an array of text nodes.
*/
exports.reduce = (nodes) => nodes.reduce((acc, node) => {
if (node.type === "text") acc.push(node.value);
if (node.type === "range") node.type = "text";
return acc;
}, []);
/**
* Flatten an array
*/
exports.flatten = (...args) => {
const result = [];
const flat = (arr) => {
for (let i = 0; i < arr.length; i++) {
const ele = arr[i];
if (Array.isArray(ele)) {
flat(ele);
continue;
}
if (ele !== void 0) result.push(ele);
}
return result;
};
flat(args);
return result;
};
} });
//#endregion
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
var require_stringify = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js"(exports, module) {
const utils$16 = require_utils$3();
module.exports = (ast, options$1 = {}) => {
const stringify$4 = (node, parent = {}) => {
const invalidBlock = options$1.escapeInvalid && utils$16.isInvalidBrace(parent);
const invalidNode = node.invalid === true && options$1.escapeInvalid === true;
let output = "";
if (node.value) {
if ((invalidBlock || invalidNode) && utils$16.isOpenOrClose(node)) return "\\" + node.value;
return node.value;
}
if (node.value) return node.value;
if (node.nodes) for (const child of node.nodes) output += stringify$4(child);
return output;
};
return stringify$4(ast);
};
} });
//#endregion
//#region ../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js
var require_is_number = __commonJS({ "../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js"(exports, module) {
module.exports = function(num) {
if (typeof num === "number") return num - num === 0;
if (typeof num === "string" && num.trim() !== "") return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
return false;
};
} });
//#endregion
//#region ../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js
var require_to_regex_range = __commonJS({ "../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js"(exports, module) {
const isNumber$1 = require_is_number();
const toRegexRange$1 = (min, max, options$1) => {
if (isNumber$1(min) === false) throw new TypeError("toRegexRange: expected the first argument to be a number");
if (max === void 0 || min === max) return String(min);
if (isNumber$1(max) === false) throw new TypeError("toRegexRange: expected the second argument to be a number.");
let opts = {
relaxZeros: true,
...options$1
};
if (typeof opts.strictZeros === "boolean") opts.relaxZeros = opts.strictZeros === false;
let relax = String(opts.relaxZeros);
let shorthand = String(opts.shorthand);
let capture = String(opts.capture);
let wrap = String(opts.wrap);
let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) return toRegexRange$1.cache[cacheKey].result;
let a = Math.min(min, max);
let b = Math.max(min, max);
if (Math.abs(a - b) === 1) {
let result = min + "|" + max;
if (opts.capture) return `(${result})`;
if (opts.wrap === false) return result;
return `(?:${result})`;
}
let isPadded = hasPadding(min) || hasPadding(max);
let state = {
min,
max,
a,
b
};
let positives = [];
let negatives = [];
if (isPadded) {
state.isPadded = isPadded;
state.maxLen = String(state.max).length;
}
if (a < 0) {
let newMin = b < 0 ? Math.abs(b) : 1;
negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
a = state.a = 0;
}
if (b >= 0) positives = splitToPatterns(a, b, state, opts);
state.negatives = negatives;
state.positives = positives;
state.result = collatePatterns(negatives, positives, opts);
if (opts.capture === true) state.result = `(${state.result})`;
else if (opts.wrap !== false && positives.length + negatives.length > 1) state.result = `(?:${state.result})`;
toRegexRange$1.cache[cacheKey] = state;
return state.result;
};
function collatePatterns(neg, pos, options$1) {
let onlyNegative = filterPatterns(neg, pos, "-", false, options$1) || [];
let onlyPositive = filterPatterns(pos, neg, "", false, options$1) || [];
let intersected = filterPatterns(neg, pos, "-?", true, options$1) || [];
let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
return subpatterns.join("|");
}
function splitToRanges(min, max) {
let nines = 1;
let zeros$1 = 1;
let stop = countNines(min, nines);
let stops = new Set([max]);
while (min <= stop && stop <= max) {
stops.add(stop);
nines += 1;
stop = countNines(min, nines);
}
stop = countZeros(max + 1, zeros$1) - 1;
while (min < stop && stop <= max) {
stops.add(stop);
zeros$1 += 1;
stop = countZeros(max + 1, zeros$1) - 1;
}
stops = [...stops];
stops.sort(compare);
return stops;
}
/**
* Convert a range to a regex pattern
* @param {Number} `start`
* @param {Number} `stop`
* @return {String}
*/
function rangeToPattern(start, stop, options$1) {
if (start === stop) return {
pattern: start,
count: [],
digits: 0
};
let zipped = zip(start, stop);
let digits = zipped.length;
let pattern$1 = "";
let count = 0;
for (let i = 0; i < digits; i++) {
let [startDigit, stopDigit] = zipped[i];
if (startDigit === stopDigit) pattern$1 += startDigit;
else if (startDigit !== "0" || stopDigit !== "9") pattern$1 += toCharacterClass(startDigit, stopDigit, options$1);
else count++;
}
if (count) pattern$1 += options$1.shorthand === true ? "\\d" : "[0-9]";
return {
pattern: pattern$1,
count: [count],
digits
};
}
function splitToPatterns(min, max, tok, options$1) {
let ranges = splitToRanges(min, max);
let tokens = [];
let start = min;
let prev;
for (let i = 0; i < ranges.length; i++) {
let max$1 = ranges[i];
let obj = rangeToPattern(String(start), String(max$1), options$1);
let zeros$1 = "";
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
if (prev.count.length > 1) prev.count.pop();
prev.count.push(obj.count[0]);
prev.string = prev.pattern + toQuantifier(prev.count);
start = max$1 + 1;
continue;
}
if (tok.isPadded) zeros$1 = padZeros(max$1, tok, options$1);
obj.string = zeros$1 + obj.pattern + toQuantifier(obj.count);
tokens.push(obj);
start = max$1 + 1;
prev = obj;
}
return tokens;
}
function filterPatterns(arr, comparison, prefix, intersection, options$1) {
let result = [];
for (let ele of arr) {
let { string: string$1 } = ele;
if (!intersection && !contains(comparison, "string", string$1)) result.push(prefix + string$1);
if (intersection && contains(comparison, "string", string$1)) result.push(prefix + string$1);
}
return result;
}
/**
* Zip strings
*/
function zip(a, b) {
let arr = [];
for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
return arr;
}
function compare(a, b) {
return a > b ? 1 : b > a ? -1 : 0;
}
function contains(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 countZeros(integer, zeros$1) {
return integer - integer % Math.pow(10, zeros$1);
}
function toQuantifier(digits) {
let [start = 0, stop = ""] = digits;
if (stop || start > 1) return `{${start + (stop ? "," + stop : "")}}`;
return "";
}
function toCharacterClass(a, b, options$1) {
return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
}
function hasPadding(str) {
return /^-?(0+)\d/.test(str);
}
function padZeros(value, tok, options$1) {
if (!tok.isPadded) return value;
let diff = Math.abs(tok.maxLen - String(value).length);
let relax = options$1.relaxZeros !== false;
switch (diff) {
case 0: return "";
case 1: return relax ? "0?" : "0";
case 2: return relax ? "0{0,2}" : "00";
default: return relax ? `0{0,${diff}}` : `0{${diff}}`;
}
}
/**
* Cache
*/
toRegexRange$1.cache = {};
toRegexRange$1.clearCache = () => toRegexRange$1.cache = {};
/**
* Expose `toRegexRange`
*/
module.exports = toRegexRange$1;
} });
//#endregion
//#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js"(exports, module) {
const util$1 = __require("util");
const toRegexRange = require_to_regex_range();
const isObject$1 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
const transform = (toNumber) => {
return (value) => toNumber === true ? Number(value) : String(value);
};
const isValidValue = (value) => {
return typeof value === "number" || typeof value === "string" && value !== "";
};
const isNumber = (num) => Number.isInteger(+num);
const zeros = (input) => {
let value = `${input}`;
let index = -1;
if (value[0] === "-") value = value.slice(1);
if (value === "0") return false;
while (value[++index] === "0");
return index > 0;
};
const stringify$3 = (start, end, options$1) => {
if (typeof start === "string" || typeof end === "string") return true;
return options$1.stringify === true;
};
const pad = (input, maxLength, toNumber) => {
if (maxLength > 0) {
let dash = input[0] === "-" ? "-" : "";
if (dash) input = input.slice(1);
input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
}
if (toNumber === false) return String(input);
return input;
};
const toMaxLen = (input, maxLength) => {
let negative = input[0] === "-" ? "-" : "";
if (negative) {
input = input.slice(1);
maxLength--;
}
while (input.length < maxLength) input = "0" + input;
return negative ? "-" + input : input;
};
const toSequence = (parts, options$1, maxLen) => {
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
let prefix = options$1.capture ? "" : "?:";
let positives = "";
let negatives = "";
let result;
if (parts.positives.length) positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
if (positives && negatives) result = `${positives}|${negatives}`;
else result = positives || negatives;
if (options$1.wrap) return `(${prefix}${result})`;
return result;
};
const toRange = (a, b, isNumbers, options$1) => {
if (isNumbers) return toRegexRange(a, b, {
wrap: false,
...options$1
});
let start = String.fromCharCode(a);
if (a === b) return start;
let stop = String.fromCharCode(b);
return `[${start}-${stop}]`;
};
const toRegex = (start, end, options$1) => {
if (Array.isArray(start)) {
let wrap = options$1.wrap === true;
let prefix = options$1.capture ? "" : "?:";
return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
}
return toRegexRange(start, end, options$1);
};
const rangeError = (...args) => {
return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util$1.inspect(...args));
};
const invalidRange = (start, end, options$1) => {
if (options$1.strictRanges === true) throw rangeError([start, end]);
return [];
};
const invalidStep = (step, options$1) => {
if (options$1.strictRanges === true) throw new TypeError(`Expected step "${step}" to be a number`);
return [];
};
const fillNumbers = (start, end, step = 1, options$1 = {}) => {
let a = Number(start);
let b = Number(end);
if (!Number.isInteger(a) || !Number.isInteger(b)) {
if (options$1.strictRanges === true) throw rangeError([start, end]);
return [];
}
if (a === 0) a = 0;
if (b === 0) b = 0;
let descending = a > b;
let startString = String(start);
let endString = String(end);
let stepString = String(step);
step = Math.max(Math.abs(step), 1);
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
let toNumber = padded === false && stringify$3(start, end, options$1) === false;
let format = options$1.transform || transform(toNumber);
if (options$1.toRegex && step === 1) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options$1);
let parts = {
negatives: [],
positives: []
};
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
let range = [];
let index = 0;
while (descending ? a >= b : a <= b) {
if (options$1.toRegex === true && step > 1) push(a);
else range.push(pad(format(a, index), maxLen, toNumber));
a = descending ? a - step : a + step;
index++;
}
if (options$1.toRegex === true) return step > 1 ? toSequence(parts, options$1, maxLen) : toRegex(range, null, {
wrap: false,
...options$1
});
return range;
};
const fillLetters = (start, end, step = 1, options$1 = {}) => {
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options$1);
let format = options$1.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);
if (options$1.toRegex && step === 1) return toRange(min, max, false, options$1);
let range = [];
let index = 0;
while (descending ? a >= b : a <= b) {
range.push(format(a, index));
a = descending ? a - step : a + step;
index++;
}
if (options$1.toRegex === true) return toRegex(range, null, {
wrap: false,
options: options$1
});
return range;
};
const fill$2 = (start, end, step, options$1 = {}) => {
if (end == null && isValidValue(start)) return [start];
if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options$1);
if (typeof step === "function") return fill$2(start, end, 1, { transform: step });
if (isObject$1(step)) return fill$2(start, end, 0, step);
let opts = { ...options$1 };
if (opts.capture === true) opts.wrap = true;
step = step || opts.step || 1;
if (!isNumber(step)) {
if (step != null && !isObject$1(step)) return invalidStep(step, opts);
return fill$2(start, end, 1, step);
}
if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
};
module.exports = fill$2;
} });
//#endregion
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
var require_compile = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js"(exports, module) {
const fill$1 = require_fill_range();
const utils$15 = require_utils$3();
const compile$1 = (ast, options$1 = {}) => {
const walk$1 = (node, parent = {}) => {
const invalidBlock = utils$15.isInvalidBrace(parent);
const invalidNode = node.invalid === true && options$1.escapeInvalid === true;
const invalid = invalidBlock === true || invalidNode === true;
const prefix = options$1.escapeInvalid === true ? "\\" : "";
let output = "";
if (node.isOpen === true) return prefix + node.value;
if (node.isClose === true) {
console.log("node.isClose", prefix, node.value);
return prefix + node.value;
}
if (node.type === "open") return invalid ? prefix + node.value : "(";
if (node.type === "close") return invalid ? prefix + node.value : ")";
if (node.type === "comma") return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
if (node.value) return node.value;
if (node.nodes && node.ranges > 0) {
const args = utils$15.reduce(node.nodes);
const range = fill$1(...args, {
...options$1,
wrap: false,
toRegex: true,
strictZeros: true
});
if (range.length !== 0) return args.length > 1 && range.length > 1 ? `(${range})` : range;
}
if (node.nodes) for (const child of node.nodes) output += walk$1(child, node);
return output;
};
return walk$1(ast);
};
module.exports = compile$1;
} });
//#endregion
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
var require_expand = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js"(exports, module) {
const fill = require_fill_range();
const stringify$2 = require_stringify();
const utils$14 = require_utils$3();
const append = (queue = "", stash = "", enclose = false) => {
const result = [];
queue = [].concat(queue);
stash = [].concat(stash);
if (!stash.length) return queue;
if (!queue.length) return enclose ? utils$14.flatten(stash).map((ele) => `{${ele}}`) : stash;
for (const item of queue) if (Array.isArray(item)) for (const value of item) result.push(append(value, stash, enclose));
else for (let ele of stash) {
if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
}
return utils$14.flatten(result);
};
const expand$1 = (ast, options$1 = {}) => {
const rangeLimit = options$1.rangeLimit === void 0 ? 1e3 : options$1.rangeLimit;
const walk$1 = (node, parent = {}) => {
node.queue = [];
let p = parent;
let q = parent.queue;
while (p.type !== "brace" && p.type !== "root" && p.parent) {
p = p.parent;
q = p.queue;
}
if (node.invalid || node.dollar) {
q.push(append(q.pop(), stringify$2(node, options$1)));
return;
}
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
q.push(append(q.pop(), ["{}"]));
return;
}
if (node.nodes && node.ranges > 0) {
const args = utils$14.reduce(node.nodes);
if (utils$14.exceedsLimit(...args, options$1.step, rangeLimit)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
let range = fill(...args, options$1);
if (range.length === 0) range = stringify$2(node, options$1);
q.push(append(q.pop(), range));
node.nodes = [];
return;
}
const enclose = utils$14.encloseBrace(node);
let queue = node.queue;
let block = node;
while (block.type !== "brace" && block.type !== "root" && block.parent) {
block = block.parent;
queue = block.queue;
}
for (let i = 0; i < node.nodes.length; i++) {
const child = node.nodes[i];
if (child.type === "comma" && node.type === "brace") {
if (i === 1) queue.push("");
queue.push("");
continue;
}
if (child.type === "close") {
q.push(append(q.pop(), queue, enclose));
continue;
}
if (child.value && child.type !== "open") {
queue.push(append(queue.pop(), child.value));
continue;
}
if (child.nodes) walk$1(child, node);
}
return queue;
};
return utils$14.flatten(walk$1(ast));
};
module.exports = expand$1;
} });
//#endregion
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
var require_constants$2 = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js"(exports, module) {
module.exports = {
MAX_LENGTH: 1e4,
CHAR_0: "0",
CHAR_9: "9",
CHAR_UPPERCASE_A: "A",
CHAR_LOWERCASE_A: "a",
CHAR_UPPERCASE_Z: "Z",
CHAR_LOWERCASE_Z: "z",
CHAR_LEFT_PARENTHESES: "(",
CHAR_RIGHT_PARENTHESES: ")",
CHAR_ASTERISK: "*",
CHAR_AMPERSAND: "&",
CHAR_AT: "@",
CHAR_BACKSLASH: "\\",
CHAR_BACKTICK: "`",
CHAR_CARRIAGE_RETURN: "\r",
CHAR_CIRCUMFLEX_ACCENT: "^",
CHAR_COLON: ":",
CHAR_COMMA: ",",
CHAR_DOLLAR: "$",
CHAR_DOT: ".",
CHAR_DOUBLE_QUOTE: "\"",
CHAR_EQUAL: "=",
CHAR_EXCLAMATION_MARK: "!",
CHAR_FORM_FEED: "\f",
CHAR_FORWARD_SLASH: "/",
CHAR_HASH: "#",
CHAR_HYPHEN_MINUS: "-",
CHAR_LEFT_ANGLE_BRACKET: "<",
CHAR_LEFT_CURLY_BRACE: "{",
CHAR_LEFT_SQUARE_BRACKET: "[",
CHAR_LINE_FEED: "\n",
CHAR_NO_BREAK_SPACE: "\xA0",
CHAR_PERCENT: "%",
CHAR_PLUS: "+",
CHAR_QUESTION_MARK: "?",
CHAR_RIGHT_ANGLE_BRACKET: ">",
CHAR_RIGHT_CURLY_BRACE: "}",
CHAR_RIGHT_SQUARE_BRACKET: "]",
CHAR_SEMICOLON: ";",
CHAR_SINGLE_QUOTE: "'",
CHAR_SPACE: " ",
CHAR_TAB: " ",
CHAR_UNDERSCORE: "_",
CHAR_VERTICAL_LINE: "|",
CHAR_ZERO_WIDTH_NOBREAK_SPACE: ""
};
} });
//#endregion
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
var require_parse$1 = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js"(exports, module) {
const stringify$1 = require_stringify();
/**
* Constants
*/
const { MAX_LENGTH: MAX_LENGTH$1, CHAR_BACKSLASH, CHAR_BACKTICK, CHAR_COMMA: CHAR_COMMA$1, CHAR_DOT: CHAR_DOT$1, CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1, CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1, CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1, CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1, CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1, CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1, CHAR_DOUBLE_QUOTE, CHAR_SINGLE_QUOTE, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants$2();
/**
* parse
*/
const parse$3 = (input, options$1 = {}) => {
if (typeof input !== "string") throw new TypeError("Expected a string");
const opts = options$1 || {};
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
const ast = {
type: "root",
input,
nodes: []
};
const stack = [ast];
let block = ast;
let prev = ast;
let brackets = 0;
const length = input.length;
let index = 0;
let depth$1 = 0;
let value;
/**
* Helpers
*/
const advance = () => input[index++];
const push = (node) => {
if (node.type === "text" && prev.type === "dot") prev.type = "text";
if (prev && prev.type === "text" && node.type === "text") {
prev.value += node.value;
return;
}
block.nodes.push(node);
node.parent = block;
node.prev = prev;
prev = node;
return node;
};
push({ type: "bos" });
while (index < length) {
block = stack[stack.length - 1];
value = advance();
/**
* Invalid chars
*/
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) continue;
/**
* Escaped chars
*/
if (value === CHAR_BACKSLASH) {
push({
type: "text",
value: (options$1.keepEscaping ? value : "") + advance()
});
continue;
}
/**
* Right square bracket (literal): ']'
*/
if (value === CHAR_RIGHT_SQUARE_BRACKET$1) {
push({
type: "text",
value: "\\" + value
});
continue;
}
/**
* Left square bracket: '['
*/
if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
brackets++;
let next;
while (index < length && (next = advance())) {
value += next;
if (next === CHAR_LEFT_SQUARE_BRACKET$1) {
brackets++;
continue;
}
if (next === CHAR_BACKSLASH) {
value += advance();
continue;
}
if (next === CHAR_RIGHT_SQUARE_BRACKET$1) {
brackets--;
if (brackets === 0) break;
}
}
push({
type: "text",
value
});
continue;
}
/**
* Parentheses
*/
if (value === CHAR_LEFT_PARENTHESES$1) {
block = push({
type: "paren",
nodes: []
});
stack.push(block);
push({
type: "text",
value
});
continue;
}
if (value === CHAR_RIGHT_PARENTHESES$1) {
if (block.type !== "paren") {
push({
type: "text",
value
});
continue;
}
block = stack.pop();
push({
type: "text",
value
});
block = stack[stack.length - 1];
continue;
}
/**
* Quotes: '|"|`
*/
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
const open = value;
let next;
if (options$1.keepQuotes !== true) value = "";
while (index < length && (next = advance())) {
if (next === CHAR_BACKSLASH) {
value += next + advance();
continue;
}
if (next === open) {
if (options$1.keepQuotes === true) value += next;
break;
}
value += next;
}
push({
type: "text",
value
});
continue;
}
/**
* Left curly brace: '{'
*/
if (value === CHAR_LEFT_CURLY_BRACE$1) {
depth$1++;
const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
const brace = {
type: "brace",
open: true,
close: false,
dollar,
depth: depth$1,
commas: 0,
ranges: 0,
nodes: []
};
block = push(brace);
stack.push(block);
push({
type: "open",
value
});
continue;
}
/**
* Right curly brace: '}'
*/
if (value === CHAR_RIGHT_CURLY_BRACE$1) {
if (block.type !== "brace") {
push({
type: "text",
value
});
continue;
}
const type = "close";
block = stack.pop();
block.close = true;
push({
type,
value
});
depth$1--;
block = stack[stack.length - 1];
continue;
}
/**
* Comma: ','
*/
if (value === CHAR_COMMA$1 && depth$1 > 0) {
if (block.ranges > 0) {
block.ranges = 0;
const open = block.nodes.shift();
block.nodes = [open, {
type: "text",
value: stringify$1(block)
}];
}
push({
type: "comma",
value
});
block.commas++;
continue;
}
/**
* Dot: '.'
*/
if (value === CHAR_DOT$1 && depth$1 > 0 && block.commas === 0) {
const siblings = block.nodes;
if (depth$1 === 0 || siblings.length === 0) {
push({
type: "text",
value
});
continue;
}
if (prev.type === "dot") {
block.range = [];
prev.value += value;
prev.type = "range";
if (block.nodes.length !== 3 && block.nodes.length !== 5) {
block.invalid = true;
block.ranges = 0;
prev.type = "text";
continue;
}
block.ranges++;
block.args = [];
continue;
}
if (prev.type === "range") {
siblings.pop();
const before = siblings[siblings.length - 1];
before.value += prev.value + value;
prev = before;
block.ranges--;
continue;
}
push({
type: "dot",
value
});
continue;
}
/**
* Text
*/
push({
type: "text",
value
});
}
do {
block = stack.pop();
if (block.type !== "root") {
block.nodes.forEach((node) => {
if (!node.nodes) {
if (node.type === "open") node.isOpen = true;
if (node.type === "close") node.isClose = true;
if (!node.nodes) node.type = "text";
node.invalid = true;
}
});
const parent = stack[stack.length - 1];
const index$1 = parent.nodes.indexOf(block);
parent.nodes.splice(index$1, 1, ...block.nodes);
}
} while (stack.length > 0);
push({ type: "eos" });
return ast;
};
module.exports = parse$3;
} });
//#endregion
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
var require_braces = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js"(exports, module) {
const stringify = require_stringify();
const compile = require_compile();
const expand = require_expand();
const parse$2 = require_parse$1();
/**
* Expand the given pattern or create a regex-compatible string.
*
* ```js
* const braces = require('braces');
* console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
* console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
* ```
* @param {String} `str`
* @param {Object} `options`
* @return {String}
* @api public
*/
const braces$1 = (input, options$1 = {}) => {
let output = [];
if (Array.isArray(input)) for (const pattern$1 of input) {
const result = braces$1.create(pattern$1, options$1);
if (Array.isArray(result)) output.push(...result);
else output.push(result);
}
else output = [].concat(braces$1.create(input, options$1));
if (options$1 && options$1.expand === true && options$1.nodupes === true) output = [...new Set(output)];
return output;
};
/**
* Parse the given `str` with the given `options`.
*
* ```js
* // braces.parse(pattern, [, options]);
* const ast = braces.parse('a/{b,c}/d');
* console.log(ast);
* ```
* @param {String} pattern Brace pattern to parse
* @param {Object} options
* @return {Object} Returns an AST
* @api public
*/
braces$1.parse = (input, options$1 = {}) => parse$2(input, options$1);
/**
* Creates a braces string from an AST, or an AST node.
*
* ```js
* const braces = require('braces');
* let ast = braces.parse('foo/{a,b}/bar');
* console.log(stringify(ast.nodes[2])); //=> '{a,b}'
* ```
* @param {String} `input` Brace pattern or AST.
* @param {Object} `options`
* @return {Array} Returns an array of expanded values.
* @api public
*/
braces$1.stringify = (input, options$1 = {}) => {
if (typeof input === "string") return stringify(braces$1.parse(input, options$1), options$1);
return stringify(input, options$1);
};
/**
* Compiles a brace pattern into a regex-compatible, optimized string.
* This method is called by the main [braces](#braces) function by default.
*
* ```js
* const braces = require('braces');
* console.log(braces.compile('a/{b,c}/d'));
* //=> ['a/(b|c)/d']
* ```
* @param {String} `input` Brace pattern or AST.
* @param {Object} `options`
* @return {Array} Returns an array of expanded values.
* @api public
*/
braces$1.compile = (input, options$1 = {}) => {
if (typeof input === "string") input = braces$1.parse(input, options$1);
return compile(input, options$1);
};
/**
* Expands a brace pattern into an array. This method is called by the
* main [braces](#braces) function when `options.expand` is true. Before
* using this method it's recommended that you read the [performance notes](#performance))
* and advantages of using [.compile](#compile) instead.
*
* ```js
* const braces = require('braces');
* console.log(braces.expand('a/{b,c}/d'));
* //=> ['a/b/d', 'a/c/d'];
* ```
* @param {String} `pattern` Brace pattern
* @param {Object} `options`
* @return {Array} Returns an array of expanded values.
* @api public
*/
braces$1.expand = (input, options$1 = {}) => {
if (typeof input === "string") input = braces$1.parse(input, options$1);
let result = expand(input, options$1);
if (options$1.noempty === true) result = result.filter(Boolean);
if (options$1.nodupes === true) result = [...new Set(result)];
return result;
};
/**
* Processes a brace pattern and returns either an expanded array
* (if `options.expand` is true), a highly optimized regex-compatible string.
* This method is called by the main [braces](#braces) function.
*
* ```js
* const braces = require('braces');
* console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
* //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
* ```
* @param {String} `pattern` Brace pattern
* @param {Object} `options`
* @return {Array} Returns an array of expanded values.
* @api public
*/
braces$1.create = (input, options$1 = {}) => {
if (input === "" || input.length < 3) return [input];
return options$1.expand !== true ? braces$1.compile(input, options$1) : braces$1.expand(input, options$1);
};
/**
* Expose "braces"
*/
module.exports = braces$1;
} });
//#endregion
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
var require_constants$1 = __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports, module) {
const path$9 = __require("path");
const WIN_SLASH = "\\\\/";
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
/**
* Posix glob regex
*/
const DOT_LITERAL = "\\.";
const PLUS_LITERAL = "\\+";
const QMARK_LITERAL = "\\?";
const SLASH_LITERAL = "\\/";
const ONE_CHAR = "(?=.)";
const QMARK = "[^/]";
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
const NO_DOT = `(?!${DOT_LITERAL})`;
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
const STAR = `${QMARK}*?`;
const POSIX_CHARS = {
DOT_LITERAL,
PLUS_LITERAL,
QMARK_LITERAL,
SLASH_LITERAL,
ONE_CHAR,
QMARK,
END_ANCHOR,
DOTS_SLASH,
NO_DOT,
NO_DOTS,
NO_DOT_SLASH,
NO_DOTS_SLASH,
QMARK_NO_DOT,