@cloudflare/vite-plugin 1.17.1 → 1.19.0

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.
package/dist/index.mjs CHANGED
@@ -1,13 +1,14 @@
1
1
  import { builtinModules } from "node:module";
2
- import * as vite from "vite";
3
2
  import assert from "node:assert";
4
- import { CoreHeaders, Log, LogLevel, Miniflare, Request as Request$1, Response as Response$1, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, kUnsafeEphemeralUniqueKey } from "miniflare";
5
- import { maybeStartOrUpdateRemoteProxySession, unstable_convertConfigBindingsToStartWorkerBindings, unstable_defaultWranglerConfig, unstable_getDevCompatibilityDate, unstable_getDurableObjectClassNameToUseSQLiteMap, unstable_getMiniflareWorkerOptions, unstable_getVarsForDev, unstable_getWorkerNameFromProject, unstable_readConfig } from "wrangler";
6
- import * as path$1 from "node:path";
3
+ import { CoreHeaders, Log, LogLevel, Miniflare, Request as Request$1, Response as Response$1, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, getWorkerRegistry, kUnsafeEphemeralUniqueKey } from "miniflare";
4
+ import * as wrangler from "wrangler";
5
+ import * as nodePath from "node:path";
7
6
  import path, { relative } from "node:path";
8
7
  import * as util$1 from "node:util";
9
8
  import { format, inspect } from "node:util";
10
9
  import { createHeaders, createRequest, sendResponse } from "@remix-run/node-fetch-server";
10
+ import * as vite from "vite";
11
+ import { version } from "vite";
11
12
  import { defu } from "defu";
12
13
  import * as fs$1 from "node:fs";
13
14
  import fs, { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
@@ -49,8 +50,1451 @@ var __toESM = (mod, isNodeMode, target$1) => (target$1 = mod != null ? __create(
49
50
  enumerable: true
50
51
  }) : target$1, mod));
51
52
 
