if((void 0===window||!window)&&"undefined"!=typeof self)var window=self;(function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e=void 0!==window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.jimp=t()}})(function(){var t;return function(){function t(e,r,i){function n(o,s){if(!r[o]){if(!e[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var l=r[o]={exports:{}};e[o][0].call(l.exports,function(t){var r=e[o][1][t];return n(r||t)},l,l.exports,t,e,r,i)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o=o?(n[i++]=parseInt(r/o,10),r%=o):i>0&&(n[i++]=0);s=i,u=this.dstAlphabet.slice(r,r+1).concat(u)}while(0!==i);return u},i.prototype.isValid=function(t){for(var e=0;e=0;s--)if(u[s]!==h[s])return!1;for(s=u.length-1;s>=0;s--)if(o=u[s],!d(t[o],e[o],r,i))return!1;return!0}function b(t,e,r){d(t,e,!0)&&f(t,e,r,"notDeepStrictEqual",b)}function g(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function _(t){var e;try{t()}catch(t){e=t}return e}function v(t,e,r,i){var n;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(i=r,r=null),n=_(e),i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),t&&!n&&f(n,r,"Missing expected exception"+i);var a="string"==typeof i,o=!t&&E.isError(n),s=!t&&n&&!r;if((o&&a&&g(n,r)||s)&&f(n,r,"Got unwanted exception"+i),t&&n&&r&&!g(n,r)||!t&&n)throw n}function y(t,e){t||f(t,!0,e,"==",y)}var w=t("object-assign"),E=t("util/"),x=Object.prototype.hasOwnProperty,S=Array.prototype.slice,k="foo"===function(){}.name,M=e.exports=c,A=/\s*function\s+([^\(\s]*)\s*/;M.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=l(this),this.generatedMessage=!0);var e=t.stackStartFunction||f;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var i=r.stack,n=s(e),a=i.indexOf("\n"+n);if(a>=0){var o=i.indexOf("\n",a+1);i=i.substring(o+1)}this.stack=i}}},E.inherits(M.AssertionError,Error),M.fail=f,M.ok=c,M.equal=function(t,e,r){t!=e&&f(t,e,r,"==",M.equal)},M.notEqual=function(t,e,r){t==e&&f(t,e,r,"!=",M.notEqual)},M.deepEqual=function(t,e,r){d(t,e,!1)||f(t,e,r,"deepEqual",M.deepEqual)},M.deepStrictEqual=function(t,e,r){d(t,e,!0)||f(t,e,r,"deepStrictEqual",M.deepStrictEqual)},M.notDeepEqual=function(t,e,r){d(t,e,!1)&&f(t,e,r,"notDeepEqual",M.notDeepEqual)},M.notDeepStrictEqual=b,M.strictEqual=function(t,e,r){t!==e&&f(t,e,r,"===",M.strictEqual)},M.notStrictEqual=function(t,e,r){t===e&&f(t,e,r,"!==",M.notStrictEqual)},M.throws=function(t,e,r){v(!0,t,e,r)},M.doesNotThrow=function(t,e,r){v(!1,t,e,r)},M.ifError=function(t){if(t)throw t},M.strict=w(y,M,{equal:M.strictEqual,deepEqual:M.deepStrictEqual,notEqual:M.notStrictEqual,notDeepEqual:M.notDeepStrictEqual}),M.strict.strict=M.strict;var I=Object.keys||function(t){var e=[];for(var r in t)x.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{"object-assign":84,"util/":28}],26:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],27:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],28:[function(t,e,r){(function(e,i){function n(t,e){var i={seen:[],stylize:o};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),m(e)?i.showHidden=e:e&&r._extend(i,e),w(i.showHidden)&&(i.showHidden=!1),w(i.depth)&&(i.depth=2),w(i.colors)&&(i.colors=!1),w(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=a),u(i,t,i.depth)}function a(t,e){var r=n.styles[e];return r?"["+n.colors[r][0]+"m"+t+"["+n.colors[r][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,e,i){if(t.customInspect&&e&&M(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(i,t);return v(n)||(n=u(t,n,i)),n}var a=h(t,e);if(a)return a;var o=Object.keys(e),m=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),k(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(e);if(0===o.length){if(M(e)){var b=e.name?": "+e.name:"";return t.stylize("[Function"+b+"]","special")}if(E(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(S(e))return t.stylize(Date.prototype.toString.call(e),"date");if(k(e))return l(e)}var g,_="",y=!1,w=["{","}"];if(p(e)&&(y=!0,w=["[","]"]),M(e)){var x=e.name?": "+e.name:"";_=" [Function"+x+"]"}return E(e)&&(_=" "+RegExp.prototype.toString.call(e)),S(e)&&(_=" "+Date.prototype.toUTCString.call(e)),k(e)&&(_=" "+l(e)),0!==o.length||y&&0!=e.length?i<0?E(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),g=y?f(t,e,i,m,o):o.map(function(r){return c(t,e,i,m,r,y)}),t.seen.pop(),d(g,_,w)):w[0]+_+w[1]}function h(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return _(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,i,n){for(var a=[],o=0,s=e.length;o-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),w(o)){if(a&&n.match(/^\d+$/))return s;o=JSON.stringify(""+n),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t,e,r){var i=t.reduce(function(t,e){return 0,e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function b(t){return null===t}function g(t){return null==t}function _(t){return"number"==typeof t}function v(t){return"string"==typeof t}function y(t){return"symbol"==typeof t}function w(t){return void 0===t}function E(t){return x(t)&&"[object RegExp]"===I(t)}function x(t){return"object"==typeof t&&null!==t}function S(t){return x(t)&&"[object Date]"===I(t)}function k(t){return x(t)&&("[object Error]"===I(t)||t instanceof Error)}function M(t){return"function"==typeof t}function A(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function I(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}function R(){var t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":");return[t.getDate(),B[t.getMonth()],e].join(" ")}function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var C=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}}),s=i[r];r0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function n(t){var e=i(t),r=e[0],n=e[1];return 3*(r+n)/4-n}function a(t,e,r){return 3*(e+r)/4-r}function o(t){var e,r,n=i(t),o=n[0],s=n[1],u=new c(a(t,o,s)),h=0,l=s>0?o-4:o;for(r=0;r>16&255,u[h++]=e>>8&255,u[h++]=255&e;return 2===s&&(e=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,u[h++]=255&e),1===s&&(e=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e),u}function s(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function u(t,e,r){for(var i,n=[],a=e;as?s:o+a));return 1===i?(e=t[r-1],n.push(l[e>>2]+l[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],n.push(l[e>>10]+l[e>>4&63]+l[e<<2&63]+"=")),n.join("")}r.byteLength=n,r.toByteArray=o,r.fromByteArray=h;for(var l=[],f=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,m=d.length;p=0?this.height-1:-this.height;for(r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n>7-s&1];this.data[o+4*s]=0,this.data[o+4*s+1]=u.blue,this.data[o+4*s+2]=u.green,this.data[o+4*s+3]=u.red}0!=e&&(this.pos+=4-e)}},r.prototype.bit4=function(){if(2==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0,r=!1;t>4),1&u&&u+1>1&1)&&this.pos++}}else for(u=0;u>4),r=!r}function h(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 l=Math.ceil(this.width/2),f=l%4;for(o=this.height-1;o>=0;o--){var c=this.bottom_up?o:this.height-1-o;for(a=0;a>4,p=15&n,m=this.palette[d];if(this.data[t]=0,this.data[t+1]=m.blue,this.data[t+2]=m.green,this.data[t+3]=m.red,2*a+1>=this.width)break;m=this.palette[p],this.data[t+4]=0,this.data[t+4+1]=m.blue,this.data[t+4+2]=m.green,this.data[t+4+3]=m.red}0!=f&&(this.pos+=4-f)}}},r.prototype.bit8=function(){if(1==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0;t=0;a--){var l=this.bottom_up?a:this.height-1-a;for(n=0;n=0;i--){for(var n=this.bottom_up?i:this.height-1-i,a=0;a>5&r)/r*255|0,h=(o>>10&r)/r*255|0,l=o>>15?255:0,f=n*this.width*4+4*a;this.data[f]=l,this.data[f+1]=s,this.data[f+2]=u,this.data[f+3]=h}this.pos+=t}},r.prototype.bit16=function(){var t=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,3==this.compress&&(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 e=[0,0,0],r=0;r<16;r++)this.maskRed>>r&1&&e[0]++,this.maskGreen>>r&1&&e[1]++,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--){for(var n=this.bottom_up?i:this.height-1-i,a=0;a>e[1],h=(o&this.maskRed)>>e[2],l=n*this.width*4+4*a;this.data[l]=0,this.data[l+1]=s,this.data[l+2]=u,this.data[l+3]=h}this.pos+=t}},r.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r=0;t--)for(e=this.bottom_up?t:this.height-1-t,r=0;r0){var s=this.pos+n*i+3*this.width;e.fill(0,s,s+this.extraBytes)}}return e},e.exports=function(t,e){void 0===e&&(e=100);var i=new r(t),n=i.encode();return{data:n,width:t.width,height:t.height}}}).call(this,t("buffer").Buffer)},{buffer:48}],33:[function(t,e,r){},{}],34:[function(t,e,r){(function(e,i){"use strict";function n(t){if("number"!=typeof t||tr.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}var a=t("assert"),o=t("pako/lib/zlib/zstream"),s=t("pako/lib/zlib/deflate.js"),u=t("pako/lib/zlib/inflate.js"),h=t("pako/lib/zlib/constants");for(var l in h)r[l]=h[l];r.NONE=0,r.DEFLATE=1,r.INFLATE=2,r.GZIP=3,r.GUNZIP=4,r.DEFLATERAW=5,r.INFLATERAW=6,r.UNZIP=7;var f=31,c=139;n.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,a(this.init_done,"close before init"),a(this.mode<=r.UNZIP),this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||u.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},n.prototype.write=function(t,e,r,i,n,a,o){return this._write(!0,t,e,r,i,n,a,o)},n.prototype.writeSync=function(t,e,r,i,n,a,o){return this._write(!1,t,e,r,i,n,a,o)},n.prototype._write=function(t,n,o,s,u,h,l,f){if(a.equal(arguments.length,8),a(this.init_done,"write before init"),a(this.mode!==r.NONE,"already finalized"),a.equal(!1,this.write_in_progress,"write already in progress"),a.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,a.equal(!1,void 0===n,"must provide flush value"),this.write_in_progress=!0,n!==r.Z_NO_FLUSH&&n!==r.Z_PARTIAL_FLUSH&&n!==r.Z_SYNC_FLUSH&&n!==r.Z_FULL_FLUSH&&n!==r.Z_FINISH&&n!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=i.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=h,this.strm.next_out=l,this.flush=n,!t)return this._process(),this._checkError()?this._afterSync():void 0;var c=this;return e.nextTick(function(){c._process(),c._after()}),this},n.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},n.prototype._process=function(){var t=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(this.strm.input[t]!==f){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;this.strm.input[t]===c?(this.gzip_id_bytes_read=2,this.mode=r.GUNZIP):this.mode=r.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary), this.err===r.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===r.Z_DATA_ERROR&&(this.err=r.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===r.GUNZIP&&this.err===r.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},n.prototype._checkError=function(){switch(this.err){case r.Z_OK:case r.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===r.Z_FINISH)return this._error("unexpected end of file"),!1;break;case r.Z_STREAM_END:break;case r.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},n.prototype._after=function(){if(this._checkError()){var t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},n.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},n.prototype.init=function(t,e,i,n,o){a(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),a(t>=8&&t<=15,"invalid windowBits"),a(e>=-1&&e<=9,"invalid compression level"),a(i>=1&&i<=9,"invalid memlevel"),a(n===r.Z_FILTERED||n===r.Z_HUFFMAN_ONLY||n===r.Z_RLE||n===r.Z_FIXED||n===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(e,t,i,n,o),this._setDictionary()},n.prototype.params=function(){throw new Error("deflateParams Not supported")},n.prototype.reset=function(){this._reset(),this._setDictionary()},n.prototype._init=function(t,e,i,n,a){switch(this.level=t,this.windowBits=e,this.memLevel=i,this.strategy=n,this.flush=r.Z_NO_FLUSH,this.err=r.Z_OK,this.mode!==r.GZIP&&this.mode!==r.GUNZIP||(this.windowBits+=16),this.mode===r.UNZIP&&(this.windowBits+=32),this.mode!==r.DEFLATERAW&&this.mode!==r.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==r.Z_OK&&this._error("Init error"),this.dictionary=a,this.write_in_progress=!1,this.init_done=!0},n.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==r.Z_OK&&this._error("Failed to set dictionary")}},n.prototype._reset=function(){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:case r.GZIP:this.err=s.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=n}).call(this,t("_process"),t("buffer").Buffer)},{_process:133,assert:25,buffer:48,"pako/lib/zlib/constants":38,"pako/lib/zlib/deflate.js":40,"pako/lib/zlib/inflate.js":42,"pako/lib/zlib/zstream":46}],35:[function(t,e,r){(function(e){"use strict";function i(t,e,r){function i(){for(var e;null!==(e=t.read());)o.push(e),s+=e.length;t.once("readable",i)}function n(e){t.removeListener("end",a),t.removeListener("readable",i),r(e)}function a(){var e,i=null;s>=w?i=new RangeError(E):e=b.concat(o,s),o=[],t.close(),r(i,e)}var o=[],s=0;t.on("error",n),t.on("end",a),t.end(e),i()}function n(t,e){if("string"==typeof e&&(e=b.from(e)),!b.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function a(t){if(!(this instanceof a))return new a(t);d.call(this,t,_.DEFLATE)}function o(t){if(!(this instanceof o))return new o(t);d.call(this,t,_.INFLATE)}function s(t){if(!(this instanceof s))return new s(t);d.call(this,t,_.GZIP)}function u(t){if(!(this instanceof u))return new u(t);d.call(this,t,_.GUNZIP)}function h(t){if(!(this instanceof h))return new h(t);d.call(this,t,_.DEFLATERAW)}function l(t){if(!(this instanceof l))return new l(t);d.call(this,t,_.INFLATERAW)}function f(t){if(!(this instanceof f))return new f(t);d.call(this,t,_.UNZIP)}function c(t){return t===_.Z_NO_FLUSH||t===_.Z_PARTIAL_FLUSH||t===_.Z_SYNC_FLUSH||t===_.Z_FULL_FLUSH||t===_.Z_FINISH||t===_.Z_BLOCK}function d(t,e){var i=this;if(this._opts=t=t||{},this._chunkSize=t.chunkSize||r.Z_DEFAULT_CHUNK,g.call(this,t),t.flush&&!c(t.flush))throw new Error("Invalid flush flag: "+t.flush);if(t.finishFlush&&!c(t.finishFlush))throw new Error("Invalid flush flag: "+t.finishFlush);if(this._flushFlag=t.flush||_.Z_NO_FLUSH,this._finishFlushFlag=void 0!==t.finishFlush?t.finishFlush:_.Z_FINISH,t.chunkSize&&(t.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=r.Z_FILTERED&&t.strategy!=r.Z_HUFFMAN_ONLY&&t.strategy!=r.Z_RLE&&t.strategy!=r.Z_FIXED&&t.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!b.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new _.Zlib(e);var n=this;this._hadError=!1,this._handle.onerror=function(t,e){p(n),n._hadError=!0;var i=new Error(t);i.errno=e,i.code=r.codes[e],n.emit("error",i)};var a=r.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(a=t.level);var o=r.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(o=t.strategy),this._handle.init(t.windowBits||r.Z_DEFAULT_WINDOWBITS,a,t.memLevel||r.Z_DEFAULT_MEMLEVEL,o,t.dictionary),this._buffer=b.allocUnsafe(this._chunkSize),this._offset=0,this._level=a,this._strategy=o,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!i._handle},configurable:!0,enumerable:!0})}function p(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function m(t){t.emit("close")}var b=t("buffer").Buffer,g=t("stream").Transform,_=t("./binding"),v=t("util"),y=t("assert").ok,w=t("buffer").kMaxLength,E="Cannot create final Buffer. It would be larger than 0x"+w.toString(16)+" bytes";_.Z_MIN_WINDOWBITS=8,_.Z_MAX_WINDOWBITS=15,_.Z_DEFAULT_WINDOWBITS=15,_.Z_MIN_CHUNK=64,_.Z_MAX_CHUNK=1/0,_.Z_DEFAULT_CHUNK=16384,_.Z_MIN_MEMLEVEL=1,_.Z_MAX_MEMLEVEL=9,_.Z_DEFAULT_MEMLEVEL=8,_.Z_MIN_LEVEL=-1,_.Z_MAX_LEVEL=9,_.Z_DEFAULT_LEVEL=_.Z_DEFAULT_COMPRESSION;for(var x=Object.keys(_),S=0;Sr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);if(i!=r.Z_FILTERED&&i!=r.Z_HUFFMAN_ONLY&&i!=r.Z_RLE&&i!=r.Z_FIXED&&i!=r.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+i);if(this._level!==t||this._strategy!==i){var a=this;this.flush(_.Z_SYNC_FLUSH,function(){y(a._handle,"zlib binding closed"),a._handle.params(t,i),a._hadError||(a._level=t,a._strategy=i,n&&n())})}else e.nextTick(n)},d.prototype.reset=function(){return y(this._handle,"zlib binding closed"),this._handle.reset()},d.prototype._flush=function(t){this._transform(b.alloc(0),"",t)},d.prototype.flush=function(t,r){var i=this,n=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=_.Z_FULL_FLUSH),n.ended?r&&e.nextTick(r):n.ending?r&&this.once("end",r):n.needDrain?r&&this.once("drain",function(){return i.flush(t,r)}):(this._flushFlag=t,this.write(b.alloc(0),"",r))},d.prototype.close=function(t){p(this,t),e.nextTick(m,this)},d.prototype._transform=function(t,e,r){var i,n=this._writableState,a=n.ending||n.ended,o=a&&(!t||n.length===t.length);return null===t||b.isBuffer(t)?this._handle?(o?i=this._finishFlushFlag:(i=this._flushFlag,t.length>=n.length&&(this._flushFlag=this._opts.flush||_.Z_NO_FLUSH)),void this._processChunk(t,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},d.prototype._processChunk=function(t,e,r){function i(h,c){if(this&&(this.buffer=null,this.callback=null),!s._hadError){var d=a-c;if(y(d>=0,"have should not go down"),d>0){var p=s._buffer.slice(s._offset,s._offset+d);s._offset+=d,u?s.push(p):(l.push(p),f+=p.length)}if((0===c||s._offset>=s._chunkSize)&&(a=s._chunkSize,s._offset=0,s._buffer=b.allocUnsafe(s._chunkSize)),0===c){if(o+=n-h,n=h,!u)return!0;var m=s._handle.write(e,t,o,n,s._buffer,s._offset,s._chunkSize);return m.callback=i,void(m.buffer=t)}if(!u)return!1;r()}}var n=t&&t.length,a=this._chunkSize-this._offset,o=0,s=this,u="function"==typeof r;if(!u){var h,l=[],f=0;this.on("error",function(t){h=t}),y(this._handle,"zlib binding closed");do{var c=this._handle.writeSync(e,t,o,n,this._buffer,this._offset,a)}while(!this._hadError&&i(c[0],c[1]));if(this._hadError)throw h;if(f>=w)throw p(this),new RangeError(E);var d=b.concat(l,f);return p(this),d}y(this._handle,"zlib binding closed");var m=this._handle.write(e,t,o,n,this._buffer,this._offset,a);m.buffer=t,m.callback=i},v.inherits(a,d),v.inherits(o,d),v.inherits(s,d),v.inherits(u,d),v.inherits(h,d),v.inherits(l,d),v.inherits(f,d)}).call(this,t("_process"))},{"./binding":34,_process:133,assert:25,buffer:48,stream:155,util:186}],36:[function(t,e,r){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var a={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+i),n);else for(var a=0;a>>16&65535|0,o=0;0!==r;){o=r>2e3?2e3:r,r-=o;do{n=n+e[i++]|0,a=a+n|0}while(--o);n%=65521,a%=65521}return n|a<<16|0}e.exports=i},{}],38:[function(t,e,r){"use strict";e.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}},{}],39:[function(t,e,r){"use strict";function i(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}function n(t,e,r,i){var n=a,o=i+r;t^=-1;for(var s=i;s>>8^n[255&(t^e[s])];return-1^t}var a=i();e.exports=n},{}],40:[function(t,e,r){"use strict";function i(t,e){return t.msg=L[e],e}function n(t){return(t<<1)-(t>4?9:0)}function a(t){for(var e=t.length;--e>=0;)t[e]=0}function o(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(R.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,0===e.pending&&(e.pending_out=0))}function s(t,e){P._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,o(t.strm)}function u(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function l(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,R.arraySet(e,t.input,t.next_in,n,r),1===t.state.wrap?t.adler=C(t.adler,e,n,r):2===t.state.wrap&&(t.adler=O(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var r,i,n=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,l=t.w_mask,f=t.prev,c=t.strstart+lt,d=h[a+o-1],p=h[a+o];t.prev_length>=t.good_match&&(n>>=2),s>t.lookahead&&(s=t.lookahead);do{if(r=e,h[r+o]===p&&h[r+o-1]===d&&h[r]===h[a]&&h[++r]===h[a+1]){a+=2,r++;do{}while(h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&ao){if(t.match_start=e,o=i,i>=s)break;d=h[a+o-1],p=h[a+o]}}}while((e=f[e&l])>u&&0!=--n);return o<=t.lookahead?o:t.lookahead}function c(t){var e,r,i,n,a,o=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=o+(o-ft)){R.arraySet(t.window,t.window,o,o,0),t.match_start-=o,t.strstart-=o,t.block_start-=o,r=t.hash_size,e=r;do{i=t.head[--e],t.head[e]=i>=o?i-o:0}while(--r);r=o,e=r;do{i=t.prev[--e],t.prev[e]=i>=o?i-o:0}while(--r);n+=o}if(0===t.strm.avail_in)break;if(r=l(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=ht)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(c(t),0===t.lookahead&&e===B)return yt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,s(t,!1),0===t.strm.avail_out))return yt;if(t.strstart-t.block_start>=t.w_size-ft&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?Et:xt):(t.strstart>t.block_start&&(s(t,!1),t.strm.avail_out),yt)}function p(t,e){for(var r,i;;){if(t.lookahead=ht&&(t.ins_h=(t.ins_h<=ht)if(i=P._tr_tally(t,t.strstart-t.match_start,t.match_length-ht),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ht){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=ht&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=ht-1)),t.prev_length>=ht&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ht,i=P._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ht),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<=ht&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=t.strstart+lt;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]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ht?(r=P._tr_tally(t,1,t.match_length-ht),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=P._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?Et:xt):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?yt:wt}function g(t,e){for(var r;;){if(0===t.lookahead&&(c(t),0===t.lookahead)){if(e===B)return yt;break}if(t.match_length=0,r=P._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?Et:xt):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?yt:wt}function _(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}function v(t){t.window_size=2*t.w_size,a(t.head),t.max_lazy_match=T[t.level].max_lazy,t.good_match=T[t.level].good_length,t.nice_match=T[t.level].nice_length,t.max_chain_length=T[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ht-1,t.match_available=0,t.ins_h=0}function y(){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=K,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 R.Buf16(2*st),this.dyn_dtree=new R.Buf16(2*(2*at+1)),this.bl_tree=new R.Buf16(2*(2*ot+1)),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(ut+1),this.heap=new R.Buf16(2*nt+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*nt+1),a(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 w(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=J,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?dt:_t,t.adler=2===e.wrap?0:1,e.last_flush=B,P._tr_init(e),U):i(t,G)}function E(t){var e=w(t);return e===U&&v(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?G:(t.state.gzhead=e,U):G}function S(t,e,r,n,a,o){if(!t)return G;var s=1;if(e===W&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),a<1||a>$||r!==K||n<8||n>15||e<0||e>9||o<0||o>X)return i(t,G);8===n&&(n=9);var u=new y;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<j||e<0)return t?i(t,G):G;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||s.status===vt&&e!==z)return i(t,0===t.avail_out?q:G);if(s.strm=t,r=s.last_flush,s.last_flush=e,s.status===dt)if(2===s.wrap)t.adler=0,u(s,31),u(s,139),u(s,8),s.gzhead?(u(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),u(s,255&s.gzhead.time),u(s,s.gzhead.time>>8&255),u(s,s.gzhead.time>>16&255),u(s,s.gzhead.time>>24&255),u(s,9===s.level?2:s.strategy>=Y||s.level<2?4:0),u(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(u(s,255&s.gzhead.extra.length),u(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=O(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=pt):(u(s,0),u(s,0),u(s,0),u(s,0),u(s,0),u(s,9===s.level?2:s.strategy>=Y||s.level<2?4:0),u(s,St),s.status=_t);else{var c=K+(s.w_bits-8<<4)<<8,d=-1;d=s.strategy>=Y||s.level<2?0:s.level<6?1:6===s.level?2:3,c|=d<<6,0!==s.strstart&&(c|=ct),c+=31-c%31,s.status=_t,h(s,c),0!==s.strstart&&(h(s,t.adler>>>16),h(s,65535&t.adler)),t.adler=1}if(s.status===pt)if(s.gzhead.extra){for(l=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>l&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),o(t),l=s.pending,s.pending!==s.pending_buf_size));)u(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>l&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=mt)}else s.status=mt;if(s.status===mt)if(s.gzhead.name){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),o(t),l=s.pending,s.pending===s.pending_buf_size)){f=1;break}f=s.gzindexl&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),0===f&&(s.gzindex=0,s.status=bt)}else s.status=bt;if(s.status===bt)if(s.gzhead.comment){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),o(t),l=s.pending,s.pending===s.pending_buf_size)){f=1;break}f=s.gzindexl&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),0===f&&(s.status=gt)}else s.status=gt;if(s.status===gt&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&o(t),s.pending+2<=s.pending_buf_size&&(u(s,255&t.adler),u(s,t.adler>>8&255),t.adler=0,s.status=_t)):s.status=_t),0!==s.pending){if(o(t),0===t.avail_out)return s.last_flush=-1,U}else if(0===t.avail_in&&n(e)<=n(r)&&e!==z)return i(t,q);if(s.status===vt&&0!==t.avail_in)return i(t,q);if(0!==t.avail_in||0!==s.lookahead||e!==B&&s.status!==vt){var p=s.strategy===Y?g(s,e):s.strategy===V?b(s,e):T[s.level].func(s,e);if(p!==Et&&p!==xt||(s.status=vt),p===yt||p===Et)return 0===t.avail_out&&(s.last_flush=-1),U;if(p===wt&&(e===D?P._tr_align(s):e!==j&&(P._tr_stored_block(s,0,0,!1),e===N&&(a(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),o(t),0===t.avail_out))return s.last_flush=-1,U}return e!==z?U:s.wrap<=0?F:(2===s.wrap?(u(s,255&t.adler),u(s,t.adler>>8&255),u(s,t.adler>>16&255),u(s,t.adler>>24&255),u(s,255&t.total_in),u(s,t.total_in>>8&255),u(s,t.total_in>>16&255),u(s,t.total_in>>24&255)):(h(s,t.adler>>>16),h(s,65535&t.adler)),o(t),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?U:F)}function A(t){var e;return t&&t.state?(e=t.state.status,e!==dt&&e!==pt&&e!==mt&&e!==bt&&e!==gt&&e!==_t&&e!==vt?i(t,G):(t.state=null,e===_t?i(t,H):U)):G}function I(t,e){var r,i,n,o,s,u,h,l,f=e.length;if(!t||!t.state)return G;if(r=t.state,o=r.wrap,2===o||1===o&&r.status!==dt||r.lookahead)return G;for(1===o&&(t.adler=C(t.adler,e,f,0)),r.wrap=0,f>=r.w_size&&(0===o&&(a(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new R.Buf8(r.w_size),R.arraySet(l,e,f-r.w_size,r.w_size,0),e=l,f=r.w_size),s=t.avail_in,u=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,c(r);r.lookahead>=ht;){i=r.strstart,n=r.lookahead-(ht-1);do{r.ins_h=(r.ins_h<>>24,m>>>=E,b-=E,E=w>>>16&255,0===E)I[s++]=65535&w;else{if(!(16&E)){if(0==(64&E)){w=g[(65535&w)+(m&(1<>>=E,b-=E),b<15&&(m+=A[a++]<>>24,m>>>=E,b-=E,E=w>>>16&255,!(16&E)){if(0==(64&E)){w=_[(65535&w)+(m&(1<l){t.msg="invalid distance too far back",r.mode=i;break t}if(m>>>=E,b-=E,E=s-u,S>E){if(E=S-E,E>c&&r.sane){t.msg="invalid distance too far back",r.mode=i;break t}if(k=0,M=p,0===d){if(k+=f-E,E2;)I[s++]=M[k++],I[s++]=M[k++],I[s++]=M[k++],x-=3;x&&(I[s++]=M[k++],x>1&&(I[s++]=M[k++]))}else{k=s-S;do{I[s++]=I[k++],I[s++]=I[k++],I[s++]=I[k++],x-=3}while(x>2);x&&(I[s++]=I[k++],x>1&&(I[s++]=I[k++]))}break}}break}}while(a>3,a-=x,b-=x<<3,m&=(1<>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,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 _.Buf16(320),this.work=new _.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=N,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new _.Buf32(mt),e.distcode=e.distdyn=new _.Buf32(bt),e.sane=1,e.back=-1,T):C}function o(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,a(t)):C}function s(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?C:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,o(t))):C}function u(t,e){var r,i;return t?(i=new n,t.state=i,i.window=null,r=s(t,e),r!==T&&(t.state=null),r):C}function h(t){return u(t,_t)}function l(t){if(vt){var e;for(b=new _.Buf32(512),g=new _.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(E(S,t.lens,0,288,b,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;E(k,t.lens,0,32,g,0,t.work,{bits:5}),vt=!1}t.lencode=b,t.lenbits=9,t.distcode=g,t.distbits=5}function f(t,e,r,i){var n,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(_.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),_.arraySet(a.window,e,r-i,n,a.wnext),i-=n,i?(_.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=y(r.check,At,2,0),c=0,d=0,r.mode=z;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=ct;break}if((15&c)!==D){t.msg="unknown compression method",r.mode=ct;break}if(c>>>=4,d-=4,Et=8+(15&c),0===r.wbits)r.wbits=Et;else if(Et>r.wbits){t.msg="invalid window size",r.mode=ct;break}r.dmax=1<>8&1),512&r.flags&&(At[0]=255&c,At[1]=c>>>8&255,r.check=y(r.check,At,2,0)),c=0,d=0,r.mode=j;case j:for(;d<32;){if(0===u)break t;u--,c+=n[o++]<>>8&255,At[2]=c>>>16&255,At[3]=c>>>24&255,r.check=y(r.check,At,4,0)),c=0,d=0,r.mode=U;case U:for(;d<16;){if(0===u)break t;u--,c+=n[o++]<>8),512&r.flags&&(At[0]=255&c,At[1]=c>>>8&255,r.check=y(r.check,At,2,0)),c=0,d=0,r.mode=F;case F:if(1024&r.flags){for(;d<16;){if(0===u)break t;u--,c+=n[o++]<>>8&255,r.check=y(r.check,At,2,0)),c=0,d=0}else r.head&&(r.head.extra=null);r.mode=G;case G:if(1024&r.flags&&(b=r.length,b>u&&(b=u),b&&(r.head&&(Et=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),_.arraySet(r.head.extra,n,o,b,Et)),512&r.flags&&(r.check=y(r.check,n,b,o)),u-=b,o+=b,r.length-=b),r.length))break t;r.length=0,r.mode=H;case H:if(2048&r.flags){if(0===u)break t;b=0;do{Et=n[o+b++],r.head&&Et&&r.length<65536&&(r.head.name+=String.fromCharCode(Et))}while(Et&&b>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=V;break;case Z:for(;d<32;){if(0===u)break t;u--,c+=n[o++]<>>=7&d,d-=7&d,r.mode=ht;break}for(;d<3;){if(0===u)break t;u--,c+=n[o++]<>>=1,d-=1,3&c){case 0:r.mode=Q;break;case 1:if(l(r),r.mode=rt,e===I){c>>>=2,d-=2;break t}break;case 2:r.mode=$;break;case 3:t.msg="invalid block type",r.mode=ct}c>>>=2,d-=2;break;case Q:for(c>>>=7&d,d-=7&d;d<32;){if(0===u)break t;u--,c+=n[o++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=ct;break}if(r.length=65535&c,c=0,d=0,r.mode=J,e===I)break t;case J:r.mode=K;case K:if(b=r.length,b){if(b>u&&(b=u),b>h&&(b=h),0===b)break t;_.arraySet(a,n,o,b,s),u-=b,o+=b,h-=b,s+=b,r.length-=b;break}r.mode=V;break;case $:for(;d<14;){if(0===u)break t;u--,c+=n[o++]<>>=5,d-=5,r.ndist=1+(31&c),c>>>=5,d-=5,r.ncode=4+(15&c),c>>>=4,d-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=ct;break}r.have=0,r.mode=tt;case tt:for(;r.have>>=3,d-=3}for(;r.have<19;)r.lens[It[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,St={bits:r.lenbits},xt=E(x,r.lens,0,19,r.lencode,0,r.work,St),r.lenbits=St.bits,xt){t.msg="invalid code lengths set",r.mode=ct;break}r.have=0,r.mode=et;case et:for(;r.have>>24,gt=Mt>>>16&255,_t=65535&Mt,!(bt<=d);){if(0===u)break t;u--,c+=n[o++]<>>=bt,d-=bt,r.lens[r.have++]=_t;else{if(16===_t){for(kt=bt+2;d>>=bt,d-=bt,0===r.have){t.msg="invalid bit length repeat",r.mode=ct;break}Et=r.lens[r.have-1],b=3+(3&c),c>>>=2,d-=2}else if(17===_t){for(kt=bt+3;d>>=bt,d-=bt,Et=0,b=3+(7&c),c>>>=3,d-=3}else{for(kt=bt+7;d>>=bt,d-=bt,Et=0,b=11+(127&c),c>>>=7,d-=7}if(r.have+b>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ct;break}for(;b--;)r.lens[r.have++]=Et}}if(r.mode===ct)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=ct;break}if(r.lenbits=9,St={bits:r.lenbits},xt=E(S,r.lens,0,r.nlen,r.lencode,0,r.work,St),r.lenbits=St.bits,xt){t.msg="invalid literal/lengths set",r.mode=ct;break}if(r.distbits=6,r.distcode=r.distdyn,St={bits:r.distbits},xt=E(k,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,St),r.distbits=St.bits,xt){t.msg="invalid distances set",r.mode=ct;break}if(r.mode=rt,e===I)break t;case rt:r.mode=it;case it:if(u>=6&&h>=258){t.next_out=s,t.avail_out=h,t.next_in=o,t.avail_in=u,r.hold=c,r.bits=d,w(t,m),s=t.next_out,a=t.output,h=t.avail_out,o=t.next_in,n=t.input,u=t.avail_in,c=r.hold,d=r.bits,r.mode===V&&(r.back=-1);break}for(r.back=0;Mt=r.lencode[c&(1<>>24,gt=Mt>>>16&255,_t=65535&Mt,!(bt<=d);){if(0===u)break t;u--,c+=n[o++]<>vt)],bt=Mt>>>24,gt=Mt>>>16&255,_t=65535&Mt,!(vt+bt<=d);){if(0===u)break t;u--,c+=n[o++]<>>=vt,d-=vt,r.back+=vt}if(c>>>=bt,d-=bt,r.back+=bt,r.length=_t,0===gt){r.mode=ut;break}if(32>){r.back=-1,r.mode=V;break}if(64>){t.msg="invalid literal/length code",r.mode=ct;break}r.extra=15>,r.mode=nt;case nt:if(r.extra){for(kt=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=at;case at:for(;Mt=r.distcode[c&(1<>>24,gt=Mt>>>16&255,_t=65535&Mt,!(bt<=d);){if(0===u)break t;u--,c+=n[o++]<>vt)],bt=Mt>>>24,gt=Mt>>>16&255,_t=65535&Mt,!(vt+bt<=d);){if(0===u)break t;u--,c+=n[o++]<>>=vt,d-=vt,r.back+=vt}if(c>>>=bt,d-=bt,r.back+=bt,64>){t.msg="invalid distance code",r.mode=ct;break}r.offset=_t,r.extra=15>,r.mode=ot;case ot:if(r.extra){for(kt=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=ct;break}r.mode=st;case st:if(0===h)break t;if(b=m-h,r.offset>b){if(b=r.offset-b,b>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ct;break}b>r.wnext?(b-=r.wnext,g=r.wsize-b):g=r.wnext-b,b>r.length&&(b=r.length),mt=r.window}else mt=a,g=s-r.offset,b=r.length;b>h&&(b=h),h-=b,r.length-=b;do{a[s++]=mt[g++]}while(--b);0===r.length&&(r.mode=it);break;case ut:if(0===h)break t;a[s++]=r.length,h--,r.mode=it;break;case ht:if(r.wrap){for(;d<32;){if(0===u)break t;u--,c|=n[o++]<=1&&0===F[C];C--);if(O>C&&(O=C),0===C)return m[b++]=20971520,m[b++]=20971520,_.bits=1,0;for(P=1;P0&&(t===s||1!==C))return-1;for(G[1]=0,T=1;Ta||t===h&&N>o)return 1;for(;;){k=T-B,g[R]S?(M=H[q+g[R]],A=j[U+g[R]]):(M=96,A=0),v=1<>B)+y]=k<<24|M<<16|A|0}while(0!==y);for(v=1<>=1;if(0!==v?(z&=v-1,z+=v):z=0,R++,0==--F[T]){if(T===C)break;T=e[r+g[R]]}if(T>O&&(z&E)!==w){for(0===B&&(B=O),x+=P,L=T-B,D=1<a||t===h&&N>o)return 1;w=z&E,m[w]=O<<24|L<<16|x-b|0}}return 0!==z&&(m[x+z]=T-B<<24|64<<16|0),_.bits=O,0}},{"../utils/common":36}],44:[function(t,e,r){"use strict";e.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"}},{}],45:[function(t,e,r){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function a(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function o(t){return t<256?ut[t]:ut[256+(t>>>7)]}function s(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function u(t,e,r){t.bi_valid>X-r?(t.bi_buf|=e<>X-t.bi_valid,t.bi_valid+=r-X):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function f(t){16===t.bi_valid?(s(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function c(t,e){var r,i,n,a,o,s,u=e.dyn_tree,h=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(a=0;a<=V;a++)t.bl_count[a]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;rp&&(a=p,m++),u[2*i+1]=a,i>h||(t.bl_count[a]++,o=0,i>=d&&(o=c[i-d]),s=u[2*i],t.opt_len+=s*(a+o),f&&(t.static_len+=s*(l[2*i+1]+o)));if(0!==m){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(i=t.bl_count[a];0!==i;)n=t.heap[--r],n>h||(u[2*n+1]!==a&&(t.opt_len+=(a-u[2*n+1])*u[2*n],u[2*n+1]=a),i--)}}function d(t,e,r){var i,n,a=new Array(V+1),o=0;for(i=1;i<=V;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=e;n++){var s=t[2*n+1];0!==s&&(t[2*n]=l(a[s]++,s))}}function p(){var t,e,r,i,a,o=new Array(V+1);for(r=0,i=0;i>=7;i8?s(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function g(t,e,r,i){b(t),i&&(s(t,r),s(t,~r)),C.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function _(t,e,r,i){var n=2*e,a=2*r;return t[n]>1;r>=1;r--)v(t,a,r);n=u;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],v(t,a,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,a[2*n]=a[2*r]+a[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,a[2*r+1]=a[2*i+1]=n,t.heap[1]=n++,v(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],c(t,e),d(a,h,t.bl_count)}function E(t,e,r){var i,n,a=-1,o=e[1],s=0,u=7,h=4;for(0===o&&(u=138,h=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++s=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function k(t,e,r,i){var n;for(u(t,e-257,5),u(t,r-1,5),u(t,i-4,4),n=0;n>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return L;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return B;for(e=32;e0?(t.strm.data_type===D&&(t.strm.data_type=M(t)),w(t,t.l_desc),w(t,t.d_desc),o=S(t),n=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==e?I(t,e,r,i):t.strategy===O||a===n?(u(t,(z<<1)+(i?1:0),3),y(t,ot,st)):(u(t,(j<<1)+(i?1:0),3),k(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),y(t,t.dyn_ltree,t.dyn_dtree)),m(t),i&&b(t)}function P(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(ht[r]+H+1)]++,t.dyn_dtree[2*o(e)]++),t.last_lit===t.lit_bufsize-1}var C=t("../utils/common"),O=4,L=0,B=1,D=2,N=0,z=1,j=2,U=3,F=258,G=29,H=256,q=H+1+G,W=30,Z=19,Y=2*q+1,V=15,X=16,Q=7,J=256,K=16,$=17,tt=18,et=[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],rt=[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],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],at=512,ot=new Array(2*(q+2));i(ot);var st=new Array(2*W);i(st);var ut=new Array(at);i(ut);var ht=new Array(F-U+1);i(ht);var lt=new Array(G);i(lt);var ft,ct,dt,pt=new Array(W);i(pt);var mt=!1;r._tr_init=A,r._tr_stored_block=I,r._tr_flush_block=R,r._tr_tally=P,r._tr_align=T},{"../utils/common":36}],46:[function(t,e,r){"use strict";function i(){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}e.exports=i},{}],47:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],48:[function(t,e,r){(function(e){"use strict";function i(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}function n(t){if(t>X)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,e.prototype),r}function e(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return a(t,e,r)}function a(t,r,i){if("string"==typeof t)return h(t,r);if(ArrayBuffer.isView(t))return l(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(q(t,ArrayBuffer)||t&&q(t.buffer,ArrayBuffer))return f(t,r,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return e.from(n,r,i);var a=c(t);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return e.from(t[Symbol.toPrimitive]("string"),r,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function s(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function u(t){return o(t),n(t<0?0:0|d(t))}function h(t,r){if("string"==typeof r&&""!==r||(r="utf8"),!e.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var i=0|m(t,r),a=n(i),o=a.write(t,r);return o!==i&&(a=a.slice(0,o)),a}function l(t){for(var e=t.length<0?0:0|d(t.length),r=n(e),i=0;i=X)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+X.toString(16)+" bytes");return 0|t}function p(t){return+t!=t&&(t=0),e.alloc(+t)}function m(t,r){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var a=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return G(t).length;default:if(a)return n?-1:j(t).length;r=(""+r).toLowerCase(),a=!0}}function b(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function g(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function _(t,r,i,n,a){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,W(i)&&(i=a?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(a)return-1;i=t.length-1}else if(i<0){if(!a)return-1;i=0}if("string"==typeof r&&(r=e.from(r,n)),e.isBuffer(r))return 0===r.length?-1:v(t,r,i,n,a);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,r,i):Uint8Array.prototype.lastIndexOf.call(t,r,i):v(t,[r],i,n,a);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){function a(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var o,s=1,u=t.length,h=e.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,u/=2,h/=2,r/=2}if(n){var l=-1;for(o=r;ou&&(r=u-h),o=r;o>=0;o--){for(var f=!0,c=0;cn&&(i=n)):i=n;var a=e.length;i>a/2&&(i=a/2);for(var o=0;o239?4:h>223?3:h>191?2:1;if(n+f<=r)switch(f){case 1:h<128&&(l=h);break;case 2:a=t[n+1],128==(192&a)&&(u=(31&h)<<6|63&a,u>127&&(l=u));break;case 3:a=t[n+1],o=t[n+2],128==(192&a)&&128==(192&o)&&(u=(15&h)<<12|(63&a)<<6|63&o,u>2047&&(u<55296||u>57343)&&(l=u));break;case 4:a=t[n+1],o=t[n+2],s=t[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&h)<<18|(63&a)<<12|(63&o)<<6|63&s,u>65535&&u<1114112&&(l=u))}null===l?(l=65533,f=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|1023&l),i.push(l),n+=f}return I(i)}function I(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function L(t,r,i,n,a,o){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||rt.length)throw new RangeError("Index out of range")}function B(t,e,r,i,n,a){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,i,n){return e=+e,r>>>=0,n||B(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Y.write(t,e,r,i,23,4),r+4}function N(t,e,r,i,n){return e=+e,r>>>=0,n||B(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Y.write(t,e,r,i,52,8),r+8}function z(t){if(t=t.split("=")[0],t=t.trim().replace(J,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function j(t,e){var r;e=e||1/0;for(var i=t.length,n=null,a=[],o=0;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function U(t){for(var e=[],r=0;r>8,n=r%256,a.push(n),a.push(i);return a}function G(t){return Z.toByteArray(z(t))}function H(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function W(t){return t!=t}var Z=t("base64-js"),Y=t("ieee754"),V="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=e,r.SlowBuffer=p,r.INSPECT_MAX_BYTES=50;var X=2147483647;r.kMaxLength=X,e.TYPED_ARRAY_SUPPORT=i(),e.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&e[Symbol.species]===e&&Object.defineProperty(e,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),e.poolSize=8192,e.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(e.prototype,Uint8Array.prototype),Object.setPrototypeOf(e,Uint8Array),e.alloc=function(t,e,r){return s(t,e,r)},e.allocUnsafe=function(t){return u(t)},e.allocUnsafeSlow=function(t){return u(t)},e.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==e.prototype},e.compare=function(t,r){if(q(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),q(r,Uint8Array)&&(r=e.from(r,r.offset,r.byteLength)),!e.isBuffer(t)||!e.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var i=t.length,n=r.length,a=0,o=Math.min(i,n);ae&&(t+=" ... "),""},V&&(e.prototype[V]=e.prototype.inspect),e.prototype.compare=function(t,r,i,n,a){if(q(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),r<0||i>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&r>=i)return 0;if(n>=a)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=i-r,u=Math.min(o,s),h=this.slice(n,a),l=t.slice(r,i),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return y(this,t,e,r);case"utf8":case"utf-8": return w(this,t,e,r);case"ascii":return E(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;e.prototype.slice=function(t,r){var i=this.length;t=~~t,r=void 0===r?i:~~r,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r>>=0,e>>>=0,r||O(t,e,this.length);for(var i=this[t],n=1,a=0;++a>>=0,e>>>=0,r||O(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},e.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},e.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},e.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},e.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},e.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},e.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var i=this[t],n=1,a=0;++a=n&&(i-=Math.pow(2,8*e)),i},e.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var i=e,n=1,a=this[t+--i];i>0&&(n*=256);)a+=this[t+--i]*n;return n*=128,a>=n&&(a-=Math.pow(2,8*e)),a},e.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},e.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},e.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},e.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),Y.read(this,t,!0,23,4)},e.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),Y.read(this,t,!1,23,4)},e.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),Y.read(this,t,!0,52,8)},e.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),Y.read(this,t,!1,52,8)},e.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;L(this,t,e,r,n,0)}var a=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;L(this,t,e,r,n,0)}var a=r-1,o=1;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=t/o&255;return e+r},e.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},e.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},e.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},e.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},e.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},e.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},e.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},e.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},e.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},e.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},e.prototype.copy=function(t,r,i,n){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r=0;--o)t[o+r]=this[o+i];else Uint8Array.prototype.set.call(t,this.subarray(i,n),r);return a},e.prototype.fill=function(t,r,i,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!e.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(r<0||this.length>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=r;o0&&s.length>a)){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=o[e]=r,++t._eventsCount;return t}function f(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var d=new Error('Unhandled "error" event. ('+e+")");throw d.context=e,d}if(r=f[t],!r)return!1;var p="function"==typeof r;switch(i=arguments.length,i){case 1:a(r,p,this);break;case 2:o(r,p,this,arguments[1]);break;case 3:s(r,p,this,arguments[1],arguments[2]);break;case 4:u(r,p,this,arguments[1],arguments[2],arguments[3]);break;default:for(n=new Array(i-1),l=1;l=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,n=a;break}if(n<0)return this;0===n?r.shift():m(r,n),1===r.length&&(i[t]=r[0]),i.removeListener&&this.emit("removeListener",t,o||e)}return this},i.prototype.removeAllListeners=function(t){var e,r,i;if(r=this._events,!r)return this;if(!r.removeListener)return 0===arguments.length?(this._events=w(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=w(null):delete r[t]),this;if(0===arguments.length){var n,a=E(r);for(i=0;i=0;i--)this.removeListener(t,e[i]);return this},i.prototype.listeners=function(t){return d(this,t,!0)},i.prototype.rawListeners=function(t){return d(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],53:[function(t,e,r){function i(){return(0,eval)("this")}var n=t("./lib/parser");e.exports={create:function(e,r){if(r=r||i(),e instanceof r.ArrayBuffer){var a=t("./lib/dom-bufferstream");return new n(new a(e,0,e.byteLength,!0,r))}var o=t("./lib/bufferstream");return new n(new o(e,0,e.length,!0))}}},{"./lib/bufferstream":54,"./lib/dom-bufferstream":56,"./lib/parser":60}],54:[function(t,e,r){function i(t,e,r,i){this.buffer=t,this.offset=e||0,r="number"==typeof r?r:t.length,this.endPosition=this.offset+r,this.setBigEndian(i)}i.prototype={setBigEndian:function(t){this.bigEndian=!!t},nextUInt8:function(){var t=this.buffer.readUInt8(this.offset);return this.offset+=1,t},nextInt8:function(){var t=this.buffer.readInt8(this.offset);return this.offset+=1,t},nextUInt16:function(){var t=this.bigEndian?this.buffer.readUInt16BE(this.offset):this.buffer.readUInt16LE(this.offset);return this.offset+=2,t},nextUInt32:function(){var t=this.bigEndian?this.buffer.readUInt32BE(this.offset):this.buffer.readUInt32LE(this.offset);return this.offset+=4,t},nextInt16:function(){var t=this.bigEndian?this.buffer.readInt16BE(this.offset):this.buffer.readInt16LE(this.offset);return this.offset+=2,t},nextInt32:function(){var t=this.bigEndian?this.buffer.readInt32BE(this.offset):this.buffer.readInt32LE(this.offset);return this.offset+=4,t},nextFloat:function(){var t=this.bigEndian?this.buffer.readFloatBE(this.offset):this.buffer.readFloatLE(this.offset);return this.offset+=4,t},nextDouble:function(){var t=this.bigEndian?this.buffer.readDoubleBE(this.offset):this.buffer.readDoubleLE(this.offset);return this.offset+=8,t},nextBuffer:function(t){var e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},remainingLength:function(){return this.endPosition-this.offset},nextString:function(t){var e=this.buffer.toString("utf8",this.offset,this.offset+t);return this.offset+=t,e},mark:function(){var t=this;return{openWithOffset:function(e){return e=(e||0)+this.offset,new i(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){return e="number"==typeof e?e:this.endPosition-(this.offset+t),new i(this.buffer,this.offset+t,e,this.bigEndian)}},e.exports=i},{}],55:[function(t,e,r){function i(t){return parseInt(t,10)}function n(t,e){t=t.map(i),e=e.map(i);var r=t[0],n=t[1]-1,a=t[2],o=e[0],s=e[1],u=e[2],h=Date.UTC(r,n,a,o,s,u,0),l=h/1e3;return l}function a(t){var e=t.substr(0,10).split("-"),r=t.substr(11,8).split(":"),a=t.substr(19,6),o=a.split(":").map(i),s=o[0]*u+o[1]*h,l=n(e,r);if(l-=s,"number"==typeof l&&!isNaN(l))return l}function o(t){var e=t.split(" "),r=e[0].split(":"),i=e[1].split(":"),a=n(r,i);if("number"==typeof a&&!isNaN(a))return a}function s(t){var e=19===t.length&&":"===t.charAt(4),r=25===t.length&&"T"===t.charAt(10);return r?a(t):e?o(t):void 0}var u=3600,h=60;e.exports={parseDateWithSpecFormat:o,parseDateWithTimezoneFormat:a,parseExifDate:s}},{}],56:[function(t,e,r){function i(t,e,r,i,n,a){this.global=n,e=e||0,r=r||t.byteLength-e,this.arrayBuffer=t.slice(e,e+r),this.view=new n.DataView(this.arrayBuffer,0,this.arrayBuffer.byteLength),this.setBigEndian(i),this.offset=0,this.parentOffset=(a||0)+e}i.prototype={setBigEndian:function(t){this.littleEndian=!t},nextUInt8:function(){var t=this.view.getUint8(this.offset);return this.offset+=1,t},nextInt8:function(){var t=this.view.getInt8(this.offset);return this.offset+=1,t},nextUInt16:function(){var t=this.view.getUint16(this.offset,this.littleEndian);return this.offset+=2,t},nextUInt32:function(){var t=this.view.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},nextInt16:function(){var t=this.view.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},nextInt32:function(){var t=this.view.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},nextFloat:function(){var t=this.view.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},nextDouble:function(){var t=this.view.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},nextBuffer:function(t){var e=this.arrayBuffer.slice(this.offset,this.offset+t);return this.offset+=t,e},remainingLength:function(){return this.arrayBuffer.byteLength-this.offset},nextString:function(t){var e=this.arrayBuffer.slice(this.offset,this.offset+t);return e=String.fromCharCode.apply(null,new this.global.Uint8Array(e)),this.offset+=t,e},mark:function(){var t=this;return{openWithOffset:function(e){return e=(e||0)+this.offset,new i(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){return e="number"==typeof e?e:this.arrayBuffer.byteLength-(this.offset+t),new i(this.arrayBuffer,this.offset+t,e,!this.littleEndian,this.global,this.parentOffset)}},e.exports=i},{}],57:[function(t,e,r){e.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"}}},{}],58:[function(t,e,r){function i(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 n(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 a(t,e){var r,a,o=e.nextUInt16(),s=e.nextUInt16(),u=n(s),h=e.nextUInt32(),l=u*h ;if(l>4&&(e=t.openWithOffset(e.nextUInt32())),2===s){r=e.nextString(h);var f=r.indexOf("\0");-1!==f&&(r=r.substr(0,f))}else if(7===s)r=e.nextBuffer(h);else if(0!==s)for(r=[],a=0;a0&&218!==i;){if(255!==t.nextUInt8())throw new Error("Invalid JPEG section offset");i=t.nextUInt8(),r=i>=208&&i<=217||218===i?0:t.nextUInt16()-2,e(i,t.branch(0,r)),t.skip(r)}},getSizeFromSOFSection:function(t){return t.skip(1),{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:t>=224&&t<=239?(e="APP",r=t-224):t>=192&&t<=207&&196!==t&&200!==t&&204!==t?(e="SOF",r=t-192):t>=208&&t<=215&&(e="RST",r=t-208)}var i={name:e};return"number"==typeof r&&(i.index=r),i}}},{}],60:[function(t,e,r){function i(t,e,r,i,n,a,o){this.startMarker=t,this.tags=e,this.imageSize=r,this.thumbnailOffset=i,this.thumbnailLength=n,this.thumbnailType=a,this.app1Offset=o}function n(t){this.stream=t,this.flags={readBinaryTags:!1,resolveTagNames:!0,simplifyValues:!0,imageSize:!0,hidePointers:!0,returnTags:!0}}var a=t("./jpeg"),o=t("./exif"),s=t("./simplify");i.prototype={hasThumbnail:function(t){return!(!this.thumbnailOffset||!this.thumbnailLength)&&("string"!=typeof t||("image/jpeg"===t.toLowerCase().trim()?6===this.thumbnailType:"image/tiff"===t.toLowerCase().trim()&&1===this.thumbnailType))},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,e=this._getThumbnailStream();return a.parseSections(e,function(e,r){"SOF"===a.getSectionName(e).name&&(t=a.getSizeFromSOFSection(r))}),t}},n.prototype={enableBinaryFields:function(t){return this.flags.readBinaryTags=!!t,this},enablePointers:function(t){return this.flags.hidePointers=!t,this},enableTagNames:function(t){return this.flags.resolveTagNames=!!t,this},enableImageSize:function(t){return this.flags.imageSize=!!t,this},enableReturnTags:function(t){return this.flags.returnTags=!!t,this},enableSimpleValues:function(t){return this.flags.simplifyValues=!!t,this},parse:function(){var e,r,n,u,h,l,f,c,d,p=this.stream.mark(),m=p.openWithOffset(0),b=this.flags;return b.resolveTagNames&&(f=t("./exif-tags")),b.resolveTagNames?(e={},c=function(t){return e[t.name]},d=function(t,r){e[t.name]=r}):(e=[],c=function(t){var r;for(r=0;r1))return null;var r=function(t,r){r=Object.assign({offset:0},r);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return t.findIndex(function(t,r,i){return r>=e&&80===i[r]&&75===i[r+1]&&3===i[r+2]&&4===i[r+3]})},l=0,f=!1,c=null;do{var d=l+30;if(f||(f=r(s,{offset:d})||r(u,{offset:d})),c||(i("word/",{offset:d})?c={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:i("ppt/",{offset:d})?c={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:i("xl/",{offset:d})&&(c={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),f&&c)return c;l=h(e,d)}while(l>=0);if(c)return c}if(r([80,75])&&(3===e[2]||5===e[2]||7===e[2])&&(4===e[3]||6===e[3]||8===e[3]))return{ext:"zip",mime:"application/zip"};if(r([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(0===e[6]||1===e[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([51,103,112,53])||r([0,0,0])&&r([102,116,121,112],{offset:4})&&(r([109,112,52,49],{offset:8})||r([109,112,52,50],{offset:8})||r([105,115,111,109],{offset:8})||r([105,115,111,50],{offset:8})||r([109,109,112,52],{offset:8})||r([77,52,86],{offset:8})||r([100,97,115,104],{offset:8})))return{ext:"mp4",mime:"video/mp4"};if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){var p=e.subarray(4,4100),m=p.findIndex(function(t,e,r){return 66===r[e]&&130===r[e+1]});if(-1!==m){var b=m+3,g=function(t){return(0,n.default)(t).every(function(t,e){return p[b+e]===t.charCodeAt(0)})};if(g("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(g("webm"))return{ext:"webm",mime:"video/webm"}}}if(r([0,0,0,20,102,116,121,112,113,116,32,32])||r([102,114,101,101],{offset:4})||r([102,116,121,112,113,116,32,32],{offset:4})||r([109,100,97,116],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(r([48,38,178,117,142,102,207,17,166,217]))return{ext:"wmv",mime:"video/x-ms-wmv"};if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([102,116,121,112,51,103],{offset:4}))return{ext:"3gp",mime:"video/3gpp"};for(var _=0;_<2&&_=3&&(a=r),"[object Array]"===n.call(t)?o(t,e,a):"string"==typeof t?s(t,e,a):u(t,e,a)};e.exports=h},{"is-callable":77}],64:[function(t,e,r){"use strict";function i(t,e,r,i){function a(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}var o=0,s=(i=void 0===i?{}:i,void 0===i.loop?null:i.loop),u=void 0===i.palette?null:i.palette;if(e<=0||r<=0||e>65535||r>65535)throw new Error("Width/Height invalid.");t[o++]=71,t[o++]=73,t[o++]=70,t[o++]=56,t[o++]=57,t[o++]=97;var h=0,l=0;if(null!==u){for(var f=a(u);f>>=1;)++h;if(f=1<=f)throw new Error("Background index out of range.");if(0===l)throw new Error("Background index explicitly passed as 0.")}}if(t[o++]=255&e,t[o++]=e>>8&255,t[o++]=255&r,t[o++]=r>>8&255,t[o++]=(null!==u?128:0)|h,t[o++]=l,t[o++]=0,null!==u)for(var c=0,d=u.length;c>16&255,t[o++]=p>>8&255,t[o++]=255&p}if(null!==s){if(s<0||s>65535)throw new Error("Loop count invalid.");t[o++]=33,t[o++]=255,t[o++]=11,t[o++]=78,t[o++]=69,t[o++]=84,t[o++]=83,t[o++]=67,t[o++]=65,t[o++]=80,t[o++]=69,t[o++]=50,t[o++]=46,t[o++]=48,t[o++]=3,t[o++]=1,t[o++]=255&s,t[o++]=s>>8&255,t[o++]=0}var m=!1;this.addFrame=function(e,r,i,s,h,l){if(!0===m&&(--o,m=!1),l=void 0===l?{}:l,e<0||r<0||e>65535||r>65535)throw new Error("x/y invalid.");if(i<=0||s<=0||i>65535||s>65535)throw new Error("Width/Height invalid.");if(h.length>=1;)++p;d=1<3)throw new Error("Disposal out of range.");var _=!1,v=0;if(void 0!==l.transparent&&null!==l.transparent&&(_=!0,v=l.transparent,v<0||v>=d))throw new Error("Transparent color index.");if((0!==g||_||0!==b)&&(t[o++]=33,t[o++]=249,t[o++]=4,t[o++]=g<<2|(!0===_?1:0),t[o++]=255&b,t[o++]=b>>8&255,t[o++]=v,t[o++]=0),t[o++]=44,t[o++]=255&e,t[o++]=e>>8&255,t[o++]=255&r,t[o++]=r>>8&255,t[o++]=255&i,t[o++]=i>>8&255,t[o++]=255&s,t[o++]=s>>8&255,t[o++]=!0===f?128|p-1:0,!0===f)for(var y=0,w=c.length;y>16&255,t[o++]=E>>8&255,t[o++]=255&E}return o=n(t,o,p<2?2:p,h),o},this.end=function(){return!1===m&&(t[o++]=59,m=!0),o},this.getOutputBuffer=function(){return t},this.setOutputBuffer=function(e){t=e},this.getOutputBufferPosition=function(){return o},this.setOutputBufferPosition=function(t){o=t}}function n(t,e,r,i){function n(r){for(;c>=r;)t[e++]=255&d,d>>=8,c-=8,e===o+256&&(t[o]=255,o=e++)}function a(t){d|=t<=8;)t[e++]=255&d,d>>=8,c-=8,e===o+256&&(t[o]=255,o=e++);4096===l?(a(s),l=h+1,f=r+1,m={}):(l>=1<>7,s=7&n,u=1<=0))throw Error("Invalid block size");if(0===g)break;e+=g}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var _=t[e++];d=t[e++]|t[e++]<<8,p=t[e++],0==(1&_)&&(p=null),m=_>>2&7,e++;break;case 254:for(;;){g=t[e++];if(!(g>=0))throw Error("Invalid block size");if(0===g)break;e+=g}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var v=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,w=t[e++]|t[e++]<<8,E=t[e++]|t[e++]<<8,x=t[e++],S=x>>7,k=x>>6&1,M=7&x,A=1<=0))throw Error("Invalid block size");if(0===g)break;e+=g}c.push({x:v,y:y,width:w,height:E,has_local_palette:R,palette_offset:I,palette_size:T,data_offset:P,data_length:e-P,transparent_index:p,interlaced:!!k,delay:d,disposal:m});break;case 59:f=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return c.length},this.loopCount=function(){return b},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 n=this.frameInfo(e),a=n.width*n.height,s=new Uint8Array(a);o(t,n.data_offset,s,a);var u=n.palette_offset,h=n.transparent_index;null===h&&(h=256);var l=n.width,f=r-l,c=l,d=4*(n.y*r+n.x),p=4*((n.y+n.height)*r+n.x),m=d,b=4*f;!0===n.interlaced&&(b+=4*r*7);for(var g=8,_=0,v=s.length;_=p&&(b=4*f+4*r*(g-1),m=d+(l+f)*(g<<1),g>>=1)),y===h)m+=4;else{var w=t[u+3*y],E=t[u+3*y+1],x=t[u+3*y+2];i[m++]=x,i[m++]=E,i[m++]=w,i[m++]=255}--c}},this.decodeAndBlitFrameRGBA=function(e,i){var n=this.frameInfo(e),a=n.width*n.height,s=new Uint8Array(a);o(t,n.data_offset,s,a);var u=n.palette_offset,h=n.transparent_index;null===h&&(h=256);var l=n.width,f=r-l,c=l,d=4*(n.y*r+n.x),p=4*((n.y+n.height)*r+n.x),m=d,b=4*f;!0===n.interlaced&&(b+=4*r*7);for(var g=8,_=0,v=s.length;_=p&&(b=4*f+4*r*(g-1),m=d+(l+f)*(g<<1),g>>=1)),y===h)m+=4;else{var w=t[u+3*y],E=t[u+3*y+1],x=t[u+3*y+2];i[m++]=w,i[m++]=E,i[m++]=x,i[m++]=255}--c}}}function o(t,e,r,i){for(var n=t[e++],a=1<>=u,l-=u,b!==a){if(b===o)break;for(var g=ba;)v=p[v]>>8,++_;var y=v,w=c+_+(g!==b?1:0);if(w>i)return void console.log("Warning, gif stream longer than expected.");r[c++]=y,c+=_;var E=c;for(g!==b&&(r[c++]=y),v=g;_--;)v=p[v],r[--E]=255&v,v>>=8;null!==m&&s<4096&&(p[s++]=m<<8|y,s>=h+1&&u<12&&(++u,h=h<<1|1)),m=b}else s=o+1,u=n+1,h=(1<this.bitmap.width)throw new Error("copy exceeds width of source bitmap");if(e+a>t.bitmap.width)throw new Error("copy exceeds width of target bitmap");if(n+o>this.bitmap.height)throw new Error("copy exceeds height of source bitmap");if(r+o>t.bitmap.height)throw new Erro("copy exceeds height of target bitmap");const s=this.bitmap.data,u=t.bitmap.data,h=4*this.bitmap.width,l=4*t.bitmap.width,f=4*a;let c=n*h+4*i,d=r*l+4*e;for(;--o>=0;)s.copy(u,d,c,c+f),c+=h,d+=l;return this}fillRGBA(t){const e=this.bitmap.data,r=4*this.bitmap.height;let i=0;for(;i{const n=Math.round(.299*t[i]+.587*t[i+1]+.114*t[i+2]);t[i]=n,t[i+1]=n,t[i+2]=n}),this}reframe(t,e,i,n,a){const o=t<0?0:t,s=e<0?0:e,u=i+o>this.bitmap.width?this.bitmap.width-o:i,h=n+s>this.bitmap.height?this.bitmap.height-s:n,l=t<0?-t:0,f=e<0?-e:0;let c;if(void 0===a){if(o!==t||s!=e||u!==i||h!==n)throw new GifError("fillRGBA required for this reframing");c=new r(i,n)}else c=new r(i,n,a);return this.blit(c,l,f,o,s,u,h),this.bitmap=c.bitmap,this}scale(e){if(1===e)return;if(!Number.isInteger(e)||e<1)throw new Error("the scale must be an integer >= 1");const r=this.bitmap.width,i=this.bitmap.height,n=r*e*4,a=this.bitmap.data,o=new t(i*n*e);let s,u=0,h=0;for(let t=0;te)n=r-1;else{if(!(t[r]i;)i<<=1;e.length=i,e.fill(0,r)}function h(t,e){let r=t.bitmap.width*t.bitmap.height;return r=Math.ceil(r*e/8),r+=Math.ceil(r/255),v+r+768}function l(t,e,r){const o=r.colors,s=o.length<=8?n:a,u=e.bitmap.data,h=new i(u.length/4);let l=o.length,f=0,c=0;for(;f>8&16777215;h[c]=s(o,t)}else h[c]=l;f+=4,++c}if(r.usesTransparency){if(256===l)throw new m(`Frame ${t} already has 256 colors`+"and so can't use transparency")}else l=null;return{buffer:h,transparentIndex:l}}function f(t){let e=t.indexCount,r=0;for(--e;e;)++r,e>>=1;return r>0?r:1}function c(t,e,r,n,a){if(r.interlaced)throw new m("writing interlaced GIFs is not supported");const o=l(e,r,n),s={delay:r.delayCentisecs,disposal:r.disposalMethod,transparent:o.transparentIndex};a&&(u(n),s.palette=n.colors);try{let e,n=t.getOutputBuffer(),a=t.getOutputBufferPosition(),u=!0;for(;u;)if(e=t.addFrame(r.xOffset,r.yOffset,r.bitmap.width,r.bitmap.height,o.buffer,s),u=!1,e>=n.length-1){const e=new i(1.5*n.length);n.copy(e),t.setOutputBuffer(e),t.setOutputBufferPosition(a),n=e,u=!0}return n}catch(t){throw new m(t)}}const d=t("omggif"),{Gif:p,GifError:m}=t("./gif");let b;e.nextTick(()=>{b=t("./gifutil")});const{GifFrame:g}=t("./gifframe"),_=200,v=100;class y{constructor(t={}){this._transparentRGB=null,"number"==typeof t.transparentRGB&&0!==t.transparentRGB&&(this._transparentRGBA=256*t.transparentRGB),this._testInitialBufferSize=0}decodeGif(t){try{let e;try{e=new d.GifReader(t)}catch(t){throw new m(t)}const r=e.numFrames(),i=[],n={width:e.width,height:e.height,loops:e.loopCount(),usesTransparency:!1};for(let t=0;tn.width)for(let e=0;e0)return this._testInitialBufferSize;let r=_+768;const i=f(t);return e.forEach(t=>{r+=h(t,i)}),r}_getSizeEstimateLocal(t,e){if(this._testInitialBufferSize>0)return this._testInitialBufferSize;let r=_;for(let i=0;i>8&16777215;t.add(i)}r+=4}const n=new Array(t.size),a=t.values();for(r=0;rt-e);let o=n.length;return i&&++o,{colors:n,usesTransparency:i,indexCount:o}}}a.DisposeToAnything=0,a.DisposeNothing=1,a.DisposeToBackgroundColor=2,a.DisposeToPrevious=3,r.GifFrame=a},{"./bitmapimage":65,"./gif":66}],69:[function(t,e,r){(function(e){"use strict";function i(t,e,r,i,n){const a=Array.isArray(t)?t:[t],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}'`);void 0===n.serpentine&&(n.serpentine=!0),void 0===n.minimumColorDistanceToDither&&(n.minimumColorDistanceToDither=0),void 0===n.calculateErrorLikeGIMP&&(n.calculateErrorLikeGIMP=!1)}const u=new s.distance.Euclidean,h=new s.palette[e](u,r,i);let l;l=n?new s.image.ErrorDiffusionArray(u,s.image.ErrorDiffusionArrayKernel[n.ditherAlgorithm],n.serpentine,n.minimumColorDistanceToDither,n.calculateErrorLikeGIMP):new s.image.NearestColor(u);const f=[];a.forEach(t=>{const e=t.bitmap.data,r=new ArrayBuffer(e.length),i=new Uint32Array(r);for(let t=0,r=0;t{o.readFile(t,(t,i)=>t?r(t):e(i))})}function a(t,e){return new Promise((r,i)=>{o.writeFile(t,e,t=>t?i(t):r())})}const o=t("fs"),s=t("image-q"),u=t("./bitmapimage"),{GifFrame:h}=t("./gifframe"),{GifError:l}=t("./gif"),{GifCodec:f}=t("./gifcodec"),c=[".jpg",".jpeg",".png",".bmp"],d=new f;r.cloneFrames=function(t){let e=[];return t.forEach(t=>{e.push(new h(t))}),e},r.getColorInfo=function(t,e){let r=!1;const i=[];for(let e=0;e256)throw new l(`Frame ${e} uses more than 256 color indexes`);i.push(n)}if(0===e)return{usesTransparency:r,palettes:i};const n=new Set;i.forEach(t=>{t.colors.forEach(t=>{n.add(t)})});let a=n.size;if(r&&++a,e&&a>e)return{usesTransparency:r,palettes:i};const o=new Array(n.size),s=n.values();for(let t=0;tt-e),{colors:o,indexCount:a,usesTransparency:r,palettes:i}},r.copyAsJimp=function(t,e){return r.shareAsJimp(t,new u(e))},r.getMaxDimensions=function(t){let e=0,r=0;return t.forEach(t=>{const i=t.xOffset+t.bitmap.width;i>e&&(e=i);const n=t.yOffset+t.bitmap.height;n>r&&(r=n)}),{maxWidth:e,maxHeight:r}},r.quantizeDekker=function(t,e,r){e=e||256,i(t,"NeuQuantFloat",e,0,r)},r.quantizeSorokin=function(t,e,r,n){let a;switch(e=e||256,r=r||"min-pop",r){case"min-pop":a=2;break;case"top-pop":a=1;break;default:throw new Error(`Invalid quantizeSorokin histogram '${r}'`)}i(t,"RGBQuant",e,a,n)},r.quantizeWu=function(t,e,r,n){if(e=e||256,r=r||5,r<1||r>8)throw new Error("Invalid quantization quality");i(t,"WuQuant",e,r,n)},r.read=function(t,r){return r=r||d,e.isBuffer(t)?r.decodeGif(t):n(t).then(t=>r.decodeGif(t))},r.shareAsJimp=function(t,e){const r=new t(e.bitmap.width,e.bitmap.height,0);return r.bitmap.data=e.bitmap.data,r},r.write=function(t,e,r,i){i=i||d;const n=t.match(/\.[a-zA-Z]+$/);if(null!==n&&c.includes(n[0].toLowerCase()))throw new Error(`GIF '${t}' has an unexpected suffix`);return i.encodeGif(e,r).then(e=>a(t,e.buffer).then(()=>e))}}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":76,"./bitmapimage":65,"./gif":66,"./gifcodec":67,"./gifframe":68,fs:47,"image-q":74}],70:[function(t,e,r){"use strict";const i=t("./bitmapimage"),{Gif:n,GifError:a}=t("./gif"),{GifCodec:o}=t("./gifcodec"),{GifFrame:s}=t("./gifframe"),u=t("./gifutil");e.exports={BitmapImage:i,Gif:n,GifCodec:o,GifFrame:s,GifUtil:u,GifError:a}},{"./bitmapimage":65,"./gif":66,"./gifcodec":67,"./gifframe":68,"./gifutil":69}],71:[function(t,e,r){(function(t){var r;r=void 0!==window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{}],72:[function(t,e,r){function i(t){if("string"==typeof t&&(t=a.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}var n=t("http"),a=t("url"),o=e.exports;for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);o.request=function(t,e){return t=i(t),n.request.call(this,t,e)},o.get=function(t,e){return t=i(t),n.get.call(this,t,e)}},{http:156,url:180}],73:[function(t,e,r){r.read=function(t,e,r,i,n){var a,o,s=8*n-i-1,u=(1<>1,l=-7,f=r?n-1:0,c=r?-1:1,d=t[e+f];for(f+=c,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+t[e+f],f+=c,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=i;l>0;o=256*o+t[e+f],f+=c,l-=8);if(0===a)a=1-h;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),a-=h}return(d?-1:1)*o*Math.pow(2,a-i)},r.write=function(t,e,r,i,n,a){var o,s,u,h=8*a-n-1,l=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:a-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),e+=o+f>=1?c/u:c*Math.pow(2,1-f),e*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(e*u-1)*Math.pow(2,n),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=255&s,d+=p,s/=256,n-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,h-=8);t[r+d-p]|=128*m}},{}],74:[function(e,r,i){var n,a;n=this,a=function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var i=r(1);e.constants=i;var n=r(3);e.conversion=n;var a=r(12);e.distance=a;var o=r(20);e.palette=o;var s=r(30);e.image=s;var u=r(35);e.quality=u;var h=r(37);e.utils=h},function(t,e,r){"use strict";var i=r(2);e.bt709=i},function(t,e){"use strict";var r,i,n;(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,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,function(t){t[t.RED=.33]="RED",t[t.GREEN=.6]="GREEN",t[t.BLUE=.06]="BLUE",t[t.WHITE=.329]="WHITE"}(n||(n={})),e.y=n},function(t,e,r){"use strict";var i=r(4);e.rgb2xyz=i.rgb2xyz;var n=r(5);e.rgb2hsl=n.rgb2hsl;var a=r(7);e.rgb2lab=a.rgb2lab;var o=r(9);e.lab2xyz=o.lab2xyz;var s=r(10);e.lab2rgb=s.lab2rgb;var u=r(8);e.xyz2lab=u.xyz2lab;var h=r(11);e.xyz2rgb=h.xyz2rgb},function(t,e){"use strict";function r(t){return t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92}function i(t,e,i){return t=r(t/255),e=r(e/255),i=r(i/255),{x:.4124*t+.3576*e+.1805*i,y:.2126*t+.7152*e+.0722*i,z:.0193*t+.1192*e+.9505*i}}e.rgb2xyz=i},function(t,e,r){"use strict";function i(t,e,r){var i=n.min3(t,e,r),a=n.max3(t,e,r),o=a-i,s=(i+a)/510,u=0;s>0&&s<1&&(u=o/(s<.5?a+i:510-a-i));var h=0;return o>0&&(h=a===t?(e-r)/o:a===e?2+(r-t)/o:4+(t-e)/o,h*=60,h<0&&(h+=360)),{h:h,s:u,l:s}}var n=r(6);e.rgb2hsl=i},function(t,e){"use strict";function r(t){return t*(Math.PI/180)}function i(t,e,r){var i=t;return ie&&(i=e),i>r&&(i=r),i}function a(t,e,r){return t>r&&(t=r),t255?t=255:t<0&&(t=0),t}function s(t){return t>255?t=255:t<0&&(t=0),t}function u(t,e){var r,i=typeof t[0];if("number"===i||"string"===i){for(var n=Object.create(null),a=0,o=t.length;a.008856?Math.pow(t,1/3):7.787*t+16/116}function i(t,e,i){if(t=r(t/n),e=r(e/a),i=r(i/o),116*e-16<0)throw new Error("xxx");return{L:Math.max(0,116*e-16),a:500*(t-e),b:200*(e-i)}}var n=.95047,a=1,o=1.08883;e.xyz2lab=i},function(t,e){"use strict";function r(t){return t>.206893034?Math.pow(t,3):(t-16/116)/7.787}function i(t,e,i){var s=(t+16)/116,u=e/500+s,h=s-i/200;return{x:n*r(u),y:a*r(s),z:o*r(h)}}var n=.95047,a=1,o=1.08883;e.lab2xyz=i},function(t,e,r){"use strict";function i(t,e,r){var i=n.lab2xyz(t,e,r);return a.xyz2rgb(i.x,i.y,i.z)}var n=r(9),a=r(11);e.lab2rgb=i},function(t,e,r){"use strict";function i(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function n(t,e,r){var n=i(3.2406*t+-1.5372*e+-.4986*r),o=i(-.9689*t+1.8758*e+.0415*r),s=i(.0557*t+-.204*e+1.057*r);return{r:a.inRange0to255Rounded(255*n),g:a.inRange0to255Rounded(255*o),b:a.inRange0to255Rounded(255*s)}}var a=r(6);e.xyz2rgb=n},function(t,e,r){"use strict";var i=r(13);e.AbstractDistanceCalculator=i.AbstractDistanceCalculator;var n=r(14);e.CIE94Textiles=n.CIE94Textiles,e.CIE94GraphicArts=n.CIE94GraphicArts;var a=r(15);e.CIEDE2000=a.CIEDE2000;var o=r(16);e.CMETRIC=o.CMETRIC;var s=r(17);e.AbstractEuclidean=s.AbstractEuclidean,e.Euclidean=s.Euclidean,e.EuclideanRgbQuantWOAlpha=s.EuclideanRgbQuantWOAlpha,e.EuclideanRgbQuantWithAlpha=s.EuclideanRgbQuantWithAlpha;var u=r(18);e.AbstractManhattan=u.AbstractManhattan,e.Manhattan=u.Manhattan,e.ManhattanSRGB=u.ManhattanSRGB,e.ManhattanNommyde=u.ManhattanNommyde;var h=r(19);e.PNGQUANT=h.PNGQUANT},function(t,e){"use strict";var r=function(){function t(){this._setDefaults(),this.setWhitePoint(255,255,255,255)}return t.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)},t.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},t.prototype._setDefaults=function(){},t}();e.AbstractDistanceCalculator=r},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=r(13),a=r(7),o=r(6),s=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.calculateRaw=function(t,e,r,i,n,s,u,h){var l=a.rgb2lab(o.inRange0to255(t*this._whitePoint.r),o.inRange0to255(e*this._whitePoint.g),o.inRange0to255(r*this._whitePoint.b)),f=a.rgb2lab(o.inRange0to255(n*this._whitePoint.r),o.inRange0to255(s*this._whitePoint.g),o.inRange0to255(u*this._whitePoint.b)),c=l.L-f.L,d=l.a-f.a,p=l.b-f.b,m=Math.sqrt(l.a*l.a+l.b*l.b),b=Math.sqrt(f.a*f.a+f.b*f.b),g=m-b,_=d*d+p*p-g*g;_=_<0?0:Math.sqrt(_);var v=(h-i)*this._whitePoint.a*this._kA;return Math.sqrt(Math.pow(c/this._Kl,2)+Math.pow(g/(1+this._K1*m),2)+Math.pow(_/(1+this._K2*m),2)+Math.pow(v,2))},e}(n.AbstractDistanceCalculator);e.AbstractCIE94=s;var u=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._setDefaults=function(){this._Kl=2,this._K1=.048,this._K2=.014,this._kA=12.5/255},e}(s);e.CIE94Textiles=u;var h=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._setDefaults=function(){this._Kl=1,this._K1=.045,this._K2=.015,this._kA=25/255},e}(s);e.CIE94GraphicArts=h},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=r(13),a=r(7),o=r(6),s=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.calculateRaw=function(t,r,i,n,s,u,h,l){var f=a.rgb2lab(o.inRange0to255(t*this._whitePoint.r),o.inRange0to255(r*this._whitePoint.g),o.inRange0to255(i*this._whitePoint.b)),c=a.rgb2lab(o.inRange0to255(s*this._whitePoint.r),o.inRange0to255(u*this._whitePoint.g),o.inRange0to255(h*this._whitePoint.b)),d=(l-n)*this._whitePoint.a*e._kA,p=this.calculateRawInLab(f,c);return Math.sqrt(p+d*d)},e.prototype.calculateRawInLab=function(t,r){var i=t.L,n=t.a,a=t.b,o=r.L,s=r.a,u=r.b,h=Math.sqrt(n*n+a*a),l=Math.sqrt(s*s+u*u),f=Math.pow((h+l)/2,7),c=.5*(1-Math.sqrt(f/(f+e._pow25to7))),d=(1+c)*n,p=(1+c)*s,m=Math.sqrt(d*d+a*a),b=Math.sqrt(p*p+u*u),g=m*b,_=e._calculatehp(a,d),v=e._calculatehp(u,p),y=Math.abs(_-v),w=o-i,E=b-m,x=e._calculate_dHp(g,y,v,_),S=e._calculate_ahp(g,y,_,v),k=e._calculateT(S),M=(m+b)/2,A=Math.pow((i+o)/2-50,2),I=1+.015*A/Math.sqrt(20+A),T=1+.045*M,R=1+.015*k*M,P=e._calculateRT(S,M),C=w/I,O=E/T,L=x/R;return Math.pow(C,2)+Math.pow(O,2)+Math.pow(L,2)+P*O*L},e._calculatehp=function(t,r){var i=Math.atan2(t,r);return i>=0?i:i+e._deg360InRad},e._calculateRT=function(t,r){var i=Math.pow(r,7),n=2*Math.sqrt(i/(i+e._pow25to7)),a=e._deg30InRad*Math.exp(-Math.pow((t-e._deg275InRad)/e._deg25InRad,2));return-Math.sin(2*a)*n},e._calculateT=function(t){return 1-.17*Math.cos(t-e._deg30InRad)+.24*Math.cos(2*t)+.32*Math.cos(3*t+e._deg6InRad)-.2*Math.cos(4*t-e._deg63InRad)},e._calculate_ahp=function(t,r,i,n){var a=i+n;return 0==t?a:r<=e._deg180InRad?a/2:a>8)+4*l*l+((767-u)*f*f>>8),d=(s-i)*this._whitePoint.a;return Math.sqrt(c+d*d)},e}(n.AbstractDistanceCalculator);e.CMETRIC=a},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=r(13),a=r(2),o=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.calculateRaw=function(t,e,r,i,n,a,o,s){var u=n-t,h=a-e,l=o-r,f=s-i;return Math.sqrt(this._kR*u*u+this._kG*h*h+this._kB*l*l+this._kA*f*f)},e}(n.AbstractDistanceCalculator);e.AbstractEuclidean=o;var s=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._setDefaults=function(){this._kR=1,this._kG=1,this._kB=1,this._kA=1},e}(o);e.Euclidean=s;var u=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._setDefaults=function(){this._kR=a.Y.RED,this._kG=a.Y.GREEN,this._kB=a.Y.BLUE,this._kA=1},e}(o);e.EuclideanRgbQuantWithAlpha=u;var h=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._setDefaults=function(){this._kR=a.Y.RED,this._kG=a.Y.GREEN,this._kB=a.Y.BLUE,this._kA=0},e}(o);e.EuclideanRgbQuantWOAlpha=h},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=r(13),a=r(2),o=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.calculateRaw=function(t,e,r,i,n,a,o,s){var u=n-t,h=a-e,l=o-r,f=s-i;return u<0&&(u=0-u),h<0&&(h=0-h),l<0&&(l=0-l),f<0&&(f=0-f),this._kR*u+this._kG*h+this._kB*l+this._kA*f},e}(n.AbstractDistanceCalculator);e.AbstractManhattan=o;var s=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._setDefaults=function(){this._kR=1,this._kG=1,this._kB=1,this._kA=1},e}(o);e.Manhattan=s;var u=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._setDefaults=function(){this._kR=.4984,this._kG=.8625,this._kB=.2979,this._kA=1},e}(o);e.ManhattanNommyde=u;var h=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype._setDefaults=function(){this._kR=a.Y.RED,this._kG=a.Y.GREEN,this._kB=a.Y.BLUE,this._kA=1},e}(o);e.ManhattanSRGB=h},function(t,e,r){"use strict";var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=r(13),a=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.calculateRaw=function(t,e,r,i,n,a,o,s){var u=(s-i)*this._whitePoint.a;return this._colordifference_ch(t*this._whitePoint.r,n*this._whitePoint.r,u)+this._colordifference_ch(e*this._whitePoint.g,a*this._whitePoint.g,u)+this._colordifference_ch(r*this._whitePoint.b,o*this._whitePoint.b,u)},e.prototype._colordifference_ch=function(t,e,r){var i=t-e,n=i+r;return i*i+n*n},e}(n.AbstractDistanceCalculator);e.PNGQUANT=a},function(t,e,r){"use strict";var i=r(21);e.NeuQuant=i.NeuQuant;var n=r(25);e.NeuQuantFloat=n.NeuQuantFloat;var a=r(26);e.RGBQuant=a.RGBQuant;var o=r(27);e.ColorHistogram=o.ColorHistogram;var s=r(29);e.WuQuant=s.WuQuant,e.WuColorCube=s.WuColorCube},function(t,e,r){"use strict";var i=r(22),n=r(24),a=3,o=function(){function t(t){this.r=this.g=this.b=this.a=t}return t.prototype.toPoint=function(){return n.Point.createByRGBA(this.r>>a,this.g>>a,this.b>>a,this.a>>a)},t.prototype.subtract=function(t,e,r,i){this.r-=0|t,this.g-=0|e,this.b-=0|r,this.a-=0|i},t}(),s=function(){function t(t,e){void 0===e&&(e=256),this._distance=t,this._pointArray=[],this._sampleFactor=1,this._networkSize=e,this._distance.setWhitePoint(255<>3)*t._radiusBias,l=h>>t._radiusBiasShift;l<=1&&(l=0);for(var f=0;f>>0;i=r=r&&(c-=r),f++,0===s&&(s=1),f%s==0){u-=u/n|0,h-=h/t._radiusDecrease|0,l=h>>t._radiusBiasShift,l<=1&&(l=0);for(var v=0;v>>0}}},t.prototype._buildPalette=function(){var t=new i.Palette;return this._network.forEach(function(e){t.add(e.toPoint())}),t.sort(),t},t.prototype._alterNeighbour=function(e,r,i,n,a,o){var s=r-e;s<-1&&(s=-1);var u=r+e;u>this._networkSize&&(u=this._networkSize);for(var h=r+1,l=r-1,f=1;hs;){var c=this._radPower[f++]/t._alphaRadBias;if(hs){d=this._network[l--];d.subtract(c*(d.r-a),c*(d.g-n),c*(d.b-i),c*(d.a-o))}}},t.prototype._alterSingle=function(e,r,i,n,a,o){e/=t._initAlpha;var s=this._network[r];s.subtract(e*(s.r-a),e*(s.g-n),e*(s.b-i),e*(s.a-o))},t.prototype._contest=function(e,r,i,n){for(var o=1020<>t._initialBiasShift-a);p>t._betaShift;this._freq[f]-=m,this._bias[f]+=m<>t._betaShift,t._betaGamma=t._initialBias<=o&&t=0;e--)if(t.uint32===this._pointArray[e].uint32)return!0;return!1},t.prototype.getNearestColor=function(t,e){return this._pointArray[0|this.getNearestIndex(t,e)]},t.prototype.getPointContainer=function(){return this._pointContainer},t.prototype._nearestPointFromCache=function(t){return"number"==typeof this._i32idx[t]?this._i32idx[t]:-1},t.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 n=0,a=this._pointArray.length;n>>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}return t.createByQuadruplet=function(e){var r=new t;return r.r=0|e[0],r.g=0|e[1],r.b=0|e[2],r.a=0|e[3],r._loadUINT32(),r._loadQuadruplet(),r},t.createByRGBA=function(e,r,i,n){var a=new t;return a.r=0|e,a.g=0|r,a.b=0|i,a.a=0|n,a._loadUINT32(),a._loadQuadruplet(),a},t.createByUint32=function(e){var r=new t;return r.uint32=e>>>0,r._loadRGBA(),r._loadQuadruplet(),r},t.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},t.prototype.getLuminosity=function(t){var e=this.r,r=this.g,n=this.b;return t&&(e=Math.min(255,255-this.a+this.a*e/255),r=Math.min(255,255-this.a+this.a*r/255),n=Math.min(255,255-this.a+this.a*n/255)),e*i.Y.RED+r*i.Y.GREEN+n*i.Y.BLUE},t.prototype._loadUINT32=function(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0},t.prototype._loadRGBA=function(){this.r=255&this.uint32,this.g=this.uint32>>>8&255,this.b=this.uint32>>>16&255,this.a=this.uint32>>>24&255},t.prototype._loadQuadruplet=function(){this.rgba[0]=this.r,this.rgba[1]=this.g,this.rgba[2]=this.b,this.rgba[3]=this.a},t}();e.Point=n},function(t,e,r){"use strict";var i=r(22),n=r(24),a=3,o=function(){function t(t){this.r=this.g=this.b=this.a=t}return t.prototype.toPoint=function(){return n.Point.createByRGBA(this.r>>a,this.g>>a,this.b>>a,this.a>>a)},t.prototype.subtract=function(t,e,r,i){this.r-=t,this.g-=e,this.b-=r,this.a-=i},t}(),s=function(){function t(t,e){void 0===e&&(e=256),this._distance=t,this._pointArray=[],this._sampleFactor=1,this._networkSize=e,this._distance.setWhitePoint(255<>3)*t._radiusBias,l=h>>t._radiusBiasShift;l<=1&&(l=0);for(var f=0;f=r&&(c-=r),f++,0==s&&(s=1),f%s==0){u-=u/n,h-=h/t._radiusDecrease,l=h>>t._radiusBiasShift,l<=1&&(l=0);for(var v=0;vthis._networkSize&&(u=this._networkSize);for(var h=r+1,l=r-1,f=1;hs;){var c=this._radPower[f++]/t._alphaRadBias;if(hs){d=this._network[l--];d.subtract(c*(d.r-a),c*(d.g-n),c*(d.b-i),c*(d.a-o))}}},t.prototype._alterSingle=function(e,r,i,n,a,o){e/=t._initAlpha;var s=this._network[r];s.subtract(e*(s.r-a),e*(s.g-n),e*(s.b-i),e*(s.a-o))},t.prototype._contest=function(e,r,i,n){for(var o=1020<>t._initialBiasShift-a);p>t._betaShift;this._freq[f]-=m,this._bias[f]+=m<>t._betaShift,t._betaGamma=t._initialBias<this._colors;){l.length=0;for(u=0;u3*this._colors?this._initialDistance:this._distanceIncrement}if(f=0;y--)0===a[y]&&(y!==v-1&&(r[y]=r[v-1]),--v);return r.length=v,e},t}();e.RGBQuant=u},function(t,e,r){"use strict";var i=r(28),n=r(6),a=function(){function t(e,r){this._method=e,this._minHueCols=r<<2,this._initColors=r<<2,this._hueStats=new i.HueStatistics(t._hueGroups,this._minHueCols),this._histogram=Object.create(null)}return t.prototype.sample=function(t){switch(this._method){case 1:this._colorStats1D(t);break;case 2:this._colorStats2D(t)}},t.prototype.getImportanceSortedColorsIDXI32=function(){var t,e=this,r=n.stableSort(Object.keys(this._histogram),function(t,r){return e._histogram[r]-e._histogram[t]});if(0===r.length)return[];switch(this._method){case 1:var i=Math.min(r.length,this._initColors),a=r[i-1],o=this._histogram[a];t=r.slice(0,i);for(var s=i,u=r.length;s=n&&(l[e]=o[e]):o[e]=1})}),this._hueStats.injectIntoDictionary(l)},t.prototype._iterateBox=function(t,e,r){var i=t,n=i.y*e+i.x,a=(i.y+i.h-1)*e+(i.x+i.w-1),o=e-i.w+1,s=0,u=n;do{r.call(this,u),u+=++s%i.w==0?o:1}while(u<=a)},t.prototype._makeBoxes=function(t,e,r,i){for(var n=t%r,a=e%i,o=t-n,s=e-a,u=[],h=0;h>>8&255,a=t>>>16&255,o=e==r&&r==a?0:1+n.hueGroup(i.rgb2hsl(e,r,a).h,this._numGroups),s=this._stats[o],u=this._minCols;s.num++,s.num>u||(s.num==u&&this._groupsFull++,s.num<=u&&this._stats[o].cols.push(t))},t.prototype.injectIntoDictionary=function(t){for(var e=0;e<=this._numGroups;e++)this._stats[e].num<=this._minCols&&this._stats[e].cols.forEach(function(e){t[e]?t[e]++:t[e]=1})},t.prototype.injectIntoArray=function(t){for(var e=0;e<=this._numGroups;e++)this._stats[e].num<=this._minCols&&this._stats[e].cols.forEach(function(e){-1==t.indexOf(e)&&t.push(e)})},t}();e.HueStatistics=o},function(t,e,r){"use strict";function i(t){for(var e=[],r=0;r0){var r=this._sums[e],i=this._reds[e]/r,n=this._greens[e]/r,a=this._blues[e]/r,o=this._alphas[e]/r,s=h.Point.createByRGBA(0|i,0|n,0|a,0|o);t.add(s)}return t.sort(),t},t.prototype._preparePalette=function(){this._calculateMoments();for(var e=0,r=i(this._colors),n=1;n1?this._calculateVariance(this._cubes[e]):0,r[n]=this._cubes[n].volume>1?this._calculateVariance(this._cubes[n]):0):(r[e]=0,n--),e=0;for(var a=r[0],o=1;o<=n;++o)r[o]>a&&(a=r[o],e=o);if(a<=0){this._colors=n+1;break}}for(var s=[],u=[],h=[],l=[],f=0;f0?(s[f]=t._volume(this._cubes[f],this._momentsRed)/c|0,u[f]=t._volume(this._cubes[f],this._momentsGreen)/c|0,h[f]=t._volume(this._cubes[f],this._momentsBlue)/c|0,l[f]=t._volume(this._cubes[f],this._momentsAlpha)/c|0):(s[f]=0,u[f]=0,h[f]=0,l[f]=0)}this._reds=i(this._colors+1),this._greens=i(this._colors+1),this._blues=i(this._colors+1),this._alphas=i(this._colors+1),this._sums=i(this._colors+1);o=0;for(var d=this._pixels.length;o>e),i=1+(t.g>>e),n=1+(t.b>>e),a=1+(t.a>>e);this._weights[a][r][i][n]++,this._momentsRed[a][r][i][n]+=t.r,this._momentsGreen[a][r][i][n]+=t.g,this._momentsBlue[a][r][i][n]+=t.b,this._momentsAlpha[a][r][i][n]+=t.a,this._moments[a][r][i][n]+=this._table[t.r]+this._table[t.g]+this._table[t.b]+this._table[t.a]},t.prototype._calculateMoments=function(){for(var t=[],e=[],r=[],i=[],n=[],u=[],h=a(this._sideSize,this._sideSize,this._sideSize),l=a(this._sideSize,this._sideSize,this._sideSize),f=a(this._sideSize,this._sideSize,this._sideSize),c=a(this._sideSize,this._sideSize,this._sideSize),d=a(this._sideSize,this._sideSize,this._sideSize),p=a(this._sideSize,this._sideSize,this._sideSize),m=1;m<=this._alphaMaxSideIndex;++m){o(h,this._sideSize,this._sideSize,this._sideSize,0),o(l,this._sideSize,this._sideSize,this._sideSize,0),o(f,this._sideSize,this._sideSize,this._sideSize,0),o(c,this._sideSize,this._sideSize,this._sideSize,0),o(d,this._sideSize,this._sideSize,this._sideSize,0),o(p,this._sideSize,this._sideSize,this._sideSize,0);for(var b=1;b<=this._maxSideIndex;++b){s(t,this._sideSize,0),s(e,this._sideSize,0),s(r,this._sideSize,0),s(i,this._sideSize,0),s(n,this._sideSize,0),s(u,this._sideSize,0);for(var g=1;g<=this._maxSideIndex;++g)for(var _=0,v=0,y=0,w=0,E=0,x=0,S=1;S<=this._maxSideIndex;++S)_+=this._weights[m][b][g][S],v+=this._momentsRed[m][b][g][S],y+=this._momentsGreen[m][b][g][S],w+=this._momentsBlue[m][b][g][S],E+=this._momentsAlpha[m][b][g][S],x+=this._moments[m][b][g][S],t[S]+=_,e[S]+=v,r[S]+=y,i[S]+=w,n[S]+=E,u[S]+=x,h[b][g][S]=h[b-1][g][S]+t[S],l[b][g][S]=l[b-1][g][S]+e[S],f[b][g][S]=f[b-1][g][S]+r[S],c[b][g][S]=c[b-1][g][S]+i[S],d[b][g][S]=d[b-1][g][S]+n[S],p[b][g][S]=p[b-1][g][S]+u[S],this._weights[m][b][g][S]=this._weights[m-1][b][g][S]+h[b][g][S],this._momentsRed[m][b][g][S]=this._momentsRed[m-1][b][g][S]+l[b][g][S],this._momentsGreen[m][b][g][S]=this._momentsGreen[m-1][b][g][S]+f[b][g][S],this._momentsBlue[m][b][g][S]=this._momentsBlue[m-1][b][g][S]+c[b][g][S],this._momentsAlpha[m][b][g][S]=this._momentsAlpha[m-1][b][g][S]+d[b][g][S],this._moments[m][b][g][S]=this._moments[m-1][b][g][S]+p[b][g][S]}}},t._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])},t._volume=function(e,r){return 0|t._volumeFloat(e,r)},t._top=function(e,r,i,n){var a;switch(r){case t.alpha:a=n[i][e.redMaximum][e.greenMaximum][e.blueMaximum]-n[i][e.redMaximum][e.greenMinimum][e.blueMaximum]-n[i][e.redMinimum][e.greenMaximum][e.blueMaximum]+n[i][e.redMinimum][e.greenMinimum][e.blueMaximum]-(n[i][e.redMaximum][e.greenMaximum][e.blueMinimum]-n[i][e.redMaximum][e.greenMinimum][e.blueMinimum]-n[i][e.redMinimum][e.greenMaximum][e.blueMinimum]+n[i][e.redMinimum][e.greenMinimum][e.blueMinimum]);break;case t.red:a=n[e.alphaMaximum][i][e.greenMaximum][e.blueMaximum]-n[e.alphaMaximum][i][e.greenMinimum][e.blueMaximum]-n[e.alphaMinimum][i][e.greenMaximum][e.blueMaximum]+n[e.alphaMinimum][i][e.greenMinimum][e.blueMaximum]-(n[e.alphaMaximum][i][e.greenMaximum][e.blueMinimum]-n[e.alphaMaximum][i][e.greenMinimum][e.blueMinimum]-n[e.alphaMinimum][i][e.greenMaximum][e.blueMinimum]+n[e.alphaMinimum][i][e.greenMinimum][e.blueMinimum]);break;case t.green:a=n[e.alphaMaximum][e.redMaximum][i][e.blueMaximum]-n[e.alphaMaximum][e.redMinimum][i][e.blueMaximum]-n[e.alphaMinimum][e.redMaximum][i][e.blueMaximum]+n[e.alphaMinimum][e.redMinimum][i][e.blueMaximum]-(n[e.alphaMaximum][e.redMaximum][i][e.blueMinimum]-n[e.alphaMaximum][e.redMinimum][i][e.blueMinimum]-n[e.alphaMinimum][e.redMaximum][i][e.blueMinimum]+n[e.alphaMinimum][e.redMinimum][i][e.blueMinimum]);break;case t.blue:a=n[e.alphaMaximum][e.redMaximum][e.greenMaximum][i]-n[e.alphaMaximum][e.redMaximum][e.greenMinimum][i]-n[e.alphaMaximum][e.redMinimum][e.greenMaximum][i]+n[e.alphaMaximum][e.redMinimum][e.greenMinimum][i]-(n[e.alphaMinimum][e.redMaximum][e.greenMaximum][i]-n[e.alphaMinimum][e.redMaximum][e.greenMinimum][i]-n[e.alphaMinimum][e.redMinimum][e.greenMaximum][i]+n[e.alphaMinimum][e.redMinimum][e.greenMinimum][i]);break;default:throw new Error("impossible")}return 0|a},t._bottom=function(e,r,i){switch(r){case t.alpha:return-i[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMaximum]+i[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]+i[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-i[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-i[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]+i[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]+i[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-i[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case t.red:return-i[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMaximum]+i[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]+i[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-i[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-i[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]+i[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]+i[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-i[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case t.green:return-i[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMaximum]+i[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]+i[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]-i[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-i[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+i[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]+i[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]-i[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case t.blue:return-i[e.alphaMaximum][e.redMaximum][e.greenMaximum][e.blueMinimum]+i[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+i[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]-i[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]-(-i[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]+i[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]+i[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-i[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);default:return 0}},t.prototype._calculateVariance=function(e){var r=t._volume(e,this._momentsRed),i=t._volume(e,this._momentsGreen),n=t._volume(e,this._momentsBlue),a=t._volume(e,this._momentsAlpha),o=t._volumeFloat(e,this._moments),s=t._volume(e,this._weights),u=r*r+i*i+n*n+a*a;return o-u/s},t.prototype._maximize=function(e,r,i,n,a,o,s,u,h){for(var l=0|t._bottom(e,r,this._momentsRed),f=0|t._bottom(e,r,this._momentsGreen),c=0|t._bottom(e,r,this._momentsBlue),d=0|t._bottom(e,r,this._momentsAlpha),p=0|t._bottom(e,r,this._weights),m=0,b=-1,g=i;gm&&(m=S,b=g))}}return{max:m,position:b}},t.prototype._cut=function(e,r){var i,n=t._volume(e,this._momentsRed),a=t._volume(e,this._momentsGreen),o=t._volume(e,this._momentsBlue),s=t._volume(e,this._momentsAlpha),u=t._volume(e,this._weights),h=this._maximize(e,t.red,e.redMinimum+1,e.redMaximum,n,a,o,s,u),l=this._maximize(e,t.green,e.greenMinimum+1,e.greenMaximum,n,a,o,s,u),f=this._maximize(e,t.blue,e.blueMinimum+1,e.blueMaximum,n,a,o,s,u),c=this._maximize(e,t.alpha,e.alphaMinimum+1,e.alphaMaximum,n,a,o,s,u);if(c.max>=h.max&&c.max>=l.max&&c.max>=f.max){if(i=t.alpha,c.position<0)return!1}else i=h.max>=c.max&&h.max>=l.max&&h.max>=f.max?t.red:l.max>=c.max&&l.max>=h.max&&l.max>=f.max?t.green:t.blue;switch(r.redMaximum=e.redMaximum,r.greenMaximum=e.greenMaximum,r.blueMaximum=e.blueMaximum,r.alphaMaximum=e.alphaMaximum,i){case t.red:r.redMinimum=e.redMaximum=h.position,r.greenMinimum=e.greenMinimum,r.blueMinimum=e.blueMinimum,r.alphaMinimum=e.alphaMinimum;break;case t.green:r.greenMinimum=e.greenMaximum=l.position,r.redMinimum=e.redMinimum,r.blueMinimum=e.blueMinimum,r.alphaMinimum=e.alphaMinimum;break;case t.blue:r.blueMinimum=e.blueMaximum=f.position,r.redMinimum=e.redMinimum,r.greenMinimum=e.greenMinimum,r.alphaMinimum=e.alphaMinimum;break;case t.alpha:r.alphaMinimum=e.alphaMaximum=c.position,r.blueMinimum=e.blueMinimum,r.redMinimum=e.redMinimum,r.greenMinimum=e.greenMinimum}return e.volume=(e.redMaximum-e.redMinimum)*(e.greenMaximum-e.greenMinimum)*(e.blueMaximum-e.blueMinimum)*(e.alphaMaximum-e.alphaMinimum),r.volume=(r.redMaximum-r.redMinimum)*(r.greenMaximum-r.greenMinimum)*(r.blueMaximum-r.blueMinimum)*(r.alphaMaximum-r.alphaMinimum),!0},t.prototype._initialize=function(t){this._colors=t,this._cubes=[];for(var e=0;e=0&&P+_=0&&C+de&&(t.length=e);for(var r=t.length,i=0;i=0&&this._x=0&&this._y0&&(l.comments=s.comments)}catch(t){if(t instanceof RangeError)throw new Error("Could not allocate enough memory for the image. Required: "+h);if(t instanceof ReferenceError&&"Buffer is not defined"===t.message)throw new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true");throw t}return s.copyToImageData(l,a.formatAsRGBA),l}var i=function(){"use strict";function t(){}function e(t,e){for(var r,i,n=0,a=[],o=16;o>0&&!t[o-1];)o--;a.push({children:[],index:0});var s,u=a[0];for(r=0;r0;){if(0===a.length)throw new Error("Could not recreate Huffman Table");u=a.pop()}for(u.index++,a.push(u);a.length<=r;)a.push(s={children:[],index:0}),u.children[u.index]=s.children,u=s;n++}r+10)return O--,C>>O&1;if(C=t[e++],255==C){var r=t[e++];if(r)throw new Error("unexpected marker: "+(C<<8|r).toString(16))}return O=7,C>>>7}function c(t){for(var e,r=t;null!==(e=f());){if(r=r[e],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function d(t){for(var e=0;t>0;){var r=f();if(null===r)return;e=e<<1|r,t--}return e}function p(t){var e=d(t);return e>=1<>4;if(0!==s){n+=u;var h=o[n];e[h]=p(s),n++}else{if(u<15)break;n+=16}}}function b(t,e){var r=c(t.huffmanTableDC),i=0===r?0:p(r)<0)L--;else for(var r=a,i=s;r<=i;){var n=c(t.huffmanTableAC),u=15&n,l=n>>4;if(0!==u){r+=l;var f=o[r];e[f]=p(u)*(1<>4;if(0===b)n<15?(L=d(n)+(1<=65488&&N<=65495))break;e+=2}return e-P}function i(t,e){function r(t,r,i){var n,a,o,m,b,g,_,v,y,w,E=e.quantizationTable,x=i;for(w=0;w<64;w++)x[w]=t[w]*E[w];for(w=0;w<8;++w){var S=8*w;0!=x[1+S]||0!=x[2+S]||0!=x[3+S]||0!=x[4+S]||0!=x[5+S]||0!=x[6+S]||0!=x[7+S]?(n=d*x[0+S]+128>>8,a=d*x[4+S]+128>>8,o=x[2+S],m=x[6+S],b=p*(x[1+S]-x[7+S])+128>>8,v=p*(x[1+S]+x[7+S])+128>>8,g=x[3+S]<<4,_=x[5+S]<<4,y=n-a+1>>1,n=n+a+1>>1,a=y,y=o*c+m*f+128>>8,o=o*f-m*c+128>>8,m=y,y=b-_+1>>1,b=b+_+1>>1,_=y,y=v+g+1>>1,g=v-g+1>>1,v=y,y=n-m+1>>1,n=n+m+1>>1,m=y,y=a-o+1>>1,a=a+o+1>>1,o=y,y=b*l+v*h+2048>>12,b=b*h-v*l+2048>>12,v=y,y=g*u+_*s+2048>>12,g=g*s-_*u+2048>>12,_=y,x[0+S]=n+v,x[7+S]=n-v,x[1+S]=a+_,x[6+S]=a-_,x[2+S]=o+g,x[5+S]=o-g,x[3+S]=m+b,x[4+S]=m-b):(y=d*x[0+S]+512>>10,x[0+S]=y,x[1+S]=y,x[2+S]=y,x[3+S]=y,x[4+S]=y,x[5+S]=y,x[6+S]=y,x[7+S]=y)}for(w=0;w<8;++w){var k=w;0!=x[8+k]||0!=x[16+k]||0!=x[24+k]||0!=x[32+k]||0!=x[40+k]||0!=x[48+k]||0!=x[56+k]?(n=d*x[0+k]+2048>>12,a=d*x[32+k]+2048>>12,o=x[16+k],m=x[48+k],b=p*(x[8+k]-x[56+k])+2048>>12,v=p*(x[8+k]+x[56+k])+2048>>12,g=x[24+k],_=x[40+k],y=n-a+1>>1,n=n+a+1>>1,a=y,y=o*c+m*f+2048>>12,o=o*f-m*c+2048>>12,m=y,y=b-_+1>>1,b=b+_+1>>1,_=y,y=v+g+1>>1,g=v-g+1>>1,v=y,y=n-m+1>>1,n=n+m+1>>1,m=y,y=a-o+1>>1,a=a+o+1>>1,o=y,y=b*l+v*h+2048>>12,b=b*h-v*l+2048>>12,v=y,y=g*u+_*s+2048>>12,g=g*s-_*u+2048>>12,_=y,x[0+k]=n+v,x[56+k]=n-v,x[8+k]=a+_,x[48+k]=a-_,x[16+k]=o+g,x[40+k]=o-g,x[24+k]=m+b,x[32+k]=m-b):(y=d*i[w+0]+8192>>14,x[0+k]=y,x[8+k]=y,x[16+k]=y,x[24+k]=y,x[32+k]=y,x[40+k]=y,x[48+k]=y,x[56+k]=y)}for(w=0;w<64;++w){var M=128+(x[w]+8>>4);r[w]=M<0?0:M>255?255:M}}var i,n,o=[],m=e.blocksPerLine,b=e.blocksPerColumn,g=m<<3,_=new Int32Array(64),v=new Uint8Array(64);a(g*b*8);for(var y=0;y255?255:t}function a(t=0){var e=m+t;if(e>b){var r=Math.ceil((e-b)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}m=e}var o=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]),s=4017,u=799,h=3406,l=2276,f=1567,c=3784,d=5793,p=2896;t.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(t){function n(){var e=t[c]<<8|t[c+1];return c+=2,e}function s(){var e=n(),r=t.subarray(c,c+e-2);return c+=r.length,r}function u(t){var e,r,i=1,n=1;for(r in t.components)t.components.hasOwnProperty(r)&&(e=t.components[r],i>4==0)for(X=0;X<64;X++){var A=o[X];M[A]=t[c++]}else{if(k>>4!=1)throw new Error("DQT: invalid table spec");for(X=0;X<64;X++){A=o[X];M[A]=n()}}m[15&k]=M}break;case 65472:case 65473:case 65474:n(),h={},h.extended=65473===v,h.progressive=65474===v,h.precision=t[c++],h.scanLines=n(),h.samplesPerLine=n(),h.components={},h.componentsOrder=[];var I=h.scanLines*h.samplesPerLine;if(I>f){var T=Math.ceil((I-f)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${T}MP`)}var R,P=t[c++];for(Y=0;Y>4,O=15&t[c+1],L=t[c+2];if(C<=0||O<=0)throw new Error("Invalid sampling factor, expected values above 0");h.componentsOrder.push(R),h.components[R]={h:C,v:O,quantizationIdx:L},c+=3}u(h),b.push(h);break;case 65476: var B=n();for(Y=2;Y>4==0?_:g)[15&D]=e(N,j)}break;case 65501:n(),l=n();break;case 65500:n(),n();break;case 65498:n();var U=t[c++],F=[];for(Y=0;Y>4],Q.huffmanTableAC=g[15&G],F.push(Q)}var H=t[c++],q=t[c++],W=t[c++],Z=r(t,c,h,F,l,H,q,W>>4,15&W,this.opts);c+=Z;break;case 65535:255!==t[c]&&c--;break;default:if(255==t[c-3]&&t[c-2]>=192&&t[c-2]<=254){c-=3;break}if(224===v||225==v){if(-1!==y)throw new Error(`first unknown JPEG marker at offset ${y.toString(16)}, second unknown JPEG marker ${v.toString(16)} at offset ${(c-1).toString(16)}`);y=c-1;const e=n();if(255===t[c+e-2]){c+=e-2;break}}throw new Error("unknown JPEG marker "+v.toString(16))}v=n()}if(1!=b.length)throw new Error("only single frame JPEGs supported");for(var Y=0;Y255&&(i=255),T[W[r]]=i}for(var n=[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],a=0;a<64;a++){var o=I((n[a]*t+50)/100);o<1?o=1:o>255&&(o=255),R[W[a]]=o}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],u=0,h=0;h<8;h++)for(var l=0;l<8;l++)P[u]=1/(T[W[u]]*s[h]*s[l]*8),C[u]=1/(R[W[u]]*s[h]*s[l]*8),u++}function n(t,e){for(var r=0,i=0,n=new Array,a=1;a<=16;a++){for(var o=1;o<=t[a];o++)n[e[i]]=[],n[e[i]][0]=r,n[e[i]][1]=a,i++,r++;r*=2}return n}function a(){x=n(Z,Y),S=n(Q,J),k=n(V,X),M=n(K,$)}function o(){for(var t=1,e=2,r=1;r<=15;r++){for(var i=t;i>0]=38470*t,q[t+512>>0]=7471*t+32768,q[t+768>>0]=-11059*t,q[t+1024>>0]=-21709*t,q[t+1280>>0]=32768*t+8421375,q[t+1536>>0]=-27439*t,q[t+1792>>0]=-5329*t}function u(t){for(var e=t[0],r=t[1]-1;r>=0;)e&1<>8&255),h(255&t)}function f(t,e){var r,i,n,a,o,s,u,h,l,f,c=0,d=8,p=64;for(l=0;l0?f+.5|0:f-.5|0;return B}function c(){l(65504),l(16),h(74),h(70),h(73),h(70),h(0),h(1),h(1),h(0),l(1),l(1),h(0),h(0)}function d(t){if(t){l(65505),69===t[0]&&120===t[1]&&105===t[2]&&102===t[3]?l(t.length+2):(l(t.length+5+2),h(69),h(120),h(105),h(102),h(0));for(var e=0;e{if("string"==typeof t){l(65534);var e,r=t.length;for(l(r+2),e=0;e0&&0==D[b];b--);if(0==b)return u(o),r;for(var g,_=1;_<=b;){for(var v=_;0==D[_]&&_<=b;++_);var y=_-v;if(y>=h){g=y>>4;for(var w=1;w<=g;++w)u(s);y&=15}a=32767+D[_],u(n[(y<<4)+L[a]]),u(O[a]),_++}return b!=l&&u(o),r}function y(){for(var t=String.fromCharCode,e=0;e<256;e++)H[e]=t(e)}function w(t){if(t<=0&&(t=1),t>100&&(t=100),A!=t){var e=0;e=t<50?Math.floor(5e3/t):Math.floor(200-2*t),i(e),A=t}}function E(){var t=(new Date).getTime();r||(r=50),y(),a(),o(),s(),w(r);(new Date).getTime()}Math.round;var x,S,k,M,A,I=Math.floor,T=new Array(64),R=new Array(64),P=new Array(64),C=new Array(64),O=new Array(65535),L=new Array(65535),B=new Array(64),D=new Array(64),N=[],z=0,j=7,U=new Array(64),F=new Array(64),G=new Array(64),H=new Array(256),q=new Array(2048),W=[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],Z=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],Y=[0,1,2,3,4,5,6,7,8,9,10,11],V=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],X=[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],Q=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],J=[0,1,2,3,4,5,6,7,8,9,10,11],K=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],$=[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];this.encode=function(r,i){(new Date).getTime();i&&w(i),N=new Array,z=0,j=7,l(65496),c(),g(r.comments),d(r.exifBuffer),m(),p(r.width,r.height),b(),_();var n=0,a=0,o=0;z=0,j=7,this.encode.displayName="_encode_";for(var s,h,f,y,E,A,I,T,R,O=r.data,L=r.width,B=r.height,D=4*L,H=0;H>3,I=4*(7&R),A=E+T*D+I,H+T>=B&&(A-=D*(H+1+T-B)),s+I>=D&&(A-=s+I-D+4),h=O[A++],f=O[A++],y=O[A++],U[R]=(q[h]+q[f+256>>0]+q[y+512>>0]>>16)-128,F[R]=(q[h+768>>0]+q[f+1024>>0]+q[y+1280>>0]>>16)-128,G[R]=(q[h+1280>>0]+q[f+1536>>0]+q[y+1792>>0]>>16)-128;n=v(U,P,n,x,k),a=v(F,C,a,S,M),o=v(G,C,o,S,M),s+=32}H+=8}if(j>=0){var W=[];W[1]=j+1,W[0]=(1<0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var r=s.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==m)throw new Error(l[r]);if(e.header&&s.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=s.deflateSetDictionary(this.strm,n),r!==m)throw new Error(l[r]);this._dict_set=!0}}function n(t,e){var r=new i(e);if(r.push(t,!0),r.err)throw r.msg||l[r.err];return r.result}function a(t,e){return e=e||{},e.raw=!0,n(t,e)}function o(t,e){return e=e||{},e.gzip=!0,n(t,e)}var s=t("./zlib/deflate"),u=t("./utils/common"),h=t("./utils/strings"),l=t("./zlib/messages"),f=t("./zlib/zstream"),c=Object.prototype.toString,d=0,p=4,m=0,b=1,g=2,_=-1,v=0,y=8;i.prototype.push=function(t,e){var r,i,n=this.strm,a=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?p:d,"string"==typeof t?n.input=h.string2buf(t):"[object ArrayBuffer]"===c.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new u.Buf8(a),n.next_out=0,n.avail_out=a),r=s.deflate(n,i),r!==b&&r!==m)return this.onEnd(r),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||i!==p&&i!==g)||("string"===this.options.to?this.onData(h.buf2binstring(u.shrinkBuf(n.output,n.next_out))):this.onData(u.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&r!==b);return i===p?(r=s.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===m):i!==g||(this.onEnd(m),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===m&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=i,r.deflate=n,r.deflateRaw=a,r.gzip=o},{"./utils/common":89,"./utils/strings":90,"./zlib/deflate":94,"./zlib/messages":99,"./zlib/zstream":101}],88:[function(t,e,r){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var r=o.inflateInit2(this.strm,e.windowBits);if(r!==h.Z_OK)throw new Error(l[r]);this.header=new c,o.inflateGetHeader(this.strm,this.header)}function n(t,e){var r=new i(e);if(r.push(t,!0),r.err)throw r.msg||l[r.err];return r.result}function a(t,e){return e=e||{},e.raw=!0,n(t,e)}var o=t("./zlib/inflate"),s=t("./utils/common"),u=t("./utils/strings"),h=t("./zlib/constants"),l=t("./zlib/messages"),f=t("./zlib/zstream"),c=t("./zlib/gzheader"),d=Object.prototype.toString;i.prototype.push=function(t,e){var r,i,n,a,l,f,c=this.strm,p=this.options.chunkSize,m=this.options.dictionary,b=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?h.Z_FINISH:h.Z_NO_FLUSH,"string"==typeof t?c.input=u.binstring2buf(t):"[object ArrayBuffer]"===d.call(t)?c.input=new Uint8Array(t):c.input=t,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new s.Buf8(p),c.next_out=0,c.avail_out=p),r=o.inflate(c,h.Z_NO_FLUSH),r===h.Z_NEED_DICT&&m&&(f="string"==typeof m?u.string2buf(m):"[object ArrayBuffer]"===d.call(m)?new Uint8Array(m):m,r=o.inflateSetDictionary(this.strm,f)),r===h.Z_BUF_ERROR&&!0===b&&(r=h.Z_OK,b=!1),r!==h.Z_STREAM_END&&r!==h.Z_OK)return this.onEnd(r),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&r!==h.Z_STREAM_END&&(0!==c.avail_in||i!==h.Z_FINISH&&i!==h.Z_SYNC_FLUSH)||("string"===this.options.to?(n=u.utf8border(c.output,c.next_out),a=c.next_out-n,l=u.buf2string(c.output,n),c.next_out=a,c.avail_out=p-a,a&&s.arraySet(c.output,c.output,n,a,0),this.onData(l)):this.onData(s.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(b=!0)}while((c.avail_in>0||0===c.avail_out)&&r!==h.Z_STREAM_END);return r===h.Z_STREAM_END&&(i=h.Z_FINISH),i===h.Z_FINISH?(r=o.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===h.Z_OK):i!==h.Z_SYNC_FLUSH||(this.onEnd(h.Z_OK),c.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===h.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=i,r.inflate=n,r.inflateRaw=a,r.ungzip=n},{"./utils/common":89,"./utils/strings":90,"./zlib/constants":92,"./zlib/gzheader":95,"./zlib/inflate":97,"./zlib/messages":99,"./zlib/zstream":101}],89:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],90:[function(t,e,r){"use strict";function i(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&a))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",i=0;i=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;s[254]=s[254]=1,r.string2buf=function(t){var e,r,i,a,o,s=t.length,u=0;for(a=0;a>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},r.buf2binstring=function(t){return i(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r4)h[n++]=65533,r+=o-1;else{for(a&=2===o?31:3===o?15:7;o>1&&r1?h[n++]=65533:a<65536?h[n++]=a:(a-=65536,h[n++]=55296|a>>10&1023,h[n++]=56320|1023&a)}return i(h,n)},r.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0?e:0===r?e:r+s[t[r]]>e?r:e}},{"./common":89}],91:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],92:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],93:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],94:[function(t,e,r){"use strict";function i(t,e){return t.msg=L[e],e}function n(t){return(t<<1)-(t>4?9:0)}function a(t){for(var e=t.length;--e>=0;)t[e]=0}function o(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(R.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,0===e.pending&&(e.pending_out=0))}function s(t,e){P._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,o(t.strm)}function u(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function l(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,R.arraySet(e,t.input,t.next_in,n,r),1===t.state.wrap?t.adler=C(t.adler,e,n,r):2===t.state.wrap&&(t.adler=O(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var r,i,n=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,l=t.w_mask,f=t.prev,c=t.strstart+lt,d=h[a+o-1],p=h[a+o];t.prev_length>=t.good_match&&(n>>=2),s>t.lookahead&&(s=t.lookahead);do{if(r=e,h[r+o]===p&&h[r+o-1]===d&&h[r]===h[a]&&h[++r]===h[a+1]){a+=2,r++;do{}while(h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&ao){if(t.match_start=e,o=i,i>=s)break;d=h[a+o-1],p=h[a+o]}}}while((e=f[e&l])>u&&0!=--n);return o<=t.lookahead?o:t.lookahead}function c(t){var e,r,i,n,a,o=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=o+(o-ft)){R.arraySet(t.window,t.window,o,o,0),t.match_start-=o,t.strstart-=o,t.block_start-=o,r=t.hash_size,e=r;do{i=t.head[--e],t.head[e]=i>=o?i-o:0}while(--r);r=o,e=r;do{i=t.prev[--e],t.prev[e]=i>=o?i-o:0}while(--r);n+=o}if(0===t.strm.avail_in)break;if(r=l(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=ht)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(c(t),0===t.lookahead&&e===B)return yt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,s(t,!1),0===t.strm.avail_out))return yt;if(t.strstart-t.block_start>=t.w_size-ft&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?Et:xt):(t.strstart>t.block_start&&(s(t,!1),t.strm.avail_out),yt)}function p(t,e){for(var r,i;;){if(t.lookahead=ht&&(t.ins_h=(t.ins_h<=ht)if(i=P._tr_tally(t,t.strstart-t.match_start,t.match_length-ht),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ht){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=ht&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=ht-1)),t.prev_length>=ht&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ht,i=P._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ht),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<=ht&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=t.strstart+lt;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]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ht?(r=P._tr_tally(t,1,t.match_length-ht),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=P._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?Et:xt):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?yt:wt}function g(t,e){for(var r;;){if(0===t.lookahead&&(c(t),0===t.lookahead)){if(e===B)return yt;break}if(t.match_length=0,r=P._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?Et:xt):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?yt:wt}function _(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}function v(t){t.window_size=2*t.w_size,a(t.head),t.max_lazy_match=T[t.level].max_lazy,t.good_match=T[t.level].good_length,t.nice_match=T[t.level].nice_length,t.max_chain_length=T[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ht-1,t.match_available=0,t.ins_h=0}function y(){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=K,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 R.Buf16(2*st),this.dyn_dtree=new R.Buf16(2*(2*at+1)),this.bl_tree=new R.Buf16(2*(2*ot+1)),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(ut+1),this.heap=new R.Buf16(2*nt+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*nt+1),a(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 w(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=J,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?dt:_t,t.adler=2===e.wrap?0:1,e.last_flush=B,P._tr_init(e),U):i(t,G)}function E(t){var e=w(t);return e===U&&v(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?G:(t.state.gzhead=e,U):G}function S(t,e,r,n,a,o){if(!t)return G;var s=1;if(e===W&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),a<1||a>$||r!==K||n<8||n>15||e<0||e>9||o<0||o>X)return i(t,G);8===n&&(n=9);var u=new y;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<j||e<0)return t?i(t,G):G;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||s.status===vt&&e!==z)return i(t,0===t.avail_out?q:G);if(s.strm=t,r=s.last_flush,s.last_flush=e,s.status===dt)if(2===s.wrap)t.adler=0,u(s,31),u(s,139),u(s,8),s.gzhead?(u(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),u(s,255&s.gzhead.time),u(s,s.gzhead.time>>8&255),u(s,s.gzhead.time>>16&255),u(s,s.gzhead.time>>24&255),u(s,9===s.level?2:s.strategy>=Y||s.level<2?4:0),u(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(u(s,255&s.gzhead.extra.length),u(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=O(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=pt):(u(s,0),u(s,0),u(s,0),u(s,0),u(s,0),u(s,9===s.level?2:s.strategy>=Y||s.level<2?4:0),u(s,St),s.status=_t);else{var c=K+(s.w_bits-8<<4)<<8,d=-1;d=s.strategy>=Y||s.level<2?0:s.level<6?1:6===s.level?2:3,c|=d<<6,0!==s.strstart&&(c|=ct),c+=31-c%31,s.status=_t,h(s,c),0!==s.strstart&&(h(s,t.adler>>>16),h(s,65535&t.adler)),t.adler=1}if(s.status===pt)if(s.gzhead.extra){for(l=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>l&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),o(t),l=s.pending,s.pending!==s.pending_buf_size));)u(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>l&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=mt)}else s.status=mt;if(s.status===mt)if(s.gzhead.name){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),o(t),l=s.pending,s.pending===s.pending_buf_size)){f=1;break}f=s.gzindexl&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),0===f&&(s.gzindex=0,s.status=bt)}else s.status=bt;if(s.status===bt)if(s.gzhead.comment){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),o(t),l=s.pending,s.pending===s.pending_buf_size)){f=1;break}f=s.gzindexl&&(t.adler=O(t.adler,s.pending_buf,s.pending-l,l)),0===f&&(s.status=gt)}else s.status=gt ;if(s.status===gt&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&o(t),s.pending+2<=s.pending_buf_size&&(u(s,255&t.adler),u(s,t.adler>>8&255),t.adler=0,s.status=_t)):s.status=_t),0!==s.pending){if(o(t),0===t.avail_out)return s.last_flush=-1,U}else if(0===t.avail_in&&n(e)<=n(r)&&e!==z)return i(t,q);if(s.status===vt&&0!==t.avail_in)return i(t,q);if(0!==t.avail_in||0!==s.lookahead||e!==B&&s.status!==vt){var p=s.strategy===Y?g(s,e):s.strategy===V?b(s,e):T[s.level].func(s,e);if(p!==Et&&p!==xt||(s.status=vt),p===yt||p===Et)return 0===t.avail_out&&(s.last_flush=-1),U;if(p===wt&&(e===D?P._tr_align(s):e!==j&&(P._tr_stored_block(s,0,0,!1),e===N&&(a(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),o(t),0===t.avail_out))return s.last_flush=-1,U}return e!==z?U:s.wrap<=0?F:(2===s.wrap?(u(s,255&t.adler),u(s,t.adler>>8&255),u(s,t.adler>>16&255),u(s,t.adler>>24&255),u(s,255&t.total_in),u(s,t.total_in>>8&255),u(s,t.total_in>>16&255),u(s,t.total_in>>24&255)):(h(s,t.adler>>>16),h(s,65535&t.adler)),o(t),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?U:F)}function A(t){var e;return t&&t.state?(e=t.state.status,e!==dt&&e!==pt&&e!==mt&&e!==bt&&e!==gt&&e!==_t&&e!==vt?i(t,G):(t.state=null,e===_t?i(t,H):U)):G}function I(t,e){var r,i,n,o,s,u,h,l,f=e.length;if(!t||!t.state)return G;if(r=t.state,o=r.wrap,2===o||1===o&&r.status!==dt||r.lookahead)return G;for(1===o&&(t.adler=C(t.adler,e,f,0)),r.wrap=0,f>=r.w_size&&(0===o&&(a(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new R.Buf8(r.w_size),R.arraySet(l,e,f-r.w_size,r.w_size,0),e=l,f=r.w_size),s=t.avail_in,u=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,c(r);r.lookahead>=ht;){i=r.strstart,n=r.lookahead-(ht-1);do{r.ins_h=(r.ins_h<=0;)t[e]=0}function n(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function a(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function o(t){return t<256?ut[t]:ut[256+(t>>>7)]}function s(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function u(t,e,r){t.bi_valid>X-r?(t.bi_buf|=e<>X-t.bi_valid,t.bi_valid+=r-X):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function f(t){16===t.bi_valid?(s(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function c(t,e){var r,i,n,a,o,s,u=e.dyn_tree,h=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(a=0;a<=V;a++)t.bl_count[a]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;rp&&(a=p,m++),u[2*i+1]=a,i>h||(t.bl_count[a]++,o=0,i>=d&&(o=c[i-d]),s=u[2*i],t.opt_len+=s*(a+o),f&&(t.static_len+=s*(l[2*i+1]+o)));if(0!==m){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(i=t.bl_count[a];0!==i;)n=t.heap[--r],n>h||(u[2*n+1]!==a&&(t.opt_len+=(a-u[2*n+1])*u[2*n],u[2*n+1]=a),i--)}}function d(t,e,r){var i,n,a=new Array(V+1),o=0;for(i=1;i<=V;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=e;n++){var s=t[2*n+1];0!==s&&(t[2*n]=l(a[s]++,s))}}function p(){var t,e,r,i,a,o=new Array(V+1);for(r=0,i=0;i>=7;i8?s(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function g(t,e,r,i){b(t),i&&(s(t,r),s(t,~r)),C.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function _(t,e,r,i){var n=2*e,a=2*r;return t[n]>1;r>=1;r--)v(t,a,r);n=u;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],v(t,a,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,a[2*n]=a[2*r]+a[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,a[2*r+1]=a[2*i+1]=n,t.heap[1]=n++,v(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],c(t,e),d(a,h,t.bl_count)}function E(t,e,r){var i,n,a=-1,o=e[1],s=0,u=7,h=4;for(0===o&&(u=138,h=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++s=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function k(t,e,r,i){var n;for(u(t,e-257,5),u(t,r-1,5),u(t,i-4,4),n=0;n>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return L;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return B;for(e=32;e0?(t.strm.data_type===D&&(t.strm.data_type=M(t)),w(t,t.l_desc),w(t,t.d_desc),o=S(t),n=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==e?I(t,e,r,i):t.strategy===O||a===n?(u(t,(z<<1)+(i?1:0),3),y(t,ot,st)):(u(t,(j<<1)+(i?1:0),3),k(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),y(t,t.dyn_ltree,t.dyn_dtree)),m(t),i&&b(t)}function P(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(ht[r]+H+1)]++,t.dyn_dtree[2*o(e)]++),t.last_lit===t.lit_bufsize-1}var C=t("../utils/common"),O=4,L=0,B=1,D=2,N=0,z=1,j=2,U=3,F=258,G=29,H=256,q=H+1+G,W=30,Z=19,Y=2*q+1,V=15,X=16,Q=7,J=256,K=16,$=17,tt=18,et=[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],rt=[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],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],at=512,ot=new Array(2*(q+2));i(ot);var st=new Array(2*W);i(st);var ut=new Array(at);i(ut);var ht=new Array(F-U+1);i(ht);var lt=new Array(G);i(lt);var ft,ct,dt,pt=new Array(W);i(pt);var mt=!1;r._tr_init=A,r._tr_stored_block=I,r._tr_flush_block=R,r._tr_tally=P,r._tr_align=T},{"../utils/common":89}],101:[function(t,e,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],102:[function(t,e,r){function i(t,e){if(t=t.replace(/\t+/g," ").trim(),!t)return null;var r=t.indexOf(" ");if(-1===r)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)});for(var a=[],o=0;oe.length-1)return 0;var i=e.readUInt8(r++),h=e.readInt32LE(r);switch(r+=4,i){case 1:t.info=n(e,r);break;case 2:t.common=a(e,r);break;case 3:t.pages=o(e,r,h);break;case 4:t.chars=s(e,r,h);break;case 5:t.kernings=u(e,r,h)}return 5+h}function n(t,e){var r={};r.size=t.readInt16LE(e);var i=t.readUInt8(e+2);return r.smooth=i>>7&1,r.unicode=i>>6&1,r.italic=i>>5&1,r.bold=i>>4&1,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=l(t,e+14),r}function a(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);t.readUInt8(e+10);return 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),r}function o(t,e,r){for(var i=[],n=h(t,e),a=n.length+1,o=r/a,s=0;s3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var a={kernings:[],chars:[]},o=0;o<5;o++)r+=i(a,t,r);return a}},{}],104:[function(t,e,r){function i(t){var e=n(t);return e.reduce(function(t,e){var r=a(e.nodeName);return t[r]=e.nodeValue,t},{})}function n(t){for(var e=[],r=0;r element");for(var a=n.getElementsByTagName("page"),u=0;u=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t){"string"!=typeof t&&(t+="");var e,r=0,i=-1,n=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!n){r=e+1;break}}else-1===i&&(n=!1,i=e+1);return-1===i?"":t.slice(r,i)}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===a(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),a=i(e.split("/")),o=Math.min(n.length,a.length),s=o,u=0;u=1;--a)if(e=t.charCodeAt(a),47===e){if(!n){i=a;break}}else n=!1;return-1===i?r?"/":".":r&&1===i?"/":t.slice(0,i)},r.basename=function(t,e){var r=i(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,i=-1,n=!0,a=0,o=t.length-1;o>=0;--o){var s=t.charCodeAt(o);if(47!==s)-1===i&&(n=!1,i=o+1),46===s?-1===e?e=o:1!==a&&(a=1):-1!==e&&(a=-1);else if(!n){r=o+1;break}}return-1===e||-1===i||0===a||1===a&&e===i-1&&e===r+1?"":t.slice(e,i)};var a="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:133}],108:[function(t,e,r){(function(r){"use strict";var i="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},n=t("http"),a=t("https"),o=t("url"),s=t("querystring"),u=t("zlib"),h=t("util"),l=function(t,e){if("string"!=typeof t&&!t.hasOwnProperty("url"))throw new Error("Missing url option from options for request method.");var h="object"===(void 0===t?"undefined":i(t))?o.parse(t.url):o.parse(t),l={hostname:h.hostname,port:h.port||("http:"===h.protocol.toLowerCase()?80:443),path:h.path,method:"GET",headers:{},auth:h.auth||null,parse:"none",stream:!1};if("object"===(void 0===t?"undefined":i(t))&&(l=Object.assign(l,t)),l.port=Number(l.port),l.hasOwnProperty("timeout")&&delete l.timeout,!0===l.compressed&&(l.headers["accept-encoding"]="gzip, deflate"),t.hasOwnProperty("form")){if("object"!==i(t.form))throw new Error("phin 'form' option must be of type Object if present.");var f=s.stringify(t.form);l.headers["Content-Type"]="application/x-www-form-urlencoded",l.headers["Content-Length"]=r.byteLength(f),t.data=f}var c=void 0,d=function(t){var i=t;!0===l.compressed&&("gzip"===t.headers["content-encoding"]?i=t.pipe(u.createGunzip()):"deflate"===t.headers["content-encoding"]&&(i=t.pipe(u.createInflate()))),!0===l.stream?(t.stream=i,e(null,t)):(t.body=new r([]),i.on("data",function(e){t.body=r.concat([t.body,e])}),i.on("end",function(){if(e){if("json"===l.parse)try{t.body=JSON.parse(t.body.toString())}catch(r){return void e("Invalid JSON received.",t)}e(null,t)}}))};switch(h.protocol.toLowerCase()){case"http:":c=n.request(l,d);break;case"https:":c=a.request(l,d);break;default:return void(e&&e(new Error("Invalid / unknown URL protocol. Expected HTTP or HTTPS."),null))}if("number"==typeof t.timeout&&c.setTimeout(t.timeout,function(){c.abort(),e(new Error("Timeout has been reached."),null),e=null}),c.on("error",function(t){e&&e(t,null)}),t.hasOwnProperty("data")){var p=t.data;if(!(t.data instanceof r)&&"object"===i(t.data)){var m=l.headers["content-type"]||l.headers["Content-Type"];if("application/x-www-form-urlencoded"===m)p=s.stringify(t.data);else try{p=JSON.stringify(t.data)}catch(t){e(new Error("Couldn't stringify object. (Likely due to a circular reference.)"),null)}}c.write(p)}c.end()};l.promisified=function(t,e){return new Promise(function(r,i){l(t,function(t,e){t?i(t):r(e)},e)})},h.promisify&&(l[h.promisify.custom]=l.promisified),e.exports=l}).call(this,t("buffer").Buffer)},{buffer:48,http:156,https:72,querystring:137,url:180,util:186,zlib:35}],109:[function(t,e,r){"use strict";function i(t,e,r,i,o,s){s||(s={});for(var u=void 0===s.threshold?.1:s.threshold,c=35215*u*u,d=0,p=0;pc)s.includeAA||!n(t,m,p,i,o,e)&&!n(e,m,p,i,o,t)?(r&&l(r,b,255,0,0),d++):r&&l(r,b,255,255,0);else if(r){var _=h(f(t,b),.1);l(r,b,_,_,_)}}return d}function n(t,e,r,i,o,s){for(var u,h,l,f,c=Math.max(e-1,0),d=Math.max(r-1,0),p=Math.min(e+1,i-1),m=Math.min(r+1,o-1),b=4*(r*i+e),g=0,_=0,v=0,y=0,w=0,E=c;E<=p;E++)for(var x=d;x<=m;x++)if(E!==e||x!==r){var S=a(t,t,b,4*(x*i+E),!0);if(0===S?g++:S<0?v++:S>0&&_++,g>2)return!1;s&&(Sw&&(w=S,l=E,f=x))}return!s||0!==v&&0!==_&&(!n(t,u,h,i,o)&&!n(s,u,h,i,o)||!n(t,l,f,i,o)&&!n(s,l,f,i,o))}function a(t,e,r,i,n){var a=t[r+3]/255,l=e[i+3]/255,f=h(t[r+0],a),c=h(t[r+1],a),d=h(t[r+2],a),p=h(e[i+0],l),m=h(e[i+1],l),b=h(e[i+2],l),g=o(f,c,d)-o(p,m,b);if(n)return g;var _=s(f,c,d)-s(p,m,b),v=u(f,c,d)-u(p,m,b);return.5053*g*g+.299*_*_+.1957*v*v}function o(t,e,r){return.29889531*t+.58662247*e+.11448223*r}function s(t,e,r){return.59597799*t-.2741761*e-.32180189*r}function u(t,e,r){return.21147017*t-.52261711*e+.31114694*r}function h(t,e){return 255+(t-255)*e}function l(t,e,r,i,n){t[e+0]=r,t[e+1]=i,t[e+2]=n,t[e+3]=255}function f(t,e){var r=t[e+3]/255,i=h(t[e+0],r),n=h(t[e+1],r),a=h(t[e+2],r);return o(i,n,a)}e.exports=i},{}],110:[function(t,e,r){(function(e){"use strict";function i(t,e){function r(){if(n===t.length)throw new Error("Ran out of data");var r,a,o,s,u,h,l,f,c=t[n];switch(n++,e){default:throw new Error("unrecognised depth");case 16:l=t[n],n++,i.push((c<<8)+l);break;case 4:l=15&c,f=c>>4,i.push(f,l);break;case 2:u=3&c,h=c>>2&3,l=c>>4&3,f=c>>6&3,i.push(f,l,h,u);break;case 1:r=1&c,a=c>>1&1,o=c>>2&1,s=c>>3&1,u=c>>4&1,h=c>>5&1,l=c>>6&1,f=c>>7&1,i.push(f,l,h,u,s,o,a,r)}}var i=[],n=0;return{get:function(t){for(;i.length0&&(this._paused=!1,this.emit("drain"))}.bind(this))},o.prototype.write=function(t,e){return this.writable?(r=i.isBuffer(t)?t:new i(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1);var r},o.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},o.prototype.destroySoon=o.prototype.end,o.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waiting on finished stream")),this.destroy()},o.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},o.prototype._processReadAllowingLess=function(t){this._reads.shift();var e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},o.prototype._processRead=function(t){this._reads.shift();for(var e=0,r=0,n=new i(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,n)},o.prototype._process=function(){try{for(;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))break;this._processRead(t)}}this._buffers&&this._buffers.length>0&&null===this._buffers[0]&&this._end()}catch(t){this.emit("error",t)}}}).call(this,t("_process"),t("buffer").Buffer)},{_process:133,buffer:48,stream:155,util:186}],113:[function(t,e,r){"use strict";e.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}},{}],114:[function(t,e,r){"use strict";var i=[];(function(){for(var t=0;t<256;t++){for(var e=t,r=0;r<8;r++)1&e?e=3988292384^e>>>1:e>>>=1;i[t]=e}})();var n=e.exports=function(){this._crc=-1};n.prototype.write=function(t){for(var e=0;e>>8;return!0},n.prototype.crc32=function(){return-1^this._crc},n.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e}},{}],115:[function(t,e,r){(function(r){"use strict";function i(t,e,r,i,n){for(var a=0;a=a?t[e+o-a]:0,u=t[e+o]-s;i[n+o]=u}}function o(t,e,r,i){for(var n=0,a=0;a=i?t[e+a-i]:0,s=t[e+a]-o;n+=Math.abs(s)}return n}function s(t,e,r,i,n){for(var a=0;a0?t[e+a-r]:0,s=t[e+a]-o;i[n+a]=s}}function u(t,e,r){for(var i=0,n=e+r,a=e;a0?t[a-r]:0,s=t[a]-o;i+=Math.abs(s)}return i}function h(t,e,r,i,n,a){for(var o=0;o=a?t[e+o-a]:0,u=e>0?t[e+o-r]:0,h=t[e+o]-(s+u>>1);i[n+o]=h}}function l(t,e,r,i){for(var n=0,a=0;a=i?t[e+a-i]:0,s=e>0?t[e+a-r]:0,u=t[e+a]-(o+s>>1);n+=Math.abs(u)}return n}function f(t,e,r,i,n,a){for(var o=0;o=a?t[e+o-a]:0,u=e>0?t[e+o-r]:0,h=e>0&&o>=a?t[e+o-(r+a)]:0,l=t[e+o]-d(s,u,h);i[n+o]=l}}function c(t,e,r,i){for(var n=0,a=0;a=i?t[e+a-i]:0,s=e>0?t[e+a-r]:0,u=e>0&&a>=i?t[e+a-(r+i)]:0,h=t[e+a]-d(o,s,u);n+=Math.abs(h)}return n}var d=t("./paeth-predictor"),p={0:i,1:a,2:s,3:h,4:f},m={0:n,1:o,2:u,3:l,4:c};e.exports=function(t,e,i,n,a){var o;if("filterType"in n&&-1!==n.filterType){if("number"!=typeof n.filterType)throw new Error("unrecognised filter types");o=[n.filterType]}else o=[0,1,2,3,4];16===n.bitDepth&&(a*=2);for(var s=e*a,u=0,h=0,l=new r((s+1)*i),f=o[0],c=0;c1)for(var d=1/0,b=0;bn?e[a-i]:0;e[a]=o+s}},o.prototype._unFilterType2=function(t,e,r){for(var i=this._lastLine,n=0;nn?e[o-i]:0,l=Math.floor((h+u)/2);e[o]=s+l}},o.prototype._unFilterType4=function(t,e,r){for(var i=this._xComparison,n=i-1,o=this._lastLine,s=0;sn?e[s-i]:0,f=s>n&&o?o[s-i]:0,c=a(l,h,f);e[s]=u+c}},o.prototype._reverseFilterLine=function(t){var e,i=t[0],n=this._images[this._imageIndex],a=n.byteWidth;if(0===i)e=t.slice(1,a+1);else switch(e=new r(a),i){case 1:this._unFilterType1(t,e,a);break;case 2:this._unFilterType2(t,e,a);break;case 3:this._unFilterType3(t,e,a);break;case 4:this._unFilterType4(t,e,a);break;default:throw new Error("Unrecognised filter type - "+i)}this.write(e),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=e,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this,t("buffer").Buffer)},{"./interlace":120,"./paeth-predictor":124,buffer:48}],119:[function(t,e,r){(function(t){"use strict";function r(t,e,r,i,n){for(var a=0,o=0;o0&&f>0&&r.push({width:l,height:f,index:u})}return r},r.getInterlaceIterator=function(t){return function(e,r,n){var a=e%i[n].x.length,o=(e-a)/i[n].x.length*8+i[n].x[a],s=r%i[n].y.length,u=(r-s)/i[n].y.length*8+i[n].y[s];return 4*o+u*t*4}}},{}],121:[function(t,e,r){(function(r){"use strict";var i=t("util"),n=t("stream"),a=t("./constants"),o=t("./packer"),s=e.exports=function(t){n.call(this);var e=t||{};this._packer=new o(e),this._deflate=this._packer.createDeflate(),this.readable=!0};i.inherits(s,n),s.prototype.pack=function(t,e,i,n){this.emit("data",new r(a.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,i)),n&&this.emit("data",this._packer.packGAMA(n));var o=this._packer.filterData(t,e,i);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(o)}}).call(this,t("buffer").Buffer)},{"./constants":113,"./packer":123,buffer:48,stream:155,util:186}],122:[function(t,e,r){(function(r){"use strict";var i=!0,n=t("zlib");n.deflateSync||(i=!1);var a=t("./constants"),o=t("./packer");e.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 s=e||{},u=new o(s),h=[];h.push(new r(a.PNG_SIGNATURE)),h.push(u.packIHDR(t.width,t.height)),t.gamma&&h.push(u.packGAMA(t.gamma));var l=u.filterData(t.data,t.width,t.height),f=n.deflateSync(l,u.getDeflateOptions());if(l=null,!f||!f.length)throw new Error("bad png - invalid compressed data response");return h.push(u.packIDAT(f)),h.push(u.packIEND()),r.concat(h)}}).call(this,t("buffer").Buffer)},{"./constants":113,"./packer":123,buffer:48,zlib:35}],123:[function(t,e,r){(function(r){"use strict";var i=t("./constants"),n=t("./crc"),a=t("./bitpacker"),o=t("./filter-pack"),s=t("zlib"),u=e.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:i.COLORTYPE_COLOR_ALPHA,t.inputColorType="number"==typeof t.inputColorType?t.inputColorType:i.COLORTYPE_COLOR_ALPHA,-1===[i.COLORTYPE_GRAYSCALE,i.COLORTYPE_COLOR,i.COLORTYPE_COLOR_ALPHA,i.COLORTYPE_ALPHA].indexOf(t.colorType))throw new Error("option color type:"+t.colorType+" is not supported at present");if(-1===[i.COLORTYPE_GRAYSCALE,i.COLORTYPE_COLOR,i.COLORTYPE_COLOR_ALPHA,i.COLORTYPE_ALPHA].indexOf(t.inputColorType))throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(8!==t.bitDepth&&16!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(t,e,r){var n=a(t,e,r,this._options),s=i.COLORTYPE_TO_BPP_MAP[this._options.colorType],u=o(n,e,r,this._options,s);return u},u.prototype._packChunk=function(t,e){var i=e?e.length:0,a=new r(i+12);return a.writeUInt32BE(i,0),a.writeUInt32BE(t,4),e&&e.copy(a,8),a.writeInt32BE(n.crc32(a.slice(4,a.length-4)),a.length-4),a},u.prototype.packGAMA=function(t){var e=new r(4);return e.writeUInt32BE(Math.floor(t*i.GAMMA_DIVISION),0),this._packChunk(i.TYPE_gAMA,e)},u.prototype.packIHDR=function(t,e){var n=new r(13);return n.writeUInt32BE(t,0),n.writeUInt32BE(e,4),n[8]=this._options.bitDepth,n[9]=this._options.colorType,n[10]=0,n[11]=0,n[12]=0,this._packChunk(i.TYPE_IHDR,n)},u.prototype.packIDAT=function(t){return this._packChunk(i.TYPE_IDAT,t)},u.prototype.packIEND=function(){return this._packChunk(i.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./bitpacker":111,"./constants":113,"./crc":114,"./filter-pack":115,buffer:48,zlib:35}],124:[function(t,e,r){"use strict";e.exports=function(t,e,r){var i=t+e-r,n=Math.abs(i-t),a=Math.abs(i-e),o=Math.abs(i-r);return n<=a&&n<=o?t:a<=o?e:r}},{}],125:[function(t,e,r){"use strict";var i=t("util"),n=t("zlib"),a=t("./chunkstream"),o=t("./filter-parse-async"),s=t("./parser"),u=t("./bitmapper"),h=t("./format-normaliser"),l=e.exports=function(t){a.call(this),this._parser=new s(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)}),this._options=t,this.writable=!0,this._parser.start()};i.inherits(l,a),l.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0},l.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=n.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=1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3),r=e*this._bitmapInfo.height,i=Math.max(r,n.Z_MIN_CHUNK);this._inflate=n.createInflate({chunkSize:i});var a=r,o=this.emit.bind(this,"error");this._inflate.on("error",function(t){a&&o(t)}),this._filter.on("complete",this._complete.bind(this));var s=this._filter.write.bind(this._filter);this._inflate.on("data",function(t){a&&(t.length>a&&(t=t.slice(0,a)),a-=t.length,s(t))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},l.prototype._handleMetaData=function(t){this.emit("metadata",t),this._bitmapInfo=Object.create(t),this._filter=new o(this._bitmapInfo)},l.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},l.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"),this.destroySoon())},l.prototype._complete=function(t){if(!this.errord){try{var e=u.dataToBitMap(t,this._bitmapInfo),r=h(e,this._bitmapInfo);e=null}catch(t){return void this._handleError(t)}this.emit("parsed",r)}}},{"./bitmapper":110,"./chunkstream":112,"./filter-parse-async":116,"./format-normaliser":119,"./parser":127,util:186,zlib:35}],126:[function(t,e,r){(function(r){"use strict";var i=!0,n=t("zlib"),a=t("./sync-inflate");n.deflateSync||(i=!1);var o=t("./sync-reader"),s=t("./filter-parse-sync"),u=t("./parser"),h=t("./bitmapper"),l=t("./format-normaliser");e.exports=function(t,e){function f(t){g=t}function c(t){_=t}function d(t){_.transColor=t}function p(t){_.palette=t}function m(t){v=t}function b(t){y.push(t)}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 g,_,v,y=[],w=new o(t),E=new u(e,{read:w.read.bind(w),error:f,metadata:c,gamma:m,palette:p,transColor:d,inflateData:b});if(E.start(),w.process(),g)throw g;var x,S=r.concat(y);if(y.length=0,_.interlace)x=n.inflateSync(S);else{var k=1+(_.width*_.bpp*_.depth+7>>3),M=k*_.height;x=a(S,{chunkSize:M,maxLength:M})}if(S=null,!x||!x.length)throw new Error("bad png - invalid inflate data response");var A=s.process(x,_);S=null;var I=h.dataToBitMap(A,_);A=null;var T=l(I,_);return _.data=T,_.gamma=v||0,_}}).call(this,t("buffer").Buffer)},{"./bitmapper":110,"./filter-parse-sync":117,"./format-normaliser":119,"./parser":127,"./sync-inflate":130,"./sync-reader":131,buffer:48,zlib:35}],127:[function(t,e,r){(function(r){"use strict";var i=t("./constants"),n=t("./crc"),a=e.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,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};a.prototype.start=function(){this.read(i.PNG_SIGNATURE.length,this._parseSignature.bind(this))},a.prototype._parseSignature=function(t){for(var e=i.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(r):this._handleChunkEnd()},a.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},a.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this,t("buffer").Buffer)},{"./constants":113,"./crc":114,buffer:48}],128:[function(t,e,r){"use strict";var i=t("./parser-sync"),n=t("./packer-sync");r.read=function(t,e){return i(t,e||{})},r.write=function(t,e){return n(t,e)}},{"./packer-sync":122,"./parser-sync":126}],129:[function(t,e,r){(function(e,i){"use strict";var n=t("util"),a=t("stream"),o=t("./parser-async"),s=t("./packer-async"),u=t("./png-sync"),h=r.PNG=function(t){a.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?new i(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new o(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"))};n.inherits(h,a),h.sync=u,h.prototype.pack=function(){return this.data&&this.data.length?(e.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},h.prototype.parse=function(t,e){var r,i;e&&(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));return this.end(t),this},h.prototype.write=function(t){return this._parser.write(t),!0},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(){this._parser.writable||this._packer.readable||this.emit("close")},h.bitblt=function(t,e,r,i,n,a,o,s){if(r|=0,i|=0,n|=0,a|=0,o|=0,s|=0,r>t.width||i>t.height||r+n>t.width||i+a>t.height)throw new Error("bitblt reading outside image");if(o>e.width||s>e.height||o+n>e.width||s+a>e.height)throw new Error("bitblt writing outside image");for(var u=0;u=0,"have should not go down"),r>0){var i=o._buffer.slice(o._offset,o._offset+r);if(o._offset+=r,i.length>c&&(i=i.slice(0,c)),m.push(i),b+=i.length,c-=i.length,0===c)return!1}return(0===e||o._offset>=o._chunkSize)&&(h=o._chunkSize,o._offset=0,o._buffer=n.allocUnsafe(o._chunkSize)),0===e&&(p+=u-t,u=t,!0)}}if("function"==typeof r)return f.Inflate._processChunk.call(this,t,e,r);var a,o=this,u=t&&t.length,h=this._chunkSize-this._offset,c=this._maxLength,p=0,m=[],b=0;this.on("error",function(t){a=t}),l(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(e,t,p,u,this._buffer,this._offset,h);g=g||this._writeState}while(!this._hadError&&i(g[0],g[1]));if(this._hadError)throw a;if(b>=d)throw s(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+d.toString(16)+" bytes");var _=n.concat(m,b);return s(this),_},c.inherits(a,f.Inflate),e.exports=r=h,r.Inflate=a,r.createInflate=o,r.inflateSync=h}).call(this,t("_process"),t("buffer").Buffer)},{_process:133,assert:25,buffer:48,util:186,zlib:35}],131:[function(t,e,r){"use strict";var i=e.exports=function(t){this._buffer=t,this._reads=[]};i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},i.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){var t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;this._reads.shift();var e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0}},{}],132:[function(t,e,r){(function(t){"use strict";function r(e,r,i,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,i)});case 4:return t.nextTick(function(){e.call(null,r,i,n)});default:for(a=new Array(s-1),o=0;o1)for(var r=1;r1&&(i=r[0]+"@",t=r[1]),t=t.replace(O,".");var n=t.split("."),a=o(n,e).join(".");return i+a}function u(t){for(var e,r,i=[],n=0,a=t.length;n=55296&&e<=56319&&n65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t),e}).join("")}function l(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:x}function f(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function c(t,e,r){var i=0;for(t=r?D(t/A):t>>1,t+=D(t/e);t>B*k>>1;i+=x)t=D(t/B);return D(i+(B+1)*t/(t+M))}function d(t){var e,r,i,n,o,s,u,f,d,p,m=[],b=t.length,g=0,_=T,v=I;for(r=t.lastIndexOf(R),r<0&&(r=0),i=0;i=128&&a("not-basic"),m.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=b&&a("invalid-input"),f=l(t.charCodeAt(n++)),(f>=x||f>D((E-g)/s))&&a("overflow"),g+=f*s,d=u<=v?S:u>=v+k?k:u-v,!(fD(E/p)&&a("overflow"),s*=p;e=m.length+1,v=c(g-o,e,0==o),D(g/e)>E-_&&a("overflow"),_+=D(g/e),g%=e,m.splice(g++,0,_)}return h(m)}function p(t){var e,r,i,n,o,s,h,l,d,p,m,b,g,_,v,y=[];for(t=u(t),b=t.length,e=T,r=0,o=I,s=0;s=e&&mD((E-r)/g)&&a("overflow"),r+=(h-e)*g,e=h,s=0;sE&&a("overflow"),m==e){for(l=r,d=x;p=d<=o?S:d>=o+k?k:d-o,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},B=x-S,D=Math.floor,N=String.fromCharCode;if(y={version:"1.4.1",ucs2:{decode:u,encode:h},decode:d,encode:p,toASCII:b,toUnicode:m},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return y});else if(g&&_)if(r.exports==g)_.exports=y;else for(w in y)y.hasOwnProperty(w)&&(g[w]=y[w]);else n.punycode=y})(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{}],135:[function(t,e,r){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var h=t.length;u>0&&h>u&&(h=u);for(var l=0;l=0?(f=m.substr(0,b),c=m.substr(b+1)):(f=m,c=""),d=decodeURIComponent(f),p=decodeURIComponent(c),i(o,d)?n(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],136:[function(t,e,r){"use strict";function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===N.prototype||(e=n(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):l(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?l(t,s,e,!1):_(t,s)):l(t,s,e,!1))):i||(s.reading=!1));return c(s)}function l(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&b(t)),_(t,e)}function f(t,e){var r;return a(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function c(t){return!t.ended&&(t.needReadable||t.length=Z?t=Z:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function p(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=d(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function m(t,e){if(!e.ended){ if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,b(t)}}function b(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(F("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?C.nextTick(g,t):g(t))}function g(t){F("emit readable"),t.emit("readable"),S(t)}function _(t,e){e.readingMore||(e.readingMore=!0,C.nextTick(v,t,e))}function v(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=M(t,e.buffer,e.decoder),r);var r}function M(t,e,r){var i;return ta.length?a.length:t;if(o===a.length?n+=a:n+=a.slice(0,t),t-=o,0===t){o===a.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=a.slice(o));break}++i}return e.length-=i,n}function I(t,e){var r=N.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var a=i.data,o=t>a.length?a.length:t;if(a.copy(r,r.length-t,0,o),t-=o,0===t){o===a.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=a.slice(o));break}++n}return e.length-=n,r}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,C.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function P(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return F("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):b(this),null;if(t=p(t,e),0===t&&e.ended)return 0===e.length&&T(this),null;var i,n=e.needReadable;return F("need readable",n),(0===e.length||e.length-t0?k(t,e):null,null===i?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&T(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(t,e){function i(t,e){F("onunpipe"),t===c&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,a())}function n(){F("onend"),t.end()}function a(){F("cleanup"),t.removeListener("close",h),t.removeListener("finish",l),t.removeListener("drain",b),t.removeListener("error",u),t.removeListener("unpipe",i),c.removeListener("end",n),c.removeListener("end",f),c.removeListener("data",s),g=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||b()}function s(e){F("ondata"),_=!1;var r=t.write(e);!1!==r||_||((1===d.pipesCount&&d.pipes===t||d.pipesCount>1&&-1!==P(d.pipes,t))&&!g&&(F("false write response, pause",c._readableState.awaitDrain),c._readableState.awaitDrain++,_=!0),c.pause())}function u(e){F("onerror",e),f(),t.removeListener("error",u),0===B(t,"error")&&t.emit("error",e)}function h(){t.removeListener("finish",l),f()}function l(){F("onfinish"),t.removeListener("close",h),f()}function f(){F("unpipe"),c.unpipe(t)}var c=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,F("pipe count=%d opts=%j",d.pipesCount,e);var p=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr,m=p?n:f;d.endEmitted?C.nextTick(m):c.once("end",m),t.on("unpipe",i);var b=y(c);t.on("drain",b);var g=!1,_=!1;return c.on("data",s),o(t,"error",u),t.once("close",h),t.once("finish",l),t.emit("pipe",c),d.flowing||(F("pipe resume"),c.resume()),t},u.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a-1?n:I.nextTick;l.WritableState=h;var P=t("core-util-is");P.inherits=t("inherits");var C,O={deprecate:t("util-deprecate")},L=t("./internal/streams/stream"),B=t("safe-buffer").Buffer,D=i.Uint8Array||function(){},N=t("./internal/streams/destroy");P.inherits(l,L),h.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(h.prototype,"buffer",{get:O.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(C=Function.prototype[Symbol.hasInstance],Object.defineProperty(l,Symbol.hasInstance,{value:function(t){return!!C.call(this,t)||this===l&&(t&&t._writableState instanceof h)}})):C=function(t){return t instanceof this},l.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},l.prototype.write=function(t,e,r){var i=this._writableState,n=!1,a=!i.objectMode&&s(t);return a&&!B.isBuffer(t)&&(t=o(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=u),i.ended?f(this,r):(a||c(this,i,t,r))&&(i.pendingcb++,n=p(this,i,a,t,e,r)),n},l.prototype.cork=function(){var t=this._writableState;t.corked++},l.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(this,t))},l.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),l.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},l.prototype._writev=null,l.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||M(this,i,r)},Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),l.prototype.destroy=N.destroy,l.prototype._undestroy=N.undestroy,l.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{},t("timers").setImmediate)},{"./_stream_duplex":139,"./internal/streams/destroy":145,"./internal/streams/stream":146,_process:133,"core-util-is":51,inherits:75,"process-nextick-args":132,"safe-buffer":147,timers:176,"util-deprecate":183}],144:[function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e,r){t.copy(e,r)}var a=t("safe-buffer").Buffer,o=t("util");e.exports=function(){function t(){i(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var e=a.allocUnsafe(t>>>0),r=this.head,i=0;r;)n(r.data,e,i),i+=r.data.length,r=r.next;return e},t}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var t=o.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":147,util:33}],145:[function(t,e,r){"use strict";function i(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||o.nextTick(a,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(o.nextTick(a,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(t,e){t.emit("error",e)}var o=t("process-nextick-args");e.exports={destroy:i,undestroy:n}},{"process-nextick-args":132}],146:[function(t,e,r){e.exports=t("events").EventEmitter},{events:52}],147:[function(t,e,r){function i(t,e){for(var r in t)e[r]=t[r]}function n(t,e,r){return o(t,e,r)}var a=t("buffer"),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=a:(i(a,r),r.Buffer=n),i(o,n),n.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,r)},n.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=o(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},n.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return a.SlowBuffer(t)}},{buffer:48}],148:[function(t,e,r){"use strict";function i(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function n(t){var e=i(t);if("string"!=typeof e&&(_.isEncoding===v||!v(t)))throw new Error("Unknown encoding: "+t);return e||t}function a(t){var e;switch(this.encoding=n(t),this.encoding){case"utf16le":this.text=c,this.end=d,e=4;break;case"utf8":this.fillLast=h,e=4;break;case"base64":this.text=p,this.end=m,e=3;break;default:return this.write=b,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=_.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t,e,r){var i=e.length-1;if(i=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0))}function u(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}function h(t){var e=this.lastTotal-this.lastNeed,r=u(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){var r=s(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function c(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function d(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function p(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function m(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function b(t){return t.toString(this.encoding)}function g(t){return t&&t.length?this.write(t):""}var _=t("safe-buffer").Buffer,v=_.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),void 0===e)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0;--i){var n=this.tryEntries[i],a=n.completion;if("root"===n.tryLoc)return e("end");if(n.tryLoc<=this.prev){var o=g.call(n,"catchLoc"),s=g.call(n,"finallyLoc");if(o&&s){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&g.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),f(r),M}},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("throw"===i.type){var n=i.arg;f(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:d(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=m),M}},t}("object"==typeof e?e.exports:{});try{regeneratorRuntime=i}catch(t){Function("r","regeneratorRuntime = r")(i)}},{}],154:[function(t,e,r){function i(t,e){for(var r in t)e[r]=t[r]}function n(t,e,r){return o(t,e,r)}var a=t("buffer"),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=a:(i(a,r),r.Buffer=n),n.prototype=Object.create(o.prototype),i(o,n),n.from=function(t,e,r){ if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,r)},n.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=o(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},n.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return a.SlowBuffer(t)}},{buffer:48}],155:[function(t,e,r){function i(){n.call(this)}e.exports=i;var n=t("events").EventEmitter,a=t("inherits");a(i,n),i.Readable=t("readable-stream/readable.js"),i.Writable=t("readable-stream/writable.js"),i.Duplex=t("readable-stream/duplex.js"),i.Transform=t("readable-stream/transform.js"),i.PassThrough=t("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&h.pause&&h.pause()}function i(){h.readable&&h.resume&&h.resume()}function a(){l||(l=!0,t.end())}function o(){l||(l=!0,"function"==typeof t.destroy&&t.destroy())}function s(t){if(u(),0===n.listenerCount(this,"error"))throw t}function u(){h.removeListener("data",r),t.removeListener("drain",i),h.removeListener("end",a),h.removeListener("close",o),h.removeListener("error",s),t.removeListener("error",s),h.removeListener("end",u),h.removeListener("close",u),t.removeListener("close",u)}var h=this;h.on("data",r),t.on("drain",i),t._isStdio||e&&!1===e.end||(h.on("end",a),h.on("close",o));var l=!1;return h.on("error",s),t.on("error",s),h.on("end",u),h.on("close",u),t.on("close",u),t.emit("pipe",h),t}},{events:52,inherits:75,"readable-stream/duplex.js":138,"readable-stream/passthrough.js":149,"readable-stream/readable.js":150,"readable-stream/transform.js":151,"readable-stream/writable.js":152}],156:[function(t,e,r){(function(e){var i=t("./lib/request"),n=t("./lib/response"),a=t("xtend"),o=t("builtin-status-codes"),s=t("url"),u=r;u.request=function(t,r){t="string"==typeof t?s.parse(t):a(t);var n=-1===e.location.protocol.search(/^https?:$/)?"http:":"",o=t.protocol||n,u=t.hostname||t.host,h=t.port,l=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?o+"//"+u:"")+(h?":"+h:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var f=new i(t);return r&&f.on("response",r),f},u.get=function(t,e){var r=u.request(t,e);return r.end(),r},u.ClientRequest=i,u.IncomingMessage=n.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=o,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{"./lib/request":158,"./lib/response":159,"builtin-status-codes":50,url:180,xtend:189}],157:[function(t,e,r){(function(t){function e(){if(void 0!==a)return a;if(t.XMLHttpRequest){a=new t.XMLHttpRequest;try{a.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){a=null}}else a=null;return a}function i(t){var r=e();if(!r)return!1;try{return r.responseType=t,r.responseType===t}catch(t){}return!1}function n(t){return"function"==typeof t}var a;r.fetch=n(t.fetch)&&n(t.ReadableStream),r.writableStream=n(t.WritableStream),r.abortController=n(t.AbortController),r.arraybuffer=r.fetch||i("arraybuffer"),r.msstream=!r.fetch&&i("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&i("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!e()&&n(e().overrideMimeType),a=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{}],158:[function(t,e,r){(function(r,i,n){function a(t,e){return s.fetch&&e?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&t?"arraybuffer":"text"}function o(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}var s=t("./capability"),u=t("inherits"),h=t("./response"),l=t("readable-stream"),f=h.IncomingMessage,c=h.readyStates,d=e.exports=function(t){var e,r=this;l.Writable.call(r),r._opts=t,r._body=[],r._headers={},t.auth&&r.setHeader("Authorization","Basic "+n.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){r.setHeader(e,t.headers[e])});var i=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!s.abortController)i=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!s.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}r._mode=a(e,i),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};u(d,l.Writable),d.prototype.setHeader=function(t,e){var r=this,i=t.toLowerCase();-1===p.indexOf(i)&&(r._headers[i]={name:t,value:e})},d.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},d.prototype.removeHeader=function(t){var e=this;delete e._headers[t.toLowerCase()]},d.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts,n=t._headers,a=null;"GET"!==e.method&&"HEAD"!==e.method&&(a=new Blob(t._body,{type:(n["content-type"]||{}).value||""}));var o=[];if(Object.keys(n).forEach(function(t){var e=n[t].name,r=n[t].value;Array.isArray(r)?r.forEach(function(t){o.push([e,t])}):o.push([e,r])}),"fetch"===t._mode){var u=null;if(s.abortController){var h=new AbortController;u=h.signal,t._fetchAbortController=h,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=i.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))}i.fetch(t._opts.url,{method:t._opts.method,headers:o,body:a||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:u}).then(function(e){t._fetchResponse=e,t._connect()},function(e){i.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",e)})}else{var l=t._xhr=new i.XMLHttpRequest;try{l.open(t._opts.method,t._opts.url,!0)}catch(e){return void r.nextTick(function(){t.emit("error",e)})}"responseType"in l&&(l.responseType=t._mode),"withCredentials"in l&&(l.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(l.timeout=e.requestTimeout,l.ontimeout=function(){t.emit("requestTimeout")}),o.forEach(function(t){l.setRequestHeader(t[0],t[1])}),t._response=null,l.onreadystatechange=function(){switch(l.readyState){case c.LOADING:case c.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(l.onprogress=function(){t._onXHRProgress()}),l.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{l.send(a)}catch(e){return void r.nextTick(function(){t.emit("error",e)})}}}},d.prototype._onXHRProgress=function(){var t=this;o(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress())},d.prototype._connect=function(){var t=this;t._destroyed||(t._response=new f(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},d.prototype._write=function(t,e,r){var i=this;i._body.push(t),r()},d.prototype.abort=d.prototype.destroy=function(){var t=this;t._destroyed=!0,i.clearTimeout(t._fetchTimer),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort()},d.prototype.end=function(t,e,r){var i=this;"function"==typeof t&&(r=t,t=void 0),l.Writable.prototype.end.call(i,t,e,r)},d.prototype.flushHeaders=function(){},d.prototype.setTimeout=function(){},d.prototype.setNoDelay=function(){},d.prototype.setSocketKeepAlive=function(){};var p=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{},t("buffer").Buffer)},{"./capability":157,"./response":159,_process:133,buffer:48,inherits:75,"readable-stream":174}],159:[function(t,e,r){(function(e,i,n){var a=t("./capability"),o=t("inherits"),s=t("readable-stream"),u=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=r.IncomingMessage=function(t,r,o,u){var h=this;if(s.Readable.call(h),h._mode=o,h.headers={},h.rawHeaders=[],h.trailers={},h.rawTrailers=[],h.on("end",function(){e.nextTick(function(){h.emit("close")})}),"fetch"===o){if(h._fetchResponse=r,h.url=r.url,h.statusCode=r.status,h.statusMessage=r.statusText,r.headers.forEach(function(t,e){h.headers[e.toLowerCase()]=t,h.rawHeaders.push(e,t)}),a.writableStream){var l=new WritableStream({write:function(t){return new Promise(function(e,r){h._destroyed?r():h.push(n.from(t))?e():h._resumeFetch=e})},close:function(){i.clearTimeout(u),h._destroyed||h.push(null)},abort:function(t){h._destroyed||h.emit("error",t)}});try{return void r.body.pipeTo(l).catch(function(t){i.clearTimeout(u),h._destroyed||h.emit("error",t)})}catch(t){}}var f=r.body.getReader();function c(){f.read().then(function(t){if(!h._destroyed){if(t.done)return i.clearTimeout(u),void h.push(null);h.push(n.from(t.value)),c()}}).catch(function(t){i.clearTimeout(u),h._destroyed||h.emit("error",t)})}c()}else{h._xhr=t,h._pos=0,h.url=t.responseURL,h.statusCode=t.status,h.statusMessage=t.statusText;var d=t.getAllResponseHeaders().split(/\r?\n/);if(d.forEach(function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===h.headers[r]&&(h.headers[r]=[]),h.headers[r].push(e[2])):void 0!==h.headers[r]?h.headers[r]+=", "+e[2]:h.headers[r]=e[2],h.rawHeaders.push(e[1],e[2])}}),h._charset="x-user-defined",!a.overrideMimeType){var p=h.rawHeaders["mime-type"];if(p){var m=p.match(/;\s*charset=([^;])(;|$)/);m&&(h._charset=m[1].toLowerCase())}h._charset||(h._charset="utf-8")}}};o(h,s.Readable),h.prototype._read=function(){var t=this,e=t._resumeFetch;e&&(t._resumeFetch=null,e())},h.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text":if(r=e.responseText,r.length>t._pos){var a=r.substr(t._pos);if("x-user-defined"===t._charset){for(var o=n.alloc(a.length),s=0;st._pos&&(t.push(n.from(new Uint8Array(h.result.slice(t._pos)))),t._pos=h.result.byteLength)},h.onload=function(){t.push(null)},h.readAsArrayBuffer(r)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{},t("buffer").Buffer)},{"./capability":157,_process:133,buffer:48,inherits:75,"readable-stream":174}],160:[function(t,e,r){"use strict";function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function n(t,e,r){function n(t,r,i){return"string"==typeof e?e:e(t,r,i)}r||(r=Error);var a=function(t){function e(e,r,i){return t.call(this,n(e,r,i))||this}return i(e,t),e}(r);a.prototype.name=r.name,a.prototype.code=t,h[t]=a}function a(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}function o(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function s(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function u(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}var h={};n("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(t,e,r){var i,n;if("string"==typeof e&&o(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",s(t," argument"))n="The ".concat(t," ").concat(i," ").concat(a(e,"type"));else{var h=u(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(a(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=h},{}],161:[function(t,e,r){(function(t){"use strict";function r(e){if(!n.has(e)){var r=e+" is an experimental feature. This feature could change at any time";n.add(e),t.emitWarning(r,"ExperimentalWarning")}}function i(){}var n=new Set;e.exports.emitExperimentalWarning=t.emitWarning?r:i}).call(this,t("_process"))},{_process:133}],162:[function(t,e,r){(function(r){"use strict";function i(t){if(!(this instanceof i))return new i(t);s.call(this,t),u.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",n)))}function n(){this._writableState.ended||r.nextTick(a,this)}function a(t){t.end()}var o=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=i;var s=t("./_stream_readable"),u=t("./_stream_writable");t("inherits")(i,s);for(var h=o(u.prototype),l=0;l0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===O.prototype||(e=n(e)),i)s.endEmitted?t.emit("error",new Z):l(t,s,e,!0);else if(s.ended)t.emit("error",new q);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?l(t,s,e,!1):g(t,s)):l(t,s,e,!1)}else i||(s.reading=!1,g(t,s));return!s.ended&&(s.length=Q?t=Q:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function d(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=c(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function p(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?m(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,b(t)))}}function m(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(R("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(b,t))}function b(t){var e=t._readableState;R("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||t.emit("readable"),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,S(t)}function g(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(_,t,e))}function _(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function w(t){R("readable nexttick read 0"),t.read(0)}function E(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(x,t,e))}function x(t,e){R("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),S(t),e.flowing&&!e.reading&&t.read(0)}function S(t){var e=t._readableState;for(R("flow",e.flowing);e.flowing&&null!==t.read(););}function k(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function M(t){var e=t._readableState;R("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(A,e,t))}function A(t,e){R("endReadableNT",t.endEmitted,t.length),t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function I(t,e){for(var r=0,i=t.length;r=e.highWaterMark:e.length>0)||e.ended))return R("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?M(this):m(this),null;if(t=d(t,e),0===t&&e.ended)return 0===e.length&&M(this),null;var i,n=e.needReadable;return R("need readable",n),(0===e.length||e.length-t0?k(t,e):null,null===i?(e.needReadable=!0,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&M(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(t){this.emit("error",new W("_read()"))},u.prototype.pipe=function(t,e){function i(t,e){R("onunpipe"),t===c&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,a())}function n(){R("onend"),t.end()}function a(){R("cleanup"),t.removeListener("close",h),t.removeListener("finish",l),t.removeListener("drain",b),t.removeListener("error",u),t.removeListener("unpipe",i),c.removeListener("end",n),c.removeListener("end",f),c.removeListener("data",s),g=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||b()}function s(e){R("ondata");var r=t.write(e);R("dest.write",r),!1===r&&((1===d.pipesCount&&d.pipes===t||d.pipesCount>1&&-1!==I(d.pipes,t))&&!g&&(R("false write response, pause",d.awaitDrain),d.awaitDrain++),c.pause())}function u(e){R("onerror",e),f(),t.removeListener("error",u),0===P(t,"error")&&t.emit("error",e)}function h(){t.removeListener("finish",l),f()}function l(){R("onfinish"),t.removeListener("close",h),f()}function f(){R("unpipe"),c.unpipe(t)}var c=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,R("pipe count=%d opts=%j",d.pipesCount,e);var p=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr,m=p?n:f;d.endEmitted?r.nextTick(m):c.once("end",m),t.on("unpipe",i);var b=v(c);t.on("drain",b);var g=!1;return c.on("data",s),o(t,"error",u),t.once("close",h),t.once("finish",l),t.emit("pipe",c),d.flowing||(R("pipe resume"),c.resume()),t},u.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,R("on readable",n.length,n.reading),n.length?m(this):n.reading||r.nextTick(w,this))),i},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(t,e){var i=C.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(y,this),i},u.prototype.removeAllListeners=function(t){var e=C.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(y,this),e},u.prototype.resume=function(){var t=this._readableState;return t.flowing||(R("resume"),t.flowing=!t.readableListening,E(this,t)),t.paused=!1,this},u.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},u.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",function(){if(R("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(n){if(R("wrapped data"),r.decoder&&(n=r.decoder.write(n)),(!r.objectMode||null!=n)&&(r.objectMode||n&&n.length)){var a=e.push(n);a||(i=!0,t.pause())}}),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var a=0;a-1))throw new q(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),h.prototype._write=function(t,e,r){r(new z("_write()"))},h.prototype._writev=null,h.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||k(this,i,r),this},Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),h.prototype.destroy=O.destroy,h.prototype._undestroy=O.undestroy,h.prototype._destroy=function(t,e){e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{"../errors":160,"./_stream_duplex":162,"./internal/streams/destroy":169,"./internal/streams/state":172,"./internal/streams/stream":173,_process:133,buffer:48,inherits:75,"util-deprecate":183}],167:[function(t,e,r){(function(r){"use strict";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e){return{value:t,done:e}}function a(t){var e=t[l];if(null!==e){var r=t[b].read();null!==r&&(t[p]=null,t[l]=null,t[f]=null,e(n(r,!1)))}}function o(t){r.nextTick(a,t)}function s(t,e){return function(r,i){t.then(function(){e[d]?r(n(void 0,!0)):e[m](r,i)},i)}}var u,h=t("./end-of-stream"),l=Symbol("lastResolve"),f=Symbol("lastReject"),c=Symbol("error"),d=Symbol("ended"),p=Symbol("lastPromise"),m=Symbol("handlePromise"),b=Symbol("stream"),g=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((u={get stream(){return this[b]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[d])return Promise.resolve(n(void 0,!0));if(this[b].destroyed)return new Promise(function(e,i){r.nextTick(function(){t[c]?i(t[c]):e(n(void 0,!0))})});var i,a=this[p];if(a)i=new Promise(s(a,this));else{var o=this[b].read();if(null!==o)return Promise.resolve(n(o,!1));i=new Promise(this[m])}return this[p]=i,i}},i(u,Symbol.asyncIterator,function(){return this}),i(u,"return",function(){var t=this;return new Promise(function(e,r){t[b].destroy(null,function(t){t?r(t):e(n(void 0,!0))})})}),u),g),v=function(t){var e,r=Object.create(_,(e={},i(e,b,{value:t,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,f,{value:null,writable:!0}),i(e,c,{value:null,writable:!0}),i(e,d,{value:t._readableState.endEmitted,writable:!0}),i(e,m,{value:function(t,e){var i=r[b].read();i?(r[p]=null,r[l]=null,r[f]=null,t(n(i,!1))):(r[l]=t,r[f]=e)},writable:!0}),e));return r[p]=null,h(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[f];return null!==e&&(r[p]=null,r[l]=null,r[f]=null,e(t)),void(r[c]=t)}var i=r[l];null!==i&&(r[p]=null,r[l]=null,r[f]=null,i(n(void 0,!0))),r[d]=!0}),t.on("readable",o.bind(null,r)),r};e.exports=v}).call(this,t("_process"))},{"./end-of-stream":170,_process:133}],168:[function(t,e,r){"use strict";function i(t){for(var e=1;e0?this.tail.next=e:this.head=e,this.tail=e,++this.length},e.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},e.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},e.clear=function(){this.head=this.tail=null,this.length=0},e.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},e.concat=function(t){if(0===this.length)return s.alloc(0);for(var e=s.allocUnsafe(t>>>0),r=this.head,i=0;r;)a(r.data,e,i),i+=r.data.length,r=r.next;return e},e.consume=function(t,e){var r;return tn.length?n.length:t;if(a===n.length?i+=n:i+=n.slice(0,t),t-=a,0===t){a===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(a));break}++r}return this.length-=r,i},e._getBuffer=function(t){var e=s.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,a=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,a),t-=a,0===t){a===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(a));break}++i}return this.length-=i,e},e[l]=function(t,e){return h(this,i({},e,{depth:0,customInspect:!1}))},t}()},{buffer:48,util:33}],169:[function(t,e,r){(function(t){"use strict";function r(e,r){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(r?r(e):!e||this._writableState&&this._writableState.errorEmitted||t.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!r&&e?(t.nextTick(i,a,e),a._writableState&&(a._writableState.errorEmitted=!0)):r?(t.nextTick(n,a),r(e)):t.nextTick(n,a)}),this)}function i(t,e){o(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(t,e){t.emit("error",e)}e.exports={destroy:r,undestroy:a}}).call(this,t("_process"))},{_process:133}],170:[function(t,e,r){"use strict";function i(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n0;return o(t,u,h,function(t){i||(i=t),t&&a.forEach(s),u||(a.forEach(s),n(i))})});return e.reduce(u)}var f,c=t("../../../errors").codes,d=c.ERR_MISSING_ARGS,p=c.ERR_STREAM_DESTROYED;e.exports=l},{"../../../errors":160,"./end-of-stream":170}],172:[function(t,e,r){"use strict";function i(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}function n(t,e,r,n){var o=i(e,n,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0){var s=n?r:"highWaterMark";throw new a(s,o)}return Math.floor(o)}return t.objectMode?16:16384}var a=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:n}},{"../../../errors":160}],173:[function(t,e,r){arguments[4][146][0].apply(r,arguments)},{dup:146,events:52}],174:[function(t,e,r){r=e.exports=t("./lib/_stream_readable.js"),r.Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js"),r.finished=t("./lib/internal/streams/end-of-stream.js"),r.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":162,"./lib/_stream_passthrough.js":163,"./lib/_stream_readable.js":164,"./lib/_stream_transform.js":165,"./lib/_stream_writable.js":166,"./lib/internal/streams/end-of-stream.js":170,"./lib/internal/streams/pipeline.js":171}],175:[function(t,e,r){arguments[4][148][0].apply(r,arguments)},{dup:148,"safe-buffer":154}],176:[function(t,e,r){(function(e,i){function n(t,e){this._id=t,this._clearFn=e}var a=t("process/browser.js").nextTick,o=Function.prototype.apply,s=Array.prototype.slice,u={},h=0;r.setTimeout=function(){return new n(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new n(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r.setImmediate="function"==typeof e?e:function(t){var e=h++,i=!(arguments.length<2)&&s.call(arguments,1);return u[e]=!0,a(function(){u[e]&&(i?t.apply(null,i):t.call(null),r.clearImmediate(e))}),e},r.clearImmediate="function"==typeof i?i:function(t){delete u[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":133,timers:176}],177:[function(t,e,r){(function(t){"use strict";function e(t){throw new Error(t)}function i(t){var e=Object.keys(t);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e}function n(t){if(Array.isArray(t))return t.slice();for(var e=i(t),r={},n=0;n3?f-3:0),d=3;d=t.length||e<0?t:t.slice(0,e).concat(t.slice(e+1))}function d(t,e,r){if(t[e]===r)return t;for(var i=t.length,n=Array(i),a=0;a6?s-6:0),h=6;h6?s-6:0),h=6;h7?l-7:0),c=7;c=0||(o[h]=t[h])}return o}function S(t,e,r,i,n,o){for(var s=arguments.length,u=Array(s>6?s-6:0),h=6;h.5?u/(2-a-o):u/(a+o),a){case t:i=(e-r)/u+(e1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var n,a,o;if(t=I(t,360),e=I(e,100),r=I(r,100),0===e)n=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=i(u,s,t+1/3),a=i(u,s,t),o=i(u,s,t-1/3)}return{r:255*n,g:255*a,b:255*o}}function u(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var i,n,a=W(t,e,r),o=q(t,e,r),s=a,u=a-o;if(n=0===a?0:u/a,a==o)i=0;else{switch(a){case t:i=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,o.push(i(n));return o}function k(t,e){e=e||6;for(var r=i(t).toHsv(),n=r.h,a=r.s,o=r.v,s=[],u=1/e;e--;)s.push(i({h:n,s:a,v:o})),o=(o+u)%1;return s}function M(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function A(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(t,r){P(t)&&(t="100%");var i=C(t);return t=q(r,W(0,parseFloat(t))),i&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function T(t){return q(1,W(0,t))}function R(t){return parseInt(t,16)}function P(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function C(t){return"string"==typeof t&&-1!=t.indexOf("%")}function O(t){return 1==t.length?"0"+t:""+t}function L(t){return t<=1&&(t=100*t+"%"),t}function B(t){return e.round(255*parseFloat(t)).toString(16)}function D(t){return R(t)/255}function N(t){return!!tt.CSS_UNIT.exec(t)}function z(t){t=t.replace(U,"").replace(F,"").toLowerCase();var e,r=!1;if(K[t])t=K[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=tt.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=tt.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=tt.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=tt.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=tt.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=tt.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=tt.hex8.exec(t))?{r:R(e[1]),g:R(e[2]),b:R(e[3]),a:D(e[4]),format:r?"name":"hex8"}:(e=tt.hex6.exec(t))?{r:R(e[1]),g:R(e[2]),b:R(e[3]),format:r?"name":"hex"}:(e=tt.hex4.exec(t))?{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),a:D(e[4]+""+e[4]),format:r?"name":"hex8"}:!!(e=tt.hex3.exec(t))&&{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),format:r?"name":"hex"}}function j(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var U=/^\s+/,F=/\s+$/,G=0,H=e.round,q=e.min,W=e.max,Z=e.random;i.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(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,r,i,n,a,o,s=this.toRgb();return t=s.r/255,r=s.g/255,i=s.b/255,n=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),a=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),o=i<=.03928?i/12.92:e.pow((i+.055)/1.055,2.4),.2126*n+.7152*a+.0722*o},setAlpha:function(t){return this._a=A(t),this._roundA=H(100*this._a)/100,this},toHsv:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=u(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),i=H(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+i+"%)":"hsva("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),i=H(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return l(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return f(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:H(this._r),g:H(this._g),b:H(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+H(this._r)+", "+H(this._g)+", "+H(this._b)+")":"rgba("+H(this._r)+", "+H(this._g)+", "+H(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:H(100*I(this._r,255))+"%",g:H(100*I(this._g,255))+"%",b:H(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+H(100*I(this._r,255))+"%, "+H(100*I(this._g,255))+"%, "+H(100*I(this._b,255))+"%)":"rgba("+H(100*I(this._r,255))+"%, "+H(100*I(this._g,255))+"%, "+H(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&($[l(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+c(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=i(t);r="#"+c(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,i=this._a<1&&this._a>=0,n=!e&&i&&("hex"===t||"hex6"===t||"hex3"===t||"hex4"===t||"hex8"===t||"name"===t);return n?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return i(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},i.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:L(t[n]));t=r}return i(t,e)},i.equals=function(t,e){return!(!t||!e)&&i(t).toRgbString()==i(e).toRgbString()},i.random=function(){return i.fromRatio({r:Z(),g:Z(),b:Z()})},i.mix=function(t,e,r){r=0===r?0:r||50;var n=i(t).toRgb(),a=i(e).toRgb(),o=r/100,s={r:(a.r-n.r)*o+n.r,g:(a.g-n.g)*o+n.g,b:(a.b-n.b)*o+n.b,a:(a.a-n.a)*o+n.a};return i(s)},i.readability=function(t,r){var n=i(t),a=i(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},i.isReadable=function(t,e,r){var n,a,o=i.readability(t,e);switch(a=!1,n=j(r),n.level+n.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},i.mostReadable=function(t,e,r){var n,a,o,s,u=null,h=0;r=r||{},a=r.includeFallbackColors,o=r.level,s=r.size;for(var l=0;lh&&(h=n,u=i(e[l]));return i.isReadable(t,u,{level:o,size:s})||!a?u:(r.includeFallbackColors=!1,i.mostReadable(t,["#fff","#000"],r))};var Y,V,X,Q,J,K=i.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"},$=i.hexNames=M(K),tt=(Y="[-\\+]?\\d+%?",V="[-\\+]?\\d*\\.\\d+%?",X="(?:"+V+")|(?:"+Y+")",Q="[\\s|\\(]+("+X+")[,|\\s]+("+X+")[,|\\s]+("+X+")\\s*\\)?",J="[\\s|\\(]+("+X+")[,|\\s]+("+X+")[,|\\s]+("+X+")[,|\\s]+("+X+")\\s*\\)?",{CSS_UNIT:new RegExp(X),rgb:new RegExp("rgb"+Q),rgba:new RegExp("rgba"+J),hsl:new RegExp("hsl"+Q),hsla:new RegExp("hsla"+J),hsv:new RegExp("hsv"+Q),hsva:new RegExp("hsva"+J),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})$/});void 0!==r&&r.exports?r.exports=i:"function"==typeof t&&t.amd?t(function(){return i}):window.tinycolor=i})(Math)},{}],179:[function(t,e,r){function i(t){return t.replace(/^\s*|\s*$/g,"")}r=e.exports=i,r.left=function(t){return t.replace(/^\s*/,"")},r.right=function(t){return t.replace(/\s*$/,"")}},{}],180:[function(t,e,r){"use strict";function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function n(t,e,r){if(t&&h.isObject(t)&&t instanceof i)return t;var n=new i;return n.parse(t,e,r),n}function a(t){return h.isString(t)&&(t=n(t)),t instanceof i?t.format():i.prototype.format.call(t)}function o(t,e){return n(t,!1,!0).resolve(e)}function s(t,e){return t?n(t,!1,!0).resolveObject(e):e}var u=t("punycode"),h=t("./util");r.parse=n,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=i;var l=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),b=["%","/","?",";","#"].concat(m),g=["/","?","#"],_=255,v=/^[+a-z0-9A-Z_-]{0,63}$/,y=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=t("querystring");i.prototype.parse=function(t,e,r){if(!h.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?B+="x":B+=L[D];if(!B.match(v)){var z=C.slice(0,T),j=C.slice(T+1),U=L.match(y);U&&(z.push(U[1]),j.unshift(U[2])),j.length&&(s="/"+j.join(".")+s),this.hostname=z.join(".");break}}}this.hostname.length>_?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=u.toASCII(this.hostname));var F=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+F,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!w[p])for(T=0,O=m.length;T0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return r.search=t.search,r.query=t.query,h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=w.slice(-1)[0],A=(r.host||t.host||w.length>1)&&("."===M||".."===M)||""===M,I=0,T=w.length;T>=0;T--)M=w[T],"."===M?w.splice(T,1):".."===M?(w.splice(T,1),I++):I&&(w.splice(T,1),I--);if(!v&&!y)for(;I--;I)w.unshift("..");!v||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),A&&"/"!==w.join("/").substr(-1)&&w.push("");var R=""===w[0]||w[0]&&"/"===w[0].charAt(0);if(S){r.hostname=r.host=R?"":w.length?w.shift():"";k=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return v=v||r.host&&w.length,v&&!R&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),h.isNull(r.pathname)&&h.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":181,punycode:134,querystring:137}],181:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],182:[function(t,e,r){(function(r){(function(){function i(){void 0!==r&&"development"!=r.env.NODE_ENV||console.log.apply(console,arguments)}var n,a={};"object"==typeof e?e.exports=a:self.UTIF=a,n="function"==typeof t?t("pako"):self.pako,function(t,e){var r,n,a;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},n=function(){function t(t){this.message="JPEG error: "+t}return t.prototype=Error(),t.prototype.name="JpegError",t.constructor=t}(),a=function(){function t(t,e){this.message=t,this.g=e}return t.prototype=Error(),t.prototype.name="DNLMarkerError",t.constructor=t}(),function(){function e(){this.M=null,this.B=-1}function i(t,e){for(var r,i,n=0,a=[],o=16;0>L&1;if(O=t[e++],255===O){var r=t[e++];if(r){if(220===r&&R){e+=2;var o=t[e++]<<8|t[e++];if(0>>7}function m(t){for(;;){if(t=t[p()],"number"==typeof t)return t;if("object"!==(void 0===t?"undefined":r(t)))throw new n("invalid huffman sequence")}}function b(t){for(var e=0;0=1<r;){var i=m(t.o),n=15&i;if(i>>=4,0===n){if(15>i)break;r+=16}else r+=i,t.a[e+h[r]]=g(n),r++}}function v(t,e){var r=m(t.D);r=0===r?0:g(r)<>=4,0===n){if(15>i){B=b(i)+(1<t.a[r]?-1:1;switch(D){case 0:if(a=m(t.o),r=15&a,a>>=4,0===r)15>a?(B=b(a)+(1<=G)throw new n("marker was not found");if(!(65488<=G&&65495>=G))break;e+=2}return(G=u(t,e))&&G.f&&((0,_util.warn)("decodeScan - unexpected Scan data, current marker is: "+G.f),e=G.offset),e-C}function s(t,e){for(var r=e.c,i=e.l,a=new Int16Array(64),o=0;oc;c+=8){var d=f[u+c],p=f[u+c+1],m=f[u+c+2],b=f[u+c+3],g=f[u+c+4],_=f[u+c+5],v=f[u+c+6],y=f[u+c+7];if(d*=l[c],0==(p|m|b|g|_|v|y))d=5793*d+512>>10,h[c]=d,h[c+1]=d,h[c+2]=d,h[c+3]=d,h[c+4]=d,h[c+5]=d,h[c+6]=d,h[c+7]=d;else{p*=l[c+1],m*=l[c+2],b*=l[c+3],g*=l[c+4],_*=l[c+5],v*=l[c+6],y*=l[c+7];var w=5793*d+128>>8,E=5793*g+128>>8,x=m,S=v;g=2896*(p-y)+128>>8,y=2896*(p+y)+128>>8,b<<=4,_<<=4,w=w+E+1>>1,E=w-E,d=3784*x+1567*S+128>>8,x=1567*x-3784*S+128>>8,S=d,g=g+_+1>>1,_=g-_,y=y+b+1>>1,b=y-b,w=w+S+1>>1,S=w-S,E=E+x+1>>1,x=E-x,d=2276*g+3406*y+2048>>12,g=3406*g-2276*y+2048>>12,y=d,d=799*b+4017*_+2048>>12,b=4017*b-799*_+2048>>12,_=d,h[c]=w+y,h[c+7]=w-y,h[c+1]=E+_,h[c+6]=E-_,h[c+2]=x+b,h[c+5]=x-b,h[c+3]=S+g,h[c+4]=S-g}}for(l=0;8>l;++l)d=h[l],p=h[l+8],m=h[l+16],b=h[l+24],g=h[l+32],_=h[l+40],v=h[l+48],y=h[l+56],0==(p|m|b|g|_|v|y)?(d=5793*d+8192>>14,d=-2040>d?0:2024<=d?255:d+2056>>4,f[u+l]=d,f[u+l+8]=d,f[u+l+16]=d,f[u+l+24]=d,f[u+l+32]=d,f[u+l+40]=d,f[u+l+48]=d,f[u+l+56]=d):(w=5793*d+2048>>12,E=5793*g+2048>>12,x=m,S=v,g=2896*(p-y)+2048>>12,y=2896*(p+y)+2048>>12,w=4112+(w+E+1>>1),E=w-E,d=3784*x+1567*S+2048>>12,x=1567*x-3784*S+2048>>12,S=d,g=g+_+1>>1,_=g-_,y=y+b+1>>1,b=y-b,w=w+S+1>>1,S=w-S,E=E+x+1>>1,x=E-x,d=2276*g+3406*y+2048>>12,g=3406*g-2276*y+2048>>12,y=d,d=799*b+4017*_+2048>>12,b=4017*b-799*_+2048>>12,_=d,d=w+y,y=w-y,p=E+_,v=E-_,m=x+b,_=x-b,b=S+g,g=S-g,d=16>d?0:4080<=d?255:d>>4,p=16>p?0:4080<=p?255:p>>4,m=16>m?0:4080<=m?255:m>>4,b=16>b?0:4080<=b?255:b>>4,g=16>g?0:4080<=g?255:g>>4,_=16>_?0:4080<=_?255:_>>4,v=16>v?0:4080<=v?255:v>>4,y=16>y?0:4080<=y?255:y>>4,f[u+l]=d,f[u+l+8]=p,f[u+l+16]=m,f[u+l+24]=b,f[u+l+32]=g,f[u+l+40]=_,f[u+l+48]=v,f[u+l+56]=y)}return e.a}function u(t,e){var r=2=i)return null;var n=t[e]<<8|t[e+1];if(65472<=n&&65534>=n)return{f:null,F:n,offset:e};for(var a=t[r]<<8|t[r+1];!(65472<=a&&65534>=a);){if(++r>=i)return null;a=t[r]<<8|t[r+1]}return{f:n.toString(16),F:a,offset:r}}var h=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]);e.prototype={parse:function(t){function e(){var e=t[d]<<8|t[d+1];return d+=2,e}function r(){var r=e();r=d+r-2;var i=u(t,r,d);return i&&i.f&&((0,_util.warn)("readDataBlock - incorrect length, current marker is: "+i.f),r=i.offset),r=t.subarray(d,r),d+=r.length,r}function l(t){for(var e=Math.ceil(t.v/8/t.s),r=Math.ceil(t.g/8/t.u),i=0;i>4)for(v=0;64>v;v++)y=h[v],E[y]=t[d++];else{if(1!=w>>4)throw new n("DQT - invalid table spec");for(v=0;64>v;v++)y=h[v],E[y]=e()}f[15&w]=E}break;case 65472:case 65473:case 65474:if(x)throw new n("Only single frame JPEGs supported");e();var x={};for(x.X=65473===_,x.S=65474===_,x.precision=t[d++],_=e(),x.g=c||_,x.v=e(),x.b=[],x.C={},v=t[d++],_=E=w=0;_>4,k=15&t[d+1];wv;v++,d++)S+=E[v]=t[d];for(k=new Uint8Array(S),v=0;v>4?g:b)[15&w]=i(E,k)}break;case 65501:e();var M=e();break;case 65498:for(v=1==++m&&!c,e(),w=t[d++],y=[],_=0;_>4],A.o=b[15&E],y.push(A)}_=t[d++],w=t[d++],E=t[d++];try{var I=o(t,d,x,y,M,_,w,E>>4,15&E,v);d+=I}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:d+=4;break;case 65535:255!==t[d]&&d--;break;default:if(255===t[d-3]&&192<=t[d-2]&&254>=t[d-2])d-=3;else{if(!(v=u(t,d-2))||!v.f)throw new n("unknown marker "+_.toString(16));(0,_util.warn)("JpegImage.parse - unexpected data, current marker is: "+v.f),d=v.offset}}_=e()}for(this.width=x.v,this.height=x.g,this.A=p,this.b=[],_=0;_>8)+a[n+1];return u},w:function(){return this.A?!!this.A.W:3===this.i?0!==this.B:1===this.B},I:function(t){for(var e,r,i,n=0,a=t.length;n>>3)]),null==d&&(d=s.t325);var p=new Uint8Array(s.height*(f>>>3)),m=0;if(null!=s.t322){for(var b=s.t322[0],g=s.t323[0],_=Math.floor((s.width+b-1)/b),v=Math.floor((s.height+g-1)/g),y=new Uint8Array(0|Math.ceil(b*g*l/8)),w=0;w>>8;else{if(12!=b)throw new Error("unsupported bit depth "+b);for(d=0;d>>4,a[o++]=255&(_[d]<<4|_[d+1]>>>8),a[o++]=255&_[d+1]}}else{var y=new t.JpegDecoder;y.parse(h);var w=y.getData(y.width,y.height);for(d=0;d1),!_){if(255==e[r]&&e[r+1]==l)return{jpegOffset:r};if(null!=v&&(255==e[r+y]&&e[r+y+1]==l?b=r+y:i("JPEGInterchangeFormat does not point to SOI"),null==w?i("JPEGInterchangeFormatLength field is missing"):(y>=g||y+E<=g)&&i("JPEGInterchangeFormatLength field value is invalid"),null!=b))return{jpegOffset:b}}if(null!=S&&(k=S[0],M=S[1]),null!=v&&null!=w)if(E>=2&&y+E<=g){for(a=255==e[r+y+E-2]&&e[r+y+E-1]==l?new Uint8Array(E-2):new Uint8Array(E),s=0;s offset to first strip or tile");if(null==a){var T=0,R=[];R[T++]=255,R[T++]=l;var P=t.t519;if(null==P)throw new Error("JPEGQTables tag is missing");for(s=0;s>>8,R[T++]=255&O,R[T++]=s|h<<4,u=0;u<16;u++)R[T++]=e[r+C[s]+u];for(u=0;u>>8&255,R[T++]=255&t.height,R[T++]=t.width>>>8&255,R[T++]=255&t.width,R[T++]=A,1==A)R[T++]=1,R[T++]=17,R[T++]=0;else for(s=0;s<3;s++)R[T++]=s+1,R[T++]=0!=s?17:(15&k)<<4|15&M,R[T++]=s;null!=I&&0!=I[0]&&(R[T++]=255,R[T++]=d,R[T++]=0,R[T++]=4,R[T++]=I[0]>>>8&255,R[T++]=255&I[0]),a=new Uint8Array(R)}var L=-1;for(s=0;s>>8&255,a[D++]=255&t.height,a[D++]=t.width>>>8&255,a[D++]=255&t.width,a[D++]=A,1==A)a[D++]=1,a[D++]=17,a[D++]=0;else for(s=0;s<3;s++)a[D++]=s+1,a[D++]=0!=s?17:(15&k)<<4|15&M,a[D++]=s}if(255==e[g]&&e[g+1]==m){var N=e[g+2]<<8|e[g+3];for(o=new Uint8Array(N+2),o[0]=e[g],o[1]=e[g+1],o[2]=e[g+2],o[3]=e[g+3],s=0;s>>8&255,h[l.sofPosition+6]=255&e.height,h[l.sofPosition+7]=e.width>>>8&255,h[l.sofPosition+8]=255&e.width,255==r[i]&&r[i+1]==SOS||(h.set(l.sosMarker,bufoff),bufoff+=sosMarker.length),d=0;d=0&&u<128)for(var h=0;h=-127&&u<0){for(h=0;h<1-u;h++)o[n]=a[e],n++;e++}}},t.decode._decodeThunder=function(t,e,r,i,n){for(var a=[0,1,0,-1],o=[0,1,2,3,0,-3,-2,-1],s=e+r,u=2*n,h=0;e>>6,c=63&l;if(e++,3==f&&(h=15&c,i[u>>>1]|=h<<4*(1-u&1),u++),0==f)for(var d=0;d>>1]|=h<<4*(1-u&1),u++;if(2==f)for(d=0;d<2;d++){var p=c>>>3*(1-d)&7;4!=p&&(h+=o[p],i[u>>>1]|=h<<4*(1-u&1),u++)}if(1==f)for(d=0;d<3;d++){p=c>>>2*(2-d)&3;2!=p&&(h+=a[p],i[u>>>1]|=h<<4*(1-u&1),u++)}}},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 n=0;n>>3>>3]>>>7-(7&h)&1),2==s&&(S=e[h>>>3]>>>(7&h)&1),h++,f+=S,"H"==w){if(null!=u._lens[v][f]){var k=u._lens[v][f];f="",l+=k,k<64&&(u._addNtimes(c,l,v),m+=l,v=1-v,l=0,E--,0==E&&(w=""))}}else"0001"==f&&(f="",u._addNtimes(c,_-m,v),m=_),"001"==f&&(f="",w="H",E=2),null!=u._dmap[f]&&(b=g+u._dmap[f],u._addNtimes(c,b-m,v),m=b,f="",v=1-v);c.length==o&&""==w&&(u._writeBits(c,n,8*a+y*x),v=0,y++,m=0,d=u._makeDiff(c),c=[])}},t.decode._findDiff=function(t,e,r){for(var i=0;i=e&&t[i+1]==r)return t[i]},t.decode._makeDiff=function(t){var e=[];1==t[0]&&e.push(0,1);for(var r=1;r>>3>>3]>>>7-(7&h)&1),2==s&&(k=e[h>>>3]>>>(7&h)&1),h++,f+=k,x){if(null!=u._lens[v][f]){var M=u._lens[v][f];f="",l+=M,M<64&&(u._addNtimes(c,l,v),v=1-v,l=0)}}else if("H"==w){if(null!=u._lens[v][f]){M=u._lens[v][f];f="",l+=M,M<64&&(u._addNtimes(c,l,v),m+=l,v=1-v,l=0,E--,0==E&&(w=""))}}else"0001"==f&&(f="",u._addNtimes(c,_-m,v),m=_),"001"==f&&(f="",w="H",E=2),null!=u._dmap[f]&&(b=g+u._dmap[f],u._addNtimes(c,b-m,v),m=b,f="",v=1-v);f.endsWith("000000000001")&&(y>=0&&u._writeBits(c,n,8*a+y*S),1==s&&(x=1==(e[h>>>3]>>>7-(7&h)&1)),2==s&&(x=1==(e[h>>>3]>>>(7&h)&1)),h++,null==u._decodeG3.allow2D&&(u._decodeG3.allow2D=x),u._decodeG3.allow2D||(x=!0,h--),f="",v=0,y++,m=0,d=u._makeDiff(c),c=[])}c.length==o&&u._writeBits(c,n,8*a+y*S)},t.decode._addNtimes=function(t,e,r){for(var i=0;i>>3]|=t[i]<<7-(r+i&7)},t.decode._decodeLZW=function(e,r,i,n){if(null==t.decode._lzwTab){for(var a=new Uint32Array(65535),o=new Uint16Array(65535),s=new Uint8Array(2e6),u=0;u<256;u++)s[u<<2]=u,a[u]=u<<2,o[u]=1;t.decode._lzwTab=[a,o,s]}for(var h=t.decode._copyData,l=t.decode._lzwTab[0],f=t.decode._lzwTab[1],c=(s=t.decode._lzwTab[2],258),d=1032,p=9,m=r<<3,b=256,g=257,_=0,v=0,y=0;_=e[m>>>3]<<16|e[m+8>>>3]<<8|e[m+16>>>3],v=_>>24-(7&m)-p&(1<>>3]<<16|e[m+8>>>3]<<8|e[m+16>>>3],v=_>>24-(7&m)-p&(1<=c)l[c]=d,s[l[c]]=w[0],f[c]=1,d=d+1+3&-4,c++;else{l[c]=d;var x=l[y],S=f[y];h(s,x,s,d,S),s[d+S]=s[w],S++,f[c]=S,c++,d=d+S+3&-4}c+1==1<=c)l[c]=d,f[c]=0,c++;else{l[c]=d;x=l[y],S=f[y];h(s,x,s,d,S),s[d+S]=s[d],S++,f[c]=S,c++,h(s,d,i,n,S),n+=S,d=d+S+3&-4}c+1==1<4&&(e.writeUint(r,i,o),p=o),2==l&&e.writeASCII(r,p,f),3==l)for(var m=0;m4&&(d+=1&d,o+=d),i+=4}return[i,o]},t.toRGBA8=function(t){var e=t.width,r=t.height,n=e*r,a=4*n,o=t.data,s=new Uint8Array(4*n),u=t.t262[0],h=t.t258?Math.min(32,t.t258[0]):1,l=t.isLE?1:0;if(0==u)for(var f=Math.ceil(h*e/8),c=0;c>3)]>>7-(7&m)&1;s[b]=s[b+1]=s[b+2]=255*(1-g),s[b+3]=255}if(4==h)for(m=0;m>1)]>>4-4*(1&m)&15;s[b]=s[b+1]=s[b+2]=17*(15-g),s[b+3]=255}if(8==h)for(m=0;m>3)]>>7-(7&m)&1;s[b]=s[b+1]=s[b+2]=255*g,s[b+3]=255}if(2==h)for(m=0;m>2)]>>6-2*(3&m)&3;s[b]=s[b+1]=s[b+2]=85*g,s[b+3]=255}if(8==h)for(m=0;m0)for(m=0;m>8,s[b+1]=y[256+w]>>8,s[b+2]=y[512+w]>>8,s[b+3]=255}}else if(5==u){_=t.t258?t.t258.length:4;var E=_>4?1:0;for(m=0;m>8&255,t[e+1]=255&r},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;i0&&(p=setTimeout(function(){if(!h){h=!0,d.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",i(t)}},t.timeout)),d.setRequestHeader)for(s in _)_.hasOwnProperty(s)&&d.setRequestHeader(s,_[s]);else if(t.headers&&!n(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(d.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(d),d.send(g||null),d}function u(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}function h(){}var l=t("global/window"),f=t("is-function"),c=t("parse-headers"),d=t("xtend");e.exports=o,e.exports.default=o,o.XMLHttpRequest=l.XMLHttpRequest||h,o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:l.XDomainRequest,i(["get","put","post","patch","head","delete"],function(t){o["delete"===t?"del":t]=function(e,r,i){return r=a(e,r,i),r.method=t.toUpperCase(),s(r)}})},{"global/window":71,"is-function":78,"parse-headers":106,xtend:189}],188:[function(t,e,r){e.exports=void 0!==self.DOMParser?function(t){var e=new self.DOMParser;return e.parseFromString(t,"application/xml")}:void 0!==self.ActiveXObject&&new self.ActiveXObject("Microsoft.XMLDOM")?function(t){var e=new self.ActiveXObject("Microsoft.XMLDOM");return e.async="false",e.loadXML(t),e}:function(t){var e=document.createElement("div");return e.innerHTML=t,e}},{}],189:[function(t,e,r){function i(){for(var t={},e=0;e2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=(t.r*t.a+e.r*e.a*(1-t.a))/i,a=(t.g*t.a+e.g*e.a*(1-t.a))/i,o=(t.b*t.a+e.b*e.a*(1-t.a))/i;return{r:n,g:a,b:o,a:i}}function n(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=(e.r*e.a+t.r*t.a*(1-e.a))/i,a=(e.g*e.a+t.g*t.a*(1-e.a))/i,o=(e.b*e.a+t.b*t.a*(1-e.a))/i;return{r:n,g:a,b:o,a:i}}function a(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(n*s+n*(1-e.a)+s*(1-t.a))/i,f=(a*u+a*(1-e.a)+u*(1-t.a))/i,c=(o*h+o*(1-e.a)+h*(1-t.a))/i;return{r:l,g:f,b:c,a:i}}function o(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(n+s)/i,f=(a+u)/i,c=(o+h)/i;return{r:l,g:f,b:c,a:i}}function s(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(n*e.a+s*t.a-n*s+n*(1-e.a)+s*(1-t.a))/i,f=(a*e.a+u*t.a-a*u+a*(1-e.a)+u*(1-t.a))/i,c=(o*e.a+h*t.a-o*h+o*(1-e.a)+h*(1-t.a))/i;return{r:l,g:f,b:c,a:i}}function u(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(2*s<=e.a?2*n*s+n*(1-e.a)+s*(1-t.a):n*(1+e.a)+s*(1+t.a)-2*s*n-e.a*t.a)/i,f=(2*u<=e.a?2*a*u+a*(1-e.a)+u*(1-t.a):a*(1+e.a)+u*(1+t.a)-2*u*a-e.a*t.a)/i,c=(2*h<=e.a?2*o*h+o*(1-e.a)+h*(1-t.a):o*(1+e.a)+h*(1+t.a)-2*h*o-e.a*t.a)/i;return{r:l,g:f,b:c,a:i}}function h(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(Math.min(n*e.a,s*t.a)+n*(1-e.a)+s*(1-t.a))/i,f=(Math.min(a*e.a,u*t.a)+a*(1-e.a)+u*(1-t.a))/i,c=(Math.min(o*e.a,h*t.a)+o*(1-e.a)+h*(1-t.a))/i;return{r:l,g:f,b:c,a:i}}function l(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(Math.max(n*e.a,s*t.a)+n*(1-e.a)+s*(1-t.a))/i,f=(Math.max(a*e.a,u*t.a)+a*(1-e.a)+u*(1-t.a))/i,c=(Math.max(o*e.a,h*t.a)+o*(1-e.a)+h*(1-t.a))/i;return{r:l,g:f,b:c,a:i}}function f(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(2*n<=t.a?2*n*s+n*(1-e.a)+s*(1-t.a):n*(1+e.a)+s*(1+t.a)-2*s*n-e.a*t.a)/i,f=(2*a<=t.a?2*a*u+a*(1-e.a)+u*(1-t.a):a*(1+e.a)+u*(1+t.a)-2*u*a-e.a*t.a)/i,c=(2*o<=t.a?2*o*h+o*(1-e.a)+h*(1-t.a):o*(1+e.a)+h*(1+t.a)-2*h*o-e.a*t.a)/i;return{r:l,g:f,b:c,a:i}}function c(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(n+s-2*Math.min(n*e.a,s*t.a))/i,f=(a+u-2*Math.min(a*e.a,u*t.a))/i,c=(o+h-2*Math.min(o*e.a,h*t.a))/i;return{r:l,g:f,b:c,a:i}}function d(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=r;var i=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,u=e.g*e.a,h=e.b*e.a,l=(n*e.a+s*t.a-2*n*s+n*(1-e.a)+s*(1-t.a))/i,f=(a*e.a+u*t.a-2*a*u+a*(1-e.a)+u*(1-t.a))/i,c=(o*e.a+h*t.a-2*o*h+o*(1-e.a)+h*(1-t.a))/i;return{r:l,g:f,b:c,a:i}}Object.defineProperty(r,"__esModule",{value:!0}),r.srcOver=i,r.dstOver=n,r.multiply=a,r.add=o,r.screen=s,r.overlay=u,r.darken=h,r.lighten=l,r.hardLight=f,r.difference=c,r.exclusion=d},{}],191:[function(t,e,r){"use strict";function i(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=arguments.length>4?arguments[4]:void 0;if("function"==typeof i&&(n=i,i={}),!(t instanceof this.constructor))return a.throwError.call(this,"The source must be a Jimp image",n);if("number"!=typeof e||"number"!=typeof r)return a.throwError.call(this,"x and y must be numbers",n);var u=i,h=u.mode,l=u.opacitySource,f=u.opacityDest;h||(h=o.BLEND_SOURCE_OVER),("number"!=typeof l||l<0||l>1)&&(l=1),("number"!=typeof f||f<0||f>1)&&(f=1);var c=s[h];e=Math.round(e),r=Math.round(r);var d=this;return 1!==f&&d.opacity(f),t.scanQuiet(0,0,t.bitmap.width,t.bitmap.height,function(t,i,n){var a=d.getPixelIndex(e+t,r+i,o.EDGE_CROP),s=c({r:this.bitmap.data[n+0]/255,g:this.bitmap.data[n+1]/255,b:this.bitmap.data[n+2]/255,a:this.bitmap.data[n+3]/255},{r:d.bitmap.data[a+0]/255,g:d.bitmap.data[a+1]/255,b:d.bitmap.data[a+2]/255,a:d.bitmap.data[a+3]/255},l);d.bitmap.data[a+0]=this.constructor.limit255(255*s.r),d.bitmap.data[a+1]=this.constructor.limit255(255*s.g),d.bitmap.data[a+2]=this.constructor.limit255(255*s.b),d.bitmap.data[a+3]=this.constructor.limit255(255*s.a)}),(0,a.isNodePattern)(n)&&n.call(this,null,this),this}var n=t("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(r,"__esModule",{value:!0}),r.default=i;var a=t("@jimp/utils"),o=n(t("../constants")),s=n(t("./composite-modes"));e.exports=r.default},{"../constants":192,"./composite-modes":190,"@babel/runtime/helpers/interopRequireWildcard":12,"@jimp/utils":235}],192:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.EDGE_CROP=r.EDGE_WRAP=r.EDGE_EXTEND=r.BLEND_EXCLUSION=r.BLEND_DIFFERENCE=r.BLEND_HARDLIGHT=r.BLEND_LIGHTEN=r.BLEND_DARKEN=r.BLEND_OVERLAY=r.BLEND_SCREEN=r.BLEND_ADD=r.BLEND_MULTIPLY=r.BLEND_DESTINATION_OVER=r.BLEND_SOURCE_OVER=r.VERTICAL_ALIGN_BOTTOM=r.VERTICAL_ALIGN_MIDDLE=r.VERTICAL_ALIGN_TOP=r.HORIZONTAL_ALIGN_RIGHT=r.HORIZONTAL_ALIGN_CENTER=r.HORIZONTAL_ALIGN_LEFT=r.AUTO=void 0;var i=-1;r.AUTO=i;var n=1;r.HORIZONTAL_ALIGN_LEFT=n;var a=2;r.HORIZONTAL_ALIGN_CENTER=a;var o=4;r.HORIZONTAL_ALIGN_RIGHT=o;var s=8;r.VERTICAL_ALIGN_TOP=s;var u=16;r.VERTICAL_ALIGN_MIDDLE=u;var h=32;r.VERTICAL_ALIGN_BOTTOM=h;var l="srcOver";r.BLEND_SOURCE_OVER=l;var f="dstOver";r.BLEND_DESTINATION_OVER=f;var c="multiply";r.BLEND_MULTIPLY=c;var d="add";r.BLEND_ADD=d;var p="screen";r.BLEND_SCREEN=p;var m="overlay";r.BLEND_OVERLAY=m;var b="darken";r.BLEND_DARKEN=b;var g="lighten";r.BLEND_LIGHTEN=g;var _="hardLight";r.BLEND_HARDLIGHT=_;var v="difference";r.BLEND_DIFFERENCE=v;var y="exclusion";r.BLEND_EXCLUSION=y;var w=1;r.EDGE_EXTEND=w;var E=2;r.EDGE_WRAP=E;var x=3;r.EDGE_CROP=x},{}],193:[function(t,e,r){(function(e){"use strict";function i(){}function n(t){return Object.prototype.toString.call(t).toLowerCase().indexOf("arraybuffer")>-1}function a(t){for(var r=e.alloc(t.byteLength),i=new Uint8Array(t),n=0;n (HTTP: "+n.statusCode+")";return new Error(s)})}function s(t,e){M.default&&"function"==typeof M.default.readFile&&!t.match(/^(http|ftp)s?:\/\/./)?M.default.readFile(t,e):o({url:t},e)}function u(t){return t&&"object"===(0,k.default)(t)&&"number"==typeof t.width&&"number"==typeof t.height&&(e.isBuffer(t.data)||t.data instanceof Uint8Array||"function"==typeof Uint8ClampedArray&&t.data instanceof Uint8ClampedArray)&&(t.data.length===t.width*t.height*4||t.data.length===t.width*t.height*3)}function h(t){if(t.length%3!=0)throw new Error("Buffer length is incorrect");for(var r=e.allocUnsafe(t.length/3*4),i=0,n=0;n1&&void 0!==arguments[1]?arguments[1]:Y;Object.entries(t).forEach(function(t){var r=(0,g.default)(t,2),i=r[0],n=r[1];e[i]=n})}function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Y;Object.entries(t).forEach(function(t){var r=(0,g.default)(t,2),i=r[0],n=r[1];e.prototype[i]=n})}function c(t,e,r){var i="before-"+e,n=e.replace(/e$/,"")+"ed";Y.prototype[t]=function(){for(var e,a=arguments.length,o=new Array(a),s=0;s2&&void 0!==arguments[2]?arguments[2]:{};r=Object.assign(r,{methodName:t,eventName:e}),this.emit("any",r),t&&this.emit(t,r),this.emit(e,r)}},{key:"emitError",value:function(t,e){this.emitMulti(t,"error",e)}},{key:"getHeight",value:function(){return this.bitmap.height}},{key:"getWidth",value:function(){return this.bitmap.width}},{key:"inspect",value:function(){return""}},{key:"toString",value:function(){return"[object Jimp]"}},{key:"getMIME",value:function(){var t=this._originalMime||r.MIME_PNG;return t}},{key:"getExtension",value:function(){var t=this.getMIME();return z.getExtension(t)}},{key:"write",value:function(t,e){var r=this;if(!M.default||!M.default.createWriteStream)throw new Error("Cant access the filesystem. You can use the getBase64 method.");if("string"!=typeof t)return T.throwError.call(this,"path must be a string",e);if(void 0===e&&(e=i),"function"!=typeof e)return T.throwError.call(this,"cb must be a function",e);var n=z.getType(t)||this.getMIME(),a=A.default.parse(t);return a.dir&&P.default.sync(a.dir),this.getBuffer(n,function(i,n){if(i)return T.throwError.call(r,i,e);var a=M.default.createWriteStream(t);a.on("open",function(){a.write(n),a.end()}).on("error",function(t){return T.throwError.call(r,t,e)}),a.on("finish",function(){e.call(r,null,r)})}),this}},{key:"getBase64",value:function(t,e){return t===r.AUTO&&(t=this.getMIME()),"string"!=typeof t?T.throwError.call(this,"mime must be a string",e):"function"!=typeof e?T.throwError.call(this,"cb must be a function",e):(this.getBuffer(t,function(r,i){if(r)return T.throwError.call(this,r,e);var n="data:"+t+";base64,"+i.toString("base64");e.call(this,null,n)}),this)}},{key:"hash",value:function(t,e){if(t=t||64,"function"==typeof t&&(e=t,t=64),"number"!=typeof t)return T.throwError.call(this,"base must be a number",e);if(t<2||t>64)return T.throwError.call(this,"base must be a number between 2 and 64",e);var r=this.pHash();for(r=(0,R.default)(R.default.BIN,F.slice(0,t))(r);r.length=this.bitmap.width&&(a=this.bitmap.width-1),e<0&&(o=0),e>=this.bitmap.height&&(o=this.bitmap.height-1)),i===r.EDGE_WRAP&&(t<0&&(a=this.bitmap.width+t),t>=this.bitmap.width&&(a=t%this.bitmap.width),e<0&&(a=this.bitmap.height+e),e>=this.bitmap.height&&(o=e%this.bitmap.height));var s=this.bitmap.width*o+a<<2;return(a<0||a>=this.bitmap.width)&&(s=-1),(o<0||o>=this.bitmap.height)&&(s=-1),(0,T.isNodePattern)(n)&&n.call(this,null,s),s}},{key:"getPixelColor",value:function(t,e,r){if("number"!=typeof t||"number"!=typeof e)return T.throwError.call(this,"x and y must be numbers",r);t=Math.round(t),e=Math.round(e);var i=this.getPixelIndex(t,e),n=this.bitmap.data.readUInt32BE(i);return(0,T.isNodePattern)(r)&&r.call(this,null,n),n}},{key:"setPixelColor",value:function(t,e,r,i){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof r)return T.throwError.call(this,"hex, x and y must be numbers",i);e=Math.round(e),r=Math.round(r);var n=this.getPixelIndex(e,r);return this.bitmap.data.writeUInt32BE(t,n),(0,T.isNodePattern)(i)&&i.call(this,null,this),this}},{key:"hasAlpha",value:function(){for(var t=0;t255)return T.throwError.call(this,"r must be between 0 and 255",n);if((e<0||e>255)&&T.throwError.call(this,"g must be between 0 and 255",n),r<0||r>255)return T.throwError.call(this,"b must be between 0 and 255",n);if(i<0||i>255)return T.throwError.call(this,"a must be between 0 and 255",n);t=Math.round(t),r=Math.round(r),e=Math.round(e),i=Math.round(i);var a=t*Math.pow(256,3)+e*Math.pow(256,2)+r*Math.pow(256,1)+i*Math.pow(256,0);return(0,T.isNodePattern)(n)&&n.call(this,null,a),a},Y.intToRGBA=function(t,e){if("number"!=typeof t)return T.throwError.call(this,"i must be a number",e);var r={};return 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)),(0,T.isNodePattern)(e)&&e.call(this,null,r),r},Y.cssColorToHex=function(t){return t=t||0,"number"==typeof t?Number(t):parseInt((0,O.default)(t).toHex8(),16)},Y.limit255=function(t){return t=Math.max(t,0),t=Math.min(t,255),t},Y.diff=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1;if(!(t instanceof Y&&e instanceof Y))return T.throwError.call(this,"img1 and img2 must be an Jimp images");var i=t.bitmap,n=e.bitmap;if(i.width===n.width&&i.height===n.height||(i.width*i.height>n.width*n.height?t=t.cloneQuiet().resize(n.width,n.height):e=e.cloneQuiet().resize(i.width,i.height)),"number"!=typeof r||r<0||r>1)return T.throwError.call(this,"threshold must be a number between 0 and 1");var a=new Y(i.width,i.height,4294967295),o=(0,C.default)(i.data,n.data,a.bitmap.data,a.bitmap.width,a.bitmap.height,{threshold:r});return{percent:o/(a.bitmap.width*a.bitmap.height),image:a}},Y.distance=function(t,e){var r=new L.default,i=r.getHash(t),n=r.getHash(e);return r.distance(i,n)},Y.compareHashes=function(t,e){var r=new L.default;return r.distance(t,e)},Y.colorDiff=function(t,e){var r=function(t){return Math.pow(t,2)},i=Math.max,n=195075;return 0===t.a||t.a||(t.a=255),0===e.a||e.a||(e.a=255),(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)))/n},c("clone","clone",function(t){var e=new Y(this);return(0,T.isNodePattern)(t)&&t.call(e,null,e),e}),d("background",function(t,e){return"number"!=typeof t?T.throwError.call(this,"hex must be a hexadecimal rgba value",e):(this._background=t,(0,T.isNodePattern)(e)&&e.call(this,null,this),this)}),d("scan",function(t,e,r,i,n,a){if("number"!=typeof t||"number"!=typeof e)return T.throwError.call(this,"x and y must be numbers",a);if("number"!=typeof r||"number"!=typeof i)return T.throwError.call(this,"w and h must be numbers",a);if("function"!=typeof n)return T.throwError.call(this,"f must be a function",a);var o=(0,T.scan)(this,t,e,r,i,n);return(0,T.isNodePattern)(a)&&a.call(this,null,o),o}),void 0!==window&&"object"===(void 0===window?"undefined":(0,k.default)(window))&&(W=window),"undefined"!=typeof self&&"object"===("undefined"==typeof self?"undefined":(0,k.default)(self))&&(W=self),W.Jimp=Y,W.Buffer=e;var V=Y;r.default=V}).call(this,t("buffer").Buffer)},{"./composite":191,"./constants":192,"./modules/phash":194,"./request":195,"./utils/image-bitmap":196,"./utils/mime":197,"./utils/promisify":198,"@babel/runtime/helpers/assertThisInitialized":3,"@babel/runtime/helpers/classCallCheck":4,"@babel/runtime/helpers/construct":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/defineProperty":7,"@babel/runtime/helpers/getPrototypeOf":9,"@babel/runtime/helpers/inherits":10,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/interopRequireWildcard":12,"@babel/runtime/helpers/possibleConstructorReturn":17,"@babel/runtime/helpers/slicedToArray":19,"@babel/runtime/helpers/typeof":21,"@jimp/utils":235,"any-base":23,buffer:48,events:52,fs:47,mkdirp:83,path:107,pixelmatch:109,tinycolor2:178}],194:[function(t,e,r){"use strict";function i(t,e){this.size=this.size||t,this.smallerSize=this.smallerSize||e,a(this.size)}function n(t){var e={};return 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)),e}function a(t){for(var e=1;el?"1":"0";return f};var s=[];e.exports=i},{}],195:[function(t,e,r){(function(r,i){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault");n(t("@babel/runtime/helpers/defineProperty")),n(t("@babel/runtime/helpers/extends"));r.browser,e.exports=function(t,e){var r=new XMLHttpRequest;r.open("GET",t.url,!0),r.responseType="arraybuffer",r.addEventListener("load",function(){if(r.status<400)try{var n=i.from(this.response);e(null,r,n)}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()}}).call(this,t("_process"),t("buffer").Buffer)},{"@babel/runtime/helpers/defineProperty":7,"@babel/runtime/helpers/extends":8,"@babel/runtime/helpers/interopRequireDefault":11,_process:133,buffer:48,phin:108}],196:[function(t,e,r){(function(e){"use strict";function i(t,e){var r=(0,m.default)(t);return r?r.mime:e?v.getType(e):null}function n(t){return t._exif&&t._exif.tags&&t._exif.tags.Orientation||1}function a(t){var e=t.getWidth(),r=t.getHeight();switch(n(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 o(t,r,i,n){for(var a=t.bitmap.data,o=t.bitmap.width,s=e.alloc(a.length),u=0;u4,i=r?t.bitmap.height:t.bitmap.width,s=r?t.bitmap.width:t.bitmap.height;o(t,i,s,e)}}function u(t,e,r){var n=i(t,e);if("string"!=typeof n)return r(new Error("Could not find MIME for Buffer <"+e+">"));this._originalMime=n.toLowerCase();try{var a=this.getMIME();if(!this.constructor.decoders[a])return g.throwError.call(this,"Unsupported MIME type: "+a,r);this.bitmap=this.constructor.decoders[a](t)}catch(t){return r.call(this,t,this)}try{this._exif=b.default.create(t).parse(),s(this)}catch(t){}return r.call(this,null,this),this}function h(t,e){return new t(e.bitmap.width,e.bitmap.height,e._background).composite(e,0,0).bitmap}function l(t,r){if(t===_.AUTO&&(t=this.getMIME()),"string"!=typeof t)return g.throwError.call(this,"mime must be a string",r);if("function"!=typeof r)return g.throwError.call(this,"cb must be a function",r);if(t=t.toLowerCase(),this._rgba&&this.constructor.hasAlpha[t]?this.bitmap.data=e.from(this.bitmap.data):this.bitmap.data=h(this.constructor,this).data,this.constructor.encoders[t]){var i=this.constructor.encoders[t](this);r.call(this,null,i)}else r.call(this,"Unsupported MIME type: "+t);return this}function f(t){return(0,y.default)(l,this,t)}var c=t("@babel/runtime/helpers/interopRequireWildcard"),d=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.parseBitmap=u,r.getBuffer=l,r.getBufferAsync=f;var p=d(t("@babel/runtime/helpers/slicedToArray")),m=d(t("file-type")),b=d(t("exif-parser")),g=t("@jimp/utils"),_=c(t("../constants")),v=c(t("./mime")),y=d(t("./promisify"))}).call(this,t("buffer").Buffer)},{"../constants":192,"./mime":197,"./promisify":198,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/interopRequireWildcard":12,"@babel/runtime/helpers/slicedToArray":19,"@jimp/utils":235,buffer:48,"exif-parser":53,"file-type":62}],197:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getExtension=r.getType=r.addType=void 0;var i={},n=function(t){return Object.entries(i).find(function(e){return e[1].includes(t)})||[]},a=function(t,e){i[t]=e};r.addType=a;var o=function(t){var e=t.split("/").slice(-1),r=e[e.length-1].split(".").pop(),i=n(r);return i[0]};r.getType=o;var s=function(t){return(i[t.toLowerCase()]||[])[0]};r.getExtension=s},{}],198:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n1&&void 0!==arguments[1]?arguments[1]:f.default,o={hasAlpha:{},encoders:{},decoders:{},class:{},constants:{}};return t.types&&(t.types.forEach(r),a.decoders=n({},a.decoders,{},o.decoders),a.encoders=n({},a.encoders,{},o.encoders),a.hasAlpha=n({},a.hasAlpha,{},o.hasAlpha)),t.plugins&&t.plugins.forEach(i),(0,f.addJimpMethods)(o.class,a),(0,f.addConstants)(o.constants,a),f.default}var o=t("@babel/runtime/helpers/interopRequireWildcard"),s=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=a;var u=s(t("@babel/runtime/helpers/toConsumableArray")),h=s(t("@babel/runtime/helpers/defineProperty")),l=s(t("@babel/runtime/helpers/slicedToArray")),f=o(t("@jimp/core"));e.exports=r.default},{"@babel/runtime/helpers/defineProperty":7,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/interopRequireWildcard":12,"@babel/runtime/helpers/slicedToArray":19,"@babel/runtime/helpers/toConsumableArray":20,"@jimp/core":193}],200:[function(t,e,r){"use strict";var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(t("@jimp/custom")),a=i(t("@jimp/types")),o=i(t("@jimp/plugins")),s=(0,n.default)({types:[a.default],plugins:[o.default]});r.default=s,e.exports=r.default},{"@babel/runtime/helpers/interopRequireDefault":11,"@jimp/custom":199,"@jimp/plugins":228,"@jimp/types":234}],201:[function(t,e,r){"use strict";var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(t("@babel/runtime/helpers/typeof")),a=t("@jimp/utils"),o=function(){return{blit:function(t,e,r,i,o,s,u,h){if(!(t instanceof this.constructor))return a.throwError.call(this,"The source must be a Jimp image",h);if("number"!=typeof e||"number"!=typeof r)return a.throwError.call(this,"x and y must be numbers",h);if("function"==typeof i)h=i,i=0,o=0,s=t.bitmap.width,u=t.bitmap.height;else{if((0,n.default)(i)!==(0,n.default)(o)||(0,n.default)(o)!==(0,n.default)(s)||(0,n.default)(s)!==(0,n.default)(u))return a.throwError.call(this,"srcx, srcy, srcw, srch must be numbers",h);i=i||0,o=o||0,s=s||t.bitmap.width,u=u||t.bitmap.height}e=Math.round(e),r=Math.round(r),i=Math.round(i),o=Math.round(o),s=Math.round(s),u=Math.round(u);var l=this.bitmap.width,f=this.bitmap.height,c=this;return t.scanQuiet(i,o,s,u,function(t,n,a){var s=e+t-i,u=r+n-o;if(s>=0&&u>=0&&l-s>0&&f-u>0){var h=c.getPixelIndex(s,u),d={r:this.bitmap.data[a],g:this.bitmap.data[a+1],b:this.bitmap.data[a+2],a:this.bitmap.data[a+3]},p={r:c.bitmap.data[h],g:c.bitmap.data[h+1],b:c.bitmap.data[h+2],a:c.bitmap.data[h+3]};c.bitmap.data[h]=(d.a*(d.r-p.r)-p.r+255>>8)+p.r,c.bitmap.data[h+1]=(d.a*(d.g-p.g)-p.g+255>>8)+p.g,c.bitmap.data[h+2]=(d.a*(d.b-p.b)-p.b+255>>8)+p.b,c.bitmap.data[h+3]=this.constructor.limit255(p.a+d.a)}}),(0,a.isNodePattern)(h)&&h.call(this,null,this),this}}};r.default=o,e.exports=r.default},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":21,"@jimp/utils":235}],202:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shgTable=r.mulTable=void 0;var i=[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];r.mulTable=i;var n=[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];r.shgTable=n},{}],203:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t("@jimp/utils"),n=t("./blur-tables"),a=function(){return{blur:function(t,e){if("number"!=typeof t)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);for(var r,a,o,s,u,h,l,f,c,d,p,m,b,g,_=this.bitmap.width-1,v=this.bitmap.height-1,y=t+1,w=n.mulTable[t],E=n.shgTable[t],x=[],S=[],k=[],M=[],A=[],I=[],T=2;T-- >0;){for(m=0,b=0,h=0;h_?_:l)<<2),r+=this.bitmap.data[f++],a+=this.bitmap.data[f++],o+=this.bitmap.data[f++],s+=this.bitmap.data[f];for(u=0;u0?f<<2:0),c=b+A[u],d=b+I[u],r+=this.bitmap.data[c++]-this.bitmap.data[d++],a+=this.bitmap.data[c++]-this.bitmap.data[d++],o+=this.bitmap.data[c++]-this.bitmap.data[d++],s+=this.bitmap.data[c]-this.bitmap.data[d],m++;b+=this.bitmap.width<<2}for(u=0;uv?0:this.bitmap.width,r+=x[p],a+=S[p],o+=k[p],s+=M[p];for(m=u<<2,h=0;h>>E,this.bitmap.data[m+3]=g,g>255&&(this.bitmap.data[m+3]=255),g>0?(g=255/g,this.bitmap.data[m]=(r*w>>>E)*g,this.bitmap.data[m+1]=(a*w>>>E)*g,this.bitmap.data[m+2]=(o*w>>>E)*g):(this.bitmap.data[m+2]=0,this.bitmap.data[m+1]=0,this.bitmap.data[m]=0),0===u&&(A[h]=((f=h+y)0?f*this.bitmap.width:0),c=u+A[h],d=u+I[h],r+=x[c]-x[d],a+=S[c]-S[d],o+=k[c]-k[d],s+=M[c]-M[d],m+=this.bitmap.width<<2}}return(0,i.isNodePattern)(e)&&e.call(this,null,this),this}}};r.default=a,e.exports=r.default},{"./blur-tables":202,"@jimp/utils":235}],204:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t("@jimp/utils"),n=function(){return{circle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(e=t,t={});var r=t.radius||(this.bitmap.width>this.bitmap.height?this.bitmap.height:this.bitmap.width)/2,n={x:"number"==typeof t.x?t.x:this.bitmap.width/2,y:"number"==typeof t.y?t.y:this.bitmap.height/2};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,i){var a=Math.sqrt(Math.pow(t-n.x,2)+Math.pow(e-n.y,2));r-a<=0?this.bitmap.data[i+3]=0:r-a<1&&(this.bitmap.data[i+3]=255*(r-a))}),(0,i.isNodePattern)(e)&&e.call(this,null,this),this}}};r.default=n,e.exports=r.default},{"@jimp/utils":235}],205:[function(t,e,r){(function(i){"use strict";function n(t,e,r,i){for(var n=[0,0,0],a=(e.length-1)/2,o=0;o2&&void 0!==arguments[2]?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 s(t,e){var r=this;return t&&Array.isArray(t)?(t=t.map(function(t){return"xor"!==t.apply&&"mix"!==t.apply||(t.params[0]=(0,l.default)(t.params[0]).toRgb()),t}),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(i,n,a){var s={r:r.bitmap.data[a],g:r.bitmap.data[a+1],b:r.bitmap.data[a+2]},u=function(t,e){return r.constructor.limit255(s[t]+e)};t.forEach(function(t){if("mix"===t.apply)s=o(s,t.params[0],t.params[1]);else if("tint"===t.apply)s=o(s,{r:255,g:255,b:255},t.params[0]);else if("shade"===t.apply)s=o(s,{r:0,g:0,b:0},t.params[0]);else if("xor"===t.apply)s={r:s.r^t.params[0].r,g:s.g^t.params[0].g,b:s.b^t.params[0].b};else if("red"===t.apply)s.r=u("r",t.params[0]);else if("green"===t.apply)s.g=u("g",t.params[0]);else if("blue"===t.apply)s.b=u("b",t.params[0]);else{var i;if("hue"===t.apply&&(t.apply="spin"),s=(0,l.default)(s),!s[t.apply])return f.throwError.call(r,"action "+t.apply+" not supported",e);s=(i=s)[t.apply].apply(i,(0,h.default)(t.params)).toRgb()}}),r.bitmap.data[a]=s.r,r.bitmap.data[a+1]=s.g,r.bitmap.data[a+2]=s.b}),(0,f.isNodePattern)(e)&&e.call(this,null,this),this):f.throwError.call(this,"actions must be an array",e)}var u=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var h=u(t("@babel/runtime/helpers/toConsumableArray")),l=u(t("tinycolor2")),f=t("@jimp/utils"),c=function(t){return null!=t},d=function(){return{brightness:function(t,e){return"number"!=typeof t?f.throwError.call(this,"val must be numbers",e):t<-1||t>1?f.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){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)):(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)}),(0,f.isNodePattern)(e)&&e.call(this,null,this),this)},contrast:function(t,e){function r(t){return t=Math.floor(i*(t-127)+127),t<0?0:t>255?255:t}if("number"!=typeof t)return f.throwError.call(this,"val must be numbers",e);if(t<-1||t>1)return f.throwError.call(this,"val must be a number between -1 and +1",e);var i=(t+1)/(1-t);return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,i){this.bitmap.data[i]=r(this.bitmap.data[i]),this.bitmap.data[i+1]=r(this.bitmap.data[i+1]),this.bitmap.data[i+2]=r(this.bitmap.data[i+2])}),(0,f.isNodePattern)(e)&&e.call(this,null,this),this},posterize:function(t,e){return"number"!=typeof t?f.throwError.call(this,"n must be numbers",e):(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}),(0,f.isNodePattern)(e)&&e.call(this,null,this),this)},greyscale:a,grayscale:a,opacity:function(t,e){return"number"!=typeof t?f.throwError.call(this,"f must be a number",e):t<0||t>1?f.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 n=this.bitmap.data[i+3]*t;this.bitmap.data[i+3]=n}),(0,f.isNodePattern)(e)&&e.call(this,null,this),this)},sepia:function(t){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){var i=this.bitmap.data[r],n=this.bitmap.data[r+1],a=this.bitmap.data[r+2];i=.393*i+.769*n+.189*a,n=.349*i+.686*n+.168*a,a=.272*i+.534*n+.131*a,this.bitmap.data[r]=i<255?i:255,this.bitmap.data[r+1]=n<255?n:255,this.bitmap.data[r+2]=a<255?a:255}),(0,f.isNodePattern)(t)&&t.call(this,null,this),this},fade:function(t,e){return"number"!=typeof t?f.throwError.call(this,"f must be a number",e):t<0||t>1?f.throwError.call(this,"f must be a number from 0 to 1",e):(this.opacity(1-t),(0,f.isNodePattern)(e)&&e.call(this,null,this),this)},convolution:function(t,e,r){"function"==typeof e&&void 0===r&&(r=e,e=null),e||(e=this.constructor.EDGE_EXTEND);var n,a,o,s,u,h,l,c,d,p,m=i.from(this.bitmap.data),b=t.length,g=t[0].length,_=Math.floor(b/2),v=Math.floor(g/2),y=-_,w=-v;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(r,i,f){s=0,o=0,a=0;for(var b=y;b<=_;b++)for(var g=w;g<=v;g++)c=r+g,d=i+b,n=t[b+_][g+v],p=this.getPixelIndex(c,d,e),-1===p?(l=0,h=0,u=0):(u=this.bitmap.data[p+0],h=this.bitmap.data[p+1],l=this.bitmap.data[p+2]),a+=n*u,o+=n*h,s+=n*l;a<0&&(a=0),o<0&&(o=0),s<0&&(s=0),a>255&&(a=255),o>255&&(o=255),s>255&&(s=255),m[f+0]=a,m[f+1]=o,m[f+2]=s}),this.bitmap.data=m,(0,f.isNodePattern)(r)&&r.call(this,null,this),this},opaque:function(t){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){this.bitmap.data[r+3]=255}),(0,f.isNodePattern)(t)&&t.call(this,null,this),this},pixelate:function(t,e,r,i,a,o){if("function"==typeof e)o=e,a=null,i=null,r=null,e=null;else{if("number"!=typeof t)return f.throwError.call(this,"size must be a number",o);if(c(e)&&"number"!=typeof e)return f.throwError.call(this,"x must be a number",o);if(c(r)&&"number"!=typeof r)return f.throwError.call(this,"y must be a number",o);if(c(i)&&"number"!=typeof i)return f.throwError.call(this,"w must be a number",o);if(c(a)&&"number"!=typeof a)return f.throwError.call(this,"h must be a number",o)}var s=[[1/16,.125,1/16],[.125,.25,.125],[1/16,.125,1/16]];e=e||0,r=r||0,i=c(i)?i:this.bitmap.width-e,a=c(a)?a:this.bitmap.height-r;var u=this.cloneQuiet();return this.scanQuiet(e,r,i,a,function(e,r,i){e=t*Math.floor(e/t),r=t*Math.floor(r/t);var a=n(u,s,e,r);this.bitmap.data[i]=a[0],this.bitmap.data[i+1]=a[1],this.bitmap.data[i+2]=a[2]}),(0,f.isNodePattern)(o)&&o.call(this,null,this),this},convolute:function(t,e,r,i,a,o){if(!Array.isArray(t))return f.throwError.call(this,"the kernel must be an array",o);if("function"==typeof e)o=e,e=null,r=null,i=null,a=null;else{if(c(e)&&"number"!=typeof e)return f.throwError.call(this,"x must be a number",o);if(c(r)&&"number"!=typeof r)return f.throwError.call(this,"y must be a number",o);if(c(i)&&"number"!=typeof i)return f.throwError.call(this,"w must be a number",o);if(c(a)&&"number"!=typeof a)return f.throwError.call(this,"h must be a number",o)}var s=(t.length-1)/2;e=c(e)?e:s,r=c(r)?r:s,i=c(i)?i:this.bitmap.width-e,a=c(a)?a:this.bitmap.height-r;var u=this.cloneQuiet() ;return this.scanQuiet(e,r,i,a,function(e,r,i){var a=n(u,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])}),(0,f.isNodePattern)(o)&&o.call(this,null,this),this},color:s,colour:s}};r.default=d,e.exports=r.default}).call(this,t("buffer").Buffer)},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/toConsumableArray":20,"@jimp/utils":235,buffer:48,tinycolor2:178}],206:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t("@jimp/utils"),n=function(){return{contain:function(t,e,r,n,a){if("number"!=typeof t||"number"!=typeof e)return i.throwError.call(this,"w and h must be numbers",a);"string"==typeof r&&("function"==typeof n&&void 0===a&&(a=n),n=r,r=null),"function"==typeof r&&(void 0===a&&(a=r),n=null,r=null),"function"==typeof n&&void 0===a&&(a=n,n=null),r=r||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE;var o=7&r,s=r>>3;if((0===o||o&o-1)&&(0===s||s&s-1))return i.throwError.call(this,"only use one flag per alignment direction",a);var u=o>>1,h=s>>1,l=t/e>this.bitmap.width/this.bitmap.height?e/this.bitmap.height:t/this.bitmap.width,f=this.cloneQuiet().scale(l,n);return this.resize(t,e,n),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,r){this.bitmap.data.writeUInt32BE(this._background,r)}),this.blit(f,(this.bitmap.width-f.bitmap.width)/2*u,(this.bitmap.height-f.bitmap.height)/2*h),(0,i.isNodePattern)(a)&&a.call(this,null,this),this}}};r.default=n,e.exports=r.default},{"@jimp/utils":235}],207:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t("@jimp/utils"),n=function(){return{cover:function(t,e,r,n,a){if("number"!=typeof t||"number"!=typeof e)return i.throwError.call(this,"w and h must be numbers",a);r&&"function"==typeof r&&void 0===a?(a=r,r=null,n=null):"function"==typeof n&&void 0===a&&(a=n,n=null),r=r||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE;var o=7&r,s=r>>3;if((0===o||o&o-1)&&(0===s||s&s-1))return i.throwError.call(this,"only use one flag per alignment direction",a);var u=o>>1,h=s>>1,l=t/e>this.bitmap.width/this.bitmap.height?t/this.bitmap.width:e/this.bitmap.height;return this.scale(l,n),this.crop((this.bitmap.width-t)/2*u,(this.bitmap.height-e)/2*h,t,e),(0,i.isNodePattern)(a)&&a.call(this,null,this),this}}};r.default=n,e.exports=r.default},{"@jimp/utils":235}],208:[function(t,e,r){(function(i){"use strict";function n(t){return t("crop",function(t,e,r,n,a){if("number"!=typeof t||"number"!=typeof e)return s.throwError.call(this,"x and y must be numbers",a);if("number"!=typeof r||"number"!=typeof n)return s.throwError.call(this,"w and h must be numbers",a);if(t=Math.round(t),e=Math.round(e),r=Math.round(r),n=Math.round(n),0===t&&r===this.bitmap.width){var o=r*e+t<<2,u=o+n*r<<2;this.bitmap.data=this.bitmap.data.slice(o,u)}else{var h=i.allocUnsafe(r*n*4),l=0;this.scanQuiet(t,e,r,n,function(t,e,r){var i=this.bitmap.data.readUInt32BE(r,!0);h.writeUInt32BE(i,l,!0),l+=4}),this.bitmap.data=h}return this.bitmap.width=r,this.bitmap.height=n,(0,s.isNodePattern)(a)&&a.call(this,null,this),this}),{class:{autocrop:function(){for(var t,e=this.bitmap.width,r=this.bitmap.height,i=1,n=0,a=2e-4,u=!0,h=!1,l={north:!1,south:!1,east:!1,west:!1},f=arguments.length,c=new Array(f),d=0;da)break t}v++}if(g=this.getPixelColor(e,0),!l.east)t:for(var A=0;Aa)break t}y++}if(g=this.getPixelColor(0,r),!l.south)t:for(var P=r-1;P>=v+i;P--){for(var C=e-y-1;C>=0;C--){var O=this.getPixelColor(C,P),L=this.constructor.intToRGBA(O);if(this.constructor.colorDiff(_,L)>a)break t}w++}if(g=this.getPixelColor(e,r),!l.west)t:for(var B=e-1;B>=0+y+i;B--){for(var D=r-1;D>=0+v;D--){var N=this.getPixelColor(B,D),z=this.constructor.intToRGBA(N);if(this.constructor.colorDiff(_,z)>a)break t}E++}var j=!1;if(E-=n,y-=n,v-=n,w-=n,h){var U=Math.min(y,E),F=Math.min(v,w);E=U,y=U,v=F,w=F}E=E>=0?E:0,y=y>=0?y:0,v=v>=0?v:0,w=w>=0?w:0;var G=e-(E+y),H=r-(w+v);return j=u?0!==y&&0!==v&&0!==E&&0!==w:0!==y||0!==v||0!==E||0!==w,j&&this.crop(y,v,G,H),(0,s.isNodePattern)(t)&&t.call(this,null,this),this}}}}var a=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var o=a(t("@babel/runtime/helpers/typeof")),s=t("@jimp/utils");e.exports=r.default}).call(this,t("buffer").Buffer)},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":21,"@jimp/utils":235,buffer:48}],209:[function(t,e,r){"use strict";var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(t("@babel/runtime/helpers/typeof")),a=t("@jimp/utils"),o=function(){return{displace:function(t,e,r){if("object"!==(0,n.default)(t)||t.constructor!==this.constructor)return a.throwError.call(this,"The source must be a Jimp image",r);if("number"!=typeof e)return a.throwError.call(this,"factor must be a number",r);var i=this.cloneQuiet();return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(r,n,a){var o=t.bitmap.data[a]/256*e;o=Math.round(o);var s=this.getPixelIndex(r+o,n);this.bitmap.data[s]=i.bitmap.data[a],this.bitmap.data[s+1]=i.bitmap.data[a+1],this.bitmap.data[s+2]=i.bitmap.data[a+2]}),(0,a.isNodePattern)(r)&&r.call(this,null,this),this}}};r.default=o,e.exports=r.default},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":21,"@jimp/utils":235}],210:[function(t,e,r){"use strict";function i(t){var e=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,r,i){var n=((3&r)<<2)+t%4,a=e[n];this.bitmap.data[i]=Math.min(this.bitmap.data[i]+a,255),this.bitmap.data[i+1]=Math.min(this.bitmap.data[i+1]+a,255),this.bitmap.data[i+2]=Math.min(this.bitmap.data[i+2]+a,255)}),(0,n.isNodePattern)(t)&&t.call(this,null,this),this}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=t("@jimp/utils"),a=function(){return{dither565:i,dither16:i}};r.default=a,e.exports=r.default},{"@jimp/utils":235}],211:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t("@jimp/utils"),n=function(){return{fisheye:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{r:2.5},r=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(r=e,e={r:2.5});var n=this.cloneQuiet(),a=n.bitmap,o=a.width,s=a.height;return n.scanQuiet(0,0,o,s,function(r,i){var a=r/o,u=i/s,h=Math.sqrt(Math.pow(a-.5,2)+Math.pow(u-.5,2)),l=2*Math.pow(h,e.r),f=(a-.5)/h,c=(u-.5)/h,d=Math.round((l*f+.5)*o),p=Math.round((l*c+.5)*s),m=n.getPixelColor(d,p);t.setPixelColor(m,r,i)}),this.setPixelColor(n.getPixelColor(o/2,s/2),o/2,s/2),(0,i.isNodePattern)(r)&&r.call(this,null,this),this}}};r.default=n,e.exports=r.default},{"@jimp/utils":235}],212:[function(t,e,r){(function(i){"use strict";function n(t,e,r){if("boolean"!=typeof t||"boolean"!=typeof e)return a.throwError.call(this,"horizontal and vertical must be Booleans",r);var n=i.alloc(this.bitmap.data.length);return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(r,i,a){var o=t?this.bitmap.width-1-r:r,s=e?this.bitmap.height-1-i:i,u=this.bitmap.width*s+o<<2,h=this.bitmap.data.readUInt32BE(a);n.writeUInt32BE(h,u)}),this.bitmap.data=i.from(n),(0,a.isNodePattern)(r)&&r.call(this,null,this),this}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=t("@jimp/utils"),o=function(){return{flip:n,mirror:n}};r.default=o,e.exports=r.default}).call(this,t("buffer").Buffer)},{"@jimp/utils":235,buffer:48}],213:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t("@jimp/utils"),n=function(){return{gaussian:function(t,e){if("number"!=typeof t)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);for(var r=Math.ceil(2.57*t),n=2*r+1,a=t*t*2,o=a*Math.PI,s=[],u=0;u1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;if(!(t instanceof this.constructor))return i.throwError.call(this,"The source must be a Jimp image",n);if("number"!=typeof e||"number"!=typeof r)return i.throwError.call(this,"x and y must be numbers",n);e=Math.round(e),r=Math.round(r);var a=this.bitmap.width,o=this.bitmap.height,s=this;return t.scanQuiet(0,0,t.bitmap.width,t.bitmap.height,function(t,i,n){var u=e+t,h=r+i;if(u>=0&&h>=0&&u0}),255-t.slice().reverse().findIndex(function(t){return t>0})]},s=function(){return{normalize:function(t){var e=i.call(this),r={r:o(e.r),g:o(e.g),b:o(e.b)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,i){var n=this.bitmap.data[i+0],o=this.bitmap.data[i+1],s=this.bitmap.data[i+2];this.bitmap.data[i+0]=a(n,r.r[0],r.r[1]),this.bitmap.data[i+1]=a(o,r.g[0],r.g[1]),this.bitmap.data[i+2]=a(s,r.b[0],r.b[1])}),(0,n.isNodePattern)(t)&&t.call(this,null,this),this}}};r.default=s,e.exports=r.default},{"@jimp/utils":235}],217:[function(t,e,r){(function(i){"use strict";function n(t,e,r,i,n){return n===t.HORIZONTAL_ALIGN_LEFT?0:n===t.HORIZONTAL_ALIGN_CENTER?(i-(0,m.measureText)(e,r))/2:i-(0,m.measureText)(e,r)}function a(t,e,r,i,n){if(n.width>0&&n.height>0){var a=e.pages[n.page];t.blit(a,r+n.xoffset,i+n.yoffset,n.x,n.y,n.width,n.height)}return t}function o(t,e,r,i,n){for(var o=0;oo&&(o=s),a.push(e)):(n.push(a),a=[e])}),n.push(a),{lines:n,longestLine:o}}function u(t,e,r){var i=r.map(function(r){return t.read(e+"/"+r)});return Promise.all(i)}var h=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=h(t("@babel/runtime/helpers/typeof")),f=h(t("@babel/runtime/helpers/toConsumableArray")),c=h(t("path")),d=h(t("load-bmfont")),p=t("@jimp/utils"),m=t("./measure-text"),b="browser/lib/",g=function(){return{constants:{measureText:m.measureText,measureTextHeight:m.measureTextHeight,FONT_SANS_8_BLACK:c.default.join(b,"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),FONT_SANS_10_BLACK:c.default.join(b,"fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),FONT_SANS_12_BLACK:c.default.join(b,"fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),FONT_SANS_14_BLACK:c.default.join(b,"fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),FONT_SANS_16_BLACK:c.default.join(b,"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),FONT_SANS_32_BLACK:c.default.join(b,"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),FONT_SANS_64_BLACK:c.default.join(b,"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),FONT_SANS_128_BLACK:c.default.join(b,"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),FONT_SANS_8_WHITE:c.default.join(b,"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),FONT_SANS_16_WHITE:c.default.join(b,"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),FONT_SANS_32_WHITE:c.default.join(b,"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),FONT_SANS_64_WHITE:c.default.join(b,"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),FONT_SANS_128_WHITE:c.default.join(b,"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),loadFont:function(t,e){var r=this;return"string"!=typeof t?p.throwError.call(this,"file must be a string",e):new Promise(function(i,n){e=e||function(t,e){t?n(t):i(e)},(0,d.default)(t,function(i,n){var a={},o={};if(i)return p.throwError.call(r,i,e);for(var s=0;sr&&s>0?(o+=t.common.lineHeight,a=n[s]+" "):a=u}return o}Object.defineProperty(r,"__esModule",{value:!0}),r.measureText=i,r.measureTextHeight=n},{}],219:[function(t,e,r){(function(r){function i(t){var e=Object.prototype.toString;return"[object ArrayBuffer]"===e.call(t)}function n(t){if(c)return f(t,{responseType:"arraybuffer"});if(void 0===self.XMLHttpRequest)throw new Error("your browser does not support XHR loading");var e=new self.XMLHttpRequest;return e.overrideMimeType("text/plain; charset=x-user-defined"),f({xhr:e},t)}var a=t("xhr"),o=function(){},s=t("parse-bmfont-ascii"),u=t("parse-bmfont-xml"),h=t("parse-bmfont-binary"),l=t("./lib/is-binary"),f=t("xtend"),c=self.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;e.exports=function(t,e){e="function"==typeof e?e:o,"string"==typeof t?t={uri:t}:t||(t={});var f=t.binary;f&&(t=n(t)),a(t,function(n,a,f){if(n)return e(n);if(!/^2/.test(a.statusCode))return e(new Error("http status code: "+a.statusCode));if(!f)return e(new Error("no body result"));var c,d=!1;if(i(f)){var p=new Uint8Array(f);f=new r(p,"binary")}l(f)&&(d=!0,"string"==typeof f&&(f=new r(f,"binary"))),d||(r.isBuffer(f)&&(f=f.toString(t.encoding)),f=f.trim());try{var m=a.headers["content-type"];c=d?h(f):/json/.test(m)||"{"===f.charAt(0)?JSON.parse(f):/xml/.test(m)||"<"===f.charAt(0)?u(f):s(f)}catch(t){e(new Error("error parsing font "+t.message)),e=o}e(null,c)})}}).call(this,t("buffer").Buffer)},{"./lib/is-binary":220,buffer:48,"parse-bmfont-ascii":102,"parse-bmfont-binary":103,"parse-bmfont-xml":104,xhr:187,xtend:189}],220:[function(t,e,r){(function(r){var i=t("buffer-equal"),n=new r([66,77,70,3]);e.exports=function(t){return"string"==typeof t?"BMF"===t.substring(0,3):t.length>4&&i(t.slice(0,4),n)}}).call(this,t("buffer").Buffer)},{buffer:48,"buffer-equal":49}],221:[function(t,e,r){(function(i){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=t("@jimp/utils"),o=n(t("./modules/resize")),s=n(t("./modules/resize2")),u=function(){return{constants:{RESIZE_NEAREST_NEIGHBOR:"nearestNeighbor",RESIZE_BILINEAR:"bilinearInterpolation",RESIZE_BICUBIC:"bicubicInterpolation",RESIZE_HERMITE:"hermiteInterpolation",RESIZE_BEZIER:"bezierInterpolation"},class:{resize:function(t,e,r,n){if("number"!=typeof t||"number"!=typeof e)return a.throwError.call(this,"w and h must be numbers",n);if("function"==typeof r&&void 0===n&&(n=r,r=null),t===this.constructor.AUTO&&e===this.constructor.AUTO)return a.throwError.call(this,"w and h cannot both be set to auto",n);if(t===this.constructor.AUTO&&(t=this.bitmap.width*(e/this.bitmap.height)),e===this.constructor.AUTO&&(e=this.bitmap.height*(t/this.bitmap.width)),t<0||e<0)return a.throwError.call(this,"w and h must be positive numbers",n);if(t=Math.round(t),e=Math.round(e),"function"==typeof s.default[r]){var u={data:i.alloc(t*e*4),width:t,height:e};s.default[r](this.bitmap,u),this.bitmap=u}else{var h=this,l=new o.default(this.bitmap.width,this.bitmap.height,t,e,!0,!0,function(r){h.bitmap.data=i.from(r),h.bitmap.width=t,h.bitmap.height=e});l.resize(this.bitmap.data)}return(0,a.isNodePattern)(n)&&n.call(this,null,this),this}}}};r.default=u,e.exports=r.default}).call(this,t("buffer").Buffer)},{"./modules/resize":222,"./modules/resize2":223,"@babel/runtime/helpers/interopRequireDefault":11,"@jimp/utils":235,buffer:48}],222:[function(t,e,r){"use strict";function i(t,e,r,i,n,a,o){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=n?4:3,this.interpolationPass=Boolean(a),this.resizeCallback="function"==typeof o?o: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()}i.prototype.initialize=function(){if(!(this.widthOriginal>0&&this.heightOriginal>0&&this.targetWidth>0&&this.targetHeight>0))throw new Error("Invalid settings specified for the resizer.");this.configurePasses()},i.prototype.configurePasses=function(){this.widthOriginal===this.targetWidth?this.resizeWidth=this.bypassResizer:(this.ratioWeightWidthPass=this.widthOriginal/this.targetWidth,this.ratioWeightWidthPass<1&&this.interpolationPass?(this.initializeFirstPassBuffers(!0),this.resizeWidth=4===this.colorChannels?this.resizeWidthInterpolatedRGBA:this.resizeWidthInterpolatedRGB):(this.initializeFirstPassBuffers(!1),this.resizeWidth=4===this.colorChannels?this.resizeWidthRGBA:this.resizeWidthRGB)),this.heightOriginal===this.targetHeight?this.resizeHeight=this.bypassResizer:(this.ratioWeightHeightPass=this.heightOriginal/this.targetHeight,this.ratioWeightHeightPass<1&&this.interpolationPass?(this.initializeSecondPassBuffers(!0),this.resizeHeight=this.resizeHeightInterpolated):(this.initializeSecondPassBuffers(!1),this.resizeHeight=4===this.colorChannels?this.resizeHeightRGBA:this.resizeHeightRGB))},i.prototype._resizeWidthInterpolatedRGBChannels=function(t,e){var r,i,n=e?4:3,a=this.ratioWeightWidthPass,o=this.widthBuffer,s=0,u=0,h=0,l=0,f=0;for(r=0;s<1/3;r+=n,s+=a)for(u=r,h=0;u=f)){d+=l;break}c+=r,d=c,l-=f}while(l>0&&c=u)){l+=s;break}h=d,l=h,s-=u}while(s>0&&h3&&(this.outputWidthWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.heightOriginal)))},i.prototype.initializeSecondPassBuffers=function(t){this.heightBuffer=this.generateUint8Buffer(this.finalResultSize),t||(this.outputHeightWorkBench=this.generateFloatBuffer(this.targetWidthMultipliedByChannels),this.colorChannels>3&&(this.outputHeightWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.targetWidth)))},i.prototype.generateFloatBuffer=function(t){try{return new Float32Array(t)}catch(t){return[]}},i.prototype.generateFloat64Buffer=function(t){try{return new Float64Array(t)}catch(t){return[]}},i.prototype.generateUint8Buffer=function(t){try{return new Uint8Array(t)}catch(t){return[]}},e.exports=i},{}],223:[function(t,e,r){(function(t){"use strict";e.exports={nearestNeighbor:function(t,e){for(var r=t.width,i=t.height,n=e.width,a=e.height,o=t.data,s=e.data,u=0;u0?a[S-4]:2*a[S]-a[S+4],M=a[S],A=a[S+4],I=v0?m[z-4*c]:2*m[z]-m[z+4*c],U=m[z],F=m[z+4*c],G=O1)for(var q=0;q=0&&v.x=0&&v.ythis.bitmap.width/this.bitmap.height?e/this.bitmap.height:t/this.bitmap.width;return this.scale(a,r),(0,i.isNodePattern)(n)&&n.call(this,null,this),this}}};r.default=n,e.exports=r.default},{"@jimp/utils":235}],226:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t("@jimp/utils"),n=function(){return{shadow:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(r=e,e={});var n=e,a=n.opacity,o=void 0===a?.7:a,s=n.size,u=void 0===s?1.1:s,h=n.x,l=void 0===h?-25:h,f=n.y,c=void 0===f?25:f,d=n.blur,p=void 0===d?5:d,m=this.clone(),b=this.clone();return b.scan(0,0,b.bitmap.width,b.bitmap.height,function(e,r,i){b.bitmap.data[i]=0,b.bitmap.data[i+1]=0,b.bitmap.data[i+2]=0,b.bitmap.data[i+3]=b.constructor.limit255(b.bitmap.data[i+3]*o),t.bitmap.data[i]=0,t.bitmap.data[i+1]=0,t.bitmap.data[i+2]=0,t.bitmap.data[i+3]=0}),b.resize(b.bitmap.width*u,b.bitmap.height*u).blur(p),this.composite(b,l,c),this.composite(m,0,0),(0,i.isNodePattern)(r)&&r.call(this,null,this),this}}};r.default=n,e.exports=r.default},{"@jimp/utils":235}],227:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t("@jimp/utils"),n=function(){return{threshold:function(t,e){var r=this,n=t.max,a=t.replace,o=void 0===a?255:a,s=t.autoGreyscale,u=void 0===s||s;return"number"!=typeof n?i.throwError.call(this,"max must be a number",e):"number"!=typeof o?i.throwError.call(this,"replace must be a number",e):"boolean"!=typeof u?i.throwError.call(this,"autoGreyscale must be a boolean",e):(n=this.constructor.limit255(n),o=this.constructor.limit255(o),u&&this.greyscale(),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(t,e,i){var a=r.bitmap.data[i]100?o.throwError.call(this,"n must be a number 0 - 100",e):(this._quality=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)}}}};r.default=u,e.exports=r.default},{"@babel/runtime/helpers/defineProperty":7,"@babel/runtime/helpers/interopRequireDefault":11,"@jimp/utils":235,"jpeg-js":80}],232:[function(t,e,r){"use strict";var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(t("@babel/runtime/helpers/defineProperty")),a=t("pngjs"),o=t("@jimp/utils"),s="image/png",u=-1,h=0,l=1,f=2,c=3,d=4,p=function(){return{mime:(0,n.default)({},s,["png"]),constants:{MIME_PNG:s,PNG_FILTER_AUTO:u,PNG_FILTER_NONE:h,PNG_FILTER_SUB:l,PNG_FILTER_UP:f,PNG_FILTER_AVERAGE:c,PNG_FILTER_PATH:d},hasAlpha:(0,n.default)({},s,!0),decoders:(0,n.default)({},s,a.PNG.sync.read),encoders:(0,n.default)({},s,function(t){var e=new a.PNG({width:t.bitmap.width,height:t.bitmap.height});return e.data=t.bitmap.data,a.PNG.sync.write(e,{width:t.bitmap.width,height:t.bitmap.height,deflateLevel:t._deflateLevel,deflateStrategy:t._deflateStrategy,filterType:t._filterType,colorType:"number"==typeof t._colorType?t._colorType:t._rgba?6:2,inputHasAlpha:t._rgba})}),class:{_deflateLevel:9,_deflateStrategy:3,_filterType:u,_colorType:null,deflateLevel:function(t,e){return"number"!=typeof t?o.throwError.call(this,"l must be a number",e):t<0||t>9?o.throwError.call(this,"l must be a number 0 - 9",e):(this._deflateLevel=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},deflateStrategy:function(t,e){return"number"!=typeof t?o.throwError.call(this,"s must be a number",e):t<0||t>3?o.throwError.call(this,"s must be a number 0 - 3",e):(this._deflateStrategy=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},filterType:function(t,e){return"number"!=typeof t?o.throwError.call(this,"n must be a number",e):t<-1||t>4?o.throwError.call(this,"n must be -1 (auto) or a number 0 - 4",e):(this._filterType=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},colorType:function(t,e){return"number"!=typeof t?o.throwError.call(this,"s must be a number",e):0!==t&&2!==t&&4!==t&&6!==t?o.throwError.call(this,"s must be a number 0, 2, 4, 6.",e):(this._colorType=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)}}}};r.default=p,e.exports=r.default},{"@babel/runtime/helpers/defineProperty":7,"@babel/runtime/helpers/interopRequireDefault":11,"@jimp/utils":235,pngjs:129}],233:[function(t,e,r){(function(i){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("utif")),s="image/tiff",u=function(){return{mime:(0,a.default)({},s,["tiff","tif"]),constants:{MIME_TIFF:s},decoders:(0,a.default)({},s,function(t){var e=o.default.decode(t),r=e[0];o.default.decodeImages(t,e);var n=o.default.toRGBA8(r);return{data:i.from(n),width:r.t256[0],height:r.t257[0]}}),encoders:(0,a.default)({},s,function(t){var e=o.default.encodeImage(t.bitmap.data,t.bitmap.width,t.bitmap.height);return i.from(e)})}};r.default=u,e.exports=r.default}).call(this,t("buffer").Buffer)},{"@babel/runtime/helpers/defineProperty":7,"@babel/runtime/helpers/interopRequireDefault":11,buffer:48,utif:182}],234:[function(t,e,r){"use strict";var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=t("timm"),a=i(t("@jimp/jpeg")),o=i(t("@jimp/png")),s=i(t("@jimp/bmp")),u=i(t("@jimp/tiff")),h=i(t("@jimp/gif")),l=function(){return(0,n.mergeDeep)((0,a.default)(),(0,o.default)(),(0,s.default)(),(0,u.default)(),(0,h.default)())};r.default=l,e.exports=r.default},{"@babel/runtime/helpers/interopRequireDefault":11,"@jimp/bmp":229,"@jimp/gif":230,"@jimp/jpeg":231,"@jimp/png":232,"@jimp/tiff":233,timm:177}],235:[function(t,e,r){"use strict";function i(t){if(void 0===t)return!1;if("function"!=typeof t)throw new TypeError("Callback must be a function");return!0}function n(t,e){if("string"==typeof t&&(t=new Error(t)),"function"==typeof e)return e.call(this,t);throw t}function a(t,e,r,i,n,a){e=Math.round(e),r=Math.round(r),i=Math.round(i),n=Math.round(n);for(var o=r;o