市场夺宝奇兵
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6833 lines
227 KiB

  1. import { createRequire } from "node:module";
  2. import fs from "node:fs";
  3. import path, { dirname, resolve } from "node:path";
  4. import { fileURLToPath } from "node:url";
  5. import { createViteServerRpc } from "@vue/devtools-core";
  6. import { getViteRpcServer, setViteServerContext } from "@vue/devtools-kit";
  7. import sirv from "sirv";
  8. import { normalizePath } from "vite";
  9. import Inspect from "vite-plugin-inspect";
  10. import VueInspector from "vite-plugin-vue-inspector";
  11. import fsp from "node:fs/promises";
  12. //#region rolldown:runtime
  13. var __create = Object.create;
  14. var __defProp = Object.defineProperty;
  15. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  16. var __getOwnPropNames = Object.getOwnPropertyNames;
  17. var __getProtoOf = Object.getPrototypeOf;
  18. var __hasOwnProp = Object.prototype.hasOwnProperty;
  19. var __commonJS = (cb, mod) => function() {
  20. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  21. };
  22. var __copyProps = (to, from, except, desc) => {
  23. if (from && typeof from === "object" || typeof from === "function") for (var keys$1 = __getOwnPropNames(from), i = 0, n = keys$1.length, key; i < n; i++) {
  24. key = keys$1[i];
  25. if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
  26. get: ((k) => from[k]).bind(null, key),
  27. enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
  28. });
  29. }
  30. return to;
  31. };
  32. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
  33. value: mod,
  34. enumerable: true
  35. }) : target, mod));
  36. var __require = /* @__PURE__ */ createRequire(import.meta.url);
  37. //#endregion
  38. //#region ../../node_modules/.pnpm/kolorist@1.8.0/node_modules/kolorist/dist/esm/index.mjs
  39. let enabled = true;
  40. const globalVar = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
  41. /**
  42. * Detect how much colors the current terminal supports
  43. */
  44. let supportLevel = 0;
  45. if (globalVar.process && globalVar.process.env && globalVar.process.stdout) {
  46. const { FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, COLORTERM } = globalVar.process.env;
  47. if (NODE_DISABLE_COLORS || NO_COLOR || FORCE_COLOR === "0") enabled = false;
  48. else if (FORCE_COLOR === "1" || FORCE_COLOR === "2" || FORCE_COLOR === "3") enabled = true;
  49. else if (TERM === "dumb") enabled = false;
  50. else if ("CI" in globalVar.process.env && [
  51. "TRAVIS",
  52. "CIRCLECI",
  53. "APPVEYOR",
  54. "GITLAB_CI",
  55. "GITHUB_ACTIONS",
  56. "BUILDKITE",
  57. "DRONE"
  58. ].some((vendor) => vendor in globalVar.process.env)) enabled = true;
  59. else enabled = process.stdout.isTTY;
  60. if (enabled) if (process.platform === "win32") supportLevel = 3;
  61. else if (COLORTERM && (COLORTERM === "truecolor" || COLORTERM === "24bit")) supportLevel = 3;
  62. else if (TERM && (TERM.endsWith("-256color") || TERM.endsWith("256"))) supportLevel = 2;
  63. else supportLevel = 1;
  64. }
  65. let options = {
  66. enabled,
  67. supportLevel
  68. };
  69. function kolorist(start, end, level = 1) {
  70. const open = `\x1b[${start}m`;
  71. const close = `\x1b[${end}m`;
  72. const regex = new RegExp(`\\x1b\\[${end}m`, "g");
  73. return (str) => {
  74. return options.enabled && options.supportLevel >= level ? open + ("" + str).replace(regex, open) + close : "" + str;
  75. };
  76. }
  77. const reset = kolorist(0, 0);
  78. const bold = kolorist(1, 22);
  79. const dim = kolorist(2, 22);
  80. const italic = kolorist(3, 23);
  81. const underline = kolorist(4, 24);
  82. const inverse = kolorist(7, 27);
  83. const hidden = kolorist(8, 28);
  84. const strikethrough = kolorist(9, 29);
  85. const black = kolorist(30, 39);
  86. const red = kolorist(31, 39);
  87. const green = kolorist(32, 39);
  88. const yellow = kolorist(33, 39);
  89. const blue = kolorist(34, 39);
  90. const magenta = kolorist(35, 39);
  91. const cyan = kolorist(36, 39);
  92. const white = kolorist(97, 39);
  93. const gray = kolorist(90, 39);
  94. const lightGray = kolorist(37, 39);
  95. const lightRed = kolorist(91, 39);
  96. const lightGreen = kolorist(92, 39);
  97. const lightYellow = kolorist(93, 39);
  98. const lightBlue = kolorist(94, 39);
  99. const lightMagenta = kolorist(95, 39);
  100. const lightCyan = kolorist(96, 39);
  101. const bgBlack = kolorist(40, 49);
  102. const bgRed = kolorist(41, 49);
  103. const bgGreen = kolorist(42, 49);
  104. const bgYellow = kolorist(43, 49);
  105. const bgBlue = kolorist(44, 49);
  106. const bgMagenta = kolorist(45, 49);
  107. const bgCyan = kolorist(46, 49);
  108. const bgWhite = kolorist(107, 49);
  109. const bgGray = kolorist(100, 49);
  110. const bgLightRed = kolorist(101, 49);
  111. const bgLightGreen = kolorist(102, 49);
  112. const bgLightYellow = kolorist(103, 49);
  113. const bgLightBlue = kolorist(104, 49);
  114. const bgLightMagenta = kolorist(105, 49);
  115. const bgLightCyan = kolorist(106, 49);
  116. const bgLightGray = kolorist(47, 49);
  117. //#endregion
  118. //#region src/dir.ts
  119. const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
  120. const DIR_CLIENT = resolve(DIR_DIST, "../client");
  121. //#endregion
  122. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
  123. var require_array = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js": ((exports) => {
  124. Object.defineProperty(exports, "__esModule", { value: true });
  125. function flatten(items) {
  126. return items.reduce((collection, item) => [].concat(collection, item), []);
  127. }
  128. exports.flatten = flatten;
  129. function splitWhen(items, predicate) {
  130. const result = [[]];
  131. let groupIndex = 0;
  132. for (const item of items) if (predicate(item)) {
  133. groupIndex++;
  134. result[groupIndex] = [];
  135. } else result[groupIndex].push(item);
  136. return result;
  137. }
  138. exports.splitWhen = splitWhen;
  139. }) });
  140. //#endregion
  141. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js
  142. var require_errno = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js": ((exports) => {
  143. Object.defineProperty(exports, "__esModule", { value: true });
  144. function isEnoentCodeError(error) {
  145. return error.code === "ENOENT";
  146. }
  147. exports.isEnoentCodeError = isEnoentCodeError;
  148. }) });
  149. //#endregion
  150. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js
  151. var require_fs$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js": ((exports) => {
  152. Object.defineProperty(exports, "__esModule", { value: true });
  153. var DirentFromStats$1 = class {
  154. constructor(name, stats) {
  155. this.name = name;
  156. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  157. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  158. this.isDirectory = stats.isDirectory.bind(stats);
  159. this.isFIFO = stats.isFIFO.bind(stats);
  160. this.isFile = stats.isFile.bind(stats);
  161. this.isSocket = stats.isSocket.bind(stats);
  162. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  163. }
  164. };
  165. function createDirentFromStats$1(name, stats) {
  166. return new DirentFromStats$1(name, stats);
  167. }
  168. exports.createDirentFromStats = createDirentFromStats$1;
  169. }) });
  170. //#endregion
  171. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js
  172. var require_path = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js": ((exports) => {
  173. Object.defineProperty(exports, "__esModule", { value: true });
  174. const os$1 = __require("os");
  175. const path$10 = __require("path");
  176. const IS_WINDOWS_PLATFORM = os$1.platform() === "win32";
  177. const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
  178. /**
  179. * All non-escaped special characters.
  180. * Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters.
  181. * Windows: (){}[], !+@ before (, ! at the beginning.
  182. */
  183. const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
  184. const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
  185. /**
  186. * The device path (\\.\ or \\?\).
  187. * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths
  188. */
  189. const DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
  190. /**
  191. * All backslashes except those escaping special characters.
  192. * Windows: !()+@{}
  193. * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
  194. */
  195. const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
  196. /**
  197. * Designed to work only with simple paths: `dir\\file`.
  198. */
  199. function unixify(filepath) {
  200. return filepath.replace(/\\/g, "/");
  201. }
  202. exports.unixify = unixify;
  203. function makeAbsolute(cwd$1, filepath) {
  204. return path$10.resolve(cwd$1, filepath);
  205. }
  206. exports.makeAbsolute = makeAbsolute;
  207. function removeLeadingDotSegment(entry) {
  208. if (entry.charAt(0) === ".") {
  209. const secondCharactery = entry.charAt(1);
  210. if (secondCharactery === "/" || secondCharactery === "\\") return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
  211. }
  212. return entry;
  213. }
  214. exports.removeLeadingDotSegment = removeLeadingDotSegment;
  215. exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
  216. function escapeWindowsPath(pattern$1) {
  217. return pattern$1.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
  218. }
  219. exports.escapeWindowsPath = escapeWindowsPath;
  220. function escapePosixPath(pattern$1) {
  221. return pattern$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
  222. }
  223. exports.escapePosixPath = escapePosixPath;
  224. exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
  225. function convertWindowsPathToPattern(filepath) {
  226. return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/");
  227. }
  228. exports.convertWindowsPathToPattern = convertWindowsPathToPattern;
  229. function convertPosixPathToPattern(filepath) {
  230. return escapePosixPath(filepath);
  231. }
  232. exports.convertPosixPathToPattern = convertPosixPathToPattern;
  233. }) });
  234. //#endregion
  235. //#region ../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js
  236. var require_is_extglob = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js": ((exports, module) => {
  237. /*!
  238. * is-extglob <https://github.com/jonschlinkert/is-extglob>
  239. *
  240. * Copyright (c) 2014-2016, Jon Schlinkert.
  241. * Licensed under the MIT License.
  242. */
  243. module.exports = function isExtglob$1(str) {
  244. if (typeof str !== "string" || str === "") return false;
  245. var match;
  246. while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
  247. if (match[2]) return true;
  248. str = str.slice(match.index + match[0].length);
  249. }
  250. return false;
  251. };
  252. }) });
  253. //#endregion
  254. //#region ../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js
  255. var require_is_glob = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js": ((exports, module) => {
  256. /*!
  257. * is-glob <https://github.com/jonschlinkert/is-glob>
  258. *
  259. * Copyright (c) 2014-2017, Jon Schlinkert.
  260. * Released under the MIT License.
  261. */
  262. var isExtglob = require_is_extglob();
  263. var chars = {
  264. "{": "}",
  265. "(": ")",
  266. "[": "]"
  267. };
  268. var strictCheck = function(str) {
  269. if (str[0] === "!") return true;
  270. var index = 0;
  271. var pipeIndex = -2;
  272. var closeSquareIndex = -2;
  273. var closeCurlyIndex = -2;
  274. var closeParenIndex = -2;
  275. var backSlashIndex = -2;
  276. while (index < str.length) {
  277. if (str[index] === "*") return true;
  278. if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) return true;
  279. if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
  280. if (closeSquareIndex < index) closeSquareIndex = str.indexOf("]", index);
  281. if (closeSquareIndex > index) {
  282. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) return true;
  283. backSlashIndex = str.indexOf("\\", index);
  284. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) return true;
  285. }
  286. }
  287. if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
  288. closeCurlyIndex = str.indexOf("}", index);
  289. if (closeCurlyIndex > index) {
  290. backSlashIndex = str.indexOf("\\", index);
  291. if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) return true;
  292. }
  293. }
  294. if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
  295. closeParenIndex = str.indexOf(")", index);
  296. if (closeParenIndex > index) {
  297. backSlashIndex = str.indexOf("\\", index);
  298. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) return true;
  299. }
  300. }
  301. if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
  302. if (pipeIndex < index) pipeIndex = str.indexOf("|", index);
  303. if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
  304. closeParenIndex = str.indexOf(")", pipeIndex);
  305. if (closeParenIndex > pipeIndex) {
  306. backSlashIndex = str.indexOf("\\", pipeIndex);
  307. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) return true;
  308. }
  309. }
  310. }
  311. if (str[index] === "\\") {
  312. var open = str[index + 1];
  313. index += 2;
  314. var close = chars[open];
  315. if (close) {
  316. var n = str.indexOf(close, index);
  317. if (n !== -1) index = n + 1;
  318. }
  319. if (str[index] === "!") return true;
  320. } else index++;
  321. }
  322. return false;
  323. };
  324. var relaxedCheck = function(str) {
  325. if (str[0] === "!") return true;
  326. var index = 0;
  327. while (index < str.length) {
  328. if (/[*?{}()[\]]/.test(str[index])) return true;
  329. if (str[index] === "\\") {
  330. var open = str[index + 1];
  331. index += 2;
  332. var close = chars[open];
  333. if (close) {
  334. var n = str.indexOf(close, index);
  335. if (n !== -1) index = n + 1;
  336. }
  337. if (str[index] === "!") return true;
  338. } else index++;
  339. }
  340. return false;
  341. };
  342. module.exports = function isGlob$1(str, options$1) {
  343. if (typeof str !== "string" || str === "") return false;
  344. if (isExtglob(str)) return true;
  345. var check = strictCheck;
  346. if (options$1 && options$1.strict === false) check = relaxedCheck;
  347. return check(str);
  348. };
  349. }) });
  350. //#endregion
  351. //#region ../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js
  352. var require_glob_parent = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js": ((exports, module) => {
  353. var isGlob = require_is_glob();
  354. var pathPosixDirname = __require("path").posix.dirname;
  355. var isWin32 = __require("os").platform() === "win32";
  356. var slash = "/";
  357. var backslash = /\\/g;
  358. var enclosure = /[\{\[].*[\}\]]$/;
  359. var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
  360. var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
  361. /**
  362. * @param {string} str
  363. * @param {Object} opts
  364. * @param {boolean} [opts.flipBackslashes=true]
  365. * @returns {string}
  366. */
  367. module.exports = function globParent$1(str, opts) {
  368. if (Object.assign({ flipBackslashes: true }, opts).flipBackslashes && isWin32 && str.indexOf(slash) < 0) str = str.replace(backslash, slash);
  369. if (enclosure.test(str)) str += slash;
  370. str += "a";
  371. do
  372. str = pathPosixDirname(str);
  373. while (isGlob(str) || globby.test(str));
  374. return str.replace(escaped, "$1");
  375. };
  376. }) });
  377. //#endregion
  378. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
  379. var require_utils$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js": ((exports) => {
  380. exports.isInteger = (num) => {
  381. if (typeof num === "number") return Number.isInteger(num);
  382. if (typeof num === "string" && num.trim() !== "") return Number.isInteger(Number(num));
  383. return false;
  384. };
  385. /**
  386. * Find a node of the given type
  387. */
  388. exports.find = (node, type) => node.nodes.find((node$1) => node$1.type === type);
  389. /**
  390. * Find a node of the given type
  391. */
  392. exports.exceedsLimit = (min, max, step = 1, limit) => {
  393. if (limit === false) return false;
  394. if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
  395. return (Number(max) - Number(min)) / Number(step) >= limit;
  396. };
  397. /**
  398. * Escape the given node with '\\' before node.value
  399. */
  400. exports.escapeNode = (block, n = 0, type) => {
  401. const node = block.nodes[n];
  402. if (!node) return;
  403. if (type && node.type === type || node.type === "open" || node.type === "close") {
  404. if (node.escaped !== true) {
  405. node.value = "\\" + node.value;
  406. node.escaped = true;
  407. }
  408. }
  409. };
  410. /**
  411. * Returns true if the given brace node should be enclosed in literal braces
  412. */
  413. exports.encloseBrace = (node) => {
  414. if (node.type !== "brace") return false;
  415. if (node.commas >> 0 + node.ranges >> 0 === 0) {
  416. node.invalid = true;
  417. return true;
  418. }
  419. return false;
  420. };
  421. /**
  422. * Returns true if a brace node is invalid.
  423. */
  424. exports.isInvalidBrace = (block) => {
  425. if (block.type !== "brace") return false;
  426. if (block.invalid === true || block.dollar) return true;
  427. if (block.commas >> 0 + block.ranges >> 0 === 0) {
  428. block.invalid = true;
  429. return true;
  430. }
  431. if (block.open !== true || block.close !== true) {
  432. block.invalid = true;
  433. return true;
  434. }
  435. return false;
  436. };
  437. /**
  438. * Returns true if a node is an open or close node
  439. */
  440. exports.isOpenOrClose = (node) => {
  441. if (node.type === "open" || node.type === "close") return true;
  442. return node.open === true || node.close === true;
  443. };
  444. /**
  445. * Reduce an array of text nodes.
  446. */
  447. exports.reduce = (nodes) => nodes.reduce((acc, node) => {
  448. if (node.type === "text") acc.push(node.value);
  449. if (node.type === "range") node.type = "text";
  450. return acc;
  451. }, []);
  452. /**
  453. * Flatten an array
  454. */
  455. exports.flatten = (...args) => {
  456. const result = [];
  457. const flat = (arr) => {
  458. for (let i = 0; i < arr.length; i++) {
  459. const ele = arr[i];
  460. if (Array.isArray(ele)) {
  461. flat(ele);
  462. continue;
  463. }
  464. if (ele !== void 0) result.push(ele);
  465. }
  466. return result;
  467. };
  468. flat(args);
  469. return result;
  470. };
  471. }) });
  472. //#endregion
  473. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
  474. var require_stringify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js": ((exports, module) => {
  475. const utils$16 = require_utils$3();
  476. module.exports = (ast, options$1 = {}) => {
  477. const stringify$4 = (node, parent = {}) => {
  478. const invalidBlock = options$1.escapeInvalid && utils$16.isInvalidBrace(parent);
  479. const invalidNode = node.invalid === true && options$1.escapeInvalid === true;
  480. let output = "";
  481. if (node.value) {
  482. if ((invalidBlock || invalidNode) && utils$16.isOpenOrClose(node)) return "\\" + node.value;
  483. return node.value;
  484. }
  485. if (node.value) return node.value;
  486. if (node.nodes) for (const child of node.nodes) output += stringify$4(child);
  487. return output;
  488. };
  489. return stringify$4(ast);
  490. };
  491. }) });
  492. //#endregion
  493. //#region ../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js
  494. var require_is_number = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js": ((exports, module) => {
  495. module.exports = function(num) {
  496. if (typeof num === "number") return num - num === 0;
  497. if (typeof num === "string" && num.trim() !== "") return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
  498. return false;
  499. };
  500. }) });
  501. //#endregion
  502. //#region ../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js
  503. var require_to_regex_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js": ((exports, module) => {
  504. const isNumber$1 = require_is_number();
  505. const toRegexRange$1 = (min, max, options$1) => {
  506. if (isNumber$1(min) === false) throw new TypeError("toRegexRange: expected the first argument to be a number");
  507. if (max === void 0 || min === max) return String(min);
  508. if (isNumber$1(max) === false) throw new TypeError("toRegexRange: expected the second argument to be a number.");
  509. let opts = {
  510. relaxZeros: true,
  511. ...options$1
  512. };
  513. if (typeof opts.strictZeros === "boolean") opts.relaxZeros = opts.strictZeros === false;
  514. let relax = String(opts.relaxZeros);
  515. let shorthand = String(opts.shorthand);
  516. let capture = String(opts.capture);
  517. let wrap = String(opts.wrap);
  518. let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
  519. if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) return toRegexRange$1.cache[cacheKey].result;
  520. let a = Math.min(min, max);
  521. let b = Math.max(min, max);
  522. if (Math.abs(a - b) === 1) {
  523. let result = min + "|" + max;
  524. if (opts.capture) return `(${result})`;
  525. if (opts.wrap === false) return result;
  526. return `(?:${result})`;
  527. }
  528. let isPadded = hasPadding(min) || hasPadding(max);
  529. let state = {
  530. min,
  531. max,
  532. a,
  533. b
  534. };
  535. let positives = [];
  536. let negatives = [];
  537. if (isPadded) {
  538. state.isPadded = isPadded;
  539. state.maxLen = String(state.max).length;
  540. }
  541. if (a < 0) {
  542. negatives = splitToPatterns(b < 0 ? Math.abs(b) : 1, Math.abs(a), state, opts);
  543. a = state.a = 0;
  544. }
  545. if (b >= 0) positives = splitToPatterns(a, b, state, opts);
  546. state.negatives = negatives;
  547. state.positives = positives;
  548. state.result = collatePatterns(negatives, positives, opts);
  549. if (opts.capture === true) state.result = `(${state.result})`;
  550. else if (opts.wrap !== false && positives.length + negatives.length > 1) state.result = `(?:${state.result})`;
  551. toRegexRange$1.cache[cacheKey] = state;
  552. return state.result;
  553. };
  554. function collatePatterns(neg, pos, options$1) {
  555. let onlyNegative = filterPatterns(neg, pos, "-", false, options$1) || [];
  556. let onlyPositive = filterPatterns(pos, neg, "", false, options$1) || [];
  557. let intersected = filterPatterns(neg, pos, "-?", true, options$1) || [];
  558. return onlyNegative.concat(intersected).concat(onlyPositive).join("|");
  559. }
  560. function splitToRanges(min, max) {
  561. let nines = 1;
  562. let zeros$1 = 1;
  563. let stop = countNines(min, nines);
  564. let stops = new Set([max]);
  565. while (min <= stop && stop <= max) {
  566. stops.add(stop);
  567. nines += 1;
  568. stop = countNines(min, nines);
  569. }
  570. stop = countZeros(max + 1, zeros$1) - 1;
  571. while (min < stop && stop <= max) {
  572. stops.add(stop);
  573. zeros$1 += 1;
  574. stop = countZeros(max + 1, zeros$1) - 1;
  575. }
  576. stops = [...stops];
  577. stops.sort(compare);
  578. return stops;
  579. }
  580. /**
  581. * Convert a range to a regex pattern
  582. * @param {Number} `start`
  583. * @param {Number} `stop`
  584. * @return {String}
  585. */
  586. function rangeToPattern(start, stop, options$1) {
  587. if (start === stop) return {
  588. pattern: start,
  589. count: [],
  590. digits: 0
  591. };
  592. let zipped = zip(start, stop);
  593. let digits = zipped.length;
  594. let pattern$1 = "";
  595. let count = 0;
  596. for (let i = 0; i < digits; i++) {
  597. let [startDigit, stopDigit] = zipped[i];
  598. if (startDigit === stopDigit) pattern$1 += startDigit;
  599. else if (startDigit !== "0" || stopDigit !== "9") pattern$1 += toCharacterClass(startDigit, stopDigit, options$1);
  600. else count++;
  601. }
  602. if (count) pattern$1 += options$1.shorthand === true ? "\\d" : "[0-9]";
  603. return {
  604. pattern: pattern$1,
  605. count: [count],
  606. digits
  607. };
  608. }
  609. function splitToPatterns(min, max, tok, options$1) {
  610. let ranges = splitToRanges(min, max);
  611. let tokens = [];
  612. let start = min;
  613. let prev;
  614. for (let i = 0; i < ranges.length; i++) {
  615. let max$1 = ranges[i];
  616. let obj = rangeToPattern(String(start), String(max$1), options$1);
  617. let zeros$1 = "";
  618. if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
  619. if (prev.count.length > 1) prev.count.pop();
  620. prev.count.push(obj.count[0]);
  621. prev.string = prev.pattern + toQuantifier(prev.count);
  622. start = max$1 + 1;
  623. continue;
  624. }
  625. if (tok.isPadded) zeros$1 = padZeros(max$1, tok, options$1);
  626. obj.string = zeros$1 + obj.pattern + toQuantifier(obj.count);
  627. tokens.push(obj);
  628. start = max$1 + 1;
  629. prev = obj;
  630. }
  631. return tokens;
  632. }
  633. function filterPatterns(arr, comparison, prefix, intersection, options$1) {
  634. let result = [];
  635. for (let ele of arr) {
  636. let { string: string$1 } = ele;
  637. if (!intersection && !contains(comparison, "string", string$1)) result.push(prefix + string$1);
  638. if (intersection && contains(comparison, "string", string$1)) result.push(prefix + string$1);
  639. }
  640. return result;
  641. }
  642. /**
  643. * Zip strings
  644. */
  645. function zip(a, b) {
  646. let arr = [];
  647. for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
  648. return arr;
  649. }
  650. function compare(a, b) {
  651. return a > b ? 1 : b > a ? -1 : 0;
  652. }
  653. function contains(arr, key, val) {
  654. return arr.some((ele) => ele[key] === val);
  655. }
  656. function countNines(min, len) {
  657. return Number(String(min).slice(0, -len) + "9".repeat(len));
  658. }
  659. function countZeros(integer, zeros$1) {
  660. return integer - integer % Math.pow(10, zeros$1);
  661. }
  662. function toQuantifier(digits) {
  663. let [start = 0, stop = ""] = digits;
  664. if (stop || start > 1) return `{${start + (stop ? "," + stop : "")}}`;
  665. return "";
  666. }
  667. function toCharacterClass(a, b, options$1) {
  668. return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
  669. }
  670. function hasPadding(str) {
  671. return /^-?(0+)\d/.test(str);
  672. }
  673. function padZeros(value, tok, options$1) {
  674. if (!tok.isPadded) return value;
  675. let diff = Math.abs(tok.maxLen - String(value).length);
  676. let relax = options$1.relaxZeros !== false;
  677. switch (diff) {
  678. case 0: return "";
  679. case 1: return relax ? "0?" : "0";
  680. case 2: return relax ? "0{0,2}" : "00";
  681. default: return relax ? `0{0,${diff}}` : `0{${diff}}`;
  682. }
  683. }
  684. /**
  685. * Cache
  686. */
  687. toRegexRange$1.cache = {};
  688. toRegexRange$1.clearCache = () => toRegexRange$1.cache = {};
  689. /**
  690. * Expose `toRegexRange`
  691. */
  692. module.exports = toRegexRange$1;
  693. }) });
  694. //#endregion
  695. //#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
  696. var require_fill_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js": ((exports, module) => {
  697. const util$1 = __require("util");
  698. const toRegexRange = require_to_regex_range();
  699. const isObject$1 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  700. const transform = (toNumber) => {
  701. return (value) => toNumber === true ? Number(value) : String(value);
  702. };
  703. const isValidValue = (value) => {
  704. return typeof value === "number" || typeof value === "string" && value !== "";
  705. };
  706. const isNumber = (num) => Number.isInteger(+num);
  707. const zeros = (input) => {
  708. let value = `${input}`;
  709. let index = -1;
  710. if (value[0] === "-") value = value.slice(1);
  711. if (value === "0") return false;
  712. while (value[++index] === "0");
  713. return index > 0;
  714. };
  715. const stringify$3 = (start, end, options$1) => {
  716. if (typeof start === "string" || typeof end === "string") return true;
  717. return options$1.stringify === true;
  718. };
  719. const pad = (input, maxLength, toNumber) => {
  720. if (maxLength > 0) {
  721. let dash = input[0] === "-" ? "-" : "";
  722. if (dash) input = input.slice(1);
  723. input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
  724. }
  725. if (toNumber === false) return String(input);
  726. return input;
  727. };
  728. const toMaxLen = (input, maxLength) => {
  729. let negative = input[0] === "-" ? "-" : "";
  730. if (negative) {
  731. input = input.slice(1);
  732. maxLength--;
  733. }
  734. while (input.length < maxLength) input = "0" + input;
  735. return negative ? "-" + input : input;
  736. };
  737. const toSequence = (parts, options$1, maxLen) => {
  738. parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  739. parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  740. let prefix = options$1.capture ? "" : "?:";
  741. let positives = "";
  742. let negatives = "";
  743. let result;
  744. if (parts.positives.length) positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
  745. if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
  746. if (positives && negatives) result = `${positives}|${negatives}`;
  747. else result = positives || negatives;
  748. if (options$1.wrap) return `(${prefix}${result})`;
  749. return result;
  750. };
  751. const toRange = (a, b, isNumbers, options$1) => {
  752. if (isNumbers) return toRegexRange(a, b, {
  753. wrap: false,
  754. ...options$1
  755. });
  756. let start = String.fromCharCode(a);
  757. if (a === b) return start;
  758. return `[${start}-${String.fromCharCode(b)}]`;
  759. };
  760. const toRegex = (start, end, options$1) => {
  761. if (Array.isArray(start)) {
  762. let wrap = options$1.wrap === true;
  763. let prefix = options$1.capture ? "" : "?:";
  764. return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
  765. }
  766. return toRegexRange(start, end, options$1);
  767. };
  768. const rangeError = (...args) => {
  769. return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util$1.inspect(...args));
  770. };
  771. const invalidRange = (start, end, options$1) => {
  772. if (options$1.strictRanges === true) throw rangeError([start, end]);
  773. return [];
  774. };
  775. const invalidStep = (step, options$1) => {
  776. if (options$1.strictRanges === true) throw new TypeError(`Expected step "${step}" to be a number`);
  777. return [];
  778. };
  779. const fillNumbers = (start, end, step = 1, options$1 = {}) => {
  780. let a = Number(start);
  781. let b = Number(end);
  782. if (!Number.isInteger(a) || !Number.isInteger(b)) {
  783. if (options$1.strictRanges === true) throw rangeError([start, end]);
  784. return [];
  785. }
  786. if (a === 0) a = 0;
  787. if (b === 0) b = 0;
  788. let descending = a > b;
  789. let startString = String(start);
  790. let endString = String(end);
  791. let stepString = String(step);
  792. step = Math.max(Math.abs(step), 1);
  793. let padded = zeros(startString) || zeros(endString) || zeros(stepString);
  794. let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
  795. let toNumber = padded === false && stringify$3(start, end, options$1) === false;
  796. let format = options$1.transform || transform(toNumber);
  797. if (options$1.toRegex && step === 1) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options$1);
  798. let parts = {
  799. negatives: [],
  800. positives: []
  801. };
  802. let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
  803. let range = [];
  804. let index = 0;
  805. while (descending ? a >= b : a <= b) {
  806. if (options$1.toRegex === true && step > 1) push(a);
  807. else range.push(pad(format(a, index), maxLen, toNumber));
  808. a = descending ? a - step : a + step;
  809. index++;
  810. }
  811. if (options$1.toRegex === true) return step > 1 ? toSequence(parts, options$1, maxLen) : toRegex(range, null, {
  812. wrap: false,
  813. ...options$1
  814. });
  815. return range;
  816. };
  817. const fillLetters = (start, end, step = 1, options$1 = {}) => {
  818. if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options$1);
  819. let format = options$1.transform || ((val) => String.fromCharCode(val));
  820. let a = `${start}`.charCodeAt(0);
  821. let b = `${end}`.charCodeAt(0);
  822. let descending = a > b;
  823. let min = Math.min(a, b);
  824. let max = Math.max(a, b);
  825. if (options$1.toRegex && step === 1) return toRange(min, max, false, options$1);
  826. let range = [];
  827. let index = 0;
  828. while (descending ? a >= b : a <= b) {
  829. range.push(format(a, index));
  830. a = descending ? a - step : a + step;
  831. index++;
  832. }
  833. if (options$1.toRegex === true) return toRegex(range, null, {
  834. wrap: false,
  835. options: options$1
  836. });
  837. return range;
  838. };
  839. const fill$2 = (start, end, step, options$1 = {}) => {
  840. if (end == null && isValidValue(start)) return [start];
  841. if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options$1);
  842. if (typeof step === "function") return fill$2(start, end, 1, { transform: step });
  843. if (isObject$1(step)) return fill$2(start, end, 0, step);
  844. let opts = { ...options$1 };
  845. if (opts.capture === true) opts.wrap = true;
  846. step = step || opts.step || 1;
  847. if (!isNumber(step)) {
  848. if (step != null && !isObject$1(step)) return invalidStep(step, opts);
  849. return fill$2(start, end, 1, step);
  850. }
  851. if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
  852. return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
  853. };
  854. module.exports = fill$2;
  855. }) });
  856. //#endregion
  857. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
  858. var require_compile = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js": ((exports, module) => {
  859. const fill$1 = require_fill_range();
  860. const utils$15 = require_utils$3();
  861. const compile$1 = (ast, options$1 = {}) => {
  862. const walk$1 = (node, parent = {}) => {
  863. const invalidBlock = utils$15.isInvalidBrace(parent);
  864. const invalidNode = node.invalid === true && options$1.escapeInvalid === true;
  865. const invalid = invalidBlock === true || invalidNode === true;
  866. const prefix = options$1.escapeInvalid === true ? "\\" : "";
  867. let output = "";
  868. if (node.isOpen === true) return prefix + node.value;
  869. if (node.isClose === true) {
  870. console.log("node.isClose", prefix, node.value);
  871. return prefix + node.value;
  872. }
  873. if (node.type === "open") return invalid ? prefix + node.value : "(";
  874. if (node.type === "close") return invalid ? prefix + node.value : ")";
  875. if (node.type === "comma") return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
  876. if (node.value) return node.value;
  877. if (node.nodes && node.ranges > 0) {
  878. const args = utils$15.reduce(node.nodes);
  879. const range = fill$1(...args, {
  880. ...options$1,
  881. wrap: false,
  882. toRegex: true,
  883. strictZeros: true
  884. });
  885. if (range.length !== 0) return args.length > 1 && range.length > 1 ? `(${range})` : range;
  886. }
  887. if (node.nodes) for (const child of node.nodes) output += walk$1(child, node);
  888. return output;
  889. };
  890. return walk$1(ast);
  891. };
  892. module.exports = compile$1;
  893. }) });
  894. //#endregion
  895. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
  896. var require_expand = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js": ((exports, module) => {
  897. const fill = require_fill_range();
  898. const stringify$2 = require_stringify();
  899. const utils$14 = require_utils$3();
  900. const append = (queue = "", stash = "", enclose = false) => {
  901. const result = [];
  902. queue = [].concat(queue);
  903. stash = [].concat(stash);
  904. if (!stash.length) return queue;
  905. if (!queue.length) return enclose ? utils$14.flatten(stash).map((ele) => `{${ele}}`) : stash;
  906. for (const item of queue) if (Array.isArray(item)) for (const value of item) result.push(append(value, stash, enclose));
  907. else for (let ele of stash) {
  908. if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
  909. result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
  910. }
  911. return utils$14.flatten(result);
  912. };
  913. const expand$1 = (ast, options$1 = {}) => {
  914. const rangeLimit = options$1.rangeLimit === void 0 ? 1e3 : options$1.rangeLimit;
  915. const walk$1 = (node, parent = {}) => {
  916. node.queue = [];
  917. let p = parent;
  918. let q = parent.queue;
  919. while (p.type !== "brace" && p.type !== "root" && p.parent) {
  920. p = p.parent;
  921. q = p.queue;
  922. }
  923. if (node.invalid || node.dollar) {
  924. q.push(append(q.pop(), stringify$2(node, options$1)));
  925. return;
  926. }
  927. if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
  928. q.push(append(q.pop(), ["{}"]));
  929. return;
  930. }
  931. if (node.nodes && node.ranges > 0) {
  932. const args = utils$14.reduce(node.nodes);
  933. 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.");
  934. let range = fill(...args, options$1);
  935. if (range.length === 0) range = stringify$2(node, options$1);
  936. q.push(append(q.pop(), range));
  937. node.nodes = [];
  938. return;
  939. }
  940. const enclose = utils$14.encloseBrace(node);
  941. let queue = node.queue;
  942. let block = node;
  943. while (block.type !== "brace" && block.type !== "root" && block.parent) {
  944. block = block.parent;
  945. queue = block.queue;
  946. }
  947. for (let i = 0; i < node.nodes.length; i++) {
  948. const child = node.nodes[i];
  949. if (child.type === "comma" && node.type === "brace") {
  950. if (i === 1) queue.push("");
  951. queue.push("");
  952. continue;
  953. }
  954. if (child.type === "close") {
  955. q.push(append(q.pop(), queue, enclose));
  956. continue;
  957. }
  958. if (child.value && child.type !== "open") {
  959. queue.push(append(queue.pop(), child.value));
  960. continue;
  961. }
  962. if (child.nodes) walk$1(child, node);
  963. }
  964. return queue;
  965. };
  966. return utils$14.flatten(walk$1(ast));
  967. };
  968. module.exports = expand$1;
  969. }) });
  970. //#endregion
  971. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
  972. var require_constants$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js": ((exports, module) => {
  973. module.exports = {
  974. MAX_LENGTH: 1e4,
  975. CHAR_0: "0",
  976. CHAR_9: "9",
  977. CHAR_UPPERCASE_A: "A",
  978. CHAR_LOWERCASE_A: "a",
  979. CHAR_UPPERCASE_Z: "Z",
  980. CHAR_LOWERCASE_Z: "z",
  981. CHAR_LEFT_PARENTHESES: "(",
  982. CHAR_RIGHT_PARENTHESES: ")",
  983. CHAR_ASTERISK: "*",
  984. CHAR_AMPERSAND: "&",
  985. CHAR_AT: "@",
  986. CHAR_BACKSLASH: "\\",
  987. CHAR_BACKTICK: "`",
  988. CHAR_CARRIAGE_RETURN: "\r",
  989. CHAR_CIRCUMFLEX_ACCENT: "^",
  990. CHAR_COLON: ":",
  991. CHAR_COMMA: ",",
  992. CHAR_DOLLAR: "$",
  993. CHAR_DOT: ".",
  994. CHAR_DOUBLE_QUOTE: "\"",
  995. CHAR_EQUAL: "=",
  996. CHAR_EXCLAMATION_MARK: "!",
  997. CHAR_FORM_FEED: "\f",
  998. CHAR_FORWARD_SLASH: "/",
  999. CHAR_HASH: "#",
  1000. CHAR_HYPHEN_MINUS: "-",
  1001. CHAR_LEFT_ANGLE_BRACKET: "<",
  1002. CHAR_LEFT_CURLY_BRACE: "{",
  1003. CHAR_LEFT_SQUARE_BRACKET: "[",
  1004. CHAR_LINE_FEED: "\n",
  1005. CHAR_NO_BREAK_SPACE: "\xA0",
  1006. CHAR_PERCENT: "%",
  1007. CHAR_PLUS: "+",
  1008. CHAR_QUESTION_MARK: "?",
  1009. CHAR_RIGHT_ANGLE_BRACKET: ">",
  1010. CHAR_RIGHT_CURLY_BRACE: "}",
  1011. CHAR_RIGHT_SQUARE_BRACKET: "]",
  1012. CHAR_SEMICOLON: ";",
  1013. CHAR_SINGLE_QUOTE: "'",
  1014. CHAR_SPACE: " ",
  1015. CHAR_TAB: " ",
  1016. CHAR_UNDERSCORE: "_",
  1017. CHAR_VERTICAL_LINE: "|",
  1018. CHAR_ZERO_WIDTH_NOBREAK_SPACE: ""
  1019. };
  1020. }) });
  1021. //#endregion
  1022. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
  1023. var require_parse$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js": ((exports, module) => {
  1024. const stringify$1 = require_stringify();
  1025. /**
  1026. * Constants
  1027. */
  1028. 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();
  1029. /**
  1030. * parse
  1031. */
  1032. const parse$3 = (input, options$1 = {}) => {
  1033. if (typeof input !== "string") throw new TypeError("Expected a string");
  1034. const opts = options$1 || {};
  1035. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
  1036. if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
  1037. const ast = {
  1038. type: "root",
  1039. input,
  1040. nodes: []
  1041. };
  1042. const stack = [ast];
  1043. let block = ast;
  1044. let prev = ast;
  1045. let brackets = 0;
  1046. const length = input.length;
  1047. let index = 0;
  1048. let depth$1 = 0;
  1049. let value;
  1050. /**
  1051. * Helpers
  1052. */
  1053. const advance = () => input[index++];
  1054. const push = (node) => {
  1055. if (node.type === "text" && prev.type === "dot") prev.type = "text";
  1056. if (prev && prev.type === "text" && node.type === "text") {
  1057. prev.value += node.value;
  1058. return;
  1059. }
  1060. block.nodes.push(node);
  1061. node.parent = block;
  1062. node.prev = prev;
  1063. prev = node;
  1064. return node;
  1065. };
  1066. push({ type: "bos" });
  1067. while (index < length) {
  1068. block = stack[stack.length - 1];
  1069. value = advance();
  1070. /**
  1071. * Invalid chars
  1072. */
  1073. if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) continue;
  1074. /**
  1075. * Escaped chars
  1076. */
  1077. if (value === CHAR_BACKSLASH) {
  1078. push({
  1079. type: "text",
  1080. value: (options$1.keepEscaping ? value : "") + advance()
  1081. });
  1082. continue;
  1083. }
  1084. /**
  1085. * Right square bracket (literal): ']'
  1086. */
  1087. if (value === CHAR_RIGHT_SQUARE_BRACKET$1) {
  1088. push({
  1089. type: "text",
  1090. value: "\\" + value
  1091. });
  1092. continue;
  1093. }
  1094. /**
  1095. * Left square bracket: '['
  1096. */
  1097. if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
  1098. brackets++;
  1099. let next;
  1100. while (index < length && (next = advance())) {
  1101. value += next;
  1102. if (next === CHAR_LEFT_SQUARE_BRACKET$1) {
  1103. brackets++;
  1104. continue;
  1105. }
  1106. if (next === CHAR_BACKSLASH) {
  1107. value += advance();
  1108. continue;
  1109. }
  1110. if (next === CHAR_RIGHT_SQUARE_BRACKET$1) {
  1111. brackets--;
  1112. if (brackets === 0) break;
  1113. }
  1114. }
  1115. push({
  1116. type: "text",
  1117. value
  1118. });
  1119. continue;
  1120. }
  1121. /**
  1122. * Parentheses
  1123. */
  1124. if (value === CHAR_LEFT_PARENTHESES$1) {
  1125. block = push({
  1126. type: "paren",
  1127. nodes: []
  1128. });
  1129. stack.push(block);
  1130. push({
  1131. type: "text",
  1132. value
  1133. });
  1134. continue;
  1135. }
  1136. if (value === CHAR_RIGHT_PARENTHESES$1) {
  1137. if (block.type !== "paren") {
  1138. push({
  1139. type: "text",
  1140. value
  1141. });
  1142. continue;
  1143. }
  1144. block = stack.pop();
  1145. push({
  1146. type: "text",
  1147. value
  1148. });
  1149. block = stack[stack.length - 1];
  1150. continue;
  1151. }
  1152. /**
  1153. * Quotes: '|"|`
  1154. */
  1155. if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
  1156. const open = value;
  1157. let next;
  1158. if (options$1.keepQuotes !== true) value = "";
  1159. while (index < length && (next = advance())) {
  1160. if (next === CHAR_BACKSLASH) {
  1161. value += next + advance();
  1162. continue;
  1163. }
  1164. if (next === open) {
  1165. if (options$1.keepQuotes === true) value += next;
  1166. break;
  1167. }
  1168. value += next;
  1169. }
  1170. push({
  1171. type: "text",
  1172. value
  1173. });
  1174. continue;
  1175. }
  1176. /**
  1177. * Left curly brace: '{'
  1178. */
  1179. if (value === CHAR_LEFT_CURLY_BRACE$1) {
  1180. depth$1++;
  1181. const brace = {
  1182. type: "brace",
  1183. open: true,
  1184. close: false,
  1185. dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === true,
  1186. depth: depth$1,
  1187. commas: 0,
  1188. ranges: 0,
  1189. nodes: []
  1190. };
  1191. block = push(brace);
  1192. stack.push(block);
  1193. push({
  1194. type: "open",
  1195. value
  1196. });
  1197. continue;
  1198. }
  1199. /**
  1200. * Right curly brace: '}'
  1201. */
  1202. if (value === CHAR_RIGHT_CURLY_BRACE$1) {
  1203. if (block.type !== "brace") {
  1204. push({
  1205. type: "text",
  1206. value
  1207. });
  1208. continue;
  1209. }
  1210. const type = "close";
  1211. block = stack.pop();
  1212. block.close = true;
  1213. push({
  1214. type,
  1215. value
  1216. });
  1217. depth$1--;
  1218. block = stack[stack.length - 1];
  1219. continue;
  1220. }
  1221. /**
  1222. * Comma: ','
  1223. */
  1224. if (value === CHAR_COMMA$1 && depth$1 > 0) {
  1225. if (block.ranges > 0) {
  1226. block.ranges = 0;
  1227. block.nodes = [block.nodes.shift(), {
  1228. type: "text",
  1229. value: stringify$1(block)
  1230. }];
  1231. }
  1232. push({
  1233. type: "comma",
  1234. value
  1235. });
  1236. block.commas++;
  1237. continue;
  1238. }
  1239. /**
  1240. * Dot: '.'
  1241. */
  1242. if (value === CHAR_DOT$1 && depth$1 > 0 && block.commas === 0) {
  1243. const siblings = block.nodes;
  1244. if (depth$1 === 0 || siblings.length === 0) {
  1245. push({
  1246. type: "text",
  1247. value
  1248. });
  1249. continue;
  1250. }
  1251. if (prev.type === "dot") {
  1252. block.range = [];
  1253. prev.value += value;
  1254. prev.type = "range";
  1255. if (block.nodes.length !== 3 && block.nodes.length !== 5) {
  1256. block.invalid = true;
  1257. block.ranges = 0;
  1258. prev.type = "text";
  1259. continue;
  1260. }
  1261. block.ranges++;
  1262. block.args = [];
  1263. continue;
  1264. }
  1265. if (prev.type === "range") {
  1266. siblings.pop();
  1267. const before = siblings[siblings.length - 1];
  1268. before.value += prev.value + value;
  1269. prev = before;
  1270. block.ranges--;
  1271. continue;
  1272. }
  1273. push({
  1274. type: "dot",
  1275. value
  1276. });
  1277. continue;
  1278. }
  1279. /**
  1280. * Text
  1281. */
  1282. push({
  1283. type: "text",
  1284. value
  1285. });
  1286. }
  1287. do {
  1288. block = stack.pop();
  1289. if (block.type !== "root") {
  1290. block.nodes.forEach((node) => {
  1291. if (!node.nodes) {
  1292. if (node.type === "open") node.isOpen = true;
  1293. if (node.type === "close") node.isClose = true;
  1294. if (!node.nodes) node.type = "text";
  1295. node.invalid = true;
  1296. }
  1297. });
  1298. const parent = stack[stack.length - 1];
  1299. const index$1 = parent.nodes.indexOf(block);
  1300. parent.nodes.splice(index$1, 1, ...block.nodes);
  1301. }
  1302. } while (stack.length > 0);
  1303. push({ type: "eos" });
  1304. return ast;
  1305. };
  1306. module.exports = parse$3;
  1307. }) });
  1308. //#endregion
  1309. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
  1310. var require_braces = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js": ((exports, module) => {
  1311. const stringify = require_stringify();
  1312. const compile = require_compile();
  1313. const expand = require_expand();
  1314. const parse$2 = require_parse$1();
  1315. /**
  1316. * Expand the given pattern or create a regex-compatible string.
  1317. *
  1318. * ```js
  1319. * const braces = require('braces');
  1320. * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
  1321. * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
  1322. * ```
  1323. * @param {String} `str`
  1324. * @param {Object} `options`
  1325. * @return {String}
  1326. * @api public
  1327. */
  1328. const braces$1 = (input, options$1 = {}) => {
  1329. let output = [];
  1330. if (Array.isArray(input)) for (const pattern$1 of input) {
  1331. const result = braces$1.create(pattern$1, options$1);
  1332. if (Array.isArray(result)) output.push(...result);
  1333. else output.push(result);
  1334. }
  1335. else output = [].concat(braces$1.create(input, options$1));
  1336. if (options$1 && options$1.expand === true && options$1.nodupes === true) output = [...new Set(output)];
  1337. return output;
  1338. };
  1339. /**
  1340. * Parse the given `str` with the given `options`.
  1341. *
  1342. * ```js
  1343. * // braces.parse(pattern, [, options]);
  1344. * const ast = braces.parse('a/{b,c}/d');
  1345. * console.log(ast);
  1346. * ```
  1347. * @param {String} pattern Brace pattern to parse
  1348. * @param {Object} options
  1349. * @return {Object} Returns an AST
  1350. * @api public
  1351. */
  1352. braces$1.parse = (input, options$1 = {}) => parse$2(input, options$1);
  1353. /**
  1354. * Creates a braces string from an AST, or an AST node.
  1355. *
  1356. * ```js
  1357. * const braces = require('braces');
  1358. * let ast = braces.parse('foo/{a,b}/bar');
  1359. * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
  1360. * ```
  1361. * @param {String} `input` Brace pattern or AST.
  1362. * @param {Object} `options`
  1363. * @return {Array} Returns an array of expanded values.
  1364. * @api public
  1365. */
  1366. braces$1.stringify = (input, options$1 = {}) => {
  1367. if (typeof input === "string") return stringify(braces$1.parse(input, options$1), options$1);
  1368. return stringify(input, options$1);
  1369. };
  1370. /**
  1371. * Compiles a brace pattern into a regex-compatible, optimized string.
  1372. * This method is called by the main [braces](#braces) function by default.
  1373. *
  1374. * ```js
  1375. * const braces = require('braces');
  1376. * console.log(braces.compile('a/{b,c}/d'));
  1377. * //=> ['a/(b|c)/d']
  1378. * ```
  1379. * @param {String} `input` Brace pattern or AST.
  1380. * @param {Object} `options`
  1381. * @return {Array} Returns an array of expanded values.
  1382. * @api public
  1383. */
  1384. braces$1.compile = (input, options$1 = {}) => {
  1385. if (typeof input === "string") input = braces$1.parse(input, options$1);
  1386. return compile(input, options$1);
  1387. };
  1388. /**
  1389. * Expands a brace pattern into an array. This method is called by the
  1390. * main [braces](#braces) function when `options.expand` is true. Before
  1391. * using this method it's recommended that you read the [performance notes](#performance))
  1392. * and advantages of using [.compile](#compile) instead.
  1393. *
  1394. * ```js
  1395. * const braces = require('braces');
  1396. * console.log(braces.expand('a/{b,c}/d'));
  1397. * //=> ['a/b/d', 'a/c/d'];
  1398. * ```
  1399. * @param {String} `pattern` Brace pattern
  1400. * @param {Object} `options`
  1401. * @return {Array} Returns an array of expanded values.
  1402. * @api public
  1403. */
  1404. braces$1.expand = (input, options$1 = {}) => {
  1405. if (typeof input === "string") input = braces$1.parse(input, options$1);
  1406. let result = expand(input, options$1);
  1407. if (options$1.noempty === true) result = result.filter(Boolean);
  1408. if (options$1.nodupes === true) result = [...new Set(result)];
  1409. return result;
  1410. };
  1411. /**
  1412. * Processes a brace pattern and returns either an expanded array
  1413. * (if `options.expand` is true), a highly optimized regex-compatible string.
  1414. * This method is called by the main [braces](#braces) function.
  1415. *
  1416. * ```js
  1417. * const braces = require('braces');
  1418. * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
  1419. * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
  1420. * ```
  1421. * @param {String} `pattern` Brace pattern
  1422. * @param {Object} `options`
  1423. * @return {Array} Returns an array of expanded values.
  1424. * @api public
  1425. */
  1426. braces$1.create = (input, options$1 = {}) => {
  1427. if (input === "" || input.length < 3) return [input];
  1428. return options$1.expand !== true ? braces$1.compile(input, options$1) : braces$1.expand(input, options$1);
  1429. };
  1430. /**
  1431. * Expose "braces"
  1432. */
  1433. module.exports = braces$1;
  1434. }) });
  1435. //#endregion
  1436. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
  1437. var require_constants$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js": ((exports, module) => {
  1438. const path$9 = __require("path");
  1439. const WIN_SLASH = "\\\\/";
  1440. const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
  1441. /**
  1442. * Posix glob regex
  1443. */
  1444. const DOT_LITERAL = "\\.";
  1445. const PLUS_LITERAL = "\\+";
  1446. const QMARK_LITERAL = "\\?";
  1447. const SLASH_LITERAL = "\\/";
  1448. const ONE_CHAR = "(?=.)";
  1449. const QMARK = "[^/]";
  1450. const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
  1451. const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
  1452. const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
  1453. const NO_DOT = `(?!${DOT_LITERAL})`;
  1454. const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
  1455. const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
  1456. const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
  1457. const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
  1458. const STAR = `${QMARK}*?`;
  1459. const POSIX_CHARS = {
  1460. DOT_LITERAL,
  1461. PLUS_LITERAL,
  1462. QMARK_LITERAL,
  1463. SLASH_LITERAL,
  1464. ONE_CHAR,
  1465. QMARK,
  1466. END_ANCHOR,
  1467. DOTS_SLASH,
  1468. NO_DOT,
  1469. NO_DOTS,
  1470. NO_DOT_SLASH,
  1471. NO_DOTS_SLASH,
  1472. QMARK_NO_DOT,
  1473. STAR,
  1474. START_ANCHOR
  1475. };
  1476. /**
  1477. * Windows glob regex
  1478. */
  1479. const WINDOWS_CHARS = {
  1480. ...POSIX_CHARS,
  1481. SLASH_LITERAL: `[${WIN_SLASH}]`,
  1482. QMARK: WIN_NO_SLASH,
  1483. STAR: `${WIN_NO_SLASH}*?`,
  1484. DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
  1485. NO_DOT: `(?!${DOT_LITERAL})`,
  1486. NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  1487. NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
  1488. NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  1489. QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
  1490. START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
  1491. END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
  1492. };
  1493. /**
  1494. * POSIX Bracket Regex
  1495. */
  1496. const POSIX_REGEX_SOURCE$1 = {
  1497. alnum: "a-zA-Z0-9",
  1498. alpha: "a-zA-Z",
  1499. ascii: "\\x00-\\x7F",
  1500. blank: " \\t",
  1501. cntrl: "\\x00-\\x1F\\x7F",
  1502. digit: "0-9",
  1503. graph: "\\x21-\\x7E",
  1504. lower: "a-z",
  1505. print: "\\x20-\\x7E ",
  1506. punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
  1507. space: " \\t\\r\\n\\v\\f",
  1508. upper: "A-Z",
  1509. word: "A-Za-z0-9_",
  1510. xdigit: "A-Fa-f0-9"
  1511. };
  1512. module.exports = {
  1513. MAX_LENGTH: 1024 * 64,
  1514. POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
  1515. REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
  1516. REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
  1517. REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
  1518. REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
  1519. REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
  1520. REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
  1521. REPLACEMENTS: {
  1522. "***": "*",
  1523. "**/**": "**",
  1524. "**/**/**": "**"
  1525. },
  1526. CHAR_0: 48,
  1527. CHAR_9: 57,
  1528. CHAR_UPPERCASE_A: 65,
  1529. CHAR_LOWERCASE_A: 97,
  1530. CHAR_UPPERCASE_Z: 90,
  1531. CHAR_LOWERCASE_Z: 122,
  1532. CHAR_LEFT_PARENTHESES: 40,
  1533. CHAR_RIGHT_PARENTHESES: 41,
  1534. CHAR_ASTERISK: 42,
  1535. CHAR_AMPERSAND: 38,
  1536. CHAR_AT: 64,
  1537. CHAR_BACKWARD_SLASH: 92,
  1538. CHAR_CARRIAGE_RETURN: 13,
  1539. CHAR_CIRCUMFLEX_ACCENT: 94,
  1540. CHAR_COLON: 58,
  1541. CHAR_COMMA: 44,
  1542. CHAR_DOT: 46,
  1543. CHAR_DOUBLE_QUOTE: 34,
  1544. CHAR_EQUAL: 61,
  1545. CHAR_EXCLAMATION_MARK: 33,
  1546. CHAR_FORM_FEED: 12,
  1547. CHAR_FORWARD_SLASH: 47,
  1548. CHAR_GRAVE_ACCENT: 96,
  1549. CHAR_HASH: 35,
  1550. CHAR_HYPHEN_MINUS: 45,
  1551. CHAR_LEFT_ANGLE_BRACKET: 60,
  1552. CHAR_LEFT_CURLY_BRACE: 123,
  1553. CHAR_LEFT_SQUARE_BRACKET: 91,
  1554. CHAR_LINE_FEED: 10,
  1555. CHAR_NO_BREAK_SPACE: 160,
  1556. CHAR_PERCENT: 37,
  1557. CHAR_PLUS: 43,
  1558. CHAR_QUESTION_MARK: 63,
  1559. CHAR_RIGHT_ANGLE_BRACKET: 62,
  1560. CHAR_RIGHT_CURLY_BRACE: 125,
  1561. CHAR_RIGHT_SQUARE_BRACKET: 93,
  1562. CHAR_SEMICOLON: 59,
  1563. CHAR_SINGLE_QUOTE: 39,
  1564. CHAR_SPACE: 32,
  1565. CHAR_TAB: 9,
  1566. CHAR_UNDERSCORE: 95,
  1567. CHAR_VERTICAL_LINE: 124,
  1568. CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
  1569. SEP: path$9.sep,
  1570. extglobChars(chars$1) {
  1571. return {
  1572. "!": {
  1573. type: "negate",
  1574. open: "(?:(?!(?:",
  1575. close: `))${chars$1.STAR})`
  1576. },
  1577. "?": {
  1578. type: "qmark",
  1579. open: "(?:",
  1580. close: ")?"
  1581. },
  1582. "+": {
  1583. type: "plus",
  1584. open: "(?:",
  1585. close: ")+"
  1586. },
  1587. "*": {
  1588. type: "star",
  1589. open: "(?:",
  1590. close: ")*"
  1591. },
  1592. "@": {
  1593. type: "at",
  1594. open: "(?:",
  1595. close: ")"
  1596. }
  1597. };
  1598. },
  1599. globChars(win32$1) {
  1600. return win32$1 === true ? WINDOWS_CHARS : POSIX_CHARS;
  1601. }
  1602. };
  1603. }) });
  1604. //#endregion
  1605. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
  1606. var require_utils$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js": ((exports) => {
  1607. const path$8 = __require("path");
  1608. const win32 = process.platform === "win32";
  1609. const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
  1610. exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  1611. exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
  1612. exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
  1613. exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
  1614. exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
  1615. exports.removeBackslashes = (str) => {
  1616. return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
  1617. return match === "\\" ? "" : match;
  1618. });
  1619. };
  1620. exports.supportsLookbehinds = () => {
  1621. const segs = process.version.slice(1).split(".").map(Number);
  1622. if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) return true;
  1623. return false;
  1624. };
  1625. exports.isWindows = (options$1) => {
  1626. if (options$1 && typeof options$1.windows === "boolean") return options$1.windows;
  1627. return win32 === true || path$8.sep === "\\";
  1628. };
  1629. exports.escapeLast = (input, char, lastIdx) => {
  1630. const idx = input.lastIndexOf(char, lastIdx);
  1631. if (idx === -1) return input;
  1632. if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
  1633. return `${input.slice(0, idx)}\\${input.slice(idx)}`;
  1634. };
  1635. exports.removePrefix = (input, state = {}) => {
  1636. let output = input;
  1637. if (output.startsWith("./")) {
  1638. output = output.slice(2);
  1639. state.prefix = "./";
  1640. }
  1641. return output;
  1642. };
  1643. exports.wrapOutput = (input, state = {}, options$1 = {}) => {
  1644. const prepend = options$1.contains ? "" : "^";
  1645. const append$1 = options$1.contains ? "" : "$";
  1646. let output = `${prepend}(?:${input})${append$1}`;
  1647. if (state.negated === true) output = `(?:^(?!${output}).*$)`;
  1648. return output;
  1649. };
  1650. }) });
  1651. //#endregion
  1652. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
  1653. var require_scan = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js": ((exports, module) => {
  1654. const utils$13 = require_utils$2();
  1655. const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants$1();
  1656. const isPathSeparator = (code) => {
  1657. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  1658. };
  1659. const depth = (token) => {
  1660. if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
  1661. };
  1662. /**
  1663. * Quickly scans a glob pattern and returns an object with a handful of
  1664. * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
  1665. * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
  1666. * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
  1667. *
  1668. * ```js
  1669. * const pm = require('picomatch');
  1670. * console.log(pm.scan('foo/bar/*.js'));
  1671. * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
  1672. * ```
  1673. * @param {String} `str`
  1674. * @param {Object} `options`
  1675. * @return {Object} Returns an object with tokens and regex source string.
  1676. * @api public
  1677. */
  1678. const scan$1 = (input, options$1) => {
  1679. const opts = options$1 || {};
  1680. const length = input.length - 1;
  1681. const scanToEnd = opts.parts === true || opts.scanToEnd === true;
  1682. const slashes = [];
  1683. const tokens = [];
  1684. const parts = [];
  1685. let str = input;
  1686. let index = -1;
  1687. let start = 0;
  1688. let lastIndex = 0;
  1689. let isBrace = false;
  1690. let isBracket = false;
  1691. let isGlob$1 = false;
  1692. let isExtglob$1 = false;
  1693. let isGlobstar = false;
  1694. let braceEscaped = false;
  1695. let backslashes = false;
  1696. let negated = false;
  1697. let negatedExtglob = false;
  1698. let finished = false;
  1699. let braces$2 = 0;
  1700. let prev;
  1701. let code;
  1702. let token = {
  1703. value: "",
  1704. depth: 0,
  1705. isGlob: false
  1706. };
  1707. const eos = () => index >= length;
  1708. const peek = () => str.charCodeAt(index + 1);
  1709. const advance = () => {
  1710. prev = code;
  1711. return str.charCodeAt(++index);
  1712. };
  1713. while (index < length) {
  1714. code = advance();
  1715. let next;
  1716. if (code === CHAR_BACKWARD_SLASH) {
  1717. backslashes = token.backslashes = true;
  1718. code = advance();
  1719. if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
  1720. continue;
  1721. }
  1722. if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
  1723. braces$2++;
  1724. while (eos() !== true && (code = advance())) {
  1725. if (code === CHAR_BACKWARD_SLASH) {
  1726. backslashes = token.backslashes = true;
  1727. advance();
  1728. continue;
  1729. }
  1730. if (code === CHAR_LEFT_CURLY_BRACE) {
  1731. braces$2++;
  1732. continue;
  1733. }
  1734. if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
  1735. isBrace = token.isBrace = true;
  1736. isGlob$1 = token.isGlob = true;
  1737. finished = true;
  1738. if (scanToEnd === true) continue;
  1739. break;
  1740. }
  1741. if (braceEscaped !== true && code === CHAR_COMMA) {
  1742. isBrace = token.isBrace = true;
  1743. isGlob$1 = token.isGlob = true;
  1744. finished = true;
  1745. if (scanToEnd === true) continue;
  1746. break;
  1747. }
  1748. if (code === CHAR_RIGHT_CURLY_BRACE) {
  1749. braces$2--;
  1750. if (braces$2 === 0) {
  1751. braceEscaped = false;
  1752. isBrace = token.isBrace = true;
  1753. finished = true;
  1754. break;
  1755. }
  1756. }
  1757. }
  1758. if (scanToEnd === true) continue;
  1759. break;
  1760. }
  1761. if (code === CHAR_FORWARD_SLASH) {
  1762. slashes.push(index);
  1763. tokens.push(token);
  1764. token = {
  1765. value: "",
  1766. depth: 0,
  1767. isGlob: false
  1768. };
  1769. if (finished === true) continue;
  1770. if (prev === CHAR_DOT && index === start + 1) {
  1771. start += 2;
  1772. continue;
  1773. }
  1774. lastIndex = index + 1;
  1775. continue;
  1776. }
  1777. if (opts.noext !== true) {
  1778. if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
  1779. isGlob$1 = token.isGlob = true;
  1780. isExtglob$1 = token.isExtglob = true;
  1781. finished = true;
  1782. if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
  1783. if (scanToEnd === true) {
  1784. while (eos() !== true && (code = advance())) {
  1785. if (code === CHAR_BACKWARD_SLASH) {
  1786. backslashes = token.backslashes = true;
  1787. code = advance();
  1788. continue;
  1789. }
  1790. if (code === CHAR_RIGHT_PARENTHESES) {
  1791. isGlob$1 = token.isGlob = true;
  1792. finished = true;
  1793. break;
  1794. }
  1795. }
  1796. continue;
  1797. }
  1798. break;
  1799. }
  1800. }
  1801. if (code === CHAR_ASTERISK) {
  1802. if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
  1803. isGlob$1 = token.isGlob = true;
  1804. finished = true;
  1805. if (scanToEnd === true) continue;
  1806. break;
  1807. }
  1808. if (code === CHAR_QUESTION_MARK) {
  1809. isGlob$1 = token.isGlob = true;
  1810. finished = true;
  1811. if (scanToEnd === true) continue;
  1812. break;
  1813. }
  1814. if (code === CHAR_LEFT_SQUARE_BRACKET) {
  1815. while (eos() !== true && (next = advance())) {
  1816. if (next === CHAR_BACKWARD_SLASH) {
  1817. backslashes = token.backslashes = true;
  1818. advance();
  1819. continue;
  1820. }
  1821. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  1822. isBracket = token.isBracket = true;
  1823. isGlob$1 = token.isGlob = true;
  1824. finished = true;
  1825. break;
  1826. }
  1827. }
  1828. if (scanToEnd === true) continue;
  1829. break;
  1830. }
  1831. if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
  1832. negated = token.negated = true;
  1833. start++;
  1834. continue;
  1835. }
  1836. if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
  1837. isGlob$1 = token.isGlob = true;
  1838. if (scanToEnd === true) {
  1839. while (eos() !== true && (code = advance())) {
  1840. if (code === CHAR_LEFT_PARENTHESES) {
  1841. backslashes = token.backslashes = true;
  1842. code = advance();
  1843. continue;
  1844. }
  1845. if (code === CHAR_RIGHT_PARENTHESES) {
  1846. finished = true;
  1847. break;
  1848. }
  1849. }
  1850. continue;
  1851. }
  1852. break;
  1853. }
  1854. if (isGlob$1 === true) {
  1855. finished = true;
  1856. if (scanToEnd === true) continue;
  1857. break;
  1858. }
  1859. }
  1860. if (opts.noext === true) {
  1861. isExtglob$1 = false;
  1862. isGlob$1 = false;
  1863. }
  1864. let base = str;
  1865. let prefix = "";
  1866. let glob = "";
  1867. if (start > 0) {
  1868. prefix = str.slice(0, start);
  1869. str = str.slice(start);
  1870. lastIndex -= start;
  1871. }
  1872. if (base && isGlob$1 === true && lastIndex > 0) {
  1873. base = str.slice(0, lastIndex);
  1874. glob = str.slice(lastIndex);
  1875. } else if (isGlob$1 === true) {
  1876. base = "";
  1877. glob = str;
  1878. } else base = str;
  1879. if (base && base !== "" && base !== "/" && base !== str) {
  1880. if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
  1881. }
  1882. if (opts.unescape === true) {
  1883. if (glob) glob = utils$13.removeBackslashes(glob);
  1884. if (base && backslashes === true) base = utils$13.removeBackslashes(base);
  1885. }
  1886. const state = {
  1887. prefix,
  1888. input,
  1889. start,
  1890. base,
  1891. glob,
  1892. isBrace,
  1893. isBracket,
  1894. isGlob: isGlob$1,
  1895. isExtglob: isExtglob$1,
  1896. isGlobstar,
  1897. negated,
  1898. negatedExtglob
  1899. };
  1900. if (opts.tokens === true) {
  1901. state.maxDepth = 0;
  1902. if (!isPathSeparator(code)) tokens.push(token);
  1903. state.tokens = tokens;
  1904. }
  1905. if (opts.parts === true || opts.tokens === true) {
  1906. let prevIndex;
  1907. for (let idx = 0; idx < slashes.length; idx++) {
  1908. const n = prevIndex ? prevIndex + 1 : start;
  1909. const i = slashes[idx];
  1910. const value = input.slice(n, i);
  1911. if (opts.tokens) {
  1912. if (idx === 0 && start !== 0) {
  1913. tokens[idx].isPrefix = true;
  1914. tokens[idx].value = prefix;
  1915. } else tokens[idx].value = value;
  1916. depth(tokens[idx]);
  1917. state.maxDepth += tokens[idx].depth;
  1918. }
  1919. if (idx !== 0 || value !== "") parts.push(value);
  1920. prevIndex = i;
  1921. }
  1922. if (prevIndex && prevIndex + 1 < input.length) {
  1923. const value = input.slice(prevIndex + 1);
  1924. parts.push(value);
  1925. if (opts.tokens) {
  1926. tokens[tokens.length - 1].value = value;
  1927. depth(tokens[tokens.length - 1]);
  1928. state.maxDepth += tokens[tokens.length - 1].depth;
  1929. }
  1930. }
  1931. state.slashes = slashes;
  1932. state.parts = parts;
  1933. }
  1934. return state;
  1935. };
  1936. module.exports = scan$1;
  1937. }) });
  1938. //#endregion
  1939. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
  1940. var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js": ((exports, module) => {
  1941. const constants$1 = require_constants$1();
  1942. const utils$12 = require_utils$2();
  1943. /**
  1944. * Constants
  1945. */
  1946. const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants$1;
  1947. /**
  1948. * Helpers
  1949. */
  1950. const expandRange = (args, options$1) => {
  1951. if (typeof options$1.expandRange === "function") return options$1.expandRange(...args, options$1);
  1952. args.sort();
  1953. const value = `[${args.join("-")}]`;
  1954. try {
  1955. new RegExp(value);
  1956. } catch (ex) {
  1957. return args.map((v) => utils$12.escapeRegex(v)).join("..");
  1958. }
  1959. return value;
  1960. };
  1961. /**
  1962. * Create the message for a syntax error
  1963. */
  1964. const syntaxError = (type, char) => {
  1965. return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
  1966. };
  1967. /**
  1968. * Parse the given input string.
  1969. * @param {String} input
  1970. * @param {Object} options
  1971. * @return {Object}
  1972. */
  1973. const parse$1 = (input, options$1) => {
  1974. if (typeof input !== "string") throw new TypeError("Expected a string");
  1975. input = REPLACEMENTS[input] || input;
  1976. const opts = { ...options$1 };
  1977. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  1978. let len = input.length;
  1979. if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  1980. const bos = {
  1981. type: "bos",
  1982. value: "",
  1983. output: opts.prepend || ""
  1984. };
  1985. const tokens = [bos];
  1986. const capture = opts.capture ? "" : "?:";
  1987. const win32$1 = utils$12.isWindows(options$1);
  1988. const PLATFORM_CHARS = constants$1.globChars(win32$1);
  1989. const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS);
  1990. const { DOT_LITERAL: DOT_LITERAL$1, PLUS_LITERAL: PLUS_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT: NO_DOT$1, NO_DOT_SLASH: NO_DOT_SLASH$1, NO_DOTS_SLASH: NO_DOTS_SLASH$1, QMARK: QMARK$1, QMARK_NO_DOT: QMARK_NO_DOT$1, STAR: STAR$1, START_ANCHOR: START_ANCHOR$1 } = PLATFORM_CHARS;
  1991. const globstar = (opts$1) => {
  1992. return `(${capture}(?:(?!${START_ANCHOR$1}${opts$1.dot ? DOTS_SLASH$1 : DOT_LITERAL$1}).)*?)`;
  1993. };
  1994. const nodot = opts.dot ? "" : NO_DOT$1;
  1995. const qmarkNoDot = opts.dot ? QMARK$1 : QMARK_NO_DOT$1;
  1996. let star = opts.bash === true ? globstar(opts) : STAR$1;
  1997. if (opts.capture) star = `(${star})`;
  1998. if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
  1999. const state = {
  2000. input,
  2001. index: -1,
  2002. start: 0,
  2003. dot: opts.dot === true,
  2004. consumed: "",
  2005. output: "",
  2006. prefix: "",
  2007. backtrack: false,
  2008. negated: false,
  2009. brackets: 0,
  2010. braces: 0,
  2011. parens: 0,
  2012. quotes: 0,
  2013. globstar: false,
  2014. tokens
  2015. };
  2016. input = utils$12.removePrefix(input, state);
  2017. len = input.length;
  2018. const extglobs = [];
  2019. const braces$2 = [];
  2020. const stack = [];
  2021. let prev = bos;
  2022. let value;
  2023. /**
  2024. * Tokenizing helpers
  2025. */
  2026. const eos = () => state.index === len - 1;
  2027. const peek = state.peek = (n = 1) => input[state.index + n];
  2028. const advance = state.advance = () => input[++state.index] || "";
  2029. const remaining = () => input.slice(state.index + 1);
  2030. const consume = (value$1 = "", num = 0) => {
  2031. state.consumed += value$1;
  2032. state.index += num;
  2033. };
  2034. const append$1 = (token) => {
  2035. state.output += token.output != null ? token.output : token.value;
  2036. consume(token.value);
  2037. };
  2038. const negate = () => {
  2039. let count = 1;
  2040. while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
  2041. advance();
  2042. state.start++;
  2043. count++;
  2044. }
  2045. if (count % 2 === 0) return false;
  2046. state.negated = true;
  2047. state.start++;
  2048. return true;
  2049. };
  2050. const increment = (type) => {
  2051. state[type]++;
  2052. stack.push(type);
  2053. };
  2054. const decrement = (type) => {
  2055. state[type]--;
  2056. stack.pop();
  2057. };
  2058. /**
  2059. * Push tokens onto the tokens array. This helper speeds up
  2060. * tokenizing by 1) helping us avoid backtracking as much as possible,
  2061. * and 2) helping us avoid creating extra tokens when consecutive
  2062. * characters are plain text. This improves performance and simplifies
  2063. * lookbehinds.
  2064. */
  2065. const push = (tok) => {
  2066. if (prev.type === "globstar") {
  2067. const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
  2068. const isExtglob$1 = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
  2069. if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob$1) {
  2070. state.output = state.output.slice(0, -prev.output.length);
  2071. prev.type = "star";
  2072. prev.value = "*";
  2073. prev.output = star;
  2074. state.output += prev.output;
  2075. }
  2076. }
  2077. if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
  2078. if (tok.value || tok.output) append$1(tok);
  2079. if (prev && prev.type === "text" && tok.type === "text") {
  2080. prev.value += tok.value;
  2081. prev.output = (prev.output || "") + tok.value;
  2082. return;
  2083. }
  2084. tok.prev = prev;
  2085. tokens.push(tok);
  2086. prev = tok;
  2087. };
  2088. const extglobOpen = (type, value$1) => {
  2089. const token = {
  2090. ...EXTGLOB_CHARS[value$1],
  2091. conditions: 1,
  2092. inner: ""
  2093. };
  2094. token.prev = prev;
  2095. token.parens = state.parens;
  2096. token.output = state.output;
  2097. const output = (opts.capture ? "(" : "") + token.open;
  2098. increment("parens");
  2099. push({
  2100. type,
  2101. value: value$1,
  2102. output: state.output ? "" : ONE_CHAR$1
  2103. });
  2104. push({
  2105. type: "paren",
  2106. extglob: true,
  2107. value: advance(),
  2108. output
  2109. });
  2110. extglobs.push(token);
  2111. };
  2112. const extglobClose = (token) => {
  2113. let output = token.close + (opts.capture ? ")" : "");
  2114. let rest;
  2115. if (token.type === "negate") {
  2116. let extglobStar = star;
  2117. if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
  2118. if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
  2119. if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse$1(rest, {
  2120. ...options$1,
  2121. fastpaths: false
  2122. }).output})${extglobStar})`;
  2123. if (token.prev.type === "bos") state.negatedExtglob = true;
  2124. }
  2125. push({
  2126. type: "paren",
  2127. extglob: true,
  2128. value,
  2129. output
  2130. });
  2131. decrement("parens");
  2132. };
  2133. /**
  2134. * Fast paths
  2135. */
  2136. if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
  2137. let backslashes = false;
  2138. let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars$1, first, rest, index) => {
  2139. if (first === "\\") {
  2140. backslashes = true;
  2141. return m;
  2142. }
  2143. if (first === "?") {
  2144. if (esc) return esc + first + (rest ? QMARK$1.repeat(rest.length) : "");
  2145. if (index === 0) return qmarkNoDot + (rest ? QMARK$1.repeat(rest.length) : "");
  2146. return QMARK$1.repeat(chars$1.length);
  2147. }
  2148. if (first === ".") return DOT_LITERAL$1.repeat(chars$1.length);
  2149. if (first === "*") {
  2150. if (esc) return esc + first + (rest ? star : "");
  2151. return star;
  2152. }
  2153. return esc ? m : `\\${m}`;
  2154. });
  2155. if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
  2156. else output = output.replace(/\\+/g, (m) => {
  2157. return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
  2158. });
  2159. if (output === input && opts.contains === true) {
  2160. state.output = input;
  2161. return state;
  2162. }
  2163. state.output = utils$12.wrapOutput(output, state, options$1);
  2164. return state;
  2165. }
  2166. /**
  2167. * Tokenize input until we reach end-of-string
  2168. */
  2169. while (!eos()) {
  2170. value = advance();
  2171. if (value === "\0") continue;
  2172. /**
  2173. * Escaped characters
  2174. */
  2175. if (value === "\\") {
  2176. const next = peek();
  2177. if (next === "/" && opts.bash !== true) continue;
  2178. if (next === "." || next === ";") continue;
  2179. if (!next) {
  2180. value += "\\";
  2181. push({
  2182. type: "text",
  2183. value
  2184. });
  2185. continue;
  2186. }
  2187. const match = /^\\+/.exec(remaining());
  2188. let slashes = 0;
  2189. if (match && match[0].length > 2) {
  2190. slashes = match[0].length;
  2191. state.index += slashes;
  2192. if (slashes % 2 !== 0) value += "\\";
  2193. }
  2194. if (opts.unescape === true) value = advance();
  2195. else value += advance();
  2196. if (state.brackets === 0) {
  2197. push({
  2198. type: "text",
  2199. value
  2200. });
  2201. continue;
  2202. }
  2203. }
  2204. /**
  2205. * If we're inside a regex character class, continue
  2206. * until we reach the closing bracket.
  2207. */
  2208. if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
  2209. if (opts.posix !== false && value === ":") {
  2210. const inner = prev.value.slice(1);
  2211. if (inner.includes("[")) {
  2212. prev.posix = true;
  2213. if (inner.includes(":")) {
  2214. const idx = prev.value.lastIndexOf("[");
  2215. const pre = prev.value.slice(0, idx);
  2216. const rest$1 = prev.value.slice(idx + 2);
  2217. const posix = POSIX_REGEX_SOURCE[rest$1];
  2218. if (posix) {
  2219. prev.value = pre + posix;
  2220. state.backtrack = true;
  2221. advance();
  2222. if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR$1;
  2223. continue;
  2224. }
  2225. }
  2226. }
  2227. }
  2228. if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
  2229. if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
  2230. if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
  2231. prev.value += value;
  2232. append$1({ value });
  2233. continue;
  2234. }
  2235. /**
  2236. * If we're inside a quoted string, continue
  2237. * until we reach the closing double quote.
  2238. */
  2239. if (state.quotes === 1 && value !== "\"") {
  2240. value = utils$12.escapeRegex(value);
  2241. prev.value += value;
  2242. append$1({ value });
  2243. continue;
  2244. }
  2245. /**
  2246. * Double quotes
  2247. */
  2248. if (value === "\"") {
  2249. state.quotes = state.quotes === 1 ? 0 : 1;
  2250. if (opts.keepQuotes === true) push({
  2251. type: "text",
  2252. value
  2253. });
  2254. continue;
  2255. }
  2256. /**
  2257. * Parentheses
  2258. */
  2259. if (value === "(") {
  2260. increment("parens");
  2261. push({
  2262. type: "paren",
  2263. value
  2264. });
  2265. continue;
  2266. }
  2267. if (value === ")") {
  2268. if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
  2269. const extglob = extglobs[extglobs.length - 1];
  2270. if (extglob && state.parens === extglob.parens + 1) {
  2271. extglobClose(extglobs.pop());
  2272. continue;
  2273. }
  2274. push({
  2275. type: "paren",
  2276. value,
  2277. output: state.parens ? ")" : "\\)"
  2278. });
  2279. decrement("parens");
  2280. continue;
  2281. }
  2282. /**
  2283. * Square brackets
  2284. */
  2285. if (value === "[") {
  2286. if (opts.nobracket === true || !remaining().includes("]")) {
  2287. if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
  2288. value = `\\${value}`;
  2289. } else increment("brackets");
  2290. push({
  2291. type: "bracket",
  2292. value
  2293. });
  2294. continue;
  2295. }
  2296. if (value === "]") {
  2297. if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
  2298. push({
  2299. type: "text",
  2300. value,
  2301. output: `\\${value}`
  2302. });
  2303. continue;
  2304. }
  2305. if (state.brackets === 0) {
  2306. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
  2307. push({
  2308. type: "text",
  2309. value,
  2310. output: `\\${value}`
  2311. });
  2312. continue;
  2313. }
  2314. decrement("brackets");
  2315. const prevValue = prev.value.slice(1);
  2316. if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
  2317. prev.value += value;
  2318. append$1({ value });
  2319. if (opts.literalBrackets === false || utils$12.hasRegexChars(prevValue)) continue;
  2320. const escaped$1 = utils$12.escapeRegex(prev.value);
  2321. state.output = state.output.slice(0, -prev.value.length);
  2322. if (opts.literalBrackets === true) {
  2323. state.output += escaped$1;
  2324. prev.value = escaped$1;
  2325. continue;
  2326. }
  2327. prev.value = `(${capture}${escaped$1}|${prev.value})`;
  2328. state.output += prev.value;
  2329. continue;
  2330. }
  2331. /**
  2332. * Braces
  2333. */
  2334. if (value === "{" && opts.nobrace !== true) {
  2335. increment("braces");
  2336. const open = {
  2337. type: "brace",
  2338. value,
  2339. output: "(",
  2340. outputIndex: state.output.length,
  2341. tokensIndex: state.tokens.length
  2342. };
  2343. braces$2.push(open);
  2344. push(open);
  2345. continue;
  2346. }
  2347. if (value === "}") {
  2348. const brace = braces$2[braces$2.length - 1];
  2349. if (opts.nobrace === true || !brace) {
  2350. push({
  2351. type: "text",
  2352. value,
  2353. output: value
  2354. });
  2355. continue;
  2356. }
  2357. let output = ")";
  2358. if (brace.dots === true) {
  2359. const arr = tokens.slice();
  2360. const range = [];
  2361. for (let i = arr.length - 1; i >= 0; i--) {
  2362. tokens.pop();
  2363. if (arr[i].type === "brace") break;
  2364. if (arr[i].type !== "dots") range.unshift(arr[i].value);
  2365. }
  2366. output = expandRange(range, opts);
  2367. state.backtrack = true;
  2368. }
  2369. if (brace.comma !== true && brace.dots !== true) {
  2370. const out = state.output.slice(0, brace.outputIndex);
  2371. const toks = state.tokens.slice(brace.tokensIndex);
  2372. brace.value = brace.output = "\\{";
  2373. value = output = "\\}";
  2374. state.output = out;
  2375. for (const t of toks) state.output += t.output || t.value;
  2376. }
  2377. push({
  2378. type: "brace",
  2379. value,
  2380. output
  2381. });
  2382. decrement("braces");
  2383. braces$2.pop();
  2384. continue;
  2385. }
  2386. /**
  2387. * Pipes
  2388. */
  2389. if (value === "|") {
  2390. if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
  2391. push({
  2392. type: "text",
  2393. value
  2394. });
  2395. continue;
  2396. }
  2397. /**
  2398. * Commas
  2399. */
  2400. if (value === ",") {
  2401. let output = value;
  2402. const brace = braces$2[braces$2.length - 1];
  2403. if (brace && stack[stack.length - 1] === "braces") {
  2404. brace.comma = true;
  2405. output = "|";
  2406. }
  2407. push({
  2408. type: "comma",
  2409. value,
  2410. output
  2411. });
  2412. continue;
  2413. }
  2414. /**
  2415. * Slashes
  2416. */
  2417. if (value === "/") {
  2418. if (prev.type === "dot" && state.index === state.start + 1) {
  2419. state.start = state.index + 1;
  2420. state.consumed = "";
  2421. state.output = "";
  2422. tokens.pop();
  2423. prev = bos;
  2424. continue;
  2425. }
  2426. push({
  2427. type: "slash",
  2428. value,
  2429. output: SLASH_LITERAL$1
  2430. });
  2431. continue;
  2432. }
  2433. /**
  2434. * Dots
  2435. */
  2436. if (value === ".") {
  2437. if (state.braces > 0 && prev.type === "dot") {
  2438. if (prev.value === ".") prev.output = DOT_LITERAL$1;
  2439. const brace = braces$2[braces$2.length - 1];
  2440. prev.type = "dots";
  2441. prev.output += value;
  2442. prev.value += value;
  2443. brace.dots = true;
  2444. continue;
  2445. }
  2446. if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
  2447. push({
  2448. type: "text",
  2449. value,
  2450. output: DOT_LITERAL$1
  2451. });
  2452. continue;
  2453. }
  2454. push({
  2455. type: "dot",
  2456. value,
  2457. output: DOT_LITERAL$1
  2458. });
  2459. continue;
  2460. }
  2461. /**
  2462. * Question marks
  2463. */
  2464. if (value === "?") {
  2465. if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  2466. extglobOpen("qmark", value);
  2467. continue;
  2468. }
  2469. if (prev && prev.type === "paren") {
  2470. const next = peek();
  2471. let output = value;
  2472. if (next === "<" && !utils$12.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
  2473. if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
  2474. push({
  2475. type: "text",
  2476. value,
  2477. output
  2478. });
  2479. continue;
  2480. }
  2481. if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
  2482. push({
  2483. type: "qmark",
  2484. value,
  2485. output: QMARK_NO_DOT$1
  2486. });
  2487. continue;
  2488. }
  2489. push({
  2490. type: "qmark",
  2491. value,
  2492. output: QMARK$1
  2493. });
  2494. continue;
  2495. }
  2496. /**
  2497. * Exclamation
  2498. */
  2499. if (value === "!") {
  2500. if (opts.noextglob !== true && peek() === "(") {
  2501. if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
  2502. extglobOpen("negate", value);
  2503. continue;
  2504. }
  2505. }
  2506. if (opts.nonegate !== true && state.index === 0) {
  2507. negate();
  2508. continue;
  2509. }
  2510. }
  2511. /**
  2512. * Plus
  2513. */
  2514. if (value === "+") {
  2515. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  2516. extglobOpen("plus", value);
  2517. continue;
  2518. }
  2519. if (prev && prev.value === "(" || opts.regex === false) {
  2520. push({
  2521. type: "plus",
  2522. value,
  2523. output: PLUS_LITERAL$1
  2524. });
  2525. continue;
  2526. }
  2527. if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
  2528. push({
  2529. type: "plus",
  2530. value
  2531. });
  2532. continue;
  2533. }
  2534. push({
  2535. type: "plus",
  2536. value: PLUS_LITERAL$1
  2537. });
  2538. continue;
  2539. }
  2540. /**
  2541. * Plain text
  2542. */
  2543. if (value === "@") {
  2544. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  2545. push({
  2546. type: "at",
  2547. extglob: true,
  2548. value,
  2549. output: ""
  2550. });
  2551. continue;
  2552. }
  2553. push({
  2554. type: "text",
  2555. value
  2556. });
  2557. continue;
  2558. }
  2559. /**
  2560. * Plain text
  2561. */
  2562. if (value !== "*") {
  2563. if (value === "$" || value === "^") value = `\\${value}`;
  2564. const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
  2565. if (match) {
  2566. value += match[0];
  2567. state.index += match[0].length;
  2568. }
  2569. push({
  2570. type: "text",
  2571. value
  2572. });
  2573. continue;
  2574. }
  2575. /**
  2576. * Stars
  2577. */
  2578. if (prev && (prev.type === "globstar" || prev.star === true)) {
  2579. prev.type = "star";
  2580. prev.star = true;
  2581. prev.value += value;
  2582. prev.output = star;
  2583. state.backtrack = true;
  2584. state.globstar = true;
  2585. consume(value);
  2586. continue;
  2587. }
  2588. let rest = remaining();
  2589. if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
  2590. extglobOpen("star", value);
  2591. continue;
  2592. }
  2593. if (prev.type === "star") {
  2594. if (opts.noglobstar === true) {
  2595. consume(value);
  2596. continue;
  2597. }
  2598. const prior = prev.prev;
  2599. const before = prior.prev;
  2600. const isStart = prior.type === "slash" || prior.type === "bos";
  2601. const afterStar = before && (before.type === "star" || before.type === "globstar");
  2602. if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
  2603. push({
  2604. type: "star",
  2605. value,
  2606. output: ""
  2607. });
  2608. continue;
  2609. }
  2610. const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
  2611. const isExtglob$1 = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
  2612. if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob$1) {
  2613. push({
  2614. type: "star",
  2615. value,
  2616. output: ""
  2617. });
  2618. continue;
  2619. }
  2620. while (rest.slice(0, 3) === "/**") {
  2621. const after = input[state.index + 4];
  2622. if (after && after !== "/") break;
  2623. rest = rest.slice(3);
  2624. consume("/**", 3);
  2625. }
  2626. if (prior.type === "bos" && eos()) {
  2627. prev.type = "globstar";
  2628. prev.value += value;
  2629. prev.output = globstar(opts);
  2630. state.output = prev.output;
  2631. state.globstar = true;
  2632. consume(value);
  2633. continue;
  2634. }
  2635. if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
  2636. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  2637. prior.output = `(?:${prior.output}`;
  2638. prev.type = "globstar";
  2639. prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
  2640. prev.value += value;
  2641. state.globstar = true;
  2642. state.output += prior.output + prev.output;
  2643. consume(value);
  2644. continue;
  2645. }
  2646. if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
  2647. const end = rest[1] !== void 0 ? "|$" : "";
  2648. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  2649. prior.output = `(?:${prior.output}`;
  2650. prev.type = "globstar";
  2651. prev.output = `${globstar(opts)}${SLASH_LITERAL$1}|${SLASH_LITERAL$1}${end})`;
  2652. prev.value += value;
  2653. state.output += prior.output + prev.output;
  2654. state.globstar = true;
  2655. consume(value + advance());
  2656. push({
  2657. type: "slash",
  2658. value: "/",
  2659. output: ""
  2660. });
  2661. continue;
  2662. }
  2663. if (prior.type === "bos" && rest[0] === "/") {
  2664. prev.type = "globstar";
  2665. prev.value += value;
  2666. prev.output = `(?:^|${SLASH_LITERAL$1}|${globstar(opts)}${SLASH_LITERAL$1})`;
  2667. state.output = prev.output;
  2668. state.globstar = true;
  2669. consume(value + advance());
  2670. push({
  2671. type: "slash",
  2672. value: "/",
  2673. output: ""
  2674. });
  2675. continue;
  2676. }
  2677. state.output = state.output.slice(0, -prev.output.length);
  2678. prev.type = "globstar";
  2679. prev.output = globstar(opts);
  2680. prev.value += value;
  2681. state.output += prev.output;
  2682. state.globstar = true;
  2683. consume(value);
  2684. continue;
  2685. }
  2686. const token = {
  2687. type: "star",
  2688. value,
  2689. output: star
  2690. };
  2691. if (opts.bash === true) {
  2692. token.output = ".*?";
  2693. if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
  2694. push(token);
  2695. continue;
  2696. }
  2697. if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
  2698. token.output = value;
  2699. push(token);
  2700. continue;
  2701. }
  2702. if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
  2703. if (prev.type === "dot") {
  2704. state.output += NO_DOT_SLASH$1;
  2705. prev.output += NO_DOT_SLASH$1;
  2706. } else if (opts.dot === true) {
  2707. state.output += NO_DOTS_SLASH$1;
  2708. prev.output += NO_DOTS_SLASH$1;
  2709. } else {
  2710. state.output += nodot;
  2711. prev.output += nodot;
  2712. }
  2713. if (peek() !== "*") {
  2714. state.output += ONE_CHAR$1;
  2715. prev.output += ONE_CHAR$1;
  2716. }
  2717. }
  2718. push(token);
  2719. }
  2720. while (state.brackets > 0) {
  2721. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
  2722. state.output = utils$12.escapeLast(state.output, "[");
  2723. decrement("brackets");
  2724. }
  2725. while (state.parens > 0) {
  2726. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
  2727. state.output = utils$12.escapeLast(state.output, "(");
  2728. decrement("parens");
  2729. }
  2730. while (state.braces > 0) {
  2731. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
  2732. state.output = utils$12.escapeLast(state.output, "{");
  2733. decrement("braces");
  2734. }
  2735. if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
  2736. type: "maybe_slash",
  2737. value: "",
  2738. output: `${SLASH_LITERAL$1}?`
  2739. });
  2740. if (state.backtrack === true) {
  2741. state.output = "";
  2742. for (const token of state.tokens) {
  2743. state.output += token.output != null ? token.output : token.value;
  2744. if (token.suffix) state.output += token.suffix;
  2745. }
  2746. }
  2747. return state;
  2748. };
  2749. /**
  2750. * Fast paths for creating regular expressions for common glob patterns.
  2751. * This can significantly speed up processing and has very little downside
  2752. * impact when none of the fast paths match.
  2753. */
  2754. parse$1.fastpaths = (input, options$1) => {
  2755. const opts = { ...options$1 };
  2756. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  2757. const len = input.length;
  2758. if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  2759. input = REPLACEMENTS[input] || input;
  2760. const win32$1 = utils$12.isWindows(options$1);
  2761. const { DOT_LITERAL: DOT_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT: NO_DOT$1, NO_DOTS: NO_DOTS$1, NO_DOTS_SLASH: NO_DOTS_SLASH$1, STAR: STAR$1, START_ANCHOR: START_ANCHOR$1 } = constants$1.globChars(win32$1);
  2762. const nodot = opts.dot ? NO_DOTS$1 : NO_DOT$1;
  2763. const slashDot = opts.dot ? NO_DOTS_SLASH$1 : NO_DOT$1;
  2764. const capture = opts.capture ? "" : "?:";
  2765. const state = {
  2766. negated: false,
  2767. prefix: ""
  2768. };
  2769. let star = opts.bash === true ? ".*?" : STAR$1;
  2770. if (opts.capture) star = `(${star})`;
  2771. const globstar = (opts$1) => {
  2772. if (opts$1.noglobstar === true) return star;
  2773. return `(${capture}(?:(?!${START_ANCHOR$1}${opts$1.dot ? DOTS_SLASH$1 : DOT_LITERAL$1}).)*?)`;
  2774. };
  2775. const create = (str) => {
  2776. switch (str) {
  2777. case "*": return `${nodot}${ONE_CHAR$1}${star}`;
  2778. case ".*": return `${DOT_LITERAL$1}${ONE_CHAR$1}${star}`;
  2779. case "*.*": return `${nodot}${star}${DOT_LITERAL$1}${ONE_CHAR$1}${star}`;
  2780. case "*/*": return `${nodot}${star}${SLASH_LITERAL$1}${ONE_CHAR$1}${slashDot}${star}`;
  2781. case "**": return nodot + globstar(opts);
  2782. case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL$1})?${slashDot}${ONE_CHAR$1}${star}`;
  2783. case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL$1})?${slashDot}${star}${DOT_LITERAL$1}${ONE_CHAR$1}${star}`;
  2784. case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL$1})?${DOT_LITERAL$1}${ONE_CHAR$1}${star}`;
  2785. default: {
  2786. const match = /^(.*?)\.(\w+)$/.exec(str);
  2787. if (!match) return;
  2788. const source$1 = create(match[1]);
  2789. if (!source$1) return;
  2790. return source$1 + DOT_LITERAL$1 + match[2];
  2791. }
  2792. }
  2793. };
  2794. const output = utils$12.removePrefix(input, state);
  2795. let source = create(output);
  2796. if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL$1}?`;
  2797. return source;
  2798. };
  2799. module.exports = parse$1;
  2800. }) });
  2801. //#endregion
  2802. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
  2803. var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js": ((exports, module) => {
  2804. const path$7 = __require("path");
  2805. const scan = require_scan();
  2806. const parse = require_parse();
  2807. const utils$11 = require_utils$2();
  2808. const constants = require_constants$1();
  2809. const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
  2810. /**
  2811. * Creates a matcher function from one or more glob patterns. The
  2812. * returned function takes a string to match as its first argument,
  2813. * and returns true if the string is a match. The returned matcher
  2814. * function also takes a boolean as the second argument that, when true,
  2815. * returns an object with additional information.
  2816. *
  2817. * ```js
  2818. * const picomatch = require('picomatch');
  2819. * // picomatch(glob[, options]);
  2820. *
  2821. * const isMatch = picomatch('*.!(*a)');
  2822. * console.log(isMatch('a.a')); //=> false
  2823. * console.log(isMatch('a.b')); //=> true
  2824. * ```
  2825. * @name picomatch
  2826. * @param {String|Array} `globs` One or more glob patterns.
  2827. * @param {Object=} `options`
  2828. * @return {Function=} Returns a matcher function.
  2829. * @api public
  2830. */
  2831. const picomatch$1 = (glob, options$1, returnState = false) => {
  2832. if (Array.isArray(glob)) {
  2833. const fns = glob.map((input) => picomatch$1(input, options$1, returnState));
  2834. const arrayMatcher = (str) => {
  2835. for (const isMatch of fns) {
  2836. const state$1 = isMatch(str);
  2837. if (state$1) return state$1;
  2838. }
  2839. return false;
  2840. };
  2841. return arrayMatcher;
  2842. }
  2843. const isState = isObject(glob) && glob.tokens && glob.input;
  2844. if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
  2845. const opts = options$1 || {};
  2846. const posix = utils$11.isWindows(options$1);
  2847. const regex = isState ? picomatch$1.compileRe(glob, options$1) : picomatch$1.makeRe(glob, options$1, false, true);
  2848. const state = regex.state;
  2849. delete regex.state;
  2850. let isIgnored = () => false;
  2851. if (opts.ignore) {
  2852. const ignoreOpts = {
  2853. ...options$1,
  2854. ignore: null,
  2855. onMatch: null,
  2856. onResult: null
  2857. };
  2858. isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState);
  2859. }
  2860. const matcher = (input, returnObject = false) => {
  2861. const { isMatch, match, output } = picomatch$1.test(input, regex, options$1, {
  2862. glob,
  2863. posix
  2864. });
  2865. const result = {
  2866. glob,
  2867. state,
  2868. regex,
  2869. posix,
  2870. input,
  2871. output,
  2872. match,
  2873. isMatch
  2874. };
  2875. if (typeof opts.onResult === "function") opts.onResult(result);
  2876. if (isMatch === false) {
  2877. result.isMatch = false;
  2878. return returnObject ? result : false;
  2879. }
  2880. if (isIgnored(input)) {
  2881. if (typeof opts.onIgnore === "function") opts.onIgnore(result);
  2882. result.isMatch = false;
  2883. return returnObject ? result : false;
  2884. }
  2885. if (typeof opts.onMatch === "function") opts.onMatch(result);
  2886. return returnObject ? result : true;
  2887. };
  2888. if (returnState) matcher.state = state;
  2889. return matcher;
  2890. };
  2891. /**
  2892. * Test `input` with the given `regex`. This is used by the main
  2893. * `picomatch()` function to test the input string.
  2894. *
  2895. * ```js
  2896. * const picomatch = require('picomatch');
  2897. * // picomatch.test(input, regex[, options]);
  2898. *
  2899. * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
  2900. * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
  2901. * ```
  2902. * @param {String} `input` String to test.
  2903. * @param {RegExp} `regex`
  2904. * @return {Object} Returns an object with matching info.
  2905. * @api public
  2906. */
  2907. picomatch$1.test = (input, regex, options$1, { glob, posix } = {}) => {
  2908. if (typeof input !== "string") throw new TypeError("Expected input to be a string");
  2909. if (input === "") return {
  2910. isMatch: false,
  2911. output: ""
  2912. };
  2913. const opts = options$1 || {};
  2914. const format = opts.format || (posix ? utils$11.toPosixSlashes : null);
  2915. let match = input === glob;
  2916. let output = match && format ? format(input) : input;
  2917. if (match === false) {
  2918. output = format ? format(input) : input;
  2919. match = output === glob;
  2920. }
  2921. if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch$1.matchBase(input, regex, options$1, posix);
  2922. else match = regex.exec(output);
  2923. return {
  2924. isMatch: Boolean(match),
  2925. match,
  2926. output
  2927. };
  2928. };
  2929. /**
  2930. * Match the basename of a filepath.
  2931. *
  2932. * ```js
  2933. * const picomatch = require('picomatch');
  2934. * // picomatch.matchBase(input, glob[, options]);
  2935. * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
  2936. * ```
  2937. * @param {String} `input` String to test.
  2938. * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
  2939. * @return {Boolean}
  2940. * @api public
  2941. */
  2942. picomatch$1.matchBase = (input, glob, options$1, posix = utils$11.isWindows(options$1)) => {
  2943. return (glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options$1)).test(path$7.basename(input));
  2944. };
  2945. /**
  2946. * Returns true if **any** of the given glob `patterns` match the specified `string`.
  2947. *
  2948. * ```js
  2949. * const picomatch = require('picomatch');
  2950. * // picomatch.isMatch(string, patterns[, options]);
  2951. *
  2952. * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
  2953. * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
  2954. * ```
  2955. * @param {String|Array} str The string to test.
  2956. * @param {String|Array} patterns One or more glob patterns to use for matching.
  2957. * @param {Object} [options] See available [options](#options).
  2958. * @return {Boolean} Returns true if any patterns match `str`
  2959. * @api public
  2960. */
  2961. picomatch$1.isMatch = (str, patterns, options$1) => picomatch$1(patterns, options$1)(str);
  2962. /**
  2963. * Parse a glob pattern to create the source string for a regular
  2964. * expression.
  2965. *
  2966. * ```js
  2967. * const picomatch = require('picomatch');
  2968. * const result = picomatch.parse(pattern[, options]);
  2969. * ```
  2970. * @param {String} `pattern`
  2971. * @param {Object} `options`
  2972. * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
  2973. * @api public
  2974. */
  2975. picomatch$1.parse = (pattern$1, options$1) => {
  2976. if (Array.isArray(pattern$1)) return pattern$1.map((p) => picomatch$1.parse(p, options$1));
  2977. return parse(pattern$1, {
  2978. ...options$1,
  2979. fastpaths: false
  2980. });
  2981. };
  2982. /**
  2983. * Scan a glob pattern to separate the pattern into segments.
  2984. *
  2985. * ```js
  2986. * const picomatch = require('picomatch');
  2987. * // picomatch.scan(input[, options]);
  2988. *
  2989. * const result = picomatch.scan('!./foo/*.js');
  2990. * console.log(result);
  2991. * { prefix: '!./',
  2992. * input: '!./foo/*.js',
  2993. * start: 3,
  2994. * base: 'foo',
  2995. * glob: '*.js',
  2996. * isBrace: false,
  2997. * isBracket: false,
  2998. * isGlob: true,
  2999. * isExtglob: false,
  3000. * isGlobstar: false,
  3001. * negated: true }
  3002. * ```
  3003. * @param {String} `input` Glob pattern to scan.
  3004. * @param {Object} `options`
  3005. * @return {Object} Returns an object with
  3006. * @api public
  3007. */
  3008. picomatch$1.scan = (input, options$1) => scan(input, options$1);
  3009. /**
  3010. * Compile a regular expression from the `state` object returned by the
  3011. * [parse()](#parse) method.
  3012. *
  3013. * @param {Object} `state`
  3014. * @param {Object} `options`
  3015. * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
  3016. * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
  3017. * @return {RegExp}
  3018. * @api public
  3019. */
  3020. picomatch$1.compileRe = (state, options$1, returnOutput = false, returnState = false) => {
  3021. if (returnOutput === true) return state.output;
  3022. const opts = options$1 || {};
  3023. const prepend = opts.contains ? "" : "^";
  3024. const append$1 = opts.contains ? "" : "$";
  3025. let source = `${prepend}(?:${state.output})${append$1}`;
  3026. if (state && state.negated === true) source = `^(?!${source}).*$`;
  3027. const regex = picomatch$1.toRegex(source, options$1);
  3028. if (returnState === true) regex.state = state;
  3029. return regex;
  3030. };
  3031. /**
  3032. * Create a regular expression from a parsed glob pattern.
  3033. *
  3034. * ```js
  3035. * const picomatch = require('picomatch');
  3036. * const state = picomatch.parse('*.js');
  3037. * // picomatch.compileRe(state[, options]);
  3038. *
  3039. * console.log(picomatch.compileRe(state));
  3040. * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
  3041. * ```
  3042. * @param {String} `state` The object returned from the `.parse` method.
  3043. * @param {Object} `options`
  3044. * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
  3045. * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
  3046. * @return {RegExp} Returns a regex created from the given pattern.
  3047. * @api public
  3048. */
  3049. picomatch$1.makeRe = (input, options$1 = {}, returnOutput = false, returnState = false) => {
  3050. if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
  3051. let parsed = {
  3052. negated: false,
  3053. fastpaths: true
  3054. };
  3055. if (options$1.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options$1);
  3056. if (!parsed.output) parsed = parse(input, options$1);
  3057. return picomatch$1.compileRe(parsed, options$1, returnOutput, returnState);
  3058. };
  3059. /**
  3060. * Create a regular expression from the given regex source string.
  3061. *
  3062. * ```js
  3063. * const picomatch = require('picomatch');
  3064. * // picomatch.toRegex(source[, options]);
  3065. *
  3066. * const { output } = picomatch.parse('*.js');
  3067. * console.log(picomatch.toRegex(output));
  3068. * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
  3069. * ```
  3070. * @param {String} `source` Regular expression source string.
  3071. * @param {Object} `options`
  3072. * @return {RegExp}
  3073. * @api public
  3074. */
  3075. picomatch$1.toRegex = (source, options$1) => {
  3076. try {
  3077. const opts = options$1 || {};
  3078. return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
  3079. } catch (err) {
  3080. if (options$1 && options$1.debug === true) throw err;
  3081. return /$^/;
  3082. }
  3083. };
  3084. /**
  3085. * Picomatch constants.
  3086. * @return {Object}
  3087. */
  3088. picomatch$1.constants = constants;
  3089. /**
  3090. * Expose "picomatch"
  3091. */
  3092. module.exports = picomatch$1;
  3093. }) });
  3094. //#endregion
  3095. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js
  3096. var require_picomatch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js": ((exports, module) => {
  3097. module.exports = require_picomatch$1();
  3098. }) });
  3099. //#endregion
  3100. //#region ../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js
  3101. var require_micromatch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js": ((exports, module) => {
  3102. const util = __require("util");
  3103. const braces = require_braces();
  3104. const picomatch = require_picomatch();
  3105. const utils$10 = require_utils$2();
  3106. const isEmptyString = (v) => v === "" || v === "./";
  3107. const hasBraces = (v) => {
  3108. const index = v.indexOf("{");
  3109. return index > -1 && v.indexOf("}", index) > -1;
  3110. };
  3111. /**
  3112. * Returns an array of strings that match one or more glob patterns.
  3113. *
  3114. * ```js
  3115. * const mm = require('micromatch');
  3116. * // mm(list, patterns[, options]);
  3117. *
  3118. * console.log(mm(['a.js', 'a.txt'], ['*.js']));
  3119. * //=> [ 'a.js' ]
  3120. * ```
  3121. * @param {String|Array<string>} `list` List of strings to match.
  3122. * @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
  3123. * @param {Object} `options` See available [options](#options)
  3124. * @return {Array} Returns an array of matches
  3125. * @summary false
  3126. * @api public
  3127. */
  3128. const micromatch$1 = (list, patterns, options$1) => {
  3129. patterns = [].concat(patterns);
  3130. list = [].concat(list);
  3131. let omit = /* @__PURE__ */ new Set();
  3132. let keep = /* @__PURE__ */ new Set();
  3133. let items = /* @__PURE__ */ new Set();
  3134. let negatives = 0;
  3135. let onResult = (state) => {
  3136. items.add(state.output);
  3137. if (options$1 && options$1.onResult) options$1.onResult(state);
  3138. };
  3139. for (let i = 0; i < patterns.length; i++) {
  3140. let isMatch = picomatch(String(patterns[i]), {
  3141. ...options$1,
  3142. onResult
  3143. }, true);
  3144. let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
  3145. if (negated) negatives++;
  3146. for (let item of list) {
  3147. let matched = isMatch(item, true);
  3148. if (!(negated ? !matched.isMatch : matched.isMatch)) continue;
  3149. if (negated) omit.add(matched.output);
  3150. else {
  3151. omit.delete(matched.output);
  3152. keep.add(matched.output);
  3153. }
  3154. }
  3155. }
  3156. let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item));
  3157. if (options$1 && matches.length === 0) {
  3158. if (options$1.failglob === true) throw new Error(`No matches found for "${patterns.join(", ")}"`);
  3159. if (options$1.nonull === true || options$1.nullglob === true) return options$1.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
  3160. }
  3161. return matches;
  3162. };
  3163. /**
  3164. * Backwards compatibility
  3165. */
  3166. micromatch$1.match = micromatch$1;
  3167. /**
  3168. * Returns a matcher function from the given glob `pattern` and `options`.
  3169. * The returned function takes a string to match as its only argument and returns
  3170. * true if the string is a match.
  3171. *
  3172. * ```js
  3173. * const mm = require('micromatch');
  3174. * // mm.matcher(pattern[, options]);
  3175. *
  3176. * const isMatch = mm.matcher('*.!(*a)');
  3177. * console.log(isMatch('a.a')); //=> false
  3178. * console.log(isMatch('a.b')); //=> true
  3179. * ```
  3180. * @param {String} `pattern` Glob pattern
  3181. * @param {Object} `options`
  3182. * @return {Function} Returns a matcher function.
  3183. * @api public
  3184. */
  3185. micromatch$1.matcher = (pattern$1, options$1) => picomatch(pattern$1, options$1);
  3186. /**
  3187. * Returns true if **any** of the given glob `patterns` match the specified `string`.
  3188. *
  3189. * ```js
  3190. * const mm = require('micromatch');
  3191. * // mm.isMatch(string, patterns[, options]);
  3192. *
  3193. * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
  3194. * console.log(mm.isMatch('a.a', 'b.*')); //=> false
  3195. * ```
  3196. * @param {String} `str` The string to test.
  3197. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3198. * @param {Object} `[options]` See available [options](#options).
  3199. * @return {Boolean} Returns true if any patterns match `str`
  3200. * @api public
  3201. */
  3202. micromatch$1.isMatch = (str, patterns, options$1) => picomatch(patterns, options$1)(str);
  3203. /**
  3204. * Backwards compatibility
  3205. */
  3206. micromatch$1.any = micromatch$1.isMatch;
  3207. /**
  3208. * Returns a list of strings that _**do not match any**_ of the given `patterns`.
  3209. *
  3210. * ```js
  3211. * const mm = require('micromatch');
  3212. * // mm.not(list, patterns[, options]);
  3213. *
  3214. * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
  3215. * //=> ['b.b', 'c.c']
  3216. * ```
  3217. * @param {Array} `list` Array of strings to match.
  3218. * @param {String|Array} `patterns` One or more glob pattern to use for matching.
  3219. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3220. * @return {Array} Returns an array of strings that **do not match** the given patterns.
  3221. * @api public
  3222. */
  3223. micromatch$1.not = (list, patterns, options$1 = {}) => {
  3224. patterns = [].concat(patterns).map(String);
  3225. let result = /* @__PURE__ */ new Set();
  3226. let items = [];
  3227. let onResult = (state) => {
  3228. if (options$1.onResult) options$1.onResult(state);
  3229. items.push(state.output);
  3230. };
  3231. let matches = new Set(micromatch$1(list, patterns, {
  3232. ...options$1,
  3233. onResult
  3234. }));
  3235. for (let item of items) if (!matches.has(item)) result.add(item);
  3236. return [...result];
  3237. };
  3238. /**
  3239. * Returns true if the given `string` contains the given pattern. Similar
  3240. * to [.isMatch](#isMatch) but the pattern can match any part of the string.
  3241. *
  3242. * ```js
  3243. * var mm = require('micromatch');
  3244. * // mm.contains(string, pattern[, options]);
  3245. *
  3246. * console.log(mm.contains('aa/bb/cc', '*b'));
  3247. * //=> true
  3248. * console.log(mm.contains('aa/bb/cc', '*d'));
  3249. * //=> false
  3250. * ```
  3251. * @param {String} `str` The string to match.
  3252. * @param {String|Array} `patterns` Glob pattern to use for matching.
  3253. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3254. * @return {Boolean} Returns true if any of the patterns matches any part of `str`.
  3255. * @api public
  3256. */
  3257. micromatch$1.contains = (str, pattern$1, options$1) => {
  3258. if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  3259. if (Array.isArray(pattern$1)) return pattern$1.some((p) => micromatch$1.contains(str, p, options$1));
  3260. if (typeof pattern$1 === "string") {
  3261. if (isEmptyString(str) || isEmptyString(pattern$1)) return false;
  3262. if (str.includes(pattern$1) || str.startsWith("./") && str.slice(2).includes(pattern$1)) return true;
  3263. }
  3264. return micromatch$1.isMatch(str, pattern$1, {
  3265. ...options$1,
  3266. contains: true
  3267. });
  3268. };
  3269. /**
  3270. * Filter the keys of the given object with the given `glob` pattern
  3271. * and `options`. Does not attempt to match nested keys. If you need this feature,
  3272. * use [glob-object][] instead.
  3273. *
  3274. * ```js
  3275. * const mm = require('micromatch');
  3276. * // mm.matchKeys(object, patterns[, options]);
  3277. *
  3278. * const obj = { aa: 'a', ab: 'b', ac: 'c' };
  3279. * console.log(mm.matchKeys(obj, '*b'));
  3280. * //=> { ab: 'b' }
  3281. * ```
  3282. * @param {Object} `object` The object with keys to filter.
  3283. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3284. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3285. * @return {Object} Returns an object with only keys that match the given patterns.
  3286. * @api public
  3287. */
  3288. micromatch$1.matchKeys = (obj, patterns, options$1) => {
  3289. if (!utils$10.isObject(obj)) throw new TypeError("Expected the first argument to be an object");
  3290. let keys$1 = micromatch$1(Object.keys(obj), patterns, options$1);
  3291. let res = {};
  3292. for (let key of keys$1) res[key] = obj[key];
  3293. return res;
  3294. };
  3295. /**
  3296. * Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
  3297. *
  3298. * ```js
  3299. * const mm = require('micromatch');
  3300. * // mm.some(list, patterns[, options]);
  3301. *
  3302. * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
  3303. * // true
  3304. * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
  3305. * // false
  3306. * ```
  3307. * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
  3308. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3309. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3310. * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
  3311. * @api public
  3312. */
  3313. micromatch$1.some = (list, patterns, options$1) => {
  3314. let items = [].concat(list);
  3315. for (let pattern$1 of [].concat(patterns)) {
  3316. let isMatch = picomatch(String(pattern$1), options$1);
  3317. if (items.some((item) => isMatch(item))) return true;
  3318. }
  3319. return false;
  3320. };
  3321. /**
  3322. * Returns true if every string in the given `list` matches
  3323. * any of the given glob `patterns`.
  3324. *
  3325. * ```js
  3326. * const mm = require('micromatch');
  3327. * // mm.every(list, patterns[, options]);
  3328. *
  3329. * console.log(mm.every('foo.js', ['foo.js']));
  3330. * // true
  3331. * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
  3332. * // true
  3333. * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
  3334. * // false
  3335. * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
  3336. * // false
  3337. * ```
  3338. * @param {String|Array} `list` The string or array of strings to test.
  3339. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3340. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3341. * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
  3342. * @api public
  3343. */
  3344. micromatch$1.every = (list, patterns, options$1) => {
  3345. let items = [].concat(list);
  3346. for (let pattern$1 of [].concat(patterns)) {
  3347. let isMatch = picomatch(String(pattern$1), options$1);
  3348. if (!items.every((item) => isMatch(item))) return false;
  3349. }
  3350. return true;
  3351. };
  3352. /**
  3353. * Returns true if **all** of the given `patterns` match
  3354. * the specified string.
  3355. *
  3356. * ```js
  3357. * const mm = require('micromatch');
  3358. * // mm.all(string, patterns[, options]);
  3359. *
  3360. * console.log(mm.all('foo.js', ['foo.js']));
  3361. * // true
  3362. *
  3363. * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
  3364. * // false
  3365. *
  3366. * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
  3367. * // true
  3368. *
  3369. * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
  3370. * // true
  3371. * ```
  3372. * @param {String|Array} `str` The string to test.
  3373. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3374. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3375. * @return {Boolean} Returns true if any patterns match `str`
  3376. * @api public
  3377. */
  3378. micromatch$1.all = (str, patterns, options$1) => {
  3379. if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  3380. return [].concat(patterns).every((p) => picomatch(p, options$1)(str));
  3381. };
  3382. /**
  3383. * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
  3384. *
  3385. * ```js
  3386. * const mm = require('micromatch');
  3387. * // mm.capture(pattern, string[, options]);
  3388. *
  3389. * console.log(mm.capture('test/*.js', 'test/foo.js'));
  3390. * //=> ['foo']
  3391. * console.log(mm.capture('test/*.js', 'foo/bar.css'));
  3392. * //=> null
  3393. * ```
  3394. * @param {String} `glob` Glob pattern to use for matching.
  3395. * @param {String} `input` String to match
  3396. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3397. * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
  3398. * @api public
  3399. */
  3400. micromatch$1.capture = (glob, input, options$1) => {
  3401. let posix = utils$10.isWindows(options$1);
  3402. let match = picomatch.makeRe(String(glob), {
  3403. ...options$1,
  3404. capture: true
  3405. }).exec(posix ? utils$10.toPosixSlashes(input) : input);
  3406. if (match) return match.slice(1).map((v) => v === void 0 ? "" : v);
  3407. };
  3408. /**
  3409. * Create a regular expression from the given glob `pattern`.
  3410. *
  3411. * ```js
  3412. * const mm = require('micromatch');
  3413. * // mm.makeRe(pattern[, options]);
  3414. *
  3415. * console.log(mm.makeRe('*.js'));
  3416. * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
  3417. * ```
  3418. * @param {String} `pattern` A glob pattern to convert to regex.
  3419. * @param {Object} `options`
  3420. * @return {RegExp} Returns a regex created from the given pattern.
  3421. * @api public
  3422. */
  3423. micromatch$1.makeRe = (...args) => picomatch.makeRe(...args);
  3424. /**
  3425. * Scan a glob pattern to separate the pattern into segments. Used
  3426. * by the [split](#split) method.
  3427. *
  3428. * ```js
  3429. * const mm = require('micromatch');
  3430. * const state = mm.scan(pattern[, options]);
  3431. * ```
  3432. * @param {String} `pattern`
  3433. * @param {Object} `options`
  3434. * @return {Object} Returns an object with
  3435. * @api public
  3436. */
  3437. micromatch$1.scan = (...args) => picomatch.scan(...args);
  3438. /**
  3439. * Parse a glob pattern to create the source string for a regular
  3440. * expression.
  3441. *
  3442. * ```js
  3443. * const mm = require('micromatch');
  3444. * const state = mm.parse(pattern[, options]);
  3445. * ```
  3446. * @param {String} `glob`
  3447. * @param {Object} `options`
  3448. * @return {Object} Returns an object with useful properties and output to be used as regex source string.
  3449. * @api public
  3450. */
  3451. micromatch$1.parse = (patterns, options$1) => {
  3452. let res = [];
  3453. for (let pattern$1 of [].concat(patterns || [])) for (let str of braces(String(pattern$1), options$1)) res.push(picomatch.parse(str, options$1));
  3454. return res;
  3455. };
  3456. /**
  3457. * Process the given brace `pattern`.
  3458. *
  3459. * ```js
  3460. * const { braces } = require('micromatch');
  3461. * console.log(braces('foo/{a,b,c}/bar'));
  3462. * //=> [ 'foo/(a|b|c)/bar' ]
  3463. *
  3464. * console.log(braces('foo/{a,b,c}/bar', { expand: true }));
  3465. * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
  3466. * ```
  3467. * @param {String} `pattern` String with brace pattern to process.
  3468. * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
  3469. * @return {Array}
  3470. * @api public
  3471. */
  3472. micromatch$1.braces = (pattern$1, options$1) => {
  3473. if (typeof pattern$1 !== "string") throw new TypeError("Expected a string");
  3474. if (options$1 && options$1.nobrace === true || !hasBraces(pattern$1)) return [pattern$1];
  3475. return braces(pattern$1, options$1);
  3476. };
  3477. /**
  3478. * Expand braces
  3479. */
  3480. micromatch$1.braceExpand = (pattern$1, options$1) => {
  3481. if (typeof pattern$1 !== "string") throw new TypeError("Expected a string");
  3482. return micromatch$1.braces(pattern$1, {
  3483. ...options$1,
  3484. expand: true
  3485. });
  3486. };
  3487. /**
  3488. * Expose micromatch
  3489. */
  3490. micromatch$1.hasBraces = hasBraces;
  3491. module.exports = micromatch$1;
  3492. }) });
  3493. //#endregion
  3494. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js
  3495. var require_pattern = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js": ((exports) => {
  3496. Object.defineProperty(exports, "__esModule", { value: true });
  3497. const path$6 = __require("path");
  3498. const globParent = require_glob_parent();
  3499. const micromatch = require_micromatch();
  3500. const GLOBSTAR = "**";
  3501. const ESCAPE_SYMBOL = "\\";
  3502. const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
  3503. const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
  3504. const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
  3505. const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
  3506. const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
  3507. /**
  3508. * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
  3509. * The latter is due to the presence of the device path at the beginning of the UNC path.
  3510. */
  3511. const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
  3512. function isStaticPattern(pattern$1, options$1 = {}) {
  3513. return !isDynamicPattern(pattern$1, options$1);
  3514. }
  3515. exports.isStaticPattern = isStaticPattern;
  3516. function isDynamicPattern(pattern$1, options$1 = {}) {
  3517. /**
  3518. * A special case with an empty string is necessary for matching patterns that start with a forward slash.
  3519. * An empty string cannot be a dynamic pattern.
  3520. * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
  3521. */
  3522. if (pattern$1 === "") return false;
  3523. /**
  3524. * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
  3525. * filepath directly (without read directory).
  3526. */
  3527. if (options$1.caseSensitiveMatch === false || pattern$1.includes(ESCAPE_SYMBOL)) return true;
  3528. if (COMMON_GLOB_SYMBOLS_RE.test(pattern$1) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern$1) || REGEX_GROUP_SYMBOLS_RE.test(pattern$1)) return true;
  3529. if (options$1.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern$1)) return true;
  3530. if (options$1.braceExpansion !== false && hasBraceExpansion(pattern$1)) return true;
  3531. return false;
  3532. }
  3533. exports.isDynamicPattern = isDynamicPattern;
  3534. function hasBraceExpansion(pattern$1) {
  3535. const openingBraceIndex = pattern$1.indexOf("{");
  3536. if (openingBraceIndex === -1) return false;
  3537. const closingBraceIndex = pattern$1.indexOf("}", openingBraceIndex + 1);
  3538. if (closingBraceIndex === -1) return false;
  3539. const braceContent = pattern$1.slice(openingBraceIndex, closingBraceIndex);
  3540. return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
  3541. }
  3542. function convertToPositivePattern(pattern$1) {
  3543. return isNegativePattern(pattern$1) ? pattern$1.slice(1) : pattern$1;
  3544. }
  3545. exports.convertToPositivePattern = convertToPositivePattern;
  3546. function convertToNegativePattern(pattern$1) {
  3547. return "!" + pattern$1;
  3548. }
  3549. exports.convertToNegativePattern = convertToNegativePattern;
  3550. function isNegativePattern(pattern$1) {
  3551. return pattern$1.startsWith("!") && pattern$1[1] !== "(";
  3552. }
  3553. exports.isNegativePattern = isNegativePattern;
  3554. function isPositivePattern(pattern$1) {
  3555. return !isNegativePattern(pattern$1);
  3556. }
  3557. exports.isPositivePattern = isPositivePattern;
  3558. function getNegativePatterns(patterns) {
  3559. return patterns.filter(isNegativePattern);
  3560. }
  3561. exports.getNegativePatterns = getNegativePatterns;
  3562. function getPositivePatterns$1(patterns) {
  3563. return patterns.filter(isPositivePattern);
  3564. }
  3565. exports.getPositivePatterns = getPositivePatterns$1;
  3566. /**
  3567. * Returns patterns that can be applied inside the current directory.
  3568. *
  3569. * @example
  3570. * // ['./*', '*', 'a/*']
  3571. * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
  3572. */
  3573. function getPatternsInsideCurrentDirectory(patterns) {
  3574. return patterns.filter((pattern$1) => !isPatternRelatedToParentDirectory(pattern$1));
  3575. }
  3576. exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
  3577. /**
  3578. * Returns patterns to be expanded relative to (outside) the current directory.
  3579. *
  3580. * @example
  3581. * // ['../*', './../*']
  3582. * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
  3583. */
  3584. function getPatternsOutsideCurrentDirectory(patterns) {
  3585. return patterns.filter(isPatternRelatedToParentDirectory);
  3586. }
  3587. exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
  3588. function isPatternRelatedToParentDirectory(pattern$1) {
  3589. return pattern$1.startsWith("..") || pattern$1.startsWith("./..");
  3590. }
  3591. exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
  3592. function getBaseDirectory(pattern$1) {
  3593. return globParent(pattern$1, { flipBackslashes: false });
  3594. }
  3595. exports.getBaseDirectory = getBaseDirectory;
  3596. function hasGlobStar(pattern$1) {
  3597. return pattern$1.includes(GLOBSTAR);
  3598. }
  3599. exports.hasGlobStar = hasGlobStar;
  3600. function endsWithSlashGlobStar(pattern$1) {
  3601. return pattern$1.endsWith("/" + GLOBSTAR);
  3602. }
  3603. exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
  3604. function isAffectDepthOfReadingPattern(pattern$1) {
  3605. const basename = path$6.basename(pattern$1);
  3606. return endsWithSlashGlobStar(pattern$1) || isStaticPattern(basename);
  3607. }
  3608. exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
  3609. function expandPatternsWithBraceExpansion(patterns) {
  3610. return patterns.reduce((collection, pattern$1) => {
  3611. return collection.concat(expandBraceExpansion(pattern$1));
  3612. }, []);
  3613. }
  3614. exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
  3615. function expandBraceExpansion(pattern$1) {
  3616. const patterns = micromatch.braces(pattern$1, {
  3617. expand: true,
  3618. nodupes: true,
  3619. keepEscaping: true
  3620. });
  3621. /**
  3622. * Sort the patterns by length so that the same depth patterns are processed side by side.
  3623. * `a/{b,}/{c,}/*` `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']`
  3624. */
  3625. patterns.sort((a, b) => a.length - b.length);
  3626. /**
  3627. * Micromatch can return an empty string in the case of patterns like `{a,}`.
  3628. */
  3629. return patterns.filter((pattern$2) => pattern$2 !== "");
  3630. }
  3631. exports.expandBraceExpansion = expandBraceExpansion;
  3632. function getPatternParts(pattern$1, options$1) {
  3633. let { parts } = micromatch.scan(pattern$1, Object.assign(Object.assign({}, options$1), { parts: true }));
  3634. /**
  3635. * The scan method returns an empty array in some cases.
  3636. * See micromatch/picomatch#58 for more details.
  3637. */
  3638. if (parts.length === 0) parts = [pattern$1];
  3639. /**
  3640. * The scan method does not return an empty part for the pattern with a forward slash.
  3641. * This is another part of micromatch/picomatch#58.
  3642. */
  3643. if (parts[0].startsWith("/")) {
  3644. parts[0] = parts[0].slice(1);
  3645. parts.unshift("");
  3646. }
  3647. return parts;
  3648. }
  3649. exports.getPatternParts = getPatternParts;
  3650. function makeRe(pattern$1, options$1) {
  3651. return micromatch.makeRe(pattern$1, options$1);
  3652. }
  3653. exports.makeRe = makeRe;
  3654. function convertPatternsToRe(patterns, options$1) {
  3655. return patterns.map((pattern$1) => makeRe(pattern$1, options$1));
  3656. }
  3657. exports.convertPatternsToRe = convertPatternsToRe;
  3658. function matchAny(entry, patternsRe) {
  3659. return patternsRe.some((patternRe) => patternRe.test(entry));
  3660. }
  3661. exports.matchAny = matchAny;
  3662. /**
  3663. * This package only works with forward slashes as a path separator.
  3664. * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
  3665. */
  3666. function removeDuplicateSlashes(pattern$1) {
  3667. return pattern$1.replace(DOUBLE_SLASH_RE, "/");
  3668. }
  3669. exports.removeDuplicateSlashes = removeDuplicateSlashes;
  3670. function partitionAbsoluteAndRelative(patterns) {
  3671. const absolute = [];
  3672. const relative$1 = [];
  3673. for (const pattern$1 of patterns) if (isAbsolute$1(pattern$1)) absolute.push(pattern$1);
  3674. else relative$1.push(pattern$1);
  3675. return [absolute, relative$1];
  3676. }
  3677. exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
  3678. function isAbsolute$1(pattern$1) {
  3679. return path$6.isAbsolute(pattern$1);
  3680. }
  3681. exports.isAbsolute = isAbsolute$1;
  3682. }) });
  3683. //#endregion
  3684. //#region ../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js
  3685. var require_merge2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js": ((exports, module) => {
  3686. const PassThrough = __require("stream").PassThrough;
  3687. const slice = Array.prototype.slice;
  3688. module.exports = merge2$1;
  3689. function merge2$1() {
  3690. const streamsQueue = [];
  3691. const args = slice.call(arguments);
  3692. let merging = false;
  3693. let options$1 = args[args.length - 1];
  3694. if (options$1 && !Array.isArray(options$1) && options$1.pipe == null) args.pop();
  3695. else options$1 = {};
  3696. const doEnd = options$1.end !== false;
  3697. const doPipeError = options$1.pipeError === true;
  3698. if (options$1.objectMode == null) options$1.objectMode = true;
  3699. if (options$1.highWaterMark == null) options$1.highWaterMark = 64 * 1024;
  3700. const mergedStream = PassThrough(options$1);
  3701. function addStream() {
  3702. for (let i = 0, len = arguments.length; i < len; i++) streamsQueue.push(pauseStreams(arguments[i], options$1));
  3703. mergeStream();
  3704. return this;
  3705. }
  3706. function mergeStream() {
  3707. if (merging) return;
  3708. merging = true;
  3709. let streams = streamsQueue.shift();
  3710. if (!streams) {
  3711. process.nextTick(endStream);
  3712. return;
  3713. }
  3714. if (!Array.isArray(streams)) streams = [streams];
  3715. let pipesCount = streams.length + 1;
  3716. function next() {
  3717. if (--pipesCount > 0) return;
  3718. merging = false;
  3719. mergeStream();
  3720. }
  3721. function pipe(stream$1) {
  3722. function onend() {
  3723. stream$1.removeListener("merge2UnpipeEnd", onend);
  3724. stream$1.removeListener("end", onend);
  3725. if (doPipeError) stream$1.removeListener("error", onerror);
  3726. next();
  3727. }
  3728. function onerror(err) {
  3729. mergedStream.emit("error", err);
  3730. }
  3731. if (stream$1._readableState.endEmitted) return next();
  3732. stream$1.on("merge2UnpipeEnd", onend);
  3733. stream$1.on("end", onend);
  3734. if (doPipeError) stream$1.on("error", onerror);
  3735. stream$1.pipe(mergedStream, { end: false });
  3736. stream$1.resume();
  3737. }
  3738. for (let i = 0; i < streams.length; i++) pipe(streams[i]);
  3739. next();
  3740. }
  3741. function endStream() {
  3742. merging = false;
  3743. mergedStream.emit("queueDrain");
  3744. if (doEnd) mergedStream.end();
  3745. }
  3746. mergedStream.setMaxListeners(0);
  3747. mergedStream.add = addStream;
  3748. mergedStream.on("unpipe", function(stream$1) {
  3749. stream$1.emit("merge2UnpipeEnd");
  3750. });
  3751. if (args.length) addStream.apply(null, args);
  3752. return mergedStream;
  3753. }
  3754. function pauseStreams(streams, options$1) {
  3755. if (!Array.isArray(streams)) {
  3756. if (!streams._readableState && streams.pipe) streams = streams.pipe(PassThrough(options$1));
  3757. if (!streams._readableState || !streams.pause || !streams.pipe) throw new Error("Only readable stream can be merged.");
  3758. streams.pause();
  3759. } else for (let i = 0, len = streams.length; i < len; i++) streams[i] = pauseStreams(streams[i], options$1);
  3760. return streams;
  3761. }
  3762. }) });
  3763. //#endregion
  3764. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js
  3765. var require_stream$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js": ((exports) => {
  3766. Object.defineProperty(exports, "__esModule", { value: true });
  3767. const merge2 = require_merge2();
  3768. function merge(streams) {
  3769. const mergedStream = merge2(streams);
  3770. streams.forEach((stream$1) => {
  3771. stream$1.once("error", (error) => mergedStream.emit("error", error));
  3772. });
  3773. mergedStream.once("close", () => propagateCloseEventToSources(streams));
  3774. mergedStream.once("end", () => propagateCloseEventToSources(streams));
  3775. return mergedStream;
  3776. }
  3777. exports.merge = merge;
  3778. function propagateCloseEventToSources(streams) {
  3779. streams.forEach((stream$1) => stream$1.emit("close"));
  3780. }
  3781. }) });
  3782. //#endregion
  3783. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/string.js
  3784. var require_string = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/string.js": ((exports) => {
  3785. Object.defineProperty(exports, "__esModule", { value: true });
  3786. function isString(input) {
  3787. return typeof input === "string";
  3788. }
  3789. exports.isString = isString;
  3790. function isEmpty(input) {
  3791. return input === "";
  3792. }
  3793. exports.isEmpty = isEmpty;
  3794. }) });
  3795. //#endregion
  3796. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js
  3797. var require_utils$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js": ((exports) => {
  3798. Object.defineProperty(exports, "__esModule", { value: true });
  3799. const array = require_array();
  3800. exports.array = array;
  3801. const errno = require_errno();
  3802. exports.errno = errno;
  3803. const fs$7 = require_fs$3();
  3804. exports.fs = fs$7;
  3805. const path$5 = require_path();
  3806. exports.path = path$5;
  3807. const pattern = require_pattern();
  3808. exports.pattern = pattern;
  3809. const stream = require_stream$3();
  3810. exports.stream = stream;
  3811. const string = require_string();
  3812. exports.string = string;
  3813. }) });
  3814. //#endregion
  3815. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js
  3816. var require_tasks = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js": ((exports) => {
  3817. Object.defineProperty(exports, "__esModule", { value: true });
  3818. const utils$9 = require_utils$1();
  3819. function generate(input, settings) {
  3820. const patterns = processPatterns(input, settings);
  3821. const ignore = processPatterns(settings.ignore, settings);
  3822. const positivePatterns = getPositivePatterns(patterns);
  3823. const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
  3824. const staticPatterns = positivePatterns.filter((pattern$1) => utils$9.pattern.isStaticPattern(pattern$1, settings));
  3825. const dynamicPatterns = positivePatterns.filter((pattern$1) => utils$9.pattern.isDynamicPattern(pattern$1, settings));
  3826. const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
  3827. const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
  3828. return staticTasks.concat(dynamicTasks);
  3829. }
  3830. exports.generate = generate;
  3831. function processPatterns(input, settings) {
  3832. let patterns = input;
  3833. /**
  3834. * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry
  3835. * and some problems with the micromatch package (see fast-glob issues: #365, #394).
  3836. *
  3837. * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown
  3838. * in matching in the case of a large set of patterns after expansion.
  3839. */
  3840. if (settings.braceExpansion) patterns = utils$9.pattern.expandPatternsWithBraceExpansion(patterns);
  3841. /**
  3842. * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used
  3843. * at any nesting level.
  3844. *
  3845. * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change
  3846. * the pattern in the filter before creating a regular expression. There is no need to change the patterns
  3847. * in the application. Only on the input.
  3848. */
  3849. if (settings.baseNameMatch) patterns = patterns.map((pattern$1) => pattern$1.includes("/") ? pattern$1 : `**/${pattern$1}`);
  3850. /**
  3851. * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion.
  3852. */
  3853. return patterns.map((pattern$1) => utils$9.pattern.removeDuplicateSlashes(pattern$1));
  3854. }
  3855. /**
  3856. * Returns tasks grouped by basic pattern directories.
  3857. *
  3858. * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
  3859. * This is necessary because directory traversal starts at the base directory and goes deeper.
  3860. */
  3861. function convertPatternsToTasks(positive, negative, dynamic) {
  3862. const tasks = [];
  3863. const patternsOutsideCurrentDirectory = utils$9.pattern.getPatternsOutsideCurrentDirectory(positive);
  3864. const patternsInsideCurrentDirectory = utils$9.pattern.getPatternsInsideCurrentDirectory(positive);
  3865. const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
  3866. const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
  3867. tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
  3868. if ("." in insideCurrentDirectoryGroup) tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
  3869. else tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
  3870. return tasks;
  3871. }
  3872. exports.convertPatternsToTasks = convertPatternsToTasks;
  3873. function getPositivePatterns(patterns) {
  3874. return utils$9.pattern.getPositivePatterns(patterns);
  3875. }
  3876. exports.getPositivePatterns = getPositivePatterns;
  3877. function getNegativePatternsAsPositive(patterns, ignore) {
  3878. return utils$9.pattern.getNegativePatterns(patterns).concat(ignore).map(utils$9.pattern.convertToPositivePattern);
  3879. }
  3880. exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
  3881. function groupPatternsByBaseDirectory(patterns) {
  3882. return patterns.reduce((collection, pattern$1) => {
  3883. const base = utils$9.pattern.getBaseDirectory(pattern$1);
  3884. if (base in collection) collection[base].push(pattern$1);
  3885. else collection[base] = [pattern$1];
  3886. return collection;
  3887. }, {});
  3888. }
  3889. exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
  3890. function convertPatternGroupsToTasks(positive, negative, dynamic) {
  3891. return Object.keys(positive).map((base) => {
  3892. return convertPatternGroupToTask(base, positive[base], negative, dynamic);
  3893. });
  3894. }
  3895. exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
  3896. function convertPatternGroupToTask(base, positive, negative, dynamic) {
  3897. return {
  3898. dynamic,
  3899. positive,
  3900. negative,
  3901. base,
  3902. patterns: [].concat(positive, negative.map(utils$9.pattern.convertToNegativePattern))
  3903. };
  3904. }
  3905. exports.convertPatternGroupToTask = convertPatternGroupToTask;
  3906. }) });
  3907. //#endregion
  3908. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js
  3909. var require_async$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js": ((exports) => {
  3910. Object.defineProperty(exports, "__esModule", { value: true });
  3911. function read$3(path$11, settings, callback) {
  3912. settings.fs.lstat(path$11, (lstatError, lstat) => {
  3913. if (lstatError !== null) {
  3914. callFailureCallback$2(callback, lstatError);
  3915. return;
  3916. }
  3917. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  3918. callSuccessCallback$2(callback, lstat);
  3919. return;
  3920. }
  3921. settings.fs.stat(path$11, (statError, stat$1) => {
  3922. if (statError !== null) {
  3923. if (settings.throwErrorOnBrokenSymbolicLink) {
  3924. callFailureCallback$2(callback, statError);
  3925. return;
  3926. }
  3927. callSuccessCallback$2(callback, lstat);
  3928. return;
  3929. }
  3930. if (settings.markSymbolicLink) stat$1.isSymbolicLink = () => true;
  3931. callSuccessCallback$2(callback, stat$1);
  3932. });
  3933. });
  3934. }
  3935. exports.read = read$3;
  3936. function callFailureCallback$2(callback, error) {
  3937. callback(error);
  3938. }
  3939. function callSuccessCallback$2(callback, result) {
  3940. callback(null, result);
  3941. }
  3942. }) });
  3943. //#endregion
  3944. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js
  3945. var require_sync$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js": ((exports) => {
  3946. Object.defineProperty(exports, "__esModule", { value: true });
  3947. function read$2(path$11, settings) {
  3948. const lstat = settings.fs.lstatSync(path$11);
  3949. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) return lstat;
  3950. try {
  3951. const stat$1 = settings.fs.statSync(path$11);
  3952. if (settings.markSymbolicLink) stat$1.isSymbolicLink = () => true;
  3953. return stat$1;
  3954. } catch (error) {
  3955. if (!settings.throwErrorOnBrokenSymbolicLink) return lstat;
  3956. throw error;
  3957. }
  3958. }
  3959. exports.read = read$2;
  3960. }) });
  3961. //#endregion
  3962. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js
  3963. var require_fs$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js": ((exports) => {
  3964. Object.defineProperty(exports, "__esModule", { value: true });
  3965. const fs$6 = __require("fs");
  3966. exports.FILE_SYSTEM_ADAPTER = {
  3967. lstat: fs$6.lstat,
  3968. stat: fs$6.stat,
  3969. lstatSync: fs$6.lstatSync,
  3970. statSync: fs$6.statSync
  3971. };
  3972. function createFileSystemAdapter$1(fsMethods) {
  3973. if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
  3974. return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
  3975. }
  3976. exports.createFileSystemAdapter = createFileSystemAdapter$1;
  3977. }) });
  3978. //#endregion
  3979. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js
  3980. var require_settings$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js": ((exports) => {
  3981. Object.defineProperty(exports, "__esModule", { value: true });
  3982. const fs$5 = require_fs$2();
  3983. var Settings$3 = class {
  3984. constructor(_options = {}) {
  3985. this._options = _options;
  3986. this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
  3987. this.fs = fs$5.createFileSystemAdapter(this._options.fs);
  3988. this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
  3989. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  3990. }
  3991. _getValue(option, value) {
  3992. return option !== null && option !== void 0 ? option : value;
  3993. }
  3994. };
  3995. exports.default = Settings$3;
  3996. }) });
  3997. //#endregion
  3998. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js
  3999. var require_out$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js": ((exports) => {
  4000. Object.defineProperty(exports, "__esModule", { value: true });
  4001. const async$1 = require_async$5();
  4002. const sync$1 = require_sync$5();
  4003. const settings_1$3 = require_settings$3();
  4004. exports.Settings = settings_1$3.default;
  4005. function stat(path$11, optionsOrSettingsOrCallback, callback) {
  4006. if (typeof optionsOrSettingsOrCallback === "function") {
  4007. async$1.read(path$11, getSettings$2(), optionsOrSettingsOrCallback);
  4008. return;
  4009. }
  4010. async$1.read(path$11, getSettings$2(optionsOrSettingsOrCallback), callback);
  4011. }
  4012. exports.stat = stat;
  4013. function statSync(path$11, optionsOrSettings) {
  4014. const settings = getSettings$2(optionsOrSettings);
  4015. return sync$1.read(path$11, settings);
  4016. }
  4017. exports.statSync = statSync;
  4018. function getSettings$2(settingsOrOptions = {}) {
  4019. if (settingsOrOptions instanceof settings_1$3.default) return settingsOrOptions;
  4020. return new settings_1$3.default(settingsOrOptions);
  4021. }
  4022. }) });
  4023. //#endregion
  4024. //#region ../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js
  4025. var require_queue_microtask = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js": ((exports, module) => {
  4026. /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  4027. let promise;
  4028. module.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
  4029. throw err;
  4030. }, 0));
  4031. }) });
  4032. //#endregion
  4033. //#region ../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js
  4034. var require_run_parallel = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js": ((exports, module) => {
  4035. /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  4036. module.exports = runParallel;
  4037. const queueMicrotask$1 = require_queue_microtask();
  4038. function runParallel(tasks, cb) {
  4039. let results, pending, keys$1;
  4040. let isSync = true;
  4041. if (Array.isArray(tasks)) {
  4042. results = [];
  4043. pending = tasks.length;
  4044. } else {
  4045. keys$1 = Object.keys(tasks);
  4046. results = {};
  4047. pending = keys$1.length;
  4048. }
  4049. function done(err) {
  4050. function end() {
  4051. if (cb) cb(err, results);
  4052. cb = null;
  4053. }
  4054. if (isSync) queueMicrotask$1(end);
  4055. else end();
  4056. }
  4057. function each(i, err, result) {
  4058. results[i] = result;
  4059. if (--pending === 0 || err) done(err);
  4060. }
  4061. if (!pending) done(null);
  4062. else if (keys$1) keys$1.forEach(function(key) {
  4063. tasks[key](function(err, result) {
  4064. each(key, err, result);
  4065. });
  4066. });
  4067. else tasks.forEach(function(task, i) {
  4068. task(function(err, result) {
  4069. each(i, err, result);
  4070. });
  4071. });
  4072. isSync = false;
  4073. }
  4074. }) });
  4075. //#endregion
  4076. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js
  4077. var require_constants = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js": ((exports) => {
  4078. Object.defineProperty(exports, "__esModule", { value: true });
  4079. const NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
  4080. 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}`);
  4081. const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
  4082. const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
  4083. const SUPPORTED_MAJOR_VERSION = 10;
  4084. const SUPPORTED_MINOR_VERSION = 10;
  4085. const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
  4086. const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
  4087. /**
  4088. * IS `true` for Node.js 10.10 and greater.
  4089. */
  4090. exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
  4091. }) });
  4092. //#endregion
  4093. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js
  4094. var require_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js": ((exports) => {
  4095. Object.defineProperty(exports, "__esModule", { value: true });
  4096. var DirentFromStats = class {
  4097. constructor(name, stats) {
  4098. this.name = name;
  4099. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  4100. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  4101. this.isDirectory = stats.isDirectory.bind(stats);
  4102. this.isFIFO = stats.isFIFO.bind(stats);
  4103. this.isFile = stats.isFile.bind(stats);
  4104. this.isSocket = stats.isSocket.bind(stats);
  4105. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  4106. }
  4107. };
  4108. function createDirentFromStats(name, stats) {
  4109. return new DirentFromStats(name, stats);
  4110. }
  4111. exports.createDirentFromStats = createDirentFromStats;
  4112. }) });
  4113. //#endregion
  4114. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js
  4115. var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js": ((exports) => {
  4116. Object.defineProperty(exports, "__esModule", { value: true });
  4117. const fs$4 = require_fs$1();
  4118. exports.fs = fs$4;
  4119. }) });
  4120. //#endregion
  4121. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js
  4122. var require_common$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js": ((exports) => {
  4123. Object.defineProperty(exports, "__esModule", { value: true });
  4124. function joinPathSegments$1(a, b, separator) {
  4125. /**
  4126. * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
  4127. */
  4128. if (a.endsWith(separator)) return a + b;
  4129. return a + separator + b;
  4130. }
  4131. exports.joinPathSegments = joinPathSegments$1;
  4132. }) });
  4133. //#endregion
  4134. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js
  4135. var require_async$4 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js": ((exports) => {
  4136. Object.defineProperty(exports, "__esModule", { value: true });
  4137. const fsStat$5 = require_out$3();
  4138. const rpl = require_run_parallel();
  4139. const constants_1$1 = require_constants();
  4140. const utils$8 = require_utils();
  4141. const common$4 = require_common$1();
  4142. function read$1(directory, settings, callback) {
  4143. if (!settings.stats && constants_1$1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  4144. readdirWithFileTypes$1(directory, settings, callback);
  4145. return;
  4146. }
  4147. readdir$1(directory, settings, callback);
  4148. }
  4149. exports.read = read$1;
  4150. function readdirWithFileTypes$1(directory, settings, callback) {
  4151. settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
  4152. if (readdirError !== null) {
  4153. callFailureCallback$1(callback, readdirError);
  4154. return;
  4155. }
  4156. const entries = dirents.map((dirent) => ({
  4157. dirent,
  4158. name: dirent.name,
  4159. path: common$4.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  4160. }));
  4161. if (!settings.followSymbolicLinks) {
  4162. callSuccessCallback$1(callback, entries);
  4163. return;
  4164. }
  4165. const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
  4166. rpl(tasks, (rplError, rplEntries) => {
  4167. if (rplError !== null) {
  4168. callFailureCallback$1(callback, rplError);
  4169. return;
  4170. }
  4171. callSuccessCallback$1(callback, rplEntries);
  4172. });
  4173. });
  4174. }
  4175. exports.readdirWithFileTypes = readdirWithFileTypes$1;
  4176. function makeRplTaskEntry(entry, settings) {
  4177. return (done) => {
  4178. if (!entry.dirent.isSymbolicLink()) {
  4179. done(null, entry);
  4180. return;
  4181. }
  4182. settings.fs.stat(entry.path, (statError, stats) => {
  4183. if (statError !== null) {
  4184. if (settings.throwErrorOnBrokenSymbolicLink) {
  4185. done(statError);
  4186. return;
  4187. }
  4188. done(null, entry);
  4189. return;
  4190. }
  4191. entry.dirent = utils$8.fs.createDirentFromStats(entry.name, stats);
  4192. done(null, entry);
  4193. });
  4194. };
  4195. }
  4196. function readdir$1(directory, settings, callback) {
  4197. settings.fs.readdir(directory, (readdirError, names) => {
  4198. if (readdirError !== null) {
  4199. callFailureCallback$1(callback, readdirError);
  4200. return;
  4201. }
  4202. const tasks = names.map((name) => {
  4203. const path$11 = common$4.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  4204. return (done) => {
  4205. fsStat$5.stat(path$11, settings.fsStatSettings, (error, stats) => {
  4206. if (error !== null) {
  4207. done(error);
  4208. return;
  4209. }
  4210. const entry = {
  4211. name,
  4212. path: path$11,
  4213. dirent: utils$8.fs.createDirentFromStats(name, stats)
  4214. };
  4215. if (settings.stats) entry.stats = stats;
  4216. done(null, entry);
  4217. });
  4218. };
  4219. });
  4220. rpl(tasks, (rplError, entries) => {
  4221. if (rplError !== null) {
  4222. callFailureCallback$1(callback, rplError);
  4223. return;
  4224. }
  4225. callSuccessCallback$1(callback, entries);
  4226. });
  4227. });
  4228. }
  4229. exports.readdir = readdir$1;
  4230. function callFailureCallback$1(callback, error) {
  4231. callback(error);
  4232. }
  4233. function callSuccessCallback$1(callback, result) {
  4234. callback(null, result);
  4235. }
  4236. }) });
  4237. //#endregion
  4238. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js
  4239. var require_sync$4 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js": ((exports) => {
  4240. Object.defineProperty(exports, "__esModule", { value: true });
  4241. const fsStat$4 = require_out$3();
  4242. const constants_1 = require_constants();
  4243. const utils$7 = require_utils();
  4244. const common$3 = require_common$1();
  4245. function read(directory, settings) {
  4246. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) return readdirWithFileTypes(directory, settings);
  4247. return readdir(directory, settings);
  4248. }
  4249. exports.read = read;
  4250. function readdirWithFileTypes(directory, settings) {
  4251. return settings.fs.readdirSync(directory, { withFileTypes: true }).map((dirent) => {
  4252. const entry = {
  4253. dirent,
  4254. name: dirent.name,
  4255. path: common$3.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  4256. };
  4257. if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) try {
  4258. const stats = settings.fs.statSync(entry.path);
  4259. entry.dirent = utils$7.fs.createDirentFromStats(entry.name, stats);
  4260. } catch (error) {
  4261. if (settings.throwErrorOnBrokenSymbolicLink) throw error;
  4262. }
  4263. return entry;
  4264. });
  4265. }
  4266. exports.readdirWithFileTypes = readdirWithFileTypes;
  4267. function readdir(directory, settings) {
  4268. return settings.fs.readdirSync(directory).map((name) => {
  4269. const entryPath = common$3.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  4270. const stats = fsStat$4.statSync(entryPath, settings.fsStatSettings);
  4271. const entry = {
  4272. name,
  4273. path: entryPath,
  4274. dirent: utils$7.fs.createDirentFromStats(name, stats)
  4275. };
  4276. if (settings.stats) entry.stats = stats;
  4277. return entry;
  4278. });
  4279. }
  4280. exports.readdir = readdir;
  4281. }) });
  4282. //#endregion
  4283. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js
  4284. var require_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js": ((exports) => {
  4285. Object.defineProperty(exports, "__esModule", { value: true });
  4286. const fs$3 = __require("fs");
  4287. exports.FILE_SYSTEM_ADAPTER = {
  4288. lstat: fs$3.lstat,
  4289. stat: fs$3.stat,
  4290. lstatSync: fs$3.lstatSync,
  4291. statSync: fs$3.statSync,
  4292. readdir: fs$3.readdir,
  4293. readdirSync: fs$3.readdirSync
  4294. };
  4295. function createFileSystemAdapter(fsMethods) {
  4296. if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
  4297. return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
  4298. }
  4299. exports.createFileSystemAdapter = createFileSystemAdapter;
  4300. }) });
  4301. //#endregion
  4302. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js
  4303. var require_settings$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js": ((exports) => {
  4304. Object.defineProperty(exports, "__esModule", { value: true });
  4305. const path$4 = __require("path");
  4306. const fsStat$3 = require_out$3();
  4307. const fs$2 = require_fs();
  4308. var Settings$2 = class {
  4309. constructor(_options = {}) {
  4310. this._options = _options;
  4311. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
  4312. this.fs = fs$2.createFileSystemAdapter(this._options.fs);
  4313. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
  4314. this.stats = this._getValue(this._options.stats, false);
  4315. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  4316. this.fsStatSettings = new fsStat$3.Settings({
  4317. followSymbolicLink: this.followSymbolicLinks,
  4318. fs: this.fs,
  4319. throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
  4320. });
  4321. }
  4322. _getValue(option, value) {
  4323. return option !== null && option !== void 0 ? option : value;
  4324. }
  4325. };
  4326. exports.default = Settings$2;
  4327. }) });
  4328. //#endregion
  4329. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js
  4330. var require_out$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js": ((exports) => {
  4331. Object.defineProperty(exports, "__esModule", { value: true });
  4332. const async = require_async$4();
  4333. const sync = require_sync$4();
  4334. const settings_1$2 = require_settings$2();
  4335. exports.Settings = settings_1$2.default;
  4336. function scandir(path$11, optionsOrSettingsOrCallback, callback) {
  4337. if (typeof optionsOrSettingsOrCallback === "function") {
  4338. async.read(path$11, getSettings$1(), optionsOrSettingsOrCallback);
  4339. return;
  4340. }
  4341. async.read(path$11, getSettings$1(optionsOrSettingsOrCallback), callback);
  4342. }
  4343. exports.scandir = scandir;
  4344. function scandirSync(path$11, optionsOrSettings) {
  4345. const settings = getSettings$1(optionsOrSettings);
  4346. return sync.read(path$11, settings);
  4347. }
  4348. exports.scandirSync = scandirSync;
  4349. function getSettings$1(settingsOrOptions = {}) {
  4350. if (settingsOrOptions instanceof settings_1$2.default) return settingsOrOptions;
  4351. return new settings_1$2.default(settingsOrOptions);
  4352. }
  4353. }) });
  4354. //#endregion
  4355. //#region ../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js
  4356. var require_reusify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js": ((exports, module) => {
  4357. function reusify$1(Constructor) {
  4358. var head = new Constructor();
  4359. var tail = head;
  4360. function get() {
  4361. var current = head;
  4362. if (current.next) head = current.next;
  4363. else {
  4364. head = new Constructor();
  4365. tail = head;
  4366. }
  4367. current.next = null;
  4368. return current;
  4369. }
  4370. function release(obj) {
  4371. tail.next = obj;
  4372. tail = obj;
  4373. }
  4374. return {
  4375. get,
  4376. release
  4377. };
  4378. }
  4379. module.exports = reusify$1;
  4380. }) });
  4381. //#endregion
  4382. //#region ../../node_modules/.pnpm/fastq@1.19.1/node_modules/fastq/queue.js
  4383. var require_queue = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fastq@1.19.1/node_modules/fastq/queue.js": ((exports, module) => {
  4384. var reusify = require_reusify();
  4385. function fastqueue(context, worker, _concurrency) {
  4386. if (typeof context === "function") {
  4387. _concurrency = worker;
  4388. worker = context;
  4389. context = null;
  4390. }
  4391. if (!(_concurrency >= 1)) throw new Error("fastqueue concurrency must be equal to or greater than 1");
  4392. var cache = reusify(Task);
  4393. var queueHead = null;
  4394. var queueTail = null;
  4395. var _running = 0;
  4396. var errorHandler = null;
  4397. var self$1 = {
  4398. push,
  4399. drain: noop,
  4400. saturated: noop,
  4401. pause,
  4402. paused: false,
  4403. get concurrency() {
  4404. return _concurrency;
  4405. },
  4406. set concurrency(value) {
  4407. if (!(value >= 1)) throw new Error("fastqueue concurrency must be equal to or greater than 1");
  4408. _concurrency = value;
  4409. if (self$1.paused) return;
  4410. for (; queueHead && _running < _concurrency;) {
  4411. _running++;
  4412. release();
  4413. }
  4414. },
  4415. running,
  4416. resume,
  4417. idle,
  4418. length,
  4419. getQueue,
  4420. unshift,
  4421. empty: noop,
  4422. kill,
  4423. killAndDrain,
  4424. error
  4425. };
  4426. return self$1;
  4427. function running() {
  4428. return _running;
  4429. }
  4430. function pause() {
  4431. self$1.paused = true;
  4432. }
  4433. function length() {
  4434. var current = queueHead;
  4435. var counter = 0;
  4436. while (current) {
  4437. current = current.next;
  4438. counter++;
  4439. }
  4440. return counter;
  4441. }
  4442. function getQueue() {
  4443. var current = queueHead;
  4444. var tasks = [];
  4445. while (current) {
  4446. tasks.push(current.value);
  4447. current = current.next;
  4448. }
  4449. return tasks;
  4450. }
  4451. function resume() {
  4452. if (!self$1.paused) return;
  4453. self$1.paused = false;
  4454. if (queueHead === null) {
  4455. _running++;
  4456. release();
  4457. return;
  4458. }
  4459. for (; queueHead && _running < _concurrency;) {
  4460. _running++;
  4461. release();
  4462. }
  4463. }
  4464. function idle() {
  4465. return _running === 0 && self$1.length() === 0;
  4466. }
  4467. function push(value, done) {
  4468. var current = cache.get();
  4469. current.context = context;
  4470. current.release = release;
  4471. current.value = value;
  4472. current.callback = done || noop;
  4473. current.errorHandler = errorHandler;
  4474. if (_running >= _concurrency || self$1.paused) if (queueTail) {
  4475. queueTail.next = current;
  4476. queueTail = current;
  4477. } else {
  4478. queueHead = current;
  4479. queueTail = current;
  4480. self$1.saturated();
  4481. }
  4482. else {
  4483. _running++;
  4484. worker.call(context, current.value, current.worked);
  4485. }
  4486. }
  4487. function unshift(value, done) {
  4488. var current = cache.get();
  4489. current.context = context;
  4490. current.release = release;
  4491. current.value = value;
  4492. current.callback = done || noop;
  4493. current.errorHandler = errorHandler;
  4494. if (_running >= _concurrency || self$1.paused) if (queueHead) {
  4495. current.next = queueHead;
  4496. queueHead = current;
  4497. } else {
  4498. queueHead = current;
  4499. queueTail = current;
  4500. self$1.saturated();
  4501. }
  4502. else {
  4503. _running++;
  4504. worker.call(context, current.value, current.worked);
  4505. }
  4506. }
  4507. function release(holder) {
  4508. if (holder) cache.release(holder);
  4509. var next = queueHead;
  4510. if (next && _running <= _concurrency) if (!self$1.paused) {
  4511. if (queueTail === queueHead) queueTail = null;
  4512. queueHead = next.next;
  4513. next.next = null;
  4514. worker.call(context, next.value, next.worked);
  4515. if (queueTail === null) self$1.empty();
  4516. } else _running--;
  4517. else if (--_running === 0) self$1.drain();
  4518. }
  4519. function kill() {
  4520. queueHead = null;
  4521. queueTail = null;
  4522. self$1.drain = noop;
  4523. }
  4524. function killAndDrain() {
  4525. queueHead = null;
  4526. queueTail = null;
  4527. self$1.drain();
  4528. self$1.drain = noop;
  4529. }
  4530. function error(handler) {
  4531. errorHandler = handler;
  4532. }
  4533. }
  4534. function noop() {}
  4535. function Task() {
  4536. this.value = null;
  4537. this.callback = noop;
  4538. this.next = null;
  4539. this.release = noop;
  4540. this.context = null;
  4541. this.errorHandler = null;
  4542. var self$1 = this;
  4543. this.worked = function worked(err, result) {
  4544. var callback = self$1.callback;
  4545. var errorHandler = self$1.errorHandler;
  4546. var val = self$1.value;
  4547. self$1.value = null;
  4548. self$1.callback = noop;
  4549. if (self$1.errorHandler) errorHandler(err, val);
  4550. callback.call(self$1.context, err, result);
  4551. self$1.release(self$1);
  4552. };
  4553. }
  4554. function queueAsPromised(context, worker, _concurrency) {
  4555. if (typeof context === "function") {
  4556. _concurrency = worker;
  4557. worker = context;
  4558. context = null;
  4559. }
  4560. function asyncWrapper(arg, cb) {
  4561. worker.call(this, arg).then(function(res) {
  4562. cb(null, res);
  4563. }, cb);
  4564. }
  4565. var queue = fastqueue(context, asyncWrapper, _concurrency);
  4566. var pushCb = queue.push;
  4567. var unshiftCb = queue.unshift;
  4568. queue.push = push;
  4569. queue.unshift = unshift;
  4570. queue.drained = drained;
  4571. return queue;
  4572. function push(value) {
  4573. var p = new Promise(function(resolve$2, reject) {
  4574. pushCb(value, function(err, result) {
  4575. if (err) {
  4576. reject(err);
  4577. return;
  4578. }
  4579. resolve$2(result);
  4580. });
  4581. });
  4582. p.catch(noop);
  4583. return p;
  4584. }
  4585. function unshift(value) {
  4586. var p = new Promise(function(resolve$2, reject) {
  4587. unshiftCb(value, function(err, result) {
  4588. if (err) {
  4589. reject(err);
  4590. return;
  4591. }
  4592. resolve$2(result);
  4593. });
  4594. });
  4595. p.catch(noop);
  4596. return p;
  4597. }
  4598. function drained() {
  4599. return new Promise(function(resolve$2) {
  4600. process.nextTick(function() {
  4601. if (queue.idle()) resolve$2();
  4602. else {
  4603. var previousDrain = queue.drain;
  4604. queue.drain = function() {
  4605. if (typeof previousDrain === "function") previousDrain();
  4606. resolve$2();
  4607. queue.drain = previousDrain;
  4608. };
  4609. }
  4610. });
  4611. });
  4612. }
  4613. }
  4614. module.exports = fastqueue;
  4615. module.exports.promise = queueAsPromised;
  4616. }) });
  4617. //#endregion
  4618. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js
  4619. var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js": ((exports) => {
  4620. Object.defineProperty(exports, "__esModule", { value: true });
  4621. function isFatalError(settings, error) {
  4622. if (settings.errorFilter === null) return true;
  4623. return !settings.errorFilter(error);
  4624. }
  4625. exports.isFatalError = isFatalError;
  4626. function isAppliedFilter(filter, value) {
  4627. return filter === null || filter(value);
  4628. }
  4629. exports.isAppliedFilter = isAppliedFilter;
  4630. function replacePathSegmentSeparator(filepath, separator) {
  4631. return filepath.split(/[/\\]/).join(separator);
  4632. }
  4633. exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
  4634. function joinPathSegments(a, b, separator) {
  4635. if (a === "") return b;
  4636. /**
  4637. * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
  4638. */
  4639. if (a.endsWith(separator)) return a + b;
  4640. return a + separator + b;
  4641. }
  4642. exports.joinPathSegments = joinPathSegments;
  4643. }) });
  4644. //#endregion
  4645. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js
  4646. var require_reader$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js": ((exports) => {
  4647. Object.defineProperty(exports, "__esModule", { value: true });
  4648. const common$2 = require_common();
  4649. var Reader$1 = class {
  4650. constructor(_root, _settings) {
  4651. this._root = _root;
  4652. this._settings = _settings;
  4653. this._root = common$2.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
  4654. }
  4655. };
  4656. exports.default = Reader$1;
  4657. }) });
  4658. //#endregion
  4659. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js
  4660. var require_async$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js": ((exports) => {
  4661. Object.defineProperty(exports, "__esModule", { value: true });
  4662. const events_1 = __require("events");
  4663. const fsScandir$2 = require_out$2();
  4664. const fastq = require_queue();
  4665. const common$1 = require_common();
  4666. const reader_1$4 = require_reader$1();
  4667. var AsyncReader = class extends reader_1$4.default {
  4668. constructor(_root, _settings) {
  4669. super(_root, _settings);
  4670. this._settings = _settings;
  4671. this._scandir = fsScandir$2.scandir;
  4672. this._emitter = new events_1.EventEmitter();
  4673. this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
  4674. this._isFatalError = false;
  4675. this._isDestroyed = false;
  4676. this._queue.drain = () => {
  4677. if (!this._isFatalError) this._emitter.emit("end");
  4678. };
  4679. }
  4680. read() {
  4681. this._isFatalError = false;
  4682. this._isDestroyed = false;
  4683. setImmediate(() => {
  4684. this._pushToQueue(this._root, this._settings.basePath);
  4685. });
  4686. return this._emitter;
  4687. }
  4688. get isDestroyed() {
  4689. return this._isDestroyed;
  4690. }
  4691. destroy() {
  4692. if (this._isDestroyed) throw new Error("The reader is already destroyed");
  4693. this._isDestroyed = true;
  4694. this._queue.killAndDrain();
  4695. }
  4696. onEntry(callback) {
  4697. this._emitter.on("entry", callback);
  4698. }
  4699. onError(callback) {
  4700. this._emitter.once("error", callback);
  4701. }
  4702. onEnd(callback) {
  4703. this._emitter.once("end", callback);
  4704. }
  4705. _pushToQueue(directory, base) {
  4706. const queueItem = {
  4707. directory,
  4708. base
  4709. };
  4710. this._queue.push(queueItem, (error) => {
  4711. if (error !== null) this._handleError(error);
  4712. });
  4713. }
  4714. _worker(item, done) {
  4715. this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
  4716. if (error !== null) {
  4717. done(error, void 0);
  4718. return;
  4719. }
  4720. for (const entry of entries) this._handleEntry(entry, item.base);
  4721. done(null, void 0);
  4722. });
  4723. }
  4724. _handleError(error) {
  4725. if (this._isDestroyed || !common$1.isFatalError(this._settings, error)) return;
  4726. this._isFatalError = true;
  4727. this._isDestroyed = true;
  4728. this._emitter.emit("error", error);
  4729. }
  4730. _handleEntry(entry, base) {
  4731. if (this._isDestroyed || this._isFatalError) return;
  4732. const fullpath = entry.path;
  4733. if (base !== void 0) entry.path = common$1.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  4734. if (common$1.isAppliedFilter(this._settings.entryFilter, entry)) this._emitEntry(entry);
  4735. if (entry.dirent.isDirectory() && common$1.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  4736. }
  4737. _emitEntry(entry) {
  4738. this._emitter.emit("entry", entry);
  4739. }
  4740. };
  4741. exports.default = AsyncReader;
  4742. }) });
  4743. //#endregion
  4744. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js
  4745. var require_async$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js": ((exports) => {
  4746. Object.defineProperty(exports, "__esModule", { value: true });
  4747. const async_1$4 = require_async$3();
  4748. var AsyncProvider = class {
  4749. constructor(_root, _settings) {
  4750. this._root = _root;
  4751. this._settings = _settings;
  4752. this._reader = new async_1$4.default(this._root, this._settings);
  4753. this._storage = [];
  4754. }
  4755. read(callback) {
  4756. this._reader.onError((error) => {
  4757. callFailureCallback(callback, error);
  4758. });
  4759. this._reader.onEntry((entry) => {
  4760. this._storage.push(entry);
  4761. });
  4762. this._reader.onEnd(() => {
  4763. callSuccessCallback(callback, this._storage);
  4764. });
  4765. this._reader.read();
  4766. }
  4767. };
  4768. exports.default = AsyncProvider;
  4769. function callFailureCallback(callback, error) {
  4770. callback(error);
  4771. }
  4772. function callSuccessCallback(callback, entries) {
  4773. callback(null, entries);
  4774. }
  4775. }) });
  4776. //#endregion
  4777. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js
  4778. var require_stream$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js": ((exports) => {
  4779. Object.defineProperty(exports, "__esModule", { value: true });
  4780. const stream_1$5 = __require("stream");
  4781. const async_1$3 = require_async$3();
  4782. var StreamProvider = class {
  4783. constructor(_root, _settings) {
  4784. this._root = _root;
  4785. this._settings = _settings;
  4786. this._reader = new async_1$3.default(this._root, this._settings);
  4787. this._stream = new stream_1$5.Readable({
  4788. objectMode: true,
  4789. read: () => {},
  4790. destroy: () => {
  4791. if (!this._reader.isDestroyed) this._reader.destroy();
  4792. }
  4793. });
  4794. }
  4795. read() {
  4796. this._reader.onError((error) => {
  4797. this._stream.emit("error", error);
  4798. });
  4799. this._reader.onEntry((entry) => {
  4800. this._stream.push(entry);
  4801. });
  4802. this._reader.onEnd(() => {
  4803. this._stream.push(null);
  4804. });
  4805. this._reader.read();
  4806. return this._stream;
  4807. }
  4808. };
  4809. exports.default = StreamProvider;
  4810. }) });
  4811. //#endregion
  4812. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js
  4813. var require_sync$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js": ((exports) => {
  4814. Object.defineProperty(exports, "__esModule", { value: true });
  4815. const fsScandir$1 = require_out$2();
  4816. const common = require_common();
  4817. const reader_1$3 = require_reader$1();
  4818. var SyncReader = class extends reader_1$3.default {
  4819. constructor() {
  4820. super(...arguments);
  4821. this._scandir = fsScandir$1.scandirSync;
  4822. this._storage = [];
  4823. this._queue = /* @__PURE__ */ new Set();
  4824. }
  4825. read() {
  4826. this._pushToQueue(this._root, this._settings.basePath);
  4827. this._handleQueue();
  4828. return this._storage;
  4829. }
  4830. _pushToQueue(directory, base) {
  4831. this._queue.add({
  4832. directory,
  4833. base
  4834. });
  4835. }
  4836. _handleQueue() {
  4837. for (const item of this._queue.values()) this._handleDirectory(item.directory, item.base);
  4838. }
  4839. _handleDirectory(directory, base) {
  4840. try {
  4841. const entries = this._scandir(directory, this._settings.fsScandirSettings);
  4842. for (const entry of entries) this._handleEntry(entry, base);
  4843. } catch (error) {
  4844. this._handleError(error);
  4845. }
  4846. }
  4847. _handleError(error) {
  4848. if (!common.isFatalError(this._settings, error)) return;
  4849. throw error;
  4850. }
  4851. _handleEntry(entry, base) {
  4852. const fullpath = entry.path;
  4853. if (base !== void 0) entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  4854. if (common.isAppliedFilter(this._settings.entryFilter, entry)) this._pushToStorage(entry);
  4855. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  4856. }
  4857. _pushToStorage(entry) {
  4858. this._storage.push(entry);
  4859. }
  4860. };
  4861. exports.default = SyncReader;
  4862. }) });
  4863. //#endregion
  4864. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js
  4865. var require_sync$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js": ((exports) => {
  4866. Object.defineProperty(exports, "__esModule", { value: true });
  4867. const sync_1$3 = require_sync$3();
  4868. var SyncProvider = class {
  4869. constructor(_root, _settings) {
  4870. this._root = _root;
  4871. this._settings = _settings;
  4872. this._reader = new sync_1$3.default(this._root, this._settings);
  4873. }
  4874. read() {
  4875. return this._reader.read();
  4876. }
  4877. };
  4878. exports.default = SyncProvider;
  4879. }) });
  4880. //#endregion
  4881. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js
  4882. var require_settings$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js": ((exports) => {
  4883. Object.defineProperty(exports, "__esModule", { value: true });
  4884. const path$3 = __require("path");
  4885. const fsScandir = require_out$2();
  4886. var Settings$1 = class {
  4887. constructor(_options = {}) {
  4888. this._options = _options;
  4889. this.basePath = this._getValue(this._options.basePath, void 0);
  4890. this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
  4891. this.deepFilter = this._getValue(this._options.deepFilter, null);
  4892. this.entryFilter = this._getValue(this._options.entryFilter, null);
  4893. this.errorFilter = this._getValue(this._options.errorFilter, null);
  4894. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$3.sep);
  4895. this.fsScandirSettings = new fsScandir.Settings({
  4896. followSymbolicLinks: this._options.followSymbolicLinks,
  4897. fs: this._options.fs,
  4898. pathSegmentSeparator: this._options.pathSegmentSeparator,
  4899. stats: this._options.stats,
  4900. throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
  4901. });
  4902. }
  4903. _getValue(option, value) {
  4904. return option !== null && option !== void 0 ? option : value;
  4905. }
  4906. };
  4907. exports.default = Settings$1;
  4908. }) });
  4909. //#endregion
  4910. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js
  4911. var require_out$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js": ((exports) => {
  4912. Object.defineProperty(exports, "__esModule", { value: true });
  4913. const async_1$2 = require_async$2();
  4914. const stream_1$4 = require_stream$2();
  4915. const sync_1$2 = require_sync$2();
  4916. const settings_1$1 = require_settings$1();
  4917. exports.Settings = settings_1$1.default;
  4918. function walk(directory, optionsOrSettingsOrCallback, callback) {
  4919. if (typeof optionsOrSettingsOrCallback === "function") {
  4920. new async_1$2.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
  4921. return;
  4922. }
  4923. new async_1$2.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
  4924. }
  4925. exports.walk = walk;
  4926. function walkSync(directory, optionsOrSettings) {
  4927. const settings = getSettings(optionsOrSettings);
  4928. return new sync_1$2.default(directory, settings).read();
  4929. }
  4930. exports.walkSync = walkSync;
  4931. function walkStream(directory, optionsOrSettings) {
  4932. const settings = getSettings(optionsOrSettings);
  4933. return new stream_1$4.default(directory, settings).read();
  4934. }
  4935. exports.walkStream = walkStream;
  4936. function getSettings(settingsOrOptions = {}) {
  4937. if (settingsOrOptions instanceof settings_1$1.default) return settingsOrOptions;
  4938. return new settings_1$1.default(settingsOrOptions);
  4939. }
  4940. }) });
  4941. //#endregion
  4942. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js
  4943. var require_reader = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js": ((exports) => {
  4944. Object.defineProperty(exports, "__esModule", { value: true });
  4945. const path$2 = __require("path");
  4946. const fsStat$2 = require_out$3();
  4947. const utils$6 = require_utils$1();
  4948. var Reader = class {
  4949. constructor(_settings) {
  4950. this._settings = _settings;
  4951. this._fsStatSettings = new fsStat$2.Settings({
  4952. followSymbolicLink: this._settings.followSymbolicLinks,
  4953. fs: this._settings.fs,
  4954. throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
  4955. });
  4956. }
  4957. _getFullEntryPath(filepath) {
  4958. return path$2.resolve(this._settings.cwd, filepath);
  4959. }
  4960. _makeEntry(stats, pattern$1) {
  4961. const entry = {
  4962. name: pattern$1,
  4963. path: pattern$1,
  4964. dirent: utils$6.fs.createDirentFromStats(pattern$1, stats)
  4965. };
  4966. if (this._settings.stats) entry.stats = stats;
  4967. return entry;
  4968. }
  4969. _isFatalError(error) {
  4970. return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
  4971. }
  4972. };
  4973. exports.default = Reader;
  4974. }) });
  4975. //#endregion
  4976. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/stream.js
  4977. var require_stream$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/stream.js": ((exports) => {
  4978. Object.defineProperty(exports, "__esModule", { value: true });
  4979. const stream_1$3 = __require("stream");
  4980. const fsStat$1 = require_out$3();
  4981. const fsWalk$2 = require_out$1();
  4982. const reader_1$2 = require_reader();
  4983. var ReaderStream = class extends reader_1$2.default {
  4984. constructor() {
  4985. super(...arguments);
  4986. this._walkStream = fsWalk$2.walkStream;
  4987. this._stat = fsStat$1.stat;
  4988. }
  4989. dynamic(root, options$1) {
  4990. return this._walkStream(root, options$1);
  4991. }
  4992. static(patterns, options$1) {
  4993. const filepaths = patterns.map(this._getFullEntryPath, this);
  4994. const stream$1 = new stream_1$3.PassThrough({ objectMode: true });
  4995. stream$1._write = (index, _enc, done) => {
  4996. return this._getEntry(filepaths[index], patterns[index], options$1).then((entry) => {
  4997. if (entry !== null && options$1.entryFilter(entry)) stream$1.push(entry);
  4998. if (index === filepaths.length - 1) stream$1.end();
  4999. done();
  5000. }).catch(done);
  5001. };
  5002. for (let i = 0; i < filepaths.length; i++) stream$1.write(i);
  5003. return stream$1;
  5004. }
  5005. _getEntry(filepath, pattern$1, options$1) {
  5006. return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern$1)).catch((error) => {
  5007. if (options$1.errorFilter(error)) return null;
  5008. throw error;
  5009. });
  5010. }
  5011. _getStat(filepath) {
  5012. return new Promise((resolve$2, reject) => {
  5013. this._stat(filepath, this._fsStatSettings, (error, stats) => {
  5014. return error === null ? resolve$2(stats) : reject(error);
  5015. });
  5016. });
  5017. }
  5018. };
  5019. exports.default = ReaderStream;
  5020. }) });
  5021. //#endregion
  5022. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/async.js
  5023. var require_async$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/async.js": ((exports) => {
  5024. Object.defineProperty(exports, "__esModule", { value: true });
  5025. const fsWalk$1 = require_out$1();
  5026. const reader_1$1 = require_reader();
  5027. const stream_1$2 = require_stream$1();
  5028. var ReaderAsync = class extends reader_1$1.default {
  5029. constructor() {
  5030. super(...arguments);
  5031. this._walkAsync = fsWalk$1.walk;
  5032. this._readerStream = new stream_1$2.default(this._settings);
  5033. }
  5034. dynamic(root, options$1) {
  5035. return new Promise((resolve$2, reject) => {
  5036. this._walkAsync(root, options$1, (error, entries) => {
  5037. if (error === null) resolve$2(entries);
  5038. else reject(error);
  5039. });
  5040. });
  5041. }
  5042. async static(patterns, options$1) {
  5043. const entries = [];
  5044. const stream$1 = this._readerStream.static(patterns, options$1);
  5045. return new Promise((resolve$2, reject) => {
  5046. stream$1.once("error", reject);
  5047. stream$1.on("data", (entry) => entries.push(entry));
  5048. stream$1.once("end", () => resolve$2(entries));
  5049. });
  5050. }
  5051. };
  5052. exports.default = ReaderAsync;
  5053. }) });
  5054. //#endregion
  5055. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/matcher.js
  5056. var require_matcher = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/matcher.js": ((exports) => {
  5057. Object.defineProperty(exports, "__esModule", { value: true });
  5058. const utils$5 = require_utils$1();
  5059. var Matcher = class {
  5060. constructor(_patterns, _settings, _micromatchOptions) {
  5061. this._patterns = _patterns;
  5062. this._settings = _settings;
  5063. this._micromatchOptions = _micromatchOptions;
  5064. this._storage = [];
  5065. this._fillStorage();
  5066. }
  5067. _fillStorage() {
  5068. for (const pattern$1 of this._patterns) {
  5069. const segments = this._getPatternSegments(pattern$1);
  5070. const sections = this._splitSegmentsIntoSections(segments);
  5071. this._storage.push({
  5072. complete: sections.length <= 1,
  5073. pattern: pattern$1,
  5074. segments,
  5075. sections
  5076. });
  5077. }
  5078. }
  5079. _getPatternSegments(pattern$1) {
  5080. return utils$5.pattern.getPatternParts(pattern$1, this._micromatchOptions).map((part) => {
  5081. if (!utils$5.pattern.isDynamicPattern(part, this._settings)) return {
  5082. dynamic: false,
  5083. pattern: part
  5084. };
  5085. return {
  5086. dynamic: true,
  5087. pattern: part,
  5088. patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
  5089. };
  5090. });
  5091. }
  5092. _splitSegmentsIntoSections(segments) {
  5093. return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
  5094. }
  5095. };
  5096. exports.default = Matcher;
  5097. }) });
  5098. //#endregion
  5099. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/partial.js
  5100. var require_partial = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/partial.js": ((exports) => {
  5101. Object.defineProperty(exports, "__esModule", { value: true });
  5102. const matcher_1 = require_matcher();
  5103. var PartialMatcher = class extends matcher_1.default {
  5104. match(filepath) {
  5105. const parts = filepath.split("/");
  5106. const levels = parts.length;
  5107. const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
  5108. for (const pattern$1 of patterns) {
  5109. const section = pattern$1.sections[0];
  5110. /**
  5111. * In this case, the pattern has a globstar and we must read all directories unconditionally,
  5112. * but only if the level has reached the end of the first group.
  5113. *
  5114. * fixtures/{a,b}/**
  5115. * ^ true/false ^ always true
  5116. */
  5117. if (!pattern$1.complete && levels > section.length) return true;
  5118. if (parts.every((part, index) => {
  5119. const segment = pattern$1.segments[index];
  5120. if (segment.dynamic && segment.patternRe.test(part)) return true;
  5121. if (!segment.dynamic && segment.pattern === part) return true;
  5122. return false;
  5123. })) return true;
  5124. }
  5125. return false;
  5126. }
  5127. };
  5128. exports.default = PartialMatcher;
  5129. }) });
  5130. //#endregion
  5131. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/deep.js
  5132. var require_deep = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/deep.js": ((exports) => {
  5133. Object.defineProperty(exports, "__esModule", { value: true });
  5134. const utils$4 = require_utils$1();
  5135. const partial_1 = require_partial();
  5136. var DeepFilter = class {
  5137. constructor(_settings, _micromatchOptions) {
  5138. this._settings = _settings;
  5139. this._micromatchOptions = _micromatchOptions;
  5140. }
  5141. getFilter(basePath, positive, negative) {
  5142. const matcher = this._getMatcher(positive);
  5143. const negativeRe = this._getNegativePatternsRe(negative);
  5144. return (entry) => this._filter(basePath, entry, matcher, negativeRe);
  5145. }
  5146. _getMatcher(patterns) {
  5147. return new partial_1.default(patterns, this._settings, this._micromatchOptions);
  5148. }
  5149. _getNegativePatternsRe(patterns) {
  5150. const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
  5151. return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
  5152. }
  5153. _filter(basePath, entry, matcher, negativeRe) {
  5154. if (this._isSkippedByDeep(basePath, entry.path)) return false;
  5155. if (this._isSkippedSymbolicLink(entry)) return false;
  5156. const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
  5157. if (this._isSkippedByPositivePatterns(filepath, matcher)) return false;
  5158. return this._isSkippedByNegativePatterns(filepath, negativeRe);
  5159. }
  5160. _isSkippedByDeep(basePath, entryPath) {
  5161. /**
  5162. * Avoid unnecessary depth calculations when it doesn't matter.
  5163. */
  5164. if (this._settings.deep === Infinity) return false;
  5165. return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
  5166. }
  5167. _getEntryLevel(basePath, entryPath) {
  5168. const entryPathDepth = entryPath.split("/").length;
  5169. if (basePath === "") return entryPathDepth;
  5170. const basePathDepth = basePath.split("/").length;
  5171. return entryPathDepth - basePathDepth;
  5172. }
  5173. _isSkippedSymbolicLink(entry) {
  5174. return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
  5175. }
  5176. _isSkippedByPositivePatterns(entryPath, matcher) {
  5177. return !this._settings.baseNameMatch && !matcher.match(entryPath);
  5178. }
  5179. _isSkippedByNegativePatterns(entryPath, patternsRe) {
  5180. return !utils$4.pattern.matchAny(entryPath, patternsRe);
  5181. }
  5182. };
  5183. exports.default = DeepFilter;
  5184. }) });
  5185. //#endregion
  5186. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.js
  5187. var require_entry$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.js": ((exports) => {
  5188. Object.defineProperty(exports, "__esModule", { value: true });
  5189. const utils$3 = require_utils$1();
  5190. var EntryFilter = class {
  5191. constructor(_settings, _micromatchOptions) {
  5192. this._settings = _settings;
  5193. this._micromatchOptions = _micromatchOptions;
  5194. this.index = /* @__PURE__ */ new Map();
  5195. }
  5196. getFilter(positive, negative) {
  5197. const [absoluteNegative, relativeNegative] = utils$3.pattern.partitionAbsoluteAndRelative(negative);
  5198. const patterns = {
  5199. positive: { all: utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions) },
  5200. negative: {
  5201. absolute: utils$3.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })),
  5202. relative: utils$3.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }))
  5203. }
  5204. };
  5205. return (entry) => this._filter(entry, patterns);
  5206. }
  5207. _filter(entry, patterns) {
  5208. const filepath = utils$3.path.removeLeadingDotSegment(entry.path);
  5209. if (this._settings.unique && this._isDuplicateEntry(filepath)) return false;
  5210. if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) return false;
  5211. const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());
  5212. if (this._settings.unique && isMatched) this._createIndexRecord(filepath);
  5213. return isMatched;
  5214. }
  5215. _isDuplicateEntry(filepath) {
  5216. return this.index.has(filepath);
  5217. }
  5218. _createIndexRecord(filepath) {
  5219. this.index.set(filepath, void 0);
  5220. }
  5221. _onlyFileFilter(entry) {
  5222. return this._settings.onlyFiles && !entry.dirent.isFile();
  5223. }
  5224. _onlyDirectoryFilter(entry) {
  5225. return this._settings.onlyDirectories && !entry.dirent.isDirectory();
  5226. }
  5227. _isMatchToPatternsSet(filepath, patterns, isDirectory) {
  5228. if (!this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory)) return false;
  5229. if (this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory)) return false;
  5230. if (this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory)) return false;
  5231. return true;
  5232. }
  5233. _isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory) {
  5234. if (patternsRe.length === 0) return false;
  5235. const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, filepath);
  5236. return this._isMatchToPatterns(fullpath, patternsRe, isDirectory);
  5237. }
  5238. _isMatchToPatterns(filepath, patternsRe, isDirectory) {
  5239. if (patternsRe.length === 0) return false;
  5240. const isMatched = utils$3.pattern.matchAny(filepath, patternsRe);
  5241. if (!isMatched && isDirectory) return utils$3.pattern.matchAny(filepath + "/", patternsRe);
  5242. return isMatched;
  5243. }
  5244. };
  5245. exports.default = EntryFilter;
  5246. }) });
  5247. //#endregion
  5248. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/error.js
  5249. var require_error = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/error.js": ((exports) => {
  5250. Object.defineProperty(exports, "__esModule", { value: true });
  5251. const utils$2 = require_utils$1();
  5252. var ErrorFilter = class {
  5253. constructor(_settings) {
  5254. this._settings = _settings;
  5255. }
  5256. getFilter() {
  5257. return (error) => this._isNonFatalError(error);
  5258. }
  5259. _isNonFatalError(error) {
  5260. return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
  5261. }
  5262. };
  5263. exports.default = ErrorFilter;
  5264. }) });
  5265. //#endregion
  5266. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/transformers/entry.js
  5267. var require_entry = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/transformers/entry.js": ((exports) => {
  5268. Object.defineProperty(exports, "__esModule", { value: true });
  5269. const utils$1 = require_utils$1();
  5270. var EntryTransformer = class {
  5271. constructor(_settings) {
  5272. this._settings = _settings;
  5273. }
  5274. getTransformer() {
  5275. return (entry) => this._transform(entry);
  5276. }
  5277. _transform(entry) {
  5278. let filepath = entry.path;
  5279. if (this._settings.absolute) {
  5280. filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
  5281. filepath = utils$1.path.unixify(filepath);
  5282. }
  5283. if (this._settings.markDirectories && entry.dirent.isDirectory()) filepath += "/";
  5284. if (!this._settings.objectMode) return filepath;
  5285. return Object.assign(Object.assign({}, entry), { path: filepath });
  5286. }
  5287. };
  5288. exports.default = EntryTransformer;
  5289. }) });
  5290. //#endregion
  5291. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js
  5292. var require_provider = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js": ((exports) => {
  5293. Object.defineProperty(exports, "__esModule", { value: true });
  5294. const path$1 = __require("path");
  5295. const deep_1 = require_deep();
  5296. const entry_1 = require_entry$1();
  5297. const error_1 = require_error();
  5298. const entry_2 = require_entry();
  5299. var Provider = class {
  5300. constructor(_settings) {
  5301. this._settings = _settings;
  5302. this.errorFilter = new error_1.default(this._settings);
  5303. this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
  5304. this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
  5305. this.entryTransformer = new entry_2.default(this._settings);
  5306. }
  5307. _getRootDirectory(task) {
  5308. return path$1.resolve(this._settings.cwd, task.base);
  5309. }
  5310. _getReaderOptions(task) {
  5311. const basePath = task.base === "." ? "" : task.base;
  5312. return {
  5313. basePath,
  5314. pathSegmentSeparator: "/",
  5315. concurrency: this._settings.concurrency,
  5316. deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
  5317. entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
  5318. errorFilter: this.errorFilter.getFilter(),
  5319. followSymbolicLinks: this._settings.followSymbolicLinks,
  5320. fs: this._settings.fs,
  5321. stats: this._settings.stats,
  5322. throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
  5323. transform: this.entryTransformer.getTransformer()
  5324. };
  5325. }
  5326. _getMicromatchOptions() {
  5327. return {
  5328. dot: this._settings.dot,
  5329. matchBase: this._settings.baseNameMatch,
  5330. nobrace: !this._settings.braceExpansion,
  5331. nocase: !this._settings.caseSensitiveMatch,
  5332. noext: !this._settings.extglob,
  5333. noglobstar: !this._settings.globstar,
  5334. posix: true,
  5335. strictSlashes: false
  5336. };
  5337. }
  5338. };
  5339. exports.default = Provider;
  5340. }) });
  5341. //#endregion
  5342. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/async.js
  5343. var require_async = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/async.js": ((exports) => {
  5344. Object.defineProperty(exports, "__esModule", { value: true });
  5345. const async_1$1 = require_async$1();
  5346. const provider_1$2 = require_provider();
  5347. var ProviderAsync = class extends provider_1$2.default {
  5348. constructor() {
  5349. super(...arguments);
  5350. this._reader = new async_1$1.default(this._settings);
  5351. }
  5352. async read(task) {
  5353. const root = this._getRootDirectory(task);
  5354. const options$1 = this._getReaderOptions(task);
  5355. return (await this.api(root, task, options$1)).map((entry) => options$1.transform(entry));
  5356. }
  5357. api(root, task, options$1) {
  5358. if (task.dynamic) return this._reader.dynamic(root, options$1);
  5359. return this._reader.static(task.patterns, options$1);
  5360. }
  5361. };
  5362. exports.default = ProviderAsync;
  5363. }) });
  5364. //#endregion
  5365. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/stream.js
  5366. var require_stream = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/stream.js": ((exports) => {
  5367. Object.defineProperty(exports, "__esModule", { value: true });
  5368. const stream_1$1 = __require("stream");
  5369. const stream_2 = require_stream$1();
  5370. const provider_1$1 = require_provider();
  5371. var ProviderStream = class extends provider_1$1.default {
  5372. constructor() {
  5373. super(...arguments);
  5374. this._reader = new stream_2.default(this._settings);
  5375. }
  5376. read(task) {
  5377. const root = this._getRootDirectory(task);
  5378. const options$1 = this._getReaderOptions(task);
  5379. const source = this.api(root, task, options$1);
  5380. const destination = new stream_1$1.Readable({
  5381. objectMode: true,
  5382. read: () => {}
  5383. });
  5384. source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options$1.transform(entry))).once("end", () => destination.emit("end"));
  5385. destination.once("close", () => source.destroy());
  5386. return destination;
  5387. }
  5388. api(root, task, options$1) {
  5389. if (task.dynamic) return this._reader.dynamic(root, options$1);
  5390. return this._reader.static(task.patterns, options$1);
  5391. }
  5392. };
  5393. exports.default = ProviderStream;
  5394. }) });
  5395. //#endregion
  5396. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/sync.js
  5397. var require_sync$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/sync.js": ((exports) => {
  5398. Object.defineProperty(exports, "__esModule", { value: true });
  5399. const fsStat = require_out$3();
  5400. const fsWalk = require_out$1();
  5401. const reader_1 = require_reader();
  5402. var ReaderSync = class extends reader_1.default {
  5403. constructor() {
  5404. super(...arguments);
  5405. this._walkSync = fsWalk.walkSync;
  5406. this._statSync = fsStat.statSync;
  5407. }
  5408. dynamic(root, options$1) {
  5409. return this._walkSync(root, options$1);
  5410. }
  5411. static(patterns, options$1) {
  5412. const entries = [];
  5413. for (const pattern$1 of patterns) {
  5414. const filepath = this._getFullEntryPath(pattern$1);
  5415. const entry = this._getEntry(filepath, pattern$1, options$1);
  5416. if (entry === null || !options$1.entryFilter(entry)) continue;
  5417. entries.push(entry);
  5418. }
  5419. return entries;
  5420. }
  5421. _getEntry(filepath, pattern$1, options$1) {
  5422. try {
  5423. const stats = this._getStat(filepath);
  5424. return this._makeEntry(stats, pattern$1);
  5425. } catch (error) {
  5426. if (options$1.errorFilter(error)) return null;
  5427. throw error;
  5428. }
  5429. }
  5430. _getStat(filepath) {
  5431. return this._statSync(filepath, this._fsStatSettings);
  5432. }
  5433. };
  5434. exports.default = ReaderSync;
  5435. }) });
  5436. //#endregion
  5437. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/sync.js
  5438. var require_sync = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/sync.js": ((exports) => {
  5439. Object.defineProperty(exports, "__esModule", { value: true });
  5440. const sync_1$1 = require_sync$1();
  5441. const provider_1 = require_provider();
  5442. var ProviderSync = class extends provider_1.default {
  5443. constructor() {
  5444. super(...arguments);
  5445. this._reader = new sync_1$1.default(this._settings);
  5446. }
  5447. read(task) {
  5448. const root = this._getRootDirectory(task);
  5449. const options$1 = this._getReaderOptions(task);
  5450. return this.api(root, task, options$1).map(options$1.transform);
  5451. }
  5452. api(root, task, options$1) {
  5453. if (task.dynamic) return this._reader.dynamic(root, options$1);
  5454. return this._reader.static(task.patterns, options$1);
  5455. }
  5456. };
  5457. exports.default = ProviderSync;
  5458. }) });
  5459. //#endregion
  5460. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js
  5461. var require_settings = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js": ((exports) => {
  5462. Object.defineProperty(exports, "__esModule", { value: true });
  5463. const fs$1 = __require("fs");
  5464. const os = __require("os");
  5465. /**
  5466. * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
  5467. * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
  5468. */
  5469. const CPU_COUNT = Math.max(os.cpus().length, 1);
  5470. exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
  5471. lstat: fs$1.lstat,
  5472. lstatSync: fs$1.lstatSync,
  5473. stat: fs$1.stat,
  5474. statSync: fs$1.statSync,
  5475. readdir: fs$1.readdir,
  5476. readdirSync: fs$1.readdirSync
  5477. };
  5478. var Settings = class {
  5479. constructor(_options = {}) {
  5480. this._options = _options;
  5481. this.absolute = this._getValue(this._options.absolute, false);
  5482. this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
  5483. this.braceExpansion = this._getValue(this._options.braceExpansion, true);
  5484. this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
  5485. this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
  5486. this.cwd = this._getValue(this._options.cwd, process.cwd());
  5487. this.deep = this._getValue(this._options.deep, Infinity);
  5488. this.dot = this._getValue(this._options.dot, false);
  5489. this.extglob = this._getValue(this._options.extglob, true);
  5490. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
  5491. this.fs = this._getFileSystemMethods(this._options.fs);
  5492. this.globstar = this._getValue(this._options.globstar, true);
  5493. this.ignore = this._getValue(this._options.ignore, []);
  5494. this.markDirectories = this._getValue(this._options.markDirectories, false);
  5495. this.objectMode = this._getValue(this._options.objectMode, false);
  5496. this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
  5497. this.onlyFiles = this._getValue(this._options.onlyFiles, true);
  5498. this.stats = this._getValue(this._options.stats, false);
  5499. this.suppressErrors = this._getValue(this._options.suppressErrors, false);
  5500. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
  5501. this.unique = this._getValue(this._options.unique, true);
  5502. if (this.onlyDirectories) this.onlyFiles = false;
  5503. if (this.stats) this.objectMode = true;
  5504. this.ignore = [].concat(this.ignore);
  5505. }
  5506. _getValue(option, value) {
  5507. return option === void 0 ? value : option;
  5508. }
  5509. _getFileSystemMethods(methods$1 = {}) {
  5510. return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods$1);
  5511. }
  5512. };
  5513. exports.default = Settings;
  5514. }) });
  5515. //#endregion
  5516. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/index.js
  5517. var require_out = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/index.js": ((exports, module) => {
  5518. const taskManager = require_tasks();
  5519. const async_1 = require_async();
  5520. const stream_1 = require_stream();
  5521. const sync_1 = require_sync();
  5522. const settings_1 = require_settings();
  5523. const utils = require_utils$1();
  5524. async function FastGlob(source, options$1) {
  5525. assertPatternsInput(source);
  5526. const works = getWorks(source, async_1.default, options$1);
  5527. const result = await Promise.all(works);
  5528. return utils.array.flatten(result);
  5529. }
  5530. (function(FastGlob$1) {
  5531. FastGlob$1.glob = FastGlob$1;
  5532. FastGlob$1.globSync = sync$2;
  5533. FastGlob$1.globStream = stream$1;
  5534. FastGlob$1.async = FastGlob$1;
  5535. function sync$2(source, options$1) {
  5536. assertPatternsInput(source);
  5537. const works = getWorks(source, sync_1.default, options$1);
  5538. return utils.array.flatten(works);
  5539. }
  5540. FastGlob$1.sync = sync$2;
  5541. function stream$1(source, options$1) {
  5542. assertPatternsInput(source);
  5543. const works = getWorks(source, stream_1.default, options$1);
  5544. /**
  5545. * The stream returned by the provider cannot work with an asynchronous iterator.
  5546. * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
  5547. * This affects performance (+25%). I don't see best solution right now.
  5548. */
  5549. return utils.stream.merge(works);
  5550. }
  5551. FastGlob$1.stream = stream$1;
  5552. function generateTasks(source, options$1) {
  5553. assertPatternsInput(source);
  5554. const patterns = [].concat(source);
  5555. const settings = new settings_1.default(options$1);
  5556. return taskManager.generate(patterns, settings);
  5557. }
  5558. FastGlob$1.generateTasks = generateTasks;
  5559. function isDynamicPattern$1(source, options$1) {
  5560. assertPatternsInput(source);
  5561. const settings = new settings_1.default(options$1);
  5562. return utils.pattern.isDynamicPattern(source, settings);
  5563. }
  5564. FastGlob$1.isDynamicPattern = isDynamicPattern$1;
  5565. function escapePath(source) {
  5566. assertPatternsInput(source);
  5567. return utils.path.escape(source);
  5568. }
  5569. FastGlob$1.escapePath = escapePath;
  5570. function convertPathToPattern(source) {
  5571. assertPatternsInput(source);
  5572. return utils.path.convertPathToPattern(source);
  5573. }
  5574. FastGlob$1.convertPathToPattern = convertPathToPattern;
  5575. (function(posix) {
  5576. function escapePath$1(source) {
  5577. assertPatternsInput(source);
  5578. return utils.path.escapePosixPath(source);
  5579. }
  5580. posix.escapePath = escapePath$1;
  5581. function convertPathToPattern$1(source) {
  5582. assertPatternsInput(source);
  5583. return utils.path.convertPosixPathToPattern(source);
  5584. }
  5585. posix.convertPathToPattern = convertPathToPattern$1;
  5586. })(FastGlob$1.posix || (FastGlob$1.posix = {}));
  5587. (function(win32$1) {
  5588. function escapePath$1(source) {
  5589. assertPatternsInput(source);
  5590. return utils.path.escapeWindowsPath(source);
  5591. }
  5592. win32$1.escapePath = escapePath$1;
  5593. function convertPathToPattern$1(source) {
  5594. assertPatternsInput(source);
  5595. return utils.path.convertWindowsPathToPattern(source);
  5596. }
  5597. win32$1.convertPathToPattern = convertPathToPattern$1;
  5598. })(FastGlob$1.win32 || (FastGlob$1.win32 = {}));
  5599. })(FastGlob || (FastGlob = {}));
  5600. function getWorks(source, _Provider, options$1) {
  5601. const patterns = [].concat(source);
  5602. const settings = new settings_1.default(options$1);
  5603. const tasks = taskManager.generate(patterns, settings);
  5604. const provider = new _Provider(settings);
  5605. return tasks.map(provider.read, provider);
  5606. }
  5607. function assertPatternsInput(input) {
  5608. if (![].concat(input).every((item) => utils.string.isString(item) && !utils.string.isEmpty(item))) throw new TypeError("Patterns must be a string (non empty) or an array of strings");
  5609. }
  5610. module.exports = FastGlob;
  5611. }) });
  5612. //#endregion
  5613. //#region ../../node_modules/.pnpm/image-meta@0.2.1/node_modules/image-meta/dist/index.mjs
  5614. var import_out = /* @__PURE__ */ __toESM(require_out(), 1);
  5615. const decoder = new TextDecoder();
  5616. const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
  5617. const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + ("0" + i.toString(16)).slice(-2), "");
  5618. const readInt16LE = (input, offset = 0) => {
  5619. const val = input[offset] + input[offset + 1] * 2 ** 8;
  5620. return val | (val & 2 ** 15) * 131070;
  5621. };
  5622. const readUInt16BE = (input, offset = 0) => input[offset] * 2 ** 8 + input[offset + 1];
  5623. const readUInt16LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8;
  5624. const readUInt24LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16;
  5625. const readInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + (input[offset + 3] << 24);
  5626. const readUInt32BE = (input, offset = 0) => input[offset] * 2 ** 24 + input[offset + 1] * 2 ** 16 + input[offset + 2] * 2 ** 8 + input[offset + 3];
  5627. const readUInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + input[offset + 3] * 2 ** 24;
  5628. const methods = {
  5629. readUInt16BE,
  5630. readUInt16LE,
  5631. readUInt32BE,
  5632. readUInt32LE
  5633. };
  5634. function readUInt(input, bits, offset, isBigEndian) {
  5635. offset = offset || 0;
  5636. const endian = isBigEndian ? "BE" : "LE";
  5637. const methodName = "readUInt" + bits + endian;
  5638. return methods[methodName](input, offset);
  5639. }
  5640. const BMP = {
  5641. validate: (input) => toUTF8String(input, 0, 2) === "BM",
  5642. calculate: (input) => ({
  5643. height: Math.abs(readInt32LE(input, 22)),
  5644. width: readUInt32LE(input, 18)
  5645. })
  5646. };
  5647. const TYPE_ICON = 1;
  5648. const SIZE_HEADER$1 = 6;
  5649. const SIZE_IMAGE_ENTRY = 16;
  5650. function getSizeFromOffset(input, offset) {
  5651. const value = input[offset];
  5652. return value === 0 ? 256 : value;
  5653. }
  5654. function getImageSize$1(input, imageIndex) {
  5655. const offset = SIZE_HEADER$1 + imageIndex * SIZE_IMAGE_ENTRY;
  5656. return {
  5657. height: getSizeFromOffset(input, offset + 1),
  5658. width: getSizeFromOffset(input, offset)
  5659. };
  5660. }
  5661. const ICO = {
  5662. validate(input) {
  5663. const reserved = readUInt16LE(input, 0);
  5664. const imageCount = readUInt16LE(input, 4);
  5665. if (reserved !== 0 || imageCount === 0) return false;
  5666. return readUInt16LE(input, 2) === TYPE_ICON;
  5667. },
  5668. calculate(input) {
  5669. const nbImages = readUInt16LE(input, 4);
  5670. const imageSize = getImageSize$1(input, 0);
  5671. if (nbImages === 1) return imageSize;
  5672. const imgs = [imageSize];
  5673. for (let imageIndex = 1; imageIndex < nbImages; imageIndex += 1) imgs.push(getImageSize$1(input, imageIndex));
  5674. return {
  5675. height: imageSize.height,
  5676. images: imgs,
  5677. width: imageSize.width
  5678. };
  5679. }
  5680. };
  5681. const TYPE_CURSOR = 2;
  5682. const CUR = {
  5683. validate(input) {
  5684. const reserved = readUInt16LE(input, 0);
  5685. const imageCount = readUInt16LE(input, 4);
  5686. if (reserved !== 0 || imageCount === 0) return false;
  5687. return readUInt16LE(input, 2) === TYPE_CURSOR;
  5688. },
  5689. calculate: (input) => ICO.calculate(input)
  5690. };
  5691. const DDS = {
  5692. validate: (input) => readUInt32LE(input, 0) === 542327876,
  5693. calculate: (input) => ({
  5694. height: readUInt32LE(input, 12),
  5695. width: readUInt32LE(input, 16)
  5696. })
  5697. };
  5698. const gifRegexp = /^GIF8[79]a/;
  5699. const GIF = {
  5700. validate: (input) => gifRegexp.test(toUTF8String(input, 0, 6)),
  5701. calculate: (input) => ({
  5702. height: readUInt16LE(input, 8),
  5703. width: readUInt16LE(input, 6)
  5704. })
  5705. };
  5706. const SIZE_HEADER = 8;
  5707. const FILE_LENGTH_OFFSET = 4;
  5708. const ENTRY_LENGTH_OFFSET = 4;
  5709. const ICON_TYPE_SIZE = {
  5710. ICON: 32,
  5711. "ICN#": 32,
  5712. "icm#": 16,
  5713. icm4: 16,
  5714. icm8: 16,
  5715. "ics#": 16,
  5716. ics4: 16,
  5717. ics8: 16,
  5718. is32: 16,
  5719. s8mk: 16,
  5720. icp4: 16,
  5721. icl4: 32,
  5722. icl8: 32,
  5723. il32: 32,
  5724. l8mk: 32,
  5725. icp5: 32,
  5726. ic11: 32,
  5727. ich4: 48,
  5728. ich8: 48,
  5729. ih32: 48,
  5730. h8mk: 48,
  5731. icp6: 64,
  5732. ic12: 32,
  5733. it32: 128,
  5734. t8mk: 128,
  5735. ic07: 128,
  5736. ic08: 256,
  5737. ic13: 256,
  5738. ic09: 512,
  5739. ic14: 512,
  5740. ic10: 1024
  5741. };
  5742. function readImageHeader(input, imageOffset) {
  5743. const imageLengthOffset = imageOffset + ENTRY_LENGTH_OFFSET;
  5744. return [toUTF8String(input, imageOffset, imageLengthOffset), readUInt32BE(input, imageLengthOffset)];
  5745. }
  5746. function getImageSize(type) {
  5747. const size = ICON_TYPE_SIZE[type];
  5748. return {
  5749. width: size,
  5750. height: size,
  5751. type
  5752. };
  5753. }
  5754. const ICNS = {
  5755. validate: (input) => toUTF8String(input, 0, 4) === "icns",
  5756. calculate(input) {
  5757. const inputLength = input.length;
  5758. const fileLength = readUInt32BE(input, FILE_LENGTH_OFFSET);
  5759. let imageOffset = SIZE_HEADER;
  5760. let imageHeader = readImageHeader(input, imageOffset);
  5761. let imageSize = getImageSize(imageHeader[0]);
  5762. imageOffset += imageHeader[1];
  5763. if (imageOffset === fileLength) return imageSize;
  5764. const result = {
  5765. height: imageSize.height,
  5766. images: [imageSize],
  5767. width: imageSize.width
  5768. };
  5769. while (imageOffset < fileLength && imageOffset < inputLength) {
  5770. imageHeader = readImageHeader(input, imageOffset);
  5771. imageSize = getImageSize(imageHeader[0]);
  5772. imageOffset += imageHeader[1];
  5773. result.images.push(imageSize);
  5774. }
  5775. return result;
  5776. }
  5777. };
  5778. const J2C = {
  5779. validate: (input) => toHexString(input, 0, 4) === "ff4fff51",
  5780. calculate: (input) => ({
  5781. height: readUInt32BE(input, 12),
  5782. width: readUInt32BE(input, 8)
  5783. })
  5784. };
  5785. const BoxTypes = {
  5786. ftyp: "66747970",
  5787. ihdr: "69686472",
  5788. jp2h: "6a703268",
  5789. jp__: "6a502020",
  5790. rreq: "72726571",
  5791. xml_: "786d6c20"
  5792. };
  5793. const calculateRREQLength = (box) => {
  5794. const unit = box[0];
  5795. let offset = 1 + 2 * unit;
  5796. const flagsLength = readUInt16BE(box, offset) * (2 + unit);
  5797. offset = offset + 2 + flagsLength;
  5798. const featuresLength = readUInt16BE(box, offset) * (16 + unit);
  5799. return offset + 2 + featuresLength;
  5800. };
  5801. const parseIHDR = (box) => {
  5802. return {
  5803. height: readUInt32BE(box, 4),
  5804. width: readUInt32BE(box, 8)
  5805. };
  5806. };
  5807. const JP2 = {
  5808. validate(input) {
  5809. const signature = toHexString(input, 4, 8);
  5810. const signatureLength = readUInt32BE(input, 0);
  5811. if (signature !== BoxTypes.jp__ || signatureLength < 1) return false;
  5812. const ftypeBoxStart = signatureLength + 4;
  5813. const ftypBoxLength = readUInt32BE(input, signatureLength);
  5814. const ftypBox = input.slice(ftypeBoxStart, ftypeBoxStart + ftypBoxLength);
  5815. return toHexString(ftypBox, 0, 4) === BoxTypes.ftyp;
  5816. },
  5817. calculate(input) {
  5818. const signatureLength = readUInt32BE(input, 0);
  5819. const ftypBoxLength = readUInt16BE(input, signatureLength + 2);
  5820. let offset = signatureLength + 4 + ftypBoxLength;
  5821. switch (toHexString(input, offset, offset + 4)) {
  5822. case BoxTypes.rreq:
  5823. offset = offset + 4 + 4 + calculateRREQLength(input.slice(offset + 4));
  5824. return parseIHDR(input.slice(offset + 8, offset + 24));
  5825. case BoxTypes.jp2h: return parseIHDR(input.slice(offset + 8, offset + 24));
  5826. default: throw new TypeError("Unsupported header found: " + toUTF8String(input, offset, offset + 4));
  5827. }
  5828. }
  5829. };
  5830. const EXIF_MARKER = "45786966";
  5831. const APP1_DATA_SIZE_BYTES = 2;
  5832. const EXIF_HEADER_BYTES = 6;
  5833. const TIFF_BYTE_ALIGN_BYTES = 2;
  5834. const BIG_ENDIAN_BYTE_ALIGN = "4d4d";
  5835. const LITTLE_ENDIAN_BYTE_ALIGN = "4949";
  5836. const IDF_ENTRY_BYTES = 12;
  5837. const NUM_DIRECTORY_ENTRIES_BYTES = 2;
  5838. function isEXIF(input) {
  5839. return toHexString(input, 2, 6) === EXIF_MARKER;
  5840. }
  5841. function extractSize(input, index) {
  5842. return {
  5843. height: readUInt16BE(input, index),
  5844. width: readUInt16BE(input, index + 2)
  5845. };
  5846. }
  5847. function extractOrientation(exifBlock, isBigEndian) {
  5848. const offset = EXIF_HEADER_BYTES + 8;
  5849. const idfDirectoryEntries = readUInt(exifBlock, 16, offset, isBigEndian);
  5850. for (let directoryEntryNumber = 0; directoryEntryNumber < idfDirectoryEntries; directoryEntryNumber++) {
  5851. const start = offset + NUM_DIRECTORY_ENTRIES_BYTES + directoryEntryNumber * IDF_ENTRY_BYTES;
  5852. const end = start + IDF_ENTRY_BYTES;
  5853. if (start > exifBlock.length) return;
  5854. const block = exifBlock.slice(start, end);
  5855. if (readUInt(block, 16, 0, isBigEndian) === 274) {
  5856. if (readUInt(block, 16, 2, isBigEndian) !== 3) return;
  5857. if (readUInt(block, 32, 4, isBigEndian) !== 1) return;
  5858. return readUInt(block, 16, 8, isBigEndian);
  5859. }
  5860. }
  5861. }
  5862. function validateExifBlock(input, index) {
  5863. const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index);
  5864. const byteAlign = toHexString(exifBlock, EXIF_HEADER_BYTES, EXIF_HEADER_BYTES + TIFF_BYTE_ALIGN_BYTES);
  5865. const isBigEndian = byteAlign === BIG_ENDIAN_BYTE_ALIGN;
  5866. if (isBigEndian || byteAlign === LITTLE_ENDIAN_BYTE_ALIGN) return extractOrientation(exifBlock, isBigEndian);
  5867. }
  5868. function validateInput(input, index) {
  5869. if (index > input.length) throw new TypeError("Corrupt JPG, exceeded buffer limits");
  5870. if (input[index] !== 255) throw new TypeError("Invalid JPG, marker table corrupted");
  5871. }
  5872. const JPG = {
  5873. validate: (input) => toHexString(input, 0, 2) === "ffd8",
  5874. calculate(input) {
  5875. input = input.slice(4);
  5876. let orientation;
  5877. let next;
  5878. while (input.length > 0) {
  5879. const i = readUInt16BE(input, 0);
  5880. if (isEXIF(input)) orientation = validateExifBlock(input, i);
  5881. validateInput(input, i);
  5882. next = input[i + 1];
  5883. if (next === 192 || next === 193 || next === 194) {
  5884. const size = extractSize(input, i + 5);
  5885. if (!orientation) return size;
  5886. return {
  5887. height: size.height,
  5888. orientation,
  5889. width: size.width
  5890. };
  5891. }
  5892. input = input.slice(i + 2);
  5893. }
  5894. throw new TypeError("Invalid JPG, no size found");
  5895. }
  5896. };
  5897. const KTX = {
  5898. validate: (input) => toUTF8String(input, 1, 7) === "KTX 11",
  5899. calculate: (input) => ({
  5900. height: readUInt32LE(input, 40),
  5901. width: readUInt32LE(input, 36)
  5902. })
  5903. };
  5904. const pngSignature = "PNG\r\n\n";
  5905. const pngImageHeaderChunkName = "IHDR";
  5906. const pngFriedChunkName = "CgBI";
  5907. const PNG = {
  5908. validate(input) {
  5909. if (pngSignature === toUTF8String(input, 1, 8)) {
  5910. let chunkName = toUTF8String(input, 12, 16);
  5911. if (chunkName === pngFriedChunkName) chunkName = toUTF8String(input, 28, 32);
  5912. if (chunkName !== pngImageHeaderChunkName) throw new TypeError("Invalid PNG");
  5913. return true;
  5914. }
  5915. return false;
  5916. },
  5917. calculate(input) {
  5918. if (toUTF8String(input, 12, 16) === pngFriedChunkName) return {
  5919. height: readUInt32BE(input, 36),
  5920. width: readUInt32BE(input, 32)
  5921. };
  5922. return {
  5923. height: readUInt32BE(input, 20),
  5924. width: readUInt32BE(input, 16)
  5925. };
  5926. }
  5927. };
  5928. const PNMTypes = {
  5929. P1: "pbm/ascii",
  5930. P2: "pgm/ascii",
  5931. P3: "ppm/ascii",
  5932. P4: "pbm",
  5933. P5: "pgm",
  5934. P6: "ppm",
  5935. P7: "pam",
  5936. PF: "pfm"
  5937. };
  5938. const handlers = {
  5939. default: (lines) => {
  5940. let dimensions = [];
  5941. while (lines.length > 0) {
  5942. const line = lines.shift();
  5943. if (line[0] === "#") continue;
  5944. dimensions = line.split(" ");
  5945. break;
  5946. }
  5947. if (dimensions.length === 2) return {
  5948. height: Number.parseInt(dimensions[1], 10),
  5949. width: Number.parseInt(dimensions[0], 10)
  5950. };
  5951. else throw new TypeError("Invalid PNM");
  5952. },
  5953. pam: (lines) => {
  5954. const size = {};
  5955. while (lines.length > 0) {
  5956. const line = lines.shift();
  5957. if (line.length > 16 || (line.codePointAt(0) || 0) > 128) continue;
  5958. const [key, value] = line.split(" ");
  5959. if (key && value) size[key.toLowerCase()] = Number.parseInt(value, 10);
  5960. if (size.height && size.width) break;
  5961. }
  5962. if (size.height && size.width) return {
  5963. height: size.height,
  5964. width: size.width
  5965. };
  5966. else throw new TypeError("Invalid PAM");
  5967. }
  5968. };
  5969. const PNM = {
  5970. validate: (input) => toUTF8String(input, 0, 2) in PNMTypes,
  5971. calculate(input) {
  5972. const signature = toUTF8String(input, 0, 2);
  5973. const type = PNMTypes[signature];
  5974. const lines = toUTF8String(input, 3).split(/[\n\r]+/);
  5975. return (handlers[type] || handlers.default)(lines);
  5976. }
  5977. };
  5978. const PSD = {
  5979. validate: (input) => toUTF8String(input, 0, 4) === "8BPS",
  5980. calculate: (input) => ({
  5981. height: readUInt32BE(input, 14),
  5982. width: readUInt32BE(input, 18)
  5983. })
  5984. };
  5985. const svgReg = /<svg\s([^"'>]|"[^"]*"|'[^']*')*>/;
  5986. const extractorRegExps = {
  5987. height: /\sheight=(["'])([^%]+?)\1/,
  5988. root: svgReg,
  5989. viewbox: /\sviewbox=(["'])(.+?)\1/i,
  5990. width: /\swidth=(["'])([^%]+?)\1/
  5991. };
  5992. const INCH_CM = 2.54;
  5993. const units = {
  5994. in: 96,
  5995. cm: 96 / INCH_CM,
  5996. em: 16,
  5997. ex: 8,
  5998. m: 96 / INCH_CM * 100,
  5999. mm: 96 / INCH_CM / 10,
  6000. pc: 96 / 72 / 12,
  6001. pt: 96 / 72,
  6002. px: 1
  6003. };
  6004. const unitsReg = /* @__PURE__ */ new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`);
  6005. function parseLength(len) {
  6006. const m = unitsReg.exec(len);
  6007. if (!m) return;
  6008. return Math.round(Number(m[1]) * (units[m[2]] || 1));
  6009. }
  6010. function parseViewbox(viewbox) {
  6011. const bounds = viewbox.split(" ");
  6012. return {
  6013. height: parseLength(bounds[3]),
  6014. width: parseLength(bounds[2])
  6015. };
  6016. }
  6017. function parseAttributes(root) {
  6018. const width = root.match(extractorRegExps.width);
  6019. const height = root.match(extractorRegExps.height);
  6020. const viewbox = root.match(extractorRegExps.viewbox);
  6021. return {
  6022. height: height && parseLength(height[2]),
  6023. viewbox: viewbox && parseViewbox(viewbox[2]),
  6024. width: width && parseLength(width[2])
  6025. };
  6026. }
  6027. function calculateByDimensions(attrs) {
  6028. return {
  6029. height: attrs.height,
  6030. width: attrs.width
  6031. };
  6032. }
  6033. function calculateByViewbox(attrs, viewbox) {
  6034. const ratio = viewbox.width / viewbox.height;
  6035. if (attrs.width) return {
  6036. height: Math.floor(attrs.width / ratio),
  6037. width: attrs.width
  6038. };
  6039. if (attrs.height) return {
  6040. height: attrs.height,
  6041. width: Math.floor(attrs.height * ratio)
  6042. };
  6043. return {
  6044. height: viewbox.height,
  6045. width: viewbox.width
  6046. };
  6047. }
  6048. const SVG = {
  6049. validate: (input) => svgReg.test(toUTF8String(input, 0, 1e3)),
  6050. calculate(input) {
  6051. const root = toUTF8String(input).match(extractorRegExps.root);
  6052. if (root) {
  6053. const attrs = parseAttributes(root[0]);
  6054. if (attrs.width && attrs.height) return calculateByDimensions(attrs);
  6055. if (attrs.viewbox) return calculateByViewbox(attrs, attrs.viewbox);
  6056. }
  6057. throw new TypeError("Invalid SVG");
  6058. }
  6059. };
  6060. const TGA = {
  6061. validate(input) {
  6062. return readUInt16LE(input, 0) === 0 && readUInt16LE(input, 4) === 0;
  6063. },
  6064. calculate(input) {
  6065. return {
  6066. height: readUInt16LE(input, 14),
  6067. width: readUInt16LE(input, 12)
  6068. };
  6069. }
  6070. };
  6071. function readIFD(buffer, isBigEndian) {
  6072. const ifdOffset = readUInt(buffer, 32, 4, isBigEndian);
  6073. let bufferSize = 1024;
  6074. const fileSize = buffer.length;
  6075. if (ifdOffset + bufferSize > fileSize) bufferSize = fileSize - ifdOffset - 10;
  6076. return buffer.slice(ifdOffset + 2, ifdOffset + 2 + bufferSize);
  6077. }
  6078. function readValue(buffer, isBigEndian) {
  6079. const low = readUInt(buffer, 16, 8, isBigEndian);
  6080. return (readUInt(buffer, 16, 10, isBigEndian) << 16) + low;
  6081. }
  6082. function nextTag(buffer) {
  6083. if (buffer.length > 24) return buffer.slice(12);
  6084. }
  6085. function extractTags(buffer, isBigEndian) {
  6086. const tags = {};
  6087. let temp = buffer;
  6088. while (temp && temp.length > 0) {
  6089. const code = readUInt(temp, 16, 0, isBigEndian);
  6090. const type = readUInt(temp, 16, 2, isBigEndian);
  6091. const length = readUInt(temp, 32, 4, isBigEndian);
  6092. if (code === 0) break;
  6093. else {
  6094. if (length === 1 && (type === 3 || type === 4)) tags[code] = readValue(temp, isBigEndian);
  6095. temp = nextTag(temp);
  6096. }
  6097. }
  6098. return tags;
  6099. }
  6100. function determineEndianness(input) {
  6101. const signature = toUTF8String(input, 0, 2);
  6102. if (signature === "II") return "LE";
  6103. else if (signature === "MM") return "BE";
  6104. }
  6105. const signatures = /* @__PURE__ */ new Set(["49492a00", "4d4d002a"]);
  6106. const TIFF = {
  6107. validate: (input) => signatures.has(toHexString(input, 0, 4)),
  6108. calculate(input) {
  6109. const isBigEndian = determineEndianness(input) === "BE";
  6110. const ifdBuffer = readIFD(input, isBigEndian);
  6111. const tags = extractTags(ifdBuffer, isBigEndian);
  6112. const width = tags[256];
  6113. const height = tags[257];
  6114. if (!width || !height) throw new TypeError("Invalid Tiff. Missing tags");
  6115. return {
  6116. height,
  6117. width
  6118. };
  6119. }
  6120. };
  6121. function calculateExtended(input) {
  6122. return {
  6123. height: 1 + readUInt24LE(input, 7),
  6124. width: 1 + readUInt24LE(input, 4)
  6125. };
  6126. }
  6127. function calculateLossless(input) {
  6128. return {
  6129. height: 1 + ((input[4] & 15) << 10 | input[3] << 2 | (input[2] & 192) >> 6),
  6130. width: 1 + ((input[2] & 63) << 8 | input[1])
  6131. };
  6132. }
  6133. function calculateLossy(input) {
  6134. return {
  6135. height: readInt16LE(input, 8) & 16383,
  6136. width: readInt16LE(input, 6) & 16383
  6137. };
  6138. }
  6139. const WEBP = {
  6140. validate(input) {
  6141. const riffHeader = toUTF8String(input, 0, 4) === "RIFF";
  6142. const webpHeader = toUTF8String(input, 8, 12) === "WEBP";
  6143. const vp8Header = toUTF8String(input, 12, 15) === "VP8";
  6144. return riffHeader && webpHeader && vp8Header;
  6145. },
  6146. calculate(input) {
  6147. const chunkHeader = toUTF8String(input, 12, 16);
  6148. input = input.slice(20, 30);
  6149. if (chunkHeader === "VP8X") {
  6150. const extendedHeader = input[0];
  6151. const validStart = (extendedHeader & 192) === 0;
  6152. const validEnd = (extendedHeader & 1) === 0;
  6153. if (validStart && validEnd) return calculateExtended(input);
  6154. else throw new TypeError("Invalid WebP");
  6155. }
  6156. if (chunkHeader === "VP8 " && input[0] !== 47) return calculateLossy(input);
  6157. const signature = toHexString(input, 3, 6);
  6158. if (chunkHeader === "VP8L" && signature !== "9d012a") return calculateLossless(input);
  6159. throw new TypeError("Invalid WebP");
  6160. }
  6161. };
  6162. const AVIF = {
  6163. validate: (input) => toUTF8String(input, 8, 12) === "avif",
  6164. calculate: (input) => {
  6165. const metaBox = findBox(input, "meta");
  6166. const iprpBox = findBox(input, "iprp", metaBox.offset + 12, metaBox.offset + metaBox.size);
  6167. const ipcoBox = findBox(input, "ipco", iprpBox.offset + 8, iprpBox.offset + iprpBox.size);
  6168. const ispeBox = findBox(input, "ispe", ipcoBox.offset + 8, ipcoBox.offset + ipcoBox.size);
  6169. const width = readUInt32BE(input, ispeBox.offset + 12);
  6170. const height = readUInt32BE(input, ispeBox.offset + 16);
  6171. return {
  6172. width,
  6173. height
  6174. };
  6175. }
  6176. };
  6177. function findBox(input, type, startOffset = 0, endOffset = input.length) {
  6178. for (let offset = startOffset; offset < endOffset;) {
  6179. const size = readUInt32BE(input, offset);
  6180. if (toUTF8String(input, offset + 4, offset + 8) === type) return {
  6181. offset,
  6182. size
  6183. };
  6184. if (size <= 0 || offset + size > endOffset) break;
  6185. offset += size;
  6186. }
  6187. throw new Error(`${type} box not found`);
  6188. }
  6189. const typeHandlers = {
  6190. bmp: BMP,
  6191. cur: CUR,
  6192. dds: DDS,
  6193. gif: GIF,
  6194. icns: ICNS,
  6195. ico: ICO,
  6196. j2c: J2C,
  6197. jp2: JP2,
  6198. jpg: JPG,
  6199. ktx: KTX,
  6200. png: PNG,
  6201. pnm: PNM,
  6202. psd: PSD,
  6203. svg: SVG,
  6204. tga: TGA,
  6205. tiff: TIFF,
  6206. webp: WEBP,
  6207. avif: AVIF
  6208. };
  6209. const keys = Object.keys(typeHandlers);
  6210. const firstBytes = {
  6211. 56: "psd",
  6212. 66: "bmp",
  6213. 68: "dds",
  6214. 71: "gif",
  6215. 73: "tiff",
  6216. 77: "tiff",
  6217. 82: "webp",
  6218. 105: "icns",
  6219. 137: "png",
  6220. 255: "jpg"
  6221. };
  6222. function detector(input) {
  6223. const byte = input[0];
  6224. if (byte in firstBytes) {
  6225. const type = firstBytes[byte];
  6226. if (type && typeHandlers[type].validate(input)) return type;
  6227. }
  6228. return keys.find((key) => typeHandlers[key].validate(input));
  6229. }
  6230. function imageMeta(input) {
  6231. if (!(input instanceof Uint8Array)) throw new TypeError("Input should be a Uint8Array");
  6232. const type = detector(input);
  6233. if (type !== void 0 && type in typeHandlers) {
  6234. const size = typeHandlers[type].calculate(input);
  6235. if (size !== void 0) {
  6236. size.type = type;
  6237. return size;
  6238. }
  6239. }
  6240. throw new TypeError(`Unsupported file type: ${type}`);
  6241. }
  6242. //#endregion
  6243. //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
  6244. const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
  6245. function normalizeWindowsPath(input = "") {
  6246. if (!input) return input;
  6247. return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
  6248. }
  6249. const _UNC_REGEX = /^[/\\]{2}/;
  6250. const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
  6251. const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
  6252. const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
  6253. const normalize = function(path$11) {
  6254. if (path$11.length === 0) return ".";
  6255. path$11 = normalizeWindowsPath(path$11);
  6256. const isUNCPath = path$11.match(_UNC_REGEX);
  6257. const isPathAbsolute = isAbsolute(path$11);
  6258. const trailingSeparator = path$11[path$11.length - 1] === "/";
  6259. path$11 = normalizeString(path$11, !isPathAbsolute);
  6260. if (path$11.length === 0) {
  6261. if (isPathAbsolute) return "/";
  6262. return trailingSeparator ? "./" : ".";
  6263. }
  6264. if (trailingSeparator) path$11 += "/";
  6265. if (_DRIVE_LETTER_RE.test(path$11)) path$11 += "/";
  6266. if (isUNCPath) {
  6267. if (!isPathAbsolute) return `//./${path$11}`;
  6268. return `//${path$11}`;
  6269. }
  6270. return isPathAbsolute && !isAbsolute(path$11) ? `/${path$11}` : path$11;
  6271. };
  6272. const join = function(...segments) {
  6273. let path$11 = "";
  6274. for (const seg of segments) {
  6275. if (!seg) continue;
  6276. if (path$11.length > 0) {
  6277. const pathTrailing = path$11[path$11.length - 1] === "/";
  6278. const segLeading = seg[0] === "/";
  6279. if (pathTrailing && segLeading) path$11 += seg.slice(1);
  6280. else path$11 += pathTrailing || segLeading ? seg : `/${seg}`;
  6281. } else path$11 += seg;
  6282. }
  6283. return normalize(path$11);
  6284. };
  6285. function cwd() {
  6286. if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
  6287. return "/";
  6288. }
  6289. const resolve$1 = function(...arguments_) {
  6290. arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
  6291. let resolvedPath = "";
  6292. let resolvedAbsolute = false;
  6293. for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
  6294. const path$11 = index >= 0 ? arguments_[index] : cwd();
  6295. if (!path$11 || path$11.length === 0) continue;
  6296. resolvedPath = `${path$11}/${resolvedPath}`;
  6297. resolvedAbsolute = isAbsolute(path$11);
  6298. }
  6299. resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
  6300. if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
  6301. return resolvedPath.length > 0 ? resolvedPath : ".";
  6302. };
  6303. function normalizeString(path$11, allowAboveRoot) {
  6304. let res = "";
  6305. let lastSegmentLength = 0;
  6306. let lastSlash = -1;
  6307. let dots = 0;
  6308. let char = null;
  6309. for (let index = 0; index <= path$11.length; ++index) {
  6310. if (index < path$11.length) char = path$11[index];
  6311. else if (char === "/") break;
  6312. else char = "/";
  6313. if (char === "/") {
  6314. if (lastSlash === index - 1 || dots === 1);
  6315. else if (dots === 2) {
  6316. if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
  6317. if (res.length > 2) {
  6318. const lastSlashIndex = res.lastIndexOf("/");
  6319. if (lastSlashIndex === -1) {
  6320. res = "";
  6321. lastSegmentLength = 0;
  6322. } else {
  6323. res = res.slice(0, lastSlashIndex);
  6324. lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
  6325. }
  6326. lastSlash = index;
  6327. dots = 0;
  6328. continue;
  6329. } else if (res.length > 0) {
  6330. res = "";
  6331. lastSegmentLength = 0;
  6332. lastSlash = index;
  6333. dots = 0;
  6334. continue;
  6335. }
  6336. }
  6337. if (allowAboveRoot) {
  6338. res += res.length > 0 ? "/.." : "..";
  6339. lastSegmentLength = 2;
  6340. }
  6341. } else {
  6342. if (res.length > 0) res += `/${path$11.slice(lastSlash + 1, index)}`;
  6343. else res = path$11.slice(lastSlash + 1, index);
  6344. lastSegmentLength = index - lastSlash - 1;
  6345. }
  6346. lastSlash = index;
  6347. dots = 0;
  6348. } else if (char === "." && dots !== -1) ++dots;
  6349. else dots = -1;
  6350. }
  6351. return res;
  6352. }
  6353. const isAbsolute = function(p) {
  6354. return _IS_ABSOLUTE_RE.test(p);
  6355. };
  6356. const relative = function(from, to) {
  6357. const _from = resolve$1(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
  6358. const _to = resolve$1(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
  6359. if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
  6360. const _fromCopy = [..._from];
  6361. for (const segment of _fromCopy) {
  6362. if (_to[0] !== segment) break;
  6363. _from.shift();
  6364. _to.shift();
  6365. }
  6366. return [..._from.map(() => ".."), ..._to].join("/");
  6367. };
  6368. //#endregion
  6369. //#region ../../node_modules/.pnpm/perfect-debounce@2.0.0/node_modules/perfect-debounce/dist/index.mjs
  6370. const DEBOUNCE_DEFAULTS = { trailing: true };
  6371. /**
  6372. Debounce functions
  6373. @param fn - Promise-returning/async function to debounce.
  6374. @param wait - Milliseconds to wait before calling `fn`. Default value is 25ms
  6375. @returns A function that delays calling `fn` until after `wait` milliseconds have elapsed since the last time it was called.
  6376. @example
  6377. ```
  6378. import { debounce } from 'perfect-debounce';
  6379. const expensiveCall = async input => input;
  6380. const debouncedFn = debounce(expensiveCall, 200);
  6381. for (const number of [1, 2, 3]) {
  6382. console.log(await debouncedFn(number));
  6383. }
  6384. //=> 1
  6385. //=> 2
  6386. //=> 3
  6387. ```
  6388. */
  6389. function debounce(fn, wait = 25, options$1 = {}) {
  6390. options$1 = {
  6391. ...DEBOUNCE_DEFAULTS,
  6392. ...options$1
  6393. };
  6394. if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
  6395. let leadingValue;
  6396. let timeout;
  6397. let resolveList = [];
  6398. let currentPromise;
  6399. let trailingArgs;
  6400. const applyFn = (_this, args) => {
  6401. currentPromise = _applyPromised(fn, _this, args);
  6402. currentPromise.finally(() => {
  6403. currentPromise = null;
  6404. if (options$1.trailing && trailingArgs && !timeout) {
  6405. const promise$1 = applyFn(_this, trailingArgs);
  6406. trailingArgs = null;
  6407. return promise$1;
  6408. }
  6409. });
  6410. return currentPromise;
  6411. };
  6412. const debounced = function(...args) {
  6413. if (options$1.trailing) trailingArgs = args;
  6414. if (currentPromise) return currentPromise;
  6415. return new Promise((resolve$2) => {
  6416. const shouldCallNow = !timeout && options$1.leading;
  6417. clearTimeout(timeout);
  6418. timeout = setTimeout(() => {
  6419. timeout = null;
  6420. const promise$1 = options$1.leading ? leadingValue : applyFn(this, args);
  6421. trailingArgs = null;
  6422. for (const _resolve of resolveList) _resolve(promise$1);
  6423. resolveList = [];
  6424. }, wait);
  6425. if (shouldCallNow) {
  6426. leadingValue = applyFn(this, args);
  6427. resolve$2(leadingValue);
  6428. } else resolveList.push(resolve$2);
  6429. });
  6430. };
  6431. const _clearTimeout = (timer) => {
  6432. if (timer) {
  6433. clearTimeout(timer);
  6434. timeout = null;
  6435. }
  6436. };
  6437. debounced.isPending = () => !!timeout;
  6438. debounced.cancel = () => {
  6439. _clearTimeout(timeout);
  6440. resolveList = [];
  6441. trailingArgs = null;
  6442. };
  6443. debounced.flush = () => {
  6444. _clearTimeout(timeout);
  6445. if (!trailingArgs || currentPromise) return;
  6446. const args = trailingArgs;
  6447. trailingArgs = null;
  6448. return applyFn(this, args);
  6449. };
  6450. return debounced;
  6451. }
  6452. async function _applyPromised(fn, _this, args) {
  6453. return await fn.apply(_this, args);
  6454. }
  6455. //#endregion
  6456. //#region src/rpc/assets.ts
  6457. function guessType(path$11) {
  6458. if (/\.(?:png|jpe?g|jxl|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path$11)) return "image";
  6459. if (/\.(?:mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|ts|mts|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)$/i.test(path$11)) return "video";
  6460. if (/\.(?:mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)$/i.test(path$11)) return "audio";
  6461. if (/\.(?:woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)/i.test(path$11)) return "font";
  6462. if (/\.(?:json[5c]?|te?xt|[mc]?[jt]sx?|md[cx]?|markdown|ya?ml|toml)/i.test(path$11)) return "text";
  6463. if (/\.wasm/i.test(path$11)) return "wasm";
  6464. return "other";
  6465. }
  6466. function getAssetsFunctions(ctx) {
  6467. const { server, config } = ctx;
  6468. const _imageMetaCache = /* @__PURE__ */ new Map();
  6469. let cache = null;
  6470. async function scan$2() {
  6471. const dir = resolve$1(config.root);
  6472. const baseURL = config.base;
  6473. const publicDir = config.publicDir;
  6474. const relativePublicDir = publicDir === "" ? "" : `${relative(dir, publicDir)}/`;
  6475. const files = await (0, import_out.default)([
  6476. "**/*.(png|jpg|jpeg|gif|svg|webp|avif|ico|bmp|tiff)",
  6477. "**/*.(mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)",
  6478. "**/*.(mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)",
  6479. "**/*.(woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)",
  6480. "**/*.(json|json5|jsonc|txt|text|tsx|jsx|md|mdx|mdc|markdown|yaml|yml|toml)",
  6481. "**/*.wasm"
  6482. ], {
  6483. cwd: dir,
  6484. onlyFiles: true,
  6485. caseSensitiveMatch: false,
  6486. ignore: [
  6487. "**/node_modules/**",
  6488. "**/dist/**",
  6489. "**/package-lock.*",
  6490. "**/pnpm-lock.*",
  6491. "**/pnpm-workspace.*"
  6492. ]
  6493. });
  6494. cache = await Promise.all(files.map(async (relativePath) => {
  6495. const filePath = resolve$1(dir, relativePath);
  6496. const stat$1 = await fsp.lstat(filePath);
  6497. const path$11 = relativePath.replace(relativePublicDir, "");
  6498. return {
  6499. path: path$11,
  6500. relativePath,
  6501. publicPath: join(baseURL, path$11),
  6502. filePath,
  6503. type: guessType(relativePath),
  6504. size: stat$1.size,
  6505. mtime: stat$1.mtimeMs
  6506. };
  6507. }));
  6508. return cache;
  6509. }
  6510. async function getAssetImporters(url) {
  6511. const importers = [];
  6512. const module$1 = await server.moduleGraph.getModuleByUrl(url);
  6513. if (module$1) for (const importer of module$1.importers) importers.push({
  6514. url: importer.url,
  6515. id: importer.id
  6516. });
  6517. return importers;
  6518. }
  6519. const debouncedAssetsUpdated = debounce(() => {
  6520. var _ref;
  6521. getViteRpcServer === null || getViteRpcServer === void 0 || (_ref = getViteRpcServer()) === null || _ref === void 0 || (_ref = _ref.broadcast) === null || _ref === void 0 || _ref.emit("assetsUpdated");
  6522. }, 100);
  6523. server.watcher.on("all", (event) => {
  6524. if (event !== "change") debouncedAssetsUpdated();
  6525. });
  6526. return {
  6527. async getStaticAssets() {
  6528. return await scan$2();
  6529. },
  6530. async getAssetImporters(url) {
  6531. return await getAssetImporters(url);
  6532. },
  6533. async getImageMeta(filepath) {
  6534. if (_imageMetaCache.has(filepath)) return _imageMetaCache.get(filepath);
  6535. try {
  6536. const meta = imageMeta(await fsp.readFile(filepath));
  6537. _imageMetaCache.set(filepath, meta);
  6538. return meta;
  6539. } catch (e) {
  6540. _imageMetaCache.set(filepath, void 0);
  6541. console.error(e);
  6542. return;
  6543. }
  6544. },
  6545. async getTextAssetContent(filepath, limit = 300) {
  6546. try {
  6547. return (await fsp.readFile(filepath, "utf-8")).slice(0, limit);
  6548. } catch (e) {
  6549. console.error(e);
  6550. return;
  6551. }
  6552. }
  6553. };
  6554. }
  6555. //#endregion
  6556. //#region src/rpc/get-config.ts
  6557. function getConfigFunctions(ctx) {
  6558. return { getRoot() {
  6559. return ctx.config.root;
  6560. } };
  6561. }
  6562. //#endregion
  6563. //#region src/rpc/graph.ts
  6564. function getGraphFunctions(ctx) {
  6565. const { rpc, server } = ctx;
  6566. const debouncedModuleUpdated = debounce(() => {
  6567. var _ref;
  6568. getViteRpcServer === null || getViteRpcServer === void 0 || (_ref = getViteRpcServer()) === null || _ref === void 0 || (_ref = _ref.broadcast) === null || _ref === void 0 || _ref.emit("graphModuleUpdated");
  6569. }, 100);
  6570. server.middlewares.use((_, __, next) => {
  6571. debouncedModuleUpdated();
  6572. next();
  6573. });
  6574. return { async getGraphModules() {
  6575. const meta = await rpc.getMetadata();
  6576. const modules = (meta ? await rpc.getModulesList({
  6577. vite: meta === null || meta === void 0 ? void 0 : meta.instances[0].vite,
  6578. env: meta === null || meta === void 0 ? void 0 : meta.instances[0].environments[0]
  6579. }) : null) || [];
  6580. const filteredModules = modules.filter((m) => {
  6581. return m.id.match(/\.(vue|js|ts|jsx|tsx|html|json)($|\?v=)/);
  6582. });
  6583. return filteredModules.map((i) => {
  6584. function searchForVueDeps(id, seen = /* @__PURE__ */ new Set()) {
  6585. if (seen.has(id)) return [];
  6586. seen.add(id);
  6587. const module$1 = modules.find((m) => m.id === id);
  6588. if (!module$1) return [];
  6589. return module$1.deps.flatMap((i$1) => {
  6590. if (filteredModules.find((m) => m.id === i$1)) return [i$1];
  6591. return searchForVueDeps(i$1, seen);
  6592. });
  6593. }
  6594. return {
  6595. id: i.id,
  6596. deps: searchForVueDeps(i.id)
  6597. };
  6598. });
  6599. } };
  6600. }
  6601. //#endregion
  6602. //#region src/rpc/index.ts
  6603. function getRpcFunctions(ctx) {
  6604. return {
  6605. heartbeat() {
  6606. return true;
  6607. },
  6608. ...getAssetsFunctions(ctx),
  6609. ...getConfigFunctions(ctx),
  6610. ...getGraphFunctions(ctx)
  6611. };
  6612. }
  6613. //#endregion
  6614. //#region src/utils.ts
  6615. function removeUrlQuery(url) {
  6616. return url.replace(/\?.*$/, "");
  6617. }
  6618. //#endregion
  6619. //#region src/vite.ts
  6620. function getVueDevtoolsPath() {
  6621. return normalizePath(path.dirname(fileURLToPath(import.meta.url))).replace(/\/dist$/, "//src");
  6622. }
  6623. const toggleComboKeysMap = {
  6624. option: process.platform === "darwin" ? "Option(⌥)" : "Alt(⌥)",
  6625. meta: "Command(⌘)",
  6626. shift: "Shift(⇧)"
  6627. };
  6628. function normalizeComboKeyPrint(toggleComboKey) {
  6629. return toggleComboKey.split("-").map((key) => toggleComboKeysMap[key] || key[0].toUpperCase() + key.slice(1)).join(dim("+"));
  6630. }
  6631. const devtoolsNextResourceSymbol = "?__vue-devtools-next-resource";
  6632. const defaultOptions = {
  6633. appendTo: "",
  6634. componentInspector: true,
  6635. launchEditor: process.env.LAUNCH_EDITOR ?? "code"
  6636. };
  6637. function mergeOptions(options$1) {
  6638. return Object.assign({}, defaultOptions, options$1);
  6639. }
  6640. function VitePluginVueDevTools(options$1) {
  6641. const vueDevtoolsPath = getVueDevtoolsPath();
  6642. const inspect = Inspect({ silent: true });
  6643. const pluginOptions = mergeOptions(options$1 ?? {});
  6644. let config;
  6645. function configureServer(server) {
  6646. const base = server.config.base || "/";
  6647. server.middlewares.use(`${base}__devtools__`, sirv(DIR_CLIENT, {
  6648. single: true,
  6649. dev: true,
  6650. setHeaders(response) {
  6651. if (config.server.headers == null) return;
  6652. Object.entries(config.server.headers).forEach(([key, value]) => {
  6653. if (value == null) return;
  6654. response.setHeader(key, value);
  6655. });
  6656. }
  6657. }));
  6658. setViteServerContext(server);
  6659. const rpcFunctions = getRpcFunctions({
  6660. rpc: inspect.api.rpc,
  6661. server,
  6662. config
  6663. });
  6664. createViteServerRpc(rpcFunctions);
  6665. const _printUrls = server.printUrls;
  6666. const colorUrl = (url) => cyan(url.replace(/:(\d+)\//, (_, port) => `:${bold(port)}/`));
  6667. server.printUrls = () => {
  6668. const urls = server.resolvedUrls;
  6669. const keys$1 = normalizeComboKeyPrint("option-shift-d");
  6670. _printUrls();
  6671. for (const url of urls.local) {
  6672. const devtoolsUrl = url.endsWith("/") ? `${url}__devtools__/` : `${url}/__devtools__/`;
  6673. console.log(` ${green("➜")} ${bold("Vue DevTools")}: ${green(`Open ${colorUrl(`${devtoolsUrl}`)} as a separate window`)}`);
  6674. }
  6675. console.log(` ${green("➜")} ${bold("Vue DevTools")}: ${green(`Press ${yellow(keys$1)} in App to toggle the Vue DevTools`)}`);
  6676. };
  6677. }
  6678. const devtoolsOptionsImportee = "virtual:vue-devtools-options";
  6679. const resolvedDevtoolsOptions = `\0${devtoolsOptionsImportee}`;
  6680. const plugin = {
  6681. name: "vite-plugin-vue-devtools",
  6682. enforce: "pre",
  6683. apply: "serve",
  6684. configResolved(resolvedConfig) {
  6685. config = resolvedConfig;
  6686. },
  6687. configureServer(server) {
  6688. configureServer(server);
  6689. },
  6690. async resolveId(importee) {
  6691. if (importee === devtoolsOptionsImportee) return resolvedDevtoolsOptions;
  6692. else if (importee.startsWith("virtual:vue-devtools-path:")) return `${importee.replace("virtual:vue-devtools-path:", `${vueDevtoolsPath}/`)}${devtoolsNextResourceSymbol}`;
  6693. },
  6694. async load(id) {
  6695. if (id === resolvedDevtoolsOptions) return `export default ${JSON.stringify({
  6696. base: config.base,
  6697. componentInspector: pluginOptions.componentInspector
  6698. })}`;
  6699. else if (id.endsWith(devtoolsNextResourceSymbol)) {
  6700. const filename = removeUrlQuery(id);
  6701. return await fs.promises.readFile(filename, "utf-8");
  6702. }
  6703. },
  6704. transform(code, id, options$2) {
  6705. if (options$2 === null || options$2 === void 0 ? void 0 : options$2.ssr) return;
  6706. const { appendTo } = pluginOptions;
  6707. const [filename] = id.split("?", 2);
  6708. if (appendTo && (typeof appendTo === "string" && filename.endsWith(appendTo) || appendTo instanceof RegExp && appendTo.test(filename))) code = `import 'virtual:vue-devtools-path:overlay.js';\n${code}`;
  6709. return code;
  6710. },
  6711. transformIndexHtml(html) {
  6712. if (pluginOptions.appendTo) return;
  6713. return {
  6714. html,
  6715. tags: [{
  6716. tag: "script",
  6717. injectTo: "head-prepend",
  6718. attrs: {
  6719. type: "module",
  6720. src: `${config.base || "/"}@id/virtual:vue-devtools-path:overlay.js`
  6721. }
  6722. }, pluginOptions.componentInspector && {
  6723. tag: "script",
  6724. injectTo: "head-prepend",
  6725. launchEditor: pluginOptions.launchEditor,
  6726. attrs: {
  6727. type: "module",
  6728. src: `${config.base || "/"}@id/virtual:vue-inspector-path:load.js`
  6729. }
  6730. }].filter(Boolean)
  6731. };
  6732. },
  6733. async buildEnd() {}
  6734. };
  6735. return [
  6736. inspect,
  6737. pluginOptions.componentInspector && VueInspector({
  6738. toggleComboKey: "",
  6739. toggleButtonVisibility: "never",
  6740. launchEditor: pluginOptions.launchEditor,
  6741. ...typeof pluginOptions.componentInspector === "boolean" ? {} : pluginOptions.componentInspector,
  6742. appendTo: pluginOptions.appendTo || "manually"
  6743. }),
  6744. plugin
  6745. ].filter(Boolean);
  6746. }
  6747. //#endregion
  6748. export { VitePluginVueDevTools as default };