GT2/Ejectable/node_modules/jimp-compact/dist/jimp.js

1 line
525 KiB
JavaScript

module.exports=function(t,e){"use strict";var r={};function __webpack_require__(e){if(r[e]){return r[e].exports}var i=r[e]={i:e,l:false,exports:{}};var a=true;try{t[e].call(i.exports,i,i.exports,__webpack_require__);a=false}finally{if(a)delete r[e]}i.l=true;return i.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(129)}return startup()}({19:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e.isNodePattern=isNodePattern;e.throwError=throwError;e.scan=scan;e.scanIterator=scanIterator;var a=i(r(148));var n=a["default"].mark(scanIterator);function isNodePattern(t){if(typeof t==="undefined"){return false}if(typeof t!=="function"){throw new TypeError("Callback must be a function")}return true}function throwError(t,e){if(typeof t==="string"){t=new Error(t)}if(typeof e==="function"){return e.call(this,t)}throw t}function scan(t,e,r,i,a,n){e=Math.round(e);r=Math.round(r);i=Math.round(i);a=Math.round(a);for(var s=r;s<r+a;s++){for(var o=e;o<e+i;o++){var h=t.bitmap.width*s+o<<2;n.call(t,o,s,h)}}return t}function scanIterator(t,e,r,i,s){var o,h,f;return a["default"].wrap(function scanIterator$(a){while(1){switch(a.prev=a.next){case 0:e=Math.round(e);r=Math.round(r);i=Math.round(i);s=Math.round(s);o=r;case 5:if(!(o<r+s)){a.next=17;break}h=e;case 7:if(!(h<e+i)){a.next=14;break}f=t.bitmap.width*o+h<<2;a.next=11;return{x:h,y:o,idx:f,image:t};case 11:h++;a.next=7;break;case 14:o++;a.next=5;break;case 17:case"end":return a.stop()}}},n)}},23:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(396));var n=i(r(457));var s=i(r(499));var o=(0,a["default"])({types:[n["default"]],plugins:[s["default"]]});e["default"]=o},24:function(t,e,r){"use strict";var i=r(657);var a=r(367);e.read=function(t,e){return i(t,e||{})};e.write=function(t,e){return a(t,e)}},26:function(t,e,r){"use strict";var i=r(407);var a=r(764);Object.defineProperty(e,"__esModule",{value:true});e.addConstants=addConstants;e.addJimpMethods=addJimpMethods;e.jimpEvMethod=jimpEvMethod;e.jimpEvChange=jimpEvChange;Object.defineProperty(e,"addType",{enumerable:true,get:function get(){return L.addType}});e["default"]=void 0;var n=a(r(32));var s=a(r(382));var o=a(r(510));var h=a(r(194));var f=a(r(482));var l=a(r(472));var u=a(r(27));var c=a(r(713));var d=a(r(655));var p=a(r(431));var v=a(r(747));var m=a(r(622));var g=a(r(614));var b=r(19);var y=a(r(851));var E=a(r(626));var M=a(r(408));var w=a(r(164));var _=a(r(695));var x=a(r(724));var I=a(r(330));var D=a(r(892));var L=i(r(289));var T=r(190);var P=i(r(963));var k="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_";var O=[NaN,NaN];for(var N=2;N<65;N++){var S=(0,y["default"])(y["default"].BIN,k.slice(0,N))(new Array(64+1).join("1"));O.push(S.length)}function noop(){}function isArrayBuffer(t){return Object.prototype.toString.call(t).toLowerCase().indexOf("arraybuffer")>-1}function bufferFromArrayBuffer(t){var e=Buffer.alloc(t.byteLength);var r=new Uint8Array(t);for(var i=0;i<e.length;++i){e[i]=r[i]}return e}function loadFromURL(t,e){(0,x["default"])(t,function(r,i,a){if(r){return e(r)}if("headers"in i&&"location"in i.headers){t.url=i.headers.location;return loadFromURL(t,e)}if((0,p["default"])(a)==="object"&&Buffer.isBuffer(a)){return e(null,a)}var n="Could not load Buffer from <"+t.url+"> "+"(HTTP: "+i.statusCode+")";return new Error(n)})}function loadBufferFromPath(t,e){if(v["default"]&&typeof v["default"].readFile==="function"&&!t.match(/^(http|ftp)s?:\/\/./)){v["default"].readFile(t,e)}else{loadFromURL({url:t},e)}}function isRawRGBAData(t){return t&&(0,p["default"])(t)==="object"&&typeof t.width==="number"&&typeof t.height==="number"&&(Buffer.isBuffer(t.data)||t.data instanceof Uint8Array||typeof Uint8ClampedArray==="function"&&t.data instanceof Uint8ClampedArray)&&(t.data.length===t.width*t.height*4||t.data.length===t.width*t.height*3)}function makeRGBABufferFromRGB(t){if(t.length%3!==0){throw new Error("Buffer length is incorrect")}var e=Buffer.allocUnsafe(t.length/3*4);var r=0;for(var i=0;i<t.length;i++){e[r]=t[i];if((i+1)%3===0){e[++r]=255}r++}return e}var A={data:null,width:null,height:null};var B=function(t){(0,c["default"])(Jimp,t);function Jimp(){var t;for(var e=arguments.length,r=new Array(e),i=0;i<e;i++){r[i]=arguments[i]}(0,o["default"])(this,Jimp);t=(0,f["default"])(this,(0,l["default"])(Jimp).call(this));(0,d["default"])((0,u["default"])(t),"bitmap",A);(0,d["default"])((0,u["default"])(t),"_background",0);(0,d["default"])((0,u["default"])(t),"_originalMime",Jimp.MIME_PNG);(0,d["default"])((0,u["default"])(t),"_exif",null);(0,d["default"])((0,u["default"])(t),"_rgba",true);(0,d["default"])((0,u["default"])(t),"writeAsync",function(e){return(0,D["default"])(t.write,(0,u["default"])(t),e)});(0,d["default"])((0,u["default"])(t),"getBase64Async",function(e){return(0,D["default"])(t.getBase64,(0,u["default"])(t),e)});(0,d["default"])((0,u["default"])(t),"getBuffer",T.getBuffer);(0,d["default"])((0,u["default"])(t),"getBufferAsync",T.getBufferAsync);(0,d["default"])((0,u["default"])(t),"getPixelColour",t.getPixelColor);(0,d["default"])((0,u["default"])(t),"setPixelColour",t.setPixelColor);var a=(0,u["default"])(t);var n=noop;if(isArrayBuffer(r[0])){r[0]=bufferFromArrayBuffer(r[0])}function finish(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var i=e[0];var s=i||{};s.methodName="constructor";setTimeout(function(){var t;if(i&&n===noop){a.emitError("constructor",i)}else if(!i){a.emitMulti("constructor","initialized")}(t=n).call.apply(t,[a].concat(e))},1)}if(typeof r[0]==="number"&&typeof r[1]==="number"||parseInt(r[0],10)&&parseInt(r[1],10)){var s=parseInt(r[0],10);var h=parseInt(r[1],10);n=r[2];if(typeof r[2]==="number"){t._background=r[2];n=r[3]}if(typeof r[2]==="string"){t._background=Jimp.cssColorToHex(r[2]);n=r[3]}if(typeof n==="undefined"){n=noop}if(typeof n!=="function"){return(0,f["default"])(t,b.throwError.call((0,u["default"])(t),"cb must be a function",finish))}t.bitmap={data:Buffer.alloc(s*h*4),width:s,height:h};for(var c=0;c<t.bitmap.data.length;c+=4){t.bitmap.data.writeUInt32BE(t._background,c)}finish(null,(0,u["default"])(t))}else if((0,p["default"])(r[0])==="object"&&r[0].url){n=r[1]||noop;if(typeof n!=="function"){return(0,f["default"])(t,b.throwError.call((0,u["default"])(t),"cb must be a function",finish))}loadFromURL(r[0],function(e,i){if(e){return b.throwError.call((0,u["default"])(t),e,finish)}t.parseBitmap(i,r[0].url,finish)})}else if(r[0]instanceof Jimp){var v=r[0];n=r[1];if(typeof n==="undefined"){n=noop}if(typeof n!=="function"){return(0,f["default"])(t,b.throwError.call((0,u["default"])(t),"cb must be a function",finish))}t.bitmap={data:Buffer.from(v.bitmap.data),width:v.bitmap.width,height:v.bitmap.height};t._quality=v._quality;t._deflateLevel=v._deflateLevel;t._deflateStrategy=v._deflateStrategy;t._filterType=v._filterType;t._rgba=v._rgba;t._background=v._background;t._originalMime=v._originalMime;finish(null,(0,u["default"])(t))}else if(isRawRGBAData(r[0])){var m=r[0];n=r[1]||noop;var g=m.width*m.height*4===m.data.length;var y=g?Buffer.from(m.data):makeRGBABufferFromRGB(m.data);t.bitmap={data:y,width:m.width,height:m.height};finish(null,(0,u["default"])(t))}else if(typeof r[0]==="string"){var E=r[0];n=r[1];if(typeof n==="undefined"){n=noop}if(typeof n!=="function"){return(0,f["default"])(t,b.throwError.call((0,u["default"])(t),"cb must be a function",finish))}loadBufferFromPath(E,function(e,r){if(e){return b.throwError.call((0,u["default"])(t),e,finish)}t.parseBitmap(r,E,finish)})}else if((0,p["default"])(r[0])==="object"&&Buffer.isBuffer(r[0])){var M=r[0];n=r[1];if(typeof n!=="function"){return(0,f["default"])(t,b.throwError.call((0,u["default"])(t),"cb must be a function",finish))}t.parseBitmap(M,null,finish)}else{n=r[r.length-1];if(typeof n!=="function"){n=r[r.length-2];if(typeof n!=="function"){n=noop}}var w=Jimp.__extraConstructors.find(function(t){return t.test.apply(t,r)});if(w){new Promise(function(e,i){var a;return(a=w.run).call.apply(a,[(0,u["default"])(t),e,i].concat(r))}).then(function(){return finish(null,(0,u["default"])(t))})["catch"](finish)}else{return(0,f["default"])(t,b.throwError.call((0,u["default"])(t),"No matching constructor overloading was found. "+"Please see the docs for how to call the Jimp constructor.",finish))}}return t}(0,h["default"])(Jimp,[{key:"parseBitmap",value:function parseBitmap(t,e,r){T.parseBitmap.call(this,t,null,r)}},{key:"rgba",value:function rgba(t,e){if(typeof t!=="boolean"){return b.throwError.call(this,"bool must be a boolean, true for RGBA or false for RGB",e)}this._rgba=t;if((0,b.isNodePattern)(e)){e.call(this,null,this)}return this}},{key:"emitMulti",value:function emitMulti(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};r=Object.assign(r,{methodName:t,eventName:e});this.emit("any",r);if(t){this.emit(t,r)}this.emit(e,r)}},{key:"emitError",value:function emitError(t,e){this.emitMulti(t,"error",e)}},{key:"getHeight",value:function getHeight(){return this.bitmap.height}},{key:"getWidth",value:function getWidth(){return this.bitmap.width}},{key:"inspect",value:function inspect(){return"<Jimp "+(this.bitmap===A?"pending...":this.bitmap.width+"x"+this.bitmap.height)+">"}},{key:"toString",value:function toString(){return"[object Jimp]"}},{key:"getMIME",value:function getMIME(){var t=this._originalMime||Jimp.MIME_PNG;return t}},{key:"getExtension",value:function getExtension(){var t=this.getMIME();return L.getExtension(t)}},{key:"write",value:function write(t,e){var r=this;if(!v["default"]||!v["default"].createWriteStream){throw new Error("Cant access the filesystem. You can use the getBase64 method.")}if(typeof t!=="string"){return b.throwError.call(this,"path must be a string",e)}if(typeof e==="undefined"){e=noop}if(typeof e!=="function"){return b.throwError.call(this,"cb must be a function",e)}var i=L.getType(t)||this.getMIME();var a=m["default"].parse(t);if(a.dir){E["default"].sync(a.dir)}this.getBuffer(i,function(i,a){if(i){return b.throwError.call(r,i,e)}var n=v["default"].createWriteStream(t);n.on("open",function(){n.write(a);n.end()}).on("error",function(t){return b.throwError.call(r,t,e)});n.on("finish",function(){e.call(r,null,r)})});return this}},{key:"getBase64",value:function getBase64(t,e){if(t===Jimp.AUTO){t=this.getMIME()}if(typeof t!=="string"){return b.throwError.call(this,"mime must be a string",e)}if(typeof e!=="function"){return b.throwError.call(this,"cb must be a function",e)}this.getBuffer(t,function(r,i){if(r){return b.throwError.call(this,r,e)}var a="data:"+t+";base64,"+i.toString("base64");e.call(this,null,a)});return this}},{key:"hash",value:function hash(t,e){t=t||64;if(typeof t==="function"){e=t;t=64}if(typeof t!=="number"){return b.throwError.call(this,"base must be a number",e)}if(t<2||t>64){return b.throwError.call(this,"base must be a number between 2 and 64",e)}var hash=this.pHash();hash=(0,y["default"])(y["default"].BIN,k.slice(0,t))(hash);while(hash.length<O[t]){hash="0"+hash}if((0,b.isNodePattern)(e)){e.call(this,null,hash)}return hash}},{key:"pHash",value:function pHash(){var pHash=new _["default"];return pHash.getHash(this)}},{key:"distanceFromHash",value:function distanceFromHash(t){var e=new _["default"];var r=e.getHash(this);return e.distance(r,t)}},{key:"getPixelIndex",value:function getPixelIndex(t,e,r,i){var a;var n;if(typeof r==="function"&&typeof i==="undefined"){i=r;r=null}if(!r){r=Jimp.EDGE_EXTEND}if(typeof t!=="number"||typeof e!=="number"){return b.throwError.call(this,"x and y must be numbers",i)}t=Math.round(t);e=Math.round(e);a=t;n=e;if(r===Jimp.EDGE_EXTEND){if(t<0)a=0;if(t>=this.bitmap.width)a=this.bitmap.width-1;if(e<0)n=0;if(e>=this.bitmap.height)n=this.bitmap.height-1}if(r===Jimp.EDGE_WRAP){if(t<0){a=this.bitmap.width+t}if(t>=this.bitmap.width){a=t%this.bitmap.width}if(e<0){a=this.bitmap.height+e}if(e>=this.bitmap.height){n=e%this.bitmap.height}}var s=this.bitmap.width*n+a<<2;if(a<0||a>=this.bitmap.width){s=-1}if(n<0||n>=this.bitmap.height){s=-1}if((0,b.isNodePattern)(i)){i.call(this,null,s)}return s}},{key:"getPixelColor",value:function getPixelColor(t,e,r){if(typeof t!=="number"||typeof e!=="number")return b.throwError.call(this,"x and y must be numbers",r);t=Math.round(t);e=Math.round(e);var i=this.getPixelIndex(t,e);var a=this.bitmap.data.readUInt32BE(i);if((0,b.isNodePattern)(r)){r.call(this,null,a)}return a}},{key:"setPixelColor",value:function setPixelColor(t,e,r,i){if(typeof t!=="number"||typeof e!=="number"||typeof r!=="number")return b.throwError.call(this,"hex, x and y must be numbers",i);e=Math.round(e);r=Math.round(r);var a=this.getPixelIndex(e,r);this.bitmap.data.writeUInt32BE(t,a);if((0,b.isNodePattern)(i)){i.call(this,null,this)}return this}},{key:"hasAlpha",value:function hasAlpha(){for(var t=0;t<this.bitmap.height;t++){for(var e=0;e<this.bitmap.width;e++){var r=this.bitmap.width*t+e<<2;var i=this.bitmap.data[r+3];if(i!==255){return true}}}return false}},{key:"scanIterator",value:function scanIterator(t,e,r,i){if(typeof t!=="number"||typeof e!=="number"){return b.throwError.call(this,"x and y must be numbers")}if(typeof r!=="number"||typeof i!=="number"){return b.throwError.call(this,"w and h must be numbers")}return(0,b.scanIterator)(this,t,e,r,i)}}]);return Jimp}(g["default"]);function addConstants(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:B;Object.entries(t).forEach(function(t){var r=(0,s["default"])(t,2),i=r[0],a=r[1];e[i]=a})}function addJimpMethods(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:B;Object.entries(t).forEach(function(t){var r=(0,s["default"])(t,2),i=r[0],a=r[1];e.prototype[i]=a})}addConstants(P);addJimpMethods({composite:I["default"]});B.__extraConstructors=[];B.appendConstructorOption=function(t,e,r){B.__extraConstructors.push({name:t,test:e,run:r})};B.read=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}return new Promise(function(t,r){(0,n["default"])(B,e.concat([function(e,i){if(e)r(e);else t(i)}]))})};B.create=B.read;B.rgbaToInt=function(t,e,r,i,a){if(typeof t!=="number"||typeof e!=="number"||typeof r!=="number"||typeof i!=="number"){return b.throwError.call(this,"r, g, b and a must be numbers",a)}if(t<0||t>255){return b.throwError.call(this,"r must be between 0 and 255",a)}if(e<0||e>255){b.throwError.call(this,"g must be between 0 and 255",a)}if(r<0||r>255){return b.throwError.call(this,"b must be between 0 and 255",a)}if(i<0||i>255){return b.throwError.call(this,"a must be between 0 and 255",a)}t=Math.round(t);r=Math.round(r);e=Math.round(e);i=Math.round(i);var n=t*Math.pow(256,3)+e*Math.pow(256,2)+r*Math.pow(256,1)+i*Math.pow(256,0);if((0,b.isNodePattern)(a)){a.call(this,null,n)}return n};B.intToRGBA=function(t,e){if(typeof t!=="number"){return b.throwError.call(this,"i must be a number",e)}var r={};r.r=Math.floor(t/Math.pow(256,3));r.g=Math.floor((t-r.r*Math.pow(256,3))/Math.pow(256,2));r.b=Math.floor((t-r.r*Math.pow(256,3)-r.g*Math.pow(256,2))/Math.pow(256,1));r.a=Math.floor((t-r.r*Math.pow(256,3)-r.g*Math.pow(256,2)-r.b*Math.pow(256,1))/Math.pow(256,0));if((0,b.isNodePattern)(e)){e.call(this,null,r)}return r};B.cssColorToHex=function(t){t=t||0;if(typeof t==="number")return Number(t);return parseInt((0,w["default"])(t).toHex8(),16)};B.limit255=function(t){t=Math.max(t,0);t=Math.min(t,255);return t};B.diff=function(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:.1;if(!(t instanceof B)||!(e instanceof B))return b.throwError.call(this,"img1 and img2 must be an Jimp images");var i=t.bitmap;var a=e.bitmap;if(i.width!==a.width||i.height!==a.height){if(i.width*i.height>a.width*a.height){t=t.cloneQuiet().resize(a.width,a.height)}else{e=e.cloneQuiet().resize(i.width,i.height)}}if(typeof r!=="number"||r<0||r>1){return b.throwError.call(this,"threshold must be a number between 0 and 1")}var n=new B(i.width,i.height,4294967295);var s=(0,M["default"])(i.data,a.data,n.bitmap.data,n.bitmap.width,n.bitmap.height,{threshold:r});return{percent:s/(n.bitmap.width*n.bitmap.height),image:n}};B.distance=function(t,e){var r=new _["default"];var i=r.getHash(t);var a=r.getHash(e);return r.distance(i,a)};B.compareHashes=function(t,e){var r=new _["default"];return r.distance(t,e)};B.colorDiff=function(t,e){var r=function pow(t){return Math.pow(t,2)};var i=Math.max;var a=255*255*3;if(t.a!==0&&!t.a){t.a=255}if(e.a!==0&&!e.a){e.a=255}return(i(r(t.r-e.r),r(t.r-e.r-t.a+e.a))+i(r(t.g-e.g),r(t.g-e.g-t.a+e.a))+i(r(t.b-e.b),r(t.b-e.b-t.a+e.a)))/a};function jimpEvMethod(t,e,r){var i="before-"+e;var a=e.replace(/e$/,"")+"ed";B.prototype[t]=function(){var e;for(var n=arguments.length,s=new Array(n),o=0;o<n;o++){s[o]=arguments[o]}var h=s[r.length-1];var f=this;if(typeof h==="function"){e=function wrappedCb(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++){r[i]=arguments[i]}var n=r[0],s=r[1];if(n){f.emitError(t,n)}else{f.emitMulti(t,a,(0,d["default"])({},t,s))}h.apply(this,r)};s[s.length-1]=e}else{e=false}this.emitMulti(t,i);var l;try{l=r.apply(this,s);if(!e){this.emitMulti(t,a,(0,d["default"])({},t,l))}}catch(e){e.methodName=t;this.emitError(t,e)}return l};B.prototype[t+"Quiet"]=r}jimpEvMethod("clone","clone",function(t){var e=new B(this);if((0,b.isNodePattern)(t)){t.call(e,null,e)}return e});function jimpEvChange(t,e){jimpEvMethod(t,"change",e)}jimpEvChange("background",function(t,e){if(typeof t!=="number"){return b.throwError.call(this,"hex must be a hexadecimal rgba value",e)}this._background=t;if((0,b.isNodePattern)(e)){e.call(this,null,this)}return this});jimpEvChange("scan",function(t,e,r,i,a,n){if(typeof t!=="number"||typeof e!=="number"){return b.throwError.call(this,"x and y must be numbers",n)}if(typeof r!=="number"||typeof i!=="number"){return b.throwError.call(this,"w and h must be numbers",n)}if(typeof a!=="function"){return b.throwError.call(this,"f must be a function",n)}var s=(0,b.scan)(this,t,e,r,i,a);if((0,b.isNodePattern)(n)){n.call(this,null,s)}return s});if(process.env.ENVIRONMENT==="BROWSER"){var C;if(typeof window!=="undefined"&&(typeof window==="undefined"?"undefined":(0,p["default"])(window))==="object"){C=window}if(typeof self!=="undefined"&&(typeof self==="undefined"?"undefined":(0,p["default"])(self))==="object"){C=self}C.Jimp=B;C.Buffer=Buffer}var R=B;e["default"]=R},27:function(t){function _assertThisInitialized(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}t.exports=_assertThisInitialized},32:function(t,e,r){var i=r(221);var a=r(601);function _construct(e,r,n){if(a()){t.exports=_construct=Reflect.construct}else{t.exports=_construct=function _construct(t,e,r){var a=[null];a.push.apply(a,e);var n=Function.bind.apply(t,a);var s=new n;if(r)i(s,r.prototype);return s}}return _construct.apply(null,arguments)}t.exports=_construct},34:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(431));var n=r(19);var s=function _default(){return{displace:function displace(t,e,r){if((0,a["default"])(t)!=="object"||t.constructor!==this.constructor){return n.throwError.call(this,"The source must be a Jimp image",r)}if(typeof e!=="number"){return n.throwError.call(this,"factor must be a number",r)}var i=this.cloneQuiet();this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(r,a,n){var s=t.bitmap.data[n]/256*e;s=Math.round(s);var o=this.getPixelIndex(r+s,a);this.bitmap.data[o]=i.bitmap.data[n];this.bitmap.data[o+1]=i.bitmap.data[n+1];this.bitmap.data[o+2]=i.bitmap.data[n+2]});if((0,n.isNodePattern)(r)){r.call(this,null,this)}return this}}};e["default"]=s;t.exports=e.default},35:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=r(578);var n=function _default(){return{blur:function blur(t,e){if(typeof t!=="number")return i.throwError.call(this,"r must be a number",e);if(t<1)return i.throwError.call(this,"r must be greater than 0",e);var r;var n;var s;var o;var h;var f;var l;var u;var c;var d;var p;var v;var m;var g;var b=this.bitmap.width-1;var y=this.bitmap.height-1;var E=t+1;var M=a.mulTable[t];var w=a.shgTable[t];var _=[];var x=[];var I=[];var D=[];var L=[];var T=[];var P=2;while(P-- >0){v=0;m=0;for(f=0;f<this.bitmap.height;f++){r=this.bitmap.data[m]*E;n=this.bitmap.data[m+1]*E;s=this.bitmap.data[m+2]*E;o=this.bitmap.data[m+3]*E;for(l=1;l<=t;l++){u=m+((l>b?b:l)<<2);r+=this.bitmap.data[u++];n+=this.bitmap.data[u++];s+=this.bitmap.data[u++];o+=this.bitmap.data[u]}for(h=0;h<this.bitmap.width;h++){_[v]=r;x[v]=n;I[v]=s;D[v]=o;if(f===0){L[h]=((u=h+E)<b?u:b)<<2;T[h]=(u=h-t)>0?u<<2:0}c=m+L[h];d=m+T[h];r+=this.bitmap.data[c++]-this.bitmap.data[d++];n+=this.bitmap.data[c++]-this.bitmap.data[d++];s+=this.bitmap.data[c++]-this.bitmap.data[d++];o+=this.bitmap.data[c]-this.bitmap.data[d];v++}m+=this.bitmap.width<<2}for(h=0;h<this.bitmap.width;h++){p=h;r=_[p]*E;n=x[p]*E;s=I[p]*E;o=D[p]*E;for(l=1;l<=t;l++){p+=l>y?0:this.bitmap.width;r+=_[p];n+=x[p];s+=I[p];o+=D[p]}v=h<<2;for(f=0;f<this.bitmap.height;f++){g=o*M>>>w;this.bitmap.data[v+3]=g;if(g>255){this.bitmap.data[v+3]=255}if(g>0){g=255/g;this.bitmap.data[v]=(r*M>>>w)*g;this.bitmap.data[v+1]=(n*M>>>w)*g;this.bitmap.data[v+2]=(s*M>>>w)*g}else{this.bitmap.data[v+2]=0;this.bitmap.data[v+1]=0;this.bitmap.data[v]=0}if(h===0){L[f]=((u=f+E)<y?u:y)*this.bitmap.width;T[f]=(u=f-t)>0?u*this.bitmap.width:0}c=h+L[f];d=h+T[f];r+=_[c]-_[d];n+=x[c]-x[d];s+=I[c]-I[d];o+=D[c]-D[d];v+=this.bitmap.width<<2}}}if((0,i.isNodePattern)(e)){e.call(this,null,this)}return this}}};e["default"]=n;t.exports=e.default},43:function(t,e,r){"use strict";var i=r(999);var a=4;var n=0;var s=1;var o=2;function zero(t){var e=t.length;while(--e>=0){t[e]=0}}var h=0;var f=1;var l=2;var u=3;var c=258;var d=29;var p=256;var v=p+1+d;var m=30;var g=19;var b=2*v+1;var y=15;var E=16;var M=7;var w=256;var _=16;var x=17;var I=18;var D=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var L=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var k=512;var O=new Array((v+2)*2);zero(O);var N=new Array(m*2);zero(N);var S=new Array(k);zero(S);var A=new Array(c-u+1);zero(A);var B=new Array(d);zero(B);var C=new Array(m);zero(C);function StaticTreeDesc(t,e,r,i,a){this.static_tree=t;this.extra_bits=e;this.extra_base=r;this.elems=i;this.max_length=a;this.has_stree=t&&t.length}var R;var F;var X;function TreeDesc(t,e){this.dyn_tree=t;this.max_code=0;this.stat_desc=e}function d_code(t){return t<256?S[t]:S[256+(t>>>7)]}function put_short(t,e){t.pending_buf[t.pending++]=e&255;t.pending_buf[t.pending++]=e>>>8&255}function send_bits(t,e,r){if(t.bi_valid>E-r){t.bi_buf|=e<<t.bi_valid&65535;put_short(t,t.bi_buf);t.bi_buf=e>>E-t.bi_valid;t.bi_valid+=r-E}else{t.bi_buf|=e<<t.bi_valid&65535;t.bi_valid+=r}}function send_code(t,e,r){send_bits(t,r[e*2],r[e*2+1])}function bi_reverse(t,e){var r=0;do{r|=t&1;t>>>=1;r<<=1}while(--e>0);return r>>>1}function bi_flush(t){if(t.bi_valid===16){put_short(t,t.bi_buf);t.bi_buf=0;t.bi_valid=0}else if(t.bi_valid>=8){t.pending_buf[t.pending++]=t.bi_buf&255;t.bi_buf>>=8;t.bi_valid-=8}}function gen_bitlen(t,e){var r=e.dyn_tree;var i=e.max_code;var a=e.stat_desc.static_tree;var n=e.stat_desc.has_stree;var s=e.stat_desc.extra_bits;var o=e.stat_desc.extra_base;var h=e.stat_desc.max_length;var f;var l,u;var c;var d;var p;var v=0;for(c=0;c<=y;c++){t.bl_count[c]=0}r[t.heap[t.heap_max]*2+1]=0;for(f=t.heap_max+1;f<b;f++){l=t.heap[f];c=r[r[l*2+1]*2+1]+1;if(c>h){c=h;v++}r[l*2+1]=c;if(l>i){continue}t.bl_count[c]++;d=0;if(l>=o){d=s[l-o]}p=r[l*2];t.opt_len+=p*(c+d);if(n){t.static_len+=p*(a[l*2+1]+d)}}if(v===0){return}do{c=h-1;while(t.bl_count[c]===0){c--}t.bl_count[c]--;t.bl_count[c+1]+=2;t.bl_count[h]--;v-=2}while(v>0);for(c=h;c!==0;c--){l=t.bl_count[c];while(l!==0){u=t.heap[--f];if(u>i){continue}if(r[u*2+1]!==c){t.opt_len+=(c-r[u*2+1])*r[u*2];r[u*2+1]=c}l--}}}function gen_codes(t,e,r){var i=new Array(y+1);var a=0;var n;var s;for(n=1;n<=y;n++){i[n]=a=a+r[n-1]<<1}for(s=0;s<=e;s++){var o=t[s*2+1];if(o===0){continue}t[s*2]=bi_reverse(i[o]++,o)}}function tr_static_init(){var t;var e;var r;var i;var a;var n=new Array(y+1);r=0;for(i=0;i<d-1;i++){B[i]=r;for(t=0;t<1<<D[i];t++){A[r++]=i}}A[r-1]=i;a=0;for(i=0;i<16;i++){C[i]=a;for(t=0;t<1<<L[i];t++){S[a++]=i}}a>>=7;for(;i<m;i++){C[i]=a<<7;for(t=0;t<1<<L[i]-7;t++){S[256+a++]=i}}for(e=0;e<=y;e++){n[e]=0}t=0;while(t<=143){O[t*2+1]=8;t++;n[8]++}while(t<=255){O[t*2+1]=9;t++;n[9]++}while(t<=279){O[t*2+1]=7;t++;n[7]++}while(t<=287){O[t*2+1]=8;t++;n[8]++}gen_codes(O,v+1,n);for(t=0;t<m;t++){N[t*2+1]=5;N[t*2]=bi_reverse(t,5)}R=new StaticTreeDesc(O,D,p+1,v,y);F=new StaticTreeDesc(N,L,0,m,y);X=new StaticTreeDesc(new Array(0),T,0,g,M)}function init_block(t){var e;for(e=0;e<v;e++){t.dyn_ltree[e*2]=0}for(e=0;e<m;e++){t.dyn_dtree[e*2]=0}for(e=0;e<g;e++){t.bl_tree[e*2]=0}t.dyn_ltree[w*2]=1;t.opt_len=t.static_len=0;t.last_lit=t.matches=0}function bi_windup(t){if(t.bi_valid>8){put_short(t,t.bi_buf)}else if(t.bi_valid>0){t.pending_buf[t.pending++]=t.bi_buf}t.bi_buf=0;t.bi_valid=0}function copy_block(t,e,r,a){bi_windup(t);if(a){put_short(t,r);put_short(t,~r)}i.arraySet(t.pending_buf,t.window,e,r,t.pending);t.pending+=r}function smaller(t,e,r,i){var a=e*2;var n=r*2;return t[a]<t[n]||t[a]===t[n]&&i[e]<=i[r]}function pqdownheap(t,e,r){var i=t.heap[r];var a=r<<1;while(a<=t.heap_len){if(a<t.heap_len&&smaller(e,t.heap[a+1],t.heap[a],t.depth)){a++}if(smaller(e,i,t.heap[a],t.depth)){break}t.heap[r]=t.heap[a];r=a;a<<=1}t.heap[r]=i}function compress_block(t,e,r){var i;var a;var n=0;var s;var o;if(t.last_lit!==0){do{i=t.pending_buf[t.d_buf+n*2]<<8|t.pending_buf[t.d_buf+n*2+1];a=t.pending_buf[t.l_buf+n];n++;if(i===0){send_code(t,a,e)}else{s=A[a];send_code(t,s+p+1,e);o=D[s];if(o!==0){a-=B[s];send_bits(t,a,o)}i--;s=d_code(i);send_code(t,s,r);o=L[s];if(o!==0){i-=C[s];send_bits(t,i,o)}}}while(n<t.last_lit)}send_code(t,w,e)}function build_tree(t,e){var r=e.dyn_tree;var i=e.stat_desc.static_tree;var a=e.stat_desc.has_stree;var n=e.stat_desc.elems;var s,o;var h=-1;var f;t.heap_len=0;t.heap_max=b;for(s=0;s<n;s++){if(r[s*2]!==0){t.heap[++t.heap_len]=h=s;t.depth[s]=0}else{r[s*2+1]=0}}while(t.heap_len<2){f=t.heap[++t.heap_len]=h<2?++h:0;r[f*2]=1;t.depth[f]=0;t.opt_len--;if(a){t.static_len-=i[f*2+1]}}e.max_code=h;for(s=t.heap_len>>1;s>=1;s--){pqdownheap(t,r,s)}f=n;do{s=t.heap[1];t.heap[1]=t.heap[t.heap_len--];pqdownheap(t,r,1);o=t.heap[1];t.heap[--t.heap_max]=s;t.heap[--t.heap_max]=o;r[f*2]=r[s*2]+r[o*2];t.depth[f]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1;r[s*2+1]=r[o*2+1]=f;t.heap[1]=f++;pqdownheap(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1];gen_bitlen(t,e);gen_codes(r,h,t.bl_count)}function scan_tree(t,e,r){var i;var a=-1;var n;var s=e[0*2+1];var o=0;var h=7;var f=4;if(s===0){h=138;f=3}e[(r+1)*2+1]=65535;for(i=0;i<=r;i++){n=s;s=e[(i+1)*2+1];if(++o<h&&n===s){continue}else if(o<f){t.bl_tree[n*2]+=o}else if(n!==0){if(n!==a){t.bl_tree[n*2]++}t.bl_tree[_*2]++}else if(o<=10){t.bl_tree[x*2]++}else{t.bl_tree[I*2]++}o=0;a=n;if(s===0){h=138;f=3}else if(n===s){h=6;f=3}else{h=7;f=4}}}function send_tree(t,e,r){var i;var a=-1;var n;var s=e[0*2+1];var o=0;var h=7;var f=4;if(s===0){h=138;f=3}for(i=0;i<=r;i++){n=s;s=e[(i+1)*2+1];if(++o<h&&n===s){continue}else if(o<f){do{send_code(t,n,t.bl_tree)}while(--o!==0)}else if(n!==0){if(n!==a){send_code(t,n,t.bl_tree);o--}send_code(t,_,t.bl_tree);send_bits(t,o-3,2)}else if(o<=10){send_code(t,x,t.bl_tree);send_bits(t,o-3,3)}else{send_code(t,I,t.bl_tree);send_bits(t,o-11,7)}o=0;a=n;if(s===0){h=138;f=3}else if(n===s){h=6;f=3}else{h=7;f=4}}}function build_bl_tree(t){var e;scan_tree(t,t.dyn_ltree,t.l_desc.max_code);scan_tree(t,t.dyn_dtree,t.d_desc.max_code);build_tree(t,t.bl_desc);for(e=g-1;e>=3;e--){if(t.bl_tree[P[e]*2+1]!==0){break}}t.opt_len+=3*(e+1)+5+5+4;return e}function send_all_trees(t,e,r,i){var a;send_bits(t,e-257,5);send_bits(t,r-1,5);send_bits(t,i-4,4);for(a=0;a<i;a++){send_bits(t,t.bl_tree[P[a]*2+1],3)}send_tree(t,t.dyn_ltree,e-1);send_tree(t,t.dyn_dtree,r-1)}function detect_data_type(t){var e=4093624447;var r;for(r=0;r<=31;r++,e>>>=1){if(e&1&&t.dyn_ltree[r*2]!==0){return n}}if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0){return s}for(r=32;r<p;r++){if(t.dyn_ltree[r*2]!==0){return s}}return n}var G=false;function _tr_init(t){if(!G){tr_static_init();G=true}t.l_desc=new TreeDesc(t.dyn_ltree,R);t.d_desc=new TreeDesc(t.dyn_dtree,F);t.bl_desc=new TreeDesc(t.bl_tree,X);t.bi_buf=0;t.bi_valid=0;init_block(t)}function _tr_stored_block(t,e,r,i){send_bits(t,(h<<1)+(i?1:0),3);copy_block(t,e,r,true)}function _tr_align(t){send_bits(t,f<<1,3);send_code(t,w,O);bi_flush(t)}function _tr_flush_block(t,e,r,i){var n,s;var h=0;if(t.level>0){if(t.strm.data_type===o){t.strm.data_type=detect_data_type(t)}build_tree(t,t.l_desc);build_tree(t,t.d_desc);h=build_bl_tree(t);n=t.opt_len+3+7>>>3;s=t.static_len+3+7>>>3;if(s<=n){n=s}}else{n=s=r+5}if(r+4<=n&&e!==-1){_tr_stored_block(t,e,r,i)}else if(t.strategy===a||s===n){send_bits(t,(f<<1)+(i?1:0),3);compress_block(t,O,N)}else{send_bits(t,(l<<1)+(i?1:0),3);send_all_trees(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1);compress_block(t,t.dyn_ltree,t.dyn_dtree)}init_block(t);if(i){bi_windup(t)}}function _tr_tally(t,e,r){t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255;t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255;t.pending_buf[t.l_buf+t.last_lit]=r&255;t.last_lit++;if(e===0){t.dyn_ltree[r*2]++}else{t.matches++;e--;t.dyn_ltree[(A[r]+p+1)*2]++;t.dyn_dtree[d_code(e)*2]++}return t.last_lit===t.lit_bufsize-1}e._tr_init=_tr_init;e._tr_stored_block=_tr_stored_block;e._tr_flush_block=_tr_flush_block;e._tr_tally=_tr_tally;e._tr_align=_tr_align},65:function(t,e){"use strict";function GifWriter(t,e,r,i){var a=0;var i=i===undefined?{}:i;var n=i.loop===undefined?null:i.loop;var s=i.palette===undefined?null:i.palette;if(e<=0||r<=0||e>65535||r>65535)throw new Error("Width/Height invalid.");function check_palette_and_num_colors(t){var e=t.length;if(e<2||e>256||e&e-1){throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.")}return e}t[a++]=71;t[a++]=73;t[a++]=70;t[a++]=56;t[a++]=57;t[a++]=97;var o=0;var h=0;if(s!==null){var f=check_palette_and_num_colors(s);while(f>>=1)++o;f=1<<o;--o;if(i.background!==undefined){h=i.background;if(h>=f)throw new Error("Background index out of range.");if(h===0)throw new Error("Background index explicitly passed as 0.")}}t[a++]=e&255;t[a++]=e>>8&255;t[a++]=r&255;t[a++]=r>>8&255;t[a++]=(s!==null?128:0)|o;t[a++]=h;t[a++]=0;if(s!==null){for(var l=0,u=s.length;l<u;++l){var c=s[l];t[a++]=c>>16&255;t[a++]=c>>8&255;t[a++]=c&255}}if(n!==null){if(n<0||n>65535)throw new Error("Loop count invalid.");t[a++]=33;t[a++]=255;t[a++]=11;t[a++]=78;t[a++]=69;t[a++]=84;t[a++]=83;t[a++]=67;t[a++]=65;t[a++]=80;t[a++]=69;t[a++]=50;t[a++]=46;t[a++]=48;t[a++]=3;t[a++]=1;t[a++]=n&255;t[a++]=n>>8&255;t[a++]=0}var d=false;this.addFrame=function(e,r,i,n,o,h){if(d===true){--a;d=false}h=h===undefined?{}:h;if(e<0||r<0||e>65535||r>65535)throw new Error("x/y invalid.");if(i<=0||n<=0||i>65535||n>65535)throw new Error("Width/Height invalid.");if(o.length<i*n)throw new Error("Not enough pixels for the frame size.");var f=true;var l=h.palette;if(l===undefined||l===null){f=false;l=s}if(l===undefined||l===null)throw new Error("Must supply either a local or global palette.");var u=check_palette_and_num_colors(l);var c=0;while(u>>=1)++c;u=1<<c;var p=h.delay===undefined?0:h.delay;var v=h.disposal===undefined?0:h.disposal;if(v<0||v>3)throw new Error("Disposal out of range.");var m=false;var g=0;if(h.transparent!==undefined&&h.transparent!==null){m=true;g=h.transparent;if(g<0||g>=u)throw new Error("Transparent color index.")}if(v!==0||m||p!==0){t[a++]=33;t[a++]=249;t[a++]=4;t[a++]=v<<2|(m===true?1:0);t[a++]=p&255;t[a++]=p>>8&255;t[a++]=g;t[a++]=0}t[a++]=44;t[a++]=e&255;t[a++]=e>>8&255;t[a++]=r&255;t[a++]=r>>8&255;t[a++]=i&255;t[a++]=i>>8&255;t[a++]=n&255;t[a++]=n>>8&255;t[a++]=f===true?128|c-1:0;if(f===true){for(var b=0,y=l.length;b<y;++b){var E=l[b];t[a++]=E>>16&255;t[a++]=E>>8&255;t[a++]=E&255}}a=GifWriterOutputLZWCodeStream(t,a,c<2?2:c,o);return a};this.end=function(){if(d===false){t[a++]=59;d=true}return a};this.getOutputBuffer=function(){return t};this.setOutputBuffer=function(e){t=e};this.getOutputBufferPosition=function(){return a};this.setOutputBufferPosition=function(t){a=t}}function GifWriterOutputLZWCodeStream(t,e,r,i){t[e++]=r;var a=e++;var n=1<<r;var s=n-1;var o=n+1;var h=o+1;var f=r+1;var l=0;var u=0;function emit_bytes_to_buffer(r){while(l>=r){t[e++]=u&255;u>>=8;l-=8;if(e===a+256){t[a]=255;a=e++}}}function emit_code(t){u|=t<<l;l+=f;emit_bytes_to_buffer(8)}var c=i[0]&s;var d={};emit_code(n);for(var p=1,v=i.length;p<v;++p){var m=i[p]&s;var g=c<<8|m;var b=d[g];if(b===undefined){u|=c<<l;l+=f;while(l>=8){t[e++]=u&255;u>>=8;l-=8;if(e===a+256){t[a]=255;a=e++}}if(h===4096){emit_code(n);h=o+1;f=r+1;d={}}else{if(h>=1<<f)++f;d[g]=h++}c=m}else{c=b}}emit_code(c);emit_code(o);emit_bytes_to_buffer(1);if(a+1===e){t[a]=0}else{t[a]=e-a-1;t[e++]=0}return e}function GifReader(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!==56||t[e++]!==97){throw new Error("Invalid GIF 87a/89a header.")}var r=t[e++]|t[e++]<<8;var i=t[e++]|t[e++]<<8;var a=t[e++];var n=a>>7;var s=a&7;var o=1<<s+1;var h=t[e++];t[e++];var f=null;var l=null;if(n){f=e;l=o;e+=o*3}var u=true;var c=[];var d=0;var p=null;var v=0;var m=null;this.width=r;this.height=i;while(u&&e<t.length){switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0){e+=14;m=t[e++]|t[e++]<<8;e++}else{e+=12;while(true){var g=t[e++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;e+=g}}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var b=t[e++];d=t[e++]|t[e++]<<8;p=t[e++];if((b&1)===0)p=null;v=b>>2&7;e++;break;case 254:while(true){var g=t[e++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;e+=g}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var y=t[e++]|t[e++]<<8;var E=t[e++]|t[e++]<<8;var M=t[e++]|t[e++]<<8;var w=t[e++]|t[e++]<<8;var _=t[e++];var x=_>>7;var I=_>>6&1;var D=_&7;var L=1<<D+1;var T=f;var P=l;var k=false;if(x){var k=true;T=e;P=L;e+=L*3}var O=e;e++;while(true){var g=t[e++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;e+=g}c.push({x:y,y:E,width:M,height:w,has_local_palette:k,palette_offset:T,palette_size:P,data_offset:O,data_length:e-O,transparent_index:p,interlaced:!!I,delay:d,disposal:v});break;case 59:u=false;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16));break}}this.numFrames=function(){return c.length};this.loopCount=function(){return m};this.frameInfo=function(t){if(t<0||t>=c.length)throw new Error("Frame index out of range.");return c[t]};this.decodeAndBlitFrameBGRA=function(e,i){var a=this.frameInfo(e);var n=a.width*a.height;var s=new Uint8Array(n);GifReaderLZWOutputIndexStream(t,a.data_offset,s,n);var o=a.palette_offset;var h=a.transparent_index;if(h===null)h=256;var f=a.width;var l=r-f;var u=f;var c=(a.y*r+a.x)*4;var d=((a.y+a.height)*r+a.x)*4;var p=c;var v=l*4;if(a.interlaced===true){v+=r*4*7}var m=8;for(var g=0,b=s.length;g<b;++g){var y=s[g];if(u===0){p+=v;u=f;if(p>=d){v=l*4+r*4*(m-1);p=c+(f+l)*(m<<1);m>>=1}}if(y===h){p+=4}else{var E=t[o+y*3];var M=t[o+y*3+1];var w=t[o+y*3+2];i[p++]=w;i[p++]=M;i[p++]=E;i[p++]=255}--u}};this.decodeAndBlitFrameRGBA=function(e,i){var a=this.frameInfo(e);var n=a.width*a.height;var s=new Uint8Array(n);GifReaderLZWOutputIndexStream(t,a.data_offset,s,n);var o=a.palette_offset;var h=a.transparent_index;if(h===null)h=256;var f=a.width;var l=r-f;var u=f;var c=(a.y*r+a.x)*4;var d=((a.y+a.height)*r+a.x)*4;var p=c;var v=l*4;if(a.interlaced===true){v+=r*4*7}var m=8;for(var g=0,b=s.length;g<b;++g){var y=s[g];if(u===0){p+=v;u=f;if(p>=d){v=l*4+r*4*(m-1);p=c+(f+l)*(m<<1);m>>=1}}if(y===h){p+=4}else{var E=t[o+y*3];var M=t[o+y*3+1];var w=t[o+y*3+2];i[p++]=E;i[p++]=M;i[p++]=w;i[p++]=255}--u}}}function GifReaderLZWOutputIndexStream(t,e,r,i){var a=t[e++];var n=1<<a;var s=n+1;var o=s+1;var h=a+1;var f=(1<<h)-1;var l=0;var u=0;var c=0;var d=t[e++];var p=new Int32Array(4096);var v=null;while(true){while(l<16){if(d===0)break;u|=t[e++]<<l;l+=8;if(d===1){d=t[e++]}else{--d}}if(l<h)break;var m=u&f;u>>=h;l-=h;if(m===n){o=s+1;h=a+1;f=(1<<h)-1;v=null;continue}else if(m===s){break}var g=m<o?m:v;var b=0;var y=g;while(y>n){y=p[y]>>8;++b}var E=y;var M=c+b+(g!==m?1:0);if(M>i){console.log("Warning, gif stream longer than expected.");return}r[c++]=E;c+=b;var w=c;if(g!==m)r[c++]=E;y=g;while(b--){y=p[y];r[--w]=y&255;y>>=8}if(v!==null&&o<4096){p[o++]=v<<8|E;if(o>=f+1&&h<12){++h;f=f<<1|1}}v=m}if(c!==i){console.log("Warning, gif stream shorter than expected.")}return r}try{e.GifWriter=GifWriter;e.GifReader=GifReader}catch(t){}},69:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{gaussian:function gaussian(t,e){if(typeof t!=="number"){return i.throwError.call(this,"r must be a number",e)}if(t<1){return i.throwError.call(this,"r must be greater than 0",e)}var r=Math.ceil(t*2.57);var a=r*2+1;var n=t*t*2;var s=n*Math.PI;var o=[];for(var h=0;h<a;h++){o[h]=[];for(var f=0;f<a;f++){var l=Math.pow(f-r,2)+Math.pow(h-r,2);o[h][f]=Math.exp(-l/n)/s}}for(var u=0;u<this.bitmap.height;u++){for(var c=0;c<this.bitmap.width;c++){var d=0;var p=0;var v=0;var m=0;var g=0;for(var b=0;b<a;b++){for(var y=0;y<a;y++){var E=Math.min(this.bitmap.width-1,Math.max(0,y+c-r));var M=Math.min(this.bitmap.height-1,Math.max(0,b+u-r));var w=o[b][y];var _=M*this.bitmap.width+E<<2;d+=this.bitmap.data[_]*w;p+=this.bitmap.data[_+1]*w;v+=this.bitmap.data[_+2]*w;m+=this.bitmap.data[_+3]*w;g+=w}var x=u*this.bitmap.width+c<<2;this.bitmap.data[x]=Math.round(d/g);this.bitmap.data[x+1]=Math.round(p/g);this.bitmap.data[x+2]=Math.round(v/g);this.bitmap.data[x+3]=Math.round(m/g)}}}if((0,i.isNodePattern)(e)){e.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},74:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(655));var n=i(r(789));var s=r(19);var o="image/jpeg";var h=function _default(){return{mime:(0,a["default"])({},o,["jpeg","jpg","jpe"]),constants:{MIME_JPEG:o},decoders:(0,a["default"])({},o,n["default"].decode),encoders:(0,a["default"])({},o,function(t){return n["default"].encode(t.bitmap,t._quality).data}),class:{_quality:100,quality:function quality(t,e){if(typeof t!=="number"){return s.throwError.call(this,"n must be a number",e)}if(t<0||t>100){return s.throwError.call(this,"n must be a number 0 - 100",e)}this._quality=Math.round(t);if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this}}}};e["default"]=h;t.exports=e.default},75:function(t){t.exports={parseSections:function(t,e){var r,i;t.setBigEndian(true);while(t.remainingLength()>0&&i!==218){if(t.nextUInt8()!==255){throw new Error("Invalid JPEG section offset")}i=t.nextUInt8();if(i>=208&&i<=217||i===218){r=0}else{r=t.nextUInt16()-2}e(i,t.branch(0,r));t.skip(r)}},getSizeFromSOFSection:function(t){t.skip(1);return{height:t.nextUInt16(),width:t.nextUInt16()}},getSectionName:function(t){var e,r;switch(t){case 216:e="SOI";break;case 196:e="DHT";break;case 219:e="DQT";break;case 221:e="DRI";break;case 218:e="SOS";break;case 254:e="COM";break;case 217:e="EOI";break;default:if(t>=224&&t<=239){e="APP";r=t-224}else if(t>=192&&t<=207&&t!==196&&t!==200&&t!==204){e="SOF";r=t-192}else if(t>=208&&t<=215){e="RST";r=t-208}break}var i={name:e};if(typeof r==="number"){i.index=r}return i}}},78:function(t){(function(){t.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},80:function(t){"use strict";var e=t.exports=function(t){this._buffer=t;this._reads=[]};e.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};e.prototype.process=function(){while(this._reads.length>0&&this._buffer.length){var t=this._reads[0];if(this._buffer.length&&(this._buffer.length>=t.length||t.allowLess)){this._reads.shift();var e=this._buffer;this._buffer=e.slice(t.length);t.func.call(this,e.slice(0,t.length))}else{break}}if(this._reads.length>0){return new Error("There are some read requests waitng on finished stream")}if(this._buffer.length>0){return new Error("unrecognised content at end of stream")}}},83:function(t,e,r){"use strict";var i=r(669);var a=r(413);var n=r(268);var s=r(189);var o=t.exports=function(t){a.call(this);var e=t||{};this._packer=new s(e);this._deflate=this._packer.createDeflate();this.readable=true};i.inherits(o,a);o.prototype.pack=function(t,e,r,i){this.emit("data",new JIMPBUffer(n.PNG_SIGNATURE));this.emit("data",this._packer.packIHDR(e,r));if(i){this.emit("data",this._packer.packGAMA(i))}var a=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error"));this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this));this._deflate.on("end",function(){this.emit("data",this._packer.packIEND());this.emit("end")}.bind(this));this._deflate.end(a)}},93:function(t){t.exports={exif:{1:"InteropIndex",2:"InteropVersion",11:"ProcessingSoftware",254:"SubfileType",255:"OldSubfileType",256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:"Thresholding",264:"CellWidth",265:"CellLength",266:"FillOrder",269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",285:"PageName",286:"XPosition",287:"YPosition",288:"FreeOffsets",289:"FreeByteCounts",290:"GrayResponseUnit",291:"GrayResponseCurve",292:"T4Options",293:"T6Options",296:"ResolutionUnit",297:"PageNumber",300:"ColorResponseUnit",301:"TransferFunction",305:"Software",306:"ModifyDate",315:"Artist",316:"HostComputer",317:"Predictor",318:"WhitePoint",319:"PrimaryChromaticities",320:"ColorMap",321:"HalftoneHints",322:"TileWidth",323:"TileLength",324:"TileOffsets",325:"TileByteCounts",326:"BadFaxLines",327:"CleanFaxData",328:"ConsecutiveBadFaxLines",330:"SubIFD",332:"InkSet",333:"InkNames",334:"NumberofInks",336:"DotRange",337:"TargetPrinter",338:"ExtraSamples",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",342:"TransferRange",343:"ClipPath",344:"XClipPathUnits",345:"YClipPathUnits",346:"Indexed",347:"JPEGTables",351:"OPIProxy",400:"GlobalParametersIFD",401:"ProfileType",402:"FaxProfile",403:"CodingMethods",404:"VersionYear",405:"ModeNumber",433:"Decode",434:"DefaultImageColor",435:"T82Options",437:"JPEGTables",512:"JPEGProc",513:"ThumbnailOffset",514:"ThumbnailLength",515:"JPEGRestartInterval",517:"JPEGLosslessPredictors",518:"JPEGPointTransforms",519:"JPEGQTables",520:"JPEGDCTables",521:"JPEGACTables",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite",559:"StripRowCounts",700:"ApplicationNotes",999:"USPTOMiscellaneous",4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight",18246:"Rating",18247:"XP_DIP_XML",18248:"StitchInfo",18249:"RatingPercent",32781:"ImageID",32931:"WangTag1",32932:"WangAnnotation",32933:"WangTag3",32934:"WangTag4",32995:"Matteing",32996:"DataType",32997:"ImageDepth",32998:"TileDepth",33405:"Model2",33421:"CFARepeatPatternDim",33422:"CFAPattern2",33423:"BatteryLevel",33424:"KodakIFD",33432:"Copyright",33434:"ExposureTime",33437:"FNumber",33445:"MDFileTag",33446:"MDScalePixel",33447:"MDColorTable",33448:"MDLabName",33449:"MDSampleInfo",33450:"MDPrepDate",33451:"MDPrepTime",33452:"MDFileUnits",33550:"PixelScale",33589:"AdventScale",33590:"AdventRevision",33628:"UIC1Tag",33629:"UIC2Tag",33630:"UIC3Tag",33631:"UIC4Tag",33723:"IPTC-NAA",33918:"IntergraphPacketData",33919:"IntergraphFlagRegisters",33920:"IntergraphMatrix",33921:"INGRReserved",33922:"ModelTiePoint",34016:"Site",34017:"ColorSequence",34018:"IT8Header",34019:"RasterPadding",34020:"BitsPerRunLength",34021:"BitsPerExtendedRunLength",34022:"ColorTable",34023:"ImageColorIndicator",34024:"BackgroundColorIndicator",34025:"ImageColorValue",34026:"BackgroundColorValue",34027:"PixelIntensityRange",34028:"TransparencyIndicator",34029:"ColorCharacterization",34030:"HCUsage",34031:"TrapIndicator",34032:"CMYKEquivalent",34118:"SEMInfo",34152:"AFCP_IPTC",34232:"PixelMagicJBIGOptions",34264:"ModelTransform",34306:"WB_GRGBLevels",34310:"LeafData",34377:"PhotoshopSettings",34665:"ExifOffset",34675:"ICC_Profile",34687:"TIFF_FXExtensions",34688:"MultiProfiles",34689:"SharedData",34690:"T88Options",34732:"ImageLayer",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34850:"ExposureProgram",34852:"SpectralSensitivity",34853:"GPSInfo",34855:"ISO",34856:"Opto-ElectricConvFactor",34857:"Interlace",34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",34908:"FaxRecvParams",34909:"FaxSubAddress",34910:"FaxRecvTime",34954:"LeafSubIFD",36864:"ExifVersion",36867:"DateTimeOriginal",36868:"CreateDate",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureCompensation",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",37387:"FlashEnergy",37388:"SpatialFrequencyResponse",37389:"Noise",37390:"FocalPlaneXResolution",37391:"FocalPlaneYResolution",37392:"FocalPlaneResolutionUnit",37393:"ImageNumber",37394:"SecurityClassification",37395:"ImageHistory",37396:"SubjectArea",37397:"ExposureIndex",37398:"TIFF-EPStandardID",37399:"SensingMethod",37434:"CIP3DataFile",37435:"CIP3Sheet",37436:"CIP3Side",37439:"StoNits",37500:"MakerNote",37510:"UserComment",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37679:"MSDocumentText",37680:"MSPropertySetStorage",37681:"MSDocumentTextPosition",37724:"ImageSourceData",40091:"XPTitle",40092:"XPComment",40093:"XPAuthor",40094:"XPKeywords",40095:"XPSubject",40960:"FlashpixVersion",40961:"ColorSpace",40962:"ExifImageWidth",40963:"ExifImageHeight",40964:"RelatedSoundFile",40965:"InteropOffset",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41485:"Noise",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41489:"ImageNumber",41490:"SecurityClassification",41491:"ImageHistory",41492:"SubjectLocation",41493:"ExposureIndex",41494:"TIFF-EPStandardID",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFormat",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"OwnerName",42033:"SerialNumber",42034:"LensInfo",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42112:"GDALMetadata",42113:"GDALNoData",42240:"Gamma",44992:"ExpandSoftware",44993:"ExpandLens",44994:"ExpandFilm",44995:"ExpandFilterLens",44996:"ExpandScanner",44997:"ExpandFlashLamp",48129:"PixelFormat",48130:"Transformation",48131:"Uncompressed",48132:"ImageType",48256:"ImageWidth",48257:"ImageHeight",48258:"WidthResolution",48259:"HeightResolution",48320:"ImageOffset",48321:"ImageByteCount",48322:"AlphaOffset",48323:"AlphaByteCount",48324:"ImageDataDiscard",48325:"AlphaDataDiscard",50215:"OceScanjobDesc",50216:"OceApplicationSelector",50217:"OceIDNumber",50218:"OceImageLogic",50255:"Annotations",50341:"PrintIM",50560:"USPTOOriginalContentType",50706:"DNGVersion",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50710:"CFAPlaneColor",50711:"CFALayout",50712:"LinearizationTable",50713:"BlackLevelRepeatDim",50714:"BlackLevel",50715:"BlackLevelDeltaH",50716:"BlackLevelDeltaV",50717:"WhiteLevel",50718:"DefaultScale",50719:"DefaultCropOrigin",50720:"DefaultCropSize",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50733:"BayerGreenSplit",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50737:"ChromaBlurRadius",50738:"AntiAliasStrength",50739:"ShadowScale",50740:"DNGPrivateData",50741:"MakerNoteSafety",50752:"RawImageSegmentation",50778:"CalibrationIlluminant1",50779:"CalibrationIlluminant2",50780:"BestQualityScale",50781:"RawDataUniqueID",50784:"AliasLayerMetadata",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50829:"ActiveArea",50830:"MaskedAreas",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50935:"NoiseReductionApplied",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:"ProfileEmbedPolicy",50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:"PreviewColorSpace",50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50974:"SubTileBlockSize",50975:"RowInterleaveFactor",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51008:"OpcodeList1",51009:"OpcodeList2",51022:"OpcodeList3",51041:"NoiseProfile",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:"ProfileHueSatMapEncoding",51108:"ProfileLookTableEncoding",51109:"BaselineExposureOffset",51110:"DefaultBlackRender",51111:"NewRawImageDigest",51112:"RawToPreviewGain",51125:"DefaultUserCrop",59932:"Padding",59933:"OffsetSchema",65000:"OwnerName",65001:"SerialNumber",65002:"Lens",65024:"KDC_IFD",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"}}},94:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{shadow:function shadow(){var t=this;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1?arguments[1]:undefined;if(typeof e==="function"){r=e;e={}}var a=e,n=a.opacity,s=n===void 0?.7:n,o=a.size,h=o===void 0?1.1:o,f=a.x,l=f===void 0?-25:f,u=a.y,c=u===void 0?25:u,d=a.blur,p=d===void 0?5:d;var v=this.clone();var shadow=this.clone();shadow.scan(0,0,shadow.bitmap.width,shadow.bitmap.height,function(e,r,i){shadow.bitmap.data[i]=0;shadow.bitmap.data[i+1]=0;shadow.bitmap.data[i+2]=0;shadow.bitmap.data[i+3]=shadow.constructor.limit255(shadow.bitmap.data[i+3]*s);t.bitmap.data[i]=0;t.bitmap.data[i+1]=0;t.bitmap.data[i+2]=0;t.bitmap.data[i+3]=0});shadow.resize(shadow.bitmap.width*h,shadow.bitmap.height*h).blur(p);this.composite(shadow,l,c);this.composite(v,0,0);if((0,i.isNodePattern)(r)){r.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},97:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.srcOver=srcOver;e.dstOver=dstOver;e.multiply=multiply;e.add=add;e.screen=screen;e.overlay=overlay;e.darken=darken;e.lighten=lighten;e.hardLight=hardLight;e.difference=difference;e.exclusion=exclusion;function srcOver(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=(t.r*t.a+e.r*e.a*(1-t.a))/i;var n=(t.g*t.a+e.g*e.a*(1-t.a))/i;var s=(t.b*t.a+e.b*e.a*(1-t.a))/i;return{r:a,g:n,b:s,a:i}}function dstOver(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=(e.r*e.a+t.r*t.a*(1-e.a))/i;var n=(e.g*e.a+t.g*t.a*(1-e.a))/i;var s=(e.b*e.a+t.b*t.a*(1-e.a))/i;return{r:a,g:n,b:s,a:i}}function multiply(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(a*o+a*(1-e.a)+o*(1-t.a))/i;var u=(n*h+n*(1-e.a)+h*(1-t.a))/i;var c=(s*f+s*(1-e.a)+f*(1-t.a))/i;return{r:l,g:u,b:c,a:i}}function add(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(a+o)/i;var u=(n+h)/i;var c=(s+f)/i;return{r:l,g:u,b:c,a:i}}function screen(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(a*e.a+o*t.a-a*o+a*(1-e.a)+o*(1-t.a))/i;var u=(n*e.a+h*t.a-n*h+n*(1-e.a)+h*(1-t.a))/i;var c=(s*e.a+f*t.a-s*f+s*(1-e.a)+f*(1-t.a))/i;return{r:l,g:u,b:c,a:i}}function overlay(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(2*o<=e.a?2*a*o+a*(1-e.a)+o*(1-t.a):a*(1+e.a)+o*(1+t.a)-2*o*a-e.a*t.a)/i;var u=(2*h<=e.a?2*n*h+n*(1-e.a)+h*(1-t.a):n*(1+e.a)+h*(1+t.a)-2*h*n-e.a*t.a)/i;var c=(2*f<=e.a?2*s*f+s*(1-e.a)+f*(1-t.a):s*(1+e.a)+f*(1+t.a)-2*f*s-e.a*t.a)/i;return{r:l,g:u,b:c,a:i}}function darken(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(Math.min(a*e.a,o*t.a)+a*(1-e.a)+o*(1-t.a))/i;var u=(Math.min(n*e.a,h*t.a)+n*(1-e.a)+h*(1-t.a))/i;var c=(Math.min(s*e.a,f*t.a)+s*(1-e.a)+f*(1-t.a))/i;return{r:l,g:u,b:c,a:i}}function lighten(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(Math.max(a*e.a,o*t.a)+a*(1-e.a)+o*(1-t.a))/i;var u=(Math.max(n*e.a,h*t.a)+n*(1-e.a)+h*(1-t.a))/i;var c=(Math.max(s*e.a,f*t.a)+s*(1-e.a)+f*(1-t.a))/i;return{r:l,g:u,b:c,a:i}}function hardLight(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(2*a<=t.a?2*a*o+a*(1-e.a)+o*(1-t.a):a*(1+e.a)+o*(1+t.a)-2*o*a-e.a*t.a)/i;var u=(2*n<=t.a?2*n*h+n*(1-e.a)+h*(1-t.a):n*(1+e.a)+h*(1+t.a)-2*h*n-e.a*t.a)/i;var c=(2*s<=t.a?2*s*f+s*(1-e.a)+f*(1-t.a):s*(1+e.a)+f*(1+t.a)-2*f*s-e.a*t.a)/i;return{r:l,g:u,b:c,a:i}}function difference(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(a+o-2*Math.min(a*e.a,o*t.a))/i;var u=(n+h-2*Math.min(n*e.a,h*t.a))/i;var c=(s+f-2*Math.min(s*e.a,f*t.a))/i;return{r:l,g:u,b:c,a:i}}function exclusion(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a;var a=t.r*t.a;var n=t.g*t.a;var s=t.b*t.a;var o=e.r*e.a;var h=e.g*e.a;var f=e.b*e.a;var l=(a*e.a+o*t.a-2*a*o+a*(1-e.a)+o*(1-t.a))/i;var u=(n*e.a+h*t.a-2*n*h+n*(1-e.a)+h*(1-t.a))/i;var c=(s*e.a+f*t.a-2*s*f+s*(1-e.a)+f*(1-t.a))/i;return{r:l,g:u,b:c,a:i}}},108:function(t,e,r){var i=r(925);function _arrayWithoutHoles(t){if(Array.isArray(t))return i(t)}t.exports=_arrayWithoutHoles},112:function(t,e,r){"use strict";const i=r(65);const{Gif:a,GifError:n}=r(736);let s;process.nextTick(()=>{s=r(836)});const{GifFrame:o}=r(569);const h=200;const f=100;class GifCodec{constructor(t={}){this._transparentRGB=null;if(typeof t.transparentRGB==="number"&&t.transparentRGB!==0){this._transparentRGBA=t.transparentRGB*256}this._testInitialBufferSize=0}decodeGif(t){try{let e;try{e=new i.GifReader(t)}catch(t){throw new n(t)}const r=e.numFrames();const s=[];const o={width:e.width,height:e.height,loops:e.loopCount()};o.usesTransparency=false;for(let t=0;t<r;++t){const r=this._decodeFrame(e,t,o.usesTransparency);s.push(r.frame);if(r.usesTransparency){o.usesTransparency=true}}return Promise.resolve(new a(t,s,o))}catch(t){return Promise.reject(t)}}encodeGif(t,e={}){try{if(t===null||t.length===0){throw new n("there are no frames")}const r=s.getMaxDimensions(t);e=Object.assign({},e);e.width=r.maxWidth;e.height=r.maxHeight;e.loops=e.loops||0;e.colorScope=e.colorScope||a.GlobalColorsPreferred;return Promise.resolve(this._encodeGif(t,e))}catch(t){return Promise.reject(t)}}_decodeFrame(t,e,r){let i,a;try{i=t.frameInfo(e);a=new JIMPBUffer(t.width*t.height*4);t.decodeAndBlitFrameRGBA(e,a);if(i.width!==t.width||i.height!==t.height){if(i.y){a=a.slice(i.y*t.width*4)}if(t.width>i.width){for(let e=0;e<i.height;++e){a.copy(a,e*i.width*4,(i.x+e*t.width)*4,(i.x+e*t.width)*4+i.width*4)}}a=a.slice(0,i.width*i.height*4)}}catch(t){throw new n(t)}let s=false;if(this._transparentRGBA===null){if(!r){for(let t=3;t<a.length;t+=4){if(a[t]===0){s=true;t=a.length}}}}else{for(let t=3;t<a.length;t+=4){if(a[t]===0){a.writeUInt32BE(this._transparentRGBA,t-3);s=true}}}const h=new o(i.width,i.height,a,{xOffset:i.x,yOffset:i.y,disposalMethod:i.disposal,interlaced:i.interlaced,delayCentisecs:i.delay});return{frame:h,usesTransparency:s}}_encodeGif(t,e){let r;if(e.colorScope===a.LocalColorsOnly){r=s.getColorInfo(t,0)}else{r=s.getColorInfo(t,256);if(!r.colors){if(e.colorScope===a.GlobalColorsOnly){throw new n("Too many color indexes for global color table")}e.colorScope=a.LocalColorsOnly}}e.usesTransparency=r.usesTransparency;const i=r.palettes;if(e.colorScope===a.LocalColorsOnly){const r=2e3;return _encodeLocal(t,e,r,i)}const o=2e3;return _encodeGlobal(t,e,o,r)}_getSizeEstimateGlobal(t,e){if(this._testInitialBufferSize>0){return this._testInitialBufferSize}let r=h+3*256;const i=_getPixelBitWidth(t);e.forEach(t=>{r+=_getFrameSizeEst(t,i)});return r}_getSizeEstimateLocal(t,e){if(this._testInitialBufferSize>0){return this._testInitialBufferSize}let r=h;for(let i=0;i<e.length;++i){const a=t[i];const n=_getPixelBitWidth(a);r+=_getFrameSizeEst(e[i],n)}return r}}e.GifCodec=GifCodec;function _colorLookupLinear(t,e){const r=t.indexOf(e);return r===-1?null:r}function _colorLookupBinary(t,e){var r=0,i=t.length-1,a;while(r<=i){a=Math.floor((r+i)/2);if(t[a]>e)i=a-1;else if(t[a]<e)r=a+1;else return a}return null}function _encodeGlobal(t,e,r,s){const o={colors:s.colors.slice(),usesTransparency:s.usesTransparency};_extendPaletteToPowerOf2(o);const h={palette:o.colors,loop:e.loops};let f=new JIMPBUffer(r);let l;try{l=new i.GifWriter(f,e.width,e.height,h)}catch(t){throw new n(t)}for(let e=0;e<t.length;++e){f=_writeFrame(l,e,t[e],s,false)}return new a(f.slice(0,l.end()),t,e)}function _encodeLocal(t,e,r,s){const o={loop:e.loops};let h=new JIMPBUffer(r);let f;try{f=new i.GifWriter(h,e.width,e.height,o)}catch(t){throw new n(t)}for(let e=0;e<t.length;++e){h=_writeFrame(f,e,t[e],s[e],true)}return new a(h.slice(0,f.end()),t,e)}function _extendPaletteToPowerOf2(t){const e=t.colors;if(t.usesTransparency){e.push(0)}const r=e.length;let i=2;while(r>i){i<<=1}e.length=i;e.fill(0,r)}function _getFrameSizeEst(t,e){let r=t.bitmap.width*t.bitmap.height;r=Math.ceil(r*e/8);r+=Math.ceil(r/255);return f+r+3*256}function _getIndexedImage(t,e,r){const i=r.colors;const a=i.length<=8?_colorLookupLinear:_colorLookupBinary;const s=e.bitmap.data;const o=new JIMPBUffer(s.length/4);let h=i.length;let f=0,l=0;while(f<s.length){if(s[f+3]!==0){const t=s.readUInt32BE(f,true)>>8&16777215;o[l]=a(i,t)}else{o[l]=h}f+=4;++l}if(r.usesTransparency){if(h===256){throw new n(`Frame ${t} already has 256 colors`+`and so can't use transparency`)}}else{h=null}return{buffer:o,transparentIndex:h}}function _getPixelBitWidth(t){let e=t.indexCount;let r=0;--e;while(e){++r;e>>=1}return r>0?r:1}function _writeFrame(t,e,r,i,a){if(r.interlaced){throw new n("writing interlaced GIFs is not supported")}const s=_getIndexedImage(e,r,i);const o={delay:r.delayCentisecs,disposal:r.disposalMethod,transparent:s.transparentIndex};if(a){_extendPaletteToPowerOf2(i);o.palette=i.colors}try{let e=t.getOutputBuffer();let i=t.getOutputBufferPosition();let a;let h=true;while(h){a=t.addFrame(r.xOffset,r.yOffset,r.bitmap.width,r.bitmap.height,s.buffer,o);h=false;if(a>=e.length-1){const r=new JIMPBUffer(e.length*1.5);e.copy(r);t.setOutputBuffer(r);t.setOutputBufferPosition(i);e=r;h=true}}return e}catch(t){throw new n(t)}}},118:function(t){function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t.exports=_nonIterableSpread},129:function(t,e,r){class JIMPBUffer{constructor(t,...e){if(e.length){throw new Error("Incompatible args!")}if(typeof t==="number"){return Buffer.alloc(t)}return Buffer.from(t)}}global.JIMPBUffer=JIMPBUffer;t.exports=r(23).default},139:function(t,e,r){(function(){var e={};if(true){t.exports=e}else{}var i;if(true){i=r(246)}else{}function log(){if(typeof process=="undefined"||process.env.NODE_ENV=="development")console.log.apply(console,arguments)}(function(t,e){(function(){var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function g(t){this.message="JPEG error: "+t}g.prototype=Error();g.prototype.name="JpegError";return g.constructor=g}(),a=function(){function g(t,e){this.message=t;this.g=e}g.prototype=Error();g.prototype.name="DNLMarkerError";return g.constructor=g}();(function(){function g(){this.M=null;this.B=-1}function W(t,e){for(var r=0,i=[],a,n,s=16;0<s&&!t[s-1];)s--;i.push({children:[],index:0});var o=i[0],h;for(a=0;a<s;a++){for(n=0;n<t[a];n++){o=i.pop();for(o.children[o.index]=e[r];0<o.index;)o=i.pop();o.index++;for(i.push(o);i.length<=a;)i.push(h={children:[],index:0}),o.children[o.index]=h.children,o=h;r++}a+1<s&&(i.push(h={children:[],index:0}),o.children[o.index]=h.children,o=h)}return i[0].children}function X(e,o,f,l,u,d,v,g,b){function n(){if(0<x)return x--,_>>x&1;_=e[o++];if(255===_){var t=e[o++];if(t){if(220===t&&y){o+=2;var r=e[o++]<<8|e[o++];if(0<r&&r!==f.g)throw new a("Found DNL marker (0xFFDC) while parsing scan data",r)}throw new i("unexpected marker "+(_<<8|t).toString(16))}}x=7;return _>>>7}function q(t){for(;;){t=t[n()];if("number"===typeof t)return t;if("object"!==("undefined"===typeof t?"undefined":r(t)))throw new i("invalid huffman sequence")}}function h(t){for(var e=0;0<t;)e=e<<1|n(),t--;return e}function c(t){if(1===t)return 1===n()?1:-1;var e=h(t);return e>=1<<t-1?e:e+(-1<<t)+1}function C(t,e){var r=q(t.D);r=0===r?0:c(r);t.a[e]=t.m+=r;for(r=1;64>r;){var i=q(t.o),a=i&15;i>>=4;if(0===a){if(15>i)break;r+=16}else r+=i,t.a[e+s[r]]=c(a),r++}}function w(t,e){var r=q(t.D);r=0===r?0:c(r)<<b;t.a[e]=t.m+=r}function p(t,e){t.a[e]|=n()<<b}function m(t,e){if(0<I)I--;else for(var r=d;r<=v;){var i=q(t.o),a=i&15;i>>=4;if(0===a){if(15>i){I=h(i)+(1<<i)-1;break}r+=16}else r+=i,t.a[e+s[r]]=c(a)*(1<<b),r++}}function t(t,e){for(var r=d,a=0,o;r<=v;){o=e+s[r];var f=0>t.a[o]?-1:1;switch(D){case 0:a=q(t.o);o=a&15;a>>=4;if(0===o)15>a?(I=h(a)+(1<<a),D=4):(a=16,D=1);else{if(1!==o)throw new i("invalid ACn encoding");L=c(o);D=a?2:3}continue;case 1:case 2:t.a[o]?t.a[o]+=f*(n()<<b):(a--,0===a&&(D=2===D?3:0));break;case 3:t.a[o]?t.a[o]+=f*(n()<<b):(t.a[o]=L<<b,D=0);break;case 4:t.a[o]&&(t.a[o]+=f*(n()<<b))}r++}4===D&&(I--,0===I&&(D=0))}var y=9<arguments.length&&void 0!==arguments[9]?arguments[9]:!1,E=f.P,M=o,_=0,x=0,I=0,D=0,L,T=l.length,P,k,O,S;var A=f.S?0===d?0===g?w:p:0===g?m:t:C;var B=0;var R=1===T?l[0].c*l[0].l:E*f.O;for(var F,X;B<R;){var G=u?Math.min(R-B,u):R;for(P=0;P<T;P++)l[P].m=0;I=0;if(1===T){var U=l[0];for(S=0;S<G;S++)A(U,64*((U.c+1)*(B/U.c|0)+B%U.c)),B++}else for(S=0;S<G;S++){for(P=0;P<T;P++)for(U=l[P],F=U.h,X=U.j,k=0;k<X;k++)for(O=0;O<F;O++)A(U,64*((U.c+1)*((B/E|0)*U.j+k)+(B%E*U.h+O)));B++}x=0;(U=N(e,o))&&U.f&&((0,_util.warn)("decodeScan - unexpected MCU data, current marker is: "+U.f),o=U.offset);U=U&&U.F;if(!U||65280>=U)throw new i("marker was not found");if(65488<=U&&65495>=U)o+=2;else break}(U=N(e,o))&&U.f&&((0,_util.warn)("decodeScan - unexpected Scan data, current marker is: "+U.f),o=U.offset);return o-M}function Y(t,e){for(var r=e.c,a=e.l,n=new Int16Array(64),s=0;s<a;s++)for(var o=0;o<r;o++){var h=64*((e.c+1)*s+o),f=n,l=e.G,u=e.a;if(!l)throw new i("missing required Quantization Table.");for(var c=0;64>c;c+=8){var d=u[h+c];var p=u[h+c+1];var v=u[h+c+2];var m=u[h+c+3];var g=u[h+c+4];var b=u[h+c+5];var y=u[h+c+6];var E=u[h+c+7];d*=l[c];if(0===(p|v|m|g|b|y|E))d=5793*d+512>>10,f[c]=d,f[c+1]=d,f[c+2]=d,f[c+3]=d,f[c+4]=d,f[c+5]=d,f[c+6]=d,f[c+7]=d;else{p*=l[c+1];v*=l[c+2];m*=l[c+3];g*=l[c+4];b*=l[c+5];y*=l[c+6];E*=l[c+7];var M=5793*d+128>>8;var w=5793*g+128>>8;var _=v;var x=y;g=2896*(p-E)+128>>8;E=2896*(p+E)+128>>8;m<<=4;b<<=4;M=M+w+1>>1;w=M-w;d=3784*_+1567*x+128>>8;_=1567*_-3784*x+128>>8;x=d;g=g+b+1>>1;b=g-b;E=E+m+1>>1;m=E-m;M=M+x+1>>1;x=M-x;w=w+_+1>>1;_=w-_;d=2276*g+3406*E+2048>>12;g=3406*g-2276*E+2048>>12;E=d;d=799*m+4017*b+2048>>12;m=4017*m-799*b+2048>>12;b=d;f[c]=M+E;f[c+7]=M-E;f[c+1]=w+b;f[c+6]=w-b;f[c+2]=_+m;f[c+5]=_-m;f[c+3]=x+g;f[c+4]=x-g}}for(l=0;8>l;++l)d=f[l],p=f[l+8],v=f[l+16],m=f[l+24],g=f[l+32],b=f[l+40],y=f[l+48],E=f[l+56],0===(p|v|m|g|b|y|E)?(d=5793*d+8192>>14,d=-2040>d?0:2024<=d?255:d+2056>>4,u[h+l]=d,u[h+l+8]=d,u[h+l+16]=d,u[h+l+24]=d,u[h+l+32]=d,u[h+l+40]=d,u[h+l+48]=d,u[h+l+56]=d):(M=5793*d+2048>>12,w=5793*g+2048>>12,_=v,x=y,g=2896*(p-E)+2048>>12,E=2896*(p+E)+2048>>12,M=(M+w+1>>1)+4112,w=M-w,d=3784*_+1567*x+2048>>12,_=1567*_-3784*x+2048>>12,x=d,g=g+b+1>>1,b=g-b,E=E+m+1>>1,m=E-m,M=M+x+1>>1,x=M-x,w=w+_+1>>1,_=w-_,d=2276*g+3406*E+2048>>12,g=3406*g-2276*E+2048>>12,E=d,d=799*m+4017*b+2048>>12,m=4017*m-799*b+2048>>12,b=d,d=M+E,E=M-E,p=w+b,y=w-b,v=_+m,b=_-m,m=x+g,g=x-g,d=16>d?0:4080<=d?255:d>>4,p=16>p?0:4080<=p?255:p>>4,v=16>v?0:4080<=v?255:v>>4,m=16>m?0:4080<=m?255:m>>4,g=16>g?0:4080<=g?255:g>>4,b=16>b?0:4080<=b?255:b>>4,y=16>y?0:4080<=y?255:y>>4,E=16>E?0:4080<=E?255:E>>4,u[h+l]=d,u[h+l+8]=p,u[h+l+16]=v,u[h+l+24]=m,u[h+l+32]=g,u[h+l+40]=b,u[h+l+48]=y,u[h+l+56]=E)}return e.a}function N(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:e,i=t.length-1;r=r<e?r:e;if(e>=i)return null;var a=t[e]<<8|t[e+1];if(65472<=a&&65534>=a)return{f:null,F:a,offset:e};for(var n=t[r]<<8|t[r+1];!(65472<=n&&65534>=n);){if(++r>=i)return null;n=t[r]<<8|t[r+1]}return{f:a.toString(16),F:n,offset:r}}var s=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);g.prototype={parse:function(t){function d(){var e=t[o]<<8|t[o+1];o+=2;return e}function f(){var e=d();e=o+e-2;var r=N(t,e,o);r&&r.f&&((0,_util.warn)("readDataBlock - incorrect length, current marker is: "+r.f),e=r.offset);e=t.subarray(o,e);o+=e.length;return e}function e(t){for(var e=Math.ceil(t.v/8/t.s),r=Math.ceil(t.g/8/t.u),i=0;i<t.b.length;i++){_=t.b[i];var a=Math.ceil(Math.ceil(t.v/8)*_.h/t.s),n=Math.ceil(Math.ceil(t.g/8)*_.j/t.u);_.a=new Int16Array(64*r*_.j*(e*_.h+1));_.c=a;_.l=n}t.P=e;t.O=r}var r=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).N,n=void 0===r?null:r,o=0,h=null,l=0;r=[];var u=[],c=[],p=d();if(65496!==p)throw new i("SOI not found");for(p=d();65497!==p;){switch(p){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var v=f();65518===p&&65===v[0]&&100===v[1]&&111===v[2]&&98===v[3]&&101===v[4]&&(h={version:v[5]<<8|v[6],Y:v[7]<<8|v[8],Z:v[9]<<8|v[10],W:v[11]});break;case 65499:p=d()+o-2;for(var m;o<p;){var g=t[o++],b=new Uint16Array(64);if(0===g>>4)for(v=0;64>v;v++)m=s[v],b[m]=t[o++];else if(1===g>>4)for(v=0;64>v;v++)m=s[v],b[m]=d();else throw new i("DQT - invalid table spec");r[g&15]=b}break;case 65472:case 65473:case 65474:if(y)throw new i("Only single frame JPEGs supported");d();var y={};y.X=65473===p;y.S=65474===p;y.precision=t[o++];p=d();y.g=n||p;y.v=d();y.b=[];y.C={};v=t[o++];for(p=b=g=0;p<v;p++){m=t[o];var E=t[o+1]>>4;var M=t[o+1]&15;g<E&&(g=E);b<M&&(b=M);E=y.b.push({h:E,j:M,T:t[o+2],G:null});y.C[m]=E-1;o+=3}y.s=g;y.u=b;e(y);break;case 65476:m=d();for(p=2;p<m;){g=t[o++];b=new Uint8Array(16);for(v=E=0;16>v;v++,o++)E+=b[v]=t[o];M=new Uint8Array(E);for(v=0;v<E;v++,o++)M[v]=t[o];p+=17+E;(0===g>>4?c:u)[g&15]=W(b,M)}break;case 65501:d();var w=d();break;case 65498:v=1===++l&&!n;d();g=t[o++];m=[];for(p=0;p<g;p++){b=y.C[t[o++]];var _=y.b[b];b=t[o++];_.D=c[b>>4];_.o=u[b&15];m.push(_)}p=t[o++];g=t[o++];b=t[o++];try{var x=X(t,o,y,m,w,p,g,b>>4,b&15,v);o+=x}catch(e){if(e instanceof a)return(0,_util.warn)('Attempting to re-parse JPEG image using "scanLines" parameter found in DNL marker (0xFFDC) segment.'),this.parse(t,{N:e.g});throw e}break;case 65500:o+=4;break;case 65535:255!==t[o]&&o--;break;default:if(255===t[o-3]&&192<=t[o-2]&&254>=t[o-2])o-=3;else if((v=N(t,o-2))&&v.f)(0,_util.warn)("JpegImage.parse - unexpected data, current marker is: "+v.f),o=v.offset;else throw new i("unknown marker "+p.toString(16))}p=d()}this.width=y.v;this.height=y.g;this.A=h;this.b=[];for(p=0;p<y.b.length;p++){_=y.b[p];if(w=r[_.T])_.G=w;this.b.push({R:Y(y,_),U:_.h/y.s,V:_.j/y.u,c:_.c,l:_.l})}this.i=this.b.length},L:function(t,e){var r=this.width/t,i=this.height/e,a,n,s=this.b.length,o=t*e*s,h=new Uint8ClampedArray(o),f=new Uint32Array(t);for(n=0;n<s;n++){var l=this.b[n];var u=l.U*r;var c=l.V*i;var d=n;var p=l.R;var v=l.c+1<<3;for(a=0;a<t;a++)l=0|a*u,f[a]=(l&4294967288)<<3|l&7;for(u=0;u<e;u++)for(l=0|u*c,l=v*(l&4294967288)|(l&7)<<3,a=0;a<t;a++)h[d]=p[l+f[a]],d+=s}if(i=this.M)for(n=0;n<o;)for(r=l=0;l<s;l++,n++,r+=2)h[n]=(h[n]*i[r]>>8)+i[r+1];return h},w:function(){return this.A?!!this.A.W:3===this.i?0===this.B?!1:!0:1===this.B?!0:!1},I:function(t){for(var e,r,i,a=0,n=t.length;a<n;a+=3)e=t[a],r=t[a+1],i=t[a+2],t[a]=e-179.456+1.402*i,t[a+1]=e+135.459-.344*r-.714*i,t[a+2]=e-226.816+1.772*r;return t},K:function(t){for(var e,r,i,a,n=0,s=0,o=t.length;s<o;s+=4)e=t[s],r=t[s+1],i=t[s+2],a=t[s+3],t[n++]=-122.67195406894+r*(-660635669420364e-19*r+.000437130475926232*i-54080610064599e-18*e+.00048449797120281*a-.154362151871126)+i*(-.000957964378445773*i+.000817076911346625*e-.00477271405408747*a+1.53380253221734)+e*(.000961250184130688*e-.00266257332283933*a+.48357088451265)+a*(-.000336197177618394*a+.484791561490776),t[n++]=107.268039397724+r*(219927104525741e-19*r-.000640992018297945*i+.000659397001245577*e+.000426105652938837*a-.176491792462875)+i*(-.000778269941513683*i+.00130872261408275*e+.000770482631801132*a-.151051492775562)+e*(.00126935368114843*e-.00265090189010898*a+.25802910206845)+a*(-.000318913117588328*a-.213742400323665),t[n++]=-20.810012546947+r*(-.000570115196973677*r-263409051004589e-19*i+.0020741088115012*e-.00288260236853442*a+.814272968359295)+i*(-153496057440975e-19*i-.000132689043961446*e+.000560833691242812*a-.195152027534049)+e*(.00174418132927582*e-.00255243321439347*a+.116935020465145)+a*(-.000343531996510555*a+.24165260232407);return t.subarray(0,n)},J:function(t){for(var e,r,i,a=0,n=t.length;a<n;a+=4)e=t[a],r=t[a+1],i=t[a+2],t[a]=434.456-e-1.402*i,t[a+1]=119.541-e+.344*r+.714*i,t[a+2]=481.816-e-1.772*r;return t},H:function(t){for(var e,r,i,a,n=0,s=1/255,o=0,h=t.length;o<h;o+=4)e=t[o]*s,r=t[o+1]*s,i=t[o+2]*s,a=t[o+3]*s,t[n++]=255+e*(-4.387332384609988*e+54.48615194189176*r+18.82290502165302*i+212.25662451639585*a-285.2331026137004)+r*(1.7149763477362134*r-5.6096736904047315*i-17.873870861415444*a-5.497006427196366)+i*(-2.5217340131683033*i-21.248923337353073*a+17.5119270841813)-a*(21.86122147463605*a+189.48180835922747),t[n++]=255+e*(8.841041422036149*e+60.118027045597366*r+6.871425592049007*i+31.159100130055922*a-79.2970844816548)+r*(-15.310361306967817*r+17.575251261109482*i+131.35250912493976*a-190.9453302588951)+i*(4.444339102852739*i+9.8632861493405*a-24.86741582555878)-a*(20.737325471181034*a+187.80453709719578),t[n++]=255+e*(.8842522430003296*e+8.078677503112928*r+30.89978309703729*i-.23883238689178934*a-14.183576799673286)+r*(10.49593273432072*r+63.02378494754052*i+50.606957656360734*a-112.23884253719248)+i*(.03296041114873217*i+115.60384449646641*a-193.58209356861505)-a*(22.33816807309886*a+180.12613974708367);return t.subarray(0,n)},getData:function(t,e,r){if(4<this.i)throw new i("Unsupported color mode");t=this.L(t,e);if(1===this.i&&r){r=t.length;e=new Uint8ClampedArray(3*r);for(var a=0,n=0;n<r;n++){var s=t[n];e[a++]=s;e[a++]=s;e[a++]=s}return e}if(3===this.i&&this.w())return this.I(t);if(4===this.i){if(this.w())return r?this.K(t):this.J(t);if(r)return this.H(t)}return t}};t.JpegDecoder=g})()})();t.encodeImage=function(e,r,i,a){var n={t256:[r],t257:[i],t258:[8,8,8,8],t259:[1],t262:[2],t273:[1e3],t277:[4],t278:[i],t279:[r*i*4],t282:[1],t283:[1],t284:[1],t286:[0],t287:[0],t296:[1],t305:["Photopea (UTIF.js)"],t338:[1]};if(a)for(var s in a)n[s]=a[s];var o=new Uint8Array(t.encode([n]));var h=new Uint8Array(e);var f=new Uint8Array(1e3+r*i*4);for(var s=0;s<o.length;s++)f[s]=o[s];for(var s=0;s<h.length;s++)f[1e3+s]=h[s];return f.buffer};t.encode=function(e){var r=new Uint8Array(2e4),i=4,a=t._binBE;r[0]=77;r[1]=77;r[3]=42;var n=8;a.writeUint(r,i,n);i+=4;for(var s=0;s<e.length;s++){var o=t._writeIFD(a,r,n,e[s]);n=o[1];if(s<e.length-1)a.writeUint(r,o[0],n)}return r.slice(0,n).buffer};t.decode=function(e){t.decode._decodeG3.allow2D=null;var r=new Uint8Array(e),i=0;var a=t._binBE.readASCII(r,i,2);i+=2;var n=a=="II"?t._binLE:t._binBE;var s=n.readUshort(r,i);i+=2;var o=n.readUint(r,i);i+=4;var h=[];while(true){var f=t._readIFD(n,r,o,h);o=n.readUint(r,f);if(o==0)break}return h};t.decodeImages=function(e,r){var i=new Uint8Array(e);var a=t._binBE.readASCII(i,0,2);for(var n=0;n<r.length;n++){var s=r[n];if(s["t256"]==null)continue;s.isLE=a=="II";s.width=s["t256"][0];s.height=s["t257"][0];var o=s["t259"]?s["t259"][0]:1;var h=s["t266"]?s["t266"][0]:1;if(s["t284"]&&s["t284"][0]==2)log("PlanarConfiguration 2 should not be used!");var f=(s["t258"]?Math.min(32,s["t258"][0]):1)*(s["t277"]?s["t277"][0]:1);var l=Math.ceil(s.width*f/8)*8;var u=s["t273"];if(u==null)u=s["t324"];var c=s["t279"];if(o==1&&u.length==1)c=[s.height*(l>>>3)];if(c==null)c=s["t325"];var d=new Uint8Array(s.height*(l>>>3)),p=0;if(s["t322"]!=null){var v=s["t322"][0],m=s["t323"][0];var g=Math.floor((s.width+v-1)/v);var b=Math.floor((s.height+m-1)/m);var y=new Uint8Array(Math.ceil(v*m*f/8)|0);for(var E=0;E<b;E++)for(var M=0;M<g;M++){var w=E*g+M;for(var _=0;_<y.length;_++)y[_]=0;t.decode._decompress(s,i,u[w],c[w],o,y,0,h);if(o==6)d=y;else t._copyTile(y,Math.ceil(v*f/8)|0,m,d,Math.ceil(s.width*f/8)|0,s.height,Math.ceil(M*v*f/8)|0,E*m)}p=d.length*8}else{var x=s["t278"]?s["t278"][0]:s.height;x=Math.min(x,s.height);for(var w=0;w<u.length;w++){t.decode._decompress(s,i,u[w],c[w],o,d,Math.ceil(p/8)|0,h);p+=l*x}p=Math.min(p,d.length*8)}s.data=new Uint8Array(d.buffer,0,Math.ceil(p/8)|0)}};t.decode._decompress=function(r,i,a,n,s,o,h,f){if(false){}else if(s==1)for(var l=0;l<n;l++)o[h+l]=i[a+l];else if(s==3)t.decode._decodeG3(i,a,n,o,h,r.width,f);else if(s==4)t.decode._decodeG4(i,a,n,o,h,r.width,f);else if(s==5)t.decode._decodeLZW(i,a,o,h);else if(s==6)t.decode._decodeOldJPEG(r,i,a,n,o,h);else if(s==7)t.decode._decodeNewJPEG(r,i,a,n,o,h);else if(s==8){var u=new Uint8Array(i.buffer,a,n);var c=e["inflate"](u);for(var d=0;d<c.length;d++)o[h+d]=c[d]}else if(s==32773)t.decode._decodePackBits(i,a,n,o,h);else if(s==32809)t.decode._decodeThunder(i,a,n,o,h);else log("Unknown compression",s);if(r["t317"]&&r["t317"][0]==2){var p=r["t277"]?r["t277"][0]:1,v=r["t278"]?r["t278"][0]:r.height,m=r.width*p;for(var g=0;g<v;g++){var b=h+g*m;if(p==3)for(var l=3;l<m;l+=3){o[b+l]=o[b+l]+o[b+l-3]&255;o[b+l+1]=o[b+l+1]+o[b+l-2]&255;o[b+l+2]=o[b+l+2]+o[b+l-1]&255}else for(var l=p;l<m;l++)o[b+l]=o[b+l]+o[b+l-p]&255}}};t.decode._decodeNikon=function(t,e,r,i,a){var n=[[0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0,5,4,3,6,2,7,1,0,8,9,11,10,12],[0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0,57,90,56,39,22,5,4,3,2,1,0,11,12,12],[0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0,5,4,6,3,7,2,8,1,9,0,10,11,12],[0,1,4,3,1,1,1,1,1,2,0,0,0,0,0,0,5,6,4,7,8,3,9,2,1,0,10,11,12,13,14],[0,1,5,1,1,1,1,1,1,1,2,0,0,0,0,0,8,92,75,58,41,7,6,5,4,3,2,1,0,13,14],[0,1,4,2,2,3,1,2,0,0,0,0,0,0,0,0,7,6,8,5,9,4,10,3,11,12,2,0,1,13,14]];var s,o,h,f,l;var u,c,d,p=0,v=0,m=0,g,b,r,y,E;log(t.slice(e,e+100));s=t[e];e++;o=t[e];e++;log(s.toString(16),o.toString(16),r)};t.decode._decodeNewJPEG=function(e,r,i,a,n,s){var o=e["t347"],h=o?o.length:0,f=new Uint8Array(h+a);if(o){var l=216,u=217,c=0;for(var d=0;d<h-1;d++){if(o[d]==255&&o[d+1]==u)break;f[c++]=o[d]}var p=r[i],v=r[i+1];if(p!=255||v!=l){f[c++]=p;f[c++]=v}for(var d=2;d<a;d++)f[c++]=r[i+d]}else for(var d=0;d<a;d++)f[d]=r[i+d];if(e["t262"]==32803){var m=e["t258"][0],g=new LosslessJpegDecoder;var b=g.decode(f),y=b.length;if(false){}else if(m==16)for(var d=0;d<y;d++){n[s++]=b[d]&255;n[s++]=b[d]>>>8}else if(m==12)for(var d=0;d<y;d+=2){n[s++]=b[d]>>>4;n[s++]=(b[d]<<4|b[d+1]>>>8)&255;n[s++]=b[d+1]&255}else throw new Error("unsupported bit depth "+m)}else{var E=new t.JpegDecoder;E.parse(f);var M=E.getData(E.width,E.height);for(var d=0;d<M.length;d++)n[s+d]=M[d]}if(e["t262"][0]==6)e["t262"][0]=2};t.decode._decodeOldJPEGInit=function(t,e,r,i){var a=216,n=217,s=219,o=196,h=221,f=192,l=218;var u=0,c=0,d,p,v=false,m,g,b;var y=t["t513"],E=y?y[0]:0;var M=t["t514"],w=M?M[0]:0;var _=t["t324"]||t["t273"]||y;var x=t["t530"],I=0,D=0;var L=t["t277"]?t["t277"][0]:1;var T=t["t515"];if(_){c=_[0];v=_.length>1}if(!v){if(e[r]==255&&e[r+1]==a)return{jpegOffset:r};if(y!=null){if(e[r+E]==255&&e[r+E+1]==a)u=r+E;else log("JPEGInterchangeFormat does not point to SOI");if(M==null)log("JPEGInterchangeFormatLength field is missing");else if(E>=c||E+w<=c)log("JPEGInterchangeFormatLength field value is invalid");if(u!=null)return{jpegOffset:u}}}if(x!=null){I=x[0];D=x[1]}if(y!=null)if(M!=null)if(w>=2&&E+w<=c){if(e[r+E+w-2]==255&&e[r+E+w-1]==a)d=new Uint8Array(w-2);else d=new Uint8Array(w);for(m=0;m<d.length;m++)d[m]=e[r+E+m];log("Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables")}else log("JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile");if(d==null){var P=0,k=[];k[P++]=255;k[P++]=a;var O=t["t519"];if(O==null)throw new Error("JPEGQTables tag is missing");for(m=0;m<O.length;m++){k[P++]=255;k[P++]=s;k[P++]=0;k[P++]=67;k[P++]=m;for(g=0;g<64;g++)k[P++]=e[r+O[m]+g]}for(b=0;b<2;b++){var N=t[b==0?"t520":"t521"];if(N==null)throw new Error((b==0?"JPEGDCTables":"JPEGACTables")+" tag is missing");for(m=0;m<N.length;m++){k[P++]=255;k[P++]=o;var S=19;for(g=0;g<16;g++)S+=e[r+N[m]+g];k[P++]=S>>>8;k[P++]=S&255;k[P++]=m|b<<4;for(g=0;g<16;g++)k[P++]=e[r+N[m]+g];for(g=0;g<S;g++)k[P++]=e[r+N[m]+16+g]}}k[P++]=255;k[P++]=f;k[P++]=0;k[P++]=8+3*L;k[P++]=8;k[P++]=t.height>>>8&255;k[P++]=t.height&255;k[P++]=t.width>>>8&255;k[P++]=t.width&255;k[P++]=L;if(L==1){k[P++]=1;k[P++]=17;k[P++]=0}else for(m=0;m<3;m++){k[P++]=m+1;k[P++]=m!=0?17:(I&15)<<4|D&15;k[P++]=m}if(T!=null&&T[0]!=0){k[P++]=255;k[P++]=h;k[P++]=0;k[P++]=4;k[P++]=T[0]>>>8&255;k[P++]=T[0]&255}d=new Uint8Array(k)}var A=-1;m=0;while(m<d.length-1){if(d[m]==255&&d[m+1]==f){A=m;break}m++}if(A==-1){var B=new Uint8Array(d.length+10+3*L);B.set(d);var C=d.length;A=d.length;d=B;d[C++]=255;d[C++]=f;d[C++]=0;d[C++]=8+3*L;d[C++]=8;d[C++]=t.height>>>8&255;d[C++]=t.height&255;d[C++]=t.width>>>8&255;d[C++]=t.width&255;d[C++]=L;if(L==1){d[C++]=1;d[C++]=17;d[C++]=0}else for(m=0;m<3;m++){d[C++]=m+1;d[C++]=m!=0?17:(I&15)<<4|D&15;d[C++]=m}}if(e[c]==255&&e[c+1]==l){var R=e[c+2]<<8|e[c+3];p=new Uint8Array(R+2);p[0]=e[c];p[1]=e[c+1];p[2]=e[c+2];p[3]=e[c+3];for(m=0;m<R-2;m++)p[m+4]=e[c+m+4]}else{p=new Uint8Array(2+6+2*L);var F=0;p[F++]=255;p[F++]=l;p[F++]=0;p[F++]=6+2*L;p[F++]=L;if(L==1){p[F++]=1;p[F++]=0}else for(m=0;m<3;m++){p[F++]=m+1;p[F++]=m<<4|m}p[F++]=0;p[F++]=63;p[F++]=0}return{jpegOffset:r,tables:d,sosMarker:p,sofPosition:A}};t.decode._decodeOldJPEG=function(e,r,i,a,n,s){var o,h,f,l,u;var c=t.decode._decodeOldJPEGInit(e,r,i,a);if(c.jpegOffset!=null){h=i+a-c.jpegOffset;l=new Uint8Array(h);for(o=0;o<h;o++)l[o]=r[c.jpegOffset+o]}else{f=c.tables.length;l=new Uint8Array(f+c.sosMarker.length+a+2);l.set(c.tables);u=f;l[c.sofPosition+5]=e.height>>>8&255;l[c.sofPosition+6]=e.height&255;l[c.sofPosition+7]=e.width>>>8&255;l[c.sofPosition+8]=e.width&255;if(r[i]!=255||r[i+1]!=SOS){l.set(c.sosMarker,bufoff);bufoff+=sosMarker.length}for(o=0;o<a;o++)l[bufoff++]=r[i+o];l[bufoff++]=255;l[bufoff++]=EOI}var d=new t.JpegDecoder;d.parse(l);var p=d.getData(d.width,d.height);for(var o=0;o<p.length;o++)n[s+o]=p[o];if(e["t262"][0]==6)e["t262"][0]=2};t.decode._decodePackBits=function(t,e,r,i,a){var n=new Int8Array(t.buffer),s=new Int8Array(i.buffer),o=e+r;while(e<o){var h=n[e];e++;if(h>=0&&h<128)for(var f=0;f<h+1;f++){s[a]=n[e];a++;e++}if(h>=-127&&h<0){for(var f=0;f<-h+1;f++){s[a]=n[e];a++}e++}}};t.decode._decodeThunder=function(t,e,r,i,a){var n=[0,1,0,-1],s=[0,1,2,3,0,-3,-2,-1];var o=e+r,h=a*2,f=0;while(e<o){var l=t[e],u=l>>>6,c=l&63;e++;if(u==3){f=c&15;i[h>>>1]|=f<<4*(1-h&1);h++}if(u==0)for(var d=0;d<c;d++){i[h>>>1]|=f<<4*(1-h&1);h++}if(u==2)for(var d=0;d<2;d++){var p=c>>>3*(1-d)&7;if(p!=4){f+=s[p];i[h>>>1]|=f<<4*(1-h&1);h++}}if(u==1)for(var d=0;d<3;d++){var p=c>>>2*(2-d)&3;if(p!=2){f+=n[p];i[h>>>1]|=f<<4*(1-h&1);h++}}}};t.decode._dmap={1:0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3};t.decode._lens=function(){var t=function(t,e,r,i){for(var a=0;a<e.length;a++)t[e[a]]=r+a*i};var e="00110101,000111,0111,1000,1011,1100,1110,1111,10011,10100,00111,01000,001000,000011,110100,110101,"+"101010,101011,0100111,0001100,0001000,0010111,0000011,0000100,0101000,0101011,0010011,0100100,0011000,00000010,00000011,00011010,"+"00011011,00010010,00010011,00010100,00010101,00010110,00010111,00101000,00101001,00101010,00101011,00101100,00101101,00000100,00000101,00001010,"+"00001011,01010010,01010011,01010100,01010101,00100100,00100101,01011000,01011001,01011010,01011011,01001010,01001011,00110010,00110011,00110100";var r="0000110111,010,11,10,011,0011,0010,00011,000101,000100,0000100,0000101,0000111,00000100,00000111,000011000,"+"0000010111,0000011000,0000001000,00001100111,00001101000,00001101100,00000110111,00000101000,00000010111,00000011000,000011001010,000011001011,000011001100,000011001101,000001101000,000001101001,"+"000001101010,000001101011,000011010010,000011010011,000011010100,000011010101,000011010110,000011010111,000001101100,000001101101,000011011010,000011011011,000001010100,000001010101,000001010110,000001010111,"+"000001100100,000001100101,000001010010,000001010011,000000100100,000000110111,000000111000,000000100111,000000101000,000001011000,000001011001,000000101011,000000101100,000001011010,000001100110,000001100111";var i="11011,10010,010111,0110111,00110110,00110111,01100100,01100101,01101000,01100111,011001100,011001101,011010010,011010011,011010100,011010101,011010110,"+"011010111,011011000,011011001,011011010,011011011,010011000,010011001,010011010,011000,010011011";var a="0000001111,000011001000,000011001001,000001011011,000000110011,000000110100,000000110101,0000001101100,0000001101101,0000001001010,0000001001011,0000001001100,"+"0000001001101,0000001110010,0000001110011,0000001110100,0000001110101,0000001110110,0000001110111,0000001010010,0000001010011,0000001010100,0000001010101,0000001011010,"+"0000001011011,0000001100100,0000001100101";var n="00000001000,00000001100,00000001101,000000010010,000000010011,000000010100,000000010101,000000010110,000000010111,000000011100,000000011101,000000011110,000000011111";e=e.split(",");r=r.split(",");i=i.split(",");a=a.split(",");n=n.split(",");var s={},o={};t(s,e,0,1);t(s,i,64,64);t(s,n,1792,64);t(o,r,0,1);t(o,a,64,64);t(o,n,1792,64);return[s,o]}();t.decode._decodeG4=function(e,r,i,a,n,s,o){var h=t.decode,f=r<<3,l=0,u="";var c=[],d=[];for(var p=0;p<s;p++)d.push(0);d=h._makeDiff(d);var v=0,m=0,g=0,b=0,y=0,E=0;var M=0,w="",_=0;var x=Math.ceil(s/8)*8;while(f>>>3<r+i){b=h._findDiff(d,v+(v==0?0:1),1-E),y=h._findDiff(d,b,E);var I=0;if(o==1)I=e[f>>>3]>>>7-(f&7)&1;if(o==2)I=e[f>>>3]>>>(f&7)&1;f++;u+=I;if(w=="H"){if(h._lens[E][u]!=null){var D=h._lens[E][u];u="";l+=D;if(D<64){h._addNtimes(c,l,E);v+=l;E=1-E;l=0;_--;if(_==0)w=""}}}else{if(u=="0001"){u="";h._addNtimes(c,y-v,E);v=y}if(u=="001"){u="";w="H";_=2}if(h._dmap[u]!=null){m=b+h._dmap[u];h._addNtimes(c,m-v,E);v=m;u="";E=1-E}}if(c.length==s&&w==""){h._writeBits(c,a,n*8+M*x);E=0;M++;v=0;d=h._makeDiff(c);c=[]}}};t.decode._findDiff=function(t,e,r){for(var i=0;i<t.length;i+=2)if(t[i]>=e&&t[i+1]==r)return t[i]};t.decode._makeDiff=function(t){var e=[];if(t[0]==1)e.push(0,1);for(var r=1;r<t.length;r++)if(t[r-1]!=t[r])e.push(r,t[r]);e.push(t.length,0,t.length,1);return e};t.decode._decodeG3=function(e,r,i,a,n,s,o){var h=t.decode,f=r<<3,l=0,u="";var c=[],d=[];for(var p=0;p<s;p++)c.push(0);var v=0,m=0,g=0,b=0,y=0,E=0;var M=-1,w="",_=0,x=false;var I=Math.ceil(s/8)*8;while(f>>>3<r+i){b=h._findDiff(d,v+(v==0?0:1),1-E),y=h._findDiff(d,b,E);var D=0;if(o==1)D=e[f>>>3]>>>7-(f&7)&1;if(o==2)D=e[f>>>3]>>>(f&7)&1;f++;u+=D;if(x){if(h._lens[E][u]!=null){var L=h._lens[E][u];u="";l+=L;if(L<64){h._addNtimes(c,l,E);E=1-E;l=0}}}else{if(w=="H"){if(h._lens[E][u]!=null){var L=h._lens[E][u];u="";l+=L;if(L<64){h._addNtimes(c,l,E);v+=l;E=1-E;l=0;_--;if(_==0)w=""}}}else{if(u=="0001"){u="";h._addNtimes(c,y-v,E);v=y}if(u=="001"){u="";w="H";_=2}if(h._dmap[u]!=null){m=b+h._dmap[u];h._addNtimes(c,m-v,E);v=m;u="";E=1-E}}}if(u.endsWith("000000000001")){if(M>=0)h._writeBits(c,a,n*8+M*I);if(o==1)x=(e[f>>>3]>>>7-(f&7)&1)==1;if(o==2)x=(e[f>>>3]>>>(f&7)&1)==1;f++;if(h._decodeG3.allow2D==null)h._decodeG3.allow2D=x;if(!h._decodeG3.allow2D){x=true;f--}u="";E=0;M++;v=0;d=h._makeDiff(c);c=[]}}if(c.length==s)h._writeBits(c,a,n*8+M*I)};t.decode._addNtimes=function(t,e,r){for(var i=0;i<e;i++)t.push(r)};t.decode._writeBits=function(t,e,r){for(var i=0;i<t.length;i++)e[r+i>>>3]|=t[i]<<7-(r+i&7)};t.decode._decodeLZW=function(e,r,i,a){if(t.decode._lzwTab==null){var n=new Uint32Array(65535),s=new Uint16Array(65535),o=new Uint8Array(2e6);for(var h=0;h<256;h++){o[h<<2]=h;n[h]=h<<2;s[h]=1}t.decode._lzwTab=[n,s,o]}var f=t.decode._copyData;var l=t.decode._lzwTab[0],u=t.decode._lzwTab[1],o=t.decode._lzwTab[2],c=258,d=258<<2;var p=9,v=r<<3;var m=256,g=257;var b=0,y=0,E=0;while(true){b=e[v>>>3]<<16|e[v+8>>>3]<<8|e[v+16>>>3];y=b>>24-(v&7)-p&(1<<p)-1;v+=p;if(y==g)break;if(y==m){p=9;c=258;d=258<<2;b=e[v>>>3]<<16|e[v+8>>>3]<<8|e[v+16>>>3];y=b>>24-(v&7)-p&(1<<p)-1;v+=p;if(y==g)break;i[a]=y;a++}else if(y<c){var M=l[y],w=u[y];f(o,M,i,a,w);a+=w;if(E>=c){l[c]=d;o[l[c]]=M[0];u[c]=1;d=d+1+3&~3;c++}else{l[c]=d;var _=l[E],x=u[E];f(o,_,o,d,x);o[d+x]=o[M];x++;u[c]=x;c++;d=d+x+3&~3}if(c+1==1<<p)p++}else{if(E>=c){l[c]=d;u[c]=0;c++}else{l[c]=d;var _=l[E],x=u[E];f(o,_,o,d,x);o[d+x]=o[d];x++;u[c]=x;c++;f(o,d,i,a,x);a+=x;d=d+x+3&~3}if(c+1==1<<p)p++}E=y}};t.decode._copyData=function(t,e,r,i,a){for(var n=0;n<a;n+=4){r[i+n]=t[e+n];r[i+n+1]=t[e+n+1];r[i+n+2]=t[e+n+2];r[i+n+3]=t[e+n+3]}};t.tags={254:"NewSubfileType",255:"SubfileType",256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",266:"FillOrder",269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffset",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",285:"PageName",286:"XPosition",287:"YPosition",292:"T4Options",296:"ResolutionUnit",297:"PageNumber",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:"WhitePoint",319:"PrimaryChromaticities",320:"ColorMap",321:"HalftoneHints",322:"TileWidth",323:"TileLength",324:"TileOffset",325:"TileByteCounts",330:"SubIFDs",336:"DotRange",338:"ExtraSample",339:"SampleFormat",347:"JPEGTables",512:"JPEGProc",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",519:"JPEGQTables",520:"JPEGDCTables",521:"JPEGACTables",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite",700:"XMP",33421:"CFARepeatPatternDim",33422:"CFAPattern",33432:"Copyright",33434:"ExposureTime",33437:"FNumber",33723:"IPTC/NAA",34377:"Photoshop",34665:"ExifIFD",34675:"ICC Profile",34850:"ExposureProgram",34853:"GPSInfo",34855:"ISOSpeedRatings",34858:"TimeZoneOffset",34859:"SelfTimeMode",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37377:"ShutterSpeedValue",37378:"ApertureValue",37380:"ExposureBiasValue",37383:"MeteringMode",37385:"Flash",37386:"FocalLength",37390:"FocalPlaneXResolution",37391:"FocalPlaneYResolution",37392:"FocalPlaneResolutionUnit",37393:"ImageNumber",37398:"TIFF/EPStandardID",37399:"SensingMethod",37500:"MakerNote",37510:"UserComment",37724:"ImageSourceData",40092:"XPComment",40094:"XPKeywords",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelXDimension",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",50706:"DNGVersion",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50710:"CFAPlaneColor",50711:"CFALayout",50712:"LinearizationTable",50713:"BlackLevelRepeatDim",50714:"BlackLevel",50716:"BlackLevelDeltaV",50717:"WhiteLevel",50718:"DefaultScale",50719:"DefaultCropOrigin",50720:"DefaultCropSize",50733:"BayerGreenSplit",50738:"AntiAliasStrength",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50727:"AnalogBalance",50728:"AsShotNeutral",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"LensInfo",50739:"ShadowScale",50740:"DNGPrivateData",50741:"MakerNoteSafety",50778:"CalibrationIlluminant1",50779:"CalibrationIlluminant2",50780:"BestQualityScale",50781:"RawDataUniqueID",50827:"OriginalRawFileName",50829:"ActiveArea",50830:"MaskedAreas",50931:"CameraCalibrationSignature",50932:"ProfileCalibrationSignature",50935:"NoiseReductionApplied",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:"ProfileEmbedPolicy",50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50969:"PreviewSettingsDigest",50970:"PreviewColorSpace",50971:"PreviewDateTime",50972:"RawImageDigest",51008:"OpcodeList1",51009:"OpcodeList2",51022:"OpcodeList3",51041:"NoiseProfile",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualityFinalSize",51091:"OriginalDefaultCropSize",51125:"DefaultUserCrop"};t.ttypes={256:3,257:3,258:3,259:3,262:3,273:4,274:3,277:3,278:4,279:4,282:5,283:5,284:3,286:5,287:5,296:3,305:2,306:2,338:3,513:4,514:4,34665:4};t._readIFD=function(e,r,i,a){var n=e.readUshort(r,i);i+=2;var s={};a.push(s);for(var o=0;o<n;o++){var h=e.readUshort(r,i);i+=2;var f=e.readUshort(r,i);i+=2;var l=e.readUint(r,i);i+=4;var u=e.readUint(r,i);i+=4;var c=[];s["t"+h]=c;if(f==1||f==7){for(var d=0;d<l;d++)c.push(r[(l<5?i-4:u)+d])}if(f==2){c.push(e.readASCII(r,l<5?i-4:u,l-1))}if(f==3){for(var d=0;d<l;d++)c.push(e.readUshort(r,(l<3?i-4:u)+2*d))}if(f==4){for(var d=0;d<l;d++)c.push(e.readUint(r,(l<2?i-4:u)+4*d))}if(f==5){for(var d=0;d<l;d++)c.push(e.readUint(r,u+d*8)/e.readUint(r,u+d*8+4))}if(f==8){for(var d=0;d<l;d++)c.push(e.readShort(r,(l<3?i-4:u)+2*d))}if(f==9){for(var d=0;d<l;d++)c.push(e.readInt(r,(l<2?i-4:u)+4*d))}if(f==10){for(var d=0;d<l;d++)c.push(e.readInt(r,u+d*8)/e.readInt(r,u+d*8+4))}if(f==11){for(var d=0;d<l;d++)c.push(e.readFloat(r,u+d*4))}if(f==12){for(var d=0;d<l;d++)c.push(e.readDouble(r,u+d*8))}if(l!=0&&c.length==0)log("unknown TIFF tag type: ",f,"num:",l);if(h==330)for(var d=0;d<l;d++)t._readIFD(e,r,c[d],a)}return i};t._writeIFD=function(e,r,i,a){var n=Object.keys(a);e.writeUshort(r,i,n.length);i+=2;var s=i+n.length*12+4;for(var o=0;o<n.length;o++){var h=n[o];var f=parseInt(h.slice(1)),l=t.ttypes[f];if(l==null)throw new Error("unknown type of tag: "+f);var u=a[h];if(l==2)u=u[0]+"\0";var c=u.length;e.writeUshort(r,i,f);i+=2;e.writeUshort(r,i,l);i+=2;e.writeUint(r,i,c);i+=4;var d=[-1,1,1,2,4,8,0,0,0,0,0,0,8][l]*c;var p=i;if(d>4){e.writeUint(r,i,s);p=s}if(l==2){e.writeASCII(r,p,u)}if(l==3){for(var v=0;v<c;v++)e.writeUshort(r,p+2*v,u[v])}if(l==4){for(var v=0;v<c;v++)e.writeUint(r,p+4*v,u[v])}if(l==5){for(var v=0;v<c;v++){e.writeUint(r,p+8*v,Math.round(u[v]*1e4));e.writeUint(r,p+8*v+4,1e4)}}if(l==12){for(var v=0;v<c;v++)e.writeDouble(r,p+8*v,u[v])}if(d>4){d+=d&1;s+=d}i+=4}return[i,s]};t.toRGBA8=function(t){var e=t.width,r=t.height,i=e*r,a=i*4,n=t.data;var s=new Uint8Array(i*4);var o=t["t262"][0],h=t["t258"]?Math.min(32,t["t258"][0]):1,f=t.isLE?1:0;if(false){}else if(o==0){var l=Math.ceil(h*e/8);for(var u=0;u<r;u++){var c=u*l,d=u*e;if(h==1)for(var p=0;p<e;p++){var v=d+p<<2,m=n[c+(p>>3)]>>7-(p&7)&1;s[v]=s[v+1]=s[v+2]=(1-m)*255;s[v+3]=255}if(h==4)for(var p=0;p<e;p++){var v=d+p<<2,m=n[c+(p>>1)]>>4-4*(p&1)&15;s[v]=s[v+1]=s[v+2]=(15-m)*17;s[v+3]=255}if(h==8)for(var p=0;p<e;p++){var v=d+p<<2,m=n[c+p];s[v]=s[v+1]=s[v+2]=255-m;s[v+3]=255}}}else if(o==1){var l=Math.ceil(h*e/8);for(var u=0;u<r;u++){var c=u*l,d=u*e;if(h==1)for(var p=0;p<e;p++){var v=d+p<<2,m=n[c+(p>>3)]>>7-(p&7)&1;s[v]=s[v+1]=s[v+2]=m*255;s[v+3]=255}if(h==2)for(var p=0;p<e;p++){var v=d+p<<2,m=n[c+(p>>2)]>>6-2*(p&3)&3;s[v]=s[v+1]=s[v+2]=m*85;s[v+3]=255}if(h==8)for(var p=0;p<e;p++){var v=d+p<<2,m=n[c+p];s[v]=s[v+1]=s[v+2]=m;s[v+3]=255}if(h==16)for(var p=0;p<e;p++){var v=d+p<<2,m=n[c+(2*p+f)];s[v]=s[v+1]=s[v+2]=Math.min(255,m);s[v+3]=255}}}else if(o==2){if(h==8){if(t["t338"]){if(t["t338"][0]>0)for(var p=0;p<a;p++)s[p]=n[p];else for(var p=0;p<a;p+=4){s[p]=n[p];s[p+1]=n[p+1];s[p+2]=n[p+2];s[p+3]=255}}else{var g=t["t258"]?t["t258"].length:3;if(g==4)for(var p=0;p<a;p++)s[p]=n[p];if(g==3)for(var p=0;p<i;p++){var v=p<<2,b=p*3;s[v]=n[b];s[v+1]=n[b+1];s[v+2]=n[b+2];s[v+3]=255}}}else for(var p=0;p<i;p++){var v=p<<2,b=p*6;s[v]=n[b];s[v+1]=n[b+2];s[v+2]=n[b+4];s[v+3]=255}}else if(o==3){var y=t["t320"];for(var p=0;p<i;p++){var v=p<<2,E=n[p];s[v]=y[E]>>8;s[v+1]=y[256+E]>>8;s[v+2]=y[512+E]>>8;s[v+3]=255}}else if(o==5){var g=t["t258"]?t["t258"].length:4;var M=g>4?1:0;for(var p=0;p<i;p++){var v=p<<2,w=p*g;var _=255-n[w],x=255-n[w+1],I=255-n[w+2],D=(255-n[w+3])*(1/255);s[v]=~~(_*D+.5);s[v+1]=~~(x*D+.5);s[v+2]=~~(I*D+.5);s[v+3]=255*(1-M)+n[w+4]*M}}else log("Unknown Photometric interpretation: "+o);return s};t.replaceIMG=function(){var e=document.getElementsByTagName("img");for(var r=0;r<e.length;r++){var i=e[r],a=i.getAttribute("src");if(a==null)continue;var n=a.split(".").pop().toLowerCase();if(n!="tif"&&n!="tiff")continue;var s=new XMLHttpRequest;t._xhrs.push(s);t._imgs.push(i);s.open("GET",a);s.responseType="arraybuffer";s.onload=t._imgLoaded;s.send()}};t._xhrs=[];t._imgs=[];t._imgLoaded=function(e){var r=e.target.response;var i=t.decode(r),a=i[0];t.decodeImages(r,i);var n=t.toRGBA8(a),s=a.width,o=a.height;var h=t._xhrs.indexOf(e.target),f=t._imgs[h];t._xhrs.splice(h,1);t._imgs.splice(h,1);var l=document.createElement("canvas");l.width=s;l.height=o;var u=l.getContext("2d"),c=u.createImageData(s,o);for(var d=0;d<n.length;d++)c.data[d]=n[d];u.putImageData(c,0,0);var p=["style","class","id"];for(var d=0;d<p.length;d++)l.setAttribute(p[d],f.getAttribute(p[d]));f.parentNode.replaceChild(l,f)};t._binBE={nextZero:function(t,e){while(t[e]!=0)e++;return e},readUshort:function(t,e){return t[e]<<8|t[e+1]},readShort:function(e,r){var i=t._binBE.ui8;i[0]=e[r+1];i[1]=e[r+0];return t._binBE.i16[0]},readInt:function(e,r){var i=t._binBE.ui8;i[0]=e[r+3];i[1]=e[r+2];i[2]=e[r+1];i[3]=e[r+0];return t._binBE.i32[0]},readUint:function(e,r){var i=t._binBE.ui8;i[0]=e[r+3];i[1]=e[r+2];i[2]=e[r+1];i[3]=e[r+0];return t._binBE.ui32[0]},readASCII:function(t,e,r){var i="";for(var a=0;a<r;a++)i+=String.fromCharCode(t[e+a]);return i},readFloat:function(e,r){var i=t._binBE.ui8;for(var a=0;a<4;a++)i[a]=e[r+3-a];return t._binBE.fl32[0]},readDouble:function(e,r){var i=t._binBE.ui8;for(var a=0;a<8;a++)i[a]=e[r+7-a];return t._binBE.fl64[0]},writeUshort:function(t,e,r){t[e]=r>>8&255;t[e+1]=r&255},writeUint:function(t,e,r){t[e]=r>>24&255;t[e+1]=r>>16&255;t[e+2]=r>>8&255;t[e+3]=r>>0&255},writeASCII:function(t,e,r){for(var i=0;i<r.length;i++)t[e+i]=r.charCodeAt(i)},writeDouble:function(e,r,i){t._binBE.fl64[0]=i;for(var a=0;a<8;a++)e[r+a]=t._binBE.ui8[7-a]}};t._binBE.ui8=new Uint8Array(8);t._binBE.i16=new Int16Array(t._binBE.ui8.buffer);t._binBE.i32=new Int32Array(t._binBE.ui8.buffer);t._binBE.ui32=new Uint32Array(t._binBE.ui8.buffer);t._binBE.fl32=new Float32Array(t._binBE.ui8.buffer);t._binBE.fl64=new Float64Array(t._binBE.ui8.buffer);t._binLE={nextZero:t._binBE.nextZero,readUshort:function(t,e){return t[e+1]<<8|t[e]},readShort:function(e,r){var i=t._binBE.ui8;i[0]=e[r+0];i[1]=e[r+1];return t._binBE.i16[0]},readInt:function(e,r){var i=t._binBE.ui8;i[0]=e[r+0];i[1]=e[r+1];i[2]=e[r+2];i[3]=e[r+3];return t._binBE.i32[0]},readUint:function(e,r){var i=t._binBE.ui8;i[0]=e[r+0];i[1]=e[r+1];i[2]=e[r+2];i[3]=e[r+3];return t._binBE.ui32[0]},readASCII:t._binBE.readASCII,readFloat:function(e,r){var i=t._binBE.ui8;for(var a=0;a<4;a++)i[a]=e[r+a];return t._binBE.fl32[0]},readDouble:function(e,r){var i=t._binBE.ui8;for(var a=0;a<8;a++)i[a]=e[r+a];return t._binBE.fl64[0]}};t._copyTile=function(t,e,r,i,a,n,s,o){var h=Math.min(e,a-s);var f=Math.min(r,n-o);for(var l=0;l<f;l++){var u=(o+l)*a+s;var c=l*e;for(var d=0;d<h;d++)i[u+d]=t[c+d]}}})(e,i)})()},140:function(t,e,r){"use strict";var i=r(594);function filterNone(t,e,r,i,a){for(var n=0;n<r;n++){i[a+n]=t[e+n]}}function filterSumNone(t,e,r){var i=0;var a=e+r;for(var n=e;n<a;n++){i+=Math.abs(t[n])}return i}function filterSub(t,e,r,i,a,n){for(var s=0;s<r;s++){var o=s>=n?t[e+s-n]:0;var h=t[e+s]-o;i[a+s]=h}}function filterSumSub(t,e,r,i){var a=0;for(var n=0;n<r;n++){var s=n>=i?t[e+n-i]:0;var o=t[e+n]-s;a+=Math.abs(o)}return a}function filterUp(t,e,r,i,a){for(var n=0;n<r;n++){var s=e>0?t[e+n-r]:0;var o=t[e+n]-s;i[a+n]=o}}function filterSumUp(t,e,r){var i=0;var a=e+r;for(var n=e;n<a;n++){var s=e>0?t[n-r]:0;var o=t[n]-s;i+=Math.abs(o)}return i}function filterAvg(t,e,r,i,a,n){for(var s=0;s<r;s++){var o=s>=n?t[e+s-n]:0;var h=e>0?t[e+s-r]:0;var f=t[e+s]-(o+h>>1);i[a+s]=f}}function filterSumAvg(t,e,r,i){var a=0;for(var n=0;n<r;n++){var s=n>=i?t[e+n-i]:0;var o=e>0?t[e+n-r]:0;var h=t[e+n]-(s+o>>1);a+=Math.abs(h)}return a}function filterPaeth(t,e,r,a,n,s){for(var o=0;o<r;o++){var h=o>=s?t[e+o-s]:0;var f=e>0?t[e+o-r]:0;var l=e>0&&o>=s?t[e+o-(r+s)]:0;var u=t[e+o]-i(h,f,l);a[n+o]=u}}function filterSumPaeth(t,e,r,a){var n=0;for(var s=0;s<r;s++){var o=s>=a?t[e+s-a]:0;var h=e>0?t[e+s-r]:0;var f=e>0&&s>=a?t[e+s-(r+a)]:0;var l=t[e+s]-i(o,h,f);n+=Math.abs(l)}return n}var a={0:filterNone,1:filterSub,2:filterUp,3:filterAvg,4:filterPaeth};var n={0:filterSumNone,1:filterSumSub,2:filterSumUp,3:filterSumAvg,4:filterSumPaeth};t.exports=function(t,e,r,i,s){var o;if(!("filterType"in i)||i.filterType===-1){o=[0,1,2,3,4]}else if(typeof i.filterType==="number"){o=[i.filterType]}else{throw new Error("unrecognised filter types")}if(i.bitDepth===16){s*=2}var h=e*s;var f=0;var l=0;var u=new JIMPBUffer((h+1)*r);var c=o[0];for(var d=0;d<r;d++){if(o.length>1){var p=Infinity;for(var v=0;v<o.length;v++){var m=n[o[v]](t,l,h,s);if(m<p){c=o[v];p=m}}}u[f]=c;f++;a[c](t,l,h,u,f,s);f+=h;l+=h}return u}},141:function(t){"use strict";function adler32(t,e,r,i){var a=t&65535|0,n=t>>>16&65535|0,s=0;while(r!==0){s=r>2e3?2e3:r;r-=s;do{a=a+e[i++]|0;n=n+a|0}while(--s);a%=65521;n%=65521}return a|n<<16|0}t.exports=adler32},148:function(t,e,r){t.exports=r(565)},164:function(t){(function(e){var r=/^\s+/,i=/\s+$/,a=0,n=e.round,s=e.min,o=e.max,h=e.random;function tinycolor(t,e){t=t?t:"";e=e||{};if(t instanceof tinycolor){return t}if(!(this instanceof tinycolor)){return new tinycolor(t,e)}var r=inputToRGB(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=n(100*this._a)/100,this._format=e.format||r.format;this._gradientType=e.gradientType;if(this._r<1){this._r=n(this._r)}if(this._g<1){this._g=n(this._g)}if(this._b<1){this._b=n(this._b)}this._ok=r.ok;this._tc_id=a++}tinycolor.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb();var r,i,a,n,s,o;r=t.r/255;i=t.g/255;a=t.b/255;if(r<=.03928){n=r/12.92}else{n=e.pow((r+.055)/1.055,2.4)}if(i<=.03928){s=i/12.92}else{s=e.pow((i+.055)/1.055,2.4)}if(a<=.03928){o=a/12.92}else{o=e.pow((a+.055)/1.055,2.4)}return.2126*n+.7152*s+.0722*o},setAlpha:function(t){this._a=boundAlpha(t);this._roundA=n(100*this._a)/100;return this},toHsv:function(){var t=rgbToHsv(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=rgbToHsv(this._r,this._g,this._b);var e=n(t.h*360),r=n(t.s*100),i=n(t.v*100);return this._a==1?"hsv("+e+", "+r+"%, "+i+"%)":"hsva("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=rgbToHsl(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=rgbToHsl(this._r,this._g,this._b);var e=n(t.h*360),r=n(t.s*100),i=n(t.l*100);return this._a==1?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return rgbToHex(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return rgbaToHex(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:n(this._r),g:n(this._g),b:n(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+n(this._r)+", "+n(this._g)+", "+n(this._b)+")":"rgba("+n(this._r)+", "+n(this._g)+", "+n(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:n(bound01(this._r,255)*100)+"%",g:n(bound01(this._g,255)*100)+"%",b:n(bound01(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+n(bound01(this._r,255)*100)+"%, "+n(bound01(this._g,255)*100)+"%, "+n(bound01(this._b,255)*100)+"%)":"rgba("+n(bound01(this._r,255)*100)+"%, "+n(bound01(this._g,255)*100)+"%, "+n(bound01(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){if(this._a===0){return"transparent"}if(this._a<1){return false}return l[rgbToHex(this._r,this._g,this._b,true)]||false},toFilter:function(t){var e="#"+rgbaToArgbHex(this._r,this._g,this._b,this._a);var r=e;var i=this._gradientType?"GradientType = 1, ":"";if(t){var a=tinycolor(t);r="#"+rgbaToArgbHex(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=false;var i=this._a<1&&this._a>=0;var a=!e&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");if(a){if(t==="name"&&this._a===0){return this.toName()}return this.toRgbString()}if(t==="rgb"){r=this.toRgbString()}if(t==="prgb"){r=this.toPercentageRgbString()}if(t==="hex"||t==="hex6"){r=this.toHexString()}if(t==="hex3"){r=this.toHexString(true)}if(t==="hex4"){r=this.toHex8String(true)}if(t==="hex8"){r=this.toHex8String()}if(t==="name"){r=this.toName()}if(t==="hsl"){r=this.toHslString()}if(t==="hsv"){r=this.toHsvString()}return r||this.toHexString()},clone:function(){return tinycolor(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));this._r=r._r;this._g=r._g;this._b=r._b;this.setAlpha(r._a);return this},lighten:function(){return this._applyModification(lighten,arguments)},brighten:function(){return this._applyModification(brighten,arguments)},darken:function(){return this._applyModification(darken,arguments)},desaturate:function(){return this._applyModification(desaturate,arguments)},saturate:function(){return this._applyModification(saturate,arguments)},greyscale:function(){return this._applyModification(greyscale,arguments)},spin:function(){return this._applyModification(spin,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(analogous,arguments)},complement:function(){return this._applyCombination(complement,arguments)},monochromatic:function(){return this._applyCombination(monochromatic,arguments)},splitcomplement:function(){return this._applyCombination(splitcomplement,arguments)},triad:function(){return this._applyCombination(triad,arguments)},tetrad:function(){return this._applyCombination(tetrad,arguments)}};tinycolor.fromRatio=function(t,e){if(typeof t=="object"){var r={};for(var i in t){if(t.hasOwnProperty(i)){if(i==="a"){r[i]=t[i]}else{r[i]=convertToPercentage(t[i])}}}t=r}return tinycolor(t,e)};function inputToRGB(t){var e={r:0,g:0,b:0};var r=1;var i=null;var a=null;var n=null;var h=false;var f=false;if(typeof t=="string"){t=stringInputToObject(t)}if(typeof t=="object"){if(isValidCSSUnit(t.r)&&isValidCSSUnit(t.g)&&isValidCSSUnit(t.b)){e=rgbToRgb(t.r,t.g,t.b);h=true;f=String(t.r).substr(-1)==="%"?"prgb":"rgb"}else if(isValidCSSUnit(t.h)&&isValidCSSUnit(t.s)&&isValidCSSUnit(t.v)){i=convertToPercentage(t.s);a=convertToPercentage(t.v);e=hsvToRgb(t.h,i,a);h=true;f="hsv"}else if(isValidCSSUnit(t.h)&&isValidCSSUnit(t.s)&&isValidCSSUnit(t.l)){i=convertToPercentage(t.s);n=convertToPercentage(t.l);e=hslToRgb(t.h,i,n);h=true;f="hsl"}if(t.hasOwnProperty("a")){r=t.a}}r=boundAlpha(r);return{ok:h,format:t.format||f,r:s(255,o(e.r,0)),g:s(255,o(e.g,0)),b:s(255,o(e.b,0)),a:r}}function rgbToRgb(t,e,r){return{r:bound01(t,255)*255,g:bound01(e,255)*255,b:bound01(r,255)*255}}function rgbToHsl(t,e,r){t=bound01(t,255);e=bound01(e,255);r=bound01(r,255);var i=o(t,e,r),a=s(t,e,r);var n,h,f=(i+a)/2;if(i==a){n=h=0}else{var l=i-a;h=f>.5?l/(2-i-a):l/(i+a);switch(i){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4;break}n/=6}return{h:n,s:h,l:f}}function hslToRgb(t,e,r){var i,a,n;t=bound01(t,360);e=bound01(e,100);r=bound01(r,100);function hue2rgb(t,e,r){if(r<0)r+=1;if(r>1)r-=1;if(r<1/6)return t+(e-t)*6*r;if(r<1/2)return e;if(r<2/3)return t+(e-t)*(2/3-r)*6;return t}if(e===0){i=a=n=r}else{var s=r<.5?r*(1+e):r+e-r*e;var o=2*r-s;i=hue2rgb(o,s,t+1/3);a=hue2rgb(o,s,t);n=hue2rgb(o,s,t-1/3)}return{r:i*255,g:a*255,b:n*255}}function rgbToHsv(t,e,r){t=bound01(t,255);e=bound01(e,255);r=bound01(r,255);var i=o(t,e,r),a=s(t,e,r);var n,h,f=i;var l=i-a;h=i===0?0:l/i;if(i==a){n=0}else{switch(i){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4;break}n/=6}return{h:n,s:h,v:f}}function hsvToRgb(t,r,i){t=bound01(t,360)*6;r=bound01(r,100);i=bound01(i,100);var a=e.floor(t),n=t-a,s=i*(1-r),o=i*(1-n*r),h=i*(1-(1-n)*r),f=a%6,l=[i,o,s,s,h,i][f],u=[h,i,i,o,s,s][f],c=[s,s,h,i,i,o][f];return{r:l*255,g:u*255,b:c*255}}function rgbToHex(t,e,r,i){var a=[pad2(n(t).toString(16)),pad2(n(e).toString(16)),pad2(n(r).toString(16))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)){return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)}return a.join("")}function rgbaToHex(t,e,r,i,a){var s=[pad2(n(t).toString(16)),pad2(n(e).toString(16)),pad2(n(r).toString(16)),pad2(convertDecimalToHex(i))];if(a&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)){return s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0)}return s.join("")}function rgbaToArgbHex(t,e,r,i){var a=[pad2(convertDecimalToHex(i)),pad2(n(t).toString(16)),pad2(n(e).toString(16)),pad2(n(r).toString(16))];return a.join("")}tinycolor.equals=function(t,e){if(!t||!e){return false}return tinycolor(t).toRgbString()==tinycolor(e).toRgbString()};tinycolor.random=function(){return tinycolor.fromRatio({r:h(),g:h(),b:h()})};function desaturate(t,e){e=e===0?0:e||10;var r=tinycolor(t).toHsl();r.s-=e/100;r.s=clamp01(r.s);return tinycolor(r)}function saturate(t,e){e=e===0?0:e||10;var r=tinycolor(t).toHsl();r.s+=e/100;r.s=clamp01(r.s);return tinycolor(r)}function greyscale(t){return tinycolor(t).desaturate(100)}function lighten(t,e){e=e===0?0:e||10;var r=tinycolor(t).toHsl();r.l+=e/100;r.l=clamp01(r.l);return tinycolor(r)}function brighten(t,e){e=e===0?0:e||10;var r=tinycolor(t).toRgb();r.r=o(0,s(255,r.r-n(255*-(e/100))));r.g=o(0,s(255,r.g-n(255*-(e/100))));r.b=o(0,s(255,r.b-n(255*-(e/100))));return tinycolor(r)}function darken(t,e){e=e===0?0:e||10;var r=tinycolor(t).toHsl();r.l-=e/100;r.l=clamp01(r.l);return tinycolor(r)}function spin(t,e){var r=tinycolor(t).toHsl();var i=(r.h+e)%360;r.h=i<0?360+i:i;return tinycolor(r)}function complement(t){var e=tinycolor(t).toHsl();e.h=(e.h+180)%360;return tinycolor(e)}function triad(t){var e=tinycolor(t).toHsl();var r=e.h;return[tinycolor(t),tinycolor({h:(r+120)%360,s:e.s,l:e.l}),tinycolor({h:(r+240)%360,s:e.s,l:e.l})]}function tetrad(t){var e=tinycolor(t).toHsl();var r=e.h;return[tinycolor(t),tinycolor({h:(r+90)%360,s:e.s,l:e.l}),tinycolor({h:(r+180)%360,s:e.s,l:e.l}),tinycolor({h:(r+270)%360,s:e.s,l:e.l})]}function splitcomplement(t){var e=tinycolor(t).toHsl();var r=e.h;return[tinycolor(t),tinycolor({h:(r+72)%360,s:e.s,l:e.l}),tinycolor({h:(r+216)%360,s:e.s,l:e.l})]}function analogous(t,e,r){e=e||6;r=r||30;var i=tinycolor(t).toHsl();var a=360/r;var n=[tinycolor(t)];for(i.h=(i.h-(a*e>>1)+720)%360;--e;){i.h=(i.h+a)%360;n.push(tinycolor(i))}return n}function monochromatic(t,e){e=e||6;var r=tinycolor(t).toHsv();var i=r.h,a=r.s,n=r.v;var s=[];var o=1/e;while(e--){s.push(tinycolor({h:i,s:a,v:n}));n=(n+o)%1}return s}tinycolor.mix=function(t,e,r){r=r===0?0:r||50;var i=tinycolor(t).toRgb();var a=tinycolor(e).toRgb();var n=r/100;var s={r:(a.r-i.r)*n+i.r,g:(a.g-i.g)*n+i.g,b:(a.b-i.b)*n+i.b,a:(a.a-i.a)*n+i.a};return tinycolor(s)};tinycolor.readability=function(t,r){var i=tinycolor(t);var a=tinycolor(r);return(e.max(i.getLuminance(),a.getLuminance())+.05)/(e.min(i.getLuminance(),a.getLuminance())+.05)};tinycolor.isReadable=function(t,e,r){var i=tinycolor.readability(t,e);var a,n;n=false;a=validateWCAG2Parms(r);switch(a.level+a.size){case"AAsmall":case"AAAlarge":n=i>=4.5;break;case"AAlarge":n=i>=3;break;case"AAAsmall":n=i>=7;break}return n};tinycolor.mostReadable=function(t,e,r){var i=null;var a=0;var n;var s,o,h;r=r||{};s=r.includeFallbackColors;o=r.level;h=r.size;for(var f=0;f<e.length;f++){n=tinycolor.readability(t,e[f]);if(n>a){a=n;i=tinycolor(e[f])}}if(tinycolor.isReadable(t,i,{level:o,size:h})||!s){return i}else{r.includeFallbackColors=false;return tinycolor.mostReadable(t,["#fff","#000"],r)}};var f=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var l=tinycolor.hexNames=flip(f);function flip(t){var e={};for(var r in t){if(t.hasOwnProperty(r)){e[t[r]]=r}}return e}function boundAlpha(t){t=parseFloat(t);if(isNaN(t)||t<0||t>1){t=1}return t}function bound01(t,r){if(isOnePointZero(t)){t="100%"}var i=isPercentage(t);t=s(r,o(0,parseFloat(t)));if(i){t=parseInt(t*r,10)/100}if(e.abs(t-r)<1e-6){return 1}return t%r/parseFloat(r)}function clamp01(t){return s(1,o(0,t))}function parseIntFromHex(t){return parseInt(t,16)}function isOnePointZero(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function isPercentage(t){return typeof t==="string"&&t.indexOf("%")!=-1}function pad2(t){return t.length==1?"0"+t:""+t}function convertToPercentage(t){if(t<=1){t=t*100+"%"}return t}function convertDecimalToHex(t){return e.round(parseFloat(t)*255).toString(16)}function convertHexToDecimal(t){return parseIntFromHex(t)/255}var u=function(){var t="[-\\+]?\\d+%?";var e="[-\\+]?\\d*\\.\\d+%?";var r="(?:"+e+")|(?:"+t+")";var i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";var a="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function isValidCSSUnit(t){return!!u.CSS_UNIT.exec(t)}function stringInputToObject(t){t=t.replace(r,"").replace(i,"").toLowerCase();var e=false;if(f[t]){t=f[t];e=true}else if(t=="transparent"){return{r:0,g:0,b:0,a:0,format:"name"}}var a;if(a=u.rgb.exec(t)){return{r:a[1],g:a[2],b:a[3]}}if(a=u.rgba.exec(t)){return{r:a[1],g:a[2],b:a[3],a:a[4]}}if(a=u.hsl.exec(t)){return{h:a[1],s:a[2],l:a[3]}}if(a=u.hsla.exec(t)){return{h:a[1],s:a[2],l:a[3],a:a[4]}}if(a=u.hsv.exec(t)){return{h:a[1],s:a[2],v:a[3]}}if(a=u.hsva.exec(t)){return{h:a[1],s:a[2],v:a[3],a:a[4]}}if(a=u.hex8.exec(t)){return{r:parseIntFromHex(a[1]),g:parseIntFromHex(a[2]),b:parseIntFromHex(a[3]),a:convertHexToDecimal(a[4]),format:e?"name":"hex8"}}if(a=u.hex6.exec(t)){return{r:parseIntFromHex(a[1]),g:parseIntFromHex(a[2]),b:parseIntFromHex(a[3]),format:e?"name":"hex"}}if(a=u.hex4.exec(t)){return{r:parseIntFromHex(a[1]+""+a[1]),g:parseIntFromHex(a[2]+""+a[2]),b:parseIntFromHex(a[3]+""+a[3]),a:convertHexToDecimal(a[4]+""+a[4]),format:e?"name":"hex8"}}if(a=u.hex3.exec(t)){return{r:parseIntFromHex(a[1]+""+a[1]),g:parseIntFromHex(a[2]+""+a[2]),b:parseIntFromHex(a[3]+""+a[3]),format:e?"name":"hex"}}return false}function validateWCAG2Parms(t){var e,r;t=t||{level:"AA",size:"small"};e=(t.level||"AA").toUpperCase();r=(t.size||"small").toLowerCase();if(e!=="AA"&&e!=="AAA"){e="AA"}if(r!=="small"&&r!=="large"){r="small"}return{level:e,size:r}}if(true&&t.exports){t.exports=tinycolor}else if(typeof define==="function"&&define.amd){define(function(){return tinycolor})}else{window.tinycolor=tinycolor}})(Math)},170:function(t,e,r){var i=r(622);var a=r(747);function Mime(){this.types=Object.create(null);this.extensions=Object.create(null)}Mime.prototype.define=function(t){for(var e in t){var r=t[e];for(var i=0;i<r.length;i++){if(process.env.DEBUG_MIME&&this.types[r[i]]){console.warn((this._loading||"define()").replace(/.*\//,""),'changes "'+r[i]+'" extension type from '+this.types[r[i]]+" to "+e)}this.types[r[i]]=e}if(!this.extensions[e]){this.extensions[e]=r[0]}}};Mime.prototype.load=function(t){this._loading=t;var e={},r=a.readFileSync(t,"ascii"),i=r.split(/[\r\n]+/);i.forEach(function(t){var r=t.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);e[r.shift()]=r});this.define(e);this._loading=null};Mime.prototype.lookup=function(t,e){var r=t.replace(/^.*[\.\/\\]/,"").toLowerCase();return this.types[r]||e||this.default_type};Mime.prototype.extension=function(t){var e=t.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[e]};var n=new Mime;n.define(r(467));n.default_type=n.lookup("bin");n.Mime=Mime;n.charsets={lookup:function(t,e){return/^text\/|^application\/(javascript|json)/.test(t)?"UTF-8":e}};t.exports=n},181:function(t){"use strict";var e=30;var r=12;t.exports=function inflate_fast(t,i){var a;var n;var s;var o;var h;var f;var l;var u;var c;var d;var p;var v;var m;var g;var b;var y;var E;var M;var w;var _;var x;var I;var D;var L,T;a=t.state;n=t.next_in;L=t.input;s=n+(t.avail_in-5);o=t.next_out;T=t.output;h=o-(i-t.avail_out);f=o+(t.avail_out-257);l=a.dmax;u=a.wsize;c=a.whave;d=a.wnext;p=a.window;v=a.hold;m=a.bits;g=a.lencode;b=a.distcode;y=(1<<a.lenbits)-1;E=(1<<a.distbits)-1;t:do{if(m<15){v+=L[n++]<<m;m+=8;v+=L[n++]<<m;m+=8}M=g[v&y];e:for(;;){w=M>>>24;v>>>=w;m-=w;w=M>>>16&255;if(w===0){T[o++]=M&65535}else if(w&16){_=M&65535;w&=15;if(w){if(m<w){v+=L[n++]<<m;m+=8}_+=v&(1<<w)-1;v>>>=w;m-=w}if(m<15){v+=L[n++]<<m;m+=8;v+=L[n++]<<m;m+=8}M=b[v&E];r:for(;;){w=M>>>24;v>>>=w;m-=w;w=M>>>16&255;if(w&16){x=M&65535;w&=15;if(m<w){v+=L[n++]<<m;m+=8;if(m<w){v+=L[n++]<<m;m+=8}}x+=v&(1<<w)-1;if(x>l){t.msg="invalid distance too far back";a.mode=e;break t}v>>>=w;m-=w;w=o-h;if(x>w){w=x-w;if(w>c){if(a.sane){t.msg="invalid distance too far back";a.mode=e;break t}}I=0;D=p;if(d===0){I+=u-w;if(w<_){_-=w;do{T[o++]=p[I++]}while(--w);I=o-x;D=T}}else if(d<w){I+=u+d-w;w-=d;if(w<_){_-=w;do{T[o++]=p[I++]}while(--w);I=0;if(d<_){w=d;_-=w;do{T[o++]=p[I++]}while(--w);I=o-x;D=T}}}else{I+=d-w;if(w<_){_-=w;do{T[o++]=p[I++]}while(--w);I=o-x;D=T}}while(_>2){T[o++]=D[I++];T[o++]=D[I++];T[o++]=D[I++];_-=3}if(_){T[o++]=D[I++];if(_>1){T[o++]=D[I++]}}}else{I=o-x;do{T[o++]=T[I++];T[o++]=T[I++];T[o++]=T[I++];_-=3}while(_>2);if(_){T[o++]=T[I++];if(_>1){T[o++]=T[I++]}}}}else if((w&64)===0){M=b[(M&65535)+(v&(1<<w)-1)];continue r}else{t.msg="invalid distance code";a.mode=e;break t}break}}else if((w&64)===0){M=g[(M&65535)+(v&(1<<w)-1)];continue e}else if(w&32){a.mode=r;break t}else{t.msg="invalid literal/length code";a.mode=e;break t}break}}while(n<s&&o<f);_=m>>3;n-=_;m-=_<<3;v&=(1<<m)-1;t.next_in=n;t.next_out=o;t.avail_in=n<s?5+(s-n):5-(n-s);t.avail_out=o<f?257+(f-o):257-(o-f);a.hold=v;a.bits=m;return}},189:function(t,e,r){"use strict";var i=r(268);var a=r(228);var n=r(667);var s=r(140);var o=r(761);var h=t.exports=function(t){this._options=t;t.deflateChunkSize=t.deflateChunkSize||32*1024;t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9;t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3;t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:true;t.deflateFactory=t.deflateFactory||o.createDeflate;t.bitDepth=t.bitDepth||8;t.colorType=typeof t.colorType==="number"?t.colorType:i.COLORTYPE_COLOR_ALPHA;t.inputColorType=typeof t.inputColorType==="number"?t.inputColorType:i.COLORTYPE_COLOR_ALPHA;if([i.COLORTYPE_GRAYSCALE,i.COLORTYPE_COLOR,i.COLORTYPE_COLOR_ALPHA,i.COLORTYPE_ALPHA].indexOf(t.colorType)===-1){throw new Error("option color type:"+t.colorType+" is not supported at present")}if([i.COLORTYPE_GRAYSCALE,i.COLORTYPE_COLOR,i.COLORTYPE_COLOR_ALPHA,i.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1){throw new Error("option input color type:"+t.inputColorType+" is not supported at present")}if(t.bitDepth!==8&&t.bitDepth!==16){throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")}};h.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};h.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};h.prototype.filterData=function(t,e,r){var a=n(t,e,r,this._options);var o=i.COLORTYPE_TO_BPP_MAP[this._options.colorType];var h=s(a,e,r,this._options,o);return h};h.prototype._packChunk=function(t,e){var r=e?e.length:0;var i=new JIMPBUffer(r+12);i.writeUInt32BE(r,0);i.writeUInt32BE(t,4);if(e){e.copy(i,8)}i.writeInt32BE(a.crc32(i.slice(4,i.length-4)),i.length-4);return i};h.prototype.packGAMA=function(t){var e=new JIMPBUffer(4);e.writeUInt32BE(Math.floor(t*i.GAMMA_DIVISION),0);return this._packChunk(i.TYPE_gAMA,e)};h.prototype.packIHDR=function(t,e){var r=new JIMPBUffer(13);r.writeUInt32BE(t,0);r.writeUInt32BE(e,4);r[8]=this._options.bitDepth;r[9]=this._options.colorType;r[10]=0;r[11]=0;r[12]=0;return this._packChunk(i.TYPE_IHDR,r)};h.prototype.packIDAT=function(t){return this._packChunk(i.TYPE_IDAT,t)};h.prototype.packIEND=function(){return this._packChunk(i.TYPE_IEND,null)}},190:function(t,e,r){"use strict";var i=r(407);var a=r(764);Object.defineProperty(e,"__esModule",{value:true});e.parseBitmap=parseBitmap;e.getBuffer=getBuffer;e.getBufferAsync=getBufferAsync;var n=a(r(382));var s=a(r(631));var o=a(r(842));var h=r(19);var f=i(r(963));var l=i(r(289));var u=a(r(892));function getMIMEFromBuffer(t,e){var r=(0,s["default"])(t);if(r){return r.mime}if(e){return l.getType(e)}return null}function getExifOrientation(t){return t._exif&&t._exif.tags&&t._exif.tags.Orientation||1}function getExifOrientationTransformation(t){var e=t.getWidth();var r=t.getHeight();switch(getExifOrientation(t)){case 1:return null;case 2:return function(t,r){return[e-t-1,r]};case 3:return function(t,i){return[e-t-1,r-i-1]};case 4:return function(t,e){return[t,r-e-1]};case 5:return function(t,e){return[e,t]};case 6:return function(t,e){return[e,r-t-1]};case 7:return function(t,i){return[e-i-1,r-t-1]};case 8:return function(t,r){return[e-r-1,t]};default:return null}}function transformBitmap(t,e,r,i){var a=t.bitmap.data;var s=t.bitmap.width;var o=Buffer.alloc(a.length);for(var h=0;h<e;h++){for(var f=0;f<r;f++){var l=i(h,f),u=(0,n["default"])(l,2),c=u[0],d=u[1];var p=e*f+h<<2;var v=s*d+c<<2;var m=a.readUInt32BE(v);o.writeUInt32BE(m,p)}}t.bitmap.data=o;t.bitmap.width=e;t.bitmap.height=r}function exifRotate(t){if(getExifOrientation(t)<2)return;var e=getExifOrientationTransformation(t);var r=getExifOrientation(t)>4;var i=r?t.bitmap.height:t.bitmap.width;var a=r?t.bitmap.width:t.bitmap.height;transformBitmap(t,i,a,e)}function parseBitmap(t,e,r){var i=getMIMEFromBuffer(t,e);if(typeof i!=="string"){return r(new Error("Could not find MIME for Buffer <"+e+">"))}this._originalMime=i.toLowerCase();try{var a=this.getMIME();if(this.constructor.decoders[a]){this.bitmap=this.constructor.decoders[a](t)}else{return h.throwError.call(this,"Unsupported MIME type: "+a,r)}}catch(t){return r.call(this,t,this)}try{this._exif=o["default"].create(t).parse();exifRotate(this)}catch(t){}r.call(this,null,this);return this}function compositeBitmapOverBackground(t,e){return new t(e.bitmap.width,e.bitmap.height,e._background).composite(e,0,0).bitmap}function getBuffer(t,e){if(t===f.AUTO){t=this.getMIME()}if(typeof t!=="string"){return h.throwError.call(this,"mime must be a string",e)}if(typeof e!=="function"){return h.throwError.call(this,"cb must be a function",e)}t=t.toLowerCase();if(this._rgba&&this.constructor.hasAlpha[t]){this.bitmap.data=Buffer.from(this.bitmap.data)}else{this.bitmap.data=compositeBitmapOverBackground(this.constructor,this).data}if(this.constructor.encoders[t]){var r=this.constructor.encoders[t](this);e.call(this,null,r)}else{e.call(this,"Unsupported MIME type: "+t)}return this}function getBufferAsync(t){return(0,u["default"])(getBuffer,this,t)}},191:function(t){t.exports=require("querystring")},193:function(t){var e=function jpegImage(){"use strict";var t=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);var e=4017;var r=799;var i=3406;var a=2276;var n=1567;var s=3784;var o=5793;var h=2896;function constructor(){}function buildHuffmanTable(t,e){var r=0,i=[],a,n,s=16;while(s>0&&!t[s-1])s--;i.push({children:[],index:0});var o=i[0],h;for(a=0;a<s;a++){for(n=0;n<t[a];n++){o=i.pop();o.children[o.index]=e[r];while(o.index>0){if(i.length===0)throw new Error("Could not recreate Huffman Table");o=i.pop()}o.index++;i.push(o);while(i.length<=a){i.push(h={children:[],index:0});o.children[o.index]=h.children;o=h}r++}if(a+1<s){i.push(h={children:[],index:0});o.children[o.index]=h.children;o=h}}return i[0].children}function decodeScan(e,r,i,a,n,s,o,h,f,l){var u=i.precision;var c=i.samplesPerLine;var d=i.scanLines;var p=i.mcusPerLine;var v=i.progressive;var m=i.maxH,g=i.maxV;var b=r,y=0,E=0;function readBit(){if(E>0){E--;return y>>E&1}y=e[r++];if(y==255){var t=e[r++];if(t){throw new Error("unexpected marker: "+(y<<8|t).toString(16))}}E=7;return y>>>7}function decodeHuffman(t){var e=t,r;while((r=readBit())!==null){e=e[r];if(typeof e==="number")return e;if(typeof e!=="object")throw new Error("invalid huffman sequence")}return null}function receive(t){var e=0;while(t>0){var r=readBit();if(r===null)return;e=e<<1|r;t--}return e}function receiveAndExtend(t){var e=receive(t);if(e>=1<<t-1)return e;return e+(-1<<t)+1}function decodeBaseline(e,r){var i=decodeHuffman(e.huffmanTableDC);var a=i===0?0:receiveAndExtend(i);r[0]=e.pred+=a;var n=1;while(n<64){var s=decodeHuffman(e.huffmanTableAC);var o=s&15,h=s>>4;if(o===0){if(h<15)break;n+=16;continue}n+=h;var f=t[n];r[f]=receiveAndExtend(o);n++}}function decodeDCFirst(t,e){var r=decodeHuffman(t.huffmanTableDC);var i=r===0?0:receiveAndExtend(r)<<f;e[0]=t.pred+=i}function decodeDCSuccessive(t,e){e[0]|=readBit()<<f}var M=0;function decodeACFirst(e,r){if(M>0){M--;return}var i=s,a=o;while(i<=a){var n=decodeHuffman(e.huffmanTableAC);var h=n&15,l=n>>4;if(h===0){if(l<15){M=receive(l)+(1<<l)-1;break}i+=16;continue}i+=l;var u=t[i];r[u]=receiveAndExtend(h)*(1<<f);i++}}var w=0,_;function decodeACSuccessive(e,r){var i=s,a=o,n=0;while(i<=a){var h=t[i];var l=r[h]<0?-1:1;switch(w){case 0:var u=decodeHuffman(e.huffmanTableAC);var c=u&15,n=u>>4;if(c===0){if(n<15){M=receive(n)+(1<<n);w=4}else{n=16;w=1}}else{if(c!==1)throw new Error("invalid ACn encoding");_=receiveAndExtend(c);w=n?2:3}continue;case 1:case 2:if(r[h])r[h]+=(readBit()<<f)*l;else{n--;if(n===0)w=w==2?3:0}break;case 3:if(r[h])r[h]+=(readBit()<<f)*l;else{r[h]=_<<f;w=0}break;case 4:if(r[h])r[h]+=(readBit()<<f)*l;break}i++}if(w===4){M--;if(M===0)w=0}}function decodeMcu(t,e,r,i,a){var n=r/p|0;var s=r%p;var o=n*t.v+i;var h=s*t.h+a;if(t.blocks[o]===undefined&&l.tolerantDecoding)return;e(t,t.blocks[o][h])}function decodeBlock(t,e,r){var i=r/t.blocksPerLine|0;var a=r%t.blocksPerLine;if(t.blocks[i]===undefined&&l.tolerantDecoding)return;e(t,t.blocks[i][a])}var x=a.length;var I,D,L,T,P;var k;if(v){if(s===0)k=h===0?decodeDCFirst:decodeDCSuccessive;else k=h===0?decodeACFirst:decodeACSuccessive}else{k=decodeBaseline}var O=0,N;var S;if(x==1){S=a[0].blocksPerLine*a[0].blocksPerColumn}else{S=p*i.mcusPerColumn}if(!n)n=S;var A,B;while(O<S){for(D=0;D<x;D++)a[D].pred=0;M=0;if(x==1){I=a[0];for(P=0;P<n;P++){decodeBlock(I,k,O);O++}}else{for(P=0;P<n;P++){for(D=0;D<x;D++){I=a[D];A=I.h;B=I.v;for(L=0;L<B;L++){for(T=0;T<A;T++){decodeMcu(I,k,O,L,T)}}}O++;if(O===S)break}}if(O===S){do{if(e[r]===255){if(e[r+1]!==0){break}}r+=1}while(r<e.length-2)}E=0;N=e[r]<<8|e[r+1];if(N<65280){throw new Error("marker was not found")}if(N>=65488&&N<=65495){r+=2}else break}return r-b}function buildComponentData(t,f){var l=[];var u=f.blocksPerLine;var c=f.blocksPerColumn;var d=u<<3;var p=new Int32Array(64),v=new Uint8Array(64);function quantizeAndInverse(t,l,u){var c=f.quantizationTable;var d,p,v,m,g,b,y,E,M;var w=u;var _;for(_=0;_<64;_++)w[_]=t[_]*c[_];for(_=0;_<8;++_){var x=8*_;if(w[1+x]==0&&w[2+x]==0&&w[3+x]==0&&w[4+x]==0&&w[5+x]==0&&w[6+x]==0&&w[7+x]==0){M=o*w[0+x]+512>>10;w[0+x]=M;w[1+x]=M;w[2+x]=M;w[3+x]=M;w[4+x]=M;w[5+x]=M;w[6+x]=M;w[7+x]=M;continue}d=o*w[0+x]+128>>8;p=o*w[4+x]+128>>8;v=w[2+x];m=w[6+x];g=h*(w[1+x]-w[7+x])+128>>8;E=h*(w[1+x]+w[7+x])+128>>8;b=w[3+x]<<4;y=w[5+x]<<4;M=d-p+1>>1;d=d+p+1>>1;p=M;M=v*s+m*n+128>>8;v=v*n-m*s+128>>8;m=M;M=g-y+1>>1;g=g+y+1>>1;y=M;M=E+b+1>>1;b=E-b+1>>1;E=M;M=d-m+1>>1;d=d+m+1>>1;m=M;M=p-v+1>>1;p=p+v+1>>1;v=M;M=g*a+E*i+2048>>12;g=g*i-E*a+2048>>12;E=M;M=b*r+y*e+2048>>12;b=b*e-y*r+2048>>12;y=M;w[0+x]=d+E;w[7+x]=d-E;w[1+x]=p+y;w[6+x]=p-y;w[2+x]=v+b;w[5+x]=v-b;w[3+x]=m+g;w[4+x]=m-g}for(_=0;_<8;++_){var I=_;if(w[1*8+I]==0&&w[2*8+I]==0&&w[3*8+I]==0&&w[4*8+I]==0&&w[5*8+I]==0&&w[6*8+I]==0&&w[7*8+I]==0){M=o*u[_+0]+8192>>14;w[0*8+I]=M;w[1*8+I]=M;w[2*8+I]=M;w[3*8+I]=M;w[4*8+I]=M;w[5*8+I]=M;w[6*8+I]=M;w[7*8+I]=M;continue}d=o*w[0*8+I]+2048>>12;p=o*w[4*8+I]+2048>>12;v=w[2*8+I];m=w[6*8+I];g=h*(w[1*8+I]-w[7*8+I])+2048>>12;E=h*(w[1*8+I]+w[7*8+I])+2048>>12;b=w[3*8+I];y=w[5*8+I];M=d-p+1>>1;d=d+p+1>>1;p=M;M=v*s+m*n+2048>>12;v=v*n-m*s+2048>>12;m=M;M=g-y+1>>1;g=g+y+1>>1;y=M;M=E+b+1>>1;b=E-b+1>>1;E=M;M=d-m+1>>1;d=d+m+1>>1;m=M;M=p-v+1>>1;p=p+v+1>>1;v=M;M=g*a+E*i+2048>>12;g=g*i-E*a+2048>>12;E=M;M=b*r+y*e+2048>>12;b=b*e-y*r+2048>>12;y=M;w[0*8+I]=d+E;w[7*8+I]=d-E;w[1*8+I]=p+y;w[6*8+I]=p-y;w[2*8+I]=v+b;w[5*8+I]=v-b;w[3*8+I]=m+g;w[4*8+I]=m-g}for(_=0;_<64;++_){var D=128+(w[_]+8>>4);l[_]=D<0?0:D>255?255:D}}requestMemoryAllocation(d*c*8);var m,g;for(var b=0;b<c;b++){var y=b<<3;for(m=0;m<8;m++)l.push(new Uint8Array(d));for(var E=0;E<u;E++){quantizeAndInverse(f.blocks[b][E],v,p);var M=0,w=E<<3;for(g=0;g<8;g++){var _=l[y+g];for(m=0;m<8;m++)_[w+m]=v[M++]}}}return l}function clampTo8bit(t){return t<0?0:t>255?255:t}constructor.prototype={load:function load(t){var e=new XMLHttpRequest;e.open("GET",t,true);e.responseType="arraybuffer";e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t);if(this.onload)this.onload()}.bind(this);e.send(null)},parse:function parse(e){var r=this.opts.maxResolutionInMP*1e3*1e3;var i=0,a=e.length;function readUint16(){var t=e[i]<<8|e[i+1];i+=2;return t}function readDataBlock(){var t=readUint16();var r=e.subarray(i,i+t-2);i+=r.length;return r}function prepareComponents(t){var e=0,r=0;var i,a;for(a in t.components){if(t.components.hasOwnProperty(a)){i=t.components[a];if(e<i.h)e=i.h;if(r<i.v)r=i.v}}var n=Math.ceil(t.samplesPerLine/8/e);var s=Math.ceil(t.scanLines/8/r);for(a in t.components){if(t.components.hasOwnProperty(a)){i=t.components[a];var o=Math.ceil(Math.ceil(t.samplesPerLine/8)*i.h/e);var h=Math.ceil(Math.ceil(t.scanLines/8)*i.v/r);var f=n*i.h;var l=s*i.v;var u=l*f;var c=[];requestMemoryAllocation(u*256);for(var d=0;d<l;d++){var p=[];for(var v=0;v<f;v++)p.push(new Int32Array(64));c.push(p)}i.blocksPerLine=o;i.blocksPerColumn=h;i.blocks=c}}t.maxH=e;t.maxV=r;t.mcusPerLine=n;t.mcusPerColumn=s}var n=null;var s=null;var o=null;var h,f;var l=[],u=[];var c=[],d=[];var p=readUint16();this.comments=[];if(p!=65496){throw new Error("SOI not found")}p=readUint16();while(p!=65497){var v,m,g;switch(p){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var b=readDataBlock();if(p===65534){var y=String.fromCharCode.apply(null,b);this.comments.push(y)}if(p===65504){if(b[0]===74&&b[1]===70&&b[2]===73&&b[3]===70&&b[4]===0){n={version:{major:b[5],minor:b[6]},densityUnits:b[7],xDensity:b[8]<<8|b[9],yDensity:b[10]<<8|b[11],thumbWidth:b[12],thumbHeight:b[13],thumbData:b.subarray(14,14+3*b[12]*b[13])}}}if(p===65505){if(b[0]===69&&b[1]===120&&b[2]===105&&b[3]===102&&b[4]===0){this.exifBuffer=b.subarray(5,b.length)}}if(p===65518){if(b[0]===65&&b[1]===100&&b[2]===111&&b[3]===98&&b[4]===101&&b[5]===0){s={version:b[6],flags0:b[7]<<8|b[8],flags1:b[9]<<8|b[10],transformCode:b[11]}}}break;case 65499:var E=readUint16();var M=E+i-2;while(i<M){var w=e[i++];requestMemoryAllocation(64*4);var _=new Int32Array(64);if(w>>4===0){for(m=0;m<64;m++){var x=t[m];_[x]=e[i++]}}else if(w>>4===1){for(m=0;m<64;m++){var x=t[m];_[x]=readUint16()}}else throw new Error("DQT: invalid table spec");l[w&15]=_}break;case 65472:case 65473:case 65474:readUint16();h={};h.extended=p===65473;h.progressive=p===65474;h.precision=e[i++];h.scanLines=readUint16();h.samplesPerLine=readUint16();h.components={};h.componentsOrder=[];var I=h.scanLines*h.samplesPerLine;if(I>r){var D=Math.ceil((I-r)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${D}MP`)}var L=e[i++],T;var P=0,k=0;for(v=0;v<L;v++){T=e[i];var O=e[i+1]>>4;var N=e[i+1]&15;var S=e[i+2];h.componentsOrder.push(T);h.components[T]={h:O,v:N,quantizationIdx:S};i+=3}prepareComponents(h);u.push(h);break;case 65476:var A=readUint16();for(v=2;v<A;){var B=e[i++];var C=new Uint8Array(16);var R=0;for(m=0;m<16;m++,i++){R+=C[m]=e[i]}requestMemoryAllocation(16+R);var F=new Uint8Array(R);for(m=0;m<R;m++,i++)F[m]=e[i];v+=17+R;(B>>4===0?d:c)[B&15]=buildHuffmanTable(C,F)}break;case 65501:readUint16();f=readUint16();break;case 65500:readUint16();readUint16();break;case 65498:var X=readUint16();var G=e[i++];var U=[],z;for(v=0;v<G;v++){z=h.components[e[i++]];var W=e[i++];z.huffmanTableDC=d[W>>4];z.huffmanTableAC=c[W&15];U.push(z)}var H=e[i++];var Q=e[i++];var j=e[i++];var V=decodeScan(e,i,h,U,f,H,Q,j>>4,j&15,this.opts);i+=V;break;case 65535:if(e[i]!==255){i--}break;default:if(e[i-3]==255&&e[i-2]>=192&&e[i-2]<=254){i-=3;break}throw new Error("unknown JPEG marker "+p.toString(16))}p=readUint16()}if(u.length!=1)throw new Error("only single frame JPEGs supported");for(var v=0;v<u.length;v++){var Y=u[v].components;for(var m in Y){Y[m].quantizationTable=l[Y[m].quantizationIdx];delete Y[m].quantizationIdx}}this.width=h.samplesPerLine;this.height=h.scanLines;this.jfif=n;this.adobe=s;this.components=[];for(var v=0;v<h.componentsOrder.length;v++){var z=h.components[h.componentsOrder[v]];this.components.push({lines:buildComponentData(h,z),scaleX:z.h/h.maxH,scaleY:z.v/h.maxV})}},getData:function getData(t,e){var r=this.width/t,i=this.height/e;var a,n,s,o;var h,f,l,u;var c,d;var p=0;var v,m,g,b,y,E,M,w,_,x;var I;var D=t*e*this.components.length;requestMemoryAllocation(D);var L=new Uint8Array(D);switch(this.components.length){case 1:a=this.components[0];for(d=0;d<e;d++){h=a.lines[0|d*a.scaleY*i];for(c=0;c<t;c++){v=h[0|c*a.scaleX*r];L[p++]=v}}break;case 2:a=this.components[0];n=this.components[1];for(d=0;d<e;d++){h=a.lines[0|d*a.scaleY*i];f=n.lines[0|d*n.scaleY*i];for(c=0;c<t;c++){v=h[0|c*a.scaleX*r];L[p++]=v;v=f[0|c*n.scaleX*r];L[p++]=v}}break;case 3:I=true;if(this.adobe&&this.adobe.transformCode)I=true;else if(typeof this.opts.colorTransform!=="undefined")I=!!this.opts.colorTransform;a=this.components[0];n=this.components[1];s=this.components[2];for(d=0;d<e;d++){h=a.lines[0|d*a.scaleY*i];f=n.lines[0|d*n.scaleY*i];l=s.lines[0|d*s.scaleY*i];for(c=0;c<t;c++){if(!I){w=h[0|c*a.scaleX*r];_=f[0|c*n.scaleX*r];x=l[0|c*s.scaleX*r]}else{v=h[0|c*a.scaleX*r];m=f[0|c*n.scaleX*r];g=l[0|c*s.scaleX*r];w=clampTo8bit(v+1.402*(g-128));_=clampTo8bit(v-.3441363*(m-128)-.71413636*(g-128));x=clampTo8bit(v+1.772*(m-128))}L[p++]=w;L[p++]=_;L[p++]=x}}break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");I=false;if(this.adobe&&this.adobe.transformCode)I=true;else if(typeof this.opts.colorTransform!=="undefined")I=!!this.opts.colorTransform;a=this.components[0];n=this.components[1];s=this.components[2];o=this.components[3];for(d=0;d<e;d++){h=a.lines[0|d*a.scaleY*i];f=n.lines[0|d*n.scaleY*i];l=s.lines[0|d*s.scaleY*i];u=o.lines[0|d*o.scaleY*i];for(c=0;c<t;c++){if(!I){y=h[0|c*a.scaleX*r];E=f[0|c*n.scaleX*r];M=l[0|c*s.scaleX*r];b=u[0|c*o.scaleX*r]}else{v=h[0|c*a.scaleX*r];m=f[0|c*n.scaleX*r];g=l[0|c*s.scaleX*r];b=u[0|c*o.scaleX*r];y=255-clampTo8bit(v+1.402*(g-128));E=255-clampTo8bit(v-.3441363*(m-128)-.71413636*(g-128));M=255-clampTo8bit(v+1.772*(m-128))}L[p++]=255-y;L[p++]=255-E;L[p++]=255-M;L[p++]=255-b}}break;default:throw new Error("Unsupported color mode")}return L},copyToImageData:function copyToImageData(t,e){var r=t.width,i=t.height;var a=t.data;var n=this.getData(r,i);var s=0,o=0,h,f;var l,u,c,d,p,v,m;switch(this.components.length){case 1:for(f=0;f<i;f++){for(h=0;h<r;h++){l=n[s++];a[o++]=l;a[o++]=l;a[o++]=l;if(e){a[o++]=255}}}break;case 3:for(f=0;f<i;f++){for(h=0;h<r;h++){p=n[s++];v=n[s++];m=n[s++];a[o++]=p;a[o++]=v;a[o++]=m;if(e){a[o++]=255}}}break;case 4:for(f=0;f<i;f++){for(h=0;h<r;h++){c=n[s++];d=n[s++];l=n[s++];u=n[s++];p=255-clampTo8bit(c*(1-u/255)+u);v=255-clampTo8bit(d*(1-u/255)+u);m=255-clampTo8bit(l*(1-u/255)+u);a[o++]=p;a[o++]=v;a[o++]=m;if(e){a[o++]=255}}}break;default:throw new Error("Unsupported color mode")}}};var f=0;var l=0;function requestMemoryAllocation(t=0){var e=f+t;if(e>l){var r=Math.ceil((e-l)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}f=e}constructor.resetMaxMemoryUsage=function(t){f=0;l=t};constructor.getBytesAllocated=function(){return f};constructor.requestMemoryAllocation=requestMemoryAllocation;return constructor}();if(true){t.exports=decode}else{}function decode(t,r={}){var i={colorTransform:undefined,useTArray:false,formatAsRGBA:true,tolerantDecoding:true,maxResolutionInMP:100,maxMemoryUsageInMB:512};var a={...i,...r};var n=new Uint8Array(t);var s=new e;s.opts=a;e.resetMaxMemoryUsage(a.maxMemoryUsageInMB*1024*1024);s.parse(n);var o=a.formatAsRGBA?4:3;var h=s.width*s.height*o;try{e.requestMemoryAllocation(h);var f={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:a.useTArray?new Uint8Array(h):Buffer.alloc(h)};if(s.comments.length>0){f["comments"]=s.comments}}catch(t){if(t instanceof RangeError){throw new Error("Could not allocate enough memory for the image. "+"Required: "+h)}else{throw t}}s.copyToImageData(f,a.formatAsRGBA);return f}},194:function(t){function _defineProperties(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(t,i.key,i)}}function _createClass(t,e,r){if(e)_defineProperties(t.prototype,e);if(r)_defineProperties(t,r);return t}t.exports=_createClass},204:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{fisheye:function fisheye(){var t=this;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{r:2.5};var r=arguments.length>1?arguments[1]:undefined;if(typeof e==="function"){r=e;e={r:2.5}}var a=this.cloneQuiet();var n=a.bitmap,s=n.width,o=n.height;a.scanQuiet(0,0,s,o,function(r,i){var n=r/s;var h=i/o;var f=Math.sqrt(Math.pow(n-.5,2)+Math.pow(h-.5,2));var l=2*Math.pow(f,e.r);var u=(n-.5)/f;var c=(h-.5)/f;var d=Math.round((l*u+.5)*s);var p=Math.round((l*c+.5)*o);var v=a.getPixelColor(d,p);t.setPixelColor(v,r,i)});this.setPixelColor(a.getPixelColor(s/2,o/2),s/2,o/2);if((0,i.isNodePattern)(r)){r.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},210:function(t,e,r){"use strict";var i=r(669);var a=r(413);var n=t.exports=function(){a.call(this);this._buffers=[];this._buffered=0;this._reads=[];this._paused=false;this._encoding="utf8";this.writable=true};i.inherits(n,a);n.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e});process.nextTick(function(){this._process();if(this._paused&&this._reads.length>0){this._paused=false;this.emit("drain")}}.bind(this))};n.prototype.write=function(t,e){if(!this.writable){this.emit("error",new Error("Stream not writable"));return false}var r;if(Buffer.isBuffer(t)){r=t}else{r=new JIMPBUffer(t,e||this._encoding)}this._buffers.push(r);this._buffered+=r.length;this._process();if(this._reads&&this._reads.length===0){this._paused=true}return this.writable&&!this._paused};n.prototype.end=function(t,e){if(t){this.write(t,e)}this.writable=false;if(!this._buffers){return}if(this._buffers.length===0){this._end()}else{this._buffers.push(null);this._process()}};n.prototype.destroySoon=n.prototype.end;n.prototype._end=function(){if(this._reads.length>0){this.emit("error",new Error("Unexpected end of input"))}this.destroy()};n.prototype.destroy=function(){if(!this._buffers){return}this.writable=false;this._reads=null;this._buffers=null;this.emit("close")};n.prototype._processReadAllowingLess=function(t){this._reads.shift();var e=this._buffers[0];if(e.length>t.length){this._buffered-=t.length;this._buffers[0]=e.slice(t.length);t.func.call(this,e.slice(0,t.length))}else{this._buffered-=e.length;this._buffers.shift();t.func.call(this,e)}};n.prototype._processRead=function(t){this._reads.shift();var e=0;var r=0;var i=new JIMPBUffer(t.length);while(e<t.length){var a=this._buffers[r++];var n=Math.min(a.length,t.length-e);a.copy(i,e,0,n);e+=n;if(n!==a.length){this._buffers[--r]=a.slice(n)}}if(r>0){this._buffers.splice(0,r)}this._buffered-=t.length;t.func.call(this,i)};n.prototype._process=function(){try{while(this._buffered>0&&this._reads&&this._reads.length>0){var t=this._reads[0];if(t.allowLess){this._processReadAllowingLess(t)}else if(this._buffered>=t.length){this._processRead(t)}else{break}}if(this._buffers&&!this.writable){this._end()}}catch(t){this.emit("error",t)}}},211:function(t){t.exports=require("https")},213:function(t){function BmpEncoder(t){this.buffer=t.data;this.width=t.width;this.height=t.height;this.extraBytes=this.width%4;this.rgbSize=this.height*(3*this.width+this.extraBytes);this.headerInfoSize=40;this.data=[];this.flag="BM";this.reserved=0;this.offset=54;this.fileSize=this.rgbSize+this.offset;this.planes=1;this.bitPP=24;this.compress=0;this.hr=0;this.vr=0;this.colors=0;this.importantColors=0}BmpEncoder.prototype.encode=function(){var t=new JIMPBUffer(this.offset+this.rgbSize);this.pos=0;t.write(this.flag,this.pos,2);this.pos+=2;t.writeUInt32LE(this.fileSize,this.pos);this.pos+=4;t.writeUInt32LE(this.reserved,this.pos);this.pos+=4;t.writeUInt32LE(this.offset,this.pos);this.pos+=4;t.writeUInt32LE(this.headerInfoSize,this.pos);this.pos+=4;t.writeUInt32LE(this.width,this.pos);this.pos+=4;t.writeInt32LE(-this.height,this.pos);this.pos+=4;t.writeUInt16LE(this.planes,this.pos);this.pos+=2;t.writeUInt16LE(this.bitPP,this.pos);this.pos+=2;t.writeUInt32LE(this.compress,this.pos);this.pos+=4;t.writeUInt32LE(this.rgbSize,this.pos);this.pos+=4;t.writeUInt32LE(this.hr,this.pos);this.pos+=4;t.writeUInt32LE(this.vr,this.pos);this.pos+=4;t.writeUInt32LE(this.colors,this.pos);this.pos+=4;t.writeUInt32LE(this.importantColors,this.pos);this.pos+=4;var e=0;var r=3*this.width+this.extraBytes;for(var i=0;i<this.height;i++){for(var a=0;a<this.width;a++){var n=this.pos+i*r+a*3;e++;t[n]=this.buffer[e++];t[n+1]=this.buffer[e++];t[n+2]=this.buffer[e++]}if(this.extraBytes>0){var s=this.pos+i*r+this.width*3;t.fill(0,s,s+this.extraBytes)}}return t};t.exports=function(t,e){if(typeof e==="undefined")e=100;var r=new BmpEncoder(t);var i=r.encode();return{data:i,width:t.width,height:t.height}}},221:function(t){function _setPrototypeOf(e,r){t.exports=_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,e){t.__proto__=e;return t};return _setPrototypeOf(e,r)}t.exports=_setPrototypeOf},228:function(t){"use strict";var e=[];(function(){for(var t=0;t<256;t++){var r=t;for(var i=0;i<8;i++){if(r&1){r=3988292384^r>>>1}else{r=r>>>1}}e[t]=r}})();var r=t.exports=function(){this._crc=-1};r.prototype.write=function(t){for(var r=0;r<t.length;r++){this._crc=e[(this._crc^t[r])&255]^this._crc>>>8}return true};r.prototype.crc32=function(){return this._crc^-1};r.crc32=function(t){var r=-1;for(var i=0;i<t.length;i++){r=e[(r^t[i])&255]^r>>>8}return r^-1}},235:function(t){var e=[66,77,70];t.exports=function readBMFontBinary(t){if(t.length<6)throw new Error("invalid buffer length for BMFont");var r=e.every(function(e,r){return t.readUInt8(r)===e});if(!r)throw new Error("BMFont missing BMF byte header");var i=3;var a=t.readUInt8(i++);if(a>3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");var n={kernings:[],chars:[]};for(var s=0;s<5;s++)i+=readBlock(n,t,i);return n};function readBlock(t,e,r){if(r>e.length-1)return 0;var i=e.readUInt8(r++);var a=e.readInt32LE(r);r+=4;switch(i){case 1:t.info=readInfo(e,r);break;case 2:t.common=readCommon(e,r);break;case 3:t.pages=readPages(e,r,a);break;case 4:t.chars=readChars(e,r,a);break;case 5:t.kernings=readKernings(e,r,a);break}return 5+a}function readInfo(t,e){var r={};r.size=t.readInt16LE(e);var i=t.readUInt8(e+2);r.smooth=i>>7&1;r.unicode=i>>6&1;r.italic=i>>5&1;r.bold=i>>4&1;if(i>>3&1)r.fixedHeight=1;r.charset=t.readUInt8(e+3)||"";r.stretchH=t.readUInt16LE(e+4);r.aa=t.readUInt8(e+6);r.padding=[t.readInt8(e+7),t.readInt8(e+8),t.readInt8(e+9),t.readInt8(e+10)];r.spacing=[t.readInt8(e+11),t.readInt8(e+12)];r.outline=t.readUInt8(e+13);r.face=readStringNT(t,e+14);return r}function readCommon(t,e){var r={};r.lineHeight=t.readUInt16LE(e);r.base=t.readUInt16LE(e+2);r.scaleW=t.readUInt16LE(e+4);r.scaleH=t.readUInt16LE(e+6);r.pages=t.readUInt16LE(e+8);var i=t.readUInt8(e+10);r.packed=0;r.alphaChnl=t.readUInt8(e+11);r.redChnl=t.readUInt8(e+12);r.greenChnl=t.readUInt8(e+13);r.blueChnl=t.readUInt8(e+14);return r}function readPages(t,e,r){var i=[];var a=readNameNT(t,e);var n=a.length+1;var s=r/n;for(var o=0;o<s;o++){i[o]=t.slice(e,e+a.length).toString("utf8");e+=n}return i}function readChars(t,e,r){var i=[];var a=r/20;for(var n=0;n<a;n++){var s={};var o=n*20;s.id=t.readUInt32LE(e+0+o);s.x=t.readUInt16LE(e+4+o);s.y=t.readUInt16LE(e+6+o);s.width=t.readUInt16LE(e+8+o);s.height=t.readUInt16LE(e+10+o);s.xoffset=t.readInt16LE(e+12+o);s.yoffset=t.readInt16LE(e+14+o);s.xadvance=t.readInt16LE(e+16+o);s.page=t.readUInt8(e+18+o);s.chnl=t.readUInt8(e+19+o);i[n]=s}return i}function readKernings(t,e,r){var i=[];var a=r/10;for(var n=0;n<a;n++){var s={};var o=n*10;s.first=t.readUInt32LE(e+0+o);s.second=t.readUInt32LE(e+4+o);s.amount=t.readInt16LE(e+8+o);i[n]=s}return i}function readNameNT(t,e){var r=e;for(;r<t.length;r++){if(t[r]===0)break}return t.slice(e,r)}function readStringNT(t,e){return readNameNT(t,e).toString("utf8")}},246:function(t,e,r){"use strict";var i=r(999).assign;var a=r(259);var n=r(832);var s=r(691);var o={};i(o,a,n,s);t.exports=o},259:function(t,e,r){"use strict";var i=r(378);var a=r(999);var n=r(279);var s=r(868);var o=r(991);var h=Object.prototype.toString;var f=0;var l=4;var u=0;var c=1;var d=2;var p=-1;var v=0;var m=8;function Deflate(t){if(!(this instanceof Deflate))return new Deflate(t);this.options=a.assign({level:p,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:v,to:""},t||{});var e=this.options;if(e.raw&&e.windowBits>0){e.windowBits=-e.windowBits}else if(e.gzip&&e.windowBits>0&&e.windowBits<16){e.windowBits+=16}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new o;this.strm.avail_out=0;var r=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==u){throw new Error(s[r])}if(e.header){i.deflateSetHeader(this.strm,e.header)}if(e.dictionary){var f;if(typeof e.dictionary==="string"){f=n.string2buf(e.dictionary)}else if(h.call(e.dictionary)==="[object ArrayBuffer]"){f=new Uint8Array(e.dictionary)}else{f=e.dictionary}r=i.deflateSetDictionary(this.strm,f);if(r!==u){throw new Error(s[r])}this._dict_set=true}}Deflate.prototype.push=function(t,e){var r=this.strm;var s=this.options.chunkSize;var o,p;if(this.ended){return false}p=e===~~e?e:e===true?l:f;if(typeof t==="string"){r.input=n.string2buf(t)}else if(h.call(t)==="[object ArrayBuffer]"){r.input=new Uint8Array(t)}else{r.input=t}r.next_in=0;r.avail_in=r.input.length;do{if(r.avail_out===0){r.output=new a.Buf8(s);r.next_out=0;r.avail_out=s}o=i.deflate(r,p);if(o!==c&&o!==u){this.onEnd(o);this.ended=true;return false}if(r.avail_out===0||r.avail_in===0&&(p===l||p===d)){if(this.options.to==="string"){this.onData(n.buf2binstring(a.shrinkBuf(r.output,r.next_out)))}else{this.onData(a.shrinkBuf(r.output,r.next_out))}}}while((r.avail_in>0||r.avail_out===0)&&o!==c);if(p===l){o=i.deflateEnd(this.strm);this.onEnd(o);this.ended=true;return o===u}if(p===d){this.onEnd(u);r.avail_out=0;return true}return true};Deflate.prototype.onData=function(t){this.chunks.push(t)};Deflate.prototype.onEnd=function(t){if(t===u){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=a.flattenChunks(this.chunks)}}this.chunks=[];this.err=t;this.msg=this.strm.msg};function deflate(t,e){var r=new Deflate(e);r.push(t,true);if(r.err){throw r.msg||s[r.err]}return r.result}function deflateRaw(t,e){e=e||{};e.raw=true;return deflate(t,e)}function gzip(t,e){e=e||{};e.gzip=true;return deflate(t,e)}e.Deflate=Deflate;e.deflate=deflate;e.deflateRaw=deflateRaw;e.gzip=gzip},265:function(t){(function(){var e;t.exports=e=function(){function XMLNodeList(t){this.nodes=t}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});XMLNodeList.prototype.clone=function(){return this.nodes=null};XMLNodeList.prototype.item=function(t){return this.nodes[t]||null};return XMLNodeList}()}).call(this)},268:function(t){"use strict";t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},275:function(t,e,r){"use strict";var i=r(669);var a=r(413);var n=r(507);var s=r(83);var o=r(24);var h=e.PNG=function(t){a.call(this);t=t||{};this.width=t.width|0;this.height=t.height|0;this.data=this.width>0&&this.height>0?new JIMPBUffer(4*this.width*this.height):null;if(t.fill&&this.data){this.data.fill(0)}this.gamma=0;this.readable=this.writable=true;this._parser=new n(t);this._parser.on("error",this.emit.bind(this,"error"));this._parser.on("close",this._handleClose.bind(this));this._parser.on("metadata",this._metadata.bind(this));this._parser.on("gamma",this._gamma.bind(this));this._parser.on("parsed",function(t){this.data=t;this.emit("parsed",t)}.bind(this));this._packer=new s(t);this._packer.on("data",this.emit.bind(this,"data"));this._packer.on("end",this.emit.bind(this,"end"));this._parser.on("close",this._handleClose.bind(this));this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(h,a);h.sync=o;h.prototype.pack=function(){if(!this.data||!this.data.length){this.emit("error","No data provided");return this}process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this));return this};h.prototype.parse=function(t,e){if(e){var r,i;r=function(t){this.removeListener("error",i);this.data=t;e(null,this)}.bind(this);i=function(t){this.removeListener("parsed",r);e(t,null)}.bind(this);this.once("parsed",r);this.once("error",i)}this.end(t);return this};h.prototype.write=function(t){this._parser.write(t);return true};h.prototype.end=function(t){this._parser.end(t)};h.prototype._metadata=function(t){this.width=t.width;this.height=t.height;this.emit("metadata",t)};h.prototype._gamma=function(t){this.gamma=t};h.prototype._handleClose=function(){if(!this._parser.writable&&!this._packer.readable){this.emit("close")}};h.bitblt=function(t,e,r,i,a,n,s,o){r|=0;i|=0;a|=0;n|=0;s|=0;o|=0;if(r>t.width||i>t.height||r+a>t.width||i+n>t.height){throw new Error("bitblt reading outside image")}if(s>e.width||o>e.height||s+a>e.width||o+n>e.height){throw new Error("bitblt writing outside image")}for(var h=0;h<n;h++){t.data.copy(e.data,(o+h)*e.width+s<<2,(i+h)*t.width+r<<2,(i+h)*t.width+r+a<<2)}};h.prototype.bitblt=function(t,e,r,i,a,n,s){h.bitblt(this,t,e,r,i,a,n,s);return this};h.adjustGamma=function(t){if(t.gamma){for(var e=0;e<t.height;e++){for(var r=0;r<t.width;r++){var i=t.width*e+r<<2;for(var a=0;a<3;a++){var n=t.data[i+a]/255;n=Math.pow(n,1/2.2/t.gamma);t.data[i+a]=Math.round(n*255)}}}t.gamma=0}};h.prototype.adjustGamma=function(){h.adjustGamma(this)}},279:function(t,e,r){"use strict";var i=r(999);var a=true;var n=true;try{String.fromCharCode.apply(null,[0])}catch(t){a=false}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){n=false}var s=new i.Buf8(256);for(var o=0;o<256;o++){s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1}s[254]=s[254]=1;e.string2buf=function(t){var e,r,a,n,s,o=t.length,h=0;for(n=0;n<o;n++){r=t.charCodeAt(n);if((r&64512)===55296&&n+1<o){a=t.charCodeAt(n+1);if((a&64512)===56320){r=65536+(r-55296<<10)+(a-56320);n++}}h+=r<128?1:r<2048?2:r<65536?3:4}e=new i.Buf8(h);for(s=0,n=0;s<h;n++){r=t.charCodeAt(n);if((r&64512)===55296&&n+1<o){a=t.charCodeAt(n+1);if((a&64512)===56320){r=65536+(r-55296<<10)+(a-56320);n++}}if(r<128){e[s++]=r}else if(r<2048){e[s++]=192|r>>>6;e[s++]=128|r&63}else if(r<65536){e[s++]=224|r>>>12;e[s++]=128|r>>>6&63;e[s++]=128|r&63}else{e[s++]=240|r>>>18;e[s++]=128|r>>>12&63;e[s++]=128|r>>>6&63;e[s++]=128|r&63}}return e};function buf2binstring(t,e){if(e<65534){if(t.subarray&&n||!t.subarray&&a){return String.fromCharCode.apply(null,i.shrinkBuf(t,e))}}var r="";for(var s=0;s<e;s++){r+=String.fromCharCode(t[s])}return r}e.buf2binstring=function(t){return buf2binstring(t,t.length)};e.binstring2buf=function(t){var e=new i.Buf8(t.length);for(var r=0,a=e.length;r<a;r++){e[r]=t.charCodeAt(r)}return e};e.buf2string=function(t,e){var r,i,a,n;var o=e||t.length;var h=new Array(o*2);for(i=0,r=0;r<o;){a=t[r++];if(a<128){h[i++]=a;continue}n=s[a];if(n>4){h[i++]=65533;r+=n-1;continue}a&=n===2?31:n===3?15:7;while(n>1&&r<o){a=a<<6|t[r++]&63;n--}if(n>1){h[i++]=65533;continue}if(a<65536){h[i++]=a}else{a-=65536;h[i++]=55296|a>>10&1023;h[i++]=56320|a&1023}}return buf2binstring(h,i)};e.utf8border=function(t,e){var r;e=e||t.length;if(e>t.length){e=t.length}r=e-1;while(r>=0&&(t[r]&192)===128){r--}if(r<0){return e}if(r===0){return e}return r+s[t[r]]>e?r:e}},283:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;e=r(683);i=r(733);t.exports=a=function(t){n(XMLRaw,t);function XMLRaw(t,r){XMLRaw.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=e.Raw;this.value=this.stringify.raw(r)}XMLRaw.prototype.clone=function(){return Object.create(this)};XMLRaw.prototype.toString=function(t){return this.options.writer.raw(this,this.options.writer.filterOptions(t))};return XMLRaw}(i)}).call(this)},288:function(t){"use strict";function Resize(t,e,r,i,a,n,s){this.widthOriginal=Math.abs(Math.floor(t)||0);this.heightOriginal=Math.abs(Math.floor(e)||0);this.targetWidth=Math.abs(Math.floor(r)||0);this.targetHeight=Math.abs(Math.floor(i)||0);this.colorChannels=a?4:3;this.interpolationPass=Boolean(n);this.resizeCallback=typeof s==="function"?s:function(){};this.targetWidthMultipliedByChannels=this.targetWidth*this.colorChannels;this.originalWidthMultipliedByChannels=this.widthOriginal*this.colorChannels;this.originalHeightMultipliedByChannels=this.heightOriginal*this.colorChannels;this.widthPassResultSize=this.targetWidthMultipliedByChannels*this.heightOriginal;this.finalResultSize=this.targetWidthMultipliedByChannels*this.targetHeight;this.initialize()}Resize.prototype.initialize=function(){if(this.widthOriginal>0&&this.heightOriginal>0&&this.targetWidth>0&&this.targetHeight>0){this.configurePasses()}else{throw new Error("Invalid settings specified for the resizer.")}};Resize.prototype.configurePasses=function(){if(this.widthOriginal===this.targetWidth){this.resizeWidth=this.bypassResizer}else{this.ratioWeightWidthPass=this.widthOriginal/this.targetWidth;if(this.ratioWeightWidthPass<1&&this.interpolationPass){this.initializeFirstPassBuffers(true);this.resizeWidth=this.colorChannels===4?this.resizeWidthInterpolatedRGBA:this.resizeWidthInterpolatedRGB}else{this.initializeFirstPassBuffers(false);this.resizeWidth=this.colorChannels===4?this.resizeWidthRGBA:this.resizeWidthRGB}}if(this.heightOriginal===this.targetHeight){this.resizeHeight=this.bypassResizer}else{this.ratioWeightHeightPass=this.heightOriginal/this.targetHeight;if(this.ratioWeightHeightPass<1&&this.interpolationPass){this.initializeSecondPassBuffers(true);this.resizeHeight=this.resizeHeightInterpolated}else{this.initializeSecondPassBuffers(false);this.resizeHeight=this.colorChannels===4?this.resizeHeightRGBA:this.resizeHeightRGB}}};Resize.prototype._resizeWidthInterpolatedRGBChannels=function(t,e){var r=e?4:3;var i=this.ratioWeightWidthPass;var a=this.widthBuffer;var n=0;var s=0;var o=0;var h=0;var f=0;var l;for(l=0;n<1/3;l+=r,n+=i){for(s=l,o=0;s<this.widthPassResultSize;o+=this.originalWidthMultipliedByChannels,s+=this.targetWidthMultipliedByChannels){a[s]=t[o];a[s+1]=t[o+1];a[s+2]=t[o+2];if(e)a[s+3]=t[o+3]}}n-=1/3;var u;for(u=this.widthOriginal-1;n<u;l+=r,n+=i){f=n%1;h=1-f;for(s=l,o=Math.floor(n)*r;s<this.widthPassResultSize;o+=this.originalWidthMultipliedByChannels,s+=this.targetWidthMultipliedByChannels){a[s+0]=t[o+0]*h+t[o+r+0]*f;a[s+1]=t[o+1]*h+t[o+r+1]*f;a[s+2]=t[o+2]*h+t[o+r+2]*f;if(e)a[s+3]=t[o+3]*h+t[o+r+3]*f}}for(u=this.originalWidthMultipliedByChannels-r;l<this.targetWidthMultipliedByChannels;l+=r){for(s=l,o=u;s<this.widthPassResultSize;o+=this.originalWidthMultipliedByChannels,s+=this.targetWidthMultipliedByChannels){a[s]=t[o];a[s+1]=t[o+1];a[s+2]=t[o+2];if(e)a[s+3]=t[o+3]}}return a};Resize.prototype._resizeWidthRGBChannels=function(t,e){var r=e?4:3;var i=this.ratioWeightWidthPass;var a=1/i;var n=this.originalWidthMultipliedByChannels-r+1;var s=this.targetWidthMultipliedByChannels-r+1;var o=this.outputWidthWorkBench;var h=this.widthBuffer;var f=this.outputWidthWorkBenchOpaquePixelsCount;var l=0;var u=0;var c=0;var d=0;var p=0;var v=0;var m=0;var g=1;var b=0;var y=0;var E=0;var M=0;do{for(p=0;p<this.originalHeightMultipliedByChannels;){o[p++]=0;o[p++]=0;o[p++]=0;if(e){o[p++]=0;f[p/r-1]=0}}l=i;do{u=1+c-d;g=Math.min(l,u);for(p=0,v=c;p<this.originalHeightMultipliedByChannels;v+=n){b=t[v];y=t[++v];E=t[++v];M=e?t[++v]:255;o[p++]+=(M?b:0)*g;o[p++]+=(M?y:0)*g;o[p++]+=(M?E:0)*g;if(e){o[p++]+=M*g;f[p/r-1]+=M?g:0}}if(l>=u){c+=r;d=c;l-=u}else{d+=l;break}}while(l>0&&c<this.originalWidthMultipliedByChannels);for(p=0,v=m;p<this.originalHeightMultipliedByChannels;v+=s){l=e?f[p/r]:1;g=e?l?1/l:0:a;h[v]=o[p++]*g;h[++v]=o[p++]*g;h[++v]=o[p++]*g;if(e)h[++v]=o[p++]*a}m+=r}while(m<this.targetWidthMultipliedByChannels);return h};Resize.prototype._resizeHeightRGBChannels=function(t,e){var r=this.ratioWeightHeightPass;var i=1/r;var a=this.outputHeightWorkBench;var n=this.heightBuffer;var s=this.outputHeightWorkBenchOpaquePixelsCount;var o=0;var h=0;var f=0;var l=0;var u=0;var c=0;var d=0;var p=1;var v=0;var m=0;var g=0;var b=0;do{for(u=0;u<this.targetWidthMultipliedByChannels;){a[u++]=0;a[u++]=0;a[u++]=0;if(e){a[u++]=0;s[u/4-1]=0}}o=r;do{h=1+f-l;p=Math.min(o,h);d=f;for(u=0;u<this.targetWidthMultipliedByChannels;){v=t[d++];m=t[d++];g=t[d++];b=e?t[d++]:255;a[u++]+=(b?v:0)*p;a[u++]+=(b?m:0)*p;a[u++]+=(b?g:0)*p;if(e){a[u++]+=b*p;s[u/4-1]+=b?p:0}}if(o>=h){f=d;l=f;o-=h}else{l+=o;break}}while(o>0&&f<this.widthPassResultSize);for(u=0;u<this.targetWidthMultipliedByChannels;){o=e?s[u/4]:1;p=e?o?1/o:0:i;n[c++]=Math.round(a[u++]*p);n[c++]=Math.round(a[u++]*p);n[c++]=Math.round(a[u++]*p);if(e){n[c++]=Math.round(a[u++]*i)}}}while(c<this.finalResultSize);return n};Resize.prototype.resizeWidthInterpolatedRGB=function(t){return this._resizeWidthInterpolatedRGBChannels(t,false)};Resize.prototype.resizeWidthInterpolatedRGBA=function(t){return this._resizeWidthInterpolatedRGBChannels(t,true)};Resize.prototype.resizeWidthRGB=function(t){return this._resizeWidthRGBChannels(t,false)};Resize.prototype.resizeWidthRGBA=function(t){return this._resizeWidthRGBChannels(t,true)};Resize.prototype.resizeHeightInterpolated=function(t){var e=this.ratioWeightHeightPass;var r=this.heightBuffer;var i=0;var a=0;var n=0;var s=0;var o=0;var h=0;var f=0;var l;for(;i<1/3;i+=e){for(n=0;n<this.targetWidthMultipliedByChannels;){r[a++]=Math.round(t[n++])}}i-=1/3;for(l=this.heightOriginal-1;i<l;i+=e){f=i%1;h=1-f;s=Math.floor(i)*this.targetWidthMultipliedByChannels;o=s+this.targetWidthMultipliedByChannels;for(n=0;n<this.targetWidthMultipliedByChannels;++n){r[a++]=Math.round(t[s++]*h+t[o++]*f)}}while(a<this.finalResultSize){for(n=0,s=l*this.targetWidthMultipliedByChannels;n<this.targetWidthMultipliedByChannels;++n){r[a++]=Math.round(t[s++])}}return r};Resize.prototype.resizeHeightRGB=function(t){return this._resizeHeightRGBChannels(t,false)};Resize.prototype.resizeHeightRGBA=function(t){return this._resizeHeightRGBChannels(t,true)};Resize.prototype.resize=function(t){this.resizeCallback(this.resizeHeight(this.resizeWidth(t)))};Resize.prototype.bypassResizer=function(t){return t};Resize.prototype.initializeFirstPassBuffers=function(t){this.widthBuffer=this.generateFloatBuffer(this.widthPassResultSize);if(!t){this.outputWidthWorkBench=this.generateFloatBuffer(this.originalHeightMultipliedByChannels);if(this.colorChannels>3){this.outputWidthWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.heightOriginal)}}};Resize.prototype.initializeSecondPassBuffers=function(t){this.heightBuffer=this.generateUint8Buffer(this.finalResultSize);if(!t){this.outputHeightWorkBench=this.generateFloatBuffer(this.targetWidthMultipliedByChannels);if(this.colorChannels>3){this.outputHeightWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.targetWidth)}}};Resize.prototype.generateFloatBuffer=function(t){try{return new Float32Array(t)}catch(t){return[]}};Resize.prototype.generateFloat64Buffer=function(t){try{return new Float64Array(t)}catch(t){return[]}};Resize.prototype.generateUint8Buffer=function(t){try{return new Uint8Array(t)}catch(t){return[]}};t.exports=Resize},289:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.getExtension=e.getType=e.addType=void 0;var r={};var i=function findType(t){return Object.entries(r).find(function(e){return e[1].includes(t)})||[]};var a=function addType(t,e){r[t]=e};e.addType=a;var n=function getType(t){var e=t.split("/").slice(-1);var r=e[e.length-1].split(".").pop();var a=i(r);return a[0]};e.getType=n;var s=function getExtension(t){return(r[t.toLowerCase()]||[])[0]};e.getExtension=s},293:function(t){t.exports=require("buffer")},298:function(t){function _extends(){t.exports=_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r){if(Object.prototype.hasOwnProperty.call(r,i)){t[i]=r[i]}}}return t};return _extends.apply(this,arguments)}t.exports=_extends},304:function(t){t.exports=require("string_decoder")},312:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(431));var n=i(r(996));var s=i(r(622));var o=i(r(632));var h=r(19);var f=r(621);function xOffsetBasedOnAlignment(t,e,r,i,a){if(a===t.HORIZONTAL_ALIGN_LEFT){return 0}if(a===t.HORIZONTAL_ALIGN_CENTER){return(i-(0,f.measureText)(e,r))/2}return i-(0,f.measureText)(e,r)}function drawCharacter(t,e,r,i,a){if(a.width>0&&a.height>0){var n=e.pages[a.page];t.blit(n,r+a.xoffset,i+a.yoffset,a.x,a.y,a.width,a.height)}return t}function printText(t,e,r,i,a){for(var n=0;n<i.length;n++){var s=void 0;if(t.chars[i[n]]){s=i[n]}else if(/\s/.test(i[n])){s=""}else{s="?"}var o=t.chars[s]||{};var h=t.kernings[s];drawCharacter(this,t,e,r,o||{});var f=h&&h[i[n+1]]?h[i[n+1]]:0;e+=f+(o.xadvance||a)}}function splitLines(t,e,r){var i=e.split(" ");var a=[];var s=[];var o=0;i.forEach(function(e){var i=[].concat((0,n["default"])(s),[e]).join(" ");var h=(0,f.measureText)(t,i);if(h<=r){if(h>o){o=h}s.push(e)}else{a.push(s);s=[e]}});a.push(s);return{lines:a,longestLine:o}}function loadPages(t,e,r){var i=r.map(function(r){return t.read(e+"/"+r)});return Promise.all(i)}var l=process.env.DIRNAME||"".concat(__dirname,"/../");var u=function _default(){return{constants:{measureText:f.measureText,measureTextHeight:f.measureTextHeight,FONT_SANS_8_BLACK:s["default"].join(l,"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),FONT_SANS_10_BLACK:s["default"].join(l,"fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),FONT_SANS_12_BLACK:s["default"].join(l,"fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),FONT_SANS_14_BLACK:s["default"].join(l,"fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),FONT_SANS_16_BLACK:s["default"].join(l,"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),FONT_SANS_32_BLACK:s["default"].join(l,"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),FONT_SANS_64_BLACK:s["default"].join(l,"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),FONT_SANS_128_BLACK:s["default"].join(l,"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),FONT_SANS_8_WHITE:s["default"].join(l,"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),FONT_SANS_16_WHITE:s["default"].join(l,"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),FONT_SANS_32_WHITE:s["default"].join(l,"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),FONT_SANS_64_WHITE:s["default"].join(l,"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),FONT_SANS_128_WHITE:s["default"].join(l,"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),loadFont:function loadFont(t,e){var r=this;if(typeof t!=="string")return h.throwError.call(this,"file must be a string",e);return new Promise(function(i,a){e=e||function(t,e){if(t)a(t);else i(e)};(0,o["default"])(t,function(i,a){var n={};var o={};if(i){return h.throwError.call(r,i,e)}for(var f=0;f<a.chars.length;f++){n[String.fromCharCode(a.chars[f].id)]=a.chars[f]}for(var l=0;l<a.kernings.length;l++){var u=String.fromCharCode(a.kernings[l].first);o[u]=o[u]||{};o[u][String.fromCharCode(a.kernings[l].second)]=a.kernings[l].amount}loadPages(r,s["default"].dirname(t),a.pages).then(function(t){e(null,{chars:n,kernings:o,pages:t,common:a.common,info:a.info})})})})}},class:{print:function print(t,e,r,i,n,s,o){var l=this;if(typeof n==="function"&&typeof o==="undefined"){o=n;n=Infinity}if(typeof n==="undefined"){n=Infinity}if(typeof s==="function"&&typeof o==="undefined"){o=s;s=Infinity}if(typeof s==="undefined"){s=Infinity}if((0,a["default"])(t)!=="object"){return h.throwError.call(this,"font must be a Jimp loadFont",o)}if(typeof e!=="number"||typeof r!=="number"||typeof n!=="number"){return h.throwError.call(this,"x, y and maxWidth must be numbers",o)}if(typeof n!=="number"){return h.throwError.call(this,"maxWidth must be a number",o)}if(typeof s!=="number"){return h.throwError.call(this,"maxHeight must be a number",o)}var u;var c;if((0,a["default"])(i)==="object"&&i.text!==null&&i.text!==undefined){u=i.alignmentX||this.constructor.HORIZONTAL_ALIGN_LEFT;c=i.alignmentY||this.constructor.VERTICAL_ALIGN_TOP;var d=i;i=d.text}else{u=this.constructor.HORIZONTAL_ALIGN_LEFT;c=this.constructor.VERTICAL_ALIGN_TOP;i=i.toString()}if(s!==Infinity&&c===this.constructor.VERTICAL_ALIGN_BOTTOM){r+=s-(0,f.measureTextHeight)(t,i,n)}else if(s!==Infinity&&c===this.constructor.VERTICAL_ALIGN_MIDDLE){r+=s/2-(0,f.measureTextHeight)(t,i,n)/2}var p=Object.entries(t.chars)[0][1].xadvance;var v=splitLines(t,i,n),m=v.lines,g=v.longestLine;m.forEach(function(i){var a=i.join(" ");var s=xOffsetBasedOnAlignment(l.constructor,t,a,n,u);printText.call(l,t,e+s,r,a,p);r+=t.common.lineHeight});if((0,h.isNodePattern)(o)){o.call(this,null,this,{x:e+g,y:r})}return this}}}};e["default"]=u;t.exports=e.default},316:function(t){var e="chasrset";t.exports=function parseAttributes(t){if(e in t){t["charset"]=t[e];delete t[e]}for(var r in t){if(r==="face"||r==="charset")continue;else if(r==="padding"||r==="spacing")t[r]=parseIntList(t[r]);else t[r]=parseInt(t[r],10)}return t};function parseIntList(t){return t.split(",").map(function(t){return parseInt(t,10)})}},317:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(655));var n=i(r(65));var s=r(517);var o="image/gif";var h=function _default(){return{mime:(0,a["default"])({},o,["gif"]),constants:{MIME_GIF:o},decoders:(0,a["default"])({},o,function(t){var e=new n["default"].GifReader(t);var r=Buffer.alloc(e.width*e.height*4);e.decodeAndBlitFrameRGBA(0,r);return{data:r,width:e.width,height:e.height}}),encoders:(0,a["default"])({},o,function(t){var e=new s.BitmapImage(t.bitmap);s.GifUtil.quantizeDekker(e,256);var r=new s.GifFrame(e);var i=new s.GifCodec;return i.encodeGif([r],{}).then(function(t){return t.buffer})})}};e["default"]=h;t.exports=e.default},319:function(t,e,r){"use strict";var i=r(414);var a=[function(){},function(t,e,r,i){if(i===e.length){throw new Error("Ran out of data")}var a=e[i];t[r]=a;t[r+1]=a;t[r+2]=a;t[r+3]=255},function(t,e,r,i){if(i+1>=e.length){throw new Error("Ran out of data")}var a=e[i];t[r]=a;t[r+1]=a;t[r+2]=a;t[r+3]=e[i+1]},function(t,e,r,i){if(i+2>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=255},function(t,e,r,i){if(i+3>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=e[i+3]}];var n=[function(){},function(t,e,r,i){var a=e[0];t[r]=a;t[r+1]=a;t[r+2]=a;t[r+3]=i},function(t,e,r){var i=e[0];t[r]=i;t[r+1]=i;t[r+2]=i;t[r+3]=e[1]},function(t,e,r,i){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=i},function(t,e,r){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=e[3]}];function bitRetriever(t,e){var r=[];var i=0;function split(){if(i===t.length){throw new Error("Ran out of data")}var a=t[i];i++;var n,s,o,h,f,l,u,c;switch(e){default:throw new Error("unrecognised depth");case 16:u=t[i];i++;r.push((a<<8)+u);break;case 4:u=a&15;c=a>>4;r.push(c,u);break;case 2:f=a&3;l=a>>2&3;u=a>>4&3;c=a>>6&3;r.push(c,u,l,f);break;case 1:n=a&1;s=a>>1&1;o=a>>2&1;h=a>>3&1;f=a>>4&1;l=a>>5&1;u=a>>6&1;c=a>>7&1;r.push(c,u,l,f,h,o,s,n);break}}return{get:function(t){while(r.length<t){split()}var e=r.slice(0,t);r=r.slice(t);return e},resetAfterLine:function(){r.length=0},end:function(){if(i!==t.length){throw new Error("extra data found")}}}}function mapImage8Bit(t,e,r,i,n,s){var o=t.width;var h=t.height;var f=t.index;for(var l=0;l<h;l++){for(var u=0;u<o;u++){var c=r(u,l,f);a[i](e,n,c,s);s+=i}}return s}function mapImageCustomBit(t,e,r,i,a,s){var o=t.width;var h=t.height;var f=t.index;for(var l=0;l<h;l++){for(var u=0;u<o;u++){var c=a.get(i);var d=r(u,l,f);n[i](e,c,d,s)}a.resetAfterLine()}}e.dataToBitMap=function(t,e){var r=e.width;var a=e.height;var n=e.depth;var s=e.bpp;var o=e.interlace;if(n!==8){var h=bitRetriever(t,n)}var f;if(n<=8){f=new JIMPBUffer(r*a*4)}else{f=new Uint16Array(r*a*4)}var l=Math.pow(2,n)-1;var u=0;var c;var d;if(o){c=i.getImagePasses(r,a);d=i.getInterlaceIterator(r,a)}else{var p=0;d=function(){var t=p;p+=4;return t};c=[{width:r,height:a}]}for(var v=0;v<c.length;v++){if(n===8){u=mapImage8Bit(c[v],f,d,s,t,u)}else{mapImageCustomBit(c[v],f,d,s,h,l)}}if(n===8){if(u!==t.length){throw new Error("extra data found")}}else{h.end()}return f}},323:function(t){function BmpDecoder(t,e){this.pos=0;this.buffer=t;this.is_with_alpha=!!e;this.bottom_up=true;this.flag=this.buffer.toString("utf-8",0,this.pos+=2);if(this.flag!="BM")throw new Error("Invalid BMP File");this.parseHeader();this.parseRGBA()}BmpDecoder.prototype.parseHeader=function(){this.fileSize=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.reserved=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.offset=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.headerSize=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.width=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.height=this.buffer.readInt32LE(this.pos);this.pos+=4;this.planes=this.buffer.readUInt16LE(this.pos);this.pos+=2;this.bitPP=this.buffer.readUInt16LE(this.pos);this.pos+=2;this.compress=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.rawSize=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.hr=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.vr=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.colors=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.importantColors=this.buffer.readUInt32LE(this.pos);this.pos+=4;if(this.bitPP===16&&this.is_with_alpha){this.bitPP=15}if(this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var r=this.buffer.readUInt8(this.pos++);var i=this.buffer.readUInt8(this.pos++);var a=this.buffer.readUInt8(this.pos++);var n=this.buffer.readUInt8(this.pos++);this.palette[e]={red:a,green:i,blue:r,quad:n}}}if(this.height<0){this.height*=-1;this.bottom_up=false}};BmpDecoder.prototype.parseRGBA=function(){var t="bit"+this.bitPP;var e=this.width*this.height*4;this.data=new JIMPBUffer(e);this[t]()};BmpDecoder.prototype.bit1=function(){var t=Math.ceil(this.width/8);var e=t%4;var r=this.height>=0?this.height-1:-this.height;for(var r=this.height-1;r>=0;r--){var i=this.bottom_up?r:this.height-1-r;for(var a=0;a<t;a++){var n=this.buffer.readUInt8(this.pos++);var s=i*this.width*4+a*8*4;for(var o=0;o<8;o++){if(a*8+o<this.width){var h=this.palette[n>>7-o&1];this.data[s+o*4]=0;this.data[s+o*4+1]=h.blue;this.data[s+o*4+2]=h.green;this.data[s+o*4+3]=h.red}else{break}}}if(e!=0){this.pos+=4-e}}};BmpDecoder.prototype.bit4=function(){if(this.compress==2){this.data.fill(255);var t=0;var e=this.bottom_up?this.height-1:0;var r=false;while(t<this.data.length){var i=this.buffer.readUInt8(this.pos++);var a=this.buffer.readUInt8(this.pos++);if(i==0){if(a==0){if(this.bottom_up){e--}else{e++}t=e*this.width*4;r=false;continue}else if(a==1){break}else if(a==2){var n=this.buffer.readUInt8(this.pos++);var s=this.buffer.readUInt8(this.pos++);if(this.bottom_up){e-=s}else{e+=s}t+=s*this.width*4+n*4}else{var o=this.buffer.readUInt8(this.pos++);for(var h=0;h<a;h++){if(r){setPixelData.call(this,o&15)}else{setPixelData.call(this,(o&240)>>4)}if(h&1&&h+1<a){o=this.buffer.readUInt8(this.pos++)}r=!r}if((a+1>>1&1)==1){this.pos++}}}else{for(var h=0;h<i;h++){if(r){setPixelData.call(this,a&15)}else{setPixelData.call(this,(a&240)>>4)}r=!r}}}function setPixelData(e){var r=this.palette[e];this.data[t]=0;this.data[t+1]=r.blue;this.data[t+2]=r.green;this.data[t+3]=r.red;t+=4}}else{var f=Math.ceil(this.width/2);var l=f%4;for(var s=this.height-1;s>=0;s--){var u=this.bottom_up?s:this.height-1-s;for(var n=0;n<f;n++){var a=this.buffer.readUInt8(this.pos++);var t=u*this.width*4+n*2*4;var c=a>>4;var d=a&15;var p=this.palette[c];this.data[t]=0;this.data[t+1]=p.blue;this.data[t+2]=p.green;this.data[t+3]=p.red;if(n*2+1>=this.width)break;p=this.palette[d];this.data[t+4]=0;this.data[t+4+1]=p.blue;this.data[t+4+2]=p.green;this.data[t+4+3]=p.red}if(l!=0){this.pos+=4-l}}}};BmpDecoder.prototype.bit8=function(){if(this.compress==1){this.data.fill(255);var t=0;var e=this.bottom_up?this.height-1:0;while(t<this.data.length){var r=this.buffer.readUInt8(this.pos++);var i=this.buffer.readUInt8(this.pos++);if(r==0){if(i==0){if(this.bottom_up){e--}else{e++}t=e*this.width*4;continue}else if(i==1){break}else if(i==2){var a=this.buffer.readUInt8(this.pos++);var n=this.buffer.readUInt8(this.pos++);if(this.bottom_up){e-=n}else{e+=n}t+=n*this.width*4+a*4}else{for(var s=0;s<i;s++){var o=this.buffer.readUInt8(this.pos++);setPixelData.call(this,o)}if(i&1==1){this.pos++}}}else{for(var s=0;s<r;s++){setPixelData.call(this,i)}}}function setPixelData(e){var r=this.palette[e];this.data[t]=0;this.data[t+1]=r.blue;this.data[t+2]=r.green;this.data[t+3]=r.red;t+=4}}else{var h=this.width%4;for(var n=this.height-1;n>=0;n--){var f=this.bottom_up?n:this.height-1-n;for(var a=0;a<this.width;a++){var i=this.buffer.readUInt8(this.pos++);var t=f*this.width*4+a*4;if(i<this.palette.length){var l=this.palette[i];this.data[t]=0;this.data[t+1]=l.blue;this.data[t+2]=l.green;this.data[t+3]=l.red}else{this.data[t]=0;this.data[t+1]=255;this.data[t+2]=255;this.data[t+3]=255}}if(h!=0){this.pos+=4-h}}}};BmpDecoder.prototype.bit15=function(){var t=this.width%3;var e=parseInt("11111",2),r=e;for(var i=this.height-1;i>=0;i--){var a=this.bottom_up?i:this.height-1-i;for(var n=0;n<this.width;n++){var s=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(s&r)/r*255|0;var h=(s>>5&r)/r*255|0;var f=(s>>10&r)/r*255|0;var l=s>>15?255:0;var u=a*this.width*4+n*4;this.data[u]=l;this.data[u+1]=o;this.data[u+2]=h;this.data[u+3]=f}this.pos+=t}};BmpDecoder.prototype.bit16=function(){var t=this.width%2*2;this.maskRed=31744;this.maskGreen=992;this.maskBlue=31;this.mask0=0;if(this.compress==3){this.maskRed=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.maskGreen=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.maskBlue=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.mask0=this.buffer.readUInt32LE(this.pos);this.pos+=4}var e=[0,0,0];for(var r=0;r<16;r++){if(this.maskRed>>r&1)e[0]++;if(this.maskGreen>>r&1)e[1]++;if(this.maskBlue>>r&1)e[2]++}e[1]+=e[0];e[2]+=e[1];e[0]=8-e[0];e[1]-=8;e[2]-=8;for(var i=this.height-1;i>=0;i--){var a=this.bottom_up?i:this.height-1-i;for(var n=0;n<this.width;n++){var s=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(s&this.maskBlue)<<e[0];var h=(s&this.maskGreen)>>e[1];var f=(s&this.maskRed)>>e[2];var l=a*this.width*4+n*4;this.data[l]=0;this.data[l+1]=o;this.data[l+2]=h;this.data[l+3]=f}this.pos+=t}};BmpDecoder.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){var e=this.bottom_up?t:this.height-1-t;for(var r=0;r<this.width;r++){var i=this.buffer.readUInt8(this.pos++);var a=this.buffer.readUInt8(this.pos++);var n=this.buffer.readUInt8(this.pos++);var s=e*this.width*4+r*4;this.data[s]=0;this.data[s+1]=i;this.data[s+2]=a;this.data[s+3]=n}this.pos+=this.width%4}};BmpDecoder.prototype.bit32=function(){if(this.compress==3){this.maskRed=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.maskGreen=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.maskBlue=this.buffer.readUInt32LE(this.pos);this.pos+=4;this.mask0=this.buffer.readUInt32LE(this.pos);this.pos+=4;for(var t=this.height-1;t>=0;t--){var e=this.bottom_up?t:this.height-1-t;for(var r=0;r<this.width;r++){var i=this.buffer.readUInt8(this.pos++);var a=this.buffer.readUInt8(this.pos++);var n=this.buffer.readUInt8(this.pos++);var s=this.buffer.readUInt8(this.pos++);var o=e*this.width*4+r*4;this.data[o]=i;this.data[o+1]=a;this.data[o+2]=n;this.data[o+3]=s}}}else{for(var t=this.height-1;t>=0;t--){var e=this.bottom_up?t:this.height-1-t;for(var r=0;r<this.width;r++){var a=this.buffer.readUInt8(this.pos++);var n=this.buffer.readUInt8(this.pos++);var s=this.buffer.readUInt8(this.pos++);var i=this.buffer.readUInt8(this.pos++);var o=e*this.width*4+r*4;this.data[o]=i;this.data[o+1]=a;this.data[o+2]=n;this.data[o+3]=s}}}};BmpDecoder.prototype.getData=function(){return this.data};t.exports=function(t){var e=new BmpDecoder(t);return e}},324:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);function dither(t){var e=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,r,i){var a=((r&3)<<2)+t%4;var n=e[a];this.bitmap.data[i]=Math.min(this.bitmap.data[i]+n,255);this.bitmap.data[i+1]=Math.min(this.bitmap.data[i+1]+n,255);this.bitmap.data[i+2]=Math.min(this.bitmap.data[i+2]+n,255)});if((0,i.isNodePattern)(t)){t.call(this,null,this)}return this}var a=function _default(){return{dither565:dither,dither16:dither}};e["default"]=a;t.exports=e.default},330:function(t,e,r){"use strict";var i=r(407);Object.defineProperty(e,"__esModule",{value:true});e["default"]=composite;var a=r(19);var n=i(r(963));var s=i(r(97));function composite(t,e,r){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var o=arguments.length>4?arguments[4]:undefined;if(typeof i==="function"){o=i;i={}}if(!(t instanceof this.constructor)){return a.throwError.call(this,"The source must be a Jimp image",o)}if(typeof e!=="number"||typeof r!=="number"){return a.throwError.call(this,"x and y must be numbers",o)}var h=i,f=h.mode,l=h.opacitySource,u=h.opacityDest;if(!f){f=n.BLEND_SOURCE_OVER}if(typeof l!=="number"||l<0||l>1){l=1}if(typeof u!=="number"||u<0||u>1){u=1}var c=s[f];e=Math.round(e);r=Math.round(r);var d=this;if(u!==1){d.opacity(u)}t.scanQuiet(0,0,t.bitmap.width,t.bitmap.height,function(t,i,a){var s=d.getPixelIndex(e+t,r+i,n.EDGE_CROP);var o=c({r:this.bitmap.data[a+0]/255,g:this.bitmap.data[a+1]/255,b:this.bitmap.data[a+2]/255,a:this.bitmap.data[a+3]/255},{r:d.bitmap.data[s+0]/255,g:d.bitmap.data[s+1]/255,b:d.bitmap.data[s+2]/255,a:d.bitmap.data[s+3]/255},l);d.bitmap.data[s+0]=this.constructor.limit255(o.r*255);d.bitmap.data[s+1]=this.constructor.limit255(o.g*255);d.bitmap.data[s+2]=this.constructor.limit255(o.b*255);d.bitmap.data[s+3]=this.constructor.limit255(o.a*255)});if((0,a.isNodePattern)(o)){o.call(this,null,this)}return this}t.exports=e.default},334:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(655));var n=i(r(627));var s=r(19);var o="image/bmp";var h="image/x-ms-bmp";function toAGBR(t){return(0,s.scan)(t,0,0,t.bitmap.width,t.bitmap.height,function(t,e,r){var i=this.bitmap.data[r+0];var a=this.bitmap.data[r+1];var n=this.bitmap.data[r+2];var s=this.bitmap.data[r+3];this.bitmap.data[r+0]=s;this.bitmap.data[r+1]=n;this.bitmap.data[r+2]=a;this.bitmap.data[r+3]=i}).bitmap}function fromAGBR(t){return(0,s.scan)({bitmap:t},0,0,t.width,t.height,function(e,r,i){var a=this.bitmap.data[i+0];var n=this.bitmap.data[i+1];var s=this.bitmap.data[i+2];var o=this.bitmap.data[i+3];this.bitmap.data[i+0]=o;this.bitmap.data[i+1]=s;this.bitmap.data[i+2]=n;this.bitmap.data[i+3]=t.is_with_alpha?a:255}).bitmap}var f=function decode(t){return fromAGBR(n["default"].decode(t))};var l=function encode(t){return n["default"].encode(toAGBR(t)).data};var u=function _default(){var t,e;return{mime:(0,a["default"])({},o,["bmp"]),constants:{MIME_BMP:o,MIME_X_MS_BMP:h},decoders:(t={},(0,a["default"])(t,o,f),(0,a["default"])(t,h,f),t),encoders:(e={},(0,a["default"])(e,o,l),(0,a["default"])(e,h,l),e)}};e["default"]=u;t.exports=e.default},343:function(t){t.exports=require("timers")},346:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{cover:function cover(t,e,r,a,n){if(typeof t!=="number"||typeof e!=="number"){return i.throwError.call(this,"w and h must be numbers",n)}if(r&&typeof r==="function"&&typeof n==="undefined"){n=r;r=null;a=null}else if(typeof a==="function"&&typeof n==="undefined"){n=a;a=null}r=r||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE;var s=r&(1<<3)-1;var o=r>>3;if(!(s!==0&&!(s&s-1)||o!==0&&!(o&o-1)))return i.throwError.call(this,"only use one flag per alignment direction",n);var h=s>>1;var f=o>>1;var l=t/e>this.bitmap.width/this.bitmap.height?t/this.bitmap.width:e/this.bitmap.height;this.scale(l,a);this.crop((this.bitmap.width-t)/2*h,(this.bitmap.height-e)/2*f,t,e);if((0,i.isNodePattern)(n)){n.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},350:function(t,e){(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/);e.normalize=function(t){return t.toLowerCase()};e.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)};e.stripPrefix=function(e){return e.replace(t,"")};e.parseNumbers=function(t){if(!isNaN(t)){t=t%1===0?parseInt(t,10):parseFloat(t)}return t};e.parseBooleans=function(t){if(/^(?:true|false)$/i.test(t)){t=t.toLowerCase()==="true"}return t}}).call(this)},357:function(t){t.exports=require("assert")},367:function(t,e,r){"use strict";var i=true;var a=r(761);if(!a.deflateSync){i=false}var n=r(268);var s=r(189);t.exports=function(t,e){if(!i){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}var r=e||{};var o=new s(r);var h=[];h.push(new JIMPBUffer(n.PNG_SIGNATURE));h.push(o.packIHDR(t.width,t.height));if(t.gamma){h.push(o.packGAMA(t.gamma))}var f=o.filterData(t.data,t.width,t.height);var l=a.deflateSync(f,o.getDeflateOptions());f=null;if(!l||!l.length){throw new Error("bad png - invalid compressed data response")}h.push(o.packIDAT(l));h.push(o.packIEND());return Buffer.concat(h)}},378:function(t,e,r){"use strict";var i=r(999);var a=r(43);var n=r(141);var s=r(613);var o=r(868);var h=0;var f=1;var l=3;var u=4;var c=5;var d=0;var p=1;var v=-2;var m=-3;var g=-5;var b=-1;var y=1;var E=2;var M=3;var w=4;var _=0;var x=2;var I=8;var D=9;var L=15;var T=8;var P=29;var k=256;var O=k+1+P;var N=30;var S=19;var A=2*O+1;var B=15;var C=3;var R=258;var F=R+C+1;var X=32;var G=42;var U=69;var z=73;var W=91;var H=103;var Q=113;var j=666;var V=1;var Y=2;var J=3;var K=4;var Z=3;function err(t,e){t.msg=o[e];return e}function rank(t){return(t<<1)-(t>4?9:0)}function zero(t){var e=t.length;while(--e>=0){t[e]=0}}function flush_pending(t){var e=t.state;var r=e.pending;if(r>t.avail_out){r=t.avail_out}if(r===0){return}i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out);t.next_out+=r;e.pending_out+=r;t.total_out+=r;t.avail_out-=r;e.pending-=r;if(e.pending===0){e.pending_out=0}}function flush_block_only(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e);t.block_start=t.strstart;flush_pending(t.strm)}function put_byte(t,e){t.pending_buf[t.pending++]=e}function putShortMSB(t,e){t.pending_buf[t.pending++]=e>>>8&255;t.pending_buf[t.pending++]=e&255}function read_buf(t,e,r,a){var o=t.avail_in;if(o>a){o=a}if(o===0){return 0}t.avail_in-=o;i.arraySet(e,t.input,t.next_in,o,r);if(t.state.wrap===1){t.adler=n(t.adler,e,o,r)}else if(t.state.wrap===2){t.adler=s(t.adler,e,o,r)}t.next_in+=o;t.total_in+=o;return o}function longest_match(t,e){var r=t.max_chain_length;var i=t.strstart;var a;var n;var s=t.prev_length;var o=t.nice_match;var h=t.strstart>t.w_size-F?t.strstart-(t.w_size-F):0;var f=t.window;var l=t.w_mask;var u=t.prev;var c=t.strstart+R;var d=f[i+s-1];var p=f[i+s];if(t.prev_length>=t.good_match){r>>=2}if(o>t.lookahead){o=t.lookahead}do{a=e;if(f[a+s]!==p||f[a+s-1]!==d||f[a]!==f[i]||f[++a]!==f[i+1]){continue}i+=2;a++;do{}while(f[++i]===f[++a]&&f[++i]===f[++a]&&f[++i]===f[++a]&&f[++i]===f[++a]&&f[++i]===f[++a]&&f[++i]===f[++a]&&f[++i]===f[++a]&&f[++i]===f[++a]&&i<c);n=R-(c-i);i=c-R;if(n>s){t.match_start=e;s=n;if(n>=o){break}d=f[i+s-1];p=f[i+s]}}while((e=u[e&l])>h&&--r!==0);if(s<=t.lookahead){return s}return t.lookahead}function fill_window(t){var e=t.w_size;var r,a,n,s,o;do{s=t.window_size-t.lookahead-t.strstart;if(t.strstart>=e+(e-F)){i.arraySet(t.window,t.window,e,e,0);t.match_start-=e;t.strstart-=e;t.block_start-=e;a=t.hash_size;r=a;do{n=t.head[--r];t.head[r]=n>=e?n-e:0}while(--a);a=e;r=a;do{n=t.prev[--r];t.prev[r]=n>=e?n-e:0}while(--a);s+=e}if(t.strm.avail_in===0){break}a=read_buf(t.strm,t.window,t.strstart+t.lookahead,s);t.lookahead+=a;if(t.lookahead+t.insert>=C){o=t.strstart-t.insert;t.ins_h=t.window[o];t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;while(t.insert){t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+C-1])&t.hash_mask;t.prev[o&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=o;o++;t.insert--;if(t.lookahead+t.insert<C){break}}}}while(t.lookahead<F&&t.strm.avail_in!==0)}function deflate_stored(t,e){var r=65535;if(r>t.pending_buf_size-5){r=t.pending_buf_size-5}for(;;){if(t.lookahead<=1){fill_window(t);if(t.lookahead===0&&e===h){return V}if(t.lookahead===0){break}}t.strstart+=t.lookahead;t.lookahead=0;var i=t.block_start+r;if(t.strstart===0||t.strstart>=i){t.lookahead=t.strstart-i;t.strstart=i;flush_block_only(t,false);if(t.strm.avail_out===0){return V}}if(t.strstart-t.block_start>=t.w_size-F){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}}t.insert=0;if(e===u){flush_block_only(t,true);if(t.strm.avail_out===0){return J}return K}if(t.strstart>t.block_start){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}return V}function deflate_fast(t,e){var r;var i;for(;;){if(t.lookahead<F){fill_window(t);if(t.lookahead<F&&e===h){return V}if(t.lookahead===0){break}}r=0;if(t.lookahead>=C){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}if(r!==0&&t.strstart-r<=t.w_size-F){t.match_length=longest_match(t,r)}if(t.match_length>=C){i=a._tr_tally(t,t.strstart-t.match_start,t.match_length-C);t.lookahead-=t.match_length;if(t.match_length<=t.max_lazy_match&&t.lookahead>=C){t.match_length--;do{t.strstart++;t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}while(--t.match_length!==0);t.strstart++}else{t.strstart+=t.match_length;t.match_length=0;t.ins_h=t.window[t.strstart];t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask}}else{i=a._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(i){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}}t.insert=t.strstart<C-1?t.strstart:C-1;if(e===u){flush_block_only(t,true);if(t.strm.avail_out===0){return J}return K}if(t.last_lit){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}return Y}function deflate_slow(t,e){var r;var i;var n;for(;;){if(t.lookahead<F){fill_window(t);if(t.lookahead<F&&e===h){return V}if(t.lookahead===0){break}}r=0;if(t.lookahead>=C){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}t.prev_length=t.match_length;t.prev_match=t.match_start;t.match_length=C-1;if(r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-F){t.match_length=longest_match(t,r);if(t.match_length<=5&&(t.strategy===y||t.match_length===C&&t.strstart-t.match_start>4096)){t.match_length=C-1}}if(t.prev_length>=C&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-C;i=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C);t.lookahead-=t.prev_length-1;t.prev_length-=2;do{if(++t.strstart<=n){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}}while(--t.prev_length!==0);t.match_available=0;t.match_length=C-1;t.strstart++;if(i){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}}else if(t.match_available){i=a._tr_tally(t,0,t.window[t.strstart-1]);if(i){flush_block_only(t,false)}t.strstart++;t.lookahead--;if(t.strm.avail_out===0){return V}}else{t.match_available=1;t.strstart++;t.lookahead--}}if(t.match_available){i=a._tr_tally(t,0,t.window[t.strstart-1]);t.match_available=0}t.insert=t.strstart<C-1?t.strstart:C-1;if(e===u){flush_block_only(t,true);if(t.strm.avail_out===0){return J}return K}if(t.last_lit){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}return Y}function deflate_rle(t,e){var r;var i;var n,s;var o=t.window;for(;;){if(t.lookahead<=R){fill_window(t);if(t.lookahead<=R&&e===h){return V}if(t.lookahead===0){break}}t.match_length=0;if(t.lookahead>=C&&t.strstart>0){n=t.strstart-1;i=o[n];if(i===o[++n]&&i===o[++n]&&i===o[++n]){s=t.strstart+R;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<s);t.match_length=R-(s-n);if(t.match_length>t.lookahead){t.match_length=t.lookahead}}}if(t.match_length>=C){r=a._tr_tally(t,1,t.match_length-C);t.lookahead-=t.match_length;t.strstart+=t.match_length;t.match_length=0}else{r=a._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(r){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}}t.insert=0;if(e===u){flush_block_only(t,true);if(t.strm.avail_out===0){return J}return K}if(t.last_lit){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}return Y}function deflate_huff(t,e){var r;for(;;){if(t.lookahead===0){fill_window(t);if(t.lookahead===0){if(e===h){return V}break}}t.match_length=0;r=a._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++;if(r){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}}t.insert=0;if(e===u){flush_block_only(t,true);if(t.strm.avail_out===0){return J}return K}if(t.last_lit){flush_block_only(t,false);if(t.strm.avail_out===0){return V}}return Y}function Config(t,e,r,i,a){this.good_length=t;this.max_lazy=e;this.nice_length=r;this.max_chain=i;this.func=a}var $;$=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)];function lm_init(t){t.window_size=2*t.w_size;zero(t.head);t.max_lazy_match=$[t.level].max_lazy;t.good_match=$[t.level].good_length;t.nice_match=$[t.level].nice_length;t.max_chain_length=$[t.level].max_chain;t.strstart=0;t.block_start=0;t.lookahead=0;t.insert=0;t.match_length=t.prev_length=C-1;t.match_available=0;t.ins_h=0}function DeflateState(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=I;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new i.Buf16(A*2);this.dyn_dtree=new i.Buf16((2*N+1)*2);this.bl_tree=new i.Buf16((2*S+1)*2);zero(this.dyn_ltree);zero(this.dyn_dtree);zero(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new i.Buf16(B+1);this.heap=new i.Buf16(2*O+1);zero(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new i.Buf16(2*O+1);zero(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function deflateResetKeep(t){var e;if(!t||!t.state){return err(t,v)}t.total_in=t.total_out=0;t.data_type=x;e=t.state;e.pending=0;e.pending_out=0;if(e.wrap<0){e.wrap=-e.wrap}e.status=e.wrap?G:Q;t.adler=e.wrap===2?0:1;e.last_flush=h;a._tr_init(e);return d}function deflateReset(t){var e=deflateResetKeep(t);if(e===d){lm_init(t.state)}return e}function deflateSetHeader(t,e){if(!t||!t.state){return v}if(t.state.wrap!==2){return v}t.state.gzhead=e;return d}function deflateInit2(t,e,r,a,n,s){if(!t){return v}var o=1;if(e===b){e=6}if(a<0){o=0;a=-a}else if(a>15){o=2;a-=16}if(n<1||n>D||r!==I||a<8||a>15||e<0||e>9||s<0||s>w){return err(t,v)}if(a===8){a=9}var h=new DeflateState;t.state=h;h.strm=t;h.wrap=o;h.gzhead=null;h.w_bits=a;h.w_size=1<<h.w_bits;h.w_mask=h.w_size-1;h.hash_bits=n+7;h.hash_size=1<<h.hash_bits;h.hash_mask=h.hash_size-1;h.hash_shift=~~((h.hash_bits+C-1)/C);h.window=new i.Buf8(h.w_size*2);h.head=new i.Buf16(h.hash_size);h.prev=new i.Buf16(h.w_size);h.lit_bufsize=1<<n+6;h.pending_buf_size=h.lit_bufsize*4;h.pending_buf=new i.Buf8(h.pending_buf_size);h.d_buf=1*h.lit_bufsize;h.l_buf=(1+2)*h.lit_bufsize;h.level=e;h.strategy=s;h.method=r;return deflateReset(t)}function deflateInit(t,e){return deflateInit2(t,e,I,L,T,_)}function deflate(t,e){var r,i;var n,o;if(!t||!t.state||e>c||e<0){return t?err(t,v):v}i=t.state;if(!t.output||!t.input&&t.avail_in!==0||i.status===j&&e!==u){return err(t,t.avail_out===0?g:v)}i.strm=t;r=i.last_flush;i.last_flush=e;if(i.status===G){if(i.wrap===2){t.adler=0;put_byte(i,31);put_byte(i,139);put_byte(i,8);if(!i.gzhead){put_byte(i,0);put_byte(i,0);put_byte(i,0);put_byte(i,0);put_byte(i,0);put_byte(i,i.level===9?2:i.strategy>=E||i.level<2?4:0);put_byte(i,Z);i.status=Q}else{put_byte(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(!i.gzhead.extra?0:4)+(!i.gzhead.name?0:8)+(!i.gzhead.comment?0:16));put_byte(i,i.gzhead.time&255);put_byte(i,i.gzhead.time>>8&255);put_byte(i,i.gzhead.time>>16&255);put_byte(i,i.gzhead.time>>24&255);put_byte(i,i.level===9?2:i.strategy>=E||i.level<2?4:0);put_byte(i,i.gzhead.os&255);if(i.gzhead.extra&&i.gzhead.extra.length){put_byte(i,i.gzhead.extra.length&255);put_byte(i,i.gzhead.extra.length>>8&255)}if(i.gzhead.hcrc){t.adler=s(t.adler,i.pending_buf,i.pending,0)}i.gzindex=0;i.status=U}}else{var m=I+(i.w_bits-8<<4)<<8;var b=-1;if(i.strategy>=E||i.level<2){b=0}else if(i.level<6){b=1}else if(i.level===6){b=2}else{b=3}m|=b<<6;if(i.strstart!==0){m|=X}m+=31-m%31;i.status=Q;putShortMSB(i,m);if(i.strstart!==0){putShortMSB(i,t.adler>>>16);putShortMSB(i,t.adler&65535)}t.adler=1}}if(i.status===U){if(i.gzhead.extra){n=i.pending;while(i.gzindex<(i.gzhead.extra.length&65535)){if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=s(t.adler,i.pending_buf,i.pending-n,n)}flush_pending(t);n=i.pending;if(i.pending===i.pending_buf_size){break}}put_byte(i,i.gzhead.extra[i.gzindex]&255);i.gzindex++}if(i.gzhead.hcrc&&i.pending>n){t.adler=s(t.adler,i.pending_buf,i.pending-n,n)}if(i.gzindex===i.gzhead.extra.length){i.gzindex=0;i.status=z}}else{i.status=z}}if(i.status===z){if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=s(t.adler,i.pending_buf,i.pending-n,n)}flush_pending(t);n=i.pending;if(i.pending===i.pending_buf_size){o=1;break}}if(i.gzindex<i.gzhead.name.length){o=i.gzhead.name.charCodeAt(i.gzindex++)&255}else{o=0}put_byte(i,o)}while(o!==0);if(i.gzhead.hcrc&&i.pending>n){t.adler=s(t.adler,i.pending_buf,i.pending-n,n)}if(o===0){i.gzindex=0;i.status=W}}else{i.status=W}}if(i.status===W){if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=s(t.adler,i.pending_buf,i.pending-n,n)}flush_pending(t);n=i.pending;if(i.pending===i.pending_buf_size){o=1;break}}if(i.gzindex<i.gzhead.comment.length){o=i.gzhead.comment.charCodeAt(i.gzindex++)&255}else{o=0}put_byte(i,o)}while(o!==0);if(i.gzhead.hcrc&&i.pending>n){t.adler=s(t.adler,i.pending_buf,i.pending-n,n)}if(o===0){i.status=H}}else{i.status=H}}if(i.status===H){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size){flush_pending(t)}if(i.pending+2<=i.pending_buf_size){put_byte(i,t.adler&255);put_byte(i,t.adler>>8&255);t.adler=0;i.status=Q}}else{i.status=Q}}if(i.pending!==0){flush_pending(t);if(t.avail_out===0){i.last_flush=-1;return d}}else if(t.avail_in===0&&rank(e)<=rank(r)&&e!==u){return err(t,g)}if(i.status===j&&t.avail_in!==0){return err(t,g)}if(t.avail_in!==0||i.lookahead!==0||e!==h&&i.status!==j){var y=i.strategy===E?deflate_huff(i,e):i.strategy===M?deflate_rle(i,e):$[i.level].func(i,e);if(y===J||y===K){i.status=j}if(y===V||y===J){if(t.avail_out===0){i.last_flush=-1}return d}if(y===Y){if(e===f){a._tr_align(i)}else if(e!==c){a._tr_stored_block(i,0,0,false);if(e===l){zero(i.head);if(i.lookahead===0){i.strstart=0;i.block_start=0;i.insert=0}}}flush_pending(t);if(t.avail_out===0){i.last_flush=-1;return d}}}if(e!==u){return d}if(i.wrap<=0){return p}if(i.wrap===2){put_byte(i,t.adler&255);put_byte(i,t.adler>>8&255);put_byte(i,t.adler>>16&255);put_byte(i,t.adler>>24&255);put_byte(i,t.total_in&255);put_byte(i,t.total_in>>8&255);put_byte(i,t.total_in>>16&255);put_byte(i,t.total_in>>24&255)}else{putShortMSB(i,t.adler>>>16);putShortMSB(i,t.adler&65535)}flush_pending(t);if(i.wrap>0){i.wrap=-i.wrap}return i.pending!==0?d:p}function deflateEnd(t){var e;if(!t||!t.state){return v}e=t.state.status;if(e!==G&&e!==U&&e!==z&&e!==W&&e!==H&&e!==Q&&e!==j){return err(t,v)}t.state=null;return e===Q?err(t,m):d}function deflateSetDictionary(t,e){var r=e.length;var a;var s,o;var h;var f;var l;var u;var c;if(!t||!t.state){return v}a=t.state;h=a.wrap;if(h===2||h===1&&a.status!==G||a.lookahead){return v}if(h===1){t.adler=n(t.adler,e,r,0)}a.wrap=0;if(r>=a.w_size){if(h===0){zero(a.head);a.strstart=0;a.block_start=0;a.insert=0}c=new i.Buf8(a.w_size);i.arraySet(c,e,r-a.w_size,a.w_size,0);e=c;r=a.w_size}f=t.avail_in;l=t.next_in;u=t.input;t.avail_in=r;t.next_in=0;t.input=e;fill_window(a);while(a.lookahead>=C){s=a.strstart;o=a.lookahead-(C-1);do{a.ins_h=(a.ins_h<<a.hash_shift^a.window[s+C-1])&a.hash_mask;a.prev[s&a.w_mask]=a.head[a.ins_h];a.head[a.ins_h]=s;s++}while(--o);a.strstart=s;a.lookahead=C-1;fill_window(a)}a.strstart+=a.lookahead;a.block_start=a.strstart;a.insert=a.lookahead;a.lookahead=0;a.match_length=a.prev_length=C-1;a.match_available=0;t.next_in=l;t.input=u;t.avail_in=f;a.wrap=h;return d}e.deflateInit=deflateInit;e.deflateInit2=deflateInit2;e.deflateReset=deflateReset;e.deflateResetKeep=deflateResetKeep;e.deflateSetHeader=deflateSetHeader;e.deflate=deflate;e.deflateEnd=deflateEnd;e.deflateSetDictionary=deflateSetDictionary;e.deflateInfo="pako deflate (from Nodeca project)"},381:function(t,e,r){var i=r(293).Buffer;t.exports=function(t,e){if(!i.isBuffer(t))return undefined;if(!i.isBuffer(e))return undefined;if(typeof t.equals==="function")return t.equals(e);if(t.length!==e.length)return false;for(var r=0;r<t.length;r++){if(t[r]!==e[r])return false}return true}},382:function(t,e,r){var i=r(525);var a=r(831);var n=r(705);var s=r(849);function _slicedToArray(t,e){return i(t)||a(t,e)||n(t,e)||s()}t.exports=_slicedToArray},396:function(t,e,r){"use strict";var i=r(407);var a=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=configure;var n=a(r(996));var s=a(r(655));var o=a(r(382));var h=i(r(26));function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);if(e)i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable});r.push.apply(r,i)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};if(e%2){ownKeys(r,true).forEach(function(e){(0,s["default"])(t,e,r[e])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))}else{ownKeys(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}}return t}function configure(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:h["default"];var r={hasAlpha:{},encoders:{},decoders:{},class:{},constants:{}};function addToConfig(t){Object.entries(t).forEach(function(t){var e=(0,o["default"])(t,2),i=e[0],a=e[1];r[i]=_objectSpread({},r[i],{},a)})}function addImageType(t){var e=t();if(Array.isArray(e.mime)){h.addType.apply(void 0,(0,n["default"])(e.mime))}else{Object.entries(e.mime).forEach(function(t){return h.addType.apply(void 0,(0,n["default"])(t))})}delete e.mime;addToConfig(e)}function addPlugin(t){var e=t(h.jimpEvChange)||{};if(!e["class"]&&!e.constants){addToConfig({class:e})}else{addToConfig(e)}}if(t.types){t.types.forEach(addImageType);e.decoders=_objectSpread({},e.decoders,{},r.decoders);e.encoders=_objectSpread({},e.encoders,{},r.encoders);e.hasAlpha=_objectSpread({},e.hasAlpha,{},r.hasAlpha)}if(t.plugins){t.plugins.forEach(addPlugin)}(0,h.addJimpMethods)(r["class"],e);(0,h.addConstants)(r.constants,e);return h["default"]}t.exports=e.default},401:function(t,e,r){"use strict";var i=r(999);var a=r(141);var n=r(613);var s=r(181);var o=r(685);var h=0;var f=1;var l=2;var u=4;var c=5;var d=6;var p=0;var v=1;var m=2;var g=-2;var b=-3;var y=-4;var E=-5;var M=8;var w=1;var _=2;var x=3;var I=4;var D=5;var L=6;var T=7;var P=8;var k=9;var O=10;var N=11;var S=12;var A=13;var B=14;var C=15;var R=16;var F=17;var X=18;var G=19;var U=20;var z=21;var W=22;var H=23;var Q=24;var j=25;var V=26;var Y=27;var J=28;var K=29;var Z=30;var $=31;var q=32;var tt=852;var et=592;var rt=15;var it=rt;function zswap32(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function InflateState(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new i.Buf16(320);this.work=new i.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function inflateResetKeep(t){var e;if(!t||!t.state){return g}e=t.state;t.total_in=t.total_out=e.total=0;t.msg="";if(e.wrap){t.adler=e.wrap&1}e.mode=w;e.last=0;e.havedict=0;e.dmax=32768;e.head=null;e.hold=0;e.bits=0;e.lencode=e.lendyn=new i.Buf32(tt);e.distcode=e.distdyn=new i.Buf32(et);e.sane=1;e.back=-1;return p}function inflateReset(t){var e;if(!t||!t.state){return g}e=t.state;e.wsize=0;e.whave=0;e.wnext=0;return inflateResetKeep(t)}function inflateReset2(t,e){var r;var i;if(!t||!t.state){return g}i=t.state;if(e<0){r=0;e=-e}else{r=(e>>4)+1;if(e<48){e&=15}}if(e&&(e<8||e>15)){return g}if(i.window!==null&&i.wbits!==e){i.window=null}i.wrap=r;i.wbits=e;return inflateReset(t)}function inflateInit2(t,e){var r;var i;if(!t){return g}i=new InflateState;t.state=i;i.window=null;r=inflateReset2(t,e);if(r!==p){t.state=null}return r}function inflateInit(t){return inflateInit2(t,it)}var at=true;var nt,st;function fixedtables(t){if(at){var e;nt=new i.Buf32(512);st=new i.Buf32(32);e=0;while(e<144){t.lens[e++]=8}while(e<256){t.lens[e++]=9}while(e<280){t.lens[e++]=7}while(e<288){t.lens[e++]=8}o(f,t.lens,0,288,nt,0,t.work,{bits:9});e=0;while(e<32){t.lens[e++]=5}o(l,t.lens,0,32,st,0,t.work,{bits:5});at=false}t.lencode=nt;t.lenbits=9;t.distcode=st;t.distbits=5}function updatewindow(t,e,r,a){var n;var s=t.state;if(s.window===null){s.wsize=1<<s.wbits;s.wnext=0;s.whave=0;s.window=new i.Buf8(s.wsize)}if(a>=s.wsize){i.arraySet(s.window,e,r-s.wsize,s.wsize,0);s.wnext=0;s.whave=s.wsize}else{n=s.wsize-s.wnext;if(n>a){n=a}i.arraySet(s.window,e,r-a,n,s.wnext);a-=n;if(a){i.arraySet(s.window,e,r-a,a,0);s.wnext=a;s.whave=s.wsize}else{s.wnext+=n;if(s.wnext===s.wsize){s.wnext=0}if(s.whave<s.wsize){s.whave+=n}}}return 0}function inflate(t,e){var r;var tt,et;var rt;var it;var at,nt;var st;var ot;var ht,ft;var lt;var ut;var ct;var dt=0;var pt,vt,mt;var gt,bt,yt;var Et;var Mt;var wt=new i.Buf8(4);var _t;var xt;var It=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0){return g}r=t.state;if(r.mode===S){r.mode=A}it=t.next_out;et=t.output;nt=t.avail_out;rt=t.next_in;tt=t.input;at=t.avail_in;st=r.hold;ot=r.bits;ht=at;ft=nt;Mt=p;t:for(;;){switch(r.mode){case w:if(r.wrap===0){r.mode=A;break}while(ot<16){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if(r.wrap&2&&st===35615){r.check=0;wt[0]=st&255;wt[1]=st>>>8&255;r.check=n(r.check,wt,2,0);st=0;ot=0;r.mode=_;break}r.flags=0;if(r.head){r.head.done=false}if(!(r.wrap&1)||(((st&255)<<8)+(st>>8))%31){t.msg="incorrect header check";r.mode=Z;break}if((st&15)!==M){t.msg="unknown compression method";r.mode=Z;break}st>>>=4;ot-=4;Et=(st&15)+8;if(r.wbits===0){r.wbits=Et}else if(Et>r.wbits){t.msg="invalid window size";r.mode=Z;break}r.dmax=1<<Et;t.adler=r.check=1;r.mode=st&512?O:S;st=0;ot=0;break;case _:while(ot<16){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}r.flags=st;if((r.flags&255)!==M){t.msg="unknown compression method";r.mode=Z;break}if(r.flags&57344){t.msg="unknown header flags set";r.mode=Z;break}if(r.head){r.head.text=st>>8&1}if(r.flags&512){wt[0]=st&255;wt[1]=st>>>8&255;r.check=n(r.check,wt,2,0)}st=0;ot=0;r.mode=x;case x:while(ot<32){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if(r.head){r.head.time=st}if(r.flags&512){wt[0]=st&255;wt[1]=st>>>8&255;wt[2]=st>>>16&255;wt[3]=st>>>24&255;r.check=n(r.check,wt,4,0)}st=0;ot=0;r.mode=I;case I:while(ot<16){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if(r.head){r.head.xflags=st&255;r.head.os=st>>8}if(r.flags&512){wt[0]=st&255;wt[1]=st>>>8&255;r.check=n(r.check,wt,2,0)}st=0;ot=0;r.mode=D;case D:if(r.flags&1024){while(ot<16){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}r.length=st;if(r.head){r.head.extra_len=st}if(r.flags&512){wt[0]=st&255;wt[1]=st>>>8&255;r.check=n(r.check,wt,2,0)}st=0;ot=0}else if(r.head){r.head.extra=null}r.mode=L;case L:if(r.flags&1024){lt=r.length;if(lt>at){lt=at}if(lt){if(r.head){Et=r.head.extra_len-r.length;if(!r.head.extra){r.head.extra=new Array(r.head.extra_len)}i.arraySet(r.head.extra,tt,rt,lt,Et)}if(r.flags&512){r.check=n(r.check,tt,lt,rt)}at-=lt;rt+=lt;r.length-=lt}if(r.length){break t}}r.length=0;r.mode=T;case T:if(r.flags&2048){if(at===0){break t}lt=0;do{Et=tt[rt+lt++];if(r.head&&Et&&r.length<65536){r.head.name+=String.fromCharCode(Et)}}while(Et&&lt<at);if(r.flags&512){r.check=n(r.check,tt,lt,rt)}at-=lt;rt+=lt;if(Et){break t}}else if(r.head){r.head.name=null}r.length=0;r.mode=P;case P:if(r.flags&4096){if(at===0){break t}lt=0;do{Et=tt[rt+lt++];if(r.head&&Et&&r.length<65536){r.head.comment+=String.fromCharCode(Et)}}while(Et&&lt<at);if(r.flags&512){r.check=n(r.check,tt,lt,rt)}at-=lt;rt+=lt;if(Et){break t}}else if(r.head){r.head.comment=null}r.mode=k;case k:if(r.flags&512){while(ot<16){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if(st!==(r.check&65535)){t.msg="header crc mismatch";r.mode=Z;break}st=0;ot=0}if(r.head){r.head.hcrc=r.flags>>9&1;r.head.done=true}t.adler=r.check=0;r.mode=S;break;case O:while(ot<32){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}t.adler=r.check=zswap32(st);st=0;ot=0;r.mode=N;case N:if(r.havedict===0){t.next_out=it;t.avail_out=nt;t.next_in=rt;t.avail_in=at;r.hold=st;r.bits=ot;return m}t.adler=r.check=1;r.mode=S;case S:if(e===c||e===d){break t}case A:if(r.last){st>>>=ot&7;ot-=ot&7;r.mode=Y;break}while(ot<3){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}r.last=st&1;st>>>=1;ot-=1;switch(st&3){case 0:r.mode=B;break;case 1:fixedtables(r);r.mode=U;if(e===d){st>>>=2;ot-=2;break t}break;case 2:r.mode=F;break;case 3:t.msg="invalid block type";r.mode=Z}st>>>=2;ot-=2;break;case B:st>>>=ot&7;ot-=ot&7;while(ot<32){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if((st&65535)!==(st>>>16^65535)){t.msg="invalid stored block lengths";r.mode=Z;break}r.length=st&65535;st=0;ot=0;r.mode=C;if(e===d){break t}case C:r.mode=R;case R:lt=r.length;if(lt){if(lt>at){lt=at}if(lt>nt){lt=nt}if(lt===0){break t}i.arraySet(et,tt,rt,lt,it);at-=lt;rt+=lt;nt-=lt;it+=lt;r.length-=lt;break}r.mode=S;break;case F:while(ot<14){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}r.nlen=(st&31)+257;st>>>=5;ot-=5;r.ndist=(st&31)+1;st>>>=5;ot-=5;r.ncode=(st&15)+4;st>>>=4;ot-=4;if(r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols";r.mode=Z;break}r.have=0;r.mode=X;case X:while(r.have<r.ncode){while(ot<3){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}r.lens[It[r.have++]]=st&7;st>>>=3;ot-=3}while(r.have<19){r.lens[It[r.have++]]=0}r.lencode=r.lendyn;r.lenbits=7;_t={bits:r.lenbits};Mt=o(h,r.lens,0,19,r.lencode,0,r.work,_t);r.lenbits=_t.bits;if(Mt){t.msg="invalid code lengths set";r.mode=Z;break}r.have=0;r.mode=G;case G:while(r.have<r.nlen+r.ndist){for(;;){dt=r.lencode[st&(1<<r.lenbits)-1];pt=dt>>>24;vt=dt>>>16&255;mt=dt&65535;if(pt<=ot){break}if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if(mt<16){st>>>=pt;ot-=pt;r.lens[r.have++]=mt}else{if(mt===16){xt=pt+2;while(ot<xt){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}st>>>=pt;ot-=pt;if(r.have===0){t.msg="invalid bit length repeat";r.mode=Z;break}Et=r.lens[r.have-1];lt=3+(st&3);st>>>=2;ot-=2}else if(mt===17){xt=pt+3;while(ot<xt){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}st>>>=pt;ot-=pt;Et=0;lt=3+(st&7);st>>>=3;ot-=3}else{xt=pt+7;while(ot<xt){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}st>>>=pt;ot-=pt;Et=0;lt=11+(st&127);st>>>=7;ot-=7}if(r.have+lt>r.nlen+r.ndist){t.msg="invalid bit length repeat";r.mode=Z;break}while(lt--){r.lens[r.have++]=Et}}}if(r.mode===Z){break}if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block";r.mode=Z;break}r.lenbits=9;_t={bits:r.lenbits};Mt=o(f,r.lens,0,r.nlen,r.lencode,0,r.work,_t);r.lenbits=_t.bits;if(Mt){t.msg="invalid literal/lengths set";r.mode=Z;break}r.distbits=6;r.distcode=r.distdyn;_t={bits:r.distbits};Mt=o(l,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,_t);r.distbits=_t.bits;if(Mt){t.msg="invalid distances set";r.mode=Z;break}r.mode=U;if(e===d){break t}case U:r.mode=z;case z:if(at>=6&&nt>=258){t.next_out=it;t.avail_out=nt;t.next_in=rt;t.avail_in=at;r.hold=st;r.bits=ot;s(t,ft);it=t.next_out;et=t.output;nt=t.avail_out;rt=t.next_in;tt=t.input;at=t.avail_in;st=r.hold;ot=r.bits;if(r.mode===S){r.back=-1}break}r.back=0;for(;;){dt=r.lencode[st&(1<<r.lenbits)-1];pt=dt>>>24;vt=dt>>>16&255;mt=dt&65535;if(pt<=ot){break}if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if(vt&&(vt&240)===0){gt=pt;bt=vt;yt=mt;for(;;){dt=r.lencode[yt+((st&(1<<gt+bt)-1)>>gt)];pt=dt>>>24;vt=dt>>>16&255;mt=dt&65535;if(gt+pt<=ot){break}if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}st>>>=gt;ot-=gt;r.back+=gt}st>>>=pt;ot-=pt;r.back+=pt;r.length=mt;if(vt===0){r.mode=V;break}if(vt&32){r.back=-1;r.mode=S;break}if(vt&64){t.msg="invalid literal/length code";r.mode=Z;break}r.extra=vt&15;r.mode=W;case W:if(r.extra){xt=r.extra;while(ot<xt){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}r.length+=st&(1<<r.extra)-1;st>>>=r.extra;ot-=r.extra;r.back+=r.extra}r.was=r.length;r.mode=H;case H:for(;;){dt=r.distcode[st&(1<<r.distbits)-1];pt=dt>>>24;vt=dt>>>16&255;mt=dt&65535;if(pt<=ot){break}if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if((vt&240)===0){gt=pt;bt=vt;yt=mt;for(;;){dt=r.distcode[yt+((st&(1<<gt+bt)-1)>>gt)];pt=dt>>>24;vt=dt>>>16&255;mt=dt&65535;if(gt+pt<=ot){break}if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}st>>>=gt;ot-=gt;r.back+=gt}st>>>=pt;ot-=pt;r.back+=pt;if(vt&64){t.msg="invalid distance code";r.mode=Z;break}r.offset=mt;r.extra=vt&15;r.mode=Q;case Q:if(r.extra){xt=r.extra;while(ot<xt){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}r.offset+=st&(1<<r.extra)-1;st>>>=r.extra;ot-=r.extra;r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back";r.mode=Z;break}r.mode=j;case j:if(nt===0){break t}lt=ft-nt;if(r.offset>lt){lt=r.offset-lt;if(lt>r.whave){if(r.sane){t.msg="invalid distance too far back";r.mode=Z;break}}if(lt>r.wnext){lt-=r.wnext;ut=r.wsize-lt}else{ut=r.wnext-lt}if(lt>r.length){lt=r.length}ct=r.window}else{ct=et;ut=it-r.offset;lt=r.length}if(lt>nt){lt=nt}nt-=lt;r.length-=lt;do{et[it++]=ct[ut++]}while(--lt);if(r.length===0){r.mode=z}break;case V:if(nt===0){break t}et[it++]=r.length;nt--;r.mode=z;break;case Y:if(r.wrap){while(ot<32){if(at===0){break t}at--;st|=tt[rt++]<<ot;ot+=8}ft-=nt;t.total_out+=ft;r.total+=ft;if(ft){t.adler=r.check=r.flags?n(r.check,et,ft,it-ft):a(r.check,et,ft,it-ft)}ft=nt;if((r.flags?st:zswap32(st))!==r.check){t.msg="incorrect data check";r.mode=Z;break}st=0;ot=0}r.mode=J;case J:if(r.wrap&&r.flags){while(ot<32){if(at===0){break t}at--;st+=tt[rt++]<<ot;ot+=8}if(st!==(r.total&4294967295)){t.msg="incorrect length check";r.mode=Z;break}st=0;ot=0}r.mode=K;case K:Mt=v;break t;case Z:Mt=b;break t;case $:return y;case q:default:return g}}t.next_out=it;t.avail_out=nt;t.next_in=rt;t.avail_in=at;r.hold=st;r.bits=ot;if(r.wsize||ft!==t.avail_out&&r.mode<Z&&(r.mode<Y||e!==u)){if(updatewindow(t,t.output,t.next_out,ft-t.avail_out)){r.mode=$;return y}}ht-=t.avail_in;ft-=t.avail_out;t.total_in+=ht;t.total_out+=ft;r.total+=ft;if(r.wrap&&ft){t.adler=r.check=r.flags?n(r.check,et,ft,t.next_out-ft):a(r.check,et,ft,t.next_out-ft)}t.data_type=r.bits+(r.last?64:0)+(r.mode===S?128:0)+(r.mode===U||r.mode===C?256:0);if((ht===0&&ft===0||e===u)&&Mt===p){Mt=E}return Mt}function inflateEnd(t){if(!t||!t.state){return g}var e=t.state;if(e.window){e.window=null}t.state=null;return p}function inflateGetHeader(t,e){var r;if(!t||!t.state){return g}r=t.state;if((r.wrap&2)===0){return g}r.head=e;e.done=false;return p}function inflateSetDictionary(t,e){var r=e.length;var i;var n;var s;if(!t||!t.state){return g}i=t.state;if(i.wrap!==0&&i.mode!==N){return g}if(i.mode===N){n=1;n=a(n,e,r,0);if(n!==i.check){return b}}s=updatewindow(t,e,r,r);if(s){i.mode=$;return y}i.havedict=1;return p}e.inflateReset=inflateReset;e.inflateReset2=inflateReset2;e.inflateResetKeep=inflateResetKeep;e.inflateInit=inflateInit;e.inflateInit2=inflateInit2;e.inflate=inflate;e.inflateEnd=inflateEnd;e.inflateGetHeader=inflateGetHeader;e.inflateSetDictionary=inflateSetDictionary;e.inflateInfo="pako inflate (from Nodeca project)"},407:function(t,e,r){var i=r(431);function _getRequireWildcardCache(){if(typeof WeakMap!=="function")return null;var t=new WeakMap;_getRequireWildcardCache=function _getRequireWildcardCache(){return t};return t}function _interopRequireWildcard(t){if(t&&t.__esModule){return t}if(t===null||i(t)!=="object"&&typeof t!=="function"){return{default:t}}var e=_getRequireWildcardCache();if(e&&e.has(t)){return e.get(t)}var r={};var a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t){if(Object.prototype.hasOwnProperty.call(t,n)){var s=a?Object.getOwnPropertyDescriptor(t,n):null;if(s&&(s.get||s.set)){Object.defineProperty(r,n,s)}else{r[n]=t[n]}}}r["default"]=t;if(e){e.set(t,r)}return r}t.exports=_interopRequireWildcard},408:function(t){"use strict";t.exports=pixelmatch;function pixelmatch(t,e,r,i,a,n){if(!n)n={};var s=n.threshold===undefined?.1:n.threshold;var o=35215*s*s,h=0;for(var f=0;f<a;f++){for(var l=0;l<i;l++){var u=(f*i+l)*4;var c=colorDelta(t,e,u,u);if(c>o){if(!n.includeAA&&(antialiased(t,l,f,i,a,e)||antialiased(e,l,f,i,a,t))){if(r)drawPixel(r,u,255,255,0)}else{if(r)drawPixel(r,u,255,0,0);h++}}else if(r){var d=blend(grayPixel(t,u),.1);drawPixel(r,u,d,d,d)}}}return h}function antialiased(t,e,r,i,a,n){var s=Math.max(e-1,0),o=Math.max(r-1,0),h=Math.min(e+1,i-1),f=Math.min(r+1,a-1),l=(r*i+e)*4,u=0,c=0,d=0,p=0,v=0,m,g,b,y;for(var E=s;E<=h;E++){for(var M=o;M<=f;M++){if(E===e&&M===r)continue;var w=colorDelta(t,t,l,(M*i+E)*4,true);if(w===0)u++;else if(w<0)d++;else if(w>0)c++;if(u>2)return false;if(!n)continue;if(w<p){p=w;m=E;g=M}if(w>v){v=w;b=E;y=M}}}if(!n)return true;if(d===0||c===0)return false;return!antialiased(t,m,g,i,a)&&!antialiased(n,m,g,i,a)||!antialiased(t,b,y,i,a)&&!antialiased(n,b,y,i,a)}function colorDelta(t,e,r,i,a){var n=t[r+3]/255,s=e[i+3]/255,o=blend(t[r+0],n),h=blend(t[r+1],n),f=blend(t[r+2],n),l=blend(e[i+0],s),u=blend(e[i+1],s),c=blend(e[i+2],s),d=rgb2y(o,h,f)-rgb2y(l,u,c);if(a)return d;var p=rgb2i(o,h,f)-rgb2i(l,u,c),v=rgb2q(o,h,f)-rgb2q(l,u,c);return.5053*d*d+.299*p*p+.1957*v*v}function rgb2y(t,e,r){return t*.29889531+e*.58662247+r*.11448223}function rgb2i(t,e,r){return t*.59597799-e*.2741761-r*.32180189}function rgb2q(t,e,r){return t*.21147017-e*.52261711+r*.31114694}function blend(t,e){return 255+(t-255)*e}function drawPixel(t,e,r,i,a){t[e+0]=r;t[e+1]=i;t[e+2]=a;t[e+3]=255}function grayPixel(t,e){var r=t[e+3]/255,i=blend(t[e+0],r),a=blend(t[e+1],r),n=blend(t[e+2],r);return rgb2y(i,a,n)}},413:function(t){t.exports=require("stream")},414:function(t,e){"use strict";var r=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];e.getImagePasses=function(t,e){var i=[];var a=t%8;var n=e%8;var s=(t-a)/8;var o=(e-n)/8;for(var h=0;h<r.length;h++){var f=r[h];var l=s*f.x.length;var u=o*f.y.length;for(var c=0;c<f.x.length;c++){if(f.x[c]<a){l++}else{break}}for(c=0;c<f.y.length;c++){if(f.y[c]<n){u++}else{break}}if(l>0&&u>0){i.push({width:l,height:u,index:h})}}return i};e.getInterlaceIterator=function(t){return function(e,i,a){var n=e%r[a].x.length;var s=(e-n)/r[a].x.length*8+r[a].x[n];var o=i%r[a].y.length;var h=(i-o)/r[a].y.length*8+r[a].y[o];return s*4+h*t*4}}},421:function(t){"use strict";t.exports={nearestNeighbor:function nearestNeighbor(t,e){var r=t.width;var i=t.height;var a=e.width;var n=e.height;var s=t.data;var o=e.data;for(var h=0;h<n;h++){for(var f=0;f<a;f++){var l=(h*a+f)*4;var u=Math.floor(h*i/n);var c=Math.floor(f*r/a);var d=(u*r+c)*4;o[l++]=s[d++];o[l++]=s[d++];o[l++]=s[d++];o[l++]=s[d++]}}},bilinearInterpolation:function bilinearInterpolation(t,e){var r=t.width;var i=t.height;var a=e.width;var n=e.height;var s=t.data;var o=e.data;var h=function interpolate(t,e,r,i,a){if(e===i){return r}return Math.round((t-e)*a+(i-t)*r)};var f=function assign(t,e,i,a,n,f,l,u){var c=(l*r+a)*4+e;var d=(l*r+n)*4+e;var p=h(i,a,s[c],n,s[d]);if(u===l){o[t+e]=p}else{c=(u*r+a)*4+e;d=(u*r+n)*4+e;var v=h(i,a,s[c],n,s[d]);o[t+e]=h(f,l,p,u,v)}};for(var l=0;l<n;l++){for(var u=0;u<a;u++){var c=(l*a+u)*4;var d=u*r/a;var p=Math.floor(d);var v=Math.min(Math.ceil(d),r-1);var m=l*i/n;var g=Math.floor(m);var b=Math.min(Math.ceil(m),i-1);f(c,0,d,p,v,m,g,b);f(c,1,d,p,v,m,g,b);f(c,2,d,p,v,m,g,b);f(c,3,d,p,v,m,g,b)}}},_interpolate2D:function _interpolate2D(t,e,r,i){var a=t.data;var n=e.data;var s=t.width;var o=t.height;var h=e.width;var f=e.height;var l=Math.max(1,Math.floor(s/h));var u=h*l;var c=Math.max(1,Math.floor(o/f));var d=f*c;var p=Buffer.alloc(u*o*4);for(var v=0;v<o;v++){for(var m=0;m<u;m++){var g=m*(s-1)/u;var b=Math.floor(g);var y=g-b;var E=(v*s+b)*4;var M=(v*u+m)*4;for(var w=0;w<4;w++){var _=E+w;var x=b>0?a[_-4]:2*a[_]-a[_+4];var I=a[_];var D=a[_+4];var L=b<s-2?a[_+8]:2*a[_+4]-a[_];p[M+w]=i(x,I,D,L,y)}}}var T=Buffer.alloc(u*d*4);for(var P=0;P<d;P++){for(var k=0;k<u;k++){var O=P*(o-1)/d;var N=Math.floor(O);var S=O-N;var A=(N*u+k)*4;var B=(P*u+k)*4;for(var C=0;C<4;C++){var R=A+C;var F=N>0?p[R-u*4]:2*p[R]-p[R+u*4];var X=p[R];var G=p[R+u*4];var U=N<o-2?p[R+u*8]:2*p[R+u*4]-p[R];T[B+C]=i(F,X,G,U,S)}}}var z=l*c;if(z>1){for(var W=0;W<f;W++){for(var H=0;H<h;H++){var Q=0;var j=0;var V=0;var Y=0;var J=0;for(var K=0;K<c;K++){var Z=W*c+K;for(var $=0;$<l;$++){var q=H*l+$;var tt=(Z*u+q)*4;var et=T[tt+3];if(et){Q+=T[tt];j+=T[tt+1];V+=T[tt+2];J++}Y+=et}}var rt=(W*h+H)*4;n[rt]=J?Math.round(Q/J):0;n[rt+1]=J?Math.round(j/J):0;n[rt+2]=J?Math.round(V/J):0;n[rt+3]=Math.round(Y/z)}}}else{e.data=T}},bicubicInterpolation:function bicubicInterpolation(t,e,r){var i=function interpolateCubic(t,e,r,i,a){var n=i-r-t+e;var s=t-e-n;var o=r-t;var h=e;return Math.max(0,Math.min(255,n*(a*a*a)+s*(a*a)+o*a+h))};return this._interpolate2D(t,e,r,i)},hermiteInterpolation:function hermiteInterpolation(t,e,r){var i=function interpolateHermite(t,e,r,i,a){var n=e;var s=.5*(r-t);var o=t-2.5*e+2*r-.5*i;var h=.5*(i-t)+1.5*(e-r);return Math.max(0,Math.min(255,Math.round(((h*a+o)*a+s)*a+n)))};return this._interpolate2D(t,e,r,i)},bezierInterpolation:function bezierInterpolation(t,e,r){var i=function interpolateBezier(t,e,r,i,a){var n=e+(r-t)/4;var s=r-(i-e)/4;var o=1-a;var h=e*o*o*o;var f=3*n*o*o*a;var l=3*s*o*a*a;var u=r*a*a*a;return Math.max(0,Math.min(255,Math.round(h+f+l+u)))};return this._interpolate2D(t,e,r,i)}}},423:function(t,e,r){(function(){var e,i,a,n,s,o,h,f,l,u,c,d,p,v,m,g,b,y={}.hasOwnProperty;b=r(582).assign;e=r(683);l=r(738);u=r(735);a=r(815);n=r(919);d=r(796);v=r(283);m=r(988);p=r(491);c=r(956);s=r(890);o=r(463);h=r(661);f=r(891);i=r(541);t.exports=g=function(){function XMLWriterBase(t){var e,r,i;t||(t={});this.options=t;r=t.writer||{};for(e in r){if(!y.call(r,e))continue;i=r[e];this["_"+e]=this[e];this[e]=i}}XMLWriterBase.prototype.filterOptions=function(t){var e,r,a,n,s,o,h,f;t||(t={});t=b({},this.options,t);e={writer:this};e.pretty=t.pretty||false;e.allowEmpty=t.allowEmpty||false;e.indent=(r=t.indent)!=null?r:" ";e.newline=(a=t.newline)!=null?a:"\n";e.offset=(n=t.offset)!=null?n:0;e.dontPrettyTextNodes=(s=(o=t.dontPrettyTextNodes)!=null?o:t.dontprettytextnodes)!=null?s:0;e.spaceBeforeSlash=(h=(f=t.spaceBeforeSlash)!=null?f:t.spacebeforeslash)!=null?h:"";if(e.spaceBeforeSlash===true){e.spaceBeforeSlash=" "}e.suppressPrettyCount=0;e.user={};e.state=i.None;return e};XMLWriterBase.prototype.indent=function(t,e,r){var i;if(!e.pretty||e.suppressPrettyCount){return""}else if(e.pretty){i=(r||0)+e.offset+1;if(i>0){return new Array(i).join(e.indent)}}return""};XMLWriterBase.prototype.endline=function(t,e,r){if(!e.pretty||e.suppressPrettyCount){return""}else{return e.newline}};XMLWriterBase.prototype.attribute=function(t,e,r){var i;this.openAttribute(t,e,r);i=" "+t.name+'="'+t.value+'"';this.closeAttribute(t,e,r);return i};XMLWriterBase.prototype.cdata=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r)+"<![CDATA[";e.state=i.InsideTag;a+=t.value;e.state=i.CloseTag;a+="]]>"+this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.comment=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r)+"\x3c!-- ";e.state=i.InsideTag;a+=t.value;e.state=i.CloseTag;a+=" --\x3e"+this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.declaration=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r)+"<?xml";e.state=i.InsideTag;a+=' version="'+t.version+'"';if(t.encoding!=null){a+=' encoding="'+t.encoding+'"'}if(t.standalone!=null){a+=' standalone="'+t.standalone+'"'}e.state=i.CloseTag;a+=e.spaceBeforeSlash+"?>";a+=this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.docType=function(t,e,r){var a,n,s,o,h;r||(r=0);this.openNode(t,e,r);e.state=i.OpenTag;o=this.indent(t,e,r);o+="<!DOCTYPE "+t.root().name;if(t.pubID&&t.sysID){o+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"'}else if(t.sysID){o+=' SYSTEM "'+t.sysID+'"'}if(t.children.length>0){o+=" [";o+=this.endline(t,e,r);e.state=i.InsideTag;h=t.children;for(n=0,s=h.length;n<s;n++){a=h[n];o+=this.writeChildNode(a,e,r+1)}e.state=i.CloseTag;o+="]"}e.state=i.CloseTag;o+=e.spaceBeforeSlash+">";o+=this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return o};XMLWriterBase.prototype.element=function(t,r,a){var n,s,o,h,f,l,u,c,d,p,v,m,g,b;a||(a=0);p=false;v="";this.openNode(t,r,a);r.state=i.OpenTag;v+=this.indent(t,r,a)+"<"+t.name;m=t.attribs;for(d in m){if(!y.call(m,d))continue;n=m[d];v+=this.attribute(n,r,a)}o=t.children.length;h=o===0?null:t.children[0];if(o===0||t.children.every(function(t){return(t.type===e.Text||t.type===e.Raw)&&t.value===""})){if(r.allowEmpty){v+=">";r.state=i.CloseTag;v+="</"+t.name+">"+this.endline(t,r,a)}else{r.state=i.CloseTag;v+=r.spaceBeforeSlash+"/>"+this.endline(t,r,a)}}else if(r.pretty&&o===1&&(h.type===e.Text||h.type===e.Raw)&&h.value!=null){v+=">";r.state=i.InsideTag;r.suppressPrettyCount++;p=true;v+=this.writeChildNode(h,r,a+1);r.suppressPrettyCount--;p=false;r.state=i.CloseTag;v+="</"+t.name+">"+this.endline(t,r,a)}else{if(r.dontPrettyTextNodes){g=t.children;for(f=0,u=g.length;f<u;f++){s=g[f];if((s.type===e.Text||s.type===e.Raw)&&s.value!=null){r.suppressPrettyCount++;p=true;break}}}v+=">"+this.endline(t,r,a);r.state=i.InsideTag;b=t.children;for(l=0,c=b.length;l<c;l++){s=b[l];v+=this.writeChildNode(s,r,a+1)}r.state=i.CloseTag;v+=this.indent(t,r,a)+"</"+t.name+">";if(p){r.suppressPrettyCount--}v+=this.endline(t,r,a);r.state=i.None}this.closeNode(t,r,a);return v};XMLWriterBase.prototype.writeChildNode=function(t,r,i){switch(t.type){case e.CData:return this.cdata(t,r,i);case e.Comment:return this.comment(t,r,i);case e.Element:return this.element(t,r,i);case e.Raw:return this.raw(t,r,i);case e.Text:return this.text(t,r,i);case e.ProcessingInstruction:return this.processingInstruction(t,r,i);case e.Dummy:return"";case e.Declaration:return this.declaration(t,r,i);case e.DocType:return this.docType(t,r,i);case e.AttributeDeclaration:return this.dtdAttList(t,r,i);case e.ElementDeclaration:return this.dtdElement(t,r,i);case e.EntityDeclaration:return this.dtdEntity(t,r,i);case e.NotationDeclaration:return this.dtdNotation(t,r,i);default:throw new Error("Unknown XML node type: "+t.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r)+"<?";e.state=i.InsideTag;a+=t.target;if(t.value){a+=" "+t.value}e.state=i.CloseTag;a+=e.spaceBeforeSlash+"?>";a+=this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.raw=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r);e.state=i.InsideTag;a+=t.value;e.state=i.CloseTag;a+=this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.text=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r);e.state=i.InsideTag;a+=t.value;e.state=i.CloseTag;a+=this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.dtdAttList=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r)+"<!ATTLIST";e.state=i.InsideTag;a+=" "+t.elementName+" "+t.attributeName+" "+t.attributeType;if(t.defaultValueType!=="#DEFAULT"){a+=" "+t.defaultValueType}if(t.defaultValue){a+=' "'+t.defaultValue+'"'}e.state=i.CloseTag;a+=e.spaceBeforeSlash+">"+this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.dtdElement=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r)+"<!ELEMENT";e.state=i.InsideTag;a+=" "+t.name+" "+t.value;e.state=i.CloseTag;a+=e.spaceBeforeSlash+">"+this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.dtdEntity=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r)+"<!ENTITY";e.state=i.InsideTag;if(t.pe){a+=" %"}a+=" "+t.name;if(t.value){a+=' "'+t.value+'"'}else{if(t.pubID&&t.sysID){a+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"'}else if(t.sysID){a+=' SYSTEM "'+t.sysID+'"'}if(t.nData){a+=" NDATA "+t.nData}}e.state=i.CloseTag;a+=e.spaceBeforeSlash+">"+this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.dtdNotation=function(t,e,r){var a;this.openNode(t,e,r);e.state=i.OpenTag;a=this.indent(t,e,r)+"<!NOTATION";e.state=i.InsideTag;a+=" "+t.name;if(t.pubID&&t.sysID){a+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"'}else if(t.pubID){a+=' PUBLIC "'+t.pubID+'"'}else if(t.sysID){a+=' SYSTEM "'+t.sysID+'"'}e.state=i.CloseTag;a+=e.spaceBeforeSlash+">"+this.endline(t,e,r);e.state=i.None;this.closeNode(t,e,r);return a};XMLWriterBase.prototype.openNode=function(t,e,r){};XMLWriterBase.prototype.closeNode=function(t,e,r){};XMLWriterBase.prototype.openAttribute=function(t,e,r){};XMLWriterBase.prototype.closeAttribute=function(t,e,r){};return XMLWriterBase}()}).call(this)},427:function(t){"use strict";class BitmapImage{constructor(...t){if(t.length===0){throw new Error("constructor requires parameters")}const e=t[0];if(e!==null&&typeof e==="object"){if(e instanceof BitmapImage){const t=e.bitmap;this.bitmap={width:t.width,height:t.height,data:new JIMPBUffer(t.width*t.height*4)};t.data.copy(this.bitmap.data)}else if(e.width&&e.height&&e.data){this.bitmap=e}else{throw new Error("unrecognized constructor parameters")}}else if(typeof e==="number"&&typeof t[1]==="number"){const r=e;const i=t[1];const a=t[2];this.bitmap={width:r,height:i};if(Buffer.isBuffer(a)){this.bitmap.data=a}else{this.bitmap.data=new JIMPBUffer(r*i*4);if(typeof a==="number"){this.fillRGBA(a)}}}else{throw new Error("unrecognized constructor parameters")}}blit(t,e,r,i,a,n,s){if(i+n>this.bitmap.width){throw new Error("copy exceeds width of source bitmap")}if(e+n>t.bitmap.width){throw new Error("copy exceeds width of target bitmap")}if(a+s>this.bitmap.height){throw new Error("copy exceeds height of source bitmap")}if(r+s>t.bitmap.height){throw new Erro("copy exceeds height of target bitmap")}const o=this.bitmap.data;const h=t.bitmap.data;const f=this.bitmap.width*4;const l=t.bitmap.width*4;const u=n*4;let c=a*f+i*4;let d=r*l+e*4;while(--s>=0){o.copy(h,d,c,c+u);c+=f;d+=l}return this}fillRGBA(t){const e=this.bitmap.data;const r=this.bitmap.height*4;let i=0;while(i<r){e.writeUInt32BE(t,i);i+=4}while(i<e.length){e.copy(e,i,0,r);i+=r}return this}getRGBA(t,e){const r=(e*this.bitmap.width+t)*4;return this.bitmap.data.readUInt32BE(r)}getRGBASet(){const t=new Set;const e=this.bitmap.data;for(let r=0;r<e.length;r+=4){t.add(e.readUInt32BE(r,true))}return t}greyscale(){const t=this.bitmap.data;this.scan(0,0,this.bitmap.width,this.bitmap.height,(e,r,i)=>{const a=Math.round(.299*t[i]+.587*t[i+1]+.114*t[i+2]);t[i]=a;t[i+1]=a;t[i+2]=a});return this}reframe(t,e,r,i,a){const n=t<0?0:t;const s=e<0?0:e;const o=r+n>this.bitmap.width?this.bitmap.width-n:r;const h=i+s>this.bitmap.height?this.bitmap.height-s:i;const f=t<0?-t:0;const l=e<0?-e:0;let u;if(a===undefined){if(n!==t||s!=e||o!==r||h!==i){throw new GifError(`fillRGBA required for this reframing`)}u=new BitmapImage(r,i)}else{u=new BitmapImage(r,i,a)}this.blit(u,f,l,n,s,o,h);this.bitmap=u.bitmap;return this}scale(t){if(t===1){return}if(!Number.isInteger(t)||t<1){throw new Error("the scale must be an integer >= 1")}const e=this.bitmap.width;const r=this.bitmap.height;const i=e*t*4;const a=this.bitmap.data;const n=new JIMPBUffer(r*i*t);let s=0;let o;let h=0;for(let f=0;f<r;++f){o=h;for(let r=0;r<e;++r){const e=a.readUInt32BE(s,true);for(let r=0;r<t;++r){n.writeUInt32BE(e,h);h+=4}s+=4}for(let e=1;e<t;++e){n.copy(n,h,o,h);h+=i;o+=i}}this.bitmap={width:e*t,height:r*t,data:n};return this}scanAllCoords(t){const e=this.bitmap.width;const r=this.bitmap.data.length;let i=0;let a=0;for(let n=0;n<r;n+=4){t(i,a,n);if(++i===e){i=0;++a}}}scanAllIndexes(t){const e=this.bitmap.data.length;for(let r=0;r<e;r+=4){t(r)}}}t.exports=BitmapImage},431:function(t){function _typeof(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){t.exports=_typeof=function _typeof(t){return typeof t}}else{t.exports=_typeof=function _typeof(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return _typeof(e)}t.exports=_typeof},432:function(t,e,r){"use strict";var i=r(669);var a=r(210);var n=r(447);var s=t.exports=function(t){a.call(this);var e=[];var r=this;this._filter=new n(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){r.emit("complete",Buffer.concat(e))}});this._filter.start()};i.inherits(s,a)},447:function(t,e,r){"use strict";var i=r(414);var a=r(594);function getByteWidth(t,e,r){var i=t*e;if(r!==8){i=Math.ceil(i/(8/r))}return i}var n=t.exports=function(t,e){var r=t.width;var a=t.height;var n=t.interlace;var s=t.bpp;var o=t.depth;this.read=e.read;this.write=e.write;this.complete=e.complete;this._imageIndex=0;this._images=[];if(n){var h=i.getImagePasses(r,a);for(var f=0;f<h.length;f++){this._images.push({byteWidth:getByteWidth(h[f].width,s,o),height:h[f].height,lineIndex:0})}}else{this._images.push({byteWidth:getByteWidth(r,s,o),height:a,lineIndex:0})}if(o===8){this._xComparison=s}else if(o===16){this._xComparison=s*2}else{this._xComparison=1}};n.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};n.prototype._unFilterType1=function(t,e,r){var i=this._xComparison;var a=i-1;for(var n=0;n<r;n++){var s=t[1+n];var o=n>a?e[n-i]:0;e[n]=s+o}};n.prototype._unFilterType2=function(t,e,r){var i=this._lastLine;for(var a=0;a<r;a++){var n=t[1+a];var s=i?i[a]:0;e[a]=n+s}};n.prototype._unFilterType3=function(t,e,r){var i=this._xComparison;var a=i-1;var n=this._lastLine;for(var s=0;s<r;s++){var o=t[1+s];var h=n?n[s]:0;var f=s>a?e[s-i]:0;var l=Math.floor((f+h)/2);e[s]=o+l}};n.prototype._unFilterType4=function(t,e,r){var i=this._xComparison;var n=i-1;var s=this._lastLine;for(var o=0;o<r;o++){var h=t[1+o];var f=s?s[o]:0;var l=o>n?e[o-i]:0;var u=o>n&&s?s[o-i]:0;var c=a(l,f,u);e[o]=h+c}};n.prototype._reverseFilterLine=function(t){var e=t[0];var r;var i=this._images[this._imageIndex];var a=i.byteWidth;if(e===0){r=t.slice(1,a+1)}else{r=new JIMPBUffer(a);switch(e){case 1:this._unFilterType1(t,r,a);break;case 2:this._unFilterType2(t,r,a);break;case 3:this._unFilterType3(t,r,a);break;case 4:this._unFilterType4(t,r,a);break;default:throw new Error("Unrecognised filter type - "+e)}}this.write(r);i.lineIndex++;if(i.lineIndex>=i.height){this._lastLine=null;this._imageIndex++;i=this._images[this._imageIndex]}else{this._lastLine=r}if(i){this.read(i.byteWidth+1,this._reverseFilterLine.bind(this))}else{this._lastLine=null;this.complete()}}},451:function(t){(function(){var e;t.exports=e=function(){function XMLNamedNodeMap(t){this.nodes=t}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(t){return this.nodes[t]};XMLNamedNodeMap.prototype.setNamedItem=function(t){var e;e=this.nodes[t.nodeName];this.nodes[t.nodeName]=t;return e||null};XMLNamedNodeMap.prototype.removeNamedItem=function(t){var e;e=this.nodes[t];delete this.nodes[t];return e||null};XMLNamedNodeMap.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},457:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=r(660);var n=i(r(74));var s=i(r(847));var o=i(r(334));var h=i(r(843));var f=i(r(317));var l=function _default(){return(0,a.mergeDeep)((0,n["default"])(),(0,s["default"])(),(0,o["default"])(),(0,h["default"])(),(0,f["default"])())};e["default"]=l;t.exports=e.default},458:function(t,e,r){(function(){var e,i,a,n,s=function(t,e){for(var r in e){if(o.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},o={}.hasOwnProperty;e=r(683);n=r(423);i=r(541);t.exports=a=function(t){s(XMLStreamWriter,t);function XMLStreamWriter(t,e){this.stream=t;XMLStreamWriter.__super__.constructor.call(this,e)}XMLStreamWriter.prototype.endline=function(t,e,r){if(t.isLastRootNode&&e.state===i.CloseTag){return""}else{return XMLStreamWriter.__super__.endline.call(this,t,e,r)}};XMLStreamWriter.prototype.document=function(t,e){var r,i,a,n,s,o,h,f,l;h=t.children;for(i=a=0,s=h.length;a<s;i=++a){r=h[i];r.isLastRootNode=i===t.children.length-1}e=this.filterOptions(e);f=t.children;l=[];for(n=0,o=f.length;n<o;n++){r=f[n];l.push(this.writeChildNode(r,e,0))}return l};XMLStreamWriter.prototype.attribute=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.attribute.call(this,t,e,r))};XMLStreamWriter.prototype.cdata=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.cdata.call(this,t,e,r))};XMLStreamWriter.prototype.comment=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.comment.call(this,t,e,r))};XMLStreamWriter.prototype.declaration=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.declaration.call(this,t,e,r))};XMLStreamWriter.prototype.docType=function(t,e,r){var a,n,s,o;r||(r=0);this.openNode(t,e,r);e.state=i.OpenTag;this.stream.write(this.indent(t,e,r));this.stream.write("<!DOCTYPE "+t.root().name);if(t.pubID&&t.sysID){this.stream.write(' PUBLIC "'+t.pubID+'" "'+t.sysID+'"')}else if(t.sysID){this.stream.write(' SYSTEM "'+t.sysID+'"')}if(t.children.length>0){this.stream.write(" [");this.stream.write(this.endline(t,e,r));e.state=i.InsideTag;o=t.children;for(n=0,s=o.length;n<s;n++){a=o[n];this.writeChildNode(a,e,r+1)}e.state=i.CloseTag;this.stream.write("]")}e.state=i.CloseTag;this.stream.write(e.spaceBeforeSlash+">");this.stream.write(this.endline(t,e,r));e.state=i.None;return this.closeNode(t,e,r)};XMLStreamWriter.prototype.element=function(t,r,a){var n,s,h,f,l,u,c,d,p,v;a||(a=0);this.openNode(t,r,a);r.state=i.OpenTag;this.stream.write(this.indent(t,r,a)+"<"+t.name);p=t.attribs;for(c in p){if(!o.call(p,c))continue;n=p[c];this.attribute(n,r,a)}h=t.children.length;f=h===0?null:t.children[0];if(h===0||t.children.every(function(t){return(t.type===e.Text||t.type===e.Raw)&&t.value===""})){if(r.allowEmpty){this.stream.write(">");r.state=i.CloseTag;this.stream.write("</"+t.name+">")}else{r.state=i.CloseTag;this.stream.write(r.spaceBeforeSlash+"/>")}}else if(r.pretty&&h===1&&(f.type===e.Text||f.type===e.Raw)&&f.value!=null){this.stream.write(">");r.state=i.InsideTag;r.suppressPrettyCount++;d=true;this.writeChildNode(f,r,a+1);r.suppressPrettyCount--;d=false;r.state=i.CloseTag;this.stream.write("</"+t.name+">")}else{this.stream.write(">"+this.endline(t,r,a));r.state=i.InsideTag;v=t.children;for(l=0,u=v.length;l<u;l++){s=v[l];this.writeChildNode(s,r,a+1)}r.state=i.CloseTag;this.stream.write(this.indent(t,r,a)+"</"+t.name+">")}this.stream.write(this.endline(t,r,a));r.state=i.None;return this.closeNode(t,r,a)};XMLStreamWriter.prototype.processingInstruction=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,t,e,r))};XMLStreamWriter.prototype.raw=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,t,e,r))};XMLStreamWriter.prototype.text=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.text.call(this,t,e,r))};XMLStreamWriter.prototype.dtdAttList=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,t,e,r))};XMLStreamWriter.prototype.dtdElement=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,t,e,r))};XMLStreamWriter.prototype.dtdEntity=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,t,e,r))};XMLStreamWriter.prototype.dtdNotation=function(t,e,r){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,t,e,r))};return XMLStreamWriter}(n)}).call(this)},463:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;a=r(733);e=r(683);t.exports=i=function(t){n(XMLDTDElement,t);function XMLDTDElement(t,r,i){XMLDTDElement.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!i){i="(#PCDATA)"}if(Array.isArray(i)){i="("+i.join(",")+")"}this.name=this.stringify.name(r);this.type=e.ElementDeclaration;this.value=this.stringify.dtdElementValue(i)}XMLDTDElement.prototype.toString=function(t){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(t))};return XMLDTDElement}(a)}).call(this)},467:function(t){t.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},472:function(t){function _getPrototypeOf(e){t.exports=_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(e)}t.exports=_getPrototypeOf},474:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=pluginCrop;var a=i(r(431));var n=r(19);function pluginCrop(t){t("crop",function(t,e,r,i,a){if(typeof t!=="number"||typeof e!=="number")return n.throwError.call(this,"x and y must be numbers",a);if(typeof r!=="number"||typeof i!=="number")return n.throwError.call(this,"w and h must be numbers",a);t=Math.round(t);e=Math.round(e);r=Math.round(r);i=Math.round(i);if(t===0&&r===this.bitmap.width){var s=r*e+t<<2;var o=s+i*r<<2;this.bitmap.data=this.bitmap.data.slice(s,o)}else{var h=Buffer.allocUnsafe(r*i*4);var f=0;this.scanQuiet(t,e,r,i,function(t,e,r){var i=this.bitmap.data.readUInt32BE(r,true);h.writeUInt32BE(i,f,true);f+=4});this.bitmap.data=h}this.bitmap.width=r;this.bitmap.height=i;if((0,n.isNodePattern)(a)){a.call(this,null,this)}return this});return{class:{autocrop:function autocrop(){var t=this.bitmap.width;var e=this.bitmap.height;var r=1;var i;var s=0;var o=2e-4;var h=true;var f=false;var l={north:false,south:false,east:false,west:false};for(var u=arguments.length,c=new Array(u),d=0;d<u;d++){c[d]=arguments[d]}for(var p=0,v=c.length;p<v;p++){if(typeof c[p]==="number"){o=c[p]}if(typeof c[p]==="boolean"){h=c[p]}if(typeof c[p]==="function"){i=c[p]}if((0,a["default"])(c[p])==="object"){var m=c[p];if(typeof m.tolerance!=="undefined"){o=m.tolerance}if(typeof m.cropOnlyFrames!=="undefined"){h=m.cropOnlyFrames}if(typeof m.cropSymmetric!=="undefined"){f=m.cropSymmetric}if(typeof m.leaveBorder!=="undefined"){s=m.leaveBorder}if(typeof m.ignoreSides!=="undefined"){l=m.ignoreSides}}}var g=this.getPixelColor(0,0);var b=this.constructor.intToRGBA(g);var y=0;var E=0;var M=0;var w=0;g=this.getPixelColor(0,0);if(!l.north){t:for(var _=0;_<e-r;_++){for(var x=0;x<t;x++){var I=this.getPixelColor(x,_);var D=this.constructor.intToRGBA(I);if(this.constructor.colorDiff(b,D)>o){break t}}y++}}g=this.getPixelColor(t,0);if(!l.east){t:for(var L=0;L<t-r;L++){for(var T=0+y;T<e;T++){var P=this.getPixelColor(L,T);var k=this.constructor.intToRGBA(P);if(this.constructor.colorDiff(b,k)>o){break t}}E++}}g=this.getPixelColor(0,e);if(!l.south){t:for(var O=e-1;O>=y+r;O--){for(var N=t-E-1;N>=0;N--){var S=this.getPixelColor(N,O);var A=this.constructor.intToRGBA(S);if(this.constructor.colorDiff(b,A)>o){break t}}M++}}g=this.getPixelColor(t,e);if(!l.west){t:for(var B=t-1;B>=0+E+r;B--){for(var C=e-1;C>=0+y;C--){var R=this.getPixelColor(B,C);var F=this.constructor.intToRGBA(R);if(this.constructor.colorDiff(b,F)>o){break t}}w++}}var X=false;w-=s;E-=s;y-=s;M-=s;if(f){var G=Math.min(E,w);var U=Math.min(y,M);w=G;E=G;y=U;M=U}w=w>=0?w:0;E=E>=0?E:0;y=y>=0?y:0;M=M>=0?M:0;var z=t-(w+E);var W=e-(M+y);if(h){X=E!==0&&y!==0&&w!==0&&M!==0}else{X=E!==0||y!==0||w!==0||M!==0}if(X){this.crop(E,y,z,W)}if((0,n.isNodePattern)(i)){i.call(this,null,this)}return this}}}}t.exports=e.default},476:function(t,e,r){(function(){"use strict";var t,i,a,n,s,o={}.hasOwnProperty;t=r(972);i=r(791).defaults;n=function(t){return typeof t==="string"&&(t.indexOf("&")>=0||t.indexOf(">")>=0||t.indexOf("<")>=0)};s=function(t){return"<![CDATA["+a(t)+"]]>"};a=function(t){return t.replace("]]>","]]]]><![CDATA[>")};e.Builder=function(){function Builder(t){var e,r,a;this.options={};r=i["0.2"];for(e in r){if(!o.call(r,e))continue;a=r[e];this.options[e]=a}for(e in t){if(!o.call(t,e))continue;a=t[e];this.options[e]=a}}Builder.prototype.buildObject=function(e){var r,a,h,f,l;r=this.options.attrkey;a=this.options.charkey;if(Object.keys(e).length===1&&this.options.rootName===i["0.2"].rootName){l=Object.keys(e)[0];e=e[l]}else{l=this.options.rootName}h=function(t){return function(e,i){var f,l,u,c,d,p;if(typeof i!=="object"){if(t.options.cdata&&n(i)){e.raw(s(i))}else{e.txt(i)}}else if(Array.isArray(i)){for(c in i){if(!o.call(i,c))continue;l=i[c];for(d in l){u=l[d];e=h(e.ele(d),u).up()}}}else{for(d in i){if(!o.call(i,d))continue;l=i[d];if(d===r){if(typeof l==="object"){for(f in l){p=l[f];e=e.att(f,p)}}}else if(d===a){if(t.options.cdata&&n(l)){e=e.raw(s(l))}else{e=e.txt(l)}}else if(Array.isArray(l)){for(c in l){if(!o.call(l,c))continue;u=l[c];if(typeof u==="string"){if(t.options.cdata&&n(u)){e=e.ele(d).raw(s(u)).up()}else{e=e.ele(d,u).up()}}else{e=h(e.ele(d),u).up()}}}else if(typeof l==="object"){e=h(e.ele(d),l).up()}else{if(typeof l==="string"&&t.options.cdata&&n(l)){e=e.ele(d).raw(s(l)).up()}else{if(l==null){l=""}e=e.ele(d,l.toString()).up()}}}}return e}}(this);f=t.create(l,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return h(f,e).end(this.options.renderOpts)};return Builder}()}).call(this)},482:function(t,e,r){var i=r(431);var a=r(27);function _possibleConstructorReturn(t,e){if(e&&(i(e)==="object"||typeof e==="function")){return e}return a(t)}t.exports=_possibleConstructorReturn},491:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;e=r(683);i=r(639);t.exports=a=function(t){n(XMLProcessingInstruction,t);function XMLProcessingInstruction(t,r,i){XMLProcessingInstruction.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=e.ProcessingInstruction;this.target=this.stringify.insTarget(r);this.name=this.target;if(i){this.value=this.stringify.insValue(i)}}XMLProcessingInstruction.prototype.clone=function(){return Object.create(this)};XMLProcessingInstruction.prototype.toString=function(t){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(t))};XMLProcessingInstruction.prototype.isEqualNode=function(t){if(!XMLProcessingInstruction.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)){return false}if(t.target!==this.target){return false}return true};return XMLProcessingInstruction}(i)}).call(this)},499:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(996));var n=r(660);var s=i(r(801));var o=i(r(35));var h=i(r(530));var f=i(r(990));var l=i(r(797));var u=i(r(346));var c=i(r(474));var d=i(r(34));var p=i(r(324));var v=i(r(204));var m=i(r(845));var g=i(r(69));var b=i(r(714));var y=i(r(946));var E=i(r(983));var M=i(r(312));var w=i(r(637));var _=i(r(606));var x=i(r(648));var I=i(r(94));var D=i(r(993));var L=[s["default"],o["default"],h["default"],f["default"],l["default"],u["default"],c["default"],d["default"],p["default"],v["default"],m["default"],g["default"],b["default"],y["default"],E["default"],M["default"],w["default"],_["default"],x["default"],I["default"],D["default"]];var T=function _default(t){var e=L.map(function(e){var r=e(t)||{};if(!r["class"]&&!r.constants){r={class:r}}return r});return n.mergeDeep.apply(void 0,(0,a["default"])(e))};e["default"]=T;t.exports=e.default},500:function(t,e,r){"use strict";var i=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var a=r(605);var n=r(211);var s=r(835);var o=r(191);var h=r(761);var f=r(669);var l=function phin(t,e){if(typeof t!=="string"){if(!t.hasOwnProperty("url")){throw new Error("Missing url option from options for request method.")}}var r=(typeof t==="undefined"?"undefined":i(t))==="object"?s.parse(t.url):s.parse(t);var f={hostname:r.hostname,port:r.port||(r.protocol.toLowerCase()==="http:"?80:443),path:r.path,method:"GET",headers:{},auth:r.auth||null,parse:"none",stream:false};if((typeof t==="undefined"?"undefined":i(t))==="object"){f=Object.assign(f,t)}f.port=Number(f.port);if(f.hasOwnProperty("timeout"))delete f.timeout;if(f.compressed===true){f.headers["accept-encoding"]="gzip, deflate"}if(t.hasOwnProperty("form")){if(i(t.form)!=="object"){throw new Error("phin 'form' option must be of type Object if present.")}var l=o.stringify(t.form);f.headers["Content-Type"]="application/x-www-form-urlencoded";f.headers["Content-Length"]=Buffer.byteLength(l);t.data=l}var u=void 0;var c=function resHandler(t){var r=t;if(f.compressed===true){if(t.headers["content-encoding"]==="gzip"){r=t.pipe(h.createGunzip())}else if(t.headers["content-encoding"]==="deflate"){r=t.pipe(h.createInflate())}}if(f.stream===true){t.stream=r;if(e)e(null,t)}else{t.body=new JIMPBUffer([]);r.on("data",function(e){t.body=Buffer.concat([t.body,e])});r.on("end",function(){if(e){if(f.parse==="json"){try{t.body=JSON.parse(t.body.toString())}catch(r){e("Invalid JSON received.",t);return}}e(null,t)}})}};switch(r.protocol.toLowerCase()){case"http:":u=a.request(f,c);break;case"https:":u=n.request(f,c);break;default:if(e)e(new Error("Invalid / unknown URL protocol. Expected HTTP or HTTPS."),null);return}if(typeof t.timeout==="number"){u.setTimeout(t.timeout,function(){u.abort();if(e)e(new Error("Timeout has been reached."),null);e=null})}u.on("error",function(t){if(e)e(t,null)});if(t.hasOwnProperty("data")){var d=t.data;if(!(t.data instanceof Buffer)&&i(t.data)==="object"){var p=f.headers["content-type"]||f.headers["Content-Type"];if(p==="application/x-www-form-urlencoded"){d=o.stringify(t.data)}else{try{d=JSON.stringify(t.data)}catch(t){if(e)e(new Error("Couldn't stringify object. (Likely due to a circular reference.)"),null)}}}u.write(d)}u.end()};l.promisified=function(t,e){return new Promise(function(r,i){l(t,function(t,e){if(t){i(t)}else{r(e)}},e)})};if(f.promisify){l[f.promisify.custom]=l.promisified}t.exports=l},501:function(t,e,r){var i=r(658);var a=r(612);var n=[{section:i.GPSIFD,type:2,name:"GPSLatitude",refType:1,refName:"GPSLatitudeRef",posVal:"N"},{section:i.GPSIFD,type:4,name:"GPSLongitude",refType:3,refName:"GPSLongitudeRef",posVal:"E"}];var s=[{section:i.SubIFD,type:306,name:"ModifyDate"},{section:i.SubIFD,type:36867,name:"DateTimeOriginal"},{section:i.SubIFD,type:36868,name:"CreateDate"},{section:i.SubIFD,type:306,name:"ModifyDate"}];t.exports={castDegreeValues:function(t,e){n.forEach(function(r){var i=t(r);if(i){var a=t({section:r.section,type:r.refType,name:r.refName});var n=a===r.posVal?1:-1;var s=(i[0]+i[1]/60+i[2]/3600)*n;e(r,s)}})},castDateValues:function(t,e){s.forEach(function(r){var i=t(r);if(i){var n=a.parseExifDate(i);if(typeof n!=="undefined"){e(r,n)}}})},simplifyValue:function(t,e){if(Array.isArray(t)){t=t.map(function(t){if(e===10||e===5){return t[0]/t[1]}return t});if(t.length===1){t=t[0]}}return t}}},507:function(t,e,r){"use strict";var i=r(669);var a=r(761);var n=r(210);var s=r(432);var o=r(932);var h=r(319);var f=r(994);var l=t.exports=function(t){n.call(this);this._parser=new o(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)});this._options=t;this.writable=true;this._parser.start()};i.inherits(l,n);l.prototype._handleError=function(t){this.emit("error",t);this.writable=false;this.destroy();if(this._inflate&&this._inflate.destroy){this._inflate.destroy()}if(this._filter){this._filter.destroy();this._filter.on("error",function(){})}this.errord=true};l.prototype._inflateData=function(t){if(!this._inflate){if(this._bitmapInfo.interlace){this._inflate=a.createInflate();this._inflate.on("error",this.emit.bind(this,"error"));this._filter.on("complete",this._complete.bind(this));this._inflate.pipe(this._filter)}else{var e=(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1;var r=e*this._bitmapInfo.height;var i=Math.max(r,a.Z_MIN_CHUNK);this._inflate=a.createInflate({chunkSize:i});var n=r;var s=this.emit.bind(this,"error");this._inflate.on("error",function(t){if(!n){return}s(t)});this._filter.on("complete",this._complete.bind(this));var o=this._filter.write.bind(this._filter);this._inflate.on("data",function(t){if(!n){return}if(t.length>n){t=t.slice(0,n)}n-=t.length;o(t)});this._inflate.on("end",this._filter.end.bind(this._filter))}}this._inflate.write(t)};l.prototype._handleMetaData=function(t){this._metaData=t;this._bitmapInfo=Object.create(t);this._filter=new s(this._bitmapInfo)};l.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};l.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};l.prototype._simpleTransparency=function(){this._metaData.alpha=true};l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};l.prototype._finished=function(){if(this.errord){return}if(!this._inflate){this.emit("error","No Inflate block")}else{this._inflate.end()}this.destroySoon()};l.prototype._complete=function(t){if(this.errord){return}try{var e=h.dataToBitMap(t,this._bitmapInfo);var r=f(e,this._bitmapInfo);e=null}catch(t){this._handleError(t);return}this.emit("parsed",r)}},510:function(t){function _classCallCheck(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}t.exports=_classCallCheck},515:function(t){(function(){var e;t.exports=e=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(t,e){return true};XMLDOMImplementation.prototype.createDocumentType=function(t,e,r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(t,e,r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},517:function(t,e,r){"use strict";const i=r(427);const{Gif:a,GifError:n}=r(736);const{GifCodec:s}=r(112);const{GifFrame:o}=r(569);const h=r(836);t.exports={BitmapImage:i,Gif:a,GifCodec:s,GifFrame:o,GifUtil:h,GifError:n}},524:function(t,e,r){(function(){var e,i,a;i=r(897);a=r(556);t.exports=e=function(){function XMLDOMConfiguration(){var t;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new i,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=t=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new a(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(t){if(this.params.hasOwnProperty(t)){return this.params[t]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(t,e){return true};XMLDOMConfiguration.prototype.setParameter=function(t,e){if(e!=null){return this.params[t]=e}else{return delete this.params[t]}};return XMLDOMConfiguration}()}).call(this)},525:function(t){function _arrayWithHoles(t){if(Array.isArray(t))return t}t.exports=_arrayWithHoles},530:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{circle:function circle(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=arguments.length>1?arguments[1]:undefined;if(typeof t==="function"){e=t;t={}}var r=t.radius||(this.bitmap.width>this.bitmap.height?this.bitmap.height:this.bitmap.width)/2;var a={x:typeof t.x==="number"?t.x:this.bitmap.width/2,y:typeof t.y==="number"?t.y:this.bitmap.height/2};this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,i){var n=Math.sqrt(Math.pow(t-a.x,2)+Math.pow(e-a.y,2));if(r-n<=0){this.bitmap.data[i+3]=0}else if(r-n<1){this.bitmap.data[i+3]=255*(r-n)}});if((0,i.isNodePattern)(e)){e.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},541:function(t){(function(){t.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},544:function(t){var e=e||function(t){return Buffer.from(t).toString("base64")};function JPEGEncoder(t){var r=this;var i=Math.round;var a=Math.floor;var n=new Array(64);var s=new Array(64);var o=new Array(64);var h=new Array(64);var f;var l;var u;var c;var d=new Array(65535);var p=new Array(65535);var v=new Array(64);var m=new Array(64);var g=[];var b=0;var y=7;var E=new Array(64);var M=new Array(64);var w=new Array(64);var _=new Array(256);var x=new Array(2048);var I;var D=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63];var L=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0];var T=[0,1,2,3,4,5,6,7,8,9,10,11];var P=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125];var k=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250];var O=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0];var N=[0,1,2,3,4,5,6,7,8,9,10,11];var S=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119];var A=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function initQuantTables(t){var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99];for(var r=0;r<64;r++){var i=a((e[r]*t+50)/100);if(i<1){i=1}else if(i>255){i=255}n[D[r]]=i}var f=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99];for(var l=0;l<64;l++){var u=a((f[l]*t+50)/100);if(u<1){u=1}else if(u>255){u=255}s[D[l]]=u}var c=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];var d=0;for(var p=0;p<8;p++){for(var v=0;v<8;v++){o[d]=1/(n[D[d]]*c[p]*c[v]*8);h[d]=1/(s[D[d]]*c[p]*c[v]*8);d++}}}function computeHuffmanTbl(t,e){var r=0;var i=0;var a=new Array;for(var n=1;n<=16;n++){for(var s=1;s<=t[n];s++){a[e[i]]=[];a[e[i]][0]=r;a[e[i]][1]=n;i++;r++}r*=2}return a}function initHuffmanTbl(){f=computeHuffmanTbl(L,T);l=computeHuffmanTbl(O,N);u=computeHuffmanTbl(P,k);c=computeHuffmanTbl(S,A)}function initCategoryNumber(){var t=1;var e=2;for(var r=1;r<=15;r++){for(var i=t;i<e;i++){p[32767+i]=r;d[32767+i]=[];d[32767+i][1]=r;d[32767+i][0]=i}for(var a=-(e-1);a<=-t;a++){p[32767+a]=r;d[32767+a]=[];d[32767+a][1]=r;d[32767+a][0]=e-1+a}t<<=1;e<<=1}}function initRGBYUVTable(){for(var t=0;t<256;t++){x[t]=19595*t;x[t+256>>0]=38470*t;x[t+512>>0]=7471*t+32768;x[t+768>>0]=-11059*t;x[t+1024>>0]=-21709*t;x[t+1280>>0]=32768*t+8421375;x[t+1536>>0]=-27439*t;x[t+1792>>0]=-5329*t}}function writeBits(t){var e=t[0];var r=t[1]-1;while(r>=0){if(e&1<<r){b|=1<<y}r--;y--;if(y<0){if(b==255){writeByte(255);writeByte(0)}else{writeByte(b)}y=7;b=0}}}function writeByte(t){g.push(t)}function writeWord(t){writeByte(t>>8&255);writeByte(t&255)}function fDCTQuant(t,e){var r,i,a,n,s,o,h,f;var l=0;var u;var c=8;var d=64;for(u=0;u<c;++u){r=t[l];i=t[l+1];a=t[l+2];n=t[l+3];s=t[l+4];o=t[l+5];h=t[l+6];f=t[l+7];var p=r+f;var m=r-f;var g=i+h;var b=i-h;var y=a+o;var E=a-o;var M=n+s;var w=n-s;var _=p+M;var x=p-M;var I=g+y;var D=g-y;t[l]=_+I;t[l+4]=_-I;var L=(D+x)*.707106781;t[l+2]=x+L;t[l+6]=x-L;_=w+E;I=E+b;D=b+m;var T=(_-D)*.382683433;var P=.5411961*_+T;var k=1.306562965*D+T;var O=I*.707106781;var N=m+O;var S=m-O;t[l+5]=S+P;t[l+3]=S-P;t[l+1]=N+k;t[l+7]=N-k;l+=8}l=0;for(u=0;u<c;++u){r=t[l];i=t[l+8];a=t[l+16];n=t[l+24];s=t[l+32];o=t[l+40];h=t[l+48];f=t[l+56];var A=r+f;var B=r-f;var C=i+h;var R=i-h;var F=a+o;var X=a-o;var G=n+s;var U=n-s;var z=A+G;var W=A-G;var H=C+F;var Q=C-F;t[l]=z+H;t[l+32]=z-H;var j=(Q+W)*.707106781;t[l+16]=W+j;t[l+48]=W-j;z=U+X;H=X+R;Q=R+B;var V=(z-Q)*.382683433;var Y=.5411961*z+V;var J=1.306562965*Q+V;var K=H*.707106781;var Z=B+K;var $=B-K;t[l+40]=$+Y;t[l+24]=$-Y;t[l+8]=Z+J;t[l+56]=Z-J;l++}var q;for(u=0;u<d;++u){q=t[u]*e[u];v[u]=q>0?q+.5|0:q-.5|0}return v}function writeAPP0(){writeWord(65504);writeWord(16);writeByte(74);writeByte(70);writeByte(73);writeByte(70);writeByte(0);writeByte(1);writeByte(1);writeByte(0);writeWord(1);writeWord(1);writeByte(0);writeByte(0)}function writeAPP1(t){if(!t)return;writeWord(65505);if(t[0]===69&&t[1]===120&&t[2]===105&&t[3]===102){writeWord(t.length+2)}else{writeWord(t.length+5+2);writeByte(69);writeByte(120);writeByte(105);writeByte(102);writeByte(0)}for(var e=0;e<t.length;e++){writeByte(t[e])}}function writeSOF0(t,e){writeWord(65472);writeWord(17);writeByte(8);writeWord(e);writeWord(t);writeByte(3);writeByte(1);writeByte(17);writeByte(0);writeByte(2);writeByte(17);writeByte(1);writeByte(3);writeByte(17);writeByte(1)}function writeDQT(){writeWord(65499);writeWord(132);writeByte(0);for(var t=0;t<64;t++){writeByte(n[t])}writeByte(1);for(var e=0;e<64;e++){writeByte(s[e])}}function writeDHT(){writeWord(65476);writeWord(418);writeByte(0);for(var t=0;t<16;t++){writeByte(L[t+1])}for(var e=0;e<=11;e++){writeByte(T[e])}writeByte(16);for(var r=0;r<16;r++){writeByte(P[r+1])}for(var i=0;i<=161;i++){writeByte(k[i])}writeByte(1);for(var a=0;a<16;a++){writeByte(O[a+1])}for(var n=0;n<=11;n++){writeByte(N[n])}writeByte(17);for(var s=0;s<16;s++){writeByte(S[s+1])}for(var o=0;o<=161;o++){writeByte(A[o])}}function writeSOS(){writeWord(65498);writeWord(12);writeByte(3);writeByte(1);writeByte(0);writeByte(2);writeByte(17);writeByte(3);writeByte(17);writeByte(0);writeByte(63);writeByte(0)}function processDU(t,e,r,i,a){var n=a[0];var s=a[240];var o;var h=16;var f=63;var l=64;var u=fDCTQuant(t,e);for(var c=0;c<l;++c){m[D[c]]=u[c]}var v=m[0]-r;r=m[0];if(v==0){writeBits(i[0])}else{o=32767+v;writeBits(i[p[o]]);writeBits(d[o])}var g=63;for(;g>0&&m[g]==0;g--){}if(g==0){writeBits(n);return r}var b=1;var y;while(b<=g){var E=b;for(;m[b]==0&&b<=g;++b){}var M=b-E;if(M>=h){y=M>>4;for(var w=1;w<=y;++w)writeBits(s);M=M&15}o=32767+m[b];writeBits(a[(M<<4)+p[o]]);writeBits(d[o]);b++}if(g!=f){writeBits(n)}return r}function initCharLookupTable(){var t=String.fromCharCode;for(var e=0;e<256;e++){_[e]=t(e)}}this.encode=function(t,r){var i=(new Date).getTime();if(r)setQuality(r);g=new Array;b=0;y=7;writeWord(65496);writeAPP0();writeAPP1(t.exifBuffer);writeDQT();writeSOF0(t.width,t.height);writeDHT();writeSOS();var a=0;var n=0;var s=0;b=0;y=7;this.encode.displayName="_encode_";var d=t.data;var p=t.width;var v=t.height;var m=p*4;var _=p*3;var I,D=0;var L,T,P;var k,O,N,S,A;while(D<v){I=0;while(I<m){k=m*D+I;O=k;N=-1;S=0;for(A=0;A<64;A++){S=A>>3;N=(A&7)*4;O=k+S*m+N;if(D+S>=v){O-=m*(D+1+S-v)}if(I+N>=m){O-=I+N-m+4}L=d[O++];T=d[O++];P=d[O++];E[A]=(x[L]+x[T+256>>0]+x[P+512>>0]>>16)-128;M[A]=(x[L+768>>0]+x[T+1024>>0]+x[P+1280>>0]>>16)-128;w[A]=(x[L+1280>>0]+x[T+1536>>0]+x[P+1792>>0]>>16)-128}a=processDU(E,o,a,f,u);n=processDU(M,h,n,l,c);s=processDU(w,h,s,l,c);I+=32}D+=8}if(y>=0){var B=[];B[1]=y+1;B[0]=(1<<y+1)-1;writeBits(B)}writeWord(65497);if(false){}return Buffer.from(g);var C="data:image/jpeg;base64,"+e(g.join(""));g=[];var R=(new Date).getTime()-i;return C};function setQuality(t){if(t<=0){t=1}if(t>100){t=100}if(I==t)return;var e=0;if(t<50){e=Math.floor(5e3/t)}else{e=Math.floor(200-t*2)}initQuantTables(e);I=t}function init(){var e=(new Date).getTime();if(!t)t=50;initCharLookupTable();initHuffmanTbl();initCategoryNumber();initRGBYUVTable();setQuality(t);var r=(new Date).getTime()-e}init()}if(true){t.exports=encode}else{}function encode(t,e){if(typeof e==="undefined")e=50;var r=new JPEGEncoder(e);var i=r.encode(t,e);return{data:i,width:t.width,height:t.height}}function getImageDataFromImage(t){var e=typeof t=="string"?document.getElementById(t):t;var r=document.createElement("canvas");r.width=e.width;r.height=e.height;var i=r.getContext("2d");i.drawImage(e,0,0);return i.getImageData(0,0,r.width,r.height)}},556:function(t){(function(){var e;t.exports=e=function(){function XMLDOMStringList(t){this.arr=t||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(t){return this.arr[t]||null};XMLDOMStringList.prototype.contains=function(t){return this.arr.indexOf(t)!==-1};return XMLDOMStringList}()}).call(this)},559:function(t){(function webpackUniversalModuleDefinition(e,r){if(true)t.exports=r();else{}})(this,function(){return function(t){var e={};function __webpack_require__(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:false};t[r].call(i.exports,i,i.exports,__webpack_require__);i.loaded=true;return i.exports}__webpack_require__.m=t;__webpack_require__.c=e;__webpack_require__.p="";return __webpack_require__(0)}([function(t,e,r){"use strict";var i=r(1);e.constants=i;var a=r(3);e.conversion=a;var n=r(12);e.distance=n;var s=r(20);e.palette=s;var o=r(30);e.image=o;var h=r(35);e.quality=h;var f=r(37);e.utils=f},function(t,e,r){"use strict";var i=r(2);e.bt709=i},function(t,e){"use strict";var r;(function(t){t[t["RED"]=.2126]="RED";t[t["GREEN"]=.7152]="GREEN";t[t["BLUE"]=.0722]="BLUE";t[t["WHITE"]=1]="WHITE"})(r||(r={}));e.Y=r;var i;(function(t){t[t["RED"]=.64]="RED";t[t["GREEN"]=.3]="GREEN";t[t["BLUE"]=.15]="BLUE";t[t["WHITE"]=.3127]="WHITE"})(i||(i={}));e.x=i;var a;(function(t){t[t["RED"]=.33]="RED";t[t["GREEN"]=.6]="GREEN";t[t["BLUE"]=.06]="BLUE";t[t["WHITE"]=.329]="WHITE"})(a||(a={}));e.y=a},function(t,e,r){"use strict";var i=r(4);e.rgb2xyz=i.rgb2xyz;var a=r(5);e.rgb2hsl=a.rgb2hsl;var n=r(7);e.rgb2lab=n.rgb2lab;var s=r(9);e.lab2xyz=s.lab2xyz;var o=r(10);e.lab2rgb=o.lab2rgb;var h=r(8);e.xyz2lab=h.xyz2lab;var f=r(11);e.xyz2rgb=f.xyz2rgb},function(t,e){"use strict";function correctGamma(t){return t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92}function rgb2xyz(t,e,r){t=correctGamma(t/255);e=correctGamma(e/255);r=correctGamma(r/255);return{x:t*.4124+e*.3576+r*.1805,y:t*.2126+e*.7152+r*.0722,z:t*.0193+e*.1192+r*.9505}}e.rgb2xyz=rgb2xyz},function(t,e,r){"use strict";var i=r(6);function rgb2hsl(t,e,r){var a=i.min3(t,e,r),n=i.max3(t,e,r),s=n-a,o=(a+n)/510;var h=0;if(o>0&&o<1)h=s/(o<.5?n+a:510-n-a);var f=0;if(s>0){if(n===t){f=(e-r)/s}else if(n===e){f=2+(r-t)/s}else{f=4+(t-e)/s}f*=60;if(f<0)f+=360}return{h:f,s:h,l:o}}e.rgb2hsl=rgb2hsl},function(t,e){"use strict";function degrees2radians(t){return t*(Math.PI/180)}e.degrees2radians=degrees2radians;function max3(t,e,r){var i=t;i<e&&(i=e);i<r&&(i=r);return i}e.max3=max3;function min3(t,e,r){var i=t;i>e&&(i=e);i>r&&(i=r);return i}e.min3=min3;function intInRange(t,e,r){if(t>r)t=r;if(t<e)t=e;return t|0}e.intInRange=intInRange;function inRange0to255Rounded(t){t=Math.round(t);if(t>255)t=255;else if(t<0)t=0;return t}e.inRange0to255Rounded=inRange0to255Rounded;function inRange0to255(t){if(t>255)t=255;else if(t<0)t=0;return t}e.inRange0to255=inRange0to255;function stableSort(t,e){var r=typeof t[0];var i;if(r==="number"||r==="string"){var a=Object.create(null);for(var n=0,s=t.length;n<s;n++){var o=t[n];if(a[o]||a[o]===0)continue;a[o]=n}i=t.sort(function(t,r){return e(t,r)||a[t]-a[r]})}else{var h=t.slice(0);i=t.sort(function(t,r){return e(t,r)||h.indexOf(t)-h.indexOf(r)})}return i}e.stableSort=stableSort},function(t,e,r){"use strict";var i=r(4);var a=r(8);function rgb2lab(t,e,r){var n=i.rgb2xyz(t,e,r);return a.xyz2lab(n.x,n.y,n.z)}e.rgb2lab=rgb2lab},function(t,e){"use strict";var r=.95047,i=1,a=1.08883;function pivot(t){return t>.008856?Math.pow(t,1/3):7.787*t+16/116}function xyz2lab(t,e,n){t=pivot(t/r);e=pivot(e/i);n=pivot(n/a);if(116*e-16<0)throw new Error("xxx");return{L:Math.max(0,116*e-16),a:500*(t-e),b:200*(e-n)}}e.xyz2lab=xyz2lab},function(t,e){"use strict";var r=.95047,i=1,a=1.08883;function pivot(t){return t>.206893034?Math.pow(t,3):(t-16/116)/7.787}function lab2xyz(t,e,n){var s=(t+16)/116,o=e/500+s,h=s-n/200;return{x:r*pivot(o),y:i*pivot(s),z:a*pivot(h)}}e.lab2xyz=lab2xyz},function(t,e,r){"use strict";var i=r(9);var a=r(11);function lab2rgb(t,e,r){var n=i.lab2xyz(t,e,r);return a.xyz2rgb(n.x,n.y,n.z)}e.lab2rgb=lab2rgb},function(t,e,r){"use strict";var i=r(6);function correctGamma(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function xyz2rgb(t,e,r){var a=correctGamma(t*3.2406+e*-1.5372+r*-.4986),n=correctGamma(t*-.9689+e*1.8758+r*.0415),s=correctGamma(t*.0557+e*-.204+r*1.057);return{r:i.inRange0to255Rounded(a*255),g:i.inRange0to255Rounded(n*255),b:i.inRange0to255Rounded(s*255)}}e.xyz2rgb=xyz2rgb},function(t,e,r){"use strict";var i=r(13);e.AbstractDistanceCalculator=i.AbstractDistanceCalculator;var a=r(14);e.CIE94Textiles=a.CIE94Textiles;e.CIE94GraphicArts=a.CIE94GraphicArts;var n=r(15);e.CIEDE2000=n.CIEDE2000;var s=r(16);e.CMETRIC=s.CMETRIC;var o=r(17);e.AbstractEuclidean=o.AbstractEuclidean;e.Euclidean=o.Euclidean;e.EuclideanRgbQuantWOAlpha=o.EuclideanRgbQuantWOAlpha;e.EuclideanRgbQuantWithAlpha=o.EuclideanRgbQuantWithAlpha;var h=r(18);e.AbstractManhattan=h.AbstractManhattan;e.Manhattan=h.Manhattan;e.ManhattanSRGB=h.ManhattanSRGB;e.ManhattanNommyde=h.ManhattanNommyde;var f=r(19);e.PNGQUANT=f.PNGQUANT},function(t,e){"use strict";var r=function(){function AbstractDistanceCalculator(){this._setDefaults();this.setWhitePoint(255,255,255,255)}AbstractDistanceCalculator.prototype.setWhitePoint=function(t,e,r,i){this._whitePoint={r:t>0?255/t:0,g:e>0?255/e:0,b:r>0?255/r:0,a:i>0?255/i:0};this._maxDistance=this.calculateRaw(t,e,r,i,0,0,0,0)};AbstractDistanceCalculator.prototype.calculateNormalized=function(t,e){return this.calculateRaw(t.r,t.g,t.b,t.a,e.r,e.g,e.b,e.a)/this._maxDistance};AbstractDistanceCalculator.prototype._setDefaults=function(){};return AbstractDistanceCalculator}();e.AbstractDistanceCalculator=r},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r];function __(){this.constructor=t}t.prototype=e===null?Object.create(e):(__.prototype=e.prototype,new __)};var a=r(13);var n=r(7);var s=r(6);var o=function(t){i(AbstractCIE94,t);function AbstractCIE94(){t.apply(this,arguments)}AbstractCIE94.prototype.calculateRaw=function(t,e,r,i,a,o,h,f){var l=n.rgb2lab(s.inRange0to255(t*this._whitePoint.r),s.inRange0to255(e*this._whitePoint.g),s.inRange0to255(r*this._whitePoint.b)),u=n.rgb2lab(s.inRange0to255(a*this._whitePoint.r),s.inRange0to255(o*this._whitePoint.g),s.inRange0to255(h*this._whitePoint.b));var c=l.L-u.L,d=l.a-u.a,p=l.b-u.b,v=Math.sqrt(l.a*l.a+l.b*l.b),m=Math.sqrt(u.a*u.a+u.b*u.b),g=v-m;var b=d*d+p*p-g*g;b=b<0?0:Math.sqrt(b);var y=(f-i)*this._whitePoint.a*this._kA;return Math.sqrt(Math.pow(c/this._Kl,2)+Math.pow(g/(1+this._K1*v),2)+Math.pow(b/(1+this._K2*v),2)+Math.pow(y,2))};return AbstractCIE94}(a.AbstractDistanceCalculator);e.AbstractCIE94=o;var h=function(t){i(CIE94Textiles,t);function CIE94Textiles(){t.apply(this,arguments)}CIE94Textiles.prototype._setDefaults=function(){this._Kl=2;this._K1=.048;this._K2=.014;this._kA=.25*50/255};return CIE94Textiles}(o);e.CIE94Textiles=h;var f=function(t){i(CIE94GraphicArts,t);function CIE94GraphicArts(){t.apply(this,arguments)}CIE94GraphicArts.prototype._setDefaults=function(){this._Kl=1;this._K1=.045;this._K2=.015;this._kA=.25*100/255};return CIE94GraphicArts}(o);e.CIE94GraphicArts=f},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r];function __(){this.constructor=t}t.prototype=e===null?Object.create(e):(__.prototype=e.prototype,new __)};var a=r(13);var n=r(7);var s=r(6);var o=function(t){i(CIEDE2000,t);function CIEDE2000(){t.apply(this,arguments)}CIEDE2000.prototype.calculateRaw=function(t,e,r,i,a,o,h,f){var l=n.rgb2lab(s.inRange0to255(t*this._whitePoint.r),s.inRange0to255(e*this._whitePoint.g),s.inRange0to255(r*this._whitePoint.b)),u=n.rgb2lab(s.inRange0to255(a*this._whitePoint.r),s.inRange0to255(o*this._whitePoint.g),s.inRange0to255(h*this._whitePoint.b)),c=(f-i)*this._whitePoint.a*CIEDE2000._kA,d=this.calculateRawInLab(l,u);return Math.sqrt(d+c*c)};CIEDE2000.prototype.calculateRawInLab=function(t,e){var r=t.L,i=t.a,a=t.b;var n=e.L,s=e.a,o=e.b;var h=Math.sqrt(i*i+a*a),f=Math.sqrt(s*s+o*o),l=Math.pow((h+f)/2,7),u=.5*(1-Math.sqrt(l/(l+CIEDE2000._pow25to7))),c=(1+u)*i,d=(1+u)*s,p=Math.sqrt(c*c+a*a),v=Math.sqrt(d*d+o*o),m=p*v,g=CIEDE2000._calculatehp(a,c),b=CIEDE2000._calculatehp(o,d),y=Math.abs(g-b),E=n-r,M=v-p,w=CIEDE2000._calculate_dHp(m,y,b,g),_=CIEDE2000._calculate_ahp(m,y,g,b),x=CIEDE2000._calculateT(_),I=(p+v)/2,D=Math.pow((r+n)/2-50,2),L=1+.015*D/Math.sqrt(20+D),T=1+.045*I,P=1+.015*x*I,k=CIEDE2000._calculateRT(_,I),O=E/L,N=M/T,S=w/P;return Math.pow(O,2)+Math.pow(N,2)+Math.pow(S,2)+k*N*S};CIEDE2000._calculatehp=function(t,e){var r=Math.atan2(t,e);if(r>=0)return r;return r+CIEDE2000._deg360InRad};CIEDE2000._calculateRT=function(t,e){var r=Math.pow(e,7),i=2*Math.sqrt(r/(r+CIEDE2000._pow25to7)),a=CIEDE2000._deg30InRad*Math.exp(-Math.pow((t-CIEDE2000._deg275InRad)/CIEDE2000._deg25InRad,2));return-Math.sin(2*a)*i};CIEDE2000._calculateT=function(t){return 1-.17*Math.cos(t-CIEDE2000._deg30InRad)+.24*Math.cos(t*2)+.32*Math.cos(t*3+CIEDE2000._deg6InRad)-.2*Math.cos(t*4-CIEDE2000._deg63InRad)};CIEDE2000._calculate_ahp=function(t,e,r,i){var a=r+i;if(t==0)return a;if(e<=CIEDE2000._deg180InRad)return a/2;if(a<CIEDE2000._deg360InRad)return(a+CIEDE2000._deg360InRad)/2;return(a-CIEDE2000._deg360InRad)/2};CIEDE2000._calculate_dHp=function(t,e,r,i){var a;if(t==0){a=0}else if(e<=CIEDE2000._deg180InRad){a=r-i}else if(r<=i){a=r-i+CIEDE2000._deg360InRad}else{a=r-i-CIEDE2000._deg360InRad}return 2*Math.sqrt(t)*Math.sin(a/2)};CIEDE2000._kA=.25*100/255;CIEDE2000._pow25to7=Math.pow(25,7);CIEDE2000._deg360InRad=s.degrees2radians(360);CIEDE2000._deg180InRad=s.degrees2radians(180);CIEDE2000._deg30InRad=s.degrees2radians(30);CIEDE2000._deg6InRad=s.degrees2radians(6);CIEDE2000._deg63InRad=s.degrees2radians(63);CIEDE2000._deg275InRad=s.degrees2radians(275);CIEDE2000._deg25InRad=s.degrees2radians(25);return CIEDE2000}(a.AbstractDistanceCalculator);e.CIEDE2000=o},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r];function __(){this.constructor=t}t.prototype=e===null?Object.create(e):(__.prototype=e.prototype,new __)};var a=r(13);var n=function(t){i(CMETRIC,t);function CMETRIC(){t.apply(this,arguments)}CMETRIC.prototype.calculateRaw=function(t,e,r,i,a,n,s,o){var h=(t+a)/2*this._whitePoint.r,f=(t-a)*this._whitePoint.r,l=(e-n)*this._whitePoint.g,u=(r-s)*this._whitePoint.b,c=((512+h)*f*f>>8)+4*l*l+((767-h)*u*u>>8),d=(o-i)*this._whitePoint.a;return Math.sqrt(c+d*d)};return CMETRIC}(a.AbstractDistanceCalculator);e.CMETRIC=n},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r];function __(){this.constructor=t}t.prototype=e===null?Object.create(e):(__.prototype=e.prototype,new __)};var a=r(13);var n=r(2);var s=function(t){i(AbstractEuclidean,t);function AbstractEuclidean(){t.apply(this,arguments)}AbstractEuclidean.prototype.calculateRaw=function(t,e,r,i,a,n,s,o){var h=a-t,f=n-e,l=s-r,u=o-i;return Math.sqrt(this._kR*h*h+this._kG*f*f+this._kB*l*l+this._kA*u*u)};return AbstractEuclidean}(a.AbstractDistanceCalculator);e.AbstractEuclidean=s;var o=function(t){i(Euclidean,t);function Euclidean(){t.apply(this,arguments)}Euclidean.prototype._setDefaults=function(){this._kR=1;this._kG=1;this._kB=1;this._kA=1};return Euclidean}(s);e.Euclidean=o;var h=function(t){i(EuclideanRgbQuantWithAlpha,t);function EuclideanRgbQuantWithAlpha(){t.apply(this,arguments)}EuclideanRgbQuantWithAlpha.prototype._setDefaults=function(){this._kR=n.Y.RED;this._kG=n.Y.GREEN;this._kB=n.Y.BLUE;this._kA=1};return EuclideanRgbQuantWithAlpha}(s);e.EuclideanRgbQuantWithAlpha=h;var f=function(t){i(EuclideanRgbQuantWOAlpha,t);function EuclideanRgbQuantWOAlpha(){t.apply(this,arguments)}EuclideanRgbQuantWOAlpha.prototype._setDefaults=function(){this._kR=n.Y.RED;this._kG=n.Y.GREEN;this._kB=n.Y.BLUE;this._kA=0};return EuclideanRgbQuantWOAlpha}(s);e.EuclideanRgbQuantWOAlpha=f},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r];function __(){this.constructor=t}t.prototype=e===null?Object.create(e):(__.prototype=e.prototype,new __)};var a=r(13);var n=r(2);var s=function(t){i(AbstractManhattan,t);function AbstractManhattan(){t.apply(this,arguments)}AbstractManhattan.prototype.calculateRaw=function(t,e,r,i,a,n,s,o){var h=a-t,f=n-e,l=s-r,u=o-i;if(h<0)h=0-h;if(f<0)f=0-f;if(l<0)l=0-l;if(u<0)u=0-u;return this._kR*h+this._kG*f+this._kB*l+this._kA*u};return AbstractManhattan}(a.AbstractDistanceCalculator);e.AbstractManhattan=s;var o=function(t){i(Manhattan,t);function Manhattan(){t.apply(this,arguments)}Manhattan.prototype._setDefaults=function(){this._kR=1;this._kG=1;this._kB=1;this._kA=1};return Manhattan}(s);e.Manhattan=o;var h=function(t){i(ManhattanNommyde,t);function ManhattanNommyde(){t.apply(this,arguments)}ManhattanNommyde.prototype._setDefaults=function(){this._kR=.4984;this._kG=.8625;this._kB=.2979;this._kA=1};return ManhattanNommyde}(s);e.ManhattanNommyde=h;var f=function(t){i(ManhattanSRGB,t);function ManhattanSRGB(){t.apply(this,arguments)}ManhattanSRGB.prototype._setDefaults=function(){this._kR=n.Y.RED;this._kG=n.Y.GREEN;this._kB=n.Y.BLUE;this._kA=1};return ManhattanSRGB}(s);e.ManhattanSRGB=f},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r];function __(){this.constructor=t}t.prototype=e===null?Object.create(e):(__.prototype=e.prototype,new __)};var a=r(13);var n=function(t){i(PNGQUANT,t);function PNGQUANT(){t.apply(this,arguments)}PNGQUANT.prototype.calculateRaw=function(t,e,r,i,a,n,s,o){var h=(o-i)*this._whitePoint.a;return this._colordifference_ch(t*this._whitePoint.r,a*this._whitePoint.r,h)+this._colordifference_ch(e*this._whitePoint.g,n*this._whitePoint.g,h)+this._colordifference_ch(r*this._whitePoint.b,s*this._whitePoint.b,h)};PNGQUANT.prototype._colordifference_ch=function(t,e,r){var i=t-e,a=i+r;return i*i+a*a};return PNGQUANT}(a.AbstractDistanceCalculator);e.PNGQUANT=n},function(t,e,r){"use strict";var i=r(21);e.NeuQuant=i.NeuQuant;var a=r(25);e.NeuQuantFloat=a.NeuQuantFloat;var n=r(26);e.RGBQuant=n.RGBQuant;var s=r(27);e.ColorHistogram=s.ColorHistogram;var o=r(29);e.WuQuant=o.WuQuant;e.WuColorCube=o.WuColorCube},function(t,e,r){"use strict";var i=r(22);var a=r(24);var n=3;var s=function(){function Neuron(t){this.r=this.g=this.b=this.a=t}Neuron.prototype.toPoint=function(){return a.Point.createByRGBA(this.r>>n,this.g>>n,this.b>>n,this.a>>n)};Neuron.prototype.subtract=function(t,e,r,i){this.r-=t|0;this.g-=e|0;this.b-=r|0;this.a-=i|0};return Neuron}();var o=function(){function NeuQuant(t,e){if(e===void 0){e=256}this._distance=t;this._pointArray=[];this._sampleFactor=1;this._networkSize=e;this._distance.setWhitePoint(255<<n,255<<n,255<<n,255<<n)}NeuQuant.prototype.sample=function(t){this._pointArray=this._pointArray.concat(t.getPointArray())};NeuQuant.prototype.quantize=function(){this._init();this._learn();return this._buildPalette()};NeuQuant.prototype._init=function(){this._freq=[];this._bias=[];this._radPower=[];this._network=[];for(var t=0;t<this._networkSize;t++){this._network[t]=new s((t<<n+8)/this._networkSize|0);this._freq[t]=NeuQuant._initialBias/this._networkSize|0;this._bias[t]=0}};NeuQuant.prototype._learn=function(){var t=this._sampleFactor;var e=this._pointArray.length;if(e<NeuQuant._minpicturebytes)t=1;var r=30+(t-1)/3|0,i=e/t|0;var a=i/NeuQuant._nCycles|0,s=NeuQuant._initAlpha,o=(this._networkSize>>3)*NeuQuant._radiusBias;var h=o>>NeuQuant._radiusBiasShift;if(h<=1)h=0;for(var f=0;f<h;f++){this._radPower[f]=s*((h*h-f*f)*NeuQuant._radBias/(h*h))>>>0}var l;if(e<NeuQuant._minpicturebytes){l=1}else if(e%NeuQuant._prime1!=0){l=NeuQuant._prime1}else if(e%NeuQuant._prime2!=0){l=NeuQuant._prime2}else if(e%NeuQuant._prime3!=0){l=NeuQuant._prime3}else{l=NeuQuant._prime4}for(var f=0,u=0;f<i;){var c=this._pointArray[u],d=c.b<<n,p=c.g<<n,v=c.r<<n,m=c.a<<n,g=this._contest(d,p,v,m);this._alterSingle(s,g,d,p,v,m);if(h!==0)this._alterNeighbour(h,g,d,p,v,m);u+=l;if(u>=e)u-=e;f++;if(a===0)a=1;if(f%a===0){s-=s/r|0;o-=o/NeuQuant._radiusDecrease|0;h=o>>NeuQuant._radiusBiasShift;if(h<=1)h=0;for(var b=0;b<h;b++)this._radPower[b]=s*((h*h-b*b)*NeuQuant._radBias/(h*h))>>>0}}};NeuQuant.prototype._buildPalette=function(){var t=new i.Palette;this._network.forEach(function(e){t.add(e.toPoint())});t.sort();return t};NeuQuant.prototype._alterNeighbour=function(t,e,r,i,a,n){var s=e-t;if(s<-1)s=-1;var o=e+t;if(o>this._networkSize)o=this._networkSize;var h=e+1,f=e-1,l=1;while(h<o||f>s){var u=this._radPower[l++]/NeuQuant._alphaRadBias;if(h<o){var c=this._network[h++];c.subtract(u*(c.r-a),u*(c.g-i),u*(c.b-r),u*(c.a-n))}if(f>s){var c=this._network[f--];c.subtract(u*(c.r-a),u*(c.g-i),u*(c.b-r),u*(c.a-n))}}};NeuQuant.prototype._alterSingle=function(t,e,r,i,a,n){t/=NeuQuant._initAlpha;var s=this._network[e];s.subtract(t*(s.r-a),t*(s.g-i),t*(s.b-r),t*(s.a-n))};NeuQuant.prototype._contest=function(t,e,r,i){var a=255*4<<n;var s=~(1<<31),o=s,h=-1,f=h;for(var l=0;l<this._networkSize;l++){var u=this._network[l],c=this._distance.calculateNormalized(u,{r:r,g:e,b:t,a:i})*a|0;if(c<s){s=c;h=l}var d=c-(this._bias[l]>>NeuQuant._initialBiasShift-n);if(d<o){o=d;f=l}var p=this._freq[l]>>NeuQuant._betaShift;this._freq[l]-=p;this._bias[l]+=p<<NeuQuant._gammaShift}this._freq[h]+=NeuQuant._beta;this._bias[h]-=NeuQuant._betaGamma;return f};NeuQuant._prime1=499;NeuQuant._prime2=491;NeuQuant._prime3=487;NeuQuant._prime4=503;NeuQuant._minpicturebytes=NeuQuant._prime4;NeuQuant._nCycles=100;NeuQuant._initialBiasShift=16;NeuQuant._initialBias=1<<NeuQuant._initialBiasShift;NeuQuant._gammaShift=10;NeuQuant._betaShift=10;NeuQuant._beta=NeuQuant._initialBias>>NeuQuant._betaShift;NeuQuant._betaGamma=NeuQuant._initialBias<<NeuQuant._gammaShift-NeuQuant._betaShift;NeuQuant._radiusBiasShift=6;NeuQuant._radiusBias=1<<NeuQuant._radiusBiasShift;NeuQuant._radiusDecrease=30;NeuQuant._alphaBiasShift=10;NeuQuant._initAlpha=1<<NeuQuant._alphaBiasShift;NeuQuant._radBiasShift=8;NeuQuant._radBias=1<<NeuQuant._radBiasShift;NeuQuant._alphaRadBiasShift=NeuQuant._alphaBiasShift+NeuQuant._radBiasShift;NeuQuant._alphaRadBias=1<<NeuQuant._alphaRadBiasShift;return NeuQuant}();e.NeuQuant=o},function(t,e,r){"use strict";var i=r(23);var a=r(5);var n=10;function hueGroup(t,e){var r=360,i=r/e,a=i/2;for(var n=1,s=i-a;n<e;n++,s+=i){if(t>=s&&t<s+i)return n}return 0}e.hueGroup=hueGroup;var s=function(){function Palette(){this._pointArray=[];this._i32idx={};this._pointContainer=new i.PointContainer;this._pointContainer.setHeight(1);this._pointArray=this._pointContainer.getPointArray()}Palette.prototype.add=function(t){this._pointArray.push(t);this._pointContainer.setWidth(this._pointArray.length)};Palette.prototype.has=function(t){for(var e=this._pointArray.length-1;e>=0;e--){if(t.uint32===this._pointArray[e].uint32)return true}return false};Palette.prototype.getNearestColor=function(t,e){return this._pointArray[this.getNearestIndex(t,e)|0]};Palette.prototype.getPointContainer=function(){return this._pointContainer};Palette.prototype._nearestPointFromCache=function(t){return typeof this._i32idx[t]==="number"?this._i32idx[t]:-1};Palette.prototype.getNearestIndex=function(t,e){var r=this._nearestPointFromCache(""+e.uint32);if(r>=0)return r;var i=Number.MAX_VALUE;r=0;for(var a=0,n=this._pointArray.length;a<n;a++){var s=this._pointArray[a],o=t.calculateRaw(e.r,e.g,e.b,e.a,s.r,s.g,s.b,s.a);if(o<i){i=o;r=a}}this._i32idx[e.uint32]=r;return r};Palette.prototype.sort=function(){this._i32idx={};this._pointArray.sort(function(t,e){var r=a.rgb2hsl(t.r,t.g,t.b),i=a.rgb2hsl(e.r,e.g,e.b);var s=t.r===t.g&&t.g===t.b?0:1+hueGroup(r.h,n),o=e.r===e.g&&e.g===e.b?0:1+hueGroup(i.h,n);var h=o-s;if(h)return-h;var f=t.getLuminosity(true),l=e.getLuminosity(true);if(l-f!==0)return l-f;var u=(i.s*100|0)-(r.s*100|0);if(u)return-u;return 0})};return Palette}();e.Palette=s},function(t,e,r){"use strict";var i=r(24);var a=function(){function PointContainer(){this._width=0;this._height=0;this._pointArray=[]}PointContainer.prototype.getWidth=function(){return this._width};PointContainer.prototype.getHeight=function(){return this._height};PointContainer.prototype.setWidth=function(t){this._width=t};PointContainer.prototype.setHeight=function(t){this._height=t};PointContainer.prototype.getPointArray=function(){return this._pointArray};PointContainer.prototype.clone=function(){var t=new PointContainer;t._width=this._width;t._height=this._height;for(var e=0,r=this._pointArray.length;e<r;e++){t._pointArray[e]=i.Point.createByUint32(this._pointArray[e].uint32|0)}return t};PointContainer.prototype.toUint32Array=function(){var t=this._pointArray.length,e=new Uint32Array(t);for(var r=0;r<t;r++){e[r]=this._pointArray[r].uint32}return e};PointContainer.prototype.toUint8Array=function(){return new Uint8Array(this.toUint32Array().buffer)};PointContainer.fromHTMLImageElement=function(t){var e=t.naturalWidth,r=t.naturalHeight;var i=document.createElement("canvas");i.width=e;i.height=r;var a=i.getContext("2d");a.drawImage(t,0,0,e,r,0,0,e,r);return PointContainer.fromHTMLCanvasElement(i)};PointContainer.fromHTMLCanvasElement=function(t){var e=t.width,r=t.height;var i=t.getContext("2d"),a=i.getImageData(0,0,e,r);return PointContainer.fromImageData(a)};PointContainer.fromNodeCanvas=function(t){return PointContainer.fromHTMLCanvasElement(t)};PointContainer.fromImageData=function(t){var e=t.width,r=t.height;return PointContainer.fromCanvasPixelArray(t.data,e,r)};PointContainer.fromArray=function(t,e,r){var i=new Uint8Array(t);return PointContainer.fromUint8Array(i,e,r)};PointContainer.fromCanvasPixelArray=function(t,e,r){return PointContainer.fromArray(t,e,r)};PointContainer.fromUint8Array=function(t,e,r){return PointContainer.fromUint32Array(new Uint32Array(t.buffer),e,r)};PointContainer.fromUint32Array=function(t,e,r){var a=new PointContainer;a._width=e;a._height=r;for(var n=0,s=t.length;n<s;n++){a._pointArray[n]=i.Point.createByUint32(t[n]|0)}return a};return PointContainer}();e.PointContainer=a},function(t,e,r){"use strict";var i=r(2);var a=function(){function Point(){this.uint32=-1>>>0;this.r=this.g=this.b=this.a=0;this.rgba=new Array(4);this.rgba[0]=0;this.rgba[1]=0;this.rgba[2]=0;this.rgba[3]=0}Point.createByQuadruplet=function(t){var e=new Point;e.r=t[0]|0;e.g=t[1]|0;e.b=t[2]|0;e.a=t[3]|0;e._loadUINT32();e._loadQuadruplet();return e};Point.createByRGBA=function(t,e,r,i){var a=new Point;a.r=t|0;a.g=e|0;a.b=r|0;a.a=i|0;a._loadUINT32();a._loadQuadruplet();return a};Point.createByUint32=function(t){var e=new Point;e.uint32=t>>>0;e._loadRGBA();e._loadQuadruplet();return e};Point.prototype.from=function(t){this.r=t.r;this.g=t.g;this.b=t.b;this.a=t.a;this.uint32=t.uint32;this.rgba[0]=t.r;this.rgba[1]=t.g;this.rgba[2]=t.b;this.rgba[3]=t.a};Point.prototype.getLuminosity=function(t){var e=this.r,r=this.g,a=this.b;if(t){e=Math.min(255,255-this.a+this.a*e/255);r=Math.min(255,255-this.a+this.a*r/255);a=Math.min(255,255-this.a+this.a*a/255)}return e*i.Y.RED+r*i.Y.GREEN+a*i.Y.BLUE};Point.prototype._loadUINT32=function(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0};Point.prototype._loadRGBA=function(){this.r=this.uint32&255;this.g=this.uint32>>>8&255;this.b=this.uint32>>>16&255;this.a=this.uint32>>>24&255};Point.prototype._loadQuadruplet=function(){this.rgba[0]=this.r;this.rgba[1]=this.g;this.rgba[2]=this.b;this.rgba[3]=this.a};return Point}();e.Point=a},function(t,e,r){"use strict";var i=r(22);var a=r(24);var n=3;var s=function(){function NeuronFloat(t){this.r=this.g=this.b=this.a=t}NeuronFloat.prototype.toPoint=function(){return a.Point.createByRGBA(this.r>>n,this.g>>n,this.b>>n,this.a>>n)};NeuronFloat.prototype.subtract=function(t,e,r,i){this.r-=t;this.g-=e;this.b-=r;this.a-=i};return NeuronFloat}();var o=function(){function NeuQuantFloat(t,e){if(e===void 0){e=256}this._distance=t;this._pointArray=[];this._sampleFactor=1;this._networkSize=e;this._distance.setWhitePoint(255<<n,255<<n,255<<n,255<<n)}NeuQuantFloat.prototype.sample=function(t){this._pointArray=this._pointArray.concat(t.getPointArray())};NeuQuantFloat.prototype.quantize=function(){this._init();this._learn();return this._buildPalette()};NeuQuantFloat.prototype._init=function(){this._freq=[];this._bias=[];this._radPower=[];this._network=[];for(var t=0;t<this._networkSize;t++){this._network[t]=new s((t<<n+8)/this._networkSize);this._freq[t]=NeuQuantFloat._initialBias/this._networkSize;this._bias[t]=0}};NeuQuantFloat.prototype._learn=function(){var t=this._sampleFactor;var e=this._pointArray.length;if(e<NeuQuantFloat._minpicturebytes)t=1;var r=30+(t-1)/3,i=e/t;var a=i/NeuQuantFloat._nCycles|0,s=NeuQuantFloat._initAlpha,o=(this._networkSize>>3)*NeuQuantFloat._radiusBias;var h=o>>NeuQuantFloat._radiusBiasShift;if(h<=1)h=0;for(var f=0;f<h;f++){this._radPower[f]=s*((h*h-f*f)*NeuQuantFloat._radBias/(h*h))}var l;if(e<NeuQuantFloat._minpicturebytes){l=1}else if(e%NeuQuantFloat._prime1!=0){l=NeuQuantFloat._prime1}else if(e%NeuQuantFloat._prime2!=0){l=NeuQuantFloat._prime2}else if(e%NeuQuantFloat._prime3!=0){l=NeuQuantFloat._prime3}else{l=NeuQuantFloat._prime4}for(var f=0,u=0;f<i;){var c=this._pointArray[u],d=c.b<<n,p=c.g<<n,v=c.r<<n,m=c.a<<n,g=this._contest(d,p,v,m);this._alterSingle(s,g,d,p,v,m);if(h!=0)this._alterNeighbour(h,g,d,p,v,m);u+=l;if(u>=e)u-=e;f++;if(a==0)a=1;if(f%a==0){s-=s/r;o-=o/NeuQuantFloat._radiusDecrease;h=o>>NeuQuantFloat._radiusBiasShift;if(h<=1)h=0;for(var b=0;b<h;b++)this._radPower[b]=s*((h*h-b*b)*NeuQuantFloat._radBias/(h*h))}}};NeuQuantFloat.prototype._buildPalette=function(){var t=new i.Palette;this._network.forEach(function(e){t.add(e.toPoint())});t.sort();return t};NeuQuantFloat.prototype._alterNeighbour=function(t,e,r,i,a,n){var s=e-t;if(s<-1)s=-1;var o=e+t;if(o>this._networkSize)o=this._networkSize;var h=e+1,f=e-1,l=1;while(h<o||f>s){var u=this._radPower[l++]/NeuQuantFloat._alphaRadBias;if(h<o){var c=this._network[h++];c.subtract(u*(c.r-a),u*(c.g-i),u*(c.b-r),u*(c.a-n))}if(f>s){var c=this._network[f--];c.subtract(u*(c.r-a),u*(c.g-i),u*(c.b-r),u*(c.a-n))}}};NeuQuantFloat.prototype._alterSingle=function(t,e,r,i,a,n){t/=NeuQuantFloat._initAlpha;var s=this._network[e];s.subtract(t*(s.r-a),t*(s.g-i),t*(s.b-r),t*(s.a-n))};NeuQuantFloat.prototype._contest=function(t,e,r,i){var a=255*4<<n;var s=~(1<<31),o=s,h=-1,f=h;for(var l=0;l<this._networkSize;l++){var u=this._network[l],c=this._distance.calculateNormalized(u,{r:r,g:e,b:t,a:i})*a;if(c<s){s=c;h=l}var d=c-(this._bias[l]>>NeuQuantFloat._initialBiasShift-n);if(d<o){o=d;f=l}var p=this._freq[l]>>NeuQuantFloat._betaShift;this._freq[l]-=p;this._bias[l]+=p<<NeuQuantFloat._gammaShift}this._freq[h]+=NeuQuantFloat._beta;this._bias[h]-=NeuQuantFloat._betaGamma;return f};NeuQuantFloat._prime1=499;NeuQuantFloat._prime2=491;NeuQuantFloat._prime3=487;NeuQuantFloat._prime4=503;NeuQuantFloat._minpicturebytes=NeuQuantFloat._prime4;NeuQuantFloat._nCycles=100;NeuQuantFloat._initialBiasShift=16;NeuQuantFloat._initialBias=1<<NeuQuantFloat._initialBiasShift;NeuQuantFloat._gammaShift=10;NeuQuantFloat._betaShift=10;NeuQuantFloat._beta=NeuQuantFloat._initialBias>>NeuQuantFloat._betaShift;NeuQuantFloat._betaGamma=NeuQuantFloat._initialBias<<NeuQuantFloat._gammaShift-NeuQuantFloat._betaShift;NeuQuantFloat._radiusBiasShift=6;NeuQuantFloat._radiusBias=1<<NeuQuantFloat._radiusBiasShift;NeuQuantFloat._radiusDecrease=30;NeuQuantFloat._alphaBiasShift=10;NeuQuantFloat._initAlpha=1<<NeuQuantFloat._alphaBiasShift;NeuQuantFloat._radBiasShift=8;NeuQuantFloat._radBias=1<<NeuQuantFloat._radBiasShift;NeuQuantFloat._alphaRadBiasShift=NeuQuantFloat._alphaBiasShift+NeuQuantFloat._radBiasShift;NeuQuantFloat._alphaRadBias=1<<NeuQuantFloat._alphaRadBiasShift;return NeuQuantFloat}();e.NeuQuantFloat=o},function(t,e,r){"use strict";var i=r(22);var a=r(24);var n=r(27);var s=r(6);var o=function(){function RemovedColor(t,e,r){this.index=t;this.color=e;this.distance=r}return RemovedColor}();var h=function(){function RGBQuant(t,e,r){if(e===void 0){e=256}if(r===void 0){r=2}this._distance=t;this._colors=e;this._histogram=new n.ColorHistogram(r,e);this._initialDistance=.01;this._distanceIncrement=.005}RGBQuant.prototype.sample=function(t){this._histogram.sample(t)};RGBQuant.prototype.quantize=function(){var t=this._histogram.getImportanceSortedColorsIDXI32();if(t.length===0){throw new Error("No colors in image")}var e=this._buildPalette(t);e.sort();return e};RGBQuant.prototype._buildPalette=function(t){var e=new i.Palette,r=e.getPointContainer().getPointArray(),n=new Array(t.length);for(var h=0;h<t.length;h++){r.push(a.Point.createByUint32(t[h]));n[h]=1}var f=r.length,l=[];var u=f,c=this._initialDistance;while(u>this._colors){l.length=0;for(var h=0;h<f;h++){if(n[h]===0)continue;var d=r[h];for(var p=h+1;p<f;p++){if(n[p]===0)continue;var v=r[p];var m=this._distance.calculateNormalized(d,v);if(m<c){l.push(new o(p,v,m));n[p]=0;u--}}}c+=u>this._colors*3?this._initialDistance:this._distanceIncrement}if(u<this._colors){s.stableSort(l,function(t,e){return e.distance-t.distance});var g=0;while(u<this._colors&&g<l.length){var b=l[g];n[b.index]=1;u++;g++}}var y=r.length;for(var E=y-1;E>=0;E--){if(n[E]===0){if(E!==y-1){r[E]=r[y-1]}--y}}r.length=y;return e};return RGBQuant}();e.RGBQuant=h},function(t,e,r){"use strict";var i=r(28);var a=r(6);var n=function(){function ColorHistogram(t,e){this._method=t;this._minHueCols=e<<2;this._initColors=e<<2;this._hueStats=new i.HueStatistics(ColorHistogram._hueGroups,this._minHueCols);this._histogram=Object.create(null)}ColorHistogram.prototype.sample=function(t){switch(this._method){case 1:this._colorStats1D(t);break;case 2:this._colorStats2D(t);break}};ColorHistogram.prototype.getImportanceSortedColorsIDXI32=function(){var t=this;var e=a.stableSort(Object.keys(this._histogram),function(e,r){return t._histogram[r]-t._histogram[e]});if(e.length===0){return[]}var r;switch(this._method){case 1:var i=Math.min(e.length,this._initColors),n=e[i-1],s=this._histogram[n];r=e.slice(0,i);var o=i,h=e.length;while(o<h&&this._histogram[e[o]]==s)r.push(e[o++]);this._hueStats.injectIntoArray(r);break;case 2:r=e;break;default:throw new Error("Incorrect method")}return r.map(function(t){return+t})};ColorHistogram.prototype._colorStats1D=function(t){var e=this._histogram,r=t.getPointArray(),i=r.length;for(var a=0;a<i;a++){var n=r[a].uint32;this._hueStats.check(n);if(n in e)e[n]++;else e[n]=1}};ColorHistogram.prototype._colorStats2D=function(t){var e=this;var r=t.getWidth(),i=t.getHeight(),a=t.getPointArray();var n=ColorHistogram._boxSize[0],s=ColorHistogram._boxSize[1],o=n*s,h=this._makeBoxes(r,i,n,s),f=this._histogram;h.forEach(function(t){var i=Math.round(t.w*t.h/o)*ColorHistogram._boxPixels;if(i<2)i=2;var n={};e._iterateBox(t,r,function(t){var r=a[t].uint32;e._hueStats.check(r);if(r in f)f[r]++;else if(r in n){if(++n[r]>=i)f[r]=n[r]}else n[r]=1})});this._hueStats.injectIntoDictionary(f)};ColorHistogram.prototype._iterateBox=function(t,e,r){var i=t,a=i.y*e+i.x,n=(i.y+i.h-1)*e+(i.x+i.w-1),s=e-i.w+1;var o=0,h=a;do{r.call(this,h);h+=++o%i.w==0?s:1}while(h<=n)};ColorHistogram.prototype._makeBoxes=function(t,e,r,i){var a=t%r,n=e%i,s=t-a,o=e-n,h=[];for(var f=0;f<e;f+=i)for(var l=0;l<t;l+=r)h.push({x:l,y:f,w:l==s?a:r,h:f==o?n:i});return h};ColorHistogram._boxSize=[64,64];ColorHistogram._boxPixels=2;ColorHistogram._hueGroups=10;return ColorHistogram}();e.ColorHistogram=n},function(t,e,r){"use strict";var i=r(5);var a=r(22);var n=function(){function HueGroup(){this.num=0;this.cols=[]}return HueGroup}();var s=function(){function HueStatistics(t,e){this._numGroups=t;this._minCols=e;this._stats=[];for(var r=0;r<=t;r++){this._stats[r]=new n}this._groupsFull=0}HueStatistics.prototype.check=function(t){if(this._groupsFull==this._numGroups+1){this.check=function(){}}var e=t&255,r=t>>>8&255,n=t>>>16&255,s=e==r&&r==n?0:1+a.hueGroup(i.rgb2hsl(e,r,n).h,this._numGroups),o=this._stats[s],h=this._minCols;o.num++;if(o.num>h)return;if(o.num==h)this._groupsFull++;if(o.num<=h)this._stats[s].cols.push(t)};HueStatistics.prototype.injectIntoDictionary=function(t){for(var e=0;e<=this._numGroups;e++){if(this._stats[e].num<=this._minCols){this._stats[e].cols.forEach(function(e){if(!t[e])t[e]=1;else t[e]++})}}};HueStatistics.prototype.injectIntoArray=function(t){for(var e=0;e<=this._numGroups;e++){if(this._stats[e].num<=this._minCols){this._stats[e].cols.forEach(function(e){if(t.indexOf(e)==-1)t.push(e)})}}};return HueStatistics}();e.HueStatistics=s},function(t,e,r){"use strict";var i=r(22);var a=r(24);function createArray1D(t){var e=[];for(var r=0;r<t;r++){e[r]=0}return e}function createArray4D(t,e,r,i){var a=new Array(t);for(var n=0;n<t;n++){a[n]=new Array(e);for(var s=0;s<e;s++){a[n][s]=new Array(r);for(var o=0;o<r;o++){a[n][s][o]=new Array(i);for(var h=0;h<i;h++){a[n][s][o][h]=0}}}}return a}function createArray3D(t,e,r){var i=new Array(t);for(var a=0;a<t;a++){i[a]=new Array(e);for(var n=0;n<e;n++){i[a][n]=new Array(r);for(var s=0;s<r;s++){i[a][n][s]=0}}}return i}function fillArray3D(t,e,r,i,a){for(var n=0;n<e;n++){t[n]=[];for(var s=0;s<r;s++){t[n][s]=[];for(var o=0;o<i;o++){t[n][s][o]=a}}}}function fillArray1D(t,e,r){for(var i=0;i<e;i++){t[i]=r}}var n=function(){function WuColorCube(){}return WuColorCube}();e.WuColorCube=n;var s=function(){function WuQuant(t,e,r){if(e===void 0){e=256}if(r===void 0){r=5}this._distance=t;this._setQuality(r);this._initialize(e)}WuQuant.prototype.sample=function(t){var e=t.getPointArray();for(var r=0,i=e.length;r<i;r++){this._addColor(e[r])}this._pixels=this._pixels.concat(e)};WuQuant.prototype.quantize=function(){this._preparePalette();var t=new i.Palette;for(var e=0;e<this._colors;e++){if(this._sums[e]>0){var r=this._sums[e],n=this._reds[e]/r,s=this._greens[e]/r,o=this._blues[e]/r,h=this._alphas[e]/r;var f=a.Point.createByRGBA(n|0,s|0,o|0,h|0);t.add(f)}}t.sort();return t};WuQuant.prototype._preparePalette=function(){this._calculateMoments();var t=0,e=createArray1D(this._colors);for(var r=1;r<this._colors;++r){if(this._cut(this._cubes[t],this._cubes[r])){e[t]=this._cubes[t].volume>1?this._calculateVariance(this._cubes[t]):0;e[r]=this._cubes[r].volume>1?this._calculateVariance(this._cubes[r]):0}else{e[t]=0;r--}t=0;var i=e[0];for(var a=1;a<=r;++a){if(e[a]>i){i=e[a];t=a}}if(i<=0){this._colors=r+1;break}}var n=[],s=[],o=[],h=[];for(var f=0;f<this._colors;++f){var l=WuQuant._volume(this._cubes[f],this._weights);if(l>0){n[f]=WuQuant._volume(this._cubes[f],this._momentsRed)/l|0;s[f]=WuQuant._volume(this._cubes[f],this._momentsGreen)/l|0;o[f]=WuQuant._volume(this._cubes[f],this._momentsBlue)/l|0;h[f]=WuQuant._volume(this._cubes[f],this._momentsAlpha)/l|0}else{n[f]=0;s[f]=0;o[f]=0;h[f]=0}}this._reds=createArray1D(this._colors+1);this._greens=createArray1D(this._colors+1);this._blues=createArray1D(this._colors+1);this._alphas=createArray1D(this._colors+1);this._sums=createArray1D(this._colors+1);for(var a=0,u=this._pixels.length;a<u;a++){var c=this._pixels[a];var d=-1;var p=d,v=Number.MAX_VALUE;for(var m=0;m<this._colors;m++){var g=n[m],b=s[m],y=o[m],E=h[m];var M=this._distance.calculateRaw(g,b,y,E,c.r,c.g,c.b,c.a);if(M<v){v=M;p=m}}this._reds[p]+=c.r;this._greens[p]+=c.g;this._blues[p]+=c.b;this._alphas[p]+=c.a;this._sums[p]++}};WuQuant.prototype._addColor=function(t){var e=8-this._significantBitsPerChannel,r=(t.r>>e)+1,i=(t.g>>e)+1,a=(t.b>>e)+1,n=(t.a>>e)+1;this._weights[n][r][i][a]++;this._momentsRed[n][r][i][a]+=t.r;this._momentsGreen[n][r][i][a]+=t.g;this._momentsBlue[n][r][i][a]+=t.b;this._momentsAlpha[n][r][i][a]+=t.a;this._moments[n][r][i][a]+=this._table[t.r]+this._table[t.g]+this._table[t.b]+this._table[t.a]};WuQuant.prototype._calculateMoments=function(){var t=[],e=[],r=[],i=[],a=[],n=[];var s=createArray3D(this._sideSize,this._sideSize,this._sideSize),o=createArray3D(this._sideSize,this._sideSize,this._sideSize),h=createArray3D(this._sideSize,this._sideSize,this._sideSize),f=createArray3D(this._sideSize,this._sideSize,this._sideSize),l=createArray3D(this._sideSize,this._sideSize,this._sideSize),u=createArray3D(this._sideSize,this._sideSize,this._sideSize);for(var c=1;c<=this._alphaMaxSideIndex;++c){fillArray3D(s,this._sideSize,this._sideSize,this._sideSize,0);fillArray3D(o,this._sideSize,this._sideSize,this._sideSize,0);fillArray3D(h,this._sideSize,this._sideSize,this._sideSize,0);fillArray3D(f,this._sideSize,this._sideSize,this._sideSize,0);fillArray3D(l,this._sideSize,this._sideSize,this._sideSize,0);fillArray3D(u,this._sideSize,this._sideSize,this._sideSize,0);for(var d=1;d<=this._maxSideIndex;++d){fillArray1D(t,this._sideSize,0);fillArray1D(e,this._sideSize,0);fillArray1D(r,this._sideSize,0);fillArray1D(i,this._sideSize,0);fillArray1D(a,this._sideSize,0);fillArray1D(n,this._sideSize,0);for(var p=1;p<=this._maxSideIndex;++p){var v=0,m=0,g=0,b=0,y=0,E=0;for(var M=1;M<=this._maxSideIndex;++M){v+=this._weights[c][d][p][M];m+=this._momentsRed[c][d][p][M];g+=this._momentsGreen[c][d][p][M];b+=this._momentsBlue[c][d][p][M];y+=this._momentsAlpha[c][d][p][M];E+=this._moments[c][d][p][M];t[M]+=v;e[M]+=m;r[M]+=g;i[M]+=b;a[M]+=y;n[M]+=E;s[d][p][M]=s[d-1][p][M]+t[M];o[d][p][M]=o[d-1][p][M]+e[M];h[d][p][M]=h[d-1][p][M]+r[M];f[d][p][M]=f[d-1][p][M]+i[M];l[d][p][M]=l[d-1][p][M]+a[M];u[d][p][M]=u[d-1][p][M]+n[M];this._weights[c][d][p][M]=this._weights[c-1][d][p][M]+s[d][p][M];this._momentsRed[c][d][p][M]=this._momentsRed[c-1][d][p][M]+o[d][p][M];this._momentsGreen[c][d][p][M]=this._momentsGreen[c-1][d][p][M]+h[d][p][M];this._momentsBlue[c][d][p][M]=this._momentsBlue[c-1][d][p][M]+f[d][p][M];this._momentsAlpha[c][d][p][M]=this._momentsAlpha[c-1][d][p][M]+l[d][p][M];this._moments[c][d][p][M]=this._moments[c-1][d][p][M]+u[d][p][M]}}}}};WuQuant._volumeFloat=function(t,e){return e[t.alphaMaximum][t.redMaximum][t.greenMaximum][t.blueMaximum]-e[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMaximum]-e[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMaximum]+e[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMaximum]-e[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMaximum]+e[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMaximum]+e[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMaximum]-e[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum]-(e[t.alphaMaximum][t.redMaximum][t.greenMaximum][t.blueMinimum]-e[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMinimum]-e[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMinimum]+e[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum]-e[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMinimum]+e[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum]+e[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum]-e[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum])};WuQuant._volume=function(t,e){return WuQuant._volumeFloat(t,e)|0};WuQuant._top=function(t,e,r,i){var a;switch(e){case WuQuant.alpha:a=i[r][t.redMaximum][t.greenMaximum][t.blueMaximum]-i[r][t.redMaximum][t.greenMinimum][t.blueMaximum]-i[r][t.redMinimum][t.greenMaximum][t.blueMaximum]+i[r][t.redMinimum][t.greenMinimum][t.blueMaximum]-(i[r][t.redMaximum][t.greenMaximum][t.blueMinimum]-i[r][t.redMaximum][t.greenMinimum][t.blueMinimum]-i[r][t.redMinimum][t.greenMaximum][t.blueMinimum]+i[r][t.redMinimum][t.greenMinimum][t.blueMinimum]);break;case WuQuant.red:a=i[t.alphaMaximum][r][t.greenMaximum][t.blueMaximum]-i[t.alphaMaximum][r][t.greenMinimum][t.blueMaximum]-i[t.alphaMinimum][r][t.greenMaximum][t.blueMaximum]+i[t.alphaMinimum][r][t.greenMinimum][t.blueMaximum]-(i[t.alphaMaximum][r][t.greenMaximum][t.blueMinimum]-i[t.alphaMaximum][r][t.greenMinimum][t.blueMinimum]-i[t.alphaMinimum][r][t.greenMaximum][t.blueMinimum]+i[t.alphaMinimum][r][t.greenMinimum][t.blueMinimum]);break;case WuQuant.green:a=i[t.alphaMaximum][t.redMaximum][r][t.blueMaximum]-i[t.alphaMaximum][t.redMinimum][r][t.blueMaximum]-i[t.alphaMinimum][t.redMaximum][r][t.blueMaximum]+i[t.alphaMinimum][t.redMinimum][r][t.blueMaximum]-(i[t.alphaMaximum][t.redMaximum][r][t.blueMinimum]-i[t.alphaMaximum][t.redMinimum][r][t.blueMinimum]-i[t.alphaMinimum][t.redMaximum][r][t.blueMinimum]+i[t.alphaMinimum][t.redMinimum][r][t.blueMinimum]);break;case WuQuant.blue:a=i[t.alphaMaximum][t.redMaximum][t.greenMaximum][r]-i[t.alphaMaximum][t.redMaximum][t.greenMinimum][r]-i[t.alphaMaximum][t.redMinimum][t.greenMaximum][r]+i[t.alphaMaximum][t.redMinimum][t.greenMinimum][r]-(i[t.alphaMinimum][t.redMaximum][t.greenMaximum][r]-i[t.alphaMinimum][t.redMaximum][t.greenMinimum][r]-i[t.alphaMinimum][t.redMinimum][t.greenMaximum][r]+i[t.alphaMinimum][t.redMinimum][t.greenMinimum][r]);break;default:throw new Error("impossible")}return a|0};WuQuant._bottom=function(t,e,r){switch(e){case WuQuant.alpha:return-r[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMaximum]+r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMaximum]+r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMaximum]-r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum]-(-r[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMinimum]+r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum]+r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum]-r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);case WuQuant.red:return-r[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMaximum]+r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMaximum]+r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMaximum]-r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum]-(-r[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMinimum]+r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum]+r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum]-r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);case WuQuant.green:return-r[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMaximum]+r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMaximum]+r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMaximum]-r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum]-(-r[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMinimum]+r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum]+r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum]-r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);case WuQuant.blue:return-r[t.alphaMaximum][t.redMaximum][t.greenMaximum][t.blueMinimum]+r[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMinimum]+r[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMinimum]-r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum]-(-r[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMinimum]+r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum]+r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum]-r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);default:return 0}};WuQuant.prototype._calculateVariance=function(t){var e=WuQuant._volume(t,this._momentsRed),r=WuQuant._volume(t,this._momentsGreen),i=WuQuant._volume(t,this._momentsBlue),a=WuQuant._volume(t,this._momentsAlpha),n=WuQuant._volumeFloat(t,this._moments),s=WuQuant._volume(t,this._weights),o=e*e+r*r+i*i+a*a;return n-o/s};WuQuant.prototype._maximize=function(t,e,r,i,a,n,s,o,h){var f=WuQuant._bottom(t,e,this._momentsRed)|0,l=WuQuant._bottom(t,e,this._momentsGreen)|0,u=WuQuant._bottom(t,e,this._momentsBlue)|0,c=WuQuant._bottom(t,e,this._momentsAlpha)|0,d=WuQuant._bottom(t,e,this._weights)|0;var p=0,v=-1;for(var m=r;m<i;++m){var g=f+WuQuant._top(t,e,m,this._momentsRed),b=l+WuQuant._top(t,e,m,this._momentsGreen),y=u+WuQuant._top(t,e,m,this._momentsBlue),E=c+WuQuant._top(t,e,m,this._momentsAlpha),M=d+WuQuant._top(t,e,m,this._weights);if(M!=0){var w=g*g+b*b+y*y+E*E,_=w/M;g=a-g;b=n-b;y=s-y;E=o-E;M=h-M;if(M!=0){w=g*g+b*b+y*y+E*E;_+=w/M;if(_>p){p=_;v=m}}}}return{max:p,position:v}};WuQuant.prototype._cut=function(t,e){var r;var i=WuQuant._volume(t,this._momentsRed),a=WuQuant._volume(t,this._momentsGreen),n=WuQuant._volume(t,this._momentsBlue),s=WuQuant._volume(t,this._momentsAlpha),o=WuQuant._volume(t,this._weights),h=this._maximize(t,WuQuant.red,t.redMinimum+1,t.redMaximum,i,a,n,s,o),f=this._maximize(t,WuQuant.green,t.greenMinimum+1,t.greenMaximum,i,a,n,s,o),l=this._maximize(t,WuQuant.blue,t.blueMinimum+1,t.blueMaximum,i,a,n,s,o),u=this._maximize(t,WuQuant.alpha,t.alphaMinimum+1,t.alphaMaximum,i,a,n,s,o);if(u.max>=h.max&&u.max>=f.max&&u.max>=l.max){r=WuQuant.alpha;if(u.position<0)return false}else{if(h.max>=u.max&&h.max>=f.max&&h.max>=l.max){r=WuQuant.red}else if(f.max>=u.max&&f.max>=h.max&&f.max>=l.max){r=WuQuant.green}else{r=WuQuant.blue}}e.redMaximum=t.redMaximum;e.greenMaximum=t.greenMaximum;e.blueMaximum=t.blueMaximum;e.alphaMaximum=t.alphaMaximum;switch(r){case WuQuant.red:e.redMinimum=t.redMaximum=h.position;e.greenMinimum=t.greenMinimum;e.blueMinimum=t.blueMinimum;e.alphaMinimum=t.alphaMinimum;break;case WuQuant.green:e.greenMinimum=t.greenMaximum=f.position;e.redMinimum=t.redMinimum;e.blueMinimum=t.blueMinimum;e.alphaMinimum=t.alphaMinimum;break;case WuQuant.blue:e.blueMinimum=t.blueMaximum=l.position;e.redMinimum=t.redMinimum;e.greenMinimum=t.greenMinimum;e.alphaMinimum=t.alphaMinimum;break;case WuQuant.alpha:e.alphaMinimum=t.alphaMaximum=u.position;e.blueMinimum=t.blueMinimum;e.redMinimum=t.redMinimum;e.greenMinimum=t.greenMinimum;break}t.volume=(t.redMaximum-t.redMinimum)*(t.greenMaximum-t.greenMinimum)*(t.blueMaximum-t.blueMinimum)*(t.alphaMaximum-t.alphaMinimum);e.volume=(e.redMaximum-e.redMinimum)*(e.greenMaximum-e.greenMinimum)*(e.blueMaximum-e.blueMinimum)*(e.alphaMaximum-e.alphaMinimum);return true};WuQuant.prototype._initialize=function(t){this._colors=t;this._cubes=[];for(var e=0;e<t;e++){this._cubes[e]=new n}this._cubes[0].redMinimum=0;this._cubes[0].greenMinimum=0;this._cubes[0].blueMinimum=0;this._cubes[0].alphaMinimum=0;this._cubes[0].redMaximum=this._maxSideIndex;this._cubes[0].greenMaximum=this._maxSideIndex;this._cubes[0].blueMaximum=this._maxSideIndex;this._cubes[0].alphaMaximum=this._alphaMaxSideIndex;this._weights=createArray4D(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize);this._momentsRed=createArray4D(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize);this._momentsGreen=createArray4D(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize);this._momentsBlue=createArray4D(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize);this._momentsAlpha=createArray4D(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize);this._moments=createArray4D(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize);this._table=[];for(var r=0;r<256;++r){this._table[r]=r*r}this._pixels=[]};WuQuant.prototype._setQuality=function(t){if(t===void 0){t=5}this._significantBitsPerChannel=t;this._maxSideIndex=1<<this._significantBitsPerChannel;this._alphaMaxSideIndex=this._maxSideIndex;this._sideSize=this._maxSideIndex+1;this._alphaSideSize=this._alphaMaxSideIndex+1};WuQuant.alpha=3;WuQuant.red=2;WuQuant.green=1;WuQuant.blue=0;return WuQuant}();e.WuQuant=s},function(t,e,r){"use strict";var i=r(31);e.NearestColor=i.NearestColor;var a=r(32);e.ErrorDiffusionArray=a.ErrorDiffusionArray;e.ErrorDiffusionArrayKernel=a.ErrorDiffusionArrayKernel;var n=r(33);e.ErrorDiffusionRiemersma=n.ErrorDiffusionRiemersma},function(t,e){"use strict";var r=function(){function NearestColor(t){this._distance=t}NearestColor.prototype.quantize=function(t,e){var r=t.getPointArray(),i=t.getWidth(),a=t.getHeight();for(var n=0;n<a;n++){for(var s=0,o=n*i;s<i;s++,o++){var h=r[o];h.from(e.getNearestColor(this._distance,h))}}return t};return NearestColor}();e.NearestColor=r},function(t,e,r){"use strict";var i=r(24);var a=r(6);(function(t){t[t["FloydSteinberg"]=0]="FloydSteinberg";t[t["FalseFloydSteinberg"]=1]="FalseFloydSteinberg";t[t["Stucki"]=2]="Stucki";t[t["Atkinson"]=3]="Atkinson";t[t["Jarvis"]=4]="Jarvis";t[t["Burkes"]=5]="Burkes";t[t["Sierra"]=6]="Sierra";t[t["TwoSierra"]=7]="TwoSierra";t[t["SierraLite"]=8]="SierraLite"})(e.ErrorDiffusionArrayKernel||(e.ErrorDiffusionArrayKernel={}));var n=e.ErrorDiffusionArrayKernel;var s=function(){function ErrorDiffusionArray(t,e,r,i,a){if(r===void 0){r=true}if(i===void 0){i=0}if(a===void 0){a=false}this._setKernel(e);this._distance=t;this._minColorDistance=i;this._serpentine=r;this._calculateErrorLikeGIMP=a}ErrorDiffusionArray.prototype.quantize=function(t,e){var r=t.getPointArray(),n=new i.Point,s=t.getWidth(),o=t.getHeight(),h=[];var f=1,l=1;for(var u=0;u<this._kernel.length;u++){var c=this._kernel[u][2]+1;if(l<c)l=c}for(var u=0;u<l;u++){this._fillErrorLine(h[u]=[],s)}for(var d=0;d<o;d++){if(this._serpentine)f=f*-1;var p=d*s,v=f==1?0:s-1,m=f==1?s:-1;this._fillErrorLine(h[0],s);h.push(h.shift());var g=h[0];for(var b=v,y=p+v;b!==m;b+=f,y+=f){var E=r[y],M=g[b];n.from(E);var w=i.Point.createByRGBA(a.inRange0to255Rounded(E.r+M[0]),a.inRange0to255Rounded(E.g+M[1]),a.inRange0to255Rounded(E.b+M[2]),a.inRange0to255Rounded(E.a+M[3]));var _=e.getNearestColor(this._distance,w);E.from(_);if(this._minColorDistance){var x=this._distance.calculateNormalized(E,_);if(x<this._minColorDistance)continue}var I=void 0,D=void 0,L=void 0,T=void 0;if(this._calculateErrorLikeGIMP){I=w.r-_.r;D=w.g-_.g;L=w.b-_.b;T=w.a-_.a}else{I=n.r-_.r;D=n.g-_.g;L=n.b-_.b;T=n.a-_.a}var P=f==1?0:this._kernel.length-1,k=f==1?this._kernel.length:-1;for(var u=P;u!==k;u+=f){var O=this._kernel[u][1]*f,N=this._kernel[u][2];if(O+b>=0&&O+b<s&&N+d>=0&&N+d<o){var S=this._kernel[u][0],A=h[N][O+b];A[0]=A[0]+I*S;A[1]=A[1]+D*S;A[2]=A[2]+L*S;A[3]=A[3]+T*S}}}}return t};ErrorDiffusionArray.prototype._fillErrorLine=function(t,e){if(t.length>e){t.length=e}var r=t.length;for(var i=0;i<r;i++){var a=t[i];a[0]=a[1]=a[2]=a[3]=0}for(var i=r;i<e;i++){t[i]=[0,0,0,0]}};ErrorDiffusionArray.prototype._setKernel=function(t){switch(t){case n.FloydSteinberg:this._kernel=[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]];break;case n.FalseFloydSteinberg:this._kernel=[[3/8,1,0],[3/8,0,1],[2/8,1,1]];break;case n.Stucki:this._kernel=[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]];break;case n.Atkinson:this._kernel=[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]];break;case n.Jarvis:this._kernel=[[7/48,1,0],[5/48,2,0],[3/48,-2,1],[5/48,-1,1],[7/48,0,1],[5/48,1,1],[3/48,2,1],[1/48,-2,2],[3/48,-1,2],[5/48,0,2],[3/48,1,2],[1/48,2,2]];break;case n.Burkes:this._kernel=[[8/32,1,0],[4/32,2,0],[2/32,-2,1],[4/32,-1,1],[8/32,0,1],[4/32,1,1],[2/32,2,1]];break;case n.Sierra:this._kernel=[[5/32,1,0],[3/32,2,0],[2/32,-2,1],[4/32,-1,1],[5/32,0,1],[4/32,1,1],[2/32,2,1],[2/32,-1,2],[3/32,0,2],[2/32,1,2]];break;case n.TwoSierra:this._kernel=[[4/16,1,0],[3/16,2,0],[1/16,-2,1],[2/16,-1,1],[3/16,0,1],[2/16,1,1],[1/16,2,1]];break;case n.SierraLite:this._kernel=[[2/4,1,0],[1/4,-1,1],[1/4,0,1]];break;default:throw new Error("ErrorDiffusionArray: unknown kernel = "+t)}};return ErrorDiffusionArray}();e.ErrorDiffusionArray=s},function(t,e,r){"use strict";var i=r(34);var a=r(24);var n=r(6);var s=function(){function ErrorDiffusionRiemersma(t,e,r){if(e===void 0){e=16}if(r===void 0){r=1}this._distance=t;this._errorPropagation=r;this._errorQueueSize=e;this._max=this._errorQueueSize;this._createWeights()}ErrorDiffusionRiemersma.prototype.quantize=function(t,e){var r=this;var s=new i.HilbertCurveBase,o=t.getPointArray(),h=t.getWidth(),f=t.getHeight(),l=[];var u=0;for(var c=0;c<this._errorQueueSize;c++){l[c]={r:0,g:0,b:0,a:0}}s.walk(h,f,function(t,i){var s=o[t+i*h];var f=s.r,c=s.g,d=s.b,p=s.a;for(var v=0;v<r._errorQueueSize;v++){var m=r._weights[v],g=l[(v+u)%r._errorQueueSize];f+=g.r*m;c+=g.g*m;d+=g.b*m;p+=g.a*m}var b=a.Point.createByRGBA(n.inRange0to255Rounded(f),n.inRange0to255Rounded(c),n.inRange0to255Rounded(d),n.inRange0to255Rounded(p));var y=e.getNearestColor(r._distance,b);u=(u+1)%r._errorQueueSize;var E=(u+r._errorQueueSize-1)%r._errorQueueSize;l[E].r=s.r-y.r;l[E].g=s.g-y.g;l[E].b=s.b-y.b;l[E].a=s.a-y.a;s.from(y)});return t};ErrorDiffusionRiemersma.prototype._createWeights=function(){this._weights=[];var t=Math.exp(Math.log(this._max)/(this._errorQueueSize-1));for(var e=0,r=1;e<this._errorQueueSize;e++){this._weights[e]=(r+.5|0)/this._max*this._errorPropagation;r*=t}};return ErrorDiffusionRiemersma}();e.ErrorDiffusionRiemersma=s},function(t,e){"use strict";var r;(function(t){t[t["NONE"]=0]="NONE";t[t["UP"]=1]="UP";t[t["LEFT"]=2]="LEFT";t[t["RIGHT"]=3]="RIGHT";t[t["DOWN"]=4]="DOWN"})(r||(r={}));var i=function(){function HilbertCurveBase(){}HilbertCurveBase.prototype.walk=function(t,e,i){this._x=0;this._y=0;this._d=0;this._width=t;this._height=e;this._callback=i;var a=Math.max(t,e);this._level=Math.log(a)/Math.log(2)+1|0;this._walkHilbert(r.UP);this._visit(r.NONE)};HilbertCurveBase.prototype._walkHilbert=function(t){if(this._level<1)return;this._level--;switch(t){case r.LEFT:this._walkHilbert(r.UP);this._visit(r.RIGHT);this._walkHilbert(r.LEFT);this._visit(r.DOWN);this._walkHilbert(r.LEFT);this._visit(r.LEFT);this._walkHilbert(r.DOWN);break;case r.RIGHT:this._walkHilbert(r.DOWN);this._visit(r.LEFT);this._walkHilbert(r.RIGHT);this._visit(r.UP);this._walkHilbert(r.RIGHT);this._visit(r.RIGHT);this._walkHilbert(r.UP);break;case r.UP:this._walkHilbert(r.LEFT);this._visit(r.DOWN);this._walkHilbert(r.UP);this._visit(r.RIGHT);this._walkHilbert(r.UP);this._visit(r.UP);this._walkHilbert(r.RIGHT);break;case r.DOWN:this._walkHilbert(r.RIGHT);this._visit(r.UP);this._walkHilbert(r.DOWN);this._visit(r.LEFT);this._walkHilbert(r.DOWN);this._visit(r.DOWN);this._walkHilbert(r.LEFT);break;default:break}this._level++};HilbertCurveBase.prototype._visit=function(t){if(this._x>=0&&this._x<this._width&&this._y>=0&&this._y<this._height){this._callback(this._x,this._y,this._d);this._d++}switch(t){case r.LEFT:this._x--;break;case r.RIGHT:this._x++;break;case r.UP:this._y--;break;case r.DOWN:this._y++;break}};return HilbertCurveBase}();e.HilbertCurveBase=i},function(t,e,r){"use strict";var i=r(36);e.SSIM=i.SSIM},function(t,e,r){"use strict";var i=r(2);var a=.01,n=.03;var s=function(){function SSIM(){}SSIM.prototype.compare=function(t,e){if(t.getHeight()!==e.getHeight()||t.getWidth()!==e.getWidth()){throw new Error("Images have different sizes!")}var r=8,i=(1<<r)-1,s=Math.pow(a*i,2),o=Math.pow(n*i,2);var h=0,f=0;this._iterate(t,e,function(t,e,r,i){var a=0,n=0,l=0;for(var u=0;u<t.length;u++){n+=Math.pow(t[u]-r,2);l+=Math.pow(e[u]-i,2);a+=(t[u]-r)*(e[u]-i)}var c=t.length-1;n/=c;l/=c;a/=c;var d=(2*r*i+s)*(2*a+o),p=(Math.pow(r,2)+Math.pow(i,2)+s)*(n+l+o),v=d/p;f+=v;h++});return f/h};SSIM.prototype._iterate=function(t,e,r){var i=8,a=t.getWidth(),n=t.getHeight();for(var s=0;s<n;s+=i){for(var o=0;o<a;o+=i){var h=Math.min(i,a-o),f=Math.min(i,n-s);var l=this._calculateLumaValuesForWindow(t,o,s,h,f),u=this._calculateLumaValuesForWindow(e,o,s,h,f),c=this._calculateAverageLuma(l),d=this._calculateAverageLuma(u);r(l,u,c,d)}}};SSIM.prototype._calculateLumaValuesForWindow=function(t,e,r,a,n){var s=t.getPointArray(),o=[];var h=0;for(var f=r;f<r+n;f++){var l=f*t.getWidth();for(var u=e;u<e+a;u++){var c=s[l+u];o[h]=c.r*i.Y.RED+c.g*i.Y.GREEN+c.b*i.Y.BLUE;h++}}return o};SSIM.prototype._calculateAverageLuma=function(t){var e=0;for(var r=0;r<t.length;r++){e+=t[r]}return e/t.length};return SSIM}();e.SSIM=s},function(t,e,r){"use strict";var i=r(6);e.arithmetic=i;var a=r(28);e.HueStatistics=a.HueStatistics;var n=r(22);e.Palette=n.Palette;var s=r(24);e.Point=s.Point;var o=r(23);e.PointContainer=o.PointContainer}])})},565:function(t){var e=function(t){"use strict";var e=Object.prototype;var r=e.hasOwnProperty;var i;var a=typeof Symbol==="function"?Symbol:{};var n=a.iterator||"@@iterator";var s=a.asyncIterator||"@@asyncIterator";var o=a.toStringTag||"@@toStringTag";function wrap(t,e,r,i){var a=e&&e.prototype instanceof Generator?e:Generator;var n=Object.create(a.prototype);var s=new Context(i||[]);n._invoke=makeInvokeMethod(t,r,s);return n}t.wrap=wrap;function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}var h="suspendedStart";var f="suspendedYield";var l="executing";var u="completed";var c={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var d={};d[n]=function(){return this};var p=Object.getPrototypeOf;var v=p&&p(p(values([])));if(v&&v!==e&&r.call(v,n)){d=v}var m=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(d);GeneratorFunction.prototype=m.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunctionPrototype[o]=GeneratorFunction.displayName="GeneratorFunction";function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}t.isGeneratorFunction=function(t){var e=typeof t==="function"&&t.constructor;return e?e===GeneratorFunction||(e.displayName||e.name)==="GeneratorFunction":false};t.mark=function(t){if(Object.setPrototypeOf){Object.setPrototypeOf(t,GeneratorFunctionPrototype)}else{t.__proto__=GeneratorFunctionPrototype;if(!(o in t)){t[o]="GeneratorFunction"}}t.prototype=Object.create(m);return t};t.awrap=function(t){return{__await:t}};function AsyncIterator(t,e){function invoke(i,a,n,s){var o=tryCatch(t[i],t,a);if(o.type==="throw"){s(o.arg)}else{var h=o.arg;var f=h.value;if(f&&typeof f==="object"&&r.call(f,"__await")){return e.resolve(f.__await).then(function(t){invoke("next",t,n,s)},function(t){invoke("throw",t,n,s)})}return e.resolve(f).then(function(t){h.value=t;n(h)},function(t){return invoke("throw",t,n,s)})}}var i;function enqueue(t,r){function callInvokeWithMethodAndArg(){return new e(function(e,i){invoke(t,r,e,i)})}return i=i?i.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}this._invoke=enqueue}defineIteratorMethods(AsyncIterator.prototype);AsyncIterator.prototype[s]=function(){return this};t.AsyncIterator=AsyncIterator;t.async=function(e,r,i,a,n){if(n===void 0)n=Promise;var s=new AsyncIterator(wrap(e,r,i,a),n);return t.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})};function makeInvokeMethod(t,e,r){var i=h;return function invoke(a,n){if(i===l){throw new Error("Generator is already running")}if(i===u){if(a==="throw"){throw n}return doneResult()}r.method=a;r.arg=n;while(true){var s=r.delegate;if(s){var o=maybeInvokeDelegate(s,r);if(o){if(o===c)continue;return o}}if(r.method==="next"){r.sent=r._sent=r.arg}else if(r.method==="throw"){if(i===h){i=u;throw r.arg}r.dispatchException(r.arg)}else if(r.method==="return"){r.abrupt("return",r.arg)}i=l;var d=tryCatch(t,e,r);if(d.type==="normal"){i=r.done?u:f;if(d.arg===c){continue}return{value:d.arg,done:r.done}}else if(d.type==="throw"){i=u;r.method="throw";r.arg=d.arg}}}}function maybeInvokeDelegate(t,e){var r=t.iterator[e.method];if(r===i){e.delegate=null;if(e.method==="throw"){if(t.iterator["return"]){e.method="return";e.arg=i;maybeInvokeDelegate(t,e);if(e.method==="throw"){return c}}e.method="throw";e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var a=tryCatch(r,t.iterator,e.arg);if(a.type==="throw"){e.method="throw";e.arg=a.arg;e.delegate=null;return c}var n=a.arg;if(!n){e.method="throw";e.arg=new TypeError("iterator result is not an object");e.delegate=null;return c}if(n.done){e[t.resultName]=n.value;e.next=t.nextLoc;if(e.method!=="return"){e.method="next";e.arg=i}}else{return n}e.delegate=null;return c}defineIteratorMethods(m);m[o]="Generator";m[n]=function(){return this};m.toString=function(){return"[object Generator]"};function pushTryEntry(t){var e={tryLoc:t[0]};if(1 in t){e.catchLoc=t[1]}if(2 in t){e.finallyLoc=t[2];e.afterLoc=t[3]}this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal";delete e.arg;t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}];t.forEach(pushTryEntry,this);this.reset(true)}t.keys=function(t){var e=[];for(var r in t){e.push(r)}e.reverse();return function next(){while(e.length){var r=e.pop();if(r in t){next.value=r;next.done=false;return next}}next.done=true;return next}};function values(t){if(t){var e=t[n];if(e){return e.call(t)}if(typeof t.next==="function"){return t}if(!isNaN(t.length)){var a=-1,s=function next(){while(++a<t.length){if(r.call(t,a)){next.value=t[a];next.done=false;return next}}next.value=i;next.done=true;return next};return s.next=s}}return{next:doneResult}}t.values=values;function doneResult(){return{value:i,done:true}}Context.prototype={constructor:Context,reset:function(t){this.prev=0;this.next=0;this.sent=this._sent=i;this.done=false;this.delegate=null;this.method="next";this.arg=i;this.tryEntries.forEach(resetTryEntry);if(!t){for(var e in this){if(e.charAt(0)==="t"&&r.call(this,e)&&!isNaN(+e.slice(1))){this[e]=i}}}},stop:function(){this.done=true;var t=this.tryEntries[0];var e=t.completion;if(e.type==="throw"){throw e.arg}return this.rval},dispatchException:function(t){if(this.done){throw t}var e=this;function handle(r,a){s.type="throw";s.arg=t;e.next=r;if(a){e.method="next";e.arg=i}return!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];var s=n.completion;if(n.tryLoc==="root"){return handle("end")}if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc");var h=r.call(n,"finallyLoc");if(o&&h){if(this.prev<n.catchLoc){return handle(n.catchLoc,true)}else if(this.prev<n.finallyLoc){return handle(n.finallyLoc)}}else if(o){if(this.prev<n.catchLoc){return handle(n.catchLoc,true)}}else if(h){if(this.prev<n.finallyLoc){return handle(n.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var n=a;break}}if(n&&(t==="break"||t==="continue")&&n.tryLoc<=e&&e<=n.finallyLoc){n=null}var s=n?n.completion:{};s.type=t;s.arg=e;if(n){this.method="next";this.next=n.finallyLoc;return c}return this.complete(s)},complete:function(t,e){if(t.type==="throw"){throw t.arg}if(t.type==="break"||t.type==="continue"){this.next=t.arg}else if(t.type==="return"){this.rval=this.arg=t.arg;this.method="return";this.next="end"}else if(t.type==="normal"&&e){this.next=e}return c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t){this.complete(r.completion,r.afterLoc);resetTryEntry(r);return c}}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if(i.type==="throw"){var a=i.arg;resetTryEntry(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){this.delegate={iterator:values(t),resultName:e,nextLoc:r};if(this.method==="next"){this.arg=i}return c}};return t}(true?t.exports:undefined);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},569:function(t,e,r){"use strict";const i=r(427);const{GifError:a}=r(736);class GifFrame extends i{constructor(...t){super(...t);if(t[0]instanceof GifFrame){const e=t[0];this.xOffset=e.xOffset;this.yOffset=e.yOffset;this.disposalMethod=e.disposalMethod;this.delayCentisecs=e.delayCentisecs;this.interlaced=e.interlaced}else{const e=t[t.length-1];let r={};if(typeof e==="object"&&!(e instanceof i)){r=e}this.xOffset=r.xOffset||0;this.yOffset=r.yOffset||0;this.disposalMethod=r.disposalMethod!==undefined?r.disposalMethod:GifFrame.DisposeToBackgroundColor;this.delayCentisecs=r.delayCentisecs||8;this.interlaced=r.interlaced||false}}getPalette(){const t=new Set;const e=this.bitmap.data;let r=0;let i=false;while(r<e.length){if(e[r+3]===0){i=true}else{const i=e.readUInt32BE(r,true)>>8&16777215;t.add(i)}r+=4}const a=new Array(t.size);const n=t.values();for(r=0;r<a.length;++r){a[r]=n.next().value}a.sort((t,e)=>t-e);let s=a.length;if(i){++s}return{colors:a,usesTransparency:i,indexCount:s}}}GifFrame.DisposeToAnything=0;GifFrame.DisposeNothing=1;GifFrame.DisposeToBackgroundColor=2;GifFrame.DisposeToPrevious=3;e.GifFrame=GifFrame},578:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.shgTable=e.mulTable=void 0;var r=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1];e.mulTable=r;var i=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];e.shgTable=i},582:function(t){(function(){var e,r,i,a,n,s,o,h=[].slice,f={}.hasOwnProperty;e=function(){var t,e,r,i,a,s;s=arguments[0],a=2<=arguments.length?h.call(arguments,1):[];if(n(Object.assign)){Object.assign.apply(null,arguments)}else{for(t=0,r=a.length;t<r;t++){i=a[t];if(i!=null){for(e in i){if(!f.call(i,e))continue;s[e]=i[e]}}}}return s};n=function(t){return!!t&&Object.prototype.toString.call(t)==="[object Function]"};s=function(t){var e;return!!t&&((e=typeof t)==="function"||e==="object")};i=function(t){if(n(Array.isArray)){return Array.isArray(t)}else{return Object.prototype.toString.call(t)==="[object Array]"}};a=function(t){var e;if(i(t)){return!t.length}else{for(e in t){if(!f.call(t,e))continue;return false}return true}};o=function(t){var e,r;return s(t)&&(r=Object.getPrototypeOf(t))&&(e=r.constructor)&&typeof e==="function"&&e instanceof e&&Function.prototype.toString.call(e)===Function.prototype.toString.call(Object)};r=function(t){if(n(t.valueOf)){return t.valueOf()}else{return t}};t.exports.assign=e;t.exports.isFunction=n;t.exports.isObject=s;t.exports.isArray=i;t.exports.isEmpty=a;t.exports.isPlainObject=o;t.exports.getValue=r}).call(this)},594:function(t){"use strict";t.exports=function paethPredictor(t,e,r){var i=t+e-r;var a=Math.abs(i-t);var n=Math.abs(i-e);var s=Math.abs(i-r);if(a<=n&&a<=s){return t}if(n<=s){return e}return r}},598:function(t,e){(function(){"use strict";e.stripBOM=function(t){if(t[0]==="\ufeff"){return t.substring(1)}else{return t}}}).call(this)},601:function(t){function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(t){return false}}t.exports=_isNativeReflectConstruct},602:function(t){(function(){var e,r=function(t,e){return function(){return t.apply(e,arguments)}},i={}.hasOwnProperty;t.exports=e=function(){function XMLStringifier(t){this.assertLegalName=r(this.assertLegalName,this);this.assertLegalChar=r(this.assertLegalChar,this);var e,a,n;t||(t={});this.options=t;if(!this.options.version){this.options.version="1.0"}a=t.stringify||{};for(e in a){if(!i.call(a,e))continue;n=a[e];this[e]=n}}XMLStringifier.prototype.name=function(t){if(this.options.noValidation){return t}return this.assertLegalName(""+t||"")};XMLStringifier.prototype.text=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(this.textEscape(""+t||""))};XMLStringifier.prototype.cdata=function(t){if(this.options.noValidation){return t}t=""+t||"";t=t.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(t)};XMLStringifier.prototype.comment=function(t){if(this.options.noValidation){return t}t=""+t||"";if(t.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+t)}return this.assertLegalChar(t)};XMLStringifier.prototype.raw=function(t){if(this.options.noValidation){return t}return""+t||""};XMLStringifier.prototype.attValue=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(this.attEscape(t=""+t||""))};XMLStringifier.prototype.insTarget=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(""+t||"")};XMLStringifier.prototype.insValue=function(t){if(this.options.noValidation){return t}t=""+t||"";if(t.match(/\?>/)){throw new Error("Invalid processing instruction value: "+t)}return this.assertLegalChar(t)};XMLStringifier.prototype.xmlVersion=function(t){if(this.options.noValidation){return t}t=""+t||"";if(!t.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+t)}return t};XMLStringifier.prototype.xmlEncoding=function(t){if(this.options.noValidation){return t}t=""+t||"";if(!t.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+t)}return this.assertLegalChar(t)};XMLStringifier.prototype.xmlStandalone=function(t){if(this.options.noValidation){return t}if(t){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(""+t||"")};XMLStringifier.prototype.dtdSysID=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(""+t||"")};XMLStringifier.prototype.dtdElementValue=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(""+t||"")};XMLStringifier.prototype.dtdAttType=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(""+t||"")};XMLStringifier.prototype.dtdAttDefault=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(""+t||"")};XMLStringifier.prototype.dtdEntityValue=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(""+t||"")};XMLStringifier.prototype.dtdNData=function(t){if(this.options.noValidation){return t}return this.assertLegalChar(""+t||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(t){var e,r;if(this.options.noValidation){return t}e="";if(this.options.version==="1.0"){e=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(r=t.match(e)){throw new Error("Invalid character in string: "+t+" at index "+r.index)}}else if(this.options.version==="1.1"){e=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(r=t.match(e)){throw new Error("Invalid character in string: "+t+" at index "+r.index)}}return t};XMLStringifier.prototype.assertLegalName=function(t){var e;if(this.options.noValidation){return t}this.assertLegalChar(t);e=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!t.match(e)){throw new Error("Invalid character in name")}return t};XMLStringifier.prototype.textEscape=function(t){var e;if(this.options.noValidation){return t}e=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return t.replace(e,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")};XMLStringifier.prototype.attEscape=function(t){var e;if(this.options.noValidation){return t}e=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return t.replace(e,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")};return XMLStringifier}()}).call(this)},605:function(t){t.exports=require("http")},606:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);function advancedRotate(t,e){t%=360;var r=t*Math.PI/180;var i=Math.cos(r);var a=Math.sin(r);var n=this.bitmap.width;var s=this.bitmap.height;if(e===true||typeof e==="string"){n=Math.ceil(Math.abs(this.bitmap.width*i)+Math.abs(this.bitmap.height*a))+1;s=Math.ceil(Math.abs(this.bitmap.width*a)+Math.abs(this.bitmap.height*i))+1;if(n%2!==0){n++}if(s%2!==0){s++}var o=this.cloneQuiet();this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){this.bitmap.data.writeUInt32BE(this._background,r)});var h=Math.max(n,s,this.bitmap.width,this.bitmap.height);this.resize(h,h,e);this.blit(o,this.bitmap.width/2-o.bitmap.width/2,this.bitmap.height/2-o.bitmap.height/2)}var f=this.bitmap.width;var l=this.bitmap.height;var u=Buffer.alloc(this.bitmap.data.length);function createTranslationFunction(t,e){return function(r,i){return{x:r+t,y:i+e}}}var c=createTranslationFunction(-(f/2),-(l/2));var d=createTranslationFunction(f/2+.5,l/2+.5);for(var p=1;p<=l;p++){for(var v=1;v<=f;v++){var m=c(v,p);var g=d(i*m.x-a*m.y,i*m.y+a*m.x);var b=f*(p-1)+v-1<<2;if(g.x>=0&&g.x<f&&g.y>=0&&g.y<l){var y=(f*(g.y|0)+g.x|0)<<2;var E=this.bitmap.data.readUInt32BE(y);u.writeUInt32BE(E,b)}else{u.writeUInt32BE(this._background,b)}}}this.bitmap.data=u;if(e===true||typeof e==="string"){var M=f/2-n/2;var w=l/2-s/2;this.crop(M,w,n,s)}}var a=function _default(){return{rotate:function rotate(t,e,r){if(typeof e==="undefined"||e===null){e=true}if(typeof e==="function"&&typeof r==="undefined"){r=e;e=true}if(typeof t!=="number"){return i.throwError.call(this,"deg must be a number",r)}if(typeof e!=="boolean"&&typeof e!=="string"){return i.throwError.call(this,"mode must be a boolean or a string",r)}advancedRotate.call(this,t,e,r);if((0,i.isNodePattern)(r)){r.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},610:function(t){function DOMBufferStream(t,e,r,i,a,n){this.global=a;e=e||0;r=r||t.byteLength-e;this.arrayBuffer=t.slice(e,e+r);this.view=new a.DataView(this.arrayBuffer,0,this.arrayBuffer.byteLength);this.setBigEndian(i);this.offset=0;this.parentOffset=(n||0)+e}DOMBufferStream.prototype={setBigEndian:function(t){this.littleEndian=!t},nextUInt8:function(){var t=this.view.getUint8(this.offset);this.offset+=1;return t},nextInt8:function(){var t=this.view.getInt8(this.offset);this.offset+=1;return t},nextUInt16:function(){var t=this.view.getUint16(this.offset,this.littleEndian);this.offset+=2;return t},nextUInt32:function(){var t=this.view.getUint32(this.offset,this.littleEndian);this.offset+=4;return t},nextInt16:function(){var t=this.view.getInt16(this.offset,this.littleEndian);this.offset+=2;return t},nextInt32:function(){var t=this.view.getInt32(this.offset,this.littleEndian);this.offset+=4;return t},nextFloat:function(){var t=this.view.getFloat32(this.offset,this.littleEndian);this.offset+=4;return t},nextDouble:function(){var t=this.view.getFloat64(this.offset,this.littleEndian);this.offset+=8;return t},nextBuffer:function(t){var e=this.arrayBuffer.slice(this.offset,this.offset+t);this.offset+=t;return e},remainingLength:function(){return this.arrayBuffer.byteLength-this.offset},nextString:function(t){var e=this.arrayBuffer.slice(this.offset,this.offset+t);e=String.fromCharCode.apply(null,new this.global.Uint8Array(e));this.offset+=t;return e},mark:function(){var t=this;return{openWithOffset:function(e){e=(e||0)+this.offset;return new DOMBufferStream(t.arrayBuffer,e,t.arrayBuffer.byteLength-e,!t.littleEndian,t.global,t.parentOffset)},offset:this.offset,getParentOffset:function(){return t.parentOffset}}},offsetFrom:function(t){return this.parentOffset+this.offset-(t.offset+t.getParentOffset())},skip:function(t){this.offset+=t},branch:function(t,e){e=typeof e==="number"?e:this.arrayBuffer.byteLength-(this.offset+t);return new DOMBufferStream(this.arrayBuffer,this.offset+t,e,!this.littleEndian,this.global,this.parentOffset)}};t.exports=DOMBufferStream},612:function(t){function parseNumber(t){return parseInt(t,10)}var e=3600;var r=60;function parseDateTimeParts(t,e){t=t.map(parseNumber);e=e.map(parseNumber);var r=t[0];var i=t[1]-1;var a=t[2];var n=e[0];var s=e[1];var o=e[2];var h=Date.UTC(r,i,a,n,s,o,0);var f=h/1e3;return f}function parseDateWithTimezoneFormat(t){var i=t.substr(0,10).split("-");var a=t.substr(11,8).split(":");var n=t.substr(19,6);var s=n.split(":").map(parseNumber);var o=s[0]*e+s[1]*r;var h=parseDateTimeParts(i,a);h-=o;if(typeof h==="number"&&!isNaN(h)){return h}}function parseDateWithSpecFormat(t){var e=t.split(" "),r=e[0].split(":"),i=e[1].split(":");var a=parseDateTimeParts(r,i);if(typeof a==="number"&&!isNaN(a)){return a}}function parseExifDate(t){var e=t.length===19&&t.charAt(4)===":";var r=t.length===25&&t.charAt(10)==="T";var i;if(r){return parseDateWithTimezoneFormat(t)}else if(e){return parseDateWithSpecFormat(t)}}t.exports={parseDateWithSpecFormat:parseDateWithSpecFormat,parseDateWithTimezoneFormat:parseDateWithTimezoneFormat,parseExifDate:parseExifDate}},613:function(t){"use strict";function makeTable(){var t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++){t=t&1?3988292384^t>>>1:t>>>1}e[r]=t}return e}var e=makeTable();function crc32(t,r,i,a){var n=e,s=a+i;t^=-1;for(var o=a;o<s;o++){t=t>>>8^n[(t^r[o])&255]}return t^-1}t.exports=crc32},614:function(t){t.exports=require("events")},621:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.measureText=measureText;e.measureTextHeight=measureTextHeight;function measureText(t,e){var r=0;for(var i=0;i<e.length;i++){if(t.chars[e[i]]){var a=t.kernings[e[i]]&&t.kernings[e[i]][e[i+1]]?t.kernings[e[i]][e[i+1]]:0;r+=(t.chars[e[i]].xadvance||0)+a}}return r}function measureTextHeight(t,e,r){var i=e.split(" ");var a="";var n=t.common.lineHeight;for(var s=0;s<i.length;s++){var o=a+i[s]+" ";var h=measureText(t,o);if(h>r&&s>0){n+=t.common.lineHeight;a=i[s]+" "}else{a=o}}return n}},622:function(t){t.exports=require("path")},626:function(t,e,r){var i=r(622);var a=r(747);var n=parseInt("0777",8);t.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(t,e,r,s){if(typeof e==="function"){r=e;e={}}else if(!e||typeof e!=="object"){e={mode:e}}var o=e.mode;var h=e.fs||a;if(o===undefined){o=n}if(!s)s=null;var f=r||function(){};t=i.resolve(t);h.mkdir(t,o,function(r){if(!r){s=s||t;return f(null,s)}switch(r.code){case"ENOENT":if(i.dirname(t)===t)return f(r);mkdirP(i.dirname(t),e,function(r,i){if(r)f(r,i);else mkdirP(t,e,f,i)});break;default:h.stat(t,function(t,e){if(t||!e.isDirectory())f(r,s);else f(null,s)});break}})}mkdirP.sync=function sync(t,e,r){if(!e||typeof e!=="object"){e={mode:e}}var s=e.mode;var o=e.fs||a;if(s===undefined){s=n}if(!r)r=null;t=i.resolve(t);try{o.mkdirSync(t,s);r=r||t}catch(a){switch(a.code){case"ENOENT":r=sync(i.dirname(t),e,r);sync(t,e,r);break;default:var h;try{h=o.statSync(t)}catch(t){throw a}if(!h.isDirectory())throw a;break}}return r}},627:function(t,e,r){var i=r(213),a=r(323);t.exports={encode:i,decode:a}},631:function(t){"use strict";const e=t=>[...t].map(t=>t.charCodeAt(0));const r=e("META-INF/mozilla.rsa");const i=e("[Content_Types].xml");const a=e("_rels/.rels");t.exports=(t=>{const n=t instanceof Uint8Array?t:new Uint8Array(t);if(!(n&&n.length>1)){return null}const s=(t,e)=>{e=Object.assign({offset:0},e);for(let r=0;r<t.length;r++){if(e.mask){if(t[r]!==(e.mask[r]&n[r+e.offset])){return false}}else if(t[r]!==n[r+e.offset]){return false}}return true};const o=(t,r)=>s(e(t),r);if(s([255,216,255])){return{ext:"jpg",mime:"image/jpeg"}}if(s([137,80,78,71,13,10,26,10])){return{ext:"png",mime:"image/png"}}if(s([71,73,70])){return{ext:"gif",mime:"image/gif"}}if(s([87,69,66,80],{offset:8})){return{ext:"webp",mime:"image/webp"}}if(s([70,76,73,70])){return{ext:"flif",mime:"image/flif"}}if((s([73,73,42,0])||s([77,77,0,42]))&&s([67,82],{offset:8})){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(s([73,73,42,0])||s([77,77,0,42])){return{ext:"tif",mime:"image/tiff"}}if(s([66,77])){return{ext:"bmp",mime:"image/bmp"}}if(s([73,73,188])){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(s([56,66,80,83])){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(s([80,75,3,4])){if(s([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30})){return{ext:"epub",mime:"application/epub+zip"}}if(s(r,{offset:30})){return{ext:"xpi",mime:"application/x-xpinstall"}}if(o("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30})){return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"}}if(o("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30})){return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"}}if(o("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30})){return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}const t=(t,e=0)=>t.findIndex((t,r,i)=>r>=e&&i[r]===80&&i[r+1]===75&&i[r+2]===3&&i[r+3]===4);let e=0;let h=false;let f=null;do{const r=e+30;if(!h){h=s(i,{offset:r})||s(a,{offset:r})}if(!f){if(o("word/",{offset:r})){f={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}}else if(o("ppt/",{offset:r})){f={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}}else if(o("xl/",{offset:r})){f={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}if(h&&f){return f}e=t(n,r)}while(e>=0);if(f){return f}}if(s([80,75])&&(n[2]===3||n[2]===5||n[2]===7)&&(n[3]===4||n[3]===6||n[3]===8)){return{ext:"zip",mime:"application/zip"}}if(s([117,115,116,97,114],{offset:257})){return{ext:"tar",mime:"application/x-tar"}}if(s([82,97,114,33,26,7])&&(n[6]===0||n[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(s([31,139,8])){return{ext:"gz",mime:"application/gzip"}}if(s([66,90,104])){return{ext:"bz2",mime:"application/x-bzip2"}}if(s([55,122,188,175,39,28])){return{ext:"7z",mime:"application/x-7z-compressed"}}if(s([120,1])){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(s([51,103,112,53])||s([0,0,0])&&s([102,116,121,112],{offset:4})&&(s([109,112,52,49],{offset:8})||s([109,112,52,50],{offset:8})||s([105,115,111,109],{offset:8})||s([105,115,111,50],{offset:8})||s([109,109,112,52],{offset:8})||s([77,52,86],{offset:8})||s([100,97,115,104],{offset:8}))){return{ext:"mp4",mime:"video/mp4"}}if(s([77,84,104,100])){return{ext:"mid",mime:"audio/midi"}}if(s([26,69,223,163])){const t=n.subarray(4,4+4096);const e=t.findIndex((t,e,r)=>r[e]===66&&r[e+1]===130);if(e!==-1){const r=e+3;const i=e=>[...e].every((e,i)=>t[r+i]===e.charCodeAt(0));if(i("matroska")){return{ext:"mkv",mime:"video/x-matroska"}}if(i("webm")){return{ext:"webm",mime:"video/webm"}}}}if(s([0,0,0,20,102,116,121,112,113,116,32,32])||s([102,114,101,101],{offset:4})||s([102,116,121,112,113,116,32,32],{offset:4})||s([109,100,97,116],{offset:4})||s([119,105,100,101],{offset:4})){return{ext:"mov",mime:"video/quicktime"}}if(s([82,73,70,70])){if(s([65,86,73],{offset:8})){return{ext:"avi",mime:"video/vnd.avi"}}if(s([87,65,86,69],{offset:8})){return{ext:"wav",mime:"audio/vnd.wave"}}if(s([81,76,67,77],{offset:8})){return{ext:"qcp",mime:"audio/qcelp"}}}if(s([48,38,178,117,142,102,207,17,166,217])){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(s([0,0,1,186])||s([0,0,1,179])){return{ext:"mpg",mime:"video/mpeg"}}if(s([102,116,121,112,51,103],{offset:4})){return{ext:"3gp",mime:"video/3gpp"}}for(let t=0;t<2&&t<n.length-16;t++){if(s([73,68,51],{offset:t})||s([255,226],{offset:t,mask:[255,226]})){return{ext:"mp3",mime:"audio/mpeg"}}if(s([255,228],{offset:t,mask:[255,228]})){return{ext:"mp2",mime:"audio/mpeg"}}if(s([255,248],{offset:t,mask:[255,252]})){return{ext:"mp2",mime:"audio/mpeg"}}if(s([255,240],{offset:t,mask:[255,252]})){return{ext:"mp4",mime:"audio/mpeg"}}}if(s([102,116,121,112,77,52,65],{offset:4})||s([77,52,65,32])){return{ext:"m4a",mime:"audio/mp4"}}if(s([79,112,117,115,72,101,97,100],{offset:28})){return{ext:"opus",mime:"audio/opus"}}if(s([79,103,103,83])){if(s([128,116,104,101,111,114,97],{offset:28})){return{ext:"ogv",mime:"video/ogg"}}if(s([1,118,105,100,101,111,0],{offset:28})){return{ext:"ogm",mime:"video/ogg"}}if(s([127,70,76,65,67],{offset:28})){return{ext:"oga",mime:"audio/ogg"}}if(s([83,112,101,101,120,32,32],{offset:28})){return{ext:"spx",mime:"audio/ogg"}}if(s([1,118,111,114,98,105,115],{offset:28})){return{ext:"ogg",mime:"audio/ogg"}}return{ext:"ogx",mime:"application/ogg"}}if(s([102,76,97,67])){return{ext:"flac",mime:"audio/x-flac"}}if(s([77,65,67,32])){return{ext:"ape",mime:"audio/ape"}}if(s([119,118,112,107])){return{ext:"wv",mime:"audio/wavpack"}}if(s([35,33,65,77,82,10])){return{ext:"amr",mime:"audio/amr"}}if(s([37,80,68,70])){return{ext:"pdf",mime:"application/pdf"}}if(s([77,90])){return{ext:"exe",mime:"application/x-msdownload"}}if((n[0]===67||n[0]===70)&&s([87,83],{offset:1})){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(s([123,92,114,116,102])){return{ext:"rtf",mime:"application/rtf"}}if(s([0,97,115,109])){return{ext:"wasm",mime:"application/wasm"}}if(s([119,79,70,70])&&(s([0,1,0,0],{offset:4})||s([79,84,84,79],{offset:4}))){return{ext:"woff",mime:"font/woff"}}if(s([119,79,70,50])&&(s([0,1,0,0],{offset:4})||s([79,84,84,79],{offset:4}))){return{ext:"woff2",mime:"font/woff2"}}if(s([76,80],{offset:34})&&(s([0,0,1],{offset:8})||s([1,0,2],{offset:8})||s([2,0,2],{offset:8}))){return{ext:"eot",mime:"application/vnd.ms-fontobject"}}if(s([0,1,0,0,0])){return{ext:"ttf",mime:"font/ttf"}}if(s([79,84,84,79,0])){return{ext:"otf",mime:"font/otf"}}if(s([0,0,1,0])){return{ext:"ico",mime:"image/x-icon"}}if(s([0,0,2,0])){return{ext:"cur",mime:"image/x-icon"}}if(s([70,76,86,1])){return{ext:"flv",mime:"video/x-flv"}}if(s([37,33])){return{ext:"ps",mime:"application/postscript"}}if(s([253,55,122,88,90,0])){return{ext:"xz",mime:"application/x-xz"}}if(s([83,81,76,105])){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(s([78,69,83,26])){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(s([67,114,50,52])){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(s([77,83,67,70])||s([73,83,99,40])){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(s([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])){return{ext:"deb",mime:"application/x-deb"}}if(s([33,60,97,114,99,104,62])){return{ext:"ar",mime:"application/x-unix-archive"}}if(s([237,171,238,219])){return{ext:"rpm",mime:"application/x-rpm"}}if(s([31,160])||s([31,157])){return{ext:"Z",mime:"application/x-compress"}}if(s([76,90,73,80])){return{ext:"lz",mime:"application/x-lzip"}}if(s([208,207,17,224,161,177,26,225])){return{ext:"msi",mime:"application/x-msi"}}if(s([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){return{ext:"mxf",mime:"application/mxf"}}if(s([71],{offset:4})&&(s([71],{offset:192})||s([71],{offset:196}))){return{ext:"mts",mime:"video/mp2t"}}if(s([66,76,69,78,68,69,82])){return{ext:"blend",mime:"application/x-blender"}}if(s([66,80,71,251])){return{ext:"bpg",mime:"image/bpg"}}if(s([0,0,0,12,106,80,32,32,13,10,135,10])){if(s([106,112,50,32],{offset:20})){return{ext:"jp2",mime:"image/jp2"}}if(s([106,112,120,32],{offset:20})){return{ext:"jpx",mime:"image/jpx"}}if(s([106,112,109,32],{offset:20})){return{ext:"jpm",mime:"image/jpm"}}if(s([109,106,112,50],{offset:20})){return{ext:"mj2",mime:"image/mj2"}}}if(s([70,79,82,77,0])){return{ext:"aif",mime:"audio/aiff"}}if(o("<?xml ")){return{ext:"xml",mime:"application/xml"}}if(s([66,79,79,75,77,79,66,73],{offset:60})){return{ext:"mobi",mime:"application/x-mobipocket-ebook"}}if(s([102,116,121,112],{offset:4})){if(s([109,105,102,49],{offset:8})){return{ext:"heic",mime:"image/heif"}}if(s([109,115,102,49],{offset:8})){return{ext:"heic",mime:"image/heif-sequence"}}if(s([104,101,105,99],{offset:8})||s([104,101,105,120],{offset:8})){return{ext:"heic",mime:"image/heic"}}if(s([104,101,118,99],{offset:8})||s([104,101,118,120],{offset:8})){return{ext:"heic",mime:"image/heic-sequence"}}}if(s([171,75,84,88,32,49,49,187,13,10,26,10])){return{ext:"ktx",mime:"image/ktx"}}return null})},632:function(t,e,r){var i=r(747);var a=r(835);var n=r(622);var s=r(500);var o=r(745);var h=r(874);var f=r(235);var l=r(170);var u=function(){};var c=r(799);function parseFont(t,e,r){var i,a;if(c(e)){if(typeof e==="string")e=new JIMPBUffer(e,"binary");a=true}else e=e.toString().trim();try{if(a)i=f(e);else if(/json/.test(l.lookup(t))||e.charAt(0)==="{")i=JSON.parse(e);else if(/xml/.test(l.lookup(t))||e.charAt(0)==="<")i=h(e);else i=o(e)}catch(t){r(t);r=u}r(null,i)}t.exports=function loadFont(t,e){e=typeof e==="function"?e:u;if(typeof t==="string")t={uri:t,url:t};else if(!t)t={};var r=t.uri||t.url;function handleData(t,i){if(t)return e(t);parseFont(r,i.body||i,e)}if(a.parse(r).host){s(t,handleData)}else{i.readFile(r,t,handleData)}}},637:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=r(19);var n=i(r(288));var s=i(r(421));var o=function _default(){return{constants:{RESIZE_NEAREST_NEIGHBOR:"nearestNeighbor",RESIZE_BILINEAR:"bilinearInterpolation",RESIZE_BICUBIC:"bicubicInterpolation",RESIZE_HERMITE:"hermiteInterpolation",RESIZE_BEZIER:"bezierInterpolation"},class:{resize:function resize(t,e,r,i){if(typeof t!=="number"||typeof e!=="number"){return a.throwError.call(this,"w and h must be numbers",i)}if(typeof r==="function"&&typeof i==="undefined"){i=r;r=null}if(t===this.constructor.AUTO&&e===this.constructor.AUTO){return a.throwError.call(this,"w and h cannot both be set to auto",i)}if(t===this.constructor.AUTO){t=this.bitmap.width*(e/this.bitmap.height)}if(e===this.constructor.AUTO){e=this.bitmap.height*(t/this.bitmap.width)}if(t<0||e<0){return a.throwError.call(this,"w and h must be positive numbers",i)}t=Math.round(t);e=Math.round(e);if(typeof s["default"][r]==="function"){var o={data:Buffer.alloc(t*e*4),width:t,height:e};s["default"][r](this.bitmap,o);this.bitmap=o}else{var h=this;var resize=new n["default"](this.bitmap.width,this.bitmap.height,t,e,true,true,function(r){h.bitmap.data=Buffer.from(r);h.bitmap.width=t;h.bitmap.height=e});resize.resize(this.bitmap.data)}if((0,a.isNodePattern)(i)){i.call(this,null,this)}return this}}}};e["default"]=o;t.exports=e.default},639:function(t,e,r){(function(){var e,i,a=function(t,e){for(var r in e){if(n.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},n={}.hasOwnProperty;i=r(733);t.exports=e=function(t){a(XMLCharacterData,t);function XMLCharacterData(t){XMLCharacterData.__super__.constructor.call(this,t);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(t,e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(t){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)){return false}if(t.data!==this.data){return false}return true};return XMLCharacterData}(i)}).call(this)},645:function(t,e,r){(function(t){t.parser=function(t,e){return new SAXParser(t,e)};t.SAXParser=SAXParser;t.SAXStream=SAXStream;t.createStream=createStream;t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function SAXParser(e,r){if(!(this instanceof SAXParser)){return new SAXParser(e,r)}var i=this;clearBuffers(i);i.q=i.c="";i.bufferCheckPosition=t.MAX_BUFFER_LENGTH;i.opt=r||{};i.opt.lowercase=i.opt.lowercase||i.opt.lowercasetags;i.looseCase=i.opt.lowercase?"toLowerCase":"toUpperCase";i.tags=[];i.closed=i.closedRoot=i.sawRoot=false;i.tag=i.error=null;i.strict=!!e;i.noscript=!!(e||i.opt.noscript);i.state=p.BEGIN;i.strictEntities=i.opt.strictEntities;i.ENTITIES=i.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES);i.attribList=[];if(i.opt.xmlns){i.ns=Object.create(f)}i.trackPosition=i.opt.position!==false;if(i.trackPosition){i.position=i.line=i.column=0}emit(i,"onready")}if(!Object.create){Object.create=function(t){function F(){}F.prototype=t;var e=new F;return e}}if(!Object.keys){Object.keys=function(t){var e=[];for(var r in t)if(t.hasOwnProperty(r))e.push(r);return e}}function checkBufferLength(r){var i=Math.max(t.MAX_BUFFER_LENGTH,10);var a=0;for(var n=0,s=e.length;n<s;n++){var o=r[e[n]].length;if(o>i){switch(e[n]){case"textNode":closeText(r);break;case"cdata":emitNode(r,"oncdata",r.cdata);r.cdata="";break;case"script":emitNode(r,"onscript",r.script);r.script="";break;default:error(r,"Max buffer length exceeded: "+e[n])}}a=Math.max(a,o)}var h=t.MAX_BUFFER_LENGTH-a;r.bufferCheckPosition=h+r.position}function clearBuffers(t){for(var r=0,i=e.length;r<i;r++){t[e[r]]=""}}function flushBuffers(t){closeText(t);if(t.cdata!==""){emitNode(t,"oncdata",t.cdata);t.cdata=""}if(t.script!==""){emitNode(t,"onscript",t.script);t.script=""}}SAXParser.prototype={end:function(){end(this)},write:write,resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){flushBuffers(this)}};var i;try{i=r(413).Stream}catch(t){i=function(){}}var a=t.EVENTS.filter(function(t){return t!=="error"&&t!=="end"});function createStream(t,e){return new SAXStream(t,e)}function SAXStream(t,e){if(!(this instanceof SAXStream)){return new SAXStream(t,e)}i.apply(this);this._parser=new SAXParser(t,e);this.writable=true;this.readable=true;var r=this;this._parser.onend=function(){r.emit("end")};this._parser.onerror=function(t){r.emit("error",t);r._parser.error=null};this._decoder=null;a.forEach(function(t){Object.defineProperty(r,"on"+t,{get:function(){return r._parser["on"+t]},set:function(e){if(!e){r.removeAllListeners(t);r._parser["on"+t]=e;return e}r.on(t,e)},enumerable:true,configurable:false})})}SAXStream.prototype=Object.create(i.prototype,{constructor:{value:SAXStream}});SAXStream.prototype.write=function(t){if(typeof Buffer==="function"&&typeof Buffer.isBuffer==="function"&&Buffer.isBuffer(t)){if(!this._decoder){var e=r(304).StringDecoder;this._decoder=new e("utf8")}t=this._decoder.write(t)}this._parser.write(t.toString());this.emit("data",t);return true};SAXStream.prototype.end=function(t){if(t&&t.length){this.write(t)}this._parser.end();return true};SAXStream.prototype.on=function(t,e){var r=this;if(!r._parser["on"+t]&&a.indexOf(t)!==-1){r._parser["on"+t]=function(){var e=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t);r.emit.apply(r,e)}}return i.prototype.on.call(r,t,e)};var n="[CDATA[";var s="DOCTYPE";var o="http://www.w3.org/XML/1998/namespace";var h="http://www.w3.org/2000/xmlns/";var f={xml:o,xmlns:h};var l=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var u=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;var c=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function isWhitespace(t){return t===" "||t==="\n"||t==="\r"||t==="\t"}function isQuote(t){return t==='"'||t==="'"}function isAttribEnd(t){return t===">"||isWhitespace(t)}function isMatch(t,e){return t.test(e)}function notMatch(t,e){return!isMatch(t,e)}var p=0;t.STATE={BEGIN:p++,BEGIN_WHITESPACE:p++,TEXT:p++,TEXT_ENTITY:p++,OPEN_WAKA:p++,SGML_DECL:p++,SGML_DECL_QUOTED:p++,DOCTYPE:p++,DOCTYPE_QUOTED:p++,DOCTYPE_DTD:p++,DOCTYPE_DTD_QUOTED:p++,COMMENT_STARTING:p++,COMMENT:p++,COMMENT_ENDING:p++,COMMENT_ENDED:p++,CDATA:p++,CDATA_ENDING:p++,CDATA_ENDING_2:p++,PROC_INST:p++,PROC_INST_BODY:p++,PROC_INST_ENDING:p++,OPEN_TAG:p++,OPEN_TAG_SLASH:p++,ATTRIB:p++,ATTRIB_NAME:p++,ATTRIB_NAME_SAW_WHITE:p++,ATTRIB_VALUE:p++,ATTRIB_VALUE_QUOTED:p++,ATTRIB_VALUE_CLOSED:p++,ATTRIB_VALUE_UNQUOTED:p++,ATTRIB_VALUE_ENTITY_Q:p++,ATTRIB_VALUE_ENTITY_U:p++,CLOSE_TAG:p++,CLOSE_TAG_SAW_WHITE:p++,SCRIPT:p++,SCRIPT_ENDING:p++};t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(t.ENTITIES).forEach(function(e){var r=t.ENTITIES[e];var i=typeof r==="number"?String.fromCharCode(r):r;t.ENTITIES[e]=i});for(var v in t.STATE){t.STATE[t.STATE[v]]=v}p=t.STATE;function emit(t,e,r){t[e]&&t[e](r)}function emitNode(t,e,r){if(t.textNode)closeText(t);emit(t,e,r)}function closeText(t){t.textNode=textopts(t.opt,t.textNode);if(t.textNode)emit(t,"ontext",t.textNode);t.textNode=""}function textopts(t,e){if(t.trim)e=e.trim();if(t.normalize)e=e.replace(/\s+/g," ");return e}function error(t,e){closeText(t);if(t.trackPosition){e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c}e=new Error(e);t.error=e;emit(t,"onerror",e);return t}function end(t){if(t.sawRoot&&!t.closedRoot)strictFail(t,"Unclosed root tag");if(t.state!==p.BEGIN&&t.state!==p.BEGIN_WHITESPACE&&t.state!==p.TEXT){error(t,"Unexpected end")}closeText(t);t.c="";t.closed=true;emit(t,"onend");SAXParser.call(t,t.strict,t.opt);return t}function strictFail(t,e){if(typeof t!=="object"||!(t instanceof SAXParser)){throw new Error("bad call to strictFail")}if(t.strict){error(t,e)}}function newTag(t){if(!t.strict)t.tagName=t.tagName[t.looseCase]();var e=t.tags[t.tags.length-1]||t;var r=t.tag={name:t.tagName,attributes:{}};if(t.opt.xmlns){r.ns=e.ns}t.attribList.length=0;emitNode(t,"onopentagstart",r)}function qname(t,e){var r=t.indexOf(":");var i=r<0?["",t]:t.split(":");var a=i[0];var n=i[1];if(e&&t==="xmlns"){a="xmlns";n=""}return{prefix:a,local:n}}function attrib(t){if(!t.strict){t.attribName=t.attribName[t.looseCase]()}if(t.attribList.indexOf(t.attribName)!==-1||t.tag.attributes.hasOwnProperty(t.attribName)){t.attribName=t.attribValue="";return}if(t.opt.xmlns){var e=qname(t.attribName,true);var r=e.prefix;var i=e.local;if(r==="xmlns"){if(i==="xml"&&t.attribValue!==o){strictFail(t,"xml: prefix must be bound to "+o+"\n"+"Actual: "+t.attribValue)}else if(i==="xmlns"&&t.attribValue!==h){strictFail(t,"xmlns: prefix must be bound to "+h+"\n"+"Actual: "+t.attribValue)}else{var a=t.tag;var n=t.tags[t.tags.length-1]||t;if(a.ns===n.ns){a.ns=Object.create(n.ns)}a.ns[i]=t.attribValue}}t.attribList.push([t.attribName,t.attribValue])}else{t.tag.attributes[t.attribName]=t.attribValue;emitNode(t,"onattribute",{name:t.attribName,value:t.attribValue})}t.attribName=t.attribValue=""}function openTag(t,e){if(t.opt.xmlns){var r=t.tag;var i=qname(t.tagName);r.prefix=i.prefix;r.local=i.local;r.uri=r.ns[i.prefix]||"";if(r.prefix&&!r.uri){strictFail(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName));r.uri=i.prefix}var a=t.tags[t.tags.length-1]||t;if(r.ns&&a.ns!==r.ns){Object.keys(r.ns).forEach(function(e){emitNode(t,"onopennamespace",{prefix:e,uri:r.ns[e]})})}for(var n=0,s=t.attribList.length;n<s;n++){var o=t.attribList[n];var h=o[0];var f=o[1];var l=qname(h,true);var u=l.prefix;var c=l.local;var d=u===""?"":r.ns[u]||"";var v={name:h,value:f,prefix:u,local:c,uri:d};if(u&&u!=="xmlns"&&!d){strictFail(t,"Unbound namespace prefix: "+JSON.stringify(u));v.uri=u}t.tag.attributes[h]=v;emitNode(t,"onattribute",v)}t.attribList.length=0}t.tag.isSelfClosing=!!e;t.sawRoot=true;t.tags.push(t.tag);emitNode(t,"onopentag",t.tag);if(!e){if(!t.noscript&&t.tagName.toLowerCase()==="script"){t.state=p.SCRIPT}else{t.state=p.TEXT}t.tag=null;t.tagName=""}t.attribName=t.attribValue="";t.attribList.length=0}function closeTag(t){if(!t.tagName){strictFail(t,"Weird empty close tag.");t.textNode+="</>";t.state=p.TEXT;return}if(t.script){if(t.tagName!=="script"){t.script+="</"+t.tagName+">";t.tagName="";t.state=p.SCRIPT;return}emitNode(t,"onscript",t.script);t.script=""}var e=t.tags.length;var r=t.tagName;if(!t.strict){r=r[t.looseCase]()}var i=r;while(e--){var a=t.tags[e];if(a.name!==i){strictFail(t,"Unexpected close tag")}else{break}}if(e<0){strictFail(t,"Unmatched closing tag: "+t.tagName);t.textNode+="</"+t.tagName+">";t.state=p.TEXT;return}t.tagName=r;var n=t.tags.length;while(n-- >e){var s=t.tag=t.tags.pop();t.tagName=t.tag.name;emitNode(t,"onclosetag",t.tagName);var o={};for(var h in s.ns){o[h]=s.ns[h]}var f=t.tags[t.tags.length-1]||t;if(t.opt.xmlns&&s.ns!==f.ns){Object.keys(s.ns).forEach(function(e){var r=s.ns[e];emitNode(t,"onclosenamespace",{prefix:e,uri:r})})}}if(e===0)t.closedRoot=true;t.tagName=t.attribValue=t.attribName="";t.attribList.length=0;t.state=p.TEXT}function parseEntity(t){var e=t.entity;var r=e.toLowerCase();var i;var a="";if(t.ENTITIES[e]){return t.ENTITIES[e]}if(t.ENTITIES[r]){return t.ENTITIES[r]}e=r;if(e.charAt(0)==="#"){if(e.charAt(1)==="x"){e=e.slice(2);i=parseInt(e,16);a=i.toString(16)}else{e=e.slice(1);i=parseInt(e,10);a=i.toString(10)}}e=e.replace(/^0+/,"");if(isNaN(i)||a.toLowerCase()!==e){strictFail(t,"Invalid character entity");return"&"+t.entity+";"}return String.fromCodePoint(i)}function beginWhiteSpace(t,e){if(e==="<"){t.state=p.OPEN_WAKA;t.startTagPosition=t.position}else if(!isWhitespace(e)){strictFail(t,"Non-whitespace before first tag.");t.textNode=e;t.state=p.TEXT}}function charAt(t,e){var r="";if(e<t.length){r=t.charAt(e)}return r}function write(t){var e=this;if(this.error){throw this.error}if(e.closed){return error(e,"Cannot write after close. Assign an onready handler.")}if(t===null){return end(e)}if(typeof t==="object"){t=t.toString()}var r=0;var i="";while(true){i=charAt(t,r++);e.c=i;if(!i){break}if(e.trackPosition){e.position++;if(i==="\n"){e.line++;e.column=0}else{e.column++}}switch(e.state){case p.BEGIN:e.state=p.BEGIN_WHITESPACE;if(i==="\ufeff"){continue}beginWhiteSpace(e,i);continue;case p.BEGIN_WHITESPACE:beginWhiteSpace(e,i);continue;case p.TEXT:if(e.sawRoot&&!e.closedRoot){var a=r-1;while(i&&i!=="<"&&i!=="&"){i=charAt(t,r++);if(i&&e.trackPosition){e.position++;if(i==="\n"){e.line++;e.column=0}else{e.column++}}}e.textNode+=t.substring(a,r-1)}if(i==="<"&&!(e.sawRoot&&e.closedRoot&&!e.strict)){e.state=p.OPEN_WAKA;e.startTagPosition=e.position}else{if(!isWhitespace(i)&&(!e.sawRoot||e.closedRoot)){strictFail(e,"Text data outside of root node.")}if(i==="&"){e.state=p.TEXT_ENTITY}else{e.textNode+=i}}continue;case p.SCRIPT:if(i==="<"){e.state=p.SCRIPT_ENDING}else{e.script+=i}continue;case p.SCRIPT_ENDING:if(i==="/"){e.state=p.CLOSE_TAG}else{e.script+="<"+i;e.state=p.SCRIPT}continue;case p.OPEN_WAKA:if(i==="!"){e.state=p.SGML_DECL;e.sgmlDecl=""}else if(isWhitespace(i)){}else if(isMatch(l,i)){e.state=p.OPEN_TAG;e.tagName=i}else if(i==="/"){e.state=p.CLOSE_TAG;e.tagName=""}else if(i==="?"){e.state=p.PROC_INST;e.procInstName=e.procInstBody=""}else{strictFail(e,"Unencoded <");if(e.startTagPosition+1<e.position){var o=e.position-e.startTagPosition;i=new Array(o).join(" ")+i}e.textNode+="<"+i;e.state=p.TEXT}continue;case p.SGML_DECL:if((e.sgmlDecl+i).toUpperCase()===n){emitNode(e,"onopencdata");e.state=p.CDATA;e.sgmlDecl="";e.cdata=""}else if(e.sgmlDecl+i==="--"){e.state=p.COMMENT;e.comment="";e.sgmlDecl=""}else if((e.sgmlDecl+i).toUpperCase()===s){e.state=p.DOCTYPE;if(e.doctype||e.sawRoot){strictFail(e,"Inappropriately located doctype declaration")}e.doctype="";e.sgmlDecl=""}else if(i===">"){emitNode(e,"onsgmldeclaration",e.sgmlDecl);e.sgmlDecl="";e.state=p.TEXT}else if(isQuote(i)){e.state=p.SGML_DECL_QUOTED;e.sgmlDecl+=i}else{e.sgmlDecl+=i}continue;case p.SGML_DECL_QUOTED:if(i===e.q){e.state=p.SGML_DECL;e.q=""}e.sgmlDecl+=i;continue;case p.DOCTYPE:if(i===">"){e.state=p.TEXT;emitNode(e,"ondoctype",e.doctype);e.doctype=true}else{e.doctype+=i;if(i==="["){e.state=p.DOCTYPE_DTD}else if(isQuote(i)){e.state=p.DOCTYPE_QUOTED;e.q=i}}continue;case p.DOCTYPE_QUOTED:e.doctype+=i;if(i===e.q){e.q="";e.state=p.DOCTYPE}continue;case p.DOCTYPE_DTD:e.doctype+=i;if(i==="]"){e.state=p.DOCTYPE}else if(isQuote(i)){e.state=p.DOCTYPE_DTD_QUOTED;e.q=i}continue;case p.DOCTYPE_DTD_QUOTED:e.doctype+=i;if(i===e.q){e.state=p.DOCTYPE_DTD;e.q=""}continue;case p.COMMENT:if(i==="-"){e.state=p.COMMENT_ENDING}else{e.comment+=i}continue;case p.COMMENT_ENDING:if(i==="-"){e.state=p.COMMENT_ENDED;e.comment=textopts(e.opt,e.comment);if(e.comment){emitNode(e,"oncomment",e.comment)}e.comment=""}else{e.comment+="-"+i;e.state=p.COMMENT}continue;case p.COMMENT_ENDED:if(i!==">"){strictFail(e,"Malformed comment");e.comment+="--"+i;e.state=p.COMMENT}else{e.state=p.TEXT}continue;case p.CDATA:if(i==="]"){e.state=p.CDATA_ENDING}else{e.cdata+=i}continue;case p.CDATA_ENDING:if(i==="]"){e.state=p.CDATA_ENDING_2}else{e.cdata+="]"+i;e.state=p.CDATA}continue;case p.CDATA_ENDING_2:if(i===">"){if(e.cdata){emitNode(e,"oncdata",e.cdata)}emitNode(e,"onclosecdata");e.cdata="";e.state=p.TEXT}else if(i==="]"){e.cdata+="]"}else{e.cdata+="]]"+i;e.state=p.CDATA}continue;case p.PROC_INST:if(i==="?"){e.state=p.PROC_INST_ENDING}else if(isWhitespace(i)){e.state=p.PROC_INST_BODY}else{e.procInstName+=i}continue;case p.PROC_INST_BODY:if(!e.procInstBody&&isWhitespace(i)){continue}else if(i==="?"){e.state=p.PROC_INST_ENDING}else{e.procInstBody+=i}continue;case p.PROC_INST_ENDING:if(i===">"){emitNode(e,"onprocessinginstruction",{name:e.procInstName,body:e.procInstBody});e.procInstName=e.procInstBody="";e.state=p.TEXT}else{e.procInstBody+="?"+i;e.state=p.PROC_INST_BODY}continue;case p.OPEN_TAG:if(isMatch(u,i)){e.tagName+=i}else{newTag(e);if(i===">"){openTag(e)}else if(i==="/"){e.state=p.OPEN_TAG_SLASH}else{if(!isWhitespace(i)){strictFail(e,"Invalid character in tag name")}e.state=p.ATTRIB}}continue;case p.OPEN_TAG_SLASH:if(i===">"){openTag(e,true);closeTag(e)}else{strictFail(e,"Forward-slash in opening tag not followed by >");e.state=p.ATTRIB}continue;case p.ATTRIB:if(isWhitespace(i)){continue}else if(i===">"){openTag(e)}else if(i==="/"){e.state=p.OPEN_TAG_SLASH}else if(isMatch(l,i)){e.attribName=i;e.attribValue="";e.state=p.ATTRIB_NAME}else{strictFail(e,"Invalid attribute name")}continue;case p.ATTRIB_NAME:if(i==="="){e.state=p.ATTRIB_VALUE}else if(i===">"){strictFail(e,"Attribute without value");e.attribValue=e.attribName;attrib(e);openTag(e)}else if(isWhitespace(i)){e.state=p.ATTRIB_NAME_SAW_WHITE}else if(isMatch(u,i)){e.attribName+=i}else{strictFail(e,"Invalid attribute name")}continue;case p.ATTRIB_NAME_SAW_WHITE:if(i==="="){e.state=p.ATTRIB_VALUE}else if(isWhitespace(i)){continue}else{strictFail(e,"Attribute without value");e.tag.attributes[e.attribName]="";e.attribValue="";emitNode(e,"onattribute",{name:e.attribName,value:""});e.attribName="";if(i===">"){openTag(e)}else if(isMatch(l,i)){e.attribName=i;e.state=p.ATTRIB_NAME}else{strictFail(e,"Invalid attribute name");e.state=p.ATTRIB}}continue;case p.ATTRIB_VALUE:if(isWhitespace(i)){continue}else if(isQuote(i)){e.q=i;e.state=p.ATTRIB_VALUE_QUOTED}else{strictFail(e,"Unquoted attribute value");e.state=p.ATTRIB_VALUE_UNQUOTED;e.attribValue=i}continue;case p.ATTRIB_VALUE_QUOTED:if(i!==e.q){if(i==="&"){e.state=p.ATTRIB_VALUE_ENTITY_Q}else{e.attribValue+=i}continue}attrib(e);e.q="";e.state=p.ATTRIB_VALUE_CLOSED;continue;case p.ATTRIB_VALUE_CLOSED:if(isWhitespace(i)){e.state=p.ATTRIB}else if(i===">"){openTag(e)}else if(i==="/"){e.state=p.OPEN_TAG_SLASH}else if(isMatch(l,i)){strictFail(e,"No whitespace between attributes");e.attribName=i;e.attribValue="";e.state=p.ATTRIB_NAME}else{strictFail(e,"Invalid attribute name")}continue;case p.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(i)){if(i==="&"){e.state=p.ATTRIB_VALUE_ENTITY_U}else{e.attribValue+=i}continue}attrib(e);if(i===">"){openTag(e)}else{e.state=p.ATTRIB}continue;case p.CLOSE_TAG:if(!e.tagName){if(isWhitespace(i)){continue}else if(notMatch(l,i)){if(e.script){e.script+="</"+i;e.state=p.SCRIPT}else{strictFail(e,"Invalid tagname in closing tag.")}}else{e.tagName=i}}else if(i===">"){closeTag(e)}else if(isMatch(u,i)){e.tagName+=i}else if(e.script){e.script+="</"+e.tagName;e.tagName="";e.state=p.SCRIPT}else{if(!isWhitespace(i)){strictFail(e,"Invalid tagname in closing tag")}e.state=p.CLOSE_TAG_SAW_WHITE}continue;case p.CLOSE_TAG_SAW_WHITE:if(isWhitespace(i)){continue}if(i===">"){closeTag(e)}else{strictFail(e,"Invalid characters in closing tag")}continue;case p.TEXT_ENTITY:case p.ATTRIB_VALUE_ENTITY_Q:case p.ATTRIB_VALUE_ENTITY_U:var h;var f;switch(e.state){case p.TEXT_ENTITY:h=p.TEXT;f="textNode";break;case p.ATTRIB_VALUE_ENTITY_Q:h=p.ATTRIB_VALUE_QUOTED;f="attribValue";break;case p.ATTRIB_VALUE_ENTITY_U:h=p.ATTRIB_VALUE_UNQUOTED;f="attribValue";break}if(i===";"){e[f]+=parseEntity(e);e.entity="";e.state=h}else if(isMatch(e.entity.length?d:c,i)){e.entity+=i}else{strictFail(e,"Invalid character in entity name");e[f]+="&"+e.entity+i;e.entity="";e.state=h}continue;default:throw new Error(e,"Unknown state: "+e.state)}}if(e.position>=e.bufferCheckPosition){checkBufferLength(e)}return e}if(!String.fromCodePoint){(function(){var t=String.fromCharCode;var e=Math.floor;var r=function(){var r=16384;var i=[];var a;var n;var s=-1;var o=arguments.length;if(!o){return""}var h="";while(++s<o){var f=Number(arguments[s]);if(!isFinite(f)||f<0||f>1114111||e(f)!==f){throw RangeError("Invalid code point: "+f)}if(f<=65535){i.push(f)}else{f-=65536;a=(f>>10)+55296;n=f%1024+56320;i.push(a,n)}if(s+1===o||i.length>r){h+=t.apply(null,i);i.length=0}}return h};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:r,configurable:true,writable:true})}else{String.fromCodePoint=r}})()}})(false?undefined:e)},648:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{scale:function scale(t,e,r){if(typeof t!=="number"){return i.throwError.call(this,"f must be a number",r)}if(t<0){return i.throwError.call(this,"f must be a positive number",r)}if(typeof e==="function"&&typeof r==="undefined"){r=e;e=null}var a=this.bitmap.width*t;var n=this.bitmap.height*t;this.resize(a,n,e);if((0,i.isNodePattern)(r)){r.call(this,null,this)}return this},scaleToFit:function scaleToFit(t,e,r,a){if(typeof t!=="number"||typeof e!=="number"){return i.throwError.call(this,"w and h must be numbers",a)}if(typeof r==="function"&&typeof a==="undefined"){a=r;r=null}var n=t/e>this.bitmap.width/this.bitmap.height?e/this.bitmap.height:t/this.bitmap.width;this.scale(n,r);if((0,i.isNodePattern)(a)){a.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},655:function(t){function _defineProperty(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}t.exports=_defineProperty},656:function(t,e,r){"use strict";var i=r(357).ok;var a=r(761);var n=r(669);var s=r(293).kMaxLength;function Inflate(t){if(!(this instanceof Inflate)){return new Inflate(t)}if(t&&t.chunkSize<a.Z_MIN_CHUNK){t.chunkSize=a.Z_MIN_CHUNK}a.Inflate.call(this,t);this._offset=this._offset===undefined?this._outOffset:this._offset;this._buffer=this._buffer||this._outBuffer;if(t&&t.maxLength!=null){this._maxLength=t.maxLength}}function createInflate(t){return new Inflate(t)}function _close(t,e){if(e){process.nextTick(e)}if(!t._handle){return}t._handle.close();t._handle=null}Inflate.prototype._processChunk=function(t,e,r){if(typeof r==="function"){return a.Inflate._processChunk.call(this,t,e,r)}var n=this;var o=t&&t.length;var h=this._chunkSize-this._offset;var f=this._maxLength;var l=0;var u=[];var c=0;var d;this.on("error",function(t){d=t});function handleChunk(t,e){if(n._hadError){return}var r=h-e;i(r>=0,"have should not go down");if(r>0){var a=n._buffer.slice(n._offset,n._offset+r);n._offset+=r;if(a.length>f){a=a.slice(0,f)}u.push(a);c+=a.length;f-=a.length;if(f===0){return false}}if(e===0||n._offset>=n._chunkSize){h=n._chunkSize;n._offset=0;n._buffer=Buffer.allocUnsafe(n._chunkSize)}if(e===0){l+=o-t;o=t;return true}return false}i(this._handle,"zlib binding closed");do{var p=this._handle.writeSync(e,t,l,o,this._buffer,this._offset,h);p=p||this._writeState}while(!this._hadError&&handleChunk(p[0],p[1]));if(this._hadError){throw d}if(c>=s){_close(this);throw new RangeError("Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes")}var v=Buffer.concat(u,c);_close(this);return v};n.inherits(Inflate,a.Inflate);function zlibBufferSync(t,e){if(typeof e==="string"){e=Buffer.from(e)}if(!(e instanceof Buffer)){throw new TypeError("Not a string or buffer")}var r=t._finishFlushFlag;if(r==null){r=a.Z_FINISH}return t._processChunk(e,r)}function inflateSync(t,e){return zlibBufferSync(new Inflate(e),t)}t.exports=e=inflateSync;e.Inflate=Inflate;e.createInflate=createInflate;e.inflateSync=inflateSync},657:function(t,e,r){"use strict";var i=true;var a=r(761);var n=r(656);if(!a.deflateSync){i=false}var s=r(80);var o=r(904);var h=r(932);var f=r(319);var l=r(994);t.exports=function(t,e){if(!i){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}var r;function handleError(t){r=t}var u;function handleMetaData(t){u=t}function handleTransColor(t){u.transColor=t}function handlePalette(t){u.palette=t}function handleSimpleTransparency(){u.alpha=true}var c;function handleGamma(t){c=t}var d=[];function handleInflateData(t){d.push(t)}var p=new s(t);var v=new h(e,{read:p.read.bind(p),error:handleError,metadata:handleMetaData,gamma:handleGamma,palette:handlePalette,transColor:handleTransColor,inflateData:handleInflateData,simpleTransparency:handleSimpleTransparency});v.start();p.process();if(r){throw r}var m=Buffer.concat(d);d.length=0;var g;if(u.interlace){g=a.inflateSync(m)}else{var b=(u.width*u.bpp*u.depth+7>>3)+1;var y=b*u.height;g=n(m,{chunkSize:y,maxLength:y})}m=null;if(!g||!g.length){throw new Error("bad png - invalid inflate data response")}var E=o.process(g,u);m=null;var M=f.dataToBitMap(E,u);E=null;var w=l(M,u);u.data=w;u.gamma=c||0;return u}},658:function(t){function readExifValue(t,e){switch(t){case 1:return e.nextUInt8();case 3:return e.nextUInt16();case 4:return e.nextUInt32();case 5:return[e.nextUInt32(),e.nextUInt32()];case 6:return e.nextInt8();case 8:return e.nextUInt16();case 9:return e.nextUInt32();case 10:return[e.nextInt32(),e.nextInt32()];case 11:return e.nextFloat();case 12:return e.nextDouble();default:throw new Error("Invalid format while decoding: "+t)}}function getBytesPerComponent(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}}function readExifTag(t,e){var r=e.nextUInt16(),i=e.nextUInt16(),a=getBytesPerComponent(i),n=e.nextUInt32(),s=a*n,o,h,f;if(s>4){e=t.openWithOffset(e.nextUInt32())}if(i===2){o=e.nextString(n);var l=o.indexOf("\0");if(l!==-1){o=o.substr(0,l)}}else if(i===7){o=e.nextBuffer(n)}else if(i!==0){o=[];for(f=0;f<n;++f){o.push(readExifValue(i,e))}}if(s<4){e.skip(4-s)}return[r,o,i]}function readIFDSection(t,e,r){var i=e.nextUInt16(),a,n;for(n=0;n<i;++n){a=readExifTag(t,e);r(a[0],a[1],a[2])}}function readHeader(t){var e=t.nextString(6);if(e!=="Exif\0\0"){throw new Error("Invalid EXIF header")}var r=t.mark();var i=t.nextUInt16();if(i===18761){t.setBigEndian(false)}else if(i===19789){t.setBigEndian(true)}else{throw new Error("Invalid TIFF header")}if(t.nextUInt16()!==42){throw new Error("Invalid TIFF data")}return r}t.exports={IFD0:1,IFD1:2,GPSIFD:3,SubIFD:4,InteropIFD:5,parseTags:function(t,e){var r;try{r=readHeader(t)}catch(t){return false}var i,a,n;var s=r.openWithOffset(t.nextUInt32()),o=this.IFD0;readIFDSection(r,s,function(t,r,n){switch(t){case 34853:a=r[0];break;case 34665:i=r[0];break;default:e(o,t,r,n);break}});var h=s.nextUInt32();if(h!==0){var f=r.openWithOffset(h);readIFDSection(r,f,e.bind(null,this.IFD1))}if(a){var l=r.openWithOffset(a);readIFDSection(r,l,e.bind(null,this.GPSIFD))}if(i){var u=r.openWithOffset(i),c=this.InteropIFD;readIFDSection(r,u,function(t,r,i){if(t===40965){n=r[0]}else{e(c,t,r,i)}})}if(n){var d=r.openWithOffset(n);readIFDSection(r,d,e.bind(null,this.InteropIFD))}return true}}},660:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.clone=clone;e.addLast=addLast;e.addFirst=addFirst;e.removeLast=removeLast;e.removeFirst=removeFirst;e.insert=insert;e.removeAt=removeAt;e.replaceAt=replaceAt;e.getIn=getIn;e.set=set;e.setIn=setIn;e.update=update;e.updateIn=updateIn;e.merge=merge;e.mergeDeep=mergeDeep;e.mergeIn=mergeIn;e.omit=omit;e.addDefaults=addDefaults;e["default"]=void 0;function _typeof(t){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(t){return typeof t}}else{_typeof=function _typeof(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return _typeof(t)}var r="INVALID_ARGS";function throwStr(t){throw new Error(t)}function getKeysAndSymbols(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){return e.concat(Object.getOwnPropertySymbols(t))}return e}var i={}.hasOwnProperty;function clone(t){if(Array.isArray(t))return t.slice();var e=getKeysAndSymbols(t);var r={};for(var i=0;i<e.length;i++){var a=e[i];r[a]=t[a]}return r}function doMerge(t,e,i){var a=i;if(!(a!=null)){throwStr(process.env.NODE_ENV!=="production"?"At least one object should be provided to merge()":r)}var n=false;for(var s=0;s<(arguments.length<=3?0:arguments.length-3);s++){var o=s+3<3||arguments.length<=s+3?undefined:arguments[s+3];if(o==null)continue;var h=getKeysAndSymbols(o);if(!h.length)continue;for(var f=0;f<=h.length;f++){var l=h[f];if(t&&a[l]!==undefined)continue;var u=o[l];if(e&&isObject(a[l])&&isObject(u)){u=doMerge(t,e,a[l],u)}if(u===undefined||u===a[l])continue;if(!n){n=true;a=clone(a)}a[l]=u}}return a}function isObject(t){var e=_typeof(t);return t!=null&&e==="object"}function addLast(t,e){if(Array.isArray(e))return t.concat(e);return t.concat([e])}function addFirst(t,e){if(Array.isArray(e))return e.concat(t);return[e].concat(t)}function removeLast(t){if(!t.length)return t;return t.slice(0,t.length-1)}function removeFirst(t){if(!t.length)return t;return t.slice(1)}function insert(t,e,r){return t.slice(0,e).concat(Array.isArray(r)?r:[r]).concat(t.slice(e))}function removeAt(t,e){if(e>=t.length||e<0)return t;return t.slice(0,e).concat(t.slice(e+1))}function replaceAt(t,e,r){if(t[e]===r)return t;var i=t.length;var a=Array(i);for(var n=0;n<i;n++){a[n]=t[n]}a[e]=r;return a}function getIn(t,e){if(!Array.isArray(e)){throwStr(process.env.NODE_ENV!=="production"?"A path array should be provided when calling getIn()":r)}if(t==null)return undefined;var i=t;for(var a=0;a<e.length;a++){var n=e[a];i=i!=null?i[n]:undefined;if(i===undefined)return i}return i}function set(t,e,r){var i=typeof e==="number"?[]:{};var a=t==null?i:t;if(a[e]===r)return a;var n=clone(a);n[e]=r;return n}function doSetIn(t,e,r,i){var a;var n=e[i];if(i===e.length-1){a=r}else{var s=isObject(t)&&isObject(t[n])?t[n]:typeof e[i+1]==="number"?[]:{};a=doSetIn(s,e,r,i+1)}return set(t,n,a)}function setIn(t,e,r){if(!e.length)return r;return doSetIn(t,e,r,0)}function update(t,e,r){var i=t==null?undefined:t[e];var a=r(i);return set(t,e,a)}function updateIn(t,e,r){var i=getIn(t,e);var a=r(i);return setIn(t,e,a)}function merge(t,e,r,i,a,n){for(var s=arguments.length,o=new Array(s>6?s-6:0),h=6;h<s;h++){o[h-6]=arguments[h]}return o.length?doMerge.call.apply(doMerge,[null,false,false,t,e,r,i,a,n].concat(o)):doMerge(false,false,t,e,r,i,a,n)}function mergeDeep(t,e,r,i,a,n){for(var s=arguments.length,o=new Array(s>6?s-6:0),h=6;h<s;h++){o[h-6]=arguments[h]}return o.length?doMerge.call.apply(doMerge,[null,false,true,t,e,r,i,a,n].concat(o)):doMerge(false,true,t,e,r,i,a,n)}function mergeIn(t,e,r,i,a,n,s){var o=getIn(t,e);if(o==null)o={};var h;for(var f=arguments.length,l=new Array(f>7?f-7:0),u=7;u<f;u++){l[u-7]=arguments[u]}if(l.length){h=doMerge.call.apply(doMerge,[null,false,false,o,r,i,a,n,s].concat(l))}else{h=doMerge(false,false,o,r,i,a,n,s)}return setIn(t,e,h)}function omit(t,e){var r=Array.isArray(e)?e:[e];var a=false;for(var n=0;n<r.length;n++){if(i.call(t,r[n])){a=true;break}}if(!a)return t;var s={};var o=getKeysAndSymbols(t);for(var h=0;h<o.length;h++){var f=o[h];if(r.indexOf(f)>=0)continue;s[f]=t[f]}return s}function addDefaults(t,e,r,i,a,n){for(var s=arguments.length,o=new Array(s>6?s-6:0),h=6;h<s;h++){o[h-6]=arguments[h]}return o.length?doMerge.call.apply(doMerge,[null,true,false,t,e,r,i,a,n].concat(o)):doMerge(true,false,t,e,r,i,a,n)}var a={clone:clone,addLast:addLast,addFirst:addFirst,removeLast:removeLast,removeFirst:removeFirst,insert:insert,removeAt:removeAt,replaceAt:replaceAt,getIn:getIn,set:set,setIn:setIn,update:update,updateIn:updateIn,merge:merge,mergeDeep:mergeDeep,mergeIn:mergeIn,omit:omit,addDefaults:addDefaults};var n=a;e["default"]=n},661:function(t,e,r){(function(){var e,i,a,n,s=function(t,e){for(var r in e){if(o.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},o={}.hasOwnProperty;n=r(582).isObject;a=r(733);e=r(683);t.exports=i=function(t){s(XMLDTDEntity,t);function XMLDTDEntity(t,r,i,a){XMLDTDEntity.__super__.constructor.call(this,t);if(i==null){throw new Error("Missing DTD entity name. "+this.debugInfo(i))}if(a==null){throw new Error("Missing DTD entity value. "+this.debugInfo(i))}this.pe=!!r;this.name=this.stringify.name(i);this.type=e.EntityDeclaration;if(!n(a)){this.value=this.stringify.dtdEntityValue(a);this.internal=true}else{if(!a.pubID&&!a.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(i))}if(a.pubID&&!a.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(i))}this.internal=false;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}if(a.nData!=null){this.nData=this.stringify.dtdNData(a.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(i))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(t){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(t))};return XMLDTDEntity}(a)}).call(this)},667:function(t,e,r){"use strict";var i=r(268);t.exports=function(t,e,r,a){var n=[i.COLORTYPE_COLOR_ALPHA,i.COLORTYPE_ALPHA].indexOf(a.colorType)!==-1;if(a.colorType===a.inputColorType){var s=function(){var t=new ArrayBuffer(2);new DataView(t).setInt16(0,256,true);return new Int16Array(t)[0]!==256}();if(a.bitDepth===8||a.bitDepth===16&&s){return t}}var o=a.bitDepth!==16?t:new Uint16Array(t.buffer);var h=255;var f=i.COLORTYPE_TO_BPP_MAP[a.inputColorType];if(f===4&&!a.inputHasAlpha){f=3}var l=i.COLORTYPE_TO_BPP_MAP[a.colorType];if(a.bitDepth===16){h=65535;l*=2}var u=new JIMPBUffer(e*r*l);var c=0;var d=0;var p=a.bgColor||{};if(p.red===undefined){p.red=h}if(p.green===undefined){p.green=h}if(p.blue===undefined){p.blue=h}function getRGBA(){var t;var e;var r;var s=h;switch(a.inputColorType){case i.COLORTYPE_COLOR_ALPHA:s=o[c+3];t=o[c];e=o[c+1];r=o[c+2];break;case i.COLORTYPE_COLOR:t=o[c];e=o[c+1];r=o[c+2];break;case i.COLORTYPE_ALPHA:s=o[c+1];t=o[c];e=t;r=t;break;case i.COLORTYPE_GRAYSCALE:t=o[c];e=t;r=t;break;default:throw new Error("input color type:"+a.inputColorType+" is not supported at present")}if(a.inputHasAlpha){if(!n){s/=h;t=Math.min(Math.max(Math.round((1-s)*p.red+s*t),0),h);e=Math.min(Math.max(Math.round((1-s)*p.green+s*e),0),h);r=Math.min(Math.max(Math.round((1-s)*p.blue+s*r),0),h)}}return{red:t,green:e,blue:r,alpha:s}}for(var v=0;v<r;v++){for(var m=0;m<e;m++){var g=getRGBA(o,c);switch(a.colorType){case i.COLORTYPE_COLOR_ALPHA:case i.COLORTYPE_COLOR:if(a.bitDepth===8){u[d]=g.red;u[d+1]=g.green;u[d+2]=g.blue;if(n){u[d+3]=g.alpha}}else{u.writeUInt16BE(g.red,d);u.writeUInt16BE(g.green,d+2);u.writeUInt16BE(g.blue,d+4);if(n){u.writeUInt16BE(g.alpha,d+6)}}break;case i.COLORTYPE_ALPHA:case i.COLORTYPE_GRAYSCALE:var b=(g.red+g.green+g.blue)/3;if(a.bitDepth===8){u[d]=b;if(n){u[d+1]=g.alpha}}else{u.writeUInt16BE(b,d);if(n){u.writeUInt16BE(g.alpha,d+2)}}break;default:throw new Error("unrecognised color Type "+a.colorType)}c+=f;d+=l}}return u}},668:function(t,e,r){(function(){var e,i,a,n,s,o,h,f,l=function(t,e){for(var r in e){if(u.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},u={}.hasOwnProperty;f=r(582).isPlainObject;a=r(515);i=r(524);s=r(733);e=r(683);h=r(602);o=r(750);t.exports=n=function(t){l(XMLDocument,t);function XMLDocument(t){XMLDocument.__super__.constructor.call(this,null);this.name="#document";this.type=e.Document;this.documentURI=null;this.domConfig=new i;t||(t={});if(!t.writer){t.writer=new o}this.options=t;this.stringify=new h(t)}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new a});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var t,r,i,a;a=this.children;for(r=0,i=a.length;r<i;r++){t=a[r];if(t.type===e.DocType){return t}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===e.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===e.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===e.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});XMLDocument.prototype.end=function(t){var e;e={};if(!t){t=this.options.writer}else if(f(t)){e=t;t=this.options.writer}return t.document(this,t.filterOptions(e))};XMLDocument.prototype.toString=function(t){return this.options.writer.document(this,this.options.writer.filterOptions(t))};XMLDocument.prototype.createElement=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTextNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createComment=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createCDATASection=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createProcessingInstruction=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttribute=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEntityReference=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.importNode=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createElementNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttributeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagNameNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementById=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.adoptNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.renameNode=function(t,e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByClassName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEvent=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createNodeIterator=function(t,e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTreeWalker=function(t,e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLDocument}(s)}).call(this)},669:function(t){t.exports=require("util")},683:function(t){(function(){t.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},685:function(t,e,r){"use strict";var i=r(999);var a=15;var n=852;var s=592;var o=0;var h=1;var f=2;var l=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];var u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78];var c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0];var d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function inflate_table(t,e,r,p,v,m,g,b){var y=b.bits;var E=0;var M=0;var w=0,_=0;var x=0;var I=0;var D=0;var L=0;var T=0;var P=0;var k;var O;var N;var S;var A;var B=null;var C=0;var R;var F=new i.Buf16(a+1);var X=new i.Buf16(a+1);var G=null;var U=0;var z,W,H;for(E=0;E<=a;E++){F[E]=0}for(M=0;M<p;M++){F[e[r+M]]++}x=y;for(_=a;_>=1;_--){if(F[_]!==0){break}}if(x>_){x=_}if(_===0){v[m++]=1<<24|64<<16|0;v[m++]=1<<24|64<<16|0;b.bits=1;return 0}for(w=1;w<_;w++){if(F[w]!==0){break}}if(x<w){x=w}L=1;for(E=1;E<=a;E++){L<<=1;L-=F[E];if(L<0){return-1}}if(L>0&&(t===o||_!==1)){return-1}X[1]=0;for(E=1;E<a;E++){X[E+1]=X[E]+F[E]}for(M=0;M<p;M++){if(e[r+M]!==0){g[X[e[r+M]]++]=M}}if(t===o){B=G=g;R=19}else if(t===h){B=l;C-=257;G=u;U-=257;R=256}else{B=c;G=d;R=-1}P=0;M=0;E=w;A=m;I=x;D=0;N=-1;T=1<<x;S=T-1;if(t===h&&T>n||t===f&&T>s){return 1}for(;;){z=E-D;if(g[M]<R){W=0;H=g[M]}else if(g[M]>R){W=G[U+g[M]];H=B[C+g[M]]}else{W=32+64;H=0}k=1<<E-D;O=1<<I;w=O;do{O-=k;v[A+(P>>D)+O]=z<<24|W<<16|H|0}while(O!==0);k=1<<E-1;while(P&k){k>>=1}if(k!==0){P&=k-1;P+=k}else{P=0}M++;if(--F[E]===0){if(E===_){break}E=e[r+g[M]]}if(E>x&&(P&S)!==N){if(D===0){D=x}A+=w;I=E-D;L=1<<I;while(I+D<_){L-=F[I+D];if(L<=0){break}I++;L<<=1}T+=1<<I;if(t===h&&T>n||t===f&&T>s){return 1}N=P&S;v[N]=x<<24|I<<16|A-m|0}}if(P!==0){v[A+P]=E-D<<24|64<<16|0}b.bits=x;return 0}},691:function(t){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},695:function(t){"use strict";function ImagePHash(t,e){this.size=this.size||t;this.smallerSize=this.smallerSize||e;initCoefficients(this.size)}ImagePHash.prototype.size=32;ImagePHash.prototype.smallerSize=8;ImagePHash.prototype.distance=function(t,e){var r=0;for(var i=0;i<t.length;i++){if(t[i]!==e[i]){r++}}return r/t.length};ImagePHash.prototype.getHash=function(t){t=t.clone().resize(this.size,this.size);t.grayscale();var e=[];for(var r=0;r<t.bitmap.width;r++){e[r]=[];for(var i=0;i<t.bitmap.height;i++){e[r][i]=intToRGBA(t.getPixelColor(r,i)).b}}var a=applyDCT(e,this.size);var n=0;for(var s=0;s<this.smallerSize;s++){for(var o=0;o<this.smallerSize;o++){n+=a[s][o]}}var h=n/(this.smallerSize*this.smallerSize);var f="";for(var l=0;l<this.smallerSize;l++){for(var u=0;u<this.smallerSize;u++){f+=a[l][u]>h?"1":"0"}}return f};function intToRGBA(t){var e={};e.r=Math.floor(t/Math.pow(256,3));e.g=Math.floor((t-e.r*Math.pow(256,3))/Math.pow(256,2));e.b=Math.floor((t-e.r*Math.pow(256,3)-e.g*Math.pow(256,2))/Math.pow(256,1));e.a=Math.floor((t-e.r*Math.pow(256,3)-e.g*Math.pow(256,2)-e.b*Math.pow(256,1))/Math.pow(256,0));return e}var e=[];function initCoefficients(t){for(var r=1;r<t;r++){e[r]=1}e[0]=1/Math.sqrt(2)}function applyDCT(t,r){var i=r;var a=[];for(var n=0;n<i;n++){a[n]=[];for(var s=0;s<i;s++){var o=0;for(var h=0;h<i;h++){for(var f=0;f<i;f++){o+=Math.cos((2*h+1)/(2*i)*n*Math.PI)*Math.cos((2*f+1)/(2*i)*s*Math.PI)*t[h][f]}}o*=e[n]*e[s]/4;a[n][s]=o}}return a}t.exports=ImagePHash},705:function(t,e,r){var i=r(925);function _unsupportedIterableToArray(t,e){if(!t)return;if(typeof t==="string")return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}t.exports=_unsupportedIterableToArray},708:function(t){"use strict";function Converter(t,e){if(!t||!e||!t.length||!e.length){throw new Error("Bad alphabet")}this.srcAlphabet=t;this.dstAlphabet=e}Converter.prototype.convert=function(t){var e,r,i,a={},n=this.srcAlphabet.length,s=this.dstAlphabet.length,o=t.length,h=typeof t==="string"?"":[];if(!this.isValid(t)){throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")")}if(this.srcAlphabet===this.dstAlphabet){return t}for(e=0;e<o;e++){a[e]=this.srcAlphabet.indexOf(t[e])}do{r=0;i=0;for(e=0;e<o;e++){r=r*n+a[e];if(r>=s){a[i++]=parseInt(r/s,10);r=r%s}else if(i>0){a[i++]=0}}o=i;h=this.dstAlphabet.slice(r,r+1).concat(h)}while(i!==0);return h};Converter.prototype.isValid=function(t){var e=0;for(;e<t.length;++e){if(this.srcAlphabet.indexOf(t[e])===-1){return false}}return true};t.exports=Converter},713:function(t,e,r){var i=r(221);function _inherits(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}});if(e)i(t,e)}t.exports=_inherits},714:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{invert:function invert(t){this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){this.bitmap.data[r]=255-this.bitmap.data[r];this.bitmap.data[r+1]=255-this.bitmap.data[r+1];this.bitmap.data[r+2]=255-this.bitmap.data[r+2]});if((0,i.isNodePattern)(t)){t.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},718:function(t,e,r){var i=r(75),a=r(658),n=r(501);function ExifResult(t,e,r,i,a,n,s){this.startMarker=t;this.tags=e;this.imageSize=r;this.thumbnailOffset=i;this.thumbnailLength=a;this.thumbnailType=n;this.app1Offset=s}ExifResult.prototype={hasThumbnail:function(t){if(!this.thumbnailOffset||!this.thumbnailLength){return false}if(typeof t!=="string"){return true}if(t.toLowerCase().trim()==="image/jpeg"){return this.thumbnailType===6}if(t.toLowerCase().trim()==="image/tiff"){return this.thumbnailType===1}return false},getThumbnailOffset:function(){return this.app1Offset+6+this.thumbnailOffset},getThumbnailLength:function(){return this.thumbnailLength},getThumbnailBuffer:function(){return this._getThumbnailStream().nextBuffer(this.thumbnailLength)},_getThumbnailStream:function(){return this.startMarker.openWithOffset(this.getThumbnailOffset())},getImageSize:function(){return this.imageSize},getThumbnailSize:function(){var t=this._getThumbnailStream(),e;i.parseSections(t,function(t,r){if(i.getSectionName(t).name==="SOF"){e=i.getSizeFromSOFSection(r)}});return e}};function Parser(t){this.stream=t;this.flags={readBinaryTags:false,resolveTagNames:true,simplifyValues:true,imageSize:true,hidePointers:true,returnTags:true}}Parser.prototype={enableBinaryFields:function(t){this.flags.readBinaryTags=!!t;return this},enablePointers:function(t){this.flags.hidePointers=!t;return this},enableTagNames:function(t){this.flags.resolveTagNames=!!t;return this},enableImageSize:function(t){this.flags.imageSize=!!t;return this},enableReturnTags:function(t){this.flags.returnTags=!!t;return this},enableSimpleValues:function(t){this.flags.simplifyValues=!!t;return this},parse:function(){var t=this.stream.mark(),e=t.openWithOffset(0),s=this.flags,o,h,f,l,u,c,d,p,v;if(s.resolveTagNames){d=r(93)}if(s.resolveTagNames){o={};p=function(t){return o[t.name]};v=function(t,e){o[t.name]=e}}else{o=[];p=function(t){var e;for(e=0;e<o.length;++e){if(o[e].type===t.type&&o[e].section===t.section){return o.value}}};v=function(t,e){var r;for(r=0;r<o.length;++r){if(o[r].type===t.type&&o[r].section===t.section){o.value=e;return}}}}i.parseSections(e,function(e,r){var p,v=r.offsetFrom(t);if(e===225){p=a.parseTags(r,function(t,e,r,i){if(!s.readBinaryTags&&i===7){return}if(e===513){f=r[0];if(s.hidePointers){return}}else if(e===514){l=r[0];if(s.hidePointers){return}}else if(e===259){u=r[0];if(s.hidePointers){return}}if(!s.returnTags){return}if(s.simplifyValues){r=n.simplifyValue(r,i)}if(s.resolveTagNames){var h=t===a.GPSIFD?d.gps:d.exif;var c=h[e];if(!c){c=d.exif[e]}if(!o.hasOwnProperty(c)){o[c]=r}}else{o.push({section:t,type:e,value:r})}});if(p){c=v}}else if(s.imageSize&&i.getSectionName(e).name==="SOF"){h=i.getSizeFromSOFSection(r)}});if(s.simplifyValues){n.castDegreeValues(p,v);n.castDateValues(p,v)}return new ExifResult(t,o,h,f,l,u,c)}};t.exports=Parser},724:function(t,e,r){"use strict";var i=r(764);var a=i(r(655));var n=i(r(298));function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);if(e)i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable});r.push.apply(r,i)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};if(e%2){ownKeys(r,true).forEach(function(e){(0,a["default"])(t,e,r[e])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))}else{ownKeys(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}}return t}if(process.browser||process.env.ENVIRONMENT==="BROWSER"||typeof process.versions.electron!=="undefined"&&process.type==="renderer"&&typeof XMLHttpRequest==="function"){t.exports=function(t,e){var r=new XMLHttpRequest;r.open("GET",t.url,true);r.responseType="arraybuffer";r.addEventListener("load",function(){if(r.status<400){try{var i=Buffer.from(this.response);e(null,r,i)}catch(r){return e(new Error("Response is not a buffer for url "+t.url+". Error: "+r.message))}}else{e(new Error("HTTP Status "+r.status+" for url "+t.url))}});r.addEventListener("error",function(t){e(t)});r.send()}}else{t.exports=function(t,e){var i=(0,n["default"])({},t);var a=r(500);a(_objectSpread({compression:true},i),function(t,r){if(t===null){e(null,r,r.body)}else{e(t)}})}}},733:function(t,e,r){(function(){var e,i,a,n,s,o,h,f,l,u,c,d,p,v,m,g,b,y,E,M={}.hasOwnProperty;E=r(582),y=E.isObject,b=E.isFunction,g=E.isEmpty,m=E.getValue;f=null;a=null;n=null;s=null;o=null;p=null;v=null;d=null;h=null;i=null;c=null;l=null;e=null;t.exports=u=function(){function XMLNode(t){this.parent=t;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!f){f=r(796);a=r(815);n=r(919);s=r(738);o=r(735);p=r(283);v=r(988);d=r(491);h=r(956);i=r(683);c=r(265);l=r(451);e=r(78)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new c(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var t;t=this.parent.children.indexOf(this);return this.parent.children[t-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var t;t=this.parent.children.indexOf(this);return this.parent.children[t+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var t,e,r,a,n;if(this.nodeType===i.Element||this.nodeType===i.DocumentFragment){n="";a=this.children;for(e=0,r=a.length;e<r;e++){t=a[e];if(t.textContent){n+=t.textContent}}return n}else{return null}},set:function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLNode.prototype.setParent=function(t){var e,r,i,a,n;this.parent=t;if(t){this.options=t.options;this.stringify=t.stringify}a=this.children;n=[];for(r=0,i=a.length;r<i;r++){e=a[r];n.push(e.setParent(this))}return n};XMLNode.prototype.element=function(t,e,r){var i,a,n,s,o,h,f,l,u,c,d;h=null;if(e===null&&r==null){u=[{},null],e=u[0],r=u[1]}if(e==null){e={}}e=m(e);if(!y(e)){c=[e,r],r=c[0],e=c[1]}if(t!=null){t=m(t)}if(Array.isArray(t)){for(n=0,f=t.length;n<f;n++){a=t[n];h=this.element(a)}}else if(b(t)){h=this.element(t.apply())}else if(y(t)){for(o in t){if(!M.call(t,o))continue;d=t[o];if(b(d)){d=d.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&o.indexOf(this.stringify.convertAttKey)===0){h=this.attribute(o.substr(this.stringify.convertAttKey.length),d)}else if(!this.options.separateArrayItems&&Array.isArray(d)&&g(d)){h=this.dummy()}else if(y(d)&&g(d)){h=this.element(o)}else if(!this.options.keepNullNodes&&d==null){h=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(d)){for(s=0,l=d.length;s<l;s++){a=d[s];i={};i[o]=a;h=this.element(i)}}else if(y(d)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&o.indexOf(this.stringify.convertTextKey)===0){h=this.element(d)}else{h=this.element(o);h.element(d)}}else{h=this.element(o,d)}}}else if(!this.options.keepNullNodes&&r===null){h=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&t.indexOf(this.stringify.convertTextKey)===0){h=this.text(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&t.indexOf(this.stringify.convertCDataKey)===0){h=this.cdata(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&t.indexOf(this.stringify.convertCommentKey)===0){h=this.comment(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&t.indexOf(this.stringify.convertRawKey)===0){h=this.raw(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&t.indexOf(this.stringify.convertPIKey)===0){h=this.instruction(t.substr(this.stringify.convertPIKey.length),r)}else{h=this.node(t,e,r)}}if(h==null){throw new Error("Could not create any elements with: "+t+". "+this.debugInfo())}return h};XMLNode.prototype.insertBefore=function(t,e,r){var i,a,n,s,o;if(t!=null?t.type:void 0){n=t;s=e;n.setParent(this);if(s){a=children.indexOf(s);o=children.splice(a);children.push(n);Array.prototype.push.apply(children,o)}else{children.push(n)}return n}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(t))}a=this.parent.children.indexOf(this);o=this.parent.children.splice(a);i=this.parent.element(t,e,r);Array.prototype.push.apply(this.parent.children,o);return i}};XMLNode.prototype.insertAfter=function(t,e,r){var i,a,n;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(t))}a=this.parent.children.indexOf(this);n=this.parent.children.splice(a+1);i=this.parent.element(t,e,r);Array.prototype.push.apply(this.parent.children,n);return i};XMLNode.prototype.remove=function(){var t,e;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}t=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[t,t-t+1].concat(e=[])),e;return this.parent};XMLNode.prototype.node=function(t,e,r){var i,a;if(t!=null){t=m(t)}e||(e={});e=m(e);if(!y(e)){a=[e,r],r=a[0],e=a[1]}i=new f(this,t,e);if(r!=null){i.text(r)}this.children.push(i);return i};XMLNode.prototype.text=function(t){var e;if(y(t)){this.element(t)}e=new v(this,t);this.children.push(e);return this};XMLNode.prototype.cdata=function(t){var e;e=new a(this,t);this.children.push(e);return this};XMLNode.prototype.comment=function(t){var e;e=new n(this,t);this.children.push(e);return this};XMLNode.prototype.commentBefore=function(t){var e,r,i;r=this.parent.children.indexOf(this);i=this.parent.children.splice(r);e=this.parent.comment(t);Array.prototype.push.apply(this.parent.children,i);return this};XMLNode.prototype.commentAfter=function(t){var e,r,i;r=this.parent.children.indexOf(this);i=this.parent.children.splice(r+1);e=this.parent.comment(t);Array.prototype.push.apply(this.parent.children,i);return this};XMLNode.prototype.raw=function(t){var e;e=new p(this,t);this.children.push(e);return this};XMLNode.prototype.dummy=function(){var t;t=new h(this);return t};XMLNode.prototype.instruction=function(t,e){var r,i,a,n,s;if(t!=null){t=m(t)}if(e!=null){e=m(e)}if(Array.isArray(t)){for(n=0,s=t.length;n<s;n++){r=t[n];this.instruction(r)}}else if(y(t)){for(r in t){if(!M.call(t,r))continue;i=t[r];this.instruction(r,i)}}else{if(b(e)){e=e.apply()}a=new d(this,t,e);this.children.push(a)}return this};XMLNode.prototype.instructionBefore=function(t,e){var r,i,a;i=this.parent.children.indexOf(this);a=this.parent.children.splice(i);r=this.parent.instruction(t,e);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.instructionAfter=function(t,e){var r,i,a;i=this.parent.children.indexOf(this);a=this.parent.children.splice(i+1);r=this.parent.instruction(t,e);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.declaration=function(t,e,r){var a,n;a=this.document();n=new s(a,t,e,r);if(a.children.length===0){a.children.unshift(n)}else if(a.children[0].type===i.Declaration){a.children[0]=n}else{a.children.unshift(n)}return a.root()||a};XMLNode.prototype.dtd=function(t,e){var r,a,n,s,h,f,l,u,c,d;a=this.document();n=new o(a,t,e);c=a.children;for(s=h=0,l=c.length;h<l;s=++h){r=c[s];if(r.type===i.DocType){a.children[s]=n;return n}}d=a.children;for(s=f=0,u=d.length;f<u;s=++f){r=d[s];if(r.isRoot){a.children.splice(s,0,n);return n}}a.children.push(n);return n};XMLNode.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};XMLNode.prototype.root=function(){var t;t=this;while(t){if(t.type===i.Document){return t.rootObject}else if(t.isRoot){return t}else{t=t.parent}}};XMLNode.prototype.document=function(){var t;t=this;while(t){if(t.type===i.Document){return t}else{t=t.parent}}};XMLNode.prototype.end=function(t){return this.document().end(t)};XMLNode.prototype.prev=function(){var t;t=this.parent.children.indexOf(this);if(t<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[t-1]};XMLNode.prototype.next=function(){var t;t=this.parent.children.indexOf(this);if(t===-1||t===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[t+1]};XMLNode.prototype.importDocument=function(t){var e;e=t.root().clone();e.parent=this;e.isRoot=false;this.children.push(e);return this};XMLNode.prototype.debugInfo=function(t){var e,r;t=t||this.name;if(t==null&&!((e=this.parent)!=null?e.name:void 0)){return""}else if(t==null){return"parent: <"+this.parent.name+">"}else if(!((r=this.parent)!=null?r.name:void 0)){return"node: <"+t+">"}else{return"node: <"+t+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(t,e,r){return this.element(t,e,r)};XMLNode.prototype.nod=function(t,e,r){return this.node(t,e,r)};XMLNode.prototype.txt=function(t){return this.text(t)};XMLNode.prototype.dat=function(t){return this.cdata(t)};XMLNode.prototype.com=function(t){return this.comment(t)};XMLNode.prototype.ins=function(t,e){return this.instruction(t,e)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(t,e,r){return this.declaration(t,e,r)};XMLNode.prototype.e=function(t,e,r){return this.element(t,e,r)};XMLNode.prototype.n=function(t,e,r){return this.node(t,e,r)};XMLNode.prototype.t=function(t){return this.text(t)};XMLNode.prototype.d=function(t){return this.cdata(t)};XMLNode.prototype.c=function(t){return this.comment(t)};XMLNode.prototype.r=function(t){return this.raw(t)};XMLNode.prototype.i=function(t,e){return this.instruction(t,e)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(t){return this.importDocument(t)};XMLNode.prototype.replaceChild=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(t,e){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(t){var r,i;r=this;if(r===t){return 0}else if(this.document()!==t.document()){i=e.Disconnected|e.ImplementationSpecific;if(Math.random()<.5){i|=e.Preceding}else{i|=e.Following}return i}else if(r.isAncestor(t)){return e.Contains|e.Preceding}else if(r.isDescendant(t)){return e.Contains|e.Following}else if(r.isPreceding(t)){return e.Preceding}else{return e.Following}};XMLNode.prototype.isSameNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(t){var e,r,i;if(t.nodeType!==this.nodeType){return false}if(t.children.length!==this.children.length){return false}for(e=r=0,i=this.children.length-1;0<=i?r<=i:r>=i;e=0<=i?++r:--r){if(!this.children[e].isEqualNode(t.children[e])){return false}}return true};XMLNode.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(t,e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(t){if(!t){return false}return t===this||this.isDescendant(t)};XMLNode.prototype.isDescendant=function(t){var e,r,i,a,n;n=this.children;for(i=0,a=n.length;i<a;i++){e=n[i];if(t===e){return true}r=e.isDescendant(t);if(r){return true}}return false};XMLNode.prototype.isAncestor=function(t){return t.isDescendant(this)};XMLNode.prototype.isPreceding=function(t){var e,r;e=this.treePosition(t);r=this.treePosition(this);if(e===-1||r===-1){return false}else{return e<r}};XMLNode.prototype.isFollowing=function(t){var e,r;e=this.treePosition(t);r=this.treePosition(this);if(e===-1||r===-1){return false}else{return e>r}};XMLNode.prototype.treePosition=function(t){var e,r;r=0;e=false;this.foreachTreeNode(this.document(),function(i){r++;if(!e&&i===t){return e=true}});if(e){return r}else{return-1}};XMLNode.prototype.foreachTreeNode=function(t,e){var r,i,a,n,s;t||(t=this.document());n=t.children;for(i=0,a=n.length;i<a;i++){r=n[i];if(s=e(r)){return s}else{s=this.foreachTreeNode(r,e);if(s){return s}}}};return XMLNode}()}).call(this)},735:function(t,e,r){(function(){var e,i,a,n,s,o,h,f,l,u=function(t,e){for(var r in e){if(c.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},c={}.hasOwnProperty;l=r(582).isObject;f=r(733);e=r(683);i=r(890);n=r(661);a=r(463);s=r(891);h=r(451);t.exports=o=function(t){u(XMLDocType,t);function XMLDocType(t,r,i){var a,n,s,o,h,f;XMLDocType.__super__.constructor.call(this,t);this.type=e.DocType;if(t.children){o=t.children;for(n=0,s=o.length;n<s;n++){a=o[n];if(a.type===e.Element){this.name=a.name;break}}}this.documentObject=t;if(l(r)){h=r,r=h.pubID,i=h.sysID}if(i==null){f=[r,i],i=f[0],r=f[1]}if(r!=null){this.pubID=this.stringify.dtdPubID(r)}if(i!=null){this.sysID=this.stringify.dtdSysID(i)}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var t,r,i,a,n;a={};n=this.children;for(r=0,i=n.length;r<i;r++){t=n[r];if(t.type===e.EntityDeclaration&&!t.pe){a[t.name]=t}}return new h(a)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var t,r,i,a,n;a={};n=this.children;for(r=0,i=n.length;r<i;r++){t=n[r];if(t.type===e.NotationDeclaration){a[t.name]=t}}return new h(a)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLDocType.prototype.element=function(t,e){var r;r=new a(this,t,e);this.children.push(r);return this};XMLDocType.prototype.attList=function(t,e,r,a,n){var s;s=new i(this,t,e,r,a,n);this.children.push(s);return this};XMLDocType.prototype.entity=function(t,e){var r;r=new n(this,false,t,e);this.children.push(r);return this};XMLDocType.prototype.pEntity=function(t,e){var r;r=new n(this,true,t,e);this.children.push(r);return this};XMLDocType.prototype.notation=function(t,e){var r;r=new s(this,t,e);this.children.push(r);return this};XMLDocType.prototype.toString=function(t){return this.options.writer.docType(this,this.options.writer.filterOptions(t))};XMLDocType.prototype.ele=function(t,e){return this.element(t,e)};XMLDocType.prototype.att=function(t,e,r,i,a){return this.attList(t,e,r,i,a)};XMLDocType.prototype.ent=function(t,e){return this.entity(t,e)};XMLDocType.prototype.pent=function(t,e){return this.pEntity(t,e)};XMLDocType.prototype.not=function(t,e){return this.notation(t,e)};XMLDocType.prototype.up=function(){return this.root()||this.documentObject};XMLDocType.prototype.isEqualNode=function(t){if(!XMLDocType.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)){return false}if(t.name!==this.name){return false}if(t.publicId!==this.publicId){return false}if(t.systemId!==this.systemId){return false}return true};return XMLDocType}(f)}).call(this)},736:function(t,e){"use strict";class Gif{constructor(t,e,r){this.width=r.width;this.height=r.height;this.loops=r.loops;this.usesTransparency=r.usesTransparency;this.colorScope=r.colorScope;this.frames=e;this.buffer=t}}Gif.GlobalColorsPreferred=0;Gif.GlobalColorsOnly=1;Gif.LocalColorsOnly=2;class GifError extends Error{constructor(t){super(t);if(t instanceof Error){this.stack="Gif"+t.stack}}}e.Gif=Gif;e.GifError=GifError},738:function(t,e,r){(function(){var e,i,a,n,s=function(t,e){for(var r in e){if(o.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},o={}.hasOwnProperty;n=r(582).isObject;a=r(733);e=r(683);t.exports=i=function(t){s(XMLDeclaration,t);function XMLDeclaration(t,r,i,a){var s;XMLDeclaration.__super__.constructor.call(this,t);if(n(r)){s=r,r=s.version,i=s.encoding,a=s.standalone}if(!r){r="1.0"}this.type=e.Declaration;this.version=this.stringify.xmlVersion(r);if(i!=null){this.encoding=this.stringify.xmlEncoding(i)}if(a!=null){this.standalone=this.stringify.xmlStandalone(a)}}XMLDeclaration.prototype.toString=function(t){return this.options.writer.declaration(this,this.options.writer.filterOptions(t))};return XMLDeclaration}(a)}).call(this)},745:function(t){t.exports=function parseBMFontAscii(t){if(!t)throw new Error("no data provided");t=t.toString().trim();var e={pages:[],chars:[],kernings:[]};var r=t.split(/\r\n?|\n/g);if(r.length===0)throw new Error("no data in BMFont file");for(var i=0;i<r.length;i++){var a=splitLine(r[i],i);if(!a)continue;if(a.key==="page"){if(typeof a.data.id!=="number")throw new Error("malformed file at line "+i+" -- needs page id=N");if(typeof a.data.file!=="string")throw new Error("malformed file at line "+i+' -- needs page file="path"');e.pages[a.data.id]=a.data.file}else if(a.key==="chars"||a.key==="kernings"){}else if(a.key==="char"){e.chars.push(a.data)}else if(a.key==="kerning"){e.kernings.push(a.data)}else{e[a.key]=a.data}}return e};function splitLine(t,e){t=t.replace(/\t+/g," ").trim();if(!t)return null;var r=t.indexOf(" ");if(r===-1)throw new Error("no named row at line "+e);var i=t.substring(0,r);t=t.substring(r+1);t=t.replace(/letter=[\'\"]\S+[\'\"]/gi,"");t=t.split("=");t=t.map(function(t){return t.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g)});var a=[];for(var n=0;n<t.length;n++){var s=t[n];if(n===0){a.push({key:s[0],data:""})}else if(n===t.length-1){a[a.length-1].data=parseData(s[0])}else{a[a.length-1].data=parseData(s[0]);a.push({key:s[1],data:""})}}var o={key:i,data:{}};a.forEach(function(t){o.data[t.key]=t.data});return o}function parseData(t){if(!t||t.length===0)return"";if(t.indexOf('"')===0||t.indexOf("'")===0)return t.substring(1,t.length-1);if(t.indexOf(",")!==-1)return parseIntList(t);return parseInt(t,10)}function parseIntList(t){return t.split(",").map(function(t){return parseInt(t,10)})}},747:function(t){t.exports=require("fs")},750:function(t,e,r){(function(){var e,i,a=function(t,e){for(var r in e){if(n.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},n={}.hasOwnProperty;i=r(423);t.exports=e=function(t){a(XMLStringWriter,t);function XMLStringWriter(t){XMLStringWriter.__super__.constructor.call(this,t)}XMLStringWriter.prototype.document=function(t,e){var r,i,a,n,s;e=this.filterOptions(e);n="";s=t.children;for(i=0,a=s.length;i<a;i++){r=s[i];n+=this.writeChildNode(r,e,0)}if(e.pretty&&n.slice(-e.newline.length)===e.newline){n=n.slice(0,-e.newline.length)}return n};return XMLStringWriter}(i)}).call(this)},761:function(t){t.exports=require("zlib")},764:function(t){function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}t.exports=_interopRequireDefault},768:function(t,e,r){(function(){var e,i,a,n,s,o,h,f,l,u,c,d,p,v,m,g,b,y,E,M,w,_,x,I,D={}.hasOwnProperty;I=r(582),_=I.isObject,w=I.isFunction,x=I.isPlainObject,M=I.getValue;e=r(683);d=r(668);v=r(796);n=r(815);s=r(919);g=r(283);E=r(988);m=r(491);u=r(738);c=r(735);o=r(890);f=r(661);h=r(463);l=r(891);a=r(884);y=r(602);b=r(750);i=r(541);t.exports=p=function(){function XMLDocumentCB(t,r,i){var a;this.name="?xml";this.type=e.Document;t||(t={});a={};if(!t.writer){t.writer=new b}else if(x(t.writer)){a=t.writer;t.writer=new b}this.options=t;this.writer=t.writer;this.writerOptions=this.writer.filterOptions(a);this.stringify=new y(t);this.onDataCallback=r||function(){};this.onEndCallback=i||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}XMLDocumentCB.prototype.createChildNode=function(t){var r,i,a,n,s,o,h,f;switch(t.type){case e.CData:this.cdata(t.value);break;case e.Comment:this.comment(t.value);break;case e.Element:a={};h=t.attribs;for(i in h){if(!D.call(h,i))continue;r=h[i];a[i]=r.value}this.node(t.name,a);break;case e.Dummy:this.dummy();break;case e.Raw:this.raw(t.value);break;case e.Text:this.text(t.value);break;case e.ProcessingInstruction:this.instruction(t.target,t.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+t.constructor.name)}f=t.children;for(s=0,o=f.length;s<o;s++){n=f[s];this.createChildNode(n);if(n.type===e.Element){this.up()}}return this};XMLDocumentCB.prototype.dummy=function(){return this};XMLDocumentCB.prototype.node=function(t,e,r){var i;if(t==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(t))}this.openCurrent();t=M(t);if(e==null){e={}}e=M(e);if(!_(e)){i=[e,r],r=i[0],e=i[1]}this.currentNode=new v(this,t,e);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(r!=null){this.text(r)}return this};XMLDocumentCB.prototype.element=function(t,r,i){var a,n,s,o,h,f;if(this.currentNode&&this.currentNode.type===e.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(t)||_(t)||w(t)){o=this.options.noValidation;this.options.noValidation=true;f=new d(this.options).element("TEMP_ROOT");f.element(t);this.options.noValidation=o;h=f.children;for(n=0,s=h.length;n<s;n++){a=h[n];this.createChildNode(a);if(a.type===e.Element){this.up()}}}else{this.node(t,r,i)}}return this};XMLDocumentCB.prototype.attribute=function(t,e){var r,i;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(t))}if(t!=null){t=M(t)}if(_(t)){for(r in t){if(!D.call(t,r))continue;i=t[r];this.attribute(r,i)}}else{if(w(e)){e=e.apply()}if(this.options.keepNullAttributes&&e==null){this.currentNode.attribs[t]=new a(this,t,"")}else if(e!=null){this.currentNode.attribs[t]=new a(this,t,e)}}return this};XMLDocumentCB.prototype.text=function(t){var e;this.openCurrent();e=new E(this,t);this.onData(this.writer.text(e,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.cdata=function(t){var e;this.openCurrent();e=new n(this,t);this.onData(this.writer.cdata(e,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.comment=function(t){var e;this.openCurrent();e=new s(this,t);this.onData(this.writer.comment(e,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.raw=function(t){var e;this.openCurrent();e=new g(this,t);this.onData(this.writer.raw(e,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.instruction=function(t,e){var r,i,a,n,s;this.openCurrent();if(t!=null){t=M(t)}if(e!=null){e=M(e)}if(Array.isArray(t)){for(r=0,n=t.length;r<n;r++){i=t[r];this.instruction(i)}}else if(_(t)){for(i in t){if(!D.call(t,i))continue;a=t[i];this.instruction(i,a)}}else{if(w(e)){e=e.apply()}s=new m(this,t,e);this.onData(this.writer.processingInstruction(s,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};XMLDocumentCB.prototype.declaration=function(t,e,r){var i;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}i=new u(this,t,e,r);this.onData(this.writer.declaration(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.doctype=function(t,e,r){this.openCurrent();if(t==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new c(this,e,r);this.currentNode.rootNodeName=t;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};XMLDocumentCB.prototype.dtdElement=function(t,e){var r;this.openCurrent();r=new h(this,t,e);this.onData(this.writer.dtdElement(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.attList=function(t,e,r,i,a){var n;this.openCurrent();n=new o(this,t,e,r,i,a);this.onData(this.writer.dtdAttList(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.entity=function(t,e){var r;this.openCurrent();r=new f(this,false,t,e);this.onData(this.writer.dtdEntity(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.pEntity=function(t,e){var r;this.openCurrent();r=new f(this,true,t,e);this.onData(this.writer.dtdEntity(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.notation=function(t,e){var r;this.openCurrent();r=new l(this,t,e);this.onData(this.writer.dtdNotation(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};XMLDocumentCB.prototype.end=function(){while(this.currentLevel>=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(t){var r,a,n,s;if(!t.isOpen){if(!this.root&&this.currentLevel===0&&t.type===e.Element){this.root=t}a="";if(t.type===e.Element){this.writerOptions.state=i.OpenTag;a=this.writer.indent(t,this.writerOptions,this.currentLevel)+"<"+t.name;s=t.attribs;for(n in s){if(!D.call(s,n))continue;r=s[n];a+=this.writer.attribute(r,this.writerOptions,this.currentLevel)}a+=(t.children?">":"/>")+this.writer.endline(t,this.writerOptions,this.currentLevel);this.writerOptions.state=i.InsideTag}else{this.writerOptions.state=i.OpenTag;a=this.writer.indent(t,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+t.rootNodeName;if(t.pubID&&t.sysID){a+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"'}else if(t.sysID){a+=' SYSTEM "'+t.sysID+'"'}if(t.children){a+=" [";this.writerOptions.state=i.InsideTag}else{this.writerOptions.state=i.CloseTag;a+=">"}a+=this.writer.endline(t,this.writerOptions,this.currentLevel)}this.onData(a,this.currentLevel);return t.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(t){var r;if(!t.isClosed){r="";this.writerOptions.state=i.CloseTag;if(t.type===e.Element){r=this.writer.indent(t,this.writerOptions,this.currentLevel)+"</"+t.name+">"+this.writer.endline(t,this.writerOptions,this.currentLevel)}else{r=this.writer.indent(t,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(t,this.writerOptions,this.currentLevel)}this.writerOptions.state=i.None;this.onData(r,this.currentLevel);return t.isClosed=true}};XMLDocumentCB.prototype.onData=function(t,e){this.documentStarted=true;return this.onDataCallback(t,e+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(t){if(t==null){return""}else{return"node: <"+t+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(t,e,r){return this.node(t,e,r)};XMLDocumentCB.prototype.txt=function(t){return this.text(t)};XMLDocumentCB.prototype.dat=function(t){return this.cdata(t)};XMLDocumentCB.prototype.com=function(t){return this.comment(t)};XMLDocumentCB.prototype.ins=function(t,e){return this.instruction(t,e)};XMLDocumentCB.prototype.dec=function(t,e,r){return this.declaration(t,e,r)};XMLDocumentCB.prototype.dtd=function(t,e,r){return this.doctype(t,e,r)};XMLDocumentCB.prototype.e=function(t,e,r){return this.element(t,e,r)};XMLDocumentCB.prototype.n=function(t,e,r){return this.node(t,e,r)};XMLDocumentCB.prototype.t=function(t){return this.text(t)};XMLDocumentCB.prototype.d=function(t){return this.cdata(t)};XMLDocumentCB.prototype.c=function(t){return this.comment(t)};XMLDocumentCB.prototype.r=function(t){return this.raw(t)};XMLDocumentCB.prototype.i=function(t,e){return this.instruction(t,e)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===e.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===e.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(t,e){return this.entity(t,e)};XMLDocumentCB.prototype.pent=function(t,e){return this.pEntity(t,e)};XMLDocumentCB.prototype.not=function(t,e){return this.notation(t,e)};return XMLDocumentCB}()}).call(this)},789:function(t,e,r){var i=r(544),a=r(193);t.exports={encode:i,decode:a}},791:function(t,e){(function(){e.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},796:function(t,e,r){(function(){var e,i,a,n,s,o,h,f,l,u=function(t,e){for(var r in e){if(c.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},c={}.hasOwnProperty;l=r(582),f=l.isObject,h=l.isFunction,o=l.getValue;s=r(733);e=r(683);i=r(884);n=r(451);t.exports=a=function(t){u(XMLElement,t);function XMLElement(t,r,i){var a,n,s,o;XMLElement.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(r);this.type=e.Element;this.attribs={};this.schemaTypeInfo=null;if(i!=null){this.attribute(i)}if(t.type===e.Document){this.isRoot=true;this.documentObject=t;t.rootObject=this;if(t.children){o=t.children;for(n=0,s=o.length;n<s;n++){a=o[n];if(a.type===e.DocType){a.name=this.name;break}}}}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new n(this.attribs)}return this.attributeMap}});XMLElement.prototype.clone=function(){var t,e,r,i;r=Object.create(this);if(r.isRoot){r.documentObject=null}r.attribs={};i=this.attribs;for(e in i){if(!c.call(i,e))continue;t=i[e];r.attribs[e]=t.clone()}r.children=[];this.children.forEach(function(t){var e;e=t.clone();e.parent=r;return r.children.push(e)});return r};XMLElement.prototype.attribute=function(t,e){var r,a;if(t!=null){t=o(t)}if(f(t)){for(r in t){if(!c.call(t,r))continue;a=t[r];this.attribute(r,a)}}else{if(h(e)){e=e.apply()}if(this.options.keepNullAttributes&&e==null){this.attribs[t]=new i(this,t,"")}else if(e!=null){this.attribs[t]=new i(this,t,e)}}return this};XMLElement.prototype.removeAttribute=function(t){var e,r,i;if(t==null){throw new Error("Missing attribute name. "+this.debugInfo())}t=o(t);if(Array.isArray(t)){for(r=0,i=t.length;r<i;r++){e=t[r];delete this.attribs[e]}}else{delete this.attribs[t]}return this};XMLElement.prototype.toString=function(t){return this.options.writer.element(this,this.options.writer.filterOptions(t))};XMLElement.prototype.att=function(t,e){return this.attribute(t,e)};XMLElement.prototype.a=function(t,e){return this.attribute(t,e)};XMLElement.prototype.getAttribute=function(t){if(this.attribs.hasOwnProperty(t)){return this.attribs[t].value}else{return null}};XMLElement.prototype.setAttribute=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNode=function(t){if(this.attribs.hasOwnProperty(t)){return this.attribs[t]}else{return null}};XMLElement.prototype.setAttributeNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNS=function(t,e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNodeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNodeNS=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.hasAttribute=function(t){return this.attribs.hasOwnProperty(t)};XMLElement.prototype.hasAttributeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttribute=function(t,e){if(this.attribs.hasOwnProperty(t)){return this.attribs[t].isId}else{return e}};XMLElement.prototype.setIdAttributeNS=function(t,e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttributeNode=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByClassName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.isEqualNode=function(t){var e,r,i;if(!XMLElement.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)){return false}if(t.namespaceURI!==this.namespaceURI){return false}if(t.prefix!==this.prefix){return false}if(t.localName!==this.localName){return false}if(t.attribs.length!==this.attribs.length){return false}for(e=r=0,i=this.attribs.length-1;0<=i?r<=i:r>=i;e=0<=i?++r:--r){if(!this.attribs[e].isEqualNode(t.attribs[e])){return false}}return true};return XMLElement}(s)}).call(this)},797:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{contain:function contain(t,e,r,a,n){if(typeof t!=="number"||typeof e!=="number"){return i.throwError.call(this,"w and h must be numbers",n)}if(typeof r==="string"){if(typeof a==="function"&&typeof n==="undefined")n=a;a=r;r=null}if(typeof r==="function"){if(typeof n==="undefined")n=r;a=null;r=null}if(typeof a==="function"&&typeof n==="undefined"){n=a;a=null}r=r||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE;var s=r&(1<<3)-1;var o=r>>3;if(!(s!==0&&!(s&s-1)||o!==0&&!(o&o-1))){return i.throwError.call(this,"only use one flag per alignment direction",n)}var h=s>>1;var f=o>>1;var l=t/e>this.bitmap.width/this.bitmap.height?e/this.bitmap.height:t/this.bitmap.width;var u=this.cloneQuiet().scale(l,a);this.resize(t,e,a);this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){this.bitmap.data.writeUInt32BE(this._background,r)});this.blit(u,(this.bitmap.width-u.bitmap.width)/2*h,(this.bitmap.height-u.bitmap.height)/2*f);if((0,i.isNodePattern)(n)){n.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},799:function(t,e,r){var i=r(381);var a=new JIMPBUffer([66,77,70,3]);t.exports=function(t){if(typeof t==="string")return t.substring(0,3)==="BMF";return t.length>4&&i(t.slice(0,4),a)}},801:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(431));var n=r(19);var s=function _default(){return{blit:function blit(t,e,r,i,s,o,h,f){if(!(t instanceof this.constructor)){return n.throwError.call(this,"The source must be a Jimp image",f)}if(typeof e!=="number"||typeof r!=="number"){return n.throwError.call(this,"x and y must be numbers",f)}if(typeof i==="function"){f=i;i=0;s=0;o=t.bitmap.width;h=t.bitmap.height}else if((0,a["default"])(i)===(0,a["default"])(s)&&(0,a["default"])(s)===(0,a["default"])(o)&&(0,a["default"])(o)===(0,a["default"])(h)){i=i||0;s=s||0;o=o||t.bitmap.width;h=h||t.bitmap.height}else{return n.throwError.call(this,"srcx, srcy, srcw, srch must be numbers",f)}e=Math.round(e);r=Math.round(r);i=Math.round(i);s=Math.round(s);o=Math.round(o);h=Math.round(h);var l=this.bitmap.width;var u=this.bitmap.height;var c=this;t.scanQuiet(i,s,o,h,function(t,a,n){var o=e+t-i;var h=r+a-s;if(o>=0&&h>=0&&l-o>0&&u-h>0){var f=c.getPixelIndex(o,h);var d={r:this.bitmap.data[n],g:this.bitmap.data[n+1],b:this.bitmap.data[n+2],a:this.bitmap.data[n+3]};var p={r:c.bitmap.data[f],g:c.bitmap.data[f+1],b:c.bitmap.data[f+2],a:c.bitmap.data[f+3]};c.bitmap.data[f]=(d.a*(d.r-p.r)-p.r+255>>8)+p.r;c.bitmap.data[f+1]=(d.a*(d.g-p.g)-p.g+255>>8)+p.g;c.bitmap.data[f+2]=(d.a*(d.b-p.b)-p.b+255>>8)+p.b;c.bitmap.data[f+3]=this.constructor.limit255(p.a+d.a)}});if((0,n.isNodePattern)(f)){f.call(this,null,this)}return this}}};e["default"]=s;t.exports=e.default},815:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;e=r(683);a=r(639);t.exports=i=function(t){n(XMLCData,t);function XMLCData(t,r){XMLCData.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=e.CData;this.value=this.stringify.cdata(r)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(t){return this.options.writer.cdata(this,this.options.writer.filterOptions(t))};return XMLCData}(a)}).call(this)},831:function(t){function _iterableToArrayLimit(t,e){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(t)))return;var r=[];var i=true;var a=false;var n=undefined;try{for(var s=t[Symbol.iterator](),o;!(i=(o=s.next()).done);i=true){r.push(o.value);if(e&&r.length===e)break}}catch(t){a=true;n=t}finally{try{if(!i&&s["return"]!=null)s["return"]()}finally{if(a)throw n}}return r}t.exports=_iterableToArrayLimit},832:function(t,e,r){"use strict";var i=r(401);var a=r(999);var n=r(279);var s=r(691);var o=r(868);var h=r(991);var f=r(969);var l=Object.prototype.toString;function Inflate(t){if(!(this instanceof Inflate))return new Inflate(t);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;if(e.raw&&e.windowBits>=0&&e.windowBits<16){e.windowBits=-e.windowBits;if(e.windowBits===0){e.windowBits=-15}}if(e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)){e.windowBits+=32}if(e.windowBits>15&&e.windowBits<48){if((e.windowBits&15)===0){e.windowBits|=15}}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new h;this.strm.avail_out=0;var r=i.inflateInit2(this.strm,e.windowBits);if(r!==s.Z_OK){throw new Error(o[r])}this.header=new f;i.inflateGetHeader(this.strm,this.header);if(e.dictionary){if(typeof e.dictionary==="string"){e.dictionary=n.string2buf(e.dictionary)}else if(l.call(e.dictionary)==="[object ArrayBuffer]"){e.dictionary=new Uint8Array(e.dictionary)}if(e.raw){r=i.inflateSetDictionary(this.strm,e.dictionary);if(r!==s.Z_OK){throw new Error(o[r])}}}}Inflate.prototype.push=function(t,e){var r=this.strm;var o=this.options.chunkSize;var h=this.options.dictionary;var f,u;var c,d,p;var v=false;if(this.ended){return false}u=e===~~e?e:e===true?s.Z_FINISH:s.Z_NO_FLUSH;if(typeof t==="string"){r.input=n.binstring2buf(t)}else if(l.call(t)==="[object ArrayBuffer]"){r.input=new Uint8Array(t)}else{r.input=t}r.next_in=0;r.avail_in=r.input.length;do{if(r.avail_out===0){r.output=new a.Buf8(o);r.next_out=0;r.avail_out=o}f=i.inflate(r,s.Z_NO_FLUSH);if(f===s.Z_NEED_DICT&&h){f=i.inflateSetDictionary(this.strm,h)}if(f===s.Z_BUF_ERROR&&v===true){f=s.Z_OK;v=false}if(f!==s.Z_STREAM_END&&f!==s.Z_OK){this.onEnd(f);this.ended=true;return false}if(r.next_out){if(r.avail_out===0||f===s.Z_STREAM_END||r.avail_in===0&&(u===s.Z_FINISH||u===s.Z_SYNC_FLUSH)){if(this.options.to==="string"){c=n.utf8border(r.output,r.next_out);d=r.next_out-c;p=n.buf2string(r.output,c);r.next_out=d;r.avail_out=o-d;if(d){a.arraySet(r.output,r.output,c,d,0)}this.onData(p)}else{this.onData(a.shrinkBuf(r.output,r.next_out))}}}if(r.avail_in===0&&r.avail_out===0){v=true}}while((r.avail_in>0||r.avail_out===0)&&f!==s.Z_STREAM_END);if(f===s.Z_STREAM_END){u=s.Z_FINISH}if(u===s.Z_FINISH){f=i.inflateEnd(this.strm);this.onEnd(f);this.ended=true;return f===s.Z_OK}if(u===s.Z_SYNC_FLUSH){this.onEnd(s.Z_OK);r.avail_out=0;return true}return true};Inflate.prototype.onData=function(t){this.chunks.push(t)};Inflate.prototype.onEnd=function(t){if(t===s.Z_OK){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=a.flattenChunks(this.chunks)}}this.chunks=[];this.err=t;this.msg=this.strm.msg};function inflate(t,e){var r=new Inflate(e);r.push(t,true);if(r.err){throw r.msg||o[r.err]}return r.result}function inflateRaw(t,e){e=e||{};e.raw=true;return inflate(t,e)}e.Inflate=Inflate;e.inflate=inflate;e.inflateRaw=inflateRaw;e.ungzip=inflate},835:function(t){t.exports=require("url")},836:function(t,e,r){"use strict";const i=r(747);const a=r(559);const n=r(427);const{GifFrame:s}=r(569);const{GifError:o}=r(736);const{GifCodec:h}=r(112);const f=[".jpg",".jpeg",".png",".bmp"];const l=new h;e.cloneFrames=function(t){let e=[];t.forEach(t=>{e.push(new s(t))});return e};e.getColorInfo=function(t,e){let r=false;const i=[];for(let e=0;e<t.length;++e){let a=t[e].getPalette();if(a.usesTransparency){r=true}if(a.indexCount>256){throw new o(`Frame ${e} uses more than 256 color indexes`)}i.push(a)}if(e===0){return{usesTransparency:r,palettes:i}}const a=new Set;i.forEach(t=>{t.colors.forEach(t=>{a.add(t)})});let n=a.size;if(r){++n}if(e&&n>e){return{usesTransparency:r,palettes:i}}const s=new Array(a.size);const h=a.values();for(let t=0;t<s.length;++t){s[t]=h.next().value}s.sort((t,e)=>t-e);return{colors:s,indexCount:n,usesTransparency:r,palettes:i}};e.copyAsJimp=function(t,r){return e.shareAsJimp(t,new n(r))};e.getMaxDimensions=function(t){let e=0,r=0;t.forEach(t=>{const i=t.xOffset+t.bitmap.width;if(i>e){e=i}const a=t.yOffset+t.bitmap.height;if(a>r){r=a}});return{maxWidth:e,maxHeight:r}};e.quantizeDekker=function(t,e,r){e=e||256;_quantize(t,"NeuQuantFloat",e,0,r)};e.quantizeSorokin=function(t,e,r,i){e=e||256;r=r||"min-pop";let a;switch(r){case"min-pop":a=2;break;case"top-pop":a=1;break;default:throw new Error(`Invalid quantizeSorokin histogram '${r}'`)}_quantize(t,"RGBQuant",e,a,i)};e.quantizeWu=function(t,e,r,i){e=e||256;r=r||5;if(r<1||r>8){throw new Error("Invalid quantization quality")}_quantize(t,"WuQuant",e,r,i)};e.read=function(t,e){e=e||l;if(Buffer.isBuffer(t)){return e.decodeGif(t)}return _readBinary(t).then(t=>{return e.decodeGif(t)})};e.shareAsJimp=function(t,e){const r=new t(e.bitmap.width,e.bitmap.height,0);r.bitmap.data=e.bitmap.data;return r};e.write=function(t,e,r,i){i=i||l;const a=t.match(/\.[a-zA-Z]+$/);if(a!==null&&f.includes(a[0].toLowerCase())){throw new Error(`GIF '${t}' has an unexpected suffix`)}return i.encodeGif(e,r).then(e=>{return _writeBinary(t,e.buffer).then(()=>{return e})})};function _quantize(t,e,r,i,n){const s=Array.isArray(t)?t:[t];const o=["FloydSteinberg","FalseFloydSteinberg","Stucki","Atkinson","Jarvis","Burkes","Sierra","TwoSierra","SierraLite"];if(n){if(o.indexOf(n.ditherAlgorithm)<0){throw new Error(`Invalid ditherAlgorithm '${n.ditherAlgorithm}'`)}if(n.serpentine===undefined){n.serpentine=true}if(n.minimumColorDistanceToDither===undefined){n.minimumColorDistanceToDither=0}if(n.calculateErrorLikeGIMP===undefined){n.calculateErrorLikeGIMP=false}}const h=new a.distance.Euclidean;const f=new a.palette[e](h,r,i);let l;if(n){l=new a.image.ErrorDiffusionArray(h,a.image.ErrorDiffusionArrayKernel[n.ditherAlgorithm],n.serpentine,n.minimumColorDistanceToDither,n.calculateErrorLikeGIMP)}else{l=new a.image.NearestColor(h)}const u=[];s.forEach(t=>{const e=t.bitmap.data;const r=new ArrayBuffer(e.length);const i=new Uint32Array(r);for(let t=0,r=0;t<e.length;t+=4,++r){i[r]=e.readUInt32LE(t,true)}const n=a.utils.PointContainer.fromUint32Array(i,t.bitmap.width,t.bitmap.height);f.sample(n);u.push(n)});const c=f.quantize();for(let t=0;t<s.length;++t){const e=s[t].bitmap.data;const r=l.quantize(u[t],c);const i=r.toUint32Array();for(let t=0,r=0;t<e.length;t+=4,++r){e.writeUInt32LE(i[r],t)}}}function _readBinary(t){return new Promise((e,r)=>{i.readFile(t,(t,i)=>{if(t){return r(t)}return e(i)})})}function _writeBinary(t,e){return new Promise((r,a)=>{i.writeFile(t,e,t=>{if(t){return a(t)}return r()})})}},842:function(t,e,r){var i=r(718);function getGlobal(){return(1,eval)("this")}t.exports={create:function(t,e){e=e||getGlobal();if(t instanceof e.ArrayBuffer){var a=r(610);return new i(new a(t,0,t.byteLength,true,e))}else{var n=r(944);return new i(new n(t,0,t.length,true))}}}},843:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(655));var n=i(r(139));var s="image/tiff";var o=function _default(){return{mime:(0,a["default"])({},s,["tiff","tif"]),constants:{MIME_TIFF:s},decoders:(0,a["default"])({},s,function(t){var e=n["default"].decode(t);var r=e[0];n["default"].decodeImages(t,e);var i=n["default"].toRGBA8(r);return{data:Buffer.from(i),width:r.t256[0],height:r.t257[0]}}),encoders:(0,a["default"])({},s,function(t){var e=n["default"].encodeImage(t.bitmap.data,t.bitmap.width,t.bitmap.height);return Buffer.from(e)})}};e["default"]=o;t.exports=e.default},845:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);function flipFn(t,e,r){if(typeof t!=="boolean"||typeof e!=="boolean")return i.throwError.call(this,"horizontal and vertical must be Booleans",r);var a=Buffer.alloc(this.bitmap.data.length);this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(r,i,n){var s=t?this.bitmap.width-1-r:r;var o=e?this.bitmap.height-1-i:i;var h=this.bitmap.width*o+s<<2;var f=this.bitmap.data.readUInt32BE(n);a.writeUInt32BE(f,h)});this.bitmap.data=Buffer.from(a);if((0,i.isNodePattern)(r)){r.call(this,null,this)}return this}var a=function _default(){return{flip:flipFn,mirror:flipFn}};e["default"]=a;t.exports=e.default},847:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(655));var n=r(275);var s=r(19);var o="image/png";var h=-1;var f=0;var l=1;var u=2;var c=3;var d=4;var p=function _default(){return{mime:(0,a["default"])({},o,["png"]),constants:{MIME_PNG:o,PNG_FILTER_AUTO:h,PNG_FILTER_NONE:f,PNG_FILTER_SUB:l,PNG_FILTER_UP:u,PNG_FILTER_AVERAGE:c,PNG_FILTER_PATH:d},hasAlpha:(0,a["default"])({},o,true),decoders:(0,a["default"])({},o,n.PNG.sync.read),encoders:(0,a["default"])({},o,function(t){var e=new n.PNG({width:t.bitmap.width,height:t.bitmap.height});e.data=t.bitmap.data;return n.PNG.sync.write(e,{width:t.bitmap.width,height:t.bitmap.height,deflateLevel:t._deflateLevel,deflateStrategy:t._deflateStrategy,filterType:t._filterType,colorType:typeof t._colorType==="number"?t._colorType:t._rgba?6:2,inputHasAlpha:t._rgba})}),class:{_deflateLevel:9,_deflateStrategy:3,_filterType:h,_colorType:null,deflateLevel:function deflateLevel(t,e){if(typeof t!=="number"){return s.throwError.call(this,"l must be a number",e)}if(t<0||t>9){return s.throwError.call(this,"l must be a number 0 - 9",e)}this._deflateLevel=Math.round(t);if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this},deflateStrategy:function deflateStrategy(t,e){if(typeof t!=="number"){return s.throwError.call(this,"s must be a number",e)}if(t<0||t>3){return s.throwError.call(this,"s must be a number 0 - 3",e)}this._deflateStrategy=Math.round(t);if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this},filterType:function filterType(t,e){if(typeof t!=="number"){return s.throwError.call(this,"n must be a number",e)}if(t<-1||t>4){return s.throwError.call(this,"n must be -1 (auto) or a number 0 - 4",e)}this._filterType=Math.round(t);if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this},colorType:function colorType(t,e){if(typeof t!=="number"){return s.throwError.call(this,"s must be a number",e)}if(t!==0&&t!==2&&t!==4&&t!==6){return s.throwError.call(this,"s must be a number 0, 2, 4, 6.",e)}this._colorType=Math.round(t);if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this}}}};e["default"]=p;t.exports=e.default},849:function(t){function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t.exports=_nonIterableRest},851:function(t,e,r){var i=r(708);function anyBase(t,e){var r=new i(t,e);return function(t){return r.convert(t)}}anyBase.BIN="01";anyBase.OCT="01234567";anyBase.DEC="0123456789";anyBase.HEX="0123456789abcdef";t.exports=anyBase},868:function(t){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},873:function(t){function _iterableToArray(t){if(typeof Symbol!=="undefined"&&Symbol.iterator in Object(t))return Array.from(t)}t.exports=_iterableToArray},874:function(t,e,r){var i=r(992);var a=r(316);t.exports=function parseBMFontXML(t){t=t.toString().trim();var e={pages:[],chars:[],kernings:[]};i.parseString(t,function(t,r){if(t)throw t;if(!r.font)throw"XML bitmap font doesn't have <font> root";r=r.font;e.common=a(r.common[0].$);e.info=a(r.info[0].$);for(var i=0;i<r.pages.length;i++){var n=r.pages[i].page[0].$;if(typeof n.id==="undefined")throw new Error("malformed file -- needs page id=N");if(typeof n.file!=="string")throw new Error('malformed file -- needs page file="path"');e.pages[parseInt(n.id,10)]=n.file}if(r.chars){var s=r.chars[0]["char"]||[];for(var i=0;i<s.length;i++){e.chars.push(a(s[i].$))}}if(r.kernings){var o=r.kernings[0]["kerning"]||[];for(var i=0;i<o.length;i++){e.kernings.push(a(o[i].$))}}});return e}},884:function(t,e,r){(function(){var e,i,a;e=r(683);a=r(733);t.exports=i=function(){function XMLAttribute(t,r,i){this.parent=t;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(r==null){throw new Error("Missing attribute name. "+this.debugInfo(r))}this.name=this.stringify.name(r);this.value=this.stringify.attValue(i);this.type=e.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});XMLAttribute.prototype.clone=function(){return Object.create(this)};XMLAttribute.prototype.toString=function(t){return this.options.writer.attribute(this,this.options.writer.filterOptions(t))};XMLAttribute.prototype.debugInfo=function(t){t=t||this.name;if(t==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+t+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(t){if(t.namespaceURI!==this.namespaceURI){return false}if(t.prefix!==this.prefix){return false}if(t.localName!==this.localName){return false}if(t.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},885:function(t,e,r){(function(){"use strict";var t,i,a,n,s,o,h,f,l=function(t,e){return function(){return t.apply(e,arguments)}},u=function(t,e){for(var r in e){if(c.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},c={}.hasOwnProperty;h=r(645);a=r(614);t=r(598);o=r(350);f=r(343).setImmediate;i=r(791).defaults;n=function(t){return typeof t==="object"&&t!=null&&Object.keys(t).length===0};s=function(t,e,r){var i,a,n;for(i=0,a=t.length;i<a;i++){n=t[i];e=n(e,r)}return e};e.Parser=function(r){u(Parser,r);function Parser(t){this.parseStringPromise=l(this.parseStringPromise,this);this.parseString=l(this.parseString,this);this.reset=l(this.reset,this);this.assignOrPush=l(this.assignOrPush,this);this.processAsync=l(this.processAsync,this);var r,a,n;if(!(this instanceof e.Parser)){return new e.Parser(t)}this.options={};a=i["0.2"];for(r in a){if(!c.call(a,r))continue;n=a[r];this.options[r]=n}for(r in t){if(!c.call(t,r))continue;n=t[r];this.options[r]=n}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(o.normalize)}this.reset()}Parser.prototype.processAsync=function(){var t,e;try{if(this.remaining.length<=this.options.chunkSize){t=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(t);return this.saxParser.close()}else{t=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(t);return f(this.processAsync)}}catch(t){e=t;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(e)}}};Parser.prototype.assignOrPush=function(t,e,r){if(!(e in t)){if(!this.options.explicitArray){return t[e]=r}else{return t[e]=[r]}}else{if(!(t[e]instanceof Array)){t[e]=[t[e]]}return t[e].push(r)}};Parser.prototype.reset=function(){var t,e,r,i;this.removeAllListeners();this.saxParser=h.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(t){return function(e){t.saxParser.resume();if(!t.saxParser.errThrown){t.saxParser.errThrown=true;return t.emit("error",e)}}}(this);this.saxParser.onend=function(t){return function(){if(!t.saxParser.ended){t.saxParser.ended=true;return t.emit("end",t.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;i=[];t=this.options.attrkey;e=this.options.charkey;this.saxParser.onopentag=function(r){return function(a){var n,o,h,f,l;h={};h[e]="";if(!r.options.ignoreAttrs){l=a.attributes;for(n in l){if(!c.call(l,n))continue;if(!(t in h)&&!r.options.mergeAttrs){h[t]={}}o=r.options.attrValueProcessors?s(r.options.attrValueProcessors,a.attributes[n],n):a.attributes[n];f=r.options.attrNameProcessors?s(r.options.attrNameProcessors,n):n;if(r.options.mergeAttrs){r.assignOrPush(h,f,o)}else{h[t][f]=o}}}h["#name"]=r.options.tagNameProcessors?s(r.options.tagNameProcessors,a.name):a.name;if(r.options.xmlns){h[r.options.xmlnskey]={uri:a.uri,local:a.local}}return i.push(h)}}(this);this.saxParser.onclosetag=function(t){return function(){var r,a,o,h,f,l,u,d,p,v;l=i.pop();f=l["#name"];if(!t.options.explicitChildren||!t.options.preserveChildrenOrder){delete l["#name"]}if(l.cdata===true){r=l.cdata;delete l.cdata}p=i[i.length-1];if(l[e].match(/^\s*$/)&&!r){a=l[e];delete l[e]}else{if(t.options.trim){l[e]=l[e].trim()}if(t.options.normalize){l[e]=l[e].replace(/\s{2,}/g," ").trim()}l[e]=t.options.valueProcessors?s(t.options.valueProcessors,l[e],f):l[e];if(Object.keys(l).length===1&&e in l&&!t.EXPLICIT_CHARKEY){l=l[e]}}if(n(l)){l=t.options.emptyTag!==""?t.options.emptyTag:a}if(t.options.validator!=null){v="/"+function(){var t,e,r;r=[];for(t=0,e=i.length;t<e;t++){h=i[t];r.push(h["#name"])}return r}().concat(f).join("/");(function(){var e;try{return l=t.options.validator(v,p&&p[f],l)}catch(r){e=r;return t.emit("error",e)}})()}if(t.options.explicitChildren&&!t.options.mergeAttrs&&typeof l==="object"){if(!t.options.preserveChildrenOrder){h={};if(t.options.attrkey in l){h[t.options.attrkey]=l[t.options.attrkey];delete l[t.options.attrkey]}if(!t.options.charsAsChildren&&t.options.charkey in l){h[t.options.charkey]=l[t.options.charkey];delete l[t.options.charkey]}if(Object.getOwnPropertyNames(l).length>0){h[t.options.childkey]=l}l=h}else if(p){p[t.options.childkey]=p[t.options.childkey]||[];u={};for(o in l){if(!c.call(l,o))continue;u[o]=l[o]}p[t.options.childkey].push(u);delete l["#name"];if(Object.keys(l).length===1&&e in l&&!t.EXPLICIT_CHARKEY){l=l[e]}}}if(i.length>0){return t.assignOrPush(p,f,l)}else{if(t.options.explicitRoot){d=l;l={};l[f]=d}t.resultObject=l;t.saxParser.ended=true;return t.emit("end",t.resultObject)}}}(this);r=function(t){return function(r){var a,n;n=i[i.length-1];if(n){n[e]+=r;if(t.options.explicitChildren&&t.options.preserveChildrenOrder&&t.options.charsAsChildren&&(t.options.includeWhiteChars||r.replace(/\\n/g,"").trim()!=="")){n[t.options.childkey]=n[t.options.childkey]||[];a={"#name":"__text__"};a[e]=r;if(t.options.normalize){a[e]=a[e].replace(/\s{2,}/g," ").trim()}n[t.options.childkey].push(a)}return n}}}(this);this.saxParser.ontext=r;return this.saxParser.oncdata=function(t){return function(t){var e;e=r(t);if(e){return e.cdata=true}}}(this)};Parser.prototype.parseString=function(e,r){var i;if(r!=null&&typeof r==="function"){this.on("end",function(t){this.reset();return r(null,t)});this.on("error",function(t){this.reset();return r(t)})}try{e=e.toString();if(e.trim()===""){this.emit("end",null);return true}e=t.stripBOM(e);if(this.options.async){this.remaining=e;f(this.processAsync);return this.saxParser}return this.saxParser.write(e).close()}catch(t){i=t;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",i);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw i}}};Parser.prototype.parseStringPromise=function(t){return new Promise(function(e){return function(r,i){return e.parseString(t,function(t,e){if(t){return i(t)}else{return r(e)}})}}(this))};return Parser}(a);e.parseString=function(t,r,i){var a,n,s;if(i!=null){if(typeof i==="function"){a=i}if(typeof r==="object"){n=r}}else{if(typeof r==="function"){a=r}n={}}s=new e.Parser(n);return s.parseString(t,a)};e.parseStringPromise=function(t,r){var i,a;if(typeof r==="object"){i=r}a=new e.Parser(i);return a.parseStringPromise(t)}}).call(this)},890:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;a=r(733);e=r(683);t.exports=i=function(t){n(XMLDTDAttList,t);function XMLDTDAttList(t,r,i,a,n,s){XMLDTDAttList.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(i==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(r))}if(!a){throw new Error("Missing DTD attribute type. "+this.debugInfo(r))}if(!n){throw new Error("Missing DTD attribute default. "+this.debugInfo(r))}if(n.indexOf("#")!==0){n="#"+n}if(!n.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(r))}if(s&&!n.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(r))}this.elementName=this.stringify.name(r);this.type=e.AttributeDeclaration;this.attributeName=this.stringify.name(i);this.attributeType=this.stringify.dtdAttType(a);if(s){this.defaultValue=this.stringify.dtdAttDefault(s)}this.defaultValueType=n}XMLDTDAttList.prototype.toString=function(t){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(t))};return XMLDTDAttList}(a)}).call(this)},891:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;a=r(733);e=r(683);t.exports=i=function(t){n(XMLDTDNotation,t);function XMLDTDNotation(t,r,i){XMLDTDNotation.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing DTD notation name. "+this.debugInfo(r))}if(!i.pubID&&!i.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(r))}this.name=this.stringify.name(r);this.type=e.NotationDeclaration;if(i.pubID!=null){this.pubID=this.stringify.dtdPubID(i.pubID)}if(i.sysID!=null){this.sysID=this.stringify.dtdSysID(i.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(t){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(t))};return XMLDTDNotation}(a)}).call(this)},892:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var r=function promisify(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++){i[a-2]=arguments[a]}return new Promise(function(r,a){i.push(function(t,e){if(t){a(t)}r(e)});t.bind(e).apply(void 0,i)})};var i=r;e["default"]=i;t.exports=e.default},897:function(t){(function(){var e;t.exports=e=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(t){throw new Error(t)};return XMLDOMErrorHandler}()}).call(this)},904:function(t,e,r){"use strict";var i=r(80);var a=r(447);e.process=function(t,e){var r=[];var n=new i(t);var s=new a(e,{read:n.read.bind(n),write:function(t){r.push(t)},complete:function(){}});s.start();n.process();return Buffer.concat(r)}},919:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;e=r(683);i=r(639);t.exports=a=function(t){n(XMLComment,t);function XMLComment(t,r){XMLComment.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=e.Comment;this.value=this.stringify.comment(r)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(t){return this.options.writer.comment(this,this.options.writer.filterOptions(t))};return XMLComment}(i)}).call(this)},925:function(t){function _arrayLikeToArray(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,i=new Array(e);r<e;r++){i[r]=t[r]}return i}t.exports=_arrayLikeToArray},932:function(t,e,r){"use strict";var i=r(268);var a=r(228);var n=t.exports=function(t,e){this._options=t;t.checkCRC=t.checkCRC!==false;this._hasIHDR=false;this._hasIEND=false;this._emittedHeadersFinished=false;this._palette=[];this._colorType=0;this._chunks={};this._chunks[i.TYPE_IHDR]=this._handleIHDR.bind(this);this._chunks[i.TYPE_IEND]=this._handleIEND.bind(this);this._chunks[i.TYPE_IDAT]=this._handleIDAT.bind(this);this._chunks[i.TYPE_PLTE]=this._handlePLTE.bind(this);this._chunks[i.TYPE_tRNS]=this._handleTRNS.bind(this);this._chunks[i.TYPE_gAMA]=this._handleGAMA.bind(this);this.read=e.read;this.error=e.error;this.metadata=e.metadata;this.gamma=e.gamma;this.transColor=e.transColor;this.palette=e.palette;this.parsed=e.parsed;this.inflateData=e.inflateData;this.finished=e.finished;this.simpleTransparency=e.simpleTransparency;this.headersFinished=e.headersFinished||function(){}};n.prototype.start=function(){this.read(i.PNG_SIGNATURE.length,this._parseSignature.bind(this))};n.prototype._parseSignature=function(t){var e=i.PNG_SIGNATURE;for(var r=0;r<e.length;r++){if(t[r]!==e[r]){this.error(new Error("Invalid file signature"));return}}this.read(8,this._parseChunkBegin.bind(this))};n.prototype._parseChunkBegin=function(t){var e=t.readUInt32BE(0);var r=t.readUInt32BE(4);var n="";for(var s=4;s<8;s++){n+=String.fromCharCode(t[s])}var o=Boolean(t[4]&32);if(!this._hasIHDR&&r!==i.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}this._crc=new a;this._crc.write(new JIMPBUffer(n));if(this._chunks[r]){return this._chunks[r](e)}if(!o){this.error(new Error("Unsupported critical chunk type "+n));return}this.read(e+4,this._skipChunk.bind(this))};n.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};n.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};n.prototype._parseChunkEnd=function(t){var e=t.readInt32BE(0);var r=this._crc.crc32();if(this._options.checkCRC&&r!==e){this.error(new Error("Crc error - "+e+" - "+r));return}if(!this._hasIEND){this.read(8,this._parseChunkBegin.bind(this))}};n.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))};n.prototype._parseIHDR=function(t){this._crc.write(t);var e=t.readUInt32BE(0);var r=t.readUInt32BE(4);var a=t[8];var n=t[9];var s=t[10];var o=t[11];var h=t[12];if(a!==8&&a!==4&&a!==2&&a!==1&&a!==16){this.error(new Error("Unsupported bit depth "+a));return}if(!(n in i.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(s!==0){this.error(new Error("Unsupported compression method"));return}if(o!==0){this.error(new Error("Unsupported filter method"));return}if(h!==0&&h!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=n;var f=i.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=true;this.metadata({width:e,height:r,depth:a,interlace:Boolean(h),palette:Boolean(n&i.COLORTYPE_PALETTE),color:Boolean(n&i.COLORTYPE_COLOR),alpha:Boolean(n&i.COLORTYPE_ALPHA),bpp:f,colorType:n});this._handleChunkEnd()};n.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))};n.prototype._parsePLTE=function(t){this._crc.write(t);var e=Math.floor(t.length/3);for(var r=0;r<e;r++){this._palette.push([t[r*3],t[r*3+1],t[r*3+2],255])}this.palette(this._palette);this._handleChunkEnd()};n.prototype._handleTRNS=function(t){this.simpleTransparency();this.read(t,this._parseTRNS.bind(this))};n.prototype._parseTRNS=function(t){this._crc.write(t);if(this._colorType===i.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(t.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(var e=0;e<t.length;e++){this._palette[e][3]=t[e]}this.palette(this._palette)}if(this._colorType===i.COLORTYPE_GRAYSCALE){this.transColor([t.readUInt16BE(0)])}if(this._colorType===i.COLORTYPE_COLOR){this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)])}this._handleChunkEnd()};n.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))};n.prototype._parseGAMA=function(t){this._crc.write(t);this.gamma(t.readUInt32BE(0)/i.GAMMA_DIVISION);this._handleChunkEnd()};n.prototype._handleIDAT=function(t){if(!this._emittedHeadersFinished){this._emittedHeadersFinished=true;this.headersFinished()}this.read(-t,this._parseIDAT.bind(this,t))};n.prototype._parseIDAT=function(t,e){this._crc.write(e);if(this._colorType===i.COLORTYPE_PALETTE_COLOR&&this._palette.length===0){throw new Error("Expected palette not found")}this.inflateData(e);var r=t-e.length;if(r>0){this._handleIDAT(r)}else{this._handleChunkEnd()}};n.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};n.prototype._parseIEND=function(t){this._crc.write(t);this._hasIEND=true;this._handleChunkEnd();if(this.finished){this.finished()}}},944:function(t){function BufferStream(t,e,r,i){this.buffer=t;this.offset=e||0;r=typeof r==="number"?r:t.length;this.endPosition=this.offset+r;this.setBigEndian(i)}BufferStream.prototype={setBigEndian:function(t){this.bigEndian=!!t},nextUInt8:function(){var t=this.buffer.readUInt8(this.offset);this.offset+=1;return t},nextInt8:function(){var t=this.buffer.readInt8(this.offset);this.offset+=1;return t},nextUInt16:function(){var t=this.bigEndian?this.buffer.readUInt16BE(this.offset):this.buffer.readUInt16LE(this.offset);this.offset+=2;return t},nextUInt32:function(){var t=this.bigEndian?this.buffer.readUInt32BE(this.offset):this.buffer.readUInt32LE(this.offset);this.offset+=4;return t},nextInt16:function(){var t=this.bigEndian?this.buffer.readInt16BE(this.offset):this.buffer.readInt16LE(this.offset);this.offset+=2;return t},nextInt32:function(){var t=this.bigEndian?this.buffer.readInt32BE(this.offset):this.buffer.readInt32LE(this.offset);this.offset+=4;return t},nextFloat:function(){var t=this.bigEndian?this.buffer.readFloatBE(this.offset):this.buffer.readFloatLE(this.offset);this.offset+=4;return t},nextDouble:function(){var t=this.bigEndian?this.buffer.readDoubleBE(this.offset):this.buffer.readDoubleLE(this.offset);this.offset+=8;return t},nextBuffer:function(t){var e=this.buffer.slice(this.offset,this.offset+t);this.offset+=t;return e},remainingLength:function(){return this.endPosition-this.offset},nextString:function(t){var e=this.buffer.toString("utf8",this.offset,this.offset+t);this.offset+=t;return e},mark:function(){var t=this;return{openWithOffset:function(e){e=(e||0)+this.offset;return new JIMPBUfferStream(t.buffer,e,t.endPosition-e,t.bigEndian)},offset:this.offset}},offsetFrom:function(t){return this.offset-t.offset},skip:function(t){this.offset+=t},branch:function(t,e){e=typeof e==="number"?e:this.endPosition-(this.offset+t);return new JIMPBUfferStream(this.buffer,this.offset+t,e,this.bigEndian)}};t.exports=BufferStream},946:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{mask:function mask(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var a=arguments.length>3?arguments[3]:undefined;if(!(t instanceof this.constructor)){return i.throwError.call(this,"The source must be a Jimp image",a)}if(typeof e!=="number"||typeof r!=="number"){return i.throwError.call(this,"x and y must be numbers",a)}e=Math.round(e);r=Math.round(r);var n=this.bitmap.width;var s=this.bitmap.height;var o=this;t.scanQuiet(0,0,t.bitmap.width,t.bitmap.height,function(t,i,a){var h=e+t;var f=r+i;if(h>=0&&f>=0&&h<n&&f<s){var l=o.getPixelIndex(h,f);var u=this.bitmap.data;var c=(u[a+0]+u[a+1]+u[a+2])/3;o.bitmap.data[l+3]*=c/255}});if((0,i.isNodePattern)(a)){a.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},956:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;a=r(733);e=r(683);t.exports=i=function(t){n(XMLDummy,t);function XMLDummy(t){XMLDummy.__super__.constructor.call(this,t);this.type=e.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(t){return""};return XMLDummy}(a)}).call(this)},963:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.EDGE_CROP=e.EDGE_WRAP=e.EDGE_EXTEND=e.BLEND_EXCLUSION=e.BLEND_DIFFERENCE=e.BLEND_HARDLIGHT=e.BLEND_LIGHTEN=e.BLEND_DARKEN=e.BLEND_OVERLAY=e.BLEND_SCREEN=e.BLEND_ADD=e.BLEND_MULTIPLY=e.BLEND_DESTINATION_OVER=e.BLEND_SOURCE_OVER=e.VERTICAL_ALIGN_BOTTOM=e.VERTICAL_ALIGN_MIDDLE=e.VERTICAL_ALIGN_TOP=e.HORIZONTAL_ALIGN_RIGHT=e.HORIZONTAL_ALIGN_CENTER=e.HORIZONTAL_ALIGN_LEFT=e.AUTO=void 0;var r=-1;e.AUTO=r;var i=1;e.HORIZONTAL_ALIGN_LEFT=i;var a=2;e.HORIZONTAL_ALIGN_CENTER=a;var n=4;e.HORIZONTAL_ALIGN_RIGHT=n;var s=8;e.VERTICAL_ALIGN_TOP=s;var o=16;e.VERTICAL_ALIGN_MIDDLE=o;var h=32;e.VERTICAL_ALIGN_BOTTOM=h;var f="srcOver";e.BLEND_SOURCE_OVER=f;var l="dstOver";e.BLEND_DESTINATION_OVER=l;var u="multiply";e.BLEND_MULTIPLY=u;var c="add";e.BLEND_ADD=c;var d="screen";e.BLEND_SCREEN=d;var p="overlay";e.BLEND_OVERLAY=p;var v="darken";e.BLEND_DARKEN=v;var m="lighten";e.BLEND_LIGHTEN=m;var g="hardLight";e.BLEND_HARDLIGHT=g;var b="difference";e.BLEND_DIFFERENCE=b;var y="exclusion";e.BLEND_EXCLUSION=y;var E=1;e.EDGE_EXTEND=E;var M=2;e.EDGE_WRAP=M;var w=3;e.EDGE_CROP=w},969:function(t){"use strict";function GZheader(){this.text=0;this.time=0;this.xflags=0;this.os=0;this.extra=null;this.extra_len=0;this.name="";this.comment="";this.hcrc=0;this.done=false}t.exports=GZheader},972:function(t,e,r){(function(){var e,i,a,n,s,o,h,f,l,u;u=r(582),f=u.assign,l=u.isFunction;a=r(515);n=r(668);s=r(768);h=r(750);o=r(458);e=r(683);i=r(541);t.exports.create=function(t,e,r,i){var a,s;if(t==null){throw new Error("Root element needs a name.")}i=f({},e,r,i);a=new n(i);s=a.element(t);if(!i.headless){a.declaration(i);if(i.pubID!=null||i.sysID!=null){a.dtd(i)}}return s};t.exports.begin=function(t,e,r){var i;if(l(t)){i=[t,e],e=i[0],r=i[1];t={}}if(e){return new s(t,e,r)}else{return new n(t)}};t.exports.stringWriter=function(t){return new h(t)};t.exports.streamWriter=function(t,e){return new o(t,e)};t.exports.implementation=new a;t.exports.nodeType=e;t.exports.writerState=i}).call(this)},983:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);function histogram(){var t={r:new Array(256).fill(0),g:new Array(256).fill(0),b:new Array(256).fill(0)};this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(e,r,i){t.r[this.bitmap.data[i+0]]++;t.g[this.bitmap.data[i+1]]++;t.b[this.bitmap.data[i+2]]++});return t}var a=function normalize(t,e,r){return(t-e)*255/(r-e)};var n=function getBounds(t){return[t.findIndex(function(t){return t>0}),255-t.slice().reverse().findIndex(function(t){return t>0})]};var s=function _default(){return{normalize:function normalize(t){var e=histogram.call(this);var r={r:n(e.r),g:n(e.g),b:n(e.b)};this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,i){var n=this.bitmap.data[i+0];var s=this.bitmap.data[i+1];var o=this.bitmap.data[i+2];this.bitmap.data[i+0]=a(n,r.r[0],r.r[1]);this.bitmap.data[i+1]=a(s,r.g[0],r.g[1]);this.bitmap.data[i+2]=a(o,r.b[0],r.b[1])});if((0,i.isNodePattern)(t)){t.call(this,null,this)}return this}}};e["default"]=s;t.exports=e.default},988:function(t,e,r){(function(){var e,i,a,n=function(t,e){for(var r in e){if(s.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},s={}.hasOwnProperty;e=r(683);i=r(639);t.exports=a=function(t){n(XMLText,t);function XMLText(t,r){XMLText.__super__.constructor.call(this,t);if(r==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=e.Text;this.value=this.stringify.text(r)}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var t,e,r;r="";e=this.previousSibling;while(e){r=e.data+r;e=e.previousSibling}r+=this.data;t=this.nextSibling;while(t){r=r+t.data;t=t.nextSibling}return r}});XMLText.prototype.clone=function(){return Object.create(this)};XMLText.prototype.toString=function(t){return this.options.writer.text(this,this.options.writer.filterOptions(t))};XMLText.prototype.splitText=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLText.prototype.replaceWholeText=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLText}(i)}).call(this)},990:function(t,e,r){"use strict";var i=r(764);Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var a=i(r(996));var n=i(r(164));var s=r(19);function applyKernel(t,e,r,i){var a=[0,0,0];var n=(e.length-1)/2;for(var s=0;s<e.length;s+=1){for(var o=0;o<e[s].length;o+=1){var h=t.getPixelIndex(r+s-n,i+o-n);a[0]+=t.bitmap.data[h]*e[s][o];a[1]+=t.bitmap.data[h+1]*e[s][o];a[2]+=t.bitmap.data[h+2]*e[s][o]}}return a}var o=function isDef(t){return typeof t!=="undefined"&&t!==null};function greyscale(t){this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){var i=parseInt(.2126*this.bitmap.data[r]+.7152*this.bitmap.data[r+1]+.0722*this.bitmap.data[r+2],10);this.bitmap.data[r]=i;this.bitmap.data[r+1]=i;this.bitmap.data[r+2]=i});if((0,s.isNodePattern)(t)){t.call(this,null,this)}return this}function mix(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:50;return{r:(e.r-t.r)*(r/100)+t.r,g:(e.g-t.g)*(r/100)+t.g,b:(e.b-t.b)*(r/100)+t.b}}function colorFn(t,e){var r=this;if(!t||!Array.isArray(t)){return s.throwError.call(this,"actions must be an array",e)}t=t.map(function(t){if(t.apply==="xor"||t.apply==="mix"){t.params[0]=(0,n["default"])(t.params[0]).toRgb()}return t});this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(i,o,h){var f={r:r.bitmap.data[h],g:r.bitmap.data[h+1],b:r.bitmap.data[h+2]};var l=function colorModifier(t,e){return r.constructor.limit255(f[t]+e)};t.forEach(function(t){if(t.apply==="mix"){f=mix(f,t.params[0],t.params[1])}else if(t.apply==="tint"){f=mix(f,{r:255,g:255,b:255},t.params[0])}else if(t.apply==="shade"){f=mix(f,{r:0,g:0,b:0},t.params[0])}else if(t.apply==="xor"){f={r:f.r^t.params[0].r,g:f.g^t.params[0].g,b:f.b^t.params[0].b}}else if(t.apply==="red"){f.r=l("r",t.params[0])}else if(t.apply==="green"){f.g=l("g",t.params[0])}else if(t.apply==="blue"){f.b=l("b",t.params[0])}else{var i;if(t.apply==="hue"){t.apply="spin"}f=(0,n["default"])(f);if(!f[t.apply]){return s.throwError.call(r,"action "+t.apply+" not supported",e)}f=(i=f)[t.apply].apply(i,(0,a["default"])(t.params)).toRgb()}});r.bitmap.data[h]=f.r;r.bitmap.data[h+1]=f.g;r.bitmap.data[h+2]=f.b});if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this}var h=function _default(){return{brightness:function brightness(t,e){if(typeof t!=="number"){return s.throwError.call(this,"val must be numbers",e)}if(t<-1||t>+1){return s.throwError.call(this,"val must be a number between -1 and +1",e)}this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(e,r,i){if(t<0){this.bitmap.data[i]=this.bitmap.data[i]*(1+t);this.bitmap.data[i+1]=this.bitmap.data[i+1]*(1+t);this.bitmap.data[i+2]=this.bitmap.data[i+2]*(1+t)}else{this.bitmap.data[i]=this.bitmap.data[i]+(255-this.bitmap.data[i])*t;this.bitmap.data[i+1]=this.bitmap.data[i+1]+(255-this.bitmap.data[i+1])*t;this.bitmap.data[i+2]=this.bitmap.data[i+2]+(255-this.bitmap.data[i+2])*t}});if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this},contrast:function contrast(t,e){if(typeof t!=="number"){return s.throwError.call(this,"val must be numbers",e)}if(t<-1||t>+1){return s.throwError.call(this,"val must be a number between -1 and +1",e)}var r=(t+1)/(1-t);function adjust(t){t=Math.floor(r*(t-127)+127);return t<0?0:t>255?255:t}this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){this.bitmap.data[r]=adjust(this.bitmap.data[r]);this.bitmap.data[r+1]=adjust(this.bitmap.data[r+1]);this.bitmap.data[r+2]=adjust(this.bitmap.data[r+2])});if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this},posterize:function posterize(t,e){if(typeof t!=="number"){return s.throwError.call(this,"n must be numbers",e)}if(t<2){t=2}this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(e,r,i){this.bitmap.data[i]=Math.floor(this.bitmap.data[i]/255*(t-1))/(t-1)*255;this.bitmap.data[i+1]=Math.floor(this.bitmap.data[i+1]/255*(t-1))/(t-1)*255;this.bitmap.data[i+2]=Math.floor(this.bitmap.data[i+2]/255*(t-1))/(t-1)*255});if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this},greyscale:greyscale,grayscale:greyscale,opacity:function opacity(t,e){if(typeof t!=="number")return s.throwError.call(this,"f must be a number",e);if(t<0||t>1)return s.throwError.call(this,"f must be a number from 0 to 1",e);this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(e,r,i){var a=this.bitmap.data[i+3]*t;this.bitmap.data[i+3]=a});if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this},sepia:function sepia(t){this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){var i=this.bitmap.data[r];var a=this.bitmap.data[r+1];var n=this.bitmap.data[r+2];i=i*.393+a*.769+n*.189;a=i*.349+a*.686+n*.168;n=i*.272+a*.534+n*.131;this.bitmap.data[r]=i<255?i:255;this.bitmap.data[r+1]=a<255?a:255;this.bitmap.data[r+2]=n<255?n:255});if((0,s.isNodePattern)(t)){t.call(this,null,this)}return this},fade:function fade(t,e){if(typeof t!=="number"){return s.throwError.call(this,"f must be a number",e)}if(t<0||t>1){return s.throwError.call(this,"f must be a number from 0 to 1",e)}this.opacity(1-t);if((0,s.isNodePattern)(e)){e.call(this,null,this)}return this},convolution:function convolution(t,e,r){if(typeof e==="function"&&typeof r==="undefined"){r=e;e=null}if(!e){e=this.constructor.EDGE_EXTEND}var i=Buffer.from(this.bitmap.data);var a=t.length;var n=t[0].length;var o=Math.floor(a/2);var h=Math.floor(n/2);var f=-o;var l=-h;var u;var c;var d;var p;var v;var m;var g;var b;var y;var E;this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(r,a,n){p=0;d=0;c=0;for(var s=f;s<=o;s++){for(var M=l;M<=h;M++){b=r+M;y=a+s;u=t[s+o][M+h];E=this.getPixelIndex(b,y,e);if(E===-1){g=0;m=0;v=0}else{v=this.bitmap.data[E+0];m=this.bitmap.data[E+1];g=this.bitmap.data[E+2]}c+=u*v;d+=u*m;p+=u*g}}if(c<0){c=0}if(d<0){d=0}if(p<0){p=0}if(c>255){c=255}if(d>255){d=255}if(p>255){p=255}i[n+0]=c;i[n+1]=d;i[n+2]=p});this.bitmap.data=i;if((0,s.isNodePattern)(r)){r.call(this,null,this)}return this},opaque:function opaque(t){this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){this.bitmap.data[r+3]=255});if((0,s.isNodePattern)(t)){t.call(this,null,this)}return this},pixelate:function pixelate(t,e,r,i,a,n){if(typeof e==="function"){n=e;a=null;i=null;r=null;e=null}else{if(typeof t!=="number"){return s.throwError.call(this,"size must be a number",n)}if(o(e)&&typeof e!=="number"){return s.throwError.call(this,"x must be a number",n)}if(o(r)&&typeof r!=="number"){return s.throwError.call(this,"y must be a number",n)}if(o(i)&&typeof i!=="number"){return s.throwError.call(this,"w must be a number",n)}if(o(a)&&typeof a!=="number"){return s.throwError.call(this,"h must be a number",n)}}var h=[[1/16,2/16,1/16],[2/16,4/16,2/16],[1/16,2/16,1/16]];e=e||0;r=r||0;i=o(i)?i:this.bitmap.width-e;a=o(a)?a:this.bitmap.height-r;var f=this.cloneQuiet();this.scanQuiet(e,r,i,a,function(e,r,i){e=t*Math.floor(e/t);r=t*Math.floor(r/t);var a=applyKernel(f,h,e,r);this.bitmap.data[i]=a[0];this.bitmap.data[i+1]=a[1];this.bitmap.data[i+2]=a[2]});if((0,s.isNodePattern)(n)){n.call(this,null,this)}return this},convolute:function convolute(t,e,r,i,a,n){if(!Array.isArray(t))return s.throwError.call(this,"the kernel must be an array",n);if(typeof e==="function"){n=e;e=null;r=null;i=null;a=null}else{if(o(e)&&typeof e!=="number"){return s.throwError.call(this,"x must be a number",n)}if(o(r)&&typeof r!=="number"){return s.throwError.call(this,"y must be a number",n)}if(o(i)&&typeof i!=="number"){return s.throwError.call(this,"w must be a number",n)}if(o(a)&&typeof a!=="number"){return s.throwError.call(this,"h must be a number",n)}}var h=(t.length-1)/2;e=o(e)?e:h;r=o(r)?r:h;i=o(i)?i:this.bitmap.width-e;a=o(a)?a:this.bitmap.height-r;var f=this.cloneQuiet();this.scanQuiet(e,r,i,a,function(e,r,i){var a=applyKernel(f,t,e,r);this.bitmap.data[i]=this.constructor.limit255(a[0]);this.bitmap.data[i+1]=this.constructor.limit255(a[1]);this.bitmap.data[i+2]=this.constructor.limit255(a[2])});if((0,s.isNodePattern)(n)){n.call(this,null,this)}return this},color:colorFn,colour:colorFn}};e["default"]=h;t.exports=e.default},991:function(t){"use strict";function ZStream(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}t.exports=ZStream},992:function(t,e,r){(function(){"use strict";var t,i,a,n,s=function(t,e){for(var r in e){if(o.call(e,r))t[r]=e[r]}function ctor(){this.constructor=t}ctor.prototype=e.prototype;t.prototype=new ctor;t.__super__=e.prototype;return t},o={}.hasOwnProperty;i=r(791);t=r(476);a=r(885);n=r(350);e.defaults=i.defaults;e.processors=n;e.ValidationError=function(t){s(ValidationError,t);function ValidationError(t){this.message=t}return ValidationError}(Error);e.Builder=t.Builder;e.Parser=a.Parser;e.parseString=a.parseString;e.parseStringPromise=a.parseStringPromise}).call(this)},993:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:true});e["default"]=void 0;var i=r(19);var a=function _default(){return{threshold:function threshold(t,e){var r=this;var a=t.max,n=t.replace,s=n===void 0?255:n,o=t.autoGreyscale,h=o===void 0?true:o;if(typeof a!=="number"){return i.throwError.call(this,"max must be a number",e)}if(typeof s!=="number"){return i.throwError.call(this,"replace must be a number",e)}if(typeof h!=="boolean"){return i.throwError.call(this,"autoGreyscale must be a boolean",e)}a=this.constructor.limit255(a);s=this.constructor.limit255(s);if(h){this.greyscale()}this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,i){var n=r.bitmap.data[i]<a?r.bitmap.data[i]:s;r.bitmap.data[i]=n;r.bitmap.data[i+1]=n;r.bitmap.data[i+2]=n});if((0,i.isNodePattern)(e)){e.call(this,null,this)}return this}}};e["default"]=a;t.exports=e.default},994:function(t){"use strict";function dePalette(t,e,r,i,a){var n=0;for(var s=0;s<i;s++){for(var o=0;o<r;o++){var h=a[t[n]];if(!h){throw new Error("index "+t[n]+" not in palette")}for(var f=0;f<4;f++){e[n+f]=h[f]}n+=4}}}function replaceTransparentColor(t,e,r,i,a){var n=0;for(var s=0;s<i;s++){for(var o=0;o<r;o++){var h=false;if(a.length===1){if(a[0]===t[n]){h=true}}else if(a[0]===t[n]&&a[1]===t[n+1]&&a[2]===t[n+2]){h=true}if(h){for(var f=0;f<4;f++){e[n+f]=0}}n+=4}}}function scaleDepth(t,e,r,i,a){var n=255;var s=Math.pow(2,a)-1;var o=0;for(var h=0;h<i;h++){for(var f=0;f<r;f++){for(var l=0;l<4;l++){e[o+l]=Math.floor(t[o+l]*n/s+.5)}o+=4}}}t.exports=function(t,e){var r=e.depth;var i=e.width;var a=e.height;var n=e.colorType;var s=e.transColor;var o=e.palette;var h=t;if(n===3){dePalette(t,h,i,a,o)}else{if(s){replaceTransparentColor(t,h,i,a,s)}if(r!==8){if(r===16){h=new JIMPBUffer(i*a*4)}scaleDepth(t,h,i,a,r)}}return h}},996:function(t,e,r){var i=r(108);var a=r(873);var n=r(705);var s=r(118);function _toConsumableArray(t){return i(t)||a(t)||n(t)||s()}t.exports=_toConsumableArray},999:function(t,e){"use strict";var r=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";function _has(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){var e=Array.prototype.slice.call(arguments,1);while(e.length){var r=e.shift();if(!r){continue}if(typeof r!=="object"){throw new TypeError(r+"must be non-object")}for(var i in r){if(_has(r,i)){t[i]=r[i]}}}return t};e.shrinkBuf=function(t,e){if(t.length===e){return t}if(t.subarray){return t.subarray(0,e)}t.length=e;return t};var i={arraySet:function(t,e,r,i,a){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),a);return}for(var n=0;n<i;n++){t[a+n]=e[r+n]}},flattenChunks:function(t){var e,r,i,a,n,s;i=0;for(e=0,r=t.length;e<r;e++){i+=t[e].length}s=new Uint8Array(i);a=0;for(e=0,r=t.length;e<r;e++){n=t[e];s.set(n,a);a+=n.length}return s}};var a={arraySet:function(t,e,r,i,a){for(var n=0;n<i;n++){t[a+n]=e[r+n]}},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){if(t){e.Buf8=Uint8Array;e.Buf16=Uint16Array;e.Buf32=Int32Array;e.assign(e,i)}else{e.Buf8=Array;e.Buf16=Array;e.Buf32=Array;e.assign(e,a)}};e.setTyped(r)}});