/**
 * Safe widget helpers - prevent common neo-blessed errors
 */
/**
 * Safely show/hide a widget
 * neo-blessed prefers hide/show methods, not direct visible property
 */
export function setShown(el, shown) {
    if (!el) {
        return;
    }
    // Preferred: use show/hide methods
    if (typeof el.show === 'function' && typeof el.hide === 'function') {
        if (shown) {
            el.show();
        }
        else {
            el.hide();
        }
        return;
    }
    // Fallback: use hidden property
    if ('hidden' in el) {
        el.hidden = !shown;
        return;
    }
    // Last resort: no-op (don't crash)
}
//# sourceMappingURL=safe.js.map