@lousy-agents/cli 5.19.0 → 5.19.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/api/copilot-with-fastify/.devcontainer/devcontainer.json +1 -1
- package/api/copilot-with-fastify/package-lock.json +12 -12
- package/api/copilot-with-fastify/package.json +3 -3
- package/cli/copilot-with-citty/.devcontainer/devcontainer.json +1 -1
- package/cli/copilot-with-citty/package.json +2 -2
- package/dist/316.js +1 -1
- package/dist/index.js +1415 -862
- package/package.json +1 -1
- package/ui/copilot-with-react/.devcontainer/devcontainer.json +1 -1
- package/ui/copilot-with-react/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3032,7 +3032,7 @@ exports.basename = (path, { windows } = {}) => {
|
|
|
3032
3032
|
|
|
3033
3033
|
|
|
3034
3034
|
},
|
|
3035
|
-
|
|
3035
|
+
4589(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
3036
3036
|
// NAMESPACE OBJECT: ../../node_modules/micromark/lib/constructs.js
|
|
3037
3037
|
var constructs_namespaceObject = {};
|
|
3038
3038
|
__webpack_require__.r(constructs_namespaceObject);
|
|
@@ -3060,6 +3060,9 @@ var external_node_path_ = __webpack_require__(6760);
|
|
|
3060
3060
|
const OPERATIONAL_CODES = new Set([
|
|
3061
3061
|
"helper-failed",
|
|
3062
3062
|
"helper-unavailable",
|
|
3063
|
+
"not-empty",
|
|
3064
|
+
"not-found",
|
|
3065
|
+
"not-removable",
|
|
3063
3066
|
"permission-unverified",
|
|
3064
3067
|
"timeout",
|
|
3065
3068
|
"unsupported-platform",
|
|
@@ -3109,6 +3112,7 @@ function file_identity_sameFileIdentity(left, right, platform = process.platform
|
|
|
3109
3112
|
|
|
3110
3113
|
|
|
3111
3114
|
|
|
3115
|
+
|
|
3112
3116
|
const NOT_FOUND_CODES = new Set(["ENOENT", "ENOTDIR"]);
|
|
3113
3117
|
const SYMLINK_OPEN_CODES = new Set(["ELOOP", "EINVAL", "ENOTSUP"]);
|
|
3114
3118
|
const POSIX_SEPARATOR_CHAR_CODE = 0x2f;
|
|
@@ -3226,6 +3230,9 @@ function splitSafeRelativePath(relativePath) {
|
|
|
3226
3230
|
if (segment === "..") {
|
|
3227
3231
|
throw new FsSafeError("invalid-path", "relative path must not contain '..'");
|
|
3228
3232
|
}
|
|
3233
|
+
if (isDriveRelativePath(segment)) {
|
|
3234
|
+
throw new FsSafeError("invalid-path", "relative path must not contain a drive letter");
|
|
3235
|
+
}
|
|
3229
3236
|
}
|
|
3230
3237
|
return segments;
|
|
3231
3238
|
}
|
|
@@ -3238,6 +3245,74 @@ function resolveSafeRelativePath(rootDir, relativePath) {
|
|
|
3238
3245
|
return target;
|
|
3239
3246
|
}
|
|
3240
3247
|
|
|
3248
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/root-errors.js
|
|
3249
|
+
|
|
3250
|
+
|
|
3251
|
+
const REMOVE_NOT_EMPTY_CODES = new Set(["ENOTEMPTY", "EEXIST"]);
|
|
3252
|
+
function fileNotFoundError(cause) {
|
|
3253
|
+
return cause === undefined
|
|
3254
|
+
? new errors_FsSafeError("not-found", "file not found")
|
|
3255
|
+
: new errors_FsSafeError("not-found", "file not found", { cause });
|
|
3256
|
+
}
|
|
3257
|
+
function outsideWorkspaceError() {
|
|
3258
|
+
return new errors_FsSafeError("outside-workspace", "file is outside workspace root");
|
|
3259
|
+
}
|
|
3260
|
+
function root_errors_directoryComponentNotDirectoryError(cause) {
|
|
3261
|
+
return cause === undefined
|
|
3262
|
+
? new errors_FsSafeError("not-file", "directory component must be a directory")
|
|
3263
|
+
: new errors_FsSafeError("not-file", "directory component must be a directory", { cause });
|
|
3264
|
+
}
|
|
3265
|
+
function hardlinkedPathNotAllowedError() {
|
|
3266
|
+
return new errors_FsSafeError("hardlink", "hardlinked path not allowed");
|
|
3267
|
+
}
|
|
3268
|
+
function isAlreadyExistsError(error) {
|
|
3269
|
+
return hasNodeErrorCode(error, "EEXIST") || /File exists|EEXIST/i.test(String(error));
|
|
3270
|
+
}
|
|
3271
|
+
function normalizePinnedWriteError(error) {
|
|
3272
|
+
if (error instanceof errors_FsSafeError) {
|
|
3273
|
+
return error;
|
|
3274
|
+
}
|
|
3275
|
+
if (path_isNotFoundPathError(error)) {
|
|
3276
|
+
return fileNotFoundError(error instanceof Error ? error : undefined);
|
|
3277
|
+
}
|
|
3278
|
+
return new errors_FsSafeError("invalid-path", "path is not a regular file under root", {
|
|
3279
|
+
cause: error instanceof Error ? error : undefined,
|
|
3280
|
+
});
|
|
3281
|
+
}
|
|
3282
|
+
function normalizePinnedPathError(error) {
|
|
3283
|
+
if (error instanceof errors_FsSafeError) {
|
|
3284
|
+
return error;
|
|
3285
|
+
}
|
|
3286
|
+
return new errors_FsSafeError("path-alias", "path is not under root", {
|
|
3287
|
+
cause: error instanceof Error ? error : undefined,
|
|
3288
|
+
});
|
|
3289
|
+
}
|
|
3290
|
+
function normalizeRemoveGuardError(error) {
|
|
3291
|
+
if (error instanceof errors_FsSafeError) {
|
|
3292
|
+
return error;
|
|
3293
|
+
}
|
|
3294
|
+
if (path_isNotFoundPathError(error)) {
|
|
3295
|
+
return fileNotFoundError(error instanceof Error ? error : undefined);
|
|
3296
|
+
}
|
|
3297
|
+
return normalizePinnedPathError(error);
|
|
3298
|
+
}
|
|
3299
|
+
function normalizeRemovePathError(error) {
|
|
3300
|
+
if (error instanceof errors_FsSafeError) {
|
|
3301
|
+
return error;
|
|
3302
|
+
}
|
|
3303
|
+
if (!isNodeError(error) || typeof error.code !== "string") {
|
|
3304
|
+
return normalizePinnedPathError(error);
|
|
3305
|
+
}
|
|
3306
|
+
const cause = error instanceof Error ? error : undefined;
|
|
3307
|
+
if (path_isNotFoundPathError(error)) {
|
|
3308
|
+
return fileNotFoundError(cause);
|
|
3309
|
+
}
|
|
3310
|
+
if (REMOVE_NOT_EMPTY_CODES.has(error.code)) {
|
|
3311
|
+
return new errors_FsSafeError("not-empty", "directory is not empty", { cause });
|
|
3312
|
+
}
|
|
3313
|
+
return new errors_FsSafeError("not-removable", "path could not be removed", { cause });
|
|
3314
|
+
}
|
|
3315
|
+
|
|
3241
3316
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/directory-guard.js
|
|
3242
3317
|
|
|
3243
3318
|
|
|
@@ -3245,17 +3320,18 @@ function resolveSafeRelativePath(rootDir, relativePath) {
|
|
|
3245
3320
|
|
|
3246
3321
|
|
|
3247
3322
|
|
|
3323
|
+
|
|
3248
3324
|
async function directory_guard_createAsyncDirectoryGuard(dir) {
|
|
3249
3325
|
const stat = await promises_.lstat(dir);
|
|
3250
3326
|
if (stat.isSymbolicLink() || !stat.isDirectory()) {
|
|
3251
|
-
throw
|
|
3327
|
+
throw root_errors_directoryComponentNotDirectoryError();
|
|
3252
3328
|
}
|
|
3253
3329
|
return { dir, realPath: await promises_.realpath(dir), stat };
|
|
3254
3330
|
}
|
|
3255
3331
|
async function assertAsyncDirectoryGuard(guard) {
|
|
3256
3332
|
const stat = await promises_.lstat(guard.dir);
|
|
3257
3333
|
if (stat.isSymbolicLink() || !stat.isDirectory()) {
|
|
3258
|
-
throw
|
|
3334
|
+
throw root_errors_directoryComponentNotDirectoryError();
|
|
3259
3335
|
}
|
|
3260
3336
|
if (!file_identity_sameFileIdentity(stat, guard.stat) || (await promises_.realpath(guard.dir)) !== guard.realPath) {
|
|
3261
3337
|
throw new errors_FsSafeError("path-mismatch", "directory changed during operation");
|
|
@@ -3264,14 +3340,14 @@ async function assertAsyncDirectoryGuard(guard) {
|
|
|
3264
3340
|
function directory_guard_createSyncDirectoryGuard(dir) {
|
|
3265
3341
|
const stat = fsSync.lstatSync(dir);
|
|
3266
3342
|
if (stat.isSymbolicLink() || !stat.isDirectory()) {
|
|
3267
|
-
throw
|
|
3343
|
+
throw directoryComponentNotDirectoryError();
|
|
3268
3344
|
}
|
|
3269
3345
|
return { dir, realPath: fsSync.realpathSync(dir), stat };
|
|
3270
3346
|
}
|
|
3271
3347
|
function directory_guard_assertSyncDirectoryGuard(guard) {
|
|
3272
3348
|
const stat = fsSync.lstatSync(guard.dir);
|
|
3273
3349
|
if (stat.isSymbolicLink() || !stat.isDirectory()) {
|
|
3274
|
-
throw
|
|
3350
|
+
throw directoryComponentNotDirectoryError();
|
|
3275
3351
|
}
|
|
3276
3352
|
if (!sameFileIdentity(stat, guard.stat) || fsSync.realpathSync(guard.dir) !== guard.realPath) {
|
|
3277
3353
|
throw new FsSafeError("path-mismatch", "directory changed during operation");
|
|
@@ -3617,6 +3693,7 @@ async function ensureDurableDirectory(options) {
|
|
|
3617
3693
|
|
|
3618
3694
|
|
|
3619
3695
|
|
|
3696
|
+
|
|
3620
3697
|
function isSameOrChildPath(candidate, parent) {
|
|
3621
3698
|
const parentPrefix = parent.endsWith(external_node_path_.sep) ? parent : `${parent}${external_node_path_.sep}`;
|
|
3622
3699
|
return candidate === parent || candidate.startsWith(parentPrefix);
|
|
@@ -3629,9 +3706,7 @@ async function realpathOrThrowNotFile(target) {
|
|
|
3629
3706
|
if (path_isNotFoundPathError(error)) {
|
|
3630
3707
|
// A dangling symlink (or a component removed between lstat and
|
|
3631
3708
|
// realpath) is not a usable directory component.
|
|
3632
|
-
throw
|
|
3633
|
-
cause: error instanceof Error ? error : undefined,
|
|
3634
|
-
});
|
|
3709
|
+
throw root_errors_directoryComponentNotDirectoryError(error instanceof Error ? error : undefined);
|
|
3635
3710
|
}
|
|
3636
3711
|
throw error;
|
|
3637
3712
|
}
|
|
@@ -3654,8 +3729,8 @@ async function mkdirPathComponentsWithGuards(params) {
|
|
|
3654
3729
|
for (const part of relative.split(external_node_path_.sep).filter(Boolean)) {
|
|
3655
3730
|
const next = external_node_path_.join(current, part);
|
|
3656
3731
|
const parentGuard = await directory_guard_createAsyncDirectoryGuard(current);
|
|
3657
|
-
await params.beforeComponent?.(next);
|
|
3658
3732
|
await assertAsyncDirectoryGuard(parentGuard);
|
|
3733
|
+
await params.beforeComponent?.(next);
|
|
3659
3734
|
try {
|
|
3660
3735
|
await promises_.mkdir(next);
|
|
3661
3736
|
}
|
|
@@ -3666,7 +3741,7 @@ async function mkdirPathComponentsWithGuards(params) {
|
|
|
3666
3741
|
}
|
|
3667
3742
|
const stat = await promises_.lstat(next);
|
|
3668
3743
|
if (!stat.isSymbolicLink() && !stat.isDirectory()) {
|
|
3669
|
-
throw
|
|
3744
|
+
throw root_errors_directoryComponentNotDirectoryError();
|
|
3670
3745
|
}
|
|
3671
3746
|
// Node's recursive mkdir follows symlinks in missing components. Build one
|
|
3672
3747
|
// segment at a time and realpath-check each segment before descending.
|
|
@@ -3686,7 +3761,7 @@ async function mkdirPathComponentsWithGuards(params) {
|
|
|
3686
3761
|
// the returned resolved path, not their own lexical parent path.
|
|
3687
3762
|
const targetStat = await promises_.stat(nextReal);
|
|
3688
3763
|
if (!targetStat.isDirectory()) {
|
|
3689
|
-
throw
|
|
3764
|
+
throw root_errors_directoryComponentNotDirectoryError();
|
|
3690
3765
|
}
|
|
3691
3766
|
await directory_guard_createAsyncDirectoryGuard(nextReal);
|
|
3692
3767
|
await assertAsyncDirectoryGuard(parentGuard);
|
|
@@ -3778,30 +3853,37 @@ function guardedRmSync(params) {
|
|
|
3778
3853
|
}), { verifyAfter: params.verifyAfter });
|
|
3779
3854
|
}
|
|
3780
3855
|
|
|
3781
|
-
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/
|
|
3856
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/root-path-existing.js
|
|
3782
3857
|
|
|
3783
3858
|
|
|
3784
3859
|
|
|
3785
3860
|
|
|
3786
|
-
|
|
3861
|
+
function isFilesystemRoot(candidate) {
|
|
3862
|
+
return external_node_path_.parse(candidate).root === candidate;
|
|
3863
|
+
}
|
|
3864
|
+
async function pathExists(targetPath) {
|
|
3787
3865
|
try {
|
|
3788
|
-
await promises_.lstat(
|
|
3866
|
+
await promises_.lstat(targetPath);
|
|
3789
3867
|
return true;
|
|
3790
3868
|
}
|
|
3791
|
-
catch (
|
|
3792
|
-
if (
|
|
3793
|
-
|
|
3869
|
+
catch (error) {
|
|
3870
|
+
if (path_isNotFoundPathError(error)) {
|
|
3871
|
+
return false;
|
|
3794
3872
|
}
|
|
3795
|
-
|
|
3873
|
+
throw error;
|
|
3796
3874
|
}
|
|
3797
3875
|
}
|
|
3798
3876
|
async function resolvePathViaExistingAncestor(targetPath) {
|
|
3799
3877
|
const normalized = external_node_path_.resolve(targetPath);
|
|
3800
3878
|
let cursor = normalized;
|
|
3801
3879
|
const missingSuffix = [];
|
|
3802
|
-
while (
|
|
3880
|
+
while (!isFilesystemRoot(cursor) && !(await pathExists(cursor))) {
|
|
3803
3881
|
missingSuffix.unshift(external_node_path_.basename(cursor));
|
|
3804
|
-
|
|
3882
|
+
const parent = external_node_path_.dirname(cursor);
|
|
3883
|
+
if (parent === cursor) {
|
|
3884
|
+
break;
|
|
3885
|
+
}
|
|
3886
|
+
cursor = parent;
|
|
3805
3887
|
}
|
|
3806
3888
|
if (!(await pathExists(cursor))) {
|
|
3807
3889
|
return normalized;
|
|
@@ -3816,7 +3898,38 @@ async function resolvePathViaExistingAncestor(targetPath) {
|
|
|
3816
3898
|
return normalized;
|
|
3817
3899
|
}
|
|
3818
3900
|
}
|
|
3819
|
-
|
|
3901
|
+
function root_path_existing_resolvePathViaExistingAncestorSync(targetPath) {
|
|
3902
|
+
const normalized = path.resolve(targetPath);
|
|
3903
|
+
let cursor = normalized;
|
|
3904
|
+
const missingSuffix = [];
|
|
3905
|
+
while (!isFilesystemRoot(cursor) && !fs.existsSync(cursor)) {
|
|
3906
|
+
missingSuffix.unshift(path.basename(cursor));
|
|
3907
|
+
const parent = path.dirname(cursor);
|
|
3908
|
+
if (parent === cursor) {
|
|
3909
|
+
break;
|
|
3910
|
+
}
|
|
3911
|
+
cursor = parent;
|
|
3912
|
+
}
|
|
3913
|
+
if (!fs.existsSync(cursor)) {
|
|
3914
|
+
return normalized;
|
|
3915
|
+
}
|
|
3916
|
+
try {
|
|
3917
|
+
const resolvedAncestor = path.resolve(fs.realpathSync(cursor));
|
|
3918
|
+
return missingSuffix.length === 0
|
|
3919
|
+
? resolvedAncestor
|
|
3920
|
+
: path.resolve(resolvedAncestor, ...missingSuffix);
|
|
3921
|
+
}
|
|
3922
|
+
catch {
|
|
3923
|
+
return normalized;
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
|
|
3927
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/deny-mutations.js
|
|
3928
|
+
|
|
3929
|
+
|
|
3930
|
+
|
|
3931
|
+
|
|
3932
|
+
async function resolveMutationComparablePaths(rawPath) {
|
|
3820
3933
|
path_assertNoNulPathInput(rawPath, "path contains a NUL byte");
|
|
3821
3934
|
const resolved = external_node_path_.resolve(rawPath);
|
|
3822
3935
|
return new Set([resolved, await resolvePathViaExistingAncestor(resolved)]);
|
|
@@ -3845,9 +3958,9 @@ async function assertMutationNotDenied(filePath, policy, options = {}) {
|
|
|
3845
3958
|
if (!hasPolicyEntries(policy)) {
|
|
3846
3959
|
return;
|
|
3847
3960
|
}
|
|
3848
|
-
const targetPaths = await
|
|
3961
|
+
const targetPaths = await resolveMutationComparablePaths(filePath);
|
|
3849
3962
|
for (const deniedPath of policyPathEntries(policy.paths)) {
|
|
3850
|
-
const deniedPaths = await
|
|
3963
|
+
const deniedPaths = await resolveMutationComparablePaths(deniedPath);
|
|
3851
3964
|
for (const target of targetPaths) {
|
|
3852
3965
|
for (const denied of deniedPaths) {
|
|
3853
3966
|
if (isSamePath(denied, target) ||
|
|
@@ -3858,7 +3971,7 @@ async function assertMutationNotDenied(filePath, policy, options = {}) {
|
|
|
3858
3971
|
}
|
|
3859
3972
|
}
|
|
3860
3973
|
for (const deniedPrefix of policyPathEntries(policy.prefixes)) {
|
|
3861
|
-
const deniedPaths = await
|
|
3974
|
+
const deniedPaths = await resolveMutationComparablePaths(deniedPrefix);
|
|
3862
3975
|
for (const target of targetPaths) {
|
|
3863
3976
|
for (const denied of deniedPaths) {
|
|
3864
3977
|
if (path_isPathInside(denied, target) ||
|
|
@@ -4321,7 +4434,20 @@ async function createNativeExclusiveFile(targetPath, mode) {
|
|
|
4321
4434
|
let fd;
|
|
4322
4435
|
let created;
|
|
4323
4436
|
try {
|
|
4324
|
-
|
|
4437
|
+
let opened;
|
|
4438
|
+
try {
|
|
4439
|
+
opened = binding.openBeneath(parent.fd, basename, nativeOpenFlags(external_node_fs_.constants.O_WRONLY | external_node_fs_.constants.O_CREAT | external_node_fs_.constants.O_EXCL));
|
|
4440
|
+
}
|
|
4441
|
+
catch (error) {
|
|
4442
|
+
// The parent open above and every post-create operation remain untagged.
|
|
4443
|
+
// Only this exclusive-open failure has enough provenance for a caller to
|
|
4444
|
+
// classify a Windows lock-file denial without swallowing setup failures.
|
|
4445
|
+
const openError = error;
|
|
4446
|
+
if (process.platform === "win32" && openError.code === "EPERM") {
|
|
4447
|
+
openError.path = targetPath;
|
|
4448
|
+
}
|
|
4449
|
+
throw error;
|
|
4450
|
+
}
|
|
4325
4451
|
fd = opened.fd;
|
|
4326
4452
|
external_node_fs_.fchmodSync(fd, mode);
|
|
4327
4453
|
created = external_node_fs_.fstatSync(fd);
|
|
@@ -4375,23 +4501,22 @@ function assertWithinMaxBytes(bytes, maxBytes) {
|
|
|
4375
4501
|
throw new errors_FsSafeError("too-large", `file exceeds limit of ${maxBytes} bytes (got at least ${bytes})`);
|
|
4376
4502
|
}
|
|
4377
4503
|
}
|
|
4378
|
-
async function
|
|
4504
|
+
async function writeNativeInput(fd, input, maxBytes) {
|
|
4379
4505
|
if (input.kind === "buffer") {
|
|
4380
4506
|
const data = typeof input.data === "string"
|
|
4381
4507
|
? Buffer.from(input.data, input.encoding ?? "utf8")
|
|
4382
4508
|
: Buffer.from(input.data);
|
|
4383
4509
|
assertWithinMaxBytes(data.byteLength, maxBytes);
|
|
4384
|
-
|
|
4510
|
+
writeNativeFd(fd, data);
|
|
4511
|
+
return;
|
|
4385
4512
|
}
|
|
4386
|
-
const chunks = [];
|
|
4387
4513
|
let bytes = 0;
|
|
4388
4514
|
for await (const chunk of input.stream) {
|
|
4389
4515
|
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
4390
4516
|
bytes += buffer.byteLength;
|
|
4391
4517
|
assertWithinMaxBytes(bytes, maxBytes);
|
|
4392
|
-
|
|
4518
|
+
writeNativeFd(fd, buffer);
|
|
4393
4519
|
}
|
|
4394
|
-
return Buffer.concat(chunks, bytes);
|
|
4395
4520
|
}
|
|
4396
4521
|
function native_pinned_write_nativeOpenFlags(flags) {
|
|
4397
4522
|
const closeOnExec = external_node_fs_.constants.O_CLOEXEC;
|
|
@@ -4403,7 +4528,6 @@ function sameNativeIdentity(left, right) {
|
|
|
4403
4528
|
return left.dev === right.dev && left.ino === right.ino;
|
|
4404
4529
|
}
|
|
4405
4530
|
async function runPinnedWriteNative(binding, params) {
|
|
4406
|
-
const data = await inputToBuffer(params.input, params.maxBytes);
|
|
4407
4531
|
const root = await promises_.open(params.rootPath, external_node_fs_.constants.O_RDONLY |
|
|
4408
4532
|
(typeof external_node_fs_.constants.O_DIRECTORY === "number" ? external_node_fs_.constants.O_DIRECTORY : 0));
|
|
4409
4533
|
let parentFd;
|
|
@@ -4433,27 +4557,56 @@ async function runPinnedWriteNative(binding, params) {
|
|
|
4433
4557
|
!sameNativeIdentity(parentPathStat, parentIdentity)) {
|
|
4434
4558
|
throw new errors_FsSafeError("path-mismatch", "native write parent changed during resolution");
|
|
4435
4559
|
}
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4560
|
+
if (params.overwrite === false) {
|
|
4561
|
+
try {
|
|
4562
|
+
await promises_.lstat(external_node_path_.join(parentPath, params.basename));
|
|
4563
|
+
throw Object.assign(new Error("destination already exists"), { code: "EEXIST" });
|
|
4564
|
+
}
|
|
4565
|
+
catch (error) {
|
|
4566
|
+
if (error.code !== "ENOENT") {
|
|
4567
|
+
throw error;
|
|
4568
|
+
}
|
|
4443
4569
|
}
|
|
4444
4570
|
}
|
|
4445
4571
|
tempFd = binding.openBeneath(parentFd, tempName, native_pinned_write_nativeOpenFlags(external_node_fs_.constants.O_WRONLY | external_node_fs_.constants.O_CREAT | external_node_fs_.constants.O_EXCL)).fd;
|
|
4446
|
-
external_node_fs_.fchmodSync(tempFd, params.mode || 0o600);
|
|
4447
|
-
writeNativeFd(tempFd, data);
|
|
4448
|
-
syncNativeFileBestEffort(tempFd);
|
|
4449
4572
|
tempIdentity = external_node_fs_.fstatSync(tempFd);
|
|
4450
|
-
binding
|
|
4573
|
+
// Creation is requested at 0600 in the binding, but a restrictive umask
|
|
4574
|
+
// can remove owner access. Keep the unpublished inode private and
|
|
4575
|
+
// reopenable until the published name has been identity-fenced.
|
|
4576
|
+
external_node_fs_.fchmodSync(tempFd, 0o600);
|
|
4577
|
+
await writeNativeInput(tempFd, params.input, params.maxBytes);
|
|
4578
|
+
syncNativeFileBestEffort(tempFd);
|
|
4579
|
+
if (params.overwrite === false) {
|
|
4580
|
+
binding.renameNoReplace(parentFd, tempName, parentFd, params.basename);
|
|
4581
|
+
}
|
|
4582
|
+
else {
|
|
4583
|
+
binding.renameReplace(parentFd, tempName, parentFd, params.basename);
|
|
4584
|
+
}
|
|
4451
4585
|
renamed = true;
|
|
4452
4586
|
targetFd = binding.openBeneath(parentFd, params.basename, native_pinned_write_nativeOpenFlags(external_node_fs_.constants.O_RDONLY)).fd;
|
|
4453
4587
|
const targetIdentity = binding.fstatIdentity(targetFd);
|
|
4454
4588
|
if (!targetIdentity.isFile || !sameNativeIdentity(tempIdentity, targetIdentity)) {
|
|
4455
4589
|
throw new errors_FsSafeError("path-mismatch", "native write target changed after rename");
|
|
4456
4590
|
}
|
|
4591
|
+
// Native exclusive creation starts at 0600. Apply the requested mode only
|
|
4592
|
+
// after reopening and fencing the published name, both so mode 000 stays
|
|
4593
|
+
// verifiable and so broader modes are never exposed before that fence.
|
|
4594
|
+
try {
|
|
4595
|
+
external_node_fs_.fchmodSync(targetFd, params.mode);
|
|
4596
|
+
syncNativeFileBestEffort(targetFd);
|
|
4597
|
+
}
|
|
4598
|
+
catch (error) {
|
|
4599
|
+
external_node_fs_.closeSync(targetFd);
|
|
4600
|
+
targetFd = undefined;
|
|
4601
|
+
removeNativeCreatedFileIfStillPinned({
|
|
4602
|
+
binding,
|
|
4603
|
+
parentPath,
|
|
4604
|
+
parentFd,
|
|
4605
|
+
basename: params.basename,
|
|
4606
|
+
created: tempIdentity,
|
|
4607
|
+
});
|
|
4608
|
+
throw error;
|
|
4609
|
+
}
|
|
4457
4610
|
syncNativeFileBestEffort(parentFd);
|
|
4458
4611
|
return { dev: targetIdentity.dev, ino: targetIdentity.ino };
|
|
4459
4612
|
}
|
|
@@ -4590,7 +4743,7 @@ async function readFileDescriptorBounded(fd, maxBytes) {
|
|
|
4590
4743
|
});
|
|
4591
4744
|
}
|
|
4592
4745
|
/** Sync bounded read from a numeric descriptor. The caller owns the descriptor. */
|
|
4593
|
-
function
|
|
4746
|
+
function bounded_read_readFileDescriptorBoundedSync(fd, maxBytes) {
|
|
4594
4747
|
assertMaxBytes(maxBytes);
|
|
4595
4748
|
const chunks = [];
|
|
4596
4749
|
const scratch = createScratchBuffer(maxBytes);
|
|
@@ -4605,6 +4758,21 @@ function readFileDescriptorBoundedSync(fd, maxBytes) {
|
|
|
4605
4758
|
}
|
|
4606
4759
|
}
|
|
4607
4760
|
|
|
4761
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/test-hooks.js
|
|
4762
|
+
let test_hooks_fsSafeTestHooks;
|
|
4763
|
+
function allowFsSafeTestHooks() {
|
|
4764
|
+
return false || process.env.VITEST === "true";
|
|
4765
|
+
}
|
|
4766
|
+
function getFsSafeTestHooks() {
|
|
4767
|
+
return test_hooks_fsSafeTestHooks;
|
|
4768
|
+
}
|
|
4769
|
+
function __setFsSafeTestHooksForTest(hooks) {
|
|
4770
|
+
if (hooks && !allowFsSafeTestHooks()) {
|
|
4771
|
+
throw new Error("__setFsSafeTestHooksForTest is only available in tests");
|
|
4772
|
+
}
|
|
4773
|
+
test_hooks_fsSafeTestHooks = hooks;
|
|
4774
|
+
}
|
|
4775
|
+
|
|
4608
4776
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js
|
|
4609
4777
|
|
|
4610
4778
|
|
|
@@ -4613,6 +4781,7 @@ function readFileDescriptorBoundedSync(fd, maxBytes) {
|
|
|
4613
4781
|
|
|
4614
4782
|
|
|
4615
4783
|
|
|
4784
|
+
|
|
4616
4785
|
const MAX_LOCK_PAYLOAD_BYTES = 1024 * 1024;
|
|
4617
4786
|
const SIDECAR_LOCK_OWNERSHIP_TOKEN_BYTES = 16;
|
|
4618
4787
|
const SIDECAR_LOCK_OWNERSHIP_TOKEN_BITS = SIDECAR_LOCK_OWNERSHIP_TOKEN_BYTES * 8;
|
|
@@ -4663,6 +4832,7 @@ function parseSidecarLockPayload(raw, parser) {
|
|
|
4663
4832
|
}
|
|
4664
4833
|
}
|
|
4665
4834
|
async function readSidecarLockSnapshot(lockPath, options = {}) {
|
|
4835
|
+
let handle;
|
|
4666
4836
|
try {
|
|
4667
4837
|
if (options.lockRoot) {
|
|
4668
4838
|
const opened = await options.lockRoot.open(relativeSidecarLockPath(options.lockRoot, lockPath));
|
|
@@ -4678,9 +4848,44 @@ async function readSidecarLockSnapshot(lockPath, options = {}) {
|
|
|
4678
4848
|
await opened.handle.close().catch(() => undefined);
|
|
4679
4849
|
}
|
|
4680
4850
|
}
|
|
4681
|
-
const
|
|
4682
|
-
|
|
4683
|
-
|
|
4851
|
+
const before = await promises_.lstat(lockPath);
|
|
4852
|
+
if (!before.isFile() || before.isSymbolicLink()) {
|
|
4853
|
+
if (options.rejectNonFile) {
|
|
4854
|
+
throw new errors_FsSafeError("not-file", `sidecar lock is not a regular file: ${lockPath}`);
|
|
4855
|
+
}
|
|
4856
|
+
return null;
|
|
4857
|
+
}
|
|
4858
|
+
await getFsSafeTestHooks()?.beforeSidecarLockSnapshotOpen?.(lockPath);
|
|
4859
|
+
const noFollow = process.platform !== "win32" && typeof external_node_fs_.constants.O_NOFOLLOW === "number"
|
|
4860
|
+
? external_node_fs_.constants.O_NOFOLLOW
|
|
4861
|
+
: 0;
|
|
4862
|
+
try {
|
|
4863
|
+
handle = await promises_.open(lockPath, external_node_fs_.constants.O_RDONLY |
|
|
4864
|
+
noFollow |
|
|
4865
|
+
(typeof external_node_fs_.constants.O_NONBLOCK === "number" ? external_node_fs_.constants.O_NONBLOCK : 0));
|
|
4866
|
+
}
|
|
4867
|
+
catch (error) {
|
|
4868
|
+
if (options.rejectNonFile && error.code === "ELOOP") {
|
|
4869
|
+
throw new errors_FsSafeError("not-file", `sidecar lock is not a regular file: ${lockPath}`, {
|
|
4870
|
+
cause: error,
|
|
4871
|
+
});
|
|
4872
|
+
}
|
|
4873
|
+
throw error;
|
|
4874
|
+
}
|
|
4875
|
+
const opened = await handle.stat();
|
|
4876
|
+
if (!opened.isFile()) {
|
|
4877
|
+
if (options.rejectNonFile) {
|
|
4878
|
+
throw new errors_FsSafeError("not-file", `sidecar lock is not a regular file: ${lockPath}`);
|
|
4879
|
+
}
|
|
4880
|
+
return null;
|
|
4881
|
+
}
|
|
4882
|
+
if (!options.allowDescriptorIdentityDrift && !file_identity_sameFileIdentity(before, opened))
|
|
4883
|
+
return null;
|
|
4884
|
+
const raw = (await readFileHandleBounded(handle, MAX_LOCK_PAYLOAD_BYTES)).toString("utf8");
|
|
4885
|
+
const after = await promises_.lstat(lockPath);
|
|
4886
|
+
if (!after.isFile() || !file_identity_sameFileIdentity(before, after))
|
|
4887
|
+
return null;
|
|
4888
|
+
return { raw, payload: parseSidecarLockPayload(raw, options.parsePayload), stat: after };
|
|
4684
4889
|
}
|
|
4685
4890
|
catch (err) {
|
|
4686
4891
|
if (err.code === "ENOENT" ||
|
|
@@ -4689,19 +4894,26 @@ async function readSidecarLockSnapshot(lockPath, options = {}) {
|
|
|
4689
4894
|
}
|
|
4690
4895
|
throw err;
|
|
4691
4896
|
}
|
|
4897
|
+
finally {
|
|
4898
|
+
await handle?.close().catch(() => undefined);
|
|
4899
|
+
}
|
|
4692
4900
|
}
|
|
4693
|
-
function readSidecarLockSnapshotSync(lockPath, parsePayload) {
|
|
4901
|
+
function readSidecarLockSnapshotSync(lockPath, parsePayload, options = {}) {
|
|
4694
4902
|
let fd;
|
|
4695
4903
|
try {
|
|
4696
4904
|
const before = fsSync.lstatSync(lockPath);
|
|
4697
|
-
if (!before.isFile() || before.isSymbolicLink())
|
|
4905
|
+
if (!before.isFile() || before.isSymbolicLink()) {
|
|
4906
|
+
if (options.rejectNonFile) {
|
|
4907
|
+
throw new FsSafeError("not-file", `sidecar lock is not a regular file: ${lockPath}`);
|
|
4908
|
+
}
|
|
4698
4909
|
return null;
|
|
4910
|
+
}
|
|
4699
4911
|
const noFollow = process.platform !== "win32" && typeof fsSync.constants.O_NOFOLLOW === "number"
|
|
4700
4912
|
? fsSync.constants.O_NOFOLLOW
|
|
4701
4913
|
: 0;
|
|
4702
4914
|
fd = fsSync.openSync(lockPath, fsSync.constants.O_RDONLY | noFollow);
|
|
4703
4915
|
const opened = fsSync.fstatSync(fd);
|
|
4704
|
-
const raw =
|
|
4916
|
+
const raw = readFileDescriptorBoundedSync(fd, MAX_LOCK_PAYLOAD_BYTES).toString("utf8");
|
|
4705
4917
|
const after = fsSync.lstatSync(lockPath);
|
|
4706
4918
|
if (!sameFileIdentity(before, opened) || !sameFileIdentity(opened, after))
|
|
4707
4919
|
return null;
|
|
@@ -4747,7 +4959,10 @@ function sidecarLockSnapshotMatches(current, observed) {
|
|
|
4747
4959
|
return observed.stat !== undefined && current.stat !== undefined;
|
|
4748
4960
|
}
|
|
4749
4961
|
async function removeSidecarLockIfUnchanged(lockPath, observed, options = {}) {
|
|
4750
|
-
const current = await readSidecarLockSnapshot(lockPath,
|
|
4962
|
+
const current = await readSidecarLockSnapshot(lockPath, {
|
|
4963
|
+
...options,
|
|
4964
|
+
allowDescriptorIdentityDrift: observed?.ownershipToken !== undefined,
|
|
4965
|
+
});
|
|
4751
4966
|
if (!current || !observed || !sidecarLockSnapshotMatches(current, observed)) {
|
|
4752
4967
|
return false;
|
|
4753
4968
|
}
|
|
@@ -4760,7 +4975,10 @@ async function removeSidecarLockIfUnchanged(lockPath, observed, options = {}) {
|
|
|
4760
4975
|
return true;
|
|
4761
4976
|
}
|
|
4762
4977
|
async function sidecarLockSnapshotStillPresent(lockPath, observed, options = {}) {
|
|
4763
|
-
const current = await readSidecarLockSnapshot(lockPath,
|
|
4978
|
+
const current = await readSidecarLockSnapshot(lockPath, {
|
|
4979
|
+
...options,
|
|
4980
|
+
allowDescriptorIdentityDrift: observed?.ownershipToken !== undefined,
|
|
4981
|
+
});
|
|
4764
4982
|
return !!current && !!observed && sidecarLockSnapshotMatches(current, observed);
|
|
4765
4983
|
}
|
|
4766
4984
|
async function sidecarReclaimGuardExists(pathname) {
|
|
@@ -4828,36 +5046,6 @@ async function removeStaleSidecarLockIfAllowed(params) {
|
|
|
4828
5046
|
}
|
|
4829
5047
|
}
|
|
4830
5048
|
|
|
4831
|
-
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.js
|
|
4832
|
-
|
|
4833
|
-
function createSidecarLockHandle(params) {
|
|
4834
|
-
let released = false;
|
|
4835
|
-
const release = async () => {
|
|
4836
|
-
if (released)
|
|
4837
|
-
return;
|
|
4838
|
-
released = true;
|
|
4839
|
-
await params.release();
|
|
4840
|
-
};
|
|
4841
|
-
return {
|
|
4842
|
-
lockPath: params.lockPath,
|
|
4843
|
-
normalizedTargetPath: params.normalizedTargetPath,
|
|
4844
|
-
verifyStillHeld: params.verifyStillHeld,
|
|
4845
|
-
release,
|
|
4846
|
-
[Symbol.asyncDispose]: release,
|
|
4847
|
-
};
|
|
4848
|
-
}
|
|
4849
|
-
function createHeldSidecarLockHandle(params) {
|
|
4850
|
-
return createSidecarLockHandle({
|
|
4851
|
-
lockPath: params.held.lockPath,
|
|
4852
|
-
normalizedTargetPath: params.normalizedTargetPath,
|
|
4853
|
-
verifyStillHeld: async () => await sidecarLockSnapshotStillPresent(params.held.lockPath, params.held.snapshot, {
|
|
4854
|
-
lockRoot: params.held.lockRoot,
|
|
4855
|
-
parsePayload: params.held.parsePayload,
|
|
4856
|
-
}),
|
|
4857
|
-
release: params.release,
|
|
4858
|
-
});
|
|
4859
|
-
}
|
|
4860
|
-
|
|
4861
5049
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js
|
|
4862
5050
|
|
|
4863
5051
|
function computeSidecarLockDelayMs(retry, attempt) {
|
|
@@ -4868,7 +5056,23 @@ function computeSidecarLockDelayMs(retry, attempt) {
|
|
|
4868
5056
|
const jitter = retry.randomize ? 1 + Math.random() : 1;
|
|
4869
5057
|
return Math.min(maxTimeout, Math.round(base * jitter));
|
|
4870
5058
|
}
|
|
5059
|
+
// Windows denies access to a lock file while a just-unlinked directory entry
|
|
5060
|
+
// is still being torn down, so a contended acquire sees EPERM on a name that is
|
|
5061
|
+
// already gone -- both when creating it exclusively and when reading the
|
|
5062
|
+
// holder's snapshot. The next attempt succeeds, so this is contention rather
|
|
5063
|
+
// than a permission failure. The error must name the lock file itself: the
|
|
5064
|
+
// exclusive-create helper opens the parent directory first, and a denial from
|
|
5065
|
+
// that setup step carries no teardown evidence and has to reach the caller.
|
|
5066
|
+
const maxTransientLockDenials = 8;
|
|
5067
|
+
function isTransientLockFileDenial(error, lockPath) {
|
|
5068
|
+
const denial = error;
|
|
5069
|
+
return process.platform === "win32" && denial?.code === "EPERM" && denial.path === lockPath;
|
|
5070
|
+
}
|
|
4871
5071
|
function sidecarLockPayloadIsStale(payload, staleMs, nowMs) {
|
|
5072
|
+
const createdAtMs = sidecarLockPayloadCreatedAtMs(payload);
|
|
5073
|
+
return createdAtMs !== null && nowMs - createdAtMs > staleMs;
|
|
5074
|
+
}
|
|
5075
|
+
function sidecarLockPayloadCreatedAtMs(payload) {
|
|
4872
5076
|
const createdAt = payload &&
|
|
4873
5077
|
typeof payload === "object" &&
|
|
4874
5078
|
"createdAt" in payload &&
|
|
@@ -4876,11 +5080,12 @@ function sidecarLockPayloadIsStale(payload, staleMs, nowMs) {
|
|
|
4876
5080
|
? payload.createdAt
|
|
4877
5081
|
: "";
|
|
4878
5082
|
const createdAtMs = Date.parse(createdAt);
|
|
4879
|
-
return Number.isFinite(createdAtMs)
|
|
5083
|
+
return Number.isFinite(createdAtMs) ? createdAtMs : null;
|
|
4880
5084
|
}
|
|
4881
5085
|
async function defaultSidecarLockShouldReclaim(params) {
|
|
4882
|
-
|
|
4883
|
-
|
|
5086
|
+
const createdAtMs = sidecarLockPayloadCreatedAtMs(params.payload);
|
|
5087
|
+
if (createdAtMs !== null)
|
|
5088
|
+
return params.nowMs - createdAtMs > params.staleMs;
|
|
4884
5089
|
try {
|
|
4885
5090
|
return params.nowMs - (await promises_.stat(params.lockPath)).mtimeMs > params.staleMs;
|
|
4886
5091
|
}
|
|
@@ -4889,17 +5094,307 @@ async function defaultSidecarLockShouldReclaim(params) {
|
|
|
4889
5094
|
}
|
|
4890
5095
|
}
|
|
4891
5096
|
|
|
4892
|
-
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock.js
|
|
5097
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js
|
|
4893
5098
|
|
|
4894
5099
|
|
|
4895
5100
|
|
|
4896
5101
|
|
|
4897
5102
|
|
|
4898
5103
|
|
|
5104
|
+
async function resolveNormalizedTargetPath(targetPath) {
|
|
5105
|
+
const resolved = external_node_path_.resolve(targetPath);
|
|
5106
|
+
const dir = external_node_path_.dirname(resolved);
|
|
5107
|
+
await promises_.mkdir(dir, { recursive: true });
|
|
5108
|
+
try {
|
|
5109
|
+
return external_node_path_.join(await promises_.realpath(dir), external_node_path_.basename(resolved));
|
|
5110
|
+
}
|
|
5111
|
+
catch {
|
|
5112
|
+
return resolved;
|
|
5113
|
+
}
|
|
5114
|
+
}
|
|
5115
|
+
async function acquireSidecarLock(options, context) {
|
|
5116
|
+
context.ensureExitCleanupRegistered();
|
|
5117
|
+
const normalizedTargetPath = await resolveNormalizedTargetPath(options.targetPath);
|
|
5118
|
+
const lockPath = options.lockPath ?? `${normalizedTargetPath}.lock`;
|
|
5119
|
+
const held = context.held.get(normalizedTargetPath);
|
|
5120
|
+
if (held &&
|
|
5121
|
+
options.reentrantOwner !== undefined &&
|
|
5122
|
+
held.reentrantOwner !== undefined &&
|
|
5123
|
+
options.reentrantOwner === held.reentrantOwner) {
|
|
5124
|
+
held.refCount += 1;
|
|
5125
|
+
return context.handleForHeldLock(normalizedTargetPath, held);
|
|
5126
|
+
}
|
|
5127
|
+
const startedAt = Date.now();
|
|
5128
|
+
const retry = options.retry ?? {};
|
|
5129
|
+
const maxRetries = options.timeoutMs === Number.POSITIVE_INFINITY ? undefined : retry.retries;
|
|
5130
|
+
const reclaimGuardPath = `${lockPath}.reclaim`;
|
|
5131
|
+
let ownsReclaimGuard = false;
|
|
5132
|
+
let attempt = 0;
|
|
5133
|
+
// Bounded so a genuine denial still surfaces as EPERM, not a lock timeout.
|
|
5134
|
+
let transientDenials = 0;
|
|
5135
|
+
const withinDenialBudget = () => ++transientDenials <= (/* inlined export .maxTransientLockDenials */8);
|
|
5136
|
+
const waitForRetry = async () => {
|
|
5137
|
+
const elapsed = Date.now() - startedAt;
|
|
5138
|
+
if ((options.timeoutMs !== undefined &&
|
|
5139
|
+
options.timeoutMs !== Number.POSITIVE_INFINITY &&
|
|
5140
|
+
elapsed >= options.timeoutMs) ||
|
|
5141
|
+
(maxRetries !== undefined && attempt >= maxRetries)) {
|
|
5142
|
+
throw Object.assign(new Error(`file lock timeout for ${normalizedTargetPath}`), {
|
|
5143
|
+
code: "file_lock_timeout",
|
|
5144
|
+
lockPath,
|
|
5145
|
+
normalizedTargetPath,
|
|
5146
|
+
});
|
|
5147
|
+
}
|
|
5148
|
+
const remaining = options.timeoutMs === undefined || options.timeoutMs === Number.POSITIVE_INFINITY
|
|
5149
|
+
? Number.POSITIVE_INFINITY
|
|
5150
|
+
: Math.max(0, options.timeoutMs - elapsed);
|
|
5151
|
+
const delay = Math.min(computeSidecarLockDelayMs(retry, attempt), remaining);
|
|
5152
|
+
attempt += 1;
|
|
5153
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
5154
|
+
};
|
|
5155
|
+
// Waiting can fail on the caller's own retry or deadline limits. Classifying
|
|
5156
|
+
// a denial as contention must not cost them the original diagnosis, so hand
|
|
5157
|
+
// the denial back when no further attempt can be scheduled.
|
|
5158
|
+
const retryOrRethrowDenial = async (denial) => {
|
|
5159
|
+
try {
|
|
5160
|
+
await waitForRetry();
|
|
5161
|
+
}
|
|
5162
|
+
catch (waitError) {
|
|
5163
|
+
if (waitError.code === "file_lock_timeout")
|
|
5164
|
+
throw denial;
|
|
5165
|
+
throw waitError;
|
|
5166
|
+
}
|
|
5167
|
+
};
|
|
5168
|
+
try {
|
|
5169
|
+
while (true) {
|
|
5170
|
+
if (!ownsReclaimGuard && (await sidecarReclaimGuardExists(reclaimGuardPath))) {
|
|
5171
|
+
await waitForRetry();
|
|
5172
|
+
continue;
|
|
5173
|
+
}
|
|
5174
|
+
let handle = null;
|
|
5175
|
+
let createdSnapshot = null;
|
|
5176
|
+
let lockFileCreateDenied = false;
|
|
5177
|
+
try {
|
|
5178
|
+
const payload = await options.payload();
|
|
5179
|
+
const { raw, ownershipToken } = serializeSidecarLockPayload(payload);
|
|
5180
|
+
if (options.lockRoot) {
|
|
5181
|
+
const relativeLockPath = relativeSidecarLockPath(options.lockRoot, lockPath);
|
|
5182
|
+
try {
|
|
5183
|
+
await options.lockRoot.create(relativeLockPath, raw, { mkdir: true, mode: 0o600 });
|
|
5184
|
+
}
|
|
5185
|
+
catch (error) {
|
|
5186
|
+
if (error instanceof errors_FsSafeError && error.code === "already-exists") {
|
|
5187
|
+
throw Object.assign(new Error("sidecar lock exists"), { code: "EEXIST" });
|
|
5188
|
+
}
|
|
5189
|
+
throw error;
|
|
5190
|
+
}
|
|
5191
|
+
createdSnapshot = { raw, payload, ownershipToken };
|
|
5192
|
+
handle = (await options.lockRoot.open(relativeLockPath)).handle;
|
|
5193
|
+
}
|
|
5194
|
+
else {
|
|
5195
|
+
try {
|
|
5196
|
+
handle =
|
|
5197
|
+
(await createNativeExclusiveFile(lockPath, 0o600)) ??
|
|
5198
|
+
(await promises_.open(lockPath, "wx"));
|
|
5199
|
+
}
|
|
5200
|
+
catch (createError) {
|
|
5201
|
+
lockFileCreateDenied = isTransientLockFileDenial(createError, lockPath);
|
|
5202
|
+
throw createError;
|
|
5203
|
+
}
|
|
5204
|
+
await handle.writeFile(raw, "utf8");
|
|
5205
|
+
}
|
|
5206
|
+
const snapshot = { raw, payload, stat: await handle.stat(), ownershipToken };
|
|
5207
|
+
const createdHeld = {
|
|
5208
|
+
refCount: 1,
|
|
5209
|
+
reentrantOwner: options.reentrantOwner,
|
|
5210
|
+
handle,
|
|
5211
|
+
lockPath,
|
|
5212
|
+
snapshot,
|
|
5213
|
+
acquiredAt: Date.now(),
|
|
5214
|
+
metadata: options.metadata ?? {},
|
|
5215
|
+
lockRoot: options.lockRoot,
|
|
5216
|
+
parsePayload: options.parsePayload,
|
|
5217
|
+
};
|
|
5218
|
+
context.held.set(normalizedTargetPath, createdHeld);
|
|
5219
|
+
if (ownsReclaimGuard) {
|
|
5220
|
+
try {
|
|
5221
|
+
await releaseSidecarReclaimGuard(context.reclaimGuards, reclaimGuardPath);
|
|
5222
|
+
ownsReclaimGuard = false;
|
|
5223
|
+
}
|
|
5224
|
+
catch (err) {
|
|
5225
|
+
await context.releaseHeldLock(normalizedTargetPath, createdHeld, { force: true });
|
|
5226
|
+
throw err;
|
|
5227
|
+
}
|
|
5228
|
+
}
|
|
5229
|
+
const returnedHandle = context.handleForHeldLock(normalizedTargetPath, createdHeld);
|
|
5230
|
+
const interval = options.compromiseCheckIntervalMs;
|
|
5231
|
+
if (options.onCompromised && interval !== undefined && interval > 0) {
|
|
5232
|
+
createdHeld.compromiseTimer = setInterval(() => {
|
|
5233
|
+
void returnedHandle.verifyStillHeld().then((stillHeld) => {
|
|
5234
|
+
if (!stillHeld && createdHeld.compromiseTimer) {
|
|
5235
|
+
clearInterval(createdHeld.compromiseTimer);
|
|
5236
|
+
createdHeld.compromiseTimer = undefined;
|
|
5237
|
+
options.onCompromised?.({ lockPath, normalizedTargetPath });
|
|
5238
|
+
}
|
|
5239
|
+
});
|
|
5240
|
+
}, interval);
|
|
5241
|
+
createdHeld.compromiseTimer.unref();
|
|
5242
|
+
}
|
|
5243
|
+
return returnedHandle;
|
|
5244
|
+
}
|
|
5245
|
+
catch (err) {
|
|
5246
|
+
if (handle) {
|
|
5247
|
+
const failedSnapshot = { payload: null };
|
|
5248
|
+
try {
|
|
5249
|
+
failedSnapshot.stat = await handle.stat();
|
|
5250
|
+
}
|
|
5251
|
+
catch {
|
|
5252
|
+
// Best-effort cleanup of a failed exclusive create.
|
|
5253
|
+
}
|
|
5254
|
+
const current = context.held.get(normalizedTargetPath);
|
|
5255
|
+
if (current?.handle === handle) {
|
|
5256
|
+
context.held.delete(normalizedTargetPath);
|
|
5257
|
+
}
|
|
5258
|
+
await handle.close().catch(() => undefined);
|
|
5259
|
+
// The file may be empty or partial JSON, so remove by the identity
|
|
5260
|
+
// captured from our exclusive handle rather than by pathname alone.
|
|
5261
|
+
await removeSidecarLockIfUnchanged(lockPath, failedSnapshot, {
|
|
5262
|
+
lockRoot: options.lockRoot,
|
|
5263
|
+
parsePayload: options.parsePayload,
|
|
5264
|
+
});
|
|
5265
|
+
}
|
|
5266
|
+
else if (createdSnapshot) {
|
|
5267
|
+
await removeSidecarLockIfUnchanged(lockPath, createdSnapshot, {
|
|
5268
|
+
lockRoot: options.lockRoot,
|
|
5269
|
+
parsePayload: options.parsePayload,
|
|
5270
|
+
});
|
|
5271
|
+
}
|
|
5272
|
+
if (lockFileCreateDenied && withinDenialBudget()) {
|
|
5273
|
+
await retryOrRethrowDenial(err);
|
|
5274
|
+
continue;
|
|
5275
|
+
}
|
|
5276
|
+
if (err.code !== "EEXIST") {
|
|
5277
|
+
throw err;
|
|
5278
|
+
}
|
|
5279
|
+
if (ownsReclaimGuard) {
|
|
5280
|
+
await releaseSidecarReclaimGuard(context.reclaimGuards, reclaimGuardPath);
|
|
5281
|
+
ownsReclaimGuard = false;
|
|
5282
|
+
continue;
|
|
5283
|
+
}
|
|
5284
|
+
const nowMs = Date.now();
|
|
5285
|
+
let snapshot;
|
|
5286
|
+
try {
|
|
5287
|
+
snapshot = await readSidecarLockSnapshot(lockPath, {
|
|
5288
|
+
lockRoot: options.lockRoot,
|
|
5289
|
+
parsePayload: options.parsePayload,
|
|
5290
|
+
rejectNonFile: true,
|
|
5291
|
+
});
|
|
5292
|
+
}
|
|
5293
|
+
catch (readErr) {
|
|
5294
|
+
if (!isTransientLockFileDenial(readErr, lockPath) || !withinDenialBudget())
|
|
5295
|
+
throw readErr;
|
|
5296
|
+
await retryOrRethrowDenial(readErr);
|
|
5297
|
+
continue;
|
|
5298
|
+
}
|
|
5299
|
+
if (!snapshot) {
|
|
5300
|
+
continue;
|
|
5301
|
+
}
|
|
5302
|
+
if (context.held.has(normalizedTargetPath)) {
|
|
5303
|
+
await waitForRetry();
|
|
5304
|
+
continue;
|
|
5305
|
+
}
|
|
5306
|
+
const shouldReclaim = options.shouldReclaim ?? defaultSidecarLockShouldReclaim;
|
|
5307
|
+
if (await shouldReclaim({
|
|
5308
|
+
lockPath,
|
|
5309
|
+
normalizedTargetPath,
|
|
5310
|
+
payload: snapshot?.payload ?? null,
|
|
5311
|
+
staleMs: options.staleMs,
|
|
5312
|
+
nowMs,
|
|
5313
|
+
heldByThisProcess: context.held.has(normalizedTargetPath),
|
|
5314
|
+
})) {
|
|
5315
|
+
if (!(await sidecarLockSnapshotStillPresent(lockPath, snapshot, {
|
|
5316
|
+
lockRoot: options.lockRoot,
|
|
5317
|
+
parsePayload: options.parsePayload,
|
|
5318
|
+
}))) {
|
|
5319
|
+
continue;
|
|
5320
|
+
}
|
|
5321
|
+
const staleRecovery = options.staleRecovery ?? "fail-closed";
|
|
5322
|
+
if (staleRecovery === "remove-if-unchanged") {
|
|
5323
|
+
if (!(await tryAcquireSidecarReclaimGuard(context.reclaimGuards, reclaimGuardPath))) {
|
|
5324
|
+
await waitForRetry();
|
|
5325
|
+
continue;
|
|
5326
|
+
}
|
|
5327
|
+
ownsReclaimGuard = true;
|
|
5328
|
+
const removal = await removeStaleSidecarLockIfAllowed({
|
|
5329
|
+
lockPath,
|
|
5330
|
+
normalizedTargetPath,
|
|
5331
|
+
snapshot,
|
|
5332
|
+
shouldRemoveStaleLock: options.shouldRemoveStaleLock,
|
|
5333
|
+
lockRoot: options.lockRoot,
|
|
5334
|
+
parsePayload: options.parsePayload,
|
|
5335
|
+
});
|
|
5336
|
+
if (removal === "removed" || removal === "changed") {
|
|
5337
|
+
continue;
|
|
5338
|
+
}
|
|
5339
|
+
await releaseSidecarReclaimGuard(context.reclaimGuards, reclaimGuardPath);
|
|
5340
|
+
ownsReclaimGuard = false;
|
|
5341
|
+
}
|
|
5342
|
+
throw Object.assign(new Error(`file lock stale for ${normalizedTargetPath}`), {
|
|
5343
|
+
code: "file_lock_stale",
|
|
5344
|
+
lockPath,
|
|
5345
|
+
normalizedTargetPath,
|
|
5346
|
+
});
|
|
5347
|
+
}
|
|
5348
|
+
await waitForRetry();
|
|
5349
|
+
}
|
|
5350
|
+
}
|
|
5351
|
+
}
|
|
5352
|
+
finally {
|
|
5353
|
+
if (ownsReclaimGuard) {
|
|
5354
|
+
await releaseSidecarReclaimGuard(context.reclaimGuards, reclaimGuardPath).catch(() => undefined);
|
|
5355
|
+
}
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
|
|
5359
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.js
|
|
5360
|
+
|
|
5361
|
+
function createSidecarLockHandle(params) {
|
|
5362
|
+
let released = false;
|
|
5363
|
+
const release = async () => {
|
|
5364
|
+
if (released)
|
|
5365
|
+
return;
|
|
5366
|
+
released = true;
|
|
5367
|
+
await params.release();
|
|
5368
|
+
};
|
|
5369
|
+
return {
|
|
5370
|
+
lockPath: params.lockPath,
|
|
5371
|
+
normalizedTargetPath: params.normalizedTargetPath,
|
|
5372
|
+
verifyStillHeld: params.verifyStillHeld,
|
|
5373
|
+
release,
|
|
5374
|
+
[Symbol.asyncDispose]: release,
|
|
5375
|
+
};
|
|
5376
|
+
}
|
|
5377
|
+
function createHeldSidecarLockHandle(params) {
|
|
5378
|
+
return createSidecarLockHandle({
|
|
5379
|
+
lockPath: params.held.lockPath,
|
|
5380
|
+
normalizedTargetPath: params.normalizedTargetPath,
|
|
5381
|
+
verifyStillHeld: async () => await sidecarLockSnapshotStillPresent(params.held.lockPath, params.held.snapshot, {
|
|
5382
|
+
lockRoot: params.held.lockRoot,
|
|
5383
|
+
parsePayload: params.held.parsePayload,
|
|
5384
|
+
}),
|
|
5385
|
+
release: params.release,
|
|
5386
|
+
});
|
|
5387
|
+
}
|
|
5388
|
+
|
|
5389
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/sidecar-lock.js
|
|
5390
|
+
|
|
5391
|
+
|
|
4899
5392
|
|
|
4900
5393
|
|
|
4901
5394
|
|
|
4902
5395
|
const GLOBAL_STATE_KEY = Symbol.for("fsSafe.sidecarLockManagers");
|
|
5396
|
+
const GLOBAL_CLEANUP_KEY = Symbol.for("fsSafe.sidecarLockCleanupRegistered");
|
|
5397
|
+
const GLOBAL_CLEANUP_HANDLER_KEY = Symbol.for("fsSafe.sidecarLockCleanupHandler");
|
|
4903
5398
|
function getGlobalManagers() {
|
|
4904
5399
|
const globalWithState = globalThis;
|
|
4905
5400
|
if (!globalWithState[GLOBAL_STATE_KEY]) {
|
|
@@ -4971,17 +5466,6 @@ function snapshotMatchesSync(lockPath, observed) {
|
|
|
4971
5466
|
}
|
|
4972
5467
|
}
|
|
4973
5468
|
}
|
|
4974
|
-
async function resolveNormalizedTargetPath(targetPath) {
|
|
4975
|
-
const resolved = external_node_path_.resolve(targetPath);
|
|
4976
|
-
const dir = external_node_path_.dirname(resolved);
|
|
4977
|
-
await promises_.mkdir(dir, { recursive: true });
|
|
4978
|
-
try {
|
|
4979
|
-
return external_node_path_.join(await promises_.realpath(dir), external_node_path_.basename(resolved));
|
|
4980
|
-
}
|
|
4981
|
-
catch {
|
|
4982
|
-
return resolved;
|
|
4983
|
-
}
|
|
4984
|
-
}
|
|
4985
5469
|
function releaseAllReclaimGuardsSync(state) {
|
|
4986
5470
|
for (const reclaimGuardPath of state.reclaimGuards) {
|
|
4987
5471
|
try {
|
|
@@ -5008,6 +5492,19 @@ function releaseAllLocksSync(state) {
|
|
|
5008
5492
|
}
|
|
5009
5493
|
releaseAllReclaimGuardsSync(state);
|
|
5010
5494
|
}
|
|
5495
|
+
function ensureGlobalExitCleanupRegistered() {
|
|
5496
|
+
const globalWithCleanup = globalThis;
|
|
5497
|
+
if (globalWithCleanup[GLOBAL_CLEANUP_KEY])
|
|
5498
|
+
return;
|
|
5499
|
+
globalWithCleanup[GLOBAL_CLEANUP_KEY] = true;
|
|
5500
|
+
const cleanup = () => {
|
|
5501
|
+
for (const state of getGlobalManagers().values()) {
|
|
5502
|
+
releaseAllLocksSync(state);
|
|
5503
|
+
}
|
|
5504
|
+
};
|
|
5505
|
+
globalWithCleanup[GLOBAL_CLEANUP_HANDLER_KEY] = cleanup;
|
|
5506
|
+
process.on("exit", cleanup);
|
|
5507
|
+
}
|
|
5011
5508
|
async function releaseHeldLock(state, normalizedTargetPath, held, options = {}) {
|
|
5012
5509
|
const current = state.held.get(normalizedTargetPath);
|
|
5013
5510
|
if (current !== held) {
|
|
@@ -5056,217 +5553,18 @@ function handleForHeldLock(state, normalizedTargetPath, held) {
|
|
|
5056
5553
|
function createSidecarLockManager(key) {
|
|
5057
5554
|
const state = resolveManagerState(key);
|
|
5058
5555
|
function ensureExitCleanupRegistered() {
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
process.on("exit", () => releaseAllLocksSync(state));
|
|
5063
|
-
return;
|
|
5064
|
-
}
|
|
5065
|
-
if (!state.reclaimCleanupRegistered) {
|
|
5066
|
-
state.reclaimCleanupRegistered = true;
|
|
5067
|
-
process.on("exit", () => releaseAllReclaimGuardsSync(state));
|
|
5068
|
-
}
|
|
5556
|
+
state.cleanupRegistered = true;
|
|
5557
|
+
state.reclaimCleanupRegistered = true;
|
|
5558
|
+
ensureGlobalExitCleanupRegistered();
|
|
5069
5559
|
}
|
|
5070
5560
|
async function acquire(options) {
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
options.reentrantOwner === held.reentrantOwner) {
|
|
5079
|
-
held.refCount += 1;
|
|
5080
|
-
return handleForHeldLock(state, normalizedTargetPath, held);
|
|
5081
|
-
}
|
|
5082
|
-
const startedAt = Date.now();
|
|
5083
|
-
const retry = options.retry ?? {};
|
|
5084
|
-
const maxRetries = options.timeoutMs === Number.POSITIVE_INFINITY ? undefined : retry.retries;
|
|
5085
|
-
const reclaimGuardPath = `${lockPath}.reclaim`;
|
|
5086
|
-
let ownsReclaimGuard = false;
|
|
5087
|
-
let attempt = 0;
|
|
5088
|
-
const waitForRetry = async () => {
|
|
5089
|
-
const elapsed = Date.now() - startedAt;
|
|
5090
|
-
if ((options.timeoutMs !== undefined &&
|
|
5091
|
-
options.timeoutMs !== Number.POSITIVE_INFINITY &&
|
|
5092
|
-
elapsed >= options.timeoutMs) ||
|
|
5093
|
-
(maxRetries !== undefined && attempt >= maxRetries)) {
|
|
5094
|
-
throw Object.assign(new Error(`file lock timeout for ${normalizedTargetPath}`), {
|
|
5095
|
-
code: "file_lock_timeout",
|
|
5096
|
-
lockPath,
|
|
5097
|
-
normalizedTargetPath,
|
|
5098
|
-
});
|
|
5099
|
-
}
|
|
5100
|
-
const remaining = options.timeoutMs === undefined || options.timeoutMs === Number.POSITIVE_INFINITY
|
|
5101
|
-
? Number.POSITIVE_INFINITY
|
|
5102
|
-
: Math.max(0, options.timeoutMs - elapsed);
|
|
5103
|
-
const delay = Math.min(computeSidecarLockDelayMs(retry, attempt), remaining);
|
|
5104
|
-
attempt += 1;
|
|
5105
|
-
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
5106
|
-
};
|
|
5107
|
-
try {
|
|
5108
|
-
while (true) {
|
|
5109
|
-
if (!ownsReclaimGuard && (await sidecarReclaimGuardExists(reclaimGuardPath))) {
|
|
5110
|
-
await waitForRetry();
|
|
5111
|
-
continue;
|
|
5112
|
-
}
|
|
5113
|
-
let handle = null;
|
|
5114
|
-
try {
|
|
5115
|
-
const payload = await options.payload();
|
|
5116
|
-
const { raw, ownershipToken } = serializeSidecarLockPayload(payload);
|
|
5117
|
-
if (options.lockRoot) {
|
|
5118
|
-
const relativeLockPath = relativeSidecarLockPath(options.lockRoot, lockPath);
|
|
5119
|
-
try {
|
|
5120
|
-
await options.lockRoot.create(relativeLockPath, raw, { mkdir: true, mode: 0o600 });
|
|
5121
|
-
}
|
|
5122
|
-
catch (error) {
|
|
5123
|
-
if (error instanceof errors_FsSafeError && error.code === "already-exists") {
|
|
5124
|
-
throw Object.assign(new Error("sidecar lock exists"), { code: "EEXIST" });
|
|
5125
|
-
}
|
|
5126
|
-
throw error;
|
|
5127
|
-
}
|
|
5128
|
-
handle = (await options.lockRoot.open(relativeLockPath)).handle;
|
|
5129
|
-
}
|
|
5130
|
-
else {
|
|
5131
|
-
handle = (await createNativeExclusiveFile(lockPath, 0o600)) ?? await promises_.open(lockPath, "wx");
|
|
5132
|
-
await handle.writeFile(raw, "utf8");
|
|
5133
|
-
}
|
|
5134
|
-
const snapshot = { raw, payload, stat: await handle.stat(), ownershipToken };
|
|
5135
|
-
const createdHeld = {
|
|
5136
|
-
refCount: 1,
|
|
5137
|
-
reentrantOwner: options.reentrantOwner,
|
|
5138
|
-
handle,
|
|
5139
|
-
lockPath,
|
|
5140
|
-
snapshot,
|
|
5141
|
-
acquiredAt: Date.now(),
|
|
5142
|
-
metadata: options.metadata ?? {},
|
|
5143
|
-
lockRoot: options.lockRoot,
|
|
5144
|
-
parsePayload: options.parsePayload,
|
|
5145
|
-
};
|
|
5146
|
-
state.held.set(normalizedTargetPath, createdHeld);
|
|
5147
|
-
if (ownsReclaimGuard) {
|
|
5148
|
-
try {
|
|
5149
|
-
await releaseSidecarReclaimGuard(state.reclaimGuards, reclaimGuardPath);
|
|
5150
|
-
ownsReclaimGuard = false;
|
|
5151
|
-
}
|
|
5152
|
-
catch (err) {
|
|
5153
|
-
await releaseHeldLock(state, normalizedTargetPath, createdHeld, { force: true });
|
|
5154
|
-
throw err;
|
|
5155
|
-
}
|
|
5156
|
-
}
|
|
5157
|
-
const returnedHandle = handleForHeldLock(state, normalizedTargetPath, createdHeld);
|
|
5158
|
-
const interval = options.compromiseCheckIntervalMs;
|
|
5159
|
-
if (options.onCompromised && interval !== undefined && interval > 0) {
|
|
5160
|
-
createdHeld.compromiseTimer = setInterval(() => {
|
|
5161
|
-
void returnedHandle.verifyStillHeld().then((stillHeld) => {
|
|
5162
|
-
if (!stillHeld && createdHeld.compromiseTimer) {
|
|
5163
|
-
clearInterval(createdHeld.compromiseTimer);
|
|
5164
|
-
createdHeld.compromiseTimer = undefined;
|
|
5165
|
-
options.onCompromised?.({ lockPath, normalizedTargetPath });
|
|
5166
|
-
}
|
|
5167
|
-
});
|
|
5168
|
-
}, interval);
|
|
5169
|
-
createdHeld.compromiseTimer.unref();
|
|
5170
|
-
}
|
|
5171
|
-
return returnedHandle;
|
|
5172
|
-
}
|
|
5173
|
-
catch (err) {
|
|
5174
|
-
if (handle) {
|
|
5175
|
-
const failedSnapshot = { payload: null };
|
|
5176
|
-
try {
|
|
5177
|
-
failedSnapshot.stat = await handle.stat();
|
|
5178
|
-
}
|
|
5179
|
-
catch {
|
|
5180
|
-
// Best-effort cleanup of a failed exclusive create.
|
|
5181
|
-
}
|
|
5182
|
-
const current = state.held.get(normalizedTargetPath);
|
|
5183
|
-
if (current?.handle === handle) {
|
|
5184
|
-
state.held.delete(normalizedTargetPath);
|
|
5185
|
-
}
|
|
5186
|
-
// If payload serialization/write fails, the file may be empty or
|
|
5187
|
-
// partial JSON, so remove while our exclusive handle is still open.
|
|
5188
|
-
if (!options.lockRoot) {
|
|
5189
|
-
await promises_.rm(lockPath, { force: true }).catch(() => undefined);
|
|
5190
|
-
}
|
|
5191
|
-
await handle.close().catch(() => undefined);
|
|
5192
|
-
// Windows can refuse removing an open file; retry after close but
|
|
5193
|
-
// only if the path still points at the file identity we created.
|
|
5194
|
-
await removeSidecarLockIfUnchanged(lockPath, failedSnapshot, {
|
|
5195
|
-
lockRoot: options.lockRoot,
|
|
5196
|
-
parsePayload: options.parsePayload,
|
|
5197
|
-
});
|
|
5198
|
-
}
|
|
5199
|
-
if (err.code !== "EEXIST") {
|
|
5200
|
-
throw err;
|
|
5201
|
-
}
|
|
5202
|
-
if (ownsReclaimGuard) {
|
|
5203
|
-
await releaseSidecarReclaimGuard(state.reclaimGuards, reclaimGuardPath);
|
|
5204
|
-
ownsReclaimGuard = false;
|
|
5205
|
-
continue;
|
|
5206
|
-
}
|
|
5207
|
-
const nowMs = Date.now();
|
|
5208
|
-
const snapshot = await readSidecarLockSnapshot(lockPath, {
|
|
5209
|
-
lockRoot: options.lockRoot,
|
|
5210
|
-
parsePayload: options.parsePayload,
|
|
5211
|
-
});
|
|
5212
|
-
if (!snapshot) {
|
|
5213
|
-
continue;
|
|
5214
|
-
}
|
|
5215
|
-
if (state.held.has(normalizedTargetPath)) {
|
|
5216
|
-
await waitForRetry();
|
|
5217
|
-
continue;
|
|
5218
|
-
}
|
|
5219
|
-
const shouldReclaim = options.shouldReclaim ?? defaultSidecarLockShouldReclaim;
|
|
5220
|
-
if (await shouldReclaim({
|
|
5221
|
-
lockPath,
|
|
5222
|
-
normalizedTargetPath,
|
|
5223
|
-
payload: snapshot?.payload ?? null,
|
|
5224
|
-
staleMs: options.staleMs,
|
|
5225
|
-
nowMs,
|
|
5226
|
-
heldByThisProcess: state.held.has(normalizedTargetPath),
|
|
5227
|
-
})) {
|
|
5228
|
-
if (!(await sidecarLockSnapshotStillPresent(lockPath, snapshot, {
|
|
5229
|
-
lockRoot: options.lockRoot,
|
|
5230
|
-
parsePayload: options.parsePayload,
|
|
5231
|
-
}))) {
|
|
5232
|
-
continue;
|
|
5233
|
-
}
|
|
5234
|
-
const staleRecovery = options.staleRecovery ?? "fail-closed";
|
|
5235
|
-
if (staleRecovery === "remove-if-unchanged") {
|
|
5236
|
-
if (!(await tryAcquireSidecarReclaimGuard(state.reclaimGuards, reclaimGuardPath))) {
|
|
5237
|
-
await waitForRetry();
|
|
5238
|
-
continue;
|
|
5239
|
-
}
|
|
5240
|
-
ownsReclaimGuard = true;
|
|
5241
|
-
const removal = await removeStaleSidecarLockIfAllowed({
|
|
5242
|
-
lockPath,
|
|
5243
|
-
normalizedTargetPath,
|
|
5244
|
-
snapshot,
|
|
5245
|
-
shouldRemoveStaleLock: options.shouldRemoveStaleLock,
|
|
5246
|
-
lockRoot: options.lockRoot,
|
|
5247
|
-
parsePayload: options.parsePayload,
|
|
5248
|
-
});
|
|
5249
|
-
if (removal === "removed" || removal === "changed") {
|
|
5250
|
-
continue;
|
|
5251
|
-
}
|
|
5252
|
-
await releaseSidecarReclaimGuard(state.reclaimGuards, reclaimGuardPath);
|
|
5253
|
-
ownsReclaimGuard = false;
|
|
5254
|
-
}
|
|
5255
|
-
throw Object.assign(new Error(`file lock stale for ${normalizedTargetPath}`), {
|
|
5256
|
-
code: "file_lock_stale",
|
|
5257
|
-
lockPath,
|
|
5258
|
-
normalizedTargetPath,
|
|
5259
|
-
});
|
|
5260
|
-
}
|
|
5261
|
-
await waitForRetry();
|
|
5262
|
-
}
|
|
5263
|
-
}
|
|
5264
|
-
}
|
|
5265
|
-
finally {
|
|
5266
|
-
if (ownsReclaimGuard) {
|
|
5267
|
-
await releaseSidecarReclaimGuard(state.reclaimGuards, reclaimGuardPath).catch(() => undefined);
|
|
5268
|
-
}
|
|
5269
|
-
}
|
|
5561
|
+
return await acquireSidecarLock(options, {
|
|
5562
|
+
held: state.held,
|
|
5563
|
+
reclaimGuards: state.reclaimGuards,
|
|
5564
|
+
ensureExitCleanupRegistered,
|
|
5565
|
+
handleForHeldLock: (normalizedTargetPath, held) => handleForHeldLock(state, normalizedTargetPath, held),
|
|
5566
|
+
releaseHeldLock: async (normalizedTargetPath, held, releaseOptions) => await releaseHeldLock(state, normalizedTargetPath, held, releaseOptions),
|
|
5567
|
+
});
|
|
5270
5568
|
}
|
|
5271
5569
|
async function withLock(options, fn) {
|
|
5272
5570
|
const lock = await acquire(options);
|
|
@@ -5302,21 +5600,6 @@ async function withSidecarLock(targetPath, options, fn) {
|
|
|
5302
5600
|
return await manager.withLock({ ...acquireOptions, targetPath }, fn);
|
|
5303
5601
|
}
|
|
5304
5602
|
|
|
5305
|
-
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/test-hooks.js
|
|
5306
|
-
let test_hooks_fsSafeTestHooks;
|
|
5307
|
-
function allowFsSafeTestHooks() {
|
|
5308
|
-
return false || process.env.VITEST === "true";
|
|
5309
|
-
}
|
|
5310
|
-
function getFsSafeTestHooks() {
|
|
5311
|
-
return test_hooks_fsSafeTestHooks;
|
|
5312
|
-
}
|
|
5313
|
-
function __setFsSafeTestHooksForTest(hooks) {
|
|
5314
|
-
if (hooks && !allowFsSafeTestHooks()) {
|
|
5315
|
-
throw new Error("__setFsSafeTestHooksForTest is only available in tests");
|
|
5316
|
-
}
|
|
5317
|
-
test_hooks_fsSafeTestHooks = hooks;
|
|
5318
|
-
}
|
|
5319
|
-
|
|
5320
5603
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/pinned-write.js
|
|
5321
5604
|
|
|
5322
5605
|
|
|
@@ -5389,7 +5672,7 @@ async function runPinnedWriteHelper(params) {
|
|
|
5389
5672
|
return await runPinnedWriteFallback(params);
|
|
5390
5673
|
}
|
|
5391
5674
|
const native = getNativeBinding();
|
|
5392
|
-
if (native
|
|
5675
|
+
if (native) {
|
|
5393
5676
|
return await runPinnedWriteNative(native, params);
|
|
5394
5677
|
}
|
|
5395
5678
|
return await runPinnedWriteFallback(params);
|
|
@@ -5427,6 +5710,7 @@ async function runPinnedWriteFallback(params) {
|
|
|
5427
5710
|
parentPath = await mkdirPathComponentsWithGuards({
|
|
5428
5711
|
rootReal: params.rootPath,
|
|
5429
5712
|
targetPath: parentPath,
|
|
5713
|
+
beforeComponent: async (componentPath) => await getFsSafeTestHooks()?.beforeRootFallbackMutation?.("mkdir", componentPath),
|
|
5430
5714
|
});
|
|
5431
5715
|
}
|
|
5432
5716
|
const parentGuard = params.mkdir
|
|
@@ -5566,77 +5850,135 @@ async function runPinnedWriteFallback(params) {
|
|
|
5566
5850
|
return { dev: targetStat.dev, ino: targetStat.ino };
|
|
5567
5851
|
}
|
|
5568
5852
|
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5853
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/error-detail.js
|
|
5854
|
+
const UNSAFE_ERROR_DETAIL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f\u2028\u2029]/gu;
|
|
5855
|
+
function formatErrorDetail(value) {
|
|
5856
|
+
return value.replace(UNSAFE_ERROR_DETAIL_CHARACTERS, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
5857
|
+
}
|
|
5572
5858
|
|
|
5859
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/root-path-symlink.js
|
|
5573
5860
|
|
|
5574
5861
|
|
|
5575
5862
|
|
|
5576
|
-
|
|
5577
|
-
|
|
5863
|
+
|
|
5864
|
+
|
|
5865
|
+
|
|
5866
|
+
function normalizeSymlinkResolutionError(error) {
|
|
5867
|
+
if (isSymlinkOpenError(error)) {
|
|
5868
|
+
throw new errors_FsSafeError("symlink", "symlink path could not be resolved", {
|
|
5869
|
+
cause: error instanceof Error ? error : undefined,
|
|
5870
|
+
});
|
|
5871
|
+
}
|
|
5872
|
+
if (!path_isNotFoundPathError(error))
|
|
5873
|
+
throw error;
|
|
5578
5874
|
}
|
|
5579
|
-
async function
|
|
5875
|
+
async function resolveSymlinkHopPath(symlinkPath) {
|
|
5580
5876
|
try {
|
|
5581
|
-
await promises_.
|
|
5582
|
-
return true;
|
|
5877
|
+
return external_node_path_.resolve(await promises_.realpath(symlinkPath));
|
|
5583
5878
|
}
|
|
5584
5879
|
catch (error) {
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
throw error;
|
|
5880
|
+
normalizeSymlinkResolutionError(error);
|
|
5881
|
+
const linkTarget = await promises_.readlink(symlinkPath);
|
|
5882
|
+
return resolvePathViaExistingAncestor(external_node_path_.resolve(external_node_path_.dirname(symlinkPath), linkTarget));
|
|
5589
5883
|
}
|
|
5590
5884
|
}
|
|
5591
|
-
|
|
5592
|
-
const normalized = external_node_path_.resolve(targetPath);
|
|
5593
|
-
let cursor = normalized;
|
|
5594
|
-
const missingSuffix = [];
|
|
5595
|
-
while (!isFilesystemRoot(cursor) && !(await root_path_existing_pathExists(cursor))) {
|
|
5596
|
-
missingSuffix.unshift(external_node_path_.basename(cursor));
|
|
5597
|
-
const parent = external_node_path_.dirname(cursor);
|
|
5598
|
-
if (parent === cursor) {
|
|
5599
|
-
break;
|
|
5600
|
-
}
|
|
5601
|
-
cursor = parent;
|
|
5602
|
-
}
|
|
5603
|
-
if (!(await root_path_existing_pathExists(cursor))) {
|
|
5604
|
-
return normalized;
|
|
5605
|
-
}
|
|
5885
|
+
function root_path_symlink_resolveSymlinkHopPathSync(symlinkPath) {
|
|
5606
5886
|
try {
|
|
5607
|
-
|
|
5608
|
-
return missingSuffix.length === 0
|
|
5609
|
-
? resolvedAncestor
|
|
5610
|
-
: external_node_path_.resolve(resolvedAncestor, ...missingSuffix);
|
|
5887
|
+
return path.resolve(fs.realpathSync(symlinkPath));
|
|
5611
5888
|
}
|
|
5612
|
-
catch {
|
|
5613
|
-
|
|
5889
|
+
catch (error) {
|
|
5890
|
+
normalizeSymlinkResolutionError(error);
|
|
5891
|
+
const linkTarget = fs.readlinkSync(symlinkPath);
|
|
5892
|
+
return resolvePathViaExistingAncestorSync(path.resolve(path.dirname(symlinkPath), linkTarget));
|
|
5614
5893
|
}
|
|
5615
5894
|
}
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5895
|
+
|
|
5896
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/safe-path-segment.js
|
|
5897
|
+
|
|
5898
|
+
const SAFE_PATH_SEGMENT_PATTERN = /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/;
|
|
5899
|
+
const SAFE_DOT_PREFIX_PATH_SEGMENT_PATTERN = /^[A-Za-z0-9._-]+$/;
|
|
5900
|
+
// Windows treats "C:name" as relative to the drive's current directory even
|
|
5901
|
+
// though path.win32.isAbsolute() reports false.
|
|
5902
|
+
const DRIVE_RELATIVE_PREFIX = /^[A-Za-z]:(?![\\/])/;
|
|
5903
|
+
const HYPHEN_CHAR_CODE = 0x2d;
|
|
5904
|
+
function safe_path_segment_isDriveRelativePath(value) {
|
|
5905
|
+
return DRIVE_RELATIVE_PREFIX.test(value);
|
|
5906
|
+
}
|
|
5907
|
+
function assertNoDriveRelativePathSegments(value, label) {
|
|
5908
|
+
if (value.split("/").some(safe_path_segment_isDriveRelativePath)) {
|
|
5909
|
+
throw new errors_FsSafeError("invalid-path", `${label} must not contain a drive letter`);
|
|
5627
5910
|
}
|
|
5628
|
-
|
|
5629
|
-
|
|
5911
|
+
return value;
|
|
5912
|
+
}
|
|
5913
|
+
function trimHyphenEdges(value) {
|
|
5914
|
+
let start = 0;
|
|
5915
|
+
let end = value.length;
|
|
5916
|
+
while (start < end && value.charCodeAt(start) === HYPHEN_CHAR_CODE) {
|
|
5917
|
+
start += 1;
|
|
5630
5918
|
}
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
return missingSuffix.length === 0
|
|
5634
|
-
? resolvedAncestor
|
|
5635
|
-
: path.resolve(resolvedAncestor, ...missingSuffix);
|
|
5919
|
+
while (end > start && value.charCodeAt(end - 1) === HYPHEN_CHAR_CODE) {
|
|
5920
|
+
end -= 1;
|
|
5636
5921
|
}
|
|
5637
|
-
|
|
5638
|
-
|
|
5922
|
+
return start === 0 && end === value.length ? value : value.slice(start, end);
|
|
5923
|
+
}
|
|
5924
|
+
function isSafePathSegment(segment, options = {}) {
|
|
5925
|
+
return (segment !== "" &&
|
|
5926
|
+
segment !== "." &&
|
|
5927
|
+
segment !== ".." &&
|
|
5928
|
+
!segment.includes("/") &&
|
|
5929
|
+
!segment.includes("\\") &&
|
|
5930
|
+
!segment.includes("\0") &&
|
|
5931
|
+
(options.allowDotPrefix === true || !segment.startsWith(".")) &&
|
|
5932
|
+
(options.allowDotPrefix === true
|
|
5933
|
+
? SAFE_DOT_PREFIX_PATH_SEGMENT_PATTERN.test(segment)
|
|
5934
|
+
: SAFE_PATH_SEGMENT_PATTERN.test(segment)));
|
|
5935
|
+
}
|
|
5936
|
+
function assertSafePathSegment(segment, options = {}) {
|
|
5937
|
+
// Validate the exact value callers will later join into paths; trimming here
|
|
5938
|
+
// would let whitespace-padded ids pass and then be used verbatim.
|
|
5939
|
+
if (!isSafePathSegment(segment, options)) {
|
|
5940
|
+
throw new FsSafeError("invalid-path", `${options.label ?? "path segment"} must be a safe path segment`);
|
|
5941
|
+
}
|
|
5942
|
+
return segment;
|
|
5943
|
+
}
|
|
5944
|
+
function sanitizeSafePathSegment(value, fallback, options = {}) {
|
|
5945
|
+
const sanitized = value
|
|
5946
|
+
.trim()
|
|
5947
|
+
.replace(/[\\/]+/g, "-")
|
|
5948
|
+
.replace(/\0/g, "")
|
|
5949
|
+
.replace(/[^A-Za-z0-9._-]+/g, "-");
|
|
5950
|
+
const trimmed = trimHyphenEdges(sanitized);
|
|
5951
|
+
if (isSafePathSegment(trimmed, options)) {
|
|
5952
|
+
return trimmed;
|
|
5953
|
+
}
|
|
5954
|
+
return assertSafePathSegment(fallback, { ...options, label: "fallback path segment" });
|
|
5955
|
+
}
|
|
5956
|
+
function assertSafePathPrefix(prefix, options = {}) {
|
|
5957
|
+
// Prefixes are often derived from safe filenames. Normalize harmless
|
|
5958
|
+
// filename characters first, but still reject real path-control bytes.
|
|
5959
|
+
if (prefix.includes("/") || prefix.includes("\\") || prefix.includes("\0")) {
|
|
5960
|
+
return assertSafePathSegment(prefix, {
|
|
5961
|
+
allowDotPrefix: true,
|
|
5962
|
+
...options,
|
|
5963
|
+
label: options.label ?? "path prefix",
|
|
5964
|
+
});
|
|
5639
5965
|
}
|
|
5966
|
+
return assertSafePathSegment(prefix.replace(/[^A-Za-z0-9._-]+/g, "-"), {
|
|
5967
|
+
allowDotPrefix: true,
|
|
5968
|
+
...options,
|
|
5969
|
+
label: options.label ?? "path prefix",
|
|
5970
|
+
});
|
|
5971
|
+
}
|
|
5972
|
+
|
|
5973
|
+
// EXTERNAL MODULE: external "node:os"
|
|
5974
|
+
var external_node_os_ = __webpack_require__(8161);
|
|
5975
|
+
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/short-path.js
|
|
5976
|
+
|
|
5977
|
+
|
|
5978
|
+
function shortPath(value) {
|
|
5979
|
+
const home = external_node_os_.homedir();
|
|
5980
|
+
const shortened = value.startsWith(home) ? `~${value.slice(home.length)}` : value;
|
|
5981
|
+
return formatErrorDetail(shortened);
|
|
5640
5982
|
}
|
|
5641
5983
|
|
|
5642
5984
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/root-path.js
|
|
@@ -5647,6 +5989,10 @@ function root_path_existing_resolvePathViaExistingAncestorSync(targetPath) {
|
|
|
5647
5989
|
|
|
5648
5990
|
|
|
5649
5991
|
|
|
5992
|
+
|
|
5993
|
+
|
|
5994
|
+
|
|
5995
|
+
|
|
5650
5996
|
const ROOT_PATH_ALIAS_POLICIES = {
|
|
5651
5997
|
strict: Object.freeze({
|
|
5652
5998
|
allowFinalSymlinkForUnlink: false,
|
|
@@ -5658,11 +6004,20 @@ const ROOT_PATH_ALIAS_POLICIES = {
|
|
|
5658
6004
|
}),
|
|
5659
6005
|
};
|
|
5660
6006
|
async function resolveRootPath(params) {
|
|
6007
|
+
try {
|
|
6008
|
+
return await resolveRootPathInternal(params);
|
|
6009
|
+
}
|
|
6010
|
+
catch (error) {
|
|
6011
|
+
throw sanitizeRootPathError(error);
|
|
6012
|
+
}
|
|
6013
|
+
}
|
|
6014
|
+
async function resolveRootPathInternal(params) {
|
|
6015
|
+
assertValidRootPathInputs(params);
|
|
5661
6016
|
const rootPath = external_node_path_.resolve(params.rootPath);
|
|
5662
6017
|
const absolutePath = external_node_path_.resolve(params.absolutePath);
|
|
5663
6018
|
const rootCanonicalPath = params.rootCanonicalPath
|
|
5664
6019
|
? external_node_path_.resolve(params.rootCanonicalPath)
|
|
5665
|
-
: await
|
|
6020
|
+
: await resolvePathViaExistingAncestor(rootPath);
|
|
5666
6021
|
const context = createBoundaryResolutionContext({
|
|
5667
6022
|
resolveParams: params,
|
|
5668
6023
|
rootPath,
|
|
@@ -5688,6 +6043,15 @@ async function resolveRootPath(params) {
|
|
|
5688
6043
|
});
|
|
5689
6044
|
}
|
|
5690
6045
|
function resolveRootPathSync(params) {
|
|
6046
|
+
try {
|
|
6047
|
+
return resolveRootPathSyncInternal(params);
|
|
6048
|
+
}
|
|
6049
|
+
catch (error) {
|
|
6050
|
+
throw sanitizeRootPathError(error);
|
|
6051
|
+
}
|
|
6052
|
+
}
|
|
6053
|
+
function resolveRootPathSyncInternal(params) {
|
|
6054
|
+
assertValidRootPathInputs(params);
|
|
5691
6055
|
const rootPath = path.resolve(params.rootPath);
|
|
5692
6056
|
const absolutePath = path.resolve(params.absolutePath);
|
|
5693
6057
|
const rootCanonicalPath = params.rootCanonicalPath
|
|
@@ -5717,6 +6081,29 @@ function resolveRootPathSync(params) {
|
|
|
5717
6081
|
rootCanonicalPath: context.rootCanonicalPath,
|
|
5718
6082
|
});
|
|
5719
6083
|
}
|
|
6084
|
+
function sanitizeRootPathError(error) {
|
|
6085
|
+
if (error instanceof Error) {
|
|
6086
|
+
error.message = formatErrorDetail(error.message);
|
|
6087
|
+
}
|
|
6088
|
+
return error;
|
|
6089
|
+
}
|
|
6090
|
+
function assertValidRootPathInputs(params) {
|
|
6091
|
+
path_assertNoNulPathInput(params.rootPath, "root path contains a NUL byte");
|
|
6092
|
+
path_assertNoNulPathInput(params.absolutePath, "absolute path contains a NUL byte");
|
|
6093
|
+
assertNoEmbeddedDriveRelativeSegment(params.rootPath, "root path");
|
|
6094
|
+
assertNoEmbeddedDriveRelativeSegment(params.absolutePath, "absolute path");
|
|
6095
|
+
if (params.rootCanonicalPath !== undefined) {
|
|
6096
|
+
path_assertNoNulPathInput(params.rootCanonicalPath, "canonical root path contains a NUL byte");
|
|
6097
|
+
assertNoEmbeddedDriveRelativeSegment(params.rootCanonicalPath, "canonical root path");
|
|
6098
|
+
}
|
|
6099
|
+
}
|
|
6100
|
+
function assertNoEmbeddedDriveRelativeSegment(filePath, label) {
|
|
6101
|
+
if (process.platform !== "win32") {
|
|
6102
|
+
return;
|
|
6103
|
+
}
|
|
6104
|
+
const root = external_node_path_.parse(filePath).root;
|
|
6105
|
+
assertNoDriveRelativePathSegments(filePath.slice(root.length).replaceAll("\\", "/"), label);
|
|
6106
|
+
}
|
|
5720
6107
|
function isPromiseLike(value) {
|
|
5721
6108
|
return Boolean(value &&
|
|
5722
6109
|
(typeof value === "object" || typeof value === "function") &&
|
|
@@ -5735,6 +6122,15 @@ function createLexicalTraversalState(params) {
|
|
|
5735
6122
|
preserveFinalSymlink: false,
|
|
5736
6123
|
};
|
|
5737
6124
|
}
|
|
6125
|
+
function createLexicalTraversalContext(params) {
|
|
6126
|
+
return {
|
|
6127
|
+
state: createLexicalTraversalState(params),
|
|
6128
|
+
resolveParams: params.params,
|
|
6129
|
+
rootPath: params.rootPath,
|
|
6130
|
+
rootCanonicalPath: params.rootCanonicalPath,
|
|
6131
|
+
absolutePath: params.absolutePath,
|
|
6132
|
+
};
|
|
6133
|
+
}
|
|
5738
6134
|
function splitTraversalSegments(value) {
|
|
5739
6135
|
return value
|
|
5740
6136
|
.split(process.platform === "win32" ? /[\\/]+/ : /\/+/)
|
|
@@ -5758,149 +6154,97 @@ function rawPathRelativeToRoot(rootPath, candidatePath) {
|
|
|
5758
6154
|
: candidatePrefix === rootWithSep;
|
|
5759
6155
|
return prefixMatches ? candidate.slice(rootWithSep.length) : undefined;
|
|
5760
6156
|
}
|
|
5761
|
-
function assertLexicalCursorInsideBoundary(
|
|
6157
|
+
function assertLexicalCursorInsideBoundary(context, candidatePath) {
|
|
5762
6158
|
assertInsideBoundary({
|
|
5763
|
-
boundaryLabel:
|
|
5764
|
-
rootCanonicalPath:
|
|
5765
|
-
candidatePath
|
|
5766
|
-
absolutePath:
|
|
6159
|
+
boundaryLabel: context.resolveParams.boundaryLabel,
|
|
6160
|
+
rootCanonicalPath: context.rootCanonicalPath,
|
|
6161
|
+
candidatePath,
|
|
6162
|
+
absolutePath: context.absolutePath,
|
|
5767
6163
|
});
|
|
5768
6164
|
}
|
|
5769
|
-
function applyMissingSuffixToCanonicalCursor(
|
|
5770
|
-
const missingSuffix =
|
|
6165
|
+
function applyMissingSuffixToCanonicalCursor(context, missingFromIndex) {
|
|
6166
|
+
const missingSuffix = context.state.segments.slice(missingFromIndex);
|
|
5771
6167
|
for (const segment of missingSuffix) {
|
|
5772
|
-
advanceCanonicalCursorForSegment(
|
|
5773
|
-
state: params.state,
|
|
5774
|
-
segment,
|
|
5775
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5776
|
-
params: params.params,
|
|
5777
|
-
absolutePath: params.absolutePath,
|
|
5778
|
-
});
|
|
6168
|
+
advanceCanonicalCursorForSegment(context, segment);
|
|
5779
6169
|
}
|
|
5780
6170
|
}
|
|
5781
|
-
function advanceCanonicalCursorForSegment(
|
|
5782
|
-
|
|
5783
|
-
assertLexicalCursorInsideBoundary(
|
|
5784
|
-
params: params.params,
|
|
5785
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5786
|
-
candidatePath: params.state.canonicalCursor,
|
|
5787
|
-
absolutePath: params.absolutePath,
|
|
5788
|
-
});
|
|
6171
|
+
function advanceCanonicalCursorForSegment(context, segment) {
|
|
6172
|
+
context.state.canonicalCursor = external_node_path_.resolve(context.state.canonicalCursor, segment);
|
|
6173
|
+
assertLexicalCursorInsideBoundary(context, context.state.canonicalCursor);
|
|
5789
6174
|
}
|
|
5790
|
-
function finalizeLexicalResolution(
|
|
5791
|
-
assertLexicalCursorInsideBoundary(
|
|
5792
|
-
params: params.params,
|
|
5793
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5794
|
-
candidatePath: params.state.canonicalCursor,
|
|
5795
|
-
absolutePath: params.absolutePath,
|
|
5796
|
-
});
|
|
6175
|
+
function finalizeLexicalResolution(context, kind) {
|
|
6176
|
+
assertLexicalCursorInsideBoundary(context, context.state.canonicalCursor);
|
|
5797
6177
|
return buildResolvedRootPath({
|
|
5798
|
-
absolutePath:
|
|
5799
|
-
canonicalPath:
|
|
5800
|
-
rootPath:
|
|
5801
|
-
rootCanonicalPath:
|
|
5802
|
-
kind
|
|
6178
|
+
absolutePath: context.absolutePath,
|
|
6179
|
+
canonicalPath: context.state.canonicalCursor,
|
|
6180
|
+
rootPath: context.rootPath,
|
|
6181
|
+
rootCanonicalPath: context.rootCanonicalPath,
|
|
6182
|
+
kind,
|
|
5803
6183
|
});
|
|
5804
6184
|
}
|
|
5805
|
-
function handleLexicalLstatFailure(
|
|
5806
|
-
if (!path_isNotFoundPathError(
|
|
6185
|
+
function handleLexicalLstatFailure(context, error, missingFromIndex) {
|
|
6186
|
+
if (!path_isNotFoundPathError(error)) {
|
|
5807
6187
|
return false;
|
|
5808
6188
|
}
|
|
5809
|
-
applyMissingSuffixToCanonicalCursor(
|
|
5810
|
-
state: params.state,
|
|
5811
|
-
missingFromIndex: params.missingFromIndex,
|
|
5812
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5813
|
-
params: params.resolveParams,
|
|
5814
|
-
absolutePath: params.absolutePath,
|
|
5815
|
-
});
|
|
6189
|
+
applyMissingSuffixToCanonicalCursor(context, missingFromIndex);
|
|
5816
6190
|
return true;
|
|
5817
6191
|
}
|
|
5818
|
-
function handleLexicalStatReadFailure(
|
|
5819
|
-
if (handleLexicalLstatFailure({
|
|
5820
|
-
error: params.error,
|
|
5821
|
-
state: params.state,
|
|
5822
|
-
missingFromIndex: params.missingFromIndex,
|
|
5823
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5824
|
-
resolveParams: params.resolveParams,
|
|
5825
|
-
absolutePath: params.absolutePath,
|
|
5826
|
-
})) {
|
|
6192
|
+
function handleLexicalStatReadFailure(context, error, missingFromIndex) {
|
|
6193
|
+
if (handleLexicalLstatFailure(context, error, missingFromIndex)) {
|
|
5827
6194
|
return null;
|
|
5828
6195
|
}
|
|
5829
|
-
throw
|
|
6196
|
+
throw error;
|
|
5830
6197
|
}
|
|
5831
|
-
function handleLexicalStatDisposition(params) {
|
|
6198
|
+
function handleLexicalStatDisposition(context, params) {
|
|
5832
6199
|
if (!params.isSymbolicLink) {
|
|
5833
|
-
advanceCanonicalCursorForSegment(
|
|
5834
|
-
state: params.state,
|
|
5835
|
-
segment: params.segment,
|
|
5836
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5837
|
-
params: params.resolveParams,
|
|
5838
|
-
absolutePath: params.absolutePath,
|
|
5839
|
-
});
|
|
6200
|
+
advanceCanonicalCursorForSegment(context, params.segment);
|
|
5840
6201
|
return "continue";
|
|
5841
6202
|
}
|
|
5842
|
-
if (
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
params: params.resolveParams,
|
|
5849
|
-
absolutePath: params.absolutePath,
|
|
5850
|
-
});
|
|
6203
|
+
if (context.resolveParams.rejectSymlinks === true && params.isLast) {
|
|
6204
|
+
throw new errors_FsSafeError("symlink", "symlink path component not allowed");
|
|
6205
|
+
}
|
|
6206
|
+
if (context.state.allowFinalSymlink && params.isLast) {
|
|
6207
|
+
context.state.preserveFinalSymlink = true;
|
|
6208
|
+
advanceCanonicalCursorForSegment(context, params.segment);
|
|
5851
6209
|
return "break";
|
|
5852
6210
|
}
|
|
5853
6211
|
return "resolve-link";
|
|
5854
6212
|
}
|
|
5855
|
-
function applyResolvedSymlinkHop(
|
|
5856
|
-
if (!path_isPathInside(
|
|
6213
|
+
function applyResolvedSymlinkHop(context, linkCanonical) {
|
|
6214
|
+
if (!path_isPathInside(context.rootCanonicalPath, linkCanonical)) {
|
|
5857
6215
|
throw symlinkEscapeError({
|
|
5858
|
-
boundaryLabel:
|
|
5859
|
-
rootCanonicalPath:
|
|
5860
|
-
symlinkPath:
|
|
6216
|
+
boundaryLabel: context.resolveParams.boundaryLabel,
|
|
6217
|
+
rootCanonicalPath: context.rootCanonicalPath,
|
|
6218
|
+
symlinkPath: context.state.lexicalCursor,
|
|
5861
6219
|
});
|
|
5862
6220
|
}
|
|
5863
|
-
|
|
5864
|
-
|
|
6221
|
+
context.state.canonicalCursor = linkCanonical;
|
|
6222
|
+
context.state.lexicalCursor = linkCanonical;
|
|
5865
6223
|
}
|
|
5866
|
-
function readLexicalStat(params) {
|
|
6224
|
+
function readLexicalStat(context, params) {
|
|
5867
6225
|
try {
|
|
5868
|
-
const stat = params.read(
|
|
6226
|
+
const stat = params.read(context.state.lexicalCursor);
|
|
5869
6227
|
if (isPromiseLike(stat)) {
|
|
5870
|
-
return Promise.resolve(stat).catch((error) => handleLexicalStatReadFailure(
|
|
6228
|
+
return Promise.resolve(stat).catch((error) => handleLexicalStatReadFailure(context, error, params.missingFromIndex));
|
|
5871
6229
|
}
|
|
5872
6230
|
return stat;
|
|
5873
6231
|
}
|
|
5874
6232
|
catch (error) {
|
|
5875
|
-
return handleLexicalStatReadFailure(
|
|
6233
|
+
return handleLexicalStatReadFailure(context, error, params.missingFromIndex);
|
|
5876
6234
|
}
|
|
5877
6235
|
}
|
|
5878
|
-
function resolveAndApplySymlinkHop(params) {
|
|
5879
|
-
const linkCanonical = params.resolveLinkCanonical(
|
|
6236
|
+
function resolveAndApplySymlinkHop(context, params) {
|
|
6237
|
+
const linkCanonical = params.resolveLinkCanonical(context.state.lexicalCursor);
|
|
5880
6238
|
if (isPromiseLike(linkCanonical)) {
|
|
5881
|
-
return Promise.resolve(linkCanonical).then((value) =>
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5885
|
-
boundaryLabel: params.boundaryLabel,
|
|
5886
|
-
}));
|
|
6239
|
+
return Promise.resolve(linkCanonical).then((value) => {
|
|
6240
|
+
applyResolvedSymlinkHop(context, value);
|
|
6241
|
+
});
|
|
5887
6242
|
}
|
|
5888
|
-
applyResolvedSymlinkHop(
|
|
5889
|
-
state: params.state,
|
|
5890
|
-
linkCanonical,
|
|
5891
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5892
|
-
boundaryLabel: params.boundaryLabel,
|
|
5893
|
-
});
|
|
6243
|
+
applyResolvedSymlinkHop(context, linkCanonical);
|
|
5894
6244
|
}
|
|
5895
|
-
function applyParentTraversalStep(
|
|
5896
|
-
|
|
5897
|
-
advanceCanonicalCursorForSegment(
|
|
5898
|
-
state: params.state,
|
|
5899
|
-
segment: "..",
|
|
5900
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5901
|
-
params: params.resolveParams,
|
|
5902
|
-
absolutePath: params.absolutePath,
|
|
5903
|
-
});
|
|
6245
|
+
function applyParentTraversalStep(context) {
|
|
6246
|
+
context.state.lexicalCursor = external_node_path_.resolve(context.state.lexicalCursor, "..");
|
|
6247
|
+
advanceCanonicalCursorForSegment(context, "..");
|
|
5904
6248
|
}
|
|
5905
6249
|
function* iterateLexicalTraversal(state) {
|
|
5906
6250
|
for (let idx = 0; idx < state.segments.length; idx += 1) {
|
|
@@ -5910,32 +6254,22 @@ function* iterateLexicalTraversal(state) {
|
|
|
5910
6254
|
}
|
|
5911
6255
|
}
|
|
5912
6256
|
async function resolveRootPathLexicalAsync(params) {
|
|
5913
|
-
const
|
|
5914
|
-
const
|
|
5915
|
-
state,
|
|
5916
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5917
|
-
resolveParams: params.params,
|
|
5918
|
-
absolutePath: params.absolutePath,
|
|
5919
|
-
};
|
|
6257
|
+
const context = createLexicalTraversalContext(params);
|
|
6258
|
+
const { state } = context;
|
|
5920
6259
|
for (const { idx, segment, isLast } of iterateLexicalTraversal(state)) {
|
|
5921
6260
|
if (segment === "..") {
|
|
5922
|
-
applyParentTraversalStep(
|
|
5923
|
-
...sharedStepParams,
|
|
5924
|
-
resolveParams: params.params,
|
|
5925
|
-
});
|
|
6261
|
+
applyParentTraversalStep(context);
|
|
5926
6262
|
continue;
|
|
5927
6263
|
}
|
|
5928
6264
|
state.lexicalCursor = external_node_path_.join(state.lexicalCursor, segment);
|
|
5929
|
-
const stat = await readLexicalStat({
|
|
5930
|
-
...sharedStepParams,
|
|
6265
|
+
const stat = await readLexicalStat(context, {
|
|
5931
6266
|
missingFromIndex: idx,
|
|
5932
6267
|
read: (cursor) => promises_.lstat(cursor),
|
|
5933
6268
|
});
|
|
5934
6269
|
if (!stat) {
|
|
5935
6270
|
break;
|
|
5936
6271
|
}
|
|
5937
|
-
const disposition = handleLexicalStatDisposition({
|
|
5938
|
-
...sharedStepParams,
|
|
6272
|
+
const disposition = handleLexicalStatDisposition(context, {
|
|
5939
6273
|
isSymbolicLink: stat.isSymbolicLink(),
|
|
5940
6274
|
segment,
|
|
5941
6275
|
isLast,
|
|
@@ -5946,41 +6280,29 @@ async function resolveRootPathLexicalAsync(params) {
|
|
|
5946
6280
|
if (disposition === "break") {
|
|
5947
6281
|
break;
|
|
5948
6282
|
}
|
|
5949
|
-
await resolveAndApplySymlinkHop({
|
|
5950
|
-
state,
|
|
5951
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5952
|
-
boundaryLabel: params.params.boundaryLabel,
|
|
6283
|
+
await resolveAndApplySymlinkHop(context, {
|
|
5953
6284
|
resolveLinkCanonical: (cursor) => resolveSymlinkHopPath(cursor),
|
|
5954
6285
|
});
|
|
6286
|
+
if (context.resolveParams.rejectSymlinks === true) {
|
|
6287
|
+
throw new errors_FsSafeError("symlink", "symlink path component not allowed");
|
|
6288
|
+
}
|
|
5955
6289
|
}
|
|
5956
6290
|
const kind = await getPathKind(state.canonicalCursor, state.preserveFinalSymlink);
|
|
5957
|
-
return finalizeLexicalResolution(
|
|
5958
|
-
...params,
|
|
5959
|
-
state,
|
|
5960
|
-
kind,
|
|
5961
|
-
});
|
|
6291
|
+
return finalizeLexicalResolution(context, kind);
|
|
5962
6292
|
}
|
|
5963
6293
|
function resolveRootPathLexicalSync(params) {
|
|
5964
|
-
const
|
|
6294
|
+
const context = createLexicalTraversalContext(params);
|
|
6295
|
+
const { state } = context;
|
|
5965
6296
|
for (let idx = 0; idx < state.segments.length; idx += 1) {
|
|
5966
6297
|
const segment = state.segments[idx] ?? "";
|
|
5967
6298
|
const isLast = idx === state.segments.length - 1;
|
|
5968
6299
|
if (segment === "..") {
|
|
5969
|
-
applyParentTraversalStep(
|
|
5970
|
-
state,
|
|
5971
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5972
|
-
resolveParams: params.params,
|
|
5973
|
-
absolutePath: params.absolutePath,
|
|
5974
|
-
});
|
|
6300
|
+
applyParentTraversalStep(context);
|
|
5975
6301
|
continue;
|
|
5976
6302
|
}
|
|
5977
6303
|
state.lexicalCursor = path.join(state.lexicalCursor, segment);
|
|
5978
|
-
const maybeStat = readLexicalStat({
|
|
5979
|
-
state,
|
|
6304
|
+
const maybeStat = readLexicalStat(context, {
|
|
5980
6305
|
missingFromIndex: idx,
|
|
5981
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5982
|
-
resolveParams: params.params,
|
|
5983
|
-
absolutePath: params.absolutePath,
|
|
5984
6306
|
read: (cursor) => fs.lstatSync(cursor),
|
|
5985
6307
|
});
|
|
5986
6308
|
if (isPromiseLike(maybeStat)) {
|
|
@@ -5990,14 +6312,10 @@ function resolveRootPathLexicalSync(params) {
|
|
|
5990
6312
|
if (!stat) {
|
|
5991
6313
|
break;
|
|
5992
6314
|
}
|
|
5993
|
-
const disposition = handleLexicalStatDisposition({
|
|
5994
|
-
state,
|
|
6315
|
+
const disposition = handleLexicalStatDisposition(context, {
|
|
5995
6316
|
isSymbolicLink: stat.isSymbolicLink(),
|
|
5996
6317
|
segment,
|
|
5997
6318
|
isLast,
|
|
5998
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
5999
|
-
resolveParams: params.params,
|
|
6000
|
-
absolutePath: params.absolutePath,
|
|
6001
6319
|
});
|
|
6002
6320
|
if (disposition === "continue") {
|
|
6003
6321
|
continue;
|
|
@@ -6005,22 +6323,18 @@ function resolveRootPathLexicalSync(params) {
|
|
|
6005
6323
|
if (disposition === "break") {
|
|
6006
6324
|
break;
|
|
6007
6325
|
}
|
|
6008
|
-
const maybeApplied = resolveAndApplySymlinkHop({
|
|
6009
|
-
state,
|
|
6010
|
-
rootCanonicalPath: params.rootCanonicalPath,
|
|
6011
|
-
boundaryLabel: params.params.boundaryLabel,
|
|
6326
|
+
const maybeApplied = resolveAndApplySymlinkHop(context, {
|
|
6012
6327
|
resolveLinkCanonical: (cursor) => resolveSymlinkHopPathSync(cursor),
|
|
6013
6328
|
});
|
|
6014
6329
|
if (isPromiseLike(maybeApplied)) {
|
|
6015
6330
|
throw new Error("Unexpected async symlink resolution");
|
|
6016
6331
|
}
|
|
6332
|
+
if (context.resolveParams.rejectSymlinks === true) {
|
|
6333
|
+
throw new FsSafeError("symlink", "symlink path component not allowed");
|
|
6334
|
+
}
|
|
6017
6335
|
}
|
|
6018
6336
|
const kind = getPathKindSync(state.canonicalCursor, state.preserveFinalSymlink);
|
|
6019
|
-
return finalizeLexicalResolution(
|
|
6020
|
-
...params,
|
|
6021
|
-
state,
|
|
6022
|
-
kind,
|
|
6023
|
-
});
|
|
6337
|
+
return finalizeLexicalResolution(context, kind);
|
|
6024
6338
|
}
|
|
6025
6339
|
function resolveCanonicalOutsideLexicalPath(params) {
|
|
6026
6340
|
return params.outsideLexicalCanonicalPath ?? params.absolutePath;
|
|
@@ -6084,7 +6398,7 @@ async function resolveOutsideLexicalCanonicalPathAsync(params) {
|
|
|
6084
6398
|
if (path_isPathInside(params.rootPath, params.absolutePath)) {
|
|
6085
6399
|
return undefined;
|
|
6086
6400
|
}
|
|
6087
|
-
return await
|
|
6401
|
+
return await resolvePathViaExistingAncestor(params.absolutePath);
|
|
6088
6402
|
}
|
|
6089
6403
|
function resolveOutsideLexicalCanonicalPathSync(params) {
|
|
6090
6404
|
if (isPathInside(params.rootPath, params.absolutePath)) {
|
|
@@ -6191,39 +6505,6 @@ function pathEscapeError(params) {
|
|
|
6191
6505
|
function symlinkEscapeError(params) {
|
|
6192
6506
|
return new Error(`Symlink escapes ${params.boundaryLabel} (${shortPath(params.rootCanonicalPath)}): ${shortPath(params.symlinkPath)}`);
|
|
6193
6507
|
}
|
|
6194
|
-
function shortPath(value) {
|
|
6195
|
-
const home = external_node_os_.homedir();
|
|
6196
|
-
if (value.startsWith(home)) {
|
|
6197
|
-
return `~${value.slice(home.length)}`;
|
|
6198
|
-
}
|
|
6199
|
-
return value;
|
|
6200
|
-
}
|
|
6201
|
-
async function resolveSymlinkHopPath(symlinkPath) {
|
|
6202
|
-
try {
|
|
6203
|
-
return external_node_path_.resolve(await promises_.realpath(symlinkPath));
|
|
6204
|
-
}
|
|
6205
|
-
catch (error) {
|
|
6206
|
-
if (!path_isNotFoundPathError(error)) {
|
|
6207
|
-
throw error;
|
|
6208
|
-
}
|
|
6209
|
-
const linkTarget = await promises_.readlink(symlinkPath);
|
|
6210
|
-
const linkAbsolute = external_node_path_.resolve(external_node_path_.dirname(symlinkPath), linkTarget);
|
|
6211
|
-
return root_path_existing_resolvePathViaExistingAncestor(linkAbsolute);
|
|
6212
|
-
}
|
|
6213
|
-
}
|
|
6214
|
-
function resolveSymlinkHopPathSync(symlinkPath) {
|
|
6215
|
-
try {
|
|
6216
|
-
return path.resolve(fs.realpathSync(symlinkPath));
|
|
6217
|
-
}
|
|
6218
|
-
catch (error) {
|
|
6219
|
-
if (!isNotFoundPathError(error)) {
|
|
6220
|
-
throw error;
|
|
6221
|
-
}
|
|
6222
|
-
const linkTarget = fs.readlinkSync(symlinkPath);
|
|
6223
|
-
const linkAbsolute = path.resolve(path.dirname(symlinkPath), linkTarget);
|
|
6224
|
-
return resolvePathViaExistingAncestorSync(linkAbsolute);
|
|
6225
|
-
}
|
|
6226
|
-
}
|
|
6227
6508
|
|
|
6228
6509
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/path-policy.js
|
|
6229
6510
|
|
|
@@ -6267,14 +6548,8 @@ async function assertNoHardlinkedFinalPath(params) {
|
|
|
6267
6548
|
return;
|
|
6268
6549
|
}
|
|
6269
6550
|
if (stat.nlink > 1) {
|
|
6270
|
-
throw new Error(`Hardlinked path is not allowed under ${params.boundaryLabel} (${
|
|
6271
|
-
}
|
|
6272
|
-
}
|
|
6273
|
-
function path_policy_shortPath(value) {
|
|
6274
|
-
if (value.startsWith(external_node_os_.homedir())) {
|
|
6275
|
-
return `~${value.slice(external_node_os_.homedir().length)}`;
|
|
6551
|
+
throw new Error(`Hardlinked path is not allowed under ${params.boundaryLabel} (${shortPath(params.root)}): ${shortPath(params.filePath)}`);
|
|
6276
6552
|
}
|
|
6277
|
-
return value;
|
|
6278
6553
|
}
|
|
6279
6554
|
|
|
6280
6555
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/string-coerce.js
|
|
@@ -6356,6 +6631,10 @@ function hasNonEmptyString(value) {
|
|
|
6356
6631
|
|
|
6357
6632
|
|
|
6358
6633
|
const ENCODED_FILE_URL_SEPARATOR_RE = /%(?:2f|5c)/i;
|
|
6634
|
+
const FILE_URL_PREFIX_RE = /^file:\/\//i;
|
|
6635
|
+
function isFileUrl(input) {
|
|
6636
|
+
return FILE_URL_PREFIX_RE.test(input);
|
|
6637
|
+
}
|
|
6359
6638
|
function isLocalFileUrlHost(hostname) {
|
|
6360
6639
|
const normalized = normalizeLowercaseStringOrEmpty(hostname);
|
|
6361
6640
|
return normalized === "" || normalized === "localhost";
|
|
@@ -6386,7 +6665,7 @@ function assertNoWindowsNetworkPath(filePath, label = "Path") {
|
|
|
6386
6665
|
throw new Error(`${label} cannot use Windows network paths: ${filePath}`);
|
|
6387
6666
|
}
|
|
6388
6667
|
}
|
|
6389
|
-
function safeFileURLToPath(fileUrl) {
|
|
6668
|
+
function safeFileURLToPath(fileUrl, platform = process.platform) {
|
|
6390
6669
|
let parsed;
|
|
6391
6670
|
try {
|
|
6392
6671
|
parsed = new external_node_url_.URL(fileUrl);
|
|
@@ -6403,13 +6682,15 @@ function safeFileURLToPath(fileUrl) {
|
|
|
6403
6682
|
if (hasEncodedFileUrlSeparator(parsed.pathname)) {
|
|
6404
6683
|
throw new Error(`file:// URLs cannot encode path separators: ${fileUrl}`);
|
|
6405
6684
|
}
|
|
6406
|
-
const filePath = (0,external_node_url_.fileURLToPath)(parsed);
|
|
6407
|
-
|
|
6685
|
+
const filePath = (0,external_node_url_.fileURLToPath)(parsed, { windows: platform === "win32" });
|
|
6686
|
+
if (isWindowsNetworkPath(filePath, platform)) {
|
|
6687
|
+
throw new Error(`Local file URL cannot use Windows network paths: ${filePath}`);
|
|
6688
|
+
}
|
|
6408
6689
|
return filePath;
|
|
6409
6690
|
}
|
|
6410
|
-
function trySafeFileURLToPath(fileUrl) {
|
|
6691
|
+
function trySafeFileURLToPath(fileUrl, platform = process.platform) {
|
|
6411
6692
|
try {
|
|
6412
|
-
return safeFileURLToPath(fileUrl);
|
|
6693
|
+
return safeFileURLToPath(fileUrl, platform);
|
|
6413
6694
|
}
|
|
6414
6695
|
catch {
|
|
6415
6696
|
return undefined;
|
|
@@ -6419,7 +6700,7 @@ function basenameFromMediaSource(source) {
|
|
|
6419
6700
|
if (!source) {
|
|
6420
6701
|
return undefined;
|
|
6421
6702
|
}
|
|
6422
|
-
if (source
|
|
6703
|
+
if (isFileUrl(source)) {
|
|
6423
6704
|
const filePath = trySafeFileURLToPath(source);
|
|
6424
6705
|
return filePath ? path.basename(filePath) || undefined : undefined;
|
|
6425
6706
|
}
|
|
@@ -6504,11 +6785,11 @@ function trimTrailingWindowsIgnoredChars(value) {
|
|
|
6504
6785
|
}
|
|
6505
6786
|
return end === value.length ? value : value.slice(0, end);
|
|
6506
6787
|
}
|
|
6507
|
-
function candidateReadPaths(filePath) {
|
|
6508
|
-
if (!filePath
|
|
6788
|
+
function candidateReadPaths(filePath, platform) {
|
|
6789
|
+
if (!isFileUrl(filePath)) {
|
|
6509
6790
|
return [filePath];
|
|
6510
6791
|
}
|
|
6511
|
-
const parsed = trySafeFileURLToPath(filePath);
|
|
6792
|
+
const parsed = trySafeFileURLToPath(filePath, platform);
|
|
6512
6793
|
return parsed === undefined ? [filePath] : [filePath, parsed];
|
|
6513
6794
|
}
|
|
6514
6795
|
function normalizePosixPath(filePath, cwd) {
|
|
@@ -6551,7 +6832,7 @@ function matchWindowsDeviceReadPath(filePath) {
|
|
|
6551
6832
|
}
|
|
6552
6833
|
function matchUnsafeDeviceReadPath(filePath, options = {}) {
|
|
6553
6834
|
const platform = options.platform ?? process.platform;
|
|
6554
|
-
for (const candidate of candidateReadPaths(filePath)) {
|
|
6835
|
+
for (const candidate of candidateReadPaths(filePath, platform)) {
|
|
6555
6836
|
const match = platform === "win32"
|
|
6556
6837
|
? matchWindowsDeviceReadPath(candidate)
|
|
6557
6838
|
: matchPosixDeviceReadPath(candidate, options.cwd);
|
|
@@ -6588,23 +6869,6 @@ async function read_opened_file_readOpenedFileSafely(params) {
|
|
|
6588
6869
|
};
|
|
6589
6870
|
}
|
|
6590
6871
|
|
|
6591
|
-
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/path-stat.js
|
|
6592
|
-
function pathStatFromStats(stat) {
|
|
6593
|
-
return {
|
|
6594
|
-
dev: Number(stat.dev),
|
|
6595
|
-
gid: Number(stat.gid),
|
|
6596
|
-
ino: Number(stat.ino),
|
|
6597
|
-
isDirectory: stat.isDirectory(),
|
|
6598
|
-
isFile: stat.isFile(),
|
|
6599
|
-
isSymbolicLink: stat.isSymbolicLink(),
|
|
6600
|
-
mode: stat.mode,
|
|
6601
|
-
mtimeMs: stat.mtimeMs,
|
|
6602
|
-
nlink: stat.nlink,
|
|
6603
|
-
size: stat.size,
|
|
6604
|
-
uid: stat.uid,
|
|
6605
|
-
};
|
|
6606
|
-
}
|
|
6607
|
-
|
|
6608
6872
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/home-dir.js
|
|
6609
6873
|
|
|
6610
6874
|
|
|
@@ -6727,10 +6991,19 @@ function resolveOsHomeRelativePath(input, opts) {
|
|
|
6727
6991
|
|
|
6728
6992
|
|
|
6729
6993
|
|
|
6994
|
+
|
|
6995
|
+
|
|
6996
|
+
|
|
6730
6997
|
const ensureTrailingSep = (value) => value.endsWith(external_node_path_.sep) ? value : value + external_node_path_.sep;
|
|
6731
6998
|
function assertValidRootRelativePath(relativePath) {
|
|
6732
6999
|
path_assertNoNulPathInput(relativePath, "relative path contains a NUL byte");
|
|
6733
7000
|
}
|
|
7001
|
+
function assertValidRootDestinationPath(relativePath) {
|
|
7002
|
+
assertValidRootRelativePath(relativePath);
|
|
7003
|
+
if (safe_path_segment_isDriveRelativePath(relativePath)) {
|
|
7004
|
+
throw new errors_FsSafeError("invalid-path", "relative path must not start with a drive letter");
|
|
7005
|
+
}
|
|
7006
|
+
}
|
|
6734
7007
|
let cachedHomePath;
|
|
6735
7008
|
async function expandRelativePathWithHome(relativePath) {
|
|
6736
7009
|
const rawHome = process.env.HOME || process.env.USERPROFILE || external_node_os_.homedir();
|
|
@@ -6749,12 +7022,14 @@ async function expandRelativePathWithHome(relativePath) {
|
|
|
6749
7022
|
async function resolveRootContext(rootDir) {
|
|
6750
7023
|
path_assertNoNulPathInput(rootDir, "root dir contains a NUL byte");
|
|
6751
7024
|
let rootReal;
|
|
7025
|
+
let rootIdentity;
|
|
6752
7026
|
try {
|
|
6753
7027
|
rootReal = await promises_.realpath(rootDir);
|
|
6754
7028
|
const rootStat = await promises_.stat(rootReal);
|
|
6755
7029
|
if (!rootStat.isDirectory()) {
|
|
6756
7030
|
throw new errors_FsSafeError("invalid-path", "root dir is not a directory");
|
|
6757
7031
|
}
|
|
7032
|
+
rootIdentity = { dev: rootStat.dev, ino: rootStat.ino };
|
|
6758
7033
|
}
|
|
6759
7034
|
catch (err) {
|
|
6760
7035
|
if (err instanceof errors_FsSafeError) {
|
|
@@ -6767,16 +7042,37 @@ async function resolveRootContext(rootDir) {
|
|
|
6767
7042
|
}
|
|
6768
7043
|
return {
|
|
6769
7044
|
rootDir: external_node_path_.resolve(rootDir),
|
|
7045
|
+
rootIdentity,
|
|
6770
7046
|
rootReal,
|
|
6771
7047
|
rootWithSep: ensureTrailingSep(rootReal),
|
|
6772
7048
|
};
|
|
6773
7049
|
}
|
|
7050
|
+
async function assertRootIdentityCurrent(root) {
|
|
7051
|
+
let current;
|
|
7052
|
+
try {
|
|
7053
|
+
current = await promises_.lstat(root.rootReal);
|
|
7054
|
+
}
|
|
7055
|
+
catch (error) {
|
|
7056
|
+
throw new errors_FsSafeError("path-mismatch", "root path changed during operation", {
|
|
7057
|
+
cause: error instanceof Error ? error : undefined,
|
|
7058
|
+
});
|
|
7059
|
+
}
|
|
7060
|
+
if (current.isSymbolicLink() ||
|
|
7061
|
+
!current.isDirectory() ||
|
|
7062
|
+
!file_identity_sameFileIdentity(current, root.rootIdentity)) {
|
|
7063
|
+
throw new errors_FsSafeError("path-mismatch", "root path changed during operation");
|
|
7064
|
+
}
|
|
7065
|
+
}
|
|
6774
7066
|
async function resolvePathInRoot(root, relativePath, options) {
|
|
6775
7067
|
assertValidRootRelativePath(relativePath);
|
|
7068
|
+
await assertRootIdentityCurrent(root);
|
|
6776
7069
|
const expanded = await expandRelativePathWithHome(relativePath);
|
|
6777
7070
|
const resolved = external_node_path_.resolve(root.rootWithSep, expanded);
|
|
6778
7071
|
if (!path_isPathInside(root.rootWithSep, resolved)) {
|
|
6779
|
-
throw
|
|
7072
|
+
throw outsideWorkspaceError();
|
|
7073
|
+
}
|
|
7074
|
+
if (options?.rejectUnsafeDeviceReads === true) {
|
|
7075
|
+
assertNoUnsafeDeviceReadPath(resolved);
|
|
6780
7076
|
}
|
|
6781
7077
|
const rawAbsolutePath = external_node_path_.isAbsolute(expanded)
|
|
6782
7078
|
? expanded
|
|
@@ -6788,9 +7084,18 @@ async function resolvePathInRoot(root, relativePath, options) {
|
|
|
6788
7084
|
rootCanonicalPath: root.rootReal,
|
|
6789
7085
|
boundaryLabel: "root",
|
|
6790
7086
|
policy: options?.allowFinalSymlink ? ROOT_PATH_ALIAS_POLICIES.unlinkTarget : undefined,
|
|
7087
|
+
rejectSymlinks: options?.rejectSymlinks,
|
|
6791
7088
|
});
|
|
6792
7089
|
}
|
|
6793
7090
|
catch (error) {
|
|
7091
|
+
if (error instanceof errors_FsSafeError && error.code === "symlink") {
|
|
7092
|
+
throw error;
|
|
7093
|
+
}
|
|
7094
|
+
if (hasNodeErrorCode(error, "ENAMETOOLONG")) {
|
|
7095
|
+
throw new errors_FsSafeError("invalid-path", "relative path is too long", {
|
|
7096
|
+
cause: error instanceof Error ? error : undefined,
|
|
7097
|
+
});
|
|
7098
|
+
}
|
|
6794
7099
|
const code = options?.aliasErrorCode ?? "outside-workspace";
|
|
6795
7100
|
throw new errors_FsSafeError(code, code === "path-alias" ? "path alias escape blocked" : "file is outside workspace root", {
|
|
6796
7101
|
cause: error instanceof Error ? error : undefined,
|
|
@@ -6802,29 +7107,6 @@ async function resolvePathWithinRoot(params) {
|
|
|
6802
7107
|
return await resolvePathInRoot(await resolveRootContext(params.rootDir), params.relativePath);
|
|
6803
7108
|
}
|
|
6804
7109
|
|
|
6805
|
-
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/root-errors.js
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
function isAlreadyExistsError(error) {
|
|
6809
|
-
return hasNodeErrorCode(error, "EEXIST") || /File exists|EEXIST/i.test(String(error));
|
|
6810
|
-
}
|
|
6811
|
-
function normalizePinnedWriteError(error) {
|
|
6812
|
-
if (error instanceof errors_FsSafeError) {
|
|
6813
|
-
return error;
|
|
6814
|
-
}
|
|
6815
|
-
return new errors_FsSafeError("invalid-path", "path is not a regular file under root", {
|
|
6816
|
-
cause: error instanceof Error ? error : undefined,
|
|
6817
|
-
});
|
|
6818
|
-
}
|
|
6819
|
-
function normalizePinnedPathError(error) {
|
|
6820
|
-
if (error instanceof errors_FsSafeError) {
|
|
6821
|
-
return error;
|
|
6822
|
-
}
|
|
6823
|
-
return new errors_FsSafeError("path-alias", "path is not under root", {
|
|
6824
|
-
cause: error instanceof Error ? error : undefined,
|
|
6825
|
-
});
|
|
6826
|
-
}
|
|
6827
|
-
|
|
6828
7110
|
;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/json-stringify.js
|
|
6829
7111
|
function stringifyJsonDocument(value, replacer, space) {
|
|
6830
7112
|
const text = JSON.stringify(value, replacer, space);
|
|
@@ -6859,6 +7141,17 @@ function limitEntry(relativePath) {
|
|
|
6859
7141
|
return { relativePath, kind: "truncated", size: 0 };
|
|
6860
7142
|
}
|
|
6861
7143
|
async function* walkRoot(root, relativePath, options) {
|
|
7144
|
+
if (!["skip", "follow-within-root"].includes(options.symlinkPolicy)) {
|
|
7145
|
+
throw new TypeError(`invalid root walk symlink policy: ${String(options.symlinkPolicy)}`);
|
|
7146
|
+
}
|
|
7147
|
+
if (options.limitBehavior !== undefined &&
|
|
7148
|
+
!["truncate", "throw"].includes(options.limitBehavior)) {
|
|
7149
|
+
throw new TypeError(`invalid root walk limit behavior: ${String(options.limitBehavior)}`);
|
|
7150
|
+
}
|
|
7151
|
+
if (options.onDirectoryError !== undefined &&
|
|
7152
|
+
!["throw", "skip-and-report"].includes(options.onDirectoryError)) {
|
|
7153
|
+
throw new TypeError(`invalid root walk directory error behavior: ${String(options.onDirectoryError)}`);
|
|
7154
|
+
}
|
|
6862
7155
|
const maxDepth = validateBudget("maxDepth", options.maxDepth);
|
|
6863
7156
|
const maxEntries = validateBudget("maxEntries", options.maxEntries);
|
|
6864
7157
|
const visitedDirectories = new Set();
|
|
@@ -6886,17 +7179,21 @@ async function* walkRoot(root, relativePath, options) {
|
|
|
6886
7179
|
return;
|
|
6887
7180
|
}
|
|
6888
7181
|
visitedDirectories.add(resolvedDirectory.canonicalPath);
|
|
7182
|
+
options.signal?.throwIfAborted();
|
|
6889
7183
|
const listingDirectory = external_node_path_.relative(root.rootReal, resolvedDirectory.canonicalPath)
|
|
6890
7184
|
.split(external_node_path_.sep)
|
|
6891
7185
|
.join(external_node_path_.posix.sep);
|
|
6892
7186
|
entries = await root.list(listingDirectory, { withFileTypes: true });
|
|
6893
7187
|
}
|
|
6894
7188
|
catch (error) {
|
|
7189
|
+
// Cancellation is never a recoverable directory read failure.
|
|
7190
|
+
options.signal?.throwIfAborted();
|
|
6895
7191
|
if ((options.onDirectoryError ?? "throw") === "throw")
|
|
6896
7192
|
throw error;
|
|
6897
7193
|
yield { relativePath: directory, kind: "directory-error", size: 0, error };
|
|
6898
7194
|
return;
|
|
6899
7195
|
}
|
|
7196
|
+
options.signal?.throwIfAborted();
|
|
6900
7197
|
for (const entry of entries) {
|
|
6901
7198
|
options.signal?.throwIfAborted();
|
|
6902
7199
|
const child = directory
|
|
@@ -7077,11 +7374,11 @@ function logWarn(message) {
|
|
|
7077
7374
|
}
|
|
7078
7375
|
}
|
|
7079
7376
|
const SUPPORTS_NOFOLLOW = process.platform !== "win32" && "O_NOFOLLOW" in external_node_fs_.constants;
|
|
7080
|
-
const NONBLOCK_OPEN_FLAG = "O_NONBLOCK" in external_node_fs_.constants ? external_node_fs_.constants.O_NONBLOCK : 0;
|
|
7081
|
-
const OPEN_READ_FLAGS = external_node_fs_.constants.O_RDONLY |
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
const
|
|
7377
|
+
const NONBLOCK_OPEN_FLAG = process.platform !== "win32" && "O_NONBLOCK" in external_node_fs_.constants ? external_node_fs_.constants.O_NONBLOCK : 0;
|
|
7378
|
+
const OPEN_READ_FLAGS = external_node_fs_.constants.O_RDONLY |
|
|
7379
|
+
(SUPPORTS_NOFOLLOW ? external_node_fs_.constants.O_NOFOLLOW : 0) |
|
|
7380
|
+
NONBLOCK_OPEN_FLAG;
|
|
7381
|
+
const OPEN_READ_FOLLOW_FLAGS = external_node_fs_.constants.O_RDONLY | NONBLOCK_OPEN_FLAG;
|
|
7085
7382
|
const OPEN_WRITE_EXISTING_FLAGS = external_node_fs_.constants.O_WRONLY | (SUPPORTS_NOFOLLOW ? external_node_fs_.constants.O_NOFOLLOW : 0);
|
|
7086
7383
|
const OPEN_WRITE_CREATE_FLAGS = external_node_fs_.constants.O_WRONLY |
|
|
7087
7384
|
external_node_fs_.constants.O_CREAT |
|
|
@@ -7094,6 +7391,21 @@ const OPEN_APPEND_CREATE_FLAGS = external_node_fs_.constants.O_RDWR |
|
|
|
7094
7391
|
external_node_fs_.constants.O_EXCL |
|
|
7095
7392
|
(SUPPORTS_NOFOLLOW ? external_node_fs_.constants.O_NOFOLLOW : 0);
|
|
7096
7393
|
const DEFAULT_ROOT_MAX_BYTES = 16 * 1024 * 1024;
|
|
7394
|
+
function pathStatFromStats(stat) {
|
|
7395
|
+
return {
|
|
7396
|
+
dev: Number(stat.dev),
|
|
7397
|
+
gid: Number(stat.gid),
|
|
7398
|
+
ino: Number(stat.ino),
|
|
7399
|
+
isDirectory: stat.isDirectory(),
|
|
7400
|
+
isFile: stat.isFile(),
|
|
7401
|
+
isSymbolicLink: stat.isSymbolicLink(),
|
|
7402
|
+
mode: stat.mode,
|
|
7403
|
+
mtimeMs: stat.mtimeMs,
|
|
7404
|
+
nlink: stat.nlink,
|
|
7405
|
+
size: stat.size,
|
|
7406
|
+
uid: stat.uid,
|
|
7407
|
+
};
|
|
7408
|
+
}
|
|
7097
7409
|
function openResult(params) {
|
|
7098
7410
|
return {
|
|
7099
7411
|
handle: params.handle,
|
|
@@ -7106,11 +7418,15 @@ function openResult(params) {
|
|
|
7106
7418
|
async function openVerifiedLocalFile(filePath, options) {
|
|
7107
7419
|
assertNoUnsafeDeviceReadPath(filePath);
|
|
7108
7420
|
const fsSafeTestHooks = getFsSafeTestHooks();
|
|
7421
|
+
let preOpenStat;
|
|
7109
7422
|
// Reject directories before opening so we never surface EISDIR to callers (e.g. tool
|
|
7110
7423
|
// results that get sent to messaging channels). See openclaw/openclaw#31186.
|
|
7111
7424
|
try {
|
|
7112
|
-
|
|
7113
|
-
if (
|
|
7425
|
+
preOpenStat = await promises_.lstat(filePath);
|
|
7426
|
+
if (preOpenStat.isSymbolicLink() && options?.symlinks !== "follow-within-root") {
|
|
7427
|
+
throw new errors_FsSafeError("symlink", "symlink not allowed");
|
|
7428
|
+
}
|
|
7429
|
+
if (!preOpenStat.isFile() && !preOpenStat.isSymbolicLink()) {
|
|
7114
7430
|
throw new errors_FsSafeError("not-file", "not a file");
|
|
7115
7431
|
}
|
|
7116
7432
|
await fsSafeTestHooks?.afterPreOpenLstat?.(filePath);
|
|
@@ -7124,12 +7440,8 @@ async function openVerifiedLocalFile(filePath, options) {
|
|
|
7124
7440
|
let handle;
|
|
7125
7441
|
try {
|
|
7126
7442
|
const openFlags = options?.symlinks === "follow-within-root"
|
|
7127
|
-
?
|
|
7128
|
-
|
|
7129
|
-
: OPEN_READ_FOLLOW_FLAGS
|
|
7130
|
-
: options?.nonBlockingRead
|
|
7131
|
-
? OPEN_READ_NONBLOCK_FLAGS
|
|
7132
|
-
: OPEN_READ_FLAGS;
|
|
7443
|
+
? OPEN_READ_FOLLOW_FLAGS
|
|
7444
|
+
: OPEN_READ_FLAGS;
|
|
7133
7445
|
await fsSafeTestHooks?.beforeOpen?.(filePath, openFlags);
|
|
7134
7446
|
handle = await promises_.open(filePath, openFlags);
|
|
7135
7447
|
try {
|
|
@@ -7142,7 +7454,7 @@ async function openVerifiedLocalFile(filePath, options) {
|
|
|
7142
7454
|
}
|
|
7143
7455
|
catch (err) {
|
|
7144
7456
|
if (path_isNotFoundPathError(err)) {
|
|
7145
|
-
throw
|
|
7457
|
+
throw fileNotFoundError();
|
|
7146
7458
|
}
|
|
7147
7459
|
if (isSymlinkOpenError(err)) {
|
|
7148
7460
|
throw new errors_FsSafeError("symlink", "symlink open blocked", { cause: err });
|
|
@@ -7158,8 +7470,13 @@ async function openVerifiedLocalFile(filePath, options) {
|
|
|
7158
7470
|
if (!stat.isFile()) {
|
|
7159
7471
|
throw new errors_FsSafeError("not-file", "not a file");
|
|
7160
7472
|
}
|
|
7473
|
+
if (preOpenStat &&
|
|
7474
|
+
!preOpenStat.isSymbolicLink() &&
|
|
7475
|
+
!file_identity_sameFileIdentity(stat, preOpenStat)) {
|
|
7476
|
+
throw new errors_FsSafeError("path-mismatch", "path changed before open");
|
|
7477
|
+
}
|
|
7161
7478
|
if (options?.hardlinks === "reject" && stat.nlink > 1) {
|
|
7162
|
-
throw
|
|
7479
|
+
throw hardlinkedPathNotAllowedError();
|
|
7163
7480
|
}
|
|
7164
7481
|
if (options?.symlinks === "follow-within-root") {
|
|
7165
7482
|
const pathStat = await promises_.stat(filePath);
|
|
@@ -7179,7 +7496,7 @@ async function openVerifiedLocalFile(filePath, options) {
|
|
|
7179
7496
|
const realPath = await resolveOpenedFileRealPathForHandle(handle, filePath);
|
|
7180
7497
|
const realStat = await promises_.stat(realPath);
|
|
7181
7498
|
if (options?.hardlinks === "reject" && realStat.nlink > 1) {
|
|
7182
|
-
throw
|
|
7499
|
+
throw hardlinkedPathNotAllowedError();
|
|
7183
7500
|
}
|
|
7184
7501
|
if (!file_identity_sameFileIdentity(stat, realStat)) {
|
|
7185
7502
|
throw new errors_FsSafeError("path-mismatch", "path mismatch");
|
|
@@ -7192,17 +7509,19 @@ async function openVerifiedLocalFile(filePath, options) {
|
|
|
7192
7509
|
throw err;
|
|
7193
7510
|
}
|
|
7194
7511
|
if (path_isNotFoundPathError(err)) {
|
|
7195
|
-
throw
|
|
7512
|
+
throw fileNotFoundError();
|
|
7196
7513
|
}
|
|
7197
7514
|
throw err;
|
|
7198
7515
|
}
|
|
7199
7516
|
}
|
|
7200
7517
|
class RootHandle {
|
|
7518
|
+
rootIdentity;
|
|
7201
7519
|
rootDir;
|
|
7202
7520
|
rootReal;
|
|
7203
7521
|
rootWithSep;
|
|
7204
7522
|
defaults;
|
|
7205
7523
|
constructor(context, defaults = {}) {
|
|
7524
|
+
this.rootIdentity = context.rootIdentity;
|
|
7206
7525
|
this.rootDir = context.rootDir;
|
|
7207
7526
|
this.rootReal = context.rootReal;
|
|
7208
7527
|
this.rootWithSep = context.rootWithSep;
|
|
@@ -7211,11 +7530,19 @@ class RootHandle {
|
|
|
7211
7530
|
get context() {
|
|
7212
7531
|
return {
|
|
7213
7532
|
rootDir: this.rootDir,
|
|
7533
|
+
rootIdentity: this.rootIdentity,
|
|
7214
7534
|
rootReal: this.rootReal,
|
|
7215
7535
|
rootWithSep: this.rootWithSep,
|
|
7216
7536
|
};
|
|
7217
7537
|
}
|
|
7538
|
+
mutationOptions(options) {
|
|
7539
|
+
return {
|
|
7540
|
+
...options,
|
|
7541
|
+
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
7542
|
+
};
|
|
7543
|
+
}
|
|
7218
7544
|
async resolve(relativePath) {
|
|
7545
|
+
assertValidRootDestinationPath(relativePath);
|
|
7219
7546
|
return (await resolvePathInRoot(this.context, relativePath, { allowFinalSymlink: true })).resolved;
|
|
7220
7547
|
}
|
|
7221
7548
|
async open(relativePath, options = {}) {
|
|
@@ -7255,67 +7582,67 @@ class RootHandle {
|
|
|
7255
7582
|
};
|
|
7256
7583
|
}
|
|
7257
7584
|
async openWritable(relativePath, options = {}) {
|
|
7585
|
+
assertValidRootDestinationPath(relativePath);
|
|
7258
7586
|
const writeMode = options.writeMode ?? "replace";
|
|
7259
7587
|
return await openWritableFileInRoot(this.context, {
|
|
7260
7588
|
relativePath,
|
|
7261
7589
|
mkdir: this.defaults.mkdir,
|
|
7262
7590
|
mode: this.defaults.mode,
|
|
7263
|
-
...options,
|
|
7264
|
-
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
7591
|
+
...this.mutationOptions(options),
|
|
7265
7592
|
append: writeMode === "append",
|
|
7266
7593
|
truncateExisting: writeMode === "replace",
|
|
7267
7594
|
});
|
|
7268
7595
|
}
|
|
7269
7596
|
async append(relativePath, data, options = {}) {
|
|
7597
|
+
assertValidRootDestinationPath(relativePath);
|
|
7270
7598
|
await appendFileInRoot(this.context, {
|
|
7271
7599
|
relativePath,
|
|
7272
7600
|
data,
|
|
7273
7601
|
mkdir: this.defaults.mkdir,
|
|
7274
7602
|
mode: this.defaults.mode,
|
|
7275
|
-
...options,
|
|
7276
|
-
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
7603
|
+
...this.mutationOptions(options),
|
|
7277
7604
|
});
|
|
7278
7605
|
}
|
|
7279
7606
|
async remove(relativePath, options = {}) {
|
|
7280
7607
|
assertValidRootRelativePath(relativePath);
|
|
7281
7608
|
await removePathInRoot(this.context, {
|
|
7282
7609
|
relativePath,
|
|
7283
|
-
|
|
7610
|
+
...this.mutationOptions(options),
|
|
7284
7611
|
});
|
|
7285
7612
|
}
|
|
7286
7613
|
async mkdir(relativePath, options = {}) {
|
|
7287
|
-
|
|
7614
|
+
assertValidRootDestinationPath(relativePath);
|
|
7288
7615
|
await mkdirPathInRoot(this.context, {
|
|
7289
7616
|
relativePath,
|
|
7290
|
-
|
|
7617
|
+
...this.mutationOptions(options),
|
|
7291
7618
|
});
|
|
7292
7619
|
}
|
|
7293
7620
|
async ensureRoot(options = {}) {
|
|
7294
7621
|
await mkdirPathInRoot(this.context, {
|
|
7295
7622
|
relativePath: "",
|
|
7296
7623
|
allowRoot: true,
|
|
7297
|
-
|
|
7624
|
+
...this.mutationOptions(options),
|
|
7298
7625
|
});
|
|
7299
7626
|
}
|
|
7300
7627
|
async write(relativePath, data, options = {}) {
|
|
7628
|
+
assertValidRootDestinationPath(relativePath);
|
|
7301
7629
|
await writeFileInRoot(this.context, {
|
|
7302
7630
|
relativePath,
|
|
7303
7631
|
data,
|
|
7304
7632
|
mkdir: this.defaults.mkdir,
|
|
7305
7633
|
mode: this.defaults.mode,
|
|
7306
7634
|
renameIdentity: this.defaults.renameIdentity,
|
|
7307
|
-
...options,
|
|
7308
|
-
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
7635
|
+
...this.mutationOptions(options),
|
|
7309
7636
|
});
|
|
7310
7637
|
}
|
|
7311
7638
|
async create(relativePath, data, options = {}) {
|
|
7639
|
+
assertValidRootDestinationPath(relativePath);
|
|
7312
7640
|
await writeFileInRoot(this.context, {
|
|
7313
7641
|
relativePath,
|
|
7314
7642
|
data,
|
|
7315
7643
|
mkdir: this.defaults.mkdir,
|
|
7316
7644
|
mode: this.defaults.mode,
|
|
7317
|
-
...options,
|
|
7318
|
-
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
7645
|
+
...this.mutationOptions(options),
|
|
7319
7646
|
overwrite: false,
|
|
7320
7647
|
});
|
|
7321
7648
|
}
|
|
@@ -7330,15 +7657,14 @@ class RootHandle {
|
|
|
7330
7657
|
await this.create(relativePath, trailingNewline ? `${json}\n` : json, writeOptions);
|
|
7331
7658
|
}
|
|
7332
7659
|
async copyIn(relativePath, sourcePath, options = {}) {
|
|
7333
|
-
|
|
7660
|
+
assertValidRootDestinationPath(relativePath);
|
|
7334
7661
|
await copyFileInRoot(this.context, {
|
|
7335
7662
|
sourcePath,
|
|
7336
7663
|
relativePath,
|
|
7337
7664
|
maxBytes: this.defaults.maxBytes,
|
|
7338
7665
|
mkdir: this.defaults.mkdir,
|
|
7339
7666
|
mode: this.defaults.mode,
|
|
7340
|
-
...options,
|
|
7341
|
-
denyMutations: mergeDenyMutationPolicies(this.defaults.denyMutations, options.denyMutations),
|
|
7667
|
+
...this.mutationOptions(options),
|
|
7342
7668
|
});
|
|
7343
7669
|
}
|
|
7344
7670
|
async exists(relativePath) {
|
|
@@ -7365,9 +7691,9 @@ class RootHandle {
|
|
|
7365
7691
|
}
|
|
7366
7692
|
async move(fromRelative, toRelative, options = {}) {
|
|
7367
7693
|
assertValidRootRelativePath(fromRelative);
|
|
7368
|
-
|
|
7694
|
+
assertValidRootDestinationPath(toRelative);
|
|
7369
7695
|
validatePinnedOperationPayload({ from: fromRelative, to: toRelative });
|
|
7370
|
-
const denyMutations =
|
|
7696
|
+
const { denyMutations } = this.mutationOptions(options);
|
|
7371
7697
|
await assertMoveMutationAllowed(this.context, {
|
|
7372
7698
|
fromRelative,
|
|
7373
7699
|
toRelative,
|
|
@@ -7399,6 +7725,8 @@ async function root_impl_root(rootDir, defaults = {}) {
|
|
|
7399
7725
|
async function openFileInRoot(root, params) {
|
|
7400
7726
|
const { rootWithSep, resolved } = await resolvePathInRoot(root, params.relativePath, {
|
|
7401
7727
|
allowFinalSymlink: true,
|
|
7728
|
+
rejectUnsafeDeviceReads: true,
|
|
7729
|
+
rejectSymlinks: params.symlinks !== "follow-within-root",
|
|
7402
7730
|
});
|
|
7403
7731
|
let opened;
|
|
7404
7732
|
try {
|
|
@@ -7415,11 +7743,11 @@ async function openFileInRoot(root, params) {
|
|
|
7415
7743
|
}
|
|
7416
7744
|
if (params.hardlinks !== "allow" && opened.stat.nlink > 1) {
|
|
7417
7745
|
await opened.handle.close().catch(() => { });
|
|
7418
|
-
throw
|
|
7746
|
+
throw hardlinkedPathNotAllowedError();
|
|
7419
7747
|
}
|
|
7420
7748
|
if (!path_isPathInside(rootWithSep, opened.realPath)) {
|
|
7421
7749
|
await opened.handle.close().catch(() => { });
|
|
7422
|
-
throw
|
|
7750
|
+
throw outsideWorkspaceError();
|
|
7423
7751
|
}
|
|
7424
7752
|
return opened;
|
|
7425
7753
|
}
|
|
@@ -7501,33 +7829,47 @@ async function verifyAtomicWriteResult(params) {
|
|
|
7501
7829
|
throw new errors_FsSafeError("path-mismatch", "path changed during write");
|
|
7502
7830
|
}
|
|
7503
7831
|
if (!path_isPathInside(params.root.rootWithSep, opened.realPath)) {
|
|
7504
|
-
throw
|
|
7832
|
+
throw outsideWorkspaceError();
|
|
7505
7833
|
}
|
|
7506
7834
|
}
|
|
7507
7835
|
finally {
|
|
7508
7836
|
await opened.handle.close().catch(() => { });
|
|
7509
7837
|
}
|
|
7510
7838
|
}
|
|
7511
|
-
async function
|
|
7512
|
-
const
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7839
|
+
async function resolveGuardedWritePathInRoot(root, params) {
|
|
7840
|
+
const resolvedPath = await resolvePathInRoot(root, params.relativePath, {
|
|
7841
|
+
aliasErrorCode: "path-alias",
|
|
7842
|
+
allowFinalSymlink: params.allowFinalSymlink,
|
|
7843
|
+
});
|
|
7844
|
+
await assertMutationNotDenied(resolvedPath.resolved, params.denyMutations, params.protectDeniedAncestors ? { protectAncestors: true } : undefined);
|
|
7845
|
+
if (await (params.shouldAssertNoPathAlias?.(resolvedPath) ?? true)) {
|
|
7846
|
+
try {
|
|
7847
|
+
await assertNoPathAliasEscape({
|
|
7848
|
+
absolutePath: resolvedPath.resolved,
|
|
7849
|
+
rootPath: resolvedPath.rootReal,
|
|
7850
|
+
boundaryLabel: "root",
|
|
7851
|
+
});
|
|
7852
|
+
}
|
|
7853
|
+
catch (error) {
|
|
7854
|
+
throw new errors_FsSafeError("path-alias", "path alias escape blocked", {
|
|
7855
|
+
cause: error instanceof Error ? error : undefined,
|
|
7856
|
+
});
|
|
7857
|
+
}
|
|
7523
7858
|
}
|
|
7859
|
+
return resolvedPath;
|
|
7860
|
+
}
|
|
7861
|
+
async function openWritableFileInRoot(root, params) {
|
|
7862
|
+
const { rootReal, rootWithSep, resolved } = await resolveGuardedWritePathInRoot(root, {
|
|
7863
|
+
relativePath: params.relativePath,
|
|
7864
|
+
denyMutations: params.denyMutations,
|
|
7865
|
+
});
|
|
7524
7866
|
let ioPath = params.mkdir === false
|
|
7525
7867
|
? resolved
|
|
7526
7868
|
: await prepareRootWriteTarget(rootReal, resolved);
|
|
7527
7869
|
try {
|
|
7528
7870
|
const resolvedRealPath = await promises_.realpath(ioPath);
|
|
7529
7871
|
if (!path_isPathInside(rootWithSep, resolvedRealPath)) {
|
|
7530
|
-
throw
|
|
7872
|
+
throw outsideWorkspaceError();
|
|
7531
7873
|
}
|
|
7532
7874
|
ioPath = resolvedRealPath;
|
|
7533
7875
|
}
|
|
@@ -7558,7 +7900,7 @@ async function openWritableFileInRoot(root, params) {
|
|
|
7558
7900
|
}
|
|
7559
7901
|
catch (err) {
|
|
7560
7902
|
if (path_isNotFoundPathError(err)) {
|
|
7561
|
-
throw
|
|
7903
|
+
throw fileNotFoundError();
|
|
7562
7904
|
}
|
|
7563
7905
|
if (isSymlinkOpenError(err)) {
|
|
7564
7906
|
throw new errors_FsSafeError("symlink", "symlink open blocked", { cause: err });
|
|
@@ -7569,13 +7911,17 @@ async function openWritableFileInRoot(root, params) {
|
|
|
7569
7911
|
throw err;
|
|
7570
7912
|
}
|
|
7571
7913
|
let realPathForCleanup = null;
|
|
7914
|
+
let createdIdentity = null;
|
|
7572
7915
|
try {
|
|
7573
7916
|
const stat = await handle.stat();
|
|
7917
|
+
if (createdForWrite) {
|
|
7918
|
+
createdIdentity = stat;
|
|
7919
|
+
}
|
|
7574
7920
|
if (!stat.isFile()) {
|
|
7575
|
-
throw new errors_FsSafeError("
|
|
7921
|
+
throw new errors_FsSafeError("not-file", "path is not a regular file under root");
|
|
7576
7922
|
}
|
|
7577
7923
|
if (stat.nlink > 1) {
|
|
7578
|
-
throw
|
|
7924
|
+
throw hardlinkedPathNotAllowedError();
|
|
7579
7925
|
}
|
|
7580
7926
|
try {
|
|
7581
7927
|
const lstat = await promises_.lstat(ioPath);
|
|
@@ -7598,10 +7944,10 @@ async function openWritableFileInRoot(root, params) {
|
|
|
7598
7944
|
throw new errors_FsSafeError("path-mismatch", "path mismatch");
|
|
7599
7945
|
}
|
|
7600
7946
|
if (realStat.nlink > 1) {
|
|
7601
|
-
throw
|
|
7947
|
+
throw hardlinkedPathNotAllowedError();
|
|
7602
7948
|
}
|
|
7603
7949
|
if (!path_isPathInside(rootWithSep, realPath)) {
|
|
7604
|
-
throw
|
|
7950
|
+
throw outsideWorkspaceError();
|
|
7605
7951
|
}
|
|
7606
7952
|
// Truncate only after boundary and identity checks complete. This avoids
|
|
7607
7953
|
// irreversible side effects if a symlink target changes before validation.
|
|
@@ -7621,8 +7967,8 @@ async function openWritableFileInRoot(root, params) {
|
|
|
7621
7967
|
const cleanupCreatedPath = createdForWrite && err instanceof errors_FsSafeError;
|
|
7622
7968
|
const cleanupPath = realPathForCleanup ?? ioPath;
|
|
7623
7969
|
await handle.close().catch(() => { });
|
|
7624
|
-
if (cleanupCreatedPath) {
|
|
7625
|
-
await
|
|
7970
|
+
if (cleanupCreatedPath && createdIdentity) {
|
|
7971
|
+
await removePathIfIdentityUnchanged(cleanupPath, createdIdentity).catch(() => { });
|
|
7626
7972
|
}
|
|
7627
7973
|
throw err;
|
|
7628
7974
|
}
|
|
@@ -7667,7 +8013,11 @@ async function appendFileInRoot(root, params) {
|
|
|
7667
8013
|
}
|
|
7668
8014
|
async function removePathInRoot(root, params) {
|
|
7669
8015
|
validatePinnedOperationPayload({ relativePath: params.relativePath });
|
|
7670
|
-
const resolved = await
|
|
8016
|
+
const resolved = await resolvePinnedPathInRoot(root, {
|
|
8017
|
+
relativePath: params.relativePath,
|
|
8018
|
+
denyMutations: params.denyMutations,
|
|
8019
|
+
remove: true,
|
|
8020
|
+
});
|
|
7671
8021
|
try {
|
|
7672
8022
|
await removePathFallback(resolved);
|
|
7673
8023
|
}
|
|
@@ -7686,15 +8036,16 @@ async function mkdirPathInRoot(root, params) {
|
|
|
7686
8036
|
}
|
|
7687
8037
|
}
|
|
7688
8038
|
async function writeFileInRoot(root, params) {
|
|
7689
|
-
|
|
7690
|
-
|
|
8039
|
+
await serializePathWrite(rootWriteQueueKey(root, params.relativePath), async () => {
|
|
8040
|
+
if (process.platform === "win32" &&
|
|
8041
|
+
(params.renameIdentity === "verify-content-with-lock" || !getNativeBinding())) {
|
|
7691
8042
|
await writeFileFallback(root, params);
|
|
8043
|
+
return;
|
|
8044
|
+
}
|
|
8045
|
+
const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, params.mode, params.denyMutations);
|
|
8046
|
+
await serializePathWrite(pinned.targetPath, async () => {
|
|
8047
|
+
await commitPinnedWriteInRoot(root, pinned, params);
|
|
7692
8048
|
});
|
|
7693
|
-
return;
|
|
7694
|
-
}
|
|
7695
|
-
const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, params.mode, params.denyMutations);
|
|
7696
|
-
await serializePathWrite(pinned.targetPath, async () => {
|
|
7697
|
-
await commitPinnedWriteInRoot(root, pinned, params);
|
|
7698
8049
|
});
|
|
7699
8050
|
}
|
|
7700
8051
|
async function commitPinnedWriteInRoot(root, pinned, params) {
|
|
@@ -7710,6 +8061,7 @@ async function commitPinnedWriteInRoot(root, pinned, params) {
|
|
|
7710
8061
|
mode: params.mode ?? pinned.mode,
|
|
7711
8062
|
overwrite: params.overwrite,
|
|
7712
8063
|
input: { kind: "buffer", data: params.data, encoding: params.encoding },
|
|
8064
|
+
rootIdentity: root.rootIdentity,
|
|
7713
8065
|
});
|
|
7714
8066
|
}
|
|
7715
8067
|
catch (error) {
|
|
@@ -7747,26 +8099,35 @@ async function copyFileInRoot(root, params) {
|
|
|
7747
8099
|
throw new errors_FsSafeError("too-large", `file exceeds limit of ${params.maxBytes} bytes (got ${source.stat.size})`);
|
|
7748
8100
|
}
|
|
7749
8101
|
try {
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
await
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
8102
|
+
await serializePathWrite(rootWriteQueueKey(root, params.relativePath), async () => {
|
|
8103
|
+
const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, params.mode, params.denyMutations);
|
|
8104
|
+
await serializePathWrite(pinned.targetPath, async () => {
|
|
8105
|
+
await assertCopySourceCurrent(source);
|
|
8106
|
+
let identity;
|
|
8107
|
+
try {
|
|
8108
|
+
identity = await runPinnedWriteHelper({
|
|
8109
|
+
rootPath: pinned.rootReal,
|
|
8110
|
+
relativeParentPath: pinned.relativeParentPath,
|
|
8111
|
+
basename: pinned.basename,
|
|
8112
|
+
mkdir: params.mkdir !== false,
|
|
8113
|
+
mode: pinned.mode,
|
|
8114
|
+
overwrite: true,
|
|
8115
|
+
maxBytes: params.maxBytes,
|
|
8116
|
+
input: { kind: "stream", stream: source.handle.createReadStream() },
|
|
8117
|
+
rootIdentity: root.rootIdentity,
|
|
8118
|
+
});
|
|
8119
|
+
}
|
|
8120
|
+
catch (error) {
|
|
8121
|
+
throw normalizePinnedWriteError(error);
|
|
8122
|
+
}
|
|
8123
|
+
try {
|
|
8124
|
+
await assertCopySourcePathCurrent(source);
|
|
8125
|
+
}
|
|
8126
|
+
catch (error) {
|
|
8127
|
+
await removePathIfIdentityUnchanged(pinned.targetPath, identity).catch(() => undefined);
|
|
8128
|
+
throw error;
|
|
8129
|
+
}
|
|
7762
8130
|
});
|
|
7763
|
-
try {
|
|
7764
|
-
await assertCopySourcePathCurrent(source);
|
|
7765
|
-
}
|
|
7766
|
-
catch (error) {
|
|
7767
|
-
await removeCopyTargetIfUnchanged(pinned.targetPath, identity).catch(() => undefined);
|
|
7768
|
-
throw error;
|
|
7769
|
-
}
|
|
7770
8131
|
});
|
|
7771
8132
|
}
|
|
7772
8133
|
finally {
|
|
@@ -7786,7 +8147,7 @@ async function assertCopySourcePathCurrent(source) {
|
|
|
7786
8147
|
throw new errors_FsSafeError("path-mismatch", "copy source path changed");
|
|
7787
8148
|
}
|
|
7788
8149
|
}
|
|
7789
|
-
async function
|
|
8150
|
+
async function removePathIfIdentityUnchanged(targetPath, identity) {
|
|
7790
8151
|
const parentGuard = await directory_guard_createAsyncDirectoryGuard(external_node_path_.dirname(targetPath));
|
|
7791
8152
|
const current = await promises_.lstat(targetPath);
|
|
7792
8153
|
if (current.isSymbolicLink() || !file_identity_sameFileIdentity(current, identity)) {
|
|
@@ -7797,25 +8158,15 @@ async function removeCopyTargetIfUnchanged(targetPath, identity) {
|
|
|
7797
8158
|
});
|
|
7798
8159
|
}
|
|
7799
8160
|
async function resolvePinnedWriteTargetInRoot(root, relativePath, requestedMode, denyMutations) {
|
|
7800
|
-
const { rootReal, rootWithSep, resolved } = await
|
|
7801
|
-
|
|
8161
|
+
const { rootReal, rootWithSep, resolved } = await resolveGuardedWritePathInRoot(root, {
|
|
8162
|
+
relativePath,
|
|
8163
|
+
denyMutations,
|
|
7802
8164
|
});
|
|
7803
|
-
await assertMutationNotDenied(resolved, denyMutations);
|
|
7804
|
-
try {
|
|
7805
|
-
await assertNoPathAliasEscape({
|
|
7806
|
-
absolutePath: resolved,
|
|
7807
|
-
rootPath: rootReal,
|
|
7808
|
-
boundaryLabel: "root",
|
|
7809
|
-
});
|
|
7810
|
-
}
|
|
7811
|
-
catch (err) {
|
|
7812
|
-
throw new errors_FsSafeError("path-alias", "path alias escape blocked", { cause: err });
|
|
7813
|
-
}
|
|
7814
8165
|
// resolvePathInRoot already enforces isPathInside, so any actual escape
|
|
7815
8166
|
// is rejected upstream.
|
|
7816
8167
|
const relativeResolved = external_node_path_.relative(rootReal, resolved);
|
|
7817
8168
|
if (external_node_path_.isAbsolute(relativeResolved)) {
|
|
7818
|
-
throw
|
|
8169
|
+
throw outsideWorkspaceError();
|
|
7819
8170
|
}
|
|
7820
8171
|
const relativePosix = relativeResolved
|
|
7821
8172
|
? relativeResolved.split(external_node_path_.sep).join(external_node_path_.posix.sep)
|
|
@@ -7830,11 +8181,12 @@ async function resolvePinnedWriteTargetInRoot(root, relativePath, requestedMode,
|
|
|
7830
8181
|
relativePath,
|
|
7831
8182
|
hardlinks: "reject",
|
|
7832
8183
|
nonBlockingRead: true,
|
|
8184
|
+
symlinks: "follow-within-root",
|
|
7833
8185
|
});
|
|
7834
8186
|
try {
|
|
7835
8187
|
mode = requestedMode ?? (opened.stat.mode & 0o777);
|
|
7836
8188
|
if (!path_isPathInside(rootWithSep, opened.realPath)) {
|
|
7837
|
-
throw
|
|
8189
|
+
throw outsideWorkspaceError();
|
|
7838
8190
|
}
|
|
7839
8191
|
}
|
|
7840
8192
|
finally {
|
|
@@ -7858,17 +8210,9 @@ async function resolvePinnedPathInRoot(root, params) {
|
|
|
7858
8210
|
return await resolvePinnedOperationPathInRoot(root, {
|
|
7859
8211
|
allowRoot: params.allowRoot,
|
|
7860
8212
|
denyMutations: params.denyMutations,
|
|
7861
|
-
protectDenyMutationAncestors:
|
|
8213
|
+
protectDenyMutationAncestors: params.remove === true,
|
|
7862
8214
|
relativePath: params.relativePath,
|
|
7863
|
-
policy: PATH_ALIAS_POLICIES.strict,
|
|
7864
|
-
});
|
|
7865
|
-
}
|
|
7866
|
-
async function resolvePinnedRemovePathInRoot(root, relativePath, denyMutations) {
|
|
7867
|
-
return await resolvePinnedOperationPathInRoot(root, {
|
|
7868
|
-
denyMutations,
|
|
7869
|
-
protectDenyMutationAncestors: true,
|
|
7870
|
-
relativePath,
|
|
7871
|
-
policy: PATH_ALIAS_POLICIES.unlinkTarget,
|
|
8215
|
+
policy: params.remove ? PATH_ALIAS_POLICIES.unlinkTarget : PATH_ALIAS_POLICIES.strict,
|
|
7872
8216
|
});
|
|
7873
8217
|
}
|
|
7874
8218
|
async function resolvePinnedOperationPathInRoot(root, params) {
|
|
@@ -7886,11 +8230,11 @@ async function resolvePinnedOperationPathInRoot(root, params) {
|
|
|
7886
8230
|
relativeResolved === "." ||
|
|
7887
8231
|
firstSegment === ".." ||
|
|
7888
8232
|
external_node_path_.isAbsolute(relativeResolved)) {
|
|
7889
|
-
throw
|
|
8233
|
+
throw outsideWorkspaceError();
|
|
7890
8234
|
}
|
|
7891
8235
|
const relativePosix = relativeResolved.split(external_node_path_.sep).join(external_node_path_.posix.sep);
|
|
7892
8236
|
if (!path_isPathInside(resolved.rootWithSep, resolved.canonicalPath)) {
|
|
7893
|
-
throw
|
|
8237
|
+
throw outsideWorkspaceError();
|
|
7894
8238
|
}
|
|
7895
8239
|
await assertMutationNotDenied(resolved.canonicalPath, params.denyMutations, {
|
|
7896
8240
|
protectAncestors: params.protectDenyMutationAncestors,
|
|
@@ -7898,6 +8242,7 @@ async function resolvePinnedOperationPathInRoot(root, params) {
|
|
|
7898
8242
|
return { rootReal: resolved.rootReal, resolved: resolved.canonicalPath, relativePosix };
|
|
7899
8243
|
}
|
|
7900
8244
|
async function resolvePinnedRootPathInRoot(root, params) {
|
|
8245
|
+
await assertRootIdentityCurrent(root);
|
|
7901
8246
|
const rootReal = root.rootReal;
|
|
7902
8247
|
let resolved;
|
|
7903
8248
|
try {
|
|
@@ -7922,11 +8267,25 @@ async function resolvePinnedRootPathInRoot(root, params) {
|
|
|
7922
8267
|
canonicalPath: resolved.canonicalPath,
|
|
7923
8268
|
};
|
|
7924
8269
|
}
|
|
8270
|
+
async function prepareRemoveGuard(targetPath) {
|
|
8271
|
+
try {
|
|
8272
|
+
const guard = await directory_guard_createAsyncDirectoryGuard(external_node_path_.dirname(targetPath));
|
|
8273
|
+
await getFsSafeTestHooks()?.beforeRootFallbackMutation?.("remove", targetPath);
|
|
8274
|
+
await assertAsyncDirectoryGuard(guard);
|
|
8275
|
+
return guard;
|
|
8276
|
+
}
|
|
8277
|
+
catch (error) {
|
|
8278
|
+
throw normalizeRemoveGuardError(error);
|
|
8279
|
+
}
|
|
8280
|
+
}
|
|
7925
8281
|
async function removePathFallback(resolved) {
|
|
7926
|
-
const guard = await
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
8282
|
+
const guard = await prepareRemoveGuard(resolved.resolved);
|
|
8283
|
+
try {
|
|
8284
|
+
await ((await promises_.lstat(resolved.resolved)).isDirectory() ? promises_.rmdir(resolved.resolved) : promises_.rm(resolved.resolved));
|
|
8285
|
+
}
|
|
8286
|
+
catch (error) {
|
|
8287
|
+
throw normalizeRemovePathError(error);
|
|
8288
|
+
}
|
|
7930
8289
|
await assertAsyncDirectoryGuard(guard).catch(() => undefined);
|
|
7931
8290
|
}
|
|
7932
8291
|
async function mkdirPathFallback(resolved) {
|
|
@@ -7938,13 +8297,13 @@ async function mkdirPathFallback(resolved) {
|
|
|
7938
8297
|
async function statPathFallback(root, relativePath) {
|
|
7939
8298
|
const resolved = await resolvePinnedPathInRoot(root, { relativePath, allowRoot: true });
|
|
7940
8299
|
try {
|
|
7941
|
-
|
|
8300
|
+
const stat = pathStatFromStats(await promises_.lstat(resolved.resolved));
|
|
8301
|
+
await assertRootIdentityCurrent(root);
|
|
8302
|
+
return stat;
|
|
7942
8303
|
}
|
|
7943
8304
|
catch (error) {
|
|
7944
8305
|
if (path_isNotFoundPathError(error)) {
|
|
7945
|
-
throw
|
|
7946
|
-
cause: error instanceof Error ? error : undefined,
|
|
7947
|
-
});
|
|
8306
|
+
throw fileNotFoundError(error instanceof Error ? error : undefined);
|
|
7948
8307
|
}
|
|
7949
8308
|
throw error;
|
|
7950
8309
|
}
|
|
@@ -7955,6 +8314,7 @@ async function listPathFallback(root, relativePath, withFileTypes) {
|
|
|
7955
8314
|
const names = await promises_.readdir(resolved.resolved);
|
|
7956
8315
|
const sortedNames = names.toSorted();
|
|
7957
8316
|
if (!withFileTypes) {
|
|
8317
|
+
await assertRootIdentityCurrent(root);
|
|
7958
8318
|
return sortedNames;
|
|
7959
8319
|
}
|
|
7960
8320
|
const entries = [];
|
|
@@ -7964,6 +8324,7 @@ async function listPathFallback(root, relativePath, withFileTypes) {
|
|
|
7964
8324
|
...pathStatFromStats(await promises_.lstat(external_node_path_.join(resolved.resolved, name))),
|
|
7965
8325
|
});
|
|
7966
8326
|
}
|
|
8327
|
+
await assertRootIdentityCurrent(root);
|
|
7967
8328
|
return entries;
|
|
7968
8329
|
}
|
|
7969
8330
|
catch (error) {
|
|
@@ -7976,6 +8337,8 @@ async function listPathFallback(root, relativePath, withFileTypes) {
|
|
|
7976
8337
|
}
|
|
7977
8338
|
}
|
|
7978
8339
|
async function assertMoveMutationAllowed(root, params) {
|
|
8340
|
+
// Keep this preflight separate from the pinned resolutions in movePathFallback:
|
|
8341
|
+
// mutation denials must take precedence over source alias or identity failures.
|
|
7979
8342
|
const source = await resolvePathInRoot(root, params.fromRelative, {
|
|
7980
8343
|
aliasErrorCode: "path-alias",
|
|
7981
8344
|
allowFinalSymlink: true,
|
|
@@ -7997,40 +8360,29 @@ async function movePathFallback(root, params) {
|
|
|
7997
8360
|
relativePath: params.fromRelative,
|
|
7998
8361
|
policy: PATH_ALIAS_POLICIES.strict,
|
|
7999
8362
|
});
|
|
8000
|
-
const target = await
|
|
8001
|
-
aliasErrorCode: "path-alias",
|
|
8002
|
-
allowFinalSymlink: true,
|
|
8003
|
-
});
|
|
8004
|
-
await assertMutationNotDenied(target.resolved, params.denyMutations, { protectAncestors: true });
|
|
8005
|
-
await resolvePinnedRootPathInRoot(root, {
|
|
8363
|
+
const target = await resolveGuardedWritePathInRoot(root, {
|
|
8006
8364
|
relativePath: params.toRelative,
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
absolutePath: target.resolved,
|
|
8015
|
-
rootPath: target.rootReal,
|
|
8016
|
-
boundaryLabel: "root",
|
|
8017
|
-
});
|
|
8018
|
-
}
|
|
8019
|
-
catch (error) {
|
|
8020
|
-
throw new errors_FsSafeError("path-alias", "path alias escape blocked", {
|
|
8021
|
-
cause: error instanceof Error ? error : undefined,
|
|
8365
|
+
denyMutations: params.denyMutations,
|
|
8366
|
+
allowFinalSymlink: true,
|
|
8367
|
+
protectDeniedAncestors: true,
|
|
8368
|
+
shouldAssertNoPathAlias: async (resolvedTarget) => {
|
|
8369
|
+
await resolvePinnedRootPathInRoot(root, {
|
|
8370
|
+
relativePath: params.toRelative,
|
|
8371
|
+
policy: PATH_ALIAS_POLICIES.unlinkTarget,
|
|
8022
8372
|
});
|
|
8023
|
-
|
|
8024
|
-
|
|
8373
|
+
const targetStat = await promises_.lstat(resolvedTarget.resolved).catch(() => undefined);
|
|
8374
|
+
return !(process.platform !== "win32" &&
|
|
8375
|
+
params.overwrite &&
|
|
8376
|
+
targetStat?.isSymbolicLink() === true);
|
|
8377
|
+
},
|
|
8378
|
+
});
|
|
8025
8379
|
let sourceStat;
|
|
8026
8380
|
try {
|
|
8027
8381
|
sourceStat = await promises_.lstat(source.resolved);
|
|
8028
8382
|
}
|
|
8029
8383
|
catch (error) {
|
|
8030
8384
|
if (path_isNotFoundPathError(error)) {
|
|
8031
|
-
throw
|
|
8032
|
-
cause: error instanceof Error ? error : undefined,
|
|
8033
|
-
});
|
|
8385
|
+
throw fileNotFoundError(error instanceof Error ? error : undefined);
|
|
8034
8386
|
}
|
|
8035
8387
|
throw error;
|
|
8036
8388
|
}
|
|
@@ -8038,7 +8390,7 @@ async function movePathFallback(root, params) {
|
|
|
8038
8390
|
throw new errors_FsSafeError("symlink", "symlink not allowed");
|
|
8039
8391
|
}
|
|
8040
8392
|
if (sourceStat.isFile() && sourceStat.nlink > 1) {
|
|
8041
|
-
throw
|
|
8393
|
+
throw hardlinkedPathNotAllowedError();
|
|
8042
8394
|
}
|
|
8043
8395
|
if (!params.overwrite && sourceStat.isDirectory()) {
|
|
8044
8396
|
throw new errors_FsSafeError("invalid-path", "directory moves require overwrite: true");
|
|
@@ -8067,9 +8419,7 @@ async function movePathFallback(root, params) {
|
|
|
8067
8419
|
}
|
|
8068
8420
|
catch (error) {
|
|
8069
8421
|
if (path_isNotFoundPathError(error)) {
|
|
8070
|
-
throw
|
|
8071
|
-
cause: error instanceof Error ? error : undefined,
|
|
8072
|
-
});
|
|
8422
|
+
throw fileNotFoundError(error instanceof Error ? error : undefined);
|
|
8073
8423
|
}
|
|
8074
8424
|
if (hasNodeErrorCode(error, "EEXIST")) {
|
|
8075
8425
|
throw new errors_FsSafeError("already-exists", "destination exists", {
|
|
@@ -8135,30 +8485,22 @@ async function writeFileFallback(root, params) {
|
|
|
8135
8485
|
}
|
|
8136
8486
|
}
|
|
8137
8487
|
async function writeMissingFileFallback(root, params) {
|
|
8138
|
-
const { rootReal, resolved } = await
|
|
8139
|
-
|
|
8488
|
+
const { rootReal, resolved } = await resolveGuardedWritePathInRoot(root, {
|
|
8489
|
+
relativePath: params.relativePath,
|
|
8490
|
+
denyMutations: params.denyMutations,
|
|
8140
8491
|
});
|
|
8141
|
-
await assertMutationNotDenied(resolved, params.denyMutations);
|
|
8142
|
-
try {
|
|
8143
|
-
await assertNoPathAliasEscape({
|
|
8144
|
-
absolutePath: resolved,
|
|
8145
|
-
rootPath: rootReal,
|
|
8146
|
-
boundaryLabel: "root",
|
|
8147
|
-
});
|
|
8148
|
-
}
|
|
8149
|
-
catch (err) {
|
|
8150
|
-
throw new errors_FsSafeError("path-alias", "path alias escape blocked", { cause: err });
|
|
8151
|
-
}
|
|
8152
8492
|
const targetPath = params.mkdir === false
|
|
8153
8493
|
? resolved
|
|
8154
8494
|
: await prepareRootWriteTarget(rootReal, resolved);
|
|
8155
8495
|
const parentGuard = await directory_guard_createAsyncDirectoryGuard(external_node_path_.dirname(targetPath));
|
|
8156
8496
|
let created = false;
|
|
8497
|
+
let createdIdentity;
|
|
8157
8498
|
try {
|
|
8158
8499
|
const { handle, writtenStat } = await withAsyncDirectoryGuards([parentGuard], async () => {
|
|
8159
8500
|
const handle = await promises_.open(targetPath, OPEN_WRITE_CREATE_FLAGS, params.mode ?? 0o600);
|
|
8160
8501
|
created = true;
|
|
8161
8502
|
try {
|
|
8503
|
+
createdIdentity = await handle.stat();
|
|
8162
8504
|
if (typeof params.data === "string") {
|
|
8163
8505
|
await handle.writeFile(params.data, params.encoding ?? "utf8");
|
|
8164
8506
|
}
|
|
@@ -8194,8 +8536,8 @@ async function writeMissingFileFallback(root, params) {
|
|
|
8194
8536
|
throw err;
|
|
8195
8537
|
}
|
|
8196
8538
|
finally {
|
|
8197
|
-
if (created) {
|
|
8198
|
-
await
|
|
8539
|
+
if (created && createdIdentity) {
|
|
8540
|
+
await removePathIfIdentityUnchanged(targetPath, createdIdentity).catch(() => undefined);
|
|
8199
8541
|
}
|
|
8200
8542
|
}
|
|
8201
8543
|
}
|
|
@@ -11689,11 +12031,11 @@ const $ZodXor = /*@__PURE__*/ (/* unused pure expression or super */ null && (co
|
|
|
11689
12031
|
})));
|
|
11690
12032
|
const $ZodDiscriminatedUnion =
|
|
11691
12033
|
/*@__PURE__*/
|
|
11692
|
-
|
|
12034
|
+
$constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
11693
12035
|
def.inclusive = false;
|
|
11694
12036
|
$ZodUnion.init(inst, def);
|
|
11695
12037
|
const _super = inst._zod.parse;
|
|
11696
|
-
|
|
12038
|
+
defineLazy(inst._zod, "propValues", () => {
|
|
11697
12039
|
const propValues = {};
|
|
11698
12040
|
for (const option of def.options) {
|
|
11699
12041
|
const pv = option._zod.propValues;
|
|
@@ -11709,7 +12051,7 @@ const $ZodDiscriminatedUnion =
|
|
|
11709
12051
|
}
|
|
11710
12052
|
return propValues;
|
|
11711
12053
|
});
|
|
11712
|
-
const disc =
|
|
12054
|
+
const disc = util_cached(() => {
|
|
11713
12055
|
const opts = def.options;
|
|
11714
12056
|
const map = new Map();
|
|
11715
12057
|
for (const o of opts) {
|
|
@@ -11727,7 +12069,7 @@ const $ZodDiscriminatedUnion =
|
|
|
11727
12069
|
});
|
|
11728
12070
|
inst._zod.parse = (payload, ctx) => {
|
|
11729
12071
|
const input = payload.value;
|
|
11730
|
-
if (!
|
|
12072
|
+
if (!util_isObject(input)) {
|
|
11731
12073
|
payload.issues.push({
|
|
11732
12074
|
code: "invalid_type",
|
|
11733
12075
|
expected: "object",
|
|
@@ -11760,7 +12102,7 @@ const $ZodDiscriminatedUnion =
|
|
|
11760
12102
|
});
|
|
11761
12103
|
return payload;
|
|
11762
12104
|
};
|
|
11763
|
-
})
|
|
12105
|
+
});
|
|
11764
12106
|
const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
|
|
11765
12107
|
$ZodType.init(inst, def);
|
|
11766
12108
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -15937,17 +16279,17 @@ function xor(options, params) {
|
|
|
15937
16279
|
...util.normalizeParams(params),
|
|
15938
16280
|
});
|
|
15939
16281
|
}
|
|
15940
|
-
const ZodDiscriminatedUnion = /*@__PURE__*/
|
|
16282
|
+
const ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
15941
16283
|
ZodUnion.init(inst, def);
|
|
15942
|
-
|
|
15943
|
-
})
|
|
16284
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
16285
|
+
});
|
|
15944
16286
|
function discriminatedUnion(discriminator, options, params) {
|
|
15945
16287
|
// const [options, params] = args;
|
|
15946
16288
|
return new ZodDiscriminatedUnion({
|
|
15947
16289
|
type: "union",
|
|
15948
16290
|
options,
|
|
15949
16291
|
discriminator,
|
|
15950
|
-
...
|
|
16292
|
+
...normalizeParams(params),
|
|
15951
16293
|
});
|
|
15952
16294
|
}
|
|
15953
16295
|
const ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
|
|
@@ -19835,7 +20177,7 @@ const pathe_M_eThtNZ_path = (/* unused pure expression or super */ null && ({
|
|
|
19835
20177
|
// EXTERNAL MODULE: ../../node_modules/dotenv/lib/main.js
|
|
19836
20178
|
var lib_main = __webpack_require__(5599);
|
|
19837
20179
|
// EXTERNAL MODULE: external "node:assert"
|
|
19838
|
-
var external_node_assert_ = __webpack_require__(
|
|
20180
|
+
var external_node_assert_ = __webpack_require__(6970);
|
|
19839
20181
|
;// CONCATENATED MODULE: ../../node_modules/exsolve/dist/index.mjs
|
|
19840
20182
|
|
|
19841
20183
|
|
|
@@ -19941,7 +20283,7 @@ function getExpectedArgumentLength(message) {
|
|
|
19941
20283
|
while (regex.exec(message) !== null) expectedLength++;
|
|
19942
20284
|
return expectedLength;
|
|
19943
20285
|
}
|
|
19944
|
-
function
|
|
20286
|
+
function dist_createError(sym, value, constructor) {
|
|
19945
20287
|
messages.set(sym, value);
|
|
19946
20288
|
return makeNodeErrorWithCode(constructor, sym);
|
|
19947
20289
|
}
|
|
@@ -20059,7 +20401,7 @@ function determineSpecificType(value) {
|
|
|
20059
20401
|
}
|
|
20060
20402
|
}
|
|
20061
20403
|
}
|
|
20062
|
-
|
|
20404
|
+
dist_createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
|
20063
20405
|
external_node_assert_.ok(typeof name === "string", "'name' must be a string");
|
|
20064
20406
|
if (!Array.isArray(expected)) expected = [expected];
|
|
20065
20407
|
let message = "The ";
|
|
@@ -20103,13 +20445,13 @@ createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
|
|
20103
20445
|
message += `. Received ${determineSpecificType(actual)}`;
|
|
20104
20446
|
return message;
|
|
20105
20447
|
}, TypeError);
|
|
20106
|
-
const ERR_INVALID_MODULE_SPECIFIER =
|
|
20448
|
+
const ERR_INVALID_MODULE_SPECIFIER = dist_createError("ERR_INVALID_MODULE_SPECIFIER", (request, reason, base) => {
|
|
20107
20449
|
return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
|
|
20108
20450
|
}, TypeError);
|
|
20109
|
-
const ERR_INVALID_PACKAGE_CONFIG =
|
|
20451
|
+
const ERR_INVALID_PACKAGE_CONFIG = dist_createError("ERR_INVALID_PACKAGE_CONFIG", (path, base, message) => {
|
|
20110
20452
|
return `Invalid package config ${path}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
20111
20453
|
}, Error);
|
|
20112
|
-
const ERR_INVALID_PACKAGE_TARGET =
|
|
20454
|
+
const ERR_INVALID_PACKAGE_TARGET = dist_createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = false, base) => {
|
|
20113
20455
|
const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
20114
20456
|
if (key === ".") {
|
|
20115
20457
|
external_node_assert_.ok(isImport === false);
|
|
@@ -20117,26 +20459,26 @@ const ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (pa
|
|
|
20117
20459
|
}
|
|
20118
20460
|
return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? "; targets must start with \"./\"" : ""}`;
|
|
20119
20461
|
}, Error);
|
|
20120
|
-
const ERR_MODULE_NOT_FOUND =
|
|
20462
|
+
const ERR_MODULE_NOT_FOUND = dist_createError("ERR_MODULE_NOT_FOUND", function(path, base, exactUrl = false) {
|
|
20121
20463
|
if (exactUrl && typeof exactUrl === "string") this.url = `${exactUrl}`;
|
|
20122
20464
|
return `Cannot find ${exactUrl ? "module" : "package"} '${path}' imported from ${base}`;
|
|
20123
20465
|
}, Error);
|
|
20124
|
-
const ERR_PACKAGE_IMPORT_NOT_DEFINED =
|
|
20466
|
+
const ERR_PACKAGE_IMPORT_NOT_DEFINED = dist_createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => {
|
|
20125
20467
|
return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
|
|
20126
20468
|
}, TypeError);
|
|
20127
|
-
const ERR_PACKAGE_PATH_NOT_EXPORTED =
|
|
20469
|
+
const ERR_PACKAGE_PATH_NOT_EXPORTED = dist_createError("ERR_PACKAGE_PATH_NOT_EXPORTED", (packagePath, subpath, base) => {
|
|
20128
20470
|
if (subpath === ".") return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
20129
20471
|
return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
20130
20472
|
}, Error);
|
|
20131
|
-
const ERR_UNSUPPORTED_DIR_IMPORT =
|
|
20473
|
+
const ERR_UNSUPPORTED_DIR_IMPORT = dist_createError("ERR_UNSUPPORTED_DIR_IMPORT", function(path, base, exactUrl = void 0) {
|
|
20132
20474
|
this.url = exactUrl;
|
|
20133
20475
|
return `Directory import '${path}' is not supported resolving ES modules imported from ${base}`;
|
|
20134
20476
|
}, Error);
|
|
20135
|
-
const ERR_UNSUPPORTED_RESOLVE_REQUEST =
|
|
20136
|
-
const ERR_UNKNOWN_FILE_EXTENSION =
|
|
20477
|
+
const ERR_UNSUPPORTED_RESOLVE_REQUEST = dist_createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", "Failed to resolve module specifier \"%s\" from \"%s\": Invalid relative URL or base scheme is not hierarchical.", TypeError);
|
|
20478
|
+
const ERR_UNKNOWN_FILE_EXTENSION = dist_createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path) => {
|
|
20137
20479
|
return `Unknown file extension "${extension}" for ${path}`;
|
|
20138
20480
|
}, TypeError);
|
|
20139
|
-
|
|
20481
|
+
dist_createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
|
|
20140
20482
|
let inspected = (0,external_node_util_.inspect)(value);
|
|
20141
20483
|
if (inspected.length > 128) inspected = `${inspected.slice(0, 128)}...`;
|
|
20142
20484
|
return `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
|
|
@@ -33047,11 +33389,28 @@ async function walkMarkdownFiles(targetDir, resolvedRootDir, dir, depth, deriveN
|
|
|
33047
33389
|
|
|
33048
33390
|
/** Maximum hook config file size: 1 MB */ const MAX_CONFIG_FILE_BYTES = 1_048_576;
|
|
33049
33391
|
/** Matches the Copilot hook key `"preToolUse":` to detect hook section presence */ const COPILOT_HOOK_PATTERN = /"preToolUse"\s*:/;
|
|
33050
|
-
/** Matches the Claude hook key `"
|
|
33392
|
+
/** Matches the Claude hook key `"hooks":` to detect hook section presence */ const CLAUDE_HOOK_PATTERN = /"hooks"\s*:/;
|
|
33051
33393
|
/** Catalog hook config paths converted to OS-native relative paths. */ const HOOK_CONFIG_PATHS = hookConfigPaths().map((entry)=>({
|
|
33052
33394
|
relativePath: (0,external_node_path_.join)(...entry.relativePath.split("/")),
|
|
33053
33395
|
platform: entry.platform
|
|
33054
33396
|
}));
|
|
33397
|
+
/**
|
|
33398
|
+
* Structural check for a `hooks` object on a parsed settings file.
|
|
33399
|
+
*
|
|
33400
|
+
* Uses `Object.hasOwn` so a `hooks` key inherited from the prototype chain
|
|
33401
|
+
* cannot make an unrelated file look like a hook config. Arrays are rejected
|
|
33402
|
+
* even though `typeof [] === "object"`, because a hooks section is keyed by
|
|
33403
|
+
* event name.
|
|
33404
|
+
*/ function hasHooksSection(parsed) {
|
|
33405
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
33406
|
+
return false;
|
|
33407
|
+
}
|
|
33408
|
+
if (!Object.hasOwn(parsed, "hooks")) {
|
|
33409
|
+
return false;
|
|
33410
|
+
}
|
|
33411
|
+
const hooks = parsed.hooks;
|
|
33412
|
+
return hooks !== null && typeof hooks === "object" && !Array.isArray(hooks);
|
|
33413
|
+
}
|
|
33055
33414
|
/**
|
|
33056
33415
|
* File system implementation of the hook config lint gateway.
|
|
33057
33416
|
*/ class FileSystemHookConfigGateway {
|
|
@@ -33098,14 +33457,24 @@ async function walkMarkdownFiles(targetDir, resolvedRootDir, dir, depth, deriveN
|
|
|
33098
33457
|
return readFileNoFollow(filePath, MAX_CONFIG_FILE_BYTES);
|
|
33099
33458
|
}
|
|
33100
33459
|
/**
|
|
33101
|
-
*
|
|
33102
|
-
*
|
|
33103
|
-
*
|
|
33460
|
+
* Checks whether a file may contain a hooks section.
|
|
33461
|
+
*
|
|
33462
|
+
* Claude Code settings files carry much more than hooks, and the `hooks`
|
|
33463
|
+
* key is generic enough to appear inside unrelated string values, so a
|
|
33464
|
+
* parsed structural check is used when the JSON is well-formed. Malformed
|
|
33465
|
+
* JSON falls back to a substring search so the file is still discovered
|
|
33466
|
+
* and surfaced as a `hook/invalid-json` diagnostic by the use case.
|
|
33104
33467
|
*/ mayContainHookSection(content, platform) {
|
|
33105
33468
|
if (platform === "copilot") {
|
|
33106
33469
|
return COPILOT_HOOK_PATTERN.test(content);
|
|
33107
33470
|
}
|
|
33108
|
-
|
|
33471
|
+
let parsed;
|
|
33472
|
+
try {
|
|
33473
|
+
parsed = JSON.parse(content);
|
|
33474
|
+
} catch {
|
|
33475
|
+
return CLAUDE_HOOK_PATTERN.test(content);
|
|
33476
|
+
}
|
|
33477
|
+
return hasHooksSection(parsed);
|
|
33109
33478
|
}
|
|
33110
33479
|
}
|
|
33111
33480
|
/**
|
|
@@ -52849,6 +53218,7 @@ async function resolveConfigPathOrNull(targetDir, relativePath) {
|
|
|
52849
53218
|
"hook/invalid-json": "error",
|
|
52850
53219
|
"hook/invalid-config": "error",
|
|
52851
53220
|
"hook/missing-command": "error",
|
|
53221
|
+
"hook/unknown-event": "error",
|
|
52852
53222
|
"hook/missing-matcher": "warn",
|
|
52853
53223
|
"hook/missing-timeout": "warn"
|
|
52854
53224
|
},
|
|
@@ -53153,6 +53523,167 @@ async function resolveConfigPathOrNull(targetDir, relativePath) {
|
|
|
53153
53523
|
return lines[0]?.trim() === "---";
|
|
53154
53524
|
}
|
|
53155
53525
|
|
|
53526
|
+
;// CONCATENATED MODULE: ../core/src/entities/claude-hook-schema.ts
|
|
53527
|
+
// biome-ignore-all lint/style/useNamingConvention: Claude Code API uses PascalCase hook event names (PreToolUse) and snake_case handler types (mcp_tool)
|
|
53528
|
+
/**
|
|
53529
|
+
* Zod schemas for the Claude Code hooks configuration format.
|
|
53530
|
+
*
|
|
53531
|
+
* Lives in entities (Layer 1) so that use cases can import it without
|
|
53532
|
+
* violating the dependency rule, mirroring `copilot-hook-schema.ts`.
|
|
53533
|
+
*
|
|
53534
|
+
* Modelled on https://code.claude.com/docs/en/hooks. Claude Code settings
|
|
53535
|
+
* files carry far more than hooks, so the top level is permissive
|
|
53536
|
+
* (`.passthrough()`); the `hooks` section itself is strict so that a
|
|
53537
|
+
* misspelled event name — which silently never fires — is reported.
|
|
53538
|
+
*/
|
|
53539
|
+
const MAX_HOOKS_PER_ENTRY = 100;
|
|
53540
|
+
/**
|
|
53541
|
+
* Events that accept a `matcher`. The remainder fire unconditionally, so a
|
|
53542
|
+
* missing `matcher` is only worth reporting for the events listed here.
|
|
53543
|
+
*/ const MATCHER_SUPPORTING_EVENTS = new Set([
|
|
53544
|
+
"PreToolUse",
|
|
53545
|
+
"PostToolUse",
|
|
53546
|
+
"PostToolUseFailure",
|
|
53547
|
+
"PermissionRequest",
|
|
53548
|
+
"PermissionDenied",
|
|
53549
|
+
"SessionStart",
|
|
53550
|
+
"Setup",
|
|
53551
|
+
"SessionEnd",
|
|
53552
|
+
"Notification",
|
|
53553
|
+
"SubagentStart",
|
|
53554
|
+
"SubagentStop",
|
|
53555
|
+
"PreCompact",
|
|
53556
|
+
"PostCompact",
|
|
53557
|
+
"ConfigChange",
|
|
53558
|
+
"DirectoryAdded",
|
|
53559
|
+
"FileChanged",
|
|
53560
|
+
"StopFailure",
|
|
53561
|
+
"InstructionsLoaded",
|
|
53562
|
+
"UserPromptExpansion",
|
|
53563
|
+
"Elicitation",
|
|
53564
|
+
"ElicitationResult"
|
|
53565
|
+
]);
|
|
53566
|
+
/** Fields every handler type accepts regardless of `type`. */ const sharedHandlerFields = {
|
|
53567
|
+
if: schemas_string().optional(),
|
|
53568
|
+
timeout: schemas_number().positive().optional(),
|
|
53569
|
+
statusMessage: schemas_string().optional(),
|
|
53570
|
+
once: schemas_boolean().optional()
|
|
53571
|
+
};
|
|
53572
|
+
/** Regex that allows standard env var names and rejects __proto__ (the prototype-polluting key). */ const ENV_KEY_PATTERN = /^(?!__proto__$)[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
53573
|
+
const ClaudeCommandHandlerSchema = schemas_object({
|
|
53574
|
+
...sharedHandlerFields,
|
|
53575
|
+
type: schemas_literal("command"),
|
|
53576
|
+
command: schemas_string().min(1, "Hook command must not be empty"),
|
|
53577
|
+
args: schemas_array(schemas_string()).optional(),
|
|
53578
|
+
shell: schemas_enum([
|
|
53579
|
+
"bash",
|
|
53580
|
+
"powershell"
|
|
53581
|
+
]).optional(),
|
|
53582
|
+
async: schemas_boolean().optional(),
|
|
53583
|
+
asyncRewake: schemas_boolean().optional()
|
|
53584
|
+
}).strict();
|
|
53585
|
+
const ClaudeHttpHandlerSchema = schemas_object({
|
|
53586
|
+
...sharedHandlerFields,
|
|
53587
|
+
type: schemas_literal("http"),
|
|
53588
|
+
url: schemas_string().min(1, "Hook url must not be empty"),
|
|
53589
|
+
headers: schemas_record(schemas_string(), schemas_string()).optional(),
|
|
53590
|
+
allowedEnvVars: schemas_array(schemas_string().regex(ENV_KEY_PATTERN, "Hook allowedEnvVars entry must be a valid identifier (no prototype-polluting keys)")).optional()
|
|
53591
|
+
}).strict();
|
|
53592
|
+
const ClaudeMcpToolHandlerSchema = schemas_object({
|
|
53593
|
+
...sharedHandlerFields,
|
|
53594
|
+
type: schemas_literal("mcp_tool"),
|
|
53595
|
+
server: schemas_string().min(1, "Hook server must not be empty"),
|
|
53596
|
+
tool: schemas_string().min(1, "Hook tool must not be empty"),
|
|
53597
|
+
input: schemas_record(schemas_string(), unknown()).optional()
|
|
53598
|
+
}).strict();
|
|
53599
|
+
const ClaudePromptHandlerSchema = schemas_object({
|
|
53600
|
+
...sharedHandlerFields,
|
|
53601
|
+
type: schemas_literal("prompt"),
|
|
53602
|
+
prompt: schemas_string().min(1, "Hook prompt must not be empty"),
|
|
53603
|
+
model: schemas_string().optional()
|
|
53604
|
+
}).strict();
|
|
53605
|
+
const ClaudeAgentHandlerSchema = schemas_object({
|
|
53606
|
+
...sharedHandlerFields,
|
|
53607
|
+
type: schemas_literal("agent"),
|
|
53608
|
+
prompt: schemas_string().min(1, "Hook prompt must not be empty"),
|
|
53609
|
+
model: schemas_string().optional()
|
|
53610
|
+
}).strict();
|
|
53611
|
+
/**
|
|
53612
|
+
* A single hook handler. Discriminated on `type` so that each handler is
|
|
53613
|
+
* validated against its own required fields — an `http` handler is not
|
|
53614
|
+
* expected to carry a `command`, and vice versa.
|
|
53615
|
+
*/ const ClaudeHookHandlerSchema = discriminatedUnion("type", [
|
|
53616
|
+
ClaudeCommandHandlerSchema,
|
|
53617
|
+
ClaudeHttpHandlerSchema,
|
|
53618
|
+
ClaudeMcpToolHandlerSchema,
|
|
53619
|
+
ClaudePromptHandlerSchema,
|
|
53620
|
+
ClaudeAgentHandlerSchema
|
|
53621
|
+
]);
|
|
53622
|
+
/**
|
|
53623
|
+
* A single entry within a hook event array.
|
|
53624
|
+
*
|
|
53625
|
+
* `matcher` is optional for every event: Claude Code treats an omitted
|
|
53626
|
+
* matcher as "match all", and many events accept no matcher at all.
|
|
53627
|
+
*/ const ClaudeHookEntrySchema = schemas_object({
|
|
53628
|
+
matcher: schemas_string().optional(),
|
|
53629
|
+
hooks: schemas_array(ClaudeHookHandlerSchema).min(1, "Hook entry must include at least one handler").max(MAX_HOOKS_PER_ENTRY)
|
|
53630
|
+
}).strict();
|
|
53631
|
+
const hookEventArray = schemas_array(ClaudeHookEntrySchema);
|
|
53632
|
+
/**
|
|
53633
|
+
* Every hook event Claude Code dispatches, each optional so that configs may
|
|
53634
|
+
* use any combination.
|
|
53635
|
+
*
|
|
53636
|
+
* Spelled out rather than generated from a list so the schema keeps precise
|
|
53637
|
+
* inferred types without a type assertion.
|
|
53638
|
+
*/ const claudeHookEventShape = {
|
|
53639
|
+
SessionStart: hookEventArray.optional(),
|
|
53640
|
+
Setup: hookEventArray.optional(),
|
|
53641
|
+
UserPromptSubmit: hookEventArray.optional(),
|
|
53642
|
+
UserPromptExpansion: hookEventArray.optional(),
|
|
53643
|
+
PreToolUse: hookEventArray.optional(),
|
|
53644
|
+
PermissionRequest: hookEventArray.optional(),
|
|
53645
|
+
PermissionDenied: hookEventArray.optional(),
|
|
53646
|
+
PostToolUse: hookEventArray.optional(),
|
|
53647
|
+
PostToolUseFailure: hookEventArray.optional(),
|
|
53648
|
+
PostToolBatch: hookEventArray.optional(),
|
|
53649
|
+
Notification: hookEventArray.optional(),
|
|
53650
|
+
MessageDisplay: hookEventArray.optional(),
|
|
53651
|
+
SubagentStart: hookEventArray.optional(),
|
|
53652
|
+
SubagentStop: hookEventArray.optional(),
|
|
53653
|
+
TaskCreated: hookEventArray.optional(),
|
|
53654
|
+
TaskCompleted: hookEventArray.optional(),
|
|
53655
|
+
Stop: hookEventArray.optional(),
|
|
53656
|
+
StopFailure: hookEventArray.optional(),
|
|
53657
|
+
TeammateIdle: hookEventArray.optional(),
|
|
53658
|
+
InstructionsLoaded: hookEventArray.optional(),
|
|
53659
|
+
ConfigChange: hookEventArray.optional(),
|
|
53660
|
+
CwdChanged: hookEventArray.optional(),
|
|
53661
|
+
DirectoryAdded: hookEventArray.optional(),
|
|
53662
|
+
FileChanged: hookEventArray.optional(),
|
|
53663
|
+
WorktreeCreate: hookEventArray.optional(),
|
|
53664
|
+
WorktreeRemove: hookEventArray.optional(),
|
|
53665
|
+
PreCompact: hookEventArray.optional(),
|
|
53666
|
+
PostCompact: hookEventArray.optional(),
|
|
53667
|
+
Elicitation: hookEventArray.optional(),
|
|
53668
|
+
ElicitationResult: hookEventArray.optional(),
|
|
53669
|
+
SessionEnd: hookEventArray.optional()
|
|
53670
|
+
};
|
|
53671
|
+
/**
|
|
53672
|
+
* Every known hook event name.
|
|
53673
|
+
*
|
|
53674
|
+
* Derived from the schema shape so the two can never drift apart, and used to
|
|
53675
|
+
* report the valid set when an unknown event name is encountered.
|
|
53676
|
+
*/ const CLAUDE_HOOK_EVENTS = Object.keys(claudeHookEventShape);
|
|
53677
|
+
/**
|
|
53678
|
+
* Zod schema for the hooks section of a Claude Code settings file.
|
|
53679
|
+
*
|
|
53680
|
+
* Every event is optional — configs may use any combination — but unknown
|
|
53681
|
+
* event names are rejected so that typos surface instead of silently
|
|
53682
|
+
* never firing.
|
|
53683
|
+
*/ const ClaudeHooksConfigSchema = schemas_object({
|
|
53684
|
+
hooks: schemas_object(claudeHookEventShape).strict()
|
|
53685
|
+
}).passthrough();
|
|
53686
|
+
|
|
53156
53687
|
;// CONCATENATED MODULE: ../core/src/entities/copilot-hook-schema.ts
|
|
53157
53688
|
/**
|
|
53158
53689
|
* Zod schemas for the GitHub Copilot hooks configuration format.
|
|
@@ -53164,7 +53695,7 @@ async function resolveConfigPathOrNull(targetDir, relativePath) {
|
|
|
53164
53695
|
* depend on @lousy-agents/core.
|
|
53165
53696
|
*/
|
|
53166
53697
|
const MAX_HOOKS_PER_EVENT = 100;
|
|
53167
|
-
/** Regex that allows standard env var names and rejects __proto__ (the prototype-polluting key). */ const
|
|
53698
|
+
/** Regex that allows standard env var names and rejects __proto__ (the prototype-polluting key). */ const copilot_hook_schema_ENV_KEY_PATTERN = /^(?!__proto__$)[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
53168
53699
|
/**
|
|
53169
53700
|
* Zod schema for a single GitHub Copilot hook command entry.
|
|
53170
53701
|
*/ const CopilotHookCommandSchema = schemas_object({
|
|
@@ -53173,7 +53704,7 @@ const MAX_HOOKS_PER_EVENT = 100;
|
|
|
53173
53704
|
powershell: schemas_string().min(1, "Hook PowerShell command must not be empty").optional(),
|
|
53174
53705
|
cwd: schemas_string().optional(),
|
|
53175
53706
|
timeoutSec: schemas_number().positive().optional(),
|
|
53176
|
-
env: schemas_record(schemas_string().regex(
|
|
53707
|
+
env: schemas_record(schemas_string().regex(copilot_hook_schema_ENV_KEY_PATTERN, "Hook env key must be a valid identifier (no prototype-polluting keys)"), schemas_string()).optional()
|
|
53177
53708
|
}).strict().refine((data)=>Boolean(data.bash) || Boolean(data.powershell), {
|
|
53178
53709
|
message: "At least one of 'bash' or 'powershell' must be provided and non-empty"
|
|
53179
53710
|
});
|
|
@@ -53193,33 +53724,78 @@ const hookArray = schemas_array(CopilotHookCommandSchema).max(MAX_HOOKS_PER_EVEN
|
|
|
53193
53724
|
}).strict();
|
|
53194
53725
|
|
|
53195
53726
|
;// CONCATENATED MODULE: ../core/src/use-cases/lint-hook-config.ts
|
|
53196
|
-
// biome-ignore-all lint/style/useNamingConvention: Claude Code API uses PascalCase hook event names (PreToolUse)
|
|
53197
53727
|
/**
|
|
53198
|
-
* Use case for linting
|
|
53728
|
+
* Use case for linting hook configurations.
|
|
53199
53729
|
* Validates GitHub Copilot and Claude Code hook config files.
|
|
53200
53730
|
*/
|
|
53201
53731
|
|
|
53202
53732
|
|
|
53203
53733
|
const INVALID_JSON_MESSAGE_PREFIX = "Invalid JSON in hook configuration file";
|
|
53734
|
+
/** Joins a Zod issue path into the dotted `field` shown on a diagnostic. */ function toFieldPath(path) {
|
|
53735
|
+
return path.length > 0 ? path.join(".") : undefined;
|
|
53736
|
+
}
|
|
53204
53737
|
/**
|
|
53205
|
-
*
|
|
53206
|
-
|
|
53207
|
-
|
|
53208
|
-
|
|
53209
|
-
|
|
53210
|
-
|
|
53211
|
-
*
|
|
53212
|
-
*/
|
|
53213
|
-
|
|
53214
|
-
|
|
53215
|
-
|
|
53738
|
+
* Expands a single Zod issue into diagnostics.
|
|
53739
|
+
*
|
|
53740
|
+
* `unrecognized_keys` issues carry every offending key on one issue whose path
|
|
53741
|
+
* points at the *containing* object, so they are expanded into one diagnostic
|
|
53742
|
+
* per key. A stray key directly under `hooks` is a misspelled event name —
|
|
53743
|
+
* the most valuable defect this linter can catch, since Claude Code silently
|
|
53744
|
+
* never fires such a hook.
|
|
53745
|
+
*/ function toClaudeDiagnostics(issue) {
|
|
53746
|
+
if (issue.code === "unrecognized_keys") {
|
|
53747
|
+
const isEventName = issue.path.length === 1 && issue.path[0] === "hooks";
|
|
53748
|
+
return issue.keys.map((key)=>({
|
|
53749
|
+
line: 1,
|
|
53750
|
+
severity: "error",
|
|
53751
|
+
message: isEventName ? `Unknown hook event '${key}'. A misspelled event never fires. Valid events: ${CLAUDE_HOOK_EVENTS.join(", ")}` : `Unrecognized key: "${key}"`,
|
|
53752
|
+
field: [
|
|
53753
|
+
...issue.path,
|
|
53754
|
+
key
|
|
53755
|
+
].join("."),
|
|
53756
|
+
ruleId: isEventName ? "hook/unknown-event" : "hook/invalid-config"
|
|
53757
|
+
}));
|
|
53758
|
+
}
|
|
53759
|
+
const lastPathSegment = issue.path.at(-1);
|
|
53760
|
+
const isMissingCommand = lastPathSegment === "command" && (issue.code === "too_small" || issue.code === "invalid_type");
|
|
53761
|
+
return [
|
|
53762
|
+
{
|
|
53763
|
+
line: 1,
|
|
53764
|
+
severity: "error",
|
|
53765
|
+
message: issue.message,
|
|
53766
|
+
field: toFieldPath([
|
|
53767
|
+
...issue.path
|
|
53768
|
+
]),
|
|
53769
|
+
ruleId: isMissingCommand ? "hook/missing-command" : "hook/invalid-config"
|
|
53770
|
+
}
|
|
53771
|
+
];
|
|
53772
|
+
}
|
|
53216
53773
|
/**
|
|
53217
|
-
*
|
|
53218
|
-
|
|
53219
|
-
|
|
53220
|
-
|
|
53221
|
-
|
|
53222
|
-
|
|
53774
|
+
* Warns when an entry omits `matcher` for an event that supports one.
|
|
53775
|
+
*
|
|
53776
|
+
* Events that accept no matcher (`Stop`, `UserPromptSubmit`, …) are skipped:
|
|
53777
|
+
* an omitted matcher there is the only valid spelling, not an oversight.
|
|
53778
|
+
*/ function collectMissingMatcherWarnings(hooks) {
|
|
53779
|
+
const diagnostics = [];
|
|
53780
|
+
for (const event of CLAUDE_HOOK_EVENTS){
|
|
53781
|
+
if (!MATCHER_SUPPORTING_EVENTS.has(event)) {
|
|
53782
|
+
continue;
|
|
53783
|
+
}
|
|
53784
|
+
const entries = hooks[event] ?? [];
|
|
53785
|
+
entries.forEach((entry, index)=>{
|
|
53786
|
+
if (entry.matcher === undefined) {
|
|
53787
|
+
diagnostics.push({
|
|
53788
|
+
line: 1,
|
|
53789
|
+
severity: "warning",
|
|
53790
|
+
message: `Recommended field 'matcher' is missing from ${event} hook entry. Without a matcher, the hook runs for every occurrence.`,
|
|
53791
|
+
field: `hooks.${event}[${index}].matcher`,
|
|
53792
|
+
ruleId: "hook/missing-matcher"
|
|
53793
|
+
});
|
|
53794
|
+
}
|
|
53795
|
+
});
|
|
53796
|
+
}
|
|
53797
|
+
return diagnostics;
|
|
53798
|
+
}
|
|
53223
53799
|
/**
|
|
53224
53800
|
* Use case for linting hook configuration files across a repository.
|
|
53225
53801
|
*/ class LintHookConfigUseCase {
|
|
@@ -53321,34 +53897,11 @@ const INVALID_JSON_MESSAGE_PREFIX = "Invalid JSON in hook configuration file";
|
|
|
53321
53897
|
return diagnostics;
|
|
53322
53898
|
}
|
|
53323
53899
|
validateClaudeConfig(parsed) {
|
|
53324
|
-
const diagnostics = [];
|
|
53325
53900
|
const result = ClaudeHooksConfigSchema.safeParse(parsed);
|
|
53326
53901
|
if (!result.success) {
|
|
53327
|
-
|
|
53328
|
-
const lastPathSegment = issue.path.length > 0 ? issue.path[issue.path.length - 1] : undefined;
|
|
53329
|
-
const isMissingCommand = lastPathSegment === "command" && (issue.code === "too_small" || issue.code === "invalid_type");
|
|
53330
|
-
diagnostics.push({
|
|
53331
|
-
line: 1,
|
|
53332
|
-
severity: "error",
|
|
53333
|
-
message: issue.message,
|
|
53334
|
-
field: issue.path.length > 0 ? issue.path.join(".") : undefined,
|
|
53335
|
-
ruleId: isMissingCommand ? "hook/missing-command" : "hook/invalid-config"
|
|
53336
|
-
});
|
|
53337
|
-
}
|
|
53338
|
-
return diagnostics;
|
|
53339
|
-
}
|
|
53340
|
-
for (const [index, entry] of result.data.hooks.PreToolUse.entries()){
|
|
53341
|
-
if (entry.matcher === undefined) {
|
|
53342
|
-
diagnostics.push({
|
|
53343
|
-
line: 1,
|
|
53344
|
-
severity: "warning",
|
|
53345
|
-
message: "Recommended field 'matcher' is missing from PreToolUse hook entry. Without a matcher, the hook runs for all tools.",
|
|
53346
|
-
field: `hooks.PreToolUse[${index}].matcher`,
|
|
53347
|
-
ruleId: "hook/missing-matcher"
|
|
53348
|
-
});
|
|
53349
|
-
}
|
|
53902
|
+
return result.error.issues.flatMap((issue)=>toClaudeDiagnostics(issue));
|
|
53350
53903
|
}
|
|
53351
|
-
return
|
|
53904
|
+
return collectMissingMatcherWarnings(result.data.hooks);
|
|
53352
53905
|
}
|
|
53353
53906
|
}
|
|
53354
53907
|
|
|
@@ -54874,7 +55427,7 @@ module.exports = __rspack_createRequire_require("events");
|
|
|
54874
55427
|
module.exports = __rspack_createRequire_require("fs");
|
|
54875
55428
|
|
|
54876
55429
|
},
|
|
54877
|
-
|
|
55430
|
+
6970(module) {
|
|
54878
55431
|
module.exports = __rspack_createRequire_require("node:assert");
|
|
54879
55432
|
|
|
54880
55433
|
},
|
|
@@ -55145,7 +55698,7 @@ function qstring(str) {
|
|
|
55145
55698
|
|
|
55146
55699
|
},
|
|
55147
55700
|
3273(module, __unused_rspack_exports, __webpack_require__) {
|
|
55148
|
-
(()=>{var e={"./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive"(e){function webpackEmptyAsyncContext(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive",e.exports=webpackEmptyAsyncContext},fs(e){"use strict";e.exports=__webpack_require__(9896)},"node:fs"(e){"use strict";e.exports=__webpack_require__(3024)},"node:module"(e){"use strict";e.exports=__webpack_require__(8995)},"node:path"(e){"use strict";e.exports=__webpack_require__(6760)},os(e){"use strict";e.exports=__webpack_require__(857)},path(e){"use strict";e.exports=__webpack_require__(6928)},"./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs"(e,t,i){"use strict";var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0}),a=i("node:path"),c=i("node:fs"),l=i("node:module"),y=i("./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs"),E=i("fs"),w=i("os"),C=i("path");function h(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}r(h,"slash");const S=r(e=>{const t=c[e];return(i,...n)=>{const a=`${e}:${n.join(":")}`;let l=null==i?void 0:i.get(a);return void 0===l&&(l=Reflect.apply(t,c,n),null==i||i.set(a,l)),l}},"cacheFs"),I=S("existsSync"),N=S("readFileSync"),O=S("statSync"),j=r((e,t,i)=>{for(;;){const n=a.posix.join(e,t);if(I(i,n))return n;const c=a.dirname(e);if(c===e)return;e=c}},"findUp"),F=/^\.{1,2}(\/.*)?$/,B=r(e=>{const t=h(e);return F.test(t)?t:`./${t}`},"normalizeRelativePath");function Ne(e,t=!1){const i=e.length;let n=0,a="",c=0,l=16,y=0,E=0,w=0,C=0,S=0;function _(t,i){let a=0,c=0;for(;a<t;){let t=e.charCodeAt(n);if(t>=48&&t<=57)c=16*c+t-48;else if(t>=65&&t<=70)c=16*c+t-65+10;else{if(!(t>=97&&t<=102))break;c=16*c+t-97+10}n++,a++}return a<t&&(c=-1),c}function b(e){n=e,a="",c=0,l=16,S=0}function p(){let t=n;if(48===e.charCodeAt(n))n++;else for(n++;n<e.length&&R(e.charCodeAt(n));)n++;if(n<e.length&&46===e.charCodeAt(n)){if(n++,!(n<e.length&&R(e.charCodeAt(n))))return S=3,e.substring(t,n);for(n++;n<e.length&&R(e.charCodeAt(n));)n++}let i=n;if(n<e.length&&(69===e.charCodeAt(n)||101===e.charCodeAt(n)))if(n++,(n<e.length&&43===e.charCodeAt(n)||45===e.charCodeAt(n))&&n++,n<e.length&&R(e.charCodeAt(n))){for(n++;n<e.length&&R(e.charCodeAt(n));)n++;i=n}else S=3;return e.substring(t,i)}function L(){let t="",a=n;for(;;){if(n>=i){t+=e.substring(a,n),S=2;break}const c=e.charCodeAt(n);if(34===c){t+=e.substring(a,n),n++;break}if(92!==c){if(c>=0&&c<=31){if(M(c)){t+=e.substring(a,n),S=2;break}S=6}n++}else{if(t+=e.substring(a,n),n++,n>=i){S=2;break}switch(e.charCodeAt(n++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:const e=_(4);e>=0?t+=String.fromCharCode(e):S=4;break;default:S=5}a=n}}return t}function A(){if(a="",S=0,c=n,E=y,C=w,n>=i)return c=i,l=17;let t=e.charCodeAt(n);if(ee(t)){do{n++,a+=String.fromCharCode(t),t=e.charCodeAt(n)}while(ee(t));return l=15}if(M(t))return n++,a+=String.fromCharCode(t),13===t&&10===e.charCodeAt(n)&&(n++,a+="\n"),y++,w=n,l=14;switch(t){case 123:return n++,l=1;case 125:return n++,l=2;case 91:return n++,l=3;case 93:return n++,l=4;case 58:return n++,l=6;case 44:return n++,l=5;case 34:return n++,a=L(),l=10;case 47:const E=n-1;if(47===e.charCodeAt(n+1)){for(n+=2;n<i&&!M(e.charCodeAt(n));)n++;return a=e.substring(E,n),l=12}if(42===e.charCodeAt(n+1)){n+=2;const t=i-1;let c=!1;for(;n<t;){const t=e.charCodeAt(n);if(42===t&&47===e.charCodeAt(n+1)){n+=2,c=!0;break}n++,M(t)&&(13===t&&10===e.charCodeAt(n)&&n++,y++,w=n)}return c||(n++,S=1),a=e.substring(E,n),l=13}return a+=String.fromCharCode(t),n++,l=16;case 45:if(a+=String.fromCharCode(t),n++,n===i||!R(e.charCodeAt(n)))return l=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return a+=p(),l=11;default:for(;n<i&&D(t);)n++,t=e.charCodeAt(n);if(c!==n){switch(a=e.substring(c,n),a){case"true":return l=8;case"false":return l=9;case"null":return l=7}return l=16}return a+=String.fromCharCode(t),n++,l=16}}function D(e){if(ee(e)||M(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function x(){let e;do{e=A()}while(e>=12&&e<=15);return e}return r(_,"scanHexDigits"),r(b,"setPosition"),r(p,"scanNumber"),r(L,"scanString"),r(A,"scanNext"),r(D,"isUnknownContentCharacter"),r(x,"scanNextNonTrivia"),{setPosition:b,getPosition:r(()=>n,"getPosition"),scan:t?x:A,getToken:r(()=>l,"getToken"),getTokenValue:r(()=>a,"getTokenValue"),getTokenOffset:r(()=>c,"getTokenOffset"),getTokenLength:r(()=>n-c,"getTokenLength"),getTokenStartLine:r(()=>E,"getTokenStartLine"),getTokenStartCharacter:r(()=>c-C,"getTokenStartCharacter"),getTokenError:r(()=>S,"getTokenError")}}function ee(e){return 32===e||9===e}function M(e){return 10===e||13===e}function R(e){return e>=48&&e<=57}var $,q;r(Ne,"createScanner"),r(ee,"isWhiteSpace"),r(M,"isLineBreak"),r(R,"isDigit"),(q=$||($={}))[q.lineFeed=10]="lineFeed",q[q.carriageReturn=13]="carriageReturn",q[q.space=32]="space",q[q._0=48]="_0",q[q._1=49]="_1",q[q._2=50]="_2",q[q._3=51]="_3",q[q._4=52]="_4",q[q._5=53]="_5",q[q._6=54]="_6",q[q._7=55]="_7",q[q._8=56]="_8",q[q._9=57]="_9",q[q.a=97]="a",q[q.b=98]="b",q[q.c=99]="c",q[q.d=100]="d",q[q.e=101]="e",q[q.f=102]="f",q[q.g=103]="g",q[q.h=104]="h",q[q.i=105]="i",q[q.j=106]="j",q[q.k=107]="k",q[q.l=108]="l",q[q.m=109]="m",q[q.n=110]="n",q[q.o=111]="o",q[q.p=112]="p",q[q.q=113]="q",q[q.r=114]="r",q[q.s=115]="s",q[q.t=116]="t",q[q.u=117]="u",q[q.v=118]="v",q[q.w=119]="w",q[q.x=120]="x",q[q.y=121]="y",q[q.z=122]="z",q[q.A=65]="A",q[q.B=66]="B",q[q.C=67]="C",q[q.D=68]="D",q[q.E=69]="E",q[q.F=70]="F",q[q.G=71]="G",q[q.H=72]="H",q[q.I=73]="I",q[q.J=74]="J",q[q.K=75]="K",q[q.L=76]="L",q[q.M=77]="M",q[q.N=78]="N",q[q.O=79]="O",q[q.P=80]="P",q[q.Q=81]="Q",q[q.R=82]="R",q[q.S=83]="S",q[q.T=84]="T",q[q.U=85]="U",q[q.V=86]="V",q[q.W=87]="W",q[q.X=88]="X",q[q.Y=89]="Y",q[q.Z=90]="Z",q[q.asterisk=42]="asterisk",q[q.backslash=92]="backslash",q[q.closeBrace=125]="closeBrace",q[q.closeBracket=93]="closeBracket",q[q.colon=58]="colon",q[q.comma=44]="comma",q[q.dot=46]="dot",q[q.doubleQuote=34]="doubleQuote",q[q.minus=45]="minus",q[q.openBrace=123]="openBrace",q[q.openBracket=91]="openBracket",q[q.plus=43]="plus",q[q.slash=47]="slash",q[q.formFeed=12]="formFeed",q[q.tab=9]="tab",new Array(20).fill(0).map((e,t)=>" ".repeat(t));const W=200;var K,H,Y;function Pe(e,t=[],i=K.DEFAULT){let n=null,a=[];const c=[];function o(e){Array.isArray(a)?a.push(e):null!==n&&(a[n]=e)}return r(o,"onValue"),We(e,{onObjectBegin:r(()=>{const e={};o(e),c.push(a),a=e,n=null},"onObjectBegin"),onObjectProperty:r(e=>{n=e},"onObjectProperty"),onObjectEnd:r(()=>{a=c.pop()},"onObjectEnd"),onArrayBegin:r(()=>{const e=[];o(e),c.push(a),a=e,n=null},"onArrayBegin"),onArrayEnd:r(()=>{a=c.pop()},"onArrayEnd"),onLiteralValue:o,onError:r((e,i,n)=>{t.push({error:e,offset:i,length:n})},"onError")},i),a[0]}function We(e,t,i=K.DEFAULT){const n=Ne(e,!1),a=[];let c=0;function o(e){return e?()=>0===c&&e(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function f(e){return e?t=>0===c&&e(t,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function u(e){return e?t=>0===c&&e(t,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>a.slice()):()=>!0}function g(e){return e?()=>{c>0?c++:!1===e(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>a.slice())&&(c=1)}:()=>!0}function m(e){return e?()=>{c>0&&c--,0===c&&e(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}r(o,"toNoArgVisit"),r(f,"toOneArgVisit"),r(u,"toOneArgVisitWithPath"),r(g,"toBeginVisit"),r(m,"toEndVisit");const l=g(t.onObjectBegin),y=u(t.onObjectProperty),E=m(t.onObjectEnd),w=g(t.onArrayBegin),C=m(t.onArrayEnd),S=u(t.onLiteralValue),I=f(t.onSeparator),N=o(t.onComment),O=f(t.onError),j=i&&i.disallowComments,F=i&&i.allowTrailingComma;function T(){for(;;){const e=n.scan();switch(n.getTokenError()){case 4:k(14);break;case 5:k(15);break;case 3:k(13);break;case 1:j||k(11);break;case 2:k(12);break;case 6:k(16)}switch(e){case 12:case 13:j?k(10):N();break;case 16:k(1);break;case 15:case 14:break;default:return e}}}function k(e,t=[],i=[]){if(O(e),t.length+i.length>0){let e=n.getToken();for(;17!==e;){if(-1!==t.indexOf(e)){T();break}if(-1!==i.indexOf(e))break;e=T()}}}function P(e){const t=n.getTokenValue();return e?S(t):(y(t),a.push(t)),T(),!0}function J(){switch(n.getToken()){case 11:const e=n.getTokenValue();let t=Number(e);isNaN(t)&&(k(2),t=0),S(t);break;case 7:S(null);break;case 8:S(!0);break;case 9:S(!1);break;default:return!1}return T(),!0}function V(){return 10!==n.getToken()?(k(3,[],[2,5]),!1):(P(!1),6===n.getToken()?(I(":"),T(),U()||k(4,[],[2,5])):k(5,[],[2,5]),a.pop(),!0)}function z(){l(),T();let e=!1;for(;2!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(e||k(4,[],[]),I(","),T(),2===n.getToken()&&F)break}else e&&k(6,[],[]);V()||k(4,[],[2,5]),e=!0}return E(),2!==n.getToken()?k(7,[2],[]):T(),!0}function G(){w(),T();let e=!0,t=!1;for(;4!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(t||k(4,[],[]),I(","),T(),4===n.getToken()&&F)break}else t&&k(6,[],[]);e?(a.push(0),e=!1):a[a.length-1]++,U()||k(4,[],[4,5]),t=!0}return C(),e||a.pop(),4!==n.getToken()?k(8,[4],[]):T(),!0}function U(){switch(n.getToken()){case 3:return G();case 1:return z();case 10:return P(!0);default:return J()}}return r(T,"scanNext"),r(k,"handleError"),r(P,"parseString"),r(J,"parseLiteral"),r(V,"parseProperty"),r(z,"parseObject"),r(G,"parseArray"),r(U,"parseValue"),T(),17===n.getToken()?!!i.allowEmptyContent||(k(4,[],[]),!1):U()?(17!==n.getToken()&&k(9,[],[]),!0):(k(4,[],[]),!1)}new Array(W).fill(0).map((e,t)=>"\n"+" ".repeat(t)),new Array(W).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(W).fill(0).map((e,t)=>"\r\n"+" ".repeat(t)),new Array(W).fill(0).map((e,t)=>"\n"+"\t".repeat(t)),new Array(W).fill(0).map((e,t)=>"\r"+"\t".repeat(t)),new Array(W).fill(0).map((e,t)=>"\r\n"+"\t".repeat(t)),function(e){e.DEFAULT={allowTrailingComma:!1}}(K||(K={})),r(Pe,"parse$1"),r(We,"visit"),function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(H||(H={})),function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"}(Y||(Y={}));const Q=Pe;var Z;!function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"}(Z||(Z={}));const X=r((e,t)=>Q(N(t,e,"utf8")),"readJsonc"),te=Symbol("implicitBaseUrl"),ie="${configDir}",se=r(()=>{const{findPnpApi:e}=l;return e&&e(process.cwd())},"getPnpApi"),re=r((e,t,i,n)=>{const c=`resolveFromPackageJsonPath:${e}:${t}:${i}`;if(null!=n&&n.has(c))return n.get(c);const l=X(e,n);if(!l)return;let E=t||"tsconfig.json";if(!i&&l.exports)try{const[e]=y.resolveExports(l.exports,t,["require","types"]);E=e}catch{return!1}else!t&&l.tsconfig&&(E=l.tsconfig);return E=a.join(e,"..",E),null==n||n.set(c,E),E},"resolveFromPackageJsonPath"),ne="package.json",ae="tsconfig.json",oe=r((e,t,i)=>{let n=e;if(".."===e&&(n=a.join(n,ae)),"."===e[0]&&(n=a.resolve(t,n)),a.isAbsolute(n)){if(I(i,n)){if(O(i,n).isFile())return n}else if(!n.endsWith(".json")){const e=`${n}.json`;if(I(i,e))return e}return}const[c,...l]=e.split("/"),y="@"===c[0]?`${c}/${l.shift()}`:c,E=l.join("/"),w=se();if(w){const{resolveRequest:n}=w;try{if(y===e){const e=n(a.join(y,ne),t);if(e){const t=re(e,E,!1,i);if(t&&I(i,t))return t}}else{let i;try{i=n(e,t,{extensions:[".json"]})}catch{i=n(a.join(e,ae),t)}if(i)return i}}catch{}}const C=j(a.resolve(t),a.join("node_modules",y),i);if(!C||!O(i,C).isDirectory())return;const S=a.join(C,ne);if(I(i,S)){const e=re(S,E,!1,i);if(!1===e)return;if(e&&I(i,e)&&O(i,e).isFile())return e}const N=a.join(C,E),F=N.endsWith(".json");if(!F){const e=`${N}.json`;if(I(i,e))return e}if(I(i,N))if(O(i,N).isDirectory()){const e=a.join(N,ne);if(I(i,e)){const t=re(e,"",!0,i);if(t&&I(i,t))return t}const t=a.join(N,ae);if(I(i,t))return t}else if(F)return N},"resolveExtendsPath"),ce=r((e,t)=>B(a.relative(e,t)),"pathRelative"),he=["files","include","exclude"],le=r((e,t,i)=>{const n=a.join(t,i);return h(a.relative(e,n))||"./"},"resolveAndRelativize"),pe=r((e,t,i)=>{const n=a.relative(e,t);if(!n)return i;return h(`${n}/${i.startsWith("./")?i.slice(2):i}`)},"prefixPattern"),ue=r((e,t,i,n)=>{const c=oe(e,t,n);if(!c)throw new Error(`File '${e}' not found.`);if(i.has(c))throw new Error(`Circularity detected while resolving configuration: ${c}`);i.add(c);const l=a.dirname(c),y=fe(c,n,i);delete y.references;const{compilerOptions:E}=y;if(E){const{baseUrl:e}=E;e&&!e.startsWith(ie)&&(E.baseUrl=le(t,l,e));const{outDir:i}=E;i&&!i.startsWith(ie)&&(E.outDir=le(t,l,i));const{declarationDir:n}=E;n&&!n.startsWith(ie)&&(E.declarationDir=le(t,l,n));const{rootDir:a}=E;a&&!a.startsWith(ie)&&(E.rootDir=le(t,l,a));const{rootDirs:c}=E;c&&(E.rootDirs=c.map(e=>e.startsWith(ie)?e:le(t,l,e)));const{typeRoots:y}=E;y&&(E.typeRoots=y.map(e=>e.startsWith(ie)?e:le(t,l,e)))}for(const e of he){const i=y[e];i&&(y[e]=i.map(e=>e.startsWith(ie)?e:pe(t,l,e)))}return y},"resolveExtends"),de=["outDir","declarationDir"],fe=r((e,t,i=new Set)=>{let n;try{n=X(e,t)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if("object"!=typeof n)throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const c=a.dirname(e);if(n.compilerOptions){const{compilerOptions:e}=n;e.paths&&!e.baseUrl&&(e[te]=c)}if(n.extends){const e=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const a of e.reverse()){const e=ue(a,c,new Set(i),t),l={...e,...n,compilerOptions:{...e.compilerOptions,...n.compilerOptions}};e.watchOptions&&(l.watchOptions={...e.watchOptions,...n.watchOptions}),n=l}}if(n.compilerOptions){const{compilerOptions:e}=n,t=["baseUrl","rootDir"];for(const i of t){const t=e[i];if(t&&!t.startsWith(ie)){const n=a.resolve(c,t),l=ce(c,n);e[i]=l}}for(const t of de){let i=e[t];i&&(Array.isArray(n.exclude)||(n.exclude=de.map(t=>e[t]).filter(Boolean)),i.startsWith(ie)||(i=B(i)),e[t]=i)}}else n.compilerOptions={};if(n.include&&(n.include=n.include.map(h)),n.files&&(n.files=n.files.map(e=>e.startsWith(ie)?e:B(e))),n.watchOptions){const{watchOptions:e}=n;e.excludeDirectories&&(e.excludeDirectories=e.excludeDirectories.map(e=>h(a.resolve(c,e)))),e.excludeFiles&&(e.excludeFiles=e.excludeFiles.map(e=>h(a.resolve(c,e)))),e.watchFile&&(e.watchFile=e.watchFile.toLowerCase()),e.watchDirectory&&(e.watchDirectory=e.watchDirectory.toLowerCase()),e.fallbackPolling&&(e.fallbackPolling=e.fallbackPolling.toLowerCase())}return n},"_parseTsconfig"),me=r((e,t)=>{if(e.startsWith(ie))return h(a.join(t,e.slice(12)))},"interpolateConfigDir"),ge=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],xe=r(e=>{if(e.strict){const t=["noImplicitAny","noImplicitThis","strictNullChecks","strictFunctionTypes","strictBindCallApply","strictPropertyInitialization","strictBuiltinIteratorReturn","alwaysStrict","useUnknownInCatchVariables"];for(const i of t)void 0===e[i]&&(e[i]=!0)}if(e.composite&&(null!=e.declaration||(e.declaration=!0),null!=e.incremental||(e.incremental=!0)),e.target){let t=e.target.toLowerCase();"es2015"===t&&(t="es6"),e.target=t,"esnext"===t&&(null!=e.module||(e.module="es6"),null!=e.useDefineForClassFields||(e.useDefineForClassFields=!0)),("es6"===t||"es2016"===t||"es2017"===t||"es2018"===t||"es2019"===t||"es2020"===t||"es2021"===t||"es2022"===t||"es2023"===t||"es2024"===t)&&(null!=e.module||(e.module="es6")),("es2022"===t||"es2023"===t||"es2024"===t)&&(null!=e.useDefineForClassFields||(e.useDefineForClassFields=!0))}if(e.module){let t=e.module.toLowerCase();if("es2015"===t&&(t="es6"),e.module=t,("es6"===t||"es2020"===t||"es2022"===t||"esnext"===t||"none"===t||"system"===t||"umd"===t||"amd"===t)&&(null!=e.moduleResolution||(e.moduleResolution="classic")),"system"===t&&(null!=e.allowSyntheticDefaultImports||(e.allowSyntheticDefaultImports=!0)),("node16"===t||"node18"===t||"node20"===t||"nodenext"===t||"preserve"===t)&&(null!=e.esModuleInterop||(e.esModuleInterop=!0),null!=e.allowSyntheticDefaultImports||(e.allowSyntheticDefaultImports=!0)),("node16"===t||"node18"===t||"node20"===t||"nodenext"===t)&&(null!=e.moduleDetection||(e.moduleDetection="force")),"node16"===t&&(null!=e.target||(e.target="es2022"),null!=e.moduleResolution||(e.moduleResolution="node16")),"node18"===t&&(null!=e.target||(e.target="es2022"),null!=e.moduleResolution||(e.moduleResolution="node16")),"node20"===t&&(null!=e.target||(e.target="es2023"),null!=e.moduleResolution||(e.moduleResolution="node16"),null!=e.resolveJsonModule||(e.resolveJsonModule=!0)),"nodenext"===t&&(null!=e.target||(e.target="esnext"),null!=e.moduleResolution||(e.moduleResolution="nodenext"),null!=e.resolveJsonModule||(e.resolveJsonModule=!0)),"node16"===t||"node18"===t||"node20"===t||"nodenext"===t){const t=e.target;("es3"===t||"es2022"===t||"es2023"===t||"es2024"===t||"esnext"===t)&&(null!=e.useDefineForClassFields||(e.useDefineForClassFields=!0))}"preserve"===t&&(null!=e.moduleResolution||(e.moduleResolution="bundler"))}if(e.moduleResolution){let t=e.moduleResolution.toLowerCase();"node"===t&&(t="node10"),e.moduleResolution=t,("node16"===t||"nodenext"===t||"bundler"===t)&&(null!=e.resolvePackageJsonExports||(e.resolvePackageJsonExports=!0),null!=e.resolvePackageJsonImports||(e.resolvePackageJsonImports=!0)),"bundler"===t&&(null!=e.allowSyntheticDefaultImports||(e.allowSyntheticDefaultImports=!0),null!=e.resolveJsonModule||(e.resolveJsonModule=!0))}e.jsx&&(e.jsx=e.jsx.toLowerCase()),e.moduleDetection&&(e.moduleDetection=e.moduleDetection.toLowerCase()),e.importsNotUsedAsValues&&(e.importsNotUsedAsValues=e.importsNotUsedAsValues.toLowerCase()),e.newLine&&(e.newLine=e.newLine.toLowerCase()),e.esModuleInterop&&(null!=e.allowSyntheticDefaultImports||(e.allowSyntheticDefaultImports=!0)),e.verbatimModuleSyntax&&(null!=e.isolatedModules||(e.isolatedModules=!0),null!=e.preserveConstEnums||(e.preserveConstEnums=!0)),e.isolatedModules&&(null!=e.preserveConstEnums||(e.preserveConstEnums=!0)),e.rewriteRelativeImportExtensions&&(null!=e.allowImportingTsExtensions||(e.allowImportingTsExtensions=!0)),e.lib&&(e.lib=e.lib.map(e=>e.toLowerCase())),e.checkJs&&(null!=e.allowJs||(e.allowJs=!0))},"normalizeCompilerOptions"),ve=r((e,t=new Map)=>{const i=a.resolve(e),n=fe(i,t),c=a.dirname(i),{compilerOptions:l}=n;if(l){for(const e of ge){const t=l[e];if(t){const i=me(t,c);l[e]=i?ce(c,i):t}}for(const e of["rootDirs","typeRoots"]){const t=l[e];t&&(l[e]=t.map(e=>{const t=me(e,c);return t?ce(c,t):B(e)}))}const{paths:e}=l;if(e)for(const t of Object.keys(e))e[t]=e[t].map(e=>{var t;return null!=(t=me(e,c))?t:e});xe(l)}for(const e of he){const t=n[e];t&&(n[e]=t.map(e=>{var t;return null!=(t=me(e,c))?t:e}))}return n},"parseTsconfig");var ye=Object.defineProperty,_e=r((e,t)=>ye(e,"name",{value:t,configurable:!0}),"s");const Ee=_e(e=>{let t="";for(let i=0;i<e.length;i+=1){const n=e[i],a=n.toUpperCase();t+=n===a?n.toLowerCase():a}return t},"invertCase"),be=new Map,ke=_e((e,t)=>{const i=C.join(e,`.is-fs-case-sensitive-test-${process.pid}`);try{return t.writeFileSync(i,""),!t.existsSync(Ee(i))}finally{try{t.unlinkSync(i)}catch{}}},"checkDirectoryCaseWithWrite"),we=_e((e,t,i)=>{try{return ke(e,i)}catch(e){if(void 0===t)return ke(w.tmpdir(),i);throw e}},"checkDirectoryCaseWithFallback"),Ce=_e((e,t=E,i=!0)=>{const n=null!=e?e:process.cwd();if(i&&be.has(n))return be.get(n);let a;const c=Ee(n);return a=c!==n&&t.existsSync(n)?!t.existsSync(c):we(n,e,t),i&&be.set(n,a),a},"isFsCaseSensitive"),{join:Se}=a.posix,Ie={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Te=r(e=>{const t=[...Ie.ts],i=[...Ie.cts],n=[...Ie.mts];return null!=e&&e.allowJs&&(t.push(".js",".jsx"),i.push(".cjs"),n.push(".mjs")),[...t,...i,...n]},"getSupportedExtensions"),Re=r(e=>{const t=[];if(!e)return t;const{outDir:i,declarationDir:n}=e;return i&&t.push(i),n&&t.push(n),t},"getDefaultExcludeSpec"),Ae=r(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),Le=`(?!(${["node_modules","bower_components","jspm_packages"].join("|")})(/|$))`,Oe=/(?:^|\/)[^.*?]+$/,De="**/*",Ve="[^/]",Ue="[^./]",Me="win32"===process.platform,je=r(({config:e,path:t},i=Ce())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!a.isAbsolute(t))throw new Error("The tsconfig path must be absolute");Me&&(t=h(t));const n=a.dirname(t),{files:c,include:l,exclude:y,compilerOptions:E}=e,w=r(e=>a.isAbsolute(e)?e:Se(n,e),"resolvePattern"),C=null==c?void 0:c.map(w),S=Te(E),I=i?"":"i",N=(y||Re(E)).map(e=>{const t=w(e),i=Ae(t).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${Ve}*`).replaceAll(String.raw`\?`,Ve);return new RegExp(`^${i}($|/)`,I)}),O=c||l?l:[De],j=O?O.map(e=>{let t=w(e);Oe.test(t)&&(t=Se(t,De));const i=Ae(t).replaceAll(String.raw`/\*\*`,`(/${Le}${Ue}${Ve}*)*?`).replaceAll(/(\/)?\\\*/g,(e,t)=>{const i=`(${Ue}|(\\.(?!min\\.js$))?)*`;return t?`/${Le}${Ue}${i}`:i}).replaceAll(/(\/)?\\\?/g,(e,t)=>t?`/${Le}${Ve}`:Ve);return new RegExp(`^${i}$`,I)}):void 0;return t=>{if(!a.isAbsolute(t))throw new Error("filePath must be absolute");return Me&&(t=h(t)),null!=C&&C.includes(t)||S.some(e=>t.endsWith(e))&&!N.some(e=>e.test(t))&&j&&j.some(e=>e.test(t))?e:void 0}},"createFilesMatcher"),Fe=r((e,t,i)=>{const n=a.resolve(e);let c=h(e);for(;;){const e=j(c,t,i);if(!e)return;const l=a.resolve(e),y=ve(l,i),E={path:h(l),config:y};if(je(E)(n))return E;const w=a.dirname(e),C=a.dirname(w);if(C===w)return;c=C}},"findConfigApplicable"),Be=r((e=process.cwd(),t="tsconfig.json",i=new Map,n=!1)=>{var a;return n?null==(a=Fe(e,t,i))?void 0:a.path:j(h(e),t,i)},"findTsconfig"),$e=r((e=process.cwd(),t="tsconfig.json",i=new Map,n=!1)=>{var a;if(!n){const n=Be(e,t,i);if(!n)return null;return{path:n,config:ve(n,i)}}return null!=(a=Fe(e,t,i))?a:null},"getTsconfig"),qe=/\*/g,Ge=r((e,t)=>{const i=e.match(qe);if(i&&i.length>1)throw new Error(t)},"assertStarCount"),Ke=r(e=>{if(e.includes("*")){const[t,i]=e.split("*");return{prefix:t,suffix:i}}return e},"parsePattern"),He=r(({prefix:e,suffix:t},i)=>i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),ze=r((e,t,i)=>Object.entries(e).map(([e,n])=>(Ge(e,`Pattern '${e}' can have at most one '*' character.`),{pattern:Ke(e),substitutions:n.map(n=>{if(Ge(n,`Substitution '${n}' in pattern '${e}' can have at most one '*' character.`),!t&&!F.test(n)&&!a.isAbsolute(n))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return a.resolve(i,n)})})),"parsePaths"),Je=r(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:i,paths:n}=t;if(!i&&!n)return null;const c=te in t&&t[te],l=a.resolve(a.dirname(e.path),i||c||"."),y=n?ze(n,i,l):[];return e=>{if(F.test(e))return[];const t=[];for(const i of y){if(i.pattern===e)return i.substitutions.map(h);"string"!=typeof i.pattern&&t.push(i)}let n,c=-1;for(const i of t)He(i.pattern,e)&&i.pattern.prefix.length>c&&(c=i.pattern.prefix.length,n=i);if(!n)return i?[h(a.join(l,e))]:[];const E=e.slice(n.pattern.prefix.length,e.length-n.pattern.suffix.length);return n.substitutions.map(e=>h(e.replace("*",E)))}},"createPathsMatcher");t.createPathsMatcher=Je,t.getTsconfig=$e},"./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const d=e=>null!==e&&"object"==typeof e,s=(e,t)=>Object.assign(new Error(`[${e}]: ${t}`),{code:e}),i="ERR_INVALID_PACKAGE_CONFIG",n="ERR_INVALID_PACKAGE_TARGET",a=/^\d+$/,c=/^(\.{1,2}|node_modules)$/i,l=/\/|\\/;var y,E=((y=E||{}).Export="exports",y.Import="imports",y);const f=(e,t,y,E,w)=>{if(null==t)return[];if("string"==typeof t){const[i,...a]=t.split(l);if(".."===i||a.some(e=>c.test(e)))throw s(n,`Invalid "${e}" target "${t}" defined in the package config`);return[w?t.replace(/\*/g,w):t]}if(Array.isArray(t))return t.flatMap(t=>f(e,t,y,E,w));if(d(t)){for(const n of Object.keys(t)){if(a.test(n))throw s(i,"Cannot contain numeric property keys");if("default"===n||E.includes(n))return f(e,t[n],y,E,w)}return[]}throw s(n,`Invalid "${e}" target "${t}"`)},w="*",v=(e,t)=>{const i=e.indexOf(w),n=t.indexOf(w);return i===n?t.length>e.length:n>i};function A(e,t){if(!t.includes(w)&&e.hasOwnProperty(t))return[t];let i,n;for(const a of Object.keys(e))if(a.includes(w)){const[e,c,l]=a.split(w);if(void 0===l&&t.startsWith(e)&&t.endsWith(c)){const l=t.slice(e.length,-c.length||void 0);l&&(!i||v(i,a))&&(i=a,n=l)}}return[i,n]}const C=/^\w+:/;t.resolveExports=(e,t,a)=>{if(!e)throw new Error('"exports" is required');t=""===t?".":`./${t}`,("string"==typeof e||Array.isArray(e)||d(e)&&(e=>Object.keys(e).reduce((e,t)=>{const n=""===t||"."!==t[0];if(void 0===e||e===n)return n;throw s(i,'"exports" cannot contain some keys starting with "." and some not')},void 0))(e))&&(e={".":e});const[c,l]=A(e,t),y=f(E.Export,e[c],t,a,l);if(0===y.length)throw s("ERR_PACKAGE_PATH_NOT_EXPORTED","."===t?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const e of y)if(!e.startsWith("./")&&!C.test(e))throw s(n,`Invalid "exports" target "${e}" defined in the package config`);return y},t.resolveImports=(e,t,i)=>{if(!e)throw new Error('"imports" is required');const[n,a]=A(e,t),c=f(E.Import,e[n],t,i,a);if(0===c.length)throw s("ERR_PACKAGE_IMPORT_NOT_DEFINED",`Package import specifier "${t}" is not defined in package`);return c}}},t={};function __nested_rspack_require_27261__(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,__nested_rspack_require_27261__),a.exports}__nested_rspack_require_27261__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __nested_rspack_require_27261__.d(t,{a:t}),t},__nested_rspack_require_27261__.d=(e,t)=>{for(var i in t)__nested_rspack_require_27261__.o(t,i)&&!__nested_rspack_require_27261__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__nested_rspack_require_27261__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};(()=>{"use strict";__nested_rspack_require_27261__.d(i,{default:()=>createJiti});const e=__webpack_require__(8161);var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],a="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",c={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},l="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",y={5:l,"5module":l+" export import",6:l+" const class extends export import super"},E=/^in(stanceof)?$/,w=new RegExp("["+a+"]"),C=new RegExp("["+a+"·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function isInAstralSet(e,t){for(var i=65536,n=0;n<t.length;n+=2){if((i+=t[n])>e)return!1;if((i+=t[n+1])>=e)return!0}return!1}function isIdentifierStart(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&w.test(String.fromCharCode(e)):!1!==t&&isInAstralSet(e,n)))}function isIdentifierChar(e,i){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&C.test(String.fromCharCode(e)):!1!==i&&(isInAstralSet(e,n)||isInAstralSet(e,t)))))}var acorn_TokenType=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function binop(e,t){return new acorn_TokenType(e,{beforeExpr:!0,binop:t})}var S={beforeExpr:!0},I={startsExpr:!0},N={};function kw(e,t){return void 0===t&&(t={}),t.keyword=e,N[e]=new acorn_TokenType(e,t)}var O={num:new acorn_TokenType("num",I),regexp:new acorn_TokenType("regexp",I),string:new acorn_TokenType("string",I),name:new acorn_TokenType("name",I),privateId:new acorn_TokenType("privateId",I),eof:new acorn_TokenType("eof"),bracketL:new acorn_TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new acorn_TokenType("]"),braceL:new acorn_TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new acorn_TokenType("}"),parenL:new acorn_TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new acorn_TokenType(")"),comma:new acorn_TokenType(",",S),semi:new acorn_TokenType(";",S),colon:new acorn_TokenType(":",S),dot:new acorn_TokenType("."),question:new acorn_TokenType("?",S),questionDot:new acorn_TokenType("?."),arrow:new acorn_TokenType("=>",S),template:new acorn_TokenType("template"),invalidTemplate:new acorn_TokenType("invalidTemplate"),ellipsis:new acorn_TokenType("...",S),backQuote:new acorn_TokenType("`",I),dollarBraceL:new acorn_TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new acorn_TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new acorn_TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new acorn_TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new acorn_TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new acorn_TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new acorn_TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",S),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",S),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",S),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",I),_if:kw("if"),_return:kw("return",S),_switch:kw("switch"),_throw:kw("throw",S),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",I),_super:kw("super",I),_class:kw("class",I),_extends:kw("extends",S),_export:kw("export"),_import:kw("import",I),_null:kw("null",I),_true:kw("true",I),_false:kw("false",I),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},j=/\r\n?|\n|\u2028|\u2029/,F=new RegExp(j.source,"g");function isNewLine(e){return 10===e||13===e||8232===e||8233===e}function nextLineBreak(e,t,i){void 0===i&&(i=e.length);for(var n=t;n<i;n++){var a=e.charCodeAt(n);if(isNewLine(a))return n<i-1&&13===a&&10===e.charCodeAt(n+1)?n+2:n+1}return-1}var B=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,$=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,q=Object.prototype,W=q.hasOwnProperty,K=q.toString,H=Object.hasOwn||function(e,t){return W.call(e,t)},Y=Array.isArray||function(e){return"[object Array]"===K.call(e)},Q=Object.create(null);function wordsRegexp(e){return Q[e]||(Q[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var Z=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,acorn_Position=function(e,t){this.line=e,this.column=t};acorn_Position.prototype.offset=function(e){return new acorn_Position(this.line,this.column+e)};var acorn_SourceLocation=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function getLineInfo(e,t){for(var i=1,n=0;;){var a=nextLineBreak(e,n,t);if(a<0)return new acorn_Position(i,t-n);++i,n=a}}var X={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},te=!1;function getOptions(e){var t={};for(var i in X)t[i]=e&&H(e,i)?e[i]:X[i];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!te&&"object"==typeof console&&console.warn&&(te=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),Y(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}if(Y(t.onComment)&&(t.onComment=function(e,t){return function(i,n,a,c,l,y){var E={type:i?"Block":"Line",value:n,start:a,end:c};e.locations&&(E.loc=new acorn_SourceLocation(this,l,y)),e.ranges&&(E.range=[a,c]),t.push(E)}}(t,t.onComment)),"commonjs"===t.sourceType&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}var ie=256,se=259;function functionFlags(e,t){return 2|(e?4:0)|(t?8:0)}var acorn_Parser=function(e,t,i){this.options=e=getOptions(e),this.sourceFile=e.sourceFile,this.keywords=wordsRegexp(y[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var n="";!0!==e.allowReserved&&(n=c[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(n+=" await")),this.reservedWords=wordsRegexp(n);var a=(n?n+" ":"")+c.strict;this.reservedWordsStrict=wordsRegexp(a),this.reservedWordsStrictBind=wordsRegexp(a+" "+c.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(j).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=O.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope("commonjs"===this.options.sourceType?2:1),this.regexpState=null,this.privateNameStack=[]},re={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};acorn_Parser.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},re.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},re.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},re.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},re.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},re.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},re.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},re.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},re.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},re.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},re.allowUsing.get=function(){var e=this.currentScope().flags;return!(1024&e)&&!(!this.inModule&&1&e)},re.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ie)>0},acorn_Parser.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n<e.length;n++)i=e[n](i);return i},acorn_Parser.parse=function(e,t){return new this(t,e).parse()},acorn_Parser.parseExpressionAt=function(e,t,i){var n=new this(i,e,t);return n.nextToken(),n.parseExpression()},acorn_Parser.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(acorn_Parser.prototype,re);var ne=acorn_Parser.prototype,ae=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;ne.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){$.lastIndex=e,e+=$.exec(this.input)[0].length;var t=ae.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){$.lastIndex=e+t[0].length;var i=$.exec(this.input),n=i.index+i[0].length,a=this.input.charAt(n);return";"===a||"}"===a||j.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(a)||"!"===a&&"="===this.input.charAt(n+1))}e+=t[0].length,$.lastIndex=e,e+=$.exec(this.input)[0].length,";"===this.input[e]&&e++}},ne.eat=function(e){return this.type===e&&(this.next(),!0)},ne.isContextual=function(e){return this.type===O.name&&this.value===e&&!this.containsEsc},ne.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},ne.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},ne.canInsertSemicolon=function(){return this.type===O.eof||this.type===O.braceR||j.test(this.input.slice(this.lastTokEnd,this.start))},ne.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ne.semicolon=function(){this.eat(O.semi)||this.insertSemicolon()||this.unexpected()},ne.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},ne.expect=function(e){this.eat(e)||this.unexpected()},ne.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var acorn_DestructuringErrors=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ne.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},ne.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},ne.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},ne.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var oe=acorn_Parser.prototype;oe.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==O.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var n=0,a=Object.keys(this.undefinedExports);n<a.length;n+=1){var c=a[n];this.raiseRecoverable(this.undefinedExports[c].start,"Export '"+c+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType="commonjs"===this.options.sourceType?"script":this.options.sourceType,this.finishNode(e,"Program")};var ce={kind:"loop"},he={kind:"switch"};oe.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;$.lastIndex=this.pos;var t=$.exec(this.input),i=this.pos+t[0].length,n=this.fullCharCodeAt(i);if(91===n||92===n)return!0;if(e)return!1;if(123===n)return!0;if(isIdentifierStart(n)){var a=i;do{i+=n<=65535?1:2}while(isIdentifierChar(n=this.fullCharCodeAt(i)));if(92===n)return!0;var c=this.input.slice(a,i);if(!E.test(c))return!0}return!1},oe.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;$.lastIndex=this.pos;var e,t=$.exec(this.input),i=this.pos+t[0].length;return!(j.test(this.input.slice(this.pos,i))||"function"!==this.input.slice(i,i+8)||i+8!==this.input.length&&(isIdentifierChar(e=this.fullCharCodeAt(i+8))||92===e))},oe.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;$.lastIndex=this.pos;var i=$.exec(this.input),n=this.pos+i[0].length;if(j.test(this.input.slice(this.pos,n)))return!1;if(e){var a,c=n+5;if("using"!==this.input.slice(n,c)||c===this.input.length||isIdentifierChar(a=this.fullCharCodeAt(c))||92===a)return!1;$.lastIndex=c;var l=$.exec(this.input);if(n=c+l[0].length,l&&j.test(this.input.slice(c,n)))return!1}var y=this.fullCharCodeAt(n);if(!isIdentifierStart(y)&&92!==y)return!1;var w=n;do{n+=y<=65535?1:2}while(isIdentifierChar(y=this.fullCharCodeAt(n)));if(92===y)return!0;var C=this.input.slice(w,n);return!(E.test(C)||t&&"of"===C)},oe.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},oe.isUsing=function(e){return this.isUsingKeyword(!1,e)},oe.parseStatement=function(e,t,i){var n,a=this.type,c=this.startNode();switch(this.isLet(e)&&(a=O._var,n="let"),a){case O._break:case O._continue:return this.parseBreakContinueStatement(c,a.keyword);case O._debugger:return this.parseDebuggerStatement(c);case O._do:return this.parseDoStatement(c);case O._for:return this.parseForStatement(c);case O._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(c,!1,!e);case O._class:return e&&this.unexpected(),this.parseClass(c,!0);case O._if:return this.parseIfStatement(c);case O._return:return this.parseReturnStatement(c);case O._switch:return this.parseSwitchStatement(c);case O._throw:return this.parseThrowStatement(c);case O._try:return this.parseTryStatement(c);case O._const:case O._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(c,n);case O._while:return this.parseWhileStatement(c);case O._with:return this.parseWithStatement(c);case O.braceL:return this.parseBlock(!0,c);case O.semi:return this.parseEmptyStatement(c);case O._export:case O._import:if(this.options.ecmaVersion>10&&a===O._import){$.lastIndex=this.pos;var l=$.exec(this.input),y=this.pos+l[0].length,E=this.input.charCodeAt(y);if(40===E||46===E)return this.parseExpressionStatement(c,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),a===O._import?this.parseImport(c):this.parseExport(c,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(c,!0,!e);var w=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(w)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),"await using"===w&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(c,!1,w),this.semicolon(),this.finishNode(c,"VariableDeclaration");var C=this.value,S=this.parseExpression();return a===O.name&&"Identifier"===S.type&&this.eat(O.colon)?this.parseLabeledStatement(c,C,S,e):this.parseExpressionStatement(c,S)}},oe.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(O.semi)||this.insertSemicolon()?e.label=null:this.type!==O.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var a=this.labels[n];if(null==e.label||a.name===e.label.name){if(null!=a.kind&&(i||"loop"===a.kind))break;if(e.label&&i)break}}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},oe.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},oe.parseDoStatement=function(e){return this.next(),this.labels.push(ce),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(O._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(O.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},oe.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ce),this.enterScope(0),this.expect(O.parenL),this.type===O.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===O._var||this.type===O._const||i){var n=this.startNode(),a=i?"let":this.value;return this.next(),this.parseVar(n,!0,a),this.finishNode(n,"VariableDeclaration"),this.parseForAfterInit(e,n,t)}var c=this.isContextual("let"),l=!1,y=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(y){var E=this.startNode();return this.next(),"await using"===y&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(E,!0,y),this.finishNode(E,"VariableDeclaration"),this.parseForAfterInit(e,E,t)}var w=this.containsEsc,C=new acorn_DestructuringErrors,S=this.start,I=t>-1?this.parseExprSubscripts(C,"await"):this.parseExpression(!0,C);return this.type===O._in||(l=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===O._in&&this.unexpected(t),e.await=!0):l&&this.options.ecmaVersion>=8&&(I.start!==S||w||"Identifier"!==I.type||"async"!==I.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),c&&l&&this.raise(I.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(I,!1,C),this.checkLValPattern(I),this.parseForIn(e,I)):(this.checkExpressionErrors(C,!0),t>-1&&this.unexpected(t),this.parseFor(e,I))},oe.parseForAfterInit=function(e,t,i){return(this.type===O._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===O._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))},oe.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,pe|(i?0:ue),!1,t)},oe.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(O._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},oe.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(O.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},oe.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(O.braceL),this.labels.push(he),this.enterScope(1024);for(var i=!1;this.type!==O.braceR;)if(this.type===O._case||this.type===O._default){var n=this.type===O._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(O.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},oe.parseThrowStatement=function(e){return this.next(),j.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var le=[];oe.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(O.parenR),e},oe.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===O._catch){var t=this.startNode();this.next(),this.eat(O.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(O._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},oe.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},oe.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(ce),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},oe.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},oe.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},oe.parseLabeledStatement=function(e,t,i,n){for(var a=0,c=this.labels;a<c.length;a+=1){c[a].name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var l=this.type.isLoop?"loop":this.type===O._switch?"switch":null,y=this.labels.length-1;y>=0;y--){var E=this.labels[y];if(E.statementStart!==e.start)break;E.statementStart=this.start,E.kind=l}return this.labels.push({name:t,kind:l,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},oe.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},oe.parseBlock=function(e,t,i){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(O.braceL),e&&this.enterScope(0);this.type!==O.braceR;){var n=this.parseStatement(null);t.body.push(n)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},oe.parseFor=function(e,t){return e.init=t,this.expect(O.semi),e.test=this.type===O.semi?null:this.parseExpression(),this.expect(O.semi),e.update=this.type===O.parenR?null:this.parseExpression(),this.expect(O.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},oe.parseForIn=function(e,t){var i=this.type===O._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(O.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},oe.parseVar=function(e,t,i,n){for(e.declarations=[],e.kind=i;;){var a=this.startNode();if(this.parseVarId(a,i),this.eat(O.eq)?a.init=this.parseMaybeAssign(t):n||"const"!==i||this.type===O._in||this.options.ecmaVersion>=6&&this.isContextual("of")?n||"using"!==i&&"await using"!==i||!(this.options.ecmaVersion>=17)||this.type===O._in||this.isContextual("of")?n||"Identifier"===a.id.type||t&&(this.type===O._in||this.isContextual("of"))?a.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(O.comma))break}return e},oe.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var pe=1,ue=2;function isPrivateNameConflicted(e,t){var i=t.key.name,n=e[i],a="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(a=(t.static?"s":"i")+t.kind),"iget"===n&&"iset"===a||"iset"===n&&"iget"===a||"sget"===n&&"sset"===a||"sset"===n&&"sget"===a?(e[i]="true",!1):!!n||(e[i]=a,!1)}function checkKeyName(e,t){var i=e.computed,n=e.key;return!i&&("Identifier"===n.type&&n.name===t||"Literal"===n.type&&n.value===t)}oe.parseFunction=function(e,t,i,n,a){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===O.star&&t&ue&&this.unexpected(),e.generator=this.eat(O.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&pe&&(e.id=4&t&&this.type!==O.name?null:this.parseIdent(),!e.id||t&ue||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var c=this.yieldPos,l=this.awaitPos,y=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(e.async,e.generator)),t&pe||(e.id=this.type===O.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,a),this.yieldPos=c,this.awaitPos=l,this.awaitIdentPos=y,this.finishNode(e,t&pe?"FunctionDeclaration":"FunctionExpression")},oe.parseFunctionParams=function(e){this.expect(O.parenL),e.params=this.parseBindingList(O.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},oe.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),a=this.startNode(),c=!1;for(a.body=[],this.expect(O.braceL);this.type!==O.braceR;){var l=this.parseClassElement(null!==e.superClass);l&&(a.body.push(l),"MethodDefinition"===l.type&&"constructor"===l.kind?(c&&this.raiseRecoverable(l.start,"Duplicate constructor in the same class"),c=!0):l.key&&"PrivateIdentifier"===l.key.type&&isPrivateNameConflicted(n,l)&&this.raiseRecoverable(l.key.start,"Identifier '#"+l.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(a,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},oe.parseClassElement=function(e){if(this.eat(O.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),n="",a=!1,c=!1,l="method",y=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(O.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===O.star?y=!0:n="static"}if(i.static=y,!n&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==O.star||this.canInsertSemicolon()?n="async":c=!0),!n&&(t>=9||!c)&&this.eat(O.star)&&(a=!0),!n&&!c&&!a){var E=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?l=E:n=E)}if(n?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=n,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===O.parenL||"method"!==l||a||c){var w=!i.static&&checkKeyName(i,"constructor"),C=w&&e;w&&"method"!==l&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=w?"constructor":l,this.parseClassMethod(i,a,c,C)}else this.parseClassField(i);return i},oe.isClassElementNameStart=function(){return this.type===O.name||this.type===O.privateId||this.type===O.num||this.type===O.string||this.type===O.bracketL||this.type.keyword},oe.parseClassElementName=function(e){this.type===O.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},oe.parseClassMethod=function(e,t,i,n){var a=e.key;"constructor"===e.kind?(t&&this.raise(a.start,"Constructor can't be a generator"),i&&this.raise(a.start,"Constructor can't be an async method")):e.static&&checkKeyName(e,"prototype")&&this.raise(a.start,"Classes may not have a static property named prototype");var c=e.value=this.parseMethod(t,i,n);return"get"===e.kind&&0!==c.params.length&&this.raiseRecoverable(c.start,"getter should have no params"),"set"===e.kind&&1!==c.params.length&&this.raiseRecoverable(c.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===c.params[0].type&&this.raiseRecoverable(c.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},oe.parseClassField=function(e){return checkKeyName(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&checkKeyName(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(O.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},oe.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==O.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},oe.parseClassId=function(e,t){this.type===O.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},oe.parseClassSuper=function(e){e.superClass=this.eat(O._extends)?this.parseExprSubscripts(null,!1):null},oe.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},oe.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,a=0===n?null:this.privateNameStack[n-1],c=0;c<i.length;++c){var l=i[c];H(t,l.name)||(a?a.used.push(l):this.raiseRecoverable(l.start,"Private field '#"+l.name+"' must be declared in an enclosing class"))}},oe.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==O.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},oe.parseExport=function(e,t){if(this.next(),this.eat(O.star))return this.parseExportAllDeclaration(e,t);if(this.eat(O._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==O.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,n=e.specifiers;i<n.length;i+=1){var a=n[i];this.checkUnreserved(a.local),this.checkLocalExport(a.local),"Literal"===a.local.type&&this.raise(a.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},oe.parseExportDeclaration=function(e){return this.parseStatement(null)},oe.parseExportDefaultDeclaration=function(){var e;if(this.type===O._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|pe,!1,e)}if(this.type===O._class){var i=this.startNode();return this.parseClass(i,"nullableID")}var n=this.parseMaybeAssign();return this.semicolon(),n},oe.checkExport=function(e,t,i){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),H(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},oe.checkPatternExport=function(e,t){var i=t.type;if("Identifier"===i)this.checkExport(e,t,t.start);else if("ObjectPattern"===i)for(var n=0,a=t.properties;n<a.length;n+=1){var c=a[n];this.checkPatternExport(e,c)}else if("ArrayPattern"===i)for(var l=0,y=t.elements;l<y.length;l+=1){var E=y[l];E&&this.checkPatternExport(e,E)}else"Property"===i?this.checkPatternExport(e,t.value):"AssignmentPattern"===i?this.checkPatternExport(e,t.left):"RestElement"===i&&this.checkPatternExport(e,t.argument)},oe.checkVariableExport=function(e,t){if(e)for(var i=0,n=t;i<n.length;i+=1){var a=n[i];this.checkPatternExport(e,a.id)}},oe.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},oe.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},oe.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(O.braceL);!this.eat(O.braceR);){if(i)i=!1;else if(this.expect(O.comma),this.afterTrailingComma(O.braceR))break;t.push(this.parseExportSpecifier(e))}return t},oe.parseImport=function(e){return this.next(),this.type===O.string?(e.specifiers=le,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===O.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},oe.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},oe.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},oe.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},oe.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===O.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(O.comma)))return e;if(this.type===O.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(O.braceL);!this.eat(O.braceR);){if(t)t=!1;else if(this.expect(O.comma),this.afterTrailingComma(O.braceR))break;e.push(this.parseImportSpecifier())}return e},oe.parseWithClause=function(){var e=[];if(!this.eat(O._with))return e;this.expect(O.braceL);for(var t={},i=!0;!this.eat(O.braceR);){if(i)i=!1;else if(this.expect(O.comma),this.afterTrailingComma(O.braceR))break;var n=this.parseImportAttribute(),a="Identifier"===n.key.type?n.key.name:n.key.value;H(t,a)&&this.raiseRecoverable(n.key.start,"Duplicate attribute key '"+a+"'"),t[a]=!0,e.push(n)}return e},oe.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===O.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(O.colon),this.type!==O.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},oe.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===O.string){var e=this.parseLiteral(this.value);return Z.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},oe.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},oe.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var de=acorn_Parser.prototype;de.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,a=e.properties;n<a.length;n+=1){var c=a[n];this.toAssignable(c,t),"RestElement"!==c.type||"ArrayPattern"!==c.argument.type&&"ObjectPattern"!==c.argument.type||this.raise(c.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},de.toAssignableList=function(e,t){for(var i=e.length,n=0;n<i;n++){var a=e[n];a&&this.toAssignable(a,t)}if(i){var c=e[i-1];6===this.options.ecmaVersion&&t&&c&&"RestElement"===c.type&&"Identifier"!==c.argument.type&&this.unexpected(c.argument.start)}return e},de.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},de.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==O.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},de.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case O.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(O.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case O.braceL:return this.parseObj(!0)}return this.parseIdent()},de.parseBindingList=function(e,t,i,n){for(var a=[],c=!0;!this.eat(e);)if(c?c=!1:this.expect(O.comma),t&&this.type===O.comma)a.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===O.ellipsis){var l=this.parseRestBinding();this.parseBindingListItem(l),a.push(l),this.type===O.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}a.push(this.parseAssignableListItem(n))}return a},de.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},de.parseBindingListItem=function(e){return e},de.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(O.eq))return i;var n=this.startNodeAt(e,t);return n.left=i,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},de.checkLValSimple=function(e,t,i){void 0===t&&(t=0);var n=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(n?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(H(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":n&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return n&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(n?"Binding":"Assigning to")+" rvalue")}},de.checkLValPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var n=0,a=e.properties;n<a.length;n+=1){var c=a[n];this.checkLValInnerPattern(c,t,i)}break;case"ArrayPattern":for(var l=0,y=e.elements;l<y.length;l+=1){var E=y[l];E&&this.checkLValInnerPattern(E,t,i)}break;default:this.checkLValSimple(e,t,i)}},de.checkLValInnerPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var acorn_TokContext=function(e,t,i,n,a){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!a},fe={b_stat:new acorn_TokContext("{",!1),b_expr:new acorn_TokContext("{",!0),b_tmpl:new acorn_TokContext("${",!1),p_stat:new acorn_TokContext("(",!1),p_expr:new acorn_TokContext("(",!0),q_tmpl:new acorn_TokContext("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new acorn_TokContext("function",!1),f_expr:new acorn_TokContext("function",!0),f_expr_gen:new acorn_TokContext("function",!0,!1,null,!0),f_gen:new acorn_TokContext("function",!1,!1,null,!0)},me=acorn_Parser.prototype;me.initialContext=function(){return[fe.b_stat]},me.curContext=function(){return this.context[this.context.length-1]},me.braceIsBlock=function(e){var t=this.curContext();return t===fe.f_expr||t===fe.f_stat||(e!==O.colon||t!==fe.b_stat&&t!==fe.b_expr?e===O._return||e===O.name&&this.exprAllowed?j.test(this.input.slice(this.lastTokEnd,this.start)):e===O._else||e===O.semi||e===O.eof||e===O.parenR||e===O.arrow||(e===O.braceL?t===fe.b_stat:e!==O._var&&e!==O._const&&e!==O.name&&!this.exprAllowed):!t.isExpr)},me.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},me.updateContext=function(e){var t,i=this.type;i.keyword&&e===O.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},me.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},O.parenR.updateContext=O.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===fe.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},O.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?fe.b_stat:fe.b_expr),this.exprAllowed=!0},O.dollarBraceL.updateContext=function(){this.context.push(fe.b_tmpl),this.exprAllowed=!0},O.parenL.updateContext=function(e){var t=e===O._if||e===O._for||e===O._with||e===O._while;this.context.push(t?fe.p_stat:fe.p_expr),this.exprAllowed=!0},O.incDec.updateContext=function(){},O._function.updateContext=O._class.updateContext=function(e){!e.beforeExpr||e===O._else||e===O.semi&&this.curContext()!==fe.p_stat||e===O._return&&j.test(this.input.slice(this.lastTokEnd,this.start))||(e===O.colon||e===O.braceL)&&this.curContext()===fe.b_stat?this.context.push(fe.f_stat):this.context.push(fe.f_expr),this.exprAllowed=!1},O.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},O.backQuote.updateContext=function(){this.curContext()===fe.q_tmpl?this.context.pop():this.context.push(fe.q_tmpl),this.exprAllowed=!1},O.star.updateContext=function(e){if(e===O._function){var t=this.context.length-1;this.context[t]===fe.f_expr?this.context[t]=fe.f_expr_gen:this.context[t]=fe.f_gen}this.exprAllowed=!0},O.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==O.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ge=acorn_Parser.prototype;function isLocalVariableAccess(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&isLocalVariableAccess(e.expression)}function isPrivateFieldAccess(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&isPrivateFieldAccess(e.expression)||"ParenthesizedExpression"===e.type&&isPrivateFieldAccess(e.expression)}ge.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,a=e.key;switch(a.type){case"Identifier":n=a.name;break;case"Literal":n=String(a.value);break;default:return}var c=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===c&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=a.start):this.raiseRecoverable(a.start,"Redefinition of __proto__ property")),t.proto=!0);else{var l=t[n="$"+n];if(l)("init"===c?this.strict&&l.init||l.get||l.set:l.init||l[c])&&this.raiseRecoverable(a.start,"Redefinition of property");else l=t[n]={init:!1,get:!1,set:!1};l[c]=!0}}},ge.parseExpression=function(e,t){var i=this.start,n=this.startLoc,a=this.parseMaybeAssign(e,t);if(this.type===O.comma){var c=this.startNodeAt(i,n);for(c.expressions=[a];this.eat(O.comma);)c.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(c,"SequenceExpression")}return a},ge.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,a=-1,c=-1,l=-1;t?(a=t.parenthesizedAssign,c=t.trailingComma,l=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new acorn_DestructuringErrors,n=!0);var y=this.start,E=this.startLoc;this.type!==O.parenL&&this.type!==O.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var w=this.parseMaybeConditional(e,t);if(i&&(w=i.call(this,w,y,E)),this.type.isAssign){var C=this.startNodeAt(y,E);return C.operator=this.value,this.type===O.eq&&(w=this.toAssignable(w,!1,t)),n||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=w.start&&(t.shorthandAssign=-1),this.type===O.eq?this.checkLValPattern(w):this.checkLValSimple(w),C.left=w,this.next(),C.right=this.parseMaybeAssign(e),l>-1&&(t.doubleProto=l),this.finishNode(C,"AssignmentExpression")}return n&&this.checkExpressionErrors(t,!0),a>-1&&(t.parenthesizedAssign=a),c>-1&&(t.trailingComma=c),w},ge.parseMaybeConditional=function(e,t){var i=this.start,n=this.startLoc,a=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return a;if(this.eat(O.question)){var c=this.startNodeAt(i,n);return c.test=a,c.consequent=this.parseMaybeAssign(),this.expect(O.colon),c.alternate=this.parseMaybeAssign(e),this.finishNode(c,"ConditionalExpression")}return a},ge.parseExprOps=function(e,t){var i=this.start,n=this.startLoc,a=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||a.start===i&&"ArrowFunctionExpression"===a.type?a:this.parseExprOp(a,i,n,-1,e)},ge.parseExprOp=function(e,t,i,n,a){var c=this.type.binop;if(null!=c&&(!a||this.type!==O._in)&&c>n){var l=this.type===O.logicalOR||this.type===O.logicalAND,y=this.type===O.coalesce;y&&(c=O.logicalAND.binop);var E=this.value;this.next();var w=this.start,C=this.startLoc,S=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,a),w,C,c,a),I=this.buildBinary(t,i,e,S,E,l||y);return(l&&this.type===O.coalesce||y&&(this.type===O.logicalOR||this.type===O.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(I,t,i,n,a)}return e},ge.buildBinary=function(e,t,i,n,a,c){"PrivateIdentifier"===n.type&&this.raise(n.start,"Private identifier can only be left side of binary expression");var l=this.startNodeAt(e,t);return l.left=i,l.operator=a,l.right=n,this.finishNode(l,c?"LogicalExpression":"BinaryExpression")},ge.parseMaybeUnary=function(e,t,i,n){var a,c=this.start,l=this.startLoc;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(n),t=!0;else if(this.type.prefix){var y=this.startNode(),E=this.type===O.incDec;y.operator=this.value,y.prefix=!0,this.next(),y.argument=this.parseMaybeUnary(null,!0,E,n),this.checkExpressionErrors(e,!0),E?this.checkLValSimple(y.argument):this.strict&&"delete"===y.operator&&isLocalVariableAccess(y.argument)?this.raiseRecoverable(y.start,"Deleting local variable in strict mode"):"delete"===y.operator&&isPrivateFieldAccess(y.argument)?this.raiseRecoverable(y.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(y,E?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==O.privateId){if(a=this.parseExprSubscripts(e,n),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var w=this.startNodeAt(c,l);w.operator=this.value,w.prefix=!1,w.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(w,"UpdateExpression")}}else(n||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==O._in&&this.unexpected();return i||!this.eat(O.starstar)?a:t?void this.unexpected(this.lastTokStart):this.buildBinary(c,l,a,this.parseMaybeUnary(null,!1,!1,n),"**",!1)},ge.parseExprSubscripts=function(e,t){var i=this.start,n=this.startLoc,a=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===a.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return a;var c=this.parseSubscripts(a,i,n,!1,t);return e&&"MemberExpression"===c.type&&(e.parenthesizedAssign>=c.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=c.start&&(e.parenthesizedBind=-1),e.trailingComma>=c.start&&(e.trailingComma=-1)),c},ge.parseSubscripts=function(e,t,i,n,a){for(var c=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,l=!1;;){var y=this.parseSubscript(e,t,i,n,c,l,a);if(y.optional&&(l=!0),y===e||"ArrowFunctionExpression"===y.type){if(l){var E=this.startNodeAt(t,i);E.expression=y,y=this.finishNode(E,"ChainExpression")}return y}e=y}},ge.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(O.arrow)},ge.parseSubscriptAsyncArrow=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,n)},ge.parseSubscript=function(e,t,i,n,a,c,l){var y=this.options.ecmaVersion>=11,E=y&&this.eat(O.questionDot);n&&E&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var w=this.eat(O.bracketL);if(w||E&&this.type!==O.parenL&&this.type!==O.backQuote||this.eat(O.dot)){var C=this.startNodeAt(t,i);C.object=e,w?(C.property=this.parseExpression(),this.expect(O.bracketR)):this.type===O.privateId&&"Super"!==e.type?C.property=this.parsePrivateIdent():C.property=this.parseIdent("never"!==this.options.allowReserved),C.computed=!!w,y&&(C.optional=E),e=this.finishNode(C,"MemberExpression")}else if(!n&&this.eat(O.parenL)){var S=new acorn_DestructuringErrors,I=this.yieldPos,N=this.awaitPos,j=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var F=this.parseExprList(O.parenR,this.options.ecmaVersion>=8,!1,S);if(a&&!E&&this.shouldParseAsyncArrow())return this.checkPatternErrors(S,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=I,this.awaitPos=N,this.awaitIdentPos=j,this.parseSubscriptAsyncArrow(t,i,F,l);this.checkExpressionErrors(S,!0),this.yieldPos=I||this.yieldPos,this.awaitPos=N||this.awaitPos,this.awaitIdentPos=j||this.awaitIdentPos;var B=this.startNodeAt(t,i);B.callee=e,B.arguments=F,y&&(B.optional=E),e=this.finishNode(B,"CallExpression")}else if(this.type===O.backQuote){(E||c)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var $=this.startNodeAt(t,i);$.tag=e,$.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode($,"TaggedTemplateExpression")}return e},ge.parseExprAtom=function(e,t,i){this.type===O.slash&&this.readRegexp();var n,a=this.potentialArrowAt===this.start;switch(this.type){case O._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),n=this.startNode(),this.next(),this.type!==O.parenL||this.allowDirectSuper||this.raise(n.start,"super() call outside constructor of a subclass"),this.type!==O.dot&&this.type!==O.bracketL&&this.type!==O.parenL&&this.unexpected(),this.finishNode(n,"Super");case O._this:return n=this.startNode(),this.next(),this.finishNode(n,"ThisExpression");case O.name:var c=this.start,l=this.startLoc,y=this.containsEsc,E=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!y&&"async"===E.name&&!this.canInsertSemicolon()&&this.eat(O._function))return this.overrideContext(fe.f_expr),this.parseFunction(this.startNodeAt(c,l),0,!1,!0,t);if(a&&!this.canInsertSemicolon()){if(this.eat(O.arrow))return this.parseArrowExpression(this.startNodeAt(c,l),[E],!1,t);if(this.options.ecmaVersion>=8&&"async"===E.name&&this.type===O.name&&!y&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return E=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(O.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(c,l),[E],!0,t)}return E;case O.regexp:var w=this.value;return(n=this.parseLiteral(w.value)).regex={pattern:w.pattern,flags:w.flags},n;case O.num:case O.string:return this.parseLiteral(this.value);case O._null:case O._true:case O._false:return(n=this.startNode()).value=this.type===O._null?null:this.type===O._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case O.parenL:var C=this.start,S=this.parseParenAndDistinguishExpression(a,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(S)&&(e.parenthesizedAssign=C),e.parenthesizedBind<0&&(e.parenthesizedBind=C)),S;case O.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(O.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case O.braceL:return this.overrideContext(fe.b_expr),this.parseObj(!1,e);case O._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case O._class:return this.parseClass(this.startNode(),!1);case O._new:return this.parseNew();case O.backQuote:return this.parseTemplate();case O._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},ge.parseExprAtomDefault=function(){this.unexpected()},ge.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===O.parenL&&!e)return this.parseDynamicImport(t);if(this.type===O.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}this.unexpected()},ge.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(O.parenR)?e.options=null:(this.expect(O.comma),this.afterTrailingComma(O.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(O.parenR)||(this.expect(O.comma),this.afterTrailingComma(O.parenR)||this.unexpected())));else if(!this.eat(O.parenR)){var t=this.start;this.eat(O.comma)&&this.eat(O.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},ge.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ge.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},ge.parseParenExpression=function(){this.expect(O.parenL);var e=this.parseExpression();return this.expect(O.parenR),e},ge.shouldParseArrow=function(e){return!this.canInsertSemicolon()},ge.parseParenAndDistinguishExpression=function(e,t){var i,n=this.start,a=this.startLoc,c=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var l,y=this.start,E=this.startLoc,w=[],C=!0,S=!1,I=new acorn_DestructuringErrors,N=this.yieldPos,j=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==O.parenR;){if(C?C=!1:this.expect(O.comma),c&&this.afterTrailingComma(O.parenR,!0)){S=!0;break}if(this.type===O.ellipsis){l=this.start,w.push(this.parseParenItem(this.parseRestBinding())),this.type===O.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}w.push(this.parseMaybeAssign(!1,I,this.parseParenItem))}var F=this.lastTokEnd,B=this.lastTokEndLoc;if(this.expect(O.parenR),e&&this.shouldParseArrow(w)&&this.eat(O.arrow))return this.checkPatternErrors(I,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=N,this.awaitPos=j,this.parseParenArrowList(n,a,w,t);w.length&&!S||this.unexpected(this.lastTokStart),l&&this.unexpected(l),this.checkExpressionErrors(I,!0),this.yieldPos=N||this.yieldPos,this.awaitPos=j||this.awaitPos,w.length>1?((i=this.startNodeAt(y,E)).expressions=w,this.finishNodeAt(i,"SequenceExpression",F,B)):i=w[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var $=this.startNodeAt(n,a);return $.expression=i,this.finishNode($,"ParenthesizedExpression")}return i},ge.parseParenItem=function(e){return e},ge.parseParenArrowList=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,n)};var xe=[];ge.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===O.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,a=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,a,!0,!1),this.eat(O.parenL)?e.arguments=this.parseExprList(O.parenR,this.options.ecmaVersion>=8,!1):e.arguments=xe,this.finishNode(e,"NewExpression")},ge.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===O.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===O.backQuote,this.finishNode(i,"TemplateElement")},ge.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(i.quasis=[n];!n.tail;)this.type===O.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(O.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(O.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},ge.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===O.name||this.type===O.num||this.type===O.string||this.type===O.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===O.star)&&!j.test(this.input.slice(this.lastTokEnd,this.start))},ge.parseObj=function(e,t){var i=this.startNode(),n=!0,a={};for(i.properties=[],this.next();!this.eat(O.braceR);){if(n)n=!1;else if(this.expect(O.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(O.braceR))break;var c=this.parseProperty(e,t);e||this.checkPropClash(c,a,t),i.properties.push(c)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},ge.parseProperty=function(e,t){var i,n,a,c,l=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(O.ellipsis))return e?(l.argument=this.parseIdent(!1),this.type===O.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(l,"RestElement")):(l.argument=this.parseMaybeAssign(!1,t),this.type===O.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(l,"SpreadElement"));this.options.ecmaVersion>=6&&(l.method=!1,l.shorthand=!1,(e||t)&&(a=this.start,c=this.startLoc),e||(i=this.eat(O.star)));var y=this.containsEsc;return this.parsePropertyName(l),!e&&!y&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(l)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(O.star),this.parsePropertyName(l)):n=!1,this.parsePropertyValue(l,e,i,n,a,c,t,y),this.finishNode(l,"Property")},ge.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var i="get"===e.kind?0:1;if(e.value.params.length!==i){var n=e.value.start;"get"===e.kind?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},ge.parsePropertyValue=function(e,t,i,n,a,c,l,y){(i||n)&&this.type===O.colon&&this.unexpected(),this.eat(O.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,l),e.kind="init"):this.options.ecmaVersion>=6&&this.type===O.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,n),e.kind="init"):t||y||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===O.comma||this.type===O.braceR||this.type===O.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=a),t?e.value=this.parseMaybeDefault(a,c,this.copyNode(e.key)):this.type===O.eq&&l?(l.shorthandAssign<0&&(l.shorthandAssign=this.start),e.value=this.parseMaybeDefault(a,c,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((i||n)&&this.unexpected(),this.parseGetterSetter(e))},ge.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(O.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(O.bracketR),e.key;e.computed=!1}return e.key=this.type===O.num||this.type===O.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ge.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ge.parseMethod=function(e,t,i){var n=this.startNode(),a=this.yieldPos,c=this.awaitPos,l=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|functionFlags(t,n.generator)|(i?128:0)),this.expect(O.parenL),n.params=this.parseBindingList(O.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=a,this.awaitPos=c,this.awaitIdentPos=l,this.finishNode(n,"FunctionExpression")},ge.parseArrowExpression=function(e,t,i,n){var a=this.yieldPos,c=this.awaitPos,l=this.awaitIdentPos;return this.enterScope(16|functionFlags(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=a,this.awaitPos=c,this.awaitIdentPos=l,this.finishNode(e,"ArrowFunctionExpression")},ge.parseFunctionBody=function(e,t,i,n){var a=t&&this.type!==O.braceL,c=this.strict,l=!1;if(a)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var y=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);c&&!y||(l=this.strictDirective(this.end))&&y&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var E=this.labels;this.labels=[],l&&(this.strict=!0),this.checkParams(e,!c&&!l&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,l&&!c),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=E}this.exitScope()},ge.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){if("Identifier"!==i[t].type)return!1}return!0},ge.checkParams=function(e,t){for(var i=Object.create(null),n=0,a=e.params;n<a.length;n+=1){var c=a[n];this.checkLValInnerPattern(c,1,t?null:i)}},ge.parseExprList=function(e,t,i,n){for(var a=[],c=!0;!this.eat(e);){if(c)c=!1;else if(this.expect(O.comma),t&&this.afterTrailingComma(e))break;var l=void 0;i&&this.type===O.comma?l=null:this.type===O.ellipsis?(l=this.parseSpread(n),n&&this.type===O.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):l=this.parseMaybeAssign(!1,n),a.push(l)}return a},ge.checkUnreserved=function(e){var t=e.start,i=e.end,n=e.name;(this.inGenerator&&"yield"===n&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===n&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().flags&se||"arguments"!==n||this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==n&&"await"!==n||this.raise(t,"Cannot use "+n+" in class static initialization block"),this.keywords.test(n)&&this.raise(t,"Unexpected keyword '"+n+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,i).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(n)&&(this.inAsync||"await"!==n||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+n+"' is reserved"))},ge.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},ge.parseIdentNode=function(){var e=this.startNode();return this.type===O.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=O.name):this.unexpected(),e},ge.parsePrivateIdent=function(){var e=this.startNode();return this.type===O.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},ge.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===O.semi||this.canInsertSemicolon()||this.type!==O.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(O.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},ge.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var ve=acorn_Parser.prototype;ve.raise=function(e,t){var i=getLineInfo(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var n=new SyntaxError(t);throw n.pos=e,n.loc=i,n.raisedAt=this.pos,n},ve.raiseRecoverable=ve.raise,ve.curPosition=function(){if(this.options.locations)return new acorn_Position(this.curLine,this.pos-this.lineStart)};var ye=acorn_Parser.prototype,acorn_Scope=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};ye.enterScope=function(e){this.scopeStack.push(new acorn_Scope(e))},ye.exitScope=function(){this.scopeStack.pop()},ye.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},ye.declareName=function(e,t,i){var n=!1;if(2===t){var a=this.currentScope();n=a.lexical.indexOf(e)>-1||a.functions.indexOf(e)>-1||a.var.indexOf(e)>-1,a.lexical.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var c=this.currentScope();n=this.treatFunctionsAsVar?c.lexical.indexOf(e)>-1:c.lexical.indexOf(e)>-1||c.var.indexOf(e)>-1,c.functions.push(e)}else for(var l=this.scopeStack.length-1;l>=0;--l){var y=this.scopeStack[l];if(y.lexical.indexOf(e)>-1&&!(32&y.flags&&y.lexical[0]===e)||!this.treatFunctionsAsVarInScope(y)&&y.functions.indexOf(e)>-1){n=!0;break}if(y.var.push(e),this.inModule&&1&y.flags&&delete this.undefinedExports[e],y.flags&se)break}n&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},ye.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},ye.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ye.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},ye.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var acorn_Node=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new acorn_SourceLocation(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},_e=acorn_Parser.prototype;function finishNodeAt(e,t,i,n){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=i),e}_e.startNode=function(){return new acorn_Node(this,this.start,this.startLoc)},_e.startNodeAt=function(e,t){return new acorn_Node(this,e,t)},_e.finishNode=function(e,t){return finishNodeAt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},_e.finishNodeAt=function(e,t,i,n){return finishNodeAt.call(this,e,t,i,n)},_e.copyNode=function(e){var t=new acorn_Node(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Ee="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",be=Ee+" Extended_Pictographic",ke=be+" EBase EComp EMod EPres ExtPict",we={9:Ee,10:be,11:be,12:ke,13:ke,14:ke},Ce={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Se="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ie="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Te=Ie+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Re=Te+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ae=Re+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Le=Ae+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Oe={9:Ie,10:Te,11:Re,12:Ae,13:Le,14:Le+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},De={};function buildUnicodeData(e){var t=De[e]={binary:wordsRegexp(we[e]+" "+Se),binaryOfStrings:wordsRegexp(Ce[e]),nonBinary:{General_Category:wordsRegexp(Se),Script:wordsRegexp(Oe[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Ve=0,Ue=[9,10,11,12,13,14];Ve<Ue.length;Ve+=1){buildUnicodeData(Ue[Ve])}var Me=acorn_Parser.prototype,acorn_BranchID=function(e,t){this.parent=e,this.base=t||this};acorn_BranchID.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var i=e;i;i=i.parent)if(t.base===i.base&&t!==i)return!0;return!1},acorn_BranchID.prototype.sibling=function(){return new acorn_BranchID(this.parent,this.base)};var acorn_RegExpValidationState=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=De[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function isRegularExpressionModifier(e){return 105===e||109===e||115===e}function isSyntaxCharacter(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function isControlLetter(e){return e>=65&&e<=90||e>=97&&e<=122}acorn_RegExpValidationState.prototype.reset=function(e,t,i){var n=-1!==i.indexOf("v"),a=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)},acorn_RegExpValidationState.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},acorn_RegExpValidationState.prototype.at=function(e,t){void 0===t&&(t=!1);var i=this.source,n=i.length;if(e>=n)return-1;var a=i.charCodeAt(e);if(!t&&!this.switchU||a<=55295||a>=57344||e+1>=n)return a;var c=i.charCodeAt(e+1);return c>=56320&&c<=57343?(a<<10)+c-56613888:a},acorn_RegExpValidationState.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var i=this.source,n=i.length;if(e>=n)return n;var a,c=i.charCodeAt(e);return!t&&!this.switchU||c<=55295||c>=57344||e+1>=n||(a=i.charCodeAt(e+1))<56320||a>57343?e+1:e+2},acorn_RegExpValidationState.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},acorn_RegExpValidationState.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},acorn_RegExpValidationState.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},acorn_RegExpValidationState.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},acorn_RegExpValidationState.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var i=this.pos,n=0,a=e;n<a.length;n+=1){var c=a[n],l=this.at(i,t);if(-1===l||l!==c)return!1;i=this.nextIndex(i,t)}return this.pos=i,!0},Me.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=!1,a=!1,c=0;c<i.length;c++){var l=i.charAt(c);-1===t.indexOf(l)&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(l,c+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===l&&(n=!0),"v"===l&&(a=!0)}this.options.ecmaVersion>=15&&n&&a&&this.raise(e.start,"Invalid regular expression flag")},Me.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Me.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var n=i[t];e.groupNames[n]||e.raise("Invalid named capture referenced")}},Me.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new acorn_BranchID(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Me.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Me.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},Me.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},Me.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Me.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Me.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var n=0,a=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(a=e.lastIntValue),e.eat(125)))return-1!==a&&a<n&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},Me.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Me.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Me.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),n=e.eat(45);if(i||n){for(var a=0;a<i.length;a++){var c=i.charAt(a);i.indexOf(c,a+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(n){var l=this.regexp_eatModifiers(e);i||l||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var y=0;y<l.length;y++){var E=l.charAt(y);(l.indexOf(E,y+1)>-1||i.indexOf(E)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},Me.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Me.regexp_eatModifiers=function(e){for(var t="",i=0;-1!==(i=e.current())&&isRegularExpressionModifier(i);)t+=codePointToString(i),e.advance();return t},Me.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Me.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Me.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!isSyntaxCharacter(t)&&(e.lastIntValue=t,e.advance(),!0)},Me.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!isSyntaxCharacter(i);)e.advance();return e.pos!==t},Me.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},Me.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var n=0,a=i;n<a.length;n+=1){a[n].separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Me.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Me.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=codePointToString(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=codePointToString(e.lastIntValue);return!0}return!1},Me.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,n=e.current(i);return e.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(n=e.lastIntValue),function(e){return isIdentifierStart(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Me.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,n=e.current(i);return e.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(n=e.lastIntValue),function(e){return isIdentifierChar(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Me.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Me.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},Me.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Me.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Me.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Me.regexp_eatZero=function(e){return 48===e.current()&&!isDecimalDigit(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Me.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Me.regexp_eatControlLetter=function(e){var t=e.current();return!!isControlLetter(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Me.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var i,n=e.pos,a=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var c=e.lastIntValue;if(a&&c>=55296&&c<=56319){var l=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var y=e.lastIntValue;if(y>=56320&&y<=57343)return e.lastIntValue=1024*(c-55296)+(y-56320)+65536,!0}e.pos=l,e.lastIntValue=c}return!0}if(a&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((i=e.lastIntValue)>=0&&i<=1114111))return!0;a&&e.raise("Invalid unicode escape"),e.pos=n}return!1},Me.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Me.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function isUnicodePropertyNameCharacter(e){return isControlLetter(e)||95===e}function isUnicodePropertyValueCharacter(e){return isUnicodePropertyNameCharacter(e)||isDecimalDigit(e)}function isDecimalDigit(e){return e>=48&&e<=57}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hexToInt(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function isOctalDigit(e){return e>=48&&e<=55}Me.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=80===t)||112===t)){var n;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&2===n&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return 0},Me.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,n),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var a=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,a)}return 0},Me.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){H(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},Me.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},Me.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyNameCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return""!==e.lastStringValue},Me.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyValueCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return""!==e.lastStringValue},Me.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Me.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===i&&e.raise("Negated character class may contain strings"),!0}return!1},Me.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},Me.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},Me.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||isOctalDigit(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},Me.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Me.regexp_classSetExpression=function(e){var t,i=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(i=2);for(var n=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(i=1):e.raise("Invalid character in character class");if(n!==e.pos)return i;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return i}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return i;2===t&&(i=2)}},Me.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return-1!==i&&-1!==n&&i>n&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Me.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Me.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return i&&2===n&&e.raise("Negated character class may contain strings"),n;e.pos=t}if(e.eat(92)){var a=this.regexp_eatCharacterClassEscape(e);if(a)return a;e.pos=t}return null},Me.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null},Me.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},Me.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},Me.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var i=e.current();return!(i<0||i===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(i))&&(!function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(i)&&(e.advance(),e.lastIntValue=i,!0))},Me.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},Me.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!isDecimalDigit(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},Me.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Me.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;isDecimalDigit(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},Me.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;isHexDigit(i=e.current());)e.lastIntValue=16*e.lastIntValue+hexToInt(i),e.advance();return e.pos!==t},Me.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},Me.regexp_eatOctalDigit=function(e){var t=e.current();return isOctalDigit(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Me.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n<t;++n){var a=e.current();if(!isHexDigit(a))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+hexToInt(a),e.advance()}return!0};var acorn_Token=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new acorn_SourceLocation(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},je=acorn_Parser.prototype;function stringToBigInt(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}je.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new acorn_Token(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},je.getToken=function(){return this.next(),new acorn_Token(this)},"undefined"!=typeof Symbol&&(je[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===O.eof,value:t}}}}),je.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(O.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},je.readToken=function(e){return isIdentifierStart(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},je.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888},je.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},je.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var n=void 0,a=t;(n=nextLineBreak(this.input,a,this.pos))>-1;)++this.curLine,a=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},je.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!isNewLine(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},je.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&B.test(String.fromCharCode(e))))break e;++this.pos}}},je.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},je.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(O.ellipsis)):(++this.pos,this.finishToken(O.dot))},je.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(O.assign,2):this.finishOp(O.slash,1)},je.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?O.star:O.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=O.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(O.assign,i+1):this.finishOp(n,i)},je.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(O.assign,3);return this.finishOp(124===e?O.logicalOR:O.logicalAND,2)}return 61===t?this.finishOp(O.assign,2):this.finishOp(124===e?O.bitwiseOR:O.bitwiseAND,1)},je.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(O.assign,2):this.finishOp(O.bitwiseXOR,1)},je.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!j.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(O.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(O.assign,2):this.finishOp(O.plusMin,1)},je.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(O.assign,i+1):this.finishOp(O.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(O.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},je.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(O.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(O.arrow)):this.finishOp(61===e?O.eq:O.prefix,1)},je.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(O.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(O.assign,3);return this.finishOp(O.coalesce,2)}}return this.finishOp(O.question,1)},je.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,isIdentifierStart(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(O.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")},je.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(O.parenL);case 41:return++this.pos,this.finishToken(O.parenR);case 59:return++this.pos,this.finishToken(O.semi);case 44:return++this.pos,this.finishToken(O.comma);case 91:return++this.pos,this.finishToken(O.bracketL);case 93:return++this.pos,this.finishToken(O.bracketR);case 123:return++this.pos,this.finishToken(O.braceL);case 125:return++this.pos,this.finishToken(O.braceR);case 58:return++this.pos,this.finishToken(O.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(O.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(O.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")},je.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},je.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(j.test(n)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var a=this.input.slice(i,this.pos);++this.pos;var c=this.pos,l=this.readWord1();this.containsEsc&&this.unexpected(c);var y=this.regexpState||(this.regexpState=new acorn_RegExpValidationState(this));y.reset(i,a,l),this.validateRegExpFlags(y),this.validateRegExpPattern(y);var E=null;try{E=new RegExp(a,l)}catch(e){}return this.finishToken(O.regexp,{pattern:a,flags:l,value:E})},je.readInt=function(e,t,i){for(var n=this.options.ecmaVersion>=12&&void 0===t,a=i&&48===this.input.charCodeAt(this.pos),c=this.pos,l=0,y=0,E=0,w=null==t?1/0:t;E<w;++E,++this.pos){var C=this.input.charCodeAt(this.pos),S=void 0;if(n&&95===C)a&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===y&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===E&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),y=C;else{if((S=C>=97?C-97+10:C>=65?C-65+10:C>=48&&C<=57?C-48:1/0)>=e)break;y=C,l=l*e+S}}return n&&95===y&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===c||null!=t&&this.pos-c!==t?null:l},je.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=stringToBigInt(this.input.slice(t,this.pos)),++this.pos):isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(O.num,i)},je.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===n){var a=stringToBigInt(this.input.slice(t,this.pos));return++this.pos,isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(O.num,a)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),46!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var c,l=(c=this.input.slice(t,this.pos),i?parseInt(c,8):parseFloat(c.replace(/_/g,"")));return this.finishToken(O.num,l)},je.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},je.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):8232===n||8233===n?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(isNewLine(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(O.string,t)};var Fe={};je.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Fe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},je.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Fe;this.raise(e,t)},je.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==O.template&&this.type!==O.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(O.template,e)):36===i?(this.pos+=2,this.finishToken(O.dollarBraceL)):(++this.pos,this.finishToken(O.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(isNewLine(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},je.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(O.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},je.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],a=parseInt(n,8);return a>255&&(n=n.slice(0,-1),a=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(a)}return isNewLine(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},je.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},je.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos<this.input.length;){var a=this.fullCharCodeAtPos();if(isIdentifierChar(a,n))this.pos+=a<=65535?1:2;else{if(92!==a)break;this.containsEsc=!0,e+=this.input.slice(i,this.pos);var c=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var l=this.readCodePoint();(t?isIdentifierStart:isIdentifierChar)(l,n)||this.invalidStringToken(c,"Invalid Unicode escape"),e+=codePointToString(l),i=this.pos}t=!1}return e+this.input.slice(i,this.pos)},je.readWord=function(){var e=this.readWord1(),t=O.name;return this.keywords.test(e)&&(t=N[e]),this.finishToken(t,e)};acorn_Parser.acorn={Parser:acorn_Parser,version:"8.16.0",defaultOptions:X,Position:acorn_Position,SourceLocation:acorn_SourceLocation,getLineInfo,Node:acorn_Node,TokenType:acorn_TokenType,tokTypes:O,keywordTypes:N,TokContext:acorn_TokContext,tokContexts:fe,isIdentifierChar,isIdentifierStart,Token:acorn_Token,isNewLine,lineBreak:j,lineBreakG:F,nonASCIIwhitespace:B};var Be=__nested_rspack_require_27261__("node:module"),$e=__nested_rspack_require_27261__("node:fs");String.fromCharCode;const qe=/\/$|\/\?|\/#/,Ge=/^\.?\//;function hasTrailingSlash(e="",t){return t?qe.test(e):e.endsWith("/")}function withTrailingSlash(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(hasTrailingSlash(e,!0))return e||"/";let i=e,n="";const a=e.indexOf("#");if(-1!==a&&(i=e.slice(0,a),n=e.slice(a),!i))return n;const[c,...l]=i.split("?");return c+"/"+(l.length>0?`?${l.join("?")}`:"")+n}function isNonEmptyURL(e){return e&&"/"!==e}function dist_joinURL(e,...t){let i=e||"";for(const e of t.filter(e=>isNonEmptyURL(e)))if(i){const t=e.replace(Ge,"");i=withTrailingSlash(i)+t}else i=e;return i}Symbol.for("ufo:protocolRelative");const Ke=/^[A-Za-z]:\//;function pathe_M_eThtNZ_normalizeWindowsPath(e=""){return e?e.replace(/\\/g,"/").replace(Ke,e=>e.toUpperCase()):e}const He=/^[/\\]{2}/,ze=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Je=/^[A-Za-z]:$/,Ye=/.(\.[^./]+|\.)$/,pathe_M_eThtNZ_normalize=function(e){if(0===e.length)return".";const t=(e=pathe_M_eThtNZ_normalizeWindowsPath(e)).match(He),i=isAbsolute(e),n="/"===e[e.length-1];return 0===(e=normalizeString(e,!i)).length?i?"/":n?"./":".":(n&&(e+="/"),Je.test(e)&&(e+="/"),t?i?`//${e}`:`//./${e}`:i&&!isAbsolute(e)?`/${e}`:e)},pathe_M_eThtNZ_join=function(...e){let t="";for(const i of e)if(i)if(t.length>0){const e="/"===t[t.length-1],n="/"===i[0];t+=e&&n?i.slice(1):e||n?i:`/${i}`}else t+=i;return pathe_M_eThtNZ_normalize(t)};function pathe_M_eThtNZ_cwd(){return"undefined"!=typeof process&&"function"==typeof process.cwd?process.cwd().replace(/\\/g,"/"):"/"}const pathe_M_eThtNZ_resolve=function(...e){let t="",i=!1;for(let n=(e=e.map(e=>pathe_M_eThtNZ_normalizeWindowsPath(e))).length-1;n>=-1&&!i;n--){const a=n>=0?e[n]:pathe_M_eThtNZ_cwd();a&&0!==a.length&&(t=`${a}/${t}`,i=isAbsolute(a))}return t=normalizeString(t,!i),i&&!isAbsolute(t)?`/${t}`:t.length>0?t:"."};function normalizeString(e,t){let i="",n=0,a=-1,c=0,l=null;for(let y=0;y<=e.length;++y){if(y<e.length)l=e[y];else{if("/"===l)break;l="/"}if("/"===l){if(a===y-1||1===c);else if(2===c){if(i.length<2||2!==n||"."!==i[i.length-1]||"."!==i[i.length-2]){if(i.length>2){const e=i.lastIndexOf("/");-1===e?(i="",n=0):(i=i.slice(0,e),n=i.length-1-i.lastIndexOf("/")),a=y,c=0;continue}if(i.length>0){i="",n=0,a=y,c=0;continue}}t&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+=`/${e.slice(a+1,y)}`:i=e.slice(a+1,y),n=y-a-1;a=y,c=0}else"."===l&&-1!==c?++c:c=-1}return i}const isAbsolute=function(e){return ze.test(e)},extname=function(e){if(".."===e)return"";const t=Ye.exec(pathe_M_eThtNZ_normalizeWindowsPath(e));return t&&t[1]||""},pathe_M_eThtNZ_dirname=function(e){const t=pathe_M_eThtNZ_normalizeWindowsPath(e).replace(/\/$/,"").split("/").slice(0,-1);return 1===t.length&&Je.test(t[0])&&(t[0]+="/"),t.join("/")||(isAbsolute(e)?"/":".")},basename=function(e,t){const i=pathe_M_eThtNZ_normalizeWindowsPath(e).split("/");let n="";for(let e=i.length-1;e>=0;e--){const t=i[e];if(t){n=t;break}}return t&&n.endsWith(t)?n.slice(0,-t.length):n},Qe=__webpack_require__(3136),Ze=__webpack_require__(4589),Xe=__webpack_require__(1708);var et=__nested_rspack_require_27261__("node:path");const tt=__webpack_require__(8877),it=__webpack_require__(7975),st=new Set(Be.builtinModules);function normalizeSlash(e){return e.replace(/\\/g,"/")}const rt={}.hasOwnProperty,nt=/^([A-Z][a-z\d]*)+$/,at=new Set(["string","function","number","object","Function","Object","boolean","bigint","symbol"]),ot={};function formatList(e,t="and"){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}const ct=new Map;let ht;function createError(e,t,i){return ct.set(e,t),function(e,t){return NodeError;function NodeError(...i){const n=Error.stackTraceLimit;isErrorStackTraceLimitWritable()&&(Error.stackTraceLimit=0);const a=new e;isErrorStackTraceLimitWritable()&&(Error.stackTraceLimit=n);const c=function(e,t,i){const n=ct.get(e);if(Ze.ok(void 0!==n,"expected `message` to be found"),"function"==typeof n)return Ze.ok(n.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${n.length}).`),Reflect.apply(n,i,t);const a=/%[dfijoOs]/g;let c=0;for(;null!==a.exec(n);)c++;return Ze.ok(c===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${c}).`),0===t.length?n:(t.unshift(n),Reflect.apply(it.format,null,t))}(t,i,a);return Object.defineProperties(a,{message:{value:c,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),lt(a),a.code=t,a}}(i,e)}function isErrorStackTraceLimitWritable(){try{if(tt.startupSnapshot.isBuildingSnapshot())return!1}catch{}const e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):rt.call(e,"writable")&&void 0!==e.writable?e.writable:void 0!==e.set}ot.ERR_INVALID_ARG_TYPE=createError("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Ze.ok("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";if(e.endsWith(" argument"))n+=`${e} `;else{const t=e.includes(".")?"property":"argument";n+=`"${e}" ${t} `}n+="must be ";const a=[],c=[],l=[];for(const e of t)Ze.ok("string"==typeof e,"All expected entries have to be of type string"),at.has(e)?a.push(e.toLowerCase()):null===nt.exec(e)?(Ze.ok("object"!==e,'The value "object" should be written as "Object"'),l.push(e)):c.push(e);if(c.length>0){const e=a.indexOf("object");-1!==e&&(a.slice(e,1),c.push("Object"))}return a.length>0&&(n+=`${a.length>1?"one of type":"of type"} ${formatList(a,"or")}`,(c.length>0||l.length>0)&&(n+=" or ")),c.length>0&&(n+=`an instance of ${formatList(c,"or")}`,l.length>0&&(n+=" or ")),l.length>0&&(l.length>1?n+=`one of ${formatList(l,"or")}`:(l[0].toLowerCase()!==l[0]&&(n+="an "),n+=`${l[0]}`)),n+=`. Received ${function(e){if(null==e)return String(e);if("function"==typeof e&&e.name)return`function ${e.name}`;if("object"==typeof e)return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${(0,it.inspect)(e,{depth:-1})}`;let t=(0,it.inspect)(e,{colors:!1});t.length>28&&(t=`${t.slice(0,25)}...`);return`type ${typeof e} (${t})`}(i)}`,n},TypeError),ot.ERR_INVALID_MODULE_SPECIFIER=createError("ERR_INVALID_MODULE_SPECIFIER",(e,t,i=void 0)=>`Invalid module "${e}" ${t}${i?` imported from ${i}`:""}`,TypeError),ot.ERR_INVALID_PACKAGE_CONFIG=createError("ERR_INVALID_PACKAGE_CONFIG",(e,t,i)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${i?`. ${i}`:""}`,Error),ot.ERR_INVALID_PACKAGE_TARGET=createError("ERR_INVALID_PACKAGE_TARGET",(e,t,i,n=!1,a=void 0)=>{const c="string"==typeof i&&!n&&i.length>0&&!i.startsWith("./");return"."===t?(Ze.ok(!1===n),`Invalid "exports" main target ${JSON.stringify(i)} defined in the package config ${e}package.json${a?` imported from ${a}`:""}${c?'; targets must start with "./"':""}`):`Invalid "${n?"imports":"exports"}" target ${JSON.stringify(i)} defined for '${t}' in the package config ${e}package.json${a?` imported from ${a}`:""}${c?'; targets must start with "./"':""}`},Error),ot.ERR_MODULE_NOT_FOUND=createError("ERR_MODULE_NOT_FOUND",(e,t,i=!1)=>`Cannot find ${i?"module":"package"} '${e}' imported from ${t}`,Error),ot.ERR_NETWORK_IMPORT_DISALLOWED=createError("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error),ot.ERR_PACKAGE_IMPORT_NOT_DEFINED=createError("ERR_PACKAGE_IMPORT_NOT_DEFINED",(e,t,i)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:""} imported from ${i}`,TypeError),ot.ERR_PACKAGE_PATH_NOT_EXPORTED=createError("ERR_PACKAGE_PATH_NOT_EXPORTED",(e,t,i=void 0)=>"."===t?`No "exports" main defined in ${e}package.json${i?` imported from ${i}`:""}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${i?` imported from ${i}`:""}`,Error),ot.ERR_UNSUPPORTED_DIR_IMPORT=createError("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error),ot.ERR_UNSUPPORTED_RESOLVE_REQUEST=createError("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError),ot.ERR_UNKNOWN_FILE_EXTENSION=createError("ERR_UNKNOWN_FILE_EXTENSION",(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError),ot.ERR_INVALID_ARG_VALUE=createError("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let n=(0,it.inspect)(t);n.length>128&&(n=`${n.slice(0,128)}...`);return`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${n}`},TypeError);const lt=function(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}(function(e){const t=isErrorStackTraceLimitWritable();return t&&(ht=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=ht),e});const pt={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:ut}=ot,dt=new Map;function read(e,{base:t,specifier:i}){const n=dt.get(e);if(n)return n;let a;try{a=$e.readFileSync(et.toNamespacedPath(e),"utf8")}catch(e){const t=e;if("ENOENT"!==t.code)throw t}const c={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};if(void 0!==a){let n;try{n=JSON.parse(a)}catch(n){const a=n,c=new ut(e,(t?`"${i}" from `:"")+(0,Qe.fileURLToPath)(t||i),a.message);throw c.cause=a,c}c.exists=!0,pt.call(n,"name")&&"string"==typeof n.name&&(c.name=n.name),pt.call(n,"main")&&"string"==typeof n.main&&(c.main=n.main),pt.call(n,"exports")&&(c.exports=n.exports),pt.call(n,"imports")&&(c.imports=n.imports),!pt.call(n,"type")||"commonjs"!==n.type&&"module"!==n.type||(c.type=n.type)}return dt.set(e,c),c}function getPackageScopeConfig(e){let t=new URL("package.json",e);for(;;){if(t.pathname.endsWith("node_modules/package.json"))break;const i=read((0,Qe.fileURLToPath)(t),{specifier:e});if(i.exists)return i;const n=t;if(t=new URL("../package.json",t),t.pathname===n.pathname)break}return{pjsonPath:(0,Qe.fileURLToPath)(t),exists:!1,type:"none"}}function getPackageType(e){return getPackageScopeConfig(e).type}const{ERR_UNKNOWN_FILE_EXTENSION:ft}=ot,mt={}.hasOwnProperty,gt={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"};const xt={__proto__:null,"data:":function(e){const{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return function(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?"module":"application/json"===e?"json":null}(t)},"file:":function(e,t,i){const n=function(e){const t=e.pathname;let i=t.length;for(;i--;){const e=t.codePointAt(i);if(47===e)return"";if(46===e)return 47===t.codePointAt(i-1)?"":t.slice(i)}return""}(e);if(".js"===n){const t=getPackageType(e);return"none"!==t?t:"commonjs"}if(""===n){const t=getPackageType(e);return"none"===t||"commonjs"===t?"commonjs":"module"}const a=gt[n];if(a)return a;if(i)return;const c=(0,Qe.fileURLToPath)(e);throw new ft(n,c)},"http:":getHttpProtocolModuleFormat,"https:":getHttpProtocolModuleFormat,"node:":()=>"builtin"};function getHttpProtocolModuleFormat(){}const vt=Object.freeze(["node","import"]),yt=new Set(vt);function getConditionsSet(e){return yt}const _t=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:Et,ERR_INVALID_PACKAGE_CONFIG:bt,ERR_INVALID_PACKAGE_TARGET:kt,ERR_MODULE_NOT_FOUND:wt,ERR_PACKAGE_IMPORT_NOT_DEFINED:Ct,ERR_PACKAGE_PATH_NOT_EXPORTED:St,ERR_UNSUPPORTED_DIR_IMPORT:It,ERR_UNSUPPORTED_RESOLVE_REQUEST:Tt}=ot,Rt={}.hasOwnProperty,At=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,Pt=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,Lt=/^\.|%|\\/,Nt=/\*/g,Ot=/%2f|%5c/i,Dt=new Set,Vt=/[/\\]{2}/;function emitInvalidSegmentDeprecation(e,t,i,n,a,c,l){if(Xe.noDeprecation)return;const y=(0,Qe.fileURLToPath)(n),E=null!==Vt.exec(l?e:t);Xe.emitWarning(`Use of deprecated ${E?"double slash":"leading or trailing slash matching"} resolving "${e}" for module request "${t}" ${t===i?"":`matched to "${i}" `}in the "${a?"imports":"exports"}" field module resolution of the package at ${y}${c?` imported from ${(0,Qe.fileURLToPath)(c)}`:""}.`,"DeprecationWarning","DEP0166")}function emitLegacyIndexDeprecation(e,t,i,n){if(Xe.noDeprecation)return;const a=function(e,t){const i=e.protocol;return mt.call(xt,i)&&xt[i](e,t,!0)||null}(e,{parentURL:i.href});if("module"!==a)return;const c=(0,Qe.fileURLToPath)(e.href),l=(0,Qe.fileURLToPath)(new URL(".",t)),y=(0,Qe.fileURLToPath)(i);n?et.resolve(l,n)!==c&&Xe.emitWarning(`Package ${l} has a "main" field set to "${n}", excluding the full filename and extension to the resolved file at "${c.slice(l.length)}", imported from ${y}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`,"DeprecationWarning","DEP0151"):Xe.emitWarning(`No "main" or "exports" field defined in the package.json for ${l} resolving the main entry point "${c.slice(l.length)}", imported from ${y}.\nDefault "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function tryStatSync(e){try{return(0,$e.statSync)(e)}catch{}}function fileExists(e){const t=(0,$e.statSync)(e,{throwIfNoEntry:!1}),i=t?t.isFile():void 0;return null!=i&&i}function legacyMainResolve(e,t,i){let n;if(void 0!==t.main){if(n=new URL(t.main,e),fileExists(n))return n;const a=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`];let c=-1;for(;++c<a.length&&(n=new URL(a[c],e),!fileExists(n));)n=void 0;if(n)return emitLegacyIndexDeprecation(n,e,i,t.main),n}const a=["./index.js","./index.json","./index.node"];let c=-1;for(;++c<a.length&&(n=new URL(a[c],e),!fileExists(n));)n=void 0;if(n)return emitLegacyIndexDeprecation(n,e,i,t.main),n;throw new wt((0,Qe.fileURLToPath)(new URL(".",e)),(0,Qe.fileURLToPath)(i))}function exportsNotFound(e,t,i){return new St((0,Qe.fileURLToPath)(new URL(".",t)),e,i&&(0,Qe.fileURLToPath)(i))}function invalidPackageTarget(e,t,i,n,a){return t="object"==typeof t&&null!==t?JSON.stringify(t,null,""):`${t}`,new kt((0,Qe.fileURLToPath)(new URL(".",i)),e,t,n,a&&(0,Qe.fileURLToPath)(a))}function resolvePackageTargetString(e,t,i,n,a,c,l,y,E){if(""!==t&&!c&&"/"!==e[e.length-1])throw invalidPackageTarget(i,e,n,l,a);if(!e.startsWith("./")){if(l&&!e.startsWith("../")&&!e.startsWith("/")){let i=!1;try{new URL(e),i=!0}catch{}if(!i){return packageResolve(c?_t.call(Nt,e,()=>t):e+t,n,E)}}throw invalidPackageTarget(i,e,n,l,a)}if(null!==At.exec(e.slice(2))){if(null!==Pt.exec(e.slice(2)))throw invalidPackageTarget(i,e,n,l,a);if(!y){const y=c?i.replace("*",()=>t):i+t;emitInvalidSegmentDeprecation(c?_t.call(Nt,e,()=>t):e,y,i,n,l,a,!0)}}const w=new URL(e,n),C=w.pathname,S=new URL(".",n).pathname;if(!C.startsWith(S))throw invalidPackageTarget(i,e,n,l,a);if(""===t)return w;if(null!==At.exec(t)){const E=c?i.replace("*",()=>t):i+t;if(null===Pt.exec(t)){if(!y){emitInvalidSegmentDeprecation(c?_t.call(Nt,e,()=>t):e,E,i,n,l,a,!1)}}else!function(e,t,i,n,a){const c=`request is not a valid match in pattern "${t}" for the "${n?"imports":"exports"}" resolution of ${(0,Qe.fileURLToPath)(i)}`;throw new Et(e,c,a&&(0,Qe.fileURLToPath)(a))}(E,i,n,l,a)}return c?new URL(_t.call(Nt,w.href,()=>t)):new URL(t,w)}function isArrayIndex(e){const t=Number(e);return`${t}`===e&&(t>=0&&t<4294967295)}function resolvePackageTarget(e,t,i,n,a,c,l,y,E){if("string"==typeof t)return resolvePackageTargetString(t,i,n,e,a,c,l,y,E);if(Array.isArray(t)){const w=t;if(0===w.length)return null;let C,S=-1;for(;++S<w.length;){const t=w[S];let I;try{I=resolvePackageTarget(e,t,i,n,a,c,l,y,E)}catch(e){if(C=e,"ERR_INVALID_PACKAGE_TARGET"===e.code)continue;throw e}if(void 0!==I){if(null!==I)return I;C=null}}if(null==C)return null;throw C}if("object"==typeof t&&null!==t){const w=Object.getOwnPropertyNames(t);let C=-1;for(;++C<w.length;){if(isArrayIndex(w[C]))throw new bt((0,Qe.fileURLToPath)(e),a,'"exports" cannot contain numeric property keys.')}for(C=-1;++C<w.length;){const S=w[C];if("default"===S||E&&E.has(S)){const w=resolvePackageTarget(e,t[S],i,n,a,c,l,y,E);if(void 0===w)continue;return w}}return null}if(null===t)return null;throw invalidPackageTarget(n,t,e,l,a)}function emitTrailingSlashPatternDeprecation(e,t,i){if(Xe.noDeprecation)return;const n=(0,Qe.fileURLToPath)(t);Dt.has(n+"|"+e)||(Dt.add(n+"|"+e),Xe.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${n}${i?` imported from ${(0,Qe.fileURLToPath)(i)}`:""}. Mapping specifiers ending in "/" is no longer supported.`,"DeprecationWarning","DEP0155"))}function packageExportsResolve(e,t,i,n,a){let c=i.exports;if(function(e,t,i){if("string"==typeof e||Array.isArray(e))return!0;if("object"!=typeof e||null===e)return!1;const n=Object.getOwnPropertyNames(e);let a=!1,c=0,l=-1;for(;++l<n.length;){const e=n[l],y=""===e||"."!==e[0];if(0===c++)a=y;else if(a!==y)throw new bt((0,Qe.fileURLToPath)(t),i,"\"exports\" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.")}return a}(c,e,n)&&(c={".":c}),Rt.call(c,t)&&!t.includes("*")&&!t.endsWith("/")){const i=resolvePackageTarget(e,c[t],"",t,n,!1,!1,!1,a);if(null==i)throw exportsNotFound(t,e,n);return i}let l="",y="";const E=Object.getOwnPropertyNames(c);let w=-1;for(;++w<E.length;){const i=E[w],a=i.indexOf("*");if(-1!==a&&t.startsWith(i.slice(0,a))){t.endsWith("/")&&emitTrailingSlashPatternDeprecation(t,e,n);const c=i.slice(a+1);t.length>=i.length&&t.endsWith(c)&&1===patternKeyCompare(l,i)&&i.lastIndexOf("*")===a&&(l=i,y=t.slice(a,t.length-c.length))}}if(l){const i=resolvePackageTarget(e,c[l],y,l,n,!0,!1,t.endsWith("/"),a);if(null==i)throw exportsNotFound(t,e,n);return i}throw exportsNotFound(t,e,n)}function patternKeyCompare(e,t){const i=e.indexOf("*"),n=t.indexOf("*"),a=-1===i?e.length:i+1,c=-1===n?t.length:n+1;return a>c?-1:c>a||-1===i?1:-1===n||e.length>t.length?-1:t.length>e.length?1:0}function packageImportsResolve(e,t,i){if("#"===e||e.startsWith("#/")||e.endsWith("/")){throw new Et(e,"is not a valid internal imports specifier name",(0,Qe.fileURLToPath)(t))}let n;const a=getPackageScopeConfig(t);if(a.exists){n=(0,Qe.pathToFileURL)(a.pjsonPath);const c=a.imports;if(c)if(Rt.call(c,e)&&!e.includes("*")){const a=resolvePackageTarget(n,c[e],"",e,t,!1,!0,!1,i);if(null!=a)return a}else{let a="",l="";const y=Object.getOwnPropertyNames(c);let E=-1;for(;++E<y.length;){const t=y[E],i=t.indexOf("*");if(-1!==i&&e.startsWith(t.slice(0,-1))){const n=t.slice(i+1);e.length>=t.length&&e.endsWith(n)&&1===patternKeyCompare(a,t)&&t.lastIndexOf("*")===i&&(a=t,l=e.slice(i,e.length-n.length))}}if(a){const e=resolvePackageTarget(n,c[a],l,a,t,!0,!0,!1,i);if(null!=e)return e}}}throw function(e,t,i){return new Ct(e,t&&(0,Qe.fileURLToPath)(new URL(".",t)),(0,Qe.fileURLToPath)(i))}(e,n,t)}function packageResolve(e,t,i){if(Be.builtinModules.includes(e))return new URL("node:"+e);const{packageName:n,packageSubpath:a,isScoped:c}=function(e,t){let i=e.indexOf("/"),n=!0,a=!1;"@"===e[0]&&(a=!0,-1===i||0===e.length?n=!1:i=e.indexOf("/",i+1));const c=-1===i?e:e.slice(0,i);if(null!==Lt.exec(c)&&(n=!1),!n)throw new Et(e,"is not a valid package name",(0,Qe.fileURLToPath)(t));return{packageName:c,packageSubpath:"."+(-1===i?"":e.slice(i)),isScoped:a}}(e,t),l=getPackageScopeConfig(t);if(l.exists){const e=(0,Qe.pathToFileURL)(l.pjsonPath);if(l.name===n&&void 0!==l.exports&&null!==l.exports)return packageExportsResolve(e,a,l,t,i)}let y,E=new URL("./node_modules/"+n+"/package.json",t),w=(0,Qe.fileURLToPath)(E);do{const l=tryStatSync(w.slice(0,-13));if(!l||!l.isDirectory()){y=w,E=new URL((c?"../../../../node_modules/":"../../../node_modules/")+n+"/package.json",E),w=(0,Qe.fileURLToPath)(E);continue}const C=read(w,{base:t,specifier:e});return void 0!==C.exports&&null!==C.exports?packageExportsResolve(E,a,C,t,i):"."===a?legacyMainResolve(E,C,t):new URL(a,E)}while(w.length!==y.length)}function moduleResolve(e,t,i,n){void 0===i&&(i=getConditionsSet());const a=t.protocol,c="data:"===a||"http:"===a||"https:"===a;let l;if(function(e){return""!==e&&("/"===e[0]||function(e){if("."===e[0]){if(1===e.length||"/"===e[1])return!0;if("."===e[1]&&(2===e.length||"/"===e[2]))return!0}return!1}(e))}(e))try{l=new URL(e,t)}catch(i){const n=new Tt(e,t);throw n.cause=i,n}else if("file:"===a&&"#"===e[0])l=packageImportsResolve(e,t,i);else try{l=new URL(e)}catch(n){if(c&&!Be.builtinModules.includes(e)){const i=new Tt(e,t);throw i.cause=n,i}l=packageResolve(e,t,i)}return Ze.ok(void 0!==l,"expected to be defined"),"file:"!==l.protocol?l:function(e,t){if(null!==Ot.exec(e.pathname))throw new Et(e.pathname,'must not include encoded "/" or "\\" characters',(0,Qe.fileURLToPath)(t));let i;try{i=(0,Qe.fileURLToPath)(e)}catch(i){const n=i;throw Object.defineProperty(n,"input",{value:String(e)}),Object.defineProperty(n,"module",{value:String(t)}),n}const n=tryStatSync(i.endsWith("/")?i.slice(-1):i);if(n&&n.isDirectory()){const n=new It(i,(0,Qe.fileURLToPath)(t));throw n.url=String(e),n}if(!n||!n.isFile()){const n=new wt(i||e.pathname,t&&(0,Qe.fileURLToPath)(t),!0);throw n.url=String(e),n}{const t=(0,$e.realpathSync)(i),{search:n,hash:a}=e;(e=(0,Qe.pathToFileURL)(t+(i.endsWith(et.sep)?"/":""))).search=n,e.hash=a}return e}(l,t)}function fileURLToPath(e){return"string"!=typeof e||e.startsWith("file://")?normalizeSlash((0,Qe.fileURLToPath)(e)):normalizeSlash(e)}function pathToFileURL(e){return(0,Qe.pathToFileURL)(fileURLToPath(e)).toString()}const Ut=new Set(["node","import"]),Mt=[".mjs",".cjs",".js",".json"],jt=new Set(["ERR_MODULE_NOT_FOUND","ERR_UNSUPPORTED_DIR_IMPORT","MODULE_NOT_FOUND","ERR_PACKAGE_PATH_NOT_EXPORTED"]);function _tryModuleResolve(e,t,i){try{return moduleResolve(e,t,i)}catch(e){if(!jt.has(e?.code))throw e}}function _resolve(e,t={}){if("string"!=typeof e){if(!(e instanceof URL))throw new TypeError("input must be a `string` or `URL`");e=fileURLToPath(e)}if(/(?:node|data|http|https):/.test(e))return e;if(st.has(e))return"node:"+e;if(e.startsWith("file://")&&(e=fileURLToPath(e)),isAbsolute(e))try{if((0,$e.statSync)(e).isFile())return pathToFileURL(e)}catch(e){if("ENOENT"!==e?.code)throw e}const i=t.conditions?new Set(t.conditions):Ut,n=(Array.isArray(t.url)?t.url:[t.url]).filter(Boolean).map(e=>new URL(function(e){return"string"!=typeof e&&(e=e.toString()),/(?:node|data|http|https|file):/.test(e)?e:st.has(e)?"node:"+e:"file://"+encodeURI(normalizeSlash(e))}(e.toString())));0===n.length&&n.push(new URL(pathToFileURL(process.cwd())));const a=[...n];for(const e of n)"file:"===e.protocol&&a.push(new URL("./",e),new URL(dist_joinURL(e.pathname,"_index.js"),e),new URL("node_modules",e));let c;for(const n of a){if(c=_tryModuleResolve(e,n,i),c)break;for(const a of["","/index"]){for(const l of t.extensions||Mt)if(c=_tryModuleResolve(dist_joinURL(e,a)+l,n,i),c)break;if(c)break}if(c)break}if(!c){const t=new Error(`Cannot find module ${e} imported from ${a.join(", ")}`);throw t.code="ERR_MODULE_NOT_FOUND",t}return pathToFileURL(c)}function resolveSync(e,t){return _resolve(e,t)}function resolvePathSync(e,t){return fileURLToPath(resolveSync(e,t))}const Ft=/(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m,Bt=/\/\*.+?\*\/|\/\/.*(?=[nr])/g;function hasESMSyntax(e,t={}){return t.stripComments&&(e=e.replace(Bt,"")),Ft.test(e)}function escapeStringRegexp(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const $t=new Set(["/","\\",void 0]),qt=Symbol.for("pathe:normalizedAlias"),Wt=/[/\\]/;function normalizeAliases(e){if(e[qt])return e;const t=Object.fromEntries(Object.entries(e).sort(([e],[t])=>function(e,t){return t.split("/").length-e.split("/").length}(e,t)));for(const e in t)for(const i in t)i===e||e.startsWith(i)||t[e]?.startsWith(i)&&$t.has(t[e][i.length])&&(t[e]=t[i]+t[e].slice(i.length));return Object.defineProperty(t,qt,{value:!0,enumerable:!1}),t}function utils_hasTrailingSlash(e="/"){const t=e[e.length-1];return"/"===t||"\\"===t}var Gt={rE:"2.6.1"};const Kt=__webpack_require__(7598);var Ht=__nested_rspack_require_27261__.n(Kt);const zt=globalThis.process?.env||Object.create(null),Jt=globalThis.process||{env:zt},Yt=void 0!==Jt&&Jt.env&&Jt.env.NODE_ENV||void 0,Qt=[["claude",["CLAUDECODE","CLAUDE_CODE"]],["replit",["REPL_ID"]],["gemini",["GEMINI_CLI"]],["codex",["CODEX_SANDBOX","CODEX_THREAD_ID"]],["opencode",["OPENCODE"]],["pi",[dist_i("PATH",/\.pi[\\/]agent/)]],["auggie",["AUGMENT_AGENT"]],["goose",["GOOSE_PROVIDER"]],["devin",[dist_i("EDITOR",/devin/)]],["cursor",["CURSOR_AGENT"]],["kiro",[dist_i("TERM_PROGRAM",/kiro/)]]];function dist_i(e,t){return()=>{let i=zt[e];return!!i&&t.test(i)}}const Zt=function(){let e=zt.AI_AGENT;if(e)return{name:e.toLowerCase()};for(let[e,t]of Qt)for(let i of t)if("string"==typeof i?zt[i]:i())return{name:e};return{}}(),Xt=(Zt.name,Zt.name,[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["GOOGLE_CLOUDRUN","K_SERVICE"],["GOOGLE_CLOUDRUN_JOB","CLOUD_RUN_JOB"],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["JENKINS","JENKINS_URL"],["HUDSON","HUDSON_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOY"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}],["EDGEONE_PAGES","EO_PAGES_CI",{ci:!0}]]);const ei=function(){for(let e of Xt)if(zt[e[1]||e[0]])return{name:e[0].toLowerCase(),...e[2]};return"/bin/jsh"===zt.SHELL&&Jt.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}(),ti=(ei.name,Jt.platform||""),ii=!!zt.CI||!1!==ei.ci,si=!!Jt.stdout?.isTTY,ri=(zt.DEBUG,"test"===Yt||!!zt.TEST),ni=("production"===Yt||zt.MODE,"dev"===Yt||"development"===Yt||zt.MODE,zt.MINIMAL,/^win/i.test(ti)),ai=(/^linux/i.test(ti),/^darwin/i.test(ti),!zt.NO_COLOR&&(!!zt.FORCE_COLOR||(si||ni)&&zt.TERM),(Jt.versions?.node||"").replace(/^v/,"")||null),oi=(Number(ai?.split(".")[0]),!!Jt?.versions?.node),ci="Bun"in globalThis,hi="Deno"in globalThis,li="fastly"in globalThis,pi=[["Netlify"in globalThis,"netlify"],["EdgeRuntime"in globalThis,"edge-light"],["Cloudflare-Workers"===globalThis.navigator?.userAgent,"workerd"],[li,"fastly"],[hi,"deno"],[ci,"bun"],[oi,"node"]];!function(){let e=pi.find(e=>e[0]);if(e)e[1]}();const ui=__webpack_require__(7066),di=ui?.WriteStream?.prototype?.hasColors?.()??!1,base_format=(e,t)=>{if(!di)return e=>e;const i=`[${e}m`,n=`[${t}m`;return e=>{const a=e+"";let c=a.indexOf(n);if(-1===c)return i+a+n;let l=i,y=0;const E=(22===t?n:"")+i;for(;-1!==c;)l+=a.slice(y,c)+E,y=c+n.length,c=a.indexOf(n,y);return l+=a.slice(y)+n,l}},fi=(base_format(0,0),base_format(1,22),base_format(2,22),base_format(3,23),base_format(4,24),base_format(53,55),base_format(7,27),base_format(8,28),base_format(9,29),base_format(30,39),base_format(31,39)),mi=base_format(32,39),gi=base_format(33,39),xi=base_format(34,39),vi=(base_format(35,39),base_format(36,39)),yi=(base_format(37,39),base_format(90,39));base_format(40,49),base_format(41,49),base_format(42,49),base_format(43,49),base_format(44,49),base_format(45,49),base_format(46,49),base_format(47,49),base_format(100,49),base_format(91,39),base_format(92,39),base_format(93,39),base_format(94,39),base_format(95,39),base_format(96,39),base_format(97,39),base_format(101,49),base_format(102,49),base_format(103,49),base_format(104,49),base_format(105,49),base_format(106,49),base_format(107,49);function isDir(e){if("string"!=typeof e||e.startsWith("file://"))return!1;try{return(0,$e.lstatSync)(e).isDirectory()}catch{return!1}}function utils_hash(e,t=8){return(function(){if(void 0!==Ei)return Ei;try{return Ei=!!Ht().getFips?.(),Ei}catch{return Ei=!1,Ei}}()?Ht().createHash("sha256"):Ht().createHash("md5")).update(e).digest("hex").slice(0,t)}const _i={true:mi("true"),false:gi("false"),"[rebuild]":gi("[rebuild]"),"[esm]":xi("[esm]"),"[cjs]":mi("[cjs]"),"[import]":xi("[import]"),"[require]":mi("[require]"),"[native]":vi("[native]"),"[transpile]":gi("[transpile]"),"[fallback]":fi("[fallback]"),"[unknown]":fi("[unknown]"),"[hit]":mi("[hit]"),"[miss]":gi("[miss]"),"[json]":mi("[json]"),"[data]":mi("[data]")};function debug(e,...t){if(!e.opts.debug)return;const i=process.cwd();console.log(yi(["[jiti]",...t.map(e=>e in _i?_i[e]:"string"!=typeof e?JSON.stringify(e):e.replace(i,"."))].join(" ")))}function jitiInteropDefault(e,t){return e.opts.interopDefault?function(e){const t=typeof e;if(null===e||"object"!==t&&"function"!==t)return e;const i=e.default,n=typeof i,a=null==i,c="object"===n||"function"===n;if(a&&e instanceof Promise)return e;const l="function"===n&&"function"!==t,y=c&&!(i instanceof Promise),E=new Map;return new Proxy(e,{get(t,n){if(E.has(n))return E.get(n);let c;return"__esModule"===n?c=!0:"default"===n?c=a?e:"function"==typeof i?.default&&e.__esModule?i.default:i:n in t?c=t[n]:y&&(c=i[n],"function"==typeof c&&(c=c.bind(i))),E.set(n,c),c},apply:l?(e,t,n)=>Reflect.apply(i,t,n):void 0})}(t):t}let Ei;function _booleanEnv(e,t){const i=_jsonEnv(e,t);return Boolean(i)}function _jsonEnv(e,t,i){const n=process.env[e];if(!(e in process.env))return t;try{return JSON.parse(n)}catch{return i?n:t}}const bi=/\.(c|m)?j(sx?)$/,ki=/\.(c|m)?t(sx?)$/;function jitiResolve(e,t,i){let n,a;if(e.isNativeRe.test(t))return t;if(e.resolveTsConfigPaths&&!i.skipTsConfigPaths){const n=e.resolveTsConfigPaths(t);for(const t of n){const n=jitiResolve(e,t,{...i,try:!0,skipTsConfigPaths:!0});if(n)return n}}e.alias&&(t=function(e,t){const i=pathe_M_eThtNZ_normalizeWindowsPath(e);t=normalizeAliases(t);for(const[e,n]of Object.entries(t)){if(!i.startsWith(e))continue;const t=utils_hasTrailingSlash(e)?e.slice(0,-1):e;if(utils_hasTrailingSlash(i[t.length]))return pathe_M_eThtNZ_join(n,i.slice(e.length))}return i}(t,e.alias));let c=i?.parentURL||e.url;isDir(c)&&(c=pathe_M_eThtNZ_join(c,"_index.js"));const l=(i?.async?[i?.conditions,["node","import"],["node","require"]]:[i?.conditions,["node","require"],["node","import"]]).filter(Boolean);for(const i of l){try{n=resolvePathSync(t,{url:c,conditions:i,extensions:e.opts.extensions})}catch(e){a=e}if(n)return n}try{return e.nativeRequire.resolve(t,{paths:i.paths})}catch(e){a=e}for(const a of e.additionalExts){if(n=tryNativeRequireResolve(e,t+a,c,i)||tryNativeRequireResolve(e,t+"/index"+a,c,i),n)return n;if((ki.test(e.filename)||ki.test(e.parentModule?.filename||"")||bi.test(t))&&(n=tryNativeRequireResolve(e,t.replace(bi,".$1t$2"),c,i),n))return n}if(!i?.try)throw a}function tryNativeRequireResolve(e,t,i,n){try{return e.nativeRequire.resolve(t,{...n,paths:[pathe_M_eThtNZ_dirname(fileURLToPath(i)),...n?.paths||[]]})}catch{}}const wi=__webpack_require__(1455),Ci=__webpack_require__(643),Si=__webpack_require__(714);var Ii=__nested_rspack_require_27261__.n(Si);function jitiRequire(e,t,i){const n=e.parentCache||{};if(t.startsWith("node:"))return nativeImportOrRequire(e,t,i.async);if(t.startsWith("file:"))t=(0,Qe.fileURLToPath)(t);else if(t.startsWith("data:")){if(!i.async)throw new Error("`data:` URLs are only supported in ESM context. Use `import` or `jiti.import` instead.");return debug(e,"[native]","[data]","[import]",t),nativeImportOrRequire(e,t,!0)}if(Be.builtinModules.includes(t)||".pnp.js"===t)return nativeImportOrRequire(e,t,i.async);if(e.opts.virtualModules&&t in e.opts.virtualModules){debug(e,"[virtual]",t);const n=e.opts.virtualModules[t];return i.async?Promise.resolve(jitiInteropDefault(e,n)):jitiInteropDefault(e,n)}if(e.opts.tryNative&&!e.opts.transformOptions)try{if(!(t=jitiResolve(e,t,i))&&i.try)return;if(debug(e,"[try-native]",i.async&&e.nativeImport?"[import]":"[require]",t),i.async&&e.nativeImport)return e.nativeImport(t).then(i=>(!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],jitiInteropDefault(e,i))).catch(n=>(debug(e,`[try-native] Using fallback for ${t} because of an error:`,n),jitiRequire({...e,opts:{...e.opts,tryNative:!1}},t,i)));{const i=e.nativeRequire(t);return!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],jitiInteropDefault(e,i)}}catch(i){debug(e,`[try-native] Using fallback for ${t} because of an error:`,i)}const a=jitiResolve(e,t,i);if(!a&&i.try)return;const c=extname(a);if(".json"===c){debug(e,"[json]",a);const t=e.nativeRequire(a);return t&&!("default"in t)&&Object.defineProperty(t,"default",{value:t,enumerable:!1}),t}if(c&&!e.opts.extensions.includes(c))return debug(e,"[native]","[unknown]",i.async?"[import]":"[require]",a),nativeImportOrRequire(e,a,i.async);if(e.isNativeRe.test(a))return debug(e,"[native]",i.async?"[import]":"[require]",a),nativeImportOrRequire(e,a,i.async);if(n[a])return jitiInteropDefault(e,n[a]?.exports);if(e.opts.moduleCache){const t=e.nativeRequire.cache[a];if(t?.loaded)return jitiInteropDefault(e,t.exports)}const l=(0,$e.readFileSync)(a,"utf8");return eval_evalModule(e,l,{id:t,filename:a,ext:c,cache:n,async:i.async})}function nativeImportOrRequire(e,t,i){return i&&e.nativeImport?e.nativeImport(function(e){return ni&&isAbsolute(e)?pathToFileURL(e):e}(t)).then(t=>jitiInteropDefault(e,t)):jitiInteropDefault(e,e.nativeRequire(t))}const Ti="9";function getCache(e,t,i){if(!e.opts.fsCache||!t.filename)return i();const n=` /* v${Ti}-${utils_hash(t.source,16)} */\n`;let a=`${basename(pathe_M_eThtNZ_dirname(t.filename))}-${function(e){const t=e.split(Wt).pop();if(!t)return;const i=t.lastIndexOf(".");return i<=0?t:t.slice(0,i)}(t.filename)}`+(e.opts.sourceMaps?"+map":"")+(t.interopDefault?".i":"")+`.${utils_hash(t.filename)}`+(t.async?".mjs":".cjs");t.jsx&&t.filename.endsWith("x")&&(a+="x");const c=e.opts.fsCache,l=pathe_M_eThtNZ_join(c,a);if(!e.opts.rebuildFsCache&&(0,$e.existsSync)(l)){const i=(0,$e.readFileSync)(l,"utf8");if(i.endsWith(n))return debug(e,"[cache]","[hit]",t.filename,"~>",l),i}debug(e,"[cache]","[miss]",t.filename);const y=i();return y.includes("__JITI_ERROR__")||((0,$e.writeFileSync)(l,y+n,"utf8"),debug(e,"[cache]","[store]",t.filename,"~>",l)),y}function prepareCacheDir(t){if(!0===t.opts.fsCache&&(t.opts.fsCache=function(t){const i=t.filename&&pathe_M_eThtNZ_resolve(t.filename,"../node_modules");if(i&&(0,$e.existsSync)(i))return pathe_M_eThtNZ_join(i,".cache/jiti");let n=(0,e.tmpdir)();if(process.env.TMPDIR&&n===process.cwd()&&!process.env.JITI_RESPECT_TMPDIR_ENV){const t=process.env.TMPDIR;delete process.env.TMPDIR,n=(0,e.tmpdir)(),process.env.TMPDIR=t}return pathe_M_eThtNZ_join(n,"jiti")}(t)),t.opts.fsCache)try{if((0,$e.mkdirSync)(t.opts.fsCache,{recursive:!0}),!function(e){try{return(0,$e.accessSync)(e,$e.constants.W_OK),!0}catch{return!1}}(t.opts.fsCache))throw new Error("directory is not writable!")}catch(e){debug(t,"Error creating cache directory at ",t.opts.fsCache,e),t.opts.fsCache=!1}}function transform(e,t){let i=getCache(e,t,()=>{const i=e.opts.transform({...e.opts.transformOptions,babel:{...e.opts.sourceMaps?{sourceFileName:t.filename,sourceMaps:"inline"}:{},...e.opts.transformOptions?.babel},interopDefault:e.opts.interopDefault,...t});return i.error&&e.opts.debug&&debug(e,i.error),i.code});return i.startsWith("#!")&&(i="// "+i),i}function eval_evalModule(t,i,n={}){const a=n.id||(n.filename?basename(n.filename):`_jitiEval.${n.ext||(n.async?"mjs":"js")}`),c=n.filename||jitiResolve(t,a,{async:n.async}),l=n.ext||extname(c),y=n.cache||t.parentCache||{},E=/\.[cm]?tsx?$/.test(l),w=".mjs"===l||".js"===l&&"module"===function(e){for(;e&&"."!==e&&"/"!==e;){e=pathe_M_eThtNZ_join(e,"..");try{const t=(0,$e.readFileSync)(pathe_M_eThtNZ_join(e,"package.json"),"utf8");try{return JSON.parse(t)}catch{}break}catch{}}}(c)?.type,C=".cjs"===l,S=n.forceTranspile??(!C&&!(w&&n.async)&&(E||w||t.isTransformRe.test(c)||hasESMSyntax(i))),I=Ci.performance.now();if(S){i=transform(t,{filename:c,source:i,ts:E,async:n.async??!1,jsx:t.opts.jsx});const e=Math.round(1e3*(Ci.performance.now()-I))/1e3;debug(t,"[transpile]",n.async?"[esm]":"[cjs]",c,`(${e}ms)`)}else{if(debug(t,"[native]",n.async?"[import]":"[require]",c),n.async)return Promise.resolve(nativeImportOrRequire(t,c,n.async)).catch(e=>(debug(t,"Native import error:",e),debug(t,"[fallback]",c),eval_evalModule(t,i,{...n,forceTranspile:!0})));try{return nativeImportOrRequire(t,c,n.async)}catch(e){debug(t,"Native require error:",e),debug(t,"[fallback]",c),i=transform(t,{filename:c,source:i,ts:E,async:n.async??!1,jsx:t.opts.jsx})}}const N=new Be.Module(c);N.filename=c,t.parentModule&&(N.parent=t.parentModule,Array.isArray(t.parentModule.children)&&!t.parentModule.children.includes(N)&&t.parentModule.children.push(N));const O=createJiti(c,t.opts,{parentModule:N,parentCache:y,nativeImport:t.nativeImport,onError:t.onError,createRequire:t.createRequire},!0);let j;N.require=O,N.path=pathe_M_eThtNZ_dirname(c),N.paths=Be.Module._nodeModulePaths(N.path),y[c]=N,t.opts.moduleCache&&(t.nativeRequire.cache[c]=N);const F=function(e,t){return`(${t?.async?"async ":""}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e}\n});`}(i,{async:n.async});try{j=Ii().runInThisContext(F,{filename:c,lineOffset:0,displayErrors:!1})}catch(i){"SyntaxError"===i.name&&n.async&&t.nativeImport?(debug(t,"[esm]","[import]","[fallback]",c),j=function(t,i,n,a,c){const l=`export default ${i}`,y=c?void 0:`data:text/javascript;base64,${Buffer.from(l).toString("base64")}`;return(...i)=>{let c;const importViaTempFile=()=>(c=function(t,i){const n=pathe_M_eThtNZ_join((0,e.tmpdir)(),"jiti-esm");try{(0,$e.mkdirSync)(n,{recursive:!0})}catch{}const a=pathe_M_eThtNZ_join(n,`${basename(i,extname(i))}-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);return(0,$e.writeFileSync)(a,t),a}(l,n),debug(t,"[esm]","[tempfile]",c),a(pathToFileURL(c))),E=y?a(y).catch(e=>{if("ENAMETOOLONG"!==e?.code)throw e;return importViaTempFile()}):importViaTempFile();return E.then(e=>e.default(...i)).finally(()=>{c&&(0,wi.unlink)(c).catch(()=>{})})}}(t,F,c,t.nativeImport,t.opts.esmEvalTempFile)):(t.opts.moduleCache&&delete t.nativeRequire.cache[c],t.onError(i))}let B;try{B=j(N.exports,N.require,N,N.filename,pathe_M_eThtNZ_dirname(N.filename),O.import,O.esmResolve)}catch(e){t.opts.moduleCache&&delete t.nativeRequire.cache[c],t.onError(e)}function next(){if(N.exports&&N.exports.__JITI_ERROR__){const{filename:e,line:i,column:n,code:a,message:c}=N.exports.__JITI_ERROR__,l=new Error(`${a}: ${c} \n ${`${e}:${i}:${n}`}`);Error.captureStackTrace(l,jitiRequire),t.onError(l)}N.loaded=!0;return jitiInteropDefault(t,N.exports)}return n.async?Promise.resolve(B).then(next):next()}const Ri="win32"===(0,e.platform)();function createJiti(e,t={},i,n=!1){const a=n?t:function(e){const t={fsCache:_booleanEnv("JITI_FS_CACHE",_booleanEnv("JITI_CACHE",!0)),rebuildFsCache:_booleanEnv("JITI_REBUILD_FS_CACHE",!1),moduleCache:_booleanEnv("JITI_MODULE_CACHE",_booleanEnv("JITI_REQUIRE_CACHE",!0)),debug:_booleanEnv("JITI_DEBUG",!1),sourceMaps:_booleanEnv("JITI_SOURCE_MAPS",!1),interopDefault:_booleanEnv("JITI_INTEROP_DEFAULT",!0),extensions:_jsonEnv("JITI_EXTENSIONS",[".js",".mjs",".cjs",".ts",".tsx",".mts",".cts",".mtsx",".ctsx"]),alias:_jsonEnv("JITI_ALIAS",{}),nativeModules:_jsonEnv("JITI_NATIVE_MODULES",[]),transformModules:_jsonEnv("JITI_TRANSFORM_MODULES",[]),tryNative:_jsonEnv("JITI_TRY_NATIVE","Bun"in globalThis),esmEvalTempFile:_booleanEnv("JITI_ESM_EVAL_TEMP_FILE",!1),jsx:_booleanEnv("JITI_JSX",!1),tsconfigPaths:_jsonEnv("JITI_TSCONFIG_PATHS",!1,!0)};t.jsx&&t.extensions.push(".jsx",".tsx");const i={};return void 0!==e.cache&&(i.fsCache=e.cache),void 0!==e.requireCache&&(i.moduleCache=e.requireCache),{...t,...i,...e}}(t);"string"==typeof e&&e.startsWith("file://")&&(e=fileURLToPath(e));const c=a.alias&&Object.keys(a.alias).length>0?normalizeAliases(a.alias||{}):void 0;let l;if(a.tsconfigPaths){const{getTsconfig:t,createPathsMatcher:i}=__nested_rspack_require_27261__("./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs"),n=t("string"==typeof a.tsconfigPaths?a.tsconfigPaths:pathe_M_eThtNZ_dirname(e));n&&(l=i(n))}const y=["typescript","jiti",...a.nativeModules||[]],E=new RegExp(`node_modules/(${y.map(e=>escapeStringRegexp(e)).join("|")})/`),w=[...a.transformModules||[]],C=new RegExp(`node_modules/(${w.map(e=>escapeStringRegexp(e)).join("|")})/`);e||(e=process.cwd()),!n&&isDir(e)&&(e=pathe_M_eThtNZ_join(e,"_index.js"));const S=pathToFileURL(e),I=[...a.extensions].filter(e=>".js"!==e),N=i.createRequire(Ri?e.replace(/\//g,"\\"):e),O={filename:e,url:S,opts:a,alias:c,resolveTsConfigPaths:l,nativeModules:y,transformModules:w,isNativeRe:E,isTransformRe:C,additionalExts:I,nativeRequire:N,onError:i.onError,parentModule:i.parentModule,parentCache:i.parentCache,nativeImport:i.nativeImport,createRequire:i.createRequire};n||debug(O,"[init]",...[["version:",Gt.rE],["module-cache:",a.moduleCache],["fs-cache:",a.fsCache],["rebuild-fs-cache:",a.rebuildFsCache],["interop-defaults:",a.interopDefault]].flat()),n||prepareCacheDir(O);const j=Object.assign(function(e){return jitiRequire(O,e,{async:!1})},{cache:a.moduleCache?N.cache:Object.create(null),extensions:N.extensions,main:N.main,options:a,resolve:Object.assign(function(e,t){return jitiResolve(O,e,{...t,async:!1})},{paths:N.resolve.paths}),transform:e=>transform(O,e),evalModule:(e,t)=>eval_evalModule(O,e,t),async import(e,t){const i=await jitiRequire(O,e,{...t,async:!0});return t?.default?i?.default??i:i},esmResolve(e,t){"string"==typeof t&&(t={parentURL:t});const i=jitiResolve(O,e,{parentURL:S,...t,async:!0});return!i||"string"!=typeof i||i.startsWith("file://")?i:pathToFileURL(i)}});return j}})(),module.exports=i.default})();
|
|
55701
|
+
(()=>{var e={"./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive"(e){function webpackEmptyAsyncContext(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive",e.exports=webpackEmptyAsyncContext},fs(e){"use strict";e.exports=__webpack_require__(9896)},"node:fs"(e){"use strict";e.exports=__webpack_require__(3024)},"node:module"(e){"use strict";e.exports=__webpack_require__(8995)},"node:path"(e){"use strict";e.exports=__webpack_require__(6760)},os(e){"use strict";e.exports=__webpack_require__(857)},path(e){"use strict";e.exports=__webpack_require__(6928)},"./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs"(e,t,i){"use strict";var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0}),a=i("node:path"),c=i("node:fs"),l=i("node:module"),y=i("./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs"),E=i("fs"),w=i("os"),C=i("path");function h(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}r(h,"slash");const S=r(e=>{const t=c[e];return(i,...n)=>{const a=`${e}:${n.join(":")}`;let l=null==i?void 0:i.get(a);return void 0===l&&(l=Reflect.apply(t,c,n),null==i||i.set(a,l)),l}},"cacheFs"),I=S("existsSync"),N=S("readFileSync"),O=S("statSync"),j=r((e,t,i)=>{for(;;){const n=a.posix.join(e,t);if(I(i,n))return n;const c=a.dirname(e);if(c===e)return;e=c}},"findUp"),F=/^\.{1,2}(\/.*)?$/,B=r(e=>{const t=h(e);return F.test(t)?t:`./${t}`},"normalizeRelativePath");function Ne(e,t=!1){const i=e.length;let n=0,a="",c=0,l=16,y=0,E=0,w=0,C=0,S=0;function _(t,i){let a=0,c=0;for(;a<t;){let t=e.charCodeAt(n);if(t>=48&&t<=57)c=16*c+t-48;else if(t>=65&&t<=70)c=16*c+t-65+10;else{if(!(t>=97&&t<=102))break;c=16*c+t-97+10}n++,a++}return a<t&&(c=-1),c}function b(e){n=e,a="",c=0,l=16,S=0}function p(){let t=n;if(48===e.charCodeAt(n))n++;else for(n++;n<e.length&&R(e.charCodeAt(n));)n++;if(n<e.length&&46===e.charCodeAt(n)){if(n++,!(n<e.length&&R(e.charCodeAt(n))))return S=3,e.substring(t,n);for(n++;n<e.length&&R(e.charCodeAt(n));)n++}let i=n;if(n<e.length&&(69===e.charCodeAt(n)||101===e.charCodeAt(n)))if(n++,(n<e.length&&43===e.charCodeAt(n)||45===e.charCodeAt(n))&&n++,n<e.length&&R(e.charCodeAt(n))){for(n++;n<e.length&&R(e.charCodeAt(n));)n++;i=n}else S=3;return e.substring(t,i)}function L(){let t="",a=n;for(;;){if(n>=i){t+=e.substring(a,n),S=2;break}const c=e.charCodeAt(n);if(34===c){t+=e.substring(a,n),n++;break}if(92!==c){if(c>=0&&c<=31){if(M(c)){t+=e.substring(a,n),S=2;break}S=6}n++}else{if(t+=e.substring(a,n),n++,n>=i){S=2;break}switch(e.charCodeAt(n++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:const e=_(4);e>=0?t+=String.fromCharCode(e):S=4;break;default:S=5}a=n}}return t}function A(){if(a="",S=0,c=n,E=y,C=w,n>=i)return c=i,l=17;let t=e.charCodeAt(n);if(ee(t)){do{n++,a+=String.fromCharCode(t),t=e.charCodeAt(n)}while(ee(t));return l=15}if(M(t))return n++,a+=String.fromCharCode(t),13===t&&10===e.charCodeAt(n)&&(n++,a+="\n"),y++,w=n,l=14;switch(t){case 123:return n++,l=1;case 125:return n++,l=2;case 91:return n++,l=3;case 93:return n++,l=4;case 58:return n++,l=6;case 44:return n++,l=5;case 34:return n++,a=L(),l=10;case 47:const E=n-1;if(47===e.charCodeAt(n+1)){for(n+=2;n<i&&!M(e.charCodeAt(n));)n++;return a=e.substring(E,n),l=12}if(42===e.charCodeAt(n+1)){n+=2;const t=i-1;let c=!1;for(;n<t;){const t=e.charCodeAt(n);if(42===t&&47===e.charCodeAt(n+1)){n+=2,c=!0;break}n++,M(t)&&(13===t&&10===e.charCodeAt(n)&&n++,y++,w=n)}return c||(n++,S=1),a=e.substring(E,n),l=13}return a+=String.fromCharCode(t),n++,l=16;case 45:if(a+=String.fromCharCode(t),n++,n===i||!R(e.charCodeAt(n)))return l=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return a+=p(),l=11;default:for(;n<i&&D(t);)n++,t=e.charCodeAt(n);if(c!==n){switch(a=e.substring(c,n),a){case"true":return l=8;case"false":return l=9;case"null":return l=7}return l=16}return a+=String.fromCharCode(t),n++,l=16}}function D(e){if(ee(e)||M(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function x(){let e;do{e=A()}while(e>=12&&e<=15);return e}return r(_,"scanHexDigits"),r(b,"setPosition"),r(p,"scanNumber"),r(L,"scanString"),r(A,"scanNext"),r(D,"isUnknownContentCharacter"),r(x,"scanNextNonTrivia"),{setPosition:b,getPosition:r(()=>n,"getPosition"),scan:t?x:A,getToken:r(()=>l,"getToken"),getTokenValue:r(()=>a,"getTokenValue"),getTokenOffset:r(()=>c,"getTokenOffset"),getTokenLength:r(()=>n-c,"getTokenLength"),getTokenStartLine:r(()=>E,"getTokenStartLine"),getTokenStartCharacter:r(()=>c-C,"getTokenStartCharacter"),getTokenError:r(()=>S,"getTokenError")}}function ee(e){return 32===e||9===e}function M(e){return 10===e||13===e}function R(e){return e>=48&&e<=57}var $,q;r(Ne,"createScanner"),r(ee,"isWhiteSpace"),r(M,"isLineBreak"),r(R,"isDigit"),(q=$||($={}))[q.lineFeed=10]="lineFeed",q[q.carriageReturn=13]="carriageReturn",q[q.space=32]="space",q[q._0=48]="_0",q[q._1=49]="_1",q[q._2=50]="_2",q[q._3=51]="_3",q[q._4=52]="_4",q[q._5=53]="_5",q[q._6=54]="_6",q[q._7=55]="_7",q[q._8=56]="_8",q[q._9=57]="_9",q[q.a=97]="a",q[q.b=98]="b",q[q.c=99]="c",q[q.d=100]="d",q[q.e=101]="e",q[q.f=102]="f",q[q.g=103]="g",q[q.h=104]="h",q[q.i=105]="i",q[q.j=106]="j",q[q.k=107]="k",q[q.l=108]="l",q[q.m=109]="m",q[q.n=110]="n",q[q.o=111]="o",q[q.p=112]="p",q[q.q=113]="q",q[q.r=114]="r",q[q.s=115]="s",q[q.t=116]="t",q[q.u=117]="u",q[q.v=118]="v",q[q.w=119]="w",q[q.x=120]="x",q[q.y=121]="y",q[q.z=122]="z",q[q.A=65]="A",q[q.B=66]="B",q[q.C=67]="C",q[q.D=68]="D",q[q.E=69]="E",q[q.F=70]="F",q[q.G=71]="G",q[q.H=72]="H",q[q.I=73]="I",q[q.J=74]="J",q[q.K=75]="K",q[q.L=76]="L",q[q.M=77]="M",q[q.N=78]="N",q[q.O=79]="O",q[q.P=80]="P",q[q.Q=81]="Q",q[q.R=82]="R",q[q.S=83]="S",q[q.T=84]="T",q[q.U=85]="U",q[q.V=86]="V",q[q.W=87]="W",q[q.X=88]="X",q[q.Y=89]="Y",q[q.Z=90]="Z",q[q.asterisk=42]="asterisk",q[q.backslash=92]="backslash",q[q.closeBrace=125]="closeBrace",q[q.closeBracket=93]="closeBracket",q[q.colon=58]="colon",q[q.comma=44]="comma",q[q.dot=46]="dot",q[q.doubleQuote=34]="doubleQuote",q[q.minus=45]="minus",q[q.openBrace=123]="openBrace",q[q.openBracket=91]="openBracket",q[q.plus=43]="plus",q[q.slash=47]="slash",q[q.formFeed=12]="formFeed",q[q.tab=9]="tab",new Array(20).fill(0).map((e,t)=>" ".repeat(t));const W=200;var K,H,Y;function Pe(e,t=[],i=K.DEFAULT){let n=null,a=[];const c=[];function o(e){Array.isArray(a)?a.push(e):null!==n&&(a[n]=e)}return r(o,"onValue"),We(e,{onObjectBegin:r(()=>{const e={};o(e),c.push(a),a=e,n=null},"onObjectBegin"),onObjectProperty:r(e=>{n=e},"onObjectProperty"),onObjectEnd:r(()=>{a=c.pop()},"onObjectEnd"),onArrayBegin:r(()=>{const e=[];o(e),c.push(a),a=e,n=null},"onArrayBegin"),onArrayEnd:r(()=>{a=c.pop()},"onArrayEnd"),onLiteralValue:o,onError:r((e,i,n)=>{t.push({error:e,offset:i,length:n})},"onError")},i),a[0]}function We(e,t,i=K.DEFAULT){const n=Ne(e,!1),a=[];let c=0;function o(e){return e?()=>0===c&&e(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function f(e){return e?t=>0===c&&e(t,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function u(e){return e?t=>0===c&&e(t,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>a.slice()):()=>!0}function g(e){return e?()=>{c>0?c++:!1===e(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>a.slice())&&(c=1)}:()=>!0}function m(e){return e?()=>{c>0&&c--,0===c&&e(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}r(o,"toNoArgVisit"),r(f,"toOneArgVisit"),r(u,"toOneArgVisitWithPath"),r(g,"toBeginVisit"),r(m,"toEndVisit");const l=g(t.onObjectBegin),y=u(t.onObjectProperty),E=m(t.onObjectEnd),w=g(t.onArrayBegin),C=m(t.onArrayEnd),S=u(t.onLiteralValue),I=f(t.onSeparator),N=o(t.onComment),O=f(t.onError),j=i&&i.disallowComments,F=i&&i.allowTrailingComma;function T(){for(;;){const e=n.scan();switch(n.getTokenError()){case 4:k(14);break;case 5:k(15);break;case 3:k(13);break;case 1:j||k(11);break;case 2:k(12);break;case 6:k(16)}switch(e){case 12:case 13:j?k(10):N();break;case 16:k(1);break;case 15:case 14:break;default:return e}}}function k(e,t=[],i=[]){if(O(e),t.length+i.length>0){let e=n.getToken();for(;17!==e;){if(-1!==t.indexOf(e)){T();break}if(-1!==i.indexOf(e))break;e=T()}}}function P(e){const t=n.getTokenValue();return e?S(t):(y(t),a.push(t)),T(),!0}function J(){switch(n.getToken()){case 11:const e=n.getTokenValue();let t=Number(e);isNaN(t)&&(k(2),t=0),S(t);break;case 7:S(null);break;case 8:S(!0);break;case 9:S(!1);break;default:return!1}return T(),!0}function V(){return 10!==n.getToken()?(k(3,[],[2,5]),!1):(P(!1),6===n.getToken()?(I(":"),T(),U()||k(4,[],[2,5])):k(5,[],[2,5]),a.pop(),!0)}function z(){l(),T();let e=!1;for(;2!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(e||k(4,[],[]),I(","),T(),2===n.getToken()&&F)break}else e&&k(6,[],[]);V()||k(4,[],[2,5]),e=!0}return E(),2!==n.getToken()?k(7,[2],[]):T(),!0}function G(){w(),T();let e=!0,t=!1;for(;4!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(t||k(4,[],[]),I(","),T(),4===n.getToken()&&F)break}else t&&k(6,[],[]);e?(a.push(0),e=!1):a[a.length-1]++,U()||k(4,[],[4,5]),t=!0}return C(),e||a.pop(),4!==n.getToken()?k(8,[4],[]):T(),!0}function U(){switch(n.getToken()){case 3:return G();case 1:return z();case 10:return P(!0);default:return J()}}return r(T,"scanNext"),r(k,"handleError"),r(P,"parseString"),r(J,"parseLiteral"),r(V,"parseProperty"),r(z,"parseObject"),r(G,"parseArray"),r(U,"parseValue"),T(),17===n.getToken()?!!i.allowEmptyContent||(k(4,[],[]),!1):U()?(17!==n.getToken()&&k(9,[],[]),!0):(k(4,[],[]),!1)}new Array(W).fill(0).map((e,t)=>"\n"+" ".repeat(t)),new Array(W).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(W).fill(0).map((e,t)=>"\r\n"+" ".repeat(t)),new Array(W).fill(0).map((e,t)=>"\n"+"\t".repeat(t)),new Array(W).fill(0).map((e,t)=>"\r"+"\t".repeat(t)),new Array(W).fill(0).map((e,t)=>"\r\n"+"\t".repeat(t)),function(e){e.DEFAULT={allowTrailingComma:!1}}(K||(K={})),r(Pe,"parse$1"),r(We,"visit"),function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(H||(H={})),function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"}(Y||(Y={}));const Q=Pe;var Z;!function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"}(Z||(Z={}));const X=r((e,t)=>Q(N(t,e,"utf8")),"readJsonc"),te=Symbol("implicitBaseUrl"),ie="${configDir}",se=r(()=>{const{findPnpApi:e}=l;return e&&e(process.cwd())},"getPnpApi"),re=r((e,t,i,n)=>{const c=`resolveFromPackageJsonPath:${e}:${t}:${i}`;if(null!=n&&n.has(c))return n.get(c);const l=X(e,n);if(!l)return;let E=t||"tsconfig.json";if(!i&&l.exports)try{const[e]=y.resolveExports(l.exports,t,["require","types"]);E=e}catch{return!1}else!t&&l.tsconfig&&(E=l.tsconfig);return E=a.join(e,"..",E),null==n||n.set(c,E),E},"resolveFromPackageJsonPath"),ne="package.json",ae="tsconfig.json",oe=r((e,t,i)=>{let n=e;if(".."===e&&(n=a.join(n,ae)),"."===e[0]&&(n=a.resolve(t,n)),a.isAbsolute(n)){if(I(i,n)){if(O(i,n).isFile())return n}else if(!n.endsWith(".json")){const e=`${n}.json`;if(I(i,e))return e}return}const[c,...l]=e.split("/"),y="@"===c[0]?`${c}/${l.shift()}`:c,E=l.join("/"),w=se();if(w){const{resolveRequest:n}=w;try{if(y===e){const e=n(a.join(y,ne),t);if(e){const t=re(e,E,!1,i);if(t&&I(i,t))return t}}else{let i;try{i=n(e,t,{extensions:[".json"]})}catch{i=n(a.join(e,ae),t)}if(i)return i}}catch{}}const C=j(a.resolve(t),a.join("node_modules",y),i);if(!C||!O(i,C).isDirectory())return;const S=a.join(C,ne);if(I(i,S)){const e=re(S,E,!1,i);if(!1===e)return;if(e&&I(i,e)&&O(i,e).isFile())return e}const N=a.join(C,E),F=N.endsWith(".json");if(!F){const e=`${N}.json`;if(I(i,e))return e}if(I(i,N))if(O(i,N).isDirectory()){const e=a.join(N,ne);if(I(i,e)){const t=re(e,"",!0,i);if(t&&I(i,t))return t}const t=a.join(N,ae);if(I(i,t))return t}else if(F)return N},"resolveExtendsPath"),ce=r((e,t)=>B(a.relative(e,t)),"pathRelative"),he=["files","include","exclude"],le=r((e,t,i)=>{const n=a.join(t,i);return h(a.relative(e,n))||"./"},"resolveAndRelativize"),pe=r((e,t,i)=>{const n=a.relative(e,t);if(!n)return i;return h(`${n}/${i.startsWith("./")?i.slice(2):i}`)},"prefixPattern"),ue=r((e,t,i,n)=>{const c=oe(e,t,n);if(!c)throw new Error(`File '${e}' not found.`);if(i.has(c))throw new Error(`Circularity detected while resolving configuration: ${c}`);i.add(c);const l=a.dirname(c),y=fe(c,n,i);delete y.references;const{compilerOptions:E}=y;if(E){const{baseUrl:e}=E;e&&!e.startsWith(ie)&&(E.baseUrl=le(t,l,e));const{outDir:i}=E;i&&!i.startsWith(ie)&&(E.outDir=le(t,l,i));const{declarationDir:n}=E;n&&!n.startsWith(ie)&&(E.declarationDir=le(t,l,n));const{rootDir:a}=E;a&&!a.startsWith(ie)&&(E.rootDir=le(t,l,a));const{rootDirs:c}=E;c&&(E.rootDirs=c.map(e=>e.startsWith(ie)?e:le(t,l,e)));const{typeRoots:y}=E;y&&(E.typeRoots=y.map(e=>e.startsWith(ie)?e:le(t,l,e)))}for(const e of he){const i=y[e];i&&(y[e]=i.map(e=>e.startsWith(ie)?e:pe(t,l,e)))}return y},"resolveExtends"),de=["outDir","declarationDir"],fe=r((e,t,i=new Set)=>{let n;try{n=X(e,t)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if("object"!=typeof n)throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const c=a.dirname(e);if(n.compilerOptions){const{compilerOptions:e}=n;e.paths&&!e.baseUrl&&(e[te]=c)}if(n.extends){const e=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const a of e.reverse()){const e=ue(a,c,new Set(i),t),l={...e,...n,compilerOptions:{...e.compilerOptions,...n.compilerOptions}};e.watchOptions&&(l.watchOptions={...e.watchOptions,...n.watchOptions}),n=l}}if(n.compilerOptions){const{compilerOptions:e}=n,t=["baseUrl","rootDir"];for(const i of t){const t=e[i];if(t&&!t.startsWith(ie)){const n=a.resolve(c,t),l=ce(c,n);e[i]=l}}for(const t of de){let i=e[t];i&&(Array.isArray(n.exclude)||(n.exclude=de.map(t=>e[t]).filter(Boolean)),i.startsWith(ie)||(i=B(i)),e[t]=i)}}else n.compilerOptions={};if(n.include&&(n.include=n.include.map(h)),n.files&&(n.files=n.files.map(e=>e.startsWith(ie)?e:B(e))),n.watchOptions){const{watchOptions:e}=n;e.excludeDirectories&&(e.excludeDirectories=e.excludeDirectories.map(e=>h(a.resolve(c,e)))),e.excludeFiles&&(e.excludeFiles=e.excludeFiles.map(e=>h(a.resolve(c,e)))),e.watchFile&&(e.watchFile=e.watchFile.toLowerCase()),e.watchDirectory&&(e.watchDirectory=e.watchDirectory.toLowerCase()),e.fallbackPolling&&(e.fallbackPolling=e.fallbackPolling.toLowerCase())}return n},"_parseTsconfig"),me=r((e,t)=>{if(e.startsWith(ie))return h(a.join(t,e.slice(12)))},"interpolateConfigDir"),ge=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],xe=r(e=>{if(e.strict){const t=["noImplicitAny","noImplicitThis","strictNullChecks","strictFunctionTypes","strictBindCallApply","strictPropertyInitialization","strictBuiltinIteratorReturn","alwaysStrict","useUnknownInCatchVariables"];for(const i of t)void 0===e[i]&&(e[i]=!0)}if(e.composite&&(null!=e.declaration||(e.declaration=!0),null!=e.incremental||(e.incremental=!0)),e.target){let t=e.target.toLowerCase();"es2015"===t&&(t="es6"),e.target=t,"esnext"===t&&(null!=e.module||(e.module="es6"),null!=e.useDefineForClassFields||(e.useDefineForClassFields=!0)),("es6"===t||"es2016"===t||"es2017"===t||"es2018"===t||"es2019"===t||"es2020"===t||"es2021"===t||"es2022"===t||"es2023"===t||"es2024"===t)&&(null!=e.module||(e.module="es6")),("es2022"===t||"es2023"===t||"es2024"===t)&&(null!=e.useDefineForClassFields||(e.useDefineForClassFields=!0))}if(e.module){let t=e.module.toLowerCase();if("es2015"===t&&(t="es6"),e.module=t,("es6"===t||"es2020"===t||"es2022"===t||"esnext"===t||"none"===t||"system"===t||"umd"===t||"amd"===t)&&(null!=e.moduleResolution||(e.moduleResolution="classic")),"system"===t&&(null!=e.allowSyntheticDefaultImports||(e.allowSyntheticDefaultImports=!0)),("node16"===t||"node18"===t||"node20"===t||"nodenext"===t||"preserve"===t)&&(null!=e.esModuleInterop||(e.esModuleInterop=!0),null!=e.allowSyntheticDefaultImports||(e.allowSyntheticDefaultImports=!0)),("node16"===t||"node18"===t||"node20"===t||"nodenext"===t)&&(null!=e.moduleDetection||(e.moduleDetection="force")),"node16"===t&&(null!=e.target||(e.target="es2022"),null!=e.moduleResolution||(e.moduleResolution="node16")),"node18"===t&&(null!=e.target||(e.target="es2022"),null!=e.moduleResolution||(e.moduleResolution="node16")),"node20"===t&&(null!=e.target||(e.target="es2023"),null!=e.moduleResolution||(e.moduleResolution="node16"),null!=e.resolveJsonModule||(e.resolveJsonModule=!0)),"nodenext"===t&&(null!=e.target||(e.target="esnext"),null!=e.moduleResolution||(e.moduleResolution="nodenext"),null!=e.resolveJsonModule||(e.resolveJsonModule=!0)),"node16"===t||"node18"===t||"node20"===t||"nodenext"===t){const t=e.target;("es3"===t||"es2022"===t||"es2023"===t||"es2024"===t||"esnext"===t)&&(null!=e.useDefineForClassFields||(e.useDefineForClassFields=!0))}"preserve"===t&&(null!=e.moduleResolution||(e.moduleResolution="bundler"))}if(e.moduleResolution){let t=e.moduleResolution.toLowerCase();"node"===t&&(t="node10"),e.moduleResolution=t,("node16"===t||"nodenext"===t||"bundler"===t)&&(null!=e.resolvePackageJsonExports||(e.resolvePackageJsonExports=!0),null!=e.resolvePackageJsonImports||(e.resolvePackageJsonImports=!0)),"bundler"===t&&(null!=e.allowSyntheticDefaultImports||(e.allowSyntheticDefaultImports=!0),null!=e.resolveJsonModule||(e.resolveJsonModule=!0))}e.jsx&&(e.jsx=e.jsx.toLowerCase()),e.moduleDetection&&(e.moduleDetection=e.moduleDetection.toLowerCase()),e.importsNotUsedAsValues&&(e.importsNotUsedAsValues=e.importsNotUsedAsValues.toLowerCase()),e.newLine&&(e.newLine=e.newLine.toLowerCase()),e.esModuleInterop&&(null!=e.allowSyntheticDefaultImports||(e.allowSyntheticDefaultImports=!0)),e.verbatimModuleSyntax&&(null!=e.isolatedModules||(e.isolatedModules=!0),null!=e.preserveConstEnums||(e.preserveConstEnums=!0)),e.isolatedModules&&(null!=e.preserveConstEnums||(e.preserveConstEnums=!0)),e.rewriteRelativeImportExtensions&&(null!=e.allowImportingTsExtensions||(e.allowImportingTsExtensions=!0)),e.lib&&(e.lib=e.lib.map(e=>e.toLowerCase())),e.checkJs&&(null!=e.allowJs||(e.allowJs=!0))},"normalizeCompilerOptions"),ve=r((e,t=new Map)=>{const i=a.resolve(e),n=fe(i,t),c=a.dirname(i),{compilerOptions:l}=n;if(l){for(const e of ge){const t=l[e];if(t){const i=me(t,c);l[e]=i?ce(c,i):t}}for(const e of["rootDirs","typeRoots"]){const t=l[e];t&&(l[e]=t.map(e=>{const t=me(e,c);return t?ce(c,t):B(e)}))}const{paths:e}=l;if(e)for(const t of Object.keys(e))e[t]=e[t].map(e=>{var t;return null!=(t=me(e,c))?t:e});xe(l)}for(const e of he){const t=n[e];t&&(n[e]=t.map(e=>{var t;return null!=(t=me(e,c))?t:e}))}return n},"parseTsconfig");var ye=Object.defineProperty,_e=r((e,t)=>ye(e,"name",{value:t,configurable:!0}),"s");const Ee=_e(e=>{let t="";for(let i=0;i<e.length;i+=1){const n=e[i],a=n.toUpperCase();t+=n===a?n.toLowerCase():a}return t},"invertCase"),be=new Map,ke=_e((e,t)=>{const i=C.join(e,`.is-fs-case-sensitive-test-${process.pid}`);try{return t.writeFileSync(i,""),!t.existsSync(Ee(i))}finally{try{t.unlinkSync(i)}catch{}}},"checkDirectoryCaseWithWrite"),we=_e((e,t,i)=>{try{return ke(e,i)}catch(e){if(void 0===t)return ke(w.tmpdir(),i);throw e}},"checkDirectoryCaseWithFallback"),Ce=_e((e,t=E,i=!0)=>{const n=null!=e?e:process.cwd();if(i&&be.has(n))return be.get(n);let a;const c=Ee(n);return a=c!==n&&t.existsSync(n)?!t.existsSync(c):we(n,e,t),i&&be.set(n,a),a},"isFsCaseSensitive"),{join:Se}=a.posix,Ie={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Te=r(e=>{const t=[...Ie.ts],i=[...Ie.cts],n=[...Ie.mts];return null!=e&&e.allowJs&&(t.push(".js",".jsx"),i.push(".cjs"),n.push(".mjs")),[...t,...i,...n]},"getSupportedExtensions"),Re=r(e=>{const t=[];if(!e)return t;const{outDir:i,declarationDir:n}=e;return i&&t.push(i),n&&t.push(n),t},"getDefaultExcludeSpec"),Ae=r(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),Le=`(?!(${["node_modules","bower_components","jspm_packages"].join("|")})(/|$))`,Oe=/(?:^|\/)[^.*?]+$/,De="**/*",Ve="[^/]",Ue="[^./]",Me="win32"===process.platform,je=r(({config:e,path:t},i=Ce())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!a.isAbsolute(t))throw new Error("The tsconfig path must be absolute");Me&&(t=h(t));const n=a.dirname(t),{files:c,include:l,exclude:y,compilerOptions:E}=e,w=r(e=>a.isAbsolute(e)?e:Se(n,e),"resolvePattern"),C=null==c?void 0:c.map(w),S=Te(E),I=i?"":"i",N=(y||Re(E)).map(e=>{const t=w(e),i=Ae(t).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${Ve}*`).replaceAll(String.raw`\?`,Ve);return new RegExp(`^${i}($|/)`,I)}),O=c||l?l:[De],j=O?O.map(e=>{let t=w(e);Oe.test(t)&&(t=Se(t,De));const i=Ae(t).replaceAll(String.raw`/\*\*`,`(/${Le}${Ue}${Ve}*)*?`).replaceAll(/(\/)?\\\*/g,(e,t)=>{const i=`(${Ue}|(\\.(?!min\\.js$))?)*`;return t?`/${Le}${Ue}${i}`:i}).replaceAll(/(\/)?\\\?/g,(e,t)=>t?`/${Le}${Ve}`:Ve);return new RegExp(`^${i}$`,I)}):void 0;return t=>{if(!a.isAbsolute(t))throw new Error("filePath must be absolute");return Me&&(t=h(t)),null!=C&&C.includes(t)||S.some(e=>t.endsWith(e))&&!N.some(e=>e.test(t))&&j&&j.some(e=>e.test(t))?e:void 0}},"createFilesMatcher"),Fe=r((e,t,i)=>{const n=a.resolve(e);let c=h(e);for(;;){const e=j(c,t,i);if(!e)return;const l=a.resolve(e),y=ve(l,i),E={path:h(l),config:y};if(je(E)(n))return E;const w=a.dirname(e),C=a.dirname(w);if(C===w)return;c=C}},"findConfigApplicable"),Be=r((e=process.cwd(),t="tsconfig.json",i=new Map,n=!1)=>{var a;return n?null==(a=Fe(e,t,i))?void 0:a.path:j(h(e),t,i)},"findTsconfig"),$e=r((e=process.cwd(),t="tsconfig.json",i=new Map,n=!1)=>{var a;if(!n){const n=Be(e,t,i);if(!n)return null;return{path:n,config:ve(n,i)}}return null!=(a=Fe(e,t,i))?a:null},"getTsconfig"),qe=/\*/g,Ge=r((e,t)=>{const i=e.match(qe);if(i&&i.length>1)throw new Error(t)},"assertStarCount"),Ke=r(e=>{if(e.includes("*")){const[t,i]=e.split("*");return{prefix:t,suffix:i}}return e},"parsePattern"),He=r(({prefix:e,suffix:t},i)=>i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),ze=r((e,t,i)=>Object.entries(e).map(([e,n])=>(Ge(e,`Pattern '${e}' can have at most one '*' character.`),{pattern:Ke(e),substitutions:n.map(n=>{if(Ge(n,`Substitution '${n}' in pattern '${e}' can have at most one '*' character.`),!t&&!F.test(n)&&!a.isAbsolute(n))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return a.resolve(i,n)})})),"parsePaths"),Je=r(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:i,paths:n}=t;if(!i&&!n)return null;const c=te in t&&t[te],l=a.resolve(a.dirname(e.path),i||c||"."),y=n?ze(n,i,l):[];return e=>{if(F.test(e))return[];const t=[];for(const i of y){if(i.pattern===e)return i.substitutions.map(h);"string"!=typeof i.pattern&&t.push(i)}let n,c=-1;for(const i of t)He(i.pattern,e)&&i.pattern.prefix.length>c&&(c=i.pattern.prefix.length,n=i);if(!n)return i?[h(a.join(l,e))]:[];const E=e.slice(n.pattern.prefix.length,e.length-n.pattern.suffix.length);return n.substitutions.map(e=>h(e.replace("*",E)))}},"createPathsMatcher");t.createPathsMatcher=Je,t.getTsconfig=$e},"./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const d=e=>null!==e&&"object"==typeof e,s=(e,t)=>Object.assign(new Error(`[${e}]: ${t}`),{code:e}),i="ERR_INVALID_PACKAGE_CONFIG",n="ERR_INVALID_PACKAGE_TARGET",a=/^\d+$/,c=/^(\.{1,2}|node_modules)$/i,l=/\/|\\/;var y,E=((y=E||{}).Export="exports",y.Import="imports",y);const f=(e,t,y,E,w)=>{if(null==t)return[];if("string"==typeof t){const[i,...a]=t.split(l);if(".."===i||a.some(e=>c.test(e)))throw s(n,`Invalid "${e}" target "${t}" defined in the package config`);return[w?t.replace(/\*/g,w):t]}if(Array.isArray(t))return t.flatMap(t=>f(e,t,y,E,w));if(d(t)){for(const n of Object.keys(t)){if(a.test(n))throw s(i,"Cannot contain numeric property keys");if("default"===n||E.includes(n))return f(e,t[n],y,E,w)}return[]}throw s(n,`Invalid "${e}" target "${t}"`)},w="*",v=(e,t)=>{const i=e.indexOf(w),n=t.indexOf(w);return i===n?t.length>e.length:n>i};function A(e,t){if(!t.includes(w)&&e.hasOwnProperty(t))return[t];let i,n;for(const a of Object.keys(e))if(a.includes(w)){const[e,c,l]=a.split(w);if(void 0===l&&t.startsWith(e)&&t.endsWith(c)){const l=t.slice(e.length,-c.length||void 0);l&&(!i||v(i,a))&&(i=a,n=l)}}return[i,n]}const C=/^\w+:/;t.resolveExports=(e,t,a)=>{if(!e)throw new Error('"exports" is required');t=""===t?".":`./${t}`,("string"==typeof e||Array.isArray(e)||d(e)&&(e=>Object.keys(e).reduce((e,t)=>{const n=""===t||"."!==t[0];if(void 0===e||e===n)return n;throw s(i,'"exports" cannot contain some keys starting with "." and some not')},void 0))(e))&&(e={".":e});const[c,l]=A(e,t),y=f(E.Export,e[c],t,a,l);if(0===y.length)throw s("ERR_PACKAGE_PATH_NOT_EXPORTED","."===t?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const e of y)if(!e.startsWith("./")&&!C.test(e))throw s(n,`Invalid "exports" target "${e}" defined in the package config`);return y},t.resolveImports=(e,t,i)=>{if(!e)throw new Error('"imports" is required');const[n,a]=A(e,t),c=f(E.Import,e[n],t,i,a);if(0===c.length)throw s("ERR_PACKAGE_IMPORT_NOT_DEFINED",`Package import specifier "${t}" is not defined in package`);return c}}},t={};function __nested_rspack_require_27261__(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,__nested_rspack_require_27261__),a.exports}__nested_rspack_require_27261__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __nested_rspack_require_27261__.d(t,{a:t}),t},__nested_rspack_require_27261__.d=(e,t)=>{for(var i in t)__nested_rspack_require_27261__.o(t,i)&&!__nested_rspack_require_27261__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__nested_rspack_require_27261__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};(()=>{"use strict";__nested_rspack_require_27261__.d(i,{default:()=>createJiti});const e=__webpack_require__(8161);var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],a="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",c={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},l="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",y={5:l,"5module":l+" export import",6:l+" const class extends export import super"},E=/^in(stanceof)?$/,w=new RegExp("["+a+"]"),C=new RegExp("["+a+"·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function isInAstralSet(e,t){for(var i=65536,n=0;n<t.length;n+=2){if((i+=t[n])>e)return!1;if((i+=t[n+1])>=e)return!0}return!1}function isIdentifierStart(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&w.test(String.fromCharCode(e)):!1!==t&&isInAstralSet(e,n)))}function isIdentifierChar(e,i){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&C.test(String.fromCharCode(e)):!1!==i&&(isInAstralSet(e,n)||isInAstralSet(e,t)))))}var acorn_TokenType=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function binop(e,t){return new acorn_TokenType(e,{beforeExpr:!0,binop:t})}var S={beforeExpr:!0},I={startsExpr:!0},N={};function kw(e,t){return void 0===t&&(t={}),t.keyword=e,N[e]=new acorn_TokenType(e,t)}var O={num:new acorn_TokenType("num",I),regexp:new acorn_TokenType("regexp",I),string:new acorn_TokenType("string",I),name:new acorn_TokenType("name",I),privateId:new acorn_TokenType("privateId",I),eof:new acorn_TokenType("eof"),bracketL:new acorn_TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new acorn_TokenType("]"),braceL:new acorn_TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new acorn_TokenType("}"),parenL:new acorn_TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new acorn_TokenType(")"),comma:new acorn_TokenType(",",S),semi:new acorn_TokenType(";",S),colon:new acorn_TokenType(":",S),dot:new acorn_TokenType("."),question:new acorn_TokenType("?",S),questionDot:new acorn_TokenType("?."),arrow:new acorn_TokenType("=>",S),template:new acorn_TokenType("template"),invalidTemplate:new acorn_TokenType("invalidTemplate"),ellipsis:new acorn_TokenType("...",S),backQuote:new acorn_TokenType("`",I),dollarBraceL:new acorn_TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new acorn_TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new acorn_TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new acorn_TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new acorn_TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new acorn_TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new acorn_TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",S),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",S),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",S),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",I),_if:kw("if"),_return:kw("return",S),_switch:kw("switch"),_throw:kw("throw",S),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",I),_super:kw("super",I),_class:kw("class",I),_extends:kw("extends",S),_export:kw("export"),_import:kw("import",I),_null:kw("null",I),_true:kw("true",I),_false:kw("false",I),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},j=/\r\n?|\n|\u2028|\u2029/,F=new RegExp(j.source,"g");function isNewLine(e){return 10===e||13===e||8232===e||8233===e}function nextLineBreak(e,t,i){void 0===i&&(i=e.length);for(var n=t;n<i;n++){var a=e.charCodeAt(n);if(isNewLine(a))return n<i-1&&13===a&&10===e.charCodeAt(n+1)?n+2:n+1}return-1}var B=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,$=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,q=Object.prototype,W=q.hasOwnProperty,K=q.toString,H=Object.hasOwn||function(e,t){return W.call(e,t)},Y=Array.isArray||function(e){return"[object Array]"===K.call(e)},Q=Object.create(null);function wordsRegexp(e){return Q[e]||(Q[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var Z=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,acorn_Position=function(e,t){this.line=e,this.column=t};acorn_Position.prototype.offset=function(e){return new acorn_Position(this.line,this.column+e)};var acorn_SourceLocation=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function getLineInfo(e,t){for(var i=1,n=0;;){var a=nextLineBreak(e,n,t);if(a<0)return new acorn_Position(i,t-n);++i,n=a}}var X={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},te=!1;function getOptions(e){var t={};for(var i in X)t[i]=e&&H(e,i)?e[i]:X[i];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!te&&"object"==typeof console&&console.warn&&(te=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),Y(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}if(Y(t.onComment)&&(t.onComment=function(e,t){return function(i,n,a,c,l,y){var E={type:i?"Block":"Line",value:n,start:a,end:c};e.locations&&(E.loc=new acorn_SourceLocation(this,l,y)),e.ranges&&(E.range=[a,c]),t.push(E)}}(t,t.onComment)),"commonjs"===t.sourceType&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}var ie=256,se=259;function functionFlags(e,t){return 2|(e?4:0)|(t?8:0)}var acorn_Parser=function(e,t,i){this.options=e=getOptions(e),this.sourceFile=e.sourceFile,this.keywords=wordsRegexp(y[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var n="";!0!==e.allowReserved&&(n=c[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(n+=" await")),this.reservedWords=wordsRegexp(n);var a=(n?n+" ":"")+c.strict;this.reservedWordsStrict=wordsRegexp(a),this.reservedWordsStrictBind=wordsRegexp(a+" "+c.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(j).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=O.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope("commonjs"===this.options.sourceType?2:1),this.regexpState=null,this.privateNameStack=[]},re={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};acorn_Parser.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},re.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},re.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},re.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},re.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},re.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},re.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},re.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},re.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},re.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},re.allowUsing.get=function(){var e=this.currentScope().flags;return!(1024&e)&&!(!this.inModule&&1&e)},re.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ie)>0},acorn_Parser.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n<e.length;n++)i=e[n](i);return i},acorn_Parser.parse=function(e,t){return new this(t,e).parse()},acorn_Parser.parseExpressionAt=function(e,t,i){var n=new this(i,e,t);return n.nextToken(),n.parseExpression()},acorn_Parser.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(acorn_Parser.prototype,re);var ne=acorn_Parser.prototype,ae=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;ne.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){$.lastIndex=e,e+=$.exec(this.input)[0].length;var t=ae.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){$.lastIndex=e+t[0].length;var i=$.exec(this.input),n=i.index+i[0].length,a=this.input.charAt(n);return";"===a||"}"===a||j.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(a)||"!"===a&&"="===this.input.charAt(n+1))}e+=t[0].length,$.lastIndex=e,e+=$.exec(this.input)[0].length,";"===this.input[e]&&e++}},ne.eat=function(e){return this.type===e&&(this.next(),!0)},ne.isContextual=function(e){return this.type===O.name&&this.value===e&&!this.containsEsc},ne.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},ne.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},ne.canInsertSemicolon=function(){return this.type===O.eof||this.type===O.braceR||j.test(this.input.slice(this.lastTokEnd,this.start))},ne.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ne.semicolon=function(){this.eat(O.semi)||this.insertSemicolon()||this.unexpected()},ne.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},ne.expect=function(e){this.eat(e)||this.unexpected()},ne.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var acorn_DestructuringErrors=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ne.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},ne.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},ne.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},ne.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var oe=acorn_Parser.prototype;oe.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==O.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var n=0,a=Object.keys(this.undefinedExports);n<a.length;n+=1){var c=a[n];this.raiseRecoverable(this.undefinedExports[c].start,"Export '"+c+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType="commonjs"===this.options.sourceType?"script":this.options.sourceType,this.finishNode(e,"Program")};var ce={kind:"loop"},he={kind:"switch"};oe.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;$.lastIndex=this.pos;var t=$.exec(this.input),i=this.pos+t[0].length,n=this.fullCharCodeAt(i);if(91===n||92===n)return!0;if(e)return!1;if(123===n)return!0;if(isIdentifierStart(n)){var a=i;do{i+=n<=65535?1:2}while(isIdentifierChar(n=this.fullCharCodeAt(i)));if(92===n)return!0;var c=this.input.slice(a,i);if(!E.test(c))return!0}return!1},oe.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;$.lastIndex=this.pos;var e,t=$.exec(this.input),i=this.pos+t[0].length;return!(j.test(this.input.slice(this.pos,i))||"function"!==this.input.slice(i,i+8)||i+8!==this.input.length&&(isIdentifierChar(e=this.fullCharCodeAt(i+8))||92===e))},oe.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;$.lastIndex=this.pos;var i=$.exec(this.input),n=this.pos+i[0].length;if(j.test(this.input.slice(this.pos,n)))return!1;if(e){var a,c=n+5;if("using"!==this.input.slice(n,c)||c===this.input.length||isIdentifierChar(a=this.fullCharCodeAt(c))||92===a)return!1;$.lastIndex=c;var l=$.exec(this.input);if(n=c+l[0].length,l&&j.test(this.input.slice(c,n)))return!1}var y=this.fullCharCodeAt(n);if(!isIdentifierStart(y)&&92!==y)return!1;var w=n;do{n+=y<=65535?1:2}while(isIdentifierChar(y=this.fullCharCodeAt(n)));if(92===y)return!0;var C=this.input.slice(w,n);return!(E.test(C)||t&&"of"===C)},oe.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},oe.isUsing=function(e){return this.isUsingKeyword(!1,e)},oe.parseStatement=function(e,t,i){var n,a=this.type,c=this.startNode();switch(this.isLet(e)&&(a=O._var,n="let"),a){case O._break:case O._continue:return this.parseBreakContinueStatement(c,a.keyword);case O._debugger:return this.parseDebuggerStatement(c);case O._do:return this.parseDoStatement(c);case O._for:return this.parseForStatement(c);case O._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(c,!1,!e);case O._class:return e&&this.unexpected(),this.parseClass(c,!0);case O._if:return this.parseIfStatement(c);case O._return:return this.parseReturnStatement(c);case O._switch:return this.parseSwitchStatement(c);case O._throw:return this.parseThrowStatement(c);case O._try:return this.parseTryStatement(c);case O._const:case O._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(c,n);case O._while:return this.parseWhileStatement(c);case O._with:return this.parseWithStatement(c);case O.braceL:return this.parseBlock(!0,c);case O.semi:return this.parseEmptyStatement(c);case O._export:case O._import:if(this.options.ecmaVersion>10&&a===O._import){$.lastIndex=this.pos;var l=$.exec(this.input),y=this.pos+l[0].length,E=this.input.charCodeAt(y);if(40===E||46===E)return this.parseExpressionStatement(c,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),a===O._import?this.parseImport(c):this.parseExport(c,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(c,!0,!e);var w=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(w)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),"await using"===w&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(c,!1,w),this.semicolon(),this.finishNode(c,"VariableDeclaration");var C=this.value,S=this.parseExpression();return a===O.name&&"Identifier"===S.type&&this.eat(O.colon)?this.parseLabeledStatement(c,C,S,e):this.parseExpressionStatement(c,S)}},oe.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(O.semi)||this.insertSemicolon()?e.label=null:this.type!==O.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var a=this.labels[n];if(null==e.label||a.name===e.label.name){if(null!=a.kind&&(i||"loop"===a.kind))break;if(e.label&&i)break}}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},oe.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},oe.parseDoStatement=function(e){return this.next(),this.labels.push(ce),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(O._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(O.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},oe.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ce),this.enterScope(0),this.expect(O.parenL),this.type===O.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===O._var||this.type===O._const||i){var n=this.startNode(),a=i?"let":this.value;return this.next(),this.parseVar(n,!0,a),this.finishNode(n,"VariableDeclaration"),this.parseForAfterInit(e,n,t)}var c=this.isContextual("let"),l=!1,y=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(y){var E=this.startNode();return this.next(),"await using"===y&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(E,!0,y),this.finishNode(E,"VariableDeclaration"),this.parseForAfterInit(e,E,t)}var w=this.containsEsc,C=new acorn_DestructuringErrors,S=this.start,I=t>-1?this.parseExprSubscripts(C,"await"):this.parseExpression(!0,C);return this.type===O._in||(l=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===O._in&&this.unexpected(t),e.await=!0):l&&this.options.ecmaVersion>=8&&(I.start!==S||w||"Identifier"!==I.type||"async"!==I.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),c&&l&&this.raise(I.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(I,!1,C),this.checkLValPattern(I),this.parseForIn(e,I)):(this.checkExpressionErrors(C,!0),t>-1&&this.unexpected(t),this.parseFor(e,I))},oe.parseForAfterInit=function(e,t,i){return(this.type===O._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===O._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))},oe.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,pe|(i?0:ue),!1,t)},oe.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(O._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},oe.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(O.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},oe.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(O.braceL),this.labels.push(he),this.enterScope(1024);for(var i=!1;this.type!==O.braceR;)if(this.type===O._case||this.type===O._default){var n=this.type===O._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(O.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},oe.parseThrowStatement=function(e){return this.next(),j.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var le=[];oe.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(O.parenR),e},oe.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===O._catch){var t=this.startNode();this.next(),this.eat(O.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(O._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},oe.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},oe.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(ce),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},oe.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},oe.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},oe.parseLabeledStatement=function(e,t,i,n){for(var a=0,c=this.labels;a<c.length;a+=1){c[a].name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var l=this.type.isLoop?"loop":this.type===O._switch?"switch":null,y=this.labels.length-1;y>=0;y--){var E=this.labels[y];if(E.statementStart!==e.start)break;E.statementStart=this.start,E.kind=l}return this.labels.push({name:t,kind:l,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},oe.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},oe.parseBlock=function(e,t,i){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(O.braceL),e&&this.enterScope(0);this.type!==O.braceR;){var n=this.parseStatement(null);t.body.push(n)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},oe.parseFor=function(e,t){return e.init=t,this.expect(O.semi),e.test=this.type===O.semi?null:this.parseExpression(),this.expect(O.semi),e.update=this.type===O.parenR?null:this.parseExpression(),this.expect(O.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},oe.parseForIn=function(e,t){var i=this.type===O._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(O.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},oe.parseVar=function(e,t,i,n){for(e.declarations=[],e.kind=i;;){var a=this.startNode();if(this.parseVarId(a,i),this.eat(O.eq)?a.init=this.parseMaybeAssign(t):n||"const"!==i||this.type===O._in||this.options.ecmaVersion>=6&&this.isContextual("of")?n||"using"!==i&&"await using"!==i||!(this.options.ecmaVersion>=17)||this.type===O._in||this.isContextual("of")?n||"Identifier"===a.id.type||t&&(this.type===O._in||this.isContextual("of"))?a.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(O.comma))break}return e},oe.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var pe=1,ue=2;function isPrivateNameConflicted(e,t){var i=t.key.name,n=e[i],a="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(a=(t.static?"s":"i")+t.kind),"iget"===n&&"iset"===a||"iset"===n&&"iget"===a||"sget"===n&&"sset"===a||"sset"===n&&"sget"===a?(e[i]="true",!1):!!n||(e[i]=a,!1)}function checkKeyName(e,t){var i=e.computed,n=e.key;return!i&&("Identifier"===n.type&&n.name===t||"Literal"===n.type&&n.value===t)}oe.parseFunction=function(e,t,i,n,a){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===O.star&&t&ue&&this.unexpected(),e.generator=this.eat(O.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&pe&&(e.id=4&t&&this.type!==O.name?null:this.parseIdent(),!e.id||t&ue||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var c=this.yieldPos,l=this.awaitPos,y=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(e.async,e.generator)),t&pe||(e.id=this.type===O.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,a),this.yieldPos=c,this.awaitPos=l,this.awaitIdentPos=y,this.finishNode(e,t&pe?"FunctionDeclaration":"FunctionExpression")},oe.parseFunctionParams=function(e){this.expect(O.parenL),e.params=this.parseBindingList(O.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},oe.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),a=this.startNode(),c=!1;for(a.body=[],this.expect(O.braceL);this.type!==O.braceR;){var l=this.parseClassElement(null!==e.superClass);l&&(a.body.push(l),"MethodDefinition"===l.type&&"constructor"===l.kind?(c&&this.raiseRecoverable(l.start,"Duplicate constructor in the same class"),c=!0):l.key&&"PrivateIdentifier"===l.key.type&&isPrivateNameConflicted(n,l)&&this.raiseRecoverable(l.key.start,"Identifier '#"+l.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(a,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},oe.parseClassElement=function(e){if(this.eat(O.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),n="",a=!1,c=!1,l="method",y=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(O.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===O.star?y=!0:n="static"}if(i.static=y,!n&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==O.star||this.canInsertSemicolon()?n="async":c=!0),!n&&(t>=9||!c)&&this.eat(O.star)&&(a=!0),!n&&!c&&!a){var E=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?l=E:n=E)}if(n?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=n,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===O.parenL||"method"!==l||a||c){var w=!i.static&&checkKeyName(i,"constructor"),C=w&&e;w&&"method"!==l&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=w?"constructor":l,this.parseClassMethod(i,a,c,C)}else this.parseClassField(i);return i},oe.isClassElementNameStart=function(){return this.type===O.name||this.type===O.privateId||this.type===O.num||this.type===O.string||this.type===O.bracketL||this.type.keyword},oe.parseClassElementName=function(e){this.type===O.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},oe.parseClassMethod=function(e,t,i,n){var a=e.key;"constructor"===e.kind?(t&&this.raise(a.start,"Constructor can't be a generator"),i&&this.raise(a.start,"Constructor can't be an async method")):e.static&&checkKeyName(e,"prototype")&&this.raise(a.start,"Classes may not have a static property named prototype");var c=e.value=this.parseMethod(t,i,n);return"get"===e.kind&&0!==c.params.length&&this.raiseRecoverable(c.start,"getter should have no params"),"set"===e.kind&&1!==c.params.length&&this.raiseRecoverable(c.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===c.params[0].type&&this.raiseRecoverable(c.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},oe.parseClassField=function(e){return checkKeyName(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&checkKeyName(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(O.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},oe.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==O.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},oe.parseClassId=function(e,t){this.type===O.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},oe.parseClassSuper=function(e){e.superClass=this.eat(O._extends)?this.parseExprSubscripts(null,!1):null},oe.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},oe.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,a=0===n?null:this.privateNameStack[n-1],c=0;c<i.length;++c){var l=i[c];H(t,l.name)||(a?a.used.push(l):this.raiseRecoverable(l.start,"Private field '#"+l.name+"' must be declared in an enclosing class"))}},oe.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==O.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},oe.parseExport=function(e,t){if(this.next(),this.eat(O.star))return this.parseExportAllDeclaration(e,t);if(this.eat(O._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==O.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,n=e.specifiers;i<n.length;i+=1){var a=n[i];this.checkUnreserved(a.local),this.checkLocalExport(a.local),"Literal"===a.local.type&&this.raise(a.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},oe.parseExportDeclaration=function(e){return this.parseStatement(null)},oe.parseExportDefaultDeclaration=function(){var e;if(this.type===O._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|pe,!1,e)}if(this.type===O._class){var i=this.startNode();return this.parseClass(i,"nullableID")}var n=this.parseMaybeAssign();return this.semicolon(),n},oe.checkExport=function(e,t,i){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),H(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},oe.checkPatternExport=function(e,t){var i=t.type;if("Identifier"===i)this.checkExport(e,t,t.start);else if("ObjectPattern"===i)for(var n=0,a=t.properties;n<a.length;n+=1){var c=a[n];this.checkPatternExport(e,c)}else if("ArrayPattern"===i)for(var l=0,y=t.elements;l<y.length;l+=1){var E=y[l];E&&this.checkPatternExport(e,E)}else"Property"===i?this.checkPatternExport(e,t.value):"AssignmentPattern"===i?this.checkPatternExport(e,t.left):"RestElement"===i&&this.checkPatternExport(e,t.argument)},oe.checkVariableExport=function(e,t){if(e)for(var i=0,n=t;i<n.length;i+=1){var a=n[i];this.checkPatternExport(e,a.id)}},oe.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},oe.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},oe.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(O.braceL);!this.eat(O.braceR);){if(i)i=!1;else if(this.expect(O.comma),this.afterTrailingComma(O.braceR))break;t.push(this.parseExportSpecifier(e))}return t},oe.parseImport=function(e){return this.next(),this.type===O.string?(e.specifiers=le,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===O.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},oe.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},oe.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},oe.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},oe.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===O.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(O.comma)))return e;if(this.type===O.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(O.braceL);!this.eat(O.braceR);){if(t)t=!1;else if(this.expect(O.comma),this.afterTrailingComma(O.braceR))break;e.push(this.parseImportSpecifier())}return e},oe.parseWithClause=function(){var e=[];if(!this.eat(O._with))return e;this.expect(O.braceL);for(var t={},i=!0;!this.eat(O.braceR);){if(i)i=!1;else if(this.expect(O.comma),this.afterTrailingComma(O.braceR))break;var n=this.parseImportAttribute(),a="Identifier"===n.key.type?n.key.name:n.key.value;H(t,a)&&this.raiseRecoverable(n.key.start,"Duplicate attribute key '"+a+"'"),t[a]=!0,e.push(n)}return e},oe.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===O.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(O.colon),this.type!==O.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},oe.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===O.string){var e=this.parseLiteral(this.value);return Z.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},oe.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},oe.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var de=acorn_Parser.prototype;de.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,a=e.properties;n<a.length;n+=1){var c=a[n];this.toAssignable(c,t),"RestElement"!==c.type||"ArrayPattern"!==c.argument.type&&"ObjectPattern"!==c.argument.type||this.raise(c.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},de.toAssignableList=function(e,t){for(var i=e.length,n=0;n<i;n++){var a=e[n];a&&this.toAssignable(a,t)}if(i){var c=e[i-1];6===this.options.ecmaVersion&&t&&c&&"RestElement"===c.type&&"Identifier"!==c.argument.type&&this.unexpected(c.argument.start)}return e},de.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},de.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==O.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},de.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case O.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(O.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case O.braceL:return this.parseObj(!0)}return this.parseIdent()},de.parseBindingList=function(e,t,i,n){for(var a=[],c=!0;!this.eat(e);)if(c?c=!1:this.expect(O.comma),t&&this.type===O.comma)a.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===O.ellipsis){var l=this.parseRestBinding();this.parseBindingListItem(l),a.push(l),this.type===O.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}a.push(this.parseAssignableListItem(n))}return a},de.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},de.parseBindingListItem=function(e){return e},de.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(O.eq))return i;var n=this.startNodeAt(e,t);return n.left=i,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},de.checkLValSimple=function(e,t,i){void 0===t&&(t=0);var n=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(n?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(H(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":n&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return n&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(n?"Binding":"Assigning to")+" rvalue")}},de.checkLValPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var n=0,a=e.properties;n<a.length;n+=1){var c=a[n];this.checkLValInnerPattern(c,t,i)}break;case"ArrayPattern":for(var l=0,y=e.elements;l<y.length;l+=1){var E=y[l];E&&this.checkLValInnerPattern(E,t,i)}break;default:this.checkLValSimple(e,t,i)}},de.checkLValInnerPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var acorn_TokContext=function(e,t,i,n,a){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!a},fe={b_stat:new acorn_TokContext("{",!1),b_expr:new acorn_TokContext("{",!0),b_tmpl:new acorn_TokContext("${",!1),p_stat:new acorn_TokContext("(",!1),p_expr:new acorn_TokContext("(",!0),q_tmpl:new acorn_TokContext("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new acorn_TokContext("function",!1),f_expr:new acorn_TokContext("function",!0),f_expr_gen:new acorn_TokContext("function",!0,!1,null,!0),f_gen:new acorn_TokContext("function",!1,!1,null,!0)},me=acorn_Parser.prototype;me.initialContext=function(){return[fe.b_stat]},me.curContext=function(){return this.context[this.context.length-1]},me.braceIsBlock=function(e){var t=this.curContext();return t===fe.f_expr||t===fe.f_stat||(e!==O.colon||t!==fe.b_stat&&t!==fe.b_expr?e===O._return||e===O.name&&this.exprAllowed?j.test(this.input.slice(this.lastTokEnd,this.start)):e===O._else||e===O.semi||e===O.eof||e===O.parenR||e===O.arrow||(e===O.braceL?t===fe.b_stat:e!==O._var&&e!==O._const&&e!==O.name&&!this.exprAllowed):!t.isExpr)},me.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},me.updateContext=function(e){var t,i=this.type;i.keyword&&e===O.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},me.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},O.parenR.updateContext=O.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===fe.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},O.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?fe.b_stat:fe.b_expr),this.exprAllowed=!0},O.dollarBraceL.updateContext=function(){this.context.push(fe.b_tmpl),this.exprAllowed=!0},O.parenL.updateContext=function(e){var t=e===O._if||e===O._for||e===O._with||e===O._while;this.context.push(t?fe.p_stat:fe.p_expr),this.exprAllowed=!0},O.incDec.updateContext=function(){},O._function.updateContext=O._class.updateContext=function(e){!e.beforeExpr||e===O._else||e===O.semi&&this.curContext()!==fe.p_stat||e===O._return&&j.test(this.input.slice(this.lastTokEnd,this.start))||(e===O.colon||e===O.braceL)&&this.curContext()===fe.b_stat?this.context.push(fe.f_stat):this.context.push(fe.f_expr),this.exprAllowed=!1},O.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},O.backQuote.updateContext=function(){this.curContext()===fe.q_tmpl?this.context.pop():this.context.push(fe.q_tmpl),this.exprAllowed=!1},O.star.updateContext=function(e){if(e===O._function){var t=this.context.length-1;this.context[t]===fe.f_expr?this.context[t]=fe.f_expr_gen:this.context[t]=fe.f_gen}this.exprAllowed=!0},O.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==O.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ge=acorn_Parser.prototype;function isLocalVariableAccess(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&isLocalVariableAccess(e.expression)}function isPrivateFieldAccess(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&isPrivateFieldAccess(e.expression)||"ParenthesizedExpression"===e.type&&isPrivateFieldAccess(e.expression)}ge.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,a=e.key;switch(a.type){case"Identifier":n=a.name;break;case"Literal":n=String(a.value);break;default:return}var c=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===c&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=a.start):this.raiseRecoverable(a.start,"Redefinition of __proto__ property")),t.proto=!0);else{var l=t[n="$"+n];if(l)("init"===c?this.strict&&l.init||l.get||l.set:l.init||l[c])&&this.raiseRecoverable(a.start,"Redefinition of property");else l=t[n]={init:!1,get:!1,set:!1};l[c]=!0}}},ge.parseExpression=function(e,t){var i=this.start,n=this.startLoc,a=this.parseMaybeAssign(e,t);if(this.type===O.comma){var c=this.startNodeAt(i,n);for(c.expressions=[a];this.eat(O.comma);)c.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(c,"SequenceExpression")}return a},ge.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,a=-1,c=-1,l=-1;t?(a=t.parenthesizedAssign,c=t.trailingComma,l=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new acorn_DestructuringErrors,n=!0);var y=this.start,E=this.startLoc;this.type!==O.parenL&&this.type!==O.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var w=this.parseMaybeConditional(e,t);if(i&&(w=i.call(this,w,y,E)),this.type.isAssign){var C=this.startNodeAt(y,E);return C.operator=this.value,this.type===O.eq&&(w=this.toAssignable(w,!1,t)),n||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=w.start&&(t.shorthandAssign=-1),this.type===O.eq?this.checkLValPattern(w):this.checkLValSimple(w),C.left=w,this.next(),C.right=this.parseMaybeAssign(e),l>-1&&(t.doubleProto=l),this.finishNode(C,"AssignmentExpression")}return n&&this.checkExpressionErrors(t,!0),a>-1&&(t.parenthesizedAssign=a),c>-1&&(t.trailingComma=c),w},ge.parseMaybeConditional=function(e,t){var i=this.start,n=this.startLoc,a=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return a;if(this.eat(O.question)){var c=this.startNodeAt(i,n);return c.test=a,c.consequent=this.parseMaybeAssign(),this.expect(O.colon),c.alternate=this.parseMaybeAssign(e),this.finishNode(c,"ConditionalExpression")}return a},ge.parseExprOps=function(e,t){var i=this.start,n=this.startLoc,a=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||a.start===i&&"ArrowFunctionExpression"===a.type?a:this.parseExprOp(a,i,n,-1,e)},ge.parseExprOp=function(e,t,i,n,a){var c=this.type.binop;if(null!=c&&(!a||this.type!==O._in)&&c>n){var l=this.type===O.logicalOR||this.type===O.logicalAND,y=this.type===O.coalesce;y&&(c=O.logicalAND.binop);var E=this.value;this.next();var w=this.start,C=this.startLoc,S=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,a),w,C,c,a),I=this.buildBinary(t,i,e,S,E,l||y);return(l&&this.type===O.coalesce||y&&(this.type===O.logicalOR||this.type===O.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(I,t,i,n,a)}return e},ge.buildBinary=function(e,t,i,n,a,c){"PrivateIdentifier"===n.type&&this.raise(n.start,"Private identifier can only be left side of binary expression");var l=this.startNodeAt(e,t);return l.left=i,l.operator=a,l.right=n,this.finishNode(l,c?"LogicalExpression":"BinaryExpression")},ge.parseMaybeUnary=function(e,t,i,n){var a,c=this.start,l=this.startLoc;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(n),t=!0;else if(this.type.prefix){var y=this.startNode(),E=this.type===O.incDec;y.operator=this.value,y.prefix=!0,this.next(),y.argument=this.parseMaybeUnary(null,!0,E,n),this.checkExpressionErrors(e,!0),E?this.checkLValSimple(y.argument):this.strict&&"delete"===y.operator&&isLocalVariableAccess(y.argument)?this.raiseRecoverable(y.start,"Deleting local variable in strict mode"):"delete"===y.operator&&isPrivateFieldAccess(y.argument)?this.raiseRecoverable(y.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(y,E?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==O.privateId){if(a=this.parseExprSubscripts(e,n),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var w=this.startNodeAt(c,l);w.operator=this.value,w.prefix=!1,w.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(w,"UpdateExpression")}}else(n||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==O._in&&this.unexpected();return i||!this.eat(O.starstar)?a:t?void this.unexpected(this.lastTokStart):this.buildBinary(c,l,a,this.parseMaybeUnary(null,!1,!1,n),"**",!1)},ge.parseExprSubscripts=function(e,t){var i=this.start,n=this.startLoc,a=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===a.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return a;var c=this.parseSubscripts(a,i,n,!1,t);return e&&"MemberExpression"===c.type&&(e.parenthesizedAssign>=c.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=c.start&&(e.parenthesizedBind=-1),e.trailingComma>=c.start&&(e.trailingComma=-1)),c},ge.parseSubscripts=function(e,t,i,n,a){for(var c=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,l=!1;;){var y=this.parseSubscript(e,t,i,n,c,l,a);if(y.optional&&(l=!0),y===e||"ArrowFunctionExpression"===y.type){if(l){var E=this.startNodeAt(t,i);E.expression=y,y=this.finishNode(E,"ChainExpression")}return y}e=y}},ge.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(O.arrow)},ge.parseSubscriptAsyncArrow=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,n)},ge.parseSubscript=function(e,t,i,n,a,c,l){var y=this.options.ecmaVersion>=11,E=y&&this.eat(O.questionDot);n&&E&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var w=this.eat(O.bracketL);if(w||E&&this.type!==O.parenL&&this.type!==O.backQuote||this.eat(O.dot)){var C=this.startNodeAt(t,i);C.object=e,w?(C.property=this.parseExpression(),this.expect(O.bracketR)):this.type===O.privateId&&"Super"!==e.type?C.property=this.parsePrivateIdent():C.property=this.parseIdent("never"!==this.options.allowReserved),C.computed=!!w,y&&(C.optional=E),e=this.finishNode(C,"MemberExpression")}else if(!n&&this.eat(O.parenL)){var S=new acorn_DestructuringErrors,I=this.yieldPos,N=this.awaitPos,j=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var F=this.parseExprList(O.parenR,this.options.ecmaVersion>=8,!1,S);if(a&&!E&&this.shouldParseAsyncArrow())return this.checkPatternErrors(S,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=I,this.awaitPos=N,this.awaitIdentPos=j,this.parseSubscriptAsyncArrow(t,i,F,l);this.checkExpressionErrors(S,!0),this.yieldPos=I||this.yieldPos,this.awaitPos=N||this.awaitPos,this.awaitIdentPos=j||this.awaitIdentPos;var B=this.startNodeAt(t,i);B.callee=e,B.arguments=F,y&&(B.optional=E),e=this.finishNode(B,"CallExpression")}else if(this.type===O.backQuote){(E||c)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var $=this.startNodeAt(t,i);$.tag=e,$.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode($,"TaggedTemplateExpression")}return e},ge.parseExprAtom=function(e,t,i){this.type===O.slash&&this.readRegexp();var n,a=this.potentialArrowAt===this.start;switch(this.type){case O._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),n=this.startNode(),this.next(),this.type!==O.parenL||this.allowDirectSuper||this.raise(n.start,"super() call outside constructor of a subclass"),this.type!==O.dot&&this.type!==O.bracketL&&this.type!==O.parenL&&this.unexpected(),this.finishNode(n,"Super");case O._this:return n=this.startNode(),this.next(),this.finishNode(n,"ThisExpression");case O.name:var c=this.start,l=this.startLoc,y=this.containsEsc,E=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!y&&"async"===E.name&&!this.canInsertSemicolon()&&this.eat(O._function))return this.overrideContext(fe.f_expr),this.parseFunction(this.startNodeAt(c,l),0,!1,!0,t);if(a&&!this.canInsertSemicolon()){if(this.eat(O.arrow))return this.parseArrowExpression(this.startNodeAt(c,l),[E],!1,t);if(this.options.ecmaVersion>=8&&"async"===E.name&&this.type===O.name&&!y&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return E=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(O.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(c,l),[E],!0,t)}return E;case O.regexp:var w=this.value;return(n=this.parseLiteral(w.value)).regex={pattern:w.pattern,flags:w.flags},n;case O.num:case O.string:return this.parseLiteral(this.value);case O._null:case O._true:case O._false:return(n=this.startNode()).value=this.type===O._null?null:this.type===O._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case O.parenL:var C=this.start,S=this.parseParenAndDistinguishExpression(a,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(S)&&(e.parenthesizedAssign=C),e.parenthesizedBind<0&&(e.parenthesizedBind=C)),S;case O.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(O.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case O.braceL:return this.overrideContext(fe.b_expr),this.parseObj(!1,e);case O._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case O._class:return this.parseClass(this.startNode(),!1);case O._new:return this.parseNew();case O.backQuote:return this.parseTemplate();case O._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},ge.parseExprAtomDefault=function(){this.unexpected()},ge.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===O.parenL&&!e)return this.parseDynamicImport(t);if(this.type===O.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}this.unexpected()},ge.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(O.parenR)?e.options=null:(this.expect(O.comma),this.afterTrailingComma(O.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(O.parenR)||(this.expect(O.comma),this.afterTrailingComma(O.parenR)||this.unexpected())));else if(!this.eat(O.parenR)){var t=this.start;this.eat(O.comma)&&this.eat(O.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},ge.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ge.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},ge.parseParenExpression=function(){this.expect(O.parenL);var e=this.parseExpression();return this.expect(O.parenR),e},ge.shouldParseArrow=function(e){return!this.canInsertSemicolon()},ge.parseParenAndDistinguishExpression=function(e,t){var i,n=this.start,a=this.startLoc,c=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var l,y=this.start,E=this.startLoc,w=[],C=!0,S=!1,I=new acorn_DestructuringErrors,N=this.yieldPos,j=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==O.parenR;){if(C?C=!1:this.expect(O.comma),c&&this.afterTrailingComma(O.parenR,!0)){S=!0;break}if(this.type===O.ellipsis){l=this.start,w.push(this.parseParenItem(this.parseRestBinding())),this.type===O.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}w.push(this.parseMaybeAssign(!1,I,this.parseParenItem))}var F=this.lastTokEnd,B=this.lastTokEndLoc;if(this.expect(O.parenR),e&&this.shouldParseArrow(w)&&this.eat(O.arrow))return this.checkPatternErrors(I,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=N,this.awaitPos=j,this.parseParenArrowList(n,a,w,t);w.length&&!S||this.unexpected(this.lastTokStart),l&&this.unexpected(l),this.checkExpressionErrors(I,!0),this.yieldPos=N||this.yieldPos,this.awaitPos=j||this.awaitPos,w.length>1?((i=this.startNodeAt(y,E)).expressions=w,this.finishNodeAt(i,"SequenceExpression",F,B)):i=w[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var $=this.startNodeAt(n,a);return $.expression=i,this.finishNode($,"ParenthesizedExpression")}return i},ge.parseParenItem=function(e){return e},ge.parseParenArrowList=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,n)};var xe=[];ge.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===O.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,a=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,a,!0,!1),this.eat(O.parenL)?e.arguments=this.parseExprList(O.parenR,this.options.ecmaVersion>=8,!1):e.arguments=xe,this.finishNode(e,"NewExpression")},ge.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===O.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===O.backQuote,this.finishNode(i,"TemplateElement")},ge.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(i.quasis=[n];!n.tail;)this.type===O.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(O.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(O.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},ge.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===O.name||this.type===O.num||this.type===O.string||this.type===O.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===O.star)&&!j.test(this.input.slice(this.lastTokEnd,this.start))},ge.parseObj=function(e,t){var i=this.startNode(),n=!0,a={};for(i.properties=[],this.next();!this.eat(O.braceR);){if(n)n=!1;else if(this.expect(O.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(O.braceR))break;var c=this.parseProperty(e,t);e||this.checkPropClash(c,a,t),i.properties.push(c)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},ge.parseProperty=function(e,t){var i,n,a,c,l=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(O.ellipsis))return e?(l.argument=this.parseIdent(!1),this.type===O.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(l,"RestElement")):(l.argument=this.parseMaybeAssign(!1,t),this.type===O.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(l,"SpreadElement"));this.options.ecmaVersion>=6&&(l.method=!1,l.shorthand=!1,(e||t)&&(a=this.start,c=this.startLoc),e||(i=this.eat(O.star)));var y=this.containsEsc;return this.parsePropertyName(l),!e&&!y&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(l)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(O.star),this.parsePropertyName(l)):n=!1,this.parsePropertyValue(l,e,i,n,a,c,t,y),this.finishNode(l,"Property")},ge.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var i="get"===e.kind?0:1;if(e.value.params.length!==i){var n=e.value.start;"get"===e.kind?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},ge.parsePropertyValue=function(e,t,i,n,a,c,l,y){(i||n)&&this.type===O.colon&&this.unexpected(),this.eat(O.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,l),e.kind="init"):this.options.ecmaVersion>=6&&this.type===O.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,n),e.kind="init"):t||y||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===O.comma||this.type===O.braceR||this.type===O.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=a),t?e.value=this.parseMaybeDefault(a,c,this.copyNode(e.key)):this.type===O.eq&&l?(l.shorthandAssign<0&&(l.shorthandAssign=this.start),e.value=this.parseMaybeDefault(a,c,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((i||n)&&this.unexpected(),this.parseGetterSetter(e))},ge.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(O.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(O.bracketR),e.key;e.computed=!1}return e.key=this.type===O.num||this.type===O.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ge.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ge.parseMethod=function(e,t,i){var n=this.startNode(),a=this.yieldPos,c=this.awaitPos,l=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|functionFlags(t,n.generator)|(i?128:0)),this.expect(O.parenL),n.params=this.parseBindingList(O.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=a,this.awaitPos=c,this.awaitIdentPos=l,this.finishNode(n,"FunctionExpression")},ge.parseArrowExpression=function(e,t,i,n){var a=this.yieldPos,c=this.awaitPos,l=this.awaitIdentPos;return this.enterScope(16|functionFlags(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=a,this.awaitPos=c,this.awaitIdentPos=l,this.finishNode(e,"ArrowFunctionExpression")},ge.parseFunctionBody=function(e,t,i,n){var a=t&&this.type!==O.braceL,c=this.strict,l=!1;if(a)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var y=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);c&&!y||(l=this.strictDirective(this.end))&&y&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var E=this.labels;this.labels=[],l&&(this.strict=!0),this.checkParams(e,!c&&!l&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,l&&!c),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=E}this.exitScope()},ge.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){if("Identifier"!==i[t].type)return!1}return!0},ge.checkParams=function(e,t){for(var i=Object.create(null),n=0,a=e.params;n<a.length;n+=1){var c=a[n];this.checkLValInnerPattern(c,1,t?null:i)}},ge.parseExprList=function(e,t,i,n){for(var a=[],c=!0;!this.eat(e);){if(c)c=!1;else if(this.expect(O.comma),t&&this.afterTrailingComma(e))break;var l=void 0;i&&this.type===O.comma?l=null:this.type===O.ellipsis?(l=this.parseSpread(n),n&&this.type===O.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):l=this.parseMaybeAssign(!1,n),a.push(l)}return a},ge.checkUnreserved=function(e){var t=e.start,i=e.end,n=e.name;(this.inGenerator&&"yield"===n&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===n&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().flags&se||"arguments"!==n||this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==n&&"await"!==n||this.raise(t,"Cannot use "+n+" in class static initialization block"),this.keywords.test(n)&&this.raise(t,"Unexpected keyword '"+n+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,i).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(n)&&(this.inAsync||"await"!==n||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+n+"' is reserved"))},ge.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},ge.parseIdentNode=function(){var e=this.startNode();return this.type===O.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=O.name):this.unexpected(),e},ge.parsePrivateIdent=function(){var e=this.startNode();return this.type===O.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},ge.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===O.semi||this.canInsertSemicolon()||this.type!==O.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(O.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},ge.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var ve=acorn_Parser.prototype;ve.raise=function(e,t){var i=getLineInfo(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var n=new SyntaxError(t);throw n.pos=e,n.loc=i,n.raisedAt=this.pos,n},ve.raiseRecoverable=ve.raise,ve.curPosition=function(){if(this.options.locations)return new acorn_Position(this.curLine,this.pos-this.lineStart)};var ye=acorn_Parser.prototype,acorn_Scope=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};ye.enterScope=function(e){this.scopeStack.push(new acorn_Scope(e))},ye.exitScope=function(){this.scopeStack.pop()},ye.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},ye.declareName=function(e,t,i){var n=!1;if(2===t){var a=this.currentScope();n=a.lexical.indexOf(e)>-1||a.functions.indexOf(e)>-1||a.var.indexOf(e)>-1,a.lexical.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var c=this.currentScope();n=this.treatFunctionsAsVar?c.lexical.indexOf(e)>-1:c.lexical.indexOf(e)>-1||c.var.indexOf(e)>-1,c.functions.push(e)}else for(var l=this.scopeStack.length-1;l>=0;--l){var y=this.scopeStack[l];if(y.lexical.indexOf(e)>-1&&!(32&y.flags&&y.lexical[0]===e)||!this.treatFunctionsAsVarInScope(y)&&y.functions.indexOf(e)>-1){n=!0;break}if(y.var.push(e),this.inModule&&1&y.flags&&delete this.undefinedExports[e],y.flags&se)break}n&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},ye.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},ye.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ye.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},ye.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var acorn_Node=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new acorn_SourceLocation(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},_e=acorn_Parser.prototype;function finishNodeAt(e,t,i,n){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=i),e}_e.startNode=function(){return new acorn_Node(this,this.start,this.startLoc)},_e.startNodeAt=function(e,t){return new acorn_Node(this,e,t)},_e.finishNode=function(e,t){return finishNodeAt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},_e.finishNodeAt=function(e,t,i,n){return finishNodeAt.call(this,e,t,i,n)},_e.copyNode=function(e){var t=new acorn_Node(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Ee="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",be=Ee+" Extended_Pictographic",ke=be+" EBase EComp EMod EPres ExtPict",we={9:Ee,10:be,11:be,12:ke,13:ke,14:ke},Ce={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Se="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ie="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Te=Ie+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Re=Te+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ae=Re+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Le=Ae+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Oe={9:Ie,10:Te,11:Re,12:Ae,13:Le,14:Le+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},De={};function buildUnicodeData(e){var t=De[e]={binary:wordsRegexp(we[e]+" "+Se),binaryOfStrings:wordsRegexp(Ce[e]),nonBinary:{General_Category:wordsRegexp(Se),Script:wordsRegexp(Oe[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Ve=0,Ue=[9,10,11,12,13,14];Ve<Ue.length;Ve+=1){buildUnicodeData(Ue[Ve])}var Me=acorn_Parser.prototype,acorn_BranchID=function(e,t){this.parent=e,this.base=t||this};acorn_BranchID.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var i=e;i;i=i.parent)if(t.base===i.base&&t!==i)return!0;return!1},acorn_BranchID.prototype.sibling=function(){return new acorn_BranchID(this.parent,this.base)};var acorn_RegExpValidationState=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=De[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function isRegularExpressionModifier(e){return 105===e||109===e||115===e}function isSyntaxCharacter(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function isControlLetter(e){return e>=65&&e<=90||e>=97&&e<=122}acorn_RegExpValidationState.prototype.reset=function(e,t,i){var n=-1!==i.indexOf("v"),a=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)},acorn_RegExpValidationState.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},acorn_RegExpValidationState.prototype.at=function(e,t){void 0===t&&(t=!1);var i=this.source,n=i.length;if(e>=n)return-1;var a=i.charCodeAt(e);if(!t&&!this.switchU||a<=55295||a>=57344||e+1>=n)return a;var c=i.charCodeAt(e+1);return c>=56320&&c<=57343?(a<<10)+c-56613888:a},acorn_RegExpValidationState.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var i=this.source,n=i.length;if(e>=n)return n;var a,c=i.charCodeAt(e);return!t&&!this.switchU||c<=55295||c>=57344||e+1>=n||(a=i.charCodeAt(e+1))<56320||a>57343?e+1:e+2},acorn_RegExpValidationState.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},acorn_RegExpValidationState.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},acorn_RegExpValidationState.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},acorn_RegExpValidationState.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},acorn_RegExpValidationState.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var i=this.pos,n=0,a=e;n<a.length;n+=1){var c=a[n],l=this.at(i,t);if(-1===l||l!==c)return!1;i=this.nextIndex(i,t)}return this.pos=i,!0},Me.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=!1,a=!1,c=0;c<i.length;c++){var l=i.charAt(c);-1===t.indexOf(l)&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(l,c+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===l&&(n=!0),"v"===l&&(a=!0)}this.options.ecmaVersion>=15&&n&&a&&this.raise(e.start,"Invalid regular expression flag")},Me.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Me.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var n=i[t];e.groupNames[n]||e.raise("Invalid named capture referenced")}},Me.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new acorn_BranchID(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Me.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Me.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},Me.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},Me.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Me.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Me.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var n=0,a=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(a=e.lastIntValue),e.eat(125)))return-1!==a&&a<n&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},Me.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Me.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Me.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),n=e.eat(45);if(i||n){for(var a=0;a<i.length;a++){var c=i.charAt(a);i.indexOf(c,a+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(n){var l=this.regexp_eatModifiers(e);i||l||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var y=0;y<l.length;y++){var E=l.charAt(y);(l.indexOf(E,y+1)>-1||i.indexOf(E)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},Me.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Me.regexp_eatModifiers=function(e){for(var t="",i=0;-1!==(i=e.current())&&isRegularExpressionModifier(i);)t+=codePointToString(i),e.advance();return t},Me.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Me.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Me.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!isSyntaxCharacter(t)&&(e.lastIntValue=t,e.advance(),!0)},Me.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!isSyntaxCharacter(i);)e.advance();return e.pos!==t},Me.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},Me.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var n=0,a=i;n<a.length;n+=1){a[n].separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Me.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Me.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=codePointToString(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=codePointToString(e.lastIntValue);return!0}return!1},Me.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,n=e.current(i);return e.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(n=e.lastIntValue),function(e){return isIdentifierStart(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Me.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,n=e.current(i);return e.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(n=e.lastIntValue),function(e){return isIdentifierChar(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Me.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Me.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},Me.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Me.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Me.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Me.regexp_eatZero=function(e){return 48===e.current()&&!isDecimalDigit(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Me.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Me.regexp_eatControlLetter=function(e){var t=e.current();return!!isControlLetter(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Me.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var i,n=e.pos,a=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var c=e.lastIntValue;if(a&&c>=55296&&c<=56319){var l=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var y=e.lastIntValue;if(y>=56320&&y<=57343)return e.lastIntValue=1024*(c-55296)+(y-56320)+65536,!0}e.pos=l,e.lastIntValue=c}return!0}if(a&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((i=e.lastIntValue)>=0&&i<=1114111))return!0;a&&e.raise("Invalid unicode escape"),e.pos=n}return!1},Me.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Me.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function isUnicodePropertyNameCharacter(e){return isControlLetter(e)||95===e}function isUnicodePropertyValueCharacter(e){return isUnicodePropertyNameCharacter(e)||isDecimalDigit(e)}function isDecimalDigit(e){return e>=48&&e<=57}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hexToInt(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function isOctalDigit(e){return e>=48&&e<=55}Me.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=80===t)||112===t)){var n;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&2===n&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return 0},Me.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,n),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var a=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,a)}return 0},Me.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){H(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},Me.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},Me.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyNameCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return""!==e.lastStringValue},Me.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyValueCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return""!==e.lastStringValue},Me.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Me.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===i&&e.raise("Negated character class may contain strings"),!0}return!1},Me.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},Me.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},Me.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||isOctalDigit(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},Me.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Me.regexp_classSetExpression=function(e){var t,i=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(i=2);for(var n=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(i=1):e.raise("Invalid character in character class");if(n!==e.pos)return i;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return i}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return i;2===t&&(i=2)}},Me.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return-1!==i&&-1!==n&&i>n&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Me.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Me.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return i&&2===n&&e.raise("Negated character class may contain strings"),n;e.pos=t}if(e.eat(92)){var a=this.regexp_eatCharacterClassEscape(e);if(a)return a;e.pos=t}return null},Me.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null},Me.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},Me.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},Me.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var i=e.current();return!(i<0||i===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(i))&&(!function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(i)&&(e.advance(),e.lastIntValue=i,!0))},Me.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},Me.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!isDecimalDigit(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},Me.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Me.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;isDecimalDigit(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},Me.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;isHexDigit(i=e.current());)e.lastIntValue=16*e.lastIntValue+hexToInt(i),e.advance();return e.pos!==t},Me.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},Me.regexp_eatOctalDigit=function(e){var t=e.current();return isOctalDigit(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Me.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n<t;++n){var a=e.current();if(!isHexDigit(a))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+hexToInt(a),e.advance()}return!0};var acorn_Token=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new acorn_SourceLocation(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},je=acorn_Parser.prototype;function stringToBigInt(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}je.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new acorn_Token(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},je.getToken=function(){return this.next(),new acorn_Token(this)},"undefined"!=typeof Symbol&&(je[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===O.eof,value:t}}}}),je.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(O.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},je.readToken=function(e){return isIdentifierStart(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},je.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888},je.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},je.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var n=void 0,a=t;(n=nextLineBreak(this.input,a,this.pos))>-1;)++this.curLine,a=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},je.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!isNewLine(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},je.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&B.test(String.fromCharCode(e))))break e;++this.pos}}},je.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},je.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(O.ellipsis)):(++this.pos,this.finishToken(O.dot))},je.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(O.assign,2):this.finishOp(O.slash,1)},je.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?O.star:O.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=O.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(O.assign,i+1):this.finishOp(n,i)},je.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(O.assign,3);return this.finishOp(124===e?O.logicalOR:O.logicalAND,2)}return 61===t?this.finishOp(O.assign,2):this.finishOp(124===e?O.bitwiseOR:O.bitwiseAND,1)},je.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(O.assign,2):this.finishOp(O.bitwiseXOR,1)},je.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!j.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(O.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(O.assign,2):this.finishOp(O.plusMin,1)},je.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(O.assign,i+1):this.finishOp(O.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(O.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},je.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(O.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(O.arrow)):this.finishOp(61===e?O.eq:O.prefix,1)},je.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(O.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(O.assign,3);return this.finishOp(O.coalesce,2)}}return this.finishOp(O.question,1)},je.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,isIdentifierStart(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(O.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")},je.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(O.parenL);case 41:return++this.pos,this.finishToken(O.parenR);case 59:return++this.pos,this.finishToken(O.semi);case 44:return++this.pos,this.finishToken(O.comma);case 91:return++this.pos,this.finishToken(O.bracketL);case 93:return++this.pos,this.finishToken(O.bracketR);case 123:return++this.pos,this.finishToken(O.braceL);case 125:return++this.pos,this.finishToken(O.braceR);case 58:return++this.pos,this.finishToken(O.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(O.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(O.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")},je.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},je.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(j.test(n)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var a=this.input.slice(i,this.pos);++this.pos;var c=this.pos,l=this.readWord1();this.containsEsc&&this.unexpected(c);var y=this.regexpState||(this.regexpState=new acorn_RegExpValidationState(this));y.reset(i,a,l),this.validateRegExpFlags(y),this.validateRegExpPattern(y);var E=null;try{E=new RegExp(a,l)}catch(e){}return this.finishToken(O.regexp,{pattern:a,flags:l,value:E})},je.readInt=function(e,t,i){for(var n=this.options.ecmaVersion>=12&&void 0===t,a=i&&48===this.input.charCodeAt(this.pos),c=this.pos,l=0,y=0,E=0,w=null==t?1/0:t;E<w;++E,++this.pos){var C=this.input.charCodeAt(this.pos),S=void 0;if(n&&95===C)a&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===y&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===E&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),y=C;else{if((S=C>=97?C-97+10:C>=65?C-65+10:C>=48&&C<=57?C-48:1/0)>=e)break;y=C,l=l*e+S}}return n&&95===y&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===c||null!=t&&this.pos-c!==t?null:l},je.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=stringToBigInt(this.input.slice(t,this.pos)),++this.pos):isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(O.num,i)},je.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===n){var a=stringToBigInt(this.input.slice(t,this.pos));return++this.pos,isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(O.num,a)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),46!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var c,l=(c=this.input.slice(t,this.pos),i?parseInt(c,8):parseFloat(c.replace(/_/g,"")));return this.finishToken(O.num,l)},je.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},je.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):8232===n||8233===n?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(isNewLine(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(O.string,t)};var Fe={};je.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Fe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},je.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Fe;this.raise(e,t)},je.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==O.template&&this.type!==O.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(O.template,e)):36===i?(this.pos+=2,this.finishToken(O.dollarBraceL)):(++this.pos,this.finishToken(O.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(isNewLine(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},je.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(O.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},je.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],a=parseInt(n,8);return a>255&&(n=n.slice(0,-1),a=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(a)}return isNewLine(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},je.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},je.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos<this.input.length;){var a=this.fullCharCodeAtPos();if(isIdentifierChar(a,n))this.pos+=a<=65535?1:2;else{if(92!==a)break;this.containsEsc=!0,e+=this.input.slice(i,this.pos);var c=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var l=this.readCodePoint();(t?isIdentifierStart:isIdentifierChar)(l,n)||this.invalidStringToken(c,"Invalid Unicode escape"),e+=codePointToString(l),i=this.pos}t=!1}return e+this.input.slice(i,this.pos)},je.readWord=function(){var e=this.readWord1(),t=O.name;return this.keywords.test(e)&&(t=N[e]),this.finishToken(t,e)};acorn_Parser.acorn={Parser:acorn_Parser,version:"8.16.0",defaultOptions:X,Position:acorn_Position,SourceLocation:acorn_SourceLocation,getLineInfo,Node:acorn_Node,TokenType:acorn_TokenType,tokTypes:O,keywordTypes:N,TokContext:acorn_TokContext,tokContexts:fe,isIdentifierChar,isIdentifierStart,Token:acorn_Token,isNewLine,lineBreak:j,lineBreakG:F,nonASCIIwhitespace:B};var Be=__nested_rspack_require_27261__("node:module"),$e=__nested_rspack_require_27261__("node:fs");String.fromCharCode;const qe=/\/$|\/\?|\/#/,Ge=/^\.?\//;function hasTrailingSlash(e="",t){return t?qe.test(e):e.endsWith("/")}function withTrailingSlash(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(hasTrailingSlash(e,!0))return e||"/";let i=e,n="";const a=e.indexOf("#");if(-1!==a&&(i=e.slice(0,a),n=e.slice(a),!i))return n;const[c,...l]=i.split("?");return c+"/"+(l.length>0?`?${l.join("?")}`:"")+n}function isNonEmptyURL(e){return e&&"/"!==e}function dist_joinURL(e,...t){let i=e||"";for(const e of t.filter(e=>isNonEmptyURL(e)))if(i){const t=e.replace(Ge,"");i=withTrailingSlash(i)+t}else i=e;return i}Symbol.for("ufo:protocolRelative");const Ke=/^[A-Za-z]:\//;function pathe_M_eThtNZ_normalizeWindowsPath(e=""){return e?e.replace(/\\/g,"/").replace(Ke,e=>e.toUpperCase()):e}const He=/^[/\\]{2}/,ze=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Je=/^[A-Za-z]:$/,Ye=/.(\.[^./]+|\.)$/,pathe_M_eThtNZ_normalize=function(e){if(0===e.length)return".";const t=(e=pathe_M_eThtNZ_normalizeWindowsPath(e)).match(He),i=isAbsolute(e),n="/"===e[e.length-1];return 0===(e=normalizeString(e,!i)).length?i?"/":n?"./":".":(n&&(e+="/"),Je.test(e)&&(e+="/"),t?i?`//${e}`:`//./${e}`:i&&!isAbsolute(e)?`/${e}`:e)},pathe_M_eThtNZ_join=function(...e){let t="";for(const i of e)if(i)if(t.length>0){const e="/"===t[t.length-1],n="/"===i[0];t+=e&&n?i.slice(1):e||n?i:`/${i}`}else t+=i;return pathe_M_eThtNZ_normalize(t)};function pathe_M_eThtNZ_cwd(){return"undefined"!=typeof process&&"function"==typeof process.cwd?process.cwd().replace(/\\/g,"/"):"/"}const pathe_M_eThtNZ_resolve=function(...e){let t="",i=!1;for(let n=(e=e.map(e=>pathe_M_eThtNZ_normalizeWindowsPath(e))).length-1;n>=-1&&!i;n--){const a=n>=0?e[n]:pathe_M_eThtNZ_cwd();a&&0!==a.length&&(t=`${a}/${t}`,i=isAbsolute(a))}return t=normalizeString(t,!i),i&&!isAbsolute(t)?`/${t}`:t.length>0?t:"."};function normalizeString(e,t){let i="",n=0,a=-1,c=0,l=null;for(let y=0;y<=e.length;++y){if(y<e.length)l=e[y];else{if("/"===l)break;l="/"}if("/"===l){if(a===y-1||1===c);else if(2===c){if(i.length<2||2!==n||"."!==i[i.length-1]||"."!==i[i.length-2]){if(i.length>2){const e=i.lastIndexOf("/");-1===e?(i="",n=0):(i=i.slice(0,e),n=i.length-1-i.lastIndexOf("/")),a=y,c=0;continue}if(i.length>0){i="",n=0,a=y,c=0;continue}}t&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+=`/${e.slice(a+1,y)}`:i=e.slice(a+1,y),n=y-a-1;a=y,c=0}else"."===l&&-1!==c?++c:c=-1}return i}const isAbsolute=function(e){return ze.test(e)},extname=function(e){if(".."===e)return"";const t=Ye.exec(pathe_M_eThtNZ_normalizeWindowsPath(e));return t&&t[1]||""},pathe_M_eThtNZ_dirname=function(e){const t=pathe_M_eThtNZ_normalizeWindowsPath(e).replace(/\/$/,"").split("/").slice(0,-1);return 1===t.length&&Je.test(t[0])&&(t[0]+="/"),t.join("/")||(isAbsolute(e)?"/":".")},basename=function(e,t){const i=pathe_M_eThtNZ_normalizeWindowsPath(e).split("/");let n="";for(let e=i.length-1;e>=0;e--){const t=i[e];if(t){n=t;break}}return t&&n.endsWith(t)?n.slice(0,-t.length):n},Qe=__webpack_require__(3136),Ze=__webpack_require__(6970),Xe=__webpack_require__(1708);var et=__nested_rspack_require_27261__("node:path");const tt=__webpack_require__(8877),it=__webpack_require__(7975),st=new Set(Be.builtinModules);function normalizeSlash(e){return e.replace(/\\/g,"/")}const rt={}.hasOwnProperty,nt=/^([A-Z][a-z\d]*)+$/,at=new Set(["string","function","number","object","Function","Object","boolean","bigint","symbol"]),ot={};function formatList(e,t="and"){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}const ct=new Map;let ht;function createError(e,t,i){return ct.set(e,t),function(e,t){return NodeError;function NodeError(...i){const n=Error.stackTraceLimit;isErrorStackTraceLimitWritable()&&(Error.stackTraceLimit=0);const a=new e;isErrorStackTraceLimitWritable()&&(Error.stackTraceLimit=n);const c=function(e,t,i){const n=ct.get(e);if(Ze.ok(void 0!==n,"expected `message` to be found"),"function"==typeof n)return Ze.ok(n.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${n.length}).`),Reflect.apply(n,i,t);const a=/%[dfijoOs]/g;let c=0;for(;null!==a.exec(n);)c++;return Ze.ok(c===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${c}).`),0===t.length?n:(t.unshift(n),Reflect.apply(it.format,null,t))}(t,i,a);return Object.defineProperties(a,{message:{value:c,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),lt(a),a.code=t,a}}(i,e)}function isErrorStackTraceLimitWritable(){try{if(tt.startupSnapshot.isBuildingSnapshot())return!1}catch{}const e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):rt.call(e,"writable")&&void 0!==e.writable?e.writable:void 0!==e.set}ot.ERR_INVALID_ARG_TYPE=createError("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Ze.ok("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";if(e.endsWith(" argument"))n+=`${e} `;else{const t=e.includes(".")?"property":"argument";n+=`"${e}" ${t} `}n+="must be ";const a=[],c=[],l=[];for(const e of t)Ze.ok("string"==typeof e,"All expected entries have to be of type string"),at.has(e)?a.push(e.toLowerCase()):null===nt.exec(e)?(Ze.ok("object"!==e,'The value "object" should be written as "Object"'),l.push(e)):c.push(e);if(c.length>0){const e=a.indexOf("object");-1!==e&&(a.slice(e,1),c.push("Object"))}return a.length>0&&(n+=`${a.length>1?"one of type":"of type"} ${formatList(a,"or")}`,(c.length>0||l.length>0)&&(n+=" or ")),c.length>0&&(n+=`an instance of ${formatList(c,"or")}`,l.length>0&&(n+=" or ")),l.length>0&&(l.length>1?n+=`one of ${formatList(l,"or")}`:(l[0].toLowerCase()!==l[0]&&(n+="an "),n+=`${l[0]}`)),n+=`. Received ${function(e){if(null==e)return String(e);if("function"==typeof e&&e.name)return`function ${e.name}`;if("object"==typeof e)return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${(0,it.inspect)(e,{depth:-1})}`;let t=(0,it.inspect)(e,{colors:!1});t.length>28&&(t=`${t.slice(0,25)}...`);return`type ${typeof e} (${t})`}(i)}`,n},TypeError),ot.ERR_INVALID_MODULE_SPECIFIER=createError("ERR_INVALID_MODULE_SPECIFIER",(e,t,i=void 0)=>`Invalid module "${e}" ${t}${i?` imported from ${i}`:""}`,TypeError),ot.ERR_INVALID_PACKAGE_CONFIG=createError("ERR_INVALID_PACKAGE_CONFIG",(e,t,i)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${i?`. ${i}`:""}`,Error),ot.ERR_INVALID_PACKAGE_TARGET=createError("ERR_INVALID_PACKAGE_TARGET",(e,t,i,n=!1,a=void 0)=>{const c="string"==typeof i&&!n&&i.length>0&&!i.startsWith("./");return"."===t?(Ze.ok(!1===n),`Invalid "exports" main target ${JSON.stringify(i)} defined in the package config ${e}package.json${a?` imported from ${a}`:""}${c?'; targets must start with "./"':""}`):`Invalid "${n?"imports":"exports"}" target ${JSON.stringify(i)} defined for '${t}' in the package config ${e}package.json${a?` imported from ${a}`:""}${c?'; targets must start with "./"':""}`},Error),ot.ERR_MODULE_NOT_FOUND=createError("ERR_MODULE_NOT_FOUND",(e,t,i=!1)=>`Cannot find ${i?"module":"package"} '${e}' imported from ${t}`,Error),ot.ERR_NETWORK_IMPORT_DISALLOWED=createError("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error),ot.ERR_PACKAGE_IMPORT_NOT_DEFINED=createError("ERR_PACKAGE_IMPORT_NOT_DEFINED",(e,t,i)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:""} imported from ${i}`,TypeError),ot.ERR_PACKAGE_PATH_NOT_EXPORTED=createError("ERR_PACKAGE_PATH_NOT_EXPORTED",(e,t,i=void 0)=>"."===t?`No "exports" main defined in ${e}package.json${i?` imported from ${i}`:""}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${i?` imported from ${i}`:""}`,Error),ot.ERR_UNSUPPORTED_DIR_IMPORT=createError("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error),ot.ERR_UNSUPPORTED_RESOLVE_REQUEST=createError("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError),ot.ERR_UNKNOWN_FILE_EXTENSION=createError("ERR_UNKNOWN_FILE_EXTENSION",(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError),ot.ERR_INVALID_ARG_VALUE=createError("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let n=(0,it.inspect)(t);n.length>128&&(n=`${n.slice(0,128)}...`);return`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${n}`},TypeError);const lt=function(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}(function(e){const t=isErrorStackTraceLimitWritable();return t&&(ht=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=ht),e});const pt={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:ut}=ot,dt=new Map;function read(e,{base:t,specifier:i}){const n=dt.get(e);if(n)return n;let a;try{a=$e.readFileSync(et.toNamespacedPath(e),"utf8")}catch(e){const t=e;if("ENOENT"!==t.code)throw t}const c={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};if(void 0!==a){let n;try{n=JSON.parse(a)}catch(n){const a=n,c=new ut(e,(t?`"${i}" from `:"")+(0,Qe.fileURLToPath)(t||i),a.message);throw c.cause=a,c}c.exists=!0,pt.call(n,"name")&&"string"==typeof n.name&&(c.name=n.name),pt.call(n,"main")&&"string"==typeof n.main&&(c.main=n.main),pt.call(n,"exports")&&(c.exports=n.exports),pt.call(n,"imports")&&(c.imports=n.imports),!pt.call(n,"type")||"commonjs"!==n.type&&"module"!==n.type||(c.type=n.type)}return dt.set(e,c),c}function getPackageScopeConfig(e){let t=new URL("package.json",e);for(;;){if(t.pathname.endsWith("node_modules/package.json"))break;const i=read((0,Qe.fileURLToPath)(t),{specifier:e});if(i.exists)return i;const n=t;if(t=new URL("../package.json",t),t.pathname===n.pathname)break}return{pjsonPath:(0,Qe.fileURLToPath)(t),exists:!1,type:"none"}}function getPackageType(e){return getPackageScopeConfig(e).type}const{ERR_UNKNOWN_FILE_EXTENSION:ft}=ot,mt={}.hasOwnProperty,gt={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"};const xt={__proto__:null,"data:":function(e){const{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return function(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?"module":"application/json"===e?"json":null}(t)},"file:":function(e,t,i){const n=function(e){const t=e.pathname;let i=t.length;for(;i--;){const e=t.codePointAt(i);if(47===e)return"";if(46===e)return 47===t.codePointAt(i-1)?"":t.slice(i)}return""}(e);if(".js"===n){const t=getPackageType(e);return"none"!==t?t:"commonjs"}if(""===n){const t=getPackageType(e);return"none"===t||"commonjs"===t?"commonjs":"module"}const a=gt[n];if(a)return a;if(i)return;const c=(0,Qe.fileURLToPath)(e);throw new ft(n,c)},"http:":getHttpProtocolModuleFormat,"https:":getHttpProtocolModuleFormat,"node:":()=>"builtin"};function getHttpProtocolModuleFormat(){}const vt=Object.freeze(["node","import"]),yt=new Set(vt);function getConditionsSet(e){return yt}const _t=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:Et,ERR_INVALID_PACKAGE_CONFIG:bt,ERR_INVALID_PACKAGE_TARGET:kt,ERR_MODULE_NOT_FOUND:wt,ERR_PACKAGE_IMPORT_NOT_DEFINED:Ct,ERR_PACKAGE_PATH_NOT_EXPORTED:St,ERR_UNSUPPORTED_DIR_IMPORT:It,ERR_UNSUPPORTED_RESOLVE_REQUEST:Tt}=ot,Rt={}.hasOwnProperty,At=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,Pt=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,Lt=/^\.|%|\\/,Nt=/\*/g,Ot=/%2f|%5c/i,Dt=new Set,Vt=/[/\\]{2}/;function emitInvalidSegmentDeprecation(e,t,i,n,a,c,l){if(Xe.noDeprecation)return;const y=(0,Qe.fileURLToPath)(n),E=null!==Vt.exec(l?e:t);Xe.emitWarning(`Use of deprecated ${E?"double slash":"leading or trailing slash matching"} resolving "${e}" for module request "${t}" ${t===i?"":`matched to "${i}" `}in the "${a?"imports":"exports"}" field module resolution of the package at ${y}${c?` imported from ${(0,Qe.fileURLToPath)(c)}`:""}.`,"DeprecationWarning","DEP0166")}function emitLegacyIndexDeprecation(e,t,i,n){if(Xe.noDeprecation)return;const a=function(e,t){const i=e.protocol;return mt.call(xt,i)&&xt[i](e,t,!0)||null}(e,{parentURL:i.href});if("module"!==a)return;const c=(0,Qe.fileURLToPath)(e.href),l=(0,Qe.fileURLToPath)(new URL(".",t)),y=(0,Qe.fileURLToPath)(i);n?et.resolve(l,n)!==c&&Xe.emitWarning(`Package ${l} has a "main" field set to "${n}", excluding the full filename and extension to the resolved file at "${c.slice(l.length)}", imported from ${y}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`,"DeprecationWarning","DEP0151"):Xe.emitWarning(`No "main" or "exports" field defined in the package.json for ${l} resolving the main entry point "${c.slice(l.length)}", imported from ${y}.\nDefault "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function tryStatSync(e){try{return(0,$e.statSync)(e)}catch{}}function fileExists(e){const t=(0,$e.statSync)(e,{throwIfNoEntry:!1}),i=t?t.isFile():void 0;return null!=i&&i}function legacyMainResolve(e,t,i){let n;if(void 0!==t.main){if(n=new URL(t.main,e),fileExists(n))return n;const a=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`];let c=-1;for(;++c<a.length&&(n=new URL(a[c],e),!fileExists(n));)n=void 0;if(n)return emitLegacyIndexDeprecation(n,e,i,t.main),n}const a=["./index.js","./index.json","./index.node"];let c=-1;for(;++c<a.length&&(n=new URL(a[c],e),!fileExists(n));)n=void 0;if(n)return emitLegacyIndexDeprecation(n,e,i,t.main),n;throw new wt((0,Qe.fileURLToPath)(new URL(".",e)),(0,Qe.fileURLToPath)(i))}function exportsNotFound(e,t,i){return new St((0,Qe.fileURLToPath)(new URL(".",t)),e,i&&(0,Qe.fileURLToPath)(i))}function invalidPackageTarget(e,t,i,n,a){return t="object"==typeof t&&null!==t?JSON.stringify(t,null,""):`${t}`,new kt((0,Qe.fileURLToPath)(new URL(".",i)),e,t,n,a&&(0,Qe.fileURLToPath)(a))}function resolvePackageTargetString(e,t,i,n,a,c,l,y,E){if(""!==t&&!c&&"/"!==e[e.length-1])throw invalidPackageTarget(i,e,n,l,a);if(!e.startsWith("./")){if(l&&!e.startsWith("../")&&!e.startsWith("/")){let i=!1;try{new URL(e),i=!0}catch{}if(!i){return packageResolve(c?_t.call(Nt,e,()=>t):e+t,n,E)}}throw invalidPackageTarget(i,e,n,l,a)}if(null!==At.exec(e.slice(2))){if(null!==Pt.exec(e.slice(2)))throw invalidPackageTarget(i,e,n,l,a);if(!y){const y=c?i.replace("*",()=>t):i+t;emitInvalidSegmentDeprecation(c?_t.call(Nt,e,()=>t):e,y,i,n,l,a,!0)}}const w=new URL(e,n),C=w.pathname,S=new URL(".",n).pathname;if(!C.startsWith(S))throw invalidPackageTarget(i,e,n,l,a);if(""===t)return w;if(null!==At.exec(t)){const E=c?i.replace("*",()=>t):i+t;if(null===Pt.exec(t)){if(!y){emitInvalidSegmentDeprecation(c?_t.call(Nt,e,()=>t):e,E,i,n,l,a,!1)}}else!function(e,t,i,n,a){const c=`request is not a valid match in pattern "${t}" for the "${n?"imports":"exports"}" resolution of ${(0,Qe.fileURLToPath)(i)}`;throw new Et(e,c,a&&(0,Qe.fileURLToPath)(a))}(E,i,n,l,a)}return c?new URL(_t.call(Nt,w.href,()=>t)):new URL(t,w)}function isArrayIndex(e){const t=Number(e);return`${t}`===e&&(t>=0&&t<4294967295)}function resolvePackageTarget(e,t,i,n,a,c,l,y,E){if("string"==typeof t)return resolvePackageTargetString(t,i,n,e,a,c,l,y,E);if(Array.isArray(t)){const w=t;if(0===w.length)return null;let C,S=-1;for(;++S<w.length;){const t=w[S];let I;try{I=resolvePackageTarget(e,t,i,n,a,c,l,y,E)}catch(e){if(C=e,"ERR_INVALID_PACKAGE_TARGET"===e.code)continue;throw e}if(void 0!==I){if(null!==I)return I;C=null}}if(null==C)return null;throw C}if("object"==typeof t&&null!==t){const w=Object.getOwnPropertyNames(t);let C=-1;for(;++C<w.length;){if(isArrayIndex(w[C]))throw new bt((0,Qe.fileURLToPath)(e),a,'"exports" cannot contain numeric property keys.')}for(C=-1;++C<w.length;){const S=w[C];if("default"===S||E&&E.has(S)){const w=resolvePackageTarget(e,t[S],i,n,a,c,l,y,E);if(void 0===w)continue;return w}}return null}if(null===t)return null;throw invalidPackageTarget(n,t,e,l,a)}function emitTrailingSlashPatternDeprecation(e,t,i){if(Xe.noDeprecation)return;const n=(0,Qe.fileURLToPath)(t);Dt.has(n+"|"+e)||(Dt.add(n+"|"+e),Xe.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${n}${i?` imported from ${(0,Qe.fileURLToPath)(i)}`:""}. Mapping specifiers ending in "/" is no longer supported.`,"DeprecationWarning","DEP0155"))}function packageExportsResolve(e,t,i,n,a){let c=i.exports;if(function(e,t,i){if("string"==typeof e||Array.isArray(e))return!0;if("object"!=typeof e||null===e)return!1;const n=Object.getOwnPropertyNames(e);let a=!1,c=0,l=-1;for(;++l<n.length;){const e=n[l],y=""===e||"."!==e[0];if(0===c++)a=y;else if(a!==y)throw new bt((0,Qe.fileURLToPath)(t),i,"\"exports\" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.")}return a}(c,e,n)&&(c={".":c}),Rt.call(c,t)&&!t.includes("*")&&!t.endsWith("/")){const i=resolvePackageTarget(e,c[t],"",t,n,!1,!1,!1,a);if(null==i)throw exportsNotFound(t,e,n);return i}let l="",y="";const E=Object.getOwnPropertyNames(c);let w=-1;for(;++w<E.length;){const i=E[w],a=i.indexOf("*");if(-1!==a&&t.startsWith(i.slice(0,a))){t.endsWith("/")&&emitTrailingSlashPatternDeprecation(t,e,n);const c=i.slice(a+1);t.length>=i.length&&t.endsWith(c)&&1===patternKeyCompare(l,i)&&i.lastIndexOf("*")===a&&(l=i,y=t.slice(a,t.length-c.length))}}if(l){const i=resolvePackageTarget(e,c[l],y,l,n,!0,!1,t.endsWith("/"),a);if(null==i)throw exportsNotFound(t,e,n);return i}throw exportsNotFound(t,e,n)}function patternKeyCompare(e,t){const i=e.indexOf("*"),n=t.indexOf("*"),a=-1===i?e.length:i+1,c=-1===n?t.length:n+1;return a>c?-1:c>a||-1===i?1:-1===n||e.length>t.length?-1:t.length>e.length?1:0}function packageImportsResolve(e,t,i){if("#"===e||e.startsWith("#/")||e.endsWith("/")){throw new Et(e,"is not a valid internal imports specifier name",(0,Qe.fileURLToPath)(t))}let n;const a=getPackageScopeConfig(t);if(a.exists){n=(0,Qe.pathToFileURL)(a.pjsonPath);const c=a.imports;if(c)if(Rt.call(c,e)&&!e.includes("*")){const a=resolvePackageTarget(n,c[e],"",e,t,!1,!0,!1,i);if(null!=a)return a}else{let a="",l="";const y=Object.getOwnPropertyNames(c);let E=-1;for(;++E<y.length;){const t=y[E],i=t.indexOf("*");if(-1!==i&&e.startsWith(t.slice(0,-1))){const n=t.slice(i+1);e.length>=t.length&&e.endsWith(n)&&1===patternKeyCompare(a,t)&&t.lastIndexOf("*")===i&&(a=t,l=e.slice(i,e.length-n.length))}}if(a){const e=resolvePackageTarget(n,c[a],l,a,t,!0,!0,!1,i);if(null!=e)return e}}}throw function(e,t,i){return new Ct(e,t&&(0,Qe.fileURLToPath)(new URL(".",t)),(0,Qe.fileURLToPath)(i))}(e,n,t)}function packageResolve(e,t,i){if(Be.builtinModules.includes(e))return new URL("node:"+e);const{packageName:n,packageSubpath:a,isScoped:c}=function(e,t){let i=e.indexOf("/"),n=!0,a=!1;"@"===e[0]&&(a=!0,-1===i||0===e.length?n=!1:i=e.indexOf("/",i+1));const c=-1===i?e:e.slice(0,i);if(null!==Lt.exec(c)&&(n=!1),!n)throw new Et(e,"is not a valid package name",(0,Qe.fileURLToPath)(t));return{packageName:c,packageSubpath:"."+(-1===i?"":e.slice(i)),isScoped:a}}(e,t),l=getPackageScopeConfig(t);if(l.exists){const e=(0,Qe.pathToFileURL)(l.pjsonPath);if(l.name===n&&void 0!==l.exports&&null!==l.exports)return packageExportsResolve(e,a,l,t,i)}let y,E=new URL("./node_modules/"+n+"/package.json",t),w=(0,Qe.fileURLToPath)(E);do{const l=tryStatSync(w.slice(0,-13));if(!l||!l.isDirectory()){y=w,E=new URL((c?"../../../../node_modules/":"../../../node_modules/")+n+"/package.json",E),w=(0,Qe.fileURLToPath)(E);continue}const C=read(w,{base:t,specifier:e});return void 0!==C.exports&&null!==C.exports?packageExportsResolve(E,a,C,t,i):"."===a?legacyMainResolve(E,C,t):new URL(a,E)}while(w.length!==y.length)}function moduleResolve(e,t,i,n){void 0===i&&(i=getConditionsSet());const a=t.protocol,c="data:"===a||"http:"===a||"https:"===a;let l;if(function(e){return""!==e&&("/"===e[0]||function(e){if("."===e[0]){if(1===e.length||"/"===e[1])return!0;if("."===e[1]&&(2===e.length||"/"===e[2]))return!0}return!1}(e))}(e))try{l=new URL(e,t)}catch(i){const n=new Tt(e,t);throw n.cause=i,n}else if("file:"===a&&"#"===e[0])l=packageImportsResolve(e,t,i);else try{l=new URL(e)}catch(n){if(c&&!Be.builtinModules.includes(e)){const i=new Tt(e,t);throw i.cause=n,i}l=packageResolve(e,t,i)}return Ze.ok(void 0!==l,"expected to be defined"),"file:"!==l.protocol?l:function(e,t){if(null!==Ot.exec(e.pathname))throw new Et(e.pathname,'must not include encoded "/" or "\\" characters',(0,Qe.fileURLToPath)(t));let i;try{i=(0,Qe.fileURLToPath)(e)}catch(i){const n=i;throw Object.defineProperty(n,"input",{value:String(e)}),Object.defineProperty(n,"module",{value:String(t)}),n}const n=tryStatSync(i.endsWith("/")?i.slice(-1):i);if(n&&n.isDirectory()){const n=new It(i,(0,Qe.fileURLToPath)(t));throw n.url=String(e),n}if(!n||!n.isFile()){const n=new wt(i||e.pathname,t&&(0,Qe.fileURLToPath)(t),!0);throw n.url=String(e),n}{const t=(0,$e.realpathSync)(i),{search:n,hash:a}=e;(e=(0,Qe.pathToFileURL)(t+(i.endsWith(et.sep)?"/":""))).search=n,e.hash=a}return e}(l,t)}function fileURLToPath(e){return"string"!=typeof e||e.startsWith("file://")?normalizeSlash((0,Qe.fileURLToPath)(e)):normalizeSlash(e)}function pathToFileURL(e){return(0,Qe.pathToFileURL)(fileURLToPath(e)).toString()}const Ut=new Set(["node","import"]),Mt=[".mjs",".cjs",".js",".json"],jt=new Set(["ERR_MODULE_NOT_FOUND","ERR_UNSUPPORTED_DIR_IMPORT","MODULE_NOT_FOUND","ERR_PACKAGE_PATH_NOT_EXPORTED"]);function _tryModuleResolve(e,t,i){try{return moduleResolve(e,t,i)}catch(e){if(!jt.has(e?.code))throw e}}function _resolve(e,t={}){if("string"!=typeof e){if(!(e instanceof URL))throw new TypeError("input must be a `string` or `URL`");e=fileURLToPath(e)}if(/(?:node|data|http|https):/.test(e))return e;if(st.has(e))return"node:"+e;if(e.startsWith("file://")&&(e=fileURLToPath(e)),isAbsolute(e))try{if((0,$e.statSync)(e).isFile())return pathToFileURL(e)}catch(e){if("ENOENT"!==e?.code)throw e}const i=t.conditions?new Set(t.conditions):Ut,n=(Array.isArray(t.url)?t.url:[t.url]).filter(Boolean).map(e=>new URL(function(e){return"string"!=typeof e&&(e=e.toString()),/(?:node|data|http|https|file):/.test(e)?e:st.has(e)?"node:"+e:"file://"+encodeURI(normalizeSlash(e))}(e.toString())));0===n.length&&n.push(new URL(pathToFileURL(process.cwd())));const a=[...n];for(const e of n)"file:"===e.protocol&&a.push(new URL("./",e),new URL(dist_joinURL(e.pathname,"_index.js"),e),new URL("node_modules",e));let c;for(const n of a){if(c=_tryModuleResolve(e,n,i),c)break;for(const a of["","/index"]){for(const l of t.extensions||Mt)if(c=_tryModuleResolve(dist_joinURL(e,a)+l,n,i),c)break;if(c)break}if(c)break}if(!c){const t=new Error(`Cannot find module ${e} imported from ${a.join(", ")}`);throw t.code="ERR_MODULE_NOT_FOUND",t}return pathToFileURL(c)}function resolveSync(e,t){return _resolve(e,t)}function resolvePathSync(e,t){return fileURLToPath(resolveSync(e,t))}const Ft=/(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m,Bt=/\/\*.+?\*\/|\/\/.*(?=[nr])/g;function hasESMSyntax(e,t={}){return t.stripComments&&(e=e.replace(Bt,"")),Ft.test(e)}function escapeStringRegexp(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const $t=new Set(["/","\\",void 0]),qt=Symbol.for("pathe:normalizedAlias"),Wt=/[/\\]/;function normalizeAliases(e){if(e[qt])return e;const t=Object.fromEntries(Object.entries(e).sort(([e],[t])=>function(e,t){return t.split("/").length-e.split("/").length}(e,t)));for(const e in t)for(const i in t)i===e||e.startsWith(i)||t[e]?.startsWith(i)&&$t.has(t[e][i.length])&&(t[e]=t[i]+t[e].slice(i.length));return Object.defineProperty(t,qt,{value:!0,enumerable:!1}),t}function utils_hasTrailingSlash(e="/"){const t=e[e.length-1];return"/"===t||"\\"===t}var Gt={rE:"2.6.1"};const Kt=__webpack_require__(7598);var Ht=__nested_rspack_require_27261__.n(Kt);const zt=globalThis.process?.env||Object.create(null),Jt=globalThis.process||{env:zt},Yt=void 0!==Jt&&Jt.env&&Jt.env.NODE_ENV||void 0,Qt=[["claude",["CLAUDECODE","CLAUDE_CODE"]],["replit",["REPL_ID"]],["gemini",["GEMINI_CLI"]],["codex",["CODEX_SANDBOX","CODEX_THREAD_ID"]],["opencode",["OPENCODE"]],["pi",[dist_i("PATH",/\.pi[\\/]agent/)]],["auggie",["AUGMENT_AGENT"]],["goose",["GOOSE_PROVIDER"]],["devin",[dist_i("EDITOR",/devin/)]],["cursor",["CURSOR_AGENT"]],["kiro",[dist_i("TERM_PROGRAM",/kiro/)]]];function dist_i(e,t){return()=>{let i=zt[e];return!!i&&t.test(i)}}const Zt=function(){let e=zt.AI_AGENT;if(e)return{name:e.toLowerCase()};for(let[e,t]of Qt)for(let i of t)if("string"==typeof i?zt[i]:i())return{name:e};return{}}(),Xt=(Zt.name,Zt.name,[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["GOOGLE_CLOUDRUN","K_SERVICE"],["GOOGLE_CLOUDRUN_JOB","CLOUD_RUN_JOB"],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["JENKINS","JENKINS_URL"],["HUDSON","HUDSON_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOY"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}],["EDGEONE_PAGES","EO_PAGES_CI",{ci:!0}]]);const ei=function(){for(let e of Xt)if(zt[e[1]||e[0]])return{name:e[0].toLowerCase(),...e[2]};return"/bin/jsh"===zt.SHELL&&Jt.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}(),ti=(ei.name,Jt.platform||""),ii=!!zt.CI||!1!==ei.ci,si=!!Jt.stdout?.isTTY,ri=(zt.DEBUG,"test"===Yt||!!zt.TEST),ni=("production"===Yt||zt.MODE,"dev"===Yt||"development"===Yt||zt.MODE,zt.MINIMAL,/^win/i.test(ti)),ai=(/^linux/i.test(ti),/^darwin/i.test(ti),!zt.NO_COLOR&&(!!zt.FORCE_COLOR||(si||ni)&&zt.TERM),(Jt.versions?.node||"").replace(/^v/,"")||null),oi=(Number(ai?.split(".")[0]),!!Jt?.versions?.node),ci="Bun"in globalThis,hi="Deno"in globalThis,li="fastly"in globalThis,pi=[["Netlify"in globalThis,"netlify"],["EdgeRuntime"in globalThis,"edge-light"],["Cloudflare-Workers"===globalThis.navigator?.userAgent,"workerd"],[li,"fastly"],[hi,"deno"],[ci,"bun"],[oi,"node"]];!function(){let e=pi.find(e=>e[0]);if(e)e[1]}();const ui=__webpack_require__(7066),di=ui?.WriteStream?.prototype?.hasColors?.()??!1,base_format=(e,t)=>{if(!di)return e=>e;const i=`[${e}m`,n=`[${t}m`;return e=>{const a=e+"";let c=a.indexOf(n);if(-1===c)return i+a+n;let l=i,y=0;const E=(22===t?n:"")+i;for(;-1!==c;)l+=a.slice(y,c)+E,y=c+n.length,c=a.indexOf(n,y);return l+=a.slice(y)+n,l}},fi=(base_format(0,0),base_format(1,22),base_format(2,22),base_format(3,23),base_format(4,24),base_format(53,55),base_format(7,27),base_format(8,28),base_format(9,29),base_format(30,39),base_format(31,39)),mi=base_format(32,39),gi=base_format(33,39),xi=base_format(34,39),vi=(base_format(35,39),base_format(36,39)),yi=(base_format(37,39),base_format(90,39));base_format(40,49),base_format(41,49),base_format(42,49),base_format(43,49),base_format(44,49),base_format(45,49),base_format(46,49),base_format(47,49),base_format(100,49),base_format(91,39),base_format(92,39),base_format(93,39),base_format(94,39),base_format(95,39),base_format(96,39),base_format(97,39),base_format(101,49),base_format(102,49),base_format(103,49),base_format(104,49),base_format(105,49),base_format(106,49),base_format(107,49);function isDir(e){if("string"!=typeof e||e.startsWith("file://"))return!1;try{return(0,$e.lstatSync)(e).isDirectory()}catch{return!1}}function utils_hash(e,t=8){return(function(){if(void 0!==Ei)return Ei;try{return Ei=!!Ht().getFips?.(),Ei}catch{return Ei=!1,Ei}}()?Ht().createHash("sha256"):Ht().createHash("md5")).update(e).digest("hex").slice(0,t)}const _i={true:mi("true"),false:gi("false"),"[rebuild]":gi("[rebuild]"),"[esm]":xi("[esm]"),"[cjs]":mi("[cjs]"),"[import]":xi("[import]"),"[require]":mi("[require]"),"[native]":vi("[native]"),"[transpile]":gi("[transpile]"),"[fallback]":fi("[fallback]"),"[unknown]":fi("[unknown]"),"[hit]":mi("[hit]"),"[miss]":gi("[miss]"),"[json]":mi("[json]"),"[data]":mi("[data]")};function debug(e,...t){if(!e.opts.debug)return;const i=process.cwd();console.log(yi(["[jiti]",...t.map(e=>e in _i?_i[e]:"string"!=typeof e?JSON.stringify(e):e.replace(i,"."))].join(" ")))}function jitiInteropDefault(e,t){return e.opts.interopDefault?function(e){const t=typeof e;if(null===e||"object"!==t&&"function"!==t)return e;const i=e.default,n=typeof i,a=null==i,c="object"===n||"function"===n;if(a&&e instanceof Promise)return e;const l="function"===n&&"function"!==t,y=c&&!(i instanceof Promise),E=new Map;return new Proxy(e,{get(t,n){if(E.has(n))return E.get(n);let c;return"__esModule"===n?c=!0:"default"===n?c=a?e:"function"==typeof i?.default&&e.__esModule?i.default:i:n in t?c=t[n]:y&&(c=i[n],"function"==typeof c&&(c=c.bind(i))),E.set(n,c),c},apply:l?(e,t,n)=>Reflect.apply(i,t,n):void 0})}(t):t}let Ei;function _booleanEnv(e,t){const i=_jsonEnv(e,t);return Boolean(i)}function _jsonEnv(e,t,i){const n=process.env[e];if(!(e in process.env))return t;try{return JSON.parse(n)}catch{return i?n:t}}const bi=/\.(c|m)?j(sx?)$/,ki=/\.(c|m)?t(sx?)$/;function jitiResolve(e,t,i){let n,a;if(e.isNativeRe.test(t))return t;if(e.resolveTsConfigPaths&&!i.skipTsConfigPaths){const n=e.resolveTsConfigPaths(t);for(const t of n){const n=jitiResolve(e,t,{...i,try:!0,skipTsConfigPaths:!0});if(n)return n}}e.alias&&(t=function(e,t){const i=pathe_M_eThtNZ_normalizeWindowsPath(e);t=normalizeAliases(t);for(const[e,n]of Object.entries(t)){if(!i.startsWith(e))continue;const t=utils_hasTrailingSlash(e)?e.slice(0,-1):e;if(utils_hasTrailingSlash(i[t.length]))return pathe_M_eThtNZ_join(n,i.slice(e.length))}return i}(t,e.alias));let c=i?.parentURL||e.url;isDir(c)&&(c=pathe_M_eThtNZ_join(c,"_index.js"));const l=(i?.async?[i?.conditions,["node","import"],["node","require"]]:[i?.conditions,["node","require"],["node","import"]]).filter(Boolean);for(const i of l){try{n=resolvePathSync(t,{url:c,conditions:i,extensions:e.opts.extensions})}catch(e){a=e}if(n)return n}try{return e.nativeRequire.resolve(t,{paths:i.paths})}catch(e){a=e}for(const a of e.additionalExts){if(n=tryNativeRequireResolve(e,t+a,c,i)||tryNativeRequireResolve(e,t+"/index"+a,c,i),n)return n;if((ki.test(e.filename)||ki.test(e.parentModule?.filename||"")||bi.test(t))&&(n=tryNativeRequireResolve(e,t.replace(bi,".$1t$2"),c,i),n))return n}if(!i?.try)throw a}function tryNativeRequireResolve(e,t,i,n){try{return e.nativeRequire.resolve(t,{...n,paths:[pathe_M_eThtNZ_dirname(fileURLToPath(i)),...n?.paths||[]]})}catch{}}const wi=__webpack_require__(1455),Ci=__webpack_require__(643),Si=__webpack_require__(714);var Ii=__nested_rspack_require_27261__.n(Si);function jitiRequire(e,t,i){const n=e.parentCache||{};if(t.startsWith("node:"))return nativeImportOrRequire(e,t,i.async);if(t.startsWith("file:"))t=(0,Qe.fileURLToPath)(t);else if(t.startsWith("data:")){if(!i.async)throw new Error("`data:` URLs are only supported in ESM context. Use `import` or `jiti.import` instead.");return debug(e,"[native]","[data]","[import]",t),nativeImportOrRequire(e,t,!0)}if(Be.builtinModules.includes(t)||".pnp.js"===t)return nativeImportOrRequire(e,t,i.async);if(e.opts.virtualModules&&t in e.opts.virtualModules){debug(e,"[virtual]",t);const n=e.opts.virtualModules[t];return i.async?Promise.resolve(jitiInteropDefault(e,n)):jitiInteropDefault(e,n)}if(e.opts.tryNative&&!e.opts.transformOptions)try{if(!(t=jitiResolve(e,t,i))&&i.try)return;if(debug(e,"[try-native]",i.async&&e.nativeImport?"[import]":"[require]",t),i.async&&e.nativeImport)return e.nativeImport(t).then(i=>(!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],jitiInteropDefault(e,i))).catch(n=>(debug(e,`[try-native] Using fallback for ${t} because of an error:`,n),jitiRequire({...e,opts:{...e.opts,tryNative:!1}},t,i)));{const i=e.nativeRequire(t);return!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],jitiInteropDefault(e,i)}}catch(i){debug(e,`[try-native] Using fallback for ${t} because of an error:`,i)}const a=jitiResolve(e,t,i);if(!a&&i.try)return;const c=extname(a);if(".json"===c){debug(e,"[json]",a);const t=e.nativeRequire(a);return t&&!("default"in t)&&Object.defineProperty(t,"default",{value:t,enumerable:!1}),t}if(c&&!e.opts.extensions.includes(c))return debug(e,"[native]","[unknown]",i.async?"[import]":"[require]",a),nativeImportOrRequire(e,a,i.async);if(e.isNativeRe.test(a))return debug(e,"[native]",i.async?"[import]":"[require]",a),nativeImportOrRequire(e,a,i.async);if(n[a])return jitiInteropDefault(e,n[a]?.exports);if(e.opts.moduleCache){const t=e.nativeRequire.cache[a];if(t?.loaded)return jitiInteropDefault(e,t.exports)}const l=(0,$e.readFileSync)(a,"utf8");return eval_evalModule(e,l,{id:t,filename:a,ext:c,cache:n,async:i.async})}function nativeImportOrRequire(e,t,i){return i&&e.nativeImport?e.nativeImport(function(e){return ni&&isAbsolute(e)?pathToFileURL(e):e}(t)).then(t=>jitiInteropDefault(e,t)):jitiInteropDefault(e,e.nativeRequire(t))}const Ti="9";function getCache(e,t,i){if(!e.opts.fsCache||!t.filename)return i();const n=` /* v${Ti}-${utils_hash(t.source,16)} */\n`;let a=`${basename(pathe_M_eThtNZ_dirname(t.filename))}-${function(e){const t=e.split(Wt).pop();if(!t)return;const i=t.lastIndexOf(".");return i<=0?t:t.slice(0,i)}(t.filename)}`+(e.opts.sourceMaps?"+map":"")+(t.interopDefault?".i":"")+`.${utils_hash(t.filename)}`+(t.async?".mjs":".cjs");t.jsx&&t.filename.endsWith("x")&&(a+="x");const c=e.opts.fsCache,l=pathe_M_eThtNZ_join(c,a);if(!e.opts.rebuildFsCache&&(0,$e.existsSync)(l)){const i=(0,$e.readFileSync)(l,"utf8");if(i.endsWith(n))return debug(e,"[cache]","[hit]",t.filename,"~>",l),i}debug(e,"[cache]","[miss]",t.filename);const y=i();return y.includes("__JITI_ERROR__")||((0,$e.writeFileSync)(l,y+n,"utf8"),debug(e,"[cache]","[store]",t.filename,"~>",l)),y}function prepareCacheDir(t){if(!0===t.opts.fsCache&&(t.opts.fsCache=function(t){const i=t.filename&&pathe_M_eThtNZ_resolve(t.filename,"../node_modules");if(i&&(0,$e.existsSync)(i))return pathe_M_eThtNZ_join(i,".cache/jiti");let n=(0,e.tmpdir)();if(process.env.TMPDIR&&n===process.cwd()&&!process.env.JITI_RESPECT_TMPDIR_ENV){const t=process.env.TMPDIR;delete process.env.TMPDIR,n=(0,e.tmpdir)(),process.env.TMPDIR=t}return pathe_M_eThtNZ_join(n,"jiti")}(t)),t.opts.fsCache)try{if((0,$e.mkdirSync)(t.opts.fsCache,{recursive:!0}),!function(e){try{return(0,$e.accessSync)(e,$e.constants.W_OK),!0}catch{return!1}}(t.opts.fsCache))throw new Error("directory is not writable!")}catch(e){debug(t,"Error creating cache directory at ",t.opts.fsCache,e),t.opts.fsCache=!1}}function transform(e,t){let i=getCache(e,t,()=>{const i=e.opts.transform({...e.opts.transformOptions,babel:{...e.opts.sourceMaps?{sourceFileName:t.filename,sourceMaps:"inline"}:{},...e.opts.transformOptions?.babel},interopDefault:e.opts.interopDefault,...t});return i.error&&e.opts.debug&&debug(e,i.error),i.code});return i.startsWith("#!")&&(i="// "+i),i}function eval_evalModule(t,i,n={}){const a=n.id||(n.filename?basename(n.filename):`_jitiEval.${n.ext||(n.async?"mjs":"js")}`),c=n.filename||jitiResolve(t,a,{async:n.async}),l=n.ext||extname(c),y=n.cache||t.parentCache||{},E=/\.[cm]?tsx?$/.test(l),w=".mjs"===l||".js"===l&&"module"===function(e){for(;e&&"."!==e&&"/"!==e;){e=pathe_M_eThtNZ_join(e,"..");try{const t=(0,$e.readFileSync)(pathe_M_eThtNZ_join(e,"package.json"),"utf8");try{return JSON.parse(t)}catch{}break}catch{}}}(c)?.type,C=".cjs"===l,S=n.forceTranspile??(!C&&!(w&&n.async)&&(E||w||t.isTransformRe.test(c)||hasESMSyntax(i))),I=Ci.performance.now();if(S){i=transform(t,{filename:c,source:i,ts:E,async:n.async??!1,jsx:t.opts.jsx});const e=Math.round(1e3*(Ci.performance.now()-I))/1e3;debug(t,"[transpile]",n.async?"[esm]":"[cjs]",c,`(${e}ms)`)}else{if(debug(t,"[native]",n.async?"[import]":"[require]",c),n.async)return Promise.resolve(nativeImportOrRequire(t,c,n.async)).catch(e=>(debug(t,"Native import error:",e),debug(t,"[fallback]",c),eval_evalModule(t,i,{...n,forceTranspile:!0})));try{return nativeImportOrRequire(t,c,n.async)}catch(e){debug(t,"Native require error:",e),debug(t,"[fallback]",c),i=transform(t,{filename:c,source:i,ts:E,async:n.async??!1,jsx:t.opts.jsx})}}const N=new Be.Module(c);N.filename=c,t.parentModule&&(N.parent=t.parentModule,Array.isArray(t.parentModule.children)&&!t.parentModule.children.includes(N)&&t.parentModule.children.push(N));const O=createJiti(c,t.opts,{parentModule:N,parentCache:y,nativeImport:t.nativeImport,onError:t.onError,createRequire:t.createRequire},!0);let j;N.require=O,N.path=pathe_M_eThtNZ_dirname(c),N.paths=Be.Module._nodeModulePaths(N.path),y[c]=N,t.opts.moduleCache&&(t.nativeRequire.cache[c]=N);const F=function(e,t){return`(${t?.async?"async ":""}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e}\n});`}(i,{async:n.async});try{j=Ii().runInThisContext(F,{filename:c,lineOffset:0,displayErrors:!1})}catch(i){"SyntaxError"===i.name&&n.async&&t.nativeImport?(debug(t,"[esm]","[import]","[fallback]",c),j=function(t,i,n,a,c){const l=`export default ${i}`,y=c?void 0:`data:text/javascript;base64,${Buffer.from(l).toString("base64")}`;return(...i)=>{let c;const importViaTempFile=()=>(c=function(t,i){const n=pathe_M_eThtNZ_join((0,e.tmpdir)(),"jiti-esm");try{(0,$e.mkdirSync)(n,{recursive:!0})}catch{}const a=pathe_M_eThtNZ_join(n,`${basename(i,extname(i))}-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);return(0,$e.writeFileSync)(a,t),a}(l,n),debug(t,"[esm]","[tempfile]",c),a(pathToFileURL(c))),E=y?a(y).catch(e=>{if("ENAMETOOLONG"!==e?.code)throw e;return importViaTempFile()}):importViaTempFile();return E.then(e=>e.default(...i)).finally(()=>{c&&(0,wi.unlink)(c).catch(()=>{})})}}(t,F,c,t.nativeImport,t.opts.esmEvalTempFile)):(t.opts.moduleCache&&delete t.nativeRequire.cache[c],t.onError(i))}let B;try{B=j(N.exports,N.require,N,N.filename,pathe_M_eThtNZ_dirname(N.filename),O.import,O.esmResolve)}catch(e){t.opts.moduleCache&&delete t.nativeRequire.cache[c],t.onError(e)}function next(){if(N.exports&&N.exports.__JITI_ERROR__){const{filename:e,line:i,column:n,code:a,message:c}=N.exports.__JITI_ERROR__,l=new Error(`${a}: ${c} \n ${`${e}:${i}:${n}`}`);Error.captureStackTrace(l,jitiRequire),t.onError(l)}N.loaded=!0;return jitiInteropDefault(t,N.exports)}return n.async?Promise.resolve(B).then(next):next()}const Ri="win32"===(0,e.platform)();function createJiti(e,t={},i,n=!1){const a=n?t:function(e){const t={fsCache:_booleanEnv("JITI_FS_CACHE",_booleanEnv("JITI_CACHE",!0)),rebuildFsCache:_booleanEnv("JITI_REBUILD_FS_CACHE",!1),moduleCache:_booleanEnv("JITI_MODULE_CACHE",_booleanEnv("JITI_REQUIRE_CACHE",!0)),debug:_booleanEnv("JITI_DEBUG",!1),sourceMaps:_booleanEnv("JITI_SOURCE_MAPS",!1),interopDefault:_booleanEnv("JITI_INTEROP_DEFAULT",!0),extensions:_jsonEnv("JITI_EXTENSIONS",[".js",".mjs",".cjs",".ts",".tsx",".mts",".cts",".mtsx",".ctsx"]),alias:_jsonEnv("JITI_ALIAS",{}),nativeModules:_jsonEnv("JITI_NATIVE_MODULES",[]),transformModules:_jsonEnv("JITI_TRANSFORM_MODULES",[]),tryNative:_jsonEnv("JITI_TRY_NATIVE","Bun"in globalThis),esmEvalTempFile:_booleanEnv("JITI_ESM_EVAL_TEMP_FILE",!1),jsx:_booleanEnv("JITI_JSX",!1),tsconfigPaths:_jsonEnv("JITI_TSCONFIG_PATHS",!1,!0)};t.jsx&&t.extensions.push(".jsx",".tsx");const i={};return void 0!==e.cache&&(i.fsCache=e.cache),void 0!==e.requireCache&&(i.moduleCache=e.requireCache),{...t,...i,...e}}(t);"string"==typeof e&&e.startsWith("file://")&&(e=fileURLToPath(e));const c=a.alias&&Object.keys(a.alias).length>0?normalizeAliases(a.alias||{}):void 0;let l;if(a.tsconfigPaths){const{getTsconfig:t,createPathsMatcher:i}=__nested_rspack_require_27261__("./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs"),n=t("string"==typeof a.tsconfigPaths?a.tsconfigPaths:pathe_M_eThtNZ_dirname(e));n&&(l=i(n))}const y=["typescript","jiti",...a.nativeModules||[]],E=new RegExp(`node_modules/(${y.map(e=>escapeStringRegexp(e)).join("|")})/`),w=[...a.transformModules||[]],C=new RegExp(`node_modules/(${w.map(e=>escapeStringRegexp(e)).join("|")})/`);e||(e=process.cwd()),!n&&isDir(e)&&(e=pathe_M_eThtNZ_join(e,"_index.js"));const S=pathToFileURL(e),I=[...a.extensions].filter(e=>".js"!==e),N=i.createRequire(Ri?e.replace(/\//g,"\\"):e),O={filename:e,url:S,opts:a,alias:c,resolveTsConfigPaths:l,nativeModules:y,transformModules:w,isNativeRe:E,isTransformRe:C,additionalExts:I,nativeRequire:N,onError:i.onError,parentModule:i.parentModule,parentCache:i.parentCache,nativeImport:i.nativeImport,createRequire:i.createRequire};n||debug(O,"[init]",...[["version:",Gt.rE],["module-cache:",a.moduleCache],["fs-cache:",a.fsCache],["rebuild-fs-cache:",a.rebuildFsCache],["interop-defaults:",a.interopDefault]].flat()),n||prepareCacheDir(O);const j=Object.assign(function(e){return jitiRequire(O,e,{async:!1})},{cache:a.moduleCache?N.cache:Object.create(null),extensions:N.extensions,main:N.main,options:a,resolve:Object.assign(function(e,t){return jitiResolve(O,e,{...t,async:!1})},{paths:N.resolve.paths}),transform:e=>transform(O,e),evalModule:(e,t)=>eval_evalModule(O,e,t),async import(e,t){const i=await jitiRequire(O,e,{...t,async:!0});return t?.default?i?.default??i:i},esmResolve(e,t){"string"==typeof t&&(t={parentURL:t});const i=jitiResolve(O,e,{parentURL:S,...t,async:!0});return!i||"string"!=typeof i||i.startsWith("file://")?i:pathToFileURL(i)}});return j}})(),module.exports=i.default})();
|
|
55149
55702
|
|
|
55150
55703
|
},
|
|
55151
55704
|
3285(__unused_rspack_module, exports, __webpack_require__) {
|
|
@@ -63711,4 +64264,4 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
|
|
|
63711
64264
|
// module factories are used so entry inlining is disabled
|
|
63712
64265
|
// startup
|
|
63713
64266
|
// Load entry module and return exports
|
|
63714
|
-
var __webpack_exports__ = __webpack_require__(
|
|
64267
|
+
var __webpack_exports__ = __webpack_require__(4589);
|