gemi 0.4.16 → 0.4.18

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.
@@ -1,22 +1,12 @@
1
- import {createRequire} from "node:module";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getProtoOf = Object.getPrototypeOf;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __toESM = (mod, isNodeMode, target) => {
8
- target = mod != null ? __create(__getProtoOf(mod)) : {};
9
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
- for (let key of __getOwnPropNames(mod))
11
- if (!__hasOwnProp.call(to, key))
12
- __defProp(to, key, {
13
- get: () => mod[key],
14
- enumerable: true
15
- });
16
- return to;
17
- };
18
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
- var __require = createRequire(import.meta.url);
1
+ // @bun
2
+ import {
3
+ generateETag,
4
+ me
5
+ } from "../chunk-21e105fb2b3d36d7.js";
6
+ import {
7
+ __commonJS,
8
+ __toESM
9
+ } from "../chunk-970e033f764e29fc.js";
20
10
 
21
11
  // ../../node_modules/sharp/lib/is.js
22
12
  var require_is = __commonJS((exports, module) => {
@@ -99,254 +89,6 @@ var require_is = __commonJS((exports, module) => {
99
89
  };
100
90
  });
101
91
 
102
- // ../../node_modules/detect-libc/lib/process.js
103
- var require_process = __commonJS((exports, module) => {
104
- var isLinux = () => process.platform === "linux";
105
- var report = null;
106
- var getReport = () => {
107
- if (!report) {
108
- if (isLinux() && process.report) {
109
- const orig = process.report.excludeNetwork;
110
- process.report.excludeNetwork = true;
111
- report = process.report.getReport();
112
- process.report.excludeNetwork = orig;
113
- } else {
114
- report = {};
115
- }
116
- }
117
- return report;
118
- };
119
- module.exports = { isLinux, getReport };
120
- });
121
-
122
- // ../../node_modules/detect-libc/lib/filesystem.js
123
- var require_filesystem = __commonJS((exports, module) => {
124
- var fs5 = __require("fs");
125
- var LDD_PATH = "/usr/bin/ldd";
126
- var readFileSync = (path2) => fs5.readFileSync(path2, "utf-8");
127
- var readFile = (path2) => new Promise((resolve, reject) => {
128
- fs5.readFile(path2, "utf-8", (err, data) => {
129
- if (err) {
130
- reject(err);
131
- } else {
132
- resolve(data);
133
- }
134
- });
135
- });
136
- module.exports = {
137
- LDD_PATH,
138
- readFileSync,
139
- readFile
140
- };
141
- });
142
-
143
- // ../../node_modules/detect-libc/lib/detect-libc.js
144
- var require_detect_libc = __commonJS((exports, module) => {
145
- var childProcess2 = __require("child_process");
146
- var { isLinux, getReport } = require_process();
147
- var { LDD_PATH, readFile, readFileSync } = require_filesystem();
148
- var cachedFamilyFilesystem;
149
- var cachedVersionFilesystem;
150
- var command = "getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true";
151
- var commandOut = "";
152
- var safeCommand = () => {
153
- if (!commandOut) {
154
- return new Promise((resolve) => {
155
- childProcess2.exec(command, (err, out) => {
156
- commandOut = err ? " " : out;
157
- resolve(commandOut);
158
- });
159
- });
160
- }
161
- return commandOut;
162
- };
163
- var safeCommandSync = () => {
164
- if (!commandOut) {
165
- try {
166
- commandOut = childProcess2.execSync(command, { encoding: "utf8" });
167
- } catch (_err) {
168
- commandOut = " ";
169
- }
170
- }
171
- return commandOut;
172
- };
173
- var GLIBC = "glibc";
174
- var RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
175
- var MUSL = "musl";
176
- var isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
177
- var familyFromReport = () => {
178
- const report = getReport();
179
- if (report.header && report.header.glibcVersionRuntime) {
180
- return GLIBC;
181
- }
182
- if (Array.isArray(report.sharedObjects)) {
183
- if (report.sharedObjects.some(isFileMusl)) {
184
- return MUSL;
185
- }
186
- }
187
- return null;
188
- };
189
- var familyFromCommand = (out) => {
190
- const [getconf, ldd1] = out.split(/[\r\n]+/);
191
- if (getconf && getconf.includes(GLIBC)) {
192
- return GLIBC;
193
- }
194
- if (ldd1 && ldd1.includes(MUSL)) {
195
- return MUSL;
196
- }
197
- return null;
198
- };
199
- var getFamilyFromLddContent = (content) => {
200
- if (content.includes("musl")) {
201
- return MUSL;
202
- }
203
- if (content.includes("GNU C Library")) {
204
- return GLIBC;
205
- }
206
- return null;
207
- };
208
- var familyFromFilesystem = async () => {
209
- if (cachedFamilyFilesystem !== undefined) {
210
- return cachedFamilyFilesystem;
211
- }
212
- cachedFamilyFilesystem = null;
213
- try {
214
- const lddContent = await readFile(LDD_PATH);
215
- cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
216
- } catch (e) {
217
- }
218
- return cachedFamilyFilesystem;
219
- };
220
- var familyFromFilesystemSync = () => {
221
- if (cachedFamilyFilesystem !== undefined) {
222
- return cachedFamilyFilesystem;
223
- }
224
- cachedFamilyFilesystem = null;
225
- try {
226
- const lddContent = readFileSync(LDD_PATH);
227
- cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
228
- } catch (e) {
229
- }
230
- return cachedFamilyFilesystem;
231
- };
232
- var family = async () => {
233
- let family2 = null;
234
- if (isLinux()) {
235
- family2 = await familyFromFilesystem();
236
- if (!family2) {
237
- family2 = familyFromReport();
238
- }
239
- if (!family2) {
240
- const out = await safeCommand();
241
- family2 = familyFromCommand(out);
242
- }
243
- }
244
- return family2;
245
- };
246
- var familySync = () => {
247
- let family2 = null;
248
- if (isLinux()) {
249
- family2 = familyFromFilesystemSync();
250
- if (!family2) {
251
- family2 = familyFromReport();
252
- }
253
- if (!family2) {
254
- const out = safeCommandSync();
255
- family2 = familyFromCommand(out);
256
- }
257
- }
258
- return family2;
259
- };
260
- var isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;
261
- var isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
262
- var versionFromFilesystem = async () => {
263
- if (cachedVersionFilesystem !== undefined) {
264
- return cachedVersionFilesystem;
265
- }
266
- cachedVersionFilesystem = null;
267
- try {
268
- const lddContent = await readFile(LDD_PATH);
269
- const versionMatch = lddContent.match(RE_GLIBC_VERSION);
270
- if (versionMatch) {
271
- cachedVersionFilesystem = versionMatch[1];
272
- }
273
- } catch (e) {
274
- }
275
- return cachedVersionFilesystem;
276
- };
277
- var versionFromFilesystemSync = () => {
278
- if (cachedVersionFilesystem !== undefined) {
279
- return cachedVersionFilesystem;
280
- }
281
- cachedVersionFilesystem = null;
282
- try {
283
- const lddContent = readFileSync(LDD_PATH);
284
- const versionMatch = lddContent.match(RE_GLIBC_VERSION);
285
- if (versionMatch) {
286
- cachedVersionFilesystem = versionMatch[1];
287
- }
288
- } catch (e) {
289
- }
290
- return cachedVersionFilesystem;
291
- };
292
- var versionFromReport = () => {
293
- const report = getReport();
294
- if (report.header && report.header.glibcVersionRuntime) {
295
- return report.header.glibcVersionRuntime;
296
- }
297
- return null;
298
- };
299
- var versionSuffix = (s) => s.trim().split(/\s+/)[1];
300
- var versionFromCommand = (out) => {
301
- const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/);
302
- if (getconf && getconf.includes(GLIBC)) {
303
- return versionSuffix(getconf);
304
- }
305
- if (ldd1 && ldd2 && ldd1.includes(MUSL)) {
306
- return versionSuffix(ldd2);
307
- }
308
- return null;
309
- };
310
- var version = async () => {
311
- let version2 = null;
312
- if (isLinux()) {
313
- version2 = await versionFromFilesystem();
314
- if (!version2) {
315
- version2 = versionFromReport();
316
- }
317
- if (!version2) {
318
- const out = await safeCommand();
319
- version2 = versionFromCommand(out);
320
- }
321
- }
322
- return version2;
323
- };
324
- var versionSync = () => {
325
- let version2 = null;
326
- if (isLinux()) {
327
- version2 = versionFromFilesystemSync();
328
- if (!version2) {
329
- version2 = versionFromReport();
330
- }
331
- if (!version2) {
332
- const out = safeCommandSync();
333
- version2 = versionFromCommand(out);
334
- }
335
- }
336
- return version2;
337
- };
338
- module.exports = {
339
- GLIBC,
340
- MUSL,
341
- family,
342
- familySync,
343
- isNonGlibcLinux,
344
- isNonGlibcLinuxSync,
345
- version,
346
- versionSync
347
- };
348
- });
349
-
350
92
  // ../../node_modules/sharp/node_modules/semver/internal/debug.js