53
+ //#endregion
54
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js
55
+ var require_constants = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js": ((exports, module) => {
56
+ const SEMVER_SPEC_VERSION = "2.0.0";
57
+ const MAX_LENGTH$2 = 256;
58
+ const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || 9007199254740991;
59
+ const MAX_SAFE_COMPONENT_LENGTH$1 = 16;
60
+ const MAX_SAFE_BUILD_LENGTH$1 = MAX_LENGTH$2 - 6;
61
+ const RELEASE_TYPES = [
62
+ "major",
63
+ "premajor",
64
+ "minor",
65
+ "preminor",
66
+ "patch",
67
+ "prepatch",
68
+ "prerelease"
69
+ ];
70
+ module.exports = {
71
+ MAX_LENGTH: MAX_LENGTH$2,
72
+ MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH$1,
73
+ MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH$1,
74
+ MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
75
+ RELEASE_TYPES,
76
+ SEMVER_SPEC_VERSION,
77
+ FLAG_INCLUDE_PRERELEASE: 1,
78
+ FLAG_LOOSE: 2
79
+ };
80
+ }) });
81
+
82
+ //#endregion
83
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
84
+ var require_debug = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js": ((exports, module) => {
85
+ const debug$4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
86
+ module.exports = debug$4;
87
+ }) });
88
+
89
+ //#endregion
90
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js
91
+ var require_re = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js": ((exports, module) => {
92
+ const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
93
+ const debug$3 = require_debug();
94
+ exports = module.exports = {};
95
+ const re$4 = exports.re = [];
96
+ const safeRe = exports.safeRe = [];
97
+ const src = exports.src = [];
98
+ const safeSrc = exports.safeSrc = [];
99
+ const t$4 = exports.t = {};
100
+ let R = 0;
101
+ const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
102
+ const safeRegexReplacements = [
103
+ ["\\s", 1],
104
+ ["\\d", MAX_LENGTH$1],
105
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
106
+ ];
107
+ const makeSafeRegex = (value) => {
108
+ for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
109
+ return value;
110
+ };
111
+ const createToken = (name, value, isGlobal) => {
112
+ const safe = makeSafeRegex(value);
113
+ const index = R++;
114
+ debug$3(name, index, value);
115
+ t$4[name] = index;
116
+ src[index] = value;
117
+ safeSrc[index] = safe;
118
+ re$4[index] = new RegExp(value, isGlobal ? "g" : void 0);
119
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
120
+ };
121
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
122
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
123
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
124
+ createToken("MAINVERSION", `(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})`);
125
+ createToken("MAINVERSIONLOOSE", `(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
126
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIER]})`);
127
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
128
+ createToken("PRERELEASE", `(?:-(${src[t$4.PRERELEASEIDENTIFIER]}(?:\\.${src[t$4.PRERELEASEIDENTIFIER]})*))`);
129
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t$4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t$4.PRERELEASEIDENTIFIERLOOSE]})*))`);
130
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
131
+ createToken("BUILD", `(?:\\+(${src[t$4.BUILDIDENTIFIER]}(?:\\.${src[t$4.BUILDIDENTIFIER]})*))`);
132
+ createToken("FULLPLAIN", `v?${src[t$4.MAINVERSION]}${src[t$4.PRERELEASE]}?${src[t$4.BUILD]}?`);
133
+ createToken("FULL", `^${src[t$4.FULLPLAIN]}$`);
134
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t$4.MAINVERSIONLOOSE]}${src[t$4.PRERELEASELOOSE]}?${src[t$4.BUILD]}?`);
135
+ createToken("LOOSE", `^${src[t$4.LOOSEPLAIN]}$`);
136
+ createToken("GTLT", "((?:<|>)?=?)");
137
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t$4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
138
+ createToken("XRANGEIDENTIFIER", `${src[t$4.NUMERICIDENTIFIER]}|x|X|\\*`);
139
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:${src[t$4.PRERELEASE]})?${src[t$4.BUILD]}?)?)?`);
140
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:${src[t$4.PRERELEASELOOSE]})?${src[t$4.BUILD]}?)?)?`);
141
+ createToken("XRANGE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAIN]}$`);
142
+ createToken("XRANGELOOSE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAINLOOSE]}$`);
143
+ createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
144
+ createToken("COERCE", `${src[t$4.COERCEPLAIN]}(?:$|[^\\d])`);
145
+ createToken("COERCEFULL", src[t$4.COERCEPLAIN] + `(?:${src[t$4.PRERELEASE]})?(?:${src[t$4.BUILD]})?(?:$|[^\\d])`);
146
+ createToken("COERCERTL", src[t$4.COERCE], true);
147
+ createToken("COERCERTLFULL", src[t$4.COERCEFULL], true);
148
+ createToken("LONETILDE", "(?:~>?)");
149
+ createToken("TILDETRIM", `(\\s*)${src[t$4.LONETILDE]}\\s+`, true);
150
+ exports.tildeTrimReplace = "$1~";
151
+ createToken("TILDE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAIN]}$`);
152
+ createToken("TILDELOOSE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAINLOOSE]}$`);
153
+ createToken("LONECARET", "(?:\\^)");
154
+ createToken("CARETTRIM", `(\\s*)${src[t$4.LONECARET]}\\s+`, true);
155
+ exports.caretTrimReplace = "$1^";
156
+ createToken("CARET", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAIN]}$`);
157
+ createToken("CARETLOOSE", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAINLOOSE]}$`);
158
+ createToken("COMPARATORLOOSE", `^${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]})$|^$`);
159
+ createToken("COMPARATOR", `^${src[t$4.GTLT]}\\s*(${src[t$4.FULLPLAIN]})$|^$`);
160
+ createToken("COMPARATORTRIM", `(\\s*)${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]}|${src[t$4.XRANGEPLAIN]})`, true);
161
+ exports.comparatorTrimReplace = "$1$2$3";
162
+ createToken("HYPHENRANGE", `^\\s*(${src[t$4.XRANGEPLAIN]})\\s+-\\s+(${src[t$4.XRANGEPLAIN]})\\s*$`);
163
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t$4.XRANGEPLAINLOOSE]})\\s*$`);
164
+ createToken("STAR", "(<|>)?=?\\s*\\*");
165
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
166
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
167
+ }) });
168
+
169
+ //#endregion
170
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js
171
+ var require_parse_options = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js": ((exports, module) => {
172
+ const looseOption = Object.freeze({ loose: true });
173
+ const emptyOpts = Object.freeze({});
174
+ const parseOptions$3 = (options) => {
175
+ if (!options) return emptyOpts;
176
+ if (typeof options !== "object") return looseOption;
177
+ return options;
178
+ };
179
+ module.exports = parseOptions$3;
180
+ }) });
181
+
182
+ //#endregion
183
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js
184
+ var require_identifiers = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js": ((exports, module) => {
185
+ const numeric = /^[0-9]+$/;
186
+ const compareIdentifiers$1 = (a, b) => {
187
+ if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
188
+ const anum = numeric.test(a);
189
+ const bnum = numeric.test(b);
190
+ if (anum && bnum) {
191
+ a = +a;
192
+ b = +b;
193
+ }
194
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
195
+ };
196
+ const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
197
+ module.exports = {
198
+ compareIdentifiers: compareIdentifiers$1,
199
+ rcompareIdentifiers
200
+ };
201
+ }) });
202
+
203
+ //#endregion
204
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js
205
+ var require_semver$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js": ((exports, module) => {
206
+ const debug$2 = require_debug();
207
+ const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
208
+ const { safeRe: re$3, t: t$3 } = require_re();
209
+ const parseOptions$2 = require_parse_options();
210
+ const { compareIdentifiers } = require_identifiers();
211
+ var SemVer$15 = class SemVer$15 {
212
+ constructor(version$2, options) {
213
+ options = parseOptions$2(options);
214
+ if (version$2 instanceof SemVer$15) if (version$2.loose === !!options.loose && version$2.includePrerelease === !!options.includePrerelease) return version$2;
215
+ else version$2 = version$2.version;
216
+ else if (typeof version$2 !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version$2}".`);
217
+ if (version$2.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
218
+ debug$2("SemVer", version$2, options);
219
+ this.options = options;
220
+ this.loose = !!options.loose;
221
+ this.includePrerelease = !!options.includePrerelease;
222
+ const m = version$2.trim().match(options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL]);
223
+ if (!m) throw new TypeError(`Invalid Version: ${version$2}`);
224
+ this.raw = version$2;
225
+ this.major = +m[1];
226
+ this.minor = +m[2];
227
+ this.patch = +m[3];
228
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
229
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
230
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
231
+ if (!m[4]) this.prerelease = [];
232
+ else this.prerelease = m[4].split(".").map((id) => {
233
+ if (/^[0-9]+$/.test(id)) {
234
+ const num = +id;
235
+ if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
236
+ }
237
+ return id;
238
+ });
239
+ this.build = m[5] ? m[5].split(".") : [];
240
+ this.format();
241
+ }
242
+ format() {
243
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
244
+ if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
245
+ return this.version;
246
+ }
247
+ toString() {
248
+ return this.version;
249
+ }
250
+ compare(other) {
251
+ debug$2("SemVer.compare", this.version, this.options, other);
252
+ if (!(other instanceof SemVer$15)) {
253
+ if (typeof other === "string" && other === this.version) return 0;
254
+ other = new SemVer$15(other, this.options);
255
+ }
256
+ if (other.version === this.version) return 0;
257
+ return this.compareMain(other) || this.comparePre(other);
258
+ }
259
+ compareMain(other) {
260
+ if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
261
+ if (this.major < other.major) return -1;
262
+ if (this.major > other.major) return 1;
263
+ if (this.minor < other.minor) return -1;
264
+ if (this.minor > other.minor) return 1;
265
+ if (this.patch < other.patch) return -1;
266
+ if (this.patch > other.patch) return 1;
267
+ return 0;
268
+ }
269
+ comparePre(other) {
270
+ if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
271
+ if (this.prerelease.length && !other.prerelease.length) return -1;
272
+ else if (!this.prerelease.length && other.prerelease.length) return 1;
273
+ else if (!this.prerelease.length && !other.prerelease.length) return 0;
274
+ let i$1 = 0;
275
+ do {
276
+ const a = this.prerelease[i$1];
277
+ const b = other.prerelease[i$1];
278
+ debug$2("prerelease compare", i$1, a, b);
279
+ if (a === void 0 && b === void 0) return 0;
280
+ else if (b === void 0) return 1;
281
+ else if (a === void 0) return -1;
282
+ else if (a === b) continue;
283
+ else return compareIdentifiers(a, b);
284
+ } while (++i$1);
285
+ }
286
+ compareBuild(other) {
287
+ if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
288
+ let i$1 = 0;
289
+ do {
290
+ const a = this.build[i$1];
291
+ const b = other.build[i$1];
292
+ debug$2("build compare", i$1, a, b);
293
+ if (a === void 0 && b === void 0) return 0;
294
+ else if (b === void 0) return 1;
295
+ else if (a === void 0) return -1;
296
+ else if (a === b) continue;
297
+ else return compareIdentifiers(a, b);
298
+ } while (++i$1);
299
+ }
300
+ inc(release, identifier, identifierBase) {
301
+ if (release.startsWith("pre")) {
302
+ if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
303
+ if (identifier) {
304
+ const match = `-${identifier}`.match(this.options.loose ? re$3[t$3.PRERELEASELOOSE] : re$3[t$3.PRERELEASE]);
305
+ if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
306
+ }
307
+ }
308
+ switch (release) {
309
+ case "premajor":
310
+ this.prerelease.length = 0;
311
+ this.patch = 0;
312
+ this.minor = 0;
313
+ this.major++;
314
+ this.inc("pre", identifier, identifierBase);
315
+ break;
316
+ case "preminor":
317
+ this.prerelease.length = 0;
318
+ this.patch = 0;
319
+ this.minor++;
320
+ this.inc("pre", identifier, identifierBase);
321
+ break;
322
+ case "prepatch":
323
+ this.prerelease.length = 0;
324
+ this.inc("patch", identifier, identifierBase);
325
+ this.inc("pre", identifier, identifierBase);
326
+ break;
327
+ case "prerelease":
328
+ if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
329
+ this.inc("pre", identifier, identifierBase);
330
+ break;
331
+ case "release":
332
+ if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
333
+ this.prerelease.length = 0;
334
+ break;
335
+ case "major":
336
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
337
+ this.minor = 0;
338
+ this.patch = 0;
339
+ this.prerelease = [];
340
+ break;
341
+ case "minor":
342
+ if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
343
+ this.patch = 0;
344
+ this.prerelease = [];
345
+ break;
346
+ case "patch":
347
+ if (this.prerelease.length === 0) this.patch++;
348
+ this.prerelease = [];
349
+ break;
350
+ case "pre": {
351
+ const base = Number(identifierBase) ? 1 : 0;
352
+ if (this.prerelease.length === 0) this.prerelease = [base];
353
+ else {
354
+ let i$1 = this.prerelease.length;
355
+ while (--i$1 >= 0) if (typeof this.prerelease[i$1] === "number") {
356
+ this.prerelease[i$1]++;
357
+ i$1 = -2;
358
+ }
359
+ if (i$1 === -1) {
360
+ if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
361
+ this.prerelease.push(base);
362
+ }
363
+ }
364
+ if (identifier) {
365
+ let prerelease$2 = [identifier, base];
366
+ if (identifierBase === false) prerelease$2 = [identifier];
367
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
368
+ if (isNaN(this.prerelease[1])) this.prerelease = prerelease$2;
369
+ } else this.prerelease = prerelease$2;
370
+ }
371
+ break;
372
+ }
373
+ default: throw new Error(`invalid increment argument: ${release}`);
374
+ }
375
+ this.raw = this.format();
376
+ if (this.build.length) this.raw += `+${this.build.join(".")}`;
377
+ return this;
378
+ }
379
+ };
380
+ module.exports = SemVer$15;
381
+ }) });
382
+
383
+ //#endregion
384
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js
385
+ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js": ((exports, module) => {
386
+ const SemVer$14 = require_semver$1();
387
+ const parse$6 = (version$2, options, throwErrors = false) => {
388
+ if (version$2 instanceof SemVer$14) return version$2;
389
+ try {
390
+ return new SemVer$14(version$2, options);
391
+ } catch (er) {
392
+ if (!throwErrors) return null;
393
+ throw er;
394
+ }
395
+ };
396
+ module.exports = parse$6;
397
+ }) });
398
+
399
+ //#endregion
400
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js
401
+ var require_valid$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js": ((exports, module) => {
402
+ const parse$5 = require_parse();
403
+ const valid$1 = (version$2, options) => {
404
+ const v = parse$5(version$2, options);
405
+ return v ? v.version : null;
406
+ };
407
+ module.exports = valid$1;
408
+ }) });
409
+
410
+ //#endregion
411
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js
412
+ var require_clean = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js": ((exports, module) => {
413
+ const parse$4 = require_parse();
414
+ const clean$1 = (version$2, options) => {
415
+ const s = parse$4(version$2.trim().replace(/^[=v]+/, ""), options);
416
+ return s ? s.version : null;
417
+ };
418
+ module.exports = clean$1;
419
+ }) });
420
+
421
+ //#endregion
422
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js
423
+ var require_inc = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js": ((exports, module) => {
424
+ const SemVer$13 = require_semver$1();
425
+ const inc$1 = (version$2, release, options, identifier, identifierBase) => {
426
+ if (typeof options === "string") {
427
+ identifierBase = identifier;
428
+ identifier = options;
429
+ options = void 0;
430
+ }
431
+ try {
432
+ return new SemVer$13(version$2 instanceof SemVer$13 ? version$2.version : version$2, options).inc(release, identifier, identifierBase).version;
433
+ } catch (er) {
434
+ return null;
435
+ }
436
+ };
437
+ module.exports = inc$1;
438
+ }) });
439
+
440
+ //#endregion
441
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js
442
+ var require_diff = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js": ((exports, module) => {
443
+ const parse$3 = require_parse();
444
+ const diff$1 = (version1, version2) => {
445
+ const v1 = parse$3(version1, null, true);
446
+ const v2 = parse$3(version2, null, true);
447
+ const comparison = v1.compare(v2);
448
+ if (comparison === 0) return null;
449
+ const v1Higher = comparison > 0;
450
+ const highVersion = v1Higher ? v1 : v2;
451
+ const lowVersion = v1Higher ? v2 : v1;
452
+ const highHasPre = !!highVersion.prerelease.length;
453
+ if (!!lowVersion.prerelease.length && !highHasPre) {
454
+ if (!lowVersion.patch && !lowVersion.minor) return "major";
455
+ if (lowVersion.compareMain(highVersion) === 0) {
456
+ if (lowVersion.minor && !lowVersion.patch) return "minor";
457
+ return "patch";
458
+ }
459
+ }
460
+ const prefix = highHasPre ? "pre" : "";
461
+ if (v1.major !== v2.major) return prefix + "major";
462
+ if (v1.minor !== v2.minor) return prefix + "minor";
463
+ if (v1.patch !== v2.patch) return prefix + "patch";
464
+ return "prerelease";
465
+ };
466
+ module.exports = diff$1;
467
+ }) });
468
+
469
+ //#endregion
470
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js
471
+ var require_major = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js": ((exports, module) => {
472
+ const SemVer$12 = require_semver$1();
473
+ const major$1 = (a, loose) => new SemVer$12(a, loose).major;
474
+ module.exports = major$1;
475
+ }) });
476
+
477
+ //#endregion
478
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js
479
+ var require_minor = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js": ((exports, module) => {
480
+ const SemVer$11 = require_semver$1();
481
+ const minor$1 = (a, loose) => new SemVer$11(a, loose).minor;
482
+ module.exports = minor$1;
483
+ }) });
484
+
485
+ //#endregion
486
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js
487
+ var require_patch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js": ((exports, module) => {
488
+ const SemVer$10 = require_semver$1();
489
+ const patch$1 = (a, loose) => new SemVer$10(a, loose).patch;
490
+ module.exports = patch$1;
491
+ }) });
492
+
493
+ //#endregion
494
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js
495
+ var require_prerelease = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js": ((exports, module) => {
496
+ const parse$2 = require_parse();
497
+ const prerelease$1 = (version$2, options) => {
498
+ const parsed = parse$2(version$2, options);
499
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
500
+ };
501
+ module.exports = prerelease$1;
502
+ }) });
503
+
504
+ //#endregion
505
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js
506
+ var require_compare = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js": ((exports, module) => {
507
+ const SemVer$9 = require_semver$1();
508
+ const compare$11 = (a, b, loose) => new SemVer$9(a, loose).compare(new SemVer$9(b, loose));
509
+ module.exports = compare$11;
510
+ }) });
511
+
512
+ //#endregion
513
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js
514
+ var require_rcompare = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js": ((exports, module) => {
515
+ const compare$10 = require_compare();
516
+ const rcompare$1 = (a, b, loose) => compare$10(b, a, loose);
517
+ module.exports = rcompare$1;
518
+ }) });
519
+
520
+ //#endregion
521
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js
522
+ var require_compare_loose = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js": ((exports, module) => {
523
+ const compare$9 = require_compare();
524
+ const compareLoose$1 = (a, b) => compare$9(a, b, true);
525
+ module.exports = compareLoose$1;
526
+ }) });
527
+
528
+ //#endregion
529
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js
530
+ var require_compare_build = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js": ((exports, module) => {
531
+ const SemVer$8 = require_semver$1();
532
+ const compareBuild$3 = (a, b, loose) => {
533
+ const versionA = new SemVer$8(a, loose);
534
+ const versionB = new SemVer$8(b, loose);
535
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
536
+ };
537
+ module.exports = compareBuild$3;
538
+ }) });
539
+
540
+ //#endregion
541
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js
542
+ var require_sort = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js": ((exports, module) => {
543
+ const compareBuild$2 = require_compare_build();
544
+ const sort$1 = (list$1, loose) => list$1.sort((a, b) => compareBuild$2(a, b, loose));
545
+ module.exports = sort$1;
546
+ }) });
547
+
548
+ //#endregion
549
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js
550
+ var require_rsort = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js": ((exports, module) => {
551
+ const compareBuild$1 = require_compare_build();
552
+ const rsort$1 = (list$1, loose) => list$1.sort((a, b) => compareBuild$1(b, a, loose));
553
+ module.exports = rsort$1;
554
+ }) });
555
+
556
+ //#endregion
557
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js
558
+ var require_gt = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js": ((exports, module) => {
559
+ const compare$8 = require_compare();
560
+ const gt$4 = (a, b, loose) => compare$8(a, b, loose) > 0;
561
+ module.exports = gt$4;
562
+ }) });
563
+
564
+ //#endregion
565
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js
566
+ var require_lt = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js": ((exports, module) => {
567
+ const compare$7 = require_compare();
568
+ const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0;
569
+ module.exports = lt$3;
570
+ }) });
571
+
572
+ //#endregion
573
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js
574
+ var require_eq = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js": ((exports, module) => {
575
+ const compare$6 = require_compare();
576
+ const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0;
577
+ module.exports = eq$2;
578
+ }) });
579
+
580
+ //#endregion
581
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js
582
+ var require_neq = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js": ((exports, module) => {
583
+ const compare$5 = require_compare();
584
+ const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0;
585
+ module.exports = neq$2;
586
+ }) });
587
+
588
+ //#endregion
589
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js
590
+ var require_gte = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js": ((exports, module) => {
591
+ const compare$4 = require_compare();
592
+ const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0;
593
+ module.exports = gte$3;
594
+ }) });
595
+
596
+ //#endregion
597
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js
598
+ var require_lte = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js": ((exports, module) => {
599
+ const compare$3 = require_compare();
600
+ const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0;
601
+ module.exports = lte$3;
602
+ }) });
603
+
604
+ //#endregion
605
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js
606
+ var require_cmp = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js": ((exports, module) => {
607
+ const eq$1 = require_eq();
608
+ const neq$1 = require_neq();
609
+ const gt$3 = require_gt();
610
+ const gte$2 = require_gte();
611
+ const lt$2 = require_lt();
612
+ const lte$2 = require_lte();
613
+ const cmp$2 = (a, op, b, loose) => {
614
+ switch (op) {
615
+ case "===":
616
+ if (typeof a === "object") a = a.version;
617
+ if (typeof b === "object") b = b.version;
618
+ return a === b;
619
+ case "!==":
620
+ if (typeof a === "object") a = a.version;
621
+ if (typeof b === "object") b = b.version;
622
+ return a !== b;
623
+ case "":
624
+ case "=":
625
+ case "==": return eq$1(a, b, loose);
626
+ case "!=": return neq$1(a, b, loose);
627
+ case ">": return gt$3(a, b, loose);
628
+ case ">=": return gte$2(a, b, loose);
629
+ case "<": return lt$2(a, b, loose);
630
+ case "<=": return lte$2(a, b, loose);
631
+ default: throw new TypeError(`Invalid operator: ${op}`);
632
+ }
633
+ };
634
+ module.exports = cmp$2;
635
+ }) });
636
+
637
+ //#endregion
638
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js
639
+ var require_coerce = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js": ((exports, module) => {
640
+ const SemVer$7 = require_semver$1();
641
+ const parse$1 = require_parse();
642
+ const { safeRe: re$2, t: t$2 } = require_re();
643
+ const coerce$2 = (version$2, options) => {
644
+ if (version$2 instanceof SemVer$7) return version$2;
645
+ if (typeof version$2 === "number") version$2 = String(version$2);
646
+ if (typeof version$2 !== "string") return null;
647
+ options = options || {};
648
+ let match = null;
649
+ if (!options.rtl) match = version$2.match(options.includePrerelease ? re$2[t$2.COERCEFULL] : re$2[t$2.COERCE]);
650
+ else {
651
+ const coerceRtlRegex = options.includePrerelease ? re$2[t$2.COERCERTLFULL] : re$2[t$2.COERCERTL];
652
+ let next;
653
+ while ((next = coerceRtlRegex.exec(version$2)) && (!match || match.index + match[0].length !== version$2.length)) {
654
+ if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
655
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
656
+ }
657
+ coerceRtlRegex.lastIndex = -1;
658
+ }
659
+ if (match === null) return null;
660
+ const major$2 = match[2];
661
+ return parse$1(`${major$2}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
662
+ };
663
+ module.exports = coerce$2;
664
+ }) });
665
+
666
+ //#endregion
667
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js
668
+ var require_lrucache = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js": ((exports, module) => {
669
+ var LRUCache = class {
670
+ constructor() {
671
+ this.max = 1e3;
672
+ this.map = /* @__PURE__ */ new Map();
673
+ }
674
+ get(key) {
675
+ const value = this.map.get(key);
676
+ if (value === void 0) return;
677
+ else {
678
+ this.map.delete(key);
679
+ this.map.set(key, value);
680
+ return value;
681
+ }
682
+ }
683
+ delete(key) {
684
+ return this.map.delete(key);
685
+ }
686
+ set(key, value) {
687
+ if (!this.delete(key) && value !== void 0) {
688
+ if (this.map.size >= this.max) {
689
+ const firstKey = this.map.keys().next().value;
690
+ this.delete(firstKey);
691
+ }
692
+ this.map.set(key, value);
693
+ }
694
+ return this;
695
+ }
696
+ };
697
+ module.exports = LRUCache;
698
+ }) });
699
+
700
+ //#endregion
701
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js
702
+ var require_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js": ((exports, module) => {
703
+ const SPACE_CHARACTERS = /\s+/g;
704
+ var Range$11 = class Range$11 {
705
+ constructor(range, options) {
706
+ options = parseOptions$1(options);
707
+ if (range instanceof Range$11) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
708
+ else return new Range$11(range.raw, options);
709
+ if (range instanceof Comparator$4) {
710
+ this.raw = range.value;
711
+ this.set = [[range]];
712
+ this.formatted = void 0;
713
+ return this;
714
+ }
715
+ this.options = options;
716
+ this.loose = !!options.loose;
717
+ this.includePrerelease = !!options.includePrerelease;
718
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
719
+ this.set = this.raw.split("||").map((r$1) => this.parseRange(r$1.trim())).filter((c) => c.length);
720
+ if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
721
+ if (this.set.length > 1) {
722
+ const first = this.set[0];
723
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
724
+ if (this.set.length === 0) this.set = [first];
725
+ else if (this.set.length > 1) {
726
+ for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
727
+ this.set = [c];
728
+ break;
729
+ }
730
+ }
731
+ }
732
+ this.formatted = void 0;
733
+ }
734
+ get range() {
735
+ if (this.formatted === void 0) {
736
+ this.formatted = "";
737
+ for (let i$1 = 0; i$1 < this.set.length; i$1++) {
738
+ if (i$1 > 0) this.formatted += "||";
739
+ const comps = this.set[i$1];
740
+ for (let k = 0; k < comps.length; k++) {
741
+ if (k > 0) this.formatted += " ";
742
+ this.formatted += comps[k].toString().trim();
743
+ }
744
+ }
745
+ }
746
+ return this.formatted;
747
+ }
748
+ format() {
749
+ return this.range;
750
+ }
751
+ toString() {
752
+ return this.range;
753
+ }
754
+ parseRange(range) {
755
+ const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
756
+ const cached = cache$1.get(memoKey);
757
+ if (cached) return cached;
758
+ const loose = this.options.loose;
759
+ const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE];
760
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
761
+ debug$1("hyphen replace", range);
762
+ range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
763
+ debug$1("comparator trim", range);
764
+ range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
765
+ debug$1("tilde trim", range);
766
+ range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
767
+ debug$1("caret trim", range);
768
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
769
+ if (loose) rangeList = rangeList.filter((comp) => {
770
+ debug$1("loose invalid filter", comp, this.options);
771
+ return !!comp.match(re$1[t$1.COMPARATORLOOSE]);
772
+ });
773
+ debug$1("range list", rangeList);
774
+ const rangeMap = /* @__PURE__ */ new Map();
775
+ const comparators = rangeList.map((comp) => new Comparator$4(comp, this.options));
776
+ for (const comp of comparators) {
777
+ if (isNullSet(comp)) return [comp];
778
+ rangeMap.set(comp.value, comp);
779
+ }
780
+ if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
781
+ const result = [...rangeMap.values()];
782
+ cache$1.set(memoKey, result);
783
+ return result;
784
+ }
785
+ intersects(range, options) {
786
+ if (!(range instanceof Range$11)) throw new TypeError("a Range is required");
787
+ return this.set.some((thisComparators) => {
788
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
789
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
790
+ return rangeComparators.every((rangeComparator) => {
791
+ return thisComparator.intersects(rangeComparator, options);
792
+ });
793
+ });
794
+ });
795
+ });
796
+ }
797
+ test(version$2) {
798
+ if (!version$2) return false;
799
+ if (typeof version$2 === "string") try {
800
+ version$2 = new SemVer$6(version$2, this.options);
801
+ } catch (er) {
802
+ return false;
803
+ }
804
+ for (let i$1 = 0; i$1 < this.set.length; i$1++) if (testSet(this.set[i$1], version$2, this.options)) return true;
805
+ return false;
806
+ }
807
+ };
808
+ module.exports = Range$11;
809
+ const cache$1 = new (require_lrucache())();
810
+ const parseOptions$1 = require_parse_options();
811
+ const Comparator$4 = require_comparator();
812
+ const debug$1 = require_debug();
813
+ const SemVer$6 = require_semver$1();
814
+ const { safeRe: re$1, t: t$1, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
815
+ const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
816
+ const isNullSet = (c) => c.value === "<0.0.0-0";
817
+ const isAny = (c) => c.value === "";
818
+ const isSatisfiable = (comparators, options) => {
819
+ let result = true;
820
+ const remainingComparators = comparators.slice();
821
+ let testComparator = remainingComparators.pop();
822
+ while (result && remainingComparators.length) {
823
+ result = remainingComparators.every((otherComparator) => {
824
+ return testComparator.intersects(otherComparator, options);
825
+ });
826
+ testComparator = remainingComparators.pop();
827
+ }
828
+ return result;
829
+ };
830
+ const parseComparator = (comp, options) => {
831
+ comp = comp.replace(re$1[t$1.BUILD], "");
832
+ debug$1("comp", comp, options);
833
+ comp = replaceCarets(comp, options);
834
+ debug$1("caret", comp);
835
+ comp = replaceTildes(comp, options);
836
+ debug$1("tildes", comp);
837
+ comp = replaceXRanges(comp, options);
838
+ debug$1("xrange", comp);
839
+ comp = replaceStars(comp, options);
840
+ debug$1("stars", comp);
841
+ return comp;
842
+ };
843
+ const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
844
+ const replaceTildes = (comp, options) => {
845
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
846
+ };
847
+ const replaceTilde = (comp, options) => {
848
+ const r$1 = options.loose ? re$1[t$1.TILDELOOSE] : re$1[t$1.TILDE];
849
+ return comp.replace(r$1, (_, M, m, p, pr) => {
850
+ debug$1("tilde", comp, _, M, m, p, pr);
851
+ let ret;
852
+ if (isX(M)) ret = "";
853
+ else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
854
+ else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
855
+ else if (pr) {
856
+ debug$1("replaceTilde pr", pr);
857
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
858
+ } else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
859
+ debug$1("tilde return", ret);
860
+ return ret;
861
+ });
862
+ };
863
+ const replaceCarets = (comp, options) => {
864
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
865
+ };
866
+ const replaceCaret = (comp, options) => {
867
+ debug$1("caret", comp, options);
868
+ const r$1 = options.loose ? re$1[t$1.CARETLOOSE] : re$1[t$1.CARET];
869
+ const z$1 = options.includePrerelease ? "-0" : "";
870
+ return comp.replace(r$1, (_, M, m, p, pr) => {
871
+ debug$1("caret", comp, _, M, m, p, pr);
872
+ let ret;
873
+ if (isX(M)) ret = "";
874
+ else if (isX(m)) ret = `>=${M}.0.0${z$1} <${+M + 1}.0.0-0`;
875
+ else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z$1} <${M}.${+m + 1}.0-0`;
876
+ else ret = `>=${M}.${m}.0${z$1} <${+M + 1}.0.0-0`;
877
+ else if (pr) {
878
+ debug$1("replaceCaret pr", pr);
879
+ if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
880
+ else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
881
+ else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
882
+ } else {
883
+ debug$1("no pr");
884
+ if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z$1} <${M}.${m}.${+p + 1}-0`;
885
+ else ret = `>=${M}.${m}.${p}${z$1} <${M}.${+m + 1}.0-0`;
886
+ else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
887
+ }
888
+ debug$1("caret return", ret);
889
+ return ret;
890
+ });
891
+ };
892
+ const replaceXRanges = (comp, options) => {
893
+ debug$1("replaceXRanges", comp, options);
894
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
895
+ };
896
+ const replaceXRange = (comp, options) => {
897
+ comp = comp.trim();
898
+ const r$1 = options.loose ? re$1[t$1.XRANGELOOSE] : re$1[t$1.XRANGE];
899
+ return comp.replace(r$1, (ret, gtlt, M, m, p, pr) => {
900
+ debug$1("xRange", comp, ret, gtlt, M, m, p, pr);
901
+ const xM = isX(M);
902
+ const xm = xM || isX(m);
903
+ const xp = xm || isX(p);
904
+ const anyX = xp;
905
+ if (gtlt === "=" && anyX) gtlt = "";
906
+ pr = options.includePrerelease ? "-0" : "";
907
+ if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
908
+ else ret = "*";
909
+ else if (gtlt && anyX) {
910
+ if (xm) m = 0;
911
+ p = 0;
912
+ if (gtlt === ">") {
913
+ gtlt = ">=";
914
+ if (xm) {
915
+ M = +M + 1;
916
+ m = 0;
917
+ p = 0;
918
+ } else {
919
+ m = +m + 1;
920
+ p = 0;
921
+ }
922
+ } else if (gtlt === "<=") {
923
+ gtlt = "<";
924
+ if (xm) M = +M + 1;
925
+ else m = +m + 1;
926
+ }
927
+ if (gtlt === "<") pr = "-0";
928
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
929
+ } else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
930
+ else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
931
+ debug$1("xRange return", ret);
932
+ return ret;
933
+ });
934
+ };
935
+ const replaceStars = (comp, options) => {
936
+ debug$1("replaceStars", comp, options);
937
+ return comp.trim().replace(re$1[t$1.STAR], "");
938
+ };
939
+ const replaceGTE0 = (comp, options) => {
940
+ debug$1("replaceGTE0", comp, options);
941
+ return comp.trim().replace(re$1[options.includePrerelease ? t$1.GTE0PRE : t$1.GTE0], "");
942
+ };
943
+ const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
944
+ if (isX(fM)) from = "";
945
+ else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
946
+ else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
947
+ else if (fpr) from = `>=${from}`;
948
+ else from = `>=${from}${incPr ? "-0" : ""}`;
949
+ if (isX(tM)) to = "";
950
+ else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
951
+ else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
952
+ else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
953
+ else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
954
+ else to = `<=${to}`;
955
+ return `${from} ${to}`.trim();
956
+ };
957
+ const testSet = (set, version$2, options) => {
958
+ for (let i$1 = 0; i$1 < set.length; i$1++) if (!set[i$1].test(version$2)) return false;
959
+ if (version$2.prerelease.length && !options.includePrerelease) {
960
+ for (let i$1 = 0; i$1 < set.length; i$1++) {
961
+ debug$1(set[i$1].semver);
962
+ if (set[i$1].semver === Comparator$4.ANY) continue;
963
+ if (set[i$1].semver.prerelease.length > 0) {
964
+ const allowed = set[i$1].semver;
965
+ if (allowed.major === version$2.major && allowed.minor === version$2.minor && allowed.patch === version$2.patch) return true;
966
+ }
967
+ }
968
+ return false;
969
+ }
970
+ return true;
971
+ };
972
+ }) });
973
+
974
+ //#endregion
975
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js
976
+ var require_comparator = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js": ((exports, module) => {
977
+ const ANY$2 = Symbol("SemVer ANY");
978
+ var Comparator$3 = class Comparator$3 {
979
+ static get ANY() {
980
+ return ANY$2;
981
+ }
982
+ constructor(comp, options) {
983
+ options = parseOptions(options);
984
+ if (comp instanceof Comparator$3) if (comp.loose === !!options.loose) return comp;
985
+ else comp = comp.value;
986
+ comp = comp.trim().split(/\s+/).join(" ");
987
+ debug("comparator", comp, options);
988
+ this.options = options;
989
+ this.loose = !!options.loose;
990
+ this.parse(comp);
991
+ if (this.semver === ANY$2) this.value = "";
992
+ else this.value = this.operator + this.semver.version;
993
+ debug("comp", this);
994
+ }
995
+ parse(comp) {
996
+ const r$1 = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
997
+ const m = comp.match(r$1);
998
+ if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
999
+ this.operator = m[1] !== void 0 ? m[1] : "";
1000
+ if (this.operator === "=") this.operator = "";
1001
+ if (!m[2]) this.semver = ANY$2;
1002
+ else this.semver = new SemVer$5(m[2], this.options.loose);
1003
+ }
1004
+ toString() {
1005
+ return this.value;
1006
+ }
1007
+ test(version$2) {
1008
+ debug("Comparator.test", version$2, this.options.loose);
1009
+ if (this.semver === ANY$2 || version$2 === ANY$2) return true;
1010
+ if (typeof version$2 === "string") try {
1011
+ version$2 = new SemVer$5(version$2, this.options);
1012
+ } catch (er) {
1013
+ return false;
1014
+ }
1015
+ return cmp$1(version$2, this.operator, this.semver, this.options);
1016
+ }
1017
+ intersects(comp, options) {
1018
+ if (!(comp instanceof Comparator$3)) throw new TypeError("a Comparator is required");
1019
+ if (this.operator === "") {
1020
+ if (this.value === "") return true;
1021
+ return new Range$10(comp.value, options).test(this.value);
1022
+ } else if (comp.operator === "") {
1023
+ if (comp.value === "") return true;
1024
+ return new Range$10(this.value, options).test(comp.semver);
1025
+ }
1026
+ options = parseOptions(options);
1027
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
1028
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
1029
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
1030
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
1031
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
1032
+ if (cmp$1(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
1033
+ if (cmp$1(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
1034
+ return false;
1035
+ }
1036
+ };
1037
+ module.exports = Comparator$3;
1038
+ const parseOptions = require_parse_options();
1039
+ const { safeRe: re, t } = require_re();
1040
+ const cmp$1 = require_cmp();
1041
+ const debug = require_debug();
1042
+ const SemVer$5 = require_semver$1();
1043
+ const Range$10 = require_range();
1044
+ }) });
1045
+
1046
+ //#endregion
1047
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js
1048
+ var require_satisfies = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js": ((exports, module) => {
1049
+ const Range$9 = require_range();
1050
+ const satisfies$5 = (version$2, range, options) => {
1051
+ try {
1052
+ range = new Range$9(range, options);
1053
+ } catch (er) {
1054
+ return false;
1055
+ }
1056
+ return range.test(version$2);
1057
+ };
1058
+ module.exports = satisfies$5;
1059
+ }) });
1060
+
1061
+ //#endregion
1062
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js
1063
+ var require_to_comparators = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js": ((exports, module) => {
1064
+ const Range$8 = require_range();
1065
+ const toComparators$1 = (range, options) => new Range$8(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1066
+ module.exports = toComparators$1;
1067
+ }) });
1068
+
1069
+ //#endregion
1070
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js
1071
+ var require_max_satisfying = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js": ((exports, module) => {
1072
+ const SemVer$4 = require_semver$1();
1073
+ const Range$7 = require_range();
1074
+ const maxSatisfying$1 = (versions, range, options) => {
1075
+ let max = null;
1076
+ let maxSV = null;
1077
+ let rangeObj = null;
1078
+ try {
1079
+ rangeObj = new Range$7(range, options);
1080
+ } catch (er) {
1081
+ return null;
1082
+ }
1083
+ versions.forEach((v) => {
1084
+ if (rangeObj.test(v)) {
1085
+ if (!max || maxSV.compare(v) === -1) {
1086
+ max = v;
1087
+ maxSV = new SemVer$4(max, options);
1088
+ }
1089
+ }
1090
+ });
1091
+ return max;
1092
+ };
1093
+ module.exports = maxSatisfying$1;
1094
+ }) });
1095
+
1096
+ //#endregion
1097
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js
1098
+ var require_min_satisfying = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js": ((exports, module) => {
1099
+ const SemVer$3 = require_semver$1();
1100
+ const Range$6 = require_range();
1101
+ const minSatisfying$1 = (versions, range, options) => {
1102
+ let min = null;
1103
+ let minSV = null;
1104
+ let rangeObj = null;
1105
+ try {
1106
+ rangeObj = new Range$6(range, options);
1107
+ } catch (er) {
1108
+ return null;
1109
+ }
1110
+ versions.forEach((v) => {
1111
+ if (rangeObj.test(v)) {
1112
+ if (!min || minSV.compare(v) === 1) {
1113
+ min = v;
1114
+ minSV = new SemVer$3(min, options);
1115
+ }
1116
+ }
1117
+ });
1118
+ return min;
1119
+ };
1120
+ module.exports = minSatisfying$1;
1121
+ }) });
1122
+
1123
+ //#endregion
1124
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js
1125
+ var require_min_version = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js": ((exports, module) => {
1126
+ const SemVer$2 = require_semver$1();
1127
+ const Range$5 = require_range();
1128
+ const gt$2 = require_gt();
1129
+ const minVersion$1 = (range, loose) => {
1130
+ range = new Range$5(range, loose);
1131
+ let minver = new SemVer$2("0.0.0");
1132
+ if (range.test(minver)) return minver;
1133
+ minver = new SemVer$2("0.0.0-0");
1134
+ if (range.test(minver)) return minver;
1135
+ minver = null;
1136
+ for (let i$1 = 0; i$1 < range.set.length; ++i$1) {
1137
+ const comparators = range.set[i$1];
1138
+ let setMin = null;
1139
+ comparators.forEach((comparator) => {
1140
+ const compver = new SemVer$2(comparator.semver.version);
1141
+ switch (comparator.operator) {
1142
+ case ">":
1143
+ if (compver.prerelease.length === 0) compver.patch++;
1144
+ else compver.prerelease.push(0);
1145
+ compver.raw = compver.format();
1146
+ case "":
1147
+ case ">=":
1148
+ if (!setMin || gt$2(compver, setMin)) setMin = compver;
1149
+ break;
1150
+ case "<":
1151
+ case "<=": break;
1152
+ default: throw new Error(`Unexpected operation: ${comparator.operator}`);
1153
+ }
1154
+ });
1155
+ if (setMin && (!minver || gt$2(minver, setMin))) minver = setMin;
1156
+ }
1157
+ if (minver && range.test(minver)) return minver;
1158
+ return null;
1159
+ };
1160
+ module.exports = minVersion$1;
1161
+ }) });
1162
+
1163
+ //#endregion
1164
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js
1165
+ var require_valid = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js": ((exports, module) => {
1166
+ const Range$4 = require_range();
1167
+ const validRange$1 = (range, options) => {
1168
+ try {
1169
+ return new Range$4(range, options).range || "*";
1170
+ } catch (er) {
1171
+ return null;
1172
+ }
1173
+ };
1174
+ module.exports = validRange$1;
1175
+ }) });
1176
+
1177
+ //#endregion
1178
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js
1179
+ var require_outside = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js": ((exports, module) => {
1180
+ const SemVer$1 = require_semver$1();
1181
+ const Comparator$2 = require_comparator();
1182
+ const { ANY: ANY$1 } = Comparator$2;
1183
+ const Range$3 = require_range();
1184
+ const satisfies$4 = require_satisfies();
1185
+ const gt$1 = require_gt();
1186
+ const lt$1 = require_lt();
1187
+ const lte$1 = require_lte();
1188
+ const gte$1 = require_gte();
1189
+ const outside$3 = (version$2, range, hilo, options) => {
1190
+ version$2 = new SemVer$1(version$2, options);
1191
+ range = new Range$3(range, options);
1192
+ let gtfn, ltefn, ltfn, comp, ecomp;
1193
+ switch (hilo) {
1194
+ case ">":
1195
+ gtfn = gt$1;
1196
+ ltefn = lte$1;
1197
+ ltfn = lt$1;
1198
+ comp = ">";
1199
+ ecomp = ">=";
1200
+ break;
1201
+ case "<":
1202
+ gtfn = lt$1;
1203
+ ltefn = gte$1;
1204
+ ltfn = gt$1;
1205
+ comp = "<";
1206
+ ecomp = "<=";
1207
+ break;
1208
+ default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
1209
+ }
1210
+ if (satisfies$4(version$2, range, options)) return false;
1211
+ for (let i$1 = 0; i$1 < range.set.length; ++i$1) {
1212
+ const comparators = range.set[i$1];
1213
+ let high = null;
1214
+ let low = null;
1215
+ comparators.forEach((comparator) => {
1216
+ if (comparator.semver === ANY$1) comparator = new Comparator$2(">=0.0.0");
1217
+ high = high || comparator;
1218
+ low = low || comparator;
1219
+ if (gtfn(comparator.semver, high.semver, options)) high = comparator;
1220
+ else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
1221
+ });
1222
+ if (high.operator === comp || high.operator === ecomp) return false;
1223
+ if ((!low.operator || low.operator === comp) && ltefn(version$2, low.semver)) return false;
1224
+ else if (low.operator === ecomp && ltfn(version$2, low.semver)) return false;
1225
+ }
1226
+ return true;
1227
+ };
1228
+ module.exports = outside$3;
1229
+ }) });
1230
+
1231
+ //#endregion
1232
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js
1233
+ var require_gtr = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js": ((exports, module) => {
1234
+ const outside$2 = require_outside();
1235
+ const gtr$1 = (version$2, range, options) => outside$2(version$2, range, ">", options);
1236
+ module.exports = gtr$1;
1237
+ }) });
1238
+
1239
+ //#endregion
1240
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js
1241
+ var require_ltr = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js": ((exports, module) => {
1242
+ const outside$1 = require_outside();
1243
+ const ltr$1 = (version$2, range, options) => outside$1(version$2, range, "<", options);
1244
+ module.exports = ltr$1;
1245
+ }) });
1246
+
1247
+ //#endregion
1248
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js
1249
+ var require_intersects = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js": ((exports, module) => {
1250
+ const Range$2 = require_range();
1251
+ const intersects$1 = (r1, r2, options) => {
1252
+ r1 = new Range$2(r1, options);
1253
+ r2 = new Range$2(r2, options);
1254
+ return r1.intersects(r2, options);
1255
+ };
1256
+ module.exports = intersects$1;
1257
+ }) });
1258
+
1259
+ //#endregion
1260
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js
1261
+ var require_simplify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js": ((exports, module) => {
1262
+ const satisfies$3 = require_satisfies();
1263
+ const compare$2 = require_compare();
1264
+ module.exports = (versions, range, options) => {
1265
+ const set = [];
1266
+ let first = null;
1267
+ let prev = null;
1268
+ const v = versions.sort((a, b) => compare$2(a, b, options));
1269
+ for (const version$2 of v) if (satisfies$3(version$2, range, options)) {
1270
+ prev = version$2;
1271
+ if (!first) first = version$2;
1272
+ } else {
1273
+ if (prev) set.push([first, prev]);
1274
+ prev = null;
1275
+ first = null;
1276
+ }
1277
+ if (first) set.push([first, null]);
1278
+ const ranges = [];
1279
+ for (const [min, max] of set) if (min === max) ranges.push(min);
1280
+ else if (!max && min === v[0]) ranges.push("*");
1281
+ else if (!max) ranges.push(`>=${min}`);
1282
+ else if (min === v[0]) ranges.push(`<=${max}`);
1283
+ else ranges.push(`${min} - ${max}`);
1284
+ const simplified = ranges.join(" || ");
1285
+ const original = typeof range.raw === "string" ? range.raw : String(range);
1286
+ return simplified.length < original.length ? simplified : range;
1287
+ };
1288
+ }) });
1289
+
1290
+ //#endregion
1291
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js
1292
+ var require_subset = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js": ((exports, module) => {
1293
+ const Range$1 = require_range();
1294
+ const Comparator$1 = require_comparator();
1295
+ const { ANY } = Comparator$1;
1296
+ const satisfies$2 = require_satisfies();
1297
+ const compare$1 = require_compare();
1298
+ const subset$1 = (sub, dom, options = {}) => {
1299
+ if (sub === dom) return true;
1300
+ sub = new Range$1(sub, options);
1301
+ dom = new Range$1(dom, options);
1302
+ let sawNonNull = false;
1303
+ OUTER: for (const simpleSub of sub.set) {
1304
+ for (const simpleDom of dom.set) {
1305
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
1306
+ sawNonNull = sawNonNull || isSub !== null;
1307
+ if (isSub) continue OUTER;
1308
+ }
1309
+ if (sawNonNull) return false;
1310
+ }
1311
+ return true;
1312
+ };
1313
+ const minimumVersionWithPreRelease = [new Comparator$1(">=0.0.0-0")];
1314
+ const minimumVersion = [new Comparator$1(">=0.0.0")];
1315
+ const simpleSubset = (sub, dom, options) => {
1316
+ if (sub === dom) return true;
1317
+ if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
1318
+ else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
1319
+ else sub = minimumVersion;
1320
+ if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
1321
+ else dom = minimumVersion;
1322
+ const eqSet = /* @__PURE__ */ new Set();
1323
+ let gt$5, lt$4;
1324
+ for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt$5 = higherGT(gt$5, c, options);
1325
+ else if (c.operator === "<" || c.operator === "<=") lt$4 = lowerLT(lt$4, c, options);
1326
+ else eqSet.add(c.semver);
1327
+ if (eqSet.size > 1) return null;
1328
+ let gtltComp;
1329
+ if (gt$5 && lt$4) {
1330
+ gtltComp = compare$1(gt$5.semver, lt$4.semver, options);
1331
+ if (gtltComp > 0) return null;
1332
+ else if (gtltComp === 0 && (gt$5.operator !== ">=" || lt$4.operator !== "<=")) return null;
1333
+ }
1334
+ for (const eq$3 of eqSet) {
1335
+ if (gt$5 && !satisfies$2(eq$3, String(gt$5), options)) return null;
1336
+ if (lt$4 && !satisfies$2(eq$3, String(lt$4), options)) return null;
1337
+ for (const c of dom) if (!satisfies$2(eq$3, String(c), options)) return false;
1338
+ return true;
1339
+ }
1340
+ let higher, lower;
1341
+ let hasDomLT, hasDomGT;
1342
+ let needDomLTPre = lt$4 && !options.includePrerelease && lt$4.semver.prerelease.length ? lt$4.semver : false;
1343
+ let needDomGTPre = gt$5 && !options.includePrerelease && gt$5.semver.prerelease.length ? gt$5.semver : false;
1344
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt$4.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
1345
+ for (const c of dom) {
1346
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1347
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1348
+ if (gt$5) {
1349
+ if (needDomGTPre) {
1350
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
1351
+ }
1352
+ if (c.operator === ">" || c.operator === ">=") {
1353
+ higher = higherGT(gt$5, c, options);
1354
+ if (higher === c && higher !== gt$5) return false;
1355
+ } else if (gt$5.operator === ">=" && !satisfies$2(gt$5.semver, String(c), options)) return false;
1356
+ }
1357
+ if (lt$4) {
1358
+ if (needDomLTPre) {
1359
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
1360
+ }
1361
+ if (c.operator === "<" || c.operator === "<=") {
1362
+ lower = lowerLT(lt$4, c, options);
1363
+ if (lower === c && lower !== lt$4) return false;
1364
+ } else if (lt$4.operator === "<=" && !satisfies$2(lt$4.semver, String(c), options)) return false;
1365
+ }
1366
+ if (!c.operator && (lt$4 || gt$5) && gtltComp !== 0) return false;
1367
+ }
1368
+ if (gt$5 && hasDomLT && !lt$4 && gtltComp !== 0) return false;
1369
+ if (lt$4 && hasDomGT && !gt$5 && gtltComp !== 0) return false;
1370
+ if (needDomGTPre || needDomLTPre) return false;
1371
+ return true;
1372
+ };
1373
+ const higherGT = (a, b, options) => {
1374
+ if (!a) return b;
1375
+ const comp = compare$1(a.semver, b.semver, options);
1376
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1377
+ };
1378
+ const lowerLT = (a, b, options) => {
1379
+ if (!a) return b;
1380
+ const comp = compare$1(a.semver, b.semver, options);
1381
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1382
+ };
1383
+ module.exports = subset$1;
1384
+ }) });
1385
+
1386
+ //#endregion
1387
+ //#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js
1388
+ var require_semver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js": ((exports, module) => {
1389
+ const internalRe = require_re();
1390
+ const constants = require_constants();
1391
+ const SemVer = require_semver$1();
1392
+ const identifiers = require_identifiers();
1393
+ const parse = require_parse();
1394
+ const valid = require_valid$1();
1395
+ const clean = require_clean();
1396
+ const inc = require_inc();
1397
+ const diff = require_diff();
1398
+ const major = require_major();
1399
+ const minor = require_minor();
1400
+ const patch = require_patch();
1401
+ const prerelease = require_prerelease();
1402
+ const compare = require_compare();
1403
+ const rcompare = require_rcompare();
1404
+ const compareLoose = require_compare_loose();
1405
+ const compareBuild = require_compare_build();
1406
+ const sort = require_sort();
1407
+ const rsort = require_rsort();
1408
+ const gt = require_gt();
1409
+ const lt = require_lt();
1410
+ const eq = require_eq();
1411
+ const neq = require_neq();
1412
+ const gte = require_gte();
1413
+ const lte = require_lte();
1414
+ const cmp = require_cmp();
1415
+ const coerce$1 = require_coerce();
1416
+ const Comparator = require_comparator();
1417
+ const Range = require_range();
1418
+ const satisfies$1 = require_satisfies();
1419
+ const toComparators = require_to_comparators();
1420
+ const maxSatisfying = require_max_satisfying();
1421
+ const minSatisfying = require_min_satisfying();
1422
+ const minVersion = require_min_version();
1423
+ const validRange = require_valid();
1424
+ const outside = require_outside();
1425
+ const gtr = require_gtr();
1426
+ const ltr = require_ltr();
1427
+ const intersects = require_intersects();
1428
+ const simplifyRange = require_simplify();
1429
+ const subset = require_subset();
1430
+ module.exports = {
1431
+ parse,
1432
+ valid,
1433
+ clean,
1434
+ inc,
1435
+ diff,
1436
+ major,
1437
+ minor,
1438
+ patch,
1439
+ prerelease,
1440
+ compare,
1441
+ rcompare,
1442
+ compareLoose,
1443
+ compareBuild,
1444
+ sort,
1445
+ rsort,
1446
+ gt,
1447
+ lt,
1448
+ eq,
1449
+ neq,
1450
+ gte,
1451
+ lte,
1452
+ cmp,
1453
+ coerce: coerce$1,
1454
+ Comparator,
1455
+ Range,
1456
+ satisfies: satisfies$1,
1457
+ toComparators,
1458
+ maxSatisfying,
1459
+ minSatisfying,
1460
+ minVersion,
1461
+ validRange,
1462
+ outside,
1463
+ gtr,
1464
+ ltr,
1465
+ intersects,
1466
+ simplifyRange,
1467
+ subset,
1468
+ SemVer,
1469
+ re: internalRe.re,
1470
+ src: internalRe.src,
1471
+ tokens: internalRe.t,
1472
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
1473
+ RELEASE_TYPES: constants.RELEASE_TYPES,
1474
+ compareIdentifiers: identifiers.compareIdentifiers,
1475
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
1476
+ };
1477
+ }) });
1478
+
1479
+ //#endregion
1480
+ //#region src/assert-wrangler-version.ts
1481
+ var import_semver = require_semver();
1482
+ /**
1483
+ * Asserts that the installed version of Wrangler that gets pulled in at runtime by the `@cloudflare/vite-plugin`
1484
+ * matches the version that `@cloudflare/vite-plugin` actually depends upon.
1485
+ *
1486
+ * This can sometime be broken by package managers that deduplicate dependencies, such as `pnpm`.
1487
+ */
1488
+ async function assertWranglerVersion() {
1489
+ const installedVersion = (await import("wrangler/package.json", { with: { type: "json" } })).default.version;
1490
+ const peerDependency = (await import("../package.json", { with: { type: "json" } })).default.peerDependencies.wrangler;
1491
+ if (peerDependency.startsWith("workspace:")) return;
1492
+ if (!(0, import_semver.satisfies)(installedVersion, peerDependency)) throw new Error(`The installed version of Wrangler (${installedVersion}) does not satisfy the peer dependency required by @cloudflare/vite-plugin (${peerDependency}).\nPlease install wrangler@${peerDependency}.`);
1493
+ }
1494
+
52
1495
  //#endregion
53
1496
  //#region src/utils.ts
1497
+ var import_gte = /* @__PURE__ */ __toESM(require_gte(), 1);
54
1498
  const debuglog = util$1.debuglog("@cloudflare:vite-plugin");
55
1499
  /**
56
1500
  * Creates an internal plugin to be used inside the main `vite-plugin-cloudflare` plugin.
@@ -67,14 +1511,14 @@ function createPlugin(name, pluginFactory) {
67
1511
  }
68
1512
  function getOutputDirectory(userConfig, environmentName) {
69
1513
  const rootOutputDirectory = userConfig.build?.outDir ?? "dist";
70
- return userConfig.environments?.[environmentName]?.build?.outDir ?? path$1.join(rootOutputDirectory, environmentName);
1514
+ return userConfig.environments?.[environmentName]?.build?.outDir ?? nodePath.join(rootOutputDirectory, environmentName);
71
1515
  }
72
1516
  const postfixRE = /[?#].*$/;
73
1517
  function cleanUrl(url) {
74
1518
  return url.replace(postfixRE, "");
75
1519
  }
76
- function withTrailingSlash(path$2) {
77
- return path$2.endsWith("/") ? path$2 : `${path$2}/`;
1520
+ function withTrailingSlash(path$1) {
1521
+ return path$1.endsWith("/") ? path$1 : `${path$1}/`;
78
1522
  }
79
1523
  function createRequestHandler(handler) {
80
1524
  return async (req, res, next) => {
@@ -94,6 +1538,9 @@ function createRequestHandler(handler) {
94
1538
  }
95
1539
  };
96
1540
  }
1541
+ function satisfiesViteVersion(minVersion$2) {
1542
+ return (0, import_gte.default)(version, minVersion$2);
1543
+ }
97
1544
  function toMiniflareRequest(request$1) {
98
1545
  const host = request$1.headers.get("Host");
99
1546
  const xForwardedHost = request$1.headers.get("X-Forwarded-Host");
@@ -117,7 +1564,7 @@ function getWorkerNameToWorkerEntrypointExportsMap(workers) {
117
1564
  return workerNameToWorkerEntrypointExportsMap;
118
1565
  }
119
1566
  function getWorkerNameToDurableObjectExportsMap(workers) {
120
- const workerNameToDurableObjectExportsMap = new Map(workers.map((worker) => [worker.config.name, new Set(unstable_getDurableObjectClassNameToUseSQLiteMap(worker.config.migrations).keys())]));
1567
+ const workerNameToDurableObjectExportsMap = new Map(workers.map((worker) => [worker.config.name, new Set(wrangler.unstable_getDurableObjectClassNameToUseSQLiteMap(worker.config.migrations).keys())]));
121
1568
  for (const worker of workers) for (const value of worker.config.durable_objects.bindings) if (value.script_name) workerNameToDurableObjectExportsMap.get(value.script_name)?.add(value.class_name);
122
1569
  else workerNameToDurableObjectExportsMap.get(worker.config.name)?.add(value.class_name);
123
1570
  return workerNameToDurableObjectExportsMap;
@@ -266,6 +1713,13 @@ var PluginContext = class {
266
1713
  getWorkerConfig(environmentName) {
267
1714
  return this.resolvedPluginConfig.type === "workers" ? this.resolvedPluginConfig.environmentNameToWorkerMap.get(environmentName)?.config : void 0;
268
1715
  }
1716
+ get allWorkerConfigs() {
1717
+ switch (this.resolvedPluginConfig.type) {
1718
+ case "workers": return Array.from(this.resolvedPluginConfig.environmentNameToWorkerMap.values()).map((worker) => worker.config);
1719
+ case "preview": return this.resolvedPluginConfig.workers;
1720
+ default: return [];
1721
+ }
1722
+ }
269
1723
  get entryWorkerConfig() {
270
1724
  if (this.resolvedPluginConfig.type !== "workers") return;
271
1725
  return this.resolvedPluginConfig.environmentNameToWorkerMap.get(this.resolvedPluginConfig.entryWorkerEnvironmentName)?.config;
@@ -356,21 +1810,22 @@ const formatInvalidRoutes = (invalidRules) => {
356
1810
  //#endregion
357
1811
  //#region src/deploy-config.ts
358
1812
  function getDeployConfigPath(root) {
359
- return path$1.resolve(root, ".wrangler", "deploy", "config.json");
1813
+ return nodePath.resolve(root, ".wrangler", "deploy", "config.json");
360
1814
  }
361
1815
  function getWorkerConfigs(root) {
362
1816
  const deployConfigPath = getDeployConfigPath(root);
363
1817
  const deployConfig = JSON.parse(fs$1.readFileSync(deployConfigPath, "utf-8"));
364
1818
  return [{ configPath: deployConfig.configPath }, ...deployConfig.auxiliaryWorkers].map(({ configPath }) => {
365
- return unstable_readConfig({ config: path$1.resolve(path$1.dirname(deployConfigPath), configPath) });
1819
+ const resolvedConfigPath = nodePath.resolve(nodePath.dirname(deployConfigPath), configPath);
1820
+ return wrangler.unstable_readConfig({ config: resolvedConfigPath });
366
1821
  });
367
1822
  }
368
1823
  function getRelativePathToWorkerConfig(deployConfigDirectory, root, outputDirectory) {
369
- return path$1.relative(deployConfigDirectory, path$1.resolve(root, outputDirectory, "wrangler.json"));
1824
+ return nodePath.relative(deployConfigDirectory, nodePath.resolve(root, outputDirectory, "wrangler.json"));
370
1825
  }
371
1826
  function writeDeployConfig(resolvedPluginConfig, resolvedViteConfig) {
372
1827
  const deployConfigPath = getDeployConfigPath(resolvedViteConfig.root);
373
- const deployConfigDirectory = path$1.dirname(deployConfigPath);
1828
+ const deployConfigDirectory = nodePath.dirname(deployConfigPath);
374
1829
  fs$1.mkdirSync(deployConfigDirectory, { recursive: true });
375
1830
  if (resolvedPluginConfig.type === "assets-only") {
376
1831
  const clientOutputDirectory = resolvedViteConfig.environments.client?.build.outDir;
@@ -1700,7 +3155,7 @@ var prototypeAccessors = {
1700
3155
  allowNewDotTarget: { configurable: true },
1701
3156
  inClassStaticBlock: { configurable: true }
1702
3157
  };
1703
- Parser.prototype.parse = function parse() {
3158
+ Parser.prototype.parse = function parse$7() {
1704
3159
  var node = this.options.program || this.startNode();
1705
3160
  this.nextToken();
1706
3161
  return this.parseTopLevel(node);
@@ -1750,7 +3205,7 @@ Parser.extend = function extend() {
1750
3205
  for (var i$1 = 0; i$1 < plugins.length; i$1++) cls = plugins[i$1](cls);
1751
3206
  return cls;
1752
3207
  };
1753
- Parser.parse = function parse(input, options) {
3208
+ Parser.parse = function parse$7(input, options) {
1754
3209
  return new this(options, input).parse();
1755
3210
  };
1756
3211
  Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) {
@@ -1852,10 +3307,10 @@ pp$9.isSimpleAssignTarget = function(expr) {
1852
3307
  };
1853
3308
  var pp$8 = Parser.prototype;
1854
3309
  pp$8.parseTopLevel = function(node) {
1855
- var exports = Object.create(null);
3310
+ var exports$1 = Object.create(null);
1856
3311
  if (!node.body) node.body = [];
1857
3312
  while (this.type !== types$1$1.eof) {
1858
- var stmt = this.parseStatement(null, true, exports);
3313
+ var stmt = this.parseStatement(null, true, exports$1);
1859
3314
  node.body.push(stmt);
1860
3315
  }
1861
3316
  if (this.inModule) for (var i$1 = 0, list$1 = Object.keys(this.undefinedExports); i$1 < list$1.length; i$1 += 1) {
@@ -1892,7 +3347,7 @@ pp$8.isAsyncFunction = function() {
1892
3347
  var next = this.pos + skip[0].length, after;
1893
3348
  return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320));
1894
3349
  };
1895
- pp$8.parseStatement = function(context, topLevel, exports) {
3350
+ pp$8.parseStatement = function(context, topLevel, exports$1) {
1896
3351
  var starttype = this.type, node = this.startNode(), kind;
1897
3352
  if (this.isLet(context)) {
1898
3353
  starttype = types$1$1._var;
@@ -1936,7 +3391,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
1936
3391
  if (!topLevel) this.raise(this.start, "'import' and 'export' may only appear at the top level");
1937
3392
  if (!this.inModule) this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
1938
3393
  }
1939
- return starttype === types$1$1._import ? this.parseImport(node) : this.parseExport(node, exports);
3394
+ return starttype === types$1$1._import ? this.parseImport(node) : this.parseExport(node, exports$1);
1940
3395
  default:
1941
3396
  if (this.isAsyncFunction()) {
1942
3397
  if (context) this.unexpected();
@@ -2425,10 +3880,10 @@ function checkKeyName(node, name) {
2425
3880
  var key = node.key;
2426
3881
  return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
2427
3882
  }
2428
- pp$8.parseExportAllDeclaration = function(node, exports) {
3883
+ pp$8.parseExportAllDeclaration = function(node, exports$1) {
2429
3884
  if (this.options.ecmaVersion >= 11) if (this.eatContextual("as")) {
2430
3885
  node.exported = this.parseModuleExportName();
2431
- this.checkExport(exports, node.exported, this.lastTokStart);
3886
+ this.checkExport(exports$1, node.exported, this.lastTokStart);
2432
3887
  } else node.exported = null;
2433
3888
  this.expectContextual("from");
2434
3889
  if (this.type !== types$1$1.string) this.unexpected();
@@ -2437,23 +3892,23 @@ pp$8.parseExportAllDeclaration = function(node, exports) {
2437
3892
  this.semicolon();
2438
3893
  return this.finishNode(node, "ExportAllDeclaration");
2439
3894
  };
2440
- pp$8.parseExport = function(node, exports) {
3895
+ pp$8.parseExport = function(node, exports$1) {
2441
3896
  this.next();
2442
- if (this.eat(types$1$1.star)) return this.parseExportAllDeclaration(node, exports);
3897
+ if (this.eat(types$1$1.star)) return this.parseExportAllDeclaration(node, exports$1);
2443
3898
  if (this.eat(types$1$1._default)) {
2444
- this.checkExport(exports, "default", this.lastTokStart);
3899
+ this.checkExport(exports$1, "default", this.lastTokStart);
2445
3900
  node.declaration = this.parseExportDefaultDeclaration();
2446
3901
  return this.finishNode(node, "ExportDefaultDeclaration");
2447
3902
  }
2448
3903
  if (this.shouldParseExportStatement()) {
2449
3904
  node.declaration = this.parseExportDeclaration(node);
2450
- if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports, node.declaration.declarations);
2451
- else this.checkExport(exports, node.declaration.id, node.declaration.id.start);
3905
+ if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports$1, node.declaration.declarations);
3906
+ else this.checkExport(exports$1, node.declaration.id, node.declaration.id.start);
2452
3907
  node.specifiers = [];
2453
3908
  node.source = null;
2454
3909
  } else {
2455
3910
  node.declaration = null;
2456
- node.specifiers = this.parseExportSpecifiers(exports);
3911
+ node.specifiers = this.parseExportSpecifiers(exports$1);
2457
3912
  if (this.eatContextual("from")) {
2458
3913
  if (this.type !== types$1$1.string) this.unexpected();
2459
3914
  node.source = this.parseExprAtom();
@@ -2490,45 +3945,45 @@ pp$8.parseExportDefaultDeclaration = function() {
2490
3945
  return declaration;
2491
3946
  }
2492
3947
  };
2493
- pp$8.checkExport = function(exports, name, pos) {
2494
- if (!exports) return;
3948
+ pp$8.checkExport = function(exports$1, name, pos) {
3949
+ if (!exports$1) return;
2495
3950
  if (typeof name !== "string") name = name.type === "Identifier" ? name.name : name.value;
2496
- if (hasOwn(exports, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
2497
- exports[name] = true;
3951
+ if (hasOwn(exports$1, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
3952
+ exports$1[name] = true;
2498
3953
  };
2499
- pp$8.checkPatternExport = function(exports, pat) {
3954
+ pp$8.checkPatternExport = function(exports$1, pat) {
2500
3955
  var type = pat.type;
2501
- if (type === "Identifier") this.checkExport(exports, pat, pat.start);
3956
+ if (type === "Identifier") this.checkExport(exports$1, pat, pat.start);
2502
3957
  else if (type === "ObjectPattern") for (var i$1 = 0, list$1 = pat.properties; i$1 < list$1.length; i$1 += 1) {
2503
3958
  var prop = list$1[i$1];
2504
- this.checkPatternExport(exports, prop);
3959
+ this.checkPatternExport(exports$1, prop);
2505
3960
  }
2506
3961
  else if (type === "ArrayPattern") for (var i$1$1 = 0, list$1$1 = pat.elements; i$1$1 < list$1$1.length; i$1$1 += 1) {
2507
3962
  var elt = list$1$1[i$1$1];
2508
- if (elt) this.checkPatternExport(exports, elt);
3963
+ if (elt) this.checkPatternExport(exports$1, elt);
2509
3964
  }
2510
- else if (type === "Property") this.checkPatternExport(exports, pat.value);
2511
- else if (type === "AssignmentPattern") this.checkPatternExport(exports, pat.left);
2512
- else if (type === "RestElement") this.checkPatternExport(exports, pat.argument);
3965
+ else if (type === "Property") this.checkPatternExport(exports$1, pat.value);
3966
+ else if (type === "AssignmentPattern") this.checkPatternExport(exports$1, pat.left);
3967
+ else if (type === "RestElement") this.checkPatternExport(exports$1, pat.argument);
2513
3968
  };
2514
- pp$8.checkVariableExport = function(exports, decls) {
2515
- if (!exports) return;
3969
+ pp$8.checkVariableExport = function(exports$1, decls) {
3970
+ if (!exports$1) return;
2516
3971
  for (var i$1 = 0, list$1 = decls; i$1 < list$1.length; i$1 += 1) {
2517
3972
  var decl = list$1[i$1];
2518
- this.checkPatternExport(exports, decl.id);
3973
+ this.checkPatternExport(exports$1, decl.id);
2519
3974
  }
2520
3975
  };
2521
3976
  pp$8.shouldParseExportStatement = function() {
2522
3977
  return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
2523
3978
  };
2524
- pp$8.parseExportSpecifier = function(exports) {
3979
+ pp$8.parseExportSpecifier = function(exports$1) {
2525
3980
  var node = this.startNode();
2526
3981
  node.local = this.parseModuleExportName();
2527
3982
  node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
2528
- this.checkExport(exports, node.exported, node.exported.start);
3983
+ this.checkExport(exports$1, node.exported, node.exported.start);
2529
3984
  return this.finishNode(node, "ExportSpecifier");
2530
3985
  };
2531
- pp$8.parseExportSpecifiers = function(exports) {
3986
+ pp$8.parseExportSpecifiers = function(exports$1) {
2532
3987
  var nodes = [], first = true;
2533
3988
  this.expect(types$1$1.braceL);
2534
3989
  while (!this.eat(types$1$1.braceR)) {
@@ -2536,7 +3991,7 @@ pp$8.parseExportSpecifiers = function(exports) {
2536
3991
  this.expect(types$1$1.comma);
2537
3992
  if (this.afterTrailingComma(types$1$1.braceR)) break;
2538
3993
  } else first = false;
2539
- nodes.push(this.parseExportSpecifier(exports));
3994
+ nodes.push(this.parseExportSpecifier(exports$1));
2540
3995
  }
2541
3996
  return nodes;
2542
3997
  };
@@ -5351,10 +6806,10 @@ pp.readWord = function() {
5351
6806
  if (this.keywords.test(word)) type = keywords[word];
5352
6807
  return this.finishToken(type, word);
5353
6808
  };
5354
- var version = "8.14.0";
6809
+ var version$1 = "8.14.0";
5355
6810
  Parser.acorn = {
5356
6811
  Parser,
5357
- version,
6812
+ version: version$1,
5358
6813
  defaultOptions,
5359
6814
  Position,
5360
6815
  SourceLocation,
@@ -5386,15 +6841,15 @@ function hasTrailingSlash(input = "", respectQueryAndFragment) {
5386
6841
  function withTrailingSlash$1(input = "", respectQueryAndFragment) {
5387
6842
  if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
5388
6843
  if (hasTrailingSlash(input, true)) return input || "/";
5389
- let path$2 = input;
6844
+ let path$1 = input;
5390
6845
  let fragment = "";
5391
6846
  const fragmentIndex = input.indexOf("#");
5392
6847
  if (fragmentIndex >= 0) {
5393
- path$2 = input.slice(0, fragmentIndex);
6848
+ path$1 = input.slice(0, fragmentIndex);
5394
6849
  fragment = input.slice(fragmentIndex);
5395
- if (!path$2) return fragment;
6850
+ if (!path$1) return fragment;
5396
6851
  }
5397
- const [s0, ...s] = path$2.split("?");
6852
+ const [s0, ...s] = path$1.split("?");
5398
6853
  return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
5399
6854
  }
5400
6855
  function isNonEmptyURL(url) {
@@ -5420,8 +6875,8 @@ const isAbsolute = function(p) {
5420
6875
  //#endregion
5421
6876
  //#region ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
5422
6877
  const BUILTIN_MODULES = new Set(builtinModules);
5423
- function normalizeSlash(path$2) {
5424
- return path$2.replace(/\\/g, "/");
6878
+ function normalizeSlash(path$1) {
6879
+ return path$1.replace(/\\/g, "/");
5425
6880
  }
5426
6881
  /**
5427
6882
  * @typedef ErrnoExceptionFields
@@ -5541,8 +6996,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
5541
6996
  * @param {string} [base]
5542
6997
  * @param {string} [message]
5543
6998
  */
5544
- (path$2, base, message) => {
5545
- return `Invalid package config ${path$2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
6999
+ (path$1, base, message) => {
7000
+ return `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
5546
7001
  },
5547
7002
  Error
5548
7003
  );
@@ -5572,8 +7027,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
5572
7027
  * @param {string} base
5573
7028
  * @param {boolean} [exactUrl]
5574
7029
  */
5575
- (path$2, base, exactUrl = false) => {
5576
- return `Cannot find ${exactUrl ? "module" : "package"} '${path$2}' imported from ${base}`;
7030
+ (path$1, base, exactUrl = false) => {
7031
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`;
5577
7032
  },
5578
7033
  Error
5579
7034
  );
@@ -5611,8 +7066,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
5611
7066
  * @param {string} extension
5612
7067
  * @param {string} path
5613
7068
  */
5614
- (extension, path$2) => {
5615
- return `Unknown file extension "${extension}" for ${path$2}`;
7069
+ (extension, path$1) => {
7070
+ return `Unknown file extension "${extension}" for ${path$1}`;
5616
7071
  },
5617
7072
  TypeError
5618
7073
  );
@@ -5981,9 +7436,9 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
5981
7436
  * @param {string} path
5982
7437
  * @returns {Stats | undefined}
5983
7438
  */
5984
- function tryStatSync(path$2) {
7439
+ function tryStatSync(path$1) {
5985
7440
  try {
5986
- return statSync(path$2);
7441
+ return statSync(path$1);
5987
7442
  } catch {}
5988
7443
  }
5989
7444
  /**
@@ -6254,10 +7709,10 @@ function resolvePackageTarget(packageJsonUrl, target$1, subpath, packageSubpath,
6254
7709
  * @param {URL} base
6255
7710
  * @returns {boolean}
6256
7711
  */
6257
- function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
6258
- if (typeof exports === "string" || Array.isArray(exports)) return true;
6259
- if (typeof exports !== "object" || exports === null) return false;
6260
- const keys = Object.getOwnPropertyNames(exports);
7712
+ function isConditionalExportsMainSugar(exports$1, packageJsonUrl, base) {
7713
+ if (typeof exports$1 === "string" || Array.isArray(exports$1)) return true;
7714
+ if (typeof exports$1 !== "object" || exports$1 === null) return false;
7715
+ const keys = Object.getOwnPropertyNames(exports$1);
6261
7716
  let isConditionalSugar = false;
6262
7717
  let i$1 = 0;
6263
7718
  let keyIndex = -1;
@@ -6290,17 +7745,17 @@ function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
6290
7745
  * @returns {URL}
6291
7746
  */
6292
7747
  function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
6293
- let exports = packageConfig.exports;
6294
- if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) exports = { ".": exports };
6295
- if (own.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
6296
- const target$1 = exports[packageSubpath];
7748
+ let exports$1 = packageConfig.exports;
7749
+ if (isConditionalExportsMainSugar(exports$1, packageJsonUrl, base)) exports$1 = { ".": exports$1 };
7750
+ if (own.call(exports$1, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
7751
+ const target$1 = exports$1[packageSubpath];
6297
7752
  const resolveResult = resolvePackageTarget(packageJsonUrl, target$1, "", packageSubpath, base, false, false, false, conditions);
6298
7753
  if (resolveResult === null || resolveResult === void 0) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
6299
7754
  return resolveResult;
6300
7755
  }
6301
7756
  let bestMatch = "";
6302
7757
  let bestMatchSubpath = "";
6303
- const keys = Object.getOwnPropertyNames(exports);
7758
+ const keys = Object.getOwnPropertyNames(exports$1);
6304
7759
  let i$1 = -1;
6305
7760
  while (++i$1 < keys.length) {
6306
7761
  const key = keys[i$1];
@@ -6315,7 +7770,7 @@ function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, ba
6315
7770
  }
6316
7771
  }
6317
7772
  if (bestMatch) {
6318
- const target$1 = exports[bestMatch];
7773
+ const target$1 = exports$1[bestMatch];
6319
7774
  const resolveResult = resolvePackageTarget(packageJsonUrl, target$1, bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"), conditions);
6320
7775
  if (resolveResult === null || resolveResult === void 0) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
6321
7776
  return resolveResult;
@@ -6714,8 +8169,8 @@ function hasNodeJsAls(workerConfig) {
6714
8169
  */
6715
8170
  const nodeJsBuiltins = new Set([...builtinModules, ...builtinModules.map((m) => `node:${m}`)]);
6716
8171
  const NODEJS_MODULES_RE = /* @__PURE__ */ new RegExp(`^(node:)?(${builtinModules.join("|")})$`);
6717
- function isNodeAlsModule(path$2) {
6718
- return /^(node:)?async_hooks$/.test(path$2);
8172
+ function isNodeAlsModule(modulePath) {
8173
+ return /^(?:node:)?async_hooks$/.test(modulePath);
6719
8174
  }
6720
8175
  function assertHasNodeJsCompat(nodeJsCompat) {
6721
8176
  assert(nodeJsCompat, `expected nodeJsCompat to be defined`);
@@ -6746,7 +8201,7 @@ var NodeJsCompatWarnings = class {
6746
8201
  `;
6747
8202
  this.sources.forEach((importers, source) => {
6748
8203
  importers.forEach((importer) => {
6749
- message += ` - "${source}" imported from "${path$1.relative(this.resolvedViteConfig.root, importer)}"\n`;
8204
+ message += ` - "${source}" imported from "${nodePath.relative(this.resolvedViteConfig.root, importer)}"\n`;
6750
8205
  });
6751
8206
  });
6752
8207
  this.resolvedViteConfig.logger.warn(message, { timestamp: true });
@@ -6804,7 +8259,7 @@ function readWorkerConfig(configPath, env) {
6804
8259
  replacedByVite: /* @__PURE__ */ new Set(),
6805
8260
  notRelevant: /* @__PURE__ */ new Set()
6806
8261
  };
6807
- const config = unstable_readConfig({
8262
+ const config = wrangler.unstable_readConfig({
6808
8263
  config: configPath,
6809
8264
  env
6810
8265
  }, { preserveOriginalMain: true });
@@ -6831,7 +8286,7 @@ function getWarningForWorkersConfigs(configs) {
6831
8286
  if (!("auxiliaryWorkers" in configs) || configs.auxiliaryWorkers.length === 0) {
6832
8287
  const nonApplicableLines = getWorkerNonApplicableWarnLines(configs.entryWorker, ` - `);
6833
8288
  if (nonApplicableLines.length === 0) return;
6834
- const lines$1 = [`\n\n\x1b[43mWARNING\x1b[0m: your worker config${configs.entryWorker.config.configPath ? ` (at \`${path$1.relative("", configs.entryWorker.config.configPath)}\`)` : ""} contains the following configuration options which are ignored since they are not applicable when using Vite:`];
8289
+ const lines$1 = [`\n\n\x1b[43mWARNING\x1b[0m: your worker config${configs.entryWorker.config.configPath ? ` (at \`${nodePath.relative("", configs.entryWorker.config.configPath)}\`)` : ""} contains the following configuration options which are ignored since they are not applicable when using Vite:`];
6835
8290
  nonApplicableLines.forEach((line) => lines$1.push(line));
6836
8291
  lines$1.push("");
6837
8292
  return lines$1.join("\n");
@@ -6840,7 +8295,7 @@ function getWarningForWorkersConfigs(configs) {
6840
8295
  const processWorkerConfig = (workerConfig, isEntryWorker = false) => {
6841
8296
  const nonApplicableLines = getWorkerNonApplicableWarnLines(workerConfig, ` - `);
6842
8297
  if (nonApplicableLines.length > 0) {
6843
- lines.push(` - (${isEntryWorker ? "entry" : "auxiliary"}) worker${workerConfig.config.name ? ` "${workerConfig.config.name}"` : ""}${workerConfig.config.configPath ? ` (config at \`${path$1.relative("", workerConfig.config.configPath)}\`)` : ""}`);
8298
+ lines.push(` - (${isEntryWorker ? "entry" : "auxiliary"}) worker${workerConfig.config.name ? ` "${workerConfig.config.name}"` : ""}${workerConfig.config.configPath ? ` (config at \`${nodePath.relative("", workerConfig.config.configPath)}\`)` : ""}`);
6844
8299
  nonApplicableLines.forEach((line) => lines.push(line));
6845
8300
  }
6846
8301
  };
@@ -6933,9 +8388,9 @@ const ENTRY_MODULE_EXTENSIONS = [
6933
8388
  */
6934
8389
  function maybeResolveMain(main, configPath, root) {
6935
8390
  if (!ENTRY_MODULE_EXTENSIONS.some((extension) => main.endsWith(extension))) return main;
6936
- const baseDir = configPath ? path$1.dirname(configPath) : root;
8391
+ const baseDir = configPath ? nodePath.dirname(configPath) : root;
6937
8392
  if (!baseDir) return main;
6938
- const resolvedMain = path$1.resolve(baseDir, main);
8393
+ const resolvedMain = nodePath.resolve(baseDir, main);
6939
8394
  if (!fs$1.existsSync(resolvedMain)) throw new Error(`The provided Wrangler config main field (${resolvedMain}) doesn't point to an existing file`);
6940
8395
  return resolvedMain;
6941
8396
  }
@@ -6950,9 +8405,9 @@ function maybeResolveMain(main, configPath, root) {
6950
8405
  */
6951
8406
  function getValidatedWranglerConfigPath(root, requestedConfigPath, isForAuxiliaryWorker = false) {
6952
8407
  if (requestedConfigPath) {
6953
- const configPath = path$1.resolve(root, requestedConfigPath);
8408
+ const configPath = nodePath.resolve(root, requestedConfigPath);
6954
8409
  const errorMessagePrefix = `The provided configPath (${configPath})${isForAuxiliaryWorker ? " requested for one of your auxiliary workers" : ""}`;
6955
- const fileExtension = path$1.extname(configPath).slice(1);
8410
+ const fileExtension = nodePath.extname(configPath).slice(1);
6956
8411
  if (!allowedWranglerConfigExtensions.includes(fileExtension)) {
6957
8412
  const foundExtensionMessage = !fileExtension ? "no extension found" : `"${fileExtension}" found`;
6958
8413
  throw new Error(`${errorMessagePrefix} doesn't point to a file with the correct file extension. It should point to a jsonc, json or toml file (${foundExtensionMessage} instead)`);
@@ -6967,7 +8422,7 @@ function getValidatedWranglerConfigPath(root, requestedConfigPath, isForAuxiliar
6967
8422
  }
6968
8423
  function findWranglerConfig(root) {
6969
8424
  for (const extension of allowedWranglerConfigExtensions) {
6970
- const configPath = path$1.join(root, `wrangler.${extension}`);
8425
+ const configPath = nodePath.join(root, `wrangler.${extension}`);
6971
8426
  if (fs$1.existsSync(configPath)) return configPath;
6972
8427
  }
6973
8428
  }
@@ -6979,36 +8434,44 @@ const allowedWranglerConfigExtensions = [
6979
8434
 
6980
8435
  //#endregion
6981
8436
  //#region src/plugin-config.ts
6982
- function customizeWorkerConfig(resolvedConfig, config) {
6983
- const configResult = typeof config === "function" ? config(resolvedConfig) : config;
6984
- if (configResult) return defu(configResult, resolvedConfig);
6985
- return resolvedConfig;
8437
+ function customizeWorkerConfig(options) {
8438
+ const configResult = typeof options.configCustomizer === "function" ? "entryWorkerConfig" in options ? options.configCustomizer(options.workerConfig, { entryWorkerConfig: options.entryWorkerConfig }) : options.configCustomizer(options.workerConfig) : options.configCustomizer;
8439
+ if (configResult) return defu(configResult, options.workerConfig);
8440
+ return options.workerConfig;
6986
8441
  }
6987
8442
  /**
6988
8443
  * Resolves the config for a single worker, applying defaults, file config, and config().
6989
8444
  */
6990
- function resolveWorkerConfig({ configPath, env, config, visitedConfigPaths, isEntryWorker, root }) {
8445
+ function resolveWorkerConfig(options) {
8446
+ const isEntryWorker = !("entryWorkerConfig" in options);
6991
8447
  let workerConfig;
6992
8448
  let raw;
6993
8449
  let nonApplicable;
6994
- if (configPath) ({raw, config: workerConfig, nonApplicable} = readWorkerConfigFromFile(configPath, env, { visitedConfigPaths }));
8450
+ if (options.configPath) ({raw, config: workerConfig, nonApplicable} = readWorkerConfigFromFile(options.configPath, options.env, { visitedConfigPaths: options.visitedConfigPaths }));
6995
8451
  else {
6996
- workerConfig = { ...unstable_defaultWranglerConfig };
8452
+ workerConfig = { ...wrangler.unstable_defaultWranglerConfig };
6997
8453
  raw = structuredClone(workerConfig);
6998
8454
  nonApplicable = {
6999
8455
  replacedByVite: /* @__PURE__ */ new Set(),
7000
8456
  notRelevant: /* @__PURE__ */ new Set()
7001
8457
  };
7002
8458
  }
7003
- workerConfig = customizeWorkerConfig(workerConfig, config);
7004
- workerConfig.compatibility_date ??= unstable_getDevCompatibilityDate(void 0);
7005
- if (isEntryWorker) workerConfig.name ??= unstable_getWorkerNameFromProject(root);
8459
+ workerConfig = "entryWorkerConfig" in options ? customizeWorkerConfig({
8460
+ workerConfig,
8461
+ configCustomizer: options.configCustomizer,
8462
+ entryWorkerConfig: options.entryWorkerConfig
8463
+ }) : customizeWorkerConfig({
8464
+ workerConfig,
8465
+ configCustomizer: options.configCustomizer
8466
+ });
8467
+ workerConfig.compatibility_date ??= wrangler.unstable_getDevCompatibilityDate(void 0);
8468
+ if (isEntryWorker) workerConfig.name ??= wrangler.unstable_getWorkerNameFromProject(options.root);
7006
8469
  workerConfig.topLevelName ??= workerConfig.name;
7007
8470
  return resolveWorkerType(workerConfig, raw, nonApplicable, {
7008
8471
  isEntryWorker,
7009
- configPath,
7010
- root,
7011
- env
8472
+ configPath: options.configPath,
8473
+ root: options.root,
8474
+ env: options.env
7012
8475
  });
7013
8476
  }
7014
8477
  function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
@@ -7017,7 +8480,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
7017
8480
  inspectorPort: pluginConfig.inspectorPort,
7018
8481
  experimental: pluginConfig.experimental ?? {}
7019
8482
  };
7020
- const root = userConfig.root ? path$1.resolve(userConfig.root) : process.cwd();
8483
+ const root = userConfig.root ? nodePath.resolve(userConfig.root) : process.cwd();
7021
8484
  const prefixedEnv = vite.loadEnv(viteEnv.mode, root, ["CLOUDFLARE_", "WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_"]);
7022
8485
  Object.assign(process.env, prefixedEnv);
7023
8486
  if (viteEnv.isPreview) return {
@@ -7032,9 +8495,8 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
7032
8495
  root,
7033
8496
  configPath: getValidatedWranglerConfigPath(root, pluginConfig.configPath),
7034
8497
  env: prefixedEnv.CLOUDFLARE_ENV,
7035
- config: pluginConfig.config,
7036
- visitedConfigPaths: configPaths,
7037
- isEntryWorker: true
8498
+ configCustomizer: pluginConfig.config,
8499
+ visitedConfigPaths: configPaths
7038
8500
  });
7039
8501
  if (entryWorkerResolvedConfig.type === "assets-only") return {
7040
8502
  ...shared,
@@ -7056,9 +8518,9 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
7056
8518
  root,
7057
8519
  configPath: getValidatedWranglerConfigPath(root, auxiliaryWorker.configPath, true),
7058
8520
  env: cloudflareEnv,
7059
- config: "config" in auxiliaryWorker ? auxiliaryWorker.config : void 0,
7060
- visitedConfigPaths: configPaths,
7061
- isEntryWorker: false
8521
+ configCustomizer: "config" in auxiliaryWorker ? auxiliaryWorker.config : void 0,
8522
+ entryWorkerConfig,
8523
+ visitedConfigPaths: configPaths
7062
8524
  });
7063
8525
  auxiliaryWorkersResolvedConfigs.push(workerResolvedConfig);
7064
8526
  const workerEnvironmentName = auxiliaryWorker.viteEnvironment?.name ?? workerNameToEnvironmentName(workerResolvedConfig.config.topLevelName);
@@ -8046,10 +9508,10 @@ var MagicString = class MagicString {
8046
9508
  });
8047
9509
  else return replacement(...match, match.index, str, match.groups);
8048
9510
  }
8049
- function matchAll(re, str) {
9511
+ function matchAll(re$5, str) {
8050
9512
  let match;
8051
9513
  const matches = [];
8052
- while (match = re.exec(str)) matches.push(match);
9514
+ while (match = re$5.exec(str)) matches.push(match);
8053
9515
  return matches;
8054
9516
  }
8055
9517
  if (searchValue.global) matchAll(searchValue, this.original).forEach((match) => {
@@ -8129,17 +9591,17 @@ const additionalModulesPlugin = createPlugin("additional-modules", (ctx) => {
8129
9591
  let source;
8130
9592
  try {
8131
9593
  source = await fsp.readFile(modulePath);
8132
- } catch (error) {
9594
+ } catch {
8133
9595
  throw new Error(`Import "${modulePath}" not found. Does the file exist?`);
8134
9596
  }
8135
9597
  const referenceId = this.emitFile({
8136
9598
  type: "asset",
8137
- name: path$1.basename(modulePath),
9599
+ name: nodePath.basename(modulePath),
8138
9600
  originalFileName: modulePath,
8139
9601
  source
8140
9602
  });
8141
9603
  const emittedFileName = this.getFileName(referenceId);
8142
- const relativePath = vite.normalizePath(path$1.relative(path$1.dirname(chunk.fileName), emittedFileName));
9604
+ const relativePath = vite.normalizePath(nodePath.relative(nodePath.dirname(chunk.fileName), emittedFileName));
8143
9605
  const importPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
8144
9606
  magicString.update(match.index, match.index + full.length, importPath);
8145
9607
  }
@@ -8250,9 +9712,9 @@ function constructHeaders({ headers, headersFile, logger }) {
8250
9712
 
8251
9713
  //#endregion
8252
9714
  //#region ../workers-shared/utils/configuration/validateURL.ts
8253
- const extractPathname = (path$2 = "/", includeSearch, includeHash) => {
8254
- if (!path$2.startsWith("/")) path$2 = `/${path$2}`;
8255
- const url = new URL(`//${path$2}`, "relative://");
9715
+ const extractPathname = (path$1 = "/", includeSearch, includeHash) => {
9716
+ if (!path$1.startsWith("/")) path$1 = `/${path$1}`;
9717
+ const url = new URL(`//${path$1}`, "relative://");
8256
9718
  return `${url.pathname}${includeSearch ? url.search : ""}${includeHash ? url.hash : ""}`;
8257
9719
  };
8258
9720
  const URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
@@ -8309,7 +9771,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
8309
9771
  lineNumber: i$1 + 1,
8310
9772
  message: "No headers specified"
8311
9773
  });
8312
- const [path$2, pathError] = validateUrl(line, false, true);
9774
+ const [path$1, pathError] = validateUrl(line, false, true);
8313
9775
  if (pathError) {
8314
9776
  invalid.push({
8315
9777
  line,
@@ -8320,7 +9782,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
8320
9782
  continue;
8321
9783
  }
8322
9784
  rule = {
8323
- path: path$2,
9785
+ path: path$1,
8324
9786
  line,
8325
9787
  headers: {},
8326
9788
  unsetHeaders: []
@@ -8608,13 +10070,13 @@ var require_ignore = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/igno
8608
10070
  const throwError = (message, Ctor) => {
8609
10071
  throw new Ctor(message);
8610
10072
  };
8611
- const checkPath = (path$2, originalPath, doThrow) => {
8612
- if (!isString$1(path$2)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
8613
- if (!path$2) return doThrow(`path must not be empty`, TypeError);
8614
- if (checkPath.isNotRelative(path$2)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
10073
+ const checkPath = (path$1, originalPath, doThrow) => {
10074
+ if (!isString$1(path$1)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
10075
+ if (!path$1) return doThrow(`path must not be empty`, TypeError);
10076
+ if (checkPath.isNotRelative(path$1)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
8615
10077
  return true;
8616
10078
  };
8617
- const isNotRelative = (path$2) => REGEX_TEST_INVALID_PATH.test(path$2);
10079
+ const isNotRelative = (path$1) => REGEX_TEST_INVALID_PATH.test(path$1);
8618
10080
  checkPath.isNotRelative = isNotRelative;
8619
10081
  checkPath.convert = (p) => p;
8620
10082
  var Ignore = class {
@@ -8650,13 +10112,13 @@ var require_ignore = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/igno
8650
10112
  addPattern(pattern) {
8651
10113
  return this.add(pattern);
8652
10114
  }
8653
- _testOne(path$2, checkUnignored) {
10115
+ _testOne(path$1, checkUnignored) {
8654
10116
  let ignored = false;
8655
10117
  let unignored = false;
8656
10118
  this._rules.forEach((rule) => {
8657
10119
  const { negative } = rule;
8658
10120
  if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) return;
8659
- if (rule.regex.test(path$2)) {
10121
+ if (rule.regex.test(path$1)) {
8660
10122
  ignored = !negative;
8661
10123
  unignored = negative;
8662
10124
  }
@@ -8666,34 +10128,34 @@ var require_ignore = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/igno
8666
10128
  unignored
8667
10129
  };
8668
10130
  }
8669
- _test(originalPath, cache$1, checkUnignored, slices) {
8670
- const path$2 = originalPath && checkPath.convert(originalPath);
8671
- checkPath(path$2, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
8672
- return this._t(path$2, cache$1, checkUnignored, slices);
10131
+ _test(originalPath, cache$2, checkUnignored, slices) {
10132
+ const path$1 = originalPath && checkPath.convert(originalPath);
10133
+ checkPath(path$1, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
10134
+ return this._t(path$1, cache$2, checkUnignored, slices);
8673
10135
  }
8674
- _t(path$2, cache$1, checkUnignored, slices) {
8675
- if (path$2 in cache$1) return cache$1[path$2];
8676
- if (!slices) slices = path$2.split(SLASH);
10136
+ _t(path$1, cache$2, checkUnignored, slices) {
10137
+ if (path$1 in cache$2) return cache$2[path$1];
10138
+ if (!slices) slices = path$1.split(SLASH);
8677
10139
  slices.pop();
8678
- if (!slices.length) return cache$1[path$2] = this._testOne(path$2, checkUnignored);
8679
- const parent = this._t(slices.join(SLASH) + SLASH, cache$1, checkUnignored, slices);
8680
- return cache$1[path$2] = parent.ignored ? parent : this._testOne(path$2, checkUnignored);
10140
+ if (!slices.length) return cache$2[path$1] = this._testOne(path$1, checkUnignored);
10141
+ const parent = this._t(slices.join(SLASH) + SLASH, cache$2, checkUnignored, slices);
10142
+ return cache$2[path$1] = parent.ignored ? parent : this._testOne(path$1, checkUnignored);
8681
10143
  }
8682
- ignores(path$2) {
8683
- return this._test(path$2, this._ignoreCache, false).ignored;
10144
+ ignores(path$1) {
10145
+ return this._test(path$1, this._ignoreCache, false).ignored;
8684
10146
  }
8685
10147
  createFilter() {
8686
- return (path$2) => !this.ignores(path$2);
10148
+ return (path$1) => !this.ignores(path$1);
8687
10149
  }
8688
10150
  filter(paths) {
8689
10151
  return makeArray(paths).filter(this.createFilter());
8690
10152
  }
8691
- test(path$2) {
8692
- return this._test(path$2, this._testCache, true);
10153
+ test(path$1) {
10154
+ return this._test(path$1, this._testCache, true);
8693
10155
  }
8694
10156
  };
8695
10157
  const factory = (options) => new Ignore(options);
8696
- const isPathValid = (path$2) => checkPath(path$2 && checkPath.convert(path$2), path$2, RETURN_FALSE);
10158
+ const isPathValid = (path$1) => checkPath(path$1 && checkPath.convert(path$1), path$1, RETURN_FALSE);
8697
10159
  factory.isPathValid = isPathValid;
8698
10160
  factory.default = factory;
8699
10161
  module.exports = factory;
@@ -8702,7 +10164,7 @@ var require_ignore = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/igno
8702
10164
  const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
8703
10165
  checkPath.convert = makePosix;
8704
10166
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
8705
- checkPath.isNotRelative = (path$2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$2) || isNotRelative(path$2);
10167
+ checkPath.isNotRelative = (path$1) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$1) || isNotRelative(path$1);
8706
10168
  }
8707
10169
  }) });
8708
10170
 
@@ -10057,11 +11519,11 @@ var Mime = class {
10057
11519
  }
10058
11520
  return this;
10059
11521
  }
10060
- getType(path$2) {
10061
- if (typeof path$2 !== "string") return null;
10062
- const last = path$2.replace(/^.*[/\\]/s, "").toLowerCase();
11522
+ getType(path$1) {
11523
+ if (typeof path$1 !== "string") return null;
11524
+ const last = path$1.replace(/^.*[/\\]/s, "").toLowerCase();
10063
11525
  const ext = last.replace(/^.*\./s, "").toLowerCase();
10064
- const hasPath = last.length < path$2.length;
11526
+ const hasPath = last.length < path$1.length;
10065
11527
  if (!(ext.length < last.length - 1) && hasPath) return null;
10066
11528
  return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
10067
11529
  }
@@ -10383,8 +11845,8 @@ function getErrorMap() {
10383
11845
  return overrideErrorMap;
10384
11846
  }
10385
11847
  const makeIssue = (params) => {
10386
- const { data: data$1, path: path$2, errorMaps, issueData } = params;
10387
- const fullPath = [...path$2, ...issueData.path || []];
11848
+ const { data: data$1, path: path$1, errorMaps, issueData } = params;
11849
+ const fullPath = [...path$1, ...issueData.path || []];
10388
11850
  const fullIssue = {
10389
11851
  ...issueData,
10390
11852
  path: fullPath
@@ -10481,11 +11943,11 @@ var errorUtil;
10481
11943
  errorUtil$1.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
10482
11944
  })(errorUtil || (errorUtil = {}));
10483
11945
  var ParseInputLazyPath = class {
10484
- constructor(parent, value, path$2, key) {
11946
+ constructor(parent, value, path$1, key) {
10485
11947
  this._cachedPath = [];
10486
11948
  this.parent = parent;
10487
11949
  this.data = value;
10488
- this._path = path$2;
11950
+ this._path = path$1;
10489
11951
  this._key = key;
10490
11952
  }
10491
11953
  get path() {
@@ -10785,9 +12247,9 @@ const datetimeRegex = (args) => {
10785
12247
  else if (args.offset) return /* @__PURE__ */ new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
10786
12248
  else return /* @__PURE__ */ new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
10787
12249
  };
10788
- function isValidIP(ip, version$1) {
10789
- if ((version$1 === "v4" || !version$1) && ipv4Regex.test(ip)) return true;
10790
- if ((version$1 === "v6" || !version$1) && ipv6Regex.test(ip)) return true;
12250
+ function isValidIP(ip, version$2) {
12251
+ if ((version$2 === "v4" || !version$2) && ipv4Regex.test(ip)) return true;
12252
+ if ((version$2 === "v6" || !version$2) && ipv6Regex.test(ip)) return true;
10791
12253
  return false;
10792
12254
  }
10793
12255
  var ZodString = class ZodString extends ZodType {
@@ -13647,10 +15109,10 @@ function getAssetsConfig(resolvedPluginConfig, entryWorkerConfig, resolvedConfig
13647
15109
  };
13648
15110
  }
13649
15111
  function getRedirectsConfigPath(config) {
13650
- return path$1.join(config.publicDir, REDIRECTS_FILENAME);
15112
+ return nodePath.join(config.publicDir, REDIRECTS_FILENAME);
13651
15113
  }
13652
15114
  function getHeadersConfigPath(config) {
13653
- return path$1.join(config.publicDir, HEADERS_FILENAME);
15115
+ return nodePath.join(config.publicDir, HEADERS_FILENAME);
13654
15116
  }
13655
15117
 
13656
15118
  //#endregion
@@ -13769,7 +15231,7 @@ function createBuildApp(resolvedPluginConfig) {
13769
15231
  return async (builder) => {
13770
15232
  const clientEnvironment = builder.environments.client;
13771
15233
  assert(clientEnvironment, `No "client" environment`);
13772
- const defaultHtmlPath = path$1.resolve(builder.config.root, "index.html");
15234
+ const defaultHtmlPath = nodePath.resolve(builder.config.root, "index.html");
13773
15235
  const hasClientEntry = clientEnvironment.config.build.rollupOptions.input || fs$1.existsSync(defaultHtmlPath);
13774
15236
  if (resolvedPluginConfig.type === "assets-only") {
13775
15237
  if (hasClientEntry) await builder.build(clientEnvironment);
@@ -13785,39 +15247,39 @@ function createBuildApp(resolvedPluginConfig) {
13785
15247
  const { entryWorkerEnvironmentName } = resolvedPluginConfig;
13786
15248
  const entryWorkerEnvironment = builder.environments[entryWorkerEnvironmentName];
13787
15249
  assert(entryWorkerEnvironment, `No "${entryWorkerEnvironmentName}" environment`);
13788
- const entryWorkerBuildDirectory = path$1.resolve(builder.config.root, entryWorkerEnvironment.config.build.outDir);
15250
+ const entryWorkerBuildDirectory = nodePath.resolve(builder.config.root, entryWorkerEnvironment.config.build.outDir);
13789
15251
  const importedAssetPaths = getImportedAssetPaths(loadViteManifest(entryWorkerBuildDirectory));
13790
15252
  if (hasClientEntry) await builder.build(clientEnvironment);
13791
15253
  else if (importedAssetPaths.size || getHasPublicAssets(builder.config)) await fallbackBuild(builder, clientEnvironment);
13792
15254
  else {
13793
- const entryWorkerConfigPath = path$1.join(entryWorkerBuildDirectory, "wrangler.json");
15255
+ const entryWorkerConfigPath = nodePath.join(entryWorkerBuildDirectory, "wrangler.json");
13794
15256
  const workerConfig = JSON.parse(fs$1.readFileSync(entryWorkerConfigPath, "utf-8"));
13795
15257
  workerConfig.assets = void 0;
13796
15258
  fs$1.writeFileSync(entryWorkerConfigPath, JSON.stringify(workerConfig));
13797
15259
  return;
13798
15260
  }
13799
- const clientBuildDirectory = path$1.resolve(builder.config.root, clientEnvironment.config.build.outDir);
15261
+ const clientBuildDirectory = nodePath.resolve(builder.config.root, clientEnvironment.config.build.outDir);
13800
15262
  const movedAssetPaths = [];
13801
15263
  for (const assetPath of importedAssetPaths) {
13802
- const src = path$1.join(entryWorkerBuildDirectory, assetPath);
13803
- const dest = path$1.join(clientBuildDirectory, assetPath);
13804
- if (!fs$1.existsSync(src)) continue;
13805
- if (fs$1.existsSync(dest)) fs$1.unlinkSync(src);
15264
+ const src$1 = nodePath.join(entryWorkerBuildDirectory, assetPath);
15265
+ const dest = nodePath.join(clientBuildDirectory, assetPath);
15266
+ if (!fs$1.existsSync(src$1)) continue;
15267
+ if (fs$1.existsSync(dest)) fs$1.unlinkSync(src$1);
13806
15268
  else {
13807
- const destDir = path$1.dirname(dest);
15269
+ const destDir = nodePath.dirname(dest);
13808
15270
  fs$1.mkdirSync(destDir, { recursive: true });
13809
- fs$1.renameSync(src, dest);
15271
+ fs$1.renameSync(src$1, dest);
13810
15272
  movedAssetPaths.push(dest);
13811
15273
  }
13812
15274
  }
13813
- if (movedAssetPaths.length) builder.config.logger.info([`${colors.green("✓")} ${movedAssetPaths.length} asset${movedAssetPaths.length > 1 ? "s" : ""} moved from "${entryWorkerEnvironmentName}" to "client" build output.`, ...movedAssetPaths.map((assetPath) => colors.dim(path$1.relative(builder.config.root, assetPath)))].join("\n"));
15275
+ if (movedAssetPaths.length) builder.config.logger.info([`${colors.green("✓")} ${movedAssetPaths.length} asset${movedAssetPaths.length > 1 ? "s" : ""} moved from "${entryWorkerEnvironmentName}" to "client" build output.`, ...movedAssetPaths.map((assetPath) => colors.dim(nodePath.relative(builder.config.root, assetPath)))].join("\n"));
13814
15276
  };
13815
15277
  }
13816
15278
  function getHasPublicAssets({ publicDir }) {
13817
15279
  let hasPublicAssets = false;
13818
15280
  if (publicDir) try {
13819
15281
  if (fs$1.readdirSync(publicDir).length) hasPublicAssets = true;
13820
- } catch (error) {}
15282
+ } catch {}
13821
15283
  return hasPublicAssets;
13822
15284
  }
13823
15285
  async function fallbackBuild(builder, environment) {
@@ -13827,11 +15289,11 @@ async function fallbackBuild(builder, environment) {
13827
15289
  output: { entryFileNames: CLIENT_FALLBACK_ENTRY_NAME }
13828
15290
  };
13829
15291
  await builder.build(environment);
13830
- const fallbackEntryPath = path$1.resolve(builder.config.root, environment.config.build.outDir, CLIENT_FALLBACK_ENTRY_NAME);
15292
+ const fallbackEntryPath = nodePath.resolve(builder.config.root, environment.config.build.outDir, CLIENT_FALLBACK_ENTRY_NAME);
13831
15293
  fs$1.unlinkSync(fallbackEntryPath);
13832
15294
  }
13833
15295
  function loadViteManifest(directory) {
13834
- const contents = fs$1.readFileSync(path$1.resolve(directory, ".vite", "manifest.json"), "utf-8");
15296
+ const contents = fs$1.readFileSync(nodePath.resolve(directory, ".vite", "manifest.json"), "utf-8");
13835
15297
  return JSON.parse(contents);
13836
15298
  }
13837
15299
  function getImportedAssetPaths(viteManifest) {
@@ -14022,7 +15484,7 @@ function initRunners(resolvedPluginConfig, viteDevServer, miniflare) {
14022
15484
  * Calls `unstable_getVarsForDev` with the current Cloudflare environment to get local dev variables from the `.dev.vars` and `.env` files.
14023
15485
  */
14024
15486
  function getLocalDevVarsForPreview(configPath, cloudflareEnv) {
14025
- const dotDevDotVars = unstable_getVarsForDev(configPath, void 0, {}, cloudflareEnv);
15487
+ const dotDevDotVars = wrangler.unstable_getVarsForDev(configPath, void 0, {}, cloudflareEnv);
14026
15488
  const dotDevDotVarsEntries = Array.from(Object.entries(dotDevDotVars));
14027
15489
  if (dotDevDotVarsEntries.length > 0) return dotDevDotVarsEntries.map(([key, value]) => {
14028
15490
  return `${key} = "${value?.toString().replaceAll(`"`, `\\"`)}"\n`;
@@ -14033,12 +15495,12 @@ function getLocalDevVarsForPreview(configPath, cloudflareEnv) {
14033
15495
  */
14034
15496
  function hasLocalDevVarsFileChanged({ configPaths, cloudflareEnv }, changedFilePath) {
14035
15497
  return [...configPaths].some((configPath) => {
14036
- const configDir = path$1.dirname(configPath);
15498
+ const configDir = nodePath.dirname(configPath);
14037
15499
  return [
14038
15500
  ".dev.vars",
14039
15501
  ".env",
14040
15502
  ...cloudflareEnv ? [`.dev.vars.${cloudflareEnv}`, `.env.${cloudflareEnv}`] : []
14041
- ].some((localDevFile) => changedFilePath === path$1.join(configDir, localDevFile));
15503
+ ].some((localDevFile) => changedFilePath === nodePath.join(configDir, localDevFile));
14042
15504
  });
14043
15505
  }
14044
15506
 
@@ -14159,7 +15621,7 @@ function addDebugToVitePrintUrls(server) {
14159
15621
  const localUrl = server.resolvedUrls?.local[0];
14160
15622
  if (localUrl) {
14161
15623
  const { protocol, hostname, port } = new URL(localUrl);
14162
- const colorDebugUrl = (url) => colors.dim(colors.yellow(url.replace(/:(\d+)\//, (_, port$1) => `:${colors.bold(port$1)}/`)));
15624
+ const colorDebugUrl = (url) => colors.dim(colors.yellow(url.replace(/:(\d+)\//, (_, portNumber) => `:${colors.bold(portNumber)}/`)));
14163
15625
  server.config.logger.info(` ${colors.green("➜")} ${colors.bold("Debug")}: ${colorDebugUrl(`${protocol}//${hostname}:${port}${DEBUG_PATH}`)}`);
14164
15626
  }
14165
15627
  };
@@ -14608,11 +16070,11 @@ const getQueryString = (params) => {
14608
16070
  };
14609
16071
  const getUrl = (config, options) => {
14610
16072
  const encoder = config.ENCODE_PATH || encodeURI;
14611
- const path$2 = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
16073
+ const path$1 = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
14612
16074
  if (options.path?.hasOwnProperty(group)) return encoder(String(options.path[group]));
14613
16075
  return substring;
14614
16076
  });
14615
- const url = `${config.BASE}${path$2}`;
16077
+ const url = `${config.BASE}${path$1}`;
14616
16078
  if (options.query) return `${url}${getQueryString(options.query)}`;
14617
16079
  return url;
14618
16080
  };
@@ -15452,7 +16914,7 @@ const INTERNAL_WORKERS_COMPATIBILITY_DATE = "2024-10-04";
15452
16914
  const PUBLIC_DIR_PREFIX = "/__vite_public_dir__";
15453
16915
  function getPersistenceRoot(root, persistState) {
15454
16916
  if (persistState === false) return;
15455
- return path$1.resolve(root, typeof persistState === "object" ? persistState.path : ".wrangler/state", "v3");
16917
+ return nodePath.resolve(root, typeof persistState === "object" ? persistState.path : ".wrangler/state", "v3");
15456
16918
  }
15457
16919
  const miniflareModulesRoot = process.platform === "win32" ? "Z:\\" : "/";
15458
16920
  const ROUTER_WORKER_PATH = "./workers/router-worker.js";
@@ -15473,7 +16935,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15473
16935
  modulesRoot: miniflareModulesRoot,
15474
16936
  modules: [{
15475
16937
  type: "ESModule",
15476
- path: path$1.join(miniflareModulesRoot, ROUTER_WORKER_PATH),
16938
+ path: nodePath.join(miniflareModulesRoot, ROUTER_WORKER_PATH),
15477
16939
  contents: fs$1.readFileSync(fileURLToPath(new URL(ROUTER_WORKER_PATH, import.meta.url)))
15478
16940
  }],
15479
16941
  bindings: { CONFIG: { has_user_worker: resolvedPluginConfig.type === "workers" } },
@@ -15488,7 +16950,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15488
16950
  modulesRoot: miniflareModulesRoot,
15489
16951
  modules: [{
15490
16952
  type: "ESModule",
15491
- path: path$1.join(miniflareModulesRoot, ASSET_WORKER_PATH),
16953
+ path: nodePath.join(miniflareModulesRoot, ASSET_WORKER_PATH),
15492
16954
  contents: fs$1.readFileSync(fileURLToPath(new URL(ASSET_WORKER_PATH, import.meta.url)))
15493
16955
  }],
15494
16956
  bindings: {
@@ -15503,11 +16965,11 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15503
16965
  const publicDirInRoot = publicDir.startsWith(withTrailingSlash(root));
15504
16966
  const publicPath = withTrailingSlash(publicDir.slice(root.length));
15505
16967
  if (publicDirInRoot && pathname.startsWith(publicPath)) return Response$1.json(null);
15506
- const publicDirFilePath = path$1.join(publicDir, pathname);
15507
- const rootDirFilePath = path$1.join(root, pathname);
16968
+ const publicDirFilePath = nodePath.join(publicDir, pathname);
16969
+ const rootDirFilePath = nodePath.join(root, pathname);
15508
16970
  for (const resolvedPath of [publicDirFilePath, rootDirFilePath]) try {
15509
16971
  if ((await fsp.stat(resolvedPath)).isFile()) return Response$1.json(resolvedPath === publicDirFilePath ? `${PUBLIC_DIR_PREFIX}${pathname}` : pathname);
15510
- } catch (error) {}
16972
+ } catch {}
15511
16973
  }
15512
16974
  return Response$1.json(null);
15513
16975
  },
@@ -15515,12 +16977,12 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15515
16977
  const { pathname } = new URL(request$1.url);
15516
16978
  const { root, publicDir } = resolvedViteConfig;
15517
16979
  const isInPublicDir = pathname.startsWith(PUBLIC_DIR_PREFIX);
15518
- const resolvedPath = isInPublicDir ? path$1.join(publicDir, pathname.slice(20)) : path$1.join(root, pathname);
16980
+ const resolvedPath = isInPublicDir ? nodePath.join(publicDir, pathname.slice(20)) : nodePath.join(root, pathname);
15519
16981
  try {
15520
16982
  let html = await fsp.readFile(resolvedPath, "utf-8");
15521
16983
  if (!isInPublicDir) html = await viteDevServer.transformIndexHtml(resolvedPath, html);
15522
16984
  return new Response$1(html, { headers: { "Content-Type": "text/html" } });
15523
- } catch (error) {
16985
+ } catch {
15524
16986
  throw new Error(`Unexpected error. Failed to load "${pathname}".`);
15525
16987
  }
15526
16988
  }
@@ -15532,7 +16994,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15532
16994
  modulesRoot: miniflareModulesRoot,
15533
16995
  modules: [{
15534
16996
  type: "ESModule",
15535
- path: path$1.join(miniflareModulesRoot, VITE_PROXY_WORKER_PATH),
16997
+ path: nodePath.join(miniflareModulesRoot, VITE_PROXY_WORKER_PATH),
15536
16998
  contents: fs$1.readFileSync(fileURLToPath(new URL(VITE_PROXY_WORKER_PATH, import.meta.url)))
15537
16999
  }],
15538
17000
  serviceBindings: {
@@ -15543,9 +17005,9 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15543
17005
  ];
15544
17006
  const containerTagToOptionsMap = /* @__PURE__ */ new Map();
15545
17007
  const workersFromConfig = resolvedPluginConfig.type === "workers" ? await Promise.all([...resolvedPluginConfig.environmentNameToWorkerMap].map(async ([environmentName, worker]) => {
15546
- const bindings = unstable_convertConfigBindingsToStartWorkerBindings(worker.config);
17008
+ const bindings = wrangler.unstable_convertConfigBindingsToStartWorkerBindings(worker.config);
15547
17009
  const preExistingRemoteProxySession = worker.config.configPath ? remoteProxySessionsDataMap.get(worker.config.configPath) : void 0;
15548
- const remoteProxySessionData = !resolvedPluginConfig.remoteBindings ? null : await maybeStartOrUpdateRemoteProxySession({
17010
+ const remoteProxySessionData = !resolvedPluginConfig.remoteBindings ? null : await wrangler.maybeStartOrUpdateRemoteProxySession({
15549
17011
  name: worker.config.name,
15550
17012
  bindings: bindings ?? {},
15551
17013
  account_id: worker.config.account_id
@@ -15563,7 +17025,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15563
17025
  });
15564
17026
  for (const option of options ?? []) containerTagToOptionsMap.set(option.image_tag, option);
15565
17027
  }
15566
- const { externalWorkers: externalWorkers$1, workerOptions } = unstable_getMiniflareWorkerOptions({
17028
+ const { externalWorkers: externalWorkers$1, workerOptions } = wrangler.unstable_getMiniflareWorkerOptions({
15567
17029
  ...worker.config,
15568
17030
  assets: void 0
15569
17031
  }, resolvedPluginConfig.cloudflareEnv, {
@@ -15586,11 +17048,11 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15586
17048
  modulesRoot: miniflareModulesRoot,
15587
17049
  modules: [{
15588
17050
  type: "ESModule",
15589
- path: path$1.join(miniflareModulesRoot, WRAPPER_PATH),
17051
+ path: nodePath.join(miniflareModulesRoot, WRAPPER_PATH),
15590
17052
  contents: wrappers.join("\n")
15591
17053
  }, {
15592
17054
  type: "ESModule",
15593
- path: path$1.join(miniflareModulesRoot, RUNNER_PATH),
17055
+ path: nodePath.join(miniflareModulesRoot, RUNNER_PATH),
15594
17056
  contents: fs$1.readFileSync(fileURLToPath(new URL(RUNNER_PATH, import.meta.url)))
15595
17057
  }],
15596
17058
  unsafeUseModuleFallbackService: true,
@@ -15654,7 +17116,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15654
17116
  let contents;
15655
17117
  try {
15656
17118
  contents = await fsp.readFile(modulePath);
15657
- } catch (error) {
17119
+ } catch {
15658
17120
  throw new Error(`Import "${modulePath}" not found. Does the file exist?`);
15659
17121
  }
15660
17122
  switch (moduleType) {
@@ -15670,8 +17132,8 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
15670
17132
  }
15671
17133
  function getPreviewModules(main, modulesRules) {
15672
17134
  assert(modulesRules, `Unexpected error: 'modulesRules' is undefined`);
15673
- const rootPath = path$1.dirname(main);
15674
- const entryPath = path$1.basename(main);
17135
+ const rootPath = nodePath.dirname(main);
17136
+ const entryPath = nodePath.basename(main);
15675
17137
  return {
15676
17138
  rootPath,
15677
17139
  modules: [{
@@ -15680,9 +17142,9 @@ function getPreviewModules(main, modulesRules) {
15680
17142
  }, ...modulesRules.flatMap(({ type, include }) => globSync(include, {
15681
17143
  cwd: rootPath,
15682
17144
  ignore: entryPath
15683
- }).map((path$2) => ({
17145
+ }).map((globPath) => ({
15684
17146
  type,
15685
- path: path$2
17147
+ path: globPath
15686
17148
  })))]
15687
17149
  };
15688
17150
  }
@@ -15691,9 +17153,9 @@ async function getPreviewMiniflareOptions(ctx, vitePreviewServer) {
15691
17153
  const { resolvedPluginConfig, resolvedViteConfig } = ctx;
15692
17154
  const containerTagToOptionsMap = /* @__PURE__ */ new Map();
15693
17155
  const workers = (await Promise.all(resolvedPluginConfig.workers.map(async (workerConfig, i$1) => {
15694
- const bindings = unstable_convertConfigBindingsToStartWorkerBindings(workerConfig);
17156
+ const bindings = wrangler.unstable_convertConfigBindingsToStartWorkerBindings(workerConfig);
15695
17157
  const preExistingRemoteProxySessionData = workerConfig.configPath ? remoteProxySessionsDataMap.get(workerConfig.configPath) : void 0;
15696
- const remoteProxySessionData = !resolvedPluginConfig.remoteBindings ? null : await maybeStartOrUpdateRemoteProxySession({
17158
+ const remoteProxySessionData = !resolvedPluginConfig.remoteBindings ? null : await wrangler.maybeStartOrUpdateRemoteProxySession({
15697
17159
  name: workerConfig.name,
15698
17160
  bindings: bindings ?? {},
15699
17161
  account_id: workerConfig.account_id
@@ -15711,7 +17173,7 @@ async function getPreviewMiniflareOptions(ctx, vitePreviewServer) {
15711
17173
  });
15712
17174
  for (const option of options ?? []) containerTagToOptionsMap.set(option.image_tag, option);
15713
17175
  }
15714
- const miniflareWorkerOptions = unstable_getMiniflareWorkerOptions(workerConfig, void 0, {
17176
+ const miniflareWorkerOptions = wrangler.unstable_getMiniflareWorkerOptions(workerConfig, void 0, {
15715
17177
  remoteProxyConnectionString: remoteProxySessionData?.session?.remoteProxyConnectionString,
15716
17178
  containerBuildId
15717
17179
  });
@@ -16009,11 +17471,11 @@ const nodeJsCompatWarningsPlugin = createPlugin("nodejs-compat-warnings", (ctx)
16009
17471
  if (workerConfig && !nodeJsCompat) return { optimizeDeps: { esbuildOptions: { plugins: [{
16010
17472
  name: "vite-plugin-cloudflare:nodejs-compat-warnings-resolver",
16011
17473
  setup(build) {
16012
- build.onResolve({ filter: NODEJS_MODULES_RE }, ({ path: path$2, importer }) => {
16013
- if (hasNodeJsAls(workerConfig) && isNodeAlsModule(path$2)) return;
16014
- nodeJsCompatWarningsMap.get(workerConfig)?.registerImport(path$2, importer);
17474
+ build.onResolve({ filter: NODEJS_MODULES_RE }, ({ path: path$1, importer }) => {
17475
+ if (hasNodeJsAls(workerConfig) && isNodeAlsModule(path$1)) return;
17476
+ nodeJsCompatWarningsMap.get(workerConfig)?.registerImport(path$1, importer);
16015
17477
  return {
16016
- path: path$2,
17478
+ path: path$1,
16017
17479
  external: true
16018
17480
  };
16019
17481
  });
@@ -16114,7 +17576,7 @@ const outputConfigPlugin = createPlugin("output-config", (ctx) => {
16114
17576
  function getAssetsDirectory(workerOutputDirectory, resolvedViteConfig) {
16115
17577
  const clientOutputDirectory = resolvedViteConfig.environments.client?.build.outDir;
16116
17578
  assert(clientOutputDirectory, "Unexpected error: client output directory is undefined");
16117
- return path$1.relative(path$1.resolve(resolvedViteConfig.root, workerOutputDirectory), path$1.resolve(resolvedViteConfig.root, clientOutputDirectory));
17579
+ return nodePath.relative(nodePath.resolve(resolvedViteConfig.root, workerOutputDirectory), nodePath.resolve(resolvedViteConfig.root, clientOutputDirectory));
16118
17580
  }
16119
17581
 
16120
17582
  //#endregion
@@ -16159,6 +17621,64 @@ const previewPlugin = createPlugin("preview", (ctx) => {
16159
17621
  } };
16160
17622
  });
16161
17623
 
17624
+ //#endregion
17625
+ //#region src/plugins/shortcuts.ts
17626
+ const shortcutsPlugin = createPlugin("shortcuts", (ctx) => {
17627
+ const isCustomShortcutsSupported = satisfiesViteVersion("7.2.7");
17628
+ return {
17629
+ async configureServer(viteDevServer) {
17630
+ if (!isCustomShortcutsSupported) return;
17631
+ assertIsNotPreview(ctx);
17632
+ addBindingsShortcut(viteDevServer, ctx);
17633
+ },
17634
+ async configurePreviewServer(vitePreviewServer) {
17635
+ if (!isCustomShortcutsSupported) return;
17636
+ assertIsPreview(ctx);
17637
+ addBindingsShortcut(vitePreviewServer, ctx);
17638
+ }
17639
+ };
17640
+ });
17641
+ function addBindingsShortcut(server, ctx) {
17642
+ const workerConfigs = ctx.allWorkerConfigs;
17643
+ if (workerConfigs.length === 0) return;
17644
+ const registryPath = getDefaultDevRegistryPath();
17645
+ const printBindingsShortcut = {
17646
+ key: "b",
17647
+ description: "list configured Cloudflare bindings",
17648
+ action: (viteServer) => {
17649
+ viteServer.config.logger.info("");
17650
+ for (const workerConfig of workerConfigs) wrangler.unstable_printBindings({
17651
+ ...workerConfig,
17652
+ assets: workerConfig.assets?.binding ? {
17653
+ ...workerConfig.assets,
17654
+ binding: workerConfig.assets.binding
17655
+ } : void 0,
17656
+ unsafe: {
17657
+ bindings: workerConfig.unsafe.bindings,
17658
+ metadata: workerConfig.unsafe.metadata,
17659
+ capnp: workerConfig.unsafe.capnp
17660
+ },
17661
+ queues: workerConfig.queues.producers?.map((queue) => ({
17662
+ ...queue,
17663
+ queue_name: queue.queue
17664
+ }))
17665
+ }, workerConfig.tail_consumers, workerConfig.streaming_tail_consumers, workerConfig.containers, {
17666
+ warnIfNoBindings: true,
17667
+ isMultiWorker: workerConfigs.length > 1,
17668
+ name: workerConfig.name ?? "Your Worker",
17669
+ registry: getWorkerRegistry(registryPath),
17670
+ log: (message) => viteServer.config.logger.info(message)
17671
+ });
17672
+ }
17673
+ };
17674
+ const bindCLIShortcuts = server.bindCLIShortcuts.bind(server);
17675
+ server.bindCLIShortcuts = (options) => {
17676
+ if (server.httpServer && process.stdin.isTTY && !process.env.CI && options?.print) server.config.logger.info(colors.dim(colors.green(" ➜")) + colors.dim(" press ") + colors.bold(`${printBindingsShortcut.key} + enter`) + colors.dim(` to ${printBindingsShortcut.description}`));
17677
+ bindCLIShortcuts(options);
17678
+ };
17679
+ server.bindCLIShortcuts({ customShortcuts: [printBindingsShortcut] });
17680
+ }
17681
+
16162
17682
  //#endregion
16163
17683
  //#region src/plugins/trigger-handlers.ts
16164
17684
  /**
@@ -16209,6 +17729,7 @@ const sharedContext = {
16209
17729
  hasShownWorkerConfigWarnings: false,
16210
17730
  isRestartingDevServer: false
16211
17731
  };
17732
+ await assertWranglerVersion();
16212
17733
  /**
16213
17734
  * Vite plugin that enables a full-featured integration between Vite and the Cloudflare Workers runtime.
16214
17735
  *
@@ -16242,6 +17763,7 @@ function cloudflare(pluginConfig = {}) {
16242
17763
  configPlugin(ctx),
16243
17764
  devPlugin(ctx),
16244
17765
  previewPlugin(ctx),
17766
+ shortcutsPlugin(ctx),
16245
17767
  debugPlugin(ctx),
16246
17768
  triggerHandlersPlugin(ctx),
16247
17769
  virtualModulesPlugin(ctx),