nitro-nightly 3.0.1-20260106-182834-5019d347 → 3.0.1-20260106-205209-b085a480

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/_build/common.mjs +24899 -0
  2. package/dist/_build/rolldown.mjs +5 -18
  3. package/dist/_build/rollup.mjs +5 -52
  4. package/dist/_build/vite.build.mjs +2 -21
  5. package/dist/{_dev.mjs → _chunks/dev.mjs} +4 -7
  6. package/dist/{_nitro.mjs → _chunks/nitro.mjs} +16 -195
  7. package/dist/_chunks/nitro2.mjs +101 -0
  8. package/dist/_chunks/utils.mjs +278 -0
  9. package/dist/_libs/@hiogawa/vite-plugin-fullstack.mjs +32 -4
  10. package/dist/_libs/@jridgewell/gen-mapping.mjs +304 -2
  11. package/dist/_libs/@jridgewell/remapping.mjs +1 -2
  12. package/dist/_libs/@rollup/plugin-commonjs.mjs +75 -31
  13. package/dist/_libs/@rollup/plugin-inject.mjs +1 -3
  14. package/dist/_libs/@rollup/plugin-json.mjs +1 -1
  15. package/dist/_libs/@rollup/plugin-node-resolve.mjs +1111 -7
  16. package/dist/_libs/c12.mjs +597 -41
  17. package/dist/_libs/chokidar.mjs +235 -2
  18. package/dist/_libs/confbox.mjs +454 -1476
  19. package/dist/_libs/estree-walker.mjs +1 -144
  20. package/dist/_libs/giget.mjs +2235 -1377
  21. package/dist/_libs/httpxy.mjs +1 -1
  22. package/dist/_libs/unimport.mjs +1547 -1772
  23. package/dist/_presets.mjs +3 -9
  24. package/dist/builder.mjs +7 -12
  25. package/dist/cli/_chunks/build.mjs +1 -1
  26. package/dist/cli/_chunks/dev.mjs +3 -5
  27. package/dist/cli/_chunks/list.mjs +1 -1
  28. package/dist/cli/_chunks/prepare.mjs +1 -1
  29. package/dist/cli/_chunks/run.mjs +1 -1
  30. package/dist/types/index.d.mts +4 -4
  31. package/dist/vite.mjs +14 -1128
  32. package/package.json +2 -2
  33. package/dist/_build/shared.mjs +0 -60
  34. package/dist/_build/shared2.mjs +0 -40
  35. package/dist/_build/shared3.mjs +0 -68
  36. package/dist/_libs/@jridgewell/resolve-uri.mjs +0 -166
  37. package/dist/_libs/@jridgewell/sourcemap-codec.mjs +0 -167
  38. package/dist/_libs/@jridgewell/trace-mapping.mjs +0 -141
  39. package/dist/_libs/@rolldown/pluginutils.mjs +0 -31
  40. package/dist/_libs/@rollup/plugin-replace.mjs +0 -104
  41. package/dist/_libs/@rollup/pluginutils.mjs +0 -241
  42. package/dist/_libs/acorn.mjs +0 -5034
  43. package/dist/_libs/commondir.mjs +0 -22
  44. package/dist/_libs/deepmerge.mjs +0 -86
  45. package/dist/_libs/dot-prop.mjs +0 -138
  46. package/dist/_libs/dotenv.mjs +0 -345
  47. package/dist/_libs/duplexer.mjs +0 -71
  48. package/dist/_libs/etag.mjs +0 -80
  49. package/dist/_libs/exsolve.mjs +0 -1007
  50. package/dist/_libs/fdir.mjs +0 -514
  51. package/dist/_libs/function-bind.mjs +0 -63
  52. package/dist/_libs/gzip-size.mjs +0 -21
  53. package/dist/_libs/hasown.mjs +0 -14
  54. package/dist/_libs/is-core-module.mjs +0 -220
  55. package/dist/_libs/is-module.mjs +0 -13
  56. package/dist/_libs/is-reference.mjs +0 -33
  57. package/dist/_libs/js-tokens.mjs +0 -382
  58. package/dist/_libs/knitwork.mjs +0 -124
  59. package/dist/_libs/local-pkg.mjs +0 -125
  60. package/dist/_libs/magic-string.mjs +0 -939
  61. package/dist/_libs/mime.mjs +0 -1391
  62. package/dist/_libs/mlly.mjs +0 -1415
  63. package/dist/_libs/node-fetch-native.mjs +0 -7
  64. package/dist/_libs/nypm.mjs +0 -239
  65. package/dist/_libs/path-parse.mjs +0 -47
  66. package/dist/_libs/pathe.mjs +0 -202
  67. package/dist/_libs/perfect-debounce.mjs +0 -89
  68. package/dist/_libs/picomatch.mjs +0 -1673
  69. package/dist/_libs/pkg-types.mjs +0 -197
  70. package/dist/_libs/pretty-bytes.mjs +0 -116
  71. package/dist/_libs/quansync.mjs +0 -90
  72. package/dist/_libs/rc9.mjs +0 -136
  73. package/dist/_libs/readdirp.mjs +0 -237
  74. package/dist/_libs/resolve.mjs +0 -689
  75. package/dist/_libs/std-env.mjs +0 -158
  76. package/dist/_libs/strip-literal.mjs +0 -51
  77. package/dist/_libs/tinyexec.mjs +0 -627
  78. package/dist/_libs/tinyglobby.mjs +0 -292
  79. package/dist/_libs/unplugin-utils.mjs +0 -61
  80. package/dist/_libs/unplugin.mjs +0 -1225
  81. package/dist/_libs/untyped.mjs +0 -271
  82. package/dist/_libs/unwasm.mjs +0 -5895
  83. package/dist/_libs/webpack-virtual-modules.mjs +0 -272
  84. package/dist/_nitro2.mjs +0 -303
  85. /package/dist/{_rolldown.mjs → _common.mjs} +0 -0
@@ -1,1778 +1,18 @@
1
- import { i as __toESM, n as __exportAll } from "../_rolldown.mjs";
2
- import { a as isAbsolute$1, c as parse, l as relative$1, n as basename$1, o as join$1, r as dirname$1, s as normalize$1, u as resolve$1 } from "./pathe.mjs";
3
- import { l as resolvePackageJSON, s as readPackageJSON } from "./pkg-types.mjs";
4
- import { t as require_picomatch } from "./picomatch.mjs";
5
- import { t as glob } from "./tinyglobby.mjs";
6
- import { n as parse$1 } from "./acorn.mjs";
7
- import { c as resolve$2, i as findTypeExports, l as resolveModuleExportNames, n as findExports, r as findStaticImports, s as parseStaticImport, t as detectSyntax } from "./mlly.mjs";
8
- import { t as MagicString } from "./magic-string.mjs";
9
- import { t as stripLiteral } from "./strip-literal.mjs";
10
- import { t as resolveModule } from "./local-pkg.mjs";
1
+ import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "../_common.mjs";
2
+ import { Ft as resolve$1, K as MagicString, M as getMagicString, Mt as join$1, X as parse$1, Y as Parser, it as require_picomatch, jt as isAbsolute$2, y as createUnimport } from "../_build/common.mjs";
11
3
  import { t as walk } from "./estree-walker.mjs";
12
- import { t as createUnplugin } from "./unplugin.mjs";
13
- import { t as createFilter } from "./unplugin-utils.mjs";
14
- import { accessSync, constants, existsSync, promises, readFileSync } from "node:fs";
15
- import { readFile } from "node:fs/promises";
4
+ import { t as remapping } from "./@jridgewell/remapping.mjs";
5
+ import { createRequire } from "node:module";
6
+ import fs, { promises } from "node:fs";
7
+ import "node:fs/promises";
16
8
  import { fileURLToPath } from "node:url";
17
- import os from "node:os";
18
- import { basename } from "node:path";
9
+ import "node:os";
10
+ import path, { basename, dirname, extname, isAbsolute, normalize, resolve } from "node:path";
19
11
  import process$1 from "node:process";
20
- import { camelCase, kebabCase } from "scule";
12
+ import "scule";
13
+ import { Buffer } from "node:buffer";
14
+ import * as querystring from "node:querystring";
21
15
 
