lakutata
Version:
An IoC-based universal application framework.
659 lines (612 loc) • 19.2 kB
JavaScript
/* Build Date: Mon Jan 05 2026 23:52:23 GMT+0800 (China Standard Time) */
;
const e = require("buffer");
const t = require("tty");
const r = require("util");
const n = e => e && e.__esModule ? e : {
default: e
};
const s = n(e);
const o = n(t);
const i = n(r);
var c = {
exports: {}
};
var u = {
exports: {}
};
u.exports;
var a;
function f() {
if (a) return u.exports;
a = 1;
if (typeof Object.create === "function") {
u.exports = function e(t, r) {
if (r) {
t.super_ = r;
t.prototype = Object.create(r.prototype, {
constructor: {
value: t,
enumerable: false,
writable: true,
configurable: true
}
});
}
};
} else {
u.exports = function e(t, r) {
if (r) {
t.super_ = r;
var n = function() {};
n.prototype = r.prototype;
t.prototype = new n;
t.prototype.constructor = t;
}
};
}
return u.exports;
}
c.exports;
var l;
function p() {
if (l) return c.exports;
l = 1;
try {
var e = require("util");
if (typeof e.inherits !== "function") throw "";
c.exports = e.inherits;
} catch (e) {
c.exports = f();
}
return c.exports;
}
var d = {
exports: {}
};
d.exports;
var C;
function m() {
if (C) return d.exports;
C = 1;
(function(e, t) {
var r = s.default;
var n = r.Buffer;
function o(e, t) {
for (var r in e) {
t[r] = e[r];
}
}
if (n.from && n.alloc && n.allocUnsafe && n.allocUnsafeSlow) {
e.exports = r;
} else {
o(r, t);
t.Buffer = i;
}
function i(e, t, r) {
return n(e, t, r);
}
i.prototype = Object.create(n.prototype);
o(n, i);
i.from = function(e, t, r) {
if (typeof e === "number") {
throw new TypeError("Argument must not be a number");
}
return n(e, t, r);
};
i.alloc = function(e, t, r) {
if (typeof e !== "number") {
throw new TypeError("Argument must be a number");
}
var s = n(e);
if (t !== undefined) {
if (typeof r === "string") {
s.fill(t, r);
} else {
s.fill(t);
}
} else {
s.fill(0);
}
return s;
};
i.allocUnsafe = function(e) {
if (typeof e !== "number") {
throw new TypeError("Argument must be a number");
}
return n(e);
};
i.allocUnsafeSlow = function(e) {
if (typeof e !== "number") {
throw new TypeError("Argument must be a number");
}
return r.SlowBuffer(e);
};
})(d, d.exports);
return d.exports;
}
var h = {
exports: {}
};
var g = {
exports: {}
};
var y;
var F;
function v() {
if (F) return y;
F = 1;
var e = 1e3;
var t = e * 60;
var r = t * 60;
var n = r * 24;
var s = n * 7;
var o = n * 365.25;
y = function(e, t) {
t = t || {};
var r = typeof e;
if (r === "string" && e.length > 0) {
return i(e);
} else if (r === "number" && isFinite(e)) {
return t.long ? u(e) : c(e);
}
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e));
};
function i(i) {
i = String(i);
if (i.length > 100) {
return;
}
var c = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);
if (!c) {
return;
}
var u = parseFloat(c[1]);
var a = (c[2] || "ms").toLowerCase();
switch (a) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return u * o;
case "weeks":
case "week":
case "w":
return u * s;
case "days":
case "day":
case "d":
return u * n;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return u * r;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return u * t;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return u * e;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return u;
default:
return undefined;
}
}
function c(s) {
var o = Math.abs(s);
if (o >= n) {
return Math.round(s / n) + "d";
}
if (o >= r) {
return Math.round(s / r) + "h";
}
if (o >= t) {
return Math.round(s / t) + "m";
}
if (o >= e) {
return Math.round(s / e) + "s";
}
return s + "ms";
}
function u(s) {
var o = Math.abs(s);
if (o >= n) {
return a(s, o, n, "day");
}
if (o >= r) {
return a(s, o, r, "hour");
}
if (o >= t) {
return a(s, o, t, "minute");
}
if (o >= e) {
return a(s, o, e, "second");
}
return s + " ms";
}
function a(e, t, r, n) {
var s = t >= r * 1.5;
return Math.round(e / r) + " " + n + (s ? "s" : "");
}
return y;
}
var b;
var w;
function x() {
if (w) return b;
w = 1;
function e(e) {
r.debug = r;
r.default = r;
r.coerce = u;
r.disable = i;
r.enable = s;
r.enabled = c;
r.humanize = v();
r.destroy = a;
Object.keys(e).forEach(t => {
r[t] = e[t];
});
r.names = [];
r.skips = [];
r.formatters = {};
function t(e) {
let t = 0;
for (let r = 0; r < e.length; r++) {
t = (t << 5) - t + e.charCodeAt(r);
t |= 0;
}
return r.colors[Math.abs(t) % r.colors.length];
}
r.selectColor = t;
function r(e) {
let t;
let s = null;
let o;
let i;
function c(...e) {
if (!c.enabled) {
return;
}
const n = c;
const s = Number(new Date);
const o = s - (t || s);
n.diff = o;
n.prev = t;
n.curr = s;
t = s;
e[0] = r.coerce(e[0]);
if (typeof e[0] !== "string") {
e.unshift("%O");
}
let i = 0;
e[0] = e[0].replace(/%([a-zA-Z%])/g, (t, s) => {
if (t === "%%") {
return "%";
}
i++;
const o = r.formatters[s];
if (typeof o === "function") {
const r = e[i];
t = o.call(n, r);
e.splice(i, 1);
i--;
}
return t;
});
r.formatArgs.call(n, e);
const u = n.log || r.log;
u.apply(n, e);
}
c.namespace = e;
c.useColors = r.useColors();
c.color = r.selectColor(e);
c.extend = n;
c.destroy = r.destroy;
Object.defineProperty(c, "enabled", {
enumerable: true,
configurable: false,
get: () => {
if (s !== null) {
return s;
}
if (o !== r.namespaces) {
o = r.namespaces;
i = r.enabled(e);
}
return i;
},
set: e => {
s = e;
}
});
if (typeof r.init === "function") {
r.init(c);
}
return c;
}
function n(e, t) {
const n = r(this.namespace + (typeof t === "undefined" ? ":" : t) + e);
n.log = this.log;
return n;
}
function s(e) {
r.save(e);
r.namespaces = e;
r.names = [];
r.skips = [];
const t = (typeof e === "string" ? e : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
for (const e of t) {
if (e[0] === "-") {
r.skips.push(e.slice(1));
} else {
r.names.push(e);
}
}
}
function o(e, t) {
let r = 0;
let n = 0;
let s = -1;
let o = 0;
while (r < e.length) {
if (n < t.length && (t[n] === e[r] || t[n] === "*")) {
if (t[n] === "*") {
s = n;
o = r;
n++;
} else {
r++;
n++;
}
} else if (s !== -1) {
n = s + 1;
o++;
r = o;
} else {
return false;
}
}
while (n < t.length && t[n] === "*") {
n++;
}
return n === t.length;
}
function i() {
const e = [ ...r.names, ...r.skips.map(e => "-" + e) ].join(",");
r.enable("");
return e;
}
function c(e) {
for (const t of r.skips) {
if (o(e, t)) {
return false;
}
}
for (const t of r.names) {
if (o(e, t)) {
return true;
}
}
return false;
}
function u(e) {
if (e instanceof Error) {
return e.stack || e.message;
}
return e;
}
function a() {
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
r.enable(r.load());
return r;
}
b = e;
return b;
}
g.exports;
var O;
function A() {
if (O) return g.exports;
O = 1;
(function(e, t) {
t.formatArgs = n;
t.save = s;
t.load = o;
t.useColors = r;
t.storage = i();
t.destroy = (() => {
let e = false;
return () => {
if (!e) {
e = true;
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
};
})();
t.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ];
function r() {
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
return true;
}
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
let e;
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (e = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(e[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
function n(t) {
t[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + t[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff);
if (!this.useColors) {
return;
}
const r = "color: " + this.color;
t.splice(1, 0, r, "color: inherit");
let n = 0;
let s = 0;
t[0].replace(/%[a-zA-Z%]/g, e => {
if (e === "%%") {
return;
}
n++;
if (e === "%c") {
s = n;
}
});
t.splice(s, 0, r);
}
t.log = console.debug || console.log || (() => {});
function s(e) {
try {
if (e) {
t.storage.setItem("debug", e);
} else {
t.storage.removeItem("debug");
}
} catch (e) {}
}
function o() {
let e;
try {
e = t.storage.getItem("debug") || t.storage.getItem("DEBUG");
} catch (e) {}
if (!e && typeof process !== "undefined" && "env" in process) {
e = process.env.DEBUG;
}
return e;
}
function i() {
try {
return localStorage;
} catch (e) {}
}
e.exports = x()(t);
const {formatters: c} = e.exports;
c.j = function(e) {
try {
return JSON.stringify(e);
} catch (e) {
return "[UnexpectedJSONParseError]: " + e.message;
}
};
})(g, g.exports);
return g.exports;
}
var E = {
exports: {}
};
E.exports;
var j;
function k() {
if (j) return E.exports;
j = 1;
(function(e, t) {
const r = o.default;
const n = i.default;
t.init = p;
t.log = a;
t.formatArgs = c;
t.save = f;
t.load = l;
t.useColors = s;
t.destroy = n.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
t.colors = [ 6, 2, 3, 4, 5, 1 ];
try {
const e = require("supports-color");
if (e && (e.stderr || e).level >= 2) {
t.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ];
}
} catch (e) {}
t.inspectOpts = Object.keys(process.env).filter(e => /^debug_/i.test(e)).reduce((e, t) => {
const r = t.substring(6).toLowerCase().replace(/_([a-z])/g, (e, t) => t.toUpperCase());
let n = process.env[t];
if (/^(yes|on|true|enabled)$/i.test(n)) {
n = true;
} else if (/^(no|off|false|disabled)$/i.test(n)) {
n = false;
} else if (n === "null") {
n = null;
} else {
n = Number(n);
}
e[r] = n;
return e;
}, {});
function s() {
return "colors" in t.inspectOpts ? Boolean(t.inspectOpts.colors) : r.isatty(process.stderr.fd);
}
function c(t) {
const {namespace: r, useColors: n} = this;
if (n) {
const n = this.color;
const s = "[3" + (n < 8 ? n : "8;5;" + n);
const o = ` ${s};1m${r} [0m`;
t[0] = o + t[0].split("\n").join("\n" + o);
t.push(s + "m+" + e.exports.humanize(this.diff) + "[0m");
} else {
t[0] = u() + r + " " + t[0];
}
}
function u() {
if (t.inspectOpts.hideDate) {
return "";
}
return (new Date).toISOString() + " ";
}
function a(...e) {
return process.stderr.write(n.formatWithOptions(t.inspectOpts, ...e) + "\n");
}
function f(e) {
if (e) {
process.env.DEBUG = e;
} else {
delete process.env.DEBUG;
}
}
function l() {
return process.env.DEBUG;
}
function p(e) {
e.inspectOpts = {};
const r = Object.keys(t.inspectOpts);
for (let n = 0; n < r.length; n++) {
e.inspectOpts[r[n]] = t.inspectOpts[r[n]];
}
}
e.exports = x()(t);
const {formatters: d} = e.exports;
d.o = function(e) {
this.inspectOpts.colors = this.useColors;
return n.inspect(e, this.inspectOpts).split("\n").map(e => e.trim()).join(" ");
};
d.O = function(e) {
this.inspectOpts.colors = this.useColors;
return n.inspect(e, this.inspectOpts);
};
})(E, E.exports);
return E.exports;
}
h.exports;
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
h.exports = A();
} else {
h.exports = k();
}
exports.srcExports = h.exports;
exports.requireInherits = p;
exports.requireSafeBuffer = m;