bremen_short_url/BackEnd/assets/vendor/blueimp-canvas-to-blob/canvas-to-blob.min.js

1 line
1.1 KiB
JavaScript

!function(t){"use strict";var n=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,c=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),d=c&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),B=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,f=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,r=(c||B)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,o,n,r,a,i,l,u,b;if(!(e=t.match(f)))throw new Error("invalid data URI");for(o=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),n=!!e[4],r=t.slice(e[0].length),a=n?atob(r):decodeURIComponent(r),i=new ArrayBuffer(a.length),l=new Uint8Array(i),u=0;u<a.length;u+=1)l[u]=a.charCodeAt(u);return c?new Blob([d?l:i],{type:o}):((b=new B).append(i),b.getBlob(o))};t.HTMLCanvasElement&&!n.toBlob&&(n.mozGetAsFile?n.toBlob=function(t,e,o){o&&n.toDataURL&&r?t(r(this.toDataURL(e,o))):t(this.mozGetAsFile("blob",e))}:n.toDataURL&&r&&(n.toBlob=function(t,e,o){t(r(this.toDataURL(e,o)))})),"function"==typeof define&&define.amd?define(function(){return r}):"object"==typeof module&&module.exports?module.exports=r:t.dataURLtoBlob=r}(window);