mirror of
https://github.com/AlexKrunch/AnonIB-3D.git
synced 2024-11-19 02:34:15 -05:00
1 line
3.3 KiB
JavaScript
1 line
3.3 KiB
JavaScript
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.blobUtil=e()}}(function(){return function e(r,n,t){function o(u,f){if(!n[u]){if(!r[u]){var a="function"==typeof require&&require;if(!f&&a)return a(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[u]={exports:{}};r[u][0].call(d.exports,function(e){var n=r[u][1][e];return o(n?n:e)},d,d.exports,e,r,n,t)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<t.length;u++)o(t[u]);return o}({1:[function(e,r,n){"use strict";function t(e,r){return new Promise(function(n,t){var o=new Image;r&&(o.crossOrigin=r),o.onload=function(){n(o)},o.onerror=t,o.src=e})}function o(e){var r=document.createElement("canvas");r.width=e.width,r.height=e.height;var n=r.getContext("2d");return n.drawImage(e,0,0,e.width,e.height,0,0,e.width,e.height),r}function i(e,r){e=e||[],r=r||{},"string"==typeof r&&(r={type:r});try{return new Blob(e,r)}catch(i){if("TypeError"!==i.name)throw i;for(var n="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,t=new n,o=0;o<e.length;o+=1)t.append(e[o]);return t.getBlob(r.type)}}function u(e){return("undefined"!=typeof URL?URL:webkitURL).createObjectURL(e)}function f(e){return("undefined"!=typeof URL?URL:webkitURL).revokeObjectURL(e)}function a(e){return new Promise(function(r,n){var t=new FileReader,o="function"==typeof t.readAsBinaryString;t.onloadend=function(){var e=t.result||"";return o?r(e):void r(w(e))},t.onerror=n,o?t.readAsBinaryString(e):t.readAsArrayBuffer(e)})}function c(e,r){var n=[v(atob(e))];return r?i(n,{type:r}):i(n)}function d(e,r){return c(btoa(e),r)}function l(e){return a(e).then(btoa)}function b(e){var r=e.match(/data:([^;]+)/)[1],n=e.replace(/^[^,]+,/,""),t=v(atob(n));return i([t],{type:r})}function y(e){return l(e).then(function(r){return"data:"+e.type+";base64,"+r})}function B(e,r,n,i){return r=r||"image/png",t(e,n).then(o).then(function(e){return e.toDataURL(r,i)})}function s(e,r,n){return"function"==typeof e.toBlob?new Promise(function(t){e.toBlob(t,r,n)}):Promise.resolve(b(e.toDataURL(r,n)))}function p(e,r,n,i){return r=r||"image/png",t(e,n).then(o).then(function(e){return s(e,r,i)})}function g(e,r){return i([e],r)}function h(e){return new Promise(function(r,n){var t=new FileReader;t.onloadend=function(){var e=t.result||new ArrayBuffer(0);r(e)},t.onerror=n,t.readAsArrayBuffer(e)})}function w(e){for(var r="",n=new Uint8Array(e),t=n.byteLength,o=-1;++o<t;)r+=String.fromCharCode(n[o]);return r}function v(e){for(var r=e.length,n=new ArrayBuffer(r),t=new Uint8Array(n),o=-1;++o<r;)t[o]=e.charCodeAt(o);return n}Object.defineProperty(n,"__esModule",{value:!0}),n.createBlob=i,n.createObjectURL=u,n.revokeObjectURL=f,n.blobToBinaryString=a,n.base64StringToBlob=c,n.binaryStringToBlob=d,n.blobToBase64String=l,n.dataURLToBlob=b,n.blobToDataURL=y,n.imgSrcToDataURL=B,n.canvasToBlob=s,n.imgSrcToBlob=p,n.arrayBufferToBlob=g,n.blobToArrayBuffer=h,n.arrayBufferToBinaryString=w,n.binaryStringToArrayBuffer=v},{}]},{},[1])(1)});
|