351
93
  var require_debug = __commonJS((exports, module) => {
352
94
  var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
@@ -1634,12 +1376,12 @@ var require_package = __commonJS((exports, module) => {
1634
1376
 
1635
1377
  // ../../node_modules/sharp/lib/libvips.js
1636
1378
  var require_libvips = __commonJS((exports, module) => {
1637
- var { spawnSync } = __require("node:child_process");
1638
- var { createHash } = __require("node:crypto");
1379
+ var { spawnSync } = import.meta.require("child_process");
1380
+ var { createHash } = import.meta.require("crypto");
1639
1381
  var semverCoerce = require_coerce();
1640
1382
  var semverGreaterThanOrEqualTo = require_gte();
1641
1383
  var semverSatisfies = require_satisfies();
1642
- var detectLibc = require_detect_libc();
1384
+ var detectLibc = import.meta.require("detect-libc");
1643
1385
  var { engines, optionalDependencies } = require_package();
1644
1386
  var minimumLibvipsVersionLabelled = process.env.npm_package_config_libvips || engines.libvips;
1645
1387
  var minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version;
@@ -1678,7 +1420,7 @@ var require_libvips = __commonJS((exports, module) => {
1678
1420
  };
1679
1421
  var buildSharpLibvipsIncludeDir = () => {
1680
1422
  try {
1681
- return __require(`@img/sharp-libvips-dev-${buildPlatformArch()}/include`);
1423
+ return import.meta.require(`@img/sharp-libvips-dev-${buildPlatformArch()}/include`);
1682
1424
  } catch {
1683
1425
  try {
1684
1426
  return (()=>{throw new Error(`Cannot require module "@img/sharp-libvips-dev/include"`);})();
@@ -1696,10 +1438,10 @@ var require_libvips = __commonJS((exports, module) => {
1696
1438
  };
1697
1439
  var buildSharpLibvipsLibDir = () => {
1698
1440
  try {
1699
- return __require(`@img/sharp-libvips-dev-${buildPlatformArch()}/lib`);
1441
+ return import.meta.require(`@img/sharp-libvips-dev-${buildPlatformArch()}/lib`);
1700
1442
  } catch {
1701
1443
  try {
1702
- return __require(`@img/sharp-libvips-${buildPlatformArch()}/lib`);
1444
+ return import.meta.require(`@img/sharp-libvips-${buildPlatformArch()}/lib`);
1703
1445
  } catch {
1704
1446
  }
1705
1447
  }
@@ -1803,7 +1545,7 @@ var require_libvips = __commonJS((exports, module) => {
1803
1545
 
1804
1546
  // ../../node_modules/sharp/lib/sharp.js
1805
1547
  var require_sharp = __commonJS((exports, module) => {
1806
- var { familySync, versionSync } = require_detect_libc();
1548
+ var { familySync, versionSync } = import.meta.require("detect-libc");
1807
1549
  var { runtimePlatformArch, isUnsupportedNodeRuntime, prebuiltPlatforms, minimumLibvipsVersion } = require_libvips();
1808
1550
  var runtimePlatform = runtimePlatformArch();
1809
1551
  var paths = [
@@ -1816,7 +1558,7 @@ var require_sharp = __commonJS((exports, module) => {
1816
1558
  var errors = [];
1817
1559
  for (const path2 of paths) {
1818
1560
  try {
1819
- sharp = __require(path2);
1561
+ sharp = import.meta.require(path2);
1820
1562
  break;
1821
1563
  } catch (err) {
1822
1564
  errors.push(err);
@@ -1846,7 +1588,7 @@ var require_sharp = __commonJS((exports, module) => {
1846
1588
  }
1847
1589
  if (isLinux && /(symbol not found|CXXABI_)/i.test(messages)) {
1848
1590
  try {
1849
- const { engines } = __require(`@img/sharp-libvips-${runtimePlatform}/package`);
1591
+ const { engines } = import.meta.require(`@img/sharp-libvips-${runtimePlatform}/package`);
1850
1592
  const libcFound = `${familySync()} ${versionSync()}`;
1851
1593
  const libcRequires = `${engines.musl ? "musl" : "glibc"} ${engines.musl || engines.glibc}`;
1852
1594
  help.push("- Update your OS:", ` Found ${libcFound}`, ` Requires ${libcRequires}`);
@@ -1887,8 +1629,8 @@ var require_constructor = __commonJS((exports, module) => {
1887
1629
  }
1888
1630
  return clone2;
1889
1631
  };
1890
- var util = __require("node:util");
1891
- var stream = __require("node:stream");
1632
+ var util = import.meta.require("util");
1633
+ var stream = import.meta.require("stream");
1892
1634
  var is = require_is();
1893
1635
  require_sharp();
1894
1636
  var debuglog = util.debuglog("sharp");
@@ -5776,7 +5518,7 @@ var require_output = __commonJS((exports, module) => {
5776
5518
  }
5777
5519
  }
5778
5520
  };
5779
- var path2 = __require("node:path");
5521
+ var path2 = import.meta.require("path");
5780
5522
  var is = require_is();
5781
5523
  var sharp = require_sharp();
5782
5524
  var formats = new Map([
@@ -5881,8 +5623,8 @@ var require_utility = __commonJS((exports, module) => {
5881
5623
  throw is.invalidParameterError("options", "object", options);
5882
5624
  }
5883
5625
  };
5884
- var events = __require("node:events");
5885
- var detectLibc = require_detect_libc();
5626
+ var events = import.meta.require("events");
5627
+ var detectLibc = import.meta.require("detect-libc");
5886
5628
  var is = require_is();
5887
5629
  var { runtimePlatformArch } = require_libvips();
5888
5630
  var sharp = require_sharp();
@@ -5907,10 +5649,10 @@ var require_utility = __commonJS((exports, module) => {
5907
5649
  if (!libvipsVersion.isGlobal) {
5908
5650
  if (!libvipsVersion.isWasm) {
5909
5651
  try {
5910
- versions = __require(`@img/sharp-${runtimePlatform}/versions`);
5652
+ versions = import.meta.require(`@img/sharp-${runtimePlatform}/versions`);
5911
5653
  } catch (_) {
5912
5654
  try {
5913
- versions = __require(`@img/sharp-libvips-${runtimePlatform}/versions`);
5655
+ versions = import.meta.require(`@img/sharp-libvips-${runtimePlatform}/versions`);
5914
5656
  } catch (_2) {
5915
5657
  }
5916
5658
  }
@@ -5926,7 +5668,7 @@ var require_utility = __commonJS((exports, module) => {
5926
5668
  if (detectLibc.familySync() === detectLibc.GLIBC && !sharp._isUsingJemalloc()) {
5927
5669
  sharp.concurrency(1);
5928
5670
  } else if (detectLibc.familySync() === detectLibc.MUSL && sharp.concurrency() === 1024) {
5929
- sharp.concurrency(__require("node:os").availableParallelism());
5671
+ sharp.concurrency(import.meta.require("os").availableParallelism());
5930
5672
  }
5931
5673
  var queue = new events.EventEmitter;
5932
5674
  module.exports = function(Sharp) {
@@ -5961,23 +5703,23 @@ var require_lib = __commonJS((exports, module) => {
5961
5703
  import path2 from "path";
5962
5704
 
5963
5705
  // ../../node_modules/open/index.js
5964
- import process6 from "node:process";
5965
- import {Buffer as Buffer2} from "node:buffer";
5966
- import path from "node:path";
5967
- import {fileURLToPath} from "node:url";
5968
- import childProcess from "node:child_process";
5969
- import fs4, {constants as fsConstants} from "node:fs/promises";
5706
+ import process6 from "process";
5707
+ import {Buffer as Buffer2} from "buffer";
5708
+ import path from "path";
5709
+ import {fileURLToPath} from "url";
5710
+ import childProcess from "child_process";
5711
+ import fs4, {constants as fsConstants} from "fs/promises";
5970
5712
 
5971
5713
  // ../../node_modules/is-wsl/index.js
5972
- import process2 from "node:process";
5973
- import os from "node:os";
5974
- import fs3 from "node:fs";
5714
+ import process2 from "process";
5715
+ import os from "os";
5716
+ import fs3 from "fs";
5975
5717
 
5976
5718
  // ../../node_modules/is-inside-container/index.js
5977
- import fs2 from "node:fs";
5719
+ import fs2 from "fs";
5978
5720
 
5979
5721
  // ../../node_modules/is-docker/index.js
5980
- import fs from "node:fs";
5722
+ import fs from "fs";
5981
5723
  var hasDockerEnv = function() {
5982
5724
  try {
5983
5725
  fs.statSync("/.dockerenv");
@@ -6056,14 +5798,14 @@ function defineLazyProperty(object, propertyName, valueGetter) {
6056
5798
  }
6057
5799
 
6058
5800
  // ../../node_modules/default-browser/index.js
6059
- import {promisify as promisify4} from "node:util";
6060
- import process5 from "node:process";
6061
- import {execFile as execFile4} from "node:child_process";
5801
+ import {promisify as promisify4} from "util";
5802
+ import process5 from "process";
5803
+ import {execFile as execFile4} from "child_process";
6062
5804
 
6063
5805
  // ../../node_modules/default-browser-id/index.js
6064
- import {promisify} from "node:util";
6065
- import process3 from "node:process";
6066
- import {execFile} from "node:child_process";
5806
+ import {promisify} from "util";
5807
+ import process3 from "process";
5808
+ import {execFile} from "child_process";
6067
5809
  var execFileAsync = promisify(execFile);
6068
5810
  async function defaultBrowserId() {
6069
5811
  if (process3.platform !== "darwin") {
@@ -6075,9 +5817,9 @@ async function defaultBrowserId() {
6075
5817
  }
6076
5818
 
6077
5819
  // ../../node_modules/run-applescript/index.js
6078
- import process4 from "node:process";
6079
- import {promisify as promisify2} from "node:util";
6080
- import {execFile as execFile2, execFileSync} from "node:child_process";
5820
+ import process4 from "process";
5821
+ import {promisify as promisify2} from "util";
5822
+ import {execFile as execFile2, execFileSync} from "child_process";
6081
5823
  async function runAppleScript(script, { humanReadableOutput = true } = {}) {
6082
5824
  if (process4.platform !== "darwin") {
6083
5825
  throw new Error("macOS only");
@@ -6094,8 +5836,8 @@ async function bundleName(bundleId) {
6094
5836
  }
6095
5837
 
6096
5838
  // ../../node_modules/default-browser/windows.js
6097
- import {promisify as promisify3} from "node:util";
6098
- import {execFile as execFile3} from "node:child_process";
5839
+ import {promisify as promisify3} from "util";
5840
+ import {execFile as execFile3} from "child_process";
6099
5841
  var execFileAsync3 = promisify3(execFile3);
6100
5842
  var windowsBrowserProgIds = {
6101
5843
  AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
@@ -6608,806 +6350,6 @@ var rootDir = process.cwd();
6608
6350
  var appDir = path2.join(rootDir, "app");
6609
6351
  // server/prod.ts
6610
6352
  import {join} from "path";
6611
-
6612
- // server/generateEtag.ts
6613
- function generateETag(lastModified) {
6614
- const lastModifiedStr = lastModified.toString();
6615
- const hasher = new Bun.CryptoHasher("sha1");
6616
- hasher.update(lastModifiedStr);
6617
- const hash = hasher.digest("hex");
6618
- return hash;
6619
- }
6620
-
6621
- // ../../node_modules/urlpattern-polyfill/dist/urlpattern.js
6622
- var Re = function(e, t) {
6623
- return (t ? /^[\x00-\xFF]*$/ : /^[\x00-\x7F]*$/).test(e);
6624
- };
6625
- var v = function(e, t = false) {
6626
- let r = [], n = 0;
6627
- for (;n < e.length; ) {
6628
- let o = e[n], c = function(l) {
6629
- if (!t)
6630
- throw new TypeError(l);
6631
- r.push({ type: "INVALID_CHAR", index: n, value: e[n++] });
6632
- };
6633
- if (o === "*") {
6634
- r.push({ type: "ASTERISK", index: n, value: e[n++] });
6635
- continue;
6636
- }
6637
- if (o === "+" || o === "?") {
6638
- r.push({ type: "OTHER_MODIFIER", index: n, value: e[n++] });
6639
- continue;
6640
- }
6641
- if (o === "\\") {
6642
- r.push({ type: "ESCAPED_CHAR", index: n++, value: e[n++] });
6643
- continue;
6644
- }
6645
- if (o === "{") {
6646
- r.push({ type: "OPEN", index: n, value: e[n++] });
6647
- continue;
6648
- }
6649
- if (o === "}") {
6650
- r.push({ type: "CLOSE", index: n, value: e[n++] });
6651
- continue;
6652
- }
6653
- if (o === ":") {
6654
- let l = "", s = n + 1;
6655
- for (;s < e.length; ) {
6656
- let i = e.substr(s, 1);
6657
- if (s === n + 1 && be.test(i) || s !== n + 1 && Pe.test(i)) {
6658
- l += e[s++];
6659
- continue;
6660
- }
6661
- break;
6662
- }
6663
- if (!l) {
6664
- c(`Missing parameter name at ${n}`);
6665
- continue;
6666
- }
6667
- r.push({ type: "NAME", index: n, value: l }), n = s;
6668
- continue;
6669
- }
6670
- if (o === "(") {
6671
- let l = 1, s = "", i = n + 1, a = false;
6672
- if (e[i] === "?") {
6673
- c(`Pattern cannot start with "?" at ${i}`);
6674
- continue;
6675
- }
6676
- for (;i < e.length; ) {
6677
- if (!Re(e[i], false)) {
6678
- c(`Invalid character '${e[i]}' at ${i}.`), a = true;
6679
- break;
6680
- }
6681
- if (e[i] === "\\") {
6682
- s += e[i++] + e[i++];
6683
- continue;
6684
- }
6685
- if (e[i] === ")") {
6686
- if (l--, l === 0) {
6687
- i++;
6688
- break;
6689
- }
6690
- } else if (e[i] === "(" && (l++, e[i + 1] !== "?")) {
6691
- c(`Capturing groups are not allowed at ${i}`), a = true;
6692
- break;
6693
- }
6694
- s += e[i++];
6695
- }
6696
- if (a)
6697
- continue;
6698
- if (l) {
6699
- c(`Unbalanced pattern at ${n}`);
6700
- continue;
6701
- }
6702
- if (!s) {
6703
- c(`Missing pattern at ${n}`);
6704
- continue;
6705
- }
6706
- r.push({ type: "REGEX", index: n, value: s }), n = i;
6707
- continue;
6708
- }
6709
- r.push({ type: "CHAR", index: n, value: e[n++] });
6710
- }
6711
- return r.push({ type: "END", index: n, value: "" }), r;
6712
- };
6713
- var D = function(e, t = {}) {
6714
- let r = v(e);
6715
- t.delimiter ??= "/#?", t.prefixes ??= "./";
6716
- let n = `[^${S(t.delimiter)}]+?`, o = [], c = 0, l = 0, s = "", i = new Set, a = (h) => {
6717
- if (l < r.length && r[l].type === h)
6718
- return r[l++].value;
6719
- }, f = () => a("OTHER_MODIFIER") ?? a("ASTERISK"), d = (h) => {
6720
- let u = a(h);
6721
- if (u !== undefined)
6722
- return u;
6723
- let { type: p, index: A } = r[l];
6724
- throw new TypeError(`Unexpected ${p} at ${A}, expected ${h}`);
6725
- }, T = () => {
6726
- let h = "", u;
6727
- for (;u = a("CHAR") ?? a("ESCAPED_CHAR"); )
6728
- h += u;
6729
- return h;
6730
- }, Se = (h) => h, L = t.encodePart || Se, I = "", U = (h) => {
6731
- I += h;
6732
- }, $ = () => {
6733
- I.length && (o.push(new R(3, "", "", L(I), "", 3)), I = "");
6734
- }, V = (h, u, p, A, Y) => {
6735
- let g = 3;
6736
- switch (Y) {
6737
- case "?":
6738
- g = 1;
6739
- break;
6740
- case "*":
6741
- g = 0;
6742
- break;
6743
- case "+":
6744
- g = 2;
6745
- break;
6746
- }
6747
- if (!u && !p && g === 3) {
6748
- U(h);
6749
- return;
6750
- }
6751
- if ($(), !u && !p) {
6752
- if (!h)
6753
- return;
6754
- o.push(new R(3, "", "", L(h), "", g));
6755
- return;
6756
- }
6757
- let m;
6758
- p ? p === "*" ? m = M : m = p : m = n;
6759
- let O = 2;
6760
- m === n ? (O = 1, m = "") : m === M && (O = 0, m = "");
6761
- let P;
6762
- if (u ? P = u : p && (P = c++), i.has(P))
6763
- throw new TypeError(`Duplicate name '${P}'.`);
6764
- i.add(P), o.push(new R(O, P, L(h), m, L(A), g));
6765
- };
6766
- for (;l < r.length; ) {
6767
- let h = a("CHAR"), u = a("NAME"), p = a("REGEX");
6768
- if (!u && !p && (p = a("ASTERISK")), u || p) {
6769
- let g = h ?? "";
6770
- t.prefixes.indexOf(g) === -1 && (U(g), g = ""), $();
6771
- let m = f();
6772
- V(g, u, p, "", m);
6773
- continue;
6774
- }
6775
- let A = h ?? a("ESCAPED_CHAR");
6776
- if (A) {
6777
- U(A);
6778
- continue;
6779
- }
6780
- if (a("OPEN")) {
6781
- let g = T(), m = a("NAME"), O = a("REGEX");
6782
- !m && !O && (O = a("ASTERISK"));
6783
- let P = T();
6784
- d("CLOSE");
6785
- let xe = f();
6786
- V(g, m, O, P, xe);
6787
- continue;
6788
- }
6789
- $(), d("END");
6790
- }
6791
- return o;
6792
- };
6793
- var S = function(e) {
6794
- return e.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
6795
- };
6796
- var X = function(e) {
6797
- return e && e.ignoreCase ? "ui" : "u";
6798
- };
6799
- var Z = function(e, t, r) {
6800
- return F(D(e, r), t, r);
6801
- };
6802
- var k = function(e) {
6803
- switch (e) {
6804
- case 0:
6805
- return "*";
6806
- case 1:
6807
- return "?";
6808
- case 2:
6809
- return "+";
6810
- case 3:
6811
- return "";
6812
- }
6813
- };
6814
- var F = function(e, t, r = {}) {
6815
- r.delimiter ??= "/#?", r.prefixes ??= "./", r.sensitive ??= false, r.strict ??= false, r.end ??= true, r.start ??= true, r.endsWith = "";
6816
- let n = r.start ? "^" : "";
6817
- for (let s of e) {
6818
- if (s.type === 3) {
6819
- s.modifier === 3 ? n += S(s.value) : n += `(?:${S(s.value)})${k(s.modifier)}`;
6820
- continue;
6821
- }
6822
- t && t.push(s.name);
6823
- let i = `[^${S(r.delimiter)}]+?`, a = s.value;
6824
- if (s.type === 1 ? a = i : s.type === 0 && (a = M), !s.prefix.length && !s.suffix.length) {
6825
- s.modifier === 3 || s.modifier === 1 ? n += `(${a})${k(s.modifier)}` : n += `((?:${a})${k(s.modifier)})`;
6826
- continue;
6827
- }
6828
- if (s.modifier === 3 || s.modifier === 1) {
6829
- n += `(?:${S(s.prefix)}(${a})${S(s.suffix)})`, n += k(s.modifier);
6830
- continue;
6831
- }
6832
- n += `(?:${S(s.prefix)}`, n += `((?:${a})(?:`, n += S(s.suffix), n += S(s.prefix), n += `(?:${a}))*)${S(s.suffix)})`, s.modifier === 0 && (n += "?");
6833
- }
6834
- let o = `[${S(r.endsWith)}]|\$`, c = `[${S(r.delimiter)}]`;
6835
- if (r.end)
6836
- return r.strict || (n += `${c}?`), r.endsWith.length ? n += `(?=${o})` : n += "$", new RegExp(n, X(r));
6837
- r.strict || (n += `(?:${c}(?=${o}))?`);
6838
- let l = false;
6839
- if (e.length) {
6840
- let s = e[e.length - 1];
6841
- s.type === 3 && s.modifier === 3 && (l = r.delimiter.indexOf(s) > -1);
6842
- }
6843
- return l || (n += `(?=${c}|${o})`), new RegExp(n, X(r));
6844
- };
6845
- var J = function(e, t) {
6846
- return e.length ? e[0] === "/" ? true : !t || e.length < 2 ? false : (e[0] == "\\" || e[0] == "{") && e[1] == "/" : false;
6847
- };
6848
- var Q = function(e, t) {
6849
- return e.startsWith(t) ? e.substring(t.length, e.length) : e;
6850
- };
6851
- var Ee = function(e, t) {
6852
- return e.endsWith(t) ? e.substr(0, e.length - t.length) : e;
6853
- };
6854
- var W = function(e) {
6855
- return !e || e.length < 2 ? false : e[0] === "[" || (e[0] === "\\" || e[0] === "{") && e[1] === "[";
6856
- };
6857
- var N = function(e) {
6858
- if (!e)
6859
- return true;
6860
- for (let t of ee)
6861
- if (e.test(t))
6862
- return true;
6863
- return false;
6864
- };
6865
- var te = function(e, t) {
6866
- if (e = Q(e, "#"), t || e === "")
6867
- return e;
6868
- let r = new URL("https://example.com");
6869
- return r.hash = e, r.hash ? r.hash.substring(1, r.hash.length) : "";
6870
- };
6871
- var re = function(e, t) {
6872
- if (e = Q(e, "?"), t || e === "")
6873
- return e;
6874
- let r = new URL("https://example.com");
6875
- return r.search = e, r.search ? r.search.substring(1, r.search.length) : "";
6876
- };
6877
- var ne = function(e, t) {
6878
- return t || e === "" ? e : W(e) ? j(e) : z(e);
6879
- };
6880
- var se = function(e, t) {
6881
- if (t || e === "")
6882
- return e;
6883
- let r = new URL("https://example.com");
6884
- return r.password = e, r.password;
6885
- };
6886
- var ie = function(e, t) {
6887
- if (t || e === "")
6888
- return e;
6889
- let r = new URL("https://example.com");
6890
- return r.username = e, r.username;
6891
- };
6892
- var ae = function(e, t, r) {
6893
- if (r || e === "")
6894
- return e;
6895
- if (t && !ee.includes(t))
6896
- return new URL(`${t}:${e}`).pathname;
6897
- let n = e[0] == "/";
6898
- return e = new URL(n ? e : "/-" + e, "https://example.com").pathname, n || (e = e.substring(2, e.length)), e;
6899
- };
6900
- var oe = function(e, t, r) {
6901
- return _(t) === e && (e = ""), r || e === "" ? e : K(e);
6902
- };
6903
- var ce = function(e, t) {
6904
- return e = Ee(e, ":"), t || e === "" ? e : y(e);
6905
- };
6906
- var _ = function(e) {
6907
- switch (e) {
6908
- case "ws":
6909
- case "http":
6910
- return "80";
6911
- case "wws":
6912
- case "https":
6913
- return "443";
6914
- case "ftp":
6915
- return "21";
6916
- default:
6917
- return "";
6918
- }
6919
- };
6920
- var y = function(e) {
6921
- if (e === "")
6922
- return e;
6923
- if (/^[-+.A-Za-z0-9]*$/.test(e))
6924
- return e.toLowerCase();
6925
- throw new TypeError(`Invalid protocol '${e}'.`);
6926
- };
6927
- var le = function(e) {
6928
- if (e === "")
6929
- return e;
6930
- let t = new URL("https://example.com");
6931
- return t.username = e, t.username;
6932
- };
6933
- var fe = function(e) {
6934
- if (e === "")
6935
- return e;
6936
- let t = new URL("https://example.com");
6937
- return t.password = e, t.password;
6938
- };
6939
- var z = function(e) {
6940
- if (e === "")
6941
- return e;
6942
- if (/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))
6943
- throw new TypeError(`Invalid hostname '${e}'`);
6944
- let t = new URL("https://example.com");
6945
- return t.hostname = e, t.hostname;
6946
- };
6947
- var j = function(e) {
6948
- if (e === "")
6949
- return e;
6950
- if (/[^0-9a-fA-F[\]:]/g.test(e))
6951
- throw new TypeError(`Invalid IPv6 hostname '${e}'`);
6952
- return e.toLowerCase();
6953
- };
6954
- var K = function(e) {
6955
- if (e === "" || /^[0-9]*$/.test(e) && parseInt(e) <= 65535)
6956
- return e;
6957
- throw new TypeError(`Invalid port '${e}'.`);
6958
- };
6959
- var he = function(e) {
6960
- if (e === "")
6961
- return e;
6962
- let t = new URL("https://example.com");
6963
- return t.pathname = e[0] !== "/" ? "/-" + e : e, e[0] !== "/" ? t.pathname.substring(2, t.pathname.length) : t.pathname;
6964
- };
6965
- var ue = function(e) {
6966
- return e === "" ? e : new URL(`data:${e}`).pathname;
6967
- };
6968
- var de = function(e) {
6969
- if (e === "")
6970
- return e;
6971
- let t = new URL("https://example.com");
6972
- return t.search = e, t.search.substring(1, t.search.length);
6973
- };
6974
- var pe = function(e) {
6975
- if (e === "")
6976
- return e;
6977
- let t = new URL("https://example.com");
6978
- return t.hash = e, t.hash.substring(1, t.hash.length);
6979
- };
6980
- var ge = function(e, t) {
6981
- if (typeof e != "string")
6982
- throw new TypeError("parameter 1 is not of type 'string'.");
6983
- let r = new URL(e, t);
6984
- return { protocol: r.protocol.substring(0, r.protocol.length - 1), username: r.username, password: r.password, hostname: r.hostname, port: r.port, pathname: r.pathname, search: r.search !== "" ? r.search.substring(1, r.search.length) : undefined, hash: r.hash !== "" ? r.hash.substring(1, r.hash.length) : undefined };
6985
- };
6986
- var b = function(e, t) {
6987
- return t ? C(e) : e;
6988
- };
6989
- var w = function(e, t, r) {
6990
- let n;
6991
- if (typeof t.baseURL == "string")
6992
- try {
6993
- n = new URL(t.baseURL), t.protocol === undefined && (e.protocol = b(n.protocol.substring(0, n.protocol.length - 1), r)), !r && t.protocol === undefined && t.hostname === undefined && t.port === undefined && t.username === undefined && (e.username = b(n.username, r)), !r && t.protocol === undefined && t.hostname === undefined && t.port === undefined && t.username === undefined && t.password === undefined && (e.password = b(n.password, r)), t.protocol === undefined && t.hostname === undefined && (e.hostname = b(n.hostname, r)), t.protocol === undefined && t.hostname === undefined && t.port === undefined && (e.port = b(n.port, r)), t.protocol === undefined && t.hostname === undefined && t.port === undefined && t.pathname === undefined && (e.pathname = b(n.pathname, r)), t.protocol === undefined && t.hostname === undefined && t.port === undefined && t.pathname === undefined && t.search === undefined && (e.search = b(n.search.substring(1, n.search.length), r)), t.protocol === undefined && t.hostname === undefined && t.port === undefined && t.pathname === undefined && t.search === undefined && t.hash === undefined && (e.hash = b(n.hash.substring(1, n.hash.length), r));
6994
- } catch {
6995
- throw new TypeError(`invalid baseURL '${t.baseURL}'.`);
6996
- }
6997
- if (typeof t.protocol == "string" && (e.protocol = ce(t.protocol, r)), typeof t.username == "string" && (e.username = ie(t.username, r)), typeof t.password == "string" && (e.password = se(t.password, r)), typeof t.hostname == "string" && (e.hostname = ne(t.hostname, r)), typeof t.port == "string" && (e.port = oe(t.port, e.protocol, r)), typeof t.pathname == "string") {
6998
- if (e.pathname = t.pathname, n && !J(e.pathname, r)) {
6999
- let o = n.pathname.lastIndexOf("/");
7000
- o >= 0 && (e.pathname = b(n.pathname.substring(0, o + 1), r) + e.pathname);
7001
- }
7002
- e.pathname = ae(e.pathname, e.protocol, r);
7003
- }
7004
- return typeof t.search == "string" && (e.search = re(t.search, r)), typeof t.hash == "string" && (e.hash = te(t.hash, r)), e;
7005
- };
7006
- var C = function(e) {
7007
- return e.replace(/([+*?:{}()\\])/g, "\\$1");
7008
- };
7009
- var Oe = function(e) {
7010
- return e.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
7011
- };
7012
- var ke = function(e, t) {
7013
- t.delimiter ??= "/#?", t.prefixes ??= "./", t.sensitive ??= false, t.strict ??= false, t.end ??= true, t.start ??= true, t.endsWith = "";
7014
- let r = ".*", n = `[^${Oe(t.delimiter)}]+?`, o = /[$_\u200C\u200D\p{ID_Continue}]/u, c = "";
7015
- for (let l = 0;l < e.length; ++l) {
7016
- let s = e[l];
7017
- if (s.type === 3) {
7018
- if (s.modifier === 3) {
7019
- c += C(s.value);
7020
- continue;
7021
- }
7022
- c += `{${C(s.value)}}${k(s.modifier)}`;
7023
- continue;
7024
- }
7025
- let i = s.hasCustomName(), a = !!s.suffix.length || !!s.prefix.length && (s.prefix.length !== 1 || !t.prefixes.includes(s.prefix)), f = l > 0 ? e[l - 1] : null, d = l < e.length - 1 ? e[l + 1] : null;
7026
- if (!a && i && s.type === 1 && s.modifier === 3 && d && !d.prefix.length && !d.suffix.length)
7027
- if (d.type === 3) {
7028
- let T = d.value.length > 0 ? d.value[0] : "";
7029
- a = o.test(T);
7030
- } else
7031
- a = !d.hasCustomName();
7032
- if (!a && !s.prefix.length && f && f.type === 3) {
7033
- let T = f.value[f.value.length - 1];
7034
- a = t.prefixes.includes(T);
7035
- }
7036
- a && (c += "{"), c += C(s.prefix), i && (c += `:${s.name}`), s.type === 2 ? c += `(${s.value})` : s.type === 1 ? i || (c += `(${n})`) : s.type === 0 && (!i && (!f || f.type === 3 || f.modifier !== 3 || a || s.prefix !== "") ? c += "*" : c += `(${r})`), s.type === 1 && i && s.suffix.length && o.test(s.suffix[0]) && (c += "\\"), c += C(s.suffix), a && (c += "}"), s.modifier !== 3 && (c += k(s.modifier));
7037
- }
7038
- return c;
7039
- };
7040
- var R = class {
7041
- type = 3;
7042
- name = "";
7043
- prefix = "";
7044
- value = "";
7045
- suffix = "";
7046
- modifier = 3;
7047
- constructor(t, r, n, o, c, l) {
7048
- this.type = t, this.name = r, this.prefix = n, this.value = o, this.suffix = c, this.modifier = l;
7049
- }
7050
- hasCustomName() {
7051
- return this.name !== "" && typeof this.name != "number";
7052
- }
7053
- };
7054
- var be = /[$_\p{ID_Start}]/u;
7055
- var Pe = /[$_\u200C\u200D\p{ID_Continue}]/u;
7056
- var M = ".*";
7057
- var x = { delimiter: "", prefixes: "", sensitive: true, strict: true };
7058
- var B = { delimiter: ".", prefixes: "", sensitive: true, strict: true };
7059
- var q = { delimiter: "/", prefixes: "/", sensitive: true, strict: true };
7060
- var ee = ["ftp", "file", "http", "https", "ws", "wss"];
7061
- var H = class {
7062
- #i;
7063
- #n = [];
7064
- #t = {};
7065
- #e = 0;
7066
- #s = 1;
7067
- #l = 0;
7068
- #o = 0;
7069
- #d = 0;
7070
- #p = 0;
7071
- #g = false;
7072
- constructor(t) {
7073
- this.#i = t;
7074
- }
7075
- get result() {
7076
- return this.#t;
7077
- }
7078
- parse() {
7079
- for (this.#n = v(this.#i, true);this.#e < this.#n.length; this.#e += this.#s) {
7080
- if (this.#s = 1, this.#n[this.#e].type === "END") {
7081
- if (this.#o === 0) {
7082
- this.#b(), this.#f() ? this.#r(9, 1) : this.#h() ? this.#r(8, 1) : this.#r(7, 0);
7083
- continue;
7084
- } else if (this.#o === 2) {
7085
- this.#u(5);
7086
- continue;
7087
- }
7088
- this.#r(10, 0);
7089
- break;
7090
- }
7091
- if (this.#d > 0)
7092
- if (this.#A())
7093
- this.#d -= 1;
7094
- else
7095
- continue;
7096
- if (this.#T()) {
7097
- this.#d += 1;
7098
- continue;
7099
- }
7100
- switch (this.#o) {
7101
- case 0:
7102
- this.#P() && this.#u(1);
7103
- break;
7104
- case 1:
7105
- if (this.#P()) {
7106
- this.#C();
7107
- let t = 7, r = 1;
7108
- this.#E() ? (t = 2, r = 3) : this.#g && (t = 2), this.#r(t, r);
7109
- }
7110
- break;
7111
- case 2:
7112
- this.#S() ? this.#u(3) : (this.#x() || this.#h() || this.#f()) && this.#u(5);
7113
- break;
7114
- case 3:
7115
- this.#O() ? this.#r(4, 1) : this.#S() && this.#r(5, 1);
7116
- break;
7117
- case 4:
7118
- this.#S() && this.#r(5, 1);
7119
- break;
7120
- case 5:
7121
- this.#y() ? this.#p += 1 : this.#w() && (this.#p -= 1), this.#k() && !this.#p ? this.#r(6, 1) : this.#x() ? this.#r(7, 0) : this.#h() ? this.#r(8, 1) : this.#f() && this.#r(9, 1);
7122
- break;
7123
- case 6:
7124
- this.#x() ? this.#r(7, 0) : this.#h() ? this.#r(8, 1) : this.#f() && this.#r(9, 1);
7125
- break;
7126
- case 7:
7127
- this.#h() ? this.#r(8, 1) : this.#f() && this.#r(9, 1);
7128
- break;
7129
- case 8:
7130
- this.#f() && this.#r(9, 1);
7131
- break;
7132
- case 9:
7133
- break;
7134
- case 10:
7135
- break;
7136
- }
7137
- }
7138
- this.#t.hostname !== undefined && this.#t.port === undefined && (this.#t.port = "");
7139
- }
7140
- #r(t, r) {
7141
- switch (this.#o) {
7142
- case 0:
7143
- break;
7144
- case 1:
7145
- this.#t.protocol = this.#c();
7146
- break;
7147
- case 2:
7148
- break;
7149
- case 3:
7150
- this.#t.username = this.#c();
7151
- break;
7152
- case 4:
7153
- this.#t.password = this.#c();
7154
- break;
7155
- case 5:
7156
- this.#t.hostname = this.#c();
7157
- break;
7158
- case 6:
7159
- this.#t.port = this.#c();
7160
- break;
7161
- case 7:
7162
- this.#t.pathname = this.#c();
7163
- break;
7164
- case 8:
7165
- this.#t.search = this.#c();
7166
- break;
7167
- case 9:
7168
- this.#t.hash = this.#c();
7169
- break;
7170
- case 10:
7171
- break;
7172
- }
7173
- this.#o !== 0 && t !== 10 && ([1, 2, 3, 4].includes(this.#o) && [6, 7, 8, 9].includes(t) && (this.#t.hostname ??= ""), [1, 2, 3, 4, 5, 6].includes(this.#o) && [8, 9].includes(t) && (this.#t.pathname ??= this.#g ? "/" : ""), [1, 2, 3, 4, 5, 6, 7].includes(this.#o) && t === 9 && (this.#t.search ??= "")), this.#R(t, r);
7174
- }
7175
- #R(t, r) {
7176
- this.#o = t, this.#l = this.#e + r, this.#e += r, this.#s = 0;
7177
- }
7178
- #b() {
7179
- this.#e = this.#l, this.#s = 0;
7180
- }
7181
- #u(t) {
7182
- this.#b(), this.#o = t;
7183
- }
7184
- #m(t) {
7185
- return t < 0 && (t = this.#n.length - t), t < this.#n.length ? this.#n[t] : this.#n[this.#n.length - 1];
7186
- }
7187
- #a(t, r) {
7188
- let n = this.#m(t);
7189
- return n.value === r && (n.type === "CHAR" || n.type === "ESCAPED_CHAR" || n.type === "INVALID_CHAR");
7190
- }
7191
- #P() {
7192
- return this.#a(this.#e, ":");
7193
- }
7194
- #E() {
7195
- return this.#a(this.#e + 1, "/") && this.#a(this.#e + 2, "/");
7196
- }
7197
- #S() {
7198
- return this.#a(this.#e, "@");
7199
- }
7200
- #O() {
7201
- return this.#a(this.#e, ":");
7202
- }
7203
- #k() {
7204
- return this.#a(this.#e, ":");
7205
- }
7206
- #x() {
7207
- return this.#a(this.#e, "/");
7208
- }
7209
- #h() {
7210
- if (this.#a(this.#e, "?"))
7211
- return true;
7212
- if (this.#n[this.#e].value !== "?")
7213
- return false;
7214
- let t = this.#m(this.#e - 1);
7215
- return t.type !== "NAME" && t.type !== "REGEX" && t.type !== "CLOSE" && t.type !== "ASTERISK";
7216
- }
7217
- #f() {
7218
- return this.#a(this.#e, "#");
7219
- }
7220
- #T() {
7221
- return this.#n[this.#e].type == "OPEN";
7222
- }
7223
- #A() {
7224
- return this.#n[this.#e].type == "CLOSE";
7225
- }
7226
- #y() {
7227
- return this.#a(this.#e, "[");
7228
- }
7229
- #w() {
7230
- return this.#a(this.#e, "]");
7231
- }
7232
- #c() {
7233
- let t = this.#n[this.#e], r = this.#m(this.#l).index;
7234
- return this.#i.substring(r, t.index);
7235
- }
7236
- #C() {
7237
- let t = {};
7238
- Object.assign(t, x), t.encodePart = y;
7239
- let r = Z(this.#c(), undefined, t);
7240
- this.#g = N(r);
7241
- }
7242
- };
7243
- var G = ["protocol", "username", "password", "hostname", "port", "pathname", "search", "hash"];
7244
- var E = "*";
7245
- var me = class {
7246
- #i;
7247
- #n = {};
7248
- #t = {};
7249
- #e = {};
7250
- #s = {};
7251
- #l = false;
7252
- constructor(t = {}, r, n) {
7253
- try {
7254
- let o;
7255
- if (typeof r == "string" ? o = r : n = r, typeof t == "string") {
7256
- let i = new H(t);
7257
- if (i.parse(), t = i.result, o === undefined && typeof t.protocol != "string")
7258
- throw new TypeError("A base URL must be provided for a relative constructor string.");
7259
- t.baseURL = o;
7260
- } else {
7261
- if (!t || typeof t != "object")
7262
- throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");
7263
- if (o)
7264
- throw new TypeError("parameter 1 is not of type 'string'.");
7265
- }
7266
- typeof n > "u" && (n = { ignoreCase: false });
7267
- let c = { ignoreCase: n.ignoreCase === true }, l = { pathname: E, protocol: E, username: E, password: E, hostname: E, port: E, search: E, hash: E };
7268
- this.#i = w(l, t, true), _(this.#i.protocol) === this.#i.port && (this.#i.port = "");
7269
- let s;
7270
- for (s of G) {
7271
- if (!(s in this.#i))
7272
- continue;
7273
- let i = {}, a = this.#i[s];
7274
- switch (this.#t[s] = [], s) {
7275
- case "protocol":
7276
- Object.assign(i, x), i.encodePart = y;
7277
- break;
7278
- case "username":
7279
- Object.assign(i, x), i.encodePart = le;
7280
- break;
7281
- case "password":
7282
- Object.assign(i, x), i.encodePart = fe;
7283
- break;
7284
- case "hostname":
7285
- Object.assign(i, B), W(a) ? i.encodePart = j : i.encodePart = z;
7286
- break;
7287
- case "port":
7288
- Object.assign(i, x), i.encodePart = K;
7289
- break;
7290
- case "pathname":
7291
- N(this.#n.protocol) ? (Object.assign(i, q, c), i.encodePart = he) : (Object.assign(i, x, c), i.encodePart = ue);
7292
- break;
7293
- case "search":
7294
- Object.assign(i, x, c), i.encodePart = de;
7295
- break;
7296
- case "hash":
7297
- Object.assign(i, x, c), i.encodePart = pe;
7298
- break;
7299
- }
7300
- try {
7301
- this.#s[s] = D(a, i), this.#n[s] = F(this.#s[s], this.#t[s], i), this.#e[s] = ke(this.#s[s], i), this.#l = this.#l || this.#s[s].some((f) => f.type === 2);
7302
- } catch {
7303
- throw new TypeError(`invalid ${s} pattern '${this.#i[s]}'.`);
7304
- }
7305
- }
7306
- } catch (o) {
7307
- throw new TypeError(`Failed to construct 'URLPattern': ${o.message}`);
7308
- }
7309
- }
7310
- test(t = {}, r) {
7311
- let n = { pathname: "", protocol: "", username: "", password: "", hostname: "", port: "", search: "", hash: "" };
7312
- if (typeof t != "string" && r)
7313
- throw new TypeError("parameter 1 is not of type 'string'.");
7314
- if (typeof t > "u")
7315
- return false;
7316
- try {
7317
- typeof t == "object" ? n = w(n, t, false) : n = w(n, ge(t, r), false);
7318
- } catch {
7319
- return false;
7320
- }
7321
- let o;
7322
- for (o of G)
7323
- if (!this.#n[o].exec(n[o]))
7324
- return false;
7325
- return true;
7326
- }
7327
- exec(t = {}, r) {
7328
- let n = { pathname: "", protocol: "", username: "", password: "", hostname: "", port: "", search: "", hash: "" };
7329
- if (typeof t != "string" && r)
7330
- throw new TypeError("parameter 1 is not of type 'string'.");
7331
- if (typeof t > "u")
7332
- return;
7333
- try {
7334
- typeof t == "object" ? n = w(n, t, false) : n = w(n, ge(t, r), false);
7335
- } catch {
7336
- return null;
7337
- }
7338
- let o = {};
7339
- r ? o.inputs = [t, r] : o.inputs = [t];
7340
- let c;
7341
- for (c of G) {
7342
- let l = this.#n[c].exec(n[c]);
7343
- if (!l)
7344
- return null;
7345
- let s = {};
7346
- for (let [i, a] of this.#t[c].entries())
7347
- if (typeof a == "string" || typeof a == "number") {
7348
- let f = l[i + 1];
7349
- s[a] = f;
7350
- }
7351
- o[c] = { input: n[c] ?? "", groups: s };
7352
- }
7353
- return o;
7354
- }
7355
- static compareComponent(t, r, n) {
7356
- let o = (i, a) => {
7357
- for (let f of ["type", "modifier", "prefix", "value", "suffix"]) {
7358
- if (i[f] < a[f])
7359
- return -1;
7360
- if (i[f] === a[f])
7361
- continue;
7362
- return 1;
7363
- }
7364
- return 0;
7365
- }, c = new R(3, "", "", "", "", 3), l = new R(0, "", "", "", "", 3), s = (i, a) => {
7366
- let f = 0;
7367
- for (;f < Math.min(i.length, a.length); ++f) {
7368
- let d = o(i[f], a[f]);
7369
- if (d)
7370
- return d;
7371
- }
7372
- return i.length === a.length ? 0 : o(i[f] ?? c, a[f] ?? c);
7373
- };
7374
- return !r.#e[t] && !n.#e[t] ? 0 : r.#e[t] && !n.#e[t] ? s(r.#s[t], [l]) : !r.#e[t] && n.#e[t] ? s([l], n.#s[t]) : s(r.#s[t], n.#s[t]);
7375
- }
7376
- get protocol() {
7377
- return this.#e.protocol;
7378
- }
7379
- get username() {
7380
- return this.#e.username;
7381
- }
7382
- get password() {
7383
- return this.#e.password;
7384
- }
7385
- get hostname() {
7386
- return this.#e.hostname;
7387
- }
7388
- get port() {
7389
- return this.#e.port;
7390
- }
7391
- get pathname() {
7392
- return this.#e.pathname;
7393
- }
7394
- get search() {
7395
- return this.#e.search;
7396
- }
7397
- get hash() {
7398
- return this.#e.hash;
7399
- }
7400
- get hasRegExpGroups() {
7401
- return this.#l;
7402
- }
7403
- };
7404
-
7405
- // ../../node_modules/urlpattern-polyfill/index.js
7406
- if (!globalThis.URLPattern) {
7407
- globalThis.URLPattern = me;
7408
- }
7409
-
7410
- // server/prod.ts
7411
6353
  async function startProdServer() {
7412
6354
  const { app } = await import(`${distDir}/server/bootstrap.mjs`);
7413
6355
  const manifest = await import(`${distDir}/client/.vite/manifest.json`);