import{validation}from"../../Validation.js";class GetBase64StringFromFile{async execute(e){let t=validation.exists("file",e.file);return t instanceof ArrayBuffer&&(t=new Blob([t],{type:"application/octet-binary"})),{result:await this.getBase64(t)}}async getBase64(e){return new Promise((t,i)=>{const r=new FileReader;r.onload=()=>{let e=r.result;return e=e.substring(e.indexOf("base64,")+7),t(e)},r.onerror=e=>i(e),r.readAsDataURL(e)})}}GetBase64StringFromFile.action="gcx:wf:core::GetBase64StringFromFile",GetBase64StringFromFile.suite="gcx:wf:builtin";export{GetBase64StringFromFile};