市场夺宝奇兵
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.

6841 lines
227 KiB

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