@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
2,166 lines (2,153 loc) • 84.4 kB
JavaScript
import { __commonJS, __name, __toESM } from './chunk-5BKT4CS5.js';
// ../../node_modules/.pnpm/is-obj@2.0.0/node_modules/is-obj/index.js
var require_is_obj = __commonJS({
"../../node_modules/.pnpm/is-obj@2.0.0/node_modules/is-obj/index.js"(exports, module) {
module.exports = (value) => {
const type = typeof value;
return value !== null && (type === "object" || type === "function");
};
}
});
// ../../node_modules/.pnpm/dot-prop@5.3.0/node_modules/dot-prop/index.js
var require_dot_prop = __commonJS({
"../../node_modules/.pnpm/dot-prop@5.3.0/node_modules/dot-prop/index.js"(exports, module) {
var isObj = require_is_obj();
var disallowedKeys = [
"__proto__",
"prototype",
"constructor"
];
var isValidPath = /* @__PURE__ */ __name((pathSegments) => !pathSegments.some((segment) => disallowedKeys.includes(segment)), "isValidPath");
function getPathSegments(path) {
const pathArray = path.split(".");
const parts = [];
for (let i = 0; i < pathArray.length; i++) {
let p = pathArray[i];
while (p[p.length - 1] === "\\" && pathArray[i + 1] !== void 0) {
p = p.slice(0, -1) + ".";
p += pathArray[++i];
}
parts.push(p);
}
if (!isValidPath(parts)) {
return [];
}
return parts;
}
__name(getPathSegments, "getPathSegments");
module.exports = {
get(object, path, value) {
if (!isObj(object) || typeof path !== "string") {
return value === void 0 ? object : value;
}
const pathArray = getPathSegments(path);
if (pathArray.length === 0) {
return;
}
for (let i = 0; i < pathArray.length; i++) {
if (!Object.prototype.propertyIsEnumerable.call(object, pathArray[i])) {
return value;
}
object = object[pathArray[i]];
if (object === void 0 || object === null) {
if (i !== pathArray.length - 1) {
return value;
}
break;
}
}
return object;
},
set(object, path, value) {
if (!isObj(object) || typeof path !== "string") {
return object;
}
const root = object;
const pathArray = getPathSegments(path);
for (let i = 0; i < pathArray.length; i++) {
const p = pathArray[i];
if (!isObj(object[p])) {
object[p] = {};
}
if (i === pathArray.length - 1) {
object[p] = value;
}
object = object[p];
}
return root;
},
delete(object, path) {
if (!isObj(object) || typeof path !== "string") {
return false;
}
const pathArray = getPathSegments(path);
for (let i = 0; i < pathArray.length; i++) {
const p = pathArray[i];
if (i === pathArray.length - 1) {
delete object[p];
return true;
}
object = object[p];
if (!isObj(object)) {
return false;
}
}
},
has(object, path) {
if (!isObj(object) || typeof path !== "string") {
return false;
}
const pathArray = getPathSegments(path);
if (pathArray.length === 0) {
return false;
}
for (let i = 0; i < pathArray.length; i++) {
if (isObj(object)) {
if (!(pathArray[i] in object)) {
return false;
}
object = object[pathArray[i]];
} else {
return false;
}
}
return true;
}
};
}
});
// ../../node_modules/.pnpm/to-fast-properties@3.0.1/node_modules/to-fast-properties/index.js
var require_to_fast_properties = __commonJS({
"../../node_modules/.pnpm/to-fast-properties@3.0.1/node_modules/to-fast-properties/index.js"(exports, module) {
var fastProto = null;
function FastObject(o) {
if (fastProto !== null && typeof fastProto.property) {
const result = fastProto;
fastProto = FastObject.prototype = null;
return result;
}
fastProto = FastObject.prototype = o == null ? /* @__PURE__ */ Object.create(null) : o;
return new FastObject();
}
__name(FastObject, "FastObject");
var inlineCacheCutoff = 10;
for (let i = 0; i <= inlineCacheCutoff; i++) {
FastObject();
}
module.exports = /* @__PURE__ */ __name(function toFastproperties(o) {
return FastObject(o);
}, "toFastproperties");
}
});
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/iterators.js
var __\u03A9ArrayLike = [
"T",
"length",
"ArrayLike",
`b!P'4"9'e"!LMw#y`
];
var __\u03A9IterableIterator = [
"T",
"TReturn",
"TNext",
() => __\u03A9Iterator,
0,
() => Symbol.iterator,
"IterableIterator",
`b!"c""c#Pe"!e""e"#o$$Pe#!e#"e##o%$1&Mw'y`
];
var __\u03A9Iterator = [
"T",
"TReturn",
"TNext",
"param0",
() => __\u03A9IteratorResult,
"next",
"value",
() => __\u03A9IteratorResult,
"return",
"e",
() => __\u03A9IteratorResult,
"throw",
"Iterator",
`b!"c""c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2'8e#!e#"o(#1)P"2*8e#!e#"o+#1,Mw-y`
];
var __\u03A9IteratorResult = [
"T",
"TReturn",
() => __\u03A9IteratorYieldResult,
() => __\u03A9IteratorReturnResult,
"IteratorResult",
'b!"c"Pe"!o#"e""o$"Jw%y'
];
var __\u03A9IteratorYieldResult = [
"TYield",
false,
"done",
"value",
"IteratorYieldResult",
'b!P."4#8e"!4$Mw%y'
];
var __\u03A9IteratorReturnResult = [
"TReturn",
true,
"done",
"value",
"IteratorReturnResult",
'b!P."4#e"!4$Mw%y'
];
eachKey.__type = [
() => __\u03A9ArrayLike,
"object",
() => __\u03A9IterableIterator,
"eachKey",
`P"o!"2"'o#"/$`
];
eachKey.__type = [
"object",
() => __\u03A9IterableIterator,
"eachKey",
'P"2!&o""/#'
];
function* eachKey(object) {
if (Array.isArray(object)) {
for (let i = 0; i < object.length; i++) {
yield i;
}
} else {
for (const i in object) {
if (object.hasOwnProperty(i)) {
yield i;
}
}
}
}
__name(eachKey, "eachKey");
eachKey.__type = [
() => __\u03A9ArrayLike,
"object",
() => __\u03A9IterableIterator,
"eachKey",
`PP""o!"J2"P&'Jo#"/$`
];
function* each(object) {
if (Array.isArray(object)) {
for (let i = 0; i < object.length; i++) {
yield object[i];
}
} else {
for (const i in object) {
if (object.hasOwnProperty(i)) {
yield object[i];
}
}
}
}
__name(each, "each");
each.__type = [
() => __\u03A9ArrayLike,
"object",
() => __\u03A9IterableIterator,
"each",
'PPP&"LM"o!"J2""o#"/$'
];
eachPair.__type = [
() => __\u03A9ArrayLike,
"object",
() => __\u03A9IterableIterator,
"eachPair",
`P"o!"2"P'"Go#"/$`
];
eachPair.__type = [
"object",
() => __\u03A9IterableIterator,
"eachPair",
'PP&"LM2!P&"Go""/#'
];
function* eachPair(object) {
if (Array.isArray(object)) {
for (let i = 0; i < object.length; i++) {
yield [
i,
object[i]
];
}
} else {
for (const i in object) {
if (object.hasOwnProperty(i)) {
yield [
i,
object[i]
];
}
}
}
}
__name(eachPair, "eachPair");
eachPair.__type = [
() => __\u03A9ArrayLike,
"object",
() => __\u03A9IterableIterator,
"eachPair",
`PPP&"LM"o!"J2"PP&"GP'"GJo#"/$`
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/core.js
var import_dot_prop = __toESM(require_dot_prop(), 1);
var __\u03A9Object = [
() => Function,
"constructor",
"toString",
"toLocaleString",
0,
"valueOf",
() => __\u03A9PropertyKey,
"v",
"hasOwnProperty",
0,
"isPrototypeOf",
() => __\u03A9PropertyKey,
"propertyIsEnumerable",
"Object",
`PPu!4"P&1#P&1$Pn%1&Pn'2()1)Pn*2()1+Pn,2()1-Mw.y`
];
var __\u03A9Error = [
"name",
"message",
"stack",
"Error",
'P&4!&4"&4#8Mw$y'
];
var __\u03A9IterableIterator2 = [
"T",
"TReturn",
"TNext",
() => __\u03A9Iterator2,
0,
() => Symbol.iterator,
"IterableIterator",
`b!"c""c#Pe"!e""e"#o$$Pe#!e#"e##o%$1&Mw'y`
];
var __\u03A9PropertyKey = [
"PropertyKey",
"P&'+Jw!y"
];
var __\u03A9Iterator2 = [
"T",
"TReturn",
"TNext",
"param0",
() => __\u03A9IteratorResult2,
"next",
"value",
() => __\u03A9IteratorResult2,
"return",
"e",
() => __\u03A9IteratorResult2,
"throw",
"Iterator",
`b!"c""c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2'8e#!e#"o(#1)P"2*8e#!e#"o+#1,Mw-y`
];
var __\u03A9IteratorResult2 = [
"T",
"TReturn",
() => __\u03A9IteratorYieldResult2,
() => __\u03A9IteratorReturnResult2,
"IteratorResult",
'b!"c"Pe"!o#"e""o$"Jw%y'
];
var __\u03A9IteratorYieldResult2 = [
"TYield",
false,
"done",
"value",
"IteratorYieldResult",
'b!P."4#8e"!4$Mw%y'
];
var __\u03A9IteratorReturnResult2 = [
"TReturn",
true,
"done",
"value",
"IteratorReturnResult",
'b!P."4#e"!4$Mw%y'
];
function __assignType(fn, args) {
fn.__type = args;
return fn;
}
__name(__assignType, "__assignType");
var CustomError = class extends Error {
static {
__name(this, "CustomError");
}
constructor(...args) {
super(...args);
this.name = this.constructor.name;
}
};
CustomError.__type = [
() => Error,
"name",
"args",
"constructor",
"CustomError",
'P7!&3"P"@2#"0$5w%'
];
var __\u03A9CustomError = [
"cause",
"CustomError",
'P#4!8Mw"y'
];
var __\u03A9ClassType = [
"T",
"args",
"new",
"ClassType",
'"c!PP"@2"e#!1#Mw$y'
];
var __\u03A9AbstractClassType = [
"T",
"args",
"new",
"AbstractClassType",
'"c!P"@2"e"!/#w$y'
];
var __\u03A9ExtractClassType = [
"T",
() => __\u03A9AbstractClassType,
"ExtractClassType",
`l:e"!R!RPde#!h!!o""qk#'QRb!Pde"!p)w#y`
];
function getClassName(classTypeOrInstance) {
if (!classTypeOrInstance) return "undefined";
const proto = classTypeOrInstance["prototype"] ? classTypeOrInstance["prototype"] : classTypeOrInstance;
return proto.constructor.name || "anonymous class";
}
__name(getClassName, "getClassName");
getClassName.__type = [
() => __\u03A9ClassType,
() => __\u03A9Object,
"classTypeOrInstance",
"getClassName",
'PP"o!"n"J2#&/$'
];
function getClassPropertyName(classType, propertyName) {
const name = getClassName(classType);
return `${name}.${propertyName}`;
}
__name(getClassPropertyName, "getClassPropertyName");
getClassPropertyName.__type = [
() => __\u03A9ClassType,
() => __\u03A9Object,
"classType",
"propertyName",
"getClassPropertyName",
'PP"o!"n"J2#&2$&/%'
];
function applyDefaults(classType, target) {
const classInstance = new classType();
for (const [i, v] of eachPair(target)) {
classInstance[i] = v;
}
return classInstance;
}
__name(applyDefaults, "applyDefaults");
applyDefaults.__type = [
() => __\u03A9ClassType,
"classType",
"target",
"applyDefaults",
'P"o!"2"P&"LM2#"/$'
];
function identifyType(obj) {
return (({}.toString.call(obj).match(/\s([a-zA-Z]+)/) || [])[1] || "").toLowerCase();
}
__name(identifyType, "identifyType");
identifyType.__type = [
"obj",
"identifyType",
'P"2!"/"'
];
function isPlainObject(obj) {
return Boolean(obj && typeof obj === "object" && obj.constructor instanceof obj.constructor);
}
__name(isPlainObject, "isPlainObject");
isPlainObject.__type = [
"obj",
"isPlainObject",
'P"2!!/"'
];
function getClassTypeFromInstance(target) {
if (!isClassInstance(target)) {
throw new Error(`Value is not a class instance. Got ${stringifyValueWithType(target)}`);
}
return target["constructor"];
}
__name(getClassTypeFromInstance, "getClassTypeFromInstance");
getClassTypeFromInstance.__type = [
"target",
() => __\u03A9ClassType,
"getClassTypeFromInstance",
'P"2!"o""/#'
];
function isClassInstance(target) {
return target !== void 0 && target !== null && target["constructor"] && Object.getPrototypeOf(target) === target["constructor"].prototype && !isPlainObject(target) && isObject(target);
}
__name(isClassInstance, "isClassInstance");
isClassInstance.__type = [
"target",
"isClassInstance",
'P"2!)/"'
];
function stringifyValueWithType(value, depth = 0) {
if ("string" === typeof value) return `string(${value})`;
if ("number" === typeof value) return `number(${value})`;
if ("boolean" === typeof value) return `boolean(${value})`;
if ("bigint" === typeof value) return `bigint(${value})`;
if (isPlainObject(value)) return `object ${depth < 2 ? prettyPrintObject(value, depth) : ""}`;
if (isArray(value)) return `Array`;
if (isClass(value)) return `${getClassName(value)}`;
if (isObject(value)) return `${getClassName(getClassTypeFromInstance(value))} ${depth < 2 ? prettyPrintObject(value, depth) : ""}`;
if ("function" === typeof value) return `function ${value.name}`;
if (null === value) return `null`;
return "undefined";
}
__name(stringifyValueWithType, "stringifyValueWithType");
stringifyValueWithType.__type = [
"value",
"depth",
() => 0,
"stringifyValueWithType",
`P"2!'2">#&/$`
];
function changeClass(value, newClass) {
return Object.assign(Object.create(newClass.prototype), value);
}
__name(changeClass, "changeClass");
changeClass.__type = [
"value",
() => __\u03A9ClassType,
"newClass",
"changeClass",
'P%2!"o""2#"/$'
];
function prettyPrintObject(object, depth = 0) {
const res = [];
for (const i in object) {
res.push(i + ": " + stringifyValueWithType(object[i], depth + 1));
}
return "{" + res.join(",") + "}";
}
__name(prettyPrintObject, "prettyPrintObject");
prettyPrintObject.__type = [
"object",
"depth",
() => 0,
"prettyPrintObject",
`P%2!'2">#&/$`
];
function isFunction(obj) {
if ("function" === typeof obj) {
return !obj.toString().startsWith("class ") && !obj.toString().startsWith("class{");
}
return false;
}
__name(isFunction, "isFunction");
isFunction.__type = [
"obj",
"isFunction",
'P"2!!/"'
];
var AsyncFunction = (async () => {
}).constructor;
function isAsyncFunction(obj) {
return obj instanceof AsyncFunction;
}
__name(isAsyncFunction, "isAsyncFunction");
isAsyncFunction.__type = [
"obj",
"isAsyncFunction",
'P"2!!/"'
];
function isPromise(obj) {
return obj !== null && typeof obj === "object" && typeof obj.then === "function" && typeof obj.catch === "function" && typeof obj.finally === "function";
}
__name(isPromise, "isPromise");
isPromise.__type = [
"obj",
"isPromise",
'PP""`J2!!/"'
];
function isClass(obj) {
if ("function" === typeof obj) {
return obj.toString().startsWith("class ") || obj.toString().startsWith("class{");
}
return false;
}
__name(isClass, "isClass");
isClass.__type = [
"obj",
"isClass",
'P"2!!/"'
];
function isGlobalClass(obj) {
if ("function" !== typeof obj) return false;
if ("undefined" !== typeof window) {
return window[getClassName(obj)] === obj;
}
if ("undefined" !== typeof global) {
return global[getClassName(obj)] === obj;
}
return false;
}
__name(isGlobalClass, "isGlobalClass");
isGlobalClass.__type = [
"obj",
"isGlobalClass",
'P"2!!/"'
];
function isObject(obj) {
if (obj === null) {
return false;
}
return typeof obj === "object" && !isArray(obj);
}
__name(isObject, "isObject");
isObject.__type = [
"obj",
"isObject",
'P"2!!/"'
];
function isObjectLiteral(obj) {
return isObject(obj) && !(obj instanceof Date) && !(obj instanceof Map) && !(obj instanceof Set);
}
__name(isObjectLiteral, "isObjectLiteral");
isObjectLiteral.__type = [
"obj",
"isObjectLiteral",
'P"2!!/"'
];
var isArray = Array.isArray;
function isNull(obj) {
return null === obj;
}
__name(isNull, "isNull");
isNull.__type = [
"obj",
"isNull",
'P"2!!/"'
];
function isUndefined(obj) {
return void 0 === obj;
}
__name(isUndefined, "isUndefined");
isUndefined.__type = [
"obj",
"isUndefined",
'P"2!!/"'
];
function isSet(obj) {
return !isNull(obj) && !isUndefined(obj);
}
__name(isSet, "isSet");
isSet.__type = [
"obj",
"isSet",
'P"2!)/"'
];
function isNumber(obj) {
return "number" === identifyType(obj);
}
__name(isNumber, "isNumber");
isNumber.__type = [
"obj",
"isNumber",
'P"2!!/"'
];
function isNumeric(s) {
if ("number" === typeof s) return true;
let points = 0;
for (let i = s.length - 1; i >= 0; i--) {
const d = s.charCodeAt(i);
if (d === 46) {
if (points++ > 0) return false;
continue;
}
if (d < 48 || d > 57) return false;
}
return true;
}
__name(isNumeric, "isNumeric");
isNumeric.__type = [
"s",
"isNumeric",
`PP&'J2!)/"`
];
var isInteger = Number.isInteger || __assignType(function(obj) {
return obj % 1 === 0;
}, [
"obj",
"",
'P"2!"/"'
]);
function isString(obj) {
return "string" === identifyType(obj);
}
__name(isString, "isString");
isString.__type = [
"obj",
"isString",
'P"2!!/"'
];
function indexOf(array, item) {
if (!array) {
return -1;
}
return array.indexOf(item);
}
__name(indexOf, "indexOf");
indexOf.__type = [
"array",
"item",
"indexOf",
`P"F2!"2"'/#`
];
async function sleep(seconds) {
return Promise.\u03A9 = [
[
"$"
]
], new Promise(__assignType((resolve) => setTimeout(resolve, seconds * 1e3), [
"resolve",
"",
'P"2!"/"'
]));
}
__name(sleep, "sleep");
sleep.__type = [
"seconds",
"sleep",
"P'2!$`/\""
];
function copy(v) {
if (isArray(v)) {
return v.slice(0);
}
return v;
}
__name(copy, "copy");
copy.__type = [
"v",
"copy",
'P"F2!"F/"'
];
function empty(value) {
if (!value) return true;
if (isArray(value)) {
return value.length === 0;
} else {
for (const i in value) if (value.hasOwnProperty(i)) return false;
return true;
}
}
__name(empty, "empty");
empty.__type = [
"value",
"empty",
'PP"F%PMJ2!8)/"'
];
function size(array) {
if (!array) {
return 0;
}
if (isArray(array)) {
return array.length;
} else {
return getObjectKeysSize(array);
}
}
__name(size, "size");
size.__type = [
"array",
"size",
`PP"FP&"LMJ2!'/"`
];
function firstKey(v) {
return Object.keys(v)[0];
}
__name(firstKey, "firstKey");
firstKey.__type = [
"v",
"firstKey",
'PPP&"LM%J2!P&-J/"'
];
function lastKey(v) {
const keys = Object.keys(v);
if (keys.length) {
return;
}
return keys[keys.length - 1];
}
__name(lastKey, "lastKey");
lastKey.__type = [
"v",
"lastKey",
'PPP&"LM%J2!P&-J/"'
];
function first(v) {
if (isArray(v)) {
return v[0];
}
const key = firstKey(v);
if (key) {
return v[key];
}
return;
}
__name(first, "first");
first.__type = [
"v",
"first",
'PPP&"LM"FJ2!P"-J/"'
];
function last(v) {
if (isArray(v)) {
if (v.length > 0) {
return v[v.length - 1];
}
return;
}
const key = firstKey(v);
if (key) {
return v[key];
}
return;
}
__name(last, "last");
last.__type = [
"v",
"last",
'PPP&"LM"FJ2!P"-J/"'
];
function average(array) {
let sum = 0;
for (const n of array) {
sum += n;
}
return sum / array.length;
}
__name(average, "average");
average.__type = [
"array",
"average",
`P'F2!'/"`
];
function prependObjectKeys(o, prependText) {
const converted = {};
for (const i in o) {
if (!o.hasOwnProperty(i)) continue;
converted[prependText + i] = o[i];
}
return converted;
}
__name(prependObjectKeys, "prependObjectKeys");
prependObjectKeys.__type = [
"o",
"prependText",
"prependObjectKeys",
'PP&"LM2!&2"P&"LM/#'
];
function appendObject(origin, extend, prependKeyName = "") {
const no = prependObjectKeys(extend, prependKeyName);
for (const [i, v] of eachPair(no)) {
origin[i] = v;
}
}
__name(appendObject, "appendObject");
appendObject.__type = [
"origin",
"extend",
"prependKeyName",
() => "",
"appendObject",
'PP&"LM2!P&"LM2"&2#>$"/%'
];
async function asyncOperation(executor) {
try {
return await (Promise.\u03A9 = [
void 0
], new Promise(async (resolve, reject) => {
try {
await executor(resolve, reject);
} catch (e) {
reject(e);
}
}));
} catch (error) {
mergeStack(error, createStack());
throw error;
}
}
__name(asyncOperation, "asyncOperation");
function fixAsyncOperation(promise) {
return asyncOperation(__assignType(async (resolve, reject) => {
resolve(await promise);
}, [
"resolve",
"reject",
"",
'P"2!"2""/#'
]));
}
__name(fixAsyncOperation, "fixAsyncOperation");
fixAsyncOperation.__type = [
"promise",
"fixAsyncOperation",
'P"`2!"`/"'
];
function mergePromiseStack(promise, stack2) {
stack2 = stack2 || createStack();
promise.then(() => {
}, __assignType((error) => {
mergeStack(error, stack2 || "");
}, [
"error",
"",
'P"2!"/"'
]));
return promise;
}
__name(mergePromiseStack, "mergePromiseStack");
mergePromiseStack.__type = [
"promise",
"stack",
"mergePromiseStack",
'P"`2!&2"8"`/#'
];
function createStack(removeCallee = true) {
if (Error.stackTraceLimit === 10) Error.stackTraceLimit = 100;
let stack2 = new Error().stack || "";
stack2 = stack2.slice(stack2.indexOf(" at ") + 6);
stack2 = stack2.slice(stack2.indexOf(" at ") - 1);
if (removeCallee) {
stack2 = stack2.slice(stack2.indexOf(" at ") + 6);
stack2 = stack2.slice(stack2.indexOf(" at ") - 1);
}
return stack2;
}
__name(createStack, "createStack");
createStack.__type = [
"removeCallee",
() => true,
"createStack",
'P)2!>"&/#'
];
function mergeStack(error, stack2) {
if (error instanceof Error && error.stack) {
error.stack += "\n" + stack2;
}
}
__name(mergeStack, "mergeStack");
mergeStack.__type = [
() => __\u03A9Error,
"error",
"stack",
"mergeStack",
'Pn!2"&2#"/$'
];
function ensureError(error, classType = Error) {
return error instanceof Error || error instanceof AggregateError ? error : new classType(error);
}
__name(ensureError, "ensureError");
ensureError.__type = [
"error",
() => __\u03A9ClassType,
"classType",
() => Error,
() => __\u03A9Error,
"ensureError",
'P"2!8n"2#>$n%/&'
];
function collectForMicrotask(callback) {
let items = [];
let taskScheduled = false;
return __assignType((arg) => {
items.push(arg);
if (!taskScheduled) {
taskScheduled = true;
queueMicrotask(() => {
taskScheduled = false;
callback(items);
items.length = 0;
});
}
}, [
() => callback,
"args",
"",
"arg",
'PPdi!Ph"!F2"$/#qe!!!j2$"/#'
]);
}
__name(collectForMicrotask, "collectForMicrotask");
collectForMicrotask.__type = [
"args",
"",
"callback",
"arg",
"collectForMicrotask",
'PP"F2!$/"2#P"2$$/"/%'
];
function time() {
return Date.now() / 1e3;
}
__name(time, "time");
time.__type = [
"time",
"P'/!"
];
function getPathValue(bag, parameterPath, defaultValue) {
if (parameterPath === "" || parameterPath === void 0) return bag;
if (isSet(bag[parameterPath])) {
return bag[parameterPath];
}
const result = import_dot_prop.default.get(bag, parameterPath);
return isSet(result) ? result : defaultValue;
}
__name(getPathValue, "getPathValue");
getPathValue.__type = [
"bag",
"parameterPath",
"defaultValue",
"getPathValue",
'PP&"LM2!&2""2#8"/$'
];
function setPathValue(bag, parameterPath, value) {
import_dot_prop.default.set(bag, parameterPath, value);
}
__name(setPathValue, "setPathValue");
setPathValue.__type = [
"bag",
"parameterPath",
"value",
"setPathValue",
'P%2!&2""2#"/$'
];
function deletePathValue(bag, parameterPath) {
import_dot_prop.default.delete(bag, parameterPath);
}
__name(deletePathValue, "deletePathValue");
deletePathValue.__type = [
"bag",
"parameterPath",
"deletePathValue",
'P%2!&2""/#'
];
function humanBytes(bytes, si = false) {
const thresh = si ? 1e3 : 1024;
if (Math.abs(bytes) < thresh) {
return bytes + " B";
}
const units = si ? [
"kB",
"MB",
"GB",
"TB",
"PB",
"EB",
"ZB",
"YB"
] : [
"KiB",
"MiB",
"GiB",
"TiB",
"PiB",
"EiB",
"ZiB",
"YiB"
];
let u = -1;
do {
bytes /= thresh;
++u;
} while (Math.abs(bytes) >= thresh && u < units.length - 1);
return bytes.toFixed(2) + " " + units[u];
}
__name(humanBytes, "humanBytes");
humanBytes.__type = [
"bytes",
"si",
() => false,
"humanBytes",
`P'2!)2">#&/$`
];
function getObjectKeysSize(obj) {
let size2 = 0;
for (let i in obj) if (obj.hasOwnProperty(i)) size2++;
return size2;
}
__name(getObjectKeysSize, "getObjectKeysSize");
getObjectKeysSize.__type = [
"obj",
"getObjectKeysSize",
`P%2!'/"`
];
function isConstructable(fn) {
try {
new new Proxy(fn, {
construct: /* @__PURE__ */ __name(() => ({}), "construct")
})();
return true;
} catch (err) {
return false;
}
}
__name(isConstructable, "isConstructable");
isConstructable.__type = [
"fn",
"isConstructable",
'P"2!)/"'
];
function isPrototypeOfBase(prototype, base) {
if (!prototype) return false;
if (prototype === base) return true;
let currentProto = Object.getPrototypeOf(prototype);
while (currentProto && currentProto !== Object.prototype) {
if (currentProto === base) return true;
currentProto = Object.getPrototypeOf(currentProto);
}
return false;
}
__name(isPrototypeOfBase, "isPrototypeOfBase");
isPrototypeOfBase.__type = [
() => __\u03A9AbstractClassType,
"prototype",
() => __\u03A9ClassType,
"base",
"isPrototypeOfBase",
'PPn!-J2"n#2$)/%'
];
function getParentClass(classType) {
const parent = Object.getPrototypeOf(classType);
if (parent === Object.prototype || Object.getPrototypeOf(parent) === Object.prototype) return;
return parent;
}
__name(getParentClass, "getParentClass");
getParentClass.__type = [
() => __\u03A9ClassType,
"classType",
() => __\u03A9ClassType,
"getParentClass",
'Pn!2"Pn#-J/$'
];
function getInheritanceChain(classType) {
const chain = [
classType
];
let current = classType;
while (current = getParentClass(current)) {
chain.push(current);
}
return chain;
}
__name(getInheritanceChain, "getInheritanceChain");
getInheritanceChain.__type = [
() => __\u03A9ClassType,
"classType",
() => __\u03A9ClassType,
"getInheritanceChain",
'Pn!2"n#F/$'
];
function inDebugMode() {
return typeof v8debug === "object" || typeof process !== "undefined" && /--debug|--inspect/.test(process.execArgv.join(" "));
}
__name(inDebugMode, "inDebugMode");
inDebugMode.__type = [
"inDebugMode",
'P"/!'
];
function createDynamicClass(name, base) {
if (base) {
let baseName = getClassName(base);
if (baseName === name) baseName += "Base";
return new Function(baseName, `return class ${name} extends ${baseName} {}`)(base);
}
return new Function(`return class ${name} {}`)();
}
__name(createDynamicClass, "createDynamicClass");
createDynamicClass.__type = [
"name",
() => __\u03A9ClassType,
"base",
() => __\u03A9ClassType,
"createDynamicClass",
'P&2!n"2#8n$/%'
];
function isIterable(value) {
return isArray(value) || value instanceof Set || value instanceof Map;
}
__name(isIterable, "isIterable");
isIterable.__type = [
"value",
"isIterable",
'P"2!)/"'
];
function iterableSize(value) {
return isArray(value) ? value.length : value.size || 0;
}
__name(iterableSize, "iterableSize");
iterableSize.__type = [
"value",
"iterableSize",
`PP#F#D##EJ2!'/"`
];
function getCurrentFileName() {
const e = new Error();
const initiator = e.stack.split("\n").slice(2, 3)[0];
let path = /(?<path>[^(\s]+):[0-9]+:[0-9]+/.exec(initiator).groups.path;
if (path.indexOf("file") >= 0) {
path = new URL(path).pathname;
}
if (path[0] === "/" && process.platform === "win32") {
path = path.slice(1);
}
return path;
}
__name(getCurrentFileName, "getCurrentFileName");
getCurrentFileName.__type = [
"getCurrentFileName",
"P&/!"
];
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
__name(escapeRegExp, "escapeRegExp");
escapeRegExp.__type = [
"string",
"escapeRegExp",
'P&2!&/"'
];
function hasProperty(object, property) {
return Object.prototype.hasOwnProperty.call(object, property);
}
__name(hasProperty, "hasProperty");
hasProperty.__type = [
"object",
"property",
"hasProperty",
'P"2!"2")/#'
];
function* range(startOrLength, stop = 0, step = 1) {
let i = startOrLength;
let end = stop;
if (stop === 0) {
i = 0;
end = startOrLength;
}
for (; i < end; i += step) {
yield i;
}
}
__name(range, "range");
range.__type = [
"startOrLength",
"stop",
() => 0,
"step",
() => 1,
() => __\u03A9IterableIterator2,
"range",
`P'2!'2">#'2$>%'o&"/'`
];
function rangeArray(startOrLength, stop = 0, step = 1) {
return [
...range(startOrLength, stop, step)
];
}
__name(rangeArray, "rangeArray");
rangeArray.__type = [
"startOrLength",
"stop",
() => 0,
"step",
() => 1,
"rangeArray",
`P'2!'2">#'2$>%'F/&`
];
function zip(...args) {
const minLength = Math.min(...args.map(__assignType((arr) => arr.length, [
"arr",
"",
'P"2!"/"'
])));
return Array.from({
length: minLength
}).map(__assignType((_, i) => args.map(__assignType((arr) => arr[i], [
"arr",
"",
'P"2!"/"'
])), [
"_",
"i",
"",
'P"2!"2""/#'
]));
}
__name(zip, "zip");
zip.__type = [
"args",
"zip",
`l:e"!R!RPd"e#!fh!!Fqk#'QRP"@2!Pd"gN)!F/"`
];
function forwardTypeArguments(x, y) {
y.\u03A9 = x.\u03A9;
x.\u03A9 = void 0;
}
__name(forwardTypeArguments, "forwardTypeArguments");
forwardTypeArguments.__type = [
"x",
"y",
"forwardTypeArguments",
'P"2!"2"$/#'
];
function formatError(error, withStack = false) {
if (error && error.name === "AggregateError" && "errors" in error) {
return `${withStack && error.stack || `AggregateError: ${error.message}`}
Errors:
${error.errors.map(__assignType((v) => formatError(v), [
"v",
"",
'P"2!"/"'
])).join("\n")}`;
}
if (error instanceof Error) {
let current = error.cause;
let errors = [
withStack && error.stack || error.message || "Error"
];
while (current) {
errors.push(`cause by ${formatError(current)}`);
current = current.cause;
}
return errors.join("\n");
}
if (withStack && error.stack) return error.stack;
return String(error);
}
__name(formatError, "formatError");
formatError.__type = [
"error",
"withStack",
() => false,
"formatError",
'P"2!)2">#&/$'
];
function assertInstanceOf(object, constructor) {
if (!(object instanceof constructor)) {
throw new Error(`Object ${getClassName(object)} is not an instance of the expected class ${getClassName(constructor)}`);
}
}
__name(assertInstanceOf, "assertInstanceOf");
assertInstanceOf.__type = [
"object",
"args",
"new",
"constructor",
"assertInstanceOf",
'P"2!PP"@2""1#M2$!/%'
];
function assertDefined(value) {
if (value === null || value === void 0) {
throw new Error(`Value is not defined`);
}
}
__name(assertDefined, "assertDefined");
assertDefined.__type = [
"value",
"assertDefined",
'P"2!!/"'
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/perf.js
var import_to_fast_properties = __toESM(require_to_fast_properties(), 1);
function toFastProperties(obj) {
(0, import_to_fast_properties.default)(obj);
}
__name(toFastProperties, "toFastProperties");
toFastProperties.__type = [
"obj",
"toFastProperties",
'P"2!"/"'
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/decorators.js
var __\u03A9PropertyDescriptor = [
"configurable",
"enumerable",
"value",
"writable",
"get",
"v",
"set",
"PropertyDescriptor",
`P)4!8)4"8"4#8)4$8P"1%P"2&$1'Mw(y`
];
var __\u03A9TypedPropertyDescriptor = [
"T",
"enumerable",
"configurable",
"writable",
"value",
"",
"get",
"set",
"TypedPropertyDescriptor",
`b!P)4"8)4#8)4$8e"!4%8Pe#!/&4'8Pe#!2%$/&4(8Mw)y`
];
function __assignType2(fn, args) {
fn.__type = args;
return fn;
}
__name(__assignType2, "__assignType");
function log() {
return __assignType2(function(target, propertyKey, descriptor) {
const orig = descriptor.value;
descriptor.value = __assignType2(function(...args) {
const a = args.map(__assignType2((v) => typeof v, [
"v",
"",
'P"2!"/"'
])).join(",");
console.info(getClassName(target) + "::" + String(propertyKey) + "(" + a + ")");
return orig.apply(this, args);
}, [
"args",
"",
'P"@2!"/"'
]);
return descriptor;
}, [
"target",
"propertyKey",
() => __\u03A9PropertyDescriptor,
"descriptor",
"",
'P%2!P&+J2"n#2$"/%'
]);
}
__name(log, "log");
log.__type = [
"log",
'P"/!'
];
function stack() {
return __assignType2(function(target, propertyKey, descriptor) {
const orig = descriptor.value;
descriptor.value = __assignType2(async function(...args) {
const name = "__c_" + propertyKey;
if (this[name] === void 0) {
this[name] = null;
toFastProperties(this);
}
while (this[name]) {
await this[name];
}
this[name] = orig.apply(this, args);
try {
return await this[name];
} finally {
this[name] = null;
}
}, [
"args",
"",
'P"@2!"/"'
]);
}, [
"target",
"propertyKey",
() => __\u03A9TypedPropertyDescriptor,
"args",
"",
"descriptor",
'P%2!&2"P"@2$"`/%o#"2&"/%'
]);
}
__name(stack, "stack");
stack.__type = [
"stack",
'P"/!'
];
function singleStack() {
return __assignType2(function(target, propertyKey, descriptor) {
const orig = descriptor.value;
descriptor.value = __assignType2(async function(...args) {
const name = "__sc_" + propertyKey;
if (this[name] === void 0) {
this[name] = null;
toFastProperties(this);
}
if (this[name]) {
return await this[name];
}
this[name] = orig.apply(this, args);
try {
return await this[name];
} finally {
this[name] = null;
}
}, [
"args",
"",
'P"@2!"/"'
]);
}, [
"target",
"propertyKey",
() => __\u03A9TypedPropertyDescriptor,
"args",
"",
"descriptor",
'P%2!&2"P"@2$"`/%o#"2&"/%'
]);
}
__name(singleStack, "singleStack");
singleStack.__type = [
"singleStack",
'P"/!'
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/enum.js
var __\u03A9Object2 = [
() => Function,
"constructor",
"toString",
"toLocaleString",
0,
"valueOf",
() => __\u03A9PropertyKey2,
"v",
"hasOwnProperty",
0,
"isPrototypeOf",
() => __\u03A9PropertyKey2,
"propertyIsEnumerable",
"Object",
`PPu!4"P&1#P&1$Pn%1&Pn'2()1)Pn*2()1+Pn,2()1-Mw.y`
];
var __\u03A9PropertyKey2 = [
"PropertyKey",
"P&'+Jw!y"
];
function __assignType3(fn, args) {
fn.__type = args;
return fn;
}
__name(__assignType3, "__assignType");
var cacheEnumLabels = (Map.\u03A9 = [
[
() => __\u03A9Object2,
"n!"
],
[
"&F"
]
], /* @__PURE__ */ new Map());
function getEnumLabel(enumType, id) {
for (const i of eachKey(enumType)) {
if (id === enumType[i]) {
return i;
}
}
}
__name(getEnumLabel, "getEnumLabel");
getEnumLabel.__type = [
"enumType",
"id",
"getEnumLabel",
'PP&"LM2!"2""/#'
];
function getEnumLabels(enumDefinition) {
let value = cacheEnumLabels.get(enumDefinition);
if (!value) {
value = Object.keys(enumDefinition).filter(__assignType3((v) => !Number.isFinite(parseInt(v, 10)), [
"v",
"",
'P"2!"/"'
]));
cacheEnumLabels.set(enumDefinition, value);
}
return value;
}
__name(getEnumLabels, "getEnumLabels");
getEnumLabels.__type = [
"enumDefinition",
"getEnumLabels",
'P"2!"/"'
];
var cacheEnumKeys = (Map.\u03A9 = [
[
() => __\u03A9Object2,
"n!"
],
[
"&F"
]
], /* @__PURE__ */ new Map());
function getEnumValues(enumDefinition) {
let value = cacheEnumKeys.get(enumDefinition);
if (!value) {
value = Object.values(enumDefinition).filter(__assignType3((v) => {
return "number" !== typeof enumDefinition[v];
}, [
"v",
"",
'P"2!"/"'
]));
cacheEnumKeys.set(enumDefinition, value);
}
return value;
}
__name(getEnumValues, "getEnumValues");
getEnumValues.__type = [
"enumDefinition",
"getEnumValues",
'P"2!"F/"'
];
function getEnumKeyLabelMap(enumDefinition) {
const map = (Map.\u03A9 = [
[
'"'
],
[
"&"
]
], /* @__PURE__ */ new Map());
const keys = getEnumValues(enumDefinition);
const labels = getEnumLabels(enumDefinition);
for (let i = 0; i < keys.length; i++) {
map.set(keys[i], labels[i]);
}
return map;
}
__name(getEnumKeyLabelMap, "getEnumKeyLabelMap");
getEnumKeyLabelMap.__type = [
"enumDefinition",
"getEnumKeyLabelMap",
'P"2!"&E/"'
];
function isValidEnumValue(enumDefinition, value, allowLabelsAsValue = false) {
if (allowLabelsAsValue) {
const labels = getEnumLabels(enumDefinition);
if (-1 !== labels.indexOf(String(value))) {
return true;
}
}
const values = getEnumValues(enumDefinition);
return -1 !== values.indexOf(+value) || -1 !== values.indexOf(value) || -1 !== values.indexOf(String(value));
}
__name(isValidEnumValue, "isValidEnumValue");
isValidEnumValue.__type = [
"enumDefinition",
"value",
"allowLabelsAsValue",
"isValidEnumValue",
'P"2!"2""2#"/$'
];
function getValidEnumValue(enumDefinition, value, allowLabelsAsValue = false) {
if (allowLabelsAsValue) {
const labels = getEnumLabels(enumDefinition);
if (-1 !== labels.indexOf(String(value))) {
return enumDefinition[String(value)];
}
}
const values = getEnumValues(enumDefinition);
if (-1 !== values.indexOf(value)) {
return value;
}
if (-1 !== values.indexOf(+value)) {
return +value;
}
if (-1 !== values.indexOf(String(value))) {
return String(value);
}
}
__name(getValidEnumValue, "getValidEnumValue");
getValidEnumValue.__type = [
"enumDefinition",
"value",
"allowLabelsAsValue",
"getValidEnumValue",
'P"2!"2""2#"/$'
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/timer.js
var Timer = class {
static {
__name(this, "Timer");
}
constructor() {
this.timeoutTimers = [];
}
setTimeout(cb, timeout) {
const timer = setTimeout(cb, timeout);
this.timeoutTimers.push(timer);
return timer;
}
/**
* Clears all timers at once.
*/
clear() {
for (const timeout of this.timeoutTimers) {
clearTimeout(timeout);
}
}
};
Timer.__type = [
"timeoutTimers",
function() {
return [];
},
"",
"cb",
"timeout",
"setTimeout",
"clear",
"Timer",
`"F3!<>"PP$/#2$'2%"0&P"0'5w(`
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/array.js
function arrayHasItem(array, item) {
return -1 !== array.indexOf(item);
}
__name(arrayHasItem, "arrayHasItem");
arrayHasItem.__type = [
"array",
"item",
"arrayHasItem",
'P"F2!"2")/#'
];
function arrayClear(array) {
const found = array.length;
array.length = 0;
return found;
}
__name(arrayClear, "arrayClear");
arrayClear.__type = [
"array",
"arrayClear",
`P"F2!'/"`
];
function arrayRemoveItem(array, item) {
const index = array.indexOf(item);
if (-1 !== index) {
array.splice(index, 1);
return true;
}
return false;
}
__name(arrayRemoveItem, "arrayRemoveItem");
arrayRemoveItem.__type = [
"array",
"item",
"arrayRemoveItem",
'P"F2!"2")/#'
];
function arrayMoveItem(array, item, move) {
if (move === 0) return array;
const index = array.indexOf(item);
if (-1 !== index) {
const newIndex = index + move;
array.splice(index, 1);
if (newIndex <= 0) {
array.unshift(item);
} else if (newIndex >= array.length) {
array.push(item);
} else {
array.splice(newIndex, 0, item);
}
}
return array;
}
__name(arrayMoveItem, "arrayMoveItem");
arrayMoveItem.__type = [
"array",
"item",
"move",
"arrayMoveItem",
`P"2!"2"'2#"/$`
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/process-locker.js
function __assignType4(fn, args) {
fn.__type = args;
return fn;
}
__name(__assignType4, "__assignType");
var LOCKS = {};
var ProcessLock = class {
static {
__name(this, "ProcessLock");
}
constructor(id) {
this.id = id;
this.holding = false;
}
async acquire(ttl = 0, timeout = 0) {
if (this.holding) {
throw new Error("Lock already acquired");
}
return Promise.\u03A9 = [
[
"$"
]
], new Promise(__assignType4((resolve, reject) => {
if (LOCKS[this.id]) {
let timeoutId;
const ourTake = /* @__PURE__ */ __name(() => {
LOCKS[this.id].time = Date.now() / 1e3;
clearTimeout(timeoutId);
this.holding = true;
resolve();
if (ttl) {
this.ttlTimeout = setTimeout(() => {
this.unlock();
}, ttl * 1e3);
}
}, "ourTake");
if (timeout > 0) {
timeoutId = setTimeout(() => {
if (LOCKS[this.id]) arrayRemoveItem(LOCKS[this.id].queue, ourTake);
reject("Lock timed out " + this.id);
}, timeout * 1e3);
}
LOCKS[this.id].queue.push(ourTake);
} else {
LOCKS[this.id] = {
time: Date.now() / 1e3,
queue: []
};
this.holding = true;
resolve();
if (ttl) {
this.ttlTimeout = setTimeout(() => {
this.unlock();
}, ttl * 1e3);
}
}
}, [
"resolve",
"reject",
"",
'P"2!"2""/#'
]));
}
isLocked() {
return this.holding;
}
tryLock(ttl = 0) {
this.holding = false;
if (!LOCKS[this.id]) {
LOCKS[this.id] = {
time: Date.now() / 1e3,
queue: []
};
this.holding = true;
if (ttl) {
this.ttlTimeout = setTimeout(() => {
this.unlock();
}, ttl * 1e3);
}
}
return this.holding;
}
unlock() {
clearTimeout(this.ttlTimeout);
if (!this.holding) {
return;
}
this.holding = false;
if (LOCKS[this.id].queue.length) {
const next = LOCKS[this.id].queue.shift();
next();
} else {
delete LOCKS[this.id];
}
}
};
ProcessLock.__type = [
"holding",
function() {
return false;
},
"ttlTimeout",
"id",
"constructor",
"ttl",
() => 0,
"timeout",
() => 0,
"acquire",
"isLocked",
() => 0,
"tryLock",
"unlock",
"ProcessLock",
`)3!;>""3#<P&2$:9"0%P'2&>''2(>)"0*P"0+P'2&>,"0-P"0.5w/`
];
var ProcessLocker = class {
static {
__name(this, "ProcessLocker");
}
/**
*
* @param id
* @param ttl optional defines when the times automatically unlocks.
* @param timeout if after `timeout` seconds the lock isn't acquired, it throws an error.
*/
async acquireLock(id, ttl = 0, timeout = 0) {
const lock = new ProcessLock(id);
await lock.acquire(ttl, timeout);
return lock;
}
async tryLock(id, ttl = 0) {
const lock = new ProcessLock(id);
if (lock.tryLock(ttl)) {
return lock;
}
return;
}
isLocked(id) {
return !!LOCKS[id];
}
};
ProcessLocker.__type = [
"id",
"ttl",
() => 0,
"timeout",
() => 0,
() => ProcessLock,
"acquireLock",
() => 0,
() => ProcessLock,
"tryLock",
"isLocked",
"ProcessLocker",
"P&2!'2\">#'2$>%P7&`0'P&2!'2\">(PP7)-J`0*P&2!)0+5w,"
];
var Mutex = class {
static {
__name(this, "Mutex");
}
unlock() {
if (this.resolver) this.resolver();
this.promise = void 0;
}
async lock() {
while (this.promise) {
await this.promise;
}
this.promise = new Promise(__assignType4((resolver) => {
this.resolver = resolver;
}, [
"resolver",
"",
'P"2!"/"'
]));
}
};
Mutex.__type = [
"promise",
() => Function,
"resolver",
"unlock",
"lock",
"Mutex",
'$`3!8<Pu"3#8<P$0$P$`0%5w&'
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/network.js
var ParsedHost = class {
static {
__name(this, "ParsedHost");
}
constructor() {
this.host = "127.0.0.1";
this.port = 0;
this.unixSocket = "";
}
get isUnixSocket() {
return this.unixSocket !== "";
}
get isHostname() {
return this.unixSocket === "";
}
get hostWithIp() {
return this.host + (this.port ? (this.host && ":") + this.port : "");
}
toString() {
return this.isUnixSocket ? this.unixSocket : this.hostWithIp;
}
getWebSocketUrl(secure = false) {
const protocol = secure ? "wss" : "ws";
if (this.isUnixSocket) {
return `${protocol}+unix://${this.unixSocket}`;
}
return `${protocol}://${this.hostWithIp}`;
}
getHttpUrl(secure = false) {
if (this.isUnixSocket) {
return `file://${this.unixSocket}`;
}
const protocol = secure ? "https" : "http";
return `${protocol}://${this.hostWithIp}`;
}
};
ParsedHost.__type = [
"host",
function() {
return "127.0.0.1";
},
"port",
function() {
return 0;
},
"unixSocket",
function() {
return "";
},
"toString",
"secure",
() => false,
"getWebSocketUrl",
() => false,
"getHttpUrl",
"ParsedHost",
`&3!>"'3#>$&3%>&!!!P&0'P)2(>)"0*P)2(>+"0,5w-`
];
function parseHost(hostWithIpOrUnixPath) {
const parsedHost = new ParsedHost();
if (hostWithIpOrUnixPath.includes("/") || hostWithIpOrUnixPath.includes("\\") || hostWithIpOrUnixPath.endsWith(".sock")) {
parsedHost.unixSocket = hostWithIpOrUnixPath;
} else {
if (hostWithIpOrUnixPath.includes(":")) {
const [host, port] = hostWithIpOrUnixPath.split(":");
if (host) parsedHost.host = host;
if (port) parsedHost.port = parseInt(port, 10);
} else {
if (hostWithIpOrUnixPath) parsedHost.host = hostWithIpOrUnixPath;
}
}
return parsedHost;
}
__name(parseHost, "parseHost");
parseHost.__type = [
"hostWithIpOrUnixPath",
() => ParsedHost,
"parseHost",
'P&2!P7"/#'
];
// ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/esm/src/indent.js
function __assignType5(fn, args) {
fn.__type = args;
return fn;
}
__name(__assignType5, "__assignType");
var indent = __assignType5(function(n) {
function t(n2, t2) {
var e2, r2 = [];
for (e2 = 0; e2 < n2.length; e2++) r2.push(t2(n2[e2], e2, n2));
return r2;
}
__name(t, "t");
t.__type = [
"n",
"t",
'P"2!"2""/"'
];
function e(n2, t2) {
var e2, r2;
for (e2 = 0; e2 < n2.length; e2++) if (r2 = t2(n2[e2], e2, n2)) return r2;
return false;
}
__name(e, "e");
e.__type = [
"n",
"t",
"e",
'P"2!"2""/#'
];
function r(n2, t2, e2) {
if (d[n2]) return d[n2];
var r2 = [];
d[n2] = r2, e2 = e2 || "";
for (var a2 = 0; a2 < t2.length; a2++) t2[a2].a.indexOf(n2.toLowerCase()) !== -1 && e2.indexOf(t2[a2].b) === -1 && r2.push(t2[a2]);
return r2;
}
__name(r, "r");
r.__type = [
"n",
"t",
"e",
"r",
'P"2!"2""2#"/$'
];
function a(n2, a2, o2) {
function h2(n3) {
P = n3.cursor;
var t2 = n3.rule, e2 = E + 1 + (t2.c || 0);
n3.line = e2, Z.push(n3), t2.d && z[e2]++, t2.e && (S = r(t2.e, g)), t2.f && F.push(null), t2.callback && t2.callback(n3, z, O);
}
__name(h2, "h");
h2.__type = [
"n",
"h",
'P"2!"/"'
];
function d2() {
var n3 = Z.pop(), t2 = n3.line, e2 = n3.rule;
if (e2.d) {
var r2 = "function" == typeof e2.g ? e2.g(b) : e2.g, a3 = r2 || 0 !== b.matchIndex ? 1 : 0;
O[E + a3] && O[E + a3].push(t2);
}
e2.e && (S = null), e2.f && F.pop(), F[F.length - 1] = n3;
}
__name(d2, "d");
d2.__type = [
"d",
'P"/!'
];
function m2(n3, r2, a3) {
n3 = n3.substring(a3, n3.length);
for (var l2, s2, i2, c2 = null, u2 = n3.length, o3 = F[F.length - 1], h3 = o3 ? o3.rule.b : "", d3 = t(Z, __assignType5(function(n4) {
return n4.rule.b;
}, [
"n",
"",
'P"2!"/"'
])).join("\n"), m3 = 0; m3 < r2.length; m3++) i2 = r2[m3], i2.h && e(i2.h, __assignType5(function(n4) {
return d3.indexOf(n4) != -1;
}, [
"n",
"",
'P"2!"/"'
])) || (!i2.i || h3 && i2.i.indexOf(h3) !== -1) && (s2 = f(n3, i2.j, i2), s2.matchIndex != -1 && s2.matchIndex < u2 && (!i2.k || 0 === a3) && (u2 = s2.matchIndex, l2 = s2, c2 = i2));
return {
rule: c2,
relativeIndex: c2 ? u2 : -1,
matchIndex: c2 ? u2 + a3 : -1,
cursor: c2 ? a3 + l2.cursor : -1,
state: l2 ? l2.state : {},
lastMatch: o3
};
}
__name(m2, "m");
m2.__type = [
"n",
"r",
"a",
"m",
'P"2!"2""2#"/$'
];
function j2(n3, t2, e2, r2) {
n3 = n3.substr(e2, n3.length);
var a3 = t2.rule, l2 = f(n3, a3.l, a3, t2.state, r2), s2 = a3.m ? l2.cursor : l2.matchIndex;
return {
endPatternIndex: l2.endPatternIndex,
matchIndex: l2.matchI