"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.batchUploadFiles = batchUploadFiles;
async function batchUploadFiles(files, handler, onFileUpload, onFileFail) {
    const success = [];
    const failed = [];
    await Promise.allSettled(files.map((file) => handler(file)
        .then((result) => {
        const item = { result, file };
        success.push(item);
        onFileUpload?.(item);
    }, (error) => {
        const item = { error, file };
        failed.push(item);
        onFileFail?.(item);
    })
        .catch(console.error)));
    return { success, failed };
}
//# sourceMappingURL=upload.js.map
