import { msg } from '@lit/localize/lit-localize.js';
import { validateImageFileSize } from './validate-image-size.js';
/**
 * This entire file was copied from shreddit
 * I removed some parts of it that were too "shreddit post creation" focused, but kept the original code style
 * Eventually we will remove it in favour of faceplate-ui image upload component, but for now we have this
 */
const KILOBYTE = 1024;
const MEGABYTE = KILOBYTE * KILOBYTE;
const GIGABYTE = KILOBYTE * MEGABYTE;
export const MAX_VIDEO_FILE_SIZE = 1 * GIGABYTE; // 1GB
export const MAX_VIDEO_DURATION = 60 * 15;
export const MIN_VIDEO_DURATION = 2; // 2 seconds
export const MIN_VIDEO_WIDTH = 50;
export const MIN_VIDEO_HEIGHT = 50;
export const ALLOWED_IMAGE_MIMETYPES = ['image/png', 'image/gif', 'image/jpeg', 'image/webp'];
export const ALLOWED_VIDEO_MIMETYPES = ['video/mp4', 'video/quicktime'];
export function validateImageFile(file) {
    const mimetype = file.type;
    if (!ALLOWED_IMAGE_MIMETYPES.includes(mimetype)) {
        return {
            valid: false,
            error: msg('Sorry, we accept only files (.png, .jpeg, .gif, .webp).', {
                desc: 'Error: invalid media type',
            }),
        };
    }
    return validateImageFileSize(file);
}
//# sourceMappingURL=validateMedia.js.map