@cloudflare/vite-plugin 1.39.0 → 1.39.2

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
@@ -3,7 +3,7 @@ import assert from "node:assert";
3
3
  import { CoreHeaders, CorePaths, Log, LogLevel, Miniflare, Request as Request$1, Response as Response$1, buildPublicUrl, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, getWorkerRegistry, kUnsafeEphemeralUniqueKey, parseModuleFallbackRequest } from "miniflare";
4
4
  import * as wrangler from "wrangler";
5
5
  import * as nodePath from "node:path";
6
- import path3, { dirname, isAbsolute, join, relative, resolve } from "node:path";
6
+ import path, { dirname, isAbsolute, join, relative, resolve } from "node:path";
7
7
  import * as util$1 from "node:util";
8
8
  import { format, inspect, promisify } from "node:util";
9
9
  import * as vite from "vite";
@@ -15,16 +15,17 @@ import os, { arch } from "node:os";
15
15
  import childProcess, { execFile, execFileSync, spawn } from "node:child_process";
16
16
  import net from "node:net";
17
17
  import { Buffer as Buffer$1 } from "node:buffer";
18
- import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
18
+ import { URL as URL$1, URLSearchParams as URLSearchParams$1, fileURLToPath, pathToFileURL } from "node:url";
19
19
  import * as fsp from "node:fs/promises";
20
20
  import fs, { constants as constants$1 } from "node:fs/promises";
21
+ import * as timersPromises from "node:timers/promises";
21
22
  import { getCloudflarePreset, nonPrefixedNodeModules } from "@cloudflare/unenv-preset";
22
23
  import process$1 from "node:process";
23
24
  import v8 from "node:v8";
24
25
  import { defineEnv } from "unenv";
25
- import * as nativeFs$1 from "fs";
26
- import nativeFs from "fs";
27
- import path, { basename, dirname as dirname$1, normalize, posix, relative as relative$1, resolve as resolve$1, sep } from "path";
26
+ import * as nativeFs from "fs";
27
+ import { readdir, readdirSync, realpath, realpathSync as realpathSync$1, stat, statSync as statSync$1 } from "fs";
28
+ import { basename, dirname as dirname$1, isAbsolute as isAbsolute$1, normalize, posix, relative as relative$1, resolve as resolve$1, sep } from "path";
28
29
  import { fileURLToPath as fileURLToPath$1 } from "url";
29
30
  import { createRequire as createRequire$1 } from "module";
30
31
  import { WebSocketServer } from "ws";
@@ -1503,7 +1504,7 @@ async function assertWranglerVersion() {
1503
1504
  * The default compatibility date to use when the user omits one.
1504
1505
  * This value is injected at build time and remains fixed for each release.
1505
1506
  */
1506
- const DEFAULT_COMPAT_DATE = "2026-05-26";
1507
+ const DEFAULT_COMPAT_DATE = "2026-06-02";
1507
1508
 
1508
1509
  //#endregion
1509
1510
  //#region ../../node_modules/.pnpm/@remix-run+node-fetch-server@0.8.0/node_modules/@remix-run/node-fetch-server/dist/node-fetch-server.js
@@ -3958,7 +3959,7 @@ function resolveWranglerConfigPath({ config, script }, options) {
3958
3959
  deployConfigPath: void 0,
3959
3960
  redirected: false
3960
3961
  };
3961
- return findWranglerConfig$1(script !== void 0 ? path3.dirname(script) : process.cwd(), options);
3962
+ return findWranglerConfig$1(script !== void 0 ? path.dirname(script) : process.cwd(), options);
3962
3963
  }
3963
3964
  __name(resolveWranglerConfigPath, "resolveWranglerConfigPath");
