"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setJsonMode = setJsonMode;
exports.header = header;
exports.success = success;
exports.warn = warn;
exports.fail = fail;
exports.info = info;
exports.dim = dim;
exports.bold = bold;
exports.detected = detected;
const CYAN = '\x1b[36m';
const GREEN = '\x1b[32m';
const YELLOW = '\x1b[33m';
const RED = '\x1b[31m';
const DIM = '\x1b[2m';
const BOLD = '\x1b[1m';
const RESET = '\x1b[0m';
let jsonMode = false;
function setJsonMode(enabled) {
    jsonMode = enabled;
}
function write(line) {
    if (jsonMode) {
        process.stderr.write(line + '\n');
    }
    else {
        console.log(line); // slop-ok: logger's non-json stdout path
    }
}
function header(text) {
    write('');
    write(`${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}`);
    write(`${CYAN}  ${text}${RESET}`);
    write(`${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}`);
    write('');
}
function success(text) {
    write(`  ${GREEN}✓${RESET} ${text}`);
}
function warn(text) {
    write(`  ${YELLOW}!${RESET} ${text}`);
}
function fail(text) {
    write(`  ${RED}✗${RESET} ${text}`);
}
function info(text) {
    write(`  ${CYAN}→${RESET} ${text}`);
}
function dim(text) {
    write(`  ${DIM}${text}${RESET}`);
}
function bold(text) {
    return `${BOLD}${text}${RESET}`;
}
function detected(label, value) {
    if (typeof value === 'boolean') {
        write(`  ${value ? GREEN + '✓' : DIM + '·'}${RESET} ${label}`);
    }
    else {
        write(`  ${GREEN}✓${RESET} ${label}: ${CYAN}${value}${RESET}`);
    }
}
//# sourceMappingURL=logger.js.map