22
- //#region node_modules/.pnpm/unimport@5.6.0/node_modules/unimport/dist/shared/unimport.CWY7iHFZ.mjs
23
- const excludeRE = [
24
- /\b(import|export)\b([\w$*{},\s]+?)\bfrom\s*["']/g,
25
- /\bfunction\s*([\w$]+)\s*\(/g,
26
- /\bclass\s*([\w$]+)\s*\{/g,
27
- /\b(?:const|let|var)\s+?(\[.*?\]|\{.*?\}|.+?)\s*?[=;\n]/gs
28
- ];
29
- const importAsRE = /^.*\sas\s+/;
30
- const separatorRE = /[,[\]{}\n]|\b(?:import|export)\b/g;
31
- const matchRE = /(^|\.\.\.|(?:\bcase|\?)\s+|[^\w$/)]|\bextends\s+)([\w$]+)\s*(?=[.()[\]}:;?+\-*&|`<>,\n]|\b(?:instanceof|in)\b|$|(?<=extends\s+\w+)\s+\{)/g;
32
- const regexRE = /\/\S*?(?<!\\)(?<!\[[^\]]*)\/[gimsuy]*/g;
33
- function stripCommentsAndStrings(code, options) {
34
- return stripLiteral(code, options).replace(regexRE, "new RegExp(\"\")");
35
- }
36
- function defineUnimportPreset(preset) {
37
- return preset;
38
- }
39
- const identifierRE = /^[A-Z_$][\w$]*$/i;
40
- const safePropertyName = /^[a-z$_][\w$]*$/i;
41
- function stringifyWith(withValues) {
42
- let withDefs = "";
43
- for (let entries = Object.entries(withValues), l = entries.length, i = 0; i < l; i++) {
44
- const [prop, value] = entries[i];
45
- withDefs += safePropertyName.test(prop) ? prop : JSON.stringify(prop);
46
- withDefs += `: ${JSON.stringify(String(value))}`;
47
- if (i + 1 !== l) withDefs += ", ";
48
- }
49
- return `{ ${withDefs} }`;
50
- }
51
- function stringifyImports(imports, isCJS = false) {
52
- const map = toImportModuleMap(imports);
53
- return Object.entries(map).flatMap(([name, importSet]) => {
54
- const entries = [];
55
- const imports2 = Array.from(importSet).filter((i) => {
56
- if (!i.name || i.as === "") {
57
- let importStr;
58
- if (isCJS) importStr = `require('${name}');`;
59
- else {
60
- importStr = `import '${name}'`;
61
- if (i.with) importStr += ` with ${stringifyWith(i.with)}`;
62
- importStr += ";";
63
- }
64
- entries.push(importStr);
65
- return false;
66
- } else if (i.name === "default" || i.name === "=") {
67
- let importStr;
68
- if (isCJS) importStr = i.name === "=" ? `const ${i.as} = require('${name}');` : `const { default: ${i.as} } = require('${name}');`;
69
- else {
70
- importStr = `import ${i.as} from '${name}'`;
71
- if (i.with) importStr += ` with ${stringifyWith(i.with)}`;
72
- importStr += ";";
73
- }
74
- entries.push(importStr);
75
- return false;
76
- } else if (i.name === "*") {
77
- let importStr;
78
- if (isCJS) importStr = `const ${i.as} = require('${name}');`;
79
- else {
80
- importStr = `import * as ${i.as} from '${name}'`;
81
- if (i.with) importStr += ` with ${stringifyWith(i.with)}`;
82
- importStr += ";";
83
- }
84
- entries.push(importStr);
85
- return false;
86
- } else if (!isCJS && i.with) {
87
- entries.push(`import { ${stringifyImportAlias(i)} } from '${name}' with ${stringifyWith(i.with)};`);
88
- return false;
89
- }
90
- return true;
91
- });
92
- if (imports2.length) {
93
- const importsAs = imports2.map((i) => stringifyImportAlias(i, isCJS));
94
- entries.push(isCJS ? `const { ${importsAs.join(", ")} } = require('${name}');` : `import { ${importsAs.join(", ")} } from '${name}';`);
95
- }
96
- return entries;
97
- }).join("\n");
98
- }
99
- function dedupeImports(imports, warn) {
100
- const map = /* @__PURE__ */ new Map();
101
- const indexToRemove = /* @__PURE__ */ new Set();
102
- imports.filter((i) => !i.disabled).forEach((i, idx) => {
103
- if (i.declarationType === "enum" || i.declarationType === "const enum" || i.declarationType === "class") return;
104
- const name = i.as ?? i.name;
105
- if (!map.has(name)) {
106
- map.set(name, idx);
107
- return;
108
- }
109
- const other = imports[map.get(name)];
110
- if (other.from === i.from) {
111
- indexToRemove.add(idx);
112
- return;
113
- }
114
- const diff = (other.priority || 1) - (i.priority || 1);
115
- if (diff === 0) warn(`Duplicated imports "${name}", the one from "${other.from}" has been ignored and "${i.from}" is used`);
116
- if (diff <= 0) {
117
- indexToRemove.add(map.get(name));
118
- map.set(name, idx);
119
- } else indexToRemove.add(idx);
120
- });
121
- return imports.filter((_, idx) => !indexToRemove.has(idx));
122
- }
123
- function toExports(imports, fileDir, includeType = false, options = {}) {
124
- const map = toImportModuleMap(imports, includeType, options);
125
- return Object.entries(map).flatMap(([name, imports2]) => {
126
- if (isFilePath(name)) name = name.replace(/\.[a-z]+$/i, "");
127
- if (fileDir && isAbsolute$1(name)) {
128
- name = relative$1(fileDir, name);
129
- if (!name.match(/^[./]/)) name = `./${name}`;
130
- }
131
- const entries = [];
132
- const filtered = Array.from(imports2).filter((i) => {
133
- if (i.name === "*") {
134
- entries.push(`export * as ${i.as} from '${name}';`);
135
- return false;
136
- }
137
- return true;
138
- });
139
- if (filtered.length) entries.push(`export { ${filtered.map((i) => stringifyImportAlias(i, false)).join(", ")} } from '${name}';`);
140
- return entries;
141
- }).join("\n");
142
- }
143
- function stripFileExtension(path$1) {
144
- return path$1.replace(/\.[a-z]+$/i, "");
145
- }
146
- function toTypeDeclarationItems(imports, options) {
147
- return imports.map((i) => {
148
- const from = options?.resolvePath?.(i) || stripFileExtension(i.typeFrom || i.from);
149
- let typeDef = "";
150
- if (i.with) typeDef += `import('${from}', { with: ${stringifyWith(i.with)} })`;
151
- else typeDef += `import('${from}')`;
152
- if (i.name !== "*" && i.name !== "=") typeDef += identifierRE.test(i.name) ? `.${i.name}` : `['${i.name}']`;
153
- return `const ${i.as}: typeof ${typeDef}`;
154
- }).sort();
155
- }
156
- function toTypeDeclarationFile(imports, options) {
157
- const items = toTypeDeclarationItems(imports, options);
158
- const { exportHelper = true } = options || {};
159
- let declaration = "";
160
- if (exportHelper) declaration += "export {}\n";
161
- declaration += `declare global {
162
- ${items.map((i) => ` ${i}`).join("\n")}
163
- }`;
164
- return declaration;
165
- }
166
- function makeTypeModulesMap(imports, resolvePath$1) {
167
- const modulesMap = /* @__PURE__ */ new Map();
168
- const resolveImportFrom = typeof resolvePath$1 === "function" ? (i) => {
169
- return resolvePath$1(i) || stripFileExtension(i.typeFrom || i.from);
170
- } : (i) => stripFileExtension(i.typeFrom || i.from);
171
- for (const import_ of imports) {
172
- const from = resolveImportFrom(import_);
173
- let module = modulesMap.get(from);
174
- if (!module) {
175
- module = {
176
- typeImports: /* @__PURE__ */ new Set(),
177
- starTypeImport: void 0
178
- };
179
- modulesMap.set(from, module);
180
- }
181
- if (import_.name === "*") {
182
- if (import_.as) module.starTypeImport = import_;
183
- } else module.typeImports.add(import_);
184
- }
185
- return modulesMap;
186
- }
187
- function toTypeReExports(imports, options) {
188
- const importsMap = makeTypeModulesMap(imports, options?.resolvePath);
189
- return `// for type re-export
190
- declare global {
191
- ${Array.from(importsMap).flatMap(([from, module]) => {
192
- from = from.replace(/\.d\.([cm]?)ts$/i, ".$1js");
193
- const { starTypeImport, typeImports } = module;
194
- const strings = [];
195
- if (typeImports.size) {
196
- const typeImportNames = Array.from(typeImports).map(({ name, as }) => {
197
- if (as && as !== name) return `${name} as ${as}`;
198
- return name;
199
- });
200
- strings.push("// @ts-ignore", `export type { ${typeImportNames.join(", ")} } from '${from}'`);
201
- }
202
- if (starTypeImport) strings.push("// @ts-ignore", `export type * as ${starTypeImport.as} from '${from}'`);
203
- if (strings.length) strings.push(`import('${from}')`);
204
- return strings;
205
- }).map((i) => ` ${i}`).join("\n")}
206
- }`;
207
- }
208
- function stringifyImportAlias(item, isCJS = false) {
209
- return item.as === void 0 || item.name === item.as ? item.name : isCJS ? `${item.name}: ${item.as}` : `${item.name} as ${item.as}`;
210
- }
211
- function toImportModuleMap(imports, includeType = false, options = {}) {
212
- const map = {};
213
- for (const _import of imports) {
214
- if (_import.type && !includeType) continue;
215
- const from = options.declaration && _import.typeFrom || _import.from;
216
- if (!map[from]) map[from] = /* @__PURE__ */ new Set();
217
- map[from].add(_import);
218
- }
219
- return map;
220
- }
221
- function getMagicString(code) {
222
- if (typeof code === "string") return new MagicString(code);
223
- return code;
224
- }
225
- function addImportToCode(code, imports, isCJS = false, mergeExisting = false, injectAtLast = false, firstOccurrence = Number.POSITIVE_INFINITY, onResolved, onStringified) {
226
- let newImports = [];
227
- const s = getMagicString(code);
228
- let _staticImports;
229
- const strippedCode = stripCommentsAndStrings(s.original);
230
- function findStaticImportsLazy() {
231
- if (!_staticImports) _staticImports = findStaticImports(s.original).filter((i) => Boolean(strippedCode.slice(i.start, i.end).trim())).map((i) => parseStaticImport(i));
232
- return _staticImports;
233
- }
234
- function hasShebang() {
235
- return /^#!.+/.test(s.original);
236
- }
237
- if (mergeExisting && !isCJS) {
238
- const existingImports = findStaticImportsLazy();
239
- const map = /* @__PURE__ */ new Map();
240
- imports.forEach((i) => {
241
- const target = existingImports.find((e) => e.specifier === i.from && e.imports.startsWith("{"));
242
- if (!target) return newImports.push(i);
243
- if (!map.has(target)) map.set(target, []);
244
- map.get(target).push(i);
245
- });
246
- for (const [target, items] of map.entries()) {
247
- const strings = items.map((i) => `${stringifyImportAlias(i)}, `);
248
- const importLength = target.code.match(/^\s*import\s*\{/)?.[0]?.length;
249
- if (importLength) s.appendLeft(target.start + importLength, ` ${strings.join("").trim()}`);
250
- }
251
- } else newImports = imports;
252
- newImports = onResolved?.(newImports) ?? newImports;
253
- let newEntries = stringifyImports(newImports, isCJS);
254
- newEntries = onStringified?.(newEntries, newImports) ?? newEntries;
255
- if (newEntries) {
256
- const insertionIndex = injectAtLast ? findStaticImportsLazy().reverse().find((i) => i.end <= firstOccurrence)?.end ?? 0 : 0;
257
- if (insertionIndex > 0) s.appendRight(insertionIndex, `
258
- ${newEntries}
259
- `);
260
- else if (hasShebang()) s.appendLeft(s.original.indexOf("\n") + 1, `
261
- ${newEntries}
262
- `);
263
- else s.prepend(`${newEntries}
264
- `);
265
- }
266
- return {
267
- s,
268
- get code() {
269
- return s.toString();
270
- }
271
- };
272
- }
273
- function normalizeImports(imports) {
274
- for (const _import of imports) _import.as = _import.as ?? _import.name;
275
- return imports;
276
- }
277
- function isFilePath(path$1) {
278
- return path$1.startsWith(".") || isAbsolute$1(path$1) || path$1.includes("://");
279
- }
280
- const contextRE$1 = /\b_ctx\.([$\w]+)\b/g;
281
- const UNREF_KEY = "__unimport_unref_";
282
- const VUE_TEMPLATE_NAME = "unimport:vue-template";
283
- function vueTemplateAddon() {
284
- const self = {
285
- name: VUE_TEMPLATE_NAME,
286
- async transform(s, id) {
287
- if (!s.original.includes("_ctx.") || s.original.includes(UNREF_KEY)) return s;
288
- const matches = Array.from(s.original.matchAll(contextRE$1));
289
- const imports = await this.getImports();
290
- let targets = [];
291
- for (const match of matches) {
292
- const name = match[1];
293
- const item = imports.find((i) => i.as === name);
294
- if (!item) continue;
295
- const start = match.index;
296
- const end = start + match[0].length;
297
- const tempName = `__unimport_${name}`;
298
- s.overwrite(start, end, `(${JSON.stringify(name)} in _ctx ? _ctx.${name} : ${UNREF_KEY}(${tempName}))`);
299
- if (!targets.find((i) => i.as === tempName)) targets.push({
300
- ...item,
301
- as: tempName
302
- });
303
- }
304
- if (targets.length) {
305
- targets.push({
306
- name: "unref",
307
- from: "vue",
308
- as: UNREF_KEY
309
- });
310
- for (const addon of this.addons) {
311
- if (addon === self) continue;
312
- targets = await addon.injectImportsResolved?.call(this, targets, s, id) ?? targets;
313
- }
314
- let injection = stringifyImports(targets);
315
- for (const addon of this.addons) {
316
- if (addon === self) continue;
317
- injection = await addon.injectImportsStringified?.call(this, injection, targets, s, id) ?? injection;
318
- }
319
- s.prepend(injection);
320
- }
321
- return s;
322
- },
323
- async declaration(dts, options) {
324
- return `${dts}
325
- // for vue template auto import
326
- import { UnwrapRef } from 'vue'
327
- declare module 'vue' {
328
- interface ComponentCustomProperties {
329
- ${(await this.getImports()).map((i) => {
330
- if (i.type || i.dtsDisabled) return "";
331
- const from = options?.resolvePath?.(i) || i.from;
332
- return `readonly ${i.as}: UnwrapRef<typeof import('${from}')${i.name !== "*" ? `['${i.name}']` : ""}>`;
333
- }).filter(Boolean).sort().map((i) => ` ${i}`).join("\n")}
334
- }
335
- }`;
336
- }
337
- };
338
- return self;
339
- }
340
- const contextRE = /resolveDirective as _resolveDirective/;
341
- const contextText = `${contextRE.source}, `;
342
- const directiveRE = /(?:var|const) (\w+) = _resolveDirective\("([\w.-]+)"\);?\s*/g;
343
- const VUE_DIRECTIVES_NAME = "unimport:vue-directives";
344
- function vueDirectivesAddon(options = {}) {
345
- function isDirective(importEntry) {
346
- let isDirective2 = importEntry.meta?.vueDirective === true;
347
- if (isDirective2) return true;
348
- isDirective2 = options.isDirective?.(normalizePath(process$1.cwd(), importEntry.from), importEntry) ?? false;
349
- if (isDirective2) {
350
- importEntry.meta ??= {};
351
- importEntry.meta.vueDirective = true;
352
- }
353
- return isDirective2;
354
- }
355
- const self = {
356
- name: VUE_DIRECTIVES_NAME,
357
- async transform(s, id) {
358
- if (!s.original.match(contextRE)) return s;
359
- const matches = Array.from(s.original.matchAll(directiveRE)).sort((a, b) => b.index - a.index);
360
- if (!matches.length) return s;
361
- let targets = [];
362
- for await (const [begin, end, importEntry] of findDirectives(isDirective, matches, this.getImports())) {
363
- s.overwrite(begin, end, "");
364
- targets.push(importEntry);
365
- }
366
- if (!targets.length) return s;
367
- if (!s.toString().match(directiveRE)) s.replace(contextText, "");
368
- for (const addon of this.addons) {
369
- if (addon === self) continue;
370
- targets = await addon.injectImportsResolved?.call(this, targets, s, id) ?? targets;
371
- }
372
- let injection = stringifyImports(targets);
373
- for (const addon of this.addons) {
374
- if (addon === self) continue;
375
- injection = await addon.injectImportsStringified?.call(this, injection, targets, s, id) ?? injection;
376
- }
377
- s.prepend(injection);
378
- return s;
379
- },
380
- async declaration(dts, options2) {
381
- const directivesMap = await this.getImports().then((imports) => {
382
- return imports.filter(isDirective).reduce((acc, i) => {
383
- if (i.type || i.dtsDisabled) return acc;
384
- let name;
385
- if (i.name === "default" && (i.as === "default" || !i.as)) {
386
- const file = basename(i.from);
387
- const idx = file.indexOf(".");
388
- name = idx > -1 ? file.slice(0, idx) : file;
389
- } else name = i.as ?? i.name;
390
- name = name[0] === "v" ? camelCase(name) : camelCase(`v-${name}`);
391
- if (!acc.has(name)) acc.set(name, i);
392
- return acc;
393
- }, /* @__PURE__ */ new Map());
394
- });
395
- if (!directivesMap.size) return dts;
396
- return `${dts}
397
- // for vue directives auto import
398
- declare module 'vue' {
399
- interface GlobalDirectives {
400
- ${Array.from(directivesMap.entries()).map(([name, i]) => ` ${name}: typeof import('${options2?.resolvePath?.(i) || i.from}')['${i.name}']`).sort().join("\n")}
401
- }
402
- }`;
403
- }
404
- };
405
- return self;
406
- }
407
- function resolvePath(cwd$1, path$1) {
408
- return path$1[0] === "." ? resolve$1(cwd$1, path$1) : path$1;
409
- }
410
- function normalizePath(cwd$1, path$1) {
411
- return resolvePath(cwd$1, path$1).replace(/\\/g, "/");
412
- }
413
- async function* findDirectives(isDirective, regexArray, importsPromise) {
414
- const imports = (await importsPromise).filter(isDirective);
415
- if (!imports.length) return;
416
- const symbols = regexArray.reduce((acc, regex) => {
417
- const [all, symbol, resolveDirectiveName] = regex;
418
- if (acc.has(symbol)) return acc;
419
- acc.set(symbol, [
420
- regex.index,
421
- regex.index + all.length,
422
- kebabCase(resolveDirectiveName)
423
- ]);
424
- return acc;
425
- }, /* @__PURE__ */ new Map());
426
- for (const [symbol, data] of symbols.entries()) yield* findDirective(imports, symbol, data);
427
- }
428
- function* findDirective(imports, symbol, [begin, end, importName]) {
429
- let resolvedName;
430
- for (const i of imports) {
431
- if (i.name === "default" && (i.as === "default" || !i.as)) {
432
- const file = basename(i.from);
433
- const idx = file.indexOf(".");
434
- resolvedName = kebabCase(idx > -1 ? file.slice(0, idx) : file);
435
- } else resolvedName = kebabCase(i.as ?? i.name);
436
- if (resolvedName === importName) {
437
- yield [
438
- begin,
439
- end,
440
- {
441
- ...i,
442
- name: i.name,
443
- as: symbol
444
- }
445
- ];
446
- return;
447
- }
448
- if (resolvedName[0] === "v") resolvedName = resolvedName.slice(resolvedName[1] === "-" ? 2 : 1);
449
- if (resolvedName === importName) {
450
- yield [
451
- begin,
452
- end,
453
- {
454
- ...i,
455
- name: i.name,
456
- as: symbol
457
- }
458
- ];
459
- return;
460
- }
461
- }
462
- }
463
-
464
- //#endregion
465
- //#region node_modules/.pnpm/unimport@5.6.0/node_modules/unimport/dist/shared/unimport.u_OYhQoS.mjs
466
- var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
467
- const version = "5.6.0";
468
- function configureAddons(opts) {
469
- const addons = [];
470
- if (Array.isArray(opts.addons)) addons.push(...opts.addons);
471
- else {
472
- const addonsMap = /* @__PURE__ */ new Map();
473
- if (opts.addons?.addons?.length) {
474
- let i = 0;
475
- for (const addon of opts.addons.addons) addonsMap.set(addon.name || `external:custom-${i++}`, addon);
476
- }
477
- if (opts.addons?.vueTemplate) {
478
- if (!addonsMap.has(VUE_TEMPLATE_NAME)) addonsMap.set(VUE_TEMPLATE_NAME, vueTemplateAddon());
479
- }
480
- if (opts.addons?.vueDirectives) {
481
- if (!addonsMap.has(VUE_DIRECTIVES_NAME)) addonsMap.set(VUE_DIRECTIVES_NAME, vueDirectivesAddon(typeof opts.addons.vueDirectives === "object" ? opts.addons.vueDirectives : void 0));
482
- }
483
- addons.push(...addonsMap.values());
484
- }
485
- return addons;
486
- }
487
- async function detectImportsRegex(code, ctx, options) {
488
- const s = getMagicString(code);
489
- const original = s.original;
490
- const strippedCode = stripCommentsAndStrings(original, options?.transformVirtualImports !== false && ctx.options.virtualImports?.length ? {
491
- filter: (i) => !ctx.options.virtualImports.includes(i),
492
- fillChar: "-"
493
- } : void 0);
494
- const syntax = detectSyntax(strippedCode);
495
- const isCJSContext = syntax.hasCJS && !syntax.hasESM;
496
- let matchedImports = [];
497
- const occurrenceMap = /* @__PURE__ */ new Map();
498
- const map = await ctx.getImportMap();
499
- if (options?.autoImport !== false) {
500
- Array.from(strippedCode.matchAll(matchRE)).forEach((i) => {
501
- if (i[1] === ".") return null;
502
- const end = strippedCode[i.index + i[0].length];
503
- const before = strippedCode[i.index - 1];
504
- if (end === ":" && !["?", "case"].includes(i[1].trim()) && before !== ":") return null;
505
- const name = i[2];
506
- const occurrence = i.index + i[1].length;
507
- if (occurrenceMap.get(name) || Number.POSITIVE_INFINITY > occurrence) occurrenceMap.set(name, occurrence);
508
- });
509
- for (const regex of excludeRE) for (const match of strippedCode.matchAll(regex)) {
510
- const segments = [...match[1]?.split(separatorRE) || [], ...match[2]?.split(separatorRE) || []];
511
- for (const segment of segments) {
512
- const identifier = segment.replace(importAsRE, "").trim();
513
- occurrenceMap.delete(identifier);
514
- }
515
- }
516
- const identifiers = new Set(occurrenceMap.keys());
517
- matchedImports = Array.from(identifiers).map((name) => {
518
- const item = map.get(name);
519
- if (item && !item.disabled) return item;
520
- occurrenceMap.delete(name);
521
- return null;
522
- }).filter(Boolean);
523
- for (const addon of ctx.addons) matchedImports = await addon.matchImports?.call(ctx, identifiers, matchedImports) || matchedImports;
524
- }
525
- if (options?.transformVirtualImports !== false && ctx.options.virtualImports?.length) {
526
- const virtualImports = parseVirtualImportsRegex(strippedCode, map, ctx.options.virtualImports);
527
- virtualImports.ranges.forEach(([start, end]) => {
528
- s.remove(start, end);
529
- });
530
- matchedImports.push(...virtualImports.imports);
531
- }
532
- const firstOccurrence = Math.min(...Array.from(occurrenceMap.entries()).map((i) => i[1]));
533
- return {
534
- s,
535
- strippedCode,
536
- isCJSContext,
537
- matchedImports,
538
- firstOccurrence
539
- };
540
- }
541
- function parseVirtualImportsRegex(strippedCode, importMap, virtualImports) {
542
- const imports = [];
543
- const ranges = [];
544
- if (virtualImports?.length) findStaticImports(strippedCode).filter((i) => virtualImports.includes(i.specifier)).map((i) => parseStaticImport(i)).forEach((i) => {
545
- ranges.push([i.start, i.end]);
546
- Object.entries(i.namedImports || {}).forEach(([name, as]) => {
547
- const original = importMap.get(name);
548
- if (!original) throw new Error(`[unimport] failed to find "${name}" imported from "${i.specifier}"`);
549
- imports.push({
550
- from: original.from,
551
- name: original.name,
552
- as
553
- });
554
- });
555
- });
556
- return {
557
- imports,
558
- ranges
559
- };
560
- }
561
- async function detectImports(code, ctx, options) {
562
- if (options?.parser === "acorn") return import("./unimport.mjs").then((n) => n.s).then((r) => r.detectImportsAcorn(code, ctx, options));
563
- return detectImportsRegex(code, ctx, options);
564
- }
565
- const FileExtensionLookup = [
566
- "mts",
567
- "cts",
568
- "ts",
569
- "tsx",
570
- "mjs",
571
- "cjs",
572
- "js",
573
- "jsx"
574
- ];
575
- const FileLookupPatterns = `*.{${FileExtensionLookup.join(",")}}`;
576
- function resolveGlobsExclude(glob2, cwd$1) {
577
- return `${glob2.startsWith("!") ? "!" : ""}${resolve$1(cwd$1, glob2.replace(/^!/, ""))}`;
578
- }
579
- function joinGlobFilePattern(glob2, filePattern) {
580
- return join$1(basename$1(glob2) === "*" ? dirname$1(glob2) : glob2, filePattern);
581
- }
582
- function normalizeScanDirs(dirs, options) {
583
- const topLevelTypes = options?.types ?? true;
584
- const cwd$1 = options?.cwd ?? process$1.cwd();
585
- const filePatterns = options?.filePatterns || [FileLookupPatterns];
586
- return dirs.map((dir) => {
587
- const isString = typeof dir === "string";
588
- const glob2 = resolveGlobsExclude(isString ? dir : dir.glob, cwd$1);
589
- const types = isString ? topLevelTypes : dir.types ?? topLevelTypes;
590
- if (glob2.match(/\.\w+$/)) return {
591
- glob: glob2,
592
- types
593
- };
594
- const withFilePatterns = filePatterns.map((filePattern) => ({
595
- glob: joinGlobFilePattern(glob2, filePattern),
596
- types
597
- }));
598
- return [{
599
- glob: glob2,
600
- types
601
- }, ...withFilePatterns];
602
- }).flat();
603
- }
604
- async function scanFilesFromDir(dir, options) {
605
- const dirGlobs = (Array.isArray(dir) ? dir : [dir]).map((i) => i.glob);
606
- const files = (await glob(dirGlobs, {
607
- absolute: true,
608
- cwd: options?.cwd || process$1.cwd(),
609
- onlyFiles: true,
610
- followSymbolicLinks: true,
611
- expandDirectories: false
612
- })).map((i) => normalize$1(i));
613
- const fileFilter = options?.fileFilter || (() => true);
614
- const indexOfDirs = (file) => dirGlobs.findIndex((glob2) => import_picomatch.default.isMatch(file, glob2));
615
- return files.reduce((acc, file) => {
616
- const index = indexOfDirs(file);
617
- if (acc[index]) acc[index].push(normalize$1(file));
618
- else acc[index] = [normalize$1(file)];
619
- return acc;
620
- }, []).map((files2) => files2.sort()).flat().filter(fileFilter);
621
- }
622
- async function scanDirExports(dirs, options) {
623
- const normalizedDirs = normalizeScanDirs(dirs, options);
624
- const files = await scanFilesFromDir(normalizedDirs, options);
625
- const includeTypesDirs = normalizedDirs.filter((dir) => !dir.glob.startsWith("!") && dir.types);
626
- const isIncludeTypes = (file) => includeTypesDirs.some((dir) => import_picomatch.default.isMatch(file, dir.glob));
627
- return dedupeDtsExports((await Promise.all(files.map((file) => scanExports(file, isIncludeTypes(file))))).flat());
628
- }
629
- function dedupeDtsExports(exports) {
630
- return exports.filter((i) => {
631
- if (!i.type) return true;
632
- if (i.declarationType === "enum" || i.declarationType === "const enum" || i.declarationType === "class") return true;
633
- return !exports.find((e) => e.as === i.as && e.name === i.name && !e.type);
634
- });
635
- }
636
- async function scanExports(filepath, includeTypes, seen = /* @__PURE__ */ new Set()) {
637
- if (seen.has(filepath)) {
638
- console.warn(`[unimport] "${filepath}" is already scanned, skipping`);
639
- return [];
640
- }
641
- seen.add(filepath);
642
- const imports = [];
643
- const code = await readFile(filepath, "utf-8");
644
- const exports = findExports(code);
645
- if (exports.find((i) => i.type === "default")) {
646
- let name = parse(filepath).name;
647
- if (name === "index") name = parse(filepath.split("/").slice(0, -1).join("/")).name;
648
- const as = /[-_.]/.test(name) ? camelCase(name) : name;
649
- imports.push({
650
- name: "default",
651
- as,
652
- from: filepath
653
- });
654
- }
655
- async function toImport(exports2, additional) {
656
- for (const exp of exports2) if (exp.type === "named") for (const name of exp.names) imports.push({
657
- name,
658
- as: name,
659
- from: filepath,
660
- ...additional
661
- });
662
- else if (exp.type === "declaration") {
663
- if (exp.name) {
664
- imports.push({
665
- name: exp.name,
666
- as: exp.name,
667
- from: filepath,
668
- ...additional
669
- });
670
- if (exp.declarationType === "enum" || exp.declarationType === "const enum" || exp.declarationType === "class") imports.push({
671
- name: exp.name,
672
- as: exp.name,
673
- from: filepath,
674
- type: true,
675
- declarationType: exp.declarationType,
676
- ...additional
677
- });
678
- }
679
- } else if (exp.type === "star" && exp.specifier) if (exp.name) imports.push({
680
- name: exp.name,
681
- as: exp.name,
682
- from: filepath,
683
- ...additional
684
- });
685
- else {
686
- const subfile = exp.specifier;
687
- let subfilepath = resolve$1(dirname$1(filepath), subfile);
688
- let subfilepathResolved = false;
689
- for (const ext of FileExtensionLookup) if (existsSync(`${subfilepath}.${ext}`)) {
690
- subfilepath = `${subfilepath}.${ext}`;
691
- break;
692
- } else if (existsSync(`${subfilepath}/index.${ext}`)) {
693
- subfilepath = `${subfilepath}/index.${ext}`;
694
- break;
695
- }
696
- if (existsSync(subfilepath)) subfilepathResolved = true;
697
- else try {
698
- subfilepath = await resolve$2(exp.specifier);
699
- subfilepath = normalize$1(fileURLToPath(subfilepath));
700
- if (existsSync(subfilepath)) subfilepathResolved = true;
701
- } catch {}
702
- if (!subfilepathResolved) {
703
- console.warn(`[unimport] failed to resolve "${subfilepath}", skip scanning`);
704
- continue;
705
- }
706
- const nested = await scanExports(subfilepath, includeTypes, seen);
707
- imports.push(...additional ? nested.map((i) => ({
708
- ...i,
709
- ...additional
710
- })) : nested);
711
- }
712
- }
713
- if (filepath.match(/\.d\.[mc]?ts$/)) {
714
- if (includeTypes) {
715
- await toImport(exports, { type: true });
716
- await toImport(findTypeExports(code), { type: true });
717
- }
718
- } else {
719
- await toImport(exports);
720
- if (includeTypes) await toImport(findTypeExports(code), { type: true });
721
- }
722
- return imports;
723
- }
724
- const CACHE_PATH = /* @__PURE__ */ join$1(os.tmpdir(), "unimport");
725
- let CACHE_WRITEABLE;
726
- async function resolvePackagePreset(preset) {
727
- return (await extractExports(preset.package, preset.url, preset.cache)).filter((name) => {
728
- for (const item of preset.ignore || []) {
729
- if (typeof item === "string" && item === name) return false;
730
- if (item instanceof RegExp && item.test(name)) return false;
731
- if (typeof item === "function" && item(name) === false) return false;
732
- }
733
- return true;
734
- }).map((name) => ({
735
- from: preset.package,
736
- name
737
- }));
738
- }
739
- async function extractExports(name, url, cache = true) {
740
- const version$1 = (await readPackageJSON(await resolvePackageJSON(name, { url }))).version;
741
- const cachePath = join$1(CACHE_PATH, `${name}@${version$1}`, "exports.json");
742
- if (cache && CACHE_WRITEABLE === void 0) try {
743
- CACHE_WRITEABLE = isWritable(CACHE_PATH);
744
- } catch {
745
- CACHE_WRITEABLE = false;
746
- }
747
- const useCache = cache && version$1 && CACHE_WRITEABLE;
748
- if (useCache && existsSync(cachePath)) return JSON.parse(await promises.readFile(cachePath, "utf-8"));
749
- const scanned = await resolveModuleExportNames(name, { url });
750
- if (useCache) {
751
- await promises.mkdir(dirname$1(cachePath), { recursive: true });
752
- await promises.writeFile(cachePath, JSON.stringify(scanned), "utf-8");
753
- }
754
- return scanned;
755
- }
756
- function isWritable(filename) {
757
- try {
758
- accessSync(filename, constants.W_OK);
759
- return true;
760
- } catch {
761
- return false;
762
- }
763
- }
764
- const dateFns = defineUnimportPreset({
765
- from: "date-fns",
766
- imports: [
767
- "add",
768
- "addBusinessDays",
769
- "addDays",
770
- "addHours",
771
- "addISOWeekYears",
772
- "addMilliseconds",
773
- "addMinutes",
774
- "addMonths",
775
- "addQuarters",
776
- "addSeconds",
777
- "addWeeks",
778
- "addYears",
779
- "areIntervalsOverlapping",
780
- "clamp",
781
- "closestIndexTo",
782
- "closestTo",
783
- "compareAsc",
784
- "compareDesc",
785
- "constants",
786
- "daysToWeeks",
787
- "differenceInBusinessDays",
788
- "differenceInCalendarDays",
789
- "differenceInCalendarISOWeekYears",
790
- "differenceInCalendarISOWeeks",
791
- "differenceInCalendarMonths",
792
- "differenceInCalendarQuarters",
793
- "differenceInCalendarWeeks",
794
- "differenceInCalendarYears",
795
- "differenceInDays",
796
- "differenceInHours",
797
- "differenceInISOWeekYears",
798
- "differenceInMilliseconds",
799
- "differenceInMinutes",
800
- "differenceInMonths",
801
- "differenceInQuarters",
802
- "differenceInSeconds",
803
- "differenceInWeeks",
804
- "differenceInYears",
805
- "eachDayOfInterval",
806
- "eachHourOfInterval",
807
- "eachMinuteOfInterval",
808
- "eachMonthOfInterval",
809
- "eachQuarterOfInterval",
810
- "eachWeekOfInterval",
811
- "eachWeekendOfInterval",
812
- "eachWeekendOfMonth",
813
- "eachWeekendOfYear",
814
- "eachYearOfInterval",
815
- "endOfDay",
816
- "endOfDecade",
817
- "endOfHour",
818
- "endOfISOWeek",
819
- "endOfISOWeekYear",
820
- "endOfMinute",
821
- "endOfMonth",
822
- "endOfQuarter",
823
- "endOfSecond",
824
- "endOfToday",
825
- "endOfTomorrow",
826
- "endOfWeek",
827
- "endOfYear",
828
- "endOfYesterday",
829
- "format",
830
- "formatDistance",
831
- "formatDistanceStrict",
832
- "formatDistanceToNow",
833
- "formatDistanceToNowStrict",
834
- "formatDuration",
835
- "formatISO",
836
- "formatISO9075",
837
- "formatISODuration",
838
- "formatRFC3339",
839
- "formatRFC7231",
840
- "formatRelative",
841
- "fromUnixTime",
842
- "getDate",
843
- "getDay",
844
- "getDayOfYear",
845
- "getDaysInMonth",
846
- "getDaysInYear",
847
- "getDecade",
848
- "getDefaultOptions",
849
- "getHours",
850
- "getISODay",
851
- "getISOWeek",
852
- "getISOWeekYear",
853
- "getISOWeeksInYear",
854
- "getMilliseconds",
855
- "getMinutes",
856
- "getMonth",
857
- "getOverlappingDaysInIntervals",
858
- "getQuarter",
859
- "getSeconds",
860
- "getTime",
861
- "getUnixTime",
862
- "getWeek",
863
- "getWeekOfMonth",
864
- "getWeekYear",
865
- "getWeeksInMonth",
866
- "getYear",
867
- "hoursToMilliseconds",
868
- "hoursToMinutes",
869
- "hoursToSeconds",
870
- "intervalToDuration",
871
- "intlFormat",
872
- "intlFormatDistance",
873
- "isAfter",
874
- "isBefore",
875
- "isDate",
876
- "isEqual",
877
- "isExists",
878
- "isFirstDayOfMonth",
879
- "isFriday",
880
- "isFuture",
881
- "isLastDayOfMonth",
882
- "isLeapYear",
883
- "isMatch",
884
- "isMonday",
885
- "isPast",
886
- "isSameDay",
887
- "isSameHour",
888
- "isSameISOWeek",
889
- "isSameISOWeekYear",
890
- "isSameMinute",
891
- "isSameMonth",
892
- "isSameQuarter",
893
- "isSameSecond",
894
- "isSameWeek",
895
- "isSameYear",
896
- "isSaturday",
897
- "isSunday",
898
- "isThisHour",
899
- "isThisISOWeek",
900
- "isThisMinute",
901
- "isThisMonth",
902
- "isThisQuarter",
903
- "isThisSecond",
904
- "isThisWeek",
905
- "isThisYear",
906
- "isThursday",
907
- "isToday",
908
- "isTomorrow",
909
- "isTuesday",
910
- "isValid",
911
- "isWednesday",
912
- "isWeekend",
913
- "isWithinInterval",
914
- "isYesterday",
915
- "lastDayOfDecade",
916
- "lastDayOfISOWeek",
917
- "lastDayOfISOWeekYear",
918
- "lastDayOfMonth",
919
- "lastDayOfQuarter",
920
- "lastDayOfWeek",
921
- "lastDayOfYear",
922
- "lightFormat",
923
- "max",
924
- "milliseconds",
925
- "millisecondsToHours",
926
- "millisecondsToMinutes",
927
- "millisecondsToSeconds",
928
- "min",
929
- "minutesToHours",
930
- "minutesToMilliseconds",
931
- "minutesToSeconds",
932
- "monthsToQuarters",
933
- "monthsToYears",
934
- "nextDay",
935
- "nextFriday",
936
- "nextMonday",
937
- "nextSaturday",
938
- "nextSunday",
939
- "nextThursday",
940
- "nextTuesday",
941
- "nextWednesday",
942
- "parse",
943
- "parseISO",
944
- "parseJSON",
945
- "previousDay",
946
- "previousFriday",
947
- "previousMonday",
948
- "previousSaturday",
949
- "previousSunday",
950
- "previousThursday",
951
- "previousTuesday",
952
- "previousWednesday",
953
- "quartersToMonths",
954
- "quartersToYears",
955
- "roundToNearestMinutes",
956
- "secondsToHours",
957
- "secondsToMilliseconds",
958
- "secondsToMinutes",
959
- "set",
960
- "setDate",
961
- "setDay",
962
- "setDayOfYear",
963
- "setDefaultOptions",
964
- "setHours",
965
- "setISODay",
966
- "setISOWeek",
967
- "setISOWeekYear",
968
- "setMilliseconds",
969
- "setMinutes",
970
- "setMonth",
971
- "setQuarter",
972
- "setSeconds",
973
- "setWeek",
974
- "setWeekYear",
975
- "setYear",
976
- "startOfDay",
977
- "startOfDecade",
978
- "startOfHour",
979
- "startOfISOWeek",
980
- "startOfISOWeekYear",
981
- "startOfMinute",
982
- "startOfMonth",
983
- "startOfQuarter",
984
- "startOfSecond",
985
- "startOfToday",
986
- "startOfTomorrow",
987
- "startOfWeek",
988
- "startOfWeekYear",
989
- "startOfYear",
990
- "startOfYesterday",
991
- "sub",
992
- "subBusinessDays",
993
- "subDays",
994
- "subHours",
995
- "subISOWeekYears",
996
- "subMilliseconds",
997
- "subMinutes",
998
- "subMonths",
999
- "subQuarters",
1000
- "subSeconds",
1001
- "subWeeks",
1002
- "subYears",
1003
- "toDate",
1004
- "weeksToDays",
1005
- "yearsToMonths",
1006
- "yearsToQuarters"
1007
- ]
1008
- });
1009
- const pinia = defineUnimportPreset({
1010
- from: "pinia",
1011
- imports: [
1012
- "acceptHMRUpdate",
1013
- "createPinia",
1014
- "defineStore",
1015
- "getActivePinia",
1016
- "mapActions",
1017
- "mapGetters",
1018
- "mapState",
1019
- "mapStores",
1020
- "mapWritableState",
1021
- "setActivePinia",
1022
- "setMapStoreSuffix",
1023
- "storeToRefs"
1024
- ]
1025
- });
1026
- const preact = defineUnimportPreset({
1027
- from: "preact",
1028
- imports: [
1029
- "useState",
1030
- "useCallback",
1031
- "useMemo",
1032
- "useEffect",
1033
- "useRef",
1034
- "useContext",
1035
- "useReducer"
1036
- ]
1037
- });
1038
- const quasar = defineUnimportPreset({
1039
- from: "quasar",
1040
- imports: [
1041
- "useQuasar",
1042
- "useDialogPluginComponent",
1043
- "useFormChild",
1044
- "useMeta"
1045
- ]
1046
- });
1047
- const react = defineUnimportPreset({
1048
- from: "react",
1049
- imports: [
1050
- "useState",
1051
- "useCallback",
1052
- "useMemo",
1053
- "useEffect",
1054
- "useRef",
1055
- "useContext",
1056
- "useReducer"
1057
- ]
1058
- });
1059
- const ReactRouterHooks = [
1060
- "useOutletContext",
1061
- "useHref",
1062
- "useInRouterContext",
1063
- "useLocation",
1064
- "useNavigationType",
1065
- "useNavigate",
1066
- "useOutlet",
1067
- "useParams",
1068
- "useResolvedPath",
1069
- "useRoutes"
1070
- ];
1071
- const reactRouter = defineUnimportPreset({
1072
- from: "react-router",
1073
- imports: [...ReactRouterHooks]
1074
- });
1075
- const reactRouterDom = defineUnimportPreset({
1076
- from: "react-router-dom",
1077
- imports: [
1078
- ...ReactRouterHooks,
1079
- "useLinkClickHandler",
1080
- "useSearchParams",
1081
- "Link",
1082
- "NavLink",
1083
- "Navigate",
1084
- "Outlet",
1085
- "Route",
1086
- "Routes"
1087
- ]
1088
- });
1089
- const rxjs = defineUnimportPreset({
1090
- from: "rxjs",
1091
- imports: [
1092
- "of",
1093
- "from",
1094
- "map",
1095
- "tap",
1096
- "filter",
1097
- "forkJoin",
1098
- "throwError",
1099
- "catchError",
1100
- "Observable",
1101
- "mergeMap",
1102
- "switchMap",
1103
- "merge",
1104
- "zip",
1105
- "take",
1106
- "takeUntil",
1107
- "first",
1108
- "lastValueFrom",
1109
- "skip",
1110
- "skipUntil",
1111
- "distinct",
1112
- "distinctUntilChanged",
1113
- "throttle",
1114
- "throttleTime",
1115
- "retry",
1116
- "retryWhen",
1117
- "timeout",
1118
- "delay",
1119
- "debounce",
1120
- "debounceTime",
1121
- "find",
1122
- "every"
1123
- ]
1124
- });
1125
- const solid = defineUnimportPreset({
1126
- from: "solid-js",
1127
- imports: [
1128
- defineUnimportPreset({
1129
- from: "solid-js",
1130
- imports: [
1131
- "createSignal",
1132
- "createEffect",
1133
- "createMemo",
1134
- "createResource",
1135
- "onMount",
1136
- "onCleanup",
1137
- "onError",
1138
- "untrack",
1139
- "batch",
1140
- "on",
1141
- "createRoot",
1142
- "mergeProps",
1143
- "splitProps",
1144
- "useTransition",
1145
- "observable",
1146
- "mapArray",
1147
- "indexArray",
1148
- "createContext",
1149
- "useContext",
1150
- "children",
1151
- "lazy",
1152
- "createDeferred",
1153
- "createRenderEffect",
1154
- "createSelector",
1155
- "For",
1156
- "Show",
1157
- "Switch",
1158
- "Match",
1159
- "Index",
1160
- "ErrorBoundary",
1161
- "Suspense",
1162
- "SuspenseList"
1163
- ]
1164
- }),
1165
- defineUnimportPreset({
1166
- from: "solid-js/store",
1167
- imports: [
1168
- "createStore",
1169
- "produce",
1170
- "reconcile",
1171
- "createMutable"
1172
- ]
1173
- }),
1174
- defineUnimportPreset({
1175
- from: "solid-js/web",
1176
- imports: [
1177
- "Dynamic",
1178
- "hydrate",
1179
- "render",
1180
- "renderToString",
1181
- "renderToStringAsync",
1182
- "renderToStream",
1183
- "isServer",
1184
- "Portal"
1185
- ]
1186
- })
1187
- ]
1188
- });
1189
- const solidAppRouter = defineUnimportPreset({
1190
- from: "solid-app-router",
1191
- imports: [
1192
- "Link",
1193
- "NavLink",
1194
- "Navigate",
1195
- "Outlet",
1196
- "Route",
1197
- "Router",
1198
- "Routes",
1199
- "_mergeSearchString",
1200
- "createIntegration",
1201
- "hashIntegration",
1202
- "normalizeIntegration",
1203
- "pathIntegration",
1204
- "staticIntegration",
1205
- "useHref",
1206
- "useIsRouting",
1207
- "useLocation",
1208
- "useMatch",
1209
- "useNavigate",
1210
- "useParams",
1211
- "useResolvedPath",
1212
- "useRouteData",
1213
- "useRoutes",
1214
- "useSearchParams"
1215
- ]
1216
- });
1217
- const svelteAnimate = defineUnimportPreset({
1218
- from: "svelte/animate",
1219
- imports: ["flip"]
1220
- });
1221
- const svelteEasing = defineUnimportPreset({
1222
- from: "svelte/easing",
1223
- imports: [
1224
- "back",
1225
- "bounce",
1226
- "circ",
1227
- "cubic",
1228
- "elastic",
1229
- "expo",
1230
- "quad",
1231
- "quart",
1232
- "quint",
1233
- "sine"
1234
- ].reduce((acc, e) => {
1235
- acc.push(`${e}In`, `${e}Out`, `${e}InOut`);
1236
- return acc;
1237
- }, ["linear"])
1238
- });
1239
- const svelteStore = defineUnimportPreset({
1240
- from: "svelte/store",
1241
- imports: [
1242
- "writable",
1243
- "readable",
1244
- "derived",
1245
- "get"
1246
- ]
1247
- });
1248
- const svelteMotion = defineUnimportPreset({
1249
- from: "svelte/motion",
1250
- imports: ["tweened", "spring"]
1251
- });
1252
- const svelteTransition = defineUnimportPreset({
1253
- from: "svelte/transition",
1254
- imports: [
1255
- "fade",
1256
- "blur",
1257
- "fly",
1258
- "slide",
1259
- "scale",
1260
- "draw",
1261
- "crossfade"
1262
- ]
1263
- });
1264
- const svelte = defineUnimportPreset({
1265
- from: "svelte",
1266
- imports: [
1267
- "onMount",
1268
- "beforeUpdate",
1269
- "afterUpdate",
1270
- "onDestroy",
1271
- "tick",
1272
- "setContext",
1273
- "getContext",
1274
- "hasContext",
1275
- "getAllContexts",
1276
- "createEventDispatcher"
1277
- ]
1278
- });
1279
- const uniApp = defineUnimportPreset({
1280
- from: "@dcloudio/uni-app",
1281
- imports: [
1282
- "onAddToFavorites",
1283
- "onBackPress",
1284
- "onError",
1285
- "onHide",
1286
- "onLaunch",
1287
- "onLoad",
1288
- "onNavigationBarButtonTap",
1289
- "onNavigationBarSearchInputChanged",
1290
- "onNavigationBarSearchInputClicked",
1291
- "onNavigationBarSearchInputConfirmed",
1292
- "onNavigationBarSearchInputFocusChanged",
1293
- "onPageNotFound",
1294
- "onPageScroll",
1295
- "onPullDownRefresh",
1296
- "onReachBottom",
1297
- "onReady",
1298
- "onResize",
1299
- "onShareAppMessage",
1300
- "onShareTimeline",
1301
- "onShow",
1302
- "onTabItemTap",
1303
- "onThemeChange",
1304
- "onUnhandledRejection",
1305
- "onUnload"
1306
- ]
1307
- });
1308
- const veeValidate = defineUnimportPreset({
1309
- from: "vee-validate",
1310
- imports: [
1311
- "validate",
1312
- "defineRule",
1313
- "configure",
1314
- "useField",
1315
- "useForm",
1316
- "useFieldArray",
1317
- "useResetForm",
1318
- "useIsFieldDirty",
1319
- "useIsFieldTouched",
1320
- "useIsFieldValid",
1321
- "useIsSubmitting",
1322
- "useValidateField",
1323
- "useIsFormDirty",
1324
- "useIsFormTouched",
1325
- "useIsFormValid",
1326
- "useValidateForm",
1327
- "useSubmitCount",
1328
- "useFieldValue",
1329
- "useFormValues",
1330
- "useFormErrors",
1331
- "useFieldError",
1332
- "useSubmitForm",
1333
- "FormContextKey",
1334
- "FieldContextKey"
1335
- ]
1336
- });
1337
- const vitepress = defineUnimportPreset({
1338
- from: "vitepress",
1339
- imports: [
1340
- "useData",
1341
- "useRoute",
1342
- "useRouter",
1343
- "withBase"
1344
- ]
1345
- });
1346
- const vitest = defineUnimportPreset({
1347
- from: "vitest",
1348
- imports: [
1349
- "suite",
1350
- "test",
1351
- "describe",
1352
- "it",
1353
- "chai",
1354
- "expect",
1355
- "assert",
1356
- "vitest",
1357
- "vi",
1358
- "beforeAll",
1359
- "afterAll",
1360
- "beforeEach",
1361
- "afterEach"
1362
- ]
1363
- });
1364
- const CommonCompositionAPI = [
1365
- "onActivated",
1366
- "onBeforeMount",
1367
- "onBeforeUnmount",
1368
- "onBeforeUpdate",
1369
- "onErrorCaptured",
1370
- "onDeactivated",
1371
- "onMounted",
1372
- "onServerPrefetch",
1373
- "onUnmounted",
1374
- "onUpdated",
1375
- "useAttrs",
1376
- "useSlots",
1377
- "computed",
1378
- "customRef",
1379
- "isReadonly",
1380
- "isRef",
1381
- "isShallow",
1382
- "isProxy",
1383
- "isReactive",
1384
- "markRaw",
1385
- "reactive",
1386
- "readonly",
1387
- "ref",
1388
- "shallowReactive",
1389
- "shallowReadonly",
1390
- "shallowRef",
1391
- "triggerRef",
1392
- "toRaw",
1393
- "toRef",
1394
- "toRefs",
1395
- "toValue",
1396
- "unref",
1397
- "watch",
1398
- "watchEffect",
1399
- "watchPostEffect",
1400
- "watchSyncEffect",
1401
- "defineComponent",
1402
- "defineAsyncComponent",
1403
- "getCurrentInstance",
1404
- "h",
1405
- "inject",
1406
- "nextTick",
1407
- "provide",
1408
- "useCssModule",
1409
- "createApp",
1410
- "effectScope",
1411
- "EffectScope",
1412
- "getCurrentScope",
1413
- "onScopeDispose",
1414
- ...[
1415
- "Component",
1416
- "Slot",
1417
- "Slots",
1418
- "ComponentPublicInstance",
1419
- "ComputedRef",
1420
- "DirectiveBinding",
1421
- "ExtractDefaultPropTypes",
1422
- "ExtractPropTypes",
1423
- "ExtractPublicPropTypes",
1424
- "InjectionKey",
1425
- "PropType",
1426
- "Ref",
1427
- "ShallowRef",
1428
- "MaybeRef",
1429
- "MaybeRefOrGetter",
1430
- "VNode",
1431
- "WritableComputedRef"
1432
- ].map((name) => ({
1433
- name,
1434
- type: true
1435
- }))
1436
- ];
1437
- const vue = defineUnimportPreset({
1438
- from: "vue",
1439
- imports: [
1440
- ...CommonCompositionAPI,
1441
- "onRenderTracked",
1442
- "onRenderTriggered",
1443
- "resolveComponent",
1444
- "useCssVars",
1445
- "useModel",
1446
- "getCurrentWatcher",
1447
- "onWatcherCleanup",
1448
- "useId",
1449
- "useTemplateRef"
1450
- ]
1451
- });
1452
- const vueCompositionApi = defineUnimportPreset({
1453
- from: "@vue/composition-api",
1454
- imports: CommonCompositionAPI
1455
- });
1456
- const vueDemi = defineUnimportPreset({
1457
- from: "vue-demi",
1458
- imports: CommonCompositionAPI
1459
- });
1460
- const vueI18n = defineUnimportPreset({
1461
- from: "vue-i18n",
1462
- imports: ["useI18n"]
1463
- });
1464
- const vueMacros = defineUnimportPreset({
1465
- from: "vue/macros",
1466
- imports: [
1467
- "$",
1468
- "$$",
1469
- "$ref",
1470
- "$shallowRef",
1471
- "$toRef",
1472
- "$customRef",
1473
- "$computed"
1474
- ]
1475
- });
1476
- const vueRouter = defineUnimportPreset({
1477
- from: "vue-router",
1478
- imports: [
1479
- "useRouter",
1480
- "useRoute",
1481
- "useLink",
1482
- "onBeforeRouteLeave",
1483
- "onBeforeRouteUpdate"
1484
- ]
1485
- });
1486
- const vueRouterComposables = defineUnimportPreset({
1487
- from: "vue-router/composables",
1488
- imports: [
1489
- "useRouter",
1490
- "useRoute",
1491
- "useLink",
1492
- "onBeforeRouteLeave",
1493
- "onBeforeRouteUpdate"
1494
- ]
1495
- });
1496
- let _cache;
1497
- const vueuseCore = () => {
1498
- const excluded = ["toRefs", "utils"];
1499
- if (!_cache) try {
1500
- const corePath = resolveModule("@vueuse/core") || process$1.cwd();
1501
- const path$1 = resolveModule("@vueuse/core/indexes.json") || resolveModule("@vueuse/metadata/index.json") || resolveModule("@vueuse/metadata/index.json", { paths: [corePath] });
1502
- _cache = defineUnimportPreset({
1503
- from: "@vueuse/core",
1504
- imports: JSON.parse(readFileSync(path$1, "utf-8")).functions.filter((i) => ["core", "shared"].includes(i.package)).map((i) => i.name).filter((i) => i && i.length >= 4 && !excluded.includes(i))
1505
- });
1506
- } catch (error) {
1507
- console.error(error);
1508
- throw new Error("[auto-import] failed to load @vueuse/core, have you installed it?");
1509
- }
1510
- return _cache;
1511
- };
1512
- const vueuseHead = defineUnimportPreset({
1513
- from: "@vueuse/head",
1514
- imports: ["useHead"]
1515
- });
1516
- const vuex = defineUnimportPreset({
1517
- from: "vuex",
1518
- imports: [
1519
- "createStore",
1520
- "createLogger",
1521
- "mapState",
1522
- "mapGetters",
1523
- "mapActions",
1524
- "mapMutations",
1525
- "createNamespacedHelpers",
1526
- "useStore"
1527
- ]
1528
- });
1529
- const builtinPresets = {
1530
- "@vue/composition-api": vueCompositionApi,
1531
- "@vueuse/core": vueuseCore,
1532
- "@vueuse/head": vueuseHead,
1533
- "pinia": pinia,
1534
- "preact": preact,
1535
- "quasar": quasar,
1536
- "react": react,
1537
- "react-router": reactRouter,
1538
- "react-router-dom": reactRouterDom,
1539
- "svelte": svelte,
1540
- "svelte/animate": svelteAnimate,
1541
- "svelte/easing": svelteEasing,
1542
- "svelte/motion": svelteMotion,
1543
- "svelte/store": svelteStore,
1544
- "svelte/transition": svelteTransition,
1545
- "vee-validate": veeValidate,
1546
- "vitepress": vitepress,
1547
- "vue-demi": vueDemi,
1548
- "vue-i18n": vueI18n,
1549
- "vue-router": vueRouter,
1550
- "vue-router-composables": vueRouterComposables,
1551
- "vue": vue,
1552
- "vue/macros": vueMacros,
1553
- "vuex": vuex,
1554
- "vitest": vitest,
1555
- "uni-app": uniApp,
1556
- "solid-js": solid,
1557
- "solid-app-router": solidAppRouter,
1558
- "rxjs": rxjs,
1559
- "date-fns": dateFns
1560
- };
1561
- const commonProps = [
1562
- "from",
1563
- "priority",
1564
- "disabled",
1565
- "dtsDisabled",
1566
- "declarationType",
1567
- "meta",
1568
- "type",
1569
- "typeFrom"
1570
- ];
1571
- async function resolvePreset(preset) {
1572
- const imports = [];
1573
- if ("package" in preset) return await resolvePackagePreset(preset);
1574
- const common = {};
1575
- commonProps.forEach((i) => {
1576
- if (i in preset) common[i] = preset[i];
1577
- });
1578
- for (const _import of preset.imports) if (typeof _import === "string") imports.push({
1579
- ...common,
1580
- name: _import,
1581
- as: _import
1582
- });
1583
- else if (Array.isArray(_import)) imports.push({
1584
- ...common,
1585
- name: _import[0],
1586
- as: _import[1] || _import[0],
1587
- from: _import[2] || preset.from
1588
- });
1589
- else if (_import.imports) imports.push(...await resolvePreset(_import));
1590
- else imports.push({
1591
- ...common,
1592
- ..._import
1593
- });
1594
- return imports;
1595
- }
1596
- async function resolveBuiltinPresets(presets) {
1597
- return (await Promise.all(presets.map(async (p) => {
1598
- let preset = typeof p === "string" ? builtinPresets[p] : p;
1599
- if (typeof preset === "function") preset = preset();
1600
- return await resolvePreset(preset);
1601
- }))).flat();
1602
- }
1603
- function createUnimport(opts) {
1604
- const ctx = createInternalContext(opts);
1605
- async function generateTypeDeclarations(options) {
1606
- const opts2 = {
1607
- resolvePath: (i) => stripFileExtension(i.typeFrom || i.from),
1608
- ...options
1609
- };
1610
- const { typeReExports = true } = opts2;
1611
- const imports = await ctx.getImports();
1612
- let dts = toTypeDeclarationFile(imports.filter((i) => !i.type && !i.dtsDisabled), opts2);
1613
- const typeOnly = imports.filter((i) => i.type);
1614
- if (typeReExports && typeOnly.length) dts += `
1615
- ${toTypeReExports(typeOnly, opts2)}`;
1616
- for (const addon of ctx.addons) dts = await addon.declaration?.call(ctx, dts, opts2) ?? dts;
1617
- return dts;
1618
- }
1619
- async function scanImportsFromFile(filepath, includeTypes = true) {
1620
- const additions = await scanExports(filepath, includeTypes);
1621
- await ctx.modifyDynamicImports((imports) => imports.filter((i) => i.from !== filepath).concat(additions));
1622
- return additions;
1623
- }
1624
- async function scanImportsFromDir(dirs = ctx.options.dirs || [], options = ctx.options.dirsScanOptions) {
1625
- const imports = await scanDirExports(dirs, options);
1626
- const files = new Set(imports.map((f) => f.from));
1627
- await ctx.modifyDynamicImports((i) => i.filter((i2) => !files.has(i2.from)).concat(imports));
1628
- return imports;
1629
- }
1630
- async function injectImportsWithContext(code, id, options) {
1631
- const result = await injectImports(code, id, ctx, {
1632
- ...opts,
1633
- ...options
1634
- });
1635
- const metadata = ctx.getMetadata();
1636
- if (metadata) result.imports.forEach((i) => {
1637
- metadata.injectionUsage[i.name] = metadata.injectionUsage[i.name] || {
1638
- import: i,
1639
- count: 0,
1640
- moduleIds: []
1641
- };
1642
- metadata.injectionUsage[i.name].count++;
1643
- if (id && !metadata.injectionUsage[i.name].moduleIds.includes(id)) metadata.injectionUsage[i.name].moduleIds.push(id);
1644
- });
1645
- return result;
1646
- }
1647
- async function init() {
1648
- if (ctx.options.dirs?.length) await scanImportsFromDir();
1649
- }
1650
- return {
1651
- version,
1652
- init,
1653
- clearDynamicImports: () => ctx.clearDynamicImports(),
1654
- modifyDynamicImports: (fn) => ctx.modifyDynamicImports(fn),
1655
- scanImportsFromDir,
1656
- scanImportsFromFile,
1657
- getImports: () => ctx.getImports(),
1658
- getImportMap: () => ctx.getImportMap(),
1659
- detectImports: (code) => detectImports(code, ctx),
1660
- injectImports: injectImportsWithContext,
1661
- generateTypeDeclarations: (options) => generateTypeDeclarations(options),
1662
- getMetadata: () => ctx.getMetadata(),
1663
- getInternalContext: () => ctx,
1664
- toExports: async (filepath, includeTypes = false) => toExports(await ctx.getImports(), filepath, includeTypes)
1665
- };
1666
- }
1667
- function createInternalContext(opts) {
1668
- let _combinedImports;
1669
- const _map = /* @__PURE__ */ new Map();
1670
- const addons = configureAddons(opts);
1671
- opts.addons = addons;
1672
- opts.commentsDisable = opts.commentsDisable ?? ["@unimport-disable", "@imports-disable"];
1673
- opts.commentsDebug = opts.commentsDebug ?? ["@unimport-debug", "@imports-debug"];
1674
- let metadata;
1675
- if (opts.collectMeta) metadata = { injectionUsage: {} };
1676
- let resolvePromise;
1677
- const ctx = {
1678
- version,
1679
- options: opts,
1680
- addons,
1681
- staticImports: [...opts.imports || []].filter(Boolean),
1682
- dynamicImports: [],
1683
- modifyDynamicImports,
1684
- clearDynamicImports,
1685
- async getImports() {
1686
- await resolvePromise;
1687
- return updateImports();
1688
- },
1689
- async replaceImports(imports) {
1690
- ctx.staticImports = [...imports || []].filter(Boolean);
1691
- ctx.invalidate();
1692
- await resolvePromise;
1693
- return updateImports();
1694
- },
1695
- async getImportMap() {
1696
- await ctx.getImports();
1697
- return _map;
1698
- },
1699
- getMetadata() {
1700
- return metadata;
1701
- },
1702
- invalidate() {
1703
- _combinedImports = void 0;
1704
- },
1705
- resolveId: (id, parentId) => opts.resolveId?.(id, parentId)
1706
- };
1707
- resolvePromise = resolveBuiltinPresets(opts.presets || []).then((r) => {
1708
- ctx.staticImports.unshift(...r);
1709
- _combinedImports = void 0;
1710
- updateImports();
1711
- });
1712
- function updateImports() {
1713
- if (!_combinedImports) {
1714
- let imports = normalizeImports(dedupeImports([...ctx.staticImports, ...ctx.dynamicImports], opts.warn || console.warn));
1715
- for (const addon of ctx.addons) if (addon.extendImports) imports = addon.extendImports.call(ctx, imports) ?? imports;
1716
- imports = imports.filter((i) => !i.disabled);
1717
- _map.clear();
1718
- for (const _import of imports) if (!_import.type) _map.set(_import.as ?? _import.name, _import);
1719
- _combinedImports = imports;
1720
- }
1721
- return _combinedImports;
1722
- }
1723
- async function modifyDynamicImports(fn) {
1724
- const result = await fn(ctx.dynamicImports);
1725
- if (Array.isArray(result)) ctx.dynamicImports = result;
1726
- ctx.invalidate();
1727
- }
1728
- function clearDynamicImports() {
1729
- ctx.dynamicImports.length = 0;
1730
- ctx.invalidate();
1731
- }
1732
- return ctx;
1733
- }
1734
- async function injectImports(code, id, ctx, options) {
1735
- const s = getMagicString(code);
1736
- if (ctx.options.commentsDisable?.some((c) => s.original.includes(c))) return {
1737
- s,
1738
- get code() {
1739
- return s.toString();
1740
- },
1741
- imports: []
1742
- };
1743
- for (const addon of ctx.addons) await addon.transform?.call(ctx, s, id);
1744
- const { isCJSContext, matchedImports, firstOccurrence } = await detectImports(s, ctx, options);
1745
- const imports = await resolveImports(ctx, matchedImports, id);
1746
- if (ctx.options.commentsDebug?.some((c) => s.original.includes(c))) (ctx.options.debugLog || console.log)(`[unimport] ${imports.length} imports detected in "${id}"${imports.length ? `: ${imports.map((i) => i.name).join(", ")}` : ""}`);
1747
- return {
1748
- ...addImportToCode(s, imports, isCJSContext, options?.mergeExisting, options?.injectAtEnd, firstOccurrence, (imports2) => {
1749
- for (const addon of ctx.addons) imports2 = addon.injectImportsResolved?.call(ctx, imports2, s, id) ?? imports2;
1750
- return imports2;
1751
- }, (str, imports2) => {
1752
- for (const addon of ctx.addons) str = addon.injectImportsStringified?.call(ctx, str, imports2, s, id) ?? str;
1753
- return str;
1754
- }),
1755
- imports
1756
- };
1757
- }
1758
- async function resolveImports(ctx, imports, id) {
1759
- const resolveCache = /* @__PURE__ */ new Map();
1760
- return (await Promise.all(imports.map(async (i) => {
1761
- if (!resolveCache.has(i.from)) resolveCache.set(i.from, await ctx.resolveId(i.from, id) || i.from);
1762
- const from = resolveCache.get(i.from);
1763
- if (i.from === id || !from || from === "." || from === id) return;
1764
- return {
1765
- ...i,
1766
- from
1767
- };
1768
- }))).filter(Boolean);
1769
- }
1770
-
1771
- //#endregion
1772
- //#region node_modules/.pnpm/unimport@5.6.0/node_modules/unimport/dist/index.mjs
1773
- var dist_exports = /* @__PURE__ */ __exportAll({ createUnimport: () => createUnimport });
1774
-
1775
- //#endregion
1776
16
  //#region node_modules/.pnpm/unimport@5.6.0/node_modules/unimport/dist/chunks/detect-acorn.mjs
1777
17
  var detect_acorn_exports = /* @__PURE__ */ __exportAll({
1778
18
  createVirtualImportsAcronWalker: () => createVirtualImportsAcronWalker,
@@ -1962,6 +202,1541 @@ function createVirtualImportsAcronWalker(importMap, virtualImports = []) {
1962
202
  };
1963
203
  }
1964
204
 
205
+ //#endregion
206
+ //#region node_modules/.pnpm/unplugin@2.3.11/node_modules/unplugin/dist/context-Csj9j3eN.js
207
+ var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
208
+ function toArray$2(array) {
209
+ array = array || [];
210
+ if (Array.isArray(array)) return array;
211
+ return [array];
212
+ }
213
+ const BACKSLASH_REGEX = /\\/g;
214
+ function normalize$1(path$1) {
215
+ return path$1.replace(BACKSLASH_REGEX, "/");
216
+ }
217
+ const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i;
218
+ function isAbsolute$1(path$1) {
219
+ return ABSOLUTE_PATH_REGEX.test(path$1);
220
+ }
221
+ function getMatcherString$1(glob, cwd$1) {
222
+ if (glob.startsWith("**") || isAbsolute$1(glob)) return normalize$1(glob);
223
+ return normalize$1(resolve(cwd$1, glob));
224
+ }
225
+ function patternToIdFilter(pattern) {
226
+ if (pattern instanceof RegExp) return (id) => {
227
+ const normalizedId = normalize$1(id);
228
+ const result = pattern.test(normalizedId);
229
+ pattern.lastIndex = 0;
230
+ return result;
231
+ };
232
+ const matcher = (0, import_picomatch.default)(getMatcherString$1(pattern, process.cwd()), { dot: true });
233
+ return (id) => {
234
+ return matcher(normalize$1(id));
235
+ };
236
+ }
237
+ function patternToCodeFilter(pattern) {
238
+ if (pattern instanceof RegExp) return (code) => {
239
+ const result = pattern.test(code);
240
+ pattern.lastIndex = 0;
241
+ return result;
242
+ };
243
+ return (code) => code.includes(pattern);
244
+ }
245
+ function createFilter$1(exclude, include) {
246
+ if (!exclude && !include) return;
247
+ return (input) => {
248
+ if (exclude?.some((filter) => filter(input))) return false;
249
+ if (include?.some((filter) => filter(input))) return true;
250
+ return !(include && include.length > 0);
251
+ };
252
+ }
253
+ function normalizeFilter(filter) {
254
+ if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] };
255
+ if (Array.isArray(filter)) return { include: filter };
256
+ return {
257
+ exclude: filter.exclude ? toArray$2(filter.exclude) : void 0,
258
+ include: filter.include ? toArray$2(filter.include) : void 0
259
+ };
260
+ }
261
+ function createIdFilter(filter) {
262
+ if (!filter) return;
263
+ const { exclude, include } = normalizeFilter(filter);
264
+ const excludeFilter = exclude?.map(patternToIdFilter);
265
+ const includeFilter = include?.map(patternToIdFilter);
266
+ return createFilter$1(excludeFilter, includeFilter);
267
+ }
268
+ function createCodeFilter(filter) {
269
+ if (!filter) return;
270
+ const { exclude, include } = normalizeFilter(filter);
271
+ const excludeFilter = exclude?.map(patternToCodeFilter);
272
+ const includeFilter = include?.map(patternToCodeFilter);
273
+ return createFilter$1(excludeFilter, includeFilter);
274
+ }
275
+ function createFilterForId(filter) {
276
+ const filterFunction = createIdFilter(filter);
277
+ return filterFunction ? (id) => !!filterFunction(id) : void 0;
278
+ }
279
+ function createFilterForTransform(idFilter, codeFilter) {
280
+ if (!idFilter && !codeFilter) return;
281
+ const idFilterFunction = createIdFilter(idFilter);
282
+ const codeFilterFunction = createCodeFilter(codeFilter);
283
+ return (id, code) => {
284
+ let fallback = true;
285
+ if (idFilterFunction) fallback &&= idFilterFunction(id);
286
+ if (!fallback) return false;
287
+ if (codeFilterFunction) fallback &&= codeFilterFunction(code);
288
+ return fallback;
289
+ };
290
+ }
291
+ function normalizeObjectHook(name, hook) {
292
+ let handler;
293
+ let filter;
294
+ if (typeof hook === "function") handler = hook;
295
+ else {
296
+ handler = hook.handler;
297
+ const hookFilter = hook.filter;
298
+ if (name === "resolveId" || name === "load") filter = createFilterForId(hookFilter?.id);
299
+ else filter = createFilterForTransform(hookFilter?.id, hookFilter?.code);
300
+ }
301
+ return {
302
+ handler,
303
+ filter: filter || (() => true)
304
+ };
305
+ }
306
+ function parse(code, opts = {}) {
307
+ return Parser.parse(code, {
308
+ sourceType: "module",
309
+ ecmaVersion: "latest",
310
+ locations: true,
311
+ ...opts
312
+ });
313
+ }
314
+
315
+ //#endregion
316
+ //#region node_modules/.pnpm/unplugin@2.3.11/node_modules/unplugin/dist/webpack-like-DFGTNSuV.js
317
+ function transformUse(data, plugin, transformLoader) {
318
+ if (data.resource == null) return [];
319
+ const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || ""));
320
+ if (plugin.transformInclude && !plugin.transformInclude(id)) return [];
321
+ const { filter } = normalizeObjectHook("load", plugin.transform);
322
+ if (!filter(id)) return [];
323
+ return [{
324
+ loader: transformLoader,
325
+ options: { plugin },
326
+ ident: plugin.name
327
+ }];
328
+ }
329
+ /**
330
+ * Normalizes a given path when it's absolute. Normalizing means returning a new path by converting
331
+ * the input path to the native os format. This is useful in cases where we want to normalize
332
+ * the `id` argument of a hook. Any absolute ids should be in the default format
333
+ * of the operating system. Any relative imports or node_module imports should remain
334
+ * untouched.
335
+ *
336
+ * @param path - Path to normalize.
337
+ * @returns a new normalized path.
338
+ */
339
+ function normalizeAbsolutePath(path$1) {
340
+ if (isAbsolute(path$1)) return normalize(path$1);
341
+ else return path$1;
342
+ }
343
+
344
+ //#endregion
345
+ //#region node_modules/.pnpm/unplugin@2.3.11/node_modules/unplugin/dist/context-DkYlx1xL.js
346
+ function createBuildContext$1(compiler, compilation, loaderContext, inputSourceMap) {
347
+ return {
348
+ getNativeBuildContext() {
349
+ return {
350
+ framework: "rspack",
351
+ compiler,
352
+ compilation,
353
+ loaderContext,
354
+ inputSourceMap
355
+ };
356
+ },
357
+ addWatchFile(file) {
358
+ const cwd$1 = process.cwd();
359
+ compilation.fileDependencies.add(resolve(cwd$1, file));
360
+ },
361
+ getWatchFiles() {
362
+ return Array.from(compilation.fileDependencies);
363
+ },
364
+ parse,
365
+ emitFile(emittedFile) {
366
+ const outFileName = emittedFile.fileName || emittedFile.name;
367
+ if (emittedFile.source && outFileName) {
368
+ const { sources } = compilation.compiler.webpack;
369
+ compilation.emitAsset(outFileName, new sources.RawSource(typeof emittedFile.source === "string" ? emittedFile.source : Buffer.from(emittedFile.source)));
370
+ }
371
+ }
372
+ };
373
+ }
374
+ function normalizeMessage$1(error) {
375
+ const err = new Error(typeof error === "string" ? error : error.message);
376
+ if (typeof error === "object") {
377
+ err.stack = error.stack;
378
+ err.cause = error.meta;
379
+ }
380
+ return err;
381
+ }
382
+
383
+ //#endregion
384
+ //#region node_modules/.pnpm/unplugin@2.3.11/node_modules/unplugin/dist/utils-BosfZ0pB.js
385
+ function encodeVirtualModuleId(id, plugin) {
386
+ return resolve(plugin.__virtualModulePrefix, encodeURIComponent(id));
387
+ }
388
+ function decodeVirtualModuleId(encoded, _plugin) {
389
+ return decodeURIComponent(basename(encoded));
390
+ }
391
+ function isVirtualModuleId(encoded, plugin) {
392
+ return dirname(encoded) === plugin.__virtualModulePrefix;
393
+ }
394
+ var FakeVirtualModulesPlugin = class FakeVirtualModulesPlugin$1 {
395
+ name = "FakeVirtualModulesPlugin";
396
+ static counters = /* @__PURE__ */ new Map();
397
+ static initCleanup = false;
398
+ constructor(plugin) {
399
+ this.plugin = plugin;
400
+ if (!FakeVirtualModulesPlugin$1.initCleanup) {
401
+ FakeVirtualModulesPlugin$1.initCleanup = true;
402
+ process.once("exit", () => {
403
+ FakeVirtualModulesPlugin$1.counters.forEach((_, dir) => {
404
+ fs.rmSync(dir, {
405
+ recursive: true,
406
+ force: true
407
+ });
408
+ });
409
+ });
410
+ }
411
+ }
412
+ apply(compiler) {
413
+ const dir = this.plugin.__virtualModulePrefix;
414
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
415
+ const counter = FakeVirtualModulesPlugin$1.counters.get(dir) ?? 0;
416
+ FakeVirtualModulesPlugin$1.counters.set(dir, counter + 1);
417
+ compiler.hooks.shutdown.tap(this.name, () => {
418
+ const counter$1 = (FakeVirtualModulesPlugin$1.counters.get(dir) ?? 1) - 1;
419
+ if (counter$1 === 0) {
420
+ FakeVirtualModulesPlugin$1.counters.delete(dir);
421
+ fs.rmSync(dir, {
422
+ recursive: true,
423
+ force: true
424
+ });
425
+ } else FakeVirtualModulesPlugin$1.counters.set(dir, counter$1);
426
+ });
427
+ }
428
+ async writeModule(file) {
429
+ return fs.promises.writeFile(file, "");
430
+ }
431
+ };
432
+
433
+ //#endregion
434
+ //#region node_modules/.pnpm/unplugin@2.3.11/node_modules/unplugin/dist/context-OCFO8EW1.js
435
+ function contextOptionsFromCompilation(compilation) {
436
+ return {
437
+ addWatchFile(file) {
438
+ (compilation.fileDependencies ?? compilation.compilationDependencies).add(file);
439
+ },
440
+ getWatchFiles() {
441
+ return Array.from(compilation.fileDependencies ?? compilation.compilationDependencies);
442
+ }
443
+ };
444
+ }
445
+ const require$1 = createRequire(import.meta.url);
446
+ function getSource(fileSource) {
447
+ return new (require$1("webpack")).sources.RawSource(typeof fileSource === "string" ? fileSource : Buffer.from(fileSource.buffer));
448
+ }
449
+ function createBuildContext(options, compiler, compilation, loaderContext, inputSourceMap) {
450
+ return {
451
+ parse,
452
+ addWatchFile(id) {
453
+ options.addWatchFile(resolve(process$1.cwd(), id));
454
+ },
455
+ emitFile(emittedFile) {
456
+ const outFileName = emittedFile.fileName || emittedFile.name;
457
+ if (emittedFile.source && outFileName) {
458
+ if (!compilation) throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)");
459
+ compilation.emitAsset(outFileName, getSource(emittedFile.source));
460
+ }
461
+ },
462
+ getWatchFiles() {
463
+ return options.getWatchFiles();
464
+ },
465
+ getNativeBuildContext() {
466
+ return {
467
+ framework: "webpack",
468
+ compiler,
469
+ compilation,
470
+ loaderContext,
471
+ inputSourceMap
472
+ };
473
+ }
474
+ };
475
+ }
476
+ function normalizeMessage(error) {
477
+ const err = new Error(typeof error === "string" ? error : error.message);
478
+ if (typeof error === "object") {
479
+ err.stack = error.stack;
480
+ err.cause = error.meta;
481
+ }
482
+ return err;
483
+ }
484
+
485
+ //#endregion
486
+ //#region node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/virtual-stats.js
487
+ var require_virtual_stats = /* @__PURE__ */ __commonJSMin(((exports) => {
488
+ var __importDefault = exports && exports.__importDefault || function(mod) {
489
+ return mod && mod.__esModule ? mod : { "default": mod };
490
+ };
491
+ Object.defineProperty(exports, "__esModule", { value: true });
492
+ exports.VirtualStats = void 0;
493
+ const constants_1 = __importDefault(__require("constants"));
494
+ var VirtualStats = class {
495
+ constructor(config) {
496
+ for (const key in config) {
497
+ if (!Object.prototype.hasOwnProperty.call(config, key)) continue;
498
+ this[key] = config[key];
499
+ }
500
+ }
501
+ _checkModeProperty(property) {
502
+ return (this.mode & constants_1.default.S_IFMT) === property;
503
+ }
504
+ isDirectory() {
505
+ return this._checkModeProperty(constants_1.default.S_IFDIR);
506
+ }
507
+ isFile() {
508
+ return this._checkModeProperty(constants_1.default.S_IFREG);
509
+ }
510
+ isBlockDevice() {
511
+ return this._checkModeProperty(constants_1.default.S_IFBLK);
512
+ }
513
+ isCharacterDevice() {
514
+ return this._checkModeProperty(constants_1.default.S_IFCHR);
515
+ }
516
+ isSymbolicLink() {
517
+ return this._checkModeProperty(constants_1.default.S_IFLNK);
518
+ }
519
+ isFIFO() {
520
+ return this._checkModeProperty(constants_1.default.S_IFIFO);
521
+ }
522
+ isSocket() {
523
+ return this._checkModeProperty(constants_1.default.S_IFSOCK);
524
+ }
525
+ };
526
+ exports.VirtualStats = VirtualStats;
527
+ }));
528
+
529
+ //#endregion
530
+ //#region node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.js
531
+ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
532
+ const path_1 = (exports && exports.__importDefault || function(mod) {
533
+ return mod && mod.__esModule ? mod : { "default": mod };
534
+ })(__require("path"));
535
+ const virtual_stats_1 = require_virtual_stats();
536
+ let inode = 45e6;
537
+ const ALL = "all";
538
+ const STATIC = "static";
539
+ const DYNAMIC = "dynamic";
540
+ function checkActivation(instance) {
541
+ if (!instance._compiler) throw new Error("You must use this plugin only after creating webpack instance!");
542
+ }
543
+ function getModulePath(filePath, compiler) {
544
+ return path_1.default.isAbsolute(filePath) ? filePath : path_1.default.join(compiler.context, filePath);
545
+ }
546
+ function createWebpackData(result) {
547
+ return (backendOrStorage) => {
548
+ if (backendOrStorage._data) {
549
+ const curLevelIdx = backendOrStorage._currentLevel;
550
+ return {
551
+ result,
552
+ level: backendOrStorage._levels[curLevelIdx]
553
+ };
554
+ }
555
+ return [null, result];
556
+ };
557
+ }
558
+ function getData(storage, key) {
559
+ if (storage._data instanceof Map) return storage._data.get(key);
560
+ else if (storage._data) return storage.data[key];
561
+ else if (storage.data instanceof Map) return storage.data.get(key);
562
+ else return storage.data[key];
563
+ }
564
+ function setData(backendOrStorage, key, valueFactory) {
565
+ const value = valueFactory(backendOrStorage);
566
+ if (backendOrStorage._data instanceof Map) backendOrStorage._data.set(key, value);
567
+ else if (backendOrStorage._data) backendOrStorage.data[key] = value;
568
+ else if (backendOrStorage.data instanceof Map) backendOrStorage.data.set(key, value);
569
+ else backendOrStorage.data[key] = value;
570
+ }
571
+ function getStatStorage(fileSystem) {
572
+ if (fileSystem._statStorage) return fileSystem._statStorage;
573
+ else if (fileSystem._statBackend) return fileSystem._statBackend;
574
+ else throw new Error("Couldn't find a stat storage");
575
+ }
576
+ function getFileStorage(fileSystem) {
577
+ if (fileSystem._readFileStorage) return fileSystem._readFileStorage;
578
+ else if (fileSystem._readFileBackend) return fileSystem._readFileBackend;
579
+ else throw new Error("Couldn't find a readFileStorage");
580
+ }
581
+ function getReadDirBackend(fileSystem) {
582
+ if (fileSystem._readdirBackend) return fileSystem._readdirBackend;
583
+ else if (fileSystem._readdirStorage) return fileSystem._readdirStorage;
584
+ else throw new Error("Couldn't find a readDirStorage from Webpack Internals");
585
+ }
586
+ function getRealpathBackend(fileSystem) {
587
+ if (fileSystem._realpathBackend) return fileSystem._realpathBackend;
588
+ }
589
+ var VirtualModulesPlugin = class {
590
+ constructor(modules) {
591
+ this._compiler = null;
592
+ this._watcher = null;
593
+ this._staticModules = modules || null;
594
+ }
595
+ getModuleList(filter = ALL) {
596
+ var _a, _b;
597
+ let modules = {};
598
+ const shouldGetStaticModules = filter === ALL || filter === STATIC;
599
+ const shouldGetDynamicModules = filter === ALL || filter === DYNAMIC;
600
+ if (shouldGetStaticModules) modules = Object.assign(Object.assign({}, modules), this._staticModules);
601
+ if (shouldGetDynamicModules) {
602
+ const finalInputFileSystem = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.inputFileSystem;
603
+ const virtualFiles = (_b = finalInputFileSystem === null || finalInputFileSystem === void 0 ? void 0 : finalInputFileSystem._virtualFiles) !== null && _b !== void 0 ? _b : {};
604
+ const dynamicModules = {};
605
+ Object.keys(virtualFiles).forEach((key) => {
606
+ dynamicModules[key] = virtualFiles[key].contents;
607
+ });
608
+ modules = Object.assign(Object.assign({}, modules), dynamicModules);
609
+ }
610
+ return modules;
611
+ }
612
+ writeModule(filePath, contents) {
613
+ if (!this._compiler) throw new Error(`Plugin has not been initialized`);
614
+ checkActivation(this);
615
+ const len = contents ? contents.length : 0;
616
+ const time = Date.now();
617
+ const date = new Date(time);
618
+ const stats = new virtual_stats_1.VirtualStats({
619
+ dev: 8675309,
620
+ nlink: 0,
621
+ uid: 1e3,
622
+ gid: 1e3,
623
+ rdev: 0,
624
+ blksize: 4096,
625
+ ino: inode++,
626
+ mode: 33188,
627
+ size: len,
628
+ blocks: Math.floor(len / 4096),
629
+ atime: date,
630
+ mtime: date,
631
+ ctime: date,
632
+ birthtime: date
633
+ });
634
+ const modulePath = getModulePath(filePath, this._compiler);
635
+ if (process.env.WVM_DEBUG) console.log(this._compiler.name, "Write virtual module:", modulePath, contents);
636
+ let finalWatchFileSystem = this._watcher && this._watcher.watchFileSystem;
637
+ while (finalWatchFileSystem && finalWatchFileSystem.wfs) finalWatchFileSystem = finalWatchFileSystem.wfs;
638
+ let finalInputFileSystem = this._compiler.inputFileSystem;
639
+ while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) finalInputFileSystem = finalInputFileSystem._inputFileSystem;
640
+ finalInputFileSystem._writeVirtualFile(modulePath, stats, contents);
641
+ if (finalWatchFileSystem && finalWatchFileSystem.watcher && (finalWatchFileSystem.watcher.fileWatchers.size || finalWatchFileSystem.watcher.fileWatchers.length)) {
642
+ const fileWatchers = finalWatchFileSystem.watcher.fileWatchers instanceof Map ? Array.from(finalWatchFileSystem.watcher.fileWatchers.values()) : finalWatchFileSystem.watcher.fileWatchers;
643
+ for (let fileWatcher of fileWatchers) {
644
+ if ("watcher" in fileWatcher) fileWatcher = fileWatcher.watcher;
645
+ if (fileWatcher.path === modulePath) {
646
+ if (process.env.DEBUG) console.log(this._compiler.name, "Emit file change:", modulePath, time);
647
+ delete fileWatcher.directoryWatcher._cachedTimeInfoEntries;
648
+ fileWatcher.emit("change", time, null);
649
+ }
650
+ }
651
+ }
652
+ }
653
+ apply(compiler) {
654
+ this._compiler = compiler;
655
+ const afterEnvironmentHook = () => {
656
+ let finalInputFileSystem = compiler.inputFileSystem;
657
+ while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) finalInputFileSystem = finalInputFileSystem._inputFileSystem;
658
+ if (!finalInputFileSystem._writeVirtualFile) {
659
+ const originalPurge = finalInputFileSystem.purge;
660
+ finalInputFileSystem.purge = () => {
661
+ originalPurge.apply(finalInputFileSystem, []);
662
+ if (finalInputFileSystem._virtualFiles) Object.keys(finalInputFileSystem._virtualFiles).forEach((file) => {
663
+ const data = finalInputFileSystem._virtualFiles[file];
664
+ finalInputFileSystem._writeVirtualFile(file, data.stats, data.contents);
665
+ });
666
+ };
667
+ finalInputFileSystem._writeVirtualFile = (file, stats, contents) => {
668
+ const statStorage = getStatStorage(finalInputFileSystem);
669
+ const fileStorage = getFileStorage(finalInputFileSystem);
670
+ const readDirStorage = getReadDirBackend(finalInputFileSystem);
671
+ const realPathStorage = getRealpathBackend(finalInputFileSystem);
672
+ finalInputFileSystem._virtualFiles = finalInputFileSystem._virtualFiles || {};
673
+ finalInputFileSystem._virtualFiles[file] = {
674
+ stats,
675
+ contents
676
+ };
677
+ setData(statStorage, file, createWebpackData(stats));
678
+ setData(fileStorage, file, createWebpackData(contents));
679
+ const segments = file.split(/[\\/]/);
680
+ let count = segments.length - 1;
681
+ const minCount = segments[0] ? 1 : 0;
682
+ while (count > minCount) {
683
+ const dir = segments.slice(0, count).join(path_1.default.sep) || path_1.default.sep;
684
+ try {
685
+ finalInputFileSystem.readdirSync(dir);
686
+ } catch (e) {
687
+ const time = Date.now();
688
+ const dirStats = new virtual_stats_1.VirtualStats({
689
+ dev: 8675309,
690
+ nlink: 0,
691
+ uid: 1e3,
692
+ gid: 1e3,
693
+ rdev: 0,
694
+ blksize: 4096,
695
+ ino: inode++,
696
+ mode: 16877,
697
+ size: stats.size,
698
+ blocks: Math.floor(stats.size / 4096),
699
+ atime: time,
700
+ mtime: time,
701
+ ctime: time,
702
+ birthtime: time
703
+ });
704
+ setData(readDirStorage, dir, createWebpackData([]));
705
+ if (realPathStorage) setData(realPathStorage, dir, createWebpackData(dir));
706
+ setData(statStorage, dir, createWebpackData(dirStats));
707
+ }
708
+ let dirData = getData(getReadDirBackend(finalInputFileSystem), dir);
709
+ dirData = dirData[1] || dirData.result;
710
+ const filename = segments[count];
711
+ if (dirData.indexOf(filename) < 0) {
712
+ const files = dirData.concat([filename]).sort();
713
+ setData(getReadDirBackend(finalInputFileSystem), dir, createWebpackData(files));
714
+ } else break;
715
+ count--;
716
+ }
717
+ };
718
+ }
719
+ };
720
+ const afterResolversHook = () => {
721
+ if (this._staticModules) {
722
+ for (const [filePath, contents] of Object.entries(this._staticModules)) this.writeModule(filePath, contents);
723
+ this._staticModules = null;
724
+ }
725
+ };
726
+ const version = typeof compiler.webpack === "undefined" ? 4 : 5;
727
+ const watchRunHook = (watcher, callback) => {
728
+ this._watcher = watcher.compiler || watcher;
729
+ const virtualFiles = compiler.inputFileSystem._virtualFiles;
730
+ const fts = compiler.fileTimestamps;
731
+ if (virtualFiles && fts && typeof fts.set === "function") Object.keys(virtualFiles).forEach((file) => {
732
+ const mtime = +virtualFiles[file].stats.mtime;
733
+ fts.set(file, version === 4 ? mtime : {
734
+ safeTime: mtime,
735
+ timestamp: mtime
736
+ });
737
+ });
738
+ callback();
739
+ };
740
+ if (compiler.hooks) {
741
+ compiler.hooks.afterEnvironment.tap("VirtualModulesPlugin", afterEnvironmentHook);
742
+ compiler.hooks.afterResolvers.tap("VirtualModulesPlugin", afterResolversHook);
743
+ compiler.hooks.watchRun.tapAsync("VirtualModulesPlugin", watchRunHook);
744
+ } else {
745
+ compiler.plugin("after-environment", afterEnvironmentHook);
746
+ compiler.plugin("after-resolvers", afterResolversHook);
747
+ compiler.plugin("watch-run", watchRunHook);
748
+ }
749
+ }
750
+ };
751
+ module.exports = VirtualModulesPlugin;
752
+ }));
753
+
754
+ //#endregion
755
+ //#region node_modules/.pnpm/unplugin@2.3.11/node_modules/unplugin/dist/index.js
756
+ var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
757
+ const ExtToLoader = {
758
+ ".js": "js",
759
+ ".mjs": "js",
760
+ ".cjs": "js",
761
+ ".jsx": "jsx",
762
+ ".ts": "ts",
763
+ ".cts": "ts",
764
+ ".mts": "ts",
765
+ ".tsx": "tsx",
766
+ ".css": "css",
767
+ ".less": "css",
768
+ ".stylus": "css",
769
+ ".scss": "css",
770
+ ".sass": "css",
771
+ ".json": "json",
772
+ ".txt": "text"
773
+ };
774
+ function guessLoader(code, id) {
775
+ return ExtToLoader[path.extname(id).toLowerCase()] || "js";
776
+ }
777
+ function unwrapLoader(loader, code, id) {
778
+ if (typeof loader === "function") return loader(code, id);
779
+ return loader;
780
+ }
781
+ function fixSourceMap(map) {
782
+ if (!Object.prototype.hasOwnProperty.call(map, "toString")) Object.defineProperty(map, "toString", {
783
+ enumerable: false,
784
+ value: function toString() {
785
+ return JSON.stringify(this);
786
+ }
787
+ });
788
+ if (!Object.prototype.hasOwnProperty.call(map, "toUrl")) Object.defineProperty(map, "toUrl", {
789
+ enumerable: false,
790
+ value: function toUrl() {
791
+ return `data:application/json;charset=utf-8;base64,${Buffer.from(this.toString()).toString("base64")}`;
792
+ }
793
+ });
794
+ return map;
795
+ }
796
+ const nullSourceMap = {
797
+ names: [],
798
+ sources: [],
799
+ mappings: "",
800
+ version: 3
801
+ };
802
+ function combineSourcemaps(filename, sourcemapList) {
803
+ sourcemapList = sourcemapList.filter((m) => m.sources);
804
+ if (sourcemapList.length === 0 || sourcemapList.every((m) => m.sources.length === 0)) return { ...nullSourceMap };
805
+ let map;
806
+ let mapIndex = 1;
807
+ if (sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === void 0) map = remapping(sourcemapList, () => null, true);
808
+ else map = remapping(sourcemapList[0], (sourcefile) => {
809
+ if (sourcefile === filename && sourcemapList[mapIndex]) return sourcemapList[mapIndex++];
810
+ else return { ...nullSourceMap };
811
+ }, true);
812
+ if (!map.file) delete map.file;
813
+ return map;
814
+ }
815
+ function createBuildContext$2(build) {
816
+ const watchFiles = [];
817
+ const { initialOptions } = build;
818
+ return {
819
+ parse,
820
+ addWatchFile() {
821
+ throw new Error("unplugin/esbuild: addWatchFile outside supported hooks (resolveId, load, transform)");
822
+ },
823
+ emitFile(emittedFile) {
824
+ const outFileName = emittedFile.fileName || emittedFile.name;
825
+ if (initialOptions.outdir && emittedFile.source && outFileName) {
826
+ const outPath = path.resolve(initialOptions.outdir, outFileName);
827
+ const outDir = path.dirname(outPath);
828
+ if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });
829
+ fs.writeFileSync(outPath, emittedFile.source);
830
+ }
831
+ },
832
+ getWatchFiles() {
833
+ return watchFiles;
834
+ },
835
+ getNativeBuildContext() {
836
+ return {
837
+ framework: "esbuild",
838
+ build
839
+ };
840
+ }
841
+ };
842
+ }
843
+ function createPluginContext(context) {
844
+ const errors = [];
845
+ const warnings = [];
846
+ const pluginContext = {
847
+ error(message) {
848
+ errors.push(normalizeMessage$2(message));
849
+ },
850
+ warn(message) {
851
+ warnings.push(normalizeMessage$2(message));
852
+ }
853
+ };
854
+ return {
855
+ errors,
856
+ warnings,
857
+ mixedContext: {
858
+ ...context,
859
+ ...pluginContext,
860
+ addWatchFile(id) {
861
+ context.getWatchFiles().push(id);
862
+ }
863
+ }
864
+ };
865
+ }
866
+ function normalizeMessage$2(message) {
867
+ if (typeof message === "string") message = { message };
868
+ return {
869
+ id: message.id,
870
+ pluginName: message.plugin,
871
+ text: message.message,
872
+ location: message.loc ? {
873
+ file: message.loc.file,
874
+ line: message.loc.line,
875
+ column: message.loc.column
876
+ } : null,
877
+ detail: message.meta,
878
+ notes: []
879
+ };
880
+ }
881
+ function processCodeWithSourceMap(map, code) {
882
+ if (map) {
883
+ if (!map.sourcesContent || map.sourcesContent.length === 0) map.sourcesContent = [code];
884
+ map = fixSourceMap(map);
885
+ code += `\n//# sourceMappingURL=${map.toUrl()}`;
886
+ }
887
+ return code;
888
+ }
889
+ function getEsbuildPlugin(factory) {
890
+ return (userOptions) => {
891
+ const meta = { framework: "esbuild" };
892
+ const plugins = toArray$2(factory(userOptions, meta));
893
+ const setupPlugins = async (build) => {
894
+ const setup = buildSetup();
895
+ const loaders = [];
896
+ for (const plugin of plugins) {
897
+ const loader = {};
898
+ await setup(plugin)({
899
+ ...build,
900
+ onLoad(_options, callback) {
901
+ loader.options = _options;
902
+ loader.onLoadCb = callback;
903
+ },
904
+ onTransform(_options, callback) {
905
+ loader.options ||= _options;
906
+ loader.onTransformCb = callback;
907
+ }
908
+ }, build);
909
+ if (loader.onLoadCb || loader.onTransformCb) loaders.push(loader);
910
+ }
911
+ if (loaders.length) build.onLoad(loaders.length === 1 ? loaders[0].options : { filter: /.*/ }, async (args) => {
912
+ function checkFilter(options) {
913
+ return loaders.length === 1 || !options?.filter || options.filter.test(args.path);
914
+ }
915
+ let result;
916
+ for (const { options, onLoadCb } of loaders) {
917
+ if (!checkFilter(options)) continue;
918
+ if (onLoadCb) result = await onLoadCb(args);
919
+ if (result?.contents) break;
920
+ }
921
+ let fsContentsCache;
922
+ for (const { options, onTransformCb } of loaders) {
923
+ if (!checkFilter(options)) continue;
924
+ if (onTransformCb) {
925
+ const _result = await onTransformCb({
926
+ ...result,
927
+ ...args,
928
+ async getContents() {
929
+ if (result?.contents) return result.contents;
930
+ if (fsContentsCache) return fsContentsCache;
931
+ return fsContentsCache = await fs.promises.readFile(args.path, "utf8");
932
+ }
933
+ });
934
+ if (_result?.contents) result = _result;
935
+ }
936
+ }
937
+ if (result?.contents) return result;
938
+ });
939
+ };
940
+ return {
941
+ name: (plugins.length === 1 ? plugins[0].name : meta.esbuildHostName) ?? `unplugin-host:${plugins.map((p) => p.name).join(":")}`,
942
+ setup: setupPlugins
943
+ };
944
+ };
945
+ }
946
+ function buildSetup() {
947
+ return (plugin) => {
948
+ return (build, rawBuild) => {
949
+ const context = createBuildContext$2(rawBuild);
950
+ const { onStart, onEnd, onResolve, onLoad, onTransform, initialOptions } = build;
951
+ const onResolveFilter = plugin.esbuild?.onResolveFilter ?? /.*/;
952
+ const onLoadFilter = plugin.esbuild?.onLoadFilter ?? /.*/;
953
+ const loader = plugin.esbuild?.loader ?? guessLoader;
954
+ plugin.esbuild?.config?.call(context, initialOptions);
955
+ if (plugin.buildStart) onStart(() => plugin.buildStart.call(context));
956
+ if (plugin.buildEnd || plugin.writeBundle) onEnd(async () => {
957
+ if (plugin.buildEnd) await plugin.buildEnd.call(context);
958
+ if (plugin.writeBundle) await plugin.writeBundle();
959
+ });
960
+ if (plugin.resolveId) onResolve({ filter: onResolveFilter }, async (args) => {
961
+ const id = args.path;
962
+ if (initialOptions.external?.includes(id)) return;
963
+ const { handler, filter } = normalizeObjectHook("resolveId", plugin.resolveId);
964
+ if (!filter(id)) return;
965
+ const { errors, warnings, mixedContext } = createPluginContext(context);
966
+ const isEntry = args.kind === "entry-point";
967
+ const result = await handler.call(mixedContext, id, isEntry ? void 0 : args.importer, { isEntry });
968
+ if (typeof result === "string") return {
969
+ path: result,
970
+ namespace: plugin.name,
971
+ errors,
972
+ warnings,
973
+ watchFiles: mixedContext.getWatchFiles()
974
+ };
975
+ else if (typeof result === "object" && result !== null) return {
976
+ path: result.id,
977
+ external: result.external,
978
+ namespace: plugin.name,
979
+ errors,
980
+ warnings,
981
+ watchFiles: mixedContext.getWatchFiles()
982
+ };
983
+ });
984
+ if (plugin.load) onLoad({ filter: onLoadFilter }, async (args) => {
985
+ const { handler, filter } = normalizeObjectHook("load", plugin.load);
986
+ const id = args.path + (args.suffix || "");
987
+ if (plugin.loadInclude && !plugin.loadInclude(id)) return;
988
+ if (!filter(id)) return;
989
+ const { errors, warnings, mixedContext } = createPluginContext(context);
990
+ let code;
991
+ let map;
992
+ const result = await handler.call(mixedContext, id);
993
+ if (typeof result === "string") code = result;
994
+ else if (typeof result === "object" && result !== null) {
995
+ code = result.code;
996
+ map = result.map;
997
+ }
998
+ if (code === void 0) return null;
999
+ if (map) code = processCodeWithSourceMap(map, code);
1000
+ const resolveDir = path.dirname(args.path);
1001
+ return {
1002
+ contents: code,
1003
+ errors,
1004
+ warnings,
1005
+ watchFiles: mixedContext.getWatchFiles(),
1006
+ loader: unwrapLoader(loader, code, args.path),
1007
+ resolveDir
1008
+ };
1009
+ });
1010
+ if (plugin.transform) onTransform({ filter: onLoadFilter }, async (args) => {
1011
+ const { handler, filter } = normalizeObjectHook("transform", plugin.transform);
1012
+ const id = args.path + (args.suffix || "");
1013
+ if (plugin.transformInclude && !plugin.transformInclude(id)) return;
1014
+ let code = await args.getContents();
1015
+ if (!filter(id, code)) return;
1016
+ const { mixedContext, errors, warnings } = createPluginContext(context);
1017
+ const resolveDir = path.dirname(args.path);
1018
+ let map;
1019
+ const result = await handler.call(mixedContext, code, id);
1020
+ if (typeof result === "string") code = result;
1021
+ else if (typeof result === "object" && result !== null) {
1022
+ code = result.code;
1023
+ if (map && result.map) map = combineSourcemaps(args.path, [result.map === "string" ? JSON.parse(result.map) : result.map, map]);
1024
+ else if (typeof result.map === "string") map = JSON.parse(result.map);
1025
+ else map = result.map;
1026
+ }
1027
+ if (code) {
1028
+ if (map) code = processCodeWithSourceMap(map, code);
1029
+ return {
1030
+ contents: code,
1031
+ errors,
1032
+ warnings,
1033
+ watchFiles: mixedContext.getWatchFiles(),
1034
+ loader: unwrapLoader(loader, code, args.path),
1035
+ resolveDir
1036
+ };
1037
+ }
1038
+ });
1039
+ if (plugin.esbuild?.setup) return plugin.esbuild.setup(rawBuild);
1040
+ };
1041
+ };
1042
+ }
1043
+ function createFarmContext(context, currentResolveId) {
1044
+ return {
1045
+ parse,
1046
+ addWatchFile(id) {
1047
+ context.addWatchFile(id, currentResolveId || id);
1048
+ },
1049
+ emitFile(emittedFile) {
1050
+ const outFileName = emittedFile.fileName || emittedFile.name;
1051
+ if (emittedFile.source && outFileName) context.emitFile({
1052
+ resolvedPath: outFileName,
1053
+ name: outFileName,
1054
+ content: [...Buffer.from(emittedFile.source)],
1055
+ resourceType: extname(outFileName)
1056
+ });
1057
+ },
1058
+ getWatchFiles() {
1059
+ return context.getWatchFiles();
1060
+ },
1061
+ getNativeBuildContext() {
1062
+ return {
1063
+ framework: "farm",
1064
+ context
1065
+ };
1066
+ }
1067
+ };
1068
+ }
1069
+ function unpluginContext(context) {
1070
+ return {
1071
+ error: (error) => context.error(typeof error === "string" ? new Error(error) : error),
1072
+ warn: (error) => context.warn(typeof error === "string" ? new Error(error) : error)
1073
+ };
1074
+ }
1075
+ function convertEnforceToPriority(value) {
1076
+ const defaultPriority = 100;
1077
+ const enforceToPriority = {
1078
+ pre: 102,
1079
+ post: 98
1080
+ };
1081
+ return enforceToPriority[value] !== void 0 ? enforceToPriority[value] : defaultPriority;
1082
+ }
1083
+ function convertWatchEventChange(value) {
1084
+ return {
1085
+ Added: "create",
1086
+ Updated: "update",
1087
+ Removed: "delete"
1088
+ }[value];
1089
+ }
1090
+ function isString(variable) {
1091
+ return typeof variable === "string";
1092
+ }
1093
+ function isObject(variable) {
1094
+ return typeof variable === "object" && variable !== null;
1095
+ }
1096
+ function customParseQueryString(url) {
1097
+ if (!url) return [];
1098
+ const queryString = url.split("?")[1];
1099
+ const parsedParams = querystring.parse(queryString);
1100
+ const paramsArray = [];
1101
+ for (const key in parsedParams) paramsArray.push([key, parsedParams[key]]);
1102
+ return paramsArray;
1103
+ }
1104
+ function encodeStr(str) {
1105
+ const len = str.length;
1106
+ if (len === 0) return str;
1107
+ const firstNullIndex = str.indexOf("\0");
1108
+ if (firstNullIndex === -1) return str;
1109
+ const result = Array.from({ length: len + countNulls(str, firstNullIndex) });
1110
+ let pos = 0;
1111
+ for (let i = 0; i < firstNullIndex; i++) result[pos++] = str[i];
1112
+ for (let i = firstNullIndex; i < len; i++) {
1113
+ const char = str[i];
1114
+ if (char === "\0") {
1115
+ result[pos++] = "\\";
1116
+ result[pos++] = "0";
1117
+ } else result[pos++] = char;
1118
+ }
1119
+ return path.posix.normalize(result.join(""));
1120
+ }
1121
+ function decodeStr(str) {
1122
+ const len = str.length;
1123
+ if (len === 0) return str;
1124
+ const firstIndex = str.indexOf("\\0");
1125
+ if (firstIndex === -1) return str;
1126
+ const result = Array.from({ length: len - countBackslashZeros(str, firstIndex) });
1127
+ let pos = 0;
1128
+ for (let i$1 = 0; i$1 < firstIndex; i$1++) result[pos++] = str[i$1];
1129
+ let i = firstIndex;
1130
+ while (i < len) if (str[i] === "\\" && str[i + 1] === "0") {
1131
+ result[pos++] = "\0";
1132
+ i += 2;
1133
+ } else result[pos++] = str[i++];
1134
+ return path.posix.normalize(result.join(""));
1135
+ }
1136
+ function getContentValue(content) {
1137
+ if (content === null || content === void 0) throw new Error("Content cannot be null or undefined");
1138
+ return encodeStr(typeof content === "string" ? content : content.code || "");
1139
+ }
1140
+ function countNulls(str, startIndex) {
1141
+ let count = 0;
1142
+ const len = str.length;
1143
+ for (let i = startIndex; i < len; i++) if (str[i] === "\0") count++;
1144
+ return count;
1145
+ }
1146
+ function countBackslashZeros(str, startIndex) {
1147
+ let count = 0;
1148
+ const len = str.length;
1149
+ for (let i = startIndex; i < len - 1; i++) if (str[i] === "\\" && str[i + 1] === "0") {
1150
+ count++;
1151
+ i++;
1152
+ }
1153
+ return count;
1154
+ }
1155
+ function removeQuery(pathe) {
1156
+ const queryIndex = pathe.indexOf("?");
1157
+ if (queryIndex !== -1) return path.posix.normalize(pathe.slice(0, queryIndex));
1158
+ return path.posix.normalize(pathe);
1159
+ }
1160
+ function isStartsWithSlash(str) {
1161
+ return str?.startsWith("/");
1162
+ }
1163
+ function appendQuery(id, query) {
1164
+ if (!query.length) return id;
1165
+ return `${id}?${stringifyQuery(query)}`;
1166
+ }
1167
+ function stringifyQuery(query) {
1168
+ if (!query.length) return "";
1169
+ let queryStr = "";
1170
+ for (const [key, value] of query) queryStr += `${key}${value ? `=${value}` : ""}&`;
1171
+ return `${queryStr.slice(0, -1)}`;
1172
+ }
1173
+ const CSS_LANGS_RES = [
1174
+ [/\.(less)(?:$|\?)/, "less"],
1175
+ [/\.(scss|sass)(?:$|\?)/, "sass"],
1176
+ [/\.(styl|stylus)(?:$|\?)/, "stylus"],
1177
+ [/\.(css)(?:$|\?)/, "css"]
1178
+ ];
1179
+ const JS_LANGS_RES = [
1180
+ [/\.(js|mjs|cjs)(?:$|\?)/, "js"],
1181
+ [/\.(jsx)(?:$|\?)/, "jsx"],
1182
+ [/\.(ts|cts|mts)(?:$|\?)/, "ts"],
1183
+ [/\.(tsx)(?:$|\?)/, "tsx"]
1184
+ ];
1185
+ function getCssModuleType(id) {
1186
+ for (const [reg, lang] of CSS_LANGS_RES) if (reg.test(id)) return lang;
1187
+ return null;
1188
+ }
1189
+ function getJsModuleType(id) {
1190
+ for (const [reg, lang] of JS_LANGS_RES) if (reg.test(id)) return lang;
1191
+ return null;
1192
+ }
1193
+ function formatLoadModuleType(id) {
1194
+ const cssModuleType = getCssModuleType(id);
1195
+ if (cssModuleType) return cssModuleType;
1196
+ const jsModuleType = getJsModuleType(id);
1197
+ if (jsModuleType) return jsModuleType;
1198
+ return "js";
1199
+ }
1200
+ function formatTransformModuleType(id) {
1201
+ return formatLoadModuleType(id);
1202
+ }
1203
+ function getFarmPlugin(factory) {
1204
+ return ((userOptions) => {
1205
+ const plugins = toArray$2(factory(userOptions, { framework: "farm" })).map((rawPlugin) => {
1206
+ const plugin = toFarmPlugin(rawPlugin, userOptions);
1207
+ if (rawPlugin.farm) Object.assign(plugin, rawPlugin.farm);
1208
+ return plugin;
1209
+ });
1210
+ return plugins.length === 1 ? plugins[0] : plugins;
1211
+ });
1212
+ }
1213
+ function toFarmPlugin(plugin, options) {
1214
+ const farmPlugin = {
1215
+ name: plugin.name,
1216
+ priority: convertEnforceToPriority(plugin.enforce)
1217
+ };
1218
+ if (plugin.farm) Object.keys(plugin.farm).forEach((key) => {
1219
+ const value = plugin.farm[key];
1220
+ if (value) Reflect.set(farmPlugin, key, value);
1221
+ });
1222
+ if (plugin.buildStart) {
1223
+ const _buildStart = plugin.buildStart;
1224
+ farmPlugin.buildStart = { async executor(_, context) {
1225
+ await _buildStart.call(createFarmContext(context));
1226
+ } };
1227
+ }
1228
+ if (plugin.resolveId) {
1229
+ const _resolveId = plugin.resolveId;
1230
+ let filters = [];
1231
+ if (options) filters = options?.filters ?? [];
1232
+ farmPlugin.resolve = {
1233
+ filters: {
1234
+ sources: filters.length ? filters : [".*"],
1235
+ importers: [".*"]
1236
+ },
1237
+ async executor(params, context) {
1238
+ const resolvedIdPath = path.resolve(params.importer ?? "");
1239
+ const id = decodeStr(params.source);
1240
+ const { handler, filter } = normalizeObjectHook("resolveId", _resolveId);
1241
+ if (!filter(id)) return null;
1242
+ let isEntry = false;
1243
+ if (isObject(params.kind) && "entry" in params.kind) isEntry = params.kind.entry === "index";
1244
+ const farmContext = createFarmContext(context, resolvedIdPath);
1245
+ const resolveIdResult = await handler.call(Object.assign(unpluginContext(context), farmContext), id, resolvedIdPath ?? null, { isEntry });
1246
+ if (isString(resolveIdResult)) return {
1247
+ resolvedPath: removeQuery(encodeStr(resolveIdResult)),
1248
+ query: customParseQueryString(resolveIdResult),
1249
+ sideEffects: true,
1250
+ external: false,
1251
+ meta: {}
1252
+ };
1253
+ if (isObject(resolveIdResult)) return {
1254
+ resolvedPath: removeQuery(encodeStr(resolveIdResult?.id)),
1255
+ query: customParseQueryString(resolveIdResult?.id),
1256
+ sideEffects: false,
1257
+ external: Boolean(resolveIdResult?.external),
1258
+ meta: {}
1259
+ };
1260
+ if (!isStartsWithSlash(params.source)) return null;
1261
+ }
1262
+ };
1263
+ }
1264
+ if (plugin.load) {
1265
+ const _load = plugin.load;
1266
+ farmPlugin.load = {
1267
+ filters: { resolvedPaths: [".*"] },
1268
+ async executor(params, context) {
1269
+ const id = appendQuery(decodeStr(params.resolvedPath), params.query);
1270
+ const loader = formatTransformModuleType(id);
1271
+ if (plugin.loadInclude && !plugin.loadInclude?.(id)) return null;
1272
+ const { handler, filter } = normalizeObjectHook("load", _load);
1273
+ if (!filter(id)) return null;
1274
+ const farmContext = createFarmContext(context, id);
1275
+ return {
1276
+ content: getContentValue(await handler.call(Object.assign(unpluginContext(context), farmContext), id)),
1277
+ moduleType: loader
1278
+ };
1279
+ }
1280
+ };
1281
+ }
1282
+ if (plugin.transform) {
1283
+ const _transform = plugin.transform;
1284
+ farmPlugin.transform = {
1285
+ filters: {
1286
+ resolvedPaths: [".*"],
1287
+ moduleTypes: [".*"]
1288
+ },
1289
+ async executor(params, context) {
1290
+ const id = appendQuery(decodeStr(params.resolvedPath), params.query);
1291
+ const loader = formatTransformModuleType(id);
1292
+ if (plugin.transformInclude && !plugin.transformInclude(id)) return null;
1293
+ const { handler, filter } = normalizeObjectHook("transform", _transform);
1294
+ if (!filter(id, params.content)) return null;
1295
+ const farmContext = createFarmContext(context, id);
1296
+ const resource = await handler.call(Object.assign(unpluginContext(context), farmContext), params.content, id);
1297
+ if (resource && typeof resource !== "string") return {
1298
+ content: getContentValue(resource),
1299
+ moduleType: loader,
1300
+ sourceMap: typeof resource.map === "object" && resource.map !== null ? JSON.stringify(resource.map) : void 0
1301
+ };
1302
+ }
1303
+ };
1304
+ }
1305
+ if (plugin.watchChange) {
1306
+ const _watchChange = plugin.watchChange;
1307
+ farmPlugin.updateModules = { async executor(param, context) {
1308
+ const updatePathContent = param.paths[0];
1309
+ const ModifiedPath = updatePathContent[0];
1310
+ const eventChange = convertWatchEventChange(updatePathContent[1]);
1311
+ await _watchChange.call(createFarmContext(context), ModifiedPath, { event: eventChange });
1312
+ } };
1313
+ }
1314
+ if (plugin.buildEnd) {
1315
+ const _buildEnd = plugin.buildEnd;
1316
+ farmPlugin.buildEnd = { async executor(_, context) {
1317
+ await _buildEnd.call(createFarmContext(context));
1318
+ } };
1319
+ }
1320
+ if (plugin.writeBundle) {
1321
+ const _writeBundle = plugin.writeBundle;
1322
+ farmPlugin.finish = { async executor() {
1323
+ await _writeBundle();
1324
+ } };
1325
+ }
1326
+ return farmPlugin;
1327
+ }
1328
+ function getRollupPlugin(factory) {
1329
+ return ((userOptions) => {
1330
+ const plugins = toArray$2(factory(userOptions, { framework: "rollup" })).map((plugin) => toRollupPlugin(plugin, "rollup"));
1331
+ return plugins.length === 1 ? plugins[0] : plugins;
1332
+ });
1333
+ }
1334
+ function toRollupPlugin(plugin, key) {
1335
+ const nativeFilter = key === "rolldown";
1336
+ if (plugin.resolveId && !nativeFilter && typeof plugin.resolveId === "object" && plugin.resolveId.filter) {
1337
+ const resolveIdHook = plugin.resolveId;
1338
+ const { handler, filter } = normalizeObjectHook("load", resolveIdHook);
1339
+ replaceHookHandler("resolveId", resolveIdHook, function(...args) {
1340
+ const [id] = args;
1341
+ if (!supportNativeFilter(this, key) && !filter(id)) return;
1342
+ return handler.apply(this, args);
1343
+ });
1344
+ }
1345
+ if (plugin.load && (plugin.loadInclude || !nativeFilter && typeof plugin.load === "object" && plugin.load.filter)) {
1346
+ const loadHook = plugin.load;
1347
+ const { handler, filter } = normalizeObjectHook("load", loadHook);
1348
+ replaceHookHandler("load", loadHook, function(...args) {
1349
+ const [id] = args;
1350
+ if (plugin.loadInclude && !plugin.loadInclude(id)) return;
1351
+ if (!supportNativeFilter(this, key) && !filter(id)) return;
1352
+ return handler.apply(this, args);
1353
+ });
1354
+ }
1355
+ if (plugin.transform && (plugin.transformInclude || !nativeFilter && typeof plugin.transform === "object" && plugin.transform.filter)) {
1356
+ const transformHook = plugin.transform;
1357
+ const { handler, filter } = normalizeObjectHook("transform", transformHook);
1358
+ replaceHookHandler("transform", transformHook, function(...args) {
1359
+ const [code, id] = args;
1360
+ if (plugin.transformInclude && !plugin.transformInclude(id)) return;
1361
+ if (!supportNativeFilter(this, key) && !filter(id, code)) return;
1362
+ return handler.apply(this, args);
1363
+ });
1364
+ }
1365
+ if (plugin[key]) Object.assign(plugin, plugin[key]);
1366
+ return plugin;
1367
+ function replaceHookHandler(name, hook, handler) {
1368
+ if (typeof hook === "function") plugin[name] = handler;
1369
+ else hook.handler = handler;
1370
+ }
1371
+ }
1372
+ function supportNativeFilter(context, framework) {
1373
+ if (framework === "unloader") return false;
1374
+ if (framework === "vite") return !!context?.meta?.viteVersion;
1375
+ if (framework === "rolldown") return true;
1376
+ const rollupVersion = context?.meta?.rollupVersion;
1377
+ if (!rollupVersion) return false;
1378
+ const [major, minor] = rollupVersion.split(".");
1379
+ return Number(major) > 4 || Number(major) === 4 && Number(minor) >= 40;
1380
+ }
1381
+ function getRolldownPlugin(factory) {
1382
+ return ((userOptions) => {
1383
+ const plugins = toArray$2(factory(userOptions, { framework: "rolldown" })).map((rawPlugin) => {
1384
+ return toRollupPlugin(rawPlugin, "rolldown");
1385
+ });
1386
+ return plugins.length === 1 ? plugins[0] : plugins;
1387
+ });
1388
+ }
1389
+ const getFilename = () => fileURLToPath(import.meta.url);
1390
+ const getDirname = () => path.dirname(getFilename());
1391
+ const __dirname = /* @__PURE__ */ getDirname();
1392
+ const TRANSFORM_LOADER$1 = resolve(__dirname, "rspack/loaders/transform");
1393
+ const LOAD_LOADER$1 = resolve(__dirname, "rspack/loaders/load");
1394
+ function getRspackPlugin(factory) {
1395
+ return (userOptions) => {
1396
+ return { apply(compiler) {
1397
+ const VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process.cwd(), "node_modules/.virtual", compiler.rspack.experiments.VirtualModulesPlugin ? "" : process.pid.toString());
1398
+ const meta = {
1399
+ framework: "rspack",
1400
+ rspack: { compiler }
1401
+ };
1402
+ const rawPlugins = toArray$2(factory(userOptions, meta));
1403
+ for (const rawPlugin of rawPlugins) {
1404
+ const plugin = Object.assign(rawPlugin, {
1405
+ __unpluginMeta: meta,
1406
+ __virtualModulePrefix: VIRTUAL_MODULE_PREFIX
1407
+ });
1408
+ const externalModules = /* @__PURE__ */ new Set();
1409
+ if (plugin.resolveId) {
1410
+ const createPlugin = (plugin$1) => {
1411
+ if (compiler.rspack.experiments.VirtualModulesPlugin) return new compiler.rspack.experiments.VirtualModulesPlugin();
1412
+ return new FakeVirtualModulesPlugin(plugin$1);
1413
+ };
1414
+ const vfs = createPlugin(plugin);
1415
+ vfs.apply(compiler);
1416
+ const vfsModules = /* @__PURE__ */ new Map();
1417
+ plugin.__vfsModules = vfsModules;
1418
+ plugin.__vfs = vfs;
1419
+ compiler.hooks.compilation.tap(plugin.name, (compilation, { normalModuleFactory }) => {
1420
+ normalModuleFactory.hooks.resolve.tapPromise(plugin.name, async (resolveData) => {
1421
+ const id = normalizeAbsolutePath(resolveData.request);
1422
+ const requestContext = resolveData.contextInfo;
1423
+ let importer = requestContext.issuer !== "" ? requestContext.issuer : void 0;
1424
+ const isEntry = requestContext.issuer === "";
1425
+ if (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length));
1426
+ const context = createBuildContext$1(compiler, compilation);
1427
+ let error;
1428
+ const pluginContext = {
1429
+ error(msg) {
1430
+ if (error == null) error = normalizeMessage$1(msg);
1431
+ else console.error(`unplugin/rspack: multiple errors returned from resolveId hook: ${msg}`);
1432
+ },
1433
+ warn(msg) {
1434
+ console.warn(`unplugin/rspack: warning from resolveId hook: ${msg}`);
1435
+ }
1436
+ };
1437
+ const { handler, filter } = normalizeObjectHook("resolveId", plugin.resolveId);
1438
+ if (!filter(id)) return;
1439
+ const resolveIdResult = await handler.call({
1440
+ ...context,
1441
+ ...pluginContext
1442
+ }, id, importer, { isEntry });
1443
+ if (error != null) throw error;
1444
+ if (resolveIdResult == null) return;
1445
+ let resolved = typeof resolveIdResult === "string" ? resolveIdResult : resolveIdResult.id;
1446
+ if (typeof resolveIdResult === "string" ? false : resolveIdResult.external === true) externalModules.add(resolved);
1447
+ let isVirtual = true;
1448
+ try {
1449
+ (compiler.inputFileSystem?.statSync ?? fs.statSync)(resolved);
1450
+ isVirtual = false;
1451
+ } catch {
1452
+ isVirtual = !isVirtualModuleId(resolved, plugin);
1453
+ }
1454
+ if (isVirtual) {
1455
+ const encodedVirtualPath = encodeVirtualModuleId(resolved, plugin);
1456
+ if (!vfsModules.has(resolved)) {
1457
+ const fsPromise = Promise.resolve(vfs.writeModule(encodedVirtualPath, ""));
1458
+ vfsModules.set(resolved, fsPromise);
1459
+ await fsPromise;
1460
+ } else await vfsModules.get(resolved);
1461
+ resolved = encodedVirtualPath;
1462
+ }
1463
+ resolveData.request = resolved;
1464
+ });
1465
+ });
1466
+ }
1467
+ if (plugin.load) compiler.options.module.rules.unshift({
1468
+ enforce: plugin.enforce,
1469
+ include(id) {
1470
+ if (isVirtualModuleId(id, plugin)) id = decodeVirtualModuleId(id, plugin);
1471
+ if (plugin.loadInclude && !plugin.loadInclude(id)) return false;
1472
+ const { filter } = normalizeObjectHook("load", plugin.load);
1473
+ if (!filter(id)) return false;
1474
+ return !externalModules.has(id);
1475
+ },
1476
+ use: [{
1477
+ loader: LOAD_LOADER$1,
1478
+ options: { plugin }
1479
+ }],
1480
+ type: "javascript/auto"
1481
+ });
1482
+ if (plugin.transform) compiler.options.module.rules.unshift({
1483
+ enforce: plugin.enforce,
1484
+ use(data) {
1485
+ return transformUse(data, plugin, TRANSFORM_LOADER$1);
1486
+ }
1487
+ });
1488
+ if (plugin.rspack) plugin.rspack(compiler);
1489
+ if (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => {
1490
+ const context = createBuildContext$1(compiler, compilation);
1491
+ if (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) {
1492
+ const promises$1 = [];
1493
+ if (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises$1.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "update" }))));
1494
+ if (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises$1.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "delete" }))));
1495
+ await Promise.all(promises$1);
1496
+ }
1497
+ if (plugin.buildStart) return await plugin.buildStart.call(context);
1498
+ });
1499
+ if (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => {
1500
+ await plugin.buildEnd.call(createBuildContext$1(compiler, compilation));
1501
+ });
1502
+ if (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => {
1503
+ await plugin.writeBundle();
1504
+ });
1505
+ }
1506
+ } };
1507
+ };
1508
+ }
1509
+ function getUnloaderPlugin(factory) {
1510
+ return ((userOptions) => {
1511
+ const plugins = toArray$2(factory(userOptions, { framework: "unloader" })).map((rawPlugin) => {
1512
+ return toRollupPlugin(rawPlugin, "unloader");
1513
+ });
1514
+ return plugins.length === 1 ? plugins[0] : plugins;
1515
+ });
1516
+ }
1517
+ function getVitePlugin(factory) {
1518
+ return ((userOptions) => {
1519
+ const plugins = toArray$2(factory(userOptions, { framework: "vite" })).map((rawPlugin) => {
1520
+ return toRollupPlugin(rawPlugin, "vite");
1521
+ });
1522
+ return plugins.length === 1 ? plugins[0] : plugins;
1523
+ });
1524
+ }
1525
+ const TRANSFORM_LOADER = resolve(__dirname, "webpack/loaders/transform");
1526
+ const LOAD_LOADER = resolve(__dirname, "webpack/loaders/load");
1527
+ function getWebpackPlugin(factory) {
1528
+ return (userOptions) => {
1529
+ return { apply(compiler) {
1530
+ const VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process$1.cwd(), "_virtual_");
1531
+ const meta = {
1532
+ framework: "webpack",
1533
+ webpack: { compiler }
1534
+ };
1535
+ const rawPlugins = toArray$2(factory(userOptions, meta));
1536
+ for (const rawPlugin of rawPlugins) {
1537
+ const plugin = Object.assign(rawPlugin, {
1538
+ __unpluginMeta: meta,
1539
+ __virtualModulePrefix: VIRTUAL_MODULE_PREFIX
1540
+ });
1541
+ const externalModules = /* @__PURE__ */ new Set();
1542
+ if (plugin.resolveId) {
1543
+ let vfs = compiler.options.plugins.find((i) => i instanceof import_lib.default);
1544
+ if (!vfs) {
1545
+ vfs = new import_lib.default();
1546
+ compiler.options.plugins.push(vfs);
1547
+ }
1548
+ const vfsModules = /* @__PURE__ */ new Set();
1549
+ plugin.__vfsModules = vfsModules;
1550
+ plugin.__vfs = vfs;
1551
+ const resolverPlugin = { apply(resolver) {
1552
+ const target = resolver.ensureHook("resolve");
1553
+ resolver.getHook("resolve").tapAsync(plugin.name, async (request, resolveContext, callback) => {
1554
+ if (!request.request) return callback();
1555
+ if (normalizeAbsolutePath(request.request).startsWith(plugin.__virtualModulePrefix)) return callback();
1556
+ const id = normalizeAbsolutePath(request.request);
1557
+ const requestContext = request.context;
1558
+ let importer = requestContext.issuer !== "" ? requestContext.issuer : void 0;
1559
+ const isEntry = requestContext.issuer === "";
1560
+ if (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length));
1561
+ const fileDependencies = /* @__PURE__ */ new Set();
1562
+ const context = createBuildContext({
1563
+ addWatchFile(file) {
1564
+ fileDependencies.add(file);
1565
+ resolveContext.fileDependencies?.add(file);
1566
+ },
1567
+ getWatchFiles() {
1568
+ return Array.from(fileDependencies);
1569
+ }
1570
+ }, compiler);
1571
+ let error;
1572
+ const pluginContext = {
1573
+ error(msg) {
1574
+ if (error == null) error = normalizeMessage(msg);
1575
+ else console.error(`unplugin/webpack: multiple errors returned from resolveId hook: ${msg}`);
1576
+ },
1577
+ warn(msg) {
1578
+ console.warn(`unplugin/webpack: warning from resolveId hook: ${msg}`);
1579
+ }
1580
+ };
1581
+ const { handler, filter } = normalizeObjectHook("resolveId", plugin.resolveId);
1582
+ if (!filter(id)) return callback();
1583
+ const resolveIdResult = await handler.call({
1584
+ ...context,
1585
+ ...pluginContext
1586
+ }, id, importer, { isEntry });
1587
+ if (error != null) return callback(error);
1588
+ if (resolveIdResult == null) return callback();
1589
+ let resolved = typeof resolveIdResult === "string" ? resolveIdResult : resolveIdResult.id;
1590
+ if (typeof resolveIdResult === "string" ? false : resolveIdResult.external === true) externalModules.add(resolved);
1591
+ if (!fs.existsSync(resolved)) {
1592
+ resolved = normalizeAbsolutePath(plugin.__virtualModulePrefix + encodeURIComponent(resolved));
1593
+ if (!vfsModules.has(resolved)) {
1594
+ plugin.__vfs.writeModule(resolved, "");
1595
+ vfsModules.add(resolved);
1596
+ }
1597
+ }
1598
+ const newRequest = {
1599
+ ...request,
1600
+ request: resolved
1601
+ };
1602
+ resolver.doResolve(target, newRequest, null, resolveContext, callback);
1603
+ });
1604
+ } };
1605
+ compiler.options.resolve.plugins = compiler.options.resolve.plugins || [];
1606
+ compiler.options.resolve.plugins.push(resolverPlugin);
1607
+ }
1608
+ if (plugin.load) compiler.options.module.rules.unshift({
1609
+ include(id) {
1610
+ return shouldLoad(id, plugin, externalModules);
1611
+ },
1612
+ enforce: plugin.enforce,
1613
+ use: [{
1614
+ loader: LOAD_LOADER,
1615
+ options: { plugin }
1616
+ }],
1617
+ type: "javascript/auto"
1618
+ });
1619
+ if (plugin.transform) compiler.options.module.rules.unshift({
1620
+ enforce: plugin.enforce,
1621
+ use(data) {
1622
+ return transformUse(data, plugin, TRANSFORM_LOADER);
1623
+ }
1624
+ });
1625
+ if (plugin.webpack) plugin.webpack(compiler);
1626
+ if (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => {
1627
+ const context = createBuildContext(contextOptionsFromCompilation(compilation), compiler, compilation);
1628
+ if (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) {
1629
+ const promises$1 = [];
1630
+ if (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises$1.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "update" }))));
1631
+ if (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises$1.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "delete" }))));
1632
+ await Promise.all(promises$1);
1633
+ }
1634
+ if (plugin.buildStart) return await plugin.buildStart.call(context);
1635
+ });
1636
+ if (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => {
1637
+ await plugin.buildEnd.call(createBuildContext(contextOptionsFromCompilation(compilation), compiler, compilation));
1638
+ });
1639
+ if (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => {
1640
+ await plugin.writeBundle();
1641
+ });
1642
+ }
1643
+ } };
1644
+ };
1645
+ }
1646
+ function shouldLoad(id, plugin, externalModules) {
1647
+ if (id.startsWith(plugin.__virtualModulePrefix)) id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
1648
+ if (plugin.loadInclude && !plugin.loadInclude(id)) return false;
1649
+ const { filter } = normalizeObjectHook("load", plugin.load);
1650
+ if (!filter(id)) return false;
1651
+ return !externalModules.has(id);
1652
+ }
1653
+ function createUnplugin(factory) {
1654
+ return {
1655
+ get esbuild() {
1656
+ return getEsbuildPlugin(factory);
1657
+ },
1658
+ get rollup() {
1659
+ return getRollupPlugin(factory);
1660
+ },
1661
+ get vite() {
1662
+ return getVitePlugin(factory);
1663
+ },
1664
+ get rolldown() {
1665
+ return getRolldownPlugin(factory);
1666
+ },
1667
+ get webpack() {
1668
+ return getWebpackPlugin(factory);
1669
+ },
1670
+ get rspack() {
1671
+ return getRspackPlugin(factory);
1672
+ },
1673
+ get farm() {
1674
+ return getFarmPlugin(factory);
1675
+ },
1676
+ get unloader() {
1677
+ return getUnloaderPlugin(factory);
1678
+ },
1679
+ get raw() {
1680
+ return factory;
1681
+ }
1682
+ };
1683
+ }
1684
+
1685
+ //#endregion
1686
+ //#region node_modules/.pnpm/unplugin-utils@0.3.1/node_modules/unplugin-utils/dist/index.js
1687
+ /**
1688
+ * Converts path separators to forward slash.
1689
+ */
1690
+ function normalizePath(filename) {
1691
+ return filename.replaceAll("\\", "/");
1692
+ }
1693
+ const isArray = Array.isArray;
1694
+ function toArray$1(thing) {
1695
+ if (isArray(thing)) return thing;
1696
+ if (thing == null) return [];
1697
+ return [thing];
1698
+ }
1699
+ const escapeMark = "[_#EsCaPe#_]";
1700
+ function getMatcherString(id, resolutionBase) {
1701
+ if (resolutionBase === false || isAbsolute$2(id) || id.startsWith("**")) return normalizePath(id);
1702
+ return join$1(normalizePath(resolve$1(resolutionBase || "")).replaceAll(/[-^$*+?.()|[\]{}]/g, `${escapeMark}$&`), normalizePath(id)).replaceAll(escapeMark, "\\");
1703
+ }
1704
+ /**
1705
+ * Constructs a filter function which can be used to determine whether or not
1706
+ * certain modules should be operated upon.
1707
+ * @param include If `include` is omitted or has zero length, filter will return `true` by default.
1708
+ * @param exclude ID must not match any of the `exclude` patterns.
1709
+ * @param options Additional options.
1710
+ * @param options.resolve Optionally resolves the patterns against a directory other than `process.cwd()`.
1711
+ * If a `string` is specified, then the value will be used as the base directory.
1712
+ * Relative paths will be resolved against `process.cwd()` first.
1713
+ * If `false`, then the patterns will not be resolved against any directory.
1714
+ * This can be useful if you want to create a filter for virtual module names.
1715
+ */
1716
+ function createFilter(include, exclude, options) {
1717
+ const resolutionBase = options && options.resolve;
1718
+ const getMatcher = (id) => id instanceof RegExp ? id : { test: (what) => {
1719
+ return (0, import_picomatch.default)(getMatcherString(id, resolutionBase), { dot: true })(what);
1720
+ } };
1721
+ const includeMatchers = toArray$1(include).map(getMatcher);
1722
+ const excludeMatchers = toArray$1(exclude).map(getMatcher);
1723
+ if (!includeMatchers.length && !excludeMatchers.length) return (id) => typeof id === "string" && !id.includes("\0");
1724
+ return function result(id) {
1725
+ if (typeof id !== "string") return false;
1726
+ if (id.includes("\0")) return false;
1727
+ const pathId = normalizePath(id);
1728
+ for (const matcher of excludeMatchers) {
1729
+ if (matcher instanceof RegExp) matcher.lastIndex = 0;
1730
+ if (matcher.test(pathId)) return false;
1731
+ }
1732
+ for (const matcher of includeMatchers) {
1733
+ if (matcher instanceof RegExp) matcher.lastIndex = 0;
1734
+ if (matcher.test(pathId)) return true;
1735
+ }
1736
+ return !includeMatchers.length;
1737
+ };
1738
+ }
1739
+
1965
1740
  //#endregion
