"use strict";
/**
 * @fileoverview Terminal output formatter with Codeforces-themed styling.
 * Provides consistent, colorful CLI output using chalk library.
 * All methods use explicit icon placement for better indentation control.
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fmt = exports.Formatter = void 0;
const chalk_1 = __importDefault(require("chalk"));
/**
 * Formatter class for creating styled terminal output with Codeforces theme.
 * Uses chalk library for coloring with custom hex colors (#1E88E5 blue, #FF6B6B red).
 *
 * @class Formatter
 * @example
 * import { fmt } from './formatter';
 *
 * fmt.section('📁 CREATE TEMPLATE');
 * fmt.step(1, 'Creating directory');
 * fmt.success('Directory created!');
 * fmt.stepComplete('Done');
 */
class Formatter {
    /**
     * Prints a success message in green.
     * @param {string} message - The message to display
     * @example
     * fmt.success('Template created successfully!');
     */
    success(message) {
        console.log(chalk_1.default.green(message));
    }
    /**
     * Prints an error message in red.
     * @param {string} message - The error message to display
     * @example
     * fmt.error('Failed to compile validator');
     */
    error(message) {
        console.log(chalk_1.default.red(message));
    }
    /**
     * Prints a warning message in yellow.
     * @param {string} message - The warning message to display
     * @example
     * fmt.warning('testlib.h already exists');
     */
    warning(message) {
        console.log(chalk_1.default.yellow(message));
    }
    /**
     * Prints an informational message in white.
     * @param {string} message - The info message to display
     * @example
     * fmt.info(`Target: ${generatorName}`);
     */
    info(message) {
        console.log(chalk_1.default.white(message));
    }
    /**
     * Prints a dimmed/gray log message.
     * Used for less important information.
     * @param {string} message - The message to display
     * @example
     * fmt.log('Additional details...');
     */
    log(message) {
        console.log(chalk_1.default.gray(message));
    }
    /**
     * Returns a green checkmark icon (✓).
     * Use explicitly in messages for better indentation control.
     * @returns {string} Styled checkmark
     * @example
     * fmt.success(`${fmt.checkmark()} Test passed`);
     */
    checkmark() {
        return chalk_1.default.green('✓');
    }
    /**
     * Returns a red cross icon (✖).
     * Use explicitly in messages for better indentation control.
     * @returns {string} Styled cross
     * @example
     * fmt.error(`${fmt.cross()} Test failed`);
     */
    cross() {
        return chalk_1.default.red('✖');
    }
    /**
     * Returns a yellow warning icon (⚠).
     * Use explicitly in messages for better indentation control.
     * @returns {string} Styled warning icon
     * @example
     * fmt.warning(`${fmt.warningIcon()} Memory limit not supported on Windows`);
     */
    warningIcon() {
        return chalk_1.default.yellow('⚠');
    }
    /**
     * Returns a blue info icon (ℹ).
     * Use explicitly in messages for better indentation control.
     * @returns {string} Styled info icon
     * @example
     * fmt.info(`${fmt.infoIcon()} Found 5 generators`);
     */
    infoIcon() {
        return chalk_1.default.blue('ℹ');
    }
    /**
     * Prints a section header with blue double-line border.
     * Used to separate major sections in command output.
     * @param {string} title - The section title
     * @example
     * fmt.section('📁 CREATE NEW PROBLEM TEMPLATE');
     */
    section(title) {
        console.log();
        console.log(chalk_1.default.bold.blue(`${'═'.repeat(50)}`));
        console.log(chalk_1.default.bold.blue(`  ${title}`));
        console.log(chalk_1.default.bold.blue(`${'═'.repeat(50)}`));
        console.log();
    }
    /**
     * Prints a numbered step header with a top corner bracket.
     * @param {number} stepNumber - The step number
     * @param {string} title - The step description
     * @example
     * fmt.step(1, 'Creating Directory Structure');
     */
    step(stepNumber, title) {
        console.log();
        console.log(chalk_1.default.bold.blue(`┌─ Step ${stepNumber}: `) + chalk_1.default.bold.white(title));
    }
    /**
     * Prints a step completion message with a bottom corner bracket and checkmark.
     * @param {string} [message] - Optional completion message (defaults to 'Complete')
     * @example
     * fmt.stepComplete('Directory created');
     */
    stepComplete(message) {
        if (message) {
            console.log(chalk_1.default.green(`└─ ✓ ${message}`));
        }
        else {
            console.log(chalk_1.default.green(`└─ ✓ Complete`));
        }
    }
    /**
     * Returns highlighted text in Codeforces blue color.
     * @param {string} text - Text to highlight
     * @returns {string} Styled text
     * @example
     * fmt.info(`Target: ${fmt.highlight('all')}`);
     */
    highlight(text) {
        return chalk_1.default.bold.blue(text);
    }
    /**
     * Returns dimmed/grayed text.
     * @param {string} text - Text to dim
     * @returns {string} Styled text
     * @example
     * fmt.info(`${fmt.dim('(optional)')}`);
     */
    dim(text) {
        return chalk_1.default.dim(text);
    }
    /**
     * Returns bold text.
     * @param {string} text - Text to make bold
     * @returns {string} Styled text
     * @example
     * console.log(fmt.bold('Important:'));
     */
    bold(text) {
        return chalk_1.default.bold(text);
    }
    /**
     * Returns text in Codeforces red accent color (#FF6B6B).
     * @param {string} text - Text to style
     * @returns {string} Styled text
     * @example
     * fmt.log(`Error: ${fmt.accent('Failed')}`);
     */
    accent(text) {
        return chalk_1.default.hex('#FF6B6B')(text); // Codeforces red accent
    }
    /**
     * Returns text in Codeforces primary blue color (#1E88E5).
     * @param {string} text - Text to style
     * @returns {string} Styled text
     * @example
     * fmt.info(`Main solution: ${fmt.primary(mainSolution.name)}`);
     */
    primary(text) {
        return chalk_1.default.hex('#1E88E5')(text); // Codeforces blue
    }
    /**
     * Prints a success box with green border and celebration emoji.
     * Used for final success messages.
     * @param {string} message - Success message to display
     * @example
     * fmt.successBox('TEMPLATE CREATED SUCCESSFULLY!');
     */
    successBox(message) {
        console.log();
        console.log(chalk_1.default.bold.green('  ╔═══════════════════════════════════════════════╗'));
        console.log(chalk_1.default.bold.green(`    🎉  ${message.padEnd(41)}  `));
        console.log(chalk_1.default.bold.green('  ╚═══════════════════════════════════════════════╝'));
        console.log();
    }
    /**
     * Prints an error box with red border and cross emoji.
     * Used for final error messages.
     * @param {string} message - Error message to display
     * @example
     * fmt.errorBox('VALIDATION FAILED!');
     */
    errorBox(message) {
        console.log();
        console.log(chalk_1.default.bold.red('  ╔═══════════════════════════════════════════╗'));
        console.log(chalk_1.default.bold.red(`   ❌  ${message.padEnd(35)}  `));
        console.log(chalk_1.default.bold.red('  ╚═══════════════════════════════════════════╝'));
        console.log();
    }
}
exports.Formatter = Formatter;
/**
 * Singleton instance of the Formatter class.
 * Import and use this instance throughout the application for consistent styling.
 *
 * @constant
 * @type {Formatter}
 * @example
 * import { fmt } from './formatter';
 * fmt.success('Operation completed!');
 */
exports.fmt = new Formatter();
//# sourceMappingURL=formatter.js.map