3964
3965
  function findWranglerConfig$1(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
@@ -3989,15 +3990,15 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
3989
3990
  const deployConfigFile = readFileSync$1(deployConfigPath);
3990
3991
  try {
3991
3992
  const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);
3992
- redirectedConfigPath = deployConfig.configPath && path3.resolve(path3.dirname(deployConfigPath), deployConfig.configPath);
3993
+ redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);
3993
3994
  } catch (e) {
3994
- throw new UserError(`Failed to parse the deploy configuration file at ${path3.relative(".", deployConfigPath)}`, {
3995
+ throw new UserError(`Failed to parse the deploy configuration file at ${path.relative(".", deployConfigPath)}`, {
3995
3996
  cause: e,
3996
3997
  telemetryMessage: false
3997
3998
  });
3998
3999
  }
3999
4000
  if (!redirectedConfigPath) throw new UserError(esm_default`
4000
- A deploy configuration file was found at "${path3.relative(".", deployConfigPath)}".
4001
+ A deploy configuration file was found at "${path.relative(".", deployConfigPath)}".
4001
4002
  But this is not valid - the required "configPath" property was not found.
4002
4003
  Instead this file contains:
4003
4004
  \`\`\`
@@ -4005,13 +4006,13 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
4005
4006
  \`\`\`
4006
4007
  `, { telemetryMessage: false });
4007
4008
  if (!existsSync(redirectedConfigPath)) throw new UserError(esm_default`
4008
- There is a deploy configuration at "${path3.relative(".", deployConfigPath)}".
4009
- But the redirected configuration path it points to, "${path3.relative(".", redirectedConfigPath)}", does not exist.
4009
+ There is a deploy configuration at "${path.relative(".", deployConfigPath)}".
4010
+ But the redirected configuration path it points to, "${path.relative(".", redirectedConfigPath)}", does not exist.
4010
4011
  `, { telemetryMessage: false });
4011
4012
  if (userConfigPath) {
4012
- if (path3.join(path3.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError(esm_default`
4013
- Found both a user configuration file at "${path3.relative(".", userConfigPath)}"
4014
- and a deploy configuration file at "${path3.relative(".", deployConfigPath)}".
4013
+ if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError(esm_default`
4014
+ Found both a user configuration file at "${path.relative(".", userConfigPath)}"
4015
+ and a deploy configuration file at "${path.relative(".", deployConfigPath)}".
4015
4016
  But these do not share the same base path so it is not clear which should be used.
4016
4017
  `, { telemetryMessage: false });
4017
4018
  }
@@ -6784,7 +6785,7 @@ var require_connect = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
6784
6785
 
6785
6786
  //#endregion
6786
6787
  //#region ../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/llhttp/utils.js
6787
- var require_utils$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/llhttp/utils.js": ((exports) => {
6788
+ var require_utils$2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/llhttp/utils.js": ((exports) => {
6788
6789
  Object.defineProperty(exports, "__esModule", { value: true });
6789
6790
  exports.enumToMap = enumToMap;
6790
6791
  function enumToMap(obj, filter = [], exceptions = []) {
@@ -6801,7 +6802,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
6801
6802
  var require_constants$4 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/llhttp/constants.js": ((exports) => {
6802
6803
  Object.defineProperty(exports, "__esModule", { value: true });
6803
6804
  exports.SPECIAL_HEADERS = exports.MINOR = exports.MAJOR = exports.HTAB_SP_VCHAR_OBS_TEXT = exports.QUOTED_STRING = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.HEX = exports.URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.STATUSES_HTTP = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.HEADER_STATE = exports.FINISH = exports.STATUSES = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
6804
- const utils_1 = require_utils$1();
6805
+ const utils_1 = require_utils$2();
6805
6806
  exports.ERROR = {
6806
6807
  OK: 0,
6807
6808
  INTERNAL: 1,
@@ -9468,7 +9469,7 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
9468
9469
  const { kEnumerableProperty: kEnumerableProperty$10 } = require_util$5();
9469
9470
  const { webidl: webidl$14 } = require_webidl();
9470
9471
  const nodeUtil$2 = __require$2("node:util");
9471
- var FormData$2 = class FormData$2 {
9472
+ var FormData$3 = class FormData$3 {
9472
9473
  #state = [];
9473
9474
  constructor(form = void 0) {
9474
9475
  webidl$14.util.markAsUncloneable(this);
@@ -9479,7 +9480,7 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
9479
9480
  });
9480
9481
  }
9481
9482
  append(name, value, filename = void 0) {
9482
- webidl$14.brandCheck(this, FormData$2);
9483
+ webidl$14.brandCheck(this, FormData$3);
9483
9484
  const prefix = "FormData.append";
9484
9485
  webidl$14.argumentLengthCheck(arguments, 2, prefix);
9485
9486
  name = webidl$14.converters.USVString(name);
@@ -9491,13 +9492,13 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
9491
9492
  this.#state.push(entry);
9492
9493
  }
9493
9494
  delete(name) {
9494
- webidl$14.brandCheck(this, FormData$2);
9495
+ webidl$14.brandCheck(this, FormData$3);
9495
9496
  webidl$14.argumentLengthCheck(arguments, 1, "FormData.delete");
9496
9497
  name = webidl$14.converters.USVString(name);
9497
9498
  this.#state = this.#state.filter((entry) => entry.name !== name);
9498
9499
  }
9499
9500
  get(name) {
9500
- webidl$14.brandCheck(this, FormData$2);
9501
+ webidl$14.brandCheck(this, FormData$3);
9501
9502
  webidl$14.argumentLengthCheck(arguments, 1, "FormData.get");
9502
9503
  name = webidl$14.converters.USVString(name);
9503
9504
  const idx = this.#state.findIndex((entry) => entry.name === name);
@@ -9505,19 +9506,19 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
9505
9506
  return this.#state[idx].value;
9506
9507
  }
9507
9508
  getAll(name) {
9508
- webidl$14.brandCheck(this, FormData$2);
9509
+ webidl$14.brandCheck(this, FormData$3);
9509
9510
  webidl$14.argumentLengthCheck(arguments, 1, "FormData.getAll");
9510
9511
  name = webidl$14.converters.USVString(name);
9511
9512
  return this.#state.filter((entry) => entry.name === name).map((entry) => entry.value);
9512
9513
  }
9513
9514
  has(name) {
9514
- webidl$14.brandCheck(this, FormData$2);
9515
+ webidl$14.brandCheck(this, FormData$3);
9515
9516
  webidl$14.argumentLengthCheck(arguments, 1, "FormData.has");
9516
9517
  name = webidl$14.converters.USVString(name);
9517
9518
  return this.#state.findIndex((entry) => entry.name === name) !== -1;
9518
9519
  }
9519
9520
  set(name, value, filename = void 0) {
9520
- webidl$14.brandCheck(this, FormData$2);
9521
+ webidl$14.brandCheck(this, FormData$3);
9521
9522
  const prefix = "FormData.set";
9522
9523
  webidl$14.argumentLengthCheck(arguments, 2, prefix);
9523
9524
  name = webidl$14.converters.USVString(name);
@@ -9560,11 +9561,11 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
9560
9561
  formData.#state = newState;
9561
9562
  }
9562
9563
  };
9563
- const { getFormDataState, setFormDataState: setFormDataState$1 } = FormData$2;
9564
- Reflect.deleteProperty(FormData$2, "getFormDataState");
9565
- Reflect.deleteProperty(FormData$2, "setFormDataState");
9566
- iteratorMixin$1("FormData", FormData$2, getFormDataState, "name", "value");
9567
- Object.defineProperties(FormData$2.prototype, {
9564
+ const { getFormDataState, setFormDataState: setFormDataState$1 } = FormData$3;
9565
+ Reflect.deleteProperty(FormData$3, "getFormDataState");
9566
+ Reflect.deleteProperty(FormData$3, "setFormDataState");
9567
+ iteratorMixin$1("FormData", FormData$3, getFormDataState, "name", "value");
9568
+ Object.defineProperties(FormData$3.prototype, {
9568
9569
  append: kEnumerableProperty$10,
9569
9570
  delete: kEnumerableProperty$10,
9570
9571
  get: kEnumerableProperty$10,
@@ -9600,9 +9601,9 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
9600
9601
  value
9601
9602
  };
9602
9603
  }
9603
- webidl$14.is.FormData = webidl$14.util.MakeTypeAssertion(FormData$2);
9604
+ webidl$14.is.FormData = webidl$14.util.MakeTypeAssertion(FormData$3);
9604
9605
  module.exports = {
9605
- FormData: FormData$2,
9606
+ FormData: FormData$3,
9606
9607
  makeEntry: makeEntry$1,
9607
9608
  setFormDataState: setFormDataState$1
9608
9609
  };
@@ -9882,7 +9883,7 @@ var require_promise = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
9882
9883
  var require_body = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/body.js": ((exports, module) => {
9883
9884
  const util$24 = require_util$5();
9884
9885
  const { ReadableStreamFrom: ReadableStreamFrom$1, readableStreamClose: readableStreamClose$1, fullyReadBody: fullyReadBody$1, extractMimeType: extractMimeType$1 } = require_util$4();
9885
- const { FormData: FormData$1, setFormDataState } = require_formdata();
9886
+ const { FormData: FormData$2, setFormDataState } = require_formdata();
9886
9887
  const { webidl: webidl$12 } = require_webidl();
9887
9888
  const assert$25 = __require$2("node:assert");
9888
9889
  const { isErrored: isErrored$1, isDisturbed: isDisturbed$2 } = __require$2("node:stream");
@@ -10052,13 +10053,13 @@ Content-Type: ${value.type || "application/octet-stream"}\r\n\r\n`);
10052
10053
  if (mimeType !== null) switch (mimeType.essence) {
10053
10054
  case "multipart/form-data": {
10054
10055
  const parsed = multipartFormDataParser(value, mimeType);
10055
- const fd = new FormData$1();
10056
+ const fd = new FormData$2();
10056
10057
  setFormDataState(fd, parsed);
10057
10058
  return fd;
10058
10059
  }
10059
10060
  case "application/x-www-form-urlencoded": {
10060
10061
  const entries = new URLSearchParams(value.toString());
10061
- const fd = new FormData$1();
10062
+ const fd = new FormData$2();
10062
10063
  for (const [name, value$1] of entries) fd.append(name, value$1);
10063
10064
  return fd;
10064
10065
  }
@@ -19859,7 +19860,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19859
19860
  }
19860
19861
  }
19861
19862
  };
19862
- var Headers$5 = class Headers$5 {
19863
+ var Headers$6 = class Headers$6 {
19863
19864
  #guard;
19864
19865
  /**
19865
19866
  * @type {HeadersList}
@@ -19880,7 +19881,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19880
19881
  }
19881
19882
  }
19882
19883
  append(name, value) {
19883
- webidl$11.brandCheck(this, Headers$5);
19884
+ webidl$11.brandCheck(this, Headers$6);
19884
19885
  webidl$11.argumentLengthCheck(arguments, 2, "Headers.append");
19885
19886
  const prefix = "Headers.append";
19886
19887
  name = webidl$11.converters.ByteString(name, prefix, "name");
@@ -19888,7 +19889,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19888
19889
  return appendHeader(this, name, value);
19889
19890
  }
19890
19891
  delete(name) {
19891
- webidl$11.brandCheck(this, Headers$5);
19892
+ webidl$11.brandCheck(this, Headers$6);
19892
19893
  webidl$11.argumentLengthCheck(arguments, 1, "Headers.delete");
19893
19894
  name = webidl$11.converters.ByteString(name, "Headers.delete", "name");
19894
19895
  if (!isValidHeaderName$1(name)) throw webidl$11.errors.invalidArgument({
@@ -19901,7 +19902,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19901
19902
  this.#headersList.delete(name, false);
19902
19903
  }
19903
19904
  get(name) {
19904
- webidl$11.brandCheck(this, Headers$5);
19905
+ webidl$11.brandCheck(this, Headers$6);
19905
19906
  webidl$11.argumentLengthCheck(arguments, 1, "Headers.get");
19906
19907
  const prefix = "Headers.get";
19907
19908
  name = webidl$11.converters.ByteString(name, prefix, "name");
@@ -19913,7 +19914,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19913
19914
  return this.#headersList.get(name, false);
19914
19915
  }
19915
19916
  has(name) {
19916
- webidl$11.brandCheck(this, Headers$5);
19917
+ webidl$11.brandCheck(this, Headers$6);
19917
19918
  webidl$11.argumentLengthCheck(arguments, 1, "Headers.has");
19918
19919
  const prefix = "Headers.has";
19919
19920
  name = webidl$11.converters.ByteString(name, prefix, "name");
@@ -19925,7 +19926,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19925
19926
  return this.#headersList.contains(name, false);
19926
19927
  }
19927
19928
  set(name, value) {
19928
- webidl$11.brandCheck(this, Headers$5);
19929
+ webidl$11.brandCheck(this, Headers$6);
19929
19930
  webidl$11.argumentLengthCheck(arguments, 2, "Headers.set");
19930
19931
  const prefix = "Headers.set";
19931
19932
  name = webidl$11.converters.ByteString(name, prefix, "name");
@@ -19945,7 +19946,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19945
19946
  this.#headersList.set(name, value, false);
19946
19947
  }
19947
19948
  getSetCookie() {
19948
- webidl$11.brandCheck(this, Headers$5);
19949
+ webidl$11.brandCheck(this, Headers$6);
19949
19950
  const list$1 = this.#headersList.cookies;
19950
19951
  if (list$1) return [...list$1];
19951
19952
  return [];
@@ -19974,13 +19975,13 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19974
19975
  target$1.#headersList = list$1;
19975
19976
  }
19976
19977
  };
19977
- const { getHeadersGuard: getHeadersGuard$2, setHeadersGuard: setHeadersGuard$2, getHeadersList: getHeadersList$2, setHeadersList: setHeadersList$2 } = Headers$5;
19978
- Reflect.deleteProperty(Headers$5, "getHeadersGuard");
19979
- Reflect.deleteProperty(Headers$5, "setHeadersGuard");
19980
- Reflect.deleteProperty(Headers$5, "getHeadersList");
19981
- Reflect.deleteProperty(Headers$5, "setHeadersList");
19982
- iteratorMixin("Headers", Headers$5, headersListSortAndCombine, 0, 1);
19983
- Object.defineProperties(Headers$5.prototype, {
19978
+ const { getHeadersGuard: getHeadersGuard$2, setHeadersGuard: setHeadersGuard$2, getHeadersList: getHeadersList$2, setHeadersList: setHeadersList$2 } = Headers$6;
19979
+ Reflect.deleteProperty(Headers$6, "getHeadersGuard");
19980
+ Reflect.deleteProperty(Headers$6, "setHeadersGuard");
19981
+ Reflect.deleteProperty(Headers$6, "getHeadersList");
19982
+ Reflect.deleteProperty(Headers$6, "setHeadersList");
19983
+ iteratorMixin("Headers", Headers$6, headersListSortAndCombine, 0, 1);
19984
+ Object.defineProperties(Headers$6.prototype, {
19984
19985
  append: kEnumerableProperty$9,
19985
19986
  delete: kEnumerableProperty$9,
19986
19987
  get: kEnumerableProperty$9,
@@ -19996,7 +19997,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
19996
19997
  webidl$11.converters.HeadersInit = function(V, prefix, argument) {
19997
19998
  if (webidl$11.util.Type(V) === webidl$11.util.Types.OBJECT) {
19998
19999
  const iterator = Reflect.get(V, Symbol.iterator);
19999
- if (!util$6.types.isProxy(V) && iterator === Headers$5.prototype.entries) try {
20000
+ if (!util$6.types.isProxy(V) && iterator === Headers$6.prototype.entries) try {
20000
20001
  return getHeadersList$2(V).entriesList;
20001
20002
  } catch {}
20002
20003
  if (typeof iterator === "function") return webidl$11.converters["sequence<sequence<ByteString>>"](V, prefix, argument, iterator.bind(V));
@@ -20011,7 +20012,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
20011
20012
  module.exports = {
20012
20013
  fill: fill$1,
20013
20014
  compareHeaderName,
20014
- Headers: Headers$5,
20015
+ Headers: Headers$6,
20015
20016
  HeadersList: HeadersList$3,
20016
20017
  getHeadersGuard: getHeadersGuard$2,
20017
20018
  setHeadersGuard: setHeadersGuard$2,
@@ -20023,7 +20024,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
20023
20024
  //#endregion
20024
20025
  //#region ../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/response.js
20025
20026
  var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/response.js": ((exports, module) => {
20026
- const { Headers: Headers$4, HeadersList: HeadersList$2, fill, getHeadersGuard: getHeadersGuard$1, setHeadersGuard: setHeadersGuard$1, setHeadersList: setHeadersList$1 } = require_headers();
20027
+ const { Headers: Headers$5, HeadersList: HeadersList$2, fill, getHeadersGuard: getHeadersGuard$1, setHeadersGuard: setHeadersGuard$1, setHeadersList: setHeadersList$1 } = require_headers();
20027
20028
  const { extractBody: extractBody$2, cloneBody: cloneBody$1, mixinBody: mixinBody$1, streamRegistry, bodyUnusable: bodyUnusable$1 } = require_body();
20028
20029
  const util$5 = require_util$5();
20029
20030
  const nodeUtil$1 = __require$2("node:util");
@@ -20036,7 +20037,7 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
20036
20037
  const assert$9 = __require$2("node:assert");
20037
20038
  const { isomorphicEncode: isomorphicEncode$1, serializeJavascriptValueToJSONString } = require_infra();
20038
20039
  const textEncoder = new TextEncoder("utf-8");
20039
- var Response$2 = class Response$2 {
20040
+ var Response$3 = class Response$3 {
20040
20041
  /** @type {Headers} */
20041
20042
  #headers;
20042
20043
  #state;
@@ -20077,7 +20078,7 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
20077
20078
  if (body !== null) body = webidl$10.converters.BodyInit(body, "Response", "body");
20078
20079
  init = webidl$10.converters.ResponseInit(init);
20079
20080
  this.#state = makeResponse$1({});
20080
- this.#headers = new Headers$4(kConstruct$6);
20081
+ this.#headers = new Headers$5(kConstruct$6);
20081
20082
  setHeadersGuard$1(this.#headers, "response");
20082
20083
  setHeadersList$1(this.#headers, this.#state.headersList);
20083
20084
  let bodyWithType = null;
@@ -20091,46 +20092,46 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
20091
20092
  initializeResponse(this, init, bodyWithType);
20092
20093
  }
20093
20094
  get type() {
20094
- webidl$10.brandCheck(this, Response$2);
20095
+ webidl$10.brandCheck(this, Response$3);
20095
20096
  return this.#state.type;
20096
20097
  }
20097
20098
  get url() {
20098
- webidl$10.brandCheck(this, Response$2);
20099
+ webidl$10.brandCheck(this, Response$3);
20099
20100
  const urlList = this.#state.urlList;
20100
20101
  const url = urlList[urlList.length - 1] ?? null;
20101
20102
  if (url === null) return "";
20102
20103
  return URLSerializer$3(url, true);
20103
20104
  }
20104
20105
  get redirected() {
20105
- webidl$10.brandCheck(this, Response$2);
20106
+ webidl$10.brandCheck(this, Response$3);
20106
20107
  return this.#state.urlList.length > 1;
20107
20108
  }
20108
20109
  get status() {
20109
- webidl$10.brandCheck(this, Response$2);
20110
+ webidl$10.brandCheck(this, Response$3);
20110
20111
  return this.#state.status;
20111
20112
  }
20112
20113
  get ok() {
20113
- webidl$10.brandCheck(this, Response$2);
20114
+ webidl$10.brandCheck(this, Response$3);
20114
20115
  return this.#state.status >= 200 && this.#state.status <= 299;
20115
20116
  }
20116
20117
  get statusText() {
20117
- webidl$10.brandCheck(this, Response$2);
20118
+ webidl$10.brandCheck(this, Response$3);
20118
20119
  return this.#state.statusText;
20119
20120
  }
20120
20121
  get headers() {
20121
- webidl$10.brandCheck(this, Response$2);
20122
+ webidl$10.brandCheck(this, Response$3);
20122
20123
  return this.#headers;
20123
20124
  }
20124
20125
  get body() {
20125
- webidl$10.brandCheck(this, Response$2);
20126
+ webidl$10.brandCheck(this, Response$3);
20126
20127
  return this.#state.body ? this.#state.body.stream : null;
20127
20128
  }
20128
20129
  get bodyUsed() {
20129
- webidl$10.brandCheck(this, Response$2);
20130
+ webidl$10.brandCheck(this, Response$3);
20130
20131
  return !!this.#state.body && util$5.isDisturbed(this.#state.body.stream);
20131
20132
  }
20132
20133
  clone() {
20133
- webidl$10.brandCheck(this, Response$2);
20134
+ webidl$10.brandCheck(this, Response$3);
20134
20135
  if (bodyUnusable$1(this.#state)) throw webidl$10.errors.exception({
20135
20136
  header: "Response.clone",
20136
20137
  message: "Body has already been consumed."
@@ -20182,13 +20183,13 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
20182
20183
  response.#state = newState;
20183
20184
  }
20184
20185
  };
20185
- const { getResponseHeaders, setResponseHeaders, getResponseState: getResponseState$2, setResponseState } = Response$2;
20186
- Reflect.deleteProperty(Response$2, "getResponseHeaders");
20187
- Reflect.deleteProperty(Response$2, "setResponseHeaders");
20188
- Reflect.deleteProperty(Response$2, "getResponseState");
20189
- Reflect.deleteProperty(Response$2, "setResponseState");
20190
- mixinBody$1(Response$2, getResponseState$2);
20191
- Object.defineProperties(Response$2.prototype, {
20186
+ const { getResponseHeaders, setResponseHeaders, getResponseState: getResponseState$2, setResponseState } = Response$3;
20187
+ Reflect.deleteProperty(Response$3, "getResponseHeaders");
20188
+ Reflect.deleteProperty(Response$3, "setResponseHeaders");
20189
+ Reflect.deleteProperty(Response$3, "getResponseState");
20190
+ Reflect.deleteProperty(Response$3, "setResponseState");
20191
+ mixinBody$1(Response$3, getResponseState$2);
20192
+ Object.defineProperties(Response$3.prototype, {
20192
20193
  type: kEnumerableProperty$8,
20193
20194
  url: kEnumerableProperty$8,
20194
20195
  status: kEnumerableProperty$8,
@@ -20204,7 +20205,7 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
20204
20205
  configurable: true
20205
20206
  }
20206
20207
  });
20207
- Object.defineProperties(Response$2, {
20208
+ Object.defineProperties(Response$3, {
20208
20209
  json: kEnumerableProperty$8,
20209
20210
  redirect: kEnumerableProperty$8,
20210
20211
  error: kEnumerableProperty$8
@@ -20314,9 +20315,9 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
20314
20315
  * @returns {Response}
20315
20316
  */
20316
20317
  function fromInnerResponse$2(innerResponse, guard) {
20317
- const response = new Response$2(kConstruct$6);
20318
+ const response = new Response$3(kConstruct$6);
20318
20319
  setResponseState(response, innerResponse);
20319
- const headers = new Headers$4(kConstruct$6);
20320
+ const headers = new Headers$5(kConstruct$6);
20320
20321
  setResponseHeaders(response, headers);
20321
20322
  setHeadersList$1(headers, innerResponse.headersList);
20322
20323
  setHeadersGuard$1(headers, guard);
@@ -20352,14 +20353,14 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
20352
20353
  converter: webidl$10.converters.HeadersInit
20353
20354
  }
20354
20355
  ]);
20355
- webidl$10.is.Response = webidl$10.util.MakeTypeAssertion(Response$2);
20356
+ webidl$10.is.Response = webidl$10.util.MakeTypeAssertion(Response$3);
20356
20357
  module.exports = {
20357
20358
  isNetworkError: isNetworkError$1,
20358
20359
  makeNetworkError: makeNetworkError$1,
20359
20360
  makeResponse: makeResponse$1,
20360
20361
  makeAppropriateNetworkError: makeAppropriateNetworkError$1,
20361
20362
  filterResponse: filterResponse$1,
20362
- Response: Response$2,
20363
+ Response: Response$3,
20363
20364
  cloneResponse: cloneResponse$1,
20364
20365
  fromInnerResponse: fromInnerResponse$2,
20365
20366
  getResponseState: getResponseState$2
@@ -20370,7 +20371,7 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
20370
20371
  //#region ../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/request.js
20371
20372
  var require_request = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/request.js": ((exports, module) => {
20372
20373
  const { extractBody: extractBody$1, mixinBody, cloneBody, bodyUnusable } = require_body();
20373
- const { Headers: Headers$3, fill: fillHeaders, HeadersList: HeadersList$1, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList: getHeadersList$1 } = require_headers();
20374
+ const { Headers: Headers$4, fill: fillHeaders, HeadersList: HeadersList$1, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList: getHeadersList$1 } = require_headers();
20374
20375
  const util$4 = require_util$5();
20375
20376
  const nodeUtil = __require$2("node:util");
20376
20377
  const { isValidHTTPToken, sameOrigin: sameOrigin$1, environmentSettingsObject: environmentSettingsObject$3 } = require_util$4();
@@ -20546,7 +20547,7 @@ var require_request = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
20546
20547
  abort: abort$1
20547
20548
  }, abort$1);
20548
20549
  }
20549
- this.#headers = new Headers$3(kConstruct$5);
20550
+ this.#headers = new Headers$4(kConstruct$5);
20550
20551
  setHeadersList(this.#headers, request$2.headersList);
20551
20552
  setHeadersGuard(this.#headers, "request");
20552
20553
  if (mode === "no-cors") {
@@ -20819,7 +20820,7 @@ var require_request = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
20819
20820
  setRequestState(request$2, innerRequest);
20820
20821
  setRequestDispatcher(request$2, dispatcher);
20821
20822
  setRequestSignal(request$2, signal);
20822
- const headers = new Headers$3(kConstruct$5);
20823
+ const headers = new Headers$4(kConstruct$5);
20823
20824
  setRequestHeaders(request$2, headers);
20824
20825
  setHeadersList(headers, innerRequest.headersList);
20825
20826
  setHeadersGuard(headers, guard);
@@ -22769,8 +22770,8 @@ var require_cookies = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
22769
22770
  const { parseSetCookie } = require_parse$1();
22770
22771
  const { stringify } = require_util$2();
22771
22772
  const { webidl: webidl$5 } = require_webidl();
22772
- const { Headers: Headers$2 } = require_headers();
22773
- const brandChecks = webidl$5.brandCheckMultiple([Headers$2, globalThis.Headers].filter(Boolean));
22773
+ const { Headers: Headers$3 } = require_headers();
22774
+ const brandChecks = webidl$5.brandCheckMultiple([Headers$3, globalThis.Headers].filter(Boolean));
22774
22775
  /**
22775
22776
  * @typedef {Object} Cookie
22776
22777
  * @property {string} name
@@ -23629,7 +23630,7 @@ var require_connection = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
23629
23630
  const { parseExtensions, isClosed: isClosed$1, isClosing: isClosing$1, isEstablished: isEstablished$2, isConnecting: isConnecting$1, validateCloseCodeAndReason: validateCloseCodeAndReason$1 } = require_util$1();
23630
23631
  const { makeRequest: makeRequest$1 } = require_request();
23631
23632
  const { fetching: fetching$1 } = require_fetch();
23632
- const { Headers: Headers$1, getHeadersList } = require_headers();
23633
+ const { Headers: Headers$2, getHeadersList } = require_headers();
23633
23634
  const { getDecodeSplit } = require_util$4();
23634
23635
  const { WebsocketFrameSend: WebsocketFrameSend$4 } = require_frame();
23635
23636
  const assert$2 = __require$2("node:assert");
@@ -23657,7 +23658,7 @@ var require_connection = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
23657
23658
  redirect: "error",
23658
23659
  useURLCredentials: true
23659
23660
  });
23660
- if (options.headers) request$2.headersList = getHeadersList(new Headers$1(options.headers));
23661
+ if (options.headers) request$2.headersList = getHeadersList(new Headers$2(options.headers));
23661
23662
  const keyValue = crypto.randomBytes(16).toString("base64");
23662
23663
  request$2.headersList.append("sec-websocket-key", keyValue, true);
23663
23664
  request$2.headersList.append("sec-websocket-version", "13", true);
@@ -26250,7 +26251,7 @@ var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0
26250
26251
  return function() {};
26251
26252
  };
26252
26253
  else {
26253
- assert2 = __require$1("assert");
26254
+ assert3 = __require$1("assert");
26254
26255
  signals = require_signals();
26255
26256
  isWin$1 = /^win/i.test(process2.platform);
26256
26257
  EE$3 = __require$1("events");
@@ -26267,7 +26268,7 @@ var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0
26267
26268
  }
26268
26269
  module$1.exports = function(cb, opts) {
26269
26270
  if (!processOk(global.process)) return function() {};
26270
- assert2.equal(typeof cb, "function", "a callback must be provided for exit handler");
26271
+ assert3.equal(typeof cb, "function", "a callback must be provided for exit handler");
26271
26272
  if (loaded === false) load();
26272
26273
  var ev = "exit";
26273
26274
  if (opts && opts.alwaysLast) ev = "afterexit";
@@ -26348,7 +26349,7 @@ var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0
26348
26349
  } else return originalProcessEmit.apply(this, arguments);
26349
26350
  }, "processEmit");
26350
26351
  }
26351
- var assert2;
26352
+ var assert3;
26352
26353
  var signals;
26353
26354
  var isWin$1;
26354
26355
  var EE$3;
@@ -26470,6 +26471,799 @@ var require_command_exists = __commonJS({ "../../node_modules/.pnpm/command-exis
26470
26471
  var require_command_exists2 = __commonJS({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js"(exports$1, module$1) {
26471
26472
  module$1.exports = require_command_exists();
26472
26473
  } });
26474
+ var require_ini = __commonJS({ "../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js"(exports$1) {
26475
+ exports$1.parse = exports$1.decode = decode;
26476
+ exports$1.stringify = exports$1.encode = encode$2;
26477
+ exports$1.safe = safe;
26478
+ exports$1.unsafe = unsafe;
26479
+ var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
26480
+ function encode$2(obj, opt) {
26481
+ var children = [];
26482
+ var out = "";
26483
+ if (typeof opt === "string") opt = {
26484
+ section: opt,
26485
+ whitespace: false
26486
+ };
26487
+ else {
26488
+ opt = opt || {};
26489
+ opt.whitespace = opt.whitespace === true;
26490
+ }
26491
+ var separator = opt.whitespace ? " = " : "=";
26492
+ Object.keys(obj).forEach(function(k, _2, __) {
26493
+ var val = obj[k];
26494
+ if (val && Array.isArray(val)) val.forEach(function(item) {
26495
+ out += safe(k + "[]") + separator + safe(item) + "\n";
26496
+ });
26497
+ else if (val && typeof val === "object") children.push(k);
26498
+ else out += safe(k) + separator + safe(val) + eol;
26499
+ });
26500
+ if (opt.section && out.length) out = "[" + safe(opt.section) + "]" + eol + out;
26501
+ children.forEach(function(k, _2, __) {
26502
+ var nk = dotSplit(k).join("\\.");
26503
+ var section = (opt.section ? opt.section + "." : "") + nk;
26504
+ var child = encode$2(obj[k], {
26505
+ section,
26506
+ whitespace: opt.whitespace
26507
+ });
26508
+ if (out.length && child.length) out += eol;
26509
+ out += child;
26510
+ });
26511
+ return out;
26512
+ }
26513
+ __name(encode$2, "encode");
26514
+ function dotSplit(str) {
26515
+ return str.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map(function(part) {
26516
+ return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, "");
26517
+ });
26518
+ }
26519
+ __name(dotSplit, "dotSplit");
26520
+ function decode(str) {
26521
+ var out = {};
26522
+ var p$1 = out;
26523
+ var section = null;
26524
+ var re$5 = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
26525
+ str.split(/[\r\n]+/g).forEach(function(line, _2, __) {
26526
+ if (!line || line.match(/^\s*[;#]/)) return;
26527
+ var match = line.match(re$5);
26528
+ if (!match) return;
26529
+ if (match[1] !== void 0) {
26530
+ section = unsafe(match[1]);
26531
+ if (section === "__proto__") {
26532
+ p$1 = {};
26533
+ return;
26534
+ }
26535
+ p$1 = out[section] = out[section] || {};
26536
+ return;
26537
+ }
26538
+ var key = unsafe(match[2]);
26539
+ if (key === "__proto__") return;
26540
+ var value = match[3] ? unsafe(match[4]) : true;
26541
+ switch (value) {
26542
+ case "true":
26543
+ case "false":
26544
+ case "null": value = JSON.parse(value);
26545
+ }
26546
+ if (key.length > 2 && key.slice(-2) === "[]") {
26547
+ key = key.substring(0, key.length - 2);
26548
+ if (key === "__proto__") return;
26549
+ if (!p$1[key]) p$1[key] = [];
26550
+ else if (!Array.isArray(p$1[key])) p$1[key] = [p$1[key]];
26551
+ }
26552
+ if (Array.isArray(p$1[key])) p$1[key].push(value);
26553
+ else p$1[key] = value;
26554
+ });
26555
+ Object.keys(out).filter(function(k, _2, __) {
26556
+ if (!out[k] || typeof out[k] !== "object" || Array.isArray(out[k])) return false;
26557
+ var parts = dotSplit(k);
26558
+ var p2 = out;
26559
+ var l = parts.pop();
26560
+ var nl = l.replace(/\\\./g, ".");
26561
+ parts.forEach(function(part, _3, __2) {
26562
+ if (part === "__proto__") return;
26563
+ if (!p2[part] || typeof p2[part] !== "object") p2[part] = {};
26564
+ p2 = p2[part];
26565
+ });
26566
+ if (p2 === out && nl === l) return false;
26567
+ p2[nl] = out[k];
26568
+ return true;
26569
+ }).forEach(function(del, _2, __) {
26570
+ delete out[del];
26571
+ });
26572
+ return out;
26573
+ }
26574
+ __name(decode, "decode");
26575
+ function isQuoted(val) {
26576
+ return val.charAt(0) === "\"" && val.slice(-1) === "\"" || val.charAt(0) === "'" && val.slice(-1) === "'";
26577
+ }
26578
+ __name(isQuoted, "isQuoted");
26579
+ function safe(val) {
26580
+ return typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim() ? JSON.stringify(val) : val.replace(/;/g, "\\;").replace(/#/g, "\\#");
26581
+ }
26582
+ __name(safe, "safe");
26583
+ function unsafe(val, doUnesc) {
26584
+ val = (val || "").trim();
26585
+ if (isQuoted(val)) {
26586
+ if (val.charAt(0) === "'") val = val.substr(1, val.length - 2);
26587
+ try {
26588
+ val = JSON.parse(val);
26589
+ } catch (_2) {}
26590
+ } else {
26591
+ var esc = false;
26592
+ var unesc = "";
26593
+ for (var i$1 = 0, l = val.length; i$1 < l; i$1++) {
26594
+ var c = val.charAt(i$1);
26595
+ if (esc) {
26596
+ if ("\\;#".indexOf(c) !== -1) unesc += c;
26597
+ else unesc += "\\" + c;
26598
+ esc = false;
26599
+ } else if (";#".indexOf(c) !== -1) break;
26600
+ else if (c === "\\") esc = true;
26601
+ else unesc += c;
26602
+ }
26603
+ if (esc) unesc += "\\";
26604
+ return unesc.trim();
26605
+ }
26606
+ return val;
26607
+ }
26608
+ __name(unsafe, "unsafe");
26609
+ } });
26610
+ var require_strip_json_comments = __commonJS({ "../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js"(exports$1, module$1) {
26611
+ var singleComment = 1;
26612
+ var multiComment = 2;
26613
+ function stripWithoutWhitespace() {
26614
+ return "";
26615
+ }
26616
+ __name(stripWithoutWhitespace, "stripWithoutWhitespace");
26617
+ function stripWithWhitespace(str, start, end) {
26618
+ return str.slice(start, end).replace(/\S/g, " ");
26619
+ }
26620
+ __name(stripWithWhitespace, "stripWithWhitespace");
26621
+ module$1.exports = function(str, opts) {
26622
+ opts = opts || {};
26623
+ var currentChar;
26624
+ var nextChar;
26625
+ var insideString = false;
26626
+ var insideComment = false;
26627
+ var offset = 0;
26628
+ var ret = "";
26629
+ var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
26630
+ for (var i$1 = 0; i$1 < str.length; i$1++) {
26631
+ currentChar = str[i$1];
26632
+ nextChar = str[i$1 + 1];
26633
+ if (!insideComment && currentChar === "\"") {
26634
+ if (!(str[i$1 - 1] === "\\" && str[i$1 - 2] !== "\\")) insideString = !insideString;
26635
+ }
26636
+ if (insideString) continue;
26637
+ if (!insideComment && currentChar + nextChar === "//") {
26638
+ ret += str.slice(offset, i$1);
26639
+ offset = i$1;
26640
+ insideComment = singleComment;
26641
+ i$1++;
26642
+ } else if (insideComment === singleComment && currentChar + nextChar === "\r\n") {
26643
+ i$1++;
26644
+ insideComment = false;
26645
+ ret += strip(str, offset, i$1);
26646
+ offset = i$1;
26647
+ continue;
26648
+ } else if (insideComment === singleComment && currentChar === "\n") {
26649
+ insideComment = false;
26650
+ ret += strip(str, offset, i$1);
26651
+ offset = i$1;
26652
+ } else if (!insideComment && currentChar + nextChar === "/*") {
26653
+ ret += str.slice(offset, i$1);
26654
+ offset = i$1;
26655
+ insideComment = multiComment;
26656
+ i$1++;
26657
+ continue;
26658
+ } else if (insideComment === multiComment && currentChar + nextChar === "*/") {
26659
+ i$1++;
26660
+ insideComment = false;
26661
+ ret += strip(str, offset, i$1 + 1);
26662
+ offset = i$1 + 1;
26663
+ continue;
26664
+ }
26665
+ }
26666
+ return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset));
26667
+ };
26668
+ } });
26669
+ var require_utils$1 = __commonJS({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports$1) {
26670
+ var fs3 = __require$1("fs");
26671
+ var ini = require_ini();
26672
+ var path5 = __require$1("path");
26673
+ var stripJsonComments = require_strip_json_comments();
26674
+ var parse$10 = exports$1.parse = function(content) {
26675
+ if (/^\s*{/.test(content)) return JSON.parse(stripJsonComments(content));
26676
+ return ini.parse(content);
26677
+ };
26678
+ var file$1 = exports$1.file = function() {
26679
+ var args = [].slice.call(arguments).filter(function(arg) {
26680
+ return arg != null;
26681
+ });
26682
+ for (var i$1 in args) if ("string" !== typeof args[i$1]) return;
26683
+ var file2 = path5.join.apply(null, args);
26684
+ try {
26685
+ return fs3.readFileSync(file2, "utf-8");
26686
+ } catch (err) {
26687
+ return;
26688
+ }
26689
+ };
26690
+ exports$1.json = function() {
26691
+ var content = file$1.apply(null, arguments);
26692
+ return content ? parse$10(content) : null;
26693
+ };
26694
+ exports$1.env = function(prefix, env2) {
26695
+ env2 = env2 || process.env;
26696
+ var obj = {};
26697
+ var l = prefix.length;
26698
+ for (var k in env2) if (k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
26699
+ var keypath = k.substring(l).split("__");
26700
+ var _emptyStringIndex;
26701
+ while ((_emptyStringIndex = keypath.indexOf("")) > -1) keypath.splice(_emptyStringIndex, 1);
26702
+ var cursor = obj;
26703
+ keypath.forEach(/* @__PURE__ */ __name(function _buildSubObj(_subkey, i$1) {
26704
+ if (!_subkey || typeof cursor !== "object") return;
26705
+ if (i$1 === keypath.length - 1) cursor[_subkey] = env2[k];
26706
+ if (cursor[_subkey] === void 0) cursor[_subkey] = {};
26707
+ cursor = cursor[_subkey];
26708
+ }, "_buildSubObj"));
26709
+ }
26710
+ return obj;
26711
+ };
26712
+ exports$1.find = function() {
26713
+ var rel = path5.join.apply(null, [].slice.call(arguments));
26714
+ function find2(start, rel2) {
26715
+ var file2 = path5.join(start, rel2);
26716
+ try {
26717
+ fs3.statSync(file2);
26718
+ return file2;
26719
+ } catch (err) {
26720
+ if (path5.dirname(start) !== start) return find2(path5.dirname(start), rel2);
26721
+ }
26722
+ }
26723
+ __name(find2, "find");
26724
+ return find2(process.cwd(), rel);
26725
+ };
26726
+ } });
26727
+ var require_deep_extend = __commonJS({ "../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(exports$1, module$1) {
26728
+ function isSpecificValue(val) {
26729
+ return val instanceof Buffer || val instanceof Date || val instanceof RegExp ? true : false;
26730
+ }
26731
+ __name(isSpecificValue, "isSpecificValue");
26732
+ function cloneSpecificValue(val) {
26733
+ if (val instanceof Buffer) {
26734
+ var x = Buffer.alloc ? Buffer.alloc(val.length) : new Buffer(val.length);
26735
+ val.copy(x);
26736
+ return x;
26737
+ } else if (val instanceof Date) return new Date(val.getTime());
26738
+ else if (val instanceof RegExp) return new RegExp(val);
26739
+ else throw new Error("Unexpected situation");
26740
+ }
26741
+ __name(cloneSpecificValue, "cloneSpecificValue");
26742
+ function deepCloneArray(arr) {
26743
+ var clone = [];
26744
+ arr.forEach(function(item, index) {
26745
+ if (typeof item === "object" && item !== null) if (Array.isArray(item)) clone[index] = deepCloneArray(item);
26746
+ else if (isSpecificValue(item)) clone[index] = cloneSpecificValue(item);
26747
+ else clone[index] = deepExtend({}, item);
26748
+ else clone[index] = item;
26749
+ });
26750
+ return clone;
26751
+ }
26752
+ __name(deepCloneArray, "deepCloneArray");
26753
+ function safeGetProperty(object, property) {
26754
+ return property === "__proto__" ? void 0 : object[property];
26755
+ }
26756
+ __name(safeGetProperty, "safeGetProperty");
26757
+ var deepExtend = module$1.exports = function() {
26758
+ if (arguments.length < 1 || typeof arguments[0] !== "object") return false;
26759
+ if (arguments.length < 2) return arguments[0];
26760
+ var target$1 = arguments[0];
26761
+ var args = Array.prototype.slice.call(arguments, 1);
26762
+ var val, src$1;
26763
+ args.forEach(function(obj) {
26764
+ if (typeof obj !== "object" || obj === null || Array.isArray(obj)) return;
26765
+ Object.keys(obj).forEach(function(key) {
26766
+ src$1 = safeGetProperty(target$1, key);
26767
+ val = safeGetProperty(obj, key);
26768
+ if (val === target$1) return;
26769
+ else if (typeof val !== "object" || val === null) {
26770
+ target$1[key] = val;
26771
+ return;
26772
+ } else if (Array.isArray(val)) {
26773
+ target$1[key] = deepCloneArray(val);
26774
+ return;
26775
+ } else if (isSpecificValue(val)) {
26776
+ target$1[key] = cloneSpecificValue(val);
26777
+ return;
26778
+ } else if (typeof src$1 !== "object" || src$1 === null || Array.isArray(src$1)) {
26779
+ target$1[key] = deepExtend({}, val);
26780
+ return;
26781
+ } else {
26782
+ target$1[key] = deepExtend(src$1, val);
26783
+ return;
26784
+ }
26785
+ });
26786
+ });
26787
+ return target$1;
26788
+ };
26789
+ } });
26790
+ var require_minimist = __commonJS({ "../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(exports$1, module$1) {
26791
+ module$1.exports = function(args, opts) {
26792
+ if (!opts) opts = {};
26793
+ var flags = {
26794
+ bools: {},
26795
+ strings: {},
26796
+ unknownFn: null
26797
+ };
26798
+ if (typeof opts["unknown"] === "function") flags.unknownFn = opts["unknown"];
26799
+ if (typeof opts["boolean"] === "boolean" && opts["boolean"]) flags.allBools = true;
26800
+ else [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
26801
+ flags.bools[key2] = true;
26802
+ });
26803
+ var aliases = {};
26804
+ Object.keys(opts.alias || {}).forEach(function(key2) {
26805
+ aliases[key2] = [].concat(opts.alias[key2]);
26806
+ aliases[key2].forEach(function(x) {
26807
+ aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
26808
+ return x !== y;
26809
+ }));
26810
+ });
26811
+ });
26812
+ [].concat(opts.string).filter(Boolean).forEach(function(key2) {
26813
+ flags.strings[key2] = true;
26814
+ if (aliases[key2]) flags.strings[aliases[key2]] = true;
26815
+ });
26816
+ var defaults = opts["default"] || {};
26817
+ var argv$1 = { _: [] };
26818
+ Object.keys(flags.bools).forEach(function(key2) {
26819
+ setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
26820
+ });
26821
+ var notFlags = [];
26822
+ if (args.indexOf("--") !== -1) {
26823
+ notFlags = args.slice(args.indexOf("--") + 1);
26824
+ args = args.slice(0, args.indexOf("--"));
26825
+ }
26826
+ function argDefined(key2, arg2) {
26827
+ return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
26828
+ }
26829
+ __name(argDefined, "argDefined");
26830
+ function setArg(key2, val, arg2) {
26831
+ if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
26832
+ if (flags.unknownFn(arg2) === false) return;
26833
+ }
26834
+ var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
26835
+ setKey(argv$1, key2.split("."), value2);
26836
+ (aliases[key2] || []).forEach(function(x) {
26837
+ setKey(argv$1, x.split("."), value2);
26838
+ });
26839
+ }
26840
+ __name(setArg, "setArg");
26841
+ function setKey(obj, keys, value2) {
26842
+ var o = obj;
26843
+ for (var i2 = 0; i2 < keys.length - 1; i2++) {
26844
+ var key2 = keys[i2];
26845
+ if (isConstructorOrProto(o, key2)) return;
26846
+ if (o[key2] === void 0) o[key2] = {};
26847
+ if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) o[key2] = {};
26848
+ if (o[key2] === Array.prototype) o[key2] = [];
26849
+ o = o[key2];
26850
+ }
26851
+ var key2 = keys[keys.length - 1];
26852
+ if (isConstructorOrProto(o, key2)) return;
26853
+ if (o === Object.prototype || o === Number.prototype || o === String.prototype) o = {};
26854
+ if (o === Array.prototype) o = [];
26855
+ if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") o[key2] = value2;
26856
+ else if (Array.isArray(o[key2])) o[key2].push(value2);
26857
+ else o[key2] = [o[key2], value2];
26858
+ }
26859
+ __name(setKey, "setKey");
26860
+ function aliasIsBoolean(key2) {
26861
+ return aliases[key2].some(function(x) {
26862
+ return flags.bools[x];
26863
+ });
26864
+ }
26865
+ __name(aliasIsBoolean, "aliasIsBoolean");
26866
+ for (var i$1 = 0; i$1 < args.length; i$1++) {
26867
+ var arg = args[i$1];
26868
+ if (/^--.+=/.test(arg)) {
26869
+ var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
26870
+ var key = m[1];
26871
+ var value = m[2];
26872
+ if (flags.bools[key]) value = value !== "false";
26873
+ setArg(key, value, arg);
26874
+ } else if (/^--no-.+/.test(arg)) {
26875
+ var key = arg.match(/^--no-(.+)/)[1];
26876
+ setArg(key, false, arg);
26877
+ } else if (/^--.+/.test(arg)) {
26878
+ var key = arg.match(/^--(.+)/)[1];
26879
+ var next = args[i$1 + 1];
26880
+ if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
26881
+ setArg(key, next, arg);
26882
+ i$1++;
26883
+ } else if (/^(true|false)$/.test(next)) {
26884
+ setArg(key, next === "true", arg);
26885
+ i$1++;
26886
+ } else setArg(key, flags.strings[key] ? "" : true, arg);
26887
+ } else if (/^-[^-]+/.test(arg)) {
26888
+ var letters = arg.slice(1, -1).split("");
26889
+ var broken = false;
26890
+ for (var j = 0; j < letters.length; j++) {
26891
+ var next = arg.slice(j + 2);
26892
+ if (next === "-") {
26893
+ setArg(letters[j], next, arg);
26894
+ continue;
26895
+ }
26896
+ if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
26897
+ setArg(letters[j], next.split("=")[1], arg);
26898
+ broken = true;
26899
+ break;
26900
+ }
26901
+ if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
26902
+ setArg(letters[j], next, arg);
26903
+ broken = true;
26904
+ break;
26905
+ }
26906
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
26907
+ setArg(letters[j], arg.slice(j + 2), arg);
26908
+ broken = true;
26909
+ break;
26910
+ } else setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
26911
+ }
26912
+ var key = arg.slice(-1)[0];
26913
+ if (!broken && key !== "-") if (args[i$1 + 1] && !/^(-|--)[^-]/.test(args[i$1 + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
26914
+ setArg(key, args[i$1 + 1], arg);
26915
+ i$1++;
26916
+ } else if (args[i$1 + 1] && /^(true|false)$/.test(args[i$1 + 1])) {
26917
+ setArg(key, args[i$1 + 1] === "true", arg);
26918
+ i$1++;
26919
+ } else setArg(key, flags.strings[key] ? "" : true, arg);
26920
+ } else {
26921
+ if (!flags.unknownFn || flags.unknownFn(arg) !== false) argv$1._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
26922
+ if (opts.stopEarly) {
26923
+ argv$1._.push.apply(argv$1._, args.slice(i$1 + 1));
26924
+ break;
26925
+ }
26926
+ }
26927
+ }
26928
+ Object.keys(defaults).forEach(function(key2) {
26929
+ if (!hasKey(argv$1, key2.split("."))) {
26930
+ setKey(argv$1, key2.split("."), defaults[key2]);
26931
+ (aliases[key2] || []).forEach(function(x) {
26932
+ setKey(argv$1, x.split("."), defaults[key2]);
26933
+ });
26934
+ }
26935
+ });
26936
+ if (opts["--"]) {
26937
+ argv$1["--"] = new Array();
26938
+ notFlags.forEach(function(key2) {
26939
+ argv$1["--"].push(key2);
26940
+ });
26941
+ } else notFlags.forEach(function(key2) {
26942
+ argv$1._.push(key2);
26943
+ });
26944
+ return argv$1;
26945
+ };
26946
+ function hasKey(obj, keys) {
26947
+ var o = obj;
26948
+ keys.slice(0, -1).forEach(function(key2) {
26949
+ o = o[key2] || {};
26950
+ });
26951
+ return keys[keys.length - 1] in o;
26952
+ }
26953
+ __name(hasKey, "hasKey");
26954
+ function isNumber(x) {
26955
+ if (typeof x === "number") return true;
26956
+ if (/^0x[0-9a-f]+$/i.test(x)) return true;
26957
+ return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
26958
+ }
26959
+ __name(isNumber, "isNumber");
26960
+ function isConstructorOrProto(obj, key) {
26961
+ return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
26962
+ }
26963
+ __name(isConstructorOrProto, "isConstructorOrProto");
26964
+ } });
26965
+ var require_rc = __commonJS({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(exports$1, module$1) {
26966
+ var cc = require_utils$1();
26967
+ var join2 = __require$1("path").join;
26968
+ var deepExtend = require_deep_extend();
26969
+ var etc = "/etc";
26970
+ var win = process.platform === "win32";
26971
+ var home = win ? process.env.USERPROFILE : process.env.HOME;
26972
+ module$1.exports = function(name, defaults, argv$1, parse$10) {
26973
+ if ("string" !== typeof name) throw new Error("rc(name): name *must* be string");
26974
+ if (!argv$1) argv$1 = require_minimist()(process.argv.slice(2));
26975
+ defaults = ("string" === typeof defaults ? cc.json(defaults) : defaults) || {};
26976
+ parse$10 = parse$10 || cc.parse;
26977
+ var env$1 = cc.env(name + "_");
26978
+ var configs = [defaults];
26979
+ var configFiles = [];
26980
+ function addConfigFile(file$1) {
26981
+ if (configFiles.indexOf(file$1) >= 0) return;
26982
+ var fileConfig = cc.file(file$1);
26983
+ if (fileConfig) {
26984
+ configs.push(parse$10(fileConfig));
26985
+ configFiles.push(file$1);
26986
+ }
26987
+ }
26988
+ __name(addConfigFile, "addConfigFile");
26989
+ if (!win) [join2(etc, name, "config"), join2(etc, name + "rc")].forEach(addConfigFile);
26990
+ if (home) [
26991
+ join2(home, ".config", name, "config"),
26992
+ join2(home, ".config", name),
26993
+ join2(home, "." + name, "config"),
26994
+ join2(home, "." + name + "rc")
26995
+ ].forEach(addConfigFile);
26996
+ addConfigFile(cc.find("." + name + "rc"));
26997
+ if (env$1.config) addConfigFile(env$1.config);
26998
+ if (argv$1.config) addConfigFile(argv$1.config);
26999
+ return deepExtend.apply(null, configs.concat([
27000
+ env$1,
27001
+ argv$1,
27002
+ configFiles.length ? {
27003
+ configs: configFiles,
27004
+ config: configFiles[configFiles.length - 1]
27005
+ } : void 0
27006
+ ]));
27007
+ };
27008
+ } });
27009
+ var require_registry_url = __commonJS({ "../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(exports$1, module$1) {
27010
+ module$1.exports = function(scope) {
27011
+ var rc = require_rc()("npm", { registry: "https://registry.npmjs.org/" });
27012
+ var url = rc[scope + ":registry"] || rc.registry;
27013
+ return url.slice(-1) === "/" ? url : url + "/";
27014
+ };
27015
+ } });
27016
+ var require_safe_buffer = __commonJS({ "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports$1, module$1) {
27017
+ var buffer$1 = __require$1("buffer");
27018
+ var Buffer2 = buffer$1.Buffer;
27019
+ function copyProps(src$1, dst) {
27020
+ for (var key in src$1) dst[key] = src$1[key];
27021
+ }
27022
+ __name(copyProps, "copyProps");
27023
+ if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) module$1.exports = buffer$1;
27024
+ else {
27025
+ copyProps(buffer$1, exports$1);
27026
+ exports$1.Buffer = SafeBuffer;
27027
+ }
27028
+ function SafeBuffer(arg, encodingOrOffset, length) {
27029
+ return Buffer2(arg, encodingOrOffset, length);
27030
+ }
27031
+ __name(SafeBuffer, "SafeBuffer");
27032
+ SafeBuffer.prototype = Object.create(Buffer2.prototype);
27033
+ copyProps(Buffer2, SafeBuffer);
27034
+ SafeBuffer.from = function(arg, encodingOrOffset, length) {
27035
+ if (typeof arg === "number") throw new TypeError("Argument must not be a number");
27036
+ return Buffer2(arg, encodingOrOffset, length);
27037
+ };
27038
+ SafeBuffer.alloc = function(size, fill$2, encoding) {
27039
+ if (typeof size !== "number") throw new TypeError("Argument must be a number");
27040
+ var buf = Buffer2(size);
27041
+ if (fill$2 !== void 0) if (typeof encoding === "string") buf.fill(fill$2, encoding);
27042
+ else buf.fill(fill$2);
27043
+ else buf.fill(0);
27044
+ return buf;
27045
+ };
27046
+ SafeBuffer.allocUnsafe = function(size) {
27047
+ if (typeof size !== "number") throw new TypeError("Argument must be a number");
27048
+ return Buffer2(size);
27049
+ };
27050
+ SafeBuffer.allocUnsafeSlow = function(size) {
27051
+ if (typeof size !== "number") throw new TypeError("Argument must be a number");
27052
+ return buffer$1.SlowBuffer(size);
27053
+ };
27054
+ } });
27055
+ var require_base64 = __commonJS({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(exports$1, module$1) {
27056
+ var safeBuffer = require_safe_buffer().Buffer;
27057
+ function decodeBase64(base64$1) {
27058
+ return safeBuffer.from(base64$1, "base64").toString("utf8");
27059
+ }
27060
+ __name(decodeBase64, "decodeBase64");
27061
+ function encodeBase64(string) {
27062
+ return safeBuffer.from(string, "utf8").toString("base64");
27063
+ }
27064
+ __name(encodeBase64, "encodeBase64");
27065
+ module$1.exports = {
27066
+ decodeBase64,
27067
+ encodeBase64
27068
+ };
27069
+ } });
27070
+ var require_registry_auth_token = __commonJS({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(exports$1, module$1) {
27071
+ var url = __require$1("url");
27072
+ var base64$1 = require_base64();
27073
+ var decodeBase64 = base64$1.decodeBase64;
27074
+ var encodeBase64 = base64$1.encodeBase64;
27075
+ var tokenKey = ":_authToken";
27076
+ var userKey = ":username";
27077
+ var passwordKey = ":_password";
27078
+ module$1.exports = function() {
27079
+ var checkUrl;
27080
+ var options;
27081
+ if (arguments.length >= 2) {
27082
+ checkUrl = arguments[0];
27083
+ options = arguments[1];
27084
+ } else if (typeof arguments[0] === "string") checkUrl = arguments[0];
27085
+ else options = arguments[0];
27086
+ options = options || {};
27087
+ options.npmrc = options.npmrc || require_rc()("npm", { registry: "https://registry.npmjs.org/" });
27088
+ checkUrl = checkUrl || options.npmrc.registry;
27089
+ return getRegistryAuthInfo(checkUrl, options) || getLegacyAuthInfo(options.npmrc);
27090
+ };
27091
+ function getRegistryAuthInfo(checkUrl, options) {
27092
+ var parsed = url.parse(checkUrl, false, true);
27093
+ var pathname;
27094
+ while (pathname !== "/" && parsed.pathname !== pathname) {
27095
+ pathname = parsed.pathname || "/";
27096
+ var authInfo = getAuthInfoForUrl("//" + parsed.host + pathname.replace(/\/$/, ""), options.npmrc);
27097
+ if (authInfo) return authInfo;
27098
+ if (!options.recursive) return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(url.resolve(checkUrl, "."), options);
27099
+ parsed.pathname = url.resolve(normalizePath$2(pathname), "..") || "/";
27100
+ }
27101
+ }
27102
+ __name(getRegistryAuthInfo, "getRegistryAuthInfo");
27103
+ function getLegacyAuthInfo(npmrc) {
27104
+ if (npmrc._auth) return {
27105
+ token: npmrc._auth,
27106
+ type: "Basic"
27107
+ };
27108
+ }
27109
+ __name(getLegacyAuthInfo, "getLegacyAuthInfo");
27110
+ function normalizePath$2(path5) {
27111
+ return path5[path5.length - 1] === "/" ? path5 : path5 + "/";
27112
+ }
27113
+ __name(normalizePath$2, "normalizePath");
27114
+ function getAuthInfoForUrl(regUrl, npmrc) {
27115
+ var bearerAuth = getBearerToken(npmrc[regUrl + tokenKey] || npmrc[regUrl + "/" + tokenKey]);
27116
+ if (bearerAuth) return bearerAuth;
27117
+ var basicAuth = getTokenForUsernameAndPassword(npmrc[regUrl + userKey] || npmrc[regUrl + "/" + userKey], npmrc[regUrl + passwordKey] || npmrc[regUrl + "/" + passwordKey]);
27118
+ if (basicAuth) return basicAuth;
27119
+ }
27120
+ __name(getAuthInfoForUrl, "getAuthInfoForUrl");
27121
+ function getBearerToken(tok) {
27122
+ if (!tok) return;
27123
+ return {
27124
+ token: tok.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) {
27125
+ return process.env[envVar];
27126
+ }),
27127
+ type: "Bearer"
27128
+ };
27129
+ }
27130
+ __name(getBearerToken, "getBearerToken");
27131
+ function getTokenForUsernameAndPassword(username, password) {
27132
+ if (!username || !password) return;
27133
+ var pass = decodeBase64(password.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) {
27134
+ return process.env[envVar];
27135
+ }));
27136
+ return {
27137
+ token: encodeBase64(username + ":" + pass),
27138
+ type: "Basic",
27139
+ password: pass,
27140
+ username
27141
+ };
27142
+ }
27143
+ __name(getTokenForUsernameAndPassword, "getTokenForUsernameAndPassword");
27144
+ } });
27145
+ var require_update_check = __commonJS({ "../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports$1, module$1) {
27146
+ var { URL: URL2 } = __require$1("url");
27147
+ var { join: join2 } = __require$1("path");
27148
+ var fs3 = __require$1("fs");
27149
+ var { promisify: promisify$3 } = __require$1("util");
27150
+ var { tmpdir } = __require$1("os");
27151
+ var registryUrl = require_registry_url();
27152
+ var writeFile$1 = promisify$3(fs3.writeFile);
27153
+ var mkdir$1 = promisify$3(fs3.mkdir);
27154
+ var readFile$1 = promisify$3(fs3.readFile);
27155
+ var compareVersions = /* @__PURE__ */ __name((a, b) => a.localeCompare(b, "en-US", { numeric: true }), "compareVersions");
27156
+ var encode$2 = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/^%40/, "@"), "encode");
27157
+ var getFile = /* @__PURE__ */ __name(async (details, distTag) => {
27158
+ const subDir = join2(tmpdir(), "update-check");
27159
+ if (!fs3.existsSync(subDir)) await mkdir$1(subDir);
27160
+ let name = `${details.name}-${distTag}.json`;
27161
+ if (details.scope) name = `${details.scope}-${name}`;
27162
+ return join2(subDir, name);
27163
+ }, "getFile");
27164
+ var evaluateCache = /* @__PURE__ */ __name(async (file$1, time, interval) => {
27165
+ if (fs3.existsSync(file$1)) {
27166
+ const content = await readFile$1(file$1, "utf8");
27167
+ const { lastUpdate, latest } = JSON.parse(content);
27168
+ if (lastUpdate + interval > time) return {
27169
+ shouldCheck: false,
27170
+ latest
27171
+ };
27172
+ }
27173
+ return {
27174
+ shouldCheck: true,
27175
+ latest: null
27176
+ };
27177
+ }, "evaluateCache");
27178
+ var updateCache = /* @__PURE__ */ __name(async (file$1, latest, lastUpdate) => {
27179
+ await writeFile$1(file$1, JSON.stringify({
27180
+ latest,
27181
+ lastUpdate
27182
+ }), "utf8");
27183
+ }, "updateCache");
27184
+ var loadPackage = /* @__PURE__ */ __name((url, authInfo) => new Promise((resolve$4, reject) => {
27185
+ const options = {
27186
+ host: url.hostname,
27187
+ path: url.pathname,
27188
+ port: url.port,
27189
+ headers: { accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*" },
27190
+ timeout: 2e3
27191
+ };
27192
+ if (authInfo) options.headers.authorization = `${authInfo.type} ${authInfo.token}`;
27193
+ const { get } = url.protocol === "https:" ? __require$1("https") : __require$1("http");
27194
+ get(options, (response) => {
27195
+ const { statusCode } = response;
27196
+ if (statusCode !== 200) {
27197
+ const error = /* @__PURE__ */ new Error(`Request failed with code ${statusCode}`);
27198
+ error.code = statusCode;
27199
+ reject(error);
27200
+ response.resume();
27201
+ return;
27202
+ }
27203
+ let rawData = "";
27204
+ response.setEncoding("utf8");
27205
+ response.on("data", (chunk) => {
27206
+ rawData += chunk;
27207
+ });
27208
+ response.on("end", () => {
27209
+ try {
27210
+ resolve$4(JSON.parse(rawData));
27211
+ } catch (e2) {
27212
+ reject(e2);
27213
+ }
27214
+ });
27215
+ }).on("error", reject).on("timeout", reject);
27216
+ }), "loadPackage");
27217
+ var getMostRecent = /* @__PURE__ */ __name(async ({ full, scope }, distTag) => {
27218
+ const regURL = registryUrl(scope);
27219
+ const url = new URL2(full, regURL);
27220
+ let spec = null;
27221
+ try {
27222
+ spec = await loadPackage(url);
27223
+ } catch (err) {
27224
+ if (err.code && String(err.code).startsWith(4)) spec = await loadPackage(url, require_registry_auth_token()(regURL, { recursive: true }));
27225
+ else throw err;
27226
+ }
27227
+ const version$2 = spec["dist-tags"][distTag];
27228
+ if (!version$2) throw new Error(`Distribution tag ${distTag} is not available`);
27229
+ return version$2;
27230
+ }, "getMostRecent");
27231
+ var defaultConfig = {
27232
+ interval: 36e5,
27233
+ distTag: "latest"
27234
+ };
27235
+ var getDetails = /* @__PURE__ */ __name((name) => {
27236
+ const spec = { full: encode$2(name) };
27237
+ if (name.includes("/")) {
27238
+ const parts = name.split("/");
27239
+ spec.scope = parts[0];
27240
+ spec.name = parts[1];
27241
+ } else {
27242
+ spec.scope = null;
27243
+ spec.name = name;
27244
+ }
27245
+ return spec;
27246
+ }, "getDetails");
27247
+ module$1.exports = async (pkg, config) => {
27248
+ if (typeof pkg !== "object") throw new Error("The first parameter should be your package.json file content");
27249
+ const details = getDetails(pkg.name);
27250
+ const time = Date.now();
27251
+ const { distTag, interval } = Object.assign({}, defaultConfig, config);
27252
+ const file$1 = await getFile(details, distTag);
27253
+ let latest = null;
27254
+ let shouldCheck = true;
27255
+ ({shouldCheck, latest} = await evaluateCache(file$1, time, interval));
27256
+ if (shouldCheck) {
27257
+ latest = await getMostRecent(details, distTag);
27258
+ await updateCache(file$1, latest, time);
27259
+ }
27260
+ if (compareVersions(pkg.version, latest) === -1) return {
27261
+ latest,
27262
+ fromCache: !shouldCheck
27263
+ };
27264
+ return null;
27265
+ };
27266
+ } });
26473
27267
  var defaultWranglerConfig = {
26474
27268
  configPath: void 0,
26475
27269
  userConfigPath: void 0,
@@ -26507,6 +27301,8 @@ var defaultWranglerConfig = {
26507
27301
  vectorize: [],
26508
27302
  ai_search_namespaces: [],
26509
27303
  ai_search: [],
27304
+ web_search: void 0,
27305
+ agent_memory: [],
26510
27306
  hyperdrive: [],
26511
27307
  workflows: [],
26512
27308
  secrets_store_secrets: [],
@@ -30137,7 +30933,7 @@ __reExport(mod_esm_exports, __toESM(require_mod_cjs3(), 1));
30137
30933
  var mod_esm_default = import_mod_cjs.default;
30138
30934
  function getGlobalWranglerConfigPath() {
30139
30935
  const configDir = mod_esm_default(".wrangler").config();
30140
- const legacyConfigDir = path3.join(os.homedir(), ".wrangler");
30936
+ const legacyConfigDir = path.join(os.homedir(), ".wrangler");
30141
30937
  if (isDirectory(legacyConfigDir)) return legacyConfigDir;
30142
30938
  else return configDir;
30143
30939
  }
@@ -30182,7 +30978,10 @@ var getC3CommandFromEnv = getEnvironmentVariableFactory({
30182
30978
  defaultValue: /* @__PURE__ */ __name(() => "create cloudflare", "defaultValue")
30183
30979
  });
30184
30980
  var getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({ variableName: "WRANGLER_SEND_METRICS" });
30185
- var getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({ variableName: "WRANGLER_SEND_ERROR_REPORTS" });
30981
+ var getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
30982
+ variableName: "WRANGLER_SEND_ERROR_REPORTS",
30983
+ defaultValue: false
30984
+ });
30186
30985
  var getCloudflareApiEnvironmentFromEnv = getEnvironmentVariableFactory({
30187
30986
  variableName: "WRANGLER_API_ENVIRONMENT",
30188
30987
  defaultValue: /* @__PURE__ */ __name(() => "production", "defaultValue"),
@@ -30205,6 +31004,7 @@ var getCloudflareApiBaseUrlFromEnv = getEnvironmentVariableFactory({
30205
31004
  variableName: "CLOUDFLARE_API_BASE_URL",
30206
31005
  deprecatedName: "CF_API_BASE_URL"
30207
31006
  });
31007
+ var getCloudflareApiBaseUrl = /* @__PURE__ */ __name((complianceConfig) => getCloudflareApiBaseUrlFromEnv() ?? `https://api${getComplianceRegionSubdomain(complianceConfig)}${getStagingSubdomain()}.cloudflare.com/client/v4`, "getCloudflareApiBaseUrl");
30208
31008
  function getComplianceRegionSubdomain(complianceConfig) {
30209
31009
  return getCloudflareComplianceRegion(complianceConfig) === "fedramp_high" ? ".fed" : "";
30210
31010
  }
@@ -30233,7 +31033,7 @@ var getBuildPlatformFromEnv = getEnvironmentVariableFactory({ variableName: "WRA
30233
31033
  var getRegistryPath = getEnvironmentVariableFactory({
30234
31034
  variableName: "WRANGLER_REGISTRY_PATH",
30235
31035
  defaultValue() {
30236
- return path3.join(getGlobalWranglerConfigPath(), "registry");
31036
+ return path.join(getGlobalWranglerConfigPath(), "registry");
30237
31037
  }
30238
31038
  });
30239
31039
  var getD1ExtraLocationChoices = getEnvironmentVariableFactory({ variableName: "WRANGLER_D1_EXTRA_LOCATION_CHOICES" });
@@ -30552,6 +31352,8 @@ var friendlyBindingNames = {
30552
31352
  vectorize: "Vectorize Index",
30553
31353
  ai_search_namespaces: "AI Search Namespace",
30554
31354
  ai_search: "AI Search Instance",
31355
+ web_search: "Web Search",
31356
+ agent_memory: "Agent Memory",
30555
31357
  hyperdrive: "Hyperdrive Config",
30556
31358
  r2_buckets: "R2 Bucket",
30557
31359
  logfwdr: "logfwdr",
@@ -30603,6 +31405,8 @@ var bindingTypeFriendlyNames = {
30603
31405
  vectorize: "Vectorize Index",
30604
31406
  ai_search_namespace: "AI Search Namespace",
30605
31407
  ai_search: "AI Search Instance",
31408
+ web_search: "Web Search",
31409
+ agent_memory: "Agent Memory",
30606
31410
  hyperdrive: "Hyperdrive Config",
30607
31411
  service: "Worker",
30608
31412
  fetcher: "Service Binding",
@@ -30645,7 +31449,7 @@ function isPagesConfig(rawConfig) {
30645
31449
  }
30646
31450
  __name(isPagesConfig, "isPagesConfig");
30647
31451
  function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
30648
- const diagnostics = new Diagnostics(`Processing ${configPath ? path3.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
31452
+ const diagnostics = new Diagnostics(`Processing ${configPath ? path.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
30649
31453
  validateOptionalProperty(diagnostics, "", "legacy_env", rawConfig.legacy_env, "boolean");
30650
31454
  validateOptionalProperty(diagnostics, "", "send_metrics", rawConfig.send_metrics, "boolean");
30651
31455
  validateOptionalProperty(diagnostics, "", "keep_vars", rawConfig.keep_vars, "boolean");
@@ -30749,34 +31553,34 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
30749
31553
  else validateOptionalProperty(diagnostics, "build", "watch_dir", watch_dir, "string");
30750
31554
  return {
30751
31555
  command,
30752
- watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir) => path3.relative(process.cwd(), path3.join(path3.dirname(configPath), `${dir}`))) : path3.relative(process.cwd(), path3.join(path3.dirname(configPath), `${watch_dir}`)) : watch_dir,
31556
+ watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir) => path.relative(process.cwd(), path.join(path.dirname(configPath), `${dir}`))) : path.relative(process.cwd(), path.join(path.dirname(configPath), `${watch_dir}`)) : watch_dir,
30753
31557
  cwd
30754
31558
  };
30755
31559
  }
30756
31560
  __name(normalizeAndValidateBuild, "normalizeAndValidateBuild");
30757
31561
  function normalizeAndValidateMainField(configPath, rawMain) {
30758
- const configDir = path3.dirname(configPath ?? "wrangler.toml");
31562
+ const configDir = path.dirname(configPath ?? "wrangler.toml");
30759
31563
  if (rawMain !== void 0) if (typeof rawMain === "string") {
30760
- const directory = path3.resolve(configDir);
30761
- return path3.resolve(directory, rawMain);
31564
+ const directory = path.resolve(configDir);
31565
+ return path.resolve(directory, rawMain);
30762
31566
  } else return rawMain;
30763
31567
  else return;
30764
31568
  }
30765
31569
  __name(normalizeAndValidateMainField, "normalizeAndValidateMainField");
30766
31570
  function normalizeAndValidateBaseDirField(configPath, rawDir) {
30767
- const configDir = path3.dirname(configPath ?? "wrangler.toml");
31571
+ const configDir = path.dirname(configPath ?? "wrangler.toml");
30768
31572
  if (rawDir !== void 0) if (typeof rawDir === "string") {
30769
- const directory = path3.resolve(configDir);
30770
- return path3.resolve(directory, rawDir);
31573
+ const directory = path.resolve(configDir);
31574
+ return path.resolve(directory, rawDir);
30771
31575
  } else return rawDir;
30772
31576
  else return;
30773
31577
  }
30774
31578
  __name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
30775
31579
  function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
30776
- const configDir = path3.dirname(configPath ?? "wrangler.toml");
31580
+ const configDir = path.dirname(configPath ?? "wrangler.toml");
30777
31581
  if (rawPagesDir !== void 0) if (typeof rawPagesDir === "string") {
30778
- const directory = path3.resolve(configDir);
30779
- return path3.resolve(directory, rawPagesDir);
31582
+ const directory = path.resolve(configDir);
31583
+ return path.resolve(directory, rawPagesDir);
30780
31584
  } else return rawPagesDir;
30781
31585
  else return;
30782
31586
  }
@@ -30829,7 +31633,7 @@ function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryP
30829
31633
  validateOptionalProperty(diagnostics, "site", "entry-point", rawConfig.site["entry-point"], "string");
30830
31634
  deprecated(diagnostics, rawConfig, `site.entry-point`, `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
30831
31635
  \`\`\`
30832
- main = "${path3.join(String(rawConfig.site["entry-point"]) || "workers-site", path3.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js")}"
31636
+ main = "${path.join(String(rawConfig.site["entry-point"]) || "workers-site", path.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js")}"
30833
31637
  \`\`\``, false, void 0, "warning");
30834
31638
  let siteEntryPoint = rawConfig.site["entry-point"];
30835
31639
  if (!mainEntryPoint && !siteEntryPoint) {
@@ -30842,7 +31646,7 @@ main = "workers-site/index.js"
30842
31646
  } else if (mainEntryPoint && siteEntryPoint) diagnostics.errors.push(`Don't define both the \`main\` and \`site.entry-point\` fields in your configuration.
30843
31647
  They serve the same purpose: to point to the entry-point of your worker.
30844
31648
  Delete the deprecated \`site.entry-point\` field from your config.`);
30845
- if (configPath && siteEntryPoint) siteEntryPoint = path3.relative(process.cwd(), path3.join(path3.dirname(configPath), siteEntryPoint));
31649
+ if (configPath && siteEntryPoint) siteEntryPoint = path.relative(process.cwd(), path.join(path.dirname(configPath), siteEntryPoint));
30846
31650
  return {
30847
31651
  bucket,
30848
31652
  "entry-point": siteEntryPoint,
@@ -30874,7 +31678,7 @@ function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapp
30874
31678
  if (rawMapping === void 0) return;
30875
31679
  const mapping = {};
30876
31680
  for (const [name, filePath] of Object.entries(rawMapping)) if (isString$2(diagnostics, `${field}['${name}']`, filePath, void 0)) {
30877
- if (configPath) mapping[name] = configPath ? path3.relative(process.cwd(), path3.join(path3.dirname(configPath), filePath)) : filePath;
31681
+ if (configPath) mapping[name] = configPath ? path.relative(process.cwd(), path.join(path.dirname(configPath), filePath)) : filePath;
30878
31682
  }
30879
31683
  return mapping;
30880
31684
  }
@@ -31079,6 +31883,8 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
31079
31883
  vectorize: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "vectorize", validateBindingArray(envName, validateVectorizeBinding), []),
31080
31884
  ai_search_namespaces: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "ai_search_namespaces", validateBindingArray(envName, validateAISearchNamespaceBinding), []),
