import{o as w,W as m,E as p,r as c,Y as i}from"./app-k0jcl5PQ.js";let l=null;const s={getVideoDownloadUrl(o,a){return i.safeUrlConcat(i.makeHttps(o),`/download?token=${a}`)},downloadResource(o,a,e,n){var d;let t=l;l||(t=l=document.createElement("iframe"),document.body.appendChild(t),t.style.display="none"),t.src=o.url,n||w.logUserAction({id:o==null?void 0:o.id,name:o==null?void 0:o.name,resourceType:(d=o==null?void 0:o.metadata)==null?void 0:d.resourceType,...a},{actionType:c.Download,entity:p.Resource,workflowPhase:m.Complete,...e})},async downloadBlob(o,a){const e=await fetch(o);if(!e.ok)throw new Error("Error downloading file");const n=URL.createObjectURL(await e.blob()),t=document.createElement("a");t.href=n,t.download=a,document.body.appendChild(t),t.click(),document.body.removeChild(t),window.setTimeout(()=>URL.revokeObjectURL(n),100)}};export{s as D};
//# sourceMappingURL=Q_WQ5xs9.chunk.js.map
