/**
 * Classify a logo by aspect ratio (width / height):
 *   - square:     0.8 ≤ ratio ≤ 1.25  (marks, favicons, app icons)
 *   - horizontal: ratio > 1.8         (headers, full sidebar)
 *   - vertical:   ratio < 0.8         (rarely fits headers/sidebars)
 *   - neutral:    everything in between
 *   - unknown:    missing/invalid dimensions
 */
export function classifyLogoShape(width, height) {
    if (!width || !height || width <= 0 || height <= 0)
        return 'unknown';
    const ratio = width / height;
    if (ratio >= 0.8 && ratio <= 1.25)
        return 'square';
    if (ratio > 1.8)
        return 'horizontal';
    if (ratio < 0.8)
        return 'vertical';
    return 'neutral';
}
/** Roles that want a square asset (mark/favicon/app icon). */
const SQUARE_ROLES = new Set([
    'publicLogoMark',
    'adminLogoMark',
    'faviconSource',
]);
/** Roles that want a wide lockup (header / full sidebar). */
const WIDE_ROLES = new Set([
    'publicPrimaryLogo',
    'adminPrimaryLogo',
    'publicDarkLogo',
    'adminDarkLogo',
]);
/**
 * Advisory warning when an asset's shape doesn't suit its role. Returns null
 * when the shape is fine (or unknown — we don't nag about SVGs without
 * intrinsic dimensions).
 */
export function logoShapeWarning(role, shape) {
    if (shape === 'unknown')
        return null;
    if (WIDE_ROLES.has(role)) {
        if (shape === 'square') {
            return 'This looks like a square mark. It will work well for icons and collapsed navigation. For full-width headers, upload a horizontal primary logo or use mark + site title.';
        }
        if (shape === 'vertical') {
            return 'Vertical logos may not fit well in headers or sidebars. Consider uploading a horizontal logo and a square mark.';
        }
    }
    if (SQUARE_ROLES.has(role)) {
        if (shape === 'horizontal') {
            return role === 'faviconSource'
                ? 'This favicon source is not square. A square image works better for favicons and app icons and avoids cropping.'
                : 'This looks like a horizontal logo. A square mark works better for favicons, collapsed sidebar, and app icons.';
        }
        if (shape === 'vertical') {
            return 'Vertical images do not crop cleanly to a square icon. Upload a square mark for the best result.';
        }
    }
    return null;
}
//# sourceMappingURL=logo-shape.js.map