import { ConvertVideoWithFfmpegBrowserInputModel, ConvertVideoWithFfmpegBrowserOutputModel, } from '../../../../../code/type/index.js';
import { buildFormDataRequestToConvert } from '../../shared.js';
import { resolveWorkFileAsBlob } from '../../../../../code/tool/shared/work.js';
import kink from '../../../../../code/tool/shared/kink.js';
export async function convertVideoWithFfmpegBrowser(source) {
    const input = ConvertVideoWithFfmpegBrowserInputModel.parse(source);
    switch (input.handle) {
        case 'remote':
            return await convertVideoWithFfmpegBrowserRemote(input);
        default:
            return await convertVideoWithFfmpegBrowserLocal(input);
    }
}
export async function convertVideoWithFfmpegBrowserRemote(input) {
    const request = buildFormDataRequestToConvert(input);
    const content = await resolveWorkFileAsBlob(request);
    return ConvertVideoWithFfmpegBrowserOutputModel.parse({
        file: {
            content,
        },
    });
}
export async function convertVideoWithFfmpegBrowserLocal(input) {
    throw kink('task_not_implemented', {
        task: 'convertVideoWithFfmpegBrowserLocal',
    });
}
//# sourceMappingURL=browser.js.map