1966
1741
  //#region node_modules/.pnpm/unimport@5.6.0/node_modules/unimport/dist/unplugin.mjs
1967
1742
  var unplugin_exports = /* @__PURE__ */ __exportAll({
@@ -2007,4 +1782,4 @@ const unplugin = createUnplugin((options = {}) => {
2007
1782
  });
2008
1783
 
2009
1784
  //#endregion
2010
- export { stripCommentsAndStrings as A, excludeRE as C, normalizeImports as D, matchRE as E, toTypeReExports as F, vueTemplateAddon as I, toExports as M, toTypeDeclarationFile as N, separatorRE as O, toTypeDeclarationItems as P, defineUnimportPreset as S, importAsRE as T, scanExports as _, createVirtualImportsAcronWalker as a, addImportToCode as b, traveseScopes as c, createUnimport as d, dedupeDtsExports as f, scanDirExports as g, resolvePreset as h, unplugin_exports as i, stripFileExtension as j, stringifyImports as k, dist_exports as l, resolveBuiltinPresets as m, defaultIncludes as n, detectImportsAcorn as o, normalizeScanDirs as p, unplugin as r, detect_acorn_exports as s, defaultExcludes as t, builtinPresets as u, scanFilesFromDir as v, getMagicString as w, dedupeImports as x, version as y };
1785
+ export { createVirtualImportsAcronWalker as a, traveseScopes as c, unplugin_exports as i, defaultIncludes as n, detectImportsAcorn as o, unplugin as r, detect_acorn_exports as s, defaultExcludes as t };