"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function s(t){return Promise.all(Array.from(t).map(async e=>{const n=await new Promise((r,o)=>{const a=new FileReader;a.onload=()=>{const l=a.result;r(l.split(",")[1])},a.onerror=o,a.readAsDataURL(e)});return{fileName:e.name,fileType:e.type,file:e,fileData:n}}))}function c(t,e,n=!1){return n?[...t.trim().length>0?[{type:"text",text:t.trim()}]:[],...e.map(r=>({type:"document",source:{filename:r.fileName,filetype:r.fileType}}))]:[...t.trim().length>0?[{type:"text",text:t}]:[],...e.map(r=>({type:"document",...r,cache_control:{type:"ephemeral"}}))]}exports.buildContentBlocks=c;exports.readFilesAsBase64=s;
//# sourceMappingURL=submitUtils.cjs.js.map