31081
31885
  ai_search: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "ai_search", validateBindingArray(envName, validateAISearchBinding), []),
31886
+ web_search: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "web_search", validateNamedSimpleBinding(envName), void 0),
31887
+ agent_memory: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "agent_memory", validateBindingArray(envName, validateAgentMemoryBinding), []),
31082
31888
  hyperdrive: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "hyperdrive", validateBindingArray(envName, validateHyperdriveBinding), []),
31083
31889
  services: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "services", validateBindingArray(envName, validateServiceBinding), []),
31084
31890
  analytics_engine_datasets: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "analytics_engine_datasets", validateBindingArray(envName, validateAnalyticsEngineBinding), []),
@@ -31122,7 +31928,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
31122
31928
  __name(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment");
31123
31929
  function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) {
31124
31930
  const tsconfig = inheritable(diagnostics, topLevelEnv, rawEnv, "tsconfig", isString$2, void 0);
31125
- return configPath && tsconfig ? path3.relative(process.cwd(), path3.join(path3.dirname(configPath), tsconfig)) : tsconfig;
31931
+ return configPath && tsconfig ? path.relative(process.cwd(), path.join(path.dirname(configPath), tsconfig)) : tsconfig;
31126
31932
  }
31127
31933
  __name(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
31128
31934
  var validateAndNormalizeRules = /* @__PURE__ */ __name((diagnostics, topLevelEnv, rawEnv, envName) => {
@@ -31546,6 +32352,8 @@ var validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) =
31546
32352
  "ai",
31547
32353
  "ai_search_namespace",
31548
32354
  "ai_search",
32355
+ "web_search",
32356
+ "agent_memory",
31549
32357
  "kv_namespace",
31550
32358
  "durable_object_namespace",
31551
32359
  "d1_database",
@@ -31620,9 +32428,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
31620
32428
  let resolvedBuildContextPath = void 0;
31621
32429
  try {
31622
32430
  if (isDockerfile(resolvedImage, configPath)) {
31623
- const baseDir = configPath ? path3.dirname(configPath) : process.cwd();
31624
- resolvedImage = path3.resolve(baseDir, resolvedImage);
31625
- resolvedBuildContextPath = containerAppOptional.image_build_context ? path3.resolve(baseDir, containerAppOptional.image_build_context) : path3.dirname(resolvedImage);
32431
+ const baseDir = configPath ? path.dirname(configPath) : process.cwd();
32432
+ resolvedImage = path.resolve(baseDir, resolvedImage);
32433
+ resolvedBuildContextPath = containerAppOptional.image_build_context ? path.resolve(baseDir, containerAppOptional.image_build_context) : path.dirname(resolvedImage);
31626
32434
  }
31627
32435
  } catch (err) {
31628
32436
  if (err instanceof Error && err.message) diagnostics.errors.push(err.message);
@@ -32054,6 +32862,28 @@ var validateAISearchBinding = /* @__PURE__ */ __name((diagnostics, field, value)
32054
32862
  ]);
32055
32863
  return isValid2;
32056
32864
  }, "validateAISearchBinding");
