jiek 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cli.cjs +1 -1
- package/dist/cli.d.cts +17 -1
- package/dist/cli.d.ts +17 -1
- package/dist/cli.js +1 -1
- package/dist/cli.min.cjs +1 -1
- package/dist/cli.min.js +1 -1
- package/dist/rollup/index.cjs +116 -87
- package/dist/rollup/index.d.cts +17 -1
- package/dist/rollup/index.d.ts +17 -1
- package/dist/rollup/index.js +114 -85
- package/dist/rollup/index.min.cjs +3 -3
- package/dist/rollup/index.min.js +2 -2
- package/package.json +3 -3
- package/src/rollup/base.ts +22 -1
- package/src/rollup/index.ts +49 -110
- package/src/rollup/plugins/skip.ts +13 -15
- package/src/utils/ts.ts +94 -0
package/dist/rollup/index.js
CHANGED
@@ -8,15 +8,15 @@ import json from '@rollup/plugin-json';
|
|
8
8
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
9
9
|
import terser from '@rollup/plugin-terser';
|
10
10
|
import { sendMessage } from 'execa';
|
11
|
-
import { parse } from 'jsonc-parser';
|
12
|
-
import require$$0 from 'util';
|
13
|
-
import require$$0$1 from 'path';
|
14
11
|
import esbuild from 'rollup-plugin-esbuild';
|
15
12
|
import ts from 'typescript';
|
13
|
+
import require$$0 from 'util';
|
14
|
+
import require$$0$1 from 'path';
|
16
15
|
import { program } from 'commander';
|
17
16
|
import { load } from 'js-yaml';
|
18
17
|
import { createRequire } from 'node:module';
|
19
18
|
import '@pnpm/filter-workspace-packages';
|
19
|
+
import { parse } from 'jsonc-parser';
|
20
20
|
|
21
21
|
var utils$1 = {};
|
22
22
|
|
@@ -4332,6 +4332,65 @@ function loadConfig(dir) {
|
|
4332
4332
|
return module.default ?? module;
|
4333
4333
|
}
|
4334
4334
|
|
4335
|
+
const getTSConfig = (p) => !fs.existsSync(p) || !fs.statSync(p).isFile() ? {} : parse(fs.readFileSync(p, "utf-8"), [], { allowTrailingComma: true, allowEmptyContent: true });
|
4336
|
+
const getExtendTSConfig = (tsconfigPath) => {
|
4337
|
+
tsconfigPath = resolve(tsconfigPath);
|
4338
|
+
const tsconfigPathDirname = dirname(tsconfigPath);
|
4339
|
+
const { extends: exts, ...tsconfig } = getTSConfig(tsconfigPath);
|
4340
|
+
const resolvePaths = (paths) => paths?.map((p) => resolve(tsconfigPathDirname, p)) ?? [];
|
4341
|
+
const extendsPaths = resolvePaths(
|
4342
|
+
exts ? Array.isArray(exts) ? exts : [exts] : []
|
4343
|
+
);
|
4344
|
+
if (extendsPaths.length === 0)
|
4345
|
+
return tsconfig;
|
4346
|
+
return extendsPaths.map(getExtendTSConfig).concat(tsconfig).reduce((acc, { compilerOptions = {}, references: _, ...curr }) => ({
|
4347
|
+
...acc,
|
4348
|
+
...curr,
|
4349
|
+
compilerOptions: {
|
4350
|
+
...acc.compilerOptions,
|
4351
|
+
...compilerOptions
|
4352
|
+
}
|
4353
|
+
}), {});
|
4354
|
+
};
|
4355
|
+
const getCompilerOptionsByFilePath = (tsconfigPath, filePath) => {
|
4356
|
+
tsconfigPath = resolve(tsconfigPath);
|
4357
|
+
filePath = resolve(filePath);
|
4358
|
+
const tsconfigPathDirname = dirname(tsconfigPath);
|
4359
|
+
const tsconfig = getExtendTSConfig(tsconfigPath);
|
4360
|
+
const resolvePaths = (paths) => paths?.map((p) => resolve(tsconfigPathDirname, p)) ?? [];
|
4361
|
+
const [
|
4362
|
+
references,
|
4363
|
+
files,
|
4364
|
+
include,
|
4365
|
+
exclude
|
4366
|
+
] = [
|
4367
|
+
tsconfig.references?.map(({ path }) => path),
|
4368
|
+
tsconfig.files,
|
4369
|
+
tsconfig.include,
|
4370
|
+
tsconfig.exclude
|
4371
|
+
].map(resolvePaths);
|
4372
|
+
if (exclude.length > 0 && exclude.some((i) => micromatchExports.isMatch(filePath, i)))
|
4373
|
+
return;
|
4374
|
+
if (tsconfig.files?.length === 0 && tsconfig.include?.length === 0)
|
4375
|
+
return;
|
4376
|
+
let isInclude = false;
|
4377
|
+
isInclude || (isInclude = files.length > 0 && files.includes(filePath));
|
4378
|
+
isInclude || (isInclude = include.length > 0 && include.some((i) => micromatchExports.isMatch(filePath, i)));
|
4379
|
+
if (isInclude) {
|
4380
|
+
return tsconfig.compilerOptions ?? {};
|
4381
|
+
} else {
|
4382
|
+
if (tsconfig.files && tsconfig.files.length > 0 || tsconfig.include && tsconfig.include.length > 0)
|
4383
|
+
return;
|
4384
|
+
}
|
4385
|
+
references.reverse();
|
4386
|
+
for (const ref of references) {
|
4387
|
+
const compilerOptions = getCompilerOptionsByFilePath(ref, filePath);
|
4388
|
+
if (compilerOptions)
|
4389
|
+
return compilerOptions;
|
4390
|
+
}
|
4391
|
+
return tsconfig.compilerOptions;
|
4392
|
+
};
|
4393
|
+
|
4335
4394
|
var progress = (options = {}) => {
|
4336
4395
|
const { onEvent } = options;
|
4337
4396
|
return {
|
@@ -4353,19 +4412,17 @@ var progress = (options = {}) => {
|
|
4353
4412
|
};
|
4354
4413
|
};
|
4355
4414
|
|
4356
|
-
var skip = (options = {}) => {
|
4357
|
-
|
4358
|
-
|
4359
|
-
|
4360
|
-
|
4361
|
-
|
4362
|
-
|
4363
|
-
|
4364
|
-
return "";
|
4365
|
-
}
|
4415
|
+
var skip = (options = {}) => ({
|
4416
|
+
name: "skip",
|
4417
|
+
// skip the specified files by `options.patterns`
|
4418
|
+
load(id) {
|
4419
|
+
if (options.patterns?.some(
|
4420
|
+
(pattern) => typeof pattern === "string" ? id.includes(pattern) : pattern.test(id)
|
4421
|
+
)) {
|
4422
|
+
return "";
|
4366
4423
|
}
|
4367
|
-
}
|
4368
|
-
};
|
4424
|
+
}
|
4425
|
+
});
|
4369
4426
|
|
4370
4427
|
function externalResolver(jsonOrPath = process.cwd()) {
|
4371
4428
|
const pkg = typeof jsonOrPath === "string" ? fs.existsSync(`${jsonOrPath}/package.json`) ? JSON.parse(fs.readFileSync(`${jsonOrPath}/package.json`, "utf-8")) : {} : jsonOrPath;
|
@@ -4394,6 +4451,29 @@ const jsOutdir = `./${relative(
|
|
4394
4451
|
)
|
4395
4452
|
)}`;
|
4396
4453
|
const STYLE_REGEXP = /\.(css|s[ac]ss|less|styl)$/;
|
4454
|
+
const resolveBuildPlugins = (context, plugins) => {
|
4455
|
+
if (plugins === false || plugins === void 0 || plugins === null) {
|
4456
|
+
return { js: [], dts: [] };
|
4457
|
+
}
|
4458
|
+
let js = [];
|
4459
|
+
let dts2 = [];
|
4460
|
+
switch (typeof plugins) {
|
4461
|
+
case "function":
|
4462
|
+
js = plugins("js", context);
|
4463
|
+
dts2 = plugins("dts", context);
|
4464
|
+
break;
|
4465
|
+
case "object":
|
4466
|
+
if ("js" in plugins || "dts" in plugins) {
|
4467
|
+
js = plugins.js ?? [];
|
4468
|
+
dts2 = plugins.dts ?? [];
|
4469
|
+
} else {
|
4470
|
+
js = plugins;
|
4471
|
+
dts2 = plugins;
|
4472
|
+
}
|
4473
|
+
break;
|
4474
|
+
}
|
4475
|
+
return { js, dts: dts2 };
|
4476
|
+
};
|
4397
4477
|
const resolveWorkspacePath = (p) => resolve(WORKSPACE_ROOT, p);
|
4398
4478
|
const pascalCase = (str) => str.replace(/[@|/-](\w)/g, (_, $1) => $1.toUpperCase()).replace(/(?:^|-)(\w)/g, (_, $1) => $1.toUpperCase());
|
4399
4479
|
const reveal = (obj, keys) => keys.reduce((acc, key) => {
|
@@ -4423,73 +4503,16 @@ const withMinify = (output, minify = build?.output?.minify) => minify === false
|
|
4423
4503
|
]
|
4424
4504
|
}
|
4425
4505
|
];
|
4426
|
-
const
|
4427
|
-
const
|
4428
|
-
|
4429
|
-
|
4430
|
-
|
4431
|
-
|
4432
|
-
|
4433
|
-
|
4434
|
-
|
4435
|
-
|
4436
|
-
return tsconfig;
|
4437
|
-
return extendsPaths.map(getExtendTSConfig).concat(tsconfig).reduce((acc, { compilerOptions = {}, references: _, ...curr }) => ({
|
4438
|
-
...acc,
|
4439
|
-
...curr,
|
4440
|
-
compilerOptions: {
|
4441
|
-
...acc.compilerOptions,
|
4442
|
-
...compilerOptions
|
4443
|
-
}
|
4444
|
-
}), {});
|
4445
|
-
};
|
4446
|
-
const getCompilerOptionsByFilePath = (tsconfigPath, filePath) => {
|
4447
|
-
tsconfigPath = resolve(tsconfigPath);
|
4448
|
-
filePath = resolve(filePath);
|
4449
|
-
const tsconfigPathDirname = dirname(tsconfigPath);
|
4450
|
-
const tsconfig = getExtendTSConfig(tsconfigPath);
|
4451
|
-
const resolvePaths = (paths) => paths?.map((p) => resolve(tsconfigPathDirname, p)) ?? [];
|
4452
|
-
const [
|
4453
|
-
references,
|
4454
|
-
files,
|
4455
|
-
include,
|
4456
|
-
exclude
|
4457
|
-
] = [
|
4458
|
-
tsconfig.references?.map(({ path }) => path),
|
4459
|
-
tsconfig.files,
|
4460
|
-
tsconfig.include,
|
4461
|
-
tsconfig.exclude
|
4462
|
-
].map(resolvePaths);
|
4463
|
-
if (exclude.length > 0 && exclude.some((i) => micromatchExports.isMatch(filePath, i)))
|
4464
|
-
return;
|
4465
|
-
if (tsconfig.files?.length === 0 && tsconfig.include?.length === 0)
|
4466
|
-
return;
|
4467
|
-
let isInclude = false;
|
4468
|
-
isInclude || (isInclude = files.length > 0 && files.includes(filePath));
|
4469
|
-
isInclude || (isInclude = include.length > 0 && include.some((i) => micromatchExports.isMatch(filePath, i)));
|
4470
|
-
if (isInclude) {
|
4471
|
-
return tsconfig.compilerOptions ?? {};
|
4472
|
-
} else {
|
4473
|
-
if (tsconfig.files && tsconfig.files.length > 0 || tsconfig.include && tsconfig.include.length > 0)
|
4474
|
-
return;
|
4475
|
-
}
|
4476
|
-
references.reverse();
|
4477
|
-
for (const ref of references) {
|
4478
|
-
const compilerOptions = getCompilerOptionsByFilePath(ref, filePath);
|
4479
|
-
if (compilerOptions)
|
4480
|
-
return compilerOptions;
|
4481
|
-
}
|
4482
|
-
return tsconfig.compilerOptions;
|
4483
|
-
};
|
4484
|
-
const generateConfigs = ({
|
4485
|
-
path,
|
4486
|
-
name,
|
4487
|
-
input,
|
4488
|
-
output,
|
4489
|
-
external,
|
4490
|
-
pkgIsModule,
|
4491
|
-
conditionals
|
4492
|
-
}, options = {}) => {
|
4506
|
+
const generateConfigs = (context, options = {}) => {
|
4507
|
+
const {
|
4508
|
+
path,
|
4509
|
+
name,
|
4510
|
+
input,
|
4511
|
+
output,
|
4512
|
+
external,
|
4513
|
+
pkgIsModule,
|
4514
|
+
conditionals
|
4515
|
+
} = context;
|
4493
4516
|
const isModule = conditionals.includes("import");
|
4494
4517
|
const isCommonJS = conditionals.includes("require");
|
4495
4518
|
const isBrowser = conditionals.includes("browser");
|
@@ -4514,6 +4537,7 @@ const generateConfigs = ({
|
|
4514
4537
|
throw new Error(errors.map((e) => e.messageText).join("\n"));
|
4515
4538
|
}
|
4516
4539
|
compilerOptions = options2;
|
4540
|
+
delete compilerOptions.composite;
|
4517
4541
|
}
|
4518
4542
|
const exportConditions = [...conditionals, ...compilerOptions.customConditions ?? []];
|
4519
4543
|
const throughEventProps = {
|
@@ -4521,6 +4545,7 @@ const generateConfigs = ({
|
|
4521
4545
|
data: { name, path, exportConditions, input }
|
4522
4546
|
};
|
4523
4547
|
const outdir = options?.output?.dir;
|
4548
|
+
const { js: jsPlugins, dts: dtsPlugins } = resolveBuildPlugins(context, build.plugins);
|
4524
4549
|
return [
|
4525
4550
|
{
|
4526
4551
|
input,
|
@@ -4543,7 +4568,9 @@ const generateConfigs = ({
|
|
4543
4568
|
minimize: true
|
4544
4569
|
})
|
4545
4570
|
).catch(() => void 0),
|
4546
|
-
esbuild(
|
4571
|
+
esbuild({
|
4572
|
+
tsconfig: dtsTSConfigPath
|
4573
|
+
}),
|
4547
4574
|
commonjs(),
|
4548
4575
|
progress({
|
4549
4576
|
onEvent: (event, message) => sendMessage(
|
@@ -4552,7 +4579,8 @@ const generateConfigs = ({
|
|
4552
4579
|
data: { ...throughEventProps.data, event, message, tags: ["js"] }
|
4553
4580
|
}
|
4554
4581
|
)
|
4555
|
-
})
|
4582
|
+
}),
|
4583
|
+
jsPlugins
|
4556
4584
|
]
|
4557
4585
|
},
|
4558
4586
|
{
|
@@ -4580,7 +4608,8 @@ const generateConfigs = ({
|
|
4580
4608
|
data: { ...throughEventProps.data, event, message, tags: ["dts"] }
|
4581
4609
|
}
|
4582
4610
|
)
|
4583
|
-
})
|
4611
|
+
}),
|
4612
|
+
dtsPlugins
|
4584
4613
|
]
|
4585
4614
|
}
|
4586
4615
|
];
|
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var e=require("node:fs"),t=require("node:path"),
|
1
|
+
"use strict";var e=require("node:fs"),t=require("node:path"),n=require("@jiek/pkger/entrypoints"),r=require("@jiek/rollup-plugin-dts"),o=require("@jiek/utils/getWorkspaceDir"),s=require("@rollup/plugin-commonjs"),u=require("@rollup/plugin-json"),a=require("@rollup/plugin-node-resolve"),i=require("@rollup/plugin-terser"),p=require("execa"),l=require("rollup-plugin-esbuild"),c=require("typescript"),f=require("util"),d=require("path"),g=require("commander"),h=require("js-yaml"),A=require("node:module");require("@pnpm/filter-workspace-packages");var R=require("jsonc-parser"),_="undefined"!=typeof document?document.currentScript:null;function E(e){return e&&e.__esModule?e:{default:e}}var y,C,m,v,S,b,x,$,H,T,w,L,O,k,N,I,M,B,j,P=E(e),D=E(t),G=E(s),U=E(u),K=E(i),q=E(l),F=E(c),Q=E(f),W=E(d),X={};function Z(){return y||(y=1,function(e){e.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find((e=>e.type===t)),e.exceedsLimit=(t,n,r=1,o)=>!1!==o&&(!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=o),e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>"brace"===e.type&&(!(e.commas>>0+e.ranges)&&(e.invalid=!0,!0)),e.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges?(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0):(e.invalid=!0,!0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),e.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){let o=e[r];Array.isArray(o)?n(o):void 0!==o&&t.push(o)}return t};return n(e),t}}(X)),X}function Y(){if(m)return C;m=1;const e=Z();return C=(t,n={})=>{let r=(t,o={})=>{let s=n.escapeInvalid&&e.isInvalidBrace(o),u=!0===t.invalid&&!0===n.escapeInvalid,a="";if(t.value)return(s||u)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(let e of t.nodes)a+=r(e);return a};return r(t)}}
|
2
2
|
/*!
|
3
3
|
* is-number <https://github.com/jonschlinkert/is-number>
|
4
4
|
*
|
@@ -10,10 +10,10 @@
|
|
10
10
|
*
|
11
11
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
12
12
|
* Released under the MIT License.
|
13
|
-
*/function z(){if(x)return b;x=1;const e=V(),t=(
|
13
|
+
*/function z(){if(x)return b;x=1;const e=V(),t=(n,s,u)=>{if(!1===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===s||n===s)return String(n);if(!1===e(s))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...u};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let i=n+":"+s+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(t.cache.hasOwnProperty(i))return t.cache[i].result;let p=Math.min(n,s),l=Math.max(n,s);if(1===Math.abs(p-l)){let e=n+"|"+s;return a.capture?`(${e})`:!1===a.wrap?e:`(?:${e})`}let f=c(n)||c(s),d={min:n,max:s,a:p,b:l},g=[],h=[];if(f&&(d.isPadded=f,d.maxLen=String(d.max).length),p<0){h=r(l<0?Math.abs(l):1,Math.abs(p),d,a),p=d.a=0}return l>=0&&(g=r(p,l,d,a)),d.negatives=h,d.positives=g,d.result=function(e,t,n){let r=o(e,t,"-",!1)||[],s=o(t,e,"",!1)||[],u=o(e,t,"-?",!0)||[];return r.concat(u).concat(s).join("|")}(h,g),!0===a.capture?d.result=`(${d.result})`:!1!==a.wrap&&g.length+h.length>1&&(d.result=`(?:${d.result})`),t.cache[i]=d,d.result};function n(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),o=r.length,s="",u=0;for(let e=0;e<o;e++){let[t,n]=r[e];t===n?s+=t:"0"!==t||"9"!==n?s+=l(t,n):u++}return u&&(s+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:s,count:[u],digits:o}}function r(e,t,r,o){let u,l=function(e,t){let n=1,r=1,o=a(e,n),u=new Set([t]);for(;e<=o&&o<=t;)u.add(o),n+=1,o=a(e,n);for(o=i(t+1,r)-1;e<o&&o<=t;)u.add(o),r+=1,o=i(t+1,r)-1;return u=[...u],u.sort(s),u}(e,t),c=[],d=e;for(let e=0;e<l.length;e++){let t=l[e],s=n(String(d),String(t),o),a="";r.isPadded||!u||u.pattern!==s.pattern?(r.isPadded&&(a=f(t,r,o)),s.string=a+s.pattern+p(s.count),c.push(s),d=t+1,u=s):(u.count.length>1&&u.count.pop(),u.count.push(s.count[0]),u.string=u.pattern+p(u.count),d=t+1)}return c}function o(e,t,n,r,o){let s=[];for(let o of e){let{string:e}=o;r||u(t,"string",e)||s.push(n+e),r&&u(t,"string",e)&&s.push(n+e)}return s}function s(e,t){return e>t?1:t>e?-1:0}function u(e,t,n){return e.some((e=>e[t]===n))}function a(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function i(e,t){return e-e%Math.pow(10,t)}function p(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function l(e,t,n){return`[${e}${t-e==1?"":"-"}${t}]`}function c(e){return/^-?(0+)\d/.test(e)}function f(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),o=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${r}}`:`0{${r}}`}}return t.cache={},t.clearCache=()=>t.cache={},b=t}
|
14
14
|
/*!
|
15
15
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
16
16
|
*
|
17
17
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
18
18
|
* Licensed under the MIT License.
|
19
|
-
*/function J(){if(H)return $;H=1;const e=q.default,t=z(),r=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),n=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,r=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++r];);return r>0},u=(e,t,r)=>{if(t>0){let r="-"===e[0]?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return!1===r?String(e):e},a=(e,t)=>{let r="-"===e[0]?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},i=(e,r,n,o)=>{if(n)return t(e,r,{wrap:!1,...o});let s=String.fromCharCode(e);return e===r?s:`[${s}-${String.fromCharCode(r)}]`},p=(e,r,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,r=n.capture?"":"?:";return t?`(${r}${e.join("|")})`:e.join("|")}return t(e,r,n)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,r)=>{if(!0===r.strictRanges)throw l([e,t]);return[]},f=(e,t,r=1,n={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===n.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,d=String(e),g=String(t),A=String(r);r=Math.max(Math.abs(r),1);let h=s(d)||s(g)||s(A),R=h?Math.max(d.length,g.length,A.length):0,_=!1===h&&!1===((e,t,r)=>"string"==typeof e||"string"==typeof t||!0===r.stringify)(e,t,n),E=n.transform||(e=>t=>!0===e?Number(t):String(t))(_);if(n.toRegex&&1===r)return i(a(e,R),a(t,R),!0,n);let y={negatives:[],positives:[]},C=[],m=0;for(;f?o>=c:o<=c;)!0===n.toRegex&&r>1?y[(v=o)<0?"negatives":"positives"].push(Math.abs(v)):C.push(u(E(o,m),R,_)),o=f?o-r:o+r,m++;var v;return!0===n.toRegex?r>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r,n=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.join("|")})`),r=o&&s?`${o}|${s}`:o||s,t.wrap?`(${n}${r})`:r})(y,n):p(C,null,{wrap:!1,...n}):C},d=(e,t,s,u={})=>{if(null==t&&n(e))return[e];if(!n(e)||!n(t))return c(e,t,u);if("function"==typeof s)return d(e,t,1,{transform:s});if(r(s))return d(e,t,0,s);let a={...u};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(e)&&o(t)?f(e,t,s,a):((e,t,r=1,n={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,n);let s=n.transform||(e=>String.fromCharCode(e)),u=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=u>a,f=Math.min(u,a),d=Math.max(u,a);if(n.toRegex&&1===r)return i(f,d,!1,n);let g=[],A=0;for(;l?u>=a:u<=a;)g.push(s(u,A)),u=l?u-r:u+r,A++;return!0===n.toRegex?p(g,null,{wrap:!1,options:n}):g})(e,t,Math.max(Math.abs(s),1),a):null==s||r(s)?d(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,a)};return $=d}function ee(){if(M)return I;M=1;const e=Y(),{MAX_LENGTH:t,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:u,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:d,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A}=N?k:(N=1,k={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return I=(h,R={})=>{if("string"!=typeof h)throw new TypeError("Expected a string");let _=R||{},E="number"==typeof _.maxLength?Math.min(t,_.maxLength):t;if(h.length>E)throw new SyntaxError(`Input length (${h.length}), exceeds max characters (${E})`);let y,C={type:"root",input:h,nodes:[]},m=[C],v=C,S=C,b=0,x=h.length,$=0,H=0;const T=()=>h[$++],w=e=>{if("text"===e.type&&"dot"===S.type&&(S.type="text"),!S||"text"!==S.type||"text"!==e.type)return v.nodes.push(e),e.parent=v,e.prev=S,S=e,e;S.value+=e.value};for(w({type:"bos"});$<x;)if(v=m[m.length-1],y=T(),y!==A&&y!==g)if(y!==r)if(y!==c)if(y!==l)if(y!==u)if(y!==a)if(y!==f&&y!==d&&y!==n)if(y!==i)if(y!==p)if(y===o&&H>0){if(v.ranges>0){v.ranges=0;let t=v.nodes.shift();v.nodes=[t,{type:"text",value:e(v)}]}w({type:"comma",value:y}),v.commas++}else if(y===s&&H>0&&0===v.commas){let e=v.nodes;if(0===H||0===e.length){w({type:"text",value:y});continue}if("dot"===S.type){if(v.range=[],S.value+=y,S.type="range",3!==v.nodes.length&&5!==v.nodes.length){v.invalid=!0,v.ranges=0,S.type="text";continue}v.ranges++,v.args=[];continue}if("range"===S.type){e.pop();let t=e[e.length-1];t.value+=S.value+y,S=t,v.ranges--;continue}w({type:"dot",value:y})}else w({type:"text",value:y});else{if("brace"!==v.type){w({type:"text",value:y});continue}let e="close";v=m.pop(),v.close=!0,w({type:e,value:y}),H--,v=m[m.length-1]}else{H++;let e=S.value&&"$"===S.value.slice(-1)||!0===v.dollar;v=w({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),m.push(v),w({type:"open",value:y})}else{let e,t=y;for(!0!==R.keepQuotes&&(y="");$<x&&(e=T());)if(e!==r){if(e===t){!0===R.keepQuotes&&(y+=e);break}y+=e}else y+=e+T();w({type:"text",value:y})}else{if("paren"!==v.type){w({type:"text",value:y});continue}v=m.pop(),w({type:"text",value:y}),v=m[m.length-1]}else v=w({type:"paren",nodes:[]}),m.push(v),w({type:"text",value:y});else{let e;for(b++;$<x&&(e=T());)if(y+=e,e!==l)if(e!==r){if(e===c&&(b--,0===b))break}else y+=T();else b++;w({type:"text",value:y})}else w({type:"text",value:"\\"+y});else w({type:"text",value:(R.keepEscaping?y:"")+T()});do{if(v=m.pop(),"root"!==v.type){v.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=m[m.length-1],t=e.nodes.indexOf(v);e.nodes.splice(t,1,...v.nodes)}}while(m.length>0);return w({type:"eos"}),C},I}function te(){if(j)return B;j=1;const e=Y(),t=function(){if(w)return T;w=1;const e=J(),t=Z();return T=(r,n={})=>{let o=(r,s={})=>{let u=t.isInvalidBrace(s),a=!0===r.invalid&&!0===n.escapeInvalid,i=!0===u||!0===a,p=!0===n.escapeInvalid?"\\":"",l="";if(!0===r.isOpen)return p+r.value;if(!0===r.isClose)return p+r.value;if("open"===r.type)return i?p+r.value:"(";if("close"===r.type)return i?p+r.value:")";if("comma"===r.type)return"comma"===r.prev.type?"":i?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let o=t.reduce(r.nodes),s=e(...o,{...n,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(r.nodes)for(let e of r.nodes)l+=o(e,r);return l};return o(r)}}(),r=function(){if(O)return L;O=1;const e=J(),t=Y(),r=Z(),n=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?r.flatten(t).map((e=>`{${e}}`)):t;for(let r of e)if(Array.isArray(r))for(let e of r)s.push(n(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?n(r,e,o):r+e);return r.flatten(s)};return L=(o,s={})=>{let u=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,i={})=>{o.queue=[];let p=i,l=i.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(n(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(n(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let a=r.reduce(o.nodes);if(r.exceedsLimit(...a,s.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=e(...a,s);return 0===i.length&&(i=t(o,s)),l.push(n(l.pop(),i)),void(o.nodes=[])}let c=r.encloseBrace(o),f=o.queue,d=o;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,f=d.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(n(f.pop(),t.value)):t.nodes&&a(t,o):l.push(n(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return r.flatten(a(o))}}(),n=ee(),o=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let e=o.create(n,t);Array.isArray(e)?r.push(...e):r.push(e)}else r=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(r=[...new Set(r)]),r};return o.parse=(e,t={})=>n(e,t),o.stringify=(t,r={})=>e("string"==typeof t?o.parse(t,r):t,r),o.compile=(e,r={})=>("string"==typeof e&&(e=o.parse(e,r)),t(e,r)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let n=r(e,t);return!0===t.noempty&&(n=n.filter(Boolean)),!0===t.nodupes&&(n=[...new Set(n)]),n},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),B=o}var re,ne,oe,se,ue,ae,ie,pe,le,ce,fe,de,ge,Ae={};function he(){if(ne)return re;ne=1;const e=F.default,t="\\\\/",r=`[^${t}]`,n="\\.",o="\\/",s="[^/]",u=`(?:${o}|$)`,a=`(?:^|${o})`,i=`${n}{1,2}${u}`,p={DOT_LITERAL:n,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:u,DOTS_SLASH:i,NO_DOT:`(?!${n})`,NO_DOTS:`(?!${a}${i})`,NO_DOT_SLASH:`(?!${n}{0,1}${u})`,NO_DOTS_SLASH:`(?!${i})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:a},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return re={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function Re(){return oe||(oe=1,function(e){const t=F.default,r="win32"===process.platform,{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:u}=he();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(u,"\\$1"),e.toPosixSlashes=e=>e.replace(n,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===r||"\\"===t.sep,e.escapeLast=(t,r,n)=>{const o=t.lastIndexOf(r,n);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,r,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},e.wrapOutput=(e,t={},r={})=>{let n=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(n=`(?:^(?!${n}).*$)`),n}}(Ae)),Ae}function _e(){if(le)return pe;le=1;const e=F.default,t=function(){if(ue)return se;ue=1;const e=Re(),{CHAR_ASTERISK:t,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:A}=he(),h=e=>e===a||e===n,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return se=(_,E)=>{const y=E||{},C=_.length-1,m=!0===y.parts||!0===y.scanToEnd,v=[],S=[],b=[];let x,$,H=_,T=-1,w=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,B=!1,j=!1,P=!1,D=!1,G=!1,U=0,K={value:"",depth:0,isGlob:!1};const q=()=>T>=C,F=()=>(x=$,H.charCodeAt(++T));for(;T<C;){let e;if($=F(),$!==n){if(!0===B||$===i){for(U++;!0!==q()&&($=F());)if($!==n)if($!==i){if(!0!==B&&$===s&&($=F())===s){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if(!0!==B&&$===o){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===d&&(U--,0===U)){B=!1,O=K.isBrace=!0,G=!0;break}}else U++;else j=K.backslashes=!0,F();if(!0===m)continue;break}if($!==a){if(!0!==y.noext&&!0==($===c||$===r||$===t||$===f||$===u)&&H.charCodeAt(T+1)===p){if(N=K.isGlob=!0,I=K.isExtglob=!0,G=!0,$===u&&T===w&&(D=!0),!0===m){for(;!0!==q()&&($=F());)if($!==n){if($===g){N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=!0),N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===f){if(N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===l){for(;!0!==q()&&(e=F());)if(e!==n){if(e===A){k=K.isBracket=!0,N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,F();if(!0===m)continue;break}if(!0===y.nonegate||$!==u||T!==w){if(!0!==y.noparen&&$===p){if(N=K.isGlob=!0,!0===m){for(;!0!==q()&&($=F());)if($!==p){if($===g){G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if(!0===N){if(G=!0,!0===m)continue;break}}else P=K.negated=!0,w++}else{if(v.push(T),S.push(K),K={value:"",depth:0,isGlob:!1},!0===G)continue;if(x===s&&T===w+1){w+=2;continue}L=T+1}}else j=K.backslashes=!0,$=F(),$===i&&(B=!0)}!0===y.noext&&(I=!1,N=!1);let Q=H,W="",X="";w>0&&(W=H.slice(0,w),H=H.slice(w),L-=w),Q&&!0===N&&L>0?(Q=H.slice(0,L),X=H.slice(L)):!0===N?(Q="",X=H):Q=H,Q&&""!==Q&&"/"!==Q&&Q!==H&&h(Q.charCodeAt(Q.length-1))&&(Q=Q.slice(0,-1)),!0===y.unescape&&(X&&(X=e.removeBackslashes(X)),Q&&!0===j&&(Q=e.removeBackslashes(Q)));const Z={prefix:W,input:_,start:w,base:Q,glob:X,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:D};if(!0===y.tokens&&(Z.maxDepth=0,h($)||S.push(K),Z.tokens=S),!0===y.parts||!0===y.tokens){let e;for(let t=0;t<v.length;t++){const r=e?e+1:w,n=v[t],o=_.slice(r,n);y.tokens&&(0===t&&0!==w?(S[t].isPrefix=!0,S[t].value=W):S[t].value=o,R(S[t]),Z.maxDepth+=S[t].depth),0===t&&""===o||b.push(o),e=n}if(e&&e+1<_.length){const t=_.slice(e+1);b.push(t),y.tokens&&(S[S.length-1].value=t,R(S[S.length-1]),Z.maxDepth+=S[S.length-1].depth)}Z.slashes=v,Z.parts=b}return Z}}(),r=function(){if(ie)return ae;ie=1;const e=he(),t=Re(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:u}=e,a=(e,r)=>{if("function"==typeof r.expandRange)return r.expandRange(...e,r);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch(r){return e.map((e=>t.escapeRegex(e))).join("..")}return n},i=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=u[l]||l;const f={...c},d="number"==typeof f.maxLength?Math.min(r,f.maxLength):r;let g=l.length;if(g>d)throw new SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);const A={type:"bos",value:"",output:f.prepend||""},h=[A],R=f.capture?"":"?:",_=t.isWindows(c),E=e.globChars(_),y=e.extglobChars(E),{DOT_LITERAL:C,PLUS_LITERAL:m,SLASH_LITERAL:v,ONE_CHAR:S,DOTS_SLASH:b,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:T,QMARK_NO_DOT:w,STAR:L,START_ANCHOR:O}=E,k=e=>`(${R}(?:(?!${O}${e.dot?b:C}).)*?)`,N=f.dot?"":x,I=f.dot?T:w;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const B={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};l=t.removePrefix(l,B),g=l.length;const j=[],P=[],D=[];let G,U=A;const K=()=>B.index===g-1,q=B.peek=(e=1)=>l[B.index+e],F=B.advance=()=>l[++B.index]||"",Q=()=>l.slice(B.index+1),W=(e="",t=0)=>{B.consumed+=e,B.index+=t},X=e=>{B.output+=null!=e.output?e.output:e.value,W(e.value)},Z=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)F(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},Y=e=>{B[e]++,D.push(e)},V=e=>{B[e]--,D.pop()},z=e=>{if("globstar"===U.type){const t=B.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(B.output=B.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=M,B.output+=U.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&X(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,h.push(e),U=e},J=(e,t)=>{const r={...y[t],conditions:1,inner:""};r.prev=U,r.parens=B.parens,r.output=B.output;const n=(f.capture?"(":"")+r.open;Y("parens"),z({type:e,value:t,output:B.output?"":S}),z({type:"paren",extglob:!0,value:F(),output:n}),j.push(r)},ee=e=>{let t,r=e.close+(f.capture?")":"");if("negate"===e.type){let n=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(n=k(f)),(n!==M||K()||/^\)+$/.test(Q()))&&(r=e.close=`)$))${n}`),e.inner.includes("*")&&(t=Q())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;r=e.close=`)${o})${n})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:G,output:r}),V("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,r=l.replace(s,((t,r,n,o,s,u)=>"\\"===o?(e=!0,t):"?"===o?r?r+o+(s?T.repeat(s.length):""):0===u?I+(s?T.repeat(s.length):""):T.repeat(n.length):"."===o?C.repeat(n.length):"*"===o?r?r+o+(s?M:""):M:r?t:`\\${t}`));return!0===e&&(r=!0===f.unescape?r.replace(/\\/g,""):r.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),r===l&&!0===f.contains?(B.output=l,B):(B.output=t.wrapOutput(r,B,c),B)}for(;!K();){if(G=F(),"\0"===G)continue;if("\\"===G){const e=q();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){G+="\\",z({type:"text",value:G});continue}const t=/^\\+/.exec(Q());let r=0;if(t&&t[0].length>2&&(r=t[0].length,B.index+=r,r%2!=0&&(G+="\\")),!0===f.unescape?G=F():G+=F(),0===B.brackets){z({type:"text",value:G});continue}}if(B.brackets>0&&("]"!==G||"["===U.value||"[^"===U.value)){if(!1!==f.posix&&":"===G){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),r=U.value.slice(e+2),o=n[r];if(o){U.value=t+o,B.backtrack=!0,F(),A.output||1!==h.indexOf(U)||(A.output=S);continue}}}("["===G&&":"!==q()||"-"===G&&"]"===q())&&(G=`\\${G}`),"]"!==G||"["!==U.value&&"[^"!==U.value||(G=`\\${G}`),!0===f.posix&&"!"===G&&"["===U.value&&(G="^"),U.value+=G,X({value:G});continue}if(1===B.quotes&&'"'!==G){G=t.escapeRegex(G),U.value+=G,X({value:G});continue}if('"'===G){B.quotes=1===B.quotes?0:1,!0===f.keepQuotes&&z({type:"text",value:G});continue}if("("===G){Y("parens"),z({type:"paren",value:G});continue}if(")"===G){if(0===B.parens&&!0===f.strictBrackets)throw new SyntaxError(i("opening","("));const e=j[j.length-1];if(e&&B.parens===e.parens+1){ee(j.pop());continue}z({type:"paren",value:G,output:B.parens?")":"\\)"}),V("parens");continue}if("["===G){if(!0!==f.nobracket&&Q().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));G=`\\${G}`}z({type:"bracket",value:G});continue}if("]"===G){if(!0===f.nobracket||U&&"bracket"===U.type&&1===U.value.length){z({type:"text",value:G,output:`\\${G}`});continue}if(0===B.brackets){if(!0===f.strictBrackets)throw new SyntaxError(i("opening","["));z({type:"text",value:G,output:`\\${G}`});continue}V("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(G=`/${G}`),U.value+=G,X({value:G}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const r=t.escapeRegex(U.value);if(B.output=B.output.slice(0,-U.value.length),!0===f.literalBrackets){B.output+=r,U.value=r;continue}U.value=`(${R}${r}|${U.value})`,B.output+=U.value;continue}if("{"===G&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:G,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};P.push(e),z(e);continue}if("}"===G){const e=P[P.length-1];if(!0===f.nobrace||!e){z({type:"text",value:G,output:G});continue}let t=")";if(!0===e.dots){const e=h.slice(),r=[];for(let t=e.length-1;t>=0&&(h.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=a(r,f),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=B.output.slice(0,e.outputIndex),n=B.tokens.slice(e.tokensIndex);e.value=e.output="\\{",G=t="\\}",B.output=r;for(const e of n)B.output+=e.output||e.value}z({type:"brace",value:G,output:t}),V("braces"),P.pop();continue}if("|"===G){j.length>0&&j[j.length-1].conditions++,z({type:"text",value:G});continue}if(","===G){let e=G;const t=P[P.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:G,output:e});continue}if("/"===G){if("dot"===U.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",h.pop(),U=A;continue}z({type:"slash",value:G,output:v});continue}if("."===G){if(B.braces>0&&"dot"===U.type){"."===U.value&&(U.output=C);const e=P[P.length-1];U.type="dots",U.output+=G,U.value+=G,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==U.type&&"slash"!==U.type){z({type:"text",value:G,output:C});continue}z({type:"dot",value:G,output:C});continue}if("?"===G){if((!U||"("!==U.value)&&!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("qmark",G);continue}if(U&&"paren"===U.type){const e=q();let r=G;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Q()))&&(r=`\\${G}`),z({type:"text",value:G,output:r});continue}if(!0!==f.dot&&("slash"===U.type||"bos"===U.type)){z({type:"qmark",value:G,output:w});continue}z({type:"qmark",value:G,output:T});continue}if("!"===G){if(!0!==f.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){J("negate",G);continue}if(!0!==f.nonegate&&0===B.index){Z();continue}}if("+"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("plus",G);continue}if(U&&"("===U.value||!1===f.regex){z({type:"plus",value:G,output:m});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||B.parens>0){z({type:"plus",value:G});continue}z({type:"plus",value:m});continue}if("@"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){z({type:"at",extglob:!0,value:G,output:""});continue}z({type:"text",value:G});continue}if("*"!==G){"$"!==G&&"^"!==G||(G=`\\${G}`);const e=o.exec(Q());e&&(G+=e[0],B.index+=e[0].length),z({type:"text",value:G});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=G,U.output=M,B.backtrack=!0,B.globstar=!0,W(G);continue}let e=Q();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",G);continue}if("star"===U.type){if(!0===f.noglobstar){W(G);continue}const t=U.prev,r=t.prev,n="slash"===t.type||"bos"===t.type,o=r&&("star"===r.type||"globstar"===r.type);if(!0===f.bash&&(!n||e[0]&&"/"!==e[0])){z({type:"star",value:G,output:""});continue}const s=B.braces>0&&("comma"===t.type||"brace"===t.type),u=j.length&&("pipe"===t.type||"paren"===t.type);if(!n&&"paren"!==t.type&&!s&&!u){z({type:"star",value:G,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[B.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3)}if("bos"===t.type&&K()){U.type="globstar",U.value+=G,U.output=k(f),B.output=U.output,B.globstar=!0,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&K()){B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=k(f)+(f.strictSlashes?")":"|$)"),U.value+=G,B.globstar=!0,B.output+=t.output+U.output,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const r=void 0!==e[1]?"|$":"";B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=`${k(f)}${v}|${v}${r})`,U.value+=G,B.output+=t.output+U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){U.type="globstar",U.value+=G,U.output=`(?:^|${v}|${k(f)}${v})`,B.output=U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-U.output.length),U.type="globstar",U.output=k(f),U.value+=G,B.output+=U.output,B.globstar=!0,W(G);continue}const r={type:"star",value:G,output:M};!0!==f.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==f.regex?(B.index!==B.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(B.output+=$,U.output+=$):!0===f.dot?(B.output+=H,U.output+=H):(B.output+=N,U.output+=N),"*"!==q()&&(B.output+=S,U.output+=S)),z(r)):(r.output=G,z(r)):(r.output=".*?","bos"!==U.type&&"slash"!==U.type||(r.output=N+r.output),z(r))}for(;B.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));B.output=t.escapeLast(B.output,"["),V("brackets")}for(;B.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing",")"));B.output=t.escapeLast(B.output,"("),V("parens")}for(;B.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","}"));B.output=t.escapeLast(B.output,"{"),V("braces")}if(!0===f.strictSlashes||"star"!==U.type&&"bracket"!==U.type||z({type:"maybe_slash",value:"",output:`${v}?`}),!0===B.backtrack){B.output="";for(const e of B.tokens)B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix)}return B};return p.fastpaths=(n,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(r,s.maxLength):r,i=n.length;if(i>a)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${a}`);n=u[n]||n;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:A,NO_DOTS_SLASH:h,STAR:R,START_ANCHOR:_}=e.globChars(p),E=s.dot?A:g,y=s.dot?h:g,C=s.capture?"":"?:";let m=!0===s.bash?".*?":R;s.capture&&(m=`(${m})`);const v=e=>!0===e.noglobstar?m:`(${C}(?:(?!${_}${e.dot?d:l}).)*?)`,S=e=>{switch(e){case"*":return`${E}${f}${m}`;case".*":return`${l}${f}${m}`;case"*.*":return`${E}${m}${l}${f}${m}`;case"*/*":return`${E}${m}${c}${f}${y}${m}`;case"**":return E+v(s);case"**/*":return`(?:${E}${v(s)}${c})?${y}${f}${m}`;case"**/*.*":return`(?:${E}${v(s)}${c})?${y}${m}${l}${f}${m}`;case"**/.*":return`(?:${E}${v(s)}${c})?${l}${f}${m}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=S(t[1]);if(!r)return;return r+l+t[2]}}},b=t.removePrefix(n,{negated:!1,prefix:""});let x=S(b);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},ae=p}(),n=Re(),o=he(),s=(e,t,r=!1)=>{if(Array.isArray(e)){const n=e.map((e=>s(e,t,r))),o=e=>{for(const t of n){const r=t(e);if(r)return r}return!1};return o}const o=(u=e)&&"object"==typeof u&&!Array.isArray(u)&&e.tokens&&e.input;var u;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},i=n.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(a.ignore,e,r)}const f=(r,n=!1)=>{const{isMatch:o,match:u,output:f}=s.test(r,p,t,{glob:e,posix:i}),d={glob:e,state:l,regex:p,posix:i,input:r,output:f,match:u,isMatch:o};return"function"==typeof a.onResult&&a.onResult(d),!1===o?(d.isMatch=!1,!!n&&d):c(r)?("function"==typeof a.onIgnore&&a.onIgnore(d),d.isMatch=!1,!!n&&d):("function"==typeof a.onMatch&&a.onMatch(d),!n||d)};return r&&(f.state=l),f};return s.test=(e,t,r,{glob:o,posix:u}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=r||{},i=a.format||(u?n.toPosixSlashes:null);let p=e===o,l=p&&i?i(e):e;return!1===p&&(l=i?i(e):e,p=l===o),!1!==p&&!0!==a.capture||(p=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,r,u):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,r,o,u=n.isWindows(o))=>(r instanceof RegExp?r:s.makeRe(r,o)).test(e.basename(t)),s.isMatch=(e,t,r)=>s(t,r)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):r(e,{...t,fastpaths:!1}),s.scan=(e,r)=>t(e,r),s.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;const o=t||{},u=o.contains?"":"^",a=o.contains?"":"$";let i=`${u}(?:${e.output})${a}`;e&&!0===e.negated&&(i=`^(?!${i}).*$`);const p=s.toRegex(i,t);return!0===n&&(p.state=e),p},s.makeRe=(e,t={},n=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let u={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(u.output=r.fastpaths(e,t)),u.output||(u=r(e,t)),s.compileRe(u,t,n,o)},s.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,pe=s}function Ee(){return fe?ce:(fe=1,ce=_e())}var ye=function(){if(ge)return de;ge=1;const e=q.default,t=te(),r=Ee(),n=Re(),o=e=>""===e||"./"===e,s=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,u=new Set,a=0,i=e=>{u.add(e.output),n&&n.onResult&&n.onResult(e)};for(let u=0;u<t.length;u++){let p=r(String(t[u]),{...n,onResult:i},!0),l=p.state.negated||p.state.negatedExtglob;l&&a++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(a===t.length?[...u]:[...s]).filter((e=>!o.has(e)));if(n&&0===p.length){if(!0===n.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===n.nonull||!0===n.nullglob)return n.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>r(e,t),s.any=s.isMatch=(e,t,n)=>r(t,n)(e),s.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],u=new Set(s(e,t,{...r,onResult:e=>{r.onResult&&r.onResult(e),o.push(e.output)}}));for(let e of o)u.has(e)||n.add(e);return[...n]},s.contains=(t,r,n)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(r))return r.some((e=>s.contains(t,e,n)));if("string"==typeof r){if(o(t)||o(r))return!1;if(t.includes(r)||t.startsWith("./")&&t.slice(2).includes(r))return!0}return s.isMatch(t,r,{...n,contains:!0})},s.matchKeys=(e,t,r)=>{if(!n.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,r),u={};for(let t of o)u[t]=e[t];return u},s.some=(e,t,n)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=r(String(e),n);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,n)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=r(String(e),n);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,n,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(n).every((e=>r(e,o)(t)))},s.capture=(e,t,o)=>{let s=n.isWindows(o),u=r.makeRe(String(e),{...o,capture:!0}).exec(s?n.toPosixSlashes(t):t);if(u)return u.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>r.makeRe(...e),s.scan=(...e)=>r.scan(...e),s.parse=(e,n)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),n))o.push(r.parse(e,n));return o},s.braces=(e,r)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return r&&!0===r.nobrace||!/\{.*\}/.test(e)?[e]:t(e,r)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},de=s}();const Ce=(e,t)=>new Set([...e].filter((e=>t.has(e))));let me;function ve(){if(me)return me;const e=A.program.getOptionValue("root");return me=e?D.default.isAbsolute(e)?e:D.default.resolve(process.cwd(),e):void 0,me}let Se,be="";try{R.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href).resolve("@pnpm/filter-workspace-packages"),be="pnpm"}catch{}""!==be&&A.program.option("-f, --filter <filter>","filter packages");let xe=!1;const $e=R.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href);function He(e){try{return $e.resolve(e),!0}catch(e){return!1}}let Te;const we=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of we)if(He(e)){Te=e;break}let Le="jiek.config";var Oe=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,r)=>t?.("transform",`Transforming ${r}...`)}}},ke=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const{JIEK_ROOT:Ne,JIEK_ENTRIES:Ie}=process.env,Me=Ne??o.getWorkspaceDir(),Be={},je=[U.default()],Pe=function(e){const{wd:t}=function(){if(Se)return{wd:Se,notWorkspace:xe};const e=ve();if(void 0!==e){const t=o.isWorkspaceDir(e,be);return xe=!t,Se=e,{wd:Se,notWorkspace:xe}}try{Se=o.getWorkspaceDir(be)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;Se=e,xe=!0}return{wd:Se,notWorkspace:xe}}();let r=A.program.getOptionValue("configPath");if(r){if(!P.default.existsSync(r))throw new Error(`config file not found: ${r}`);D.default.isAbsolute(r)||(r=D.default.resolve(t,r))}else r=function(e,t){const r=!!Te;function n(r){const n=[D.default.resolve(process.cwd(),`${Le}.${r}`),D.default.resolve(process.cwd(),`.${Le}.${r}`),D.default.resolve(e,`${Le}.${r}`),D.default.resolve(e,`.${Le}.${r}`)];t&&n.unshift(D.default.resolve(t,`${Le}.${r}`),D.default.resolve(t,`.${Le}.${r}`));for(const e of n)if(P.default.existsSync(e)&&P.default.lstatSync(e).isFile())return e}return Le=n("js")??Le,Le=n("json")??Le,Le=n("yaml")??Le,r&&(Le=n("ts")??Le),D.default.resolve(e,Le)}(t,e);const n=D.default.extname(r);let s;switch(n){case".js":s=require(r);break;case".json":return require(r);case".yaml":return h.load(P.default.readFileSync(r,"utf-8"));case".ts":if(Te){require(Te),s=require(r);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":s={};break;default:throw new Error(`unsupported config file type: ${n}`)}if(!s)throw new Error("config file is empty");return s.default??s}()??{},{build:De={}}=Pe,Ge=`./${t.relative(process.cwd(),t.resolve(("object"==typeof De?.output?.dir?De.output.dir.js:De?.output?.dir)??"dist"))}`,Ue=/\.(css|s[ac]ss|less|styl)$/,Ke=e=>t.resolve(Me,e),qe=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),Fe=(e,t=De?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}]:[e,{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}],Qe=e=>{e=t.resolve(e);const r=t.dirname(e),{extends:n,...o}=(s=e,P.default.existsSync(s)&&P.default.statSync(s).isFile()?l.parse(P.default.readFileSync(s,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var s;const u=(a=n?Array.isArray(n)?n:[n]:[],a?.map((e=>t.resolve(r,e)))??[]);var a;return 0===u.length?o:u.map(Qe).concat(o).reduce(((e,{compilerOptions:t={},references:r,...n})=>({...e,...n,compilerOptions:{...e.compilerOptions,...t}})),{})},We=(e,r)=>{e=t.resolve(e),r=t.resolve(r);const n=t.dirname(e),o=Qe(e),[s,u,a,i]=[o.references?.map((({path:e})=>e)),o.files,o.include,o.exclude].map((e=>e?.map((e=>t.resolve(n,e)))??[]));if(i.length>0&&i.some((e=>ye.isMatch(r,e))))return;if(0===o.files?.length&&0===o.include?.length)return;let p=!1;if(p||(p=u.length>0&&u.includes(r)),p||(p=a.length>0&&a.some((e=>ye.isMatch(r,e)))),p)return o.compilerOptions??{};if(!(o.files&&o.files.length>0||o.include&&o.include.length>0)){s.reverse();for(const e of s){const t=We(e,r);if(t)return t}return o.compilerOptions}},Xe=({path:e,name:r,input:o,output:s,external:u,pkgIsModule:i,conditionals:l},c={})=>{const f=l.includes("import"),d=l.includes("require"),g=l.includes("browser");let A;[Ke("tsconfig.json"),Ke("tsconfig.dts.json")].forEach((e=>{P.default.existsSync(e)&&P.default.statSync(e).isFile()&&(A=e)}));let h={};if(A){const e=We(A,t.resolve(o)),{options:r,errors:n}=W.default.convertCompilerOptionsFromJson(e,t.dirname(A));if(n.length>0)throw new Error(n.map((e=>e.messageText)).join("\n"));h=r}const R=[...l,...h.customConditions??[]],_={type:"progress",data:{name:r,path:e,exportConditions:R,input:o}},E=c?.output?.dir;return[{input:o,external:u,output:[...Fe({file:s,name:r,interop:"auto",sourcemap:"object"==typeof c?.output?.sourcemap?c.output.sourcemap.js:c?.output?.sourcemap,format:f?"esm":d?"cjs":g?"umd":i?"esm":"cjs",strict:"object"==typeof c?.output?.strict?c.output.strict.js:c?.output?.strict})],plugins:[a.nodeResolve({exportConditions:R}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:t.resolve(s.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),Q.default(),G.default(),Oe({onEvent:(e,t)=>p.sendMessage({..._,data:{..._.data,event:e,message:t,tags:["js"]}})})]},{input:o,external:u,output:[{dir:t.resolve(("object"==typeof E?E.dts:E)??"dist"),sourcemap:"object"==typeof c?.output?.sourcemap?c.output.sourcemap.dts:c?.output?.sourcemap,entryFileNames:()=>s.replace(`${Ge}/`,"").replace(/(\.[cm]?)js$/,".d$1ts"),strict:"object"==typeof c?.output?.strict?c.output.strict.dts:c?.output?.strict}],plugins:[a.nodeResolve({exportConditions:R}),ke({patterns:[Ue]}),n.dts({respectExternal:!0,compilerOptions:h}),Oe({onEvent:(e,t)=>p.sendMessage({..._,data:{..._.data,event:e,message:t,tags:["dts"]}})})]}]};exports.template=function(e){const{name:n,type:o,exports:s}=e,u="module"===o;if(!n)throw new Error("package.json name is required");if(!s)throw new Error("package.json exports is required");const a=Ie?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),i=qe(n),l=function(e=process.cwd()){const t="string"==typeof e?P.default.existsSync(`${e}/package.json`)?JSON.parse(P.default.readFileSync(`${e}/package.json`,"utf-8")):{}:e,{dependencies:r={},peerDependencies:n={},optionalDependencies:o={}}=t;return Object.keys(r).concat(Object.keys(n)).concat(Object.keys(o)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(e),[c,f]=function({entrypoints:e,pkgIsModule:n,entries:o,config:s,dir:u,noFilter:a,isPublish:i}){const{build:p={},publish:{withSuffix:l=!1,withSource:c=!0}={}}=s??{},{crossModuleConvertor:f=!0}=p,d=`./${g=((...e)=>t.resolve(u??process.cwd(),...e))(("object"==typeof p?.output?.dir?p.output.dir.js:p?.output?.dir)??"dist"),t.relative(u??process.cwd(),g)}`;var g;const[,A]=r.resolveEntrypoints(e);o&&Object.entries(A).forEach((([e])=>{o.some((t=>ye.isMatch(e,t,{matchBase:!0})))||delete A[e]}));const h=a?A:r.filterLeafs(A,{skipValue:[/(^|\/)\.jk-noentry/,...r.DEFAULT_SKIP_VALUES]}),R=f?{import:e=>!n&&0===Ce(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!n||0!==Ce(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{};return[h,r.entrypoints2Exports(h,{outdir:d,withSuffix:i?l:void 0,withSource:i?c:void 0,withConditional:{...R}})]}({entrypoints:s,pkgIsModule:u,entries:a,config:Pe}),d=new Map;r.getAllLeafs(c,(({keys:e,value:t})=>{if("string"==typeof t){const r=d.get(t)??[];d.set(t,r),r.push(e)}return!1}));const g=[];return d.forEach(((e,t)=>e.forEach((e=>{const[n,...o]=e,s=i+("."===n?"":qe(n)),a=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(f,e),p={path:n,name:s,input:t,external:l,pkgIsModule:u};switch(typeof a){case"string":g.push(...Xe({...p,output:a,conditionals:o},De));break;case"object":r.getAllLeafs(a,(({keys:e,value:t})=>{const r=[...new Set([...o,...e])];return"string"==typeof t&&g.push(...Xe({...p,output:t,conditionals:r},De)),!1}))}})))),p.sendMessage({type:"init",data:{leafMap:d,targetsLength:g.length}}),g.map((e=>({...Be,...e,plugins:[...je,e.plugins]})))};
|
19
|
+
*/function J(){if(H)return $;H=1;const e=Q.default,t=z(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},u=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},i=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,d=String(e),g=String(t),h=String(n);n=Math.max(Math.abs(n),1);let A=s(d)||s(g)||s(h),R=A?Math.max(d.length,g.length,h.length):0,_=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),E=r.transform||(e=>t=>!0===e?Number(t):String(t))(_);if(r.toRegex&&1===n)return i(a(e,R),a(t,R),!0,r);let y={negatives:[],positives:[]},C=[],m=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?y[(v=o)<0?"negatives":"positives"].push(Math.abs(v)):C.push(u(E(o,m),R,_)),o=f?o-n:o+n,m++;var v;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(y,r):p(C,null,{wrap:!1,...r}):C},d=(e,t,s,u={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,u);if("function"==typeof s)return d(e,t,1,{transform:s});if(n(s))return d(e,t,0,s);let a={...u};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(e)&&o(t)?f(e,t,s,a):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),u=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=u>a,f=Math.min(u,a),d=Math.max(u,a);if(r.toRegex&&1===n)return i(f,d,!1,r);let g=[],h=0;for(;l?u>=a:u<=a;)g.push(s(u,h)),u=l?u-n:u+n,h++;return!0===r.toRegex?p(g,null,{wrap:!1,options:r}):g})(e,t,Math.max(Math.abs(s),1),a):null==s||n(s)?d(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,a)};return $=d}function ee(){if(M)return I;M=1;const e=Y(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:u,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:d,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:h}=N?k:(N=1,k={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return I=(A,R={})=>{if("string"!=typeof A)throw new TypeError("Expected a string");let _=R||{},E="number"==typeof _.maxLength?Math.min(t,_.maxLength):t;if(A.length>E)throw new SyntaxError(`Input length (${A.length}), exceeds max characters (${E})`);let y,C={type:"root",input:A,nodes:[]},m=[C],v=C,S=C,b=0,x=A.length,$=0,H=0;const T=()=>A[$++],w=e=>{if("text"===e.type&&"dot"===S.type&&(S.type="text"),!S||"text"!==S.type||"text"!==e.type)return v.nodes.push(e),e.parent=v,e.prev=S,S=e,e;S.value+=e.value};for(w({type:"bos"});$<x;)if(v=m[m.length-1],y=T(),y!==h&&y!==g)if(y!==n)if(y!==c)if(y!==l)if(y!==u)if(y!==a)if(y!==f&&y!==d&&y!==r)if(y!==i)if(y!==p)if(y===o&&H>0){if(v.ranges>0){v.ranges=0;let t=v.nodes.shift();v.nodes=[t,{type:"text",value:e(v)}]}w({type:"comma",value:y}),v.commas++}else if(y===s&&H>0&&0===v.commas){let e=v.nodes;if(0===H||0===e.length){w({type:"text",value:y});continue}if("dot"===S.type){if(v.range=[],S.value+=y,S.type="range",3!==v.nodes.length&&5!==v.nodes.length){v.invalid=!0,v.ranges=0,S.type="text";continue}v.ranges++,v.args=[];continue}if("range"===S.type){e.pop();let t=e[e.length-1];t.value+=S.value+y,S=t,v.ranges--;continue}w({type:"dot",value:y})}else w({type:"text",value:y});else{if("brace"!==v.type){w({type:"text",value:y});continue}let e="close";v=m.pop(),v.close=!0,w({type:e,value:y}),H--,v=m[m.length-1]}else{H++;let e=S.value&&"$"===S.value.slice(-1)||!0===v.dollar;v=w({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),m.push(v),w({type:"open",value:y})}else{let e,t=y;for(!0!==R.keepQuotes&&(y="");$<x&&(e=T());)if(e!==n){if(e===t){!0===R.keepQuotes&&(y+=e);break}y+=e}else y+=e+T();w({type:"text",value:y})}else{if("paren"!==v.type){w({type:"text",value:y});continue}v=m.pop(),w({type:"text",value:y}),v=m[m.length-1]}else v=w({type:"paren",nodes:[]}),m.push(v),w({type:"text",value:y});else{let e;for(b++;$<x&&(e=T());)if(y+=e,e!==l)if(e!==n){if(e===c&&(b--,0===b))break}else y+=T();else b++;w({type:"text",value:y})}else w({type:"text",value:"\\"+y});else w({type:"text",value:(R.keepEscaping?y:"")+T()});do{if(v=m.pop(),"root"!==v.type){v.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=m[m.length-1],t=e.nodes.indexOf(v);e.nodes.splice(t,1,...v.nodes)}}while(m.length>0);return w({type:"eos"}),C},I}function te(){if(j)return B;j=1;const e=Y(),t=function(){if(w)return T;w=1;const e=J(),t=Z();return T=(n,r={})=>{let o=(n,s={})=>{let u=t.isInvalidBrace(s),a=!0===n.invalid&&!0===r.escapeInvalid,i=!0===u||!0===a,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return i?p+n.value:"(";if("close"===n.type)return i?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":i?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(O)return L;O=1;const e=J(),t=Y(),n=Z(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return L=(o,s={})=>{let u=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,i={})=>{o.queue=[];let p=i,l=i.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let a=n.reduce(o.nodes);if(n.exceedsLimit(...a,s.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=e(...a,s);return 0===i.length&&(i=t(o,s)),l.push(r(l.pop(),i)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,d=o;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,f=d.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&a(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(a(o))}}(),r=ee(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),B=o}var ne,re,oe,se,ue,ae,ie,pe,le,ce,fe,de,ge,he={};function Ae(){if(re)return ne;re=1;const e=W.default,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",u=`(?:${o}|$)`,a=`(?:^|${o})`,i=`${r}{1,2}${u}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:u,DOTS_SLASH:i,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${i})`,NO_DOT_SLASH:`(?!${r}{0,1}${u})`,NO_DOTS_SLASH:`(?!${i})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:a},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return ne={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function Re(){return oe||(oe=1,function(e){const t=W.default,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:u}=Ae();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(u,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(he)),he}function _e(){if(le)return pe;le=1;const e=W.default,t=function(){if(ue)return se;ue=1;const e=Re(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:h}=Ae(),A=e=>e===a||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return se=(_,E)=>{const y=E||{},C=_.length-1,m=!0===y.parts||!0===y.scanToEnd,v=[],S=[],b=[];let x,$,H=_,T=-1,w=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,B=!1,j=!1,P=!1,D=!1,G=!1,U=0,K={value:"",depth:0,isGlob:!1};const q=()=>T>=C,F=()=>(x=$,H.charCodeAt(++T));for(;T<C;){let e;if($=F(),$!==r){if(!0===B||$===i){for(U++;!0!==q()&&($=F());)if($!==r)if($!==i){if(!0!==B&&$===s&&($=F())===s){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if(!0!==B&&$===o){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===d&&(U--,0===U)){B=!1,O=K.isBrace=!0,G=!0;break}}else U++;else j=K.backslashes=!0,F();if(!0===m)continue;break}if($!==a){if(!0!==y.noext&&!0==($===c||$===n||$===t||$===f||$===u)&&H.charCodeAt(T+1)===p){if(N=K.isGlob=!0,I=K.isExtglob=!0,G=!0,$===u&&T===w&&(D=!0),!0===m){for(;!0!==q()&&($=F());)if($!==r){if($===g){N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=!0),N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===f){if(N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===l){for(;!0!==q()&&(e=F());)if(e!==r){if(e===h){k=K.isBracket=!0,N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,F();if(!0===m)continue;break}if(!0===y.nonegate||$!==u||T!==w){if(!0!==y.noparen&&$===p){if(N=K.isGlob=!0,!0===m){for(;!0!==q()&&($=F());)if($!==p){if($===g){G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if(!0===N){if(G=!0,!0===m)continue;break}}else P=K.negated=!0,w++}else{if(v.push(T),S.push(K),K={value:"",depth:0,isGlob:!1},!0===G)continue;if(x===s&&T===w+1){w+=2;continue}L=T+1}}else j=K.backslashes=!0,$=F(),$===i&&(B=!0)}!0===y.noext&&(I=!1,N=!1);let Q=H,W="",X="";w>0&&(W=H.slice(0,w),H=H.slice(w),L-=w),Q&&!0===N&&L>0?(Q=H.slice(0,L),X=H.slice(L)):!0===N?(Q="",X=H):Q=H,Q&&""!==Q&&"/"!==Q&&Q!==H&&A(Q.charCodeAt(Q.length-1))&&(Q=Q.slice(0,-1)),!0===y.unescape&&(X&&(X=e.removeBackslashes(X)),Q&&!0===j&&(Q=e.removeBackslashes(Q)));const Z={prefix:W,input:_,start:w,base:Q,glob:X,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:D};if(!0===y.tokens&&(Z.maxDepth=0,A($)||S.push(K),Z.tokens=S),!0===y.parts||!0===y.tokens){let e;for(let t=0;t<v.length;t++){const n=e?e+1:w,r=v[t],o=_.slice(n,r);y.tokens&&(0===t&&0!==w?(S[t].isPrefix=!0,S[t].value=W):S[t].value=o,R(S[t]),Z.maxDepth+=S[t].depth),0===t&&""===o||b.push(o),e=r}if(e&&e+1<_.length){const t=_.slice(e+1);b.push(t),y.tokens&&(S[S.length-1].value=t,R(S[S.length-1]),Z.maxDepth+=S[S.length-1].depth)}Z.slashes=v,Z.parts=b}return Z}}(),n=function(){if(ie)return ae;ie=1;const e=Ae(),t=Re(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:u}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},i=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=u[l]||l;const f={...c},d="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let g=l.length;if(g>d)throw new SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);const h={type:"bos",value:"",output:f.prepend||""},A=[h],R=f.capture?"":"?:",_=t.isWindows(c),E=e.globChars(_),y=e.extglobChars(E),{DOT_LITERAL:C,PLUS_LITERAL:m,SLASH_LITERAL:v,ONE_CHAR:S,DOTS_SLASH:b,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:T,QMARK_NO_DOT:w,STAR:L,START_ANCHOR:O}=E,k=e=>`(${R}(?:(?!${O}${e.dot?b:C}).)*?)`,N=f.dot?"":x,I=f.dot?T:w;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const B={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};l=t.removePrefix(l,B),g=l.length;const j=[],P=[],D=[];let G,U=h;const K=()=>B.index===g-1,q=B.peek=(e=1)=>l[B.index+e],F=B.advance=()=>l[++B.index]||"",Q=()=>l.slice(B.index+1),W=(e="",t=0)=>{B.consumed+=e,B.index+=t},X=e=>{B.output+=null!=e.output?e.output:e.value,W(e.value)},Z=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)F(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},Y=e=>{B[e]++,D.push(e)},V=e=>{B[e]--,D.pop()},z=e=>{if("globstar"===U.type){const t=B.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(B.output=B.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=M,B.output+=U.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&X(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,A.push(e),U=e},J=(e,t)=>{const n={...y[t],conditions:1,inner:""};n.prev=U,n.parens=B.parens,n.output=B.output;const r=(f.capture?"(":"")+n.open;Y("parens"),z({type:e,value:t,output:B.output?"":S}),z({type:"paren",extglob:!0,value:F(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=k(f)),(r!==M||K()||/^\)+$/.test(Q()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Q())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:G,output:n}),V("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,u)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?T.repeat(s.length):""):0===u?I+(s?T.repeat(s.length):""):T.repeat(r.length):"."===o?C.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(B.output=l,B):(B.output=t.wrapOutput(n,B,c),B)}for(;!K();){if(G=F(),"\0"===G)continue;if("\\"===G){const e=q();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){G+="\\",z({type:"text",value:G});continue}const t=/^\\+/.exec(Q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,B.index+=n,n%2!=0&&(G+="\\")),!0===f.unescape?G=F():G+=F(),0===B.brackets){z({type:"text",value:G});continue}}if(B.brackets>0&&("]"!==G||"["===U.value||"[^"===U.value)){if(!1!==f.posix&&":"===G){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),n=U.value.slice(e+2),o=r[n];if(o){U.value=t+o,B.backtrack=!0,F(),h.output||1!==A.indexOf(U)||(h.output=S);continue}}}("["===G&&":"!==q()||"-"===G&&"]"===q())&&(G=`\\${G}`),"]"!==G||"["!==U.value&&"[^"!==U.value||(G=`\\${G}`),!0===f.posix&&"!"===G&&"["===U.value&&(G="^"),U.value+=G,X({value:G});continue}if(1===B.quotes&&'"'!==G){G=t.escapeRegex(G),U.value+=G,X({value:G});continue}if('"'===G){B.quotes=1===B.quotes?0:1,!0===f.keepQuotes&&z({type:"text",value:G});continue}if("("===G){Y("parens"),z({type:"paren",value:G});continue}if(")"===G){if(0===B.parens&&!0===f.strictBrackets)throw new SyntaxError(i("opening","("));const e=j[j.length-1];if(e&&B.parens===e.parens+1){ee(j.pop());continue}z({type:"paren",value:G,output:B.parens?")":"\\)"}),V("parens");continue}if("["===G){if(!0!==f.nobracket&&Q().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));G=`\\${G}`}z({type:"bracket",value:G});continue}if("]"===G){if(!0===f.nobracket||U&&"bracket"===U.type&&1===U.value.length){z({type:"text",value:G,output:`\\${G}`});continue}if(0===B.brackets){if(!0===f.strictBrackets)throw new SyntaxError(i("opening","["));z({type:"text",value:G,output:`\\${G}`});continue}V("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(G=`/${G}`),U.value+=G,X({value:G}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(U.value);if(B.output=B.output.slice(0,-U.value.length),!0===f.literalBrackets){B.output+=n,U.value=n;continue}U.value=`(${R}${n}|${U.value})`,B.output+=U.value;continue}if("{"===G&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:G,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};P.push(e),z(e);continue}if("}"===G){const e=P[P.length-1];if(!0===f.nobrace||!e){z({type:"text",value:G,output:G});continue}let t=")";if(!0===e.dots){const e=A.slice(),n=[];for(let t=e.length-1;t>=0&&(A.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,f),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=B.output.slice(0,e.outputIndex),r=B.tokens.slice(e.tokensIndex);e.value=e.output="\\{",G=t="\\}",B.output=n;for(const e of r)B.output+=e.output||e.value}z({type:"brace",value:G,output:t}),V("braces"),P.pop();continue}if("|"===G){j.length>0&&j[j.length-1].conditions++,z({type:"text",value:G});continue}if(","===G){let e=G;const t=P[P.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:G,output:e});continue}if("/"===G){if("dot"===U.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",A.pop(),U=h;continue}z({type:"slash",value:G,output:v});continue}if("."===G){if(B.braces>0&&"dot"===U.type){"."===U.value&&(U.output=C);const e=P[P.length-1];U.type="dots",U.output+=G,U.value+=G,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==U.type&&"slash"!==U.type){z({type:"text",value:G,output:C});continue}z({type:"dot",value:G,output:C});continue}if("?"===G){if((!U||"("!==U.value)&&!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("qmark",G);continue}if(U&&"paren"===U.type){const e=q();let n=G;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Q()))&&(n=`\\${G}`),z({type:"text",value:G,output:n});continue}if(!0!==f.dot&&("slash"===U.type||"bos"===U.type)){z({type:"qmark",value:G,output:w});continue}z({type:"qmark",value:G,output:T});continue}if("!"===G){if(!0!==f.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){J("negate",G);continue}if(!0!==f.nonegate&&0===B.index){Z();continue}}if("+"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("plus",G);continue}if(U&&"("===U.value||!1===f.regex){z({type:"plus",value:G,output:m});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||B.parens>0){z({type:"plus",value:G});continue}z({type:"plus",value:m});continue}if("@"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){z({type:"at",extglob:!0,value:G,output:""});continue}z({type:"text",value:G});continue}if("*"!==G){"$"!==G&&"^"!==G||(G=`\\${G}`);const e=o.exec(Q());e&&(G+=e[0],B.index+=e[0].length),z({type:"text",value:G});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=G,U.output=M,B.backtrack=!0,B.globstar=!0,W(G);continue}let e=Q();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",G);continue}if("star"===U.type){if(!0===f.noglobstar){W(G);continue}const t=U.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){z({type:"star",value:G,output:""});continue}const s=B.braces>0&&("comma"===t.type||"brace"===t.type),u=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!u){z({type:"star",value:G,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[B.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3)}if("bos"===t.type&&K()){U.type="globstar",U.value+=G,U.output=k(f),B.output=U.output,B.globstar=!0,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&K()){B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=k(f)+(f.strictSlashes?")":"|$)"),U.value+=G,B.globstar=!0,B.output+=t.output+U.output,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=`${k(f)}${v}|${v}${n})`,U.value+=G,B.output+=t.output+U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){U.type="globstar",U.value+=G,U.output=`(?:^|${v}|${k(f)}${v})`,B.output=U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-U.output.length),U.type="globstar",U.output=k(f),U.value+=G,B.output+=U.output,B.globstar=!0,W(G);continue}const n={type:"star",value:G,output:M};!0!==f.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==f.regex?(B.index!==B.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(B.output+=$,U.output+=$):!0===f.dot?(B.output+=H,U.output+=H):(B.output+=N,U.output+=N),"*"!==q()&&(B.output+=S,U.output+=S)),z(n)):(n.output=G,z(n)):(n.output=".*?","bos"!==U.type&&"slash"!==U.type||(n.output=N+n.output),z(n))}for(;B.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));B.output=t.escapeLast(B.output,"["),V("brackets")}for(;B.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing",")"));B.output=t.escapeLast(B.output,"("),V("parens")}for(;B.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","}"));B.output=t.escapeLast(B.output,"{"),V("braces")}if(!0===f.strictSlashes||"star"!==U.type&&"bracket"!==U.type||z({type:"maybe_slash",value:"",output:`${v}?`}),!0===B.backtrack){B.output="";for(const e of B.tokens)B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix)}return B};return p.fastpaths=(r,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,i=r.length;if(i>a)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${a}`);r=u[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:h,NO_DOTS_SLASH:A,STAR:R,START_ANCHOR:_}=e.globChars(p),E=s.dot?h:g,y=s.dot?A:g,C=s.capture?"":"?:";let m=!0===s.bash?".*?":R;s.capture&&(m=`(${m})`);const v=e=>!0===e.noglobstar?m:`(${C}(?:(?!${_}${e.dot?d:l}).)*?)`,S=e=>{switch(e){case"*":return`${E}${f}${m}`;case".*":return`${l}${f}${m}`;case"*.*":return`${E}${m}${l}${f}${m}`;case"*/*":return`${E}${m}${c}${f}${y}${m}`;case"**":return E+v(s);case"**/*":return`(?:${E}${v(s)}${c})?${y}${f}${m}`;case"**/*.*":return`(?:${E}${v(s)}${c})?${y}${m}${l}${f}${m}`;case"**/.*":return`(?:${E}${v(s)}${c})?${l}${f}${m}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=S(t[1]);if(!n)return;return n+l+t[2]}}},b=t.removePrefix(r,{negated:!1,prefix:""});let x=S(b);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},ae=p}(),r=Re(),o=Ae(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(u=e)&&"object"==typeof u&&!Array.isArray(u)&&e.tokens&&e.input;var u;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},i=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(a.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:u,output:f}=s.test(n,p,t,{glob:e,posix:i}),d={glob:e,state:l,regex:p,posix:i,input:n,output:f,match:u,isMatch:o};return"function"==typeof a.onResult&&a.onResult(d),!1===o?(d.isMatch=!1,!!r&&d):c(n)?("function"==typeof a.onIgnore&&a.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof a.onMatch&&a.onMatch(d),!r||d)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:u}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},i=a.format||(u?r.toPosixSlashes:null);let p=e===o,l=p&&i?i(e):e;return!1===p&&(l=i?i(e):e,p=l===o),!1!==p&&!0!==a.capture||(p=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,n,u):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,u=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},u=o.contains?"":"^",a=o.contains?"":"$";let i=`${u}(?:${e.output})${a}`;e&&!0===e.negated&&(i=`^(?!${i}).*$`);const p=s.toRegex(i,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let u={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(u.output=n.fastpaths(e,t)),u.output||(u=n(e,t)),s.compileRe(u,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,pe=s}function Ee(){return fe?ce:(fe=1,ce=_e())}var ye=function(){if(ge)return de;ge=1;const e=Q.default,t=te(),n=Ee(),r=Re(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,u=new Set,a=0,i=e=>{u.add(e.output),r&&r.onResult&&r.onResult(e)};for(let u=0;u<t.length;u++){let p=n(String(t[u]),{...r,onResult:i},!0),l=p.state.negated||p.state.negatedExtglob;l&&a++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(a===t.length?[...u]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],u=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)u.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),u={};for(let t of o)u[t]=e[t];return u},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),u=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(u)return u.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},de=s}();const Ce=(e,t)=>new Set([...e].filter((e=>t.has(e))));let me;function ve(){if(me)return me;const e=g.program.getOptionValue("root");return me=e?D.default.isAbsolute(e)?e:D.default.resolve(process.cwd(),e):void 0,me}let Se,be="";try{A.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href).resolve("@pnpm/filter-workspace-packages"),be="pnpm"}catch{}""!==be&&g.program.option("-f, --filter <filter>","filter packages");let xe=!1;const $e=A.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href);function He(e){try{return $e.resolve(e),!0}catch(e){return!1}}let Te;const we=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of we)if(He(e)){Te=e;break}let Le="jiek.config";const Oe=e=>{e=t.resolve(e);const n=t.dirname(e),{extends:r,...o}=(s=e,P.default.existsSync(s)&&P.default.statSync(s).isFile()?R.parse(P.default.readFileSync(s,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var s;const u=(a=r?Array.isArray(r)?r:[r]:[],a?.map((e=>t.resolve(n,e)))??[]);var a;return 0===u.length?o:u.map(Oe).concat(o).reduce(((e,{compilerOptions:t={},references:n,...r})=>({...e,...r,compilerOptions:{...e.compilerOptions,...t}})),{})},ke=(e,n)=>{e=t.resolve(e),n=t.resolve(n);const r=t.dirname(e),o=Oe(e),[s,u,a,i]=[o.references?.map((({path:e})=>e)),o.files,o.include,o.exclude].map((e=>e?.map((e=>t.resolve(r,e)))??[]));if(i.length>0&&i.some((e=>ye.isMatch(n,e))))return;if(0===o.files?.length&&0===o.include?.length)return;let p=!1;if(p||(p=u.length>0&&u.includes(n)),p||(p=a.length>0&&a.some((e=>ye.isMatch(n,e)))),p)return o.compilerOptions??{};if(!(o.files&&o.files.length>0||o.include&&o.include.length>0)){s.reverse();for(const e of s){const t=ke(e,n);if(t)return t}return o.compilerOptions}};var Ne=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,n)=>t?.("transform",`Transforming ${n}...`)}}},Ie=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const{JIEK_ROOT:Me,JIEK_ENTRIES:Be}=process.env,je=Me??o.getWorkspaceDir(),Pe={},De=[U.default()],Ge=function(e){const{wd:t}=function(){if(Se)return{wd:Se,notWorkspace:xe};const e=ve();if(void 0!==e){const t=o.isWorkspaceDir(e,be);return xe=!t,Se=e,{wd:Se,notWorkspace:xe}}try{Se=o.getWorkspaceDir(be)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;Se=e,xe=!0}return{wd:Se,notWorkspace:xe}}();let n=g.program.getOptionValue("configPath");if(n){if(!P.default.existsSync(n))throw new Error(`config file not found: ${n}`);D.default.isAbsolute(n)||(n=D.default.resolve(t,n))}else n=function(e,t){const n=!!Te;function r(n){const r=[D.default.resolve(process.cwd(),`${Le}.${n}`),D.default.resolve(process.cwd(),`.${Le}.${n}`),D.default.resolve(e,`${Le}.${n}`),D.default.resolve(e,`.${Le}.${n}`)];t&&r.unshift(D.default.resolve(t,`${Le}.${n}`),D.default.resolve(t,`.${Le}.${n}`));for(const e of r)if(P.default.existsSync(e)&&P.default.lstatSync(e).isFile())return e}return Le=r("js")??Le,Le=r("json")??Le,Le=r("yaml")??Le,n&&(Le=r("ts")??Le),D.default.resolve(e,Le)}(t,e);const r=D.default.extname(n);let s;switch(r){case".js":s=require(n);break;case".json":return require(n);case".yaml":return h.load(P.default.readFileSync(n,"utf-8"));case".ts":if(Te){require(Te),s=require(n);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":s={};break;default:throw new Error(`unsupported config file type: ${r}`)}if(!s)throw new Error("config file is empty");return s.default??s}()??{},{build:Ue={}}=Ge,Ke=`./${t.relative(process.cwd(),t.resolve(("object"==typeof Ue?.output?.dir?Ue.output.dir.js:Ue?.output?.dir)??"dist"))}`,qe=/\.(css|s[ac]ss|less|styl)$/,Fe=e=>t.resolve(je,e),Qe=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),We=(e,t=Ue?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}]:[e,{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}],Xe=(e,n={})=>{const{path:o,name:s,input:u,output:i,external:l,pkgIsModule:c,conditionals:f}=e,d=f.includes("import"),g=f.includes("require"),h=f.includes("browser");let A;[Fe("tsconfig.json"),Fe("tsconfig.dts.json")].forEach((e=>{P.default.existsSync(e)&&P.default.statSync(e).isFile()&&(A=e)}));let R={};if(A){const e=ke(A,t.resolve(u)),{options:n,errors:r}=F.default.convertCompilerOptionsFromJson(e,t.dirname(A));if(r.length>0)throw new Error(r.map((e=>e.messageText)).join("\n"));R=n,delete R.composite}const _=[...f,...R.customConditions??[]],E={type:"progress",data:{name:s,path:o,exportConditions:_,input:u}},y=n?.output?.dir,{js:C,dts:m}=((e,t)=>{if(!1===t||null==t)return{js:[],dts:[]};let n=[],r=[];switch(typeof t){case"function":n=t("js",e),r=t("dts",e);break;case"object":"js"in t||"dts"in t?(n=t.js??[],r=t.dts??[]):(n=t,r=t)}return{js:n,dts:r}})(e,Ue.plugins);return[{input:u,external:l,output:[...We({file:i,name:s,interop:"auto",sourcemap:"object"==typeof n?.output?.sourcemap?n.output.sourcemap.js:n?.output?.sourcemap,format:d?"esm":g?"cjs":h?"umd":c?"esm":"cjs",strict:"object"==typeof n?.output?.strict?n.output.strict.js:n?.output?.strict})],plugins:[a.nodeResolve({exportConditions:_}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:t.resolve(i.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),q.default({tsconfig:A}),G.default(),Ne({onEvent:(e,t)=>p.sendMessage({...E,data:{...E.data,event:e,message:t,tags:["js"]}})}),C]},{input:u,external:l,output:[{dir:t.resolve(("object"==typeof y?y.dts:y)??"dist"),sourcemap:"object"==typeof n?.output?.sourcemap?n.output.sourcemap.dts:n?.output?.sourcemap,entryFileNames:()=>i.replace(`${Ke}/`,"").replace(/(\.[cm]?)js$/,".d$1ts"),strict:"object"==typeof n?.output?.strict?n.output.strict.dts:n?.output?.strict}],plugins:[a.nodeResolve({exportConditions:_}),Ie({patterns:[qe]}),r.dts({respectExternal:!0,compilerOptions:R}),Ne({onEvent:(e,t)=>p.sendMessage({...E,data:{...E.data,event:e,message:t,tags:["dts"]}})}),m]}]};exports.template=function(e){const{name:r,type:o,exports:s}=e,u="module"===o;if(!r)throw new Error("package.json name is required");if(!s)throw new Error("package.json exports is required");const a=Be?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),i=Qe(r),l=function(e=process.cwd()){const t="string"==typeof e?P.default.existsSync(`${e}/package.json`)?JSON.parse(P.default.readFileSync(`${e}/package.json`,"utf-8")):{}:e,{dependencies:n={},peerDependencies:r={},optionalDependencies:o={}}=t;return Object.keys(n).concat(Object.keys(r)).concat(Object.keys(o)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(e),[c,f]=function({entrypoints:e,pkgIsModule:r,entries:o,config:s,dir:u,noFilter:a,isPublish:i}){const{build:p={},publish:{withSuffix:l=!1,withSource:c=!0}={}}=s??{},{crossModuleConvertor:f=!0}=p,d=`./${g=((...e)=>t.resolve(u??process.cwd(),...e))(("object"==typeof p?.output?.dir?p.output.dir.js:p?.output?.dir)??"dist"),t.relative(u??process.cwd(),g)}`;var g;const[,h]=n.resolveEntrypoints(e);o&&Object.entries(h).forEach((([e])=>{o.some((t=>ye.isMatch(e,t,{matchBase:!0})))||delete h[e]}));const A=a?h:n.filterLeafs(h,{skipValue:[/(^|\/)\.jk-noentry/,...n.DEFAULT_SKIP_VALUES]}),R=f?{import:e=>!r&&0===Ce(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!r||0!==Ce(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{};return[A,n.entrypoints2Exports(A,{outdir:d,withSuffix:i?l:void 0,withSource:i?c:void 0,withConditional:{...R}})]}({entrypoints:s,pkgIsModule:u,entries:a,config:Ge}),d=new Map;n.getAllLeafs(c,(({keys:e,value:t})=>{if("string"==typeof t){const n=d.get(t)??[];d.set(t,n),n.push(e)}return!1}));const g=[];return d.forEach(((e,t)=>e.forEach((e=>{const[r,...o]=e,s=i+("."===r?"":Qe(r)),a=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(f,e),p={path:r,name:s,input:t,external:l,pkgIsModule:u};switch(typeof a){case"string":g.push(...Xe({...p,output:a,conditionals:o},Ue));break;case"object":n.getAllLeafs(a,(({keys:e,value:t})=>{const n=[...new Set([...o,...e])];return"string"==typeof t&&g.push(...Xe({...p,output:t,conditionals:n},Ue)),!1}))}})))),p.sendMessage({type:"init",data:{leafMap:d,targetsLength:g.length}}),g.map((e=>({...Pe,...e,plugins:[...De,e.plugins]})))};
|