"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.printJson = printJson;
exports.printSuccess = printSuccess;
exports.printSection = printSection;
exports.formatOptionalValue = formatOptionalValue;
exports.formatTimestamp = formatTimestamp;
function printJson(payload) {
    process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
}
function printSuccess(message, nextSteps = []) {
    console.log(message);
    for (const nextStep of nextSteps) {
        if (nextStep.trim().length > 0) {
            console.log(nextStep);
        }
    }
}
function printSection(title) {
    console.log(title);
}
function formatOptionalValue(value) {
    if (typeof value === 'string') {
        return value.trim().length > 0 ? value : 'none';
    }
    if (value === null || value === undefined) {
        return 'none';
    }
    return String(value);
}
function formatTimestamp(isoDate) {
    try {
        const date = new Date(isoDate);
        return date.toLocaleString('en-US', {
            year: 'numeric',
            month: 'short',
            day: 'numeric',
            hour: '2-digit',
            minute: '2-digit',
        });
    }
    catch {
        return isoDate;
    }
}