32865
+ var validateAgentMemoryBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
32866
+ if (typeof value !== "object" || value === null) {
32867
+ diagnostics.errors.push(`"agent_memory" bindings should be objects, but got ${JSON.stringify(value)}`);
32868
+ return false;
32869
+ }
32870
+ let isValid2 = true;
32871
+ if (!isRequiredProperty(value, "binding", "string")) {
32872
+ diagnostics.errors.push(`"${field}" bindings should have a string "binding" field but got ${JSON.stringify(value)}.`);
32873
+ isValid2 = false;
32874
+ }
32875
+ if (!isRequiredProperty(value, "namespace", "string")) {
32876
+ diagnostics.errors.push(`"${field}" bindings must have a "namespace" field but got ${JSON.stringify(value)}.`);
32877
+ isValid2 = false;
32878
+ }
32879
+ if (!isRemoteValid(value, field, diagnostics)) isValid2 = false;
32880
+ validateAdditionalProperties(diagnostics, field, Object.keys(value), [
32881
+ "binding",
32882
+ "namespace",
32883
+ "remote"
32884
+ ]);
32885
+ return isValid2;
32886
+ }, "validateAgentMemoryBinding");
32057
32887
  var validateHyperdriveBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
32058
32888
  if (typeof value !== "object" || value === null) {
32059
32889
  diagnostics.errors.push(`"hyperdrive" bindings should be objects, but got ${JSON.stringify(value)}`);
@@ -32364,13 +33194,19 @@ var validatePipelineBinding = /* @__PURE__ */ __name((diagnostics, field, value)
32364
33194
  diagnostics.errors.push(`"${field}" bindings must have a string "binding" field but got ${JSON.stringify(value)}.`);
32365
33195
  isValid2 = false;
32366
33196
  }
32367
- if (!isRequiredProperty(value, "pipeline", "string")) {
32368
- diagnostics.errors.push(`"${field}" bindings must have a string "pipeline" field but got ${JSON.stringify(value)}.`);
33197
+ const hasStream = isOptionalProperty(value, "stream", "string");
33198
+ const hasPipeline = isOptionalProperty(value, "pipeline", "string");
33199
+ const v = value;
33200
+ if (hasStream && v.stream);
33201
+ else if (hasPipeline && v.pipeline) diagnostics.warnings.push(`The "pipeline" field in "${field}" bindings is deprecated. Use "stream" instead.`);
33202
+ else {
33203
+ diagnostics.errors.push(`"${field}" bindings must have a string "stream" field but got ${JSON.stringify(value)}.`);
32369
33204
  isValid2 = false;
32370
33205
  }
32371
33206
  if (!isRemoteValid(value, field, diagnostics)) isValid2 = false;
32372
33207
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
32373
33208
  "binding",
33209
+ "stream",
32374
33210
  "pipeline",
32375
33211
  "remote"
32376
33212
  ]);
@@ -32761,8 +33597,8 @@ function isRemoteValid(targetObject, fieldPath, diagnostics) {
32761
33597
  }
32762
33598
  __name(isRemoteValid, "isRemoteValid");
32763
33599
  function isDockerfile(imagePath, configPath) {
32764
- const baseDir = configPath ? path3.dirname(configPath) : process.cwd();
32765
- const maybeDockerfile = path3.resolve(baseDir, imagePath);
33600
+ const baseDir = configPath ? path.dirname(configPath) : process.cwd();
33601
+ const maybeDockerfile = path.resolve(baseDir, imagePath);
32766
33602
  if (fs2.existsSync(maybeDockerfile)) {
32767
33603
  if (isDirectory(maybeDockerfile)) throw new UserError(`${imagePath} is a directory, you should specify a path to the Dockerfile`, { telemetryMessage: false });
32768
33604
  return true;
@@ -32821,7 +33657,9 @@ var BINDING_LOCAL_SUPPORT = {
32821
33657
  artifacts: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32822
33658
  flagship: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32823
33659
  vpc_service: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32824
- vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
33660
+ vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
33661
+ web_search: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
33662
+ agent_memory: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
32825
33663
  };
32826
33664
  function getBindingLocalSupport(type) {
32827
33665
  if (type in BINDING_LOCAL_SUPPORT) return BINDING_LOCAL_SUPPORT[type];
@@ -32912,7 +33750,7 @@ __name(validateDurableObjectBinding2, "validateDurableObjectBinding");
32912
33750
  var import_signal_exit = __toESM(require_signal_exit());
32913
33751
  function getWranglerHiddenDirPath(projectRoot) {
32914
33752
  projectRoot ??= process.cwd();
32915
- return path3.join(projectRoot, ".wrangler");
33753
+ return path.join(projectRoot, ".wrangler");
32916
33754
  }
32917
33755
  __name(getWranglerHiddenDirPath, "getWranglerHiddenDirPath");
32918
33756
  var STALE_WRANGLER_TMP_DIR_MS = 1440 * 60 * 1e3;
@@ -32929,7 +33767,7 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
32929
33767
  const cutoff = Date.now() - STALE_WRANGLER_TMP_DIR_MS;
32930
33768
  for (const entry of entries) {
32931
33769
  if (!entry.isDirectory()) continue;
32932
- const entryPath = path3.join(tmpRoot, entry.name);
33770
+ const entryPath = path.join(tmpRoot, entry.name);
32933
33771
  try {
32934
33772
  if (fs2.statSync(entryPath).mtimeMs < cutoff) removeDirSync(entryPath);
32935
33773
  } catch {}
@@ -32937,10 +33775,10 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
32937
33775
  }
32938
33776
  __name(sweepStaleWranglerTmpDirs, "sweepStaleWranglerTmpDirs");
32939
33777
  function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
32940
- const tmpRoot = path3.join(getWranglerHiddenDirPath(projectRoot), "tmp");
33778
+ const tmpRoot = path.join(getWranglerHiddenDirPath(projectRoot), "tmp");
32941
33779
  fs2.mkdirSync(tmpRoot, { recursive: true });
32942
33780
  sweepStaleWranglerTmpDirs(tmpRoot);
32943
- const tmpPrefix = path3.join(tmpRoot, `${prefix}-`);
33781
+ const tmpPrefix = path.join(tmpRoot, `${prefix}-`);
32944
33782
  const tmpDir = fs2.realpathSync(fs2.mkdtempSync(tmpPrefix));
32945
33783
  const cleanupDir = /* @__PURE__ */ __name(() => {
32946
33784
  if (cleanup) try {
@@ -33241,15 +34079,7 @@ Please ensure you have write permissions to: ${cacheDir}`, { telemetryMessage: "
33241
34079
  __name(downloadCloudflared, "downloadCloudflared");
33242
34080
  async function downloadAndExtractTarball(response, expectedChecksum, binPath, cacheDir) {
33243
34081
  const tempTarPath = join(cacheDir, "cloudflared.tgz");
33244
- const buffer$1 = Buffer.from(await response.arrayBuffer());
33245
- if (expectedChecksum) {
33246
- const actualSha256 = sha256Hex(buffer$1);
33247
- if (actualSha256 !== expectedChecksum) throw new UserError(`[cloudflared] SHA256 mismatch for downloaded cloudflared tarball.
33248
-
33249
- Expected: ${expectedChecksum}
33250
- Actual: ${actualSha256}`, { telemetryMessage: "tunnel cloudflared tarball checksum mismatch" });
33251
- }
33252
- writeFileSync(tempTarPath, buffer$1);
34082
+ writeFileSync(tempTarPath, Buffer.from(await response.arrayBuffer()));
33253
34083
  try {
33254
34084
  execFileSync("tar", [
33255
34085
  "-xzf",
@@ -33259,6 +34089,13 @@ Actual: ${actualSha256}`, { telemetryMessage: "tunnel cloudflared tarball chec
33259
34089
  ], { stdio: "ignore" });
33260
34090
  const extractedPath = join(cacheDir, "cloudflared");
33261
34091
  if (extractedPath !== binPath && existsSync(extractedPath)) renameSync(extractedPath, binPath);
34092
+ if (expectedChecksum) {
34093
+ const actualSha256 = sha256Hex(readFileSync(binPath));
34094
+ if (actualSha256 !== expectedChecksum) throw new UserError(`[cloudflared] SHA256 mismatch for downloaded cloudflared binary.
34095
+
34096
+ Expected: ${expectedChecksum}
34097
+ Actual: ${actualSha256}`, { telemetryMessage: "tunnel cloudflared extracted binary checksum mismatch" });
34098
+ }
33262
34099
  } finally {
33263
34100
  try {
33264
34101
  if (existsSync(tempTarPath)) unlinkSync(tempTarPath);
@@ -33418,7 +34255,7 @@ function startTunnel(options) {
33418
34255
  if (disposed) return;
33419
34256
  const remainingMs = expiresAt - Date.now();
33420
34257
  if (remainingMs <= 0) return;
33421
- logger?.log(`${publicURL ? `The tunnel is still open at ${publicURL}.` : "The tunnel is still open."} It expires in ${formatTunnelDuration(remainingMs)}. ${options.extendHint ?? ""}`);
34258
+ logger?.log(`${publicURL ? `Tunnel still open, expires in ${formatTunnelDuration(remainingMs)}: ${publicURL}` : `The tunnel is still open. It expires in ${formatTunnelDuration(remainingMs)}.`}${options.extendHint ? ` ${options.extendHint}` : ""}`);
33422
34259
  }, reminderIntervalMs);
33423
34260
  reminderInterval.unref?.();
33424
34261
  }
@@ -33527,12 +34364,258 @@ function createTunnelStartupError(message, stderrOutput, origin) {
33527
34364
  cloudflared output:
33528
34365
  ${stderrOutput || "(no output)"}
33529
34366
 
33530
- The local dev server started at ${origin.href}.
34367
+ The local dev server started at ${origin.href}
33531
34368
  ` + (isQuickTunnelRateLimited ? "Cloudflare Quick Tunnel creation was rate limited. Try again in a few minutes, or use a named tunnel if you need more reliable access." : `Check the cloudflared output above for more details, and verify that ${origin.href} is reachable from this machine if this keeps happening.`);
33532
34369
  if (isQuickTunnelRateLimited) return new UserError(errorMessage, { telemetryMessage: false });
33533
34370
  return new Error(errorMessage);
33534
34371
  }
33535
34372
  __name(createTunnelStartupError, "createTunnelStartupError");
34373
+ function buildDetailedError(message, ...extra) {
34374
+ return new ParseError({
34375
+ text: message,
34376
+ notes: extra.map((text) => ({ text })),
34377
+ telemetryMessage: false
34378
+ });
34379
+ }
34380
+ __name(buildDetailedError, "buildDetailedError");
34381
+ function maybeThrowFriendlyError(error) {
34382
+ if (error.message === "workers.api.error.email_verification_required") throw buildDetailedError("Please verify your account's email address and try again.", "Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one.");
34383
+ }
34384
+ __name(maybeThrowFriendlyError, "maybeThrowFriendlyError");
34385
+ function logHeaders(headers, logger) {
34386
+ const clone = cloneHeaders(headers);
34387
+ clone.delete("Authorization");
34388
+ logger.debugWithSanitization("HEADERS:", JSON.stringify(Object.fromEntries(clone), null, 2));
34389
+ }
34390
+ __name(logHeaders, "logHeaders");
34391
+ async function performApiFetchBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
34392
+ assert(credentials, "credentials are required for performApiFetch");
34393
+ const method = init.method ?? "GET";
34394
+ assert(resource.startsWith("/"), `CF API fetch - resource path must start with a "/" but got "${resource}"`);
34395
+ const headers = cloneHeaders(new import_undici.Headers(init.headers));
34396
+ addAuthorizationHeader(headers, credentials);
34397
+ headers.set("User-Agent", userAgent);
34398
+ maybeAddTraceHeader(headers);
34399
+ const queryString = queryParams ? `?${queryParams.toString()}` : "";
34400
+ logger.debug(`-- START CF API REQUEST: ${method} ${getCloudflareApiBaseUrl(complianceConfig)}${resource}`);
34401
+ logger.debugWithSanitization("QUERY STRING:", queryString);
34402
+ logHeaders(headers, logger);
34403
+ logger.debugWithSanitization("INIT:", JSON.stringify({ ...init }, null, 2));
34404
+ if (init.body instanceof import_undici.FormData) logger.debugWithSanitization("BODY:", await new import_undici.Response(init.body).text(), null, 2);
34405
+ logger.debug("-- END CF API REQUEST");
34406
+ return await (0, import_undici.fetch)(`${getCloudflareApiBaseUrl(complianceConfig)}${resource}${queryString}`, {
34407
+ method,
34408
+ ...init,
34409
+ headers,
34410
+ signal: abortSignal
34411
+ });
34412
+ }
34413
+ __name(performApiFetchBase, "performApiFetchBase");
34414
+ async function fetchInternalBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
34415
+ const method = init.method ?? "GET";
34416
+ const response = await performApiFetchBase(complianceConfig, resource, init, userAgent, logger, queryParams, abortSignal, credentials);
34417
+ const jsonText = await response.text();
34418
+ logger.debug("-- START CF API RESPONSE:", response.statusText, response.status);
34419
+ logHeaders(response.headers, logger);
34420
+ logger.debugWithSanitization("RESPONSE:", jsonText);
34421
+ logger.debug("-- END CF API RESPONSE");
34422
+ if (!jsonText && (response.status === 204 || response.status === 205)) return {
34423
+ response: {
34424
+ result: {},
34425
+ success: true,
34426
+ errors: [],
34427
+ messages: []
34428
+ },
34429
+ status: response.status
34430
+ };
34431
+ if (isWAFBlockResponse(response.headers)) throwWAFBlockError(response.headers, method, resource, response.status, response.statusText);
34432
+ try {
34433
+ return {
34434
+ response: parseJSON(jsonText),
34435
+ status: response.status
34436
+ };
34437
+ } catch {
34438
+ const rayId = extractWAFBlockRayId(response.headers);
34439
+ throw new APIError({
34440
+ text: "Received a malformed response from the API",
34441
+ notes: [
34442
+ { text: truncate(jsonText, 100) },
34443
+ { text: `${method} ${resource} -> ${response.status} ${response.statusText}` },
34444
+ ...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : []
34445
+ ],
34446
+ status: response.status,
34447
+ telemetryMessage: false
34448
+ });
34449
+ }
34450
+ }
34451
+ __name(fetchInternalBase, "fetchInternalBase");
34452
+ async function fetchResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
34453
+ const { response: json, status } = await fetchInternalBase(complianceConfig, resource, init, userAgent, logger, queryParams, abortSignal, credentials);
34454
+ if (json.success) return json.result;
34455
+ else throwFetchError(resource, json, status);
34456
+ }
34457
+ __name(fetchResultBase, "fetchResultBase");
34458
+ async function fetchListResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, credentials) {
34459
+ const results = [];
34460
+ let getMoreResults = true;
34461
+ let cursor;
34462
+ while (getMoreResults) {
34463
+ if (cursor) {
34464
+ queryParams = new URLSearchParams$1(queryParams);
34465
+ queryParams.set("cursor", cursor);
34466
+ }
34467
+ const { response: json, status } = await fetchInternalBase(complianceConfig, resource, init, userAgent, logger, queryParams, void 0, credentials);
34468
+ if (json.success) {
34469
+ results.push(...json.result);
34470
+ if (hasCursor(json.result_info)) cursor = json.result_info?.cursor;
34471
+ else getMoreResults = false;
34472
+ } else throwFetchError(resource, json, status);
34473
+ }
34474
+ return results;
34475
+ }
34476
+ __name(fetchListResultBase, "fetchListResultBase");
34477
+ function truncate(text, maxLength) {
34478
+ const { length } = text;
34479
+ if (length <= maxLength) return text;
34480
+ return `${text.substring(0, maxLength)}... (length = ${length})`;
34481
+ }
34482
+ __name(truncate, "truncate");
34483
+ function isWAFBlockResponse(headers) {
34484
+ return headers.get("cf-mitigated") === "challenge";
34485
+ }
34486
+ __name(isWAFBlockResponse, "isWAFBlockResponse");
34487
+ function extractWAFBlockRayId(headers) {
34488
+ return headers.get("cf-ray") ?? void 0;
34489
+ }
34490
+ __name(extractWAFBlockRayId, "extractWAFBlockRayId");
34491
+ function extractAccountTag(resource) {
34492
+ return (/* @__PURE__ */ new RegExp("/accounts/([a-zA-Z0-9]+)/?")).exec(resource)?.[1];
34493
+ }
34494
+ __name(extractAccountTag, "extractAccountTag");
34495
+ function hasMorePages(result_info) {
34496
+ const page = result_info?.page;
34497
+ const per_page = result_info?.per_page;
34498
+ const total = result_info?.total_count;
34499
+ return page !== void 0 && per_page !== void 0 && total !== void 0 && page * per_page < total;
34500
+ }
34501
+ __name(hasMorePages, "hasMorePages");
34502
+ function renderError(err, level = 0) {
34503
+ const indent = " ".repeat(level);
34504
+ const message = err.message ?? "";
34505
+ const chainedMessages = "error_chain" in err ? err.error_chain?.map((chainedError) => `
34506
+
34507
+ ${indent}- ${renderError(chainedError, level + 1)}`).join("\n") ?? "" : "";
34508
+ return (err.code ? `${message} [code: ${err.code}]` : message) + (err.documentation_url ? `
34509
+ ${indent}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages;
34510
+ }
34511
+ __name(renderError, "renderError");
34512
+ function addAuthorizationHeader(headers, auth, overrideExisting = false) {
34513
+ if (!headers.has("Authorization") || overrideExisting) if ("apiToken" in auth) {
34514
+ const authorizationHeader = `Bearer ${auth.apiToken}`;
34515
+ validateAuthorizationHeaderValue(authorizationHeader);
34516
+ headers.set("Authorization", authorizationHeader);
34517
+ } else {
34518
+ headers.set("X-Auth-Key", auth.authKey);
34519
+ headers.set("X-Auth-Email", auth.authEmail);
34520
+ }
34521
+ }
34522
+ __name(addAuthorizationHeader, "addAuthorizationHeader");
34523
+ function validateAuthorizationHeaderValue(value) {
34524
+ for (const character of value) {
34525
+ const codePoint = character.codePointAt(0);
34526
+ if (codePoint === void 0 || codePoint > 255) throw new UserError(`The configured Cloudflare API token contains a character that cannot be used in an HTTP Authorization header: ${formatAuthorizationHeaderCharacter(character, codePoint)}. Recreate or copy the token again, making sure it does not include characters such as ellipses.`, { telemetryMessage: "cfetch auth invalid authorization header" });
34527
+ }
34528
+ }
34529
+ __name(validateAuthorizationHeaderValue, "validateAuthorizationHeaderValue");
34530
+ function formatAuthorizationHeaderCharacter(character, codePoint) {
34531
+ if (codePoint === void 0) return "\"\\u{unknown}\"";
34532
+ const codePointLabel = `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")}`;
34533
+ return `${isPrintableCharacter(character) ? `"${character}"` : `"${escapeCharacter(character)}"`} (${codePointLabel})`;
34534
+ }
34535
+ __name(formatAuthorizationHeaderCharacter, "formatAuthorizationHeaderCharacter");
34536
+ function isPrintableCharacter(character) {
34537
+ return !/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(character);
34538
+ }
34539
+ __name(isPrintableCharacter, "isPrintableCharacter");
34540
+ function escapeCharacter(character) {
34541
+ return Array.from(character).map((c) => {
34542
+ const codePoint = c.codePointAt(0);
34543
+ if (codePoint === void 0) return "";
34544
+ return codePoint <= 65535 ? `\\u${codePoint.toString(16).toUpperCase().padStart(4, "0")}` : `\\u{${codePoint.toString(16).toUpperCase()}}`;
34545
+ }).join("");
34546
+ }
34547
+ __name(escapeCharacter, "escapeCharacter");
34548
+ function throwFetchError(resource, response, status) {
34549
+ const errors$1 = response.errors ?? [];
34550
+ for (const error2 of errors$1) maybeThrowFriendlyError(error2);
34551
+ const notes = [...errors$1.map((err) => ({ text: renderError(err) })), ...response.messages?.map((msg) => ({ text: typeof msg === "string" ? msg : msg.message ?? String(msg) })) ?? []];
34552
+ if (notes.length === 0) {
34553
+ const raw = response;
34554
+ const fallbackMessage = typeof raw.error === "string" ? `${raw.error}${raw.code ? ` [code: ${raw.code}]` : ""}` : void 0;
34555
+ if (fallbackMessage) notes.push({ text: fallbackMessage });
34556
+ }
34557
+ const error = new APIError({
34558
+ text: `A request to the Cloudflare API (${resource}) failed.`,
34559
+ notes,
34560
+ status,
34561
+ telemetryMessage: false
34562
+ });
34563
+ const code = errors$1[0]?.code;
34564
+ if (code) error.code = code;
34565
+ error.accountTag = extractAccountTag(resource);
34566
+ throw error;
34567
+ }
34568
+ __name(throwFetchError, "throwFetchError");
34569
+ function throwWAFBlockError(headers, method, resource, status, statusText) {
34570
+ const rayId = extractWAFBlockRayId(headers);
34571
+ throw new APIError({
34572
+ text: "The Cloudflare API responded with a WAF block page instead of the expected JSON response",
34573
+ notes: [
34574
+ { text: "Cloudflare's firewall (WAF) blocked this API request. This is usually a false positive." },
34575
+ ...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : [],
34576
+ { text: rayId ? "If the issue persists, please open a Cloudflare Support ticket and include the Ray ID above." : "If the issue persists, please open a Cloudflare Support ticket. You can find the Cloudflare Ray ID on the block page in your browser." },
34577
+ { text: `${method} ${resource} -> ${status} ${statusText}` }
34578
+ ],
34579
+ status,
34580
+ telemetryMessage: false
34581
+ });
34582
+ }
34583
+ __name(throwWAFBlockError, "throwWAFBlockError");
34584
+ function hasCursor(result_info) {
34585
+ const cursor = result_info?.cursor;
34586
+ return cursor !== void 0 && cursor !== null && cursor !== "";
34587
+ }
34588
+ __name(hasCursor, "hasCursor");
34589
+ function maybeAddTraceHeader(headers) {
34590
+ const traceHeader = getTraceHeader();
34591
+ if (traceHeader) headers.set("Cf-Trace-Id", traceHeader);
34592
+ }
34593
+ __name(maybeAddTraceHeader, "maybeAddTraceHeader");
34594
+ function cloneHeaders(headers) {
34595
+ return new import_undici.Headers(headers);
34596
+ }
34597
+ __name(cloneHeaders, "cloneHeaders");
34598
+ var import_update_check = __toESM(require_update_check());
34599
+ var UPDATE_CHECK_TIMEOUT_MS = 3e3;
34600
+ var TIMED_OUT = Symbol("timed_out");
34601
+ async function fetchLatestNpmVersion(name, version$2) {
34602
+ let result = null;
34603
+ try {
34604
+ result = await Promise.race([(0, import_update_check.default)({
34605
+ name,
34606
+ version: version$2
34607
+ }, { distTag: version$2.startsWith("0.0.0") ? "beta" : "latest" }), timersPromises.setTimeout(UPDATE_CHECK_TIMEOUT_MS, TIMED_OUT, { ref: false })]);
34608
+ } catch {
34609
+ return { status: "failed" };
34610
+ }
34611
+ if (result === TIMED_OUT) return { status: "failed" };
34612
+ if (result === null) return { status: "up-to-date" };
34613
+ return {
34614
+ status: "update-available",
34615
+ latest: result.latest
34616
+ };
34617
+ }
34618
+ __name(fetchLatestNpmVersion, "fetchLatestNpmVersion");
33536
34619
 
33537
34620
  //#endregion
33538
34621
  //#region ../../node_modules/.pnpm/get-port@7.1.0/node_modules/get-port/index.js
@@ -35499,6 +36582,7 @@ Add \`${QUICK_TUNNEL_ALLOWED_HOST}\` to \`preview.allowedHosts\` in your Vite co
35499
36582
  }
35500
36583
  dispose() {
35501
36584
  const tunnel = this.#tunnel;
36585
+ const wasTunnelStarted = this.#origin !== void 0;
35502
36586
  this.#abortController?.abort();
35503
36587
  this.#origin = void 0;
35504
36588
  this.#publicUrls = void 0;
@@ -35507,7 +36591,7 @@ Add \`${QUICK_TUNNEL_ALLOWED_HOST}\` to \`preview.allowedHosts\` in your Vite co
35507
36591
  this.#hasWarnedAboutSse = false;
35508
36592
  debuglog("Disposing tunnel...");
35509
36593
  if (tunnel) tunnel.dispose();
35510
- this.#logger.info(" ➜ Tunnel closed");
36594
+ if (wasTunnelStarted) this.#logger.info(" ➜ Tunnel closed");
35511
36595
  }
35512
36596
  disposeOnExit() {
35513
36597
  try {
@@ -37384,7 +38468,7 @@ function getLineInfo(input, offset) {
37384
38468
  cur = nextBreak;
37385
38469
  }
37386
38470
  }
37387
- var defaultOptions = {
38471
+ var defaultOptions$1 = {
37388
38472
  ecmaVersion: null,
37389
38473
  sourceType: "script",
37390
38474
  onInsertedSemicolon: null,
@@ -37406,9 +38490,9 @@ var defaultOptions = {
37406
38490
  preserveParens: false
37407
38491
  };
37408
38492
  var warnedAboutEcmaVersion = false;
37409
- function getOptions(opts) {
38493
+ function getOptions$1(opts) {
37410
38494
  var options = {};
37411
- for (var opt in defaultOptions) options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt];
38495
+ for (var opt in defaultOptions$1) options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions$1[opt];
37412
38496
  if (options.ecmaVersion === "latest") options.ecmaVersion = 1e8;
37413
38497
  else if (options.ecmaVersion == null) {
37414
38498
  if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
@@ -37448,7 +38532,7 @@ function functionFlags(async, generator) {
37448
38532
  }
37449
38533
  var BIND_NONE = 0, BIND_VAR = 1, BIND_LEXICAL = 2, BIND_FUNCTION = 3, BIND_SIMPLE_CATCH = 4, BIND_OUTSIDE = 5;
37450
38534
  var Parser = function Parser$2(options, input, startPos) {
37451
- this.options = options = getOptions(options);
38535
+ this.options = options = getOptions$1(options);
37452
38536
  this.sourceFile = options.sourceFile;
37453
38537
  this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
37454
38538
  var reserved = "";
@@ -41233,7 +42317,7 @@ var version$1 = "8.16.0";
41233
42317
  Parser.acorn = {
41234
42318
  Parser,
41235
42319
  version: version$1,
41236
- defaultOptions,
42320
+ defaultOptions: defaultOptions$1,
41237
42321
  Position,
41238
42322
  SourceLocation,
41239
42323
  getLineInfo,
@@ -41291,7 +42375,7 @@ const protocolRelative = Symbol.for("ufo:protocolRelative");
41291
42375
  //#endregion
41292
42376
  //#region ../../node_modules/.pnpm/pathe@2.0.1/node_modules/pathe/dist/shared/pathe.BLwDEnA5.mjs
41293
42377
  const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
41294
- const isAbsolute$1 = function(p$1) {
42378
+ const isAbsolute$2 = function(p$1) {
41295
42379
  return _IS_ABSOLUTE_RE.test(p$1);
41296
42380
  };
41297
42381
 
@@ -41647,7 +42731,7 @@ function read(jsonPath, { base, specifier }) {
41647
42731
  /** @type {string | undefined} */
41648
42732
  let string;
41649
42733
  try {
41650
- string = fs2.readFileSync(path3.toNamespacedPath(jsonPath), "utf8");
42734
+ string = fs2.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
41651
42735
  } catch (error) {
41652
42736
  const exception = error;
41653
42737
  if (exception.code !== "ENOENT") throw exception;
@@ -41853,7 +42937,7 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
41853
42937
  const packagePath = fileURLToPath(new URL$1(".", packageJsonUrl));
41854
42938
  const basePath = fileURLToPath(base);
41855
42939
  if (!main) process$1.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
41856
- else if (path3.resolve(packagePath, main) !== urlPath) process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
42940
+ else if (path.resolve(packagePath, main) !== urlPath) process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
41857
42941
  }
41858
42942
  /**
41859
42943
  * @param {string} path
@@ -41960,7 +43044,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
41960
43044
  {
41961
43045
  const real = realpathSync(filePath);
41962
43046
  const { search, hash } = resolved;
41963
- resolved = pathToFileURL(real + (filePath.endsWith(path3.sep) ? "/" : ""));
43047
+ resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : ""));
41964
43048
  resolved.search = search;
41965
43049
  resolved.hash = hash;
41966
43050
  }
@@ -42301,8 +43385,8 @@ function packageResolve(specifier, base, conditions) {
42301
43385
  /** @type {string} */
42302
43386
  let lastPath;
42303
43387
  do {
42304
- const stat = tryStatSync(packageJsonPath.slice(0, -13));
42305
- if (!stat || !stat.isDirectory()) {
43388
+ const stat$1 = tryStatSync(packageJsonPath.slice(0, -13));
43389
+ if (!stat$1 || !stat$1.isDirectory()) {
42306
43390
  lastPath = packageJsonPath;
42307
43391
  packageJsonUrl = new URL$1((isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", packageJsonUrl);
42308
43392
  packageJsonPath = fileURLToPath(packageJsonUrl);
@@ -42419,7 +43503,7 @@ function _resolve(id, options = {}) {
42419
43503
  if (/(node|data|http|https):/.test(id)) return id;
42420
43504
  if (BUILTIN_MODULES.has(id)) return "node:" + id;
42421
43505
  if (id.startsWith("file://")) id = fileURLToPath$2(id);
42422
- if (isAbsolute$1(id)) try {
43506
+ if (isAbsolute$2(id)) try {
42423
43507
  if (statSync(id).isFile()) return pathToFileURL$1(id);
42424
43508
  } catch (error) {
42425
43509
  if (error?.code !== "ENOENT") throw error;
@@ -43055,9 +44139,10 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
43055
44139
  const root = userConfig.root ? nodePath.resolve(userConfig.root) : process.cwd();
43056
44140
  const prefixedEnv = vite.loadEnv(viteEnv.mode, root, ["CLOUDFLARE_", "WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_"]);
43057
44141
  Object.assign(process.env, prefixedEnv);
44142
+ const remoteBindings = prefixedEnv.CLOUDFLARE_VITE_FORCE_LOCAL === "true" ? false : pluginConfig.remoteBindings ?? true;
43058
44143
  if (viteEnv.isPreview) return {
43059
44144
  ...shared,
43060
- remoteBindings: pluginConfig.remoteBindings ?? true,
44145
+ remoteBindings,
43061
44146
  type: "preview",
43062
44147
  workers: getWorkerConfigs(root, !!process.env.CLOUDFLARE_VITE_BUILD)
43063
44148
  };
@@ -43102,7 +44187,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
43102
44187
  environmentNameToChildEnvironmentNamesMap,
43103
44188
  prerenderWorkerEnvironmentName,
43104
44189
  configPaths,
43105
- remoteBindings: pluginConfig.remoteBindings ?? true,
44190
+ remoteBindings,
43106
44191
  rawConfigs: { entryWorker: entryWorkerResolvedConfig }
43107
44192
  };
43108
44193
  let staticRouting;
@@ -43146,7 +44231,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
43146
44231
  prerenderWorkerEnvironmentName,
43147
44232
  entryWorkerEnvironmentName,
43148
44233
  staticRouting,
43149
- remoteBindings: pluginConfig.remoteBindings ?? true,
44234
+ remoteBindings,
43150
44235
  rawConfigs: {
43151
44236
  entryWorker: entryWorkerResolvedConfig,
43152
44237
  auxiliaryWorkers: auxiliaryWorkersResolvedConfigs
@@ -50859,9 +51944,9 @@ const request = (config, options) => {
50859
51944
  };
50860
51945
  const debugLogRequest = async (config, url, headers, body) => {
50861
51946
  config.LOGGER?.debug(`-- START CF API REQUEST: ${url}`);
50862
- const logHeaders = new Headers(headers);
50863
- logHeaders.delete("Authorization");
50864
- config.LOGGER?.debugWithSanitization("HEADERS:", JSON.stringify(logHeaders, null, 2));
51947
+ const logHeaders$1 = new Headers(headers);
51948
+ logHeaders$1.delete("Authorization");
51949
+ config.LOGGER?.debugWithSanitization("HEADERS:", JSON.stringify(logHeaders$1, null, 2));
50865
51950
  config.LOGGER?.debugWithSanitization("BODY:", JSON.stringify(body instanceof FormData ? await new Response(body).text() : body, null, 2));
50866
51951
  config.LOGGER?.debug("-- END CF API REQUEST");
50867
51952
  };
@@ -51747,7 +52832,7 @@ function getContainerOptions(options) {
51747
52832
  return containersConfig.map((container) => {
51748
52833
  if (isDockerfile(container.image, configPath)) return {
51749
52834
  dockerfile: container.image,
51750
- image_build_context: container.image_build_context ?? path3.dirname(container.image),
52835
+ image_build_context: container.image_build_context ?? path.dirname(container.image),
51751
52836
  image_vars: container.image_vars,
51752
52837
  class_name: container.class_name,
51753
52838
  image_tag: getDevContainerImageName(container.class_name, containerBuildId)
@@ -51761,7 +52846,7 @@ function getContainerOptions(options) {
51761
52846
  }
51762
52847
 
51763
52848
  //#endregion
51764
- //#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.3/node_modules/fdir/dist/index.mjs
52849
+ //#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.4/node_modules/fdir/dist/index.mjs
51765
52850
  var __require = /* @__PURE__ */ createRequire$1(import.meta.url);
51766
52851
  function cleanPath(path$1) {
51767
52852
  let normalized = normalize(path$1);
@@ -51873,10 +52958,10 @@ const resolveSymlinksAsync = function(path$1, state, callback$1) {
51873
52958
  queue.enqueue();
51874
52959
  fs$2.realpath(path$1, (error, resolvedPath) => {
51875
52960
  if (error) return queue.dequeue(suppressErrors ? null : error, state);
51876
- fs$2.stat(resolvedPath, (error$1, stat) => {
52961
+ fs$2.stat(resolvedPath, (error$1, stat$1) => {
51877
52962
  if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
51878
- if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
51879
- callback$1(stat, resolvedPath);
52963
+ if (stat$1.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
52964
+ callback$1(stat$1, resolvedPath);
51880
52965
  queue.dequeue(null, state);
51881
52966
  });
51882
52967
  });
@@ -51886,9 +52971,9 @@ const resolveSymlinks = function(path$1, state, callback$1) {
51886
52971
  queue.enqueue();
51887
52972
  try {
51888
52973
  const resolvedPath = fs$2.realpathSync(path$1);
51889
- const stat = fs$2.statSync(resolvedPath);
51890
- if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
51891
- callback$1(stat, resolvedPath);
52974
+ const stat$1 = fs$2.statSync(resolvedPath);
52975
+ if (stat$1.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
52976
+ callback$1(stat$1, resolvedPath);
51892
52977
  } catch (e) {
51893
52978
  if (!suppressErrors) throw e;
51894
52979
  }
@@ -52062,7 +53147,7 @@ var Walker = class {
52062
53147
  symlinks: /* @__PURE__ */ new Map(),
52063
53148
  visited: [""].slice(0, 0),
52064
53149
  controller: new Aborter(),
52065
- fs: options.fs || nativeFs$1
53150
+ fs: options.fs || nativeFs
52066
53151
  };
52067
53152
  this.joinPath = build$7(this.root, options);
52068
53153
  this.pushDirectory = build$6(this.root, options);
@@ -52093,8 +53178,8 @@ var Walker = class {
52093
53178
  this.walkDirectory(this.state, path$1, path$1, depth$1 - 1, this.walk);
52094
53179
  } else if (this.resolveSymlink && entry.isSymbolicLink()) {
52095
53180
  let path$1 = joinPathWithBasePath(entry.name, directoryPath);
52096
- this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => {
52097
- if (stat.isDirectory()) {
53181
+ this.resolveSymlink(path$1, this.state, (stat$1, resolvedPath) => {
53182
+ if (stat$1.isDirectory()) {
52098
53183
  resolvedPath = normalizePath$1(resolvedPath, this.state.options);
52099
53184
  if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
52100
53185
  this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth$1 - 1, this.walk);
@@ -52270,10 +53355,11 @@ var Builder = class {
52270
53355
  };
52271
53356
 
52272
53357
  //#endregion
52273
- //#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js
52274
- var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js": ((exports, module) => {
53358
+ //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
53359
+ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js": ((exports, module) => {
52275
53360
  const WIN_SLASH = "\\\\/";
52276
53361
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
53362
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
52277
53363
  /**
52278
53364
  * Posix glob regex
52279
53365
  */
@@ -52326,6 +53412,7 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
52326
53412
  * POSIX Bracket Regex
52327
53413
  */
52328
53414
  const POSIX_REGEX_SOURCE$1 = {
53415
+ __proto__: null,
52329
53416
  alnum: "a-zA-Z0-9",
52330
53417
  alpha: "a-zA-Z",
52331
53418
  ascii: "\\x00-\\x7F",
@@ -52342,6 +53429,7 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
52342
53429
  xdigit: "A-Fa-f0-9"
52343
53430
  };
52344
53431
  module.exports = {
53432
+ DEFAULT_MAX_EXTGLOB_RECURSION,
52345
53433
  MAX_LENGTH: 1024 * 64,
52346
53434
  POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
52347
53435
  REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
@@ -52435,8 +53523,8 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
52435
53523
  }) });
52436
53524
 
52437
53525
  //#endregion
52438
- //#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js
52439
- var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js": ((exports) => {
53526
+ //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js
53527
+ var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js": ((exports) => {
52440
53528
  const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
52441
53529
  exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
52442
53530
  exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
@@ -52484,8 +53572,8 @@ var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
52484
53572
  }) });
52485
53573
 
52486
53574
  //#endregion
52487
- //#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js
52488
- var require_scan = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js": ((exports, module) => {
53575
+ //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js
53576
+ var require_scan = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js": ((exports, module) => {
52489
53577
  const utils$3 = require_utils();
52490
53578
  const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
52491
53579
  const isPathSeparator = (code) => {
@@ -52772,8 +53860,8 @@ var require_scan = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pico
52772
53860
  }) });
52773
53861
 
52774
53862
  //#endregion
52775
- //#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js
52776
- var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js": ((exports, module) => {
53863
+ //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js
53864
+ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js": ((exports, module) => {
52777
53865
  const constants$3 = require_constants();
52778
53866
  const utils$2 = require_utils();
52779
53867
  /**
@@ -52800,6 +53888,177 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
52800
53888
  const syntaxError = (type, char) => {
52801
53889
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
52802
53890
  };
53891
+ const splitTopLevel = (input) => {
53892
+ const parts = [];
53893
+ let bracket = 0;
53894
+ let paren = 0;
53895
+ let quote = 0;
53896
+ let value = "";
53897
+ let escaped = false;
53898
+ for (const ch of input) {
53899
+ if (escaped === true) {
53900
+ value += ch;
53901
+ escaped = false;
53902
+ continue;
53903
+ }
53904
+ if (ch === "\\") {
53905
+ value += ch;
53906
+ escaped = true;
53907
+ continue;
53908
+ }
53909
+ if (ch === "\"") {
53910
+ quote = quote === 1 ? 0 : 1;
53911
+ value += ch;
53912
+ continue;
53913
+ }
53914
+ if (quote === 0) {
53915
+ if (ch === "[") bracket++;
53916
+ else if (ch === "]" && bracket > 0) bracket--;
53917
+ else if (bracket === 0) {
53918
+ if (ch === "(") paren++;
53919
+ else if (ch === ")" && paren > 0) paren--;
53920
+ else if (ch === "|" && paren === 0) {
53921
+ parts.push(value);
53922
+ value = "";
53923
+ continue;
53924
+ }
53925
+ }
53926
+ }
53927
+ value += ch;
53928
+ }
53929
+ parts.push(value);
53930
+ return parts;
53931
+ };
53932
+ const isPlainBranch = (branch) => {
53933
+ let escaped = false;
53934
+ for (const ch of branch) {
53935
+ if (escaped === true) {
53936
+ escaped = false;
53937
+ continue;
53938
+ }
53939
+ if (ch === "\\") {
53940
+ escaped = true;
53941
+ continue;
53942
+ }
53943
+ if (/[?*+@!()[\]{}]/.test(ch)) return false;
53944
+ }
53945
+ return true;
53946
+ };
53947
+ const normalizeSimpleBranch = (branch) => {
53948
+ let value = branch.trim();
53949
+ let changed = true;
53950
+ while (changed === true) {
53951
+ changed = false;
53952
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
53953
+ value = value.slice(2, -1);
53954
+ changed = true;
53955
+ }
53956
+ }
53957
+ if (!isPlainBranch(value)) return;
53958
+ return value.replace(/\\(.)/g, "$1");
53959
+ };
53960
+ const hasRepeatedCharPrefixOverlap = (branches) => {
53961
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
53962
+ for (let i$1 = 0; i$1 < values.length; i$1++) for (let j = i$1 + 1; j < values.length; j++) {
53963
+ const a = values[i$1];
53964
+ const b = values[j];
53965
+ const char = a[0];
53966
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
53967
+ if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
53968
+ }
53969
+ return false;
53970
+ };
53971
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
53972
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
53973
+ let bracket = 0;
53974
+ let paren = 0;
53975
+ let quote = 0;
53976
+ let escaped = false;
53977
+ for (let i$1 = 1; i$1 < pattern.length; i$1++) {
53978
+ const ch = pattern[i$1];
53979
+ if (escaped === true) {
53980
+ escaped = false;
53981
+ continue;
53982
+ }
53983
+ if (ch === "\\") {
53984
+ escaped = true;
53985
+ continue;
53986
+ }
53987
+ if (ch === "\"") {
53988
+ quote = quote === 1 ? 0 : 1;
53989
+ continue;
53990
+ }
53991
+ if (quote === 1) continue;
53992
+ if (ch === "[") {
53993
+ bracket++;
53994
+ continue;
53995
+ }
53996
+ if (ch === "]" && bracket > 0) {
53997
+ bracket--;
53998
+ continue;
53999
+ }
54000
+ if (bracket > 0) continue;
54001
+ if (ch === "(") {
54002
+ paren++;
54003
+ continue;
54004
+ }
54005
+ if (ch === ")") {
54006
+ paren--;
54007
+ if (paren === 0) {
54008
+ if (requireEnd === true && i$1 !== pattern.length - 1) return;
54009
+ return {
54010
+ type: pattern[0],
54011
+ body: pattern.slice(2, i$1),
54012
+ end: i$1
54013
+ };
54014
+ }
54015
+ }
54016
+ }
54017
+ };
54018
+ const getStarExtglobSequenceOutput = (pattern) => {
54019
+ let index = 0;
54020
+ const chars$1 = [];
54021
+ while (index < pattern.length) {
54022
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
54023
+ if (!match || match.type !== "*") return;
54024
+ const branches = splitTopLevel(match.body).map((branch$1) => branch$1.trim());
54025
+ if (branches.length !== 1) return;
54026
+ const branch = normalizeSimpleBranch(branches[0]);
54027
+ if (!branch || branch.length !== 1) return;
54028
+ chars$1.push(branch);
54029
+ index += match.end + 1;
54030
+ }
54031
+ if (chars$1.length < 1) return;
54032
+ return `${chars$1.length === 1 ? utils$2.escapeRegex(chars$1[0]) : `[${chars$1.map((ch) => utils$2.escapeRegex(ch)).join("")}]`}*`;
54033
+ };
54034
+ const repeatedExtglobRecursion = (pattern) => {
54035
+ let depth$1 = 0;
54036
+ let value = pattern.trim();
54037
+ let match = parseRepeatedExtglob(value);
54038
+ while (match) {
54039
+ depth$1++;
54040
+ value = match.body.trim();
54041
+ match = parseRepeatedExtglob(value);
54042
+ }
54043
+ return depth$1;
54044
+ };
54045
+ const analyzeRepeatedExtglob = (body, options) => {
54046
+ if (options.maxExtglobRecursion === false) return { risky: false };
54047
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants$3.DEFAULT_MAX_EXTGLOB_RECURSION;
54048
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
54049
+ if (branches.length > 1) {
54050
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
54051
+ }
54052
+ for (const branch of branches) {
54053
+ const safeOutput = getStarExtglobSequenceOutput(branch);
54054
+ if (safeOutput) return {
54055
+ risky: true,
54056
+ safeOutput
54057
+ };
54058
+ if (repeatedExtglobRecursion(branch) > max) return { risky: true };
54059
+ }
54060
+ return { risky: false };
54061
+ };
52803
54062
  /**
52804
54063
  * Parse the given input string.
52805
54064
  * @param {String} input
@@ -52929,6 +54188,8 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
52929
54188
  token.prev = prev;
52930
54189
  token.parens = state.parens;
52931
54190
  token.output = state.output;
54191
+ token.startIndex = state.index;
54192
+ token.tokensIndex = tokens.length;
52932
54193
  const output = (opts.capture ? "(" : "") + token.open;
52933
54194
  increment("parens");
52934
54195
  push({
@@ -52945,6 +54206,30 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
52945
54206
  extglobs.push(token);
52946
54207
  };
52947
54208
  const extglobClose = (token) => {
54209
+ const literal$1 = input.slice(token.startIndex, state.index + 1);
54210
+ const analysis = analyzeRepeatedExtglob(input.slice(token.startIndex + 2, state.index), opts);
54211
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
54212
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR$1) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
54213
+ const open$1 = tokens[token.tokensIndex];
54214
+ open$1.type = "text";
54215
+ open$1.value = literal$1;
54216
+ open$1.output = safeOutput || utils$2.escapeRegex(literal$1);
54217
+ for (let i$1 = token.tokensIndex + 1; i$1 < tokens.length; i$1++) {
54218
+ tokens[i$1].value = "";
54219
+ tokens[i$1].output = "";
54220
+ delete tokens[i$1].suffix;
54221
+ }
54222
+ state.output = token.output + open$1.output;
54223
+ state.backtrack = true;
54224
+ push({
54225
+ type: "paren",
54226
+ extglob: true,
54227
+ value,
54228
+ output: ""
54229
+ });
54230
+ decrement("parens");
54231
+ return;
54232
+ }
52948
54233
  let output = token.close + (opts.capture ? ")" : "");
52949
54234
  let rest;
52950
54235
  if (token.type === "negate") {
@@ -53631,8 +54916,8 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
53631
54916
  }) });
53632
54917
 
53633
54918
  //#endregion
53634
- //#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js
53635
- var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js": ((exports, module) => {
54919
+ //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js
54920
+ var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js": ((exports, module) => {
53636
54921
  const scan = require_scan();
53637
54922
  const parse = require_parse();
53638
54923
  const utils$1 = require_utils();
@@ -53841,6 +55126,14 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
53841
55126
  * Compile a regular expression from the `state` object returned by the
53842
55127
  * [parse()](#parse) method.
53843
55128
  *
55129
+ * ```js
55130
+ * const picomatch = require('picomatch');
55131
+ * const state = picomatch.parse('*.js');
55132
+ * // picomatch.compileRe(state[, options]);
55133
+ *
55134
+ * console.log(picomatch.compileRe(state));
55135
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
55136
+ * ```
53844
55137
  * @param {Object} `state`
53845
55138
  * @param {Object} `options`
53846
55139
  * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
@@ -53864,10 +55157,10 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
53864
55157
  *
53865
55158
  * ```js
53866
55159
  * const picomatch = require('picomatch');
53867
- * const state = picomatch.parse('*.js');
53868
- * // picomatch.compileRe(state[, options]);
55160
+ * // picomatch.makeRe(state[, options]);
53869
55161
  *
53870
- * console.log(picomatch.compileRe(state));
55162
+ * const result = picomatch.makeRe('*.js');
55163
+ * console.log(result);
53871
55164
  * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
53872
55165
  * ```
53873
55166
  * @param {String} `state` The object returned from the `.parse` method.
@@ -53924,8 +55217,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
53924
55217
  }) });
53925
55218
 
53926
55219
  //#endregion
53927
- //#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js
53928
- var require_picomatch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js": ((exports, module) => {
55220
+ //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js
55221
+ var require_picomatch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js": ((exports, module) => {
53929
55222
  const pico = require_picomatch$1();
53930
55223
  const utils = require_utils();
53931
55224
  function picomatch$1(glob, options, returnState = false) {
@@ -53940,38 +55233,39 @@ var require_picomatch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
53940
55233
  }) });
53941
55234
 
53942
55235
  //#endregion
53943
- //#region ../../node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs
55236
+ //#region ../../node_modules/.pnpm/tinyglobby@0.2.16/node_modules/tinyglobby/dist/index.mjs
53944
55237
  var import_picomatch = /* @__PURE__ */ __toESM$1(require_picomatch(), 1);
53945
55238
  const isReadonlyArray = Array.isArray;
55239
+ const BACKSLASHES = /\\/g;
53946
55240
  const isWin = process.platform === "win32";
53947
55241
  const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
53948
55242
  function getPartialMatcher(patterns, options = {}) {
53949
55243
  const patternsCount = patterns.length;
53950
55244
  const patternsParts = Array(patternsCount);
53951
55245
  const matchers = Array(patternsCount);
53952
- const globstarEnabled = !options.noglobstar;
53953
- for (let i$1 = 0; i$1 < patternsCount; i$1++) {
55246
+ let i$1, j;
55247
+ for (i$1 = 0; i$1 < patternsCount; i$1++) {
53954
55248
  const parts = splitPattern(patterns[i$1]);
53955
55249
  patternsParts[i$1] = parts;
53956
55250
  const partsCount = parts.length;
53957
55251
  const partMatchers = Array(partsCount);
53958
- for (let j = 0; j < partsCount; j++) partMatchers[j] = (0, import_picomatch.default)(parts[j], options);
55252
+ for (j = 0; j < partsCount; j++) partMatchers[j] = (0, import_picomatch.default)(parts[j], options);
53959
55253
  matchers[i$1] = partMatchers;
53960
55254
  }
53961
55255
  return (input) => {
53962
55256
  const inputParts = input.split("/");
53963
55257
  if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
53964
- for (let i$1 = 0; i$1 < patterns.length; i$1++) {
55258
+ for (i$1 = 0; i$1 < patternsCount; i$1++) {
53965
55259
  const patternParts = patternsParts[i$1];
53966
55260
  const matcher = matchers[i$1];
53967
55261
  const inputPatternCount = inputParts.length;
53968
55262
  const minParts = Math.min(inputPatternCount, patternParts.length);
53969
- let j = 0;
55263
+ j = 0;
53970
55264
  while (j < minParts) {
53971
55265
  const part = patternParts[j];
53972
55266
  if (part.includes("/")) return true;
53973
55267
  if (!matcher[j](inputParts[j])) break;
53974
- if (globstarEnabled && part === "**") return true;
55268
+ if (!options.noglobstar && part === "**") return true;
53975
55269
  j++;
53976
55270
  }
53977
55271
  if (j === inputPatternCount) return true;
@@ -53985,7 +55279,7 @@ const isRoot = isWin ? (p$1) => WIN32_ROOT_DIR.test(p$1) : (p$1) => p$1 === "/";
53985
55279
  function buildFormat(cwd, root, absolute$1) {
53986
55280
  if (cwd === root || root.startsWith(`${cwd}/`)) {
53987
55281
  if (absolute$1) {
53988
- const start = isRoot(cwd) ? cwd.length : cwd.length + 1;
55282
+ const start = cwd.length + +!isRoot(cwd);
53989
55283
  return (p$1, isDir) => p$1.slice(start, isDir ? -1 : void 0) || ".";
53990
55284
  }
53991
55285
  const prefix = root.slice(cwd.length + 1);
@@ -54006,8 +55300,7 @@ function buildRelative(cwd, root) {
54006
55300
  }
54007
55301
  return (p$1) => {
54008
55302
  const result = posix.relative(cwd, `${root}/${p$1}`);
54009
- if (p$1.endsWith("/") && result !== "") return `${result}/`;
54010
- return result || ".";
55303
+ return p$1[p$1.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
54011
55304
  };
54012
55305
  }
54013
55306
  const splitPatternOptions = { parts: true };
@@ -54046,28 +55339,31 @@ function isDynamicPattern(pattern, options) {
54046
55339
  function log(...tasks) {
54047
55340
  console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
54048
55341
  }
55342
+ function ensureStringArray(value) {
55343
+ return typeof value === "string" ? [value] : value !== null && value !== void 0 ? value : [];
55344
+ }
54049
55345
  const PARENT_DIRECTORY = /^(\/?\.\.)+/;
54050
55346
  const ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
54051
- const BACKSLASHES = /\\/g;
54052
- function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
55347
+ function normalizePattern(pattern, opts, props, isIgnore) {
55348
+ var _PARENT_DIRECTORY$exe;
55349
+ const cwd = opts.cwd;
54053
55350
  let result = pattern;
54054
- if (pattern.endsWith("/")) result = pattern.slice(0, -1);
54055
- if (!result.endsWith("*") && expandDirectories) result += "/**";
55351
+ if (pattern[pattern.length - 1] === "/") result = pattern.slice(0, -1);
55352
+ if (result[result.length - 1] !== "*" && opts.expandDirectories) result += "/**";
54056
55353
  const escapedCwd = escapePath(cwd);
54057
- if (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
54058
- else result = posix.normalize(result);
54059
- const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
55354
+ result = isAbsolute$1(result.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result) : posix.normalize(result);
55355
+ const parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) === null || _PARENT_DIRECTORY$exe === void 0 ? void 0 : _PARENT_DIRECTORY$exe[0];
54060
55356
  const parts = splitPattern(result);
54061
- if (parentDirectoryMatch === null || parentDirectoryMatch === void 0 ? void 0 : parentDirectoryMatch[0]) {
54062
- const n$1 = (parentDirectoryMatch[0].length + 1) / 3;
55357
+ if (parentDir) {
55358
+ const n$1 = (parentDir.length + 1) / 3;
54063
55359
  let i$1 = 0;
54064
55360
  const cwdParts = escapedCwd.split("/");
54065
55361
  while (i$1 < n$1 && parts[i$1 + n$1] === cwdParts[cwdParts.length + i$1 - n$1]) {
54066
55362
  result = result.slice(0, (n$1 - i$1 - 1) * 3) + result.slice((n$1 - i$1) * 3 + parts[i$1 + n$1].length + 1) || ".";
54067
55363
  i$1++;
54068
55364
  }
54069
- const potentialRoot = posix.join(cwd, parentDirectoryMatch[0].slice(i$1 * 3));
54070
- if (!potentialRoot.startsWith(".") && props.root.length > potentialRoot.length) {
55365
+ const potentialRoot = posix.join(cwd, parentDir.slice(i$1 * 3));
55366
+ if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
54071
55367
  props.root = potentialRoot;
54072
55368
  props.depthOffset = -n$1 + i$1;
54073
55369
  }
@@ -54083,7 +55379,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
54083
55379
  newCommonPath.pop();
54084
55380
  break;
54085
55381
  }
54086
- if (part !== props.commonPath[i$1] || isDynamicPattern(part) || i$1 === parts.length - 1) break;
55382
+ if (i$1 === parts.length - 1 || part !== props.commonPath[i$1] || isDynamicPattern(part)) break;
54087
55383
  newCommonPath.push(part);
54088
55384
  }
54089
55385
  props.depthOffset = newCommonPath.length;
@@ -54092,135 +55388,150 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
54092
55388
  }
54093
55389
  return result;
54094
55390
  }
54095
- function processPatterns({ patterns = ["**/*"], ignore: ignore$1 = [], expandDirectories = true }, cwd, props) {
54096
- if (typeof patterns === "string") patterns = [patterns];
54097
- if (typeof ignore$1 === "string") ignore$1 = [ignore$1];
55391
+ function processPatterns(options, patterns, props) {
54098
55392
  const matchPatterns = [];
54099
55393
  const ignorePatterns = [];
54100
- for (const pattern of ignore$1) {
55394
+ for (const pattern of options.ignore) {
54101
55395
  if (!pattern) continue;
54102
- if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, true));
55396
+ if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern, options, props, true));
54103
55397
  }
54104
55398
  for (const pattern of patterns) {
54105
55399
  if (!pattern) continue;
54106
- if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, false));
54107
- else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, true));
55400
+ if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern, options, props, false));
55401
+ else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, true));
54108
55402
  }
54109
55403
  return {
54110
55404
  match: matchPatterns,
54111
55405
  ignore: ignorePatterns
54112
55406
  };
54113
55407
  }
54114
- function formatPaths(paths, relative$2) {
54115
- for (let i$1 = paths.length - 1; i$1 >= 0; i$1--) {
54116
- const path$1 = paths[i$1];
54117
- paths[i$1] = relative$2(path$1);
54118
- }
54119
- return paths;
54120
- }
54121
- function normalizeCwd(cwd) {
54122
- if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
54123
- if (cwd instanceof URL) return fileURLToPath$1(cwd).replace(BACKSLASHES, "/");
54124
- return path.resolve(cwd).replace(BACKSLASHES, "/");
54125
- }
54126
- function getCrawler(patterns, inputOptions = {}) {
54127
- const options = process.env.TINYGLOBBY_DEBUG ? {
54128
- ...inputOptions,
54129
- debug: true
54130
- } : inputOptions;
54131
- const cwd = normalizeCwd(options.cwd);
54132
- if (options.debug) log("globbing with:", {
54133
- patterns,
54134
- options,
54135
- cwd
54136
- });
54137
- if (Array.isArray(patterns) && patterns.length === 0) return [{
54138
- sync: () => [],
54139
- withPromise: async () => []
54140
- }, false];
55408
+ function buildCrawler(options, patterns) {
55409
+ const cwd = options.cwd;
54141
55410
  const props = {
54142
55411
  root: cwd,
54143
- commonPath: null,
54144
55412
  depthOffset: 0
54145
55413
  };
54146
- const processed = processPatterns({
54147
- ...options,
54148
- patterns
54149
- }, cwd, props);
55414
+ const processed = processPatterns(options, patterns, props);
54150
55415
  if (options.debug) log("internal processing patterns:", processed);
55416
+ const { absolute: absolute$1, caseSensitiveMatch: caseSensitiveMatch$1, debug: debug$7, dot, followSymbolicLinks, onlyDirectories } = options;
55417
+ const root = props.root.replace(BACKSLASHES, "");
54151
55418
  const matchOptions = {
54152
- dot: options.dot,
55419
+ dot,
54153
55420
  nobrace: options.braceExpansion === false,
54154
- nocase: options.caseSensitiveMatch === false,
55421
+ nocase: !caseSensitiveMatch$1,
54155
55422
  noextglob: options.extglob === false,
54156
55423
  noglobstar: options.globstar === false,
54157
55424
  posix: true
54158
55425
  };
54159
- const matcher = (0, import_picomatch.default)(processed.match, {
54160
- ...matchOptions,
54161
- ignore: processed.ignore
54162
- });
55426
+ const matcher = (0, import_picomatch.default)(processed.match, matchOptions);
54163
55427
  const ignore$1 = (0, import_picomatch.default)(processed.ignore, matchOptions);
54164
55428
  const partialMatcher = getPartialMatcher(processed.match, matchOptions);
54165
- const format$2 = buildFormat(cwd, props.root, options.absolute);
54166
- const formatExclude = options.absolute ? format$2 : buildFormat(cwd, props.root, true);
54167
- const fdirOptions = {
54168
- filters: [options.debug ? (p$1, isDirectory$1) => {
55429
+ const format$2 = buildFormat(cwd, root, absolute$1);
55430
+ const excludeFormatter = absolute$1 ? format$2 : buildFormat(cwd, root, true);
55431
+ const excludePredicate = (_, p$1) => {
55432
+ const relativePath = excludeFormatter(p$1, true);
55433
+ return relativePath !== "." && !partialMatcher(relativePath) || ignore$1(relativePath);
55434
+ };
55435
+ let maxDepth;
55436
+ if (options.deep !== void 0) maxDepth = Math.round(options.deep - props.depthOffset);
55437
+ const crawler = new Builder({
55438
+ filters: [debug$7 ? (p$1, isDirectory$1) => {
54169
55439
  const path$1 = format$2(p$1, isDirectory$1);
54170
- const matches = matcher(path$1);
55440
+ const matches = matcher(path$1) && !ignore$1(path$1);
54171
55441
  if (matches) log(`matched ${path$1}`);
54172
55442
  return matches;
54173
- } : (p$1, isDirectory$1) => matcher(format$2(p$1, isDirectory$1))],
54174
- exclude: options.debug ? (_, p$1) => {
54175
- const relativePath = formatExclude(p$1, true);
54176
- const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore$1(relativePath);
54177
- if (skipped) log(`skipped ${p$1}`);
54178
- else log(`crawling ${p$1}`);
55443
+ } : (p$1, isDirectory$1) => {
55444
+ const path$1 = format$2(p$1, isDirectory$1);
55445
+ return matcher(path$1) && !ignore$1(path$1);
55446
+ }],
55447
+ exclude: debug$7 ? (_, p$1) => {
55448
+ const skipped = excludePredicate(_, p$1);
55449
+ log(`${skipped ? "skipped" : "crawling"} ${p$1}`);
54179
55450
  return skipped;
54180
- } : (_, p$1) => {
54181
- const relativePath = formatExclude(p$1, true);
54182
- return relativePath !== "." && !partialMatcher(relativePath) || ignore$1(relativePath);
54183
- },
54184
- fs: options.fs ? {
54185
- readdir: options.fs.readdir || nativeFs.readdir,
54186
- readdirSync: options.fs.readdirSync || nativeFs.readdirSync,
54187
- realpath: options.fs.realpath || nativeFs.realpath,
54188
- realpathSync: options.fs.realpathSync || nativeFs.realpathSync,
54189
- stat: options.fs.stat || nativeFs.stat,
54190
- statSync: options.fs.statSync || nativeFs.statSync
54191
- } : void 0,
55451
+ } : excludePredicate,
55452
+ fs: options.fs,
54192
55453
  pathSeparator: "/",
54193
- relativePaths: true,
54194
- resolveSymlinks: true,
55454
+ relativePaths: !absolute$1,
55455
+ resolvePaths: absolute$1,
55456
+ includeBasePath: absolute$1,
55457
+ resolveSymlinks: followSymbolicLinks,
55458
+ excludeSymlinks: !followSymbolicLinks,
55459
+ excludeFiles: onlyDirectories,
55460
+ includeDirs: onlyDirectories || !options.onlyFiles,
55461
+ maxDepth,
54195
55462
  signal: options.signal
55463
+ }).crawl(root);
55464
+ if (options.debug) log("internal properties:", {
55465
+ ...props,
55466
+ root
55467
+ });
55468
+ return [crawler, cwd !== root && !absolute$1 && buildRelative(cwd, root)];
55469
+ }
55470
+ function formatPaths(paths, mapper) {
55471
+ if (mapper) for (let i$1 = paths.length - 1; i$1 >= 0; i$1--) paths[i$1] = mapper(paths[i$1]);
55472
+ return paths;
55473
+ }
55474
+ const defaultOptions = {
55475
+ caseSensitiveMatch: true,
55476
+ cwd: process.cwd(),
55477
+ debug: !!process.env.TINYGLOBBY_DEBUG,
55478
+ expandDirectories: true,
55479
+ followSymbolicLinks: true,
55480
+ onlyFiles: true
55481
+ };
55482
+ function getOptions(options) {
55483
+ const opts = {
55484
+ ...defaultOptions,
55485
+ ...options
54196
55486
  };
54197
- if (options.deep !== void 0) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
54198
- if (options.absolute) {
54199
- fdirOptions.relativePaths = false;
54200
- fdirOptions.resolvePaths = true;
54201
- fdirOptions.includeBasePath = true;
54202
- }
54203
- if (options.followSymbolicLinks === false) {
54204
- fdirOptions.resolveSymlinks = false;
54205
- fdirOptions.excludeSymlinks = true;
54206
- }
54207
- if (options.onlyDirectories) {
54208
- fdirOptions.excludeFiles = true;
54209
- fdirOptions.includeDirs = true;
54210
- } else if (options.onlyFiles === false) fdirOptions.includeDirs = true;
54211
- props.root = props.root.replace(BACKSLASHES, "");
54212
- const root = props.root;
54213
- if (options.debug) log("internal properties:", props);
54214
- const relative$2 = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
54215
- return [new Builder(fdirOptions).crawl(root), relative$2];
55487
+ opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd)).replace(BACKSLASHES, "/");
55488
+ opts.ignore = ensureStringArray(opts.ignore);
55489
+ opts.fs && (opts.fs = {
55490
+ readdir: opts.fs.readdir || readdir,
55491
+ readdirSync: opts.fs.readdirSync || readdirSync,
55492
+ realpath: opts.fs.realpath || realpath,
55493
+ realpathSync: opts.fs.realpathSync || realpathSync$1,
55494
+ stat: opts.fs.stat || stat,
55495
+ statSync: opts.fs.statSync || statSync$1
55496
+ });
55497
+ if (opts.debug) log("globbing with options:", opts);
55498
+ return opts;
55499
+ }
55500
+ function getCrawler(globInput, inputOptions = {}) {
55501
+ var _ref;
55502
+ if (globInput && (inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
55503
+ const isModern = isReadonlyArray(globInput) || typeof globInput === "string";
55504
+ const patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== void 0 ? _ref : "**/*");
55505
+ const options = getOptions(isModern ? inputOptions : globInput);
55506
+ return patterns.length > 0 ? buildCrawler(options, patterns) : [];
54216
55507
  }
54217
- function globSync(patternsOrOptions, options) {
54218
- if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
54219
- const isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === "string";
54220
- const opts = isModern ? options : patternsOrOptions;
54221
- const [crawler, relative$2] = getCrawler(isModern ? patternsOrOptions : patternsOrOptions.patterns, opts);
54222
- if (!relative$2) return crawler.sync();
54223
- return formatPaths(crawler.sync(), relative$2);
55508
+ function globSync(globInput, options) {
55509
+ const [crawler, relative$2] = getCrawler(globInput, options);
55510
+ return crawler ? formatPaths(crawler.sync(), relative$2) : [];
55511
+ }
55512
+
55513
+ //#endregion
55514
+ //#region src/update-check.ts
55515
+ let updateCheckPromise;
55516
+ /**
55517
+ * Checks if a newer version of `@cloudflare/vite-plugin` is available on npm.
55518
+ *
55519
+ * The result is memoised so the check is only performed once per process
55520
+ * lifetime — callers can invoke this freely without worrying about redundant
55521
+ * network requests.
55522
+ *
55523
+ * @returns A discriminated result indicating whether an update is available,
55524
+ * the package is already up-to-date, or the check failed
55525
+ */
55526
+ function checkForNpmUpdate() {
55527
+ return updateCheckPromise ??= (async () => {
55528
+ try {
55529
+ const pkg = (await import("../package.json", { with: { type: "json" } })).default;
55530
+ return fetchLatestNpmVersion(pkg.name, pkg.version);
55531
+ } catch {
55532
+ return { status: "failed" };
55533
+ }
55534
+ })();
54224
55535
  }
54225
55536
 
54226
55537
  //#endregion
@@ -54550,6 +55861,7 @@ async function getPreviewMiniflareOptions(ctx, vitePreviewServer) {
54550
55861
  * A Miniflare logger that forwards messages onto a Vite logger.
54551
55862
  */
54552
55863
  var ViteMiniflareLogger = class extends Log {
55864
+ #warnedCompatibilityDateFallback = false;
54553
55865
  logger;
54554
55866
  constructor(config) {
54555
55867
  super(miniflareLogLevelFromViteLogLevel(config.logLevel));
@@ -54562,6 +55874,18 @@ var ViteMiniflareLogger = class extends Log {
54562
55874
  case LogLevel.INFO: return this.logger.info(message);
54563
55875
  }
54564
55876
  }
55877
+ warn(message) {
55878
+ if (!message.startsWith("The latest compatibility date supported by")) {
55879
+ this.logger.warn(message);
55880
+ return;
55881
+ }
55882
+ if (this.#warnedCompatibilityDateFallback) return;
55883
+ this.#warnedCompatibilityDateFallback = true;
55884
+ checkForNpmUpdate().then((result) => {
55885
+ if (result.status !== "update-available") return;
55886
+ this.logger.warn(`${message}\nFeatures enabled by your requested compatibility date may not be available.\nUpgrade to \`@cloudflare/vite-plugin@${result.latest}\` to remove this warning.`);
55887
+ });
55888
+ }
54565
55889
  logReady() {}
54566
55890
  };
54567
55891
  function miniflareLogLevelFromViteLogLevel(level = "info") {
@@ -54593,6 +55917,12 @@ function getStructuredLogsLogger(logger) {
54593
55917
  */
54594
55918
  function handleWebSocket(httpServer, miniflare, entryWorkerName) {
54595
55919
  const nodeWebSocket = new WebSocketServer({ noServer: true });
55920
+ const workerResponseHeaders = /* @__PURE__ */ new WeakMap();
55921
+ nodeWebSocket.on("headers", (responseHeaders, request$2) => {
55922
+ const extra = workerResponseHeaders.get(request$2);
55923
+ workerResponseHeaders.delete(request$2);
55924
+ if (extra) appendWorkerResponseHeaders(responseHeaders, extra);
55925
+ });
54596
55926
  httpServer.on("upgrade", async (request$2, socket, head) => {
54597
55927
  socket.on("error", () => socket.destroy());
54598
55928
  const rawHost = request$2.headers.host ?? UNKNOWN_HOST;
@@ -54604,14 +55934,16 @@ function handleWebSocket(httpServer, miniflare, entryWorkerName) {
54604
55934
  if (isViteRequest && !isSandboxRequest) return;
54605
55935
  const headers = createHeaders(request$2);
54606
55936
  if (entryWorkerName) headers.set(CoreHeaders.ROUTE_OVERRIDE, entryWorkerName);
54607
- const workerWebSocket = (await miniflare.dispatchFetch(url, {
55937
+ const response = await miniflare.dispatchFetch(url, {
54608
55938
  headers,
54609
55939
  method: request$2.method
54610
- })).webSocket;
55940
+ });
55941
+ const workerWebSocket = response.webSocket;
54611
55942
  if (!workerWebSocket) {
54612
55943
  socket.destroy();
54613
55944
  return;
54614
55945
  }
55946
+ workerResponseHeaders.set(request$2, response.headers);
54615
55947
  nodeWebSocket.handleUpgrade(request$2, socket, head, async (clientWebSocket) => {
54616
55948
  coupleWebSocket(clientWebSocket, workerWebSocket);
54617
55949
  nodeWebSocket.emit("connection", clientWebSocket, request$2);
@@ -54619,6 +55951,29 @@ function handleWebSocket(httpServer, miniflare, entryWorkerName) {
54619
55951
  });
54620
55952
  }
54621
55953
  /**
55954
+ * Headers that must not be forwarded on the 101 upgrade response — they are
55955
+ * either part of the WebSocket handshake managed by `ws` or irrelevant on a
55956
+ * response with no body.
55957
+ */
55958
+ const EXCLUDED_RESPONSE_HEADERS = new Set([
55959
+ "connection",
55960
+ "content-length",
55961
+ "sec-websocket-accept",
55962
+ "sec-websocket-extensions",
55963
+ "sec-websocket-protocol",
55964
+ "transfer-encoding",
55965
+ "upgrade"
55966
+ ]);
55967
+ function appendWorkerResponseHeaders(responseHeaders, workerHeaders) {
55968
+ if (typeof workerHeaders.getSetCookie === "function") for (const cookie of workerHeaders.getSetCookie()) responseHeaders.push(`Set-Cookie: ${cookie}`);
55969
+ workerHeaders.forEach((value, name) => {
55970
+ const lower = name.toLowerCase();
55971
+ if (lower === "set-cookie") return;
55972
+ if (EXCLUDED_RESPONSE_HEADERS.has(lower)) return;
55973
+ responseHeaders.push(`${name}: ${value}`);
55974
+ });
55975
+ }
55976
+ /**
54622
55977
  * Matches the origin of a Sandbox SDK preview URL.
54623
55978
  * See: https://developers.cloudflare.com/sandbox/concepts/preview-urls/
54624
55979
  *
@@ -55353,8 +56708,8 @@ var is_in_ssh_default = isInSsh;
55353
56708
  //#endregion
55354
56709
  //#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
55355
56710
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
55356
- const __dirname = import.meta.url ? path3.dirname(fileURLToPath(import.meta.url)) : "";
55357
- const localXdgOpenPath = path3.join(__dirname, "xdg-open");
56711
+ const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
56712
+ const localXdgOpenPath = path.join(__dirname, "xdg-open");
55358
56713
  const { platform, arch: arch$1 } = process$1;
55359
56714
  const tryEachApp = async (apps$1, opener) => {
55360
56715
  if (apps$1.length === 0) return;