lakutata
Version:
An IoC-based universal application framework.
2,101 lines (1,892 loc) • 139 kB
JavaScript
/* Build Date: Mon Jan 05 2026 23:52:23 GMT+0800 (China Standard Time) */
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
const t = require("os");
const e = require("path");
const r = require("../../../vendor/Package.internal.8.cjs");
const n = require("util");
const s = require("stream");
const i = require("events");
const o = require("fs");
const a = require("../../../vendor/Package.internal.2.cjs");
const u = require("./Utils.cjs");
require("./FunctionTokenizer.cjs");
require("../../../vendor/Package.internal.7.cjs");
require("../../../vendor/Package.internal.3.cjs");
require("../base/internal/DataValidator.cjs");
require("../../../vendor/Package.internal.1.cjs");
require("node:util/types");
require("../validation/VLD.cjs");
require("url");
require("../../exceptions/dto/InvalidValueException.cjs");
require("../base/abstracts/Exception.cjs");
require("../../../vendor/Package.internal.5.cjs");
require("../helpers/As.cjs");
require("../../../vendor/Package.internal.6.cjs");
require("../base/internal/ThrowWarning.cjs");
require("../helpers/Templating.cjs");
require("../base/internal/CamelCase.cjs");
require("../helpers/NoCase.cjs");
require("../helpers/DevNull.cjs");
require("../helpers/IsHtml.cjs");
require("../helpers/IsXML.cjs");
require("../../constants/DTOMetadataKey.cjs");
require("../helpers/ObjectConstructor.cjs");
require("../helpers/ObjectParentConstructors.cjs");
require("../helpers/ObjectParentConstructor.cjs");
require("../helpers/ObjectPrototype.cjs");
const c = t => t && t.__esModule ? t : {
default: t
};
function l(t) {
if (t && t.__esModule) return t;
const e = Object.create(null, {
[Symbol.toStringTag]: {
value: "Module"
}
});
if (t) {
for (const r in t) {
if (r !== "default") {
const n = Object.getOwnPropertyDescriptor(t, r);
Object.defineProperty(e, r, n.get ? n : {
enumerable: true,
get: () => t[r]
});
}
}
}
e.default = t;
return Object.freeze(e);
}
const f = c(t);
const p = l(e);
const h = c(n);
const d = c(s);
const _ = c(i);
const g = c(o);
var y = {};
var v = {};
var S = {};
Object.defineProperty(S, "__esModule", {
value: true
});
S.splitWhen = S.flatten = void 0;
function m(t) {
return t.reduce((t, e) => [].concat(t, e), []);
}
S.flatten = m;
function A(t, e) {
const r = [ [] ];
let n = 0;
for (const s of t) {
if (e(s)) {
n++;
r[n] = [];
} else {
r[n].push(s);
}
}
return r;
}
S.splitWhen = A;
var b = {};
Object.defineProperty(b, "__esModule", {
value: true
});
b.isEnoentCodeError = void 0;
function E(t) {
return t.code === "ENOENT";
}
b.isEnoentCodeError = E;
var R = {};
Object.defineProperty(R, "__esModule", {
value: true
});
R.createDirentFromStats = void 0;
let P = class DirentFromStats {
constructor(t, e) {
this.name = t;
this.isBlockDevice = e.isBlockDevice.bind(e);
this.isCharacterDevice = e.isCharacterDevice.bind(e);
this.isDirectory = e.isDirectory.bind(e);
this.isFIFO = e.isFIFO.bind(e);
this.isFile = e.isFile.bind(e);
this.isSocket = e.isSocket.bind(e);
this.isSymbolicLink = e.isSymbolicLink.bind(e);
}
};
function x(t, e) {
return new P(t, e);
}
R.createDirentFromStats = x;
var C = {};
Object.defineProperty(C, "__esModule", {
value: true
});
C.convertPosixPathToPattern = C.convertWindowsPathToPattern = C.convertPathToPattern = C.escapePosixPath = C.escapeWindowsPath = C.escape = C.removeLeadingDotSegment = C.makeAbsolute = C.unixify = void 0;
const w = f.default;
const T = p.default;
const O = w.platform() === "win32";
const k = 2;
const L = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
const H = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
const M = /^\\\\([.?])/;
const $ = /\\(?![!()+@[\]{}])/g;
function D(t) {
return t.replace(/\\/g, "/");
}
C.unixify = D;
function F(t, e) {
return T.resolve(t, e);
}
C.makeAbsolute = F;
function I(t) {
if (t.charAt(0) === ".") {
const e = t.charAt(1);
if (e === "/" || e === "\\") {
return t.slice(k);
}
}
return t;
}
C.removeLeadingDotSegment = I;
C.escape = O ? N : j;
function N(t) {
return t.replace(H, "\\$2");
}
C.escapeWindowsPath = N;
function j(t) {
return t.replace(L, "\\$2");
}
C.escapePosixPath = j;
C.convertPathToPattern = O ? B : G;
function B(t) {
return N(t).replace(M, "//$1").replace($, "/");
}
C.convertWindowsPathToPattern = B;
function G(t) {
return j(t);
}
C.convertPosixPathToPattern = G;
var q = {};
var U = r.isGlob;
var W = p.default.posix.dirname;
var K = f.default.platform() === "win32";
var V = "/";
var Q = /\\/g;
var X = /[\{\[].*[\}\]]$/;
var Y = /(^|[^\\])([\{\[]|\([^\)]+$)/;
var Z = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
var z = function t(e, r) {
var n = Object.assign({
flipBackslashes: true
}, r);
if (n.flipBackslashes && K && e.indexOf(V) < 0) {
e = e.replace(Q, V);
}
if (X.test(e)) {
e += V;
}
e += "a";
do {
e = W(e);
} while (U(e) || Y.test(e));
return e.replace(Z, "$1");
};
var J = {};
(function(t) {
t.isInteger = t => {
if (typeof t === "number") {
return Number.isInteger(t);
}
if (typeof t === "string" && t.trim() !== "") {
return Number.isInteger(Number(t));
}
return false;
};
t.find = (t, e) => t.nodes.find(t => t.type === e);
t.exceedsLimit = (e, r, n = 1, s) => {
if (s === false) return false;
if (!t.isInteger(e) || !t.isInteger(r)) return false;
return (Number(r) - Number(e)) / Number(n) >= s;
};
t.escapeNode = (t, e = 0, r) => {
const n = t.nodes[e];
if (!n) return;
if (r && n.type === r || n.type === "open" || n.type === "close") {
if (n.escaped !== true) {
n.value = "\\" + n.value;
n.escaped = true;
}
}
};
t.encloseBrace = t => {
if (t.type !== "brace") return false;
if (t.commas >> 0 + t.ranges >> 0 === 0) {
t.invalid = true;
return true;
}
return false;
};
t.isInvalidBrace = t => {
if (t.type !== "brace") return false;
if (t.invalid === true || t.dollar) return true;
if (t.commas >> 0 + t.ranges >> 0 === 0) {
t.invalid = true;
return true;
}
if (t.open !== true || t.close !== true) {
t.invalid = true;
return true;
}
return false;
};
t.isOpenOrClose = t => {
if (t.type === "open" || t.type === "close") {
return true;
}
return t.open === true || t.close === true;
};
t.reduce = t => t.reduce((t, e) => {
if (e.type === "text") t.push(e.value);
if (e.type === "range") e.type = "text";
return t;
}, []);
t.flatten = (...t) => {
const e = [];
const r = t => {
for (let n = 0; n < t.length; n++) {
const s = t[n];
if (Array.isArray(s)) {
r(s);
continue;
}
if (s !== undefined) {
e.push(s);
}
}
return e;
};
r(t);
return e;
};
})(J);
const tt = J;
var et = (t, e = {}) => {
const r = (t, n = {}) => {
const s = e.escapeInvalid && tt.isInvalidBrace(n);
const i = t.invalid === true && e.escapeInvalid === true;
let o = "";
if (t.value) {
if ((s || i) && tt.isOpenOrClose(t)) {
return "\\" + t.value;
}
return t.value;
}
if (t.value) {
return t.value;
}
if (t.nodes) {
for (const e of t.nodes) {
o += r(e);
}
}
return o;
};
return r(t);
};
var rt = function(t) {
if (typeof t === "number") {
return t - t === 0;
}
if (typeof t === "string" && t.trim() !== "") {
return Number.isFinite ? Number.isFinite(+t) : isFinite(+t);
}
return false;
};
const nt = rt;
const st = (t, e, r) => {
if (nt(t) === false) {
throw new TypeError("toRegexRange: expected the first argument to be a number");
}
if (e === void 0 || t === e) {
return String(t);
}
if (nt(e) === false) {
throw new TypeError("toRegexRange: expected the second argument to be a number.");
}
let n = {
relaxZeros: true,
...r
};
if (typeof n.strictZeros === "boolean") {
n.relaxZeros = n.strictZeros === false;
}
let s = String(n.relaxZeros);
let i = String(n.shorthand);
let o = String(n.capture);
let a = String(n.wrap);
let u = t + ":" + e + "=" + s + i + o + a;
if (st.cache.hasOwnProperty(u)) {
return st.cache[u].result;
}
let c = Math.min(t, e);
let l = Math.max(t, e);
if (Math.abs(c - l) === 1) {
let r = t + "|" + e;
if (n.capture) {
return `(${r})`;
}
if (n.wrap === false) {
return r;
}
return `(?:${r})`;
}
let f = yt(t) || yt(e);
let p = {
min: t,
max: e,
a: c,
b: l
};
let h = [];
let d = [];
if (f) {
p.isPadded = f;
p.maxLen = String(p.max).length;
}
if (c < 0) {
let t = l < 0 ? Math.abs(l) : 1;
d = ut(t, Math.abs(c), p, n);
c = p.a = 0;
}
if (l >= 0) {
h = ut(c, l, p, n);
}
p.negatives = d;
p.positives = h;
p.result = it(d, h);
if (n.capture === true) {
p.result = `(${p.result})`;
} else if (n.wrap !== false && h.length + d.length > 1) {
p.result = `(?:${p.result})`;
}
st.cache[u] = p;
return p.result;
};
function it(t, e, r) {
let n = ct(t, e, "-", false) || [];
let s = ct(e, t, "", false) || [];
let i = ct(t, e, "-?", true) || [];
let o = n.concat(i).concat(s);
return o.join("|");
}
function ot(t, e) {
let r = 1;
let n = 1;
let s = ht(t, r);
let i = new Set([ e ]);
while (t <= s && s <= e) {
i.add(s);
r += 1;
s = ht(t, r);
}
s = dt(e + 1, n) - 1;
while (t < s && s <= e) {
i.add(s);
n += 1;
s = dt(e + 1, n) - 1;
}
i = [ ...i ];
i.sort(ft);
return i;
}
function at(t, e, r) {
if (t === e) {
return {
pattern: t,
count: [],
digits: 0
};
}
let n = lt(t, e);
let s = n.length;
let i = "";
let o = 0;
for (let t = 0; t < s; t++) {
let [e, r] = n[t];
if (e === r) {
i += e;
} else if (e !== "0" || r !== "9") {
i += gt(e, r);
} else {
o++;
}
}
if (o) {
i += r.shorthand === true ? "\\d" : "[0-9]";
}
return {
pattern: i,
count: [ o ],
digits: s
};
}
function ut(t, e, r, n) {
let s = ot(t, e);
let i = [];
let o = t;
let a;
for (let t = 0; t < s.length; t++) {
let e = s[t];
let u = at(String(o), String(e), n);
let c = "";
if (!r.isPadded && a && a.pattern === u.pattern) {
if (a.count.length > 1) {
a.count.pop();
}
a.count.push(u.count[0]);
a.string = a.pattern + _t(a.count);
o = e + 1;
continue;
}
if (r.isPadded) {
c = vt(e, r, n);
}
u.string = c + u.pattern + _t(u.count);
i.push(u);
o = e + 1;
a = u;
}
return i;
}
function ct(t, e, r, n, s) {
let i = [];
for (let s of t) {
let {string: t} = s;
if (!n && !pt(e, "string", t)) {
i.push(r + t);
}
if (n && pt(e, "string", t)) {
i.push(r + t);
}
}
return i;
}
function lt(t, e) {
let r = [];
for (let n = 0; n < t.length; n++) r.push([ t[n], e[n] ]);
return r;
}
function ft(t, e) {
return t > e ? 1 : e > t ? -1 : 0;
}
function pt(t, e, r) {
return t.some(t => t[e] === r);
}
function ht(t, e) {
return Number(String(t).slice(0, -e) + "9".repeat(e));
}
function dt(t, e) {
return t - t % Math.pow(10, e);
}
function _t(t) {
let [e = 0, r = ""] = t;
if (r || e > 1) {
return `{${e + (r ? "," + r : "")}}`;
}
return "";
}
function gt(t, e, r) {
return `[${t}${e - t === 1 ? "" : "-"}${e}]`;
}
function yt(t) {
return /^-?(0+)\d/.test(t);
}
function vt(t, e, r) {
if (!e.isPadded) {
return t;
}
let n = Math.abs(e.maxLen - String(t).length);
let s = r.relaxZeros !== false;
switch (n) {
case 0:
return "";
case 1:
return s ? "0?" : "0";
case 2:
return s ? "0{0,2}" : "00";
default:
{
return s ? `0{0,${n}}` : `0{${n}}`;
}
}
}
st.cache = {};
st.clearCache = () => st.cache = {};
var St = st;
const mt = h.default;
const At = St;
const bt = t => t !== null && typeof t === "object" && !Array.isArray(t);
const Et = t => e => t === true ? Number(e) : String(e);
const Rt = t => typeof t === "number" || typeof t === "string" && t !== "";
const Pt = t => Number.isInteger(+t);
const xt = t => {
let e = `${t}`;
let r = -1;
if (e[0] === "-") e = e.slice(1);
if (e === "0") return false;
while (e[++r] === "0") ;
return r > 0;
};
const Ct = (t, e, r) => {
if (typeof t === "string" || typeof e === "string") {
return true;
}
return r.stringify === true;
};
const wt = (t, e, r) => {
if (e > 0) {
let r = t[0] === "-" ? "-" : "";
if (r) t = t.slice(1);
t = r + t.padStart(r ? e - 1 : e, "0");
}
if (r === false) {
return String(t);
}
return t;
};
const Tt = (t, e) => {
let r = t[0] === "-" ? "-" : "";
if (r) {
t = t.slice(1);
e--;
}
while (t.length < e) t = "0" + t;
return r ? "-" + t : t;
};
const Ot = (t, e, r) => {
t.negatives.sort((t, e) => t < e ? -1 : t > e ? 1 : 0);
t.positives.sort((t, e) => t < e ? -1 : t > e ? 1 : 0);
let n = e.capture ? "" : "?:";
let s = "";
let i = "";
let o;
if (t.positives.length) {
s = t.positives.map(t => Tt(String(t), r)).join("|");
}
if (t.negatives.length) {
i = `-(${n}${t.negatives.map(t => Tt(String(t), r)).join("|")})`;
}
if (s && i) {
o = `${s}|${i}`;
} else {
o = s || i;
}
if (e.wrap) {
return `(${n}${o})`;
}
return o;
};
const kt = (t, e, r, n) => {
if (r) {
return At(t, e, {
wrap: false,
...n
});
}
let s = String.fromCharCode(t);
if (t === e) return s;
let i = String.fromCharCode(e);
return `[${s}-${i}]`;
};
const Lt = (t, e, r) => {
if (Array.isArray(t)) {
let e = r.wrap === true;
let n = r.capture ? "" : "?:";
return e ? `(${n}${t.join("|")})` : t.join("|");
}
return At(t, e, r);
};
const Ht = (...t) => new RangeError("Invalid range arguments: " + mt.inspect(...t));
const Mt = (t, e, r) => {
if (r.strictRanges === true) throw Ht([ t, e ]);
return [];
};
const $t = (t, e) => {
if (e.strictRanges === true) {
throw new TypeError(`Expected step "${t}" to be a number`);
}
return [];
};
const Dt = (t, e, r = 1, n = {}) => {
let s = Number(t);
let i = Number(e);
if (!Number.isInteger(s) || !Number.isInteger(i)) {
if (n.strictRanges === true) throw Ht([ t, e ]);
return [];
}
if (s === 0) s = 0;
if (i === 0) i = 0;
let o = s > i;
let a = String(t);
let u = String(e);
let c = String(r);
r = Math.max(Math.abs(r), 1);
let l = xt(a) || xt(u) || xt(c);
let f = l ? Math.max(a.length, u.length, c.length) : 0;
let p = l === false && Ct(t, e, n) === false;
let h = n.transform || Et(p);
if (n.toRegex && r === 1) {
return kt(Tt(t, f), Tt(e, f), true, n);
}
let d = {
negatives: [],
positives: []
};
let _ = t => d[t < 0 ? "negatives" : "positives"].push(Math.abs(t));
let g = [];
let y = 0;
while (o ? s >= i : s <= i) {
if (n.toRegex === true && r > 1) {
_(s);
} else {
g.push(wt(h(s, y), f, p));
}
s = o ? s - r : s + r;
y++;
}
if (n.toRegex === true) {
return r > 1 ? Ot(d, n, f) : Lt(g, null, {
wrap: false,
...n
});
}
return g;
};
const Ft = (t, e, r = 1, n = {}) => {
if (!Pt(t) && t.length > 1 || !Pt(e) && e.length > 1) {
return Mt(t, e, n);
}
let s = n.transform || (t => String.fromCharCode(t));
let i = `${t}`.charCodeAt(0);
let o = `${e}`.charCodeAt(0);
let a = i > o;
let u = Math.min(i, o);
let c = Math.max(i, o);
if (n.toRegex && r === 1) {
return kt(u, c, false, n);
}
let l = [];
let f = 0;
while (a ? i >= o : i <= o) {
l.push(s(i, f));
i = a ? i - r : i + r;
f++;
}
if (n.toRegex === true) {
return Lt(l, null, {
wrap: false,
options: n
});
}
return l;
};
const It = (t, e, r, n = {}) => {
if (e == null && Rt(t)) {
return [ t ];
}
if (!Rt(t) || !Rt(e)) {
return Mt(t, e, n);
}
if (typeof r === "function") {
return It(t, e, 1, {
transform: r
});
}
if (bt(r)) {
return It(t, e, 0, r);
}
let s = {
...n
};
if (s.capture === true) s.wrap = true;
r = r || s.step || 1;
if (!Pt(r)) {
if (r != null && !bt(r)) return $t(r, s);
return It(t, e, 1, r);
}
if (Pt(t) && Pt(e)) {
return Dt(t, e, r, s);
}
return Ft(t, e, Math.max(Math.abs(r), 1), s);
};
var Nt = It;
const jt = Nt;
const Bt = J;
const Gt = (t, e = {}) => {
const r = (t, n = {}) => {
const s = Bt.isInvalidBrace(n);
const i = t.invalid === true && e.escapeInvalid === true;
const o = s === true || i === true;
const a = e.escapeInvalid === true ? "\\" : "";
let u = "";
if (t.isOpen === true) {
return a + t.value;
}
if (t.isClose === true) {
console.log("node.isClose", a, t.value);
return a + t.value;
}
if (t.type === "open") {
return o ? a + t.value : "(";
}
if (t.type === "close") {
return o ? a + t.value : ")";
}
if (t.type === "comma") {
return t.prev.type === "comma" ? "" : o ? t.value : "|";
}
if (t.value) {
return t.value;
}
if (t.nodes && t.ranges > 0) {
const r = Bt.reduce(t.nodes);
const n = jt(...r, {
...e,
wrap: false,
toRegex: true,
strictZeros: true
});
if (n.length !== 0) {
return r.length > 1 && n.length > 1 ? `(${n})` : n;
}
}
if (t.nodes) {
for (const e of t.nodes) {
u += r(e, t);
}
}
return u;
};
return r(t);
};
var qt = Gt;
const Ut = Nt;
const Wt = et;
const Kt = J;
const Vt = (t = "", e = "", r = false) => {
const n = [];
t = [].concat(t);
e = [].concat(e);
if (!e.length) return t;
if (!t.length) {
return r ? Kt.flatten(e).map(t => `{${t}}`) : e;
}
for (const s of t) {
if (Array.isArray(s)) {
for (const t of s) {
n.push(Vt(t, e, r));
}
} else {
for (let t of e) {
if (r === true && typeof t === "string") t = `{${t}}`;
n.push(Array.isArray(t) ? Vt(s, t, r) : s + t);
}
}
}
return Kt.flatten(n);
};
const Qt = (t, e = {}) => {
const r = e.rangeLimit === undefined ? 1e3 : e.rangeLimit;
const n = (t, s = {}) => {
t.queue = [];
let i = s;
let o = s.queue;
while (i.type !== "brace" && i.type !== "root" && i.parent) {
i = i.parent;
o = i.queue;
}
if (t.invalid || t.dollar) {
o.push(Vt(o.pop(), Wt(t, e)));
return;
}
if (t.type === "brace" && t.invalid !== true && t.nodes.length === 2) {
o.push(Vt(o.pop(), [ "{}" ]));
return;
}
if (t.nodes && t.ranges > 0) {
const n = Kt.reduce(t.nodes);
if (Kt.exceedsLimit(...n, e.step, r)) {
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
}
let s = Ut(...n, e);
if (s.length === 0) {
s = Wt(t, e);
}
o.push(Vt(o.pop(), s));
t.nodes = [];
return;
}
const a = Kt.encloseBrace(t);
let u = t.queue;
let c = t;
while (c.type !== "brace" && c.type !== "root" && c.parent) {
c = c.parent;
u = c.queue;
}
for (let e = 0; e < t.nodes.length; e++) {
const r = t.nodes[e];
if (r.type === "comma" && t.type === "brace") {
if (e === 1) u.push("");
u.push("");
continue;
}
if (r.type === "close") {
o.push(Vt(o.pop(), u, a));
continue;
}
if (r.value && r.type !== "open") {
u.push(Vt(u.pop(), r.value));
continue;
}
if (r.nodes) {
n(r, t);
}
}
return u;
};
return Kt.flatten(n(t));
};
var Xt = Qt;
var Yt = {
MAX_LENGTH: 1e4,
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"
};
const Zt = et;
const {MAX_LENGTH: zt, CHAR_BACKSLASH: Jt, CHAR_BACKTICK: te, CHAR_COMMA: ee, CHAR_DOT: re, CHAR_LEFT_PARENTHESES: ne, CHAR_RIGHT_PARENTHESES: se, CHAR_LEFT_CURLY_BRACE: ie, CHAR_RIGHT_CURLY_BRACE: oe, CHAR_LEFT_SQUARE_BRACKET: ae, CHAR_RIGHT_SQUARE_BRACKET: ue, CHAR_DOUBLE_QUOTE: ce, CHAR_SINGLE_QUOTE: le, CHAR_NO_BREAK_SPACE: fe, CHAR_ZERO_WIDTH_NOBREAK_SPACE: pe} = Yt;
const he = (t, e = {}) => {
if (typeof t !== "string") {
throw new TypeError("Expected a string");
}
const r = e || {};
const n = typeof r.maxLength === "number" ? Math.min(zt, r.maxLength) : zt;
if (t.length > n) {
throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);
}
const s = {
type: "root",
input: t,
nodes: []
};
const i = [ s ];
let o = s;
let a = s;
let u = 0;
const c = t.length;
let l = 0;
let f = 0;
let p;
const h = () => t[l++];
const d = t => {
if (t.type === "text" && a.type === "dot") {
a.type = "text";
}
if (a && a.type === "text" && t.type === "text") {
a.value += t.value;
return;
}
o.nodes.push(t);
t.parent = o;
t.prev = a;
a = t;
return t;
};
d({
type: "bos"
});
while (l < c) {
o = i[i.length - 1];
p = h();
if (p === pe || p === fe) {
continue;
}
if (p === Jt) {
d({
type: "text",
value: (e.keepEscaping ? p : "") + h()
});
continue;
}
if (p === ue) {
d({
type: "text",
value: "\\" + p
});
continue;
}
if (p === ae) {
u++;
let t;
while (l < c && (t = h())) {
p += t;
if (t === ae) {
u++;
continue;
}
if (t === Jt) {
p += h();
continue;
}
if (t === ue) {
u--;
if (u === 0) {
break;
}
}
}
d({
type: "text",
value: p
});
continue;
}
if (p === ne) {
o = d({
type: "paren",
nodes: []
});
i.push(o);
d({
type: "text",
value: p
});
continue;
}
if (p === se) {
if (o.type !== "paren") {
d({
type: "text",
value: p
});
continue;
}
o = i.pop();
d({
type: "text",
value: p
});
o = i[i.length - 1];
continue;
}
if (p === ce || p === le || p === te) {
const t = p;
let r;
if (e.keepQuotes !== true) {
p = "";
}
while (l < c && (r = h())) {
if (r === Jt) {
p += r + h();
continue;
}
if (r === t) {
if (e.keepQuotes === true) p += r;
break;
}
p += r;
}
d({
type: "text",
value: p
});
continue;
}
if (p === ie) {
f++;
const t = a.value && a.value.slice(-1) === "$" || o.dollar === true;
const e = {
type: "brace",
open: true,
close: false,
dollar: t,
depth: f,
commas: 0,
ranges: 0,
nodes: []
};
o = d(e);
i.push(o);
d({
type: "open",
value: p
});
continue;
}
if (p === oe) {
if (o.type !== "brace") {
d({
type: "text",
value: p
});
continue;
}
const t = "close";
o = i.pop();
o.close = true;
d({
type: t,
value: p
});
f--;
o = i[i.length - 1];
continue;
}
if (p === ee && f > 0) {
if (o.ranges > 0) {
o.ranges = 0;
const t = o.nodes.shift();
o.nodes = [ t, {
type: "text",
value: Zt(o)
} ];
}
d({
type: "comma",
value: p
});
o.commas++;
continue;
}
if (p === re && f > 0 && o.commas === 0) {
const t = o.nodes;
if (f === 0 || t.length === 0) {
d({
type: "text",
value: p
});
continue;
}
if (a.type === "dot") {
o.range = [];
a.value += p;
a.type = "range";
if (o.nodes.length !== 3 && o.nodes.length !== 5) {
o.invalid = true;
o.ranges = 0;
a.type = "text";
continue;
}
o.ranges++;
o.args = [];
continue;
}
if (a.type === "range") {
t.pop();
const e = t[t.length - 1];
e.value += a.value + p;
a = e;
o.ranges--;
continue;
}
d({
type: "dot",
value: p
});
continue;
}
d({
type: "text",
value: p
});
}
do {
o = i.pop();
if (o.type !== "root") {
o.nodes.forEach(t => {
if (!t.nodes) {
if (t.type === "open") t.isOpen = true;
if (t.type === "close") t.isClose = true;
if (!t.nodes) t.type = "text";
t.invalid = true;
}
});
const t = i[i.length - 1];
const e = t.nodes.indexOf(o);
t.nodes.splice(e, 1, ...o.nodes);
}
} while (i.length > 0);
d({
type: "eos"
});
return s;
};
var de = he;
const _e = et;
const ge = qt;
const ye = Xt;
const ve = de;
const Se = (t, e = {}) => {
let r = [];
if (Array.isArray(t)) {
for (const n of t) {
const t = Se.create(n, e);
if (Array.isArray(t)) {
r.push(...t);
} else {
r.push(t);
}
}
} else {
r = [].concat(Se.create(t, e));
}
if (e && e.expand === true && e.nodupes === true) {
r = [ ...new Set(r) ];
}
return r;
};
Se.parse = (t, e = {}) => ve(t, e);
Se.stringify = (t, e = {}) => {
if (typeof t === "string") {
return _e(Se.parse(t, e), e);
}
return _e(t, e);
};
Se.compile = (t, e = {}) => {
if (typeof t === "string") {
t = Se.parse(t, e);
}
return ge(t, e);
};
Se.expand = (t, e = {}) => {
if (typeof t === "string") {
t = Se.parse(t, e);
}
let r = ye(t, e);
if (e.noempty === true) {
r = r.filter(Boolean);
}
if (e.nodupes === true) {
r = [ ...new Set(r) ];
}
return r;
};
Se.create = (t, e = {}) => {
if (t === "" || t.length < 3) {
return [ t ];
}
return e.expand !== true ? Se.compile(t, e) : Se.expand(t, e);
};
var me = Se;
var Ae = {};
const be = p.default;
const Ee = "\\\\/";
const Re = `[^${Ee}]`;
const Pe = "\\.";
const xe = "\\+";
const Ce = "\\?";
const we = "\\/";
const Te = "(?=.)";
const Oe = "[^/]";
const ke = `(?:${we}|$)`;
const Le = `(?:^|${we})`;
const He = `${Pe}{1,2}${ke}`;
const Me = `(?!${Pe})`;
const $e = `(?!${Le}${He})`;
const De = `(?!${Pe}{0,1}${ke})`;
const Fe = `(?!${He})`;
const Ie = `[^.${we}]`;
const Ne = `${Oe}*?`;
const je = {
DOT_LITERAL: Pe,
PLUS_LITERAL: xe,
QMARK_LITERAL: Ce,
SLASH_LITERAL: we,
ONE_CHAR: Te,
QMARK: Oe,
END_ANCHOR: ke,
DOTS_SLASH: He,
NO_DOT: Me,
NO_DOTS: $e,
NO_DOT_SLASH: De,
NO_DOTS_SLASH: Fe,
QMARK_NO_DOT: Ie,
STAR: Ne,
START_ANCHOR: Le
};
const Be = {
...je,
SLASH_LITERAL: `[${Ee}]`,
QMARK: Re,
STAR: `${Re}*?`,
DOTS_SLASH: `${Pe}{1,2}(?:[${Ee}]|$)`,
NO_DOT: `(?!${Pe})`,
NO_DOTS: `(?!(?:^|[${Ee}])${Pe}{1,2}(?:[${Ee}]|$))`,
NO_DOT_SLASH: `(?!${Pe}{0,1}(?:[${Ee}]|$))`,
NO_DOTS_SLASH: `(?!${Pe}{1,2}(?:[${Ee}]|$))`,
QMARK_NO_DOT: `[^.${Ee}]`,
START_ANCHOR: `(?:^|[${Ee}])`,
END_ANCHOR: `(?:[${Ee}]|$)`
};
const Ge = {
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"
};
var qe = {
MAX_LENGTH: 1024 * 64,
POSIX_REGEX_SOURCE: Ge,
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: be.sep,
extglobChars(t) {
return {
"!": {
type: "negate",
open: "(?:(?!(?:",
close: `))${t.STAR})`
},
"?": {
type: "qmark",
open: "(?:",
close: ")?"
},
"+": {
type: "plus",
open: "(?:",
close: ")+"
},
"*": {
type: "star",
open: "(?:",
close: ")*"
},
"@": {
type: "at",
open: "(?:",
close: ")"
}
};
},
globChars(t) {
return t === true ? Be : je;
}
};
(function(t) {
const e = p.default;
const r = process.platform === "win32";
const {REGEX_BACKSLASH: n, REGEX_REMOVE_BACKSLASH: s, REGEX_SPECIAL_CHARS: i, REGEX_SPECIAL_CHARS_GLOBAL: o} = qe;
t.isObject = t => t !== null && typeof t === "object" && !Array.isArray(t);
t.hasRegexChars = t => i.test(t);
t.isRegexChar = e => e.length === 1 && t.hasRegexChars(e);
t.escapeRegex = t => t.replace(o, "\\$1");
t.toPosixSlashes = t => t.replace(n, "/");
t.removeBackslashes = t => t.replace(s, t => t === "\\" ? "" : t);
t.supportsLookbehinds = () => {
const t = process.version.slice(1).split(".").map(Number);
if (t.length === 3 && t[0] >= 9 || t[0] === 8 && t[1] >= 10) {
return true;
}
return false;
};
t.isWindows = t => {
if (t && typeof t.windows === "boolean") {
return t.windows;
}
return r === true || e.sep === "\\";
};
t.escapeLast = (e, r, n) => {
const s = e.lastIndexOf(r, n);
if (s === -1) return e;
if (e[s - 1] === "\\") return t.escapeLast(e, r, s - 1);
return `${e.slice(0, s)}\\${e.slice(s)}`;
};
t.removePrefix = (t, e = {}) => {
let r = t;
if (r.startsWith("./")) {
r = r.slice(2);
e.prefix = "./";
}
return r;
};
t.wrapOutput = (t, e = {}, r = {}) => {
const n = r.contains ? "" : "^";
const s = r.contains ? "" : "$";
let i = `${n}(?:${t})${s}`;
if (e.negated === true) {
i = `(?:^(?!${i}).*$)`;
}
return i;
};
})(Ae);
const Ue = Ae;
const {CHAR_ASTERISK: We, CHAR_AT: Ke, CHAR_BACKWARD_SLASH: Ve, CHAR_COMMA: Qe, CHAR_DOT: Xe, CHAR_EXCLAMATION_MARK: Ye, CHAR_FORWARD_SLASH: Ze, CHAR_LEFT_CURLY_BRACE: ze, CHAR_LEFT_PARENTHESES: Je, CHAR_LEFT_SQUARE_BRACKET: tr, CHAR_PLUS: er, CHAR_QUESTION_MARK: rr, CHAR_RIGHT_CURLY_BRACE: nr, CHAR_RIGHT_PARENTHESES: sr, CHAR_RIGHT_SQUARE_BRACKET: ir} = qe;
const or = t => t === Ze || t === Ve;
const ar = t => {
if (t.isPrefix !== true) {
t.depth = t.isGlobstar ? Infinity : 1;
}
};
const ur = (t, e) => {
const r = e || {};
const n = t.length - 1;
const s = r.parts === true || r.scanToEnd === true;
const i = [];
const o = [];
const a = [];
let u = t;
let c = -1;
let l = 0;
let f = 0;
let p = false;
let h = false;
let d = false;
let _ = false;
let g = false;
let y = false;
let v = false;
let S = false;
let m = false;
let A = false;
let b = 0;
let E;
let R;
let P = {
value: "",
depth: 0,
isGlob: false
};
const x = () => c >= n;
const C = () => u.charCodeAt(c + 1);
const w = () => {
E = R;
return u.charCodeAt(++c);
};
while (c < n) {
R = w();
let t;
if (R === Ve) {
v = P.backslashes = true;
R = w();
if (R === ze) {
y = true;
}
continue;
}
if (y === true || R === ze) {
b++;
while (x() !== true && (R = w())) {
if (R === Ve) {
v = P.backslashes = true;
w();
continue;
}
if (R === ze) {
b++;
continue;
}
if (y !== true && R === Xe && (R = w()) === Xe) {
p = P.isBrace = true;
d = P.isGlob = true;
A = true;
if (s === true) {
continue;
}
break;
}
if (y !== true && R === Qe) {
p = P.isBrace = true;
d = P.isGlob = true;
A = true;
if (s === true) {
continue;
}
break;
}
if (R === nr) {
b--;
if (b === 0) {
y = false;
p = P.isBrace = true;
A = true;
break;
}
}
}
if (s === true) {
continue;
}
break;
}
if (R === Ze) {
i.push(c);
o.push(P);
P = {
value: "",
depth: 0,
isGlob: false
};
if (A === true) continue;
if (E === Xe && c === l + 1) {
l += 2;
continue;
}
f = c + 1;
continue;
}
if (r.noext !== true) {
const t = R === er || R === Ke || R === We || R === rr || R === Ye;
if (t === true && C() === Je) {
d = P.isGlob = true;
_ = P.isExtglob = true;
A = true;
if (R === Ye && c === l) {
m = true;
}
if (s === true) {
while (x() !== true && (R = w())) {
if (R === Ve) {
v = P.backslashes = true;
R = w();
continue;
}
if (R === sr) {
d = P.isGlob = true;
A = true;
break;
}
}
continue;
}
break;
}
}
if (R === We) {
if (E === We) g = P.isGlobstar = true;
d = P.isGlob = true;
A = true;
if (s === true) {
continue;
}
break;
}
if (R === rr) {
d = P.isGlob = true;
A = true;
if (s === true) {
continue;
}
break;
}
if (R === tr) {
while (x() !== true && (t = w())) {
if (t === Ve) {
v = P.backslashes = true;
w();
continue;
}
if (t === ir) {
h = P.isBracket = true;
d = P.isGlob = true;
A = true;
break;
}
}
if (s === true) {
continue;
}
break;
}
if (r.nonegate !== true && R === Ye && c === l) {
S = P.negated = true;
l++;
continue;
}
if (r.noparen !== true && R === Je) {
d = P.isGlob = true;
if (s === true) {
while (x() !== true && (R = w())) {
if (R === Je) {
v = P.backslashes = true;
R = w();
continue;
}
if (R === sr) {
A = true;
break;
}
}
continue;
}
break;
}
if (d === true) {
A = true;
if (s === true) {
continue;
}
break;
}
}
if (r.noext === true) {
_ = false;
d = false;
}
let T = u;
let O = "";
let k = "";
if (l > 0) {
O = u.slice(0, l);
u = u.slice(l);
f -= l;
}
if (T && d === true && f > 0) {
T = u.slice(0, f);
k = u.slice(f);
} else if (d === true) {
T = "";
k = u;
} else {
T = u;
}
if (T && T !== "" && T !== "/" && T !== u) {
if (or(T.charCodeAt(T.length - 1))) {
T = T.slice(0, -1);
}
}
if (r.unescape === true) {
if (k) k = Ue.removeBackslashes(k);
if (T && v === true) {
T = Ue.removeBackslashes(T);
}
}
const L = {
prefix: O,
input: t,
start: l,
base: T,
glob: k,
isBrace: p,
isBracket: h,
isGlob: d,
isExtglob: _,
isGlobstar: g,
negated: S,
negatedExtglob: m
};
if (r.tokens === true) {
L.maxDepth = 0;
if (!or(R)) {
o.push(P);
}
L.tokens = o;
}
if (r.parts === true || r.tokens === true) {
let e;
for (let n = 0; n < i.length; n++) {
const s = e ? e + 1 : l;
const u = i[n];
const c = t.slice(s, u);
if (r.tokens) {
if (n === 0 && l !== 0) {
o[n].isPrefix = true;
o[n].value = O;
} else {
o[n].value = c;
}
ar(o[n]);
L.maxDepth += o[n].depth;
}
if (n !== 0 || c !== "") {
a.push(c);
}
e = u;
}
if (e && e + 1 < t.length) {
const n = t.slice(e + 1);
a.push(n);
if (r.tokens) {
o[o.length - 1].value = n;
ar(o[o.length - 1]);
L.maxDepth += o[o.length - 1].depth;
}
}
L.slashes = i;
L.parts = a;
}
return L;
};
var cr = ur;
const lr = qe;
const fr = Ae;
const {MAX_LENGTH: pr, POSIX_REGEX_SOURCE: hr, REGEX_NON_SPECIAL_CHARS: dr, REGEX_SPECIAL_CHARS_BACKREF: _r, REPLACEMENTS: gr} = lr;
const yr = (t, e) => {
if (typeof e.expandRange === "function") {
return e.expandRange(...t, e);
}
t.sort();
const r = `[${t.join("-")}]`;
try {
new RegExp(r);
} catch (e) {
return t.map(t => fr.escapeRegex(t)).join("..");
}
return r;
};
const vr = (t, e) => `Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`;
const Sr = (t, e) => {
if (typeof t !== "string") {
throw new TypeError("Expected a string");
}
t = gr[t] || t;
const r = {
...e
};
const n = typeof r.maxLength === "number" ? Math.min(pr, r.maxLength) : pr;
let s = t.length;
if (s > n) {
throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);
}
const i = {
type: "bos",
value: "",
output: r.prepend || ""
};
const o = [ i ];
const a = r.capture ? "" : "?:";
const u = fr.isWindows(e);
const c = lr.globChars(u);
const l = lr.extglobChars(c);
const {DOT_LITERAL: f, PLUS_LITERAL: p, SLASH_LITERAL: h, ONE_CHAR: d, DOTS_SLASH: _, NO_DOT: g, NO_DOT_SLASH: y, NO_DOTS_SLASH: v, QMARK: S, QMARK_NO_DOT: m, STAR: A, START_ANCHOR: b} = c;
const E = t => `(${a}(?:(?!${b}${t.dot ? _ : f}).)*?)`;
const R = r.dot ? "" : g;
const P = r.dot ? S : m;
let x = r.bash === true ? E(r) : A;
if (r.capture) {
x = `(${x})`;
}
if (typeof r.noext === "boolean") {
r.noextglob = r.noext;
}
const C = {
input: t,
index: -1,
start: 0,
dot: r.dot === true,
consumed: "",
output: "",
prefix: "",
backtrack: false,
negated: false,
brackets: 0,
braces: 0,
parens: 0,
quotes: 0,
globstar: false,
tokens: o
};
t = fr.removePrefix(t, C);
s = t.length;
const w = [];
const T = [];
const O = [];
let k = i;
let L;
const H = () => C.index === s - 1;
const M = C.peek = (e = 1) => t[C.index + e];
const $ = C.advance = () => t[++C.index] || "";
const D = () => t.slice(C.index + 1);
const F = (t = "", e = 0) => {
C.consumed += t;
C.index += e;
};
const I = t => {
C.output += t.output != null ? t.output : t.value;
F(t.value);
};
const N = () => {
let t = 1;
while (M() === "!" && (M(2) !== "(" || M(3) === "?")) {
$();
C.start++;
t++;
}
if (t % 2 === 0) {
return false;
}
C.negated = true;
C.start++;
return true;
};
const j = t => {
C[t]++;
O.push(t);
};
const B = t => {
C[t]--;
O.pop();
};
const G = t => {
if (k.type === "globstar") {
const e = C.braces > 0 && (t.type === "comma" || t.type === "brace");
const r = t.extglob === true || w.length && (t.type === "pipe" || t.type === "paren");
if (t.type !== "slash" && t.type !== "paren" && !e && !r) {
C.output = C.output.slice(0, -k.output.length);
k.type = "star";
k.value = "*";
k.output = x;
C.output += k.output;
}
}
if (w.length && t.type !== "paren") {
w[w.length - 1].inner += t.value;
}
if (t.value || t.output) I(t);
if (k && k.type === "text" && t.type === "text") {
k.value += t.value;
k.output = (k.output || "") + t.value;
return;
}
t.prev = k;
o.push(t);
k = t;
};
const q = (t, e) => {
const n = {
...l[e],
conditions: 1,
inner: ""
};
n.prev = k;
n.parens = C.parens;
n.output = C.output;
const s = (r.capture ? "(" : "") + n.open;
j("parens");
G({
type: t,
value: e,
output: C.output ? "" : d
});
G({
type: "paren",
extglob: true,
value: $(),
output: s
});
w.push(n);
};
const U = t => {
let n = t.close + (r.capture ? ")" : "");
let s;
if (t.type === "negate") {
let i = x;
if (t.inner && t.inner.length > 1 && t.inner.incl