nsole
Version:
A drop-in isomorphic console.* replacement that's pretty, small, fast, and flexible
1,140 lines (1,123 loc) • 89.6 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __moduleCache = /* @__PURE__ */ new WeakMap;
var __toCommonJS = (from) => {
var entry = __moduleCache.get(from), desc;
if (entry)
return entry;
entry = __defProp({}, "__esModule", { value: true });
if (from && typeof from === "object" || typeof from === "function")
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
}));
__moduleCache.set(from, entry);
return entry;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: (newValue) => all[name] = () => newValue
});
};
// src/index.ts
var exports_src = {};
__export(exports_src, {
stagi: () => stagi2,
staggi: () => staggi2,
stagg: () => stagg2,
stag: () => stag2,
ptagi: () => ptagi2,
ptaggi: () => ptaggi2,
ptagg: () => ptagg2,
ptag: () => ptag2,
ltagi: () => ltagi2,
ltaggi: () => ltaggi2,
ltagg: () => ltagg2,
ltag: () => ltag2,
ftagi: () => ftagi2,
ftaggi: () => ftaggi2,
ftagg: () => ftagg2,
ftag: () => ftag2,
etagi: () => etagi2,
etaggi: () => etaggi2,
etagg: () => etagg2,
etag: () => etag2,
default: () => src_default,
ctagi: () => ctagi2,
ctaggi: () => ctaggi2,
ctagg: () => ctagg2,
ctag: () => ctag2,
btagi: () => btagi2,
btaggi: () => btaggi2,
btagg: () => btagg2,
btag: () => btag2
});
module.exports = __toCommonJS(exports_src);
// src/browser/ansi/_tmpl_.btag.ts
var btagi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"(",
"){",
"}"
],
_css: [
" ",
" ",
" ",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/_tmpl_.ctag.ts
var ctagi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"",
":",
":"
],
_css: [
" ",
" ",
" ",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/_tmpl_.etag.ts
var etagi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"",
" ",
" "
],
_css: [
" ",
" ",
" ",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/_tmpl_.ftag.ts
var ftagi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"",
"/",
"/"
],
_css: [
" ",
" ",
" ",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/_tmpl_.ltag.ts
var ltagi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"|",
"|",
"|"
],
_css: [
" ",
" ",
" ",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/_tmpl_.ptag.ts
var ptagi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"[",
"]",
"|"
],
_css: [
"color:#0000;margin:-1px 0 -1px -1ch;padding:1px;",
"border-radius:2px;color:#282828;color:light-dark(#FFF, #282828);background:^^^;background:light-dark(oklch(from ^^^ calc(l - .018) c h), ^^^);",
"color:^;color:light-dark(oklch(from ^ calc(l - .08) c h), oklch(from ^ calc(l + .05) c h));",
"border-right:2px solid ^;border-right-color:light-dark(oklch(from ^ calc(l - .018) c h), ^);",
"color:^;font-weight:900;font-family:Menlo,Consolas,monospace;margin:-1px 0;padding:1px 3px;"
],
...defsG,
...definitions ?? eobj,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/_tmpl_.stag.ts
var stagi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"[",
"][",
"]"
],
_css: [
"color:#0000;margin:-1px 0 -1px -1ch;padding:1px;border:none;",
"padding:0 3px;background:#0000;border:1px solid ^;color:^;color:light-dark(oklch(from ^ calc(l - .08) c h), ^);",
"padding:0;margin-left:-4px;color:^;color:light-dark(oklch(from ^ calc(l - .08) c h), ^);border:none;",
"padding:0;border:none;",
"color:^;font-weight:900;font-family:Menlo,Consolas,monospace;margin:-1px 0;padding:1px 3px;border-color:light-dark(oklch(from ^ calc(l - .12) c h), ^);"
],
...defsG,
...definitions ?? eobj,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/fg/_tmpl_.btag.ts
var btaggi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 3 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [fgG, fgF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["FG"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"(",
"){",
"}"
],
_css: [
" ",
" ",
"color:^^;color:light-dark(oklch(from ^^ calc(l - .08) c h), oklch(from ^^ calc(l + .05) c h));",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
_fg: definitions?._fg ?? fgG ?? defsG?._fg,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
fg = fgF ?? fg ?? defs._fg ?? "#89A";
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/fg/_tmpl_.ctag.ts
var ctaggi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 3 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [fgG, fgF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["FG"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"",
":",
":"
],
_css: [
" ",
" ",
"color:^^;color:light-dark(oklch(from ^^ calc(l - .08) c h), oklch(from ^^ calc(l + .05) c h));",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
_fg: definitions?._fg ?? fgG ?? defsG?._fg,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
fg = fgF ?? fg ?? defs._fg ?? "#89A";
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/fg/_tmpl_.etag.ts
var etaggi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 3 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [fgG, fgF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["FG"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"",
" ",
" "
],
_css: [
" ",
" ",
"color:^^;color:light-dark(oklch(from ^^ calc(l - .08) c h), oklch(from ^^ calc(l + .05) c h));",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
_fg: definitions?._fg ?? fgG ?? defsG?._fg,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
fg = fgF ?? fg ?? defs._fg ?? "#89A";
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/fg/_tmpl_.ftag.ts
var ftaggi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 3 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [fgG, fgF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["FG"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"",
"/",
"/"
],
_css: [
" ",
" ",
"color:^^;color:light-dark(oklch(from ^^ calc(l - .08) c h), oklch(from ^^ calc(l + .05) c h));",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
_fg: definitions?._fg ?? fgG ?? defsG?._fg,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
fg = fgF ?? fg ?? defs._fg ?? "#89A";
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/fg/_tmpl_.ltag.ts
var ltaggi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 3 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [fgG, fgF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["FG"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"|",
"|",
"|"
],
_css: [
" ",
" ",
"color:^^;color:light-dark(oklch(from ^^ calc(l - .08) c h), oklch(from ^^ calc(l + .05) c h));",
" ",
"font-weight:900;font-family:Menlo,Consolas,monospace;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), oklch(from ^^^ calc(l + .05) c h));"
],
...defsG,
...definitions ?? eobj,
_fg: definitions?._fg ?? fgG ?? defsG?._fg,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
fg = fgF ?? fg ?? defs._fg ?? "#89A";
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/fg/_tmpl_.ptag.ts
var ptaggi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 3 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [fgG, fgF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["FG"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"[",
"]",
"|"
],
_css: [
"color:#0000;margin:-1px 0 -1px -1ch;padding:1px;",
"border-radius:2px;color:#282828;color:light-dark(#FFF, #282828);background:^^^;background:light-dark(oklch(from ^^^ calc(l - .018) c h), ^^^);",
"color:^^;color:light-dark(oklch(from ^^ calc(l - .08) c h), oklch(from ^^ calc(l + .05) c h));",
"border-right:2px solid ^^^;border-right-color:light-dark(oklch(from ^^^ calc(l - .018) c h), ^^^);",
"color:^;font-weight:900;font-family:Menlo,Consolas,monospace;margin:-1px 0;padding:1px 3px;"
],
...defsG,
...definitions ?? eobj,
_fg: definitions?._fg ?? fgG ?? defsG?._fg,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
fg = fgF ?? fg ?? defs._fg ?? "#89A";
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/ansi/fg/_tmpl_.stag.ts
var staggi = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 3 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [fgG, fgF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["FG"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"[",
"][",
"]"
],
_css: [
"color:#0000;margin:-1px 0 -1px -1ch;padding:1px;border:none;",
"padding:0 3px;background: #0000;border: 1px solid ^^^;color:^^^;color:light-dark(oklch(from ^^^ calc(l - .08) c h), ^^^);",
"padding:0;margin-left:-4px;color:^^;color:light-dark(oklch(from ^^ calc(l - .08) c h), ^^);border:none;",
"padding:0;border:none;",
"color:^;font-weight:900;font-family:Menlo,Consolas,monospace;margin:-1px 0;padding:1px 3px;border-color:light-dark(oklch(from ^^^ calc(l - .12) c h), ^^^);"
],
...defsG,
...definitions ?? eobj,
_fg: definitions?._fg ?? fgG ?? defsG?._fg,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
fg = fgF ?? fg ?? defs._fg ?? "#89A";
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/_tmpl_.btag.ts
var btag = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj]
].map(getEnvDefVal), _defs = {
debug: [5, ">", "#89A"],
log: [4, ">", "#2AE"],
info: [4, "i", "#1AA"],
check: [3, "?", "#D6D"],
warn: [2, "!", "#F77"],
error: [1, "X", "#F36"],
_dl: [
"(",
"){",
"}"
],
_css: [
" ",
" ",
" ",
" ",
"color:^;font-weight:900;font-family:Menlo,Consolas,monospace;"
],
...defsG,
...definitions ?? eobj,
...defsF ?? eobj
}, setStyle = (value, dvalue = _defs) => ({ ...dvalue, ...value ?? _defs }), isForceRerun = 0 > colorSpace, gconsole = console) => new Proxy({
[i]: idG,
[s]: setStyle(),
[l]: lvlG
}, {
get: (target, prop) => {
let defs = target[s] ?? _defs;
let idef = defs[prop];
lvlF = gthis[G + "LVL" + F];
let ilvl = ~~(lvlF ?? target[l]);
let rtn = prop == l || prop == i || prop == s ? target[prop] : ilvl && (ilvl == -1 || !idef && (prop in gconsole)) ? gconsole[prop] ?? gconsole.log : !ilvl || idef?.[0] > ilvl ? lnoop : null;
if (!rtn && ((target[prop] ?? lnoop) === lnoop || isForceRerun)) {
target[s] = idef ? defs : setStyle({ [prop]: [1, prop, "#A58"] }, defs);
idef = target[s][prop];
let cid = (idF ?? target[i] ?? "").replace("{}", prop);
let plug = pluginF ?? pluginG;
let [nid, tag, bg, fg, cm, css, dl] = plug ? plug(idef, prop, cid, target) : idef;
if (nid !== idef[0]) {
if (tof(nid, "f")) {
return nid;
}
cid = tof(nid) ? nid : cid;
}
dl = defsF?._dl ?? dl ?? defs._dl;
css = defsF?._css ?? css ?? defs._css;
let nc = "NO_COLOR" in gthis || (fg ?? defs._fg) == "";
nc = isForceRerun ? !nc : colorSpace ?? !nc;
let [ds, dm, de] = dl.map((v) => nc ? `%c${v}%c` : v);
let [dcss, tcss, xcss, ecss, acss] = css;
target[prop] = (gconsole[cm ?? prop] ?? gconsole.log).bind(gconsole, ds + (prop == tag ? "*" : tag) + dm + cid + de, ...nc ? [dcss, tcss, dcss, xcss, dcss + ecss, ""].map((v) => v ? ((acss ?? "") + v).replace(/\^+/g, (match) => (match == "^" ? fg ?? bg : match == "^^" ? fg ?? defs._fg : bg) ?? "#000C") : v) : []);
}
return rtn || target[prop];
},
set: (target, prop, value) => {
target[prop] = prop == l ? value ?? lvlG : prop == i ? value ?? idG : setStyle(value, target[s]);
for (let k in target[s]) {
target[k] = lnoop;
}
return true;
}
});
// src/browser/_tmpl_.ctag.ts
var ctag = (id, level, definitions, pluginFn, colorSpace, i = "_id", s = "_def", l = "_lvl", G = "PTAG_", F = "_FORCE", eobj = {}, lnoop = () => {}, tof = (v, k = "s") => (typeof v)[0] == k, gthis = tof(globalThis, "o") ? globalThis : eobj, getEnvDefVal = ([key, param, def], idx) => [param ?? gthis[G + key] ?? def, gthis[G + key + F]].map((v) => idx > 2 ? tof(v) ? JSON.parse(v) : v : v), [[idG, idF], [lvlG, lvlF], [pluginG, pluginF], [defsG, defsF]] = [
["ID", id, "{}"],
["LVL", level, 5],
["PLG", pluginFn],
["DEF", null, eobj