UNPKG

@suns/react-monorepo-nx

Version:

To evaluate and compare the bundled and unbundled builds on large codebase.

8 lines (7 loc) 2.88 kB
/** Notice * This file contains works from many authors under various (but compatible) licenses. Please see core.txt for more information. **/ (function(){(window.wpCoreControlsBundle=window.wpCoreControlsBundle||[]).push([[5],{524:function(wa,ta,n){n.r(ta);var pa=n(0);wa=n(51);var oa=n(193),na=n(438),ja=n(247),ka=window;n=function(){function fa(y,x){this.K2=function(f){f=f.split(".");return f[f.length-1].match(/(jpg|jpeg|png|gif)$/i)};x=x||{};this.url=y;this.filename=x.filename||y;this.cg=x.customHeaders;this.sBa=!!x.useDownloader;this.withCredentials=!!x.withCredentials}fa.prototype.YI=function(y){this.cg=y};fa.prototype.getCustomHeaders=function(){return this.cg}; fa.prototype.getFileData=function(y){var x=this,f=this,e=new XMLHttpRequest,a=0===this.url.indexOf("blob:")?"blob":"arraybuffer";e.open("GET",this.url,!0);e.withCredentials=this.withCredentials;e.responseType=a;this.cg&&Object.keys(this.cg).forEach(function(h){e.setRequestHeader(h,x.cg[h])});var b=/^https?:/i.test(this.url);e.addEventListener("load",function(h){return Object(pa.b)(this,void 0,void 0,function(){var r,w,z,aa,ha,ba;return Object(pa.d)(this,function(ca){switch(ca.label){case 0:if(200!== this.status&&(b||0!==this.status))return[3,10];f.trigger(fa.Events.DOCUMENT_LOADING_PROGRESS,[h.loaded,h.loaded]);if("blob"!==this.responseType)return[3,4];r=this.response;return f.K2(f.filename)?[4,Object(ja.b)(r)]:[3,2];case 1:return w=ca.ba(),f.fileSize=w.byteLength,y(new Uint8Array(w)),[3,3];case 2:z=new FileReader,z.onload=function(ea){ea=new Uint8Array(ea.target.result);f.fileSize=ea.length;y(ea)},z.readAsArrayBuffer(r),ca.label=3;case 3:return[3,9];case 4:ca.Ze.push([4,8,,9]);aa=new Uint8Array(this.response); if(!f.K2(f.filename))return[3,6];r=new Blob([aa.buffer]);return[4,Object(ja.b)(r)];case 5:return w=ca.ba(),f.fileSize=w.byteLength,y(new Uint8Array(w)),[3,7];case 6:f.fileSize=aa.length,y(aa),ca.label=7;case 7:return[3,9];case 8:return ca.ba(),f.trigger(fa.Events.ERROR,["pdfLoad","Out of memory"]),[3,9];case 9:return[3,11];case 10:ha=h.currentTarget,ba=Object(oa.b)(ha),f.trigger(fa.Events.ERROR,["pdfLoad",this.status+" "+ha.statusText,ba]),ca.label=11;case 11:return f.PC=null,[2]}})})},!1);e.onprogress= function(h){f.trigger(fa.Events.DOCUMENT_LOADING_PROGRESS,[h.loaded,0<h.total?h.total:0])};e.addEventListener("error",function(){f.trigger(fa.Events.ERROR,["pdfLoad","Network failure"]);f.PC=null},!1);e.send();this.PC=e};fa.prototype.getFile=function(){var y=this;return new Promise(function(x){ka.da.isJSWorker&&x(y.url);if(y.sBa){var f=Object(pa.a)({url:y.url},y.cg?{customHeaders:y.cg}:{});x(f)}x(null)})};fa.prototype.abort=function(){this.PC&&(this.PC.abort(),this.PC=null)};fa.Events={DOCUMENT_LOADING_PROGRESS:"documentLoadingProgress", ERROR:"error"};return fa}();Object(wa.a)(n);Object(na.a)(n);Object(na.b)(n);ta["default"]=n}}]);}).call(this || window)