function s(r){const o=r.split(","),a=o[0].match(/:(.*?);/)[1],t=atob(o[1]);let n=t.length;const e=new Uint8Array(n);for(;n--;)e[n]=t.charCodeAt(n);return new Blob([e],{type:a})}function l(r,o){return new Promise((c,a)=>{let t=document.createElement("CANVAS");const n=t.getContext("2d"),e=new Image;e.crossOrigin="",e.onload=function(){if(!t||!n)return a();t.height=e.height,t.width=e.width,n.drawImage(e,0,0);const i=t.toDataURL(o||"image/png");t=null,c(i)},e.src=r})}export{s as dataURLtoBlob,l as urlToBase64};
