UNPKG

storybook

Version:

Storybook: Develop, document, and test UI components in isolation

1,070 lines (1,049 loc) • 154 kB
import CJS_COMPAT_NODE_URL_yr66iw5gef from 'node:url'; import CJS_COMPAT_NODE_PATH_yr66iw5gef from 'node:path'; import CJS_COMPAT_NODE_MODULE_yr66iw5gef from "node:module"; var __filename = CJS_COMPAT_NODE_URL_yr66iw5gef.fileURLToPath(import.meta.url); var __dirname = CJS_COMPAT_NODE_PATH_yr66iw5gef.dirname(__filename); var require = CJS_COMPAT_NODE_MODULE_yr66iw5gef.createRequire(import.meta.url); // ------------------------------------------------------------ // end of CJS compatibility banner, injected by Storybook's esbuild configuration // ------------------------------------------------------------ import { require_picomatch, require_utils } from "./chunk-4X3VTYIW.js"; import { slash } from "./chunk-GVOXGNOU.js"; import { __commonJS, __require, __toESM } from "./chunk-J4VC4I2M.js"; // ../node_modules/fast-glob/out/utils/array.js var require_array = __commonJS({ "../node_modules/fast-glob/out/utils/array.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); exports.splitWhen = exports.flatten = void 0; function flatten(items) { return items.reduce((collection, item) => [].concat(collection, item), []); } exports.flatten = flatten; function splitWhen(items, predicate) { let result = [[]], groupIndex = 0; for (let item of items) predicate(item) ? (groupIndex++, result[groupIndex] = []) : result[groupIndex].push(item); return result; } exports.splitWhen = splitWhen; } }); // ../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: !0 }); exports.isEnoentCodeError = void 0; function isEnoentCodeError(error) { return error.code === "ENOENT"; } exports.isEnoentCodeError = isEnoentCodeError; } }); // ../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: !0 }); 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/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: !0 }); exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; var os = __require("os"), path2 = __require("path"), IS_WINDOWS_PLATFORM = os.platform() === "win32", LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2, POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g, WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g, DOS_DEVICE_PATH_RE = /^\\\\([.?])/, WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g; function unixify(filepath) { return filepath.replace(/\\/g, "/"); } exports.unixify = unixify; function makeAbsolute(cwd, filepath) { return path2.resolve(cwd, filepath); } exports.makeAbsolute = makeAbsolute; function removeLeadingDotSegment(entry) { if (entry.charAt(0) === ".") { let 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) { 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.convertPosixPathToPattern = convertPosixPathToPattern; } }); // ../node_modules/is-extglob/index.js var require_is_extglob = __commonJS({ "../node_modules/is-extglob/index.js"(exports, module) { module.exports = function(str) { if (typeof str != "string" || str === "") return !1; for (var match; match = /(\\).|([@?!+*]\(.*\))/g.exec(str); ) { if (match[2]) return !0; str = str.slice(match.index + match[0].length); } return !1; }; } }); // ../node_modules/is-glob/index.js var require_is_glob = __commonJS({ "../node_modules/is-glob/index.js"(exports, module) { var isExtglob = require_is_extglob(), chars = { "{": "}", "(": ")", "[": "]" }, strictCheck = function(str) { if (str[0] === "!") return !0; for (var index = 0, pipeIndex = -2, closeSquareIndex = -2, closeCurlyIndex = -2, closeParenIndex = -2, backSlashIndex = -2; index < str.length; ) { if (str[index] === "*" || str[index + 1] === "?" && /[\].+)]/.test(str[index]) || closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]" && (closeSquareIndex < index && (closeSquareIndex = str.indexOf("]", index)), closeSquareIndex > index && (backSlashIndex === -1 || backSlashIndex > closeSquareIndex || (backSlashIndex = str.indexOf("\\", index), backSlashIndex === -1 || backSlashIndex > closeSquareIndex))) || closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}" && (closeCurlyIndex = str.indexOf("}", index), closeCurlyIndex > index && (backSlashIndex = str.indexOf("\\", index), backSlashIndex === -1 || backSlashIndex > closeCurlyIndex)) || closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")" && (closeParenIndex = str.indexOf(")", index), closeParenIndex > index && (backSlashIndex = str.indexOf("\\", index), backSlashIndex === -1 || backSlashIndex > closeParenIndex)) || pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|" && (pipeIndex < index && (pipeIndex = str.indexOf("|", index)), pipeIndex !== -1 && str[pipeIndex + 1] !== ")" && (closeParenIndex = str.indexOf(")", pipeIndex), closeParenIndex > pipeIndex && (backSlashIndex = str.indexOf("\\", pipeIndex), backSlashIndex === -1 || backSlashIndex > closeParenIndex)))) return !0; if (str[index] === "\\") { var open = str[index + 1]; index += 2; var close = chars[open]; if (close) { var n = str.indexOf(close, index); n !== -1 && (index = n + 1); } if (str[index] === "!") return !0; } else index++; } return !1; }, relaxedCheck = function(str) { if (str[0] === "!") return !0; for (var index = 0; index < str.length; ) { if (/[*?{}()[\]]/.test(str[index])) return !0; if (str[index] === "\\") { var open = str[index + 1]; index += 2; var close = chars[open]; if (close) { var n = str.indexOf(close, index); n !== -1 && (index = n + 1); } if (str[index] === "!") return !0; } else index++; } return !1; }; module.exports = function(str, options) { if (typeof str != "string" || str === "") return !1; if (isExtglob(str)) return !0; var check = strictCheck; return options && options.strict === !1 && (check = relaxedCheck), check(str); }; } }); // ../node_modules/fast-glob/node_modules/glob-parent/index.js var require_glob_parent = __commonJS({ "../node_modules/fast-glob/node_modules/glob-parent/index.js"(exports, module) { "use strict"; var isGlob = require_is_glob(), pathPosixDirname = __require("path").posix.dirname, isWin32 = __require("os").platform() === "win32", slash2 = "/", backslash = /\\/g, enclosure = /[\{\[].*[\}\]]$/, globby2 = /(^|[^\\])([\{\[]|\([^\)]+$)/, escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; module.exports = function(str, opts) { var options = Object.assign({ flipBackslashes: !0 }, opts); options.flipBackslashes && isWin32 && str.indexOf(slash2) < 0 && (str = str.replace(backslash, slash2)), enclosure.test(str) && (str += slash2), str += "a"; do str = pathPosixDirname(str); while (isGlob(str) || globby2.test(str)); return str.replace(escaped, "$1"); }; } }); // ../node_modules/braces/lib/utils.js var require_utils2 = __commonJS({ "../node_modules/braces/lib/utils.js"(exports) { "use strict"; exports.isInteger = (num) => typeof num == "number" ? Number.isInteger(num) : typeof num == "string" && num.trim() !== "" ? Number.isInteger(Number(num)) : !1; exports.find = (node, type) => node.nodes.find((node2) => node2.type === type); exports.exceedsLimit = (min, max, step = 1, limit) => limit === !1 || !exports.isInteger(min) || !exports.isInteger(max) ? !1 : (Number(max) - Number(min)) / Number(step) >= limit; exports.escapeNode = (block, n = 0, type) => { let node = block.nodes[n]; node && (type && node.type === type || node.type === "open" || node.type === "close") && node.escaped !== !0 && (node.value = "\\" + node.value, node.escaped = !0); }; exports.encloseBrace = (node) => node.type !== "brace" ? !1 : node.commas >> 0 + node.ranges >> 0 === 0 ? (node.invalid = !0, !0) : !1; exports.isInvalidBrace = (block) => block.type !== "brace" ? !1 : block.invalid === !0 || block.dollar ? !0 : block.commas >> 0 + block.ranges >> 0 === 0 || block.open !== !0 || block.close !== !0 ? (block.invalid = !0, !0) : !1; exports.isOpenOrClose = (node) => node.type === "open" || node.type === "close" ? !0 : node.open === !0 || node.close === !0; exports.reduce = (nodes) => nodes.reduce((acc, node) => (node.type === "text" && acc.push(node.value), node.type === "range" && (node.type = "text"), acc), []); exports.flatten = (...args) => { let result = [], flat = (arr) => { for (let i = 0; i < arr.length; i++) { let ele = arr[i]; if (Array.isArray(ele)) { flat(ele); continue; } ele !== void 0 && result.push(ele); } return result; }; return flat(args), result; }; } }); // ../node_modules/braces/lib/stringify.js var require_stringify = __commonJS({ "../node_modules/braces/lib/stringify.js"(exports, module) { "use strict"; var utils = require_utils2(); module.exports = (ast, options = {}) => { let stringify = (node, parent = {}) => { let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent), invalidNode = node.invalid === !0 && options.escapeInvalid === !0, output = ""; if (node.value) return (invalidBlock || invalidNode) && utils.isOpenOrClose(node) ? "\\" + node.value : node.value; if (node.value) return node.value; if (node.nodes) for (let child of node.nodes) output += stringify(child); return output; }; return stringify(ast); }; } }); // ../node_modules/is-number/index.js var require_is_number = __commonJS({ "../node_modules/is-number/index.js"(exports, module) { "use strict"; module.exports = function(num) { return typeof num == "number" ? num - num === 0 : typeof num == "string" && num.trim() !== "" ? Number.isFinite ? Number.isFinite(+num) : isFinite(+num) : !1; }; } }); // ../node_modules/to-regex-range/index.js var require_to_regex_range = __commonJS({ "../node_modules/to-regex-range/index.js"(exports, module) { "use strict"; var isNumber = require_is_number(), toRegexRange = (min, max, options) => { if (isNumber(min) === !1) throw new TypeError("toRegexRange: expected the first argument to be a number"); if (max === void 0 || min === max) return String(min); if (isNumber(max) === !1) throw new TypeError("toRegexRange: expected the second argument to be a number."); let opts = { relaxZeros: !0, ...options }; typeof opts.strictZeros == "boolean" && (opts.relaxZeros = opts.strictZeros === !1); let relax = String(opts.relaxZeros), shorthand = String(opts.shorthand), capture = String(opts.capture), wrap = String(opts.wrap), cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap; if (toRegexRange.cache.hasOwnProperty(cacheKey)) return toRegexRange.cache[cacheKey].result; let a = Math.min(min, max), b = Math.max(min, max); if (Math.abs(a - b) === 1) { let result = min + "|" + max; return opts.capture ? `(${result})` : opts.wrap === !1 ? result : `(?:${result})`; } let isPadded = hasPadding(min) || hasPadding(max), state = { min, max, a, b }, positives = [], negatives = []; if (isPadded && (state.isPadded = isPadded, state.maxLen = String(state.max).length), a < 0) { let newMin = b < 0 ? Math.abs(b) : 1; negatives = splitToPatterns(newMin, Math.abs(a), state, opts), a = state.a = 0; } return b >= 0 && (positives = splitToPatterns(a, b, state, opts)), state.negatives = negatives, state.positives = positives, state.result = collatePatterns(negatives, positives, opts), opts.capture === !0 ? state.result = `(${state.result})` : opts.wrap !== !1 && positives.length + negatives.length > 1 && (state.result = `(?:${state.result})`), toRegexRange.cache[cacheKey] = state, state.result; }; function collatePatterns(neg, pos, options) { let onlyNegative = filterPatterns(neg, pos, "-", !1, options) || [], onlyPositive = filterPatterns(pos, neg, "", !1, options) || [], intersected = filterPatterns(neg, pos, "-?", !0, options) || []; return onlyNegative.concat(intersected).concat(onlyPositive).join("|"); } function splitToRanges(min, max) { let nines = 1, zeros = 1, stop = countNines(min, nines), stops = /* @__PURE__ */ new Set([max]); for (; min <= stop && stop <= max; ) stops.add(stop), nines += 1, stop = countNines(min, nines); for (stop = countZeros(max + 1, zeros) - 1; min < stop && stop <= max; ) stops.add(stop), zeros += 1, stop = countZeros(max + 1, zeros) - 1; return stops = [...stops], stops.sort(compare), stops; } function rangeToPattern(start, stop, options) { if (start === stop) return { pattern: start, count: [], digits: 0 }; let zipped = zip(start, stop), digits = zipped.length, pattern = "", count = 0; for (let i = 0; i < digits; i++) { let [startDigit, stopDigit] = zipped[i]; startDigit === stopDigit ? pattern += startDigit : startDigit !== "0" || stopDigit !== "9" ? pattern += toCharacterClass(startDigit, stopDigit, options) : count++; } return count && (pattern += options.shorthand === !0 ? "\\d" : "[0-9]"), { pattern, count: [count], digits }; } function splitToPatterns(min, max, tok, options) { let ranges = splitToRanges(min, max), tokens = [], start = min, prev; for (let i = 0; i < ranges.length; i++) { let max2 = ranges[i], obj = rangeToPattern(String(start), String(max2), options), zeros = ""; if (!tok.isPadded && prev && prev.pattern === obj.pattern) { prev.count.length > 1 && prev.count.pop(), prev.count.push(obj.count[0]), prev.string = prev.pattern + toQuantifier(prev.count), start = max2 + 1; continue; } tok.isPadded && (zeros = padZeros(max2, tok, options)), obj.string = zeros + obj.pattern + toQuantifier(obj.count), tokens.push(obj), start = max2 + 1, prev = obj; } return tokens; } function filterPatterns(arr, comparison, prefix, intersection, options) { let result = []; for (let ele of arr) { let { string } = ele; !intersection && !contains(comparison, "string", string) && result.push(prefix + string), intersection && contains(comparison, "string", string) && result.push(prefix + string); } return result; } 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) { return integer - integer % Math.pow(10, zeros); } function toQuantifier(digits) { let [start = 0, stop = ""] = digits; return stop || start > 1 ? `{${start + (stop ? "," + stop : "")}}` : ""; } function toCharacterClass(a, b, options) { return `[${a}${b - a === 1 ? "" : "-"}${b}]`; } function hasPadding(str) { return /^-?(0+)\d/.test(str); } function padZeros(value, tok, options) { if (!tok.isPadded) return value; let diff = Math.abs(tok.maxLen - String(value).length), relax = options.relaxZeros !== !1; 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}}`; } } toRegexRange.cache = {}; toRegexRange.clearCache = () => toRegexRange.cache = {}; module.exports = toRegexRange; } }); // ../node_modules/fill-range/index.js var require_fill_range = __commonJS({ "../node_modules/fill-range/index.js"(exports, module) { "use strict"; var util = __require("util"), toRegexRange = require_to_regex_range(), isObject = (val) => val !== null && typeof val == "object" && !Array.isArray(val), transform = (toNumber) => (value) => toNumber === !0 ? Number(value) : String(value), isValidValue = (value) => typeof value == "number" || typeof value == "string" && value !== "", isNumber = (num) => Number.isInteger(+num), zeros = (input) => { let value = `${input}`, index = -1; if (value[0] === "-" && (value = value.slice(1)), value === "0") return !1; for (; value[++index] === "0"; ) ; return index > 0; }, stringify = (start, end, options) => typeof start == "string" || typeof end == "string" ? !0 : options.stringify === !0, pad = (input, maxLength, toNumber) => { if (maxLength > 0) { let dash = input[0] === "-" ? "-" : ""; dash && (input = input.slice(1)), input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0"); } return toNumber === !1 ? String(input) : input; }, toMaxLen = (input, maxLength) => { let negative = input[0] === "-" ? "-" : ""; for (negative && (input = input.slice(1), maxLength--); input.length < maxLength; ) input = "0" + input; return negative ? "-" + input : input; }, toSequence = (parts, options, 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.capture ? "" : "?:", positives = "", negatives = "", result; return parts.positives.length && (positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|")), parts.negatives.length && (negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`), positives && negatives ? result = `${positives}|${negatives}` : result = positives || negatives, options.wrap ? `(${prefix}${result})` : result; }, toRange = (a, b, isNumbers, options) => { if (isNumbers) return toRegexRange(a, b, { wrap: !1, ...options }); let start = String.fromCharCode(a); if (a === b) return start; let stop = String.fromCharCode(b); return `[${start}-${stop}]`; }, toRegex = (start, end, options) => { if (Array.isArray(start)) { let wrap = options.wrap === !0, prefix = options.capture ? "" : "?:"; return wrap ? `(${prefix}${start.join("|")})` : start.join("|"); } return toRegexRange(start, end, options); }, rangeError = (...args) => new RangeError("Invalid range arguments: " + util.inspect(...args)), invalidRange = (start, end, options) => { if (options.strictRanges === !0) throw rangeError([start, end]); return []; }, invalidStep = (step, options) => { if (options.strictRanges === !0) throw new TypeError(`Expected step "${step}" to be a number`); return []; }, fillNumbers = (start, end, step = 1, options = {}) => { let a = Number(start), b = Number(end); if (!Number.isInteger(a) || !Number.isInteger(b)) { if (options.strictRanges === !0) throw rangeError([start, end]); return []; } a === 0 && (a = 0), b === 0 && (b = 0); let descending = a > b, startString = String(start), endString = String(end), stepString = String(step); step = Math.max(Math.abs(step), 1); let padded = zeros(startString) || zeros(endString) || zeros(stepString), maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0, toNumber = padded === !1 && stringify(start, end, options) === !1, format = options.transform || transform(toNumber); if (options.toRegex && step === 1) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), !0, options); let parts = { negatives: [], positives: [] }, push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)), range = [], index = 0; for (; descending ? a >= b : a <= b; ) options.toRegex === !0 && step > 1 ? push(a) : range.push(pad(format(a, index), maxLen, toNumber)), a = descending ? a - step : a + step, index++; return options.toRegex === !0 ? step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: !1, ...options }) : range; }, fillLetters = (start, end, step = 1, options = {}) => { if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options); let format = options.transform || ((val) => String.fromCharCode(val)), a = `${start}`.charCodeAt(0), b = `${end}`.charCodeAt(0), descending = a > b, min = Math.min(a, b), max = Math.max(a, b); if (options.toRegex && step === 1) return toRange(min, max, !1, options); let range = [], index = 0; for (; descending ? a >= b : a <= b; ) range.push(format(a, index)), a = descending ? a - step : a + step, index++; return options.toRegex === !0 ? toRegex(range, null, { wrap: !1, options }) : range; }, fill = (start, end, step, options = {}) => { if (end == null && isValidValue(start)) return [start]; if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options); if (typeof step == "function") return fill(start, end, 1, { transform: step }); if (isObject(step)) return fill(start, end, 0, step); let opts = { ...options }; return opts.capture === !0 && (opts.wrap = !0), step = step || opts.step || 1, isNumber(step) ? isNumber(start) && isNumber(end) ? fillNumbers(start, end, step, opts) : fillLetters(start, end, Math.max(Math.abs(step), 1), opts) : step != null && !isObject(step) ? invalidStep(step, opts) : fill(start, end, 1, step); }; module.exports = fill; } }); // ../node_modules/braces/lib/compile.js var require_compile = __commonJS({ "../node_modules/braces/lib/compile.js"(exports, module) { "use strict"; var fill = require_fill_range(), utils = require_utils2(), compile = (ast, options = {}) => { let walk = (node, parent = {}) => { let invalidBlock = utils.isInvalidBrace(parent), invalidNode = node.invalid === !0 && options.escapeInvalid === !0, invalid = invalidBlock === !0 || invalidNode === !0, prefix = options.escapeInvalid === !0 ? "\\" : "", output = ""; if (node.isOpen === !0) return prefix + node.value; if (node.isClose === !0) return console.log("node.isClose", prefix, node.value), 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) { let args = utils.reduce(node.nodes), range = fill(...args, { ...options, wrap: !1, toRegex: !0, strictZeros: !0 }); if (range.length !== 0) return args.length > 1 && range.length > 1 ? `(${range})` : range; } if (node.nodes) for (let child of node.nodes) output += walk(child, node); return output; }; return walk(ast); }; module.exports = compile; } }); // ../node_modules/braces/lib/expand.js var require_expand = __commonJS({ "../node_modules/braces/lib/expand.js"(exports, module) { "use strict"; var fill = require_fill_range(), stringify = require_stringify(), utils = require_utils2(), append = (queue = "", stash = "", enclose = !1) => { let result = []; if (queue = [].concat(queue), stash = [].concat(stash), !stash.length) return queue; if (!queue.length) return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash; for (let item of queue) if (Array.isArray(item)) for (let value of item) result.push(append(value, stash, enclose)); else for (let ele of stash) enclose === !0 && typeof ele == "string" && (ele = `{${ele}}`), result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); return utils.flatten(result); }, expand = (ast, options = {}) => { let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit, walk = (node, parent = {}) => { node.queue = []; let p = parent, q = parent.queue; for (; 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(node, options))); return; } if (node.type === "brace" && node.invalid !== !0 && node.nodes.length === 2) { q.push(append(q.pop(), ["{}"])); return; } if (node.nodes && node.ranges > 0) { let args = utils.reduce(node.nodes); if (utils.exceedsLimit(...args, options.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); range.length === 0 && (range = stringify(node, options)), q.push(append(q.pop(), range)), node.nodes = []; return; } let enclose = utils.encloseBrace(node), queue = node.queue, block = node; for (; block.type !== "brace" && block.type !== "root" && block.parent; ) block = block.parent, queue = block.queue; for (let i = 0; i < node.nodes.length; i++) { let child = node.nodes[i]; if (child.type === "comma" && node.type === "brace") { 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; } child.nodes && walk(child, node); } return queue; }; return utils.flatten(walk(ast)); }; module.exports = expand; } }); // ../node_modules/braces/lib/constants.js var require_constants = __commonJS({ "../node_modules/braces/lib/constants.js"(exports, module) { "use strict"; module.exports = { MAX_LENGTH: 1e4, // Digits CHAR_0: "0", /* 0 */ CHAR_9: "9", /* 9 */ // Alphabet chars. CHAR_UPPERCASE_A: "A", /* A */ CHAR_LOWERCASE_A: "a", /* a */ CHAR_UPPERCASE_Z: "Z", /* Z */ CHAR_LOWERCASE_Z: "z", /* z */ CHAR_LEFT_PARENTHESES: "(", /* ( */ CHAR_RIGHT_PARENTHESES: ")", /* ) */ CHAR_ASTERISK: "*", /* * */ // Non-alphabetic chars. CHAR_AMPERSAND: "&", /* & */ CHAR_AT: "@", /* @ */ CHAR_BACKSLASH: "\\", /* \ */ CHAR_BACKTICK: "`", /* ` */ CHAR_CARRIAGE_RETURN: "\r", /* \r */ CHAR_CIRCUMFLEX_ACCENT: "^", /* ^ */ CHAR_COLON: ":", /* : */ CHAR_COMMA: ",", /* , */ CHAR_DOLLAR: "$", /* . */ CHAR_DOT: ".", /* . */ CHAR_DOUBLE_QUOTE: '"', /* " */ CHAR_EQUAL: "=", /* = */ CHAR_EXCLAMATION_MARK: "!", /* ! */ CHAR_FORM_FEED: "\f", /* \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", /* \u00A0 */ 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: " ", /* \t */ CHAR_UNDERSCORE: "_", /* _ */ CHAR_VERTICAL_LINE: "|", /* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF" /* \uFEFF */ }; } }); // ../node_modules/braces/lib/parse.js var require_parse = __commonJS({ "../node_modules/braces/lib/parse.js"(exports, module) { "use strict"; var stringify = require_stringify(), { MAX_LENGTH, CHAR_BACKSLASH, /* \ */ CHAR_BACKTICK, /* ` */ CHAR_COMMA, /* , */ CHAR_DOT, /* . */ CHAR_LEFT_PARENTHESES, /* ( */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_LEFT_CURLY_BRACE, /* { */ CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_LEFT_SQUARE_BRACKET, /* [ */ CHAR_RIGHT_SQUARE_BRACKET, /* ] */ CHAR_DOUBLE_QUOTE, /* " */ CHAR_SINGLE_QUOTE, /* ' */ CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants(), parse = (input, options = {}) => { if (typeof input != "string") throw new TypeError("Expected a string"); let opts = options || {}, 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 ast = { type: "root", input, nodes: [] }, stack = [ast], block = ast, prev = ast, brackets = 0, length = input.length, index = 0, depth = 0, value, advance = () => input[index++], push = (node) => { if (node.type === "text" && prev.type === "dot" && (prev.type = "text"), prev && prev.type === "text" && node.type === "text") { prev.value += node.value; return; } return block.nodes.push(node), node.parent = block, node.prev = prev, prev = node, node; }; for (push({ type: "bos" }); index < length; ) if (block = stack[stack.length - 1], value = advance(), !(value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE)) { if (value === CHAR_BACKSLASH) { push({ type: "text", value: (options.keepEscaping ? value : "") + advance() }); continue; } if (value === CHAR_RIGHT_SQUARE_BRACKET) { push({ type: "text", value: "\\" + value }); continue; } if (value === CHAR_LEFT_SQUARE_BRACKET) { brackets++; let next; for (; index < length && (next = advance()); ) { if (value += next, next === CHAR_LEFT_SQUARE_BRACKET) { brackets++; continue; } if (next === CHAR_BACKSLASH) { value += advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET && (brackets--, brackets === 0)) break; } push({ type: "text", value }); continue; } if (value === CHAR_LEFT_PARENTHESES) { block = push({ type: "paren", nodes: [] }), stack.push(block), push({ type: "text", value }); continue; } if (value === CHAR_RIGHT_PARENTHESES) { if (block.type !== "paren") { push({ type: "text", value }); continue; } block = stack.pop(), push({ type: "text", value }), block = stack[stack.length - 1]; continue; } if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { let open = value, next; for (options.keepQuotes !== !0 && (value = ""); index < length && (next = advance()); ) { if (next === CHAR_BACKSLASH) { value += next + advance(); continue; } if (next === open) { options.keepQuotes === !0 && (value += next); break; } value += next; } push({ type: "text", value }); continue; } if (value === CHAR_LEFT_CURLY_BRACE) { depth++; let brace = { type: "brace", open: !0, close: !1, dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === !0, depth, commas: 0, ranges: 0, nodes: [] }; block = push(brace), stack.push(block), push({ type: "open", value }); continue; } if (value === CHAR_RIGHT_CURLY_BRACE) { if (block.type !== "brace") { push({ type: "text", value }); continue; } let type = "close"; block = stack.pop(), block.close = !0, push({ type, value }), depth--, block = stack[stack.length - 1]; continue; } if (value === CHAR_COMMA && depth > 0) { if (block.ranges > 0) { block.ranges = 0; let open = block.nodes.shift(); block.nodes = [open, { type: "text", value: stringify(block) }]; } push({ type: "comma", value }), block.commas++; continue; } if (value === CHAR_DOT && depth > 0 && block.commas === 0) { let siblings = block.nodes; if (depth === 0 || siblings.length === 0) { push({ type: "text", value }); continue; } if (prev.type === "dot") { if (block.range = [], prev.value += value, prev.type = "range", block.nodes.length !== 3 && block.nodes.length !== 5) { block.invalid = !0, block.ranges = 0, prev.type = "text"; continue; } block.ranges++, block.args = []; continue; } if (prev.type === "range") { siblings.pop(); let before = siblings[siblings.length - 1]; before.value += prev.value + value, prev = before, block.ranges--; continue; } push({ type: "dot", value }); continue; } push({ type: "text", value }); } do if (block = stack.pop(), block.type !== "root") { block.nodes.forEach((node) => { node.nodes || (node.type === "open" && (node.isOpen = !0), node.type === "close" && (node.isClose = !0), node.nodes || (node.type = "text"), node.invalid = !0); }); let parent = stack[stack.length - 1], index2 = parent.nodes.indexOf(block); parent.nodes.splice(index2, 1, ...block.nodes); } while (stack.length > 0); return push({ type: "eos" }), ast; }; module.exports = parse; } }); // ../node_modules/braces/index.js var require_braces = __commonJS({ "../node_modules/braces/index.js"(exports, module) { "use strict"; var stringify = require_stringify(), compile = require_compile(), expand = require_expand(), parse = require_parse(), braces = (input, options = {}) => { let output = []; if (Array.isArray(input)) for (let pattern of input) { let result = braces.create(pattern, options); Array.isArray(result) ? output.push(...result) : output.push(result); } else output = [].concat(braces.create(input, options)); return options && options.expand === !0 && options.nodupes === !0 && (output = [...new Set(output)]), output; }; braces.parse = (input, options = {}) => parse(input, options); braces.stringify = (input, options = {}) => stringify(typeof input == "string" ? braces.parse(input, options) : input, options); braces.compile = (input, options = {}) => (typeof input == "string" && (input = braces.parse(input, options)), compile(input, options)); braces.expand = (input, options = {}) => { typeof input == "string" && (input = braces.parse(input, options)); let result = expand(input, options); return options.noempty === !0 && (result = result.filter(Boolean)), options.nodupes === !0 && (result = [...new Set(result)]), result; }; braces.create = (input, options = {}) => input === "" || input.length < 3 ? [input] : options.expand !== !0 ? braces.compile(input, options) : braces.expand(input, options); module.exports = braces; } }); // ../node_modules/micromatch/index.js var require_micromatch = __commonJS({ "../node_modules/micromatch/index.js"(exports, module) { "use strict"; var util = __require("util"), braces = require_braces(), picomatch = require_picomatch(), utils = require_utils(), isEmptyString = (v) => v === "" || v === "./", hasBraces = (v) => { let index = v.indexOf("{"); return index > -1 && v.indexOf("}", index) > -1; }, micromatch = (list, patterns, options) => { patterns = [].concat(patterns), list = [].concat(list); let omit = /* @__PURE__ */ new Set(), keep = /* @__PURE__ */ new Set(), items = /* @__PURE__ */ new Set(), negatives = 0, onResult = (state) => { items.add(state.output), options && options.onResult && options.onResult(state); }; for (let i = 0; i < patterns.length; i++) { let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, !0), negated = isMatch.state.negated || isMatch.state.negatedExtglob; negated && negatives++; for (let item of list) { let matched = isMatch(item, !0); (negated ? !matched.isMatch : matched.isMatch) && (negated ? omit.add(matched.output) : (omit.delete(matched.output), keep.add(matched.output))); } } let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item)); if (options && matches.length === 0) { if (options.failglob === !0) throw new Error(`No matches found for "${patterns.join(", ")}"`); if (options.nonull === !0 || options.nullglob === !0) return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns; } return matches; }; micromatch.match = micromatch; micromatch.matcher = (pattern, options) => picomatch(pattern, options); micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); micromatch.any = micromatch.isMatch; micromatch.not = (list, patterns, options = {}) => { patterns = [].concat(patterns).map(String); let result = /* @__PURE__ */ new Set(), items = [], onResult = (state) => { options.onResult && options.onResult(state), items.push(state.output); }, matches = new Set(micromatch(list, patterns, { ...options, onResult })); for (let item of items) matches.has(item) || result.add(item); return [...result]; }; micromatch.contains = (str, pattern, options) => { if (typeof str != "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`); if (Array.isArray(pattern)) return pattern.some((p) => micromatch.contains(str, p, options)); if (typeof pattern == "string") { if (isEmptyString(str) || isEmptyString(pattern)) return !1; if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) return !0; } return micromatch.isMatch(str, pattern, { ...options, contains: !0 }); }; micromatch.matchKeys = (obj, patterns, options) => { if (!utils.isObject(obj)) throw new TypeError("Expected the first argument to be an object"); let keys = micromatch(Object.keys(obj), patterns, options), res = {}; for (let key of keys) res[key] = obj[key]; return res; }; micromatch.some = (list, patterns, options) => { let items = [].concat(list); for (let pattern of [].concat(patterns)) { let isMatch = picomatch(String(pattern), options); if (items.some((item) => isMatch(item))) return !0; } return !1; }; micromatch.every = (list, patterns, options) => { let items = [].concat(list); for (let pattern of [].concat(patterns)) { let isMatch = picomatch(String(pattern), options); if (!items.every((item) => isMatch(item))) return !1; } return !0; }; micromatch.all = (str, patterns, options) => { if (typeof str != "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`); return [].concat(patterns).every((p) => picomatch(p, options)(str)); }; micromatch.capture = (glob, input, options) => { let posix = utils.isWindows(options), match = picomatch.makeRe(String(glob), { ...options, capture: !0 }).exec(posix ? utils.toPosixSlashes(input) : input); if (match) return match.slice(1).map((v) => v === void 0 ? "" : v); }; micromatch.makeRe = (...args) => picomatch.makeRe(...args); micromatch.scan = (...args) => picomatch.scan(...args); micromatch.parse = (patterns, options) => { let res = []; for (let pattern of [].concat(patterns || [])) for (let str of braces(String(pattern), options)) res.push(picomatch.parse(str, options)); return res; }; micromatch.braces = (pattern, options) => { if (typeof pattern != "string") throw new TypeError("Expected a string"); return options && options.nobrace === !0 || !hasBraces(pattern) ? [pattern] : braces(pattern, options); }; micromatch.braceExpand = (pattern, options) => { if (typeof pattern != "string") throw new TypeError("Expected a string"); return micromatch.braces(pattern, { ...options, expand: !0 }); }; micromatch.hasBraces = hasBraces; module.exports = micromatch; } }); // ../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: !0 }); exports.isAbsolute = exports.partitionAbsoluteAndRelative = 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 path2 = __require("path"), globParent = require_glob_parent(), micromatch = require_micromatch(), GLOBSTAR = "**", ESCAPE_SYMBOL = "\\", COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/, REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/, REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/, GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/, BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./, DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; function isStaticPattern(pattern, options = {}) { return !isDynamicPattern2(pattern, options); } exports.isStaticPattern = isStaticPattern; function isDynamicPattern2(pattern, options = {}) { return pattern === "" ? !1 : !!(options.caseSensitiveMatch === !1 || pattern.includes(ESCAPE_SYMBOL) || COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern) || options.extglob !== !1 && GLOB_EXTENSION_SYMBOLS_RE.test(pattern) || options.braceExpansion !== !1 && hasBraceExpansion(pattern)); } exports.isDynamicPattern = isDynamicPattern2; function hasBraceExpansion(pattern) { let openingBraceIndex = pattern.indexOf("{"); if (openingBraceIndex === -1) return !1; let closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1); if (closingBraceIndex === -1) return !1; let braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); } function convertToPositivePattern(pattern) { return isNegativePattern2(pattern) ? pattern.slice(1) : pattern; } exports.convertToPositivePattern = convertToPositivePattern; function convertToNegativePattern(pattern) { return "!" + pattern; } exports.convertToNegativePattern = convertToNegativePattern; function isNegativePattern2(pattern) { return pattern.startsWith("!") && pattern[1] !== "("; } exports.isNegativePattern = isNegativePattern2; function isPositivePattern(pattern) { return !isNegativePattern2(pattern); } exports.isPositivePattern = isPositivePattern; function getNegativePatterns(patterns) { return patterns.filter(isNegativePattern2); } exports.getNegativePatterns = getNegativePatterns; function getPositivePatterns(patterns) { return patterns.filter(isPositivePattern); } exports.getPositivePatterns = getPositivePatterns; function getPatternsInsideCurrentDirectory(patterns) { return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); } exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; function getPatternsOutsideCurrentDirectory(patterns) { return patterns.filter(isPatternRelatedToParentDirectory); } exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; function isPatternRelatedToParentDirectory(pattern) { return pattern.startsWith("..") || pattern.startsWith("./.."); } exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; function getBaseDirectory(pattern) { return globParent(pattern, { flipBackslashes: !1 }); } exports.getBaseDirectory = getBaseDirectory; function hasGlobStar(pattern) { return pattern.includes(GLOBSTAR); } exports.hasGlobStar = hasGlobStar; function endsWithSlashGlobStar(pattern) { return pattern.endsWith("/" + GLOBSTAR); } exports.endsWithSlashGlobStar = endsWithSlashGlobStar; function isAffectDepthOfReadingPattern(pattern) { let basename = path2.basename(pattern); return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); } exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; function expandPatternsWithBraceExpansion(patterns) { return patterns.reduce((collection, pattern) => collection.concat(expandBraceExpansion(pattern)), []