'use strict'; var SupportLevel = /* @__PURE__ */ ((SupportLevel2) => { SupportLevel2[SupportLevel2["none"] = 0] = "none"; SupportLevel2[SupportLevel2["ansi"] = 1] = "ansi"; SupportLevel2[SupportLevel2["ansi256"] = 2] = "ansi256"; return SupportLevel2; })(SupportLevel || {}); const options = { enabled: true, supportLevel: 0 /* none */ }; const globalVar = ( // @ts-ignore typeof self !== "undefined" ? ( // @ts-ignore self ) : ( // @ts-ignore typeof window !== "undefined" ? ( // @ts-ignore window ) : typeof global !== "undefined" ? global : {} ) ); if (globalVar.process && globalVar.process.env && globalVar.process.stdout) { const { FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = globalVar.process.env; if (NODE_DISABLE_COLORS || NO_COLOR || FORCE_COLOR === "0") { options.enabled = false; } else if (FORCE_COLOR === "1" || FORCE_COLOR === "2" || FORCE_COLOR === "3") { options.enabled = true; } else if (TERM === "dumb") { options.enabled = false; } else if ("CI" in globalVar.process.env && [ "TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE" ].some((vendor) => vendor in globalVar.process.env)) { options.enabled = true; } else { options.enabled = process.stdout.isTTY; } if (options.enabled) { options.supportLevel = TERM && TERM.endsWith("-256color") ? 2 /* ansi256 */ : 1 /* ansi */; } } function kolorist(start, end, level = 1 /* ansi */) { const open = `\x1B[${start}m`; const close = `\x1B[${end}m`; const regex = new RegExp(`\\x1b\\[${end}m`, "g"); return (str) => { return options.enabled && options.supportLevel >= level ? open + ("" + str).replace(regex, open) + close : "" + str; }; } function combine(...fns) { return (str) => { for (const fn of fns) { str = fn(str); } return str; }; } function stripColors(str) { return ("" + str).replace(/\x1b\[[0-9;]+m/g, "").replace(/\x1b\]8;;.*?\x07(.*?)\x1b\]8;;\x07/g, (_, group) => group); } const reset = kolorist(0, 0); const bold = kolorist(1, 22); const dim = kolorist(2, 22); const italic = kolorist(3, 23); const underline = kolorist(4, 24); const inverse = kolorist(7, 27); const hidden = kolorist(8, 28); const strikethrough = kolorist(9, 29); const black = kolorist(30, 39); const red = kolorist(31, 39); const green = kolorist(32, 39); const yellow = kolorist(33, 39); const blue = kolorist(34, 39); const magenta = kolorist(35, 39); const cyan = kolorist(36, 39); const white = kolorist(97, 39); const gray = kolorist(90, 39); const lightRed = kolorist(91, 39); const lightGreen = kolorist(92, 39); const lightYellow = kolorist(93, 39); const lightBlue = kolorist(94, 39); const lightMagenta = kolorist(95, 39); const lightCyan = kolorist(96, 39); const lightGray = kolorist(37, 39); const bgBlack = kolorist(40, 49); const bgRed = kolorist(41, 49); const bgGreen = kolorist(42, 49); const bgYellow = kolorist(43, 49); const bgBlue = kolorist(44, 49); const bgMagenta = kolorist(45, 49); const bgCyan = kolorist(46, 49); const bgWhite = kolorist(107, 49); const bgGray = kolorist(100, 49); const bgLightRed = kolorist(101, 49); const bgLightGreen = kolorist(102, 49); const bgLightYellow = kolorist(103, 49); const bgLightBlue = kolorist(104, 49); const bgLightMagenta = kolorist(105, 49); const bgLightCyan = kolorist(106, 49); const bgLightGray = kolorist(47, 49); const ansi256 = (n) => kolorist("38;5;" + n, 0, 2 /* ansi256 */); const ansi256Bg = (n) => kolorist("48;5;" + n, 0, 2 /* ansi256 */); const OSC = "\x1B]"; const BEL = "\x07"; const SEP = ";"; function link(text, url) { return options.enabled ? OSC + "8" + SEP + SEP + url + BEL + text + OSC + "8" + SEP + SEP + BEL : `${text} (\u200B${url}\u200B)`; } exports.SupportLevel = SupportLevel; exports.ansi256 = ansi256; exports.ansi256Bg = ansi256Bg; exports.bgBlack = bgBlack; exports.bgBlue = bgBlue; exports.bgCyan = bgCyan; exports.bgGray = bgGray; exports.bgGreen = bgGreen; exports.bgLightBlue = bgLightBlue; exports.bgLightCyan = bgLightCyan; exports.bgLightGray = bgLightGray; exports.bgLightGreen = bgLightGreen; exports.bgLightMagenta = bgLightMagenta; exports.bgLightRed = bgLightRed; exports.bgLightYellow = bgLightYellow; exports.bgMagenta = bgMagenta; exports.bgRed = bgRed; exports.bgWhite = bgWhite; exports.bgYellow = bgYellow; exports.black = black; exports.blue = blue; exports.bold = bold; exports.combine = combine; exports.cyan = cyan; exports.dim = dim; exports.gray = gray; exports.green = green; exports.hidden = hidden; exports.inverse = inverse; exports.italic = italic; exports.lightBlue = lightBlue; exports.lightCyan = lightCyan; exports.lightGray = lightGray; exports.lightGreen = lightGreen; exports.lightMagenta = lightMagenta; exports.lightRed = lightRed; exports.lightYellow = lightYellow; exports.link = link; exports.magenta = magenta; exports.options = options; exports.red = red; exports.reset = reset; exports.strikethrough = strikethrough; exports.stripColors = stripColors; exports.underline = underline; exports.white = white; exports.yellow = yellow;