(window.webpackJsonpPMA=window.webpackJsonpPMA||[]).push([["pixelworks"],{"8DZu":function(t,e,a){var n=a("Fi3C").newImageData;function r(t){var e=!0;try{new ImageData(10,10)}catch(t){e=!1}function a(t,a,n){return e?new ImageData(t,a,n):{data:t,width:a,height:n}}return function(e){var n,r,i=e.buffers,s=e.meta,o=e.imageOps,u=e.width,h=e.height,f=i.length,p=i[0].byteLength;if(o){var _=new Array(f);for(r=0;r<f;++r)_[r]=a(new Uint8ClampedArray(i[r]),u,h);n=t(_,s).data}else{n=new Uint8ClampedArray(p);var c=new Array(f),g=new Array(f);for(r=0;r<f;++r)c[r]=new Uint8ClampedArray(i[r]),g[r]=[0,0,0,0];for(var d=0;d<p;d+=4){for(var l=0;l<f;++l){var m=c[l];g[l][0]=m[d],g[l][1]=m[d+1],g[l][2]=m[d+2],g[l][3]=m[d+3]}var v=t(g,s);n[d]=v[0],n[d+1]=v[1],n[d+2]=v[2],n[d+3]=v[3]}}return n.buffer}}function i(t,e){var a=Object.keys(t.lib||{}).map((function(e){return"var "+e+" = "+t.lib[e].toString()+";"})).concat(["var __minion__ = ("+r.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {',"  var buffer = __minion__(event.data);","  self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),n=new Blob(a,{type:"text/javascript"}),i=URL.createObjectURL(n),s=new Worker(i);return s.addEventListener("message",e),s}function s(t){var e;this._imageOps=!!t.imageOps;var a=[];if(e=0===t.threads?0:this._imageOps?1:t.threads||1)for(var n=0;n<e;++n)a[n]=i(t,this._onWorkerMessage.bind(this,n));else a[0]=function(t,e){var a=r(t.operation);return{postMessage:function(t){setTimeout((function(){e({data:{buffer:a(t),meta:t.meta}})}),0)}}}(t,this._onWorkerMessage.bind(this,0));this._workers=a,this._queue=[],this._maxQueueLength=t.queue||1/0,this._running=0,this._dataLookup={},this._job=null}s.prototype.process=function(t,e,a){this._enqueue({inputs:t,meta:e,callback:a}),this._dispatch()},s.prototype.destroy=function(){for(var t in this)this[t]=null;this._destroyed=!0},s.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},s.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var t=this._job=this._queue.shift(),e=t.inputs[0].width,a=t.inputs[0].height,n=t.inputs.map((function(t){return t.data.buffer})),r=this._workers.length;if(this._running=r,1===r)this._workers[0].postMessage({buffers:n,meta:t.meta,imageOps:this._imageOps,width:e,height:a},n);else for(var i=t.inputs[0].data.length,s=4*Math.ceil(i/4/r),o=0;o<r;++o){for(var u=o*s,h=[],f=0,p=n.length;f<p;++f)h.push(n[o].slice(u,u+s));this._workers[o].postMessage({buffers:h,meta:t.meta,imageOps:this._imageOps,width:e,height:a},h)}}},s.prototype._onWorkerMessage=function(t,e){this._destroyed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())},s.prototype._resolveJob=function(){var t,e,a=this._job,r=this._workers.length;if(1===r)t=new Uint8ClampedArray(this._dataLookup[0].buffer),e=this._dataLookup[0].meta;else{var i=a.inputs[0].data.length;t=new Uint8ClampedArray(i),e=new Array(i);for(var s=4*Math.ceil(i/4/r),o=0;o<r;++o){var u=this._dataLookup[o].buffer,h=o*s;t.set(new Uint8ClampedArray(u),h),e[o]=this._dataLookup[o].meta}}this._job=null,this._dataLookup={},a.callback(null,n(t,a.inputs[0].width,a.inputs[0].height),e),this._dispatch()},t.exports=s},CYfV:function(t,e,a){var n=a("8DZu");e.Processor=n},Fi3C:function(t,e){var a=!0;try{new ImageData(10,10)}catch(t){a=!1}var n=document.createElement("canvas").getContext("2d");e.newImageData=function(t,e,r){if(a)return new ImageData(t,e,r);var i=n.createImageData(e,r);return i.data.set(t),i}}}]);
//# sourceMappingURL=pixelworks.js.map