import{V as f,W as n,X as u}from"./index-DT-X9ySe.js";async function o(d,a){const r=new FormData;r.append("file",d),a!=null&&a.folder&&r.append("folder",a.folder);const{data:l}=await f.post(n.media.upload,r,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:e=>{if(!(a!=null&&a.onProgress)||!e.total)return;const t=Math.round(e.loaded/e.total*100);a.onProgress(t)}});return u(l)}export{o as u};
