import { ConvertDocumentWithJupyterBrowserInputModel, ConvertDocumentWithJupyterBrowserOutputModel, } 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 convertDocumentWithJupyterBrowser(source) {
    const input = ConvertDocumentWithJupyterBrowserInputModel.parse(source);
    switch (input.handle) {
        case 'remote':
            return await convertDocumentWithJupyterBrowserRemote(input);
        default:
            return await convertDocumentWithJupyterBrowserLocal(input);
    }
}
export async function convertDocumentWithJupyterBrowserRemote(input) {
    const request = buildFormDataRequestToConvert(input);
    const content = await resolveWorkFileAsBlob(request);
    return ConvertDocumentWithJupyterBrowserOutputModel.parse({
        file: {
            content,
        },
    });
}
export async function convertDocumentWithJupyterBrowserLocal(input) {
    throw kink('task_not_implemented', {
        task: 'convertDocumentWithJupyterBrowserLocal',
    });
}
//# sourceMappingURL=browser.js.map