/*! For license information please see Image.js.LICENSE.txt */ (()=>{var __webpack_modules__={94148(e,t,r){"use strict";var n=r(65606);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;ie.length)&&(r=e.length),e.substring(r-t.length,r)===t}var _="",v="",w="",x="",k={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function B(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function E(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var S=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(S,e);var r,i,s,c,f=(r=S,i=h(),function(){var e,t=p(r);if(i){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function S(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,S),"object"!==m(e)||null===e)throw new b("options","Object",e);var r=e.message,i=e.operator,a=e.stackStartFn,o=e.actual,s=e.expected,c=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(_="",v="",x="",w=""):(_="",v="",x="",w="")),"object"===m(o)&&null!==o&&"object"===m(s)&&null!==s&&"stack"in o&&o instanceof Error&&"stack"in s&&s instanceof Error&&(o=B(o),s=B(s)),"deepStrictEqual"===i||"strictEqual"===i)t=f.call(this,function(e,t,r){var i="",a="",o=0,s="",u=!1,l=E(e),c=l.split("\n"),f=E(t).split("\n"),h=0,d="";if("strictEqual"===r&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===f.length&&c[0]!==f[0]){var p=c[0].length+f[0].length;if(p<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(k[r],"\n\n")+"".concat(c[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&p<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][h]===f[0][h];)h++;h>2&&(d="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var g=c[c.length-1],b=f[f.length-1];g===b&&(h++<2?s="\n ".concat(g).concat(s):i=g,c.pop(),f.pop(),0!==c.length&&0!==f.length);)g=c[c.length-1],b=f[f.length-1];var B=Math.max(c.length,f.length);if(0===B){var S=l.split("\n");if(S.length>30)for(S[26]="".concat(_,"...").concat(x);S.length>27;)S.pop();return"".concat(k.notIdentical,"\n\n").concat(S.join("\n"),"\n")}h>3&&(s="\n".concat(_,"...").concat(x).concat(s),u=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var A=0,C=k[r]+"\n".concat(v,"+ actual").concat(x," ").concat(w,"- expected").concat(x),I=" ".concat(_,"...").concat(x," Lines skipped");for(h=0;h1&&h>2&&(P>4?(a+="\n".concat(_,"...").concat(x),u=!0):P>3&&(a+="\n ".concat(f[h-2]),A++),a+="\n ".concat(f[h-1]),A++),o=h,i+="\n".concat(w,"-").concat(x," ").concat(f[h]),A++;else if(f.length1&&h>2&&(P>4?(a+="\n".concat(_,"...").concat(x),u=!0):P>3&&(a+="\n ".concat(c[h-2]),A++),a+="\n ".concat(c[h-1]),A++),o=h,a+="\n".concat(v,"+").concat(x," ").concat(c[h]),A++;else{var T=f[h],M=c[h],R=M!==T&&(!y(M,",")||M.slice(0,-1)!==T);R&&y(T,",")&&T.slice(0,-1)===M&&(R=!1,M+=","),R?(P>1&&h>2&&(P>4?(a+="\n".concat(_,"...").concat(x),u=!0):P>3&&(a+="\n ".concat(c[h-2]),A++),a+="\n ".concat(c[h-1]),A++),o=h,a+="\n".concat(v,"+").concat(x," ").concat(M),i+="\n".concat(w,"-").concat(x," ").concat(T),A+=2):(a+=i,i="",1!==P&&0!==h||(a+="\n ".concat(M),A++))}if(A>20&&h30)for(d[26]="".concat(_,"...").concat(x);d.length>27;)d.pop();t=1===d.length?f.call(this,"".concat(h," ").concat(d[0])):f.call(this,"".concat(h,"\n\n").concat(d.join("\n"),"\n"))}else{var p=E(o),g="",A=k[i];"notDeepEqual"===i||"notEqual"===i?(p="".concat(k[i],"\n\n").concat(p)).length>1024&&(p="".concat(p.slice(0,1021),"...")):(g="".concat(E(s)),p.length>512&&(p="".concat(p.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===i||"equal"===i?p="".concat(A,"\n\n").concat(p,"\n\nshould equal\n\n"):g=" ".concat(i," ").concat(g)),t=f.call(this,"".concat(p).concat(g))}return Error.stackTraceLimit=c,t.generatedMessage=!r,Object.defineProperty(l(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=o,t.expected=s,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(l(t),a),t.stack,t.name="AssertionError",u(t)}return s=S,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,a(a({},t),{},{customInspect:!1,depth:0}))}}])&&o(s.prototype,c),Object.defineProperty(s,"prototype",{writable:!1}),S}(c(Error),g.custom);e.exports=S},69597(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}var o,s,u={};function l(e,t,r){r||(r=Error);var o=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(c,r);var o,s,u,l=(s=c,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=a(s);if(u){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(r,n,i){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),a=l.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i)),a.code=e,a}return o=c,Object.defineProperty(o,"prototype",{writable:!1}),o}(r);u[e]=o}function c(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(e,t,i){var a,s,u,l,f;if(void 0===o&&(o=r(94148)),o("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,4)===s)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))u="The ".concat(e," ").concat(a," ").concat(c(t,"type"));else{var h=("number"!=typeof f&&(f=0),f+1>(l=e).length||-1===l.indexOf(".",f)?"argument":"property");u='The "'.concat(e,'" ').concat(h," ").concat(a," ").concat(c(t,"type"))}return u+". Received type ".concat(n(i))},TypeError),l("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(94591));var i=s.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)},TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",a=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", "),i+=", and ".concat(t[a-1]," arguments")}return"".concat(i," must be specified")},TypeError),e.exports.codes=u},82299(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(M).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function F(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),h(n,e,n.depth)}function c(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function f(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return _(i)||(i=h(e,i,n)),i}var a=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(_(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return y(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),B(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return d(r);if(0===o.length){if(E(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(w(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(B(r))return d(r)}var l,c="",f=!1,x=["{","}"];return m(r)&&(f=!0,x=["[","]"]),E(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(c=" "+RegExp.prototype.toString.call(r)),k(r)&&(c=" "+Date.prototype.toUTCString.call(r)),B(r)&&(c=" "+d(r)),0!==o.length||f&&0!=r.length?n<0?w(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=f?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,x)):x[0]+c+x[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),I(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?h(e,u.value,null):h(e,u.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function m(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function b(e){return null===e}function y(e){return"number"==typeof e}function _(e){return"string"==typeof e}function v(e){return void 0===e}function w(e){return x(e)&&"[object RegExp]"===S(e)}function x(e){return"object"==typeof e&&null!==e}function k(e){return x(e)&&"[object Date]"===S(e)}function B(e){return x(e)&&("[object Error]"===S(e)||e instanceof Error)}function E(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(12078),t.isArray=m,t.isBoolean=g,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=_,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=w,t.types.isRegExp=w,t.isObject=x,t.isDate=k,t.types.isDate=k,t.isError=B,t.types.isNativeError=B,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(33845);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[A((e=new Date).getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(56698),t._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],a=0;a0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function l(e,t,r){for(var n,i=[],a=t;at.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=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7,f.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<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||u.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},f.prototype.write=function(e,t,r,n,i,a,o){return this._write(!0,e,t,r,n,i,a,o)},f.prototype.writeSync=function(e,t,r,n,i,a,o){return this._write(!1,e,t,r,n,i,a,o)},f.prototype._write=function(e,r,o,s,u,l,c,f){if(a.equal(arguments.length,8),a(this.init_done,"write before init"),a(this.mode!==t.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===r,"must provide flush value"),this.write_in_progress=!0,r!==t.Z_NO_FLUSH&&r!==t.Z_PARTIAL_FLUSH&&r!==t.Z_SYNC_FLUSH&&r!==t.Z_FULL_FLUSH&&r!==t.Z_FINISH&&r!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=n.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=l,this.strm.next_out=c,this.flush=r,!e)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return i.nextTick(function(){h._process(),h._after()}),this},f.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},f.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.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)}},f.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.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},f.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},f.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},f.prototype.init=function(e,r,n,i,o){a(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),a(e>=8&&e<=15,"invalid windowBits"),a(r>=-1&&r<=9,"invalid compression level"),a(n>=1&&n<=9,"invalid memlevel"),a(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,i,o),this._setDictionary()},f.prototype.params=function(){throw new Error("deflateParams Not supported")},f.prototype.reset=function(){this._reset(),this._setDictionary()},f.prototype._init=function(e,r,n,i,a){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=a,this.write_in_progress=!1,this.init_done=!0},f.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=f},78559(e,t,r){"use strict";var n=r(65606),i=r(48287).Buffer,a=r(88310).Transform,o=r(5974),s=r(40537),u=r(94148).ok,l=r(48287).kMaxLength,c="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var f=Object.keys(o),h=0;h=l?o=new RangeError(c):t=i.concat(n,a),n=[],e.close(),r(o,t)}e.on("error",function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)}),e.on("end",s),e.end(t),o()}function _(e,t){if("string"==typeof t&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function v(e){if(!(this instanceof v))return new v(e);C.call(this,e,o.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);C.call(this,e,o.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);C.call(this,e,o.GZIP)}function k(e){if(!(this instanceof k))return new k(e);C.call(this,e,o.GUNZIP)}function B(e){if(!(this instanceof B))return new B(e);C.call(this,e,o.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);C.call(this,e,o.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);C.call(this,e,o.UNZIP)}function A(e){return e===o.Z_NO_FLUSH||e===o.Z_PARTIAL_FLUSH||e===o.Z_SYNC_FLUSH||e===o.Z_FULL_FLUSH||e===o.Z_FINISH||e===o.Z_BLOCK}function C(e,r){var n=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,a.call(this,e),e.flush&&!A(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!A(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:o.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!i.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){I(s),s._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],s.emit("error",n)};var u=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var l=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(l=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,l,e.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=l,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!n._handle},configurable:!0,enumerable:!0})}function I(e,t){t&&n.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function P(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(p),writable:!1}),t.Deflate=v,t.Inflate=w,t.Gzip=x,t.Gunzip=k,t.DeflateRaw=B,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new v(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new B(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new k(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new v(t),e,r)},t.deflateSync=function(e,t){return _(new v(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new x(t),e,r)},t.gzipSync=function(e,t){return _(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new B(t),e,r)},t.deflateRawSync=function(e,t){return _(new B(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new S(t),e,r)},t.unzipSync=function(e,t){return _(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new w(t),e,r)},t.inflateSync=function(e,t){return _(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new k(t),e,r)},t.gunzipSync=function(e,t){return _(new k(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new E(t),e,r)},t.inflateRawSync=function(e,t){return _(new E(t),e)},s.inherits(C,a),C.prototype.params=function(e,r,i){if(et.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var a=this;this.flush(o.Z_SYNC_FLUSH,function(){u(a._handle,"zlib binding closed"),a._handle.params(e,r),a._hadError||(a._level=e,a._strategy=r,i&&i())})}else n.nextTick(i)},C.prototype.reset=function(){return u(this._handle,"zlib binding closed"),this._handle.reset()},C.prototype._flush=function(e){this._transform(i.alloc(0),"",e)},C.prototype.flush=function(e,t){var r=this,a=this._writableState;("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),a.ended?t&&n.nextTick(t):a.ending?t&&this.once("end",t):a.needDrain?t&&this.once("drain",function(){return r.flush(e,t)}):(this._flushFlag=e,this.write(i.alloc(0),"",t))},C.prototype.close=function(e){I(this,e),n.nextTick(P,this)},C.prototype._transform=function(e,t,r){var n,a=this._writableState,s=(a.ending||a.ended)&&(!e||a.length===e.length);return null===e||i.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},C.prototype._processChunk=function(e,t,r){var n=e&&e.length,a=this._chunkSize-this._offset,o=0,s=this,f="function"==typeof r;if(!f){var h,d=[],p=0;this.on("error",function(e){h=e}),u(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,a)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw h;if(p>=l)throw I(this),new RangeError(c);var g=i.concat(d,p);return I(this),g}u(this._handle,"zlib binding closed");var b=this._handle.write(t,e,o,n,this._buffer,this._offset,a);function y(l,c){if(this&&(this.buffer=null,this.callback=null),!s._hadError){var h=a-c;if(u(h>=0,"have should not go down"),h>0){var m=s._buffer.slice(s._offset,s._offset+h);s._offset+=h,f?s.push(m):(d.push(m),p+=m.length)}if((0===c||s._offset>=s._chunkSize)&&(a=s._chunkSize,s._offset=0,s._buffer=i.allocUnsafe(s._chunkSize)),0===c){if(o+=n-l,n=l,!f)return!0;var g=s._handle.write(t,e,o,n,s._buffer,s._offset,s._chunkSize);return g.callback=y,void(g.buffer=e)}if(!f)return!1;r()}}b.buffer=e,b.callback=y},s.inherits(v,C),s.inherits(w,C),s.inherits(x,C),s.inherits(k,C),s.inherits(B,C),s.inherits(E,C),s.inherits(S,C)},48287(e,t,r){"use strict";const n=r(67526),i=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(V(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(V(e,ArrayBuffer)||e&&V(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(V(e,SharedArrayBuffer)||e&&V(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?s(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return c(e),s(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||V(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,i){let a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;const a=t.length;let o;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,s,u;switch(o){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(a=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(a=u))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(V(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const s=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function C(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function F(e,t,r,n,i){j(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function O(e,t,r,n,i){j(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function N(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,a){return t=+t,r>>>=0,a||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,a){return t=+t,r>>>=0,a||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||M(e,t,this.length);let n=this[e],i=1,a=0;for(;++a>>=0,t>>>=0,r||M(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X(function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||M(e,t,this.length);let n=this[e],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X(function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||M(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X(function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=X(function(e,t=0){return O(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,a=1,o=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X(function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=X(function(e,t=0){return O(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=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),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function j(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new z.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){Z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,i,a)}function Z(e,t){if("number"!=typeof e)throw new z.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw Z(e,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),U("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function q(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Q(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function V(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},13144(e,t,r){"use strict";var n=r(66743),i=r(11002),a=r(10076),o=r(47119);e.exports=o||n.call(a,i)},12205(e,t,r){"use strict";var n=r(66743),i=r(11002),a=r(13144);e.exports=function(){return a(n,i,arguments)}},11002(e){"use strict";e.exports=Function.prototype.apply},10076(e){"use strict";e.exports=Function.prototype.call},73126(e,t,r){"use strict";var n=r(66743),i=r(69675),a=r(10076),o=r(13144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return o(n,a,e)}},47119(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},38075(e,t,r){"use strict";var n=r(70453),i=r(10487),a=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i(r):r}},10487(e,t,r){"use strict";var n=r(96897),i=r(30655),a=r(73126),o=r(12205);e.exports=function(e){var t=a(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:o}):e.exports.apply=o},36556(e,t,r){"use strict";var n=r(70453),i=r(73126),a=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i([r]):r}},30041(e,t,r){"use strict";var n=r(30655),i=r(58068),a=r(69675),o=r(75795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!o&&o(e,t);if(n)n(e,t,{configurable:null===l&&f?f.configurable:!l,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===u&&f?f.writable:!u});else{if(!c&&(s||u||l))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},38452(e,t,r){"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,o=Array.prototype.concat,s=r(30041),u=r(30592)(),l=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==a.call(i)||!n())return;var i;u?s(e,t,r,!0):s(e,t,r)},c=function(e,t){var r=arguments.length>2?arguments[2]:{},a=n(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;s0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,l=c,console&&console.warn&&console.warn(l)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var l=u.length,c=p(u,l);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return h(this,e,!0)},a.prototype.rawListeners=function(e){return h(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},a.prototype.listenerCount=d,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},87833(e,t,r){var n=r(74942);e.exports={create:function(e,t){if(e instanceof(t=t||(0,eval)("this")).ArrayBuffer){var i=r(84628);return new n(new i(e,0,e.byteLength,!0,t))}var a=r(83779);return new n(new a(e,0,e.length,!0))}}},83779(e){function t(e,t,r,n){this.buffer=e,this.offset=t||0,r="number"==typeof r?r:e.length,this.endPosition=this.offset+r,this.setBigEndian(n)}t.prototype={setBigEndian:function(e){this.bigEndian=!!e},nextUInt8:function(){var e=this.buffer.readUInt8(this.offset);return this.offset+=1,e},nextInt8:function(){var e=this.buffer.readInt8(this.offset);return this.offset+=1,e},nextUInt16:function(){var e=this.bigEndian?this.buffer.readUInt16BE(this.offset):this.buffer.readUInt16LE(this.offset);return this.offset+=2,e},nextUInt32:function(){var e=this.bigEndian?this.buffer.readUInt32BE(this.offset):this.buffer.readUInt32LE(this.offset);return this.offset+=4,e},nextInt16:function(){var e=this.bigEndian?this.buffer.readInt16BE(this.offset):this.buffer.readInt16LE(this.offset);return this.offset+=2,e},nextInt32:function(){var e=this.bigEndian?this.buffer.readInt32BE(this.offset):this.buffer.readInt32LE(this.offset);return this.offset+=4,e},nextFloat:function(){var e=this.bigEndian?this.buffer.readFloatBE(this.offset):this.buffer.readFloatLE(this.offset);return this.offset+=4,e},nextDouble:function(){var e=this.bigEndian?this.buffer.readDoubleBE(this.offset):this.buffer.readDoubleLE(this.offset);return this.offset+=8,e},nextBuffer:function(e){var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},remainingLength:function(){return this.endPosition-this.offset},nextString:function(e){var t=this.buffer.toString("utf8",this.offset,this.offset+e);return this.offset+=e,t},mark:function(){var e=this;return{openWithOffset:function(r){return r=(r||0)+this.offset,new t(e.buffer,r,e.endPosition-r,e.bigEndian)},offset:this.offset}},offsetFrom:function(e){return this.offset-e.offset},skip:function(e){this.offset+=e},branch:function(e,r){return r="number"==typeof r?r:this.endPosition-(this.offset+e),new t(this.buffer,this.offset+e,r,this.bigEndian)}},e.exports=t},32297(e){function t(e){return parseInt(e,10)}function r(e,r){e=e.map(t),r=r.map(t);var n=e[0],i=e[1]-1,a=e[2],o=r[0],s=r[1],u=r[2];return Date.UTC(n,i,a,o,s,u,0)/1e3}function n(e){var n=e.substr(0,10).split("-"),i=e.substr(11,8).split(":"),a=e.substr(19,6).split(":").map(t),o=3600*a[0]+60*a[1],s=r(n,i);if("number"==typeof(s-=o)&&!isNaN(s))return s}function i(e){var t=e.split(" "),n=r(t[0].split(":"),t[1].split(":"));if("number"==typeof n&&!isNaN(n))return n}e.exports={parseDateWithSpecFormat:i,parseDateWithTimezoneFormat:n,parseExifDate:function(e){var t=19===e.length&&":"===e.charAt(4);return 25===e.length&&"T"===e.charAt(10)?n(e):t?i(e):void 0}}},84628(e){function t(e,t,r,n,i,a){this.global=i,t=t||0,r=r||e.byteLength-t,this.arrayBuffer=e.slice(t,t+r),this.view=new i.DataView(this.arrayBuffer,0,this.arrayBuffer.byteLength),this.setBigEndian(n),this.offset=0,this.parentOffset=(a||0)+t}t.prototype={setBigEndian:function(e){this.littleEndian=!e},nextUInt8:function(){var e=this.view.getUint8(this.offset);return this.offset+=1,e},nextInt8:function(){var e=this.view.getInt8(this.offset);return this.offset+=1,e},nextUInt16:function(){var e=this.view.getUint16(this.offset,this.littleEndian);return this.offset+=2,e},nextUInt32:function(){var e=this.view.getUint32(this.offset,this.littleEndian);return this.offset+=4,e},nextInt16:function(){var e=this.view.getInt16(this.offset,this.littleEndian);return this.offset+=2,e},nextInt32:function(){var e=this.view.getInt32(this.offset,this.littleEndian);return this.offset+=4,e},nextFloat:function(){var e=this.view.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e},nextDouble:function(){var e=this.view.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e},nextBuffer:function(e){var t=this.arrayBuffer.slice(this.offset,this.offset+e);return this.offset+=e,t},remainingLength:function(){return this.arrayBuffer.byteLength-this.offset},nextString:function(e){var t=this.arrayBuffer.slice(this.offset,this.offset+e);return t=String.fromCharCode.apply(null,new this.global.Uint8Array(t)),this.offset+=e,t},mark:function(){var e=this;return{openWithOffset:function(r){return r=(r||0)+this.offset,new t(e.arrayBuffer,r,e.arrayBuffer.byteLength-r,!e.littleEndian,e.global,e.parentOffset)},offset:this.offset,getParentOffset:function(){return e.parentOffset}}},offsetFrom:function(e){return this.parentOffset+this.offset-(e.offset+e.getParentOffset())},skip:function(e){this.offset+=e},branch:function(e,r){return r="number"==typeof r?r:this.arrayBuffer.byteLength-(this.offset+e),new t(this.arrayBuffer,this.offset+e,r,!this.littleEndian,this.global,this.parentOffset)}},e.exports=t},26393(e){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",65e3:"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"}}},58107(e){function t(e,t){switch(e){case 1:return t.nextUInt8();case 3:case 8:return t.nextUInt16();case 4:case 9:return t.nextUInt32();case 5:return[t.nextUInt32(),t.nextUInt32()];case 6:return t.nextInt8();case 10:return[t.nextInt32(),t.nextInt32()];case 11:return t.nextFloat();case 12:return t.nextDouble();default:throw new Error("Invalid format while decoding: "+e)}}function r(e,r){var n,i,a=r.nextUInt16(),o=r.nextUInt16(),s=function(e){switch(e){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}}(o),u=r.nextUInt32(),l=s*u;if(l>4&&(r=e.openWithOffset(r.nextUInt32())),2===o){var c=(n=r.nextString(u)).indexOf("\0");-1!==c&&(n=n.substr(0,c))}else if(7===o)n=r.nextBuffer(u);else if(0!==o)for(n=[],i=0;i0&&218!==n;){if(255!==e.nextUInt8())throw new Error("Invalid JPEG section offset");r=(n=e.nextUInt8())>=208&&n<=217||218===n?0:e.nextUInt16()-2,t(n,e.branch(0,r)),e.skip(r)}},getSizeFromSOFSection:function(e){return e.skip(1),{height:e.nextUInt16(),width:e.nextUInt16()}},getSectionName:function(e){var t,r;switch(e){case 216:t="SOI";break;case 196:t="DHT";break;case 219:t="DQT";break;case 221:t="DRI";break;case 218:t="SOS";break;case 254:t="COM";break;case 217:t="EOI";break;default:e>=224&&e<=239?(t="APP",r=e-224):e>=192&&e<=207&&196!==e&&200!==e&&204!==e?(t="SOF",r=e-192):e>=208&&e<=215&&(t="RST",r=e-208)}var n={name:t};return"number"==typeof r&&(n.index=r),n}}},74942(e,t,r){var n=r(62335),i=r(58107),a=r(29062);function o(e,t,r,n,i,a,o){this.startMarker=e,this.tags=t,this.imageSize=r,this.thumbnailOffset=n,this.thumbnailLength=i,this.thumbnailType=a,this.app1Offset=o}function s(e){this.stream=e,this.flags={readBinaryTags:!1,resolveTagNames:!0,simplifyValues:!0,imageSize:!0,hidePointers:!0,returnTags:!0}}o.prototype={hasThumbnail:function(e){return!(!this.thumbnailOffset||!this.thumbnailLength||"string"==typeof e&&("image/jpeg"===e.toLowerCase().trim()?6!==this.thumbnailType:"image/tiff"!==e.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 e,t=this._getThumbnailStream();return n.parseSections(t,function(t,r){"SOF"===n.getSectionName(t).name&&(e=n.getSizeFromSOFSection(r))}),e}},s.prototype={enableBinaryFields:function(e){return this.flags.readBinaryTags=!!e,this},enablePointers:function(e){return this.flags.hidePointers=!e,this},enableTagNames:function(e){return this.flags.resolveTagNames=!!e,this},enableImageSize:function(e){return this.flags.imageSize=!!e,this},enableReturnTags:function(e){return this.flags.returnTags=!!e,this},enableSimpleValues:function(e){return this.flags.simplifyValues=!!e,this},parse:function(){var e,t,s,u,l,c,f,h,d,p=this.stream.mark(),m=p.openWithOffset(0),g=this.flags;return g.resolveTagNames&&(f=r(26393)),g.resolveTagNames?(e={},h=function(t){return e[t.name]},d=function(t,r){e[t.name]=r}):(e=[],h=function(t){var r;for(r=0;r=3&&(o=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;nt},70453(e,t,r){"use strict";var n,i=r(79612),a=r(69383),o=r(41237),s=r(79290),u=r(79538),l=r(58068),c=r(69675),f=r(35345),h=r(71514),d=r(58968),p=r(6188),m=r(68002),g=r(75880),b=r(70414),y=r(73093),_=Function,v=function(e){try{return _('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=r(75795),x=r(30655),k=function(){throw new c},B=w?function(){try{return k}catch(e){try{return w(arguments,"callee").get}catch(e){return k}}}():k,E=r(64039)(),S=r(93628),A=r(71064),C=r(48648),I=r(11002),P=r(10076),T={},M="undefined"!=typeof Uint8Array&&S?S(Uint8Array):n,R={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":E&&S?S([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":T,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&S?S(S([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&S?S((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&S?S((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&S?S(""[Symbol.iterator]()):n,"%Symbol%":E?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":B,"%TypedArray%":M,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":I,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":A,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":b,"%Math.sign%":y,"%Reflect.getPrototypeOf%":C};if(S)try{null.error}catch(e){var F=S(S(e));R["%Error.prototype%"]=F}var O=function e(t){var r;if("%AsyncFunction%"===t)r=v("async function () {}");else if("%GeneratorFunction%"===t)r=v("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=v("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&S&&(r=S(i.prototype))}return R[t]=r,r},N={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=r(66743),D=r(9957),z=L.call(P,Array.prototype.concat),U=L.call(I,Array.prototype.splice),$=L.call(P,String.prototype.replace),j=L.call(P,String.prototype.slice),Z=L.call(P,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,H=function(e,t){var r,n=e;if(D(N,n)&&(n="%"+(r=N[n])[0]+"%"),D(R,n)){var i=R[n];if(i===T&&(i=O(n)),void 0===i&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===Z(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=j(e,0,1),r=j(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return $(e,G,function(e,t,r,i){n[n.length]=r?$(i,W,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=H("%"+n+"%",t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(n=u[0],U(r,z([0,1],u)));for(var f=1,h=!0;f=r.length){var g=w(o,d);o=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[d]}else h=D(o,d),o=o[d];h&&!s&&(R[a]=o)}}return o}},71064(e,t,r){"use strict";var n=r(79612);e.exports=n.getPrototypeOf||null},48648(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},93628(e,t,r){"use strict";var n=r(48648),i=r(71064),a=r(7176);e.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:a?function(e){return a(e)}:null},6549(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},75795(e,t,r){"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},30592(e,t,r){"use strict";var n=r(30655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},64039(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(41333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},41333(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},49092(e,t,r){"use strict";var n=r(41333);e.exports=function(){return n()&&!!Symbol.toStringTag}},9957(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,a=r(66743);e.exports=a.call(n,i)},251(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=l}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,l-=8);e[r+d-p]|=128*m}},56698(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},47244(e,t,r){"use strict";var n=r(49092)(),i=r(36556)("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},69600(e){"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var a=/^\s*class\b/,o=function(e){try{var t=n.call(e);return a.test(t)}catch(e){return!1}},s=function(e){try{return!o(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var h=document.all;u.call(h)===u.call(document.all)&&(f=function(e){if((c||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!o(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(l)return s(e);if(o(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},48184(e,t,r){"use strict";var n=r(36556),i=r(99721)(/^\s*(?:function)?\*/),a=r(49092)(),o=r(93628),s=n("Object.prototype.toString"),u=n("Function.prototype.toString"),l=r(4233);e.exports=function(e){if("function"!=typeof e)return!1;if(i(u(e)))return!0;if(!a)return"[object GeneratorFunction]"===s(e);if(!o)return!1;var t=l();return t&&o(e)===t.prototype}},13003(e){"use strict";e.exports=function(e){return e!=e}},24133(e,t,r){"use strict";var n=r(10487),i=r(38452),a=r(13003),o=r(76642),s=r(92464),u=n(o(),Number);i(u,{getPolyfill:o,implementation:a,shim:s}),e.exports=u},76642(e,t,r){"use strict";var n=r(13003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},92464(e,t,r){"use strict";var n=r(38452),i=r(76642);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},14035(e,t,r){"use strict";var n,i=r(36556),a=r(49092)(),o=r(9957),s=r(75795);if(a){var u=i("RegExp.prototype.exec"),l={},c=function(){throw l},f={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=c),n=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!t||!o(t,"value"))return!1;try{u(e,f)}catch(e){return e===l}}}else{var h=i("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}e.exports=n},35680(e,t,r){"use strict";var n=r(25767);e.exports=function(e){return!!n(e)}},66624(e){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,i){for(var a=t;a=this.size&&(i=(i^this.primitive)&this.size-1);for(a=0;a1&&0===t[0]){for(var n=1;na.length&&(i=(r=[a,i])[0],a=r[1]);for(var o=new Uint8ClampedArray(a.length),s=a.length-i.length,u=0;ur?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,o){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new a(t,r),u=0;u0&&b>0)){var k=(m.get(b,g-1)+2*m.get(b-1,g)+m.get(b-1,g-1))/4;_=0;i--)for(var a=t-9;a>=t-11;a--)n=u(e.get(a,i),n);var l=0;for(a=5;a>=0;a--)for(i=t-9;i>=t-11;i--)l=u(e.get(a,i),l);for(var c,f=1/0,h=0,d=o.VERSIONS;h=0;n--)6!==n&&(t=u(e.get(8,n),t));var i=e.height,a=0;for(n=i-1;n>=i-7;n--)a=u(e.get(8,n),a);for(r=i-8;r1){var c=n.ecBlocks[0].numBlocks,f=n.ecBlocks[1].numBlocks;for(s=0;s0;)for(var h=0,d=i;h6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],l=0,f=0,h=!0,d=a-1;d>0;d-=2){6===d&&d--;for(var p=0;p=3;){if((l=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var o=Math.floor(l/100),s=Math.floor(l/10)%10,u=l%10;r.push(48+o,48+s,48+u),n+=o.toString()+s.toString()+u.toString(),a-=3}if(2===a){if((l=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");o=Math.floor(l/10),s=l%10,r.push(48+o,48+s),n+=o.toString()+s.toString()}else if(1===a){var l;if((l=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+l),n+=l.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(i||(i={}));var u=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function l(e,t){for(var r=[],n="",i=[9,11,13][t],a=e.readBits(i);a>=2;){var o=e.readBits(11),s=Math.floor(o/45),l=o%45;r.push(u[s].charCodeAt(0),u[l].charCodeAt(0)),n+=u[s]+u[l],a-=2}return 1===a&&(s=e.readBits(6),r.push(u[s].charCodeAt(0)),n+=u[s]),{bytes:r,text:n}}function c(e,t){for(var r=[],n="",i=[8,16,16][t],a=e.readBits(i),o=0;o>8,255&l),n+=String.fromCharCode(o.shiftJISTable[l])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,o,u,h,d=new a.BitStream(e),p=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};d.available()>=4;){var g=d.readBits(4);if(g===i.Terminator)return m;if(g===i.ECI)0===d.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:d.readBits(7)}):0===d.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:d.readBits(14)}):0===d.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:d.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===i.Numeric){var b=s(d,p);m.text+=b.text,(r=m.bytes).push.apply(r,b.bytes),m.chunks.push({type:n.Numeric,text:b.text})}else if(g===i.Alphanumeric){var y=l(d,p);m.text+=y.text,(o=m.bytes).push.apply(o,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===i.Byte){var _=c(d,p);m.text+=_.text,(u=m.bytes).push.apply(u,_.bytes),m.chunks.push({type:n.Byte,bytes:_.bytes,text:_.text})}else if(g===i.Kanji){var v=f(d,p);m.text+=v.text,(h=m.bytes).push.apply(h,v.bytes),m.chunks.push({type:n.Kanji,bytes:v.bytes,text:v.text})}}if(0===d.available()||0===d.readBits(d.available()))return m}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e>8-n<<(a=r-n);t=(this.bytes[this.byteOffset]&i)>>a,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var a;e>0&&(i=255>>(a=8-e)<>a,this.bitOffset+=e)}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var a=new n.default(285,256,0),o=new i.default(a,r),s=new Uint8ClampedArray(t),u=!1,l=0;l=n/2;){var l=a,c=s;if(s=u,(a=o).isZero())return null;o=l;for(var f=e.zero,h=a.getCoefficient(a.degree()),d=e.inverse(h);o.degree()>=a.degree()&&!o.isZero();){var p=o.degree()-a.degree(),m=e.multiply(o.getCoefficient(o.degree()),d);f=f.addOrSubtract(e.buildMonomial(p,m)),o=o.addOrSubtract(a.multiplyByMonomial(p,m))}if(u=f.multiplyPoly(s).addOrSubtract(c),o.degree()>=a.degree())return null}var g=u.getCoefficient(0);if(0===g)return null;var b=e.inverse(g);return[u.multiply(b),o.multiply(b)]}(a,a.buildMonomial(t,1),f,t);if(null===h)return null;var d=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),i=0,a=1;aMath.abs(t.x-e.x);c?(a=Math.floor(e.y),o=Math.floor(e.x),s=Math.floor(t.y),u=Math.floor(t.x)):(a=Math.floor(e.x),o=Math.floor(e.y),s=Math.floor(t.x),u=Math.floor(t.y));for(var f=Math.abs(s-a),h=Math.abs(u-o),d=Math.floor(-f/2),p=a0){if(y===u)break;y+=m,d-=f}}for(var w=[],x=0;x=15&&b.length?b[0]:g,dimension:c}}t.locate=function(e){for(var t=[],r=[],a=[],o=[],s=function(n){for(var s=0,u=!1,l=[0,0,0,0,0],c=function(t){var a=e.get(t,n);if(a===u)s++;else{l=[l[1],l[2],l[3],l[4],s],s=1,u=a;var c=i(l)/7,f=Math.abs(l[0]-c)=e.bottom.startX&&m<=e.bottom.endX||p>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&p>=e.bottom.endX&&l[2]/(e.bottom.endX-e.bottom.startX)<1.5&&l[2]/(e.bottom.endX-e.bottom.startX)>.5})).length>0?b[0].bottom=g:r.push({top:g,bottom:g})}if(d){var b,y=t-l[4],_=y-l[3];g={startX:_,y:n,endX:y},(b=o.filter(function(e){return _>=e.bottom.startX&&_<=e.bottom.endX||y>=e.bottom.startX&&_<=e.bottom.endX||_<=e.bottom.startX&&y>=e.bottom.endX&&l[2]/(e.bottom.endX-e.bottom.startX)<1.5&&l[2]/(e.bottom.endX-e.bottom.startX)>.5})).length>0?b[0].bottom=g:o.push({top:g,bottom:g})}}},f=-1;f<=e.width;f++)c(f);t.push.apply(t,r.filter(function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2})),r=r.filter(function(e){return e.bottom.y===n}),a.push.apply(a,o.filter(function(e){return e.bottom.y!==n})),o=o.filter(function(e){return e.bottom.y===n})},f=0;f<=e.height;f++)s(f);t.push.apply(t,r.filter(function(e){return e.bottom.y-e.top.y>=2})),a.push.apply(a,o);var h=t.filter(function(e){return e.bottom.y-e.top.y>=2}).map(function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],o=i(a)/a.length;return{score:u({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:o}}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score}).map(function(e,t,r){if(t>4)return null;var n=r.filter(function(e,r){return t!==r}).map(function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}}).sort(function(e,t){return e.score-t.score});if(n.length<2)return null;var i=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:i}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score});if(0===h.length)return null;var d=function(e,t,r){var i,a,o,s,u,l,c,f=n(e,t),h=n(t,r),d=n(e,r);return h>=f&&h>=d?(u=(i=[t,e,r])[0],l=i[1],c=i[2]):d>=h&&d>=f?(u=(a=[e,t,r])[0],l=a[1],c=a[2]):(u=(o=[e,r,t])[0],l=o[1],c=o[2]),(c.x-l.x)*(u.y-l.y)-(c.y-l.y)*(u.x-l.x)<0&&(u=(s=[c,u])[0],c=s[1]),{bottomLeft:u,topLeft:l,topRight:c}}(h[0].points[0],h[0].points[1],h[0].points[2]),p=d.topRight,m=d.topLeft,g=d.bottomLeft,b=c(e,a,p,m,g),y=[];b&&y.push({alignmentPattern:{x:b.alignmentPattern.x,y:b.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:b.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:p.x,y:p.y}});var _=l(e,p),v=l(e,m),w=l(e,g),x=c(e,a,_,v,w);return x&&y.push({alignmentPattern:{x:x.alignmentPattern.x,y:x.alignmentPattern.y},bottomLeft:{x:w.x,y:w.y},topLeft:{x:v.x,y:v.y},topRight:{x:_.x,y:_.y},dimension:x.dimension}),0===y.length?null:y}}]).default},e.exports=t()},73065(e,t,r){var n,i;!function(){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],i={},a=null;function o(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var r=this.getLevel(),i=0;i=0&&t<=f.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?h+=":"+e:"symbol"==typeof e&&(h=void 0),f.name=e,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=r||c,f.getLevel=function(){return null!=l?l:null!=s?s:o},f.setLevel=function(e,r){return l=p(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&h){try{return void(window.localStorage[h]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"="+r+";"}catch(e){}}}(l),u.call(f)},f.setDefaultLevel=function(e){s=p(e),d()||f.setLevel(e,!1)},f.resetLevel=function(){l=null,function(){if(typeof window!==t&&h){try{window.localStorage.removeItem(h)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(f)},f.enableAll=function(e){f.setLevel(f.levels.TRACE,e)},f.disableAll=function(e){f.setLevel(f.levels.SILENT,e)},f.rebuild=function(){if(a!==f&&(o=p(a.getLevel())),u.call(f),a===f)for(var e in i)i[e].rebuild()},o=p(a?a.getLevel():"WARN");var m=d();null!=m&&(l=p(m)),u.call(f)}(a=new f).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new f(e,a.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=h),a},a.getLoggers=function(){return i},a.default=a,a},void 0===(i=n.call(t,r,t,e))||(e.exports=i)}()},71514(e){"use strict";e.exports=Math.abs},58968(e){"use strict";e.exports=Math.floor},94459(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},6188(e){"use strict";e.exports=Math.max},68002(e){"use strict";e.exports=Math.min},75880(e){"use strict";e.exports=Math.pow},70414(e){"use strict";e.exports=Math.round},73093(e,t,r){"use strict";var n=r(94459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},89211(e){"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},37653(e,t,r){"use strict";var n=r(38452),i=r(10487),a=r(89211),o=r(9394),s=r(36576),u=i(o(),Object);n(u,{getPolyfill:o,implementation:a,shim:s}),e.exports=u},9394(e,t,r){"use strict";var n=r(89211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},36576(e,t,r){"use strict";var n=r(9394),i=r(38452);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},28875(e,t,r){"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=r(1093),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),l=s.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===a.call(e),n=o(e),s=t&&"[object String]"===a.call(e),h=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=l&&r;if(s&&e.length>0&&!i.call(e,0))for(var m=0;m0)for(var g=0;g=0&&"[object Function]"===t.call(e.callee)),n}},38403(e,t,r){"use strict";var n=r(1189),i=r(41333)(),a=r(36556),o=r(79612),s=a("Array.prototype.push"),u=a("Object.prototype.propertyIsEnumerable"),l=i?o.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=o(e);if(1===arguments.length)return r;for(var a=1;a>>16&65535,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16}},19681(e){"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}},14823(e){"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var a=t,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^r[s])];return-1^e}},58411(e,t,r){"use strict";var n,i=r(9805),a=r(23665),o=r(53269),s=r(14823),u=r(54674),l=-2,c=258,f=262,h=103,d=113,p=666;function m(e,t){return e.msg=u[t],t}function g(e){return(e<<1)-(e>4?9:0)}function b(e){for(var t=e.length;--t>=0;)e[t]=0}function y(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function _(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,y(e.strm)}function v(e,t){e.pending_buf[e.pending++]=t}function w(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function x(e,t,r,n){var a=e.avail_in;return a>n&&(a=n),0===a?0:(e.avail_in-=a,i.arraySet(t,e.input,e.next_in,a,r),1===e.state.wrap?e.adler=o(e.adler,t,a,r):2===e.state.wrap&&(e.adler=s(e.adler,t,a,r)),e.next_in+=a,e.total_in+=a,a)}function k(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,l=e.window,h=e.w_mask,d=e.prev,p=e.strstart+c,m=l[a+o-1],g=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+o]===g&&l[r+o-1]===m&&l[r]===l[a]&&l[++r]===l[a+1]){a+=2,r++;do{}while(l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;m=l[a+o-1],g=l[a+o]}}}while((t=d[t&h])>u&&0!==--i);return o<=e.lookahead?o:e.lookahead}function B(e){var t,r,n,a,o,s=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-f)){i.arraySet(e.window,e.window,s,s,0),e.match_start-=s,e.strstart-=s,e.block_start-=s,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=s?n-s:0}while(--r);t=r=s;do{n=e.prev[--t],e.prev[t]=n>=s?n-s:0}while(--r);a+=s}if(0===e.strm.avail_in)break;if(r=x(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(s=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return m(e,l);8===n&&(n=9);var u=new C;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,_(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(_(e,!1),e.strm.avail_out),1)}),new A(4,4,8,4,E),new A(4,5,16,8,E),new A(4,6,32,32,E),new A(4,4,16,16,S),new A(8,16,32,32,S),new A(8,16,128,128,S),new A(8,32,128,256,S),new A(32,128,258,1024,S),new A(32,258,258,4096,S)],t.deflateInit=function(e,t){return T(e,t,8,15,8,0)},t.deflateInit2=T,t.deflateReset=P,t.deflateResetKeep=I,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?l:(e.state.gzhead=t,0):l},t.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>5||t<0)return e?m(e,l):l;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===p&&4!==t)return m(e,0===e.avail_out?-5:l);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,v(i,31),v(i,139),v(i,8),i.gzhead?(v(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),v(i,255&i.gzhead.time),v(i,i.gzhead.time>>8&255),v(i,i.gzhead.time>>16&255),v(i,i.gzhead.time>>24&255),v(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),v(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(v(i,255&i.gzhead.extra.length),v(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(v(i,0),v(i,0),v(i,0),v(i,0),v(i,0),v(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),v(i,3),i.status=d);else{var f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=d,w(i,f),0!==i.strstart&&(w(i,e.adler>>>16),w(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending!==i.pending_buf_size));)v(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&y(e),i.pending+2<=i.pending_buf_size&&(v(i,255&e.adler),v(i,e.adler>>8&255),e.adler=0,i.status=d)):i.status=d),0!==i.pending){if(y(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&g(t)<=g(r)&&4!==t)return m(e,-5);if(i.status===p&&0!==e.avail_in)return m(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==p){var x=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(B(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(_(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=c){if(B(e),e.lookahead<=c&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+c;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(_(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==x&&4!==x||(i.status=p),1===x||3===x)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===x&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(b(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),y(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(v(i,255&e.adler),v(i,e.adler>>8&255),v(i,e.adler>>16&255),v(i,e.adler>>24&255),v(i,255&e.total_in),v(i,e.total_in>>8&255),v(i,e.total_in>>16&255),v(i,e.total_in>>24&255)):(w(i,e.adler>>>16),w(i,65535&e.adler)),y(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==d&&t!==p?m(e,l):(e.state=null,t===d?m(e,-3):0):l},t.deflateSetDictionary=function(e,t){var r,n,a,s,u,c,f,h,d=t.length;if(!e||!e.state)return l;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return l;for(1===s&&(e.adler=o(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(b(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,d-r.w_size,r.w_size,0),t=h,d=r.w_size),u=e.avail_in,c=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,B(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<>>=v=_>>>24,p-=v,0==(v=_>>>16&255))S[a++]=65535&_;else{if(!(16&v)){if(64&v){if(32&v){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=m[(65535&_)+(d&(1<>>=v,p-=v),p<15&&(d+=E[n++]<>>=v=_>>>24,p-=v,16&(v=_>>>16&255)){if(x=65535&_,p<(v&=15)&&(d+=E[n++]<u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=v,p-=v,x>(v=a-o)){if((v=x-v)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=0,B=h,0===f){if(k+=l-v,v2;)S[a++]=B[k++],S[a++]=B[k++],S[a++]=B[k++],w-=3;w&&(S[a++]=B[k++],w>1&&(S[a++]=B[k++]))}else{k=a-x;do{S[a++]=S[k++],S[a++]=S[k++],S[a++]=S[k++],w-=3}while(w>2);w&&(S[a++]=S[k++],w>1&&(S[a++]=S[k++]))}break}if(64&v){e.msg="invalid distance code",r.mode=30;break e}_=g[(65535&_)+(d&(1<>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function p(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,d(e)):u}function m(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,p(e))):u}function g(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=m(e,t))&&(e.state=null),r):u}var b,y,_=!0;function v(e){if(_){var t;for(b=new n.Buf32(512),y=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,y,0,e.work,{bits:5}),_=!1}e.lencode=b,e.lenbits=9,e.distcode=y,e.distbits=5}function w(e,t,r,i){var a,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),n.arraySet(o.window,t,r-i,a,o.wnext),(i-=a)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=a(r.check,D,2,0),y=0,_=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",r.mode=c;break}if(8!=(15&y)){e.msg="unknown compression method",r.mode=c;break}if(_-=4,R=8+(15&(y>>>=4)),0===r.wbits)r.wbits=R;else if(R>r.wbits){e.msg="invalid window size",r.mode=c;break}r.dmax=1<>8&1),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,_=0,r.mode=3;case 3:for(;_<32;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}r.head&&(r.head.time=y),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,D[2]=y>>>16&255,D[3]=y>>>24&255,r.check=a(r.check,D,4,0)),y=0,_=0,r.mode=4;case 4:for(;_<16;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}r.head&&(r.head.xflags=255&y,r.head.os=y>>8),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,_=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}r.length=y,r.head&&(r.head.extra_len=y),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,_=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((B=r.length)>g&&(B=g),B&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,p,B,R)),512&r.flags&&(r.check=a(r.check,h,B,p)),g-=B,p+=B,r.length-=B),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break e;B=0;do{R=h[p+B++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&B>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=l;break;case 10:for(;_<32;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}e.adler=r.check=f(y),y=0,_=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=m,e.avail_out=b,e.next_in=p,e.avail_in=g,r.hold=y,r.bits=_,2;e.adler=r.check=1,r.mode=l;case l:if(5===t||6===t)break e;case 13:if(r.last){y>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}switch(r.last=1&y,_-=1,3&(y>>>=1)){case 0:r.mode=14;break;case 1:if(v(r),r.mode=20,6===t){y>>>=2,_-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=c}y>>>=2,_-=2;break;case 14:for(y>>>=7&_,_-=7&_;_<32;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if((65535&y)!=(y>>>16^65535)){e.msg="invalid stored block lengths",r.mode=c;break}if(r.length=65535&y,y=0,_=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(B=r.length){if(B>g&&(B=g),B>b&&(B=b),0===B)break e;n.arraySet(d,h,p,B,m),g-=B,p+=B,b-=B,m+=B,r.length-=B;break}r.mode=l;break;case 17:for(;_<14;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(r.nlen=257+(31&y),y>>>=5,_-=5,r.ndist=1+(31&y),y>>>=5,_-=5,r.ncode=4+(15&y),y>>>=4,_-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=c;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,_-=3}for(;r.have<19;)r.lens[z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},F=s(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,F){e.msg="invalid code lengths set",r.mode=c;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,I=65535&L,!((A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(I<16)y>>>=A,_-=A,r.lens[r.have++]=I;else{if(16===I){for(N=A+2;_>>=A,_-=A,0===r.have){e.msg="invalid bit length repeat",r.mode=c;break}R=r.lens[r.have-1],B=3+(3&y),y>>>=2,_-=2}else if(17===I){for(N=A+3;_>>=A)),y>>>=3,_-=3}else{for(N=A+7;_>>=A)),y>>>=7,_-=7}if(r.have+B>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=c;break}for(;B--;)r.lens[r.have++]=R}}if(r.mode===c)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=c;break}if(r.lenbits=9,O={bits:r.lenbits},F=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,F){e.msg="invalid literal/lengths set",r.mode=c;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},F=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,F){e.msg="invalid distances set",r.mode=c;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(g>=6&&b>=258){e.next_out=m,e.avail_out=b,e.next_in=p,e.avail_in=g,r.hold=y,r.bits=_,o(e,k),m=e.next_out,d=e.output,b=e.avail_out,p=e.next_in,h=e.input,g=e.avail_in,y=r.hold,_=r.bits,r.mode===l&&(r.back=-1);break}for(r.back=0;C=(L=r.lencode[y&(1<>>16&255,I=65535&L,!((A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(C&&!(240&C)){for(P=A,T=C,M=I;C=(L=r.lencode[M+((y&(1<>P)])>>>16&255,I=65535&L,!(P+(A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}y>>>=P,_-=P,r.back+=P}if(y>>>=A,_-=A,r.back+=A,r.length=I,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=l;break}if(64&C){e.msg="invalid literal/length code",r.mode=c;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(N=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(L=r.distcode[y&(1<>>16&255,I=65535&L,!((A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(!(240&C)){for(P=A,T=C,M=I;C=(L=r.distcode[M+((y&(1<>P)])>>>16&255,I=65535&L,!(P+(A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}y>>>=P,_-=P,r.back+=P}if(y>>>=A,_-=A,r.back+=A,64&C){e.msg="invalid distance code",r.mode=c;break}r.offset=I,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(N=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=c;break}r.mode=25;case 25:if(0===b)break e;if(B=k-b,r.offset>B){if((B=r.offset-B)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=c;break}B>r.wnext?(B-=r.wnext,E=r.wsize-B):E=r.wnext-B,B>r.length&&(B=r.length),S=r.window}else S=d,E=m-r.offset,B=r.length;B>b&&(B=b),b-=B,r.length-=B;do{d[m++]=S[E++]}while(--B);0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;d[m++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===g)break e;g--,y|=h[p++]<<_,_+=8}if(k-=b,e.total_out+=k,r.total+=k,k&&(e.adler=r.check=r.flags?a(r.check,d,k,m-k):i(r.check,d,k,m-k)),k=b,(r.flags?y:f(y))!==r.check){e.msg="incorrect data check",r.mode=c;break}y=0,_=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(y!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=c;break}y=0,_=0}r.mode=29;case 29:F=1;break e;case c:F=-3;break e;case 31:return-4;default:return u}return e.next_out=m,e.avail_out=b,e.next_in=p,e.avail_in=g,r.hold=y,r.bits=_,(r.wsize||k!==e.avail_out&&r.mode=1&&0===O[S];S--);if(A>S&&(A=S),0===S)return l[c++]=20971520,l[c++]=20971520,h.bits=1,0;for(E=1;E0&&(0===e||1!==S))return-1;for(N[1]=0,k=1;k<15;k++)N[k+1]=N[k]+O[k];for(B=0;B852||2===e&&T>592)return 1;for(;;){_=k-I,f[B]y?(v=L[D+f[B]],w=R[F+f[B]]):(v=96,w=0),d=1<>I)+(p-=d)]=_<<24|v<<16|w}while(0!==p);for(d=1<>=1;if(0!==d?(M&=d-1,M+=d):M=0,B++,0===--O[k]){if(k===S)break;k=t[r+f[B]]}if(k>A&&(M&g)!==m){for(0===I&&(I=A),b+=E,P=1<<(C=k-I);C+I852||2===e&&T>592)return 1;l[m=M&g]=A<<24|C<<16|b-c}}return 0!==M&&(l[b+M]=k-I<<24|64<<16),h.bits=A,0}},54674(e){"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"}},23665(e,t,r){"use strict";var n=r(9805);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=[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],o=[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],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],l=new Array(576);i(l);var c=new Array(60);i(c);var f=new Array(512);i(f);var h=new Array(256);i(h);var d=new Array(29);i(d);var p,m,g,b=new Array(30);function y(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function _(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function v(e){return e<256?f[e]:f[256+(e>>>7)]}function w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function x(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function E(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=15;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=B(a[s]++,s))}}function S(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function A(e){e.bi_valid>8?w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function C(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)I(e,a,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],I(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,I(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,u=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(a=0;a<=15;a++)e.bl_count[a]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=u[2*u[2*(n=e.heap[r])+1]+1]+1)>p&&(a=p,m++),u[2*n+1]=a,n>l||(e.bl_count[a]++,o=0,n>=d&&(o=h[n-d]),s=u[2*n],e.opt_len+=s*(a+o),f&&(e.static_len+=s*(c[2*n+1]+o)));if(0!==m){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>l||(u[2*i+1]!==a&&(e.opt_len+=(a-u[2*i+1])*u[2*i],u[2*i+1]=a),n--)}}(e,t),E(a,l,e.bl_count)}function M(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,l=4;for(0===o&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>=7;n<30;n++)for(b[n]=i<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),T(e,e.l_desc),T(e,e.d_desc),o=function(e){var t;for(M(e,e.dyn_ltree,e.l_desc.max_code),M(e,e.dyn_dtree,e.d_desc.max_code),T(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*u[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?O(e,t,r,n):4===e.strategy||a===i?(x(e,2+(n?1:0),3),P(e,l,c)):(x(e,4+(n?1:0),3),function(e,t,r,n){var i;for(x(e,t-257,5),x(e,r-1,5),x(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(h[r]+256+1)]++,e.dyn_dtree[2*v(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){x(e,2,3),k(e,256,l),function(e){16===e.bi_valid?(w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},44442(e){"use strict";e.exports=function(){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}},76578(e){"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},65606(e){var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],l=!1,c=-1;function f(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&h())}function h(){if(!l){var e=o(f);l=!0;for(var t=u.length;t;){for(s=u,u=[];++c1)for(var r=1;r>>1:r>>>=1;t[e]=r>>>0}}(),e.exports=function(){for(var e=arguments.length,t=-1,r=0;r>>0}}else e.exports=r(29275);function a(e,r){for(var n=r.length,i=0;i>>8;return e}}()},29275(e,t,r){"use strict";for(var n=r(48287).Buffer,i=[],a=0;a<256;a++){var o=i[a]=new n(4);o.writeUInt32BE(a,0);for(var s=0;s<8;s++){var u=1&o[0],l=1&o[1],c=1&o[2],f=1&o[3];o[0]=o[0]>>1^(f?237:0),o[1]=o[1]>>1^(f?184:0)^(u?128:0),o[2]=o[2]>>1^(f?131:0)^(l?128:0),o[3]=o[3]>>1^(f?32:0)^(c?128:0)}}function h(e,t){for(var r=t.length,n=0;n>>=1)e.push(n&r?1:0)}var a=function(){for(var e={},t=0;t<45;t++)e["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"[t]]=t;return e}();e.exports=function e(t,r){var o,s=typeof t;if("string"==s||"number"==s)t=new n(o=""+t);else if(n.isBuffer(t))o=t.toString();else{if(!Array.isArray(t))throw new Error("Bad data");o=(t=new n(t)).toString()}if(/^[0-9]+$/.test(o)){if(t.length>7089)throw new Error("Too much data");return function(e){for(var t=e.length,r=[],n=0;n4296)throw new Error("Too much data");return function(e){for(var t=e.length,r=[],n=0;n=t.length)return n;var i=e(t.slice(r),!1);return n.data27=n.data27.concat(i.data27),n.data10&&i.data10&&(n.data10=n.data10.concat(i.data10)),n.data1&&i.data1&&(n.data1=n.data1.concat(i.data1)),n}(o);if(t.length>2953)throw new Error("Too much data");return function(e){for(var t=e.length,r=[],n=0;n255&&(s^=285),i[o]=s}for(o=0;o<255;o++)a[i[o]]=o;function u(e){for(;e<0;)e+=255;for(;e>255;)e-=255;return i[e]}function l(e){if(e<1||e>255)throw Error("Bad log("+e+")");return a[e]}var c=[[0],[0,0],[0,25,1]];function f(e){if(c[e])return c[e];var t=f(e-1),r=[];r[0]=t[0];for(var n=1;n<=e;n++)r[n]=l(u(t[n])^u(t[n-1]+e-1));return c[e]=r,r}e.exports=function(e,t){e=[].slice.call(e);for(var r=f(t),i=0;it;)if(e[0]){var a=l(e[0]);for(i=0;i<=t;i++)e[i]=e[i]^u(r[i]+a);e.shift()}else e.shift();return new n(e)}},94081(e,t,r){"use strict";var n=r(48287).Buffer;function i(e){var t=4*e+17,r=[],i=new n(t);i.fill(0),i=[].slice.call(i);for(var a=0;a=-2||-2==a&&i<=2?128:129;e[3+r][3+n]=o,e[3+r][t-4+n]=o,e[t-4+r][3+n]=o}for(r=0;r<8;r++)e[7][r]=e[r][7]=e[7][t-r-1]=e[r][t-8]=e[t-8][r]=e[t-1-r][7]=128}function o(e){var t=e.length;if(t>21){var r=t-13,n=Math.round(r/Math.ceil(r/28));n%2&&n++;for(var i=[],a=r+6;a>10;a-=n)i.unshift(a);i.unshift(6);for(var o=0;o=-1||-1==d&&h<=1?128:129;e[u+c][l+f]=p}}}for(o=8;o0;i--)n>>>9+i&&(n^=1335<0;i--)n>>>11+i&&(n^=7973<>e&1?129:128}for(var l=0;l<8;l++)r[8][a-1-l]=u(l),l<6&&(r[l][8]=u(l));for(l=8;l<15;l++)r[a-15+l][8]=u(l),l>8&&(r[8][14-l]=u(l));r[7][8]=u(6),r[8][8]=u(7),r[8][7]=u(8);var c=t[(a-17)/4];if(c)for(l=0;l<6;l++)for(var f=0;f<3;f++)r[a-11+f][l]=r[l][a-11+f]=h(3*l+f);function h(e){return c>>e&1?129:128}}}(),c=(u=[function(e,t){return(e+t)%2==0},function(e,t){return e%2==0},function(e,t){return t%3==0},function(e,t){return(e+t)%3==0},function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0},function(e,t){return e*t%2+e*t%3==0},function(e,t){return(e*t%2+e*t%3)%2==0},function(e,t){return(e*t%3+(e+t)%2)%2==0}],function(e,t,r){var n,i,a=e.length,o=-1;n=i=a-1;for(var s=u[r],l=t.blocks[t.blocks.length-1].length,c=0;c-1)do{e[n][i]=s(n,i)?1:0}while(d());function h(t){for(var r=128;r;r>>=1){var a=!!(r&t);s(n,i)&&(a=!a),e[n][i]=a?1:0,d()}}function d(){do{if(i%2^i<6?o<0&&0==n||o>0&&n==a-1?(i--,o=-o):(i++,n+=o):i--,6==i&&i--,i<0)return!1}while(240&e[n][i]);return!0}});function f(e){for(var t=e.length,r=0,n=0;n=5&&(r+=a-2),i=s,a=1):a++;a>=5&&(r+=a-2)}for(o=0;o=5&&(r+=a-2),i=s,a=1):a++}a>=5&&(r+=a-2)}for(n=0;n=4&&!(l(-4)||l(-3)||l(-2)||l(-1))&&(r+=40),o=4&&!(c(-4)||c(-3)||c(-2)||c(-1))&&(r+=40),n=r)return s(i);for(e.data10?r=Math.ceil(e.data10.length/8):n=27;n<27;n++)if((i=l[n][t]).data_len>=r)return s(i);for(r=Math.ceil(e.data27.length/8);n<41;n++){var i;if((i=l[n][t]).data_len>=r)return s(i)}throw new Error("Too much data")}function f(e,t){var r=new n(t.data_len);r.fill(0);for(var i=(e=t.version<10?e.data1:t.version<27?e.data10:e.data27).length,o=0;o0;l--){var f=c/l|0;s.blocks.push(f),c-=f}r[o]=s}return r}),e.exports={QR:function(e,t,r){t=u.indexOf(t)>-1?t:"M";var n=i(e,r),a=f(n,c(n,t));return o.getMatrix(a)},getTemplate:c,fillTemplate:f}},65235(e,t,r){"use strict";var n=r(65606),i=r(48287).Buffer,a=r(88310).Readable,o=r(32129).QR,s=r(77641),u=r(13087),l=function(){},c={parse_url:!1,ec_level:"M",size:5,margin:4,customize:null},f={parse_url:!1,ec_level:"M",margin:1,size:0};function h(e,t){e="string"==typeof e?{ec_level:e}:e||{};var r={type:String(t||e.type||"png").toLowerCase()},n="png"==r.type?c:f;for(var i in n)r[i]=i in e?e[i]:n[i];return r}e.exports={matrix:o,image:function(e,t){t=h(t);var r=o(e,t.ec_level,t.parse_url),i=new a;switch(i._read=l,t.type){case"svg":case"pdf":case"eps":n.nextTick(function(){u[t.type](r,i,t.margin,t.size)});break;case"svgpath":n.nextTick(function(){var e=u.svg_object(r,t.margin,t.size);i.push(e.path),i.push(null)});break;default:n.nextTick(function(){var e=s.bitmap(r,t.size,t.margin);t.customize&&t.customize(e),s.png(e,i)})}return i},imageSync:function(e,t){t=h(t);var r,n=o(e,t.ec_level,t.parse_url),a=[];switch(t.type){case"svg":case"pdf":case"eps":u[t.type](n,a,t.margin,t.size),r=a.filter(Boolean).join("");break;default:var l=s.bitmap(n,t.size,t.margin);t.customize&&t.customize(l),s.png(l,a),r=i.concat(a.filter(Boolean))}return r},svgObject:function(e,t){t=h(t,"svg");var r=o(e,t.ec_level);return u.svg_object(r,t.margin)}}},13087(e){"use strict";function t(e){for(var t=e.length,r=[],n=-1;n<=t;n++)r[n]=[];var i=[];for(n=0;n=t||n>=t||!e[r][n])}function s(e,t,n){r[e][t]=1;var i=[];i.push(["M",t,e]);var a=e,s=t,u=0;do{switch(n){case"right":r[a][s]=1,o(a,s)?(r[a-1][s]=1,o(a-1,s)?(i.push(["h",u]),u=0,n="up"):(u++,s++)):(i.push(["h",u]),u=0,n="down");break;case"left":r[a-1][s-1]=1,o(a-1,s-1)?(r[a][s-1]=1,o(a,s-1)?(i.push(["h",-u]),u=0,n="down"):(u++,s--)):(i.push(["h",-u]),u=0,n="up");break;case"down":r[a][s-1]=1,o(a,s-1)?(r[a][s]=1,o(a,s)?(i.push(["v",u]),u=0,n="right"):(u++,a++)):(i.push(["v",u]),u=0,n="left");break;case"up":r[a-1][s]=1,o(a-1,s)?(r[a-1][s-1]=1,o(a-1,s-1)?(i.push(["v",-u]),u=0,n="left"):(u++,a--)):(i.push(["v",-u]),u=0,n="right")}}while(a!=e||s!=t);return i}}function r(e,r,n){t(e).forEach(function(e){for(var t="",i=0;i0){var o=a*i;t.push('width="'+o+'" height="'+o+'" ')}t.push('viewBox="0 0 '+a+" "+a+'">'),t.push(''),t.push(null)},eps:function(e,r,n){var i=e.length,a=9*(i+2*n);r.push(["%!PS-Adobe-3.0 EPSF-3.0","%%BoundingBox: 0 0 "+a+" "+a,"/h { 0 rlineto } bind def","/v { 0 exch neg rlineto } bind def","/M { neg "+(i+n)+" add moveto } bind def","/z { closepath } bind def","9 9 scale",""].join("\n")),t(e).forEach(function(e){for(var t="",i=0;i> endobj\n","2 0 obj << /Type /Pages /Count 1 /Kids [ 3 0 R ] >> endobj\n"];o.push("3 0 obj << /Type /Page /Parent 2 0 R /Resources <<>> /Contents 4 0 R /MediaBox [ 0 0 "+a+" "+a+" ] >> endobj\n");var s="9 0 0 9 0 0 cm\n";s+=t(e).map(function(e){for(var t,r,a="",o=0;o> stream\n"+s+"endstream\nendobj\n");for(var u="xref\n0 5\n0000000000 65535 f \n",l=1,c=o[0].length;l<5;l++)u+=("0000000000"+c).substr(-10)+" 00000 n \n",c+=o[l].length;o.push(u,"trailer << /Root 1 0 R /Size 5 >>\n","startxref\n"+c+"\n%%EOF\n"),r.push(o.join("")),r.push(null)},svg_object:function(e,t){var n=[];return r(e,n,t),{size:e.length+2*t,path:n.filter(Boolean).join("")}}}},99721(e,t,r){"use strict";var n=r(36556),i=r(14035),a=n("RegExp.prototype.exec"),o=r(69675);e.exports=function(e){if(!i(e))throw new o("`regex` must be a RegExp");return function(t){return null!==a(e,t)}}},96897(e,t,r){"use strict";var n=r(70453),i=r(30041),a=r(30592)(),o=r(75795),s=r(69675),u=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in e&&o){var c=o(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(l=!1)}return(n||l||!r)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},88310(e,t,r){e.exports=i;var n=r(37007).EventEmitter;function i(){n.call(this)}r(56698)(i,n),i.Readable=r(46891),i.Writable=r(81999),i.Duplex=r(88101),i.Transform=r(59083),i.PassThrough=r(3681),i.finished=r(14257),i.pipeline=r(5267),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},12463(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,a,o,s,u;if("string"==typeof t&&(a="not ",t.substr(0,4)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))o="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=("number"!=typeof u&&(u=0),u+1>(s=e).length||-1===s.indexOf(".",u)?"argument":"property");o='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return o+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},88101(e,t,r){"use strict";var n=r(65606),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var a=r(46891),o=r(81999);r(56698)(c,a);for(var s=i(o.prototype),u=0;u0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?x(e,new w):A(e,s,t,!0);else if(s.ended)x(e,new _);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?A(e,s,t,!1):M(e,s)):A(e,s,t,!1)}else n||(s.reading=!1,M(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(T,e))}function T(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function M(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function O(e){a("readable nexttick read 0"),e.read(0)}function N(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function z(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(U,t,e))}function U(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function $(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?z(this):P(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&z(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&z(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){x(this,new v("_read()"))},E.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===i.stdout||e===i.stderr?m:u;function u(){a("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",function t(i,o){a("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,a("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",f),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",l);var c=!1;function f(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==$(n.pipes,e))&&!c&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){a("onerror",t),m(),e.removeListener("error",h),0===o(e,"error")&&x(e,t)}function d(){e.removeListener("finish",p),m()}function p(){a("onfinish"),e.removeListener("close",d),m()}function m(){a("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(O,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(F,this),r},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(F,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new m("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)}},65034(e,t,r){"use strict";var n,i=r(65606);function a(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(14257),s=Symbol("lastResolve"),u=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[s]=null,e[u]=null,t(p(r,!1)))}}function g(e){i.nextTick(m,e)}var b=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((a(n={get stream(){return this[d]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){i.nextTick(function(){e[l]?r(e[l]):t(p(void 0,!0))})});var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[c]?r(p(void 0,!0)):t[h](r,n)},n)}}(n,this));else{var a=this[d].read();if(null!==a)return Promise.resolve(p(a,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,function(){return this}),a(n,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),b);e.exports=function(e){var t,r=Object.create(y,(a(t={},d,{value:e,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,u,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,h,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[s]=null,r[u]=null,e(p(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[f]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[f]=null,r[s]=null,r[u]=null,t(e)),void(r[l]=e)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[c]=!0}),e.on("readable",g.bind(null,r)),r}},81766(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0===(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},54347(e,t,r){"use strict";var n=r(65606);function i(e,t){o(e,t),a(e)}function a(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(o,this,e)):n.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(a,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(a,r),t(e)):n.nextTick(a,r)}),this)},undestroy:function(){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)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},14257(e,t,r){"use strict";var n=r(12463).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,a){if("function"==typeof r)return e(t,null,r);r||(r={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0,function(e){c||(c=e),e&&h.forEach(u),a||(h.forEach(u),f(c))})});return t.reduce(l)}},66644(e,t,r){"use strict";var n=r(12463).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},41396(e,t,r){e.exports=r(37007).EventEmitter},83141(e,t,r){"use strict";var n=r(15003).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.I=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},15003(e,t,r){var n=r(48287),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=o),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},90031(e,t){!function(e){var t,r,n,i=String.fromCharCode;function a(e){for(var t,r,n=[],i=0,a=e.length;i=55296&&t<=56319&&i=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return i(e>>t&63|128)}function u(e){if(!(4294967168&e))return i(e);var t="";return 4294965248&e?4294901760&e?4292870144&e||(t=i(e>>18&7|240),t+=s(e,12),t+=s(e,6)):(o(e),t=i(e>>12&15|224),t+=s(e,6)):t=i(e>>6&31|192),t+i(63&e|128)}function l(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function c(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,!(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|l())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|l()<<6|l())>=2048)return o(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|l()<<12|l()<<6|l())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=a(e),r=t.length,n=-1,i="";++n65535&&(a+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),a+=i(t);return a}(s)}}(t)},94643(e,t,r){function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},36622(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},81135(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},40537(e,t,r){var n=r(65606),i=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],r=0;r=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function l(e,t){return e}function c(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return b(i)||(i=c(e,i,n)),i}var a=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),x(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(k(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(x(r))return f(r)}var l,v="",B=!1,E=["{","}"];return d(r)&&(B=!0,E=["[","]"]),k(r)&&(v=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(v=" "+RegExp.prototype.toString.call(r)),w(r)&&(v=" "+Date.prototype.toUTCString.call(r)),x(r)&&(v=" "+f(r)),0!==o.length||B&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=B?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,v,E)):E[0]+v+E[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=m(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function y(e){return void 0===e}function _(e){return v(e)&&"[object RegExp]"===B(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===B(e)}function x(e){return v(e)&&("[object Error]"===B(e)||e instanceof Error)}function k(e){return"function"==typeof e}function B(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(y(a)&&(a=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=_,t.isObject=v,t.isDate=w,t.isError=x,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(81135);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[E((e=new Date).getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":"),[e.getDate(),S[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(36622),t._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}},25767(e,t,r){"use strict";var n=r(60301),i=r(39209),a=r(10487),o=r(36556),s=r(75795),u=o("Object.prototype.toString"),l=r(49092)(),c="undefined"==typeof globalThis?r.g:globalThis,f=i(),h=o("String.prototype.slice"),d=Object.getPrototypeOf,p=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1?t:"Object"===t&&function(e){var t=!1;return n(m,function(r,n){if(!t)try{r(e),t=h(n,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return n(m,function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(e){}}),t}(e):null}},85966(e,t,r){"use strict";e.exports=r.p+"assets/fonts/Roboto72White.fnt"},47707(e,t,r){"use strict";e.exports=r.p+"assets/fonts/Roboto72White.png"},60261(e,t,r){"use strict";e.exports=r.p+"assets/fonts/RobotoBlack72White.fnt"},55560(e,t,r){"use strict";e.exports=r.p+"assets/fonts/RobotoBlack72White.png"},13773(e,t,r){"use strict";e.exports=r.p+"assets/fonts/RobotoMono72White.fnt"},53968(e,t,r){"use strict";e.exports=r.p+"assets/fonts/RobotoMono72White.png"},6758(e,t,r){"use strict";e.exports=r.p+"assets/fonts/RobotoSlab72White.fnt"},25971(e,t,r){"use strict";e.exports=r.p+"assets/fonts/RobotoSlab72White.png"},63779(){},77199(){},25172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},16993(e,t,r){var n=r(75546);function i(){var t,r,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.toStringTag||"@@toStringTag";function u(e,i,a,o){var s=i&&i.prototype instanceof c?i:c,u=Object.create(s.prototype);return n(u,"_invoke",function(e,n,i){var a,o,s,u=0,c=i||[],f=!1,h={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return a=e,o=0,s=t,h.n=r,l}};function d(e,n){for(o=e,s=n,r=0;!f&&u&&!i&&r3?(i=p===n)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=t):a[0]<=d&&((i=e<2&&dn||n>p)&&(a[4]=e,a[5]=n,h.n=p,o=0))}if(i||e>1)return l;throw f=!0,n}return function(i,c,p){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,p),o=c,s=p;(r=o<2?t:s)||!f;){a||(o?o<3?(o>1&&(h.n=-1),d(o,s)):h.n=s:h.v=s);try{if(u=2,a){if(o||(i="next"),r=a[i]){if(!(r=r.call(a,s)))throw TypeError("iterator result is not an object");if(!r.done)return r;s=r.value,o<2&&(o=0)}else 1===o&&(r=a.return)&&r.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),o=1);a=t}else if((r=(f=h.n<0)?s:e.call(n,h))!==l)break}catch(e){a=t,o=1,s=e}finally{u=1}}return{value:r,done:f}}}(e,a,o),!0),u}var l={};function c(){}function f(){}function h(){}r=Object.getPrototypeOf;var d=[][o]?r(r([][o]())):(n(r={},o,function(){return this}),r),p=h.prototype=c.prototype=Object.create(d);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,n(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return f.prototype=h,n(p,"constructor",h),n(h,"constructor",f),f.displayName="GeneratorFunction",n(h,s,"GeneratorFunction"),n(p),n(p,s,"Generator"),n(p,o,function(){return this}),n(p,"toString",function(){return"[object Generator]"}),(e.exports=i=function(){return{w:u,m}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},55869(e,t,r){var n=r(887);e.exports=function(e,t,r,i,a){var o=n(e,t,r,i,a);return o.next().then(function(e){return e.done?e.value:o.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,r){var n=r(16993),i=r(11791);e.exports=function(e,t,r,a,o){return new i(n().w(e,t,r,a),o||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},11791(e,t,r){var n=r(25172),i=r(75546);e.exports=function e(t,r){function a(e,i,o,s){try{var u=t[e](i),l=u.value;return l instanceof n?r.resolve(l.v).then(function(e){a("next",e,o,s)},function(e){a("throw",e,o,s)}):r.resolve(l).then(function(e){u.value=e,o(u)},function(e){return a("throw",e,o,s)})}catch(e){s(e)}}var o;this.next||(i(e.prototype),i(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(e,t,n){function i(){return new r(function(t,r){a(e,n,t,r)})}return o=o?o.then(i,i):i()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},75546(e){function t(r,n,i,a){var o=Object.defineProperty;try{o({},"",{})}catch(r){o=0}e.exports=t=function(e,r,n,i){function a(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?o?o(e,r,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[r]=n:(a("next",0),a("throw",1),a("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,i,a)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,r){var n=r(25172),i=r(16993),a=r(55869),o=r(887),s=r(11791),u=r(4373),l=r(30579);function c(){"use strict";var t=i(),r=t.m(c),f=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function p(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,i,a){return t.resultName=i,r(n.d,l(e),a)},finish:function(e){return r(n.f,e)}},r=function(e,r,i){n.p=t.prev,n.n=t.next;try{return e(r,i)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=c=function(){return{wrap:function(e,r,n,i){return t.w(p(e),r,n,i&&i.reverse())},isGeneratorFunction:h,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:s,async:function(e,t,r,n,i){return(h(t)?o:a)(p(e),t,r,n,i)},keys:u,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=c,e.exports.__esModule=!0,e.exports.default=e.exports},30579(e,t,r){var n=r(73738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},73738(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756(e,t,r){var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},39209(e,t,r){"use strict";var n=r(76578),i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;tloadFont,G4:()=>VerticalAlign,Rf:()=>measureTextHeight,dK:()=>Jimp,ej:()=>PNGFilterType,kD:()=>measureText,od:()=>ResizeStrategy,pY:()=>JimpMime,rO:()=>rgbaToInt,wq:()=>HorizontalAlign});var process=__webpack_require__(65606),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}"undefined"==typeof self&&"object"==typeof commonjsGlobal&&(commonjsGlobal.self=commonjsGlobal);var global$1=void 0!==__webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,inited=!1;function init(){inited=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)lookup[t]=e[t],revLookup[e.charCodeAt(t)]=t;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63}function toByteArray(e){var t,r,n,i,a,o;inited||init();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new Arr(3*s/4-a),n=a>0?s-4:s;var u=0;for(t=0,r=0;t>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===a?(i=revLookup[e.charCodeAt(t)]<<2|revLookup[e.charCodeAt(t+1)]>>4,o[u++]=255&i):1===a&&(i=revLookup[e.charCodeAt(t)]<<10|revLookup[e.charCodeAt(t+1)]<<4|revLookup[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,r){for(var n,i=[],a=t;au?u:s+o));return 1===n?(t=e[r-1],i+=lookup[t>>2],i+=lookup[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=lookup[t>>10],i+=lookup[t>>4&63],i+=lookup[t<<2&63],i+="="),a.push(i),a.join("")}function read(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=l}return(d?-1:1)*o*Math.pow(2,a-n)}function write(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,l-=8);e[r+d-p]|=128*m}var toString={}.toString,isArray=Array.isArray||function(e){return"[object Array]"==toString.call(e)},INSPECT_MAX_BYTES=50;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function internalIsBuffer(e){return!(null==e||!e._isBuffer)}function byteLength(e,t){if(internalIsBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),internalIsBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,i);if("number"==typeof t)return t&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return decodeCodePointsArray(n)}Buffer.TYPED_ARRAY_SUPPORT=void 0===global$1.TYPED_ARRAY_SUPPORT||global$1.TYPED_ARRAY_SUPPORT,kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(e){return e.__proto__=Buffer.prototype,e},Buffer.from=function(e,t,r){return from(null,e,t,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]),Buffer.alloc=function(e,t,r){return alloc(null,e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)},Buffer.isBuffer=isBuffer,Buffer.compare=function(e,t){if(!internalIsBuffer(e)||!internalIsBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},Buffer.prototype.compare=function(e,t,r,n,i){if(!internalIsBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,i,a){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function objectWriteUInt32(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function checkIEEE754(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,i){return i||checkIEEE754(e,t,r,4),write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,i){return i||checkIEEE754(e,t,r,8),write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUInt8=function(e,t){return t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},Buffer.prototype.readInt8=function(e,t){return t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return t||checkOffset(e,4,this.length),read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return t||checkOffset(e,4,this.length),read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return t||checkOffset(e,8,this.length),read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return t||checkOffset(e,8,this.length),read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function asciiToBytes(e){for(var t=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function isnan(e){return e!=e}function isBuffer(e){return null!=e&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&isFastBuffer(e.slice(0,0))}!function(e){e[e.BITMAP_INFO_HEADER=40]="BITMAP_INFO_HEADER",e[e.BITMAP_V2_INFO_HEADER=52]="BITMAP_V2_INFO_HEADER",e[e.BITMAP_V3_INFO_HEADER=56]="BITMAP_V3_INFO_HEADER",e[e.BITMAP_V4_HEADER=108]="BITMAP_V4_HEADER",e[e.BITMAP_V5_HEADER=124]="BITMAP_V5_HEADER"}(HeaderTypes||(HeaderTypes={}));var HeaderTypes$1=HeaderTypes,BmpCompression;function maskColor(e,t,r,n){const i=1+~e&e,a=1+~t&t,o=1+~r&r,s=1+~n&n,u=e/i+1,l=t/a+1,c=r/o+1,f=n/s+1;return{shiftRed:t=>(t&e)/i*256/u,shiftGreen:e=>(e&t)/a*256/l,shiftBlue:e=>(e&r)/o*256/c,shiftAlpha:0!==n?e=>(e&n)/s*256/f:()=>255}}!function(e){e[e.NONE=0]="NONE",e[e.BI_RLE8=1]="BI_RLE8",e[e.BI_RLE4=2]="BI_RLE4",e[e.BI_BIT_FIELDS=3]="BI_BIT_FIELDS",e[e.BI_ALPHA_BIT_FIELDS=6]="BI_ALPHA_BIT_FIELDS"}(BmpCompression||(BmpCompression={}));class BmpDecoder{flag;fileSize;reserved1;reserved2;offset;headerSize;width;height;planes;bitPP;compression;rawSize;hr;vr;colors;importantColors;palette;data;maskRed;maskGreen;maskBlue;maskAlpha;toRGBA;pos;bottomUp;buffer;locRed;locGreen;locBlue;locAlpha;shiftRed;shiftGreen;shiftBlue;shiftAlpha;constructor(e,{toRGBA:t}={toRGBA:!1}){if(this.buffer=e,this.toRGBA=!!t,this.pos=0,this.bottomUp=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),"BM"!==this.flag)throw new Error("Invalid BMP File");this.locRed=this.toRGBA?0:3,this.locGreen=this.toRGBA?1:2,this.locBlue=this.toRGBA?2:1,this.locAlpha=this.toRGBA?3:0,this.parseHeader(),this.parseRGBA()}parseHeader(){if(this.fileSize=this.readUInt32LE(),this.reserved1=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.reserved2=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.offset=this.readUInt32LE(),this.headerSize=this.readUInt32LE(),!(this.headerSize in HeaderTypes$1))throw new Error(`Unsupported BMP header size ${this.headerSize}`);if(this.width=this.readUInt32LE(),this.height=this.readUInt32LE(),this.height=this.height>2147483647?this.height-4294967296:this.height,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compression=this.readUInt32LE(),this.rawSize=this.readUInt32LE(),this.hr=this.readUInt32LE(),this.vr=this.readUInt32LE(),this.colors=this.readUInt32LE(),this.importantColors=this.readUInt32LE(),32===this.bitPP?(this.maskAlpha=0,this.maskRed=16711680,this.maskGreen=65280,this.maskBlue=255):16===this.bitPP&&(this.maskAlpha=0,this.maskRed=31744,this.maskGreen=992,this.maskBlue=31),(this.headerSize>HeaderTypes$1.BITMAP_INFO_HEADER||this.compression===BmpCompression.BI_BIT_FIELDS||this.compression===BmpCompression.BI_ALPHA_BIT_FIELDS)&&(this.maskRed=this.readUInt32LE(),this.maskGreen=this.readUInt32LE(),this.maskBlue=this.readUInt32LE()),(this.headerSize>HeaderTypes$1.BITMAP_V2_INFO_HEADER||this.compression===BmpCompression.BI_ALPHA_BIT_FIELDS)&&(this.maskAlpha=this.readUInt32LE()),this.headerSize>HeaderTypes$1.BITMAP_V3_INFO_HEADER&&(this.pos+=HeaderTypes$1.BITMAP_V4_HEADER-HeaderTypes$1.BITMAP_V3_INFO_HEADER),this.headerSize>HeaderTypes$1.BITMAP_V4_HEADER&&(this.pos+=HeaderTypes$1.BITMAP_V5_HEADER-HeaderTypes$1.BITMAP_V4_HEADER),this.bitPP<=8||this.colors>0){const e=0===this.colors?1<{const r=this.buffer.readUInt8(this.pos++),n=t*this.width*4+8*e*4;for(let t=0;t<8&&8*e+t>7-t&1];this.data[n+t*this.locAlpha]=0,this.data[n+4*t+this.locBlue]=e.blue,this.data[n+4*t+this.locGreen]=e.green,this.data[n+4*t+this.locRed]=e.red}})}bit4(){if(this.compression===BmpCompression.BI_RLE4){this.data.fill(0);let e=!1,t=this.bottomUp?this.height-1:0,r=0;for(;r>4),1&n&&n+1>1&1)&&this.pos++}}else for(let t=0;t>4),e=!e}}else{const e=Math.ceil(this.width/2),t=e%4,r=0!==t?4-t:0;this.scanImage(r,e,(e,t)=>{const r=this.buffer.readUInt8(this.pos++),n=t*this.width*4+2*e*4,i=r>>4;let a=this.palette[i];if(this.data[n]=0,this.data[n+1]=a.blue,this.data[n+2]=a.green,this.data[n+3]=a.red,2*e+1>=this.width)return!1;const o=15&r;a=this.palette[o],this.data[n+4]=0,this.data[n+4+1]=a.blue,this.data[n+4+2]=a.green,this.data[n+4+3]=a.red})}}bit8(){if(this.compression===BmpCompression.BI_RLE8){this.data.fill(0);let e=this.bottomUp?this.height-1:0,t=0;for(;t{const r=this.buffer.readUInt8(this.pos++),n=t*this.width*4+4*e;if(r{const r=t*this.width*4+4*e,n=this.buffer.readUInt16LE(this.pos);this.pos+=2,this.data[r+this.locRed]=this.shiftRed(n),this.data[r+this.locGreen]=this.shiftGreen(n),this.data[r+this.locBlue]=this.shiftBlue(n),this.data[r+this.locAlpha]=this.shiftAlpha(n)})}bit24(){const e=this.width%4;this.scanImage(e,this.width,(e,t)=>{const r=t*this.width*4+4*e,n=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++);this.data[r+this.locRed]=a,this.data[r+this.locGreen]=i,this.data[r+this.locBlue]=n,this.data[r+this.locAlpha]=0})}bit32(){this.scanImage(0,this.width,(e,t)=>{const r=t*this.width*4+4*e,n=this.readUInt32LE();this.data[r+this.locRed]=this.shiftRed(n),this.data[r+this.locGreen]=this.shiftGreen(n),this.data[r+this.locBlue]=this.shiftBlue(n),this.data[r+this.locAlpha]=this.shiftAlpha(n)})}scanImage(e=0,t=this.width,r){for(let n=this.height-1;n>=0;n--){const i=this.bottomUp?n:this.height-1-n;for(let e=0;ee<<1|t,0)}function createColor(e){return e.quad<<24|e.red<<16|e.green<<8|e.blue}class BmpEncoder{fileSize;reserved1;reserved2;offset;width;flag;height;planes;bitPP;compress;hr;vr;colors;importantColors;rawSize;headerSize;data;palette;extraBytes;buffer;bytesInColor;pos;constructor(e){switch(this.buffer=e.data,this.width=e.width,this.height=e.height,this.headerSize=HeaderTypes$1.BITMAP_INFO_HEADER,this.flag="BM",this.bitPP=e.bitPP||24,this.offset=54,this.reserved1=e.reserved1||0,this.reserved2=e.reserved2||0,this.planes=1,this.compress=0,this.hr=e.hr||0,this.vr=e.vr||0,this.importantColors=e.importantColors||0,this.colors=Math.min(2**(this.bitPP-1||1),e.colors||1/0),this.palette=e.palette||[],this.colors&&this.bitPP<16?this.offset+=4*this.colors:this.colors=0,this.bitPP){case 32:this.bytesInColor=4;break;case 16:this.bytesInColor=2;break;case 8:this.bytesInColor=1;break;case 4:this.bytesInColor=.5;break;case 1:this.bytesInColor=1/8;break;default:this.bytesInColor=3,this.bitPP=24}const t=this.width*this.bitPP/32,r=Math.ceil(t);this.extraBytes=4*(r-t),this.rawSize=this.height*r*4+2,this.fileSize=this.rawSize+this.offset,this.data=Buffer.alloc(this.fileSize,1),this.pos=0,this.encode()}encode(){switch(this.pos=0,this.writeHeader(),this.bitPP){case 32:this.bit32();break;case 16:this.bit16();break;case 8:this.bit8();break;case 4:this.bit4();break;case 1:this.bit1();break;default:this.bit24()}}writeHeader(){this.data.write(this.flag,this.pos,2),this.pos+=2,this.writeUInt32LE(this.fileSize),this.writeUInt32LE(this.reserved1<<16|this.reserved2),this.writeUInt32LE(this.offset),this.writeUInt32LE(this.headerSize),this.writeUInt32LE(this.width),this.writeUInt32LE(this.height),this.data.writeUInt16LE(this.planes,this.pos),this.pos+=2,this.data.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,this.writeUInt32LE(this.compress),this.writeUInt32LE(this.rawSize),this.writeUInt32LE(this.hr),this.writeUInt32LE(this.vr),this.writeUInt32LE(this.colors),this.writeUInt32LE(this.importantColors)}bit1(){this.palette.length&&2===this.colors?this.initColors(1):(this.writeUInt32LE(16777215),this.writeUInt32LE(0)),this.pos+=1;let e=[];this.writeImage((t,r,n)=>{let i=r;i++;const a=this.buffer[i++],o=this.buffer[i++],s=.2126*this.buffer[i++]+.7152*o+.0722*a;return e.push(s>127?0:1),(n+1)%8==0?(this.data[t-1]=createInteger(e),e=[]):n===this.width-1&&e.length>0&&(this.data[t-1]=createInteger(e)<<4,e=[]),i})}bit4(){const e=this.initColors(4);let t=[];this.writeImage((r,n,i)=>{let a=n;const o=createColor({quad:this.buffer[a++],blue:this.buffer[a++],green:this.buffer[a++],red:this.buffer[a++]}),s=e.findIndex(e=>e===o);return-1!==s?t.push(s):t.push(0),(i+1)%2==0&&(this.data[r]=t[0]<<4|t[1],t=[]),a})}bit8(){const e=this.initColors(8);this.writeImage((t,r)=>{let n=r;const i=createColor({quad:this.buffer[n++],blue:this.buffer[n++],green:this.buffer[n++],red:this.buffer[n++]}),a=e.findIndex(e=>e===i);return this.data[t]=-1!==a?a:0,n})}bit16(){this.writeImage((e,t)=>{let r=t+1;const n=this.buffer[r++]/8,i=this.buffer[r++]/8,a=this.buffer[r++]/8<<10|i<<5|n;return this.data[e]=255&a,this.data[e+1]=(65280&a)>>8,r})}bit24(){this.writeImage((e,t)=>{let r=t+1;return this.data[e]=this.buffer[r++],this.data[e+1]=this.buffer[r++],this.data[e+2]=this.buffer[r++],r})}bit32(){this.writeImage((e,t)=>{let r=t;return this.data[e+3]=this.buffer[r++],this.data[e]=this.buffer[r++],this.data[e+1]=this.buffer[r++],this.data[e+2]=this.buffer[r++],r})}writeImage(e){const t=this.extraBytes+this.width*this.bytesInColor;let r=0;for(let n=0;n.5?u/(2-a-o):u/(a+o),a){case e:n=(t-r)/u+(t1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=bound01(e,360),t=bound01(t,100),r=bound01(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,u=2*r-s;n=o(u,s,e+1/3),i=o(u,s,e),a=o(u,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}function rgbToHsv(e,t,r){e=bound01(e,255),t=bound01(t,255),r=bound01(r,255);var n,i,a=Math.max(e,t,r),o=Math.min(e,t,r),s=a,u=a-o;if(i=0===a?0:u/a,a==o)n=0;else{switch(a){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(tinycolor(n));return a}function _monochromatic(e,t){t=t||6;for(var r=tinycolor(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(tinycolor({h:n,s:i,v:a})),a=(a+s)%1;return o}tinycolor.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=boundAlpha(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=rgbToHsv(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=rgbToHsv(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=rgbToHsl(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=rgbToHsl(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return rgbToHex(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return rgbaToHex(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*bound01(this._r,255))+"%",g:Math.round(100*bound01(this._g,255))+"%",b:Math.round(100*bound01(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*bound01(this._r,255))+"%, "+Math.round(100*bound01(this._g,255))+"%, "+Math.round(100*bound01(this._b,255))+"%)":"rgba("+Math.round(100*bound01(this._r,255))+"%, "+Math.round(100*bound01(this._g,255))+"%, "+Math.round(100*bound01(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(hexNames[rgbToHex(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+rgbaToArgbHex(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=tinycolor(e);r="#"+rgbaToArgbHex(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return tinycolor(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(_lighten,arguments)},brighten:function(){return this._applyModification(_brighten,arguments)},darken:function(){return this._applyModification(_darken,arguments)},desaturate:function(){return this._applyModification(_desaturate,arguments)},saturate:function(){return this._applyModification(_saturate,arguments)},greyscale:function(){return this._applyModification(_greyscale,arguments)},spin:function(){return this._applyModification(_spin,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(_analogous,arguments)},complement:function(){return this._applyCombination(_complement,arguments)},monochromatic:function(){return this._applyCombination(_monochromatic,arguments)},splitcomplement:function(){return this._applyCombination(_splitcomplement,arguments)},triad:function(){return this._applyCombination(polyad,[3])},tetrad:function(){return this._applyCombination(polyad,[4])}},tinycolor.fromRatio=function(e,t){if("object"==_typeof(e)){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:convertToPercentage(e[n]));e=r}return tinycolor(e,t)},tinycolor.equals=function(e,t){return!(!e||!t)&&tinycolor(e).toRgbString()==tinycolor(t).toRgbString()},tinycolor.random=function(){return tinycolor.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},tinycolor.mix=function(e,t,r){r=0===r?0:r||50;var n=tinycolor(e).toRgb(),i=tinycolor(t).toRgb(),a=r/100;return tinycolor({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},tinycolor.readability=function(e,t){var r=tinycolor(e),n=tinycolor(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},tinycolor.isReadable=function(e,t,r){var n,i,a=tinycolor.readability(e,t);switch(i=!1,(n=validateWCAG2Parms(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},tinycolor.mostReadable=function(e,t,r){var n,i,a,o,s=null,u=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var l=0;lu&&(u=n,s=tinycolor(t[l]));return tinycolor.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,tinycolor.mostReadable(e,["#fff","#000"],r))};var names$1=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},hexNames=tinycolor.hexNames=flip(names$1);function flip(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function boundAlpha(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function bound01(e,t){isOnePointZero(e)&&(e="100%");var r=isPercentage(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function clamp01(e){return Math.min(1,Math.max(0,e))}function parseIntFromHex(e){return parseInt(e,16)}function isOnePointZero(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)}function isPercentage(e){return"string"==typeof e&&-1!=e.indexOf("%")}function pad2(e){return 1==e.length?"0"+e:""+e}function convertToPercentage(e){return e<=1&&(e=100*e+"%"),e}function convertDecimalToHex(e){return Math.round(255*parseFloat(e)).toString(16)}function convertHexToDecimal(e){return parseIntFromHex(e)/255}var matchers=(CSS_UNIT="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",{CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),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})$/}),CSS_UNIT,PERMISSIVE_MATCH3,PERMISSIVE_MATCH4;function isValidCSSUnit(e){return!!matchers.CSS_UNIT.exec(e)}function stringInputToObject(e){e=e.replace(trimLeft,"").replace(trimRight,"").toLowerCase();var t,r=!1;if(names$1[e])e=names$1[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=matchers.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=matchers.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=matchers.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=matchers.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=matchers.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=matchers.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=matchers.hex8.exec(e))?{r:parseIntFromHex(t[1]),g:parseIntFromHex(t[2]),b:parseIntFromHex(t[3]),a:convertHexToDecimal(t[4]),format:r?"name":"hex8"}:(t=matchers.hex6.exec(e))?{r:parseIntFromHex(t[1]),g:parseIntFromHex(t[2]),b:parseIntFromHex(t[3]),format:r?"name":"hex"}:(t=matchers.hex4.exec(e))?{r:parseIntFromHex(t[1]+""+t[1]),g:parseIntFromHex(t[2]+""+t[2]),b:parseIntFromHex(t[3]+""+t[3]),a:convertHexToDecimal(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=matchers.hex3.exec(e))&&{r:parseIntFromHex(t[1]+""+t[1]),g:parseIntFromHex(t[2]+""+t[2]),b:parseIntFromHex(t[3]+""+t[3]),format:r?"name":"hex"}}function validateWCAG2Parms(e){var t,r;return"AA"!==(t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==t&&(t="AA"),"small"!==(r=(e.size||"small").toLowerCase())&&"large"!==r&&(r="small"),{level:t,size:r}}function clone(e){const t={width:e.bitmap.width,height:e.bitmap.height,data:Buffer.from(e.bitmap.data)};return new e.constructor(t)}function scan(e,t,r,n,i,a){let o,s,u,l,c;if("function"==typeof t)c=t,o=0,s=0,u=e.bitmap.width,l=e.bitmap.height;else{if(o=t,"number"!=typeof r)throw new Error("y must be a number");if(s=r,"number"!=typeof n)throw new Error("w must be a number");if(u=n,"number"!=typeof i)throw new Error("h must be a number");if(l=i,"function"!=typeof a)throw new Error("cb must be a function");c=a}o=Math.round(o),s=Math.round(s),u=Math.round(u),l=Math.round(l);const f=c.bind(e);for(let t=s;t255)throw new Error("r must be between 0 and 255");if(t<0||t>255)throw new Error("g must be between 0 and 255");if(r<0||r>255)throw new Error("b must be between 0 and 255");if(n<0||n>255)throw new Error("a must be between 0 and 255");let i=255&e;return i<<=8,i|=255&t,i<<=8,i|=255&r,i<<=8,i|=255&n,i>>>=0,i}function colorDiff(e,t){const r=e=>Math.pow(e,2),{max:n}=Math,i="a"in e?e.a:255,a="a"in t?t.a:255;return(n(r(e.r-t.r),r(e.r-t.r-i+a))+n(r(e.g-t.g),r(e.g-t.g-i+a))+n(r(e.b-t.b),r(e.b-t.b-i+a)))/195075}function limit255(e){return e=Math.max(e,0),Math.min(e,255)}function cssColorToHex(e){return"number"==typeof e?e:parseInt(tinycolor(e).toHex8(),16)}function encode$1(e,t={}){return scan({bitmap:e},0,0,e.width,e.height,function(t,r,n){const i=e.data[n+0],a=e.data[n+1],o=e.data[n+2],s=e.data[n+3];e.data[n+0]=s,e.data[n+1]=o,e.data[n+2]=a,e.data[n+3]=i}),encode$2({...e,...t}).data}function decode$1(e,t){const r=decode$2(e,t);return scan({bitmap:r},0,0,r.width,r.height,function(e,t,n){const i=r.data[n+1],a=r.data[n+2],o=r.data[n+3];r.data[n+0]=o,r.data[n+1]=a,r.data[n+2]=i,r.data[n+3]=255}),r}function msBmp(){return{mime:"image/x-ms-bmp",encode:encode$1,decode:decode$1}}function bmp(){return{mime:"image/bmp",encode:encode$1,decode:decode$1}}var omggif={},GifReader_1,GifWriter_1;function GifWriter(e,t,r,n){var i=0,a=void 0===(n=void 0===n?{}:n).loop?null:n.loop,o=void 0===n.palette?null:n.palette;if(t<=0||r<=0||t>65535||r>65535)throw new Error("Width/Height invalid.");function s(e){var t=e.length;if(t<2||t>256||t&t-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return t}e[i++]=71,e[i++]=73,e[i++]=70,e[i++]=56,e[i++]=57,e[i++]=97;var u=0,l=0;if(null!==o){for(var c=s(o);c>>=1;)++u;if(c=1<=c)throw new Error("Background index out of range.");if(0===l)throw new Error("Background index explicitly passed as 0.")}}if(e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=(null!==o?128:0)|u,e[i++]=l,e[i++]=0,null!==o)for(var f=0,h=o.length;f>16&255,e[i++]=d>>8&255,e[i++]=255&d}if(null!==a){if(a<0||a>65535)throw new Error("Loop count invalid.");e[i++]=33,e[i++]=255,e[i++]=11,e[i++]=78,e[i++]=69,e[i++]=84,e[i++]=83,e[i++]=67,e[i++]=65,e[i++]=80,e[i++]=69,e[i++]=50,e[i++]=46,e[i++]=48,e[i++]=3,e[i++]=1,e[i++]=255&a,e[i++]=a>>8&255,e[i++]=0}var p=!1;this.addFrame=function(t,r,n,a,u,l){if(!0===p&&(--i,p=!1),l=void 0===l?{}:l,t<0||r<0||t>65535||r>65535)throw new Error("x/y invalid.");if(n<=0||a<=0||n>65535||a>65535)throw new Error("Width/Height invalid.");if(u.length>=1;)++d;h=1<3)throw new Error("Disposal out of range.");var b=!1,y=0;if(void 0!==l.transparent&&null!==l.transparent&&(b=!0,(y=l.transparent)<0||y>=h))throw new Error("Transparent color index.");if((0!==g||b||0!==m)&&(e[i++]=33,e[i++]=249,e[i++]=4,e[i++]=g<<2|(!0===b?1:0),e[i++]=255&m,e[i++]=m>>8&255,e[i++]=y,e[i++]=0),e[i++]=44,e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=255&n,e[i++]=n>>8&255,e[i++]=255&a,e[i++]=a>>8&255,e[i++]=!0===c?128|d-1:0,!0===c)for(var _=0,v=f.length;_>16&255,e[i++]=w>>8&255,e[i++]=255&w}return i=GifWriterOutputLZWCodeStream(e,i,d<2?2:d,u)},this.end=function(){return!1===p&&(e[i++]=59,p=!0),i},this.getOutputBuffer=function(){return e},this.setOutputBuffer=function(t){e=t},this.getOutputBufferPosition=function(){return i},this.setOutputBufferPosition=function(e){i=e}}function GifWriterOutputLZWCodeStream(e,t,r,n){e[t++]=r;var i=t++,a=1<=r;)e[t++]=255&f,f>>=8,c-=8,t===i+256&&(e[i]=255,i=t++)}function d(e){f|=e<=8;)e[t++]=255&f,f>>=8,c-=8,t===i+256&&(e[i]=255,i=t++);4096===u?(d(a),u=s+1,l=r+1,m={}):(u>=1<>7,o=1<<1+(7&i);e[t++],e[t++];var s=null,u=null;a&&(s=t,u=o,t+=3*o);var l=!0,c=[],f=0,h=null,d=0,p=null;for(this.width=r,this.height=n;l&&t=0))throw Error("Invalid block size");if(0===A)break;t+=A}break;case 249:if(4!==e[t++]||0!==e[t+4])throw new Error("Invalid graphics extension block.");var m=e[t++];f=e[t++]|e[t++]<<8,h=e[t++],1&m||(h=null),d=m>>2&7,t++;break;case 254:for(;;){if(!((A=e[t++])>=0))throw Error("Invalid block size");if(0===A)break;t+=A}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,v=e[t++],w=v>>6&1,x=1<<1+(7&v),k=s,B=u,E=!1;v>>7&&(E=!0,k=t,B=x,t+=3*x);var S=t;for(t++;;){var A;if(!((A=e[t++])>=0))throw Error("Invalid block size");if(0===A)break;t+=A}c.push({x:g,y:b,width:y,height:_,has_local_palette:E,palette_offset:k,palette_size:B,data_offset:S,data_length:t-S,transparent_index:h,interlaced:!!w,delay:f,disposal:d});break;case 59:l=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return c.length},this.loopCount=function(){return p},this.frameInfo=function(e){if(e<0||e>=c.length)throw new Error("Frame index out of range.");return c[e]},this.decodeAndBlitFrameBGRA=function(t,n){var i=this.frameInfo(t),a=i.width*i.height,o=new Uint8Array(a);GifReaderLZWOutputIndexStream(e,i.data_offset,o,a);var s=i.palette_offset,u=i.transparent_index;null===u&&(u=256);var l=i.width,c=r-l,f=l,h=4*(i.y*r+i.x),d=4*((i.y+i.height)*r+i.x),p=h,m=4*c;!0===i.interlaced&&(m+=4*r*7);for(var g=8,b=0,y=o.length;b=d&&(m=4*c+4*r*(g-1),p=h+(l+c)*(g<<1),g>>=1)),_===u)p+=4;else{var v=e[s+3*_],w=e[s+3*_+1],x=e[s+3*_+2];n[p++]=x,n[p++]=w,n[p++]=v,n[p++]=255}--f}},this.decodeAndBlitFrameRGBA=function(t,n){var i=this.frameInfo(t),a=i.width*i.height,o=new Uint8Array(a);GifReaderLZWOutputIndexStream(e,i.data_offset,o,a);var s=i.palette_offset,u=i.transparent_index;null===u&&(u=256);var l=i.width,c=r-l,f=l,h=4*(i.y*r+i.x),d=4*((i.y+i.height)*r+i.x),p=h,m=4*c;!0===i.interlaced&&(m+=4*r*7);for(var g=8,b=0,y=o.length;b=d&&(m=4*c+4*r*(g-1),p=h+(l+c)*(g<<1),g>>=1)),_===u)p+=4;else{var v=e[s+3*_],w=e[s+3*_+1],x=e[s+3*_+2];n[p++]=v,n[p++]=w,n[p++]=x,n[p++]=255}--f}}}function GifReaderLZWOutputIndexStream(e,t,r,n){for(var i=e[t++],a=1<>=u,c-=u,g!==a){if(g===o)break;for(var b=ga;)_=p[_]>>8,++y;var v=_;if(h+y+(b!==g?1:0)>n)return void console.log("Warning, gif stream longer than expected.");r[h++]=v;var w=h+=y;for(b!==g&&(r[h++]=v),_=b;y--;)_=p[_],r[--w]=255&_,_>>=8;null!==m&&s<4096&&(p[s++]=m<<8|v,s>=l+1&&u<12&&(++u,l=l<<1|1)),m=g}else s=o+1,l=(1<<(u=i+1))-1,m=null}return h!==n&&console.log("Warning, gif stream shorter than expected."),r}try{GifWriter_1=omggif.GifWriter=GifWriter,GifReader_1=omggif.GifReader=GifReader}catch(e){}let BitmapImage$2=class e{constructor(...t){if(0===t.length)throw new Error("constructor requires parameters");const r=t[0];if(null!==r&&"object"==typeof r)if(r instanceof e){const e=r.bitmap;this.bitmap={width:e.width,height:e.height,data:new Buffer(e.width*e.height*4)},e.data.copy(this.bitmap.data)}else{if(!(r.width&&r.height&&r.data))throw new Error("unrecognized constructor parameters");this.bitmap=r}else{if("number"!=typeof r||"number"!=typeof t[1])throw new Error("unrecognized constructor parameters");{const e=r,n=t[1],i=t[2];this.bitmap={width:e,height:n},Buffer.isBuffer(i)?this.bitmap.data=i:(this.bitmap.data=new Buffer(e*n*4),"number"==typeof i&&this.fillRGBA(i))}}}blit(e,t,r,n,i,a,o){if(n+a>this.bitmap.width)throw new Error("copy exceeds width of source bitmap");if(t+a>e.bitmap.width)throw new Error("copy exceeds width of target bitmap");if(i+o>this.bitmap.height)throw new Error("copy exceeds height of source bitmap");if(r+o>e.bitmap.height)throw new Erro("copy exceeds height of target bitmap");const s=this.bitmap.data,u=e.bitmap.data,l=4*this.bitmap.width,c=4*e.bitmap.width,f=4*a;let h=i*l+4*n,d=r*c+4*t;for(;--o>=0;)s.copy(u,d,h,h+f),h+=l,d+=c;return this}fillRGBA(e){const t=this.bitmap.data,r=4*this.bitmap.height;let n=0;for(;n{const i=Math.round(.299*e[n]+.587*e[n+1]+.114*e[n+2]);e[n]=i,e[n+1]=i,e[n+2]=i}),this}reframe(t,r,n,i,a){const o=t<0?0:t,s=r<0?0:r,u=n+o>this.bitmap.width?this.bitmap.width-o:n,l=i+s>this.bitmap.height?this.bitmap.height-s:i,c=t<0?-t:0,f=r<0?-r:0;let h;if(void 0===a){if(o!==t||s!=r||u!==n||l!==i)throw new GifError("fillRGBA required for this reframing");h=new e(n,i)}else h=new e(n,i,a);return this.blit(h,c,f,o,s,u,l),this.bitmap=h.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 t=this.bitmap.width,r=this.bitmap.height,n=t*e*4,i=this.bitmap.data,a=new Buffer(r*n*e);let o,s=0,u=0;for(let l=0;lt in e?__defProp$3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__markAsModule=e=>__defProp$3(e,"__esModule",{value:!0}),__export$1=(e,t)=>{for(var r in t)__defProp$3(e,r,{get:t[r],enumerable:!0})},__reExport=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of __getOwnPropNames(t))!__hasOwnProp.call(e,i)&&r&&__defProp$3(e,i,{get:()=>t[i],enumerable:!(n=__getOwnPropDesc(t,i))||n.enumerable});return e},__toCommonJS=(e=>(t,r)=>e&&e.get(t)||(r=__reExport(__markAsModule({}),t,1),e&&e.set(t,r),r))("undefined"!=typeof WeakMap?new WeakMap:0),__publicField$3=(e,t,r)=>(__defNormalProp$3(e,"symbol"!=typeof t?t+"":t,r),r),src_exports={};__export$1(src_exports,{applyPalette:()=>applyPalette,applyPaletteSync:()=>applyPaletteSync$1,buildPalette:()=>buildPalette,buildPaletteSync:()=>buildPaletteSync$1,constants:()=>constants_exports$1,conversion:()=>conversion_exports$1,distance:()=>distance_exports$1,image:()=>image_exports$1,palette:()=>palette_exports$1,quality:()=>quality_exports$1,utils:()=>utils_exports$1});var constants_exports$1={};__export$1(constants_exports$1,{bt709:()=>bt709_exports$1});var bt709_exports$1={};__export$1(bt709_exports$1,{Y:()=>Y$1,x:()=>x$2,y:()=>y$2});var Y$1=(e=>(e[e.RED=.2126]="RED",e[e.GREEN=.7152]="GREEN",e[e.BLUE=.0722]="BLUE",e[e.WHITE=1]="WHITE",e))(Y$1||{}),x$2=(e=>(e[e.RED=.64]="RED",e[e.GREEN=.3]="GREEN",e[e.BLUE=.15]="BLUE",e[e.WHITE=.3127]="WHITE",e))(x$2||{}),y$2=(e=>(e[e.RED=.33]="RED",e[e.GREEN=.6]="GREEN",e[e.BLUE=.06]="BLUE",e[e.WHITE=.329]="WHITE",e))(y$2||{}),conversion_exports$1={};function correctGamma$1(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}function rgb2xyz$1(e,t,r){return{x:.4124*(e=correctGamma$1(e/255))+.3576*(t=correctGamma$1(t/255))+.1805*(r=correctGamma$1(r/255)),y:.2126*e+.7152*t+.0722*r,z:.0193*e+.1192*t+.9505*r}}__export$1(conversion_exports$1,{lab2rgb:()=>lab2rgb$1,lab2xyz:()=>lab2xyz$1,rgb2hsl:()=>rgb2hsl$1,rgb2lab:()=>rgb2lab$1,rgb2xyz:()=>rgb2xyz$1,xyz2lab:()=>xyz2lab$1,xyz2rgb:()=>xyz2rgb$1});var arithmetic_exports$1={};function degrees2radians$1(e){return e*(Math.PI/180)}function max3$1(e,t,r){let n=e;return nt&&(n=t),n>r&&(n=r),n}function intInRange$1(e,t,r){return e>r&&(e=r),e255?e=255:e<0&&(e=0),e}function inRange0to255$1(e){return e>255?e=255:e<0&&(e=0),e}function stableSort$1(e,t){const r=typeof e[0];let n;if("number"===r||"string"===r){const r=Object.create(null);for(let t=0,n=e.length;tt(e,n)||r[e]-r[n])}else{const r=e.slice(0);n=e.sort((e,n)=>t(e,n)||r.indexOf(e)-r.indexOf(n))}return n}function rgb2hsl$1(e,t,r){const n=min3$1(e,t,r),i=max3$1(e,t,r),a=i-n,o=(n+i)/510;let s=0;o>0&&o<1&&(s=a/(o<.5?i+n:510-i-n));let u=0;return a>0&&(u=i===e?(t-r)/a:i===t?2+(r-e)/a:4+(e-t)/a,u*=60,u<0&&(u+=360)),{h:u,s,l:o}}__export$1(arithmetic_exports$1,{degrees2radians:()=>degrees2radians$1,inRange0to255:()=>inRange0to255$1,inRange0to255Rounded:()=>inRange0to255Rounded$1,intInRange:()=>intInRange$1,max3:()=>max3$1,min3:()=>min3$1,stableSort:()=>stableSort$1});var refX$1=.95047,refY$1=1,refZ$1=1.08883;function pivot$1(e){return e>.008856?e**(1/3):7.787*e+16/116}function xyz2lab$1(e,t,r){if(e=pivot$1(e/refX$1),t=pivot$1(t/refY$1),r=pivot$1(r/refZ$1),116*t-16<0)throw new Error("xxx");return{L:Math.max(0,116*t-16),a:500*(e-t),b:200*(t-r)}}function rgb2lab$1(e,t,r){const n=rgb2xyz$1(e,t,r);return xyz2lab$1(n.x,n.y,n.z)}var refX2$1=.95047,refY2$1=1,refZ2$1=1.08883;function pivot2$1(e){return e>.206893034?e**3:(e-16/116)/7.787}function lab2xyz$1(e,t,r){const n=(e+16)/116,i=n-r/200;return{x:refX2$1*pivot2$1(t/500+n),y:refY2$1*pivot2$1(n),z:refZ2$1*pivot2$1(i)}}function correctGamma2$1(e){return e>.0031308?1.055*e**(1/2.4)-.055:12.92*e}function xyz2rgb$1(e,t,r){const n=correctGamma2$1(3.2406*e+-1.5372*t+-.4986*r),i=correctGamma2$1(-.9689*e+1.8758*t+.0415*r),a=correctGamma2$1(.0557*e+-.204*t+1.057*r);return{r:inRange0to255Rounded$1(255*n),g:inRange0to255Rounded$1(255*i),b:inRange0to255Rounded$1(255*a)}}function lab2rgb$1(e,t,r){const n=lab2xyz$1(e,t,r);return xyz2rgb$1(n.x,n.y,n.z)}var distance_exports$1={};__export$1(distance_exports$1,{AbstractDistanceCalculator:()=>AbstractDistanceCalculator$1,AbstractEuclidean:()=>AbstractEuclidean$1,AbstractManhattan:()=>AbstractManhattan$1,CIE94GraphicArts:()=>CIE94GraphicArts$1,CIE94Textiles:()=>CIE94Textiles$1,CIEDE2000:()=>CIEDE2000$1,CMetric:()=>CMetric$1,Euclidean:()=>Euclidean$1,EuclideanBT709:()=>EuclideanBT709$1,EuclideanBT709NoAlpha:()=>EuclideanBT709NoAlpha$1,Manhattan:()=>Manhattan$1,ManhattanBT709:()=>ManhattanBT709$1,ManhattanNommyde:()=>ManhattanNommyde$1,PNGQuant:()=>PNGQuant$1});var AbstractDistanceCalculator$1=class{constructor(){__publicField$3(this,"_maxDistance"),__publicField$3(this,"_whitePoint"),this._setDefaults(),this.setWhitePoint(255,255,255,255)}setWhitePoint(e,t,r,n){this._whitePoint={r:e>0?255/e:0,g:t>0?255/t:0,b:r>0?255/r:0,a:n>0?255/n:0},this._maxDistance=this.calculateRaw(e,t,r,n,0,0,0,0)}calculateNormalized(e,t){return this.calculateRaw(e.r,e.g,e.b,e.a,t.r,t.g,t.b,t.a)/this._maxDistance}},AbstractCIE94$1=class extends AbstractDistanceCalculator$1{calculateRaw(e,t,r,n,i,a,o,s){const u=rgb2lab$1(inRange0to255$1(e*this._whitePoint.r),inRange0to255$1(t*this._whitePoint.g),inRange0to255$1(r*this._whitePoint.b)),l=rgb2lab$1(inRange0to255$1(i*this._whitePoint.r),inRange0to255$1(a*this._whitePoint.g),inRange0to255$1(o*this._whitePoint.b)),c=u.L-l.L,f=u.a-l.a,h=u.b-l.b,d=Math.sqrt(u.a*u.a+u.b*u.b),p=d-Math.sqrt(l.a*l.a+l.b*l.b);let m=f*f+h*h-p*p;m=m<0?0:Math.sqrt(m);const g=(s-n)*this._whitePoint.a*this._kA;return Math.sqrt((c/this._Kl)**2+(p/(1+this._K1*d))**2+(m/(1+this._K2*d))**2+g**2)}},CIE94Textiles$1=class extends AbstractCIE94$1{_setDefaults(){this._Kl=2,this._K1=.048,this._K2=.014,this._kA=12.5/255}},CIE94GraphicArts$1=class extends AbstractCIE94$1{_setDefaults(){this._Kl=1,this._K1=.045,this._K2=.015,this._kA=25/255}},_CIEDE2000$1=class extends AbstractDistanceCalculator$1{_setDefaults(){}static _calculatehp(e,t){const r=Math.atan2(e,t);return r>=0?r:r+_CIEDE2000$1._deg360InRad}static _calculateRT(e,t){const r=t**7,n=2*Math.sqrt(r/(r+_CIEDE2000$1._pow25to7)),i=_CIEDE2000$1._deg30InRad*Math.exp(-(((e-_CIEDE2000$1._deg275InRad)/_CIEDE2000$1._deg25InRad)**2));return-Math.sin(2*i)*n}static _calculateT(e){return 1-.17*Math.cos(e-_CIEDE2000$1._deg30InRad)+.24*Math.cos(2*e)+.32*Math.cos(3*e+_CIEDE2000$1._deg6InRad)-.2*Math.cos(4*e-_CIEDE2000$1._deg63InRad)}static _calculate_ahp(e,t,r,n){const i=r+n;return 0===e?i:t<=_CIEDE2000$1._deg180InRad?i/2:i<_CIEDE2000$1._deg360InRad?(i+_CIEDE2000$1._deg360InRad)/2:(i-_CIEDE2000$1._deg360InRad)/2}static _calculate_dHp(e,t,r,n){let i;return i=0===e?0:t<=_CIEDE2000$1._deg180InRad?r-n:r<=n?r-n+_CIEDE2000$1._deg360InRad:r-n-_CIEDE2000$1._deg360InRad,2*Math.sqrt(e)*Math.sin(i/2)}calculateRaw(e,t,r,n,i,a,o,s){const u=rgb2lab$1(inRange0to255$1(e*this._whitePoint.r),inRange0to255$1(t*this._whitePoint.g),inRange0to255$1(r*this._whitePoint.b)),l=rgb2lab$1(inRange0to255$1(i*this._whitePoint.r),inRange0to255$1(a*this._whitePoint.g),inRange0to255$1(o*this._whitePoint.b)),c=(s-n)*this._whitePoint.a*_CIEDE2000$1._kA,f=this.calculateRawInLab(u,l);return Math.sqrt(f+c*c)}calculateRawInLab(e,t){const r=e.L,n=e.a,i=e.b,a=t.L,o=t.a,s=t.b,u=((Math.sqrt(n*n+i*i)+Math.sqrt(o*o+s*s))/2)**7,l=.5*(1-Math.sqrt(u/(u+_CIEDE2000$1._pow25to7))),c=(1+l)*n,f=(1+l)*o,h=Math.sqrt(c*c+i*i),d=Math.sqrt(f*f+s*s),p=h*d,m=_CIEDE2000$1._calculatehp(i,c),g=_CIEDE2000$1._calculatehp(s,f),b=Math.abs(m-g),y=a-r,_=d-h,v=_CIEDE2000$1._calculate_dHp(p,b,g,m),w=_CIEDE2000$1._calculate_ahp(p,b,m,g),x=(h+d)/2,k=((r+a)/2-50)**2,B=_/(1+.045*x),E=v/(1+.015*_CIEDE2000$1._calculateT(w)*x);return(y/(1+.015*k/Math.sqrt(20+k)))**2+B**2+E**2+_CIEDE2000$1._calculateRT(w,x)*B*E}},CIEDE2000$1=_CIEDE2000$1;__publicField$3(CIEDE2000$1,"_kA",25/255),__publicField$3(CIEDE2000$1,"_pow25to7",25**7),__publicField$3(CIEDE2000$1,"_deg360InRad",degrees2radians$1(360)),__publicField$3(CIEDE2000$1,"_deg180InRad",degrees2radians$1(180)),__publicField$3(CIEDE2000$1,"_deg30InRad",degrees2radians$1(30)),__publicField$3(CIEDE2000$1,"_deg6InRad",degrees2radians$1(6)),__publicField$3(CIEDE2000$1,"_deg63InRad",degrees2radians$1(63)),__publicField$3(CIEDE2000$1,"_deg275InRad",degrees2radians$1(275)),__publicField$3(CIEDE2000$1,"_deg25InRad",degrees2radians$1(25));var CMetric$1=class extends AbstractDistanceCalculator$1{calculateRaw(e,t,r,n,i,a,o,s){const u=(e+i)/2*this._whitePoint.r,l=(e-i)*this._whitePoint.r,c=(t-a)*this._whitePoint.g,f=(r-o)*this._whitePoint.b,h=((512+u)*l*l>>8)+4*c*c+((767-u)*f*f>>8),d=(s-n)*this._whitePoint.a;return Math.sqrt(h+d*d)}_setDefaults(){}},AbstractEuclidean$1=class extends AbstractDistanceCalculator$1{calculateRaw(e,t,r,n,i,a,o,s){const u=i-e,l=a-t,c=o-r,f=s-n;return Math.sqrt(this._kR*u*u+this._kG*l*l+this._kB*c*c+this._kA*f*f)}},Euclidean$1=class extends AbstractEuclidean$1{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},EuclideanBT709$1=class extends AbstractEuclidean$1{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},EuclideanBT709NoAlpha$1=class extends AbstractEuclidean$1{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=0}},AbstractManhattan$1=class extends AbstractDistanceCalculator$1{calculateRaw(e,t,r,n,i,a,o,s){let u=i-e,l=a-t,c=o-r,f=s-n;return u<0&&(u=0-u),l<0&&(l=0-l),c<0&&(c=0-c),f<0&&(f=0-f),this._kR*u+this._kG*l+this._kB*c+this._kA*f}},Manhattan$1=class extends AbstractManhattan$1{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},ManhattanNommyde$1=class extends AbstractManhattan$1{_setDefaults(){this._kR=.4984,this._kG=.8625,this._kB=.2979,this._kA=1}},ManhattanBT709$1=class extends AbstractManhattan$1{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},PNGQuant$1=class extends AbstractDistanceCalculator$1{calculateRaw(e,t,r,n,i,a,o,s){const u=(s-n)*this._whitePoint.a;return this._colordifferenceCh(e*this._whitePoint.r,i*this._whitePoint.r,u)+this._colordifferenceCh(t*this._whitePoint.g,a*this._whitePoint.g,u)+this._colordifferenceCh(r*this._whitePoint.b,o*this._whitePoint.b,u)}_colordifferenceCh(e,t,r){const n=e-t,i=n+r;return n*n+i*i}_setDefaults(){}},palette_exports$1={};__export$1(palette_exports$1,{AbstractPaletteQuantizer:()=>AbstractPaletteQuantizer$1,ColorHistogram:()=>ColorHistogram$1,NeuQuant:()=>NeuQuant$1,NeuQuantFloat:()=>NeuQuantFloat$1,RGBQuant:()=>RGBQuant$1,WuColorCube:()=>WuColorCube$1,WuQuant:()=>WuQuant$1});var AbstractPaletteQuantizer$1=class{quantizeSync(){for(const e of this.quantize())if(e.palette)return e.palette;throw new Error("unreachable")}},Point$1=class{constructor(){__publicField$3(this,"r"),__publicField$3(this,"g"),__publicField$3(this,"b"),__publicField$3(this,"a"),__publicField$3(this,"uint32"),__publicField$3(this,"rgba"),this.uint32=-1>>>0,this.r=this.g=this.b=this.a=0,this.rgba=new Array(4),this.rgba[0]=0,this.rgba[1]=0,this.rgba[2]=0,this.rgba[3]=0}static createByQuadruplet(e){const t=new Point$1;return t.r=0|e[0],t.g=0|e[1],t.b=0|e[2],t.a=0|e[3],t._loadUINT32(),t._loadQuadruplet(),t}static createByRGBA(e,t,r,n){const i=new Point$1;return i.r=0|e,i.g=0|t,i.b=0|r,i.a=0|n,i._loadUINT32(),i._loadQuadruplet(),i}static createByUint32(e){const t=new Point$1;return t.uint32=e>>>0,t._loadRGBA(),t._loadQuadruplet(),t}from(e){this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this.uint32=e.uint32,this.rgba[0]=e.r,this.rgba[1]=e.g,this.rgba[2]=e.b,this.rgba[3]=e.a}getLuminosity(e){let t=this.r,r=this.g,n=this.b;return e&&(t=Math.min(255,255-this.a+this.a*t/255),r=Math.min(255,255-this.a+this.a*r/255),n=Math.min(255,255-this.a+this.a*n/255)),.2126*t+.7152*r+.0722*n}_loadUINT32(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0}_loadRGBA(){this.r=255&this.uint32,this.g=this.uint32>>>8&255,this.b=this.uint32>>>16&255,this.a=this.uint32>>>24&255}_loadQuadruplet(){this.rgba[0]=this.r,this.rgba[1]=this.g,this.rgba[2]=this.b,this.rgba[3]=this.a}},PointContainer$1=class{constructor(){__publicField$3(this,"_pointArray"),__publicField$3(this,"_width"),__publicField$3(this,"_height"),this._width=0,this._height=0,this._pointArray=[]}getWidth(){return this._width}getHeight(){return this._height}setWidth(e){this._width=e}setHeight(e){this._height=e}getPointArray(){return this._pointArray}clone(){const e=new PointContainer$1;e._width=this._width,e._height=this._height;for(let t=0,r=this._pointArray.length;t=i&&e=0;t--)if(e.uint32===this._pointArray[t].uint32)return!0;return!1}getNearestColor(e,t){return this._pointArray[0|this._getNearestIndex(e,t)]}getPointContainer(){return this._pointContainer}_nearestPointFromCache(e){return"number"==typeof this._i32idx[e]?this._i32idx[e]:-1}_getNearestIndex(e,t){let r=this._nearestPointFromCache(""+t.uint32);if(r>=0)return r;let n=Number.MAX_VALUE;r=0;for(let i=0,a=this._pointArray.length;i{const r=rgb2hsl$1(e.r,e.g,e.b),n=rgb2hsl$1(t.r,t.g,t.b),i=e.r===e.g&&e.g===e.b?0:1+hueGroup$1(r.h,hueGroups$1),a=(t.r===t.g&&t.g===t.b?0:1+hueGroup$1(n.h,hueGroups$1))-i;if(a)return-a;const o=e.getLuminosity(!0),s=t.getLuminosity(!0);if(s-o!=0)return s-o;const u=(100*n.s|0)-(100*r.s|0);return u?-u:0})}},utils_exports$1={};__export$1(utils_exports$1,{HueStatistics:()=>HueStatistics$1,Palette:()=>Palette$1,Point:()=>Point$1,PointContainer:()=>PointContainer$1,ProgressTracker:()=>ProgressTracker$1,arithmetic:()=>arithmetic_exports$1});var HueGroup$1=class{constructor(){__publicField$3(this,"num",0),__publicField$3(this,"cols",[])}},HueStatistics$1=class{constructor(e,t){__publicField$3(this,"_numGroups"),__publicField$3(this,"_minCols"),__publicField$3(this,"_stats"),__publicField$3(this,"_groupsFull"),this._numGroups=e,this._minCols=t,this._stats=[];for(let t=0;t<=e;t++)this._stats[t]=new HueGroup$1;this._groupsFull=0}check(e){this._groupsFull===this._numGroups+1&&(this.check=()=>{});const t=255&e,r=e>>>8&255,n=e>>>16&255,i=t===r&&r===n?0:1+hueGroup$1(rgb2hsl$1(t,r,n).h,this._numGroups),a=this._stats[i],o=this._minCols;a.num++,a.num>o||(a.num===o&&this._groupsFull++,a.num<=o&&this._stats[i].cols.push(e))}injectIntoDictionary(e){for(let t=0;t<=this._numGroups;t++)this._stats[t].num<=this._minCols&&this._stats[t].cols.forEach(t=>{e[t]?e[t]++:e[t]=1})}injectIntoArray(e){for(let t=0;t<=this._numGroups;t++)this._stats[t].num<=this._minCols&&this._stats[t].cols.forEach(t=>{-1===e.indexOf(t)&&e.push(t)})}},_ProgressTracker$1=class{constructor(e,t){__publicField$3(this,"progress"),__publicField$3(this,"_step"),__publicField$3(this,"_range"),__publicField$3(this,"_last"),__publicField$3(this,"_progressRange"),this._range=e,this._progressRange=t,this._step=Math.max(1,this._range/(_ProgressTracker$1.steps+1)|0),this._last=-this._step,this.progress=0}shouldNotify(e){return e-this._last>=this._step&&(this._last=e,this.progress=Math.min(this._progressRange*this._last/this._range,this._progressRange),!0)}},ProgressTracker$1=_ProgressTracker$1;__publicField$3(ProgressTracker$1,"steps",100);var networkBiasShift$1=3,Neuron$1=class{constructor(e){__publicField$3(this,"r"),__publicField$3(this,"g"),__publicField$3(this,"b"),__publicField$3(this,"a"),this.r=this.g=this.b=this.a=e}toPoint(){return Point$1.createByRGBA(this.r>>networkBiasShift$1,this.g>>networkBiasShift$1,this.b>>networkBiasShift$1,this.a>>networkBiasShift$1)}subtract(e,t,r,n){this.r-=0|e,this.g-=0|t,this.b-=0|r,this.a-=0|n}},_NeuQuant$1=class extends AbstractPaletteQuantizer$1{constructor(e,t=256){super(),__publicField$3(this,"_pointArray"),__publicField$3(this,"_networkSize"),__publicField$3(this,"_network"),__publicField$3(this,"_sampleFactor"),__publicField$3(this,"_radPower"),__publicField$3(this,"_freq"),__publicField$3(this,"_bias"),__publicField$3(this,"_distance"),this._distance=e,this._pointArray=[],this._sampleFactor=1,this._networkSize=t,this._distance.setWhitePoint(255<>3)*_NeuQuant$1._radiusBias,u=s>>_NeuQuant$1._radiusBiasShift;u<=1&&(u=0);for(let e=0;e>>0;i=t<_NeuQuant$1._minpicturebytes?1:t%_NeuQuant$1._prime1!=0?_NeuQuant$1._prime1:t%_NeuQuant$1._prime2!=0?_NeuQuant$1._prime2:t%_NeuQuant$1._prime3!=0?_NeuQuant$1._prime3:_NeuQuant$1._prime4;const l=new ProgressTracker$1(n,99);for(let e=0,c=0;e=t&&(c-=t),e++,0===a&&(a=1),e%a==0){o-=o/r|0,s-=s/_NeuQuant$1._radiusDecrease|0,u=s>>_NeuQuant$1._radiusBiasShift,u<=1&&(u=0);for(let e=0;e>>0}}}_buildPalette(){const e=new Palette$1;return this._network.forEach(t=>{e.add(t.toPoint())}),e.sort(),e}_alterNeighbour(e,t,r,n,i,a){let o=t-e;o<-1&&(o=-1);let s=t+e;s>this._networkSize&&(s=this._networkSize);let u=t+1,l=t-1,c=1;for(;uo;){const e=this._radPower[c++]/_NeuQuant$1._alphaRadBias;if(uo){const t=this._network[l--];t.subtract(e*(t.r-i),e*(t.g-n),e*(t.b-r),e*(t.a-a))}}}_alterSingle(e,t,r,n,i,a){e/=_NeuQuant$1._initAlpha;const o=this._network[t];o.subtract(e*(o.r-i),e*(o.g-n),e*(o.b-r),e*(o.a-a))}_contest(e,t,r,n){const i=1020<>_NeuQuant$1._initialBiasShift-networkBiasShift$1);h>_NeuQuant$1._betaShift;this._freq[l]-=d,this._bias[l]+=d<<_NeuQuant$1._gammaShift}return this._freq[s]+=_NeuQuant$1._beta,this._bias[s]-=_NeuQuant$1._betaGamma,u}},NeuQuant$1=_NeuQuant$1;__publicField$3(NeuQuant$1,"_prime1",499),__publicField$3(NeuQuant$1,"_prime2",491),__publicField$3(NeuQuant$1,"_prime3",487),__publicField$3(NeuQuant$1,"_prime4",503),__publicField$3(NeuQuant$1,"_minpicturebytes",_NeuQuant$1._prime4),__publicField$3(NeuQuant$1,"_nCycles",100),__publicField$3(NeuQuant$1,"_initialBiasShift",16),__publicField$3(NeuQuant$1,"_initialBias",1<<_NeuQuant$1._initialBiasShift),__publicField$3(NeuQuant$1,"_gammaShift",10),__publicField$3(NeuQuant$1,"_betaShift",10),__publicField$3(NeuQuant$1,"_beta",_NeuQuant$1._initialBias>>_NeuQuant$1._betaShift),__publicField$3(NeuQuant$1,"_betaGamma",_NeuQuant$1._initialBias<<_NeuQuant$1._gammaShift-_NeuQuant$1._betaShift),__publicField$3(NeuQuant$1,"_radiusBiasShift",6),__publicField$3(NeuQuant$1,"_radiusBias",1<<_NeuQuant$1._radiusBiasShift),__publicField$3(NeuQuant$1,"_radiusDecrease",30),__publicField$3(NeuQuant$1,"_alphaBiasShift",10),__publicField$3(NeuQuant$1,"_initAlpha",1<<_NeuQuant$1._alphaBiasShift),__publicField$3(NeuQuant$1,"_radBiasShift",8),__publicField$3(NeuQuant$1,"_radBias",1<<_NeuQuant$1._radBiasShift),__publicField$3(NeuQuant$1,"_alphaRadBiasShift",_NeuQuant$1._alphaBiasShift+_NeuQuant$1._radBiasShift),__publicField$3(NeuQuant$1,"_alphaRadBias",1<<_NeuQuant$1._alphaRadBiasShift);var networkBiasShift2$1=3,NeuronFloat$1=class{constructor(e){__publicField$3(this,"r"),__publicField$3(this,"g"),__publicField$3(this,"b"),__publicField$3(this,"a"),this.r=this.g=this.b=this.a=e}toPoint(){return Point$1.createByRGBA(this.r>>networkBiasShift2$1,this.g>>networkBiasShift2$1,this.b>>networkBiasShift2$1,this.a>>networkBiasShift2$1)}subtract(e,t,r,n){this.r-=e,this.g-=t,this.b-=r,this.a-=n}},_NeuQuantFloat$1=class extends AbstractPaletteQuantizer$1{constructor(e,t=256){super(),__publicField$3(this,"_pointArray"),__publicField$3(this,"_networkSize"),__publicField$3(this,"_network"),__publicField$3(this,"_sampleFactor"),__publicField$3(this,"_radPower"),__publicField$3(this,"_freq"),__publicField$3(this,"_bias"),__publicField$3(this,"_distance"),this._distance=e,this._pointArray=[],this._sampleFactor=1,this._networkSize=t,this._distance.setWhitePoint(255<>3)*_NeuQuantFloat$1._radiusBias,u=s>>_NeuQuantFloat$1._radiusBiasShift;u<=1&&(u=0);for(let e=0;e=t&&(c-=t),e++,0===a&&(a=1),e%a==0){o-=o/r,s-=s/_NeuQuantFloat$1._radiusDecrease,u=s>>_NeuQuantFloat$1._radiusBiasShift,u<=1&&(u=0);for(let e=0;e{e.add(t.toPoint())}),e.sort(),e}_alterNeighbour(e,t,r,n,i,a){let o=t-e;o<-1&&(o=-1);let s=t+e;s>this._networkSize&&(s=this._networkSize);let u=t+1,l=t-1,c=1;for(;uo;){const e=this._radPower[c++]/_NeuQuantFloat$1._alphaRadBias;if(uo){const t=this._network[l--];t.subtract(e*(t.r-i),e*(t.g-n),e*(t.b-r),e*(t.a-a))}}}_alterSingle(e,t,r,n,i,a){e/=_NeuQuantFloat$1._initAlpha;const o=this._network[t];o.subtract(e*(o.r-i),e*(o.g-n),e*(o.b-r),e*(o.a-a))}_contest(e,t,r,n){const i=1020<>_NeuQuantFloat$1._initialBiasShift-networkBiasShift2$1);h>_NeuQuantFloat$1._betaShift;this._freq[l]-=d,this._bias[l]+=d<<_NeuQuantFloat$1._gammaShift}return this._freq[s]+=_NeuQuantFloat$1._beta,this._bias[s]-=_NeuQuantFloat$1._betaGamma,u}},NeuQuantFloat$1=_NeuQuantFloat$1;__publicField$3(NeuQuantFloat$1,"_prime1",499),__publicField$3(NeuQuantFloat$1,"_prime2",491),__publicField$3(NeuQuantFloat$1,"_prime3",487),__publicField$3(NeuQuantFloat$1,"_prime4",503),__publicField$3(NeuQuantFloat$1,"_minpicturebytes",_NeuQuantFloat$1._prime4),__publicField$3(NeuQuantFloat$1,"_nCycles",100),__publicField$3(NeuQuantFloat$1,"_initialBiasShift",16),__publicField$3(NeuQuantFloat$1,"_initialBias",1<<_NeuQuantFloat$1._initialBiasShift),__publicField$3(NeuQuantFloat$1,"_gammaShift",10),__publicField$3(NeuQuantFloat$1,"_betaShift",10),__publicField$3(NeuQuantFloat$1,"_beta",_NeuQuantFloat$1._initialBias>>_NeuQuantFloat$1._betaShift),__publicField$3(NeuQuantFloat$1,"_betaGamma",_NeuQuantFloat$1._initialBias<<_NeuQuantFloat$1._gammaShift-_NeuQuantFloat$1._betaShift),__publicField$3(NeuQuantFloat$1,"_radiusBiasShift",6),__publicField$3(NeuQuantFloat$1,"_radiusBias",1<<_NeuQuantFloat$1._radiusBiasShift),__publicField$3(NeuQuantFloat$1,"_radiusDecrease",30),__publicField$3(NeuQuantFloat$1,"_alphaBiasShift",10),__publicField$3(NeuQuantFloat$1,"_initAlpha",1<<_NeuQuantFloat$1._alphaBiasShift),__publicField$3(NeuQuantFloat$1,"_radBiasShift",8),__publicField$3(NeuQuantFloat$1,"_radBias",1<<_NeuQuantFloat$1._radBiasShift),__publicField$3(NeuQuantFloat$1,"_alphaRadBiasShift",_NeuQuantFloat$1._alphaBiasShift+_NeuQuantFloat$1._radBiasShift),__publicField$3(NeuQuantFloat$1,"_alphaRadBias",1<<_NeuQuantFloat$1._alphaRadBiasShift);var _ColorHistogram$1=class{constructor(e,t){__publicField$3(this,"_method"),__publicField$3(this,"_hueStats"),__publicField$3(this,"_histogram"),__publicField$3(this,"_initColors"),__publicField$3(this,"_minHueCols"),this._method=e,this._minHueCols=t<<2,this._initColors=t<<2,this._hueStats=new HueStatistics$1(_ColorHistogram$1._hueGroups,this._minHueCols),this._histogram=Object.create(null)}sample(e){switch(this._method){case 1:this._colorStats1D(e);break;case 2:this._colorStats2D(e)}}getImportanceSortedColorsIDXI32(){const e=stableSort$1(Object.keys(this._histogram),(e,t)=>this._histogram[t]-this._histogram[e]);if(0===e.length)return[];let t;switch(this._method){case 1:const r=Math.min(e.length,this._initColors),n=e[r-1],i=this._histogram[n];t=e.slice(0,r);let a=r;const o=e.length;for(;a+e)}_colorStats1D(e){const t=this._histogram,r=e.getPointArray(),n=r.length;for(let e=0;e{let r=Math.round(e.w*e.h/o)*_ColorHistogram$1._boxPixels;r<2&&(r=2);const i={};this._iterateBox(e,t,e=>{const t=n[e].uint32;this._hueStats.check(t),t in u?u[t]++:t in i?++i[t]>=r&&(u[t]=i[t]):i[t]=1})}),this._hueStats.injectIntoDictionary(u)}_iterateBox(e,t,r){const n=e,i=n.y*t+n.x,a=(n.y+n.h-1)*t+(n.x+n.w-1),o=t-n.w+1;let s=0,u=i;do{r.call(this,u),u+=++s%n.w==0?o:1}while(u<=a)}_makeBoxes(e,t,r,n){const i=e%r,a=t%n,o=e-i,s=t-a,u=[];for(let l=0;lthis._colors;){a.length=0;for(let e=0;e3*this._colors?this._initialDistance:this._distanceIncrement}if(ot.distance-e.distance);let e=0;for(;o=0;e--)0===n[e]&&(e!==l-1&&(r[e]=r[l-1]),--l);r.length=l,t.sort(),yield{palette:t,progress:100}}};function createArray1D$1(e){const t=[];for(let r=0;r0){const r=this._sums[t],n=this._reds[t]/r,i=this._greens[t]/r,a=this._blues[t]/r,o=this._alphas[t]/r,s=Point$1.createByRGBA(0|n,0|i,0|a,0|o);e.add(s)}e.sort(),yield{palette:e,progress:100}}*_preparePalette(){yield*this._calculateMoments();let e=0;const t=createArray1D$1(this._colors);for(let r=1;r1?this._calculateVariance(this._cubes[e]):0,t[r]=this._cubes[r].volume>1?this._calculateVariance(this._cubes[r]):0):(t[e]=0,r--),e=0;let n=t[0];for(let i=1;i<=r;++i)t[i]>n&&(n=t[i],e=i);if(n<=0){this._colors=r+1;break}}const r=[],n=[],i=[],a=[];for(let e=0;e0?(r[e]=_WuQuant$1._volume(this._cubes[e],this._momentsRed)/t|0,n[e]=_WuQuant$1._volume(this._cubes[e],this._momentsGreen)/t|0,i[e]=_WuQuant$1._volume(this._cubes[e],this._momentsBlue)/t|0,a[e]=_WuQuant$1._volume(this._cubes[e],this._momentsAlpha)/t|0):(r[e]=0,n[e]=0,i[e]=0,a[e]=0)}this._reds=createArray1D$1(this._colors+1),this._greens=createArray1D$1(this._colors+1),this._blues=createArray1D$1(this._colors+1),this._alphas=createArray1D$1(this._colors+1),this._sums=createArray1D$1(this._colors+1);for(let e=0,t=this._pixels.length;e>t),n=1+(e.g>>t),i=1+(e.b>>t),a=1+(e.a>>t);this._weights[a][r][n][i]++,this._momentsRed[a][r][n][i]+=e.r,this._momentsGreen[a][r][n][i]+=e.g,this._momentsBlue[a][r][n][i]+=e.b,this._momentsAlpha[a][r][n][i]+=e.a,this._moments[a][r][n][i]+=this._table[e.r]+this._table[e.g]+this._table[e.b]+this._table[e.a]}*_calculateMoments(){const e=[],t=[],r=[],n=[],i=[],a=[],o=createArray3D$1(this._sideSize,this._sideSize,this._sideSize),s=createArray3D$1(this._sideSize,this._sideSize,this._sideSize),u=createArray3D$1(this._sideSize,this._sideSize,this._sideSize),l=createArray3D$1(this._sideSize,this._sideSize,this._sideSize),c=createArray3D$1(this._sideSize,this._sideSize,this._sideSize),f=createArray3D$1(this._sideSize,this._sideSize,this._sideSize);let h=0;const d=new ProgressTracker$1(this._alphaMaxSideIndex*this._maxSideIndex,99);for(let p=1;p<=this._alphaMaxSideIndex;++p){fillArray3D$1(o,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D$1(s,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D$1(u,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D$1(l,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D$1(c,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D$1(f,this._sideSize,this._sideSize,this._sideSize,0);for(let m=1;m<=this._maxSideIndex;++m,++h){d.shouldNotify(h)&&(yield{progress:d.progress}),fillArray1D$1(e,this._sideSize,0),fillArray1D$1(t,this._sideSize,0),fillArray1D$1(r,this._sideSize,0),fillArray1D$1(n,this._sideSize,0),fillArray1D$1(i,this._sideSize,0),fillArray1D$1(a,this._sideSize,0);for(let h=1;h<=this._maxSideIndex;++h){let d=0,g=0,b=0,y=0,_=0,v=0;for(let w=1;w<=this._maxSideIndex;++w)d+=this._weights[p][m][h][w],g+=this._momentsRed[p][m][h][w],b+=this._momentsGreen[p][m][h][w],y+=this._momentsBlue[p][m][h][w],_+=this._momentsAlpha[p][m][h][w],v+=this._moments[p][m][h][w],e[w]+=d,t[w]+=g,r[w]+=b,n[w]+=y,i[w]+=_,a[w]+=v,o[m][h][w]=o[m-1][h][w]+e[w],s[m][h][w]=s[m-1][h][w]+t[w],u[m][h][w]=u[m-1][h][w]+r[w],l[m][h][w]=l[m-1][h][w]+n[w],c[m][h][w]=c[m-1][h][w]+i[w],f[m][h][w]=f[m-1][h][w]+a[w],this._weights[p][m][h][w]=this._weights[p-1][m][h][w]+o[m][h][w],this._momentsRed[p][m][h][w]=this._momentsRed[p-1][m][h][w]+s[m][h][w],this._momentsGreen[p][m][h][w]=this._momentsGreen[p-1][m][h][w]+u[m][h][w],this._momentsBlue[p][m][h][w]=this._momentsBlue[p-1][m][h][w]+l[m][h][w],this._momentsAlpha[p][m][h][w]=this._momentsAlpha[p-1][m][h][w]+c[m][h][w],this._moments[p][m][h][w]=this._moments[p-1][m][h][w]+f[m][h][w]}}}}static _volumeFloat(e,t){return t[e.alphaMaximum][e.redMaximum][e.greenMaximum][e.blueMaximum]-t[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMaximum]-t[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMaximum]+t[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]-t[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMaximum]+t[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]+t[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-t[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(t[e.alphaMaximum][e.redMaximum][e.greenMaximum][e.blueMinimum]-t[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]-t[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+t[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]-t[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]+t[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]+t[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]-t[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum])}static _volume(e,t){return 0|_WuQuant$1._volumeFloat(e,t)}static _top(e,t,r,n){let i;switch(t){case _WuQuant$1._alpha:i=n[r][e.redMaximum][e.greenMaximum][e.blueMaximum]-n[r][e.redMaximum][e.greenMinimum][e.blueMaximum]-n[r][e.redMinimum][e.greenMaximum][e.blueMaximum]+n[r][e.redMinimum][e.greenMinimum][e.blueMaximum]-(n[r][e.redMaximum][e.greenMaximum][e.blueMinimum]-n[r][e.redMaximum][e.greenMinimum][e.blueMinimum]-n[r][e.redMinimum][e.greenMaximum][e.blueMinimum]+n[r][e.redMinimum][e.greenMinimum][e.blueMinimum]);break;case _WuQuant$1._red:i=n[e.alphaMaximum][r][e.greenMaximum][e.blueMaximum]-n[e.alphaMaximum][r][e.greenMinimum][e.blueMaximum]-n[e.alphaMinimum][r][e.greenMaximum][e.blueMaximum]+n[e.alphaMinimum][r][e.greenMinimum][e.blueMaximum]-(n[e.alphaMaximum][r][e.greenMaximum][e.blueMinimum]-n[e.alphaMaximum][r][e.greenMinimum][e.blueMinimum]-n[e.alphaMinimum][r][e.greenMaximum][e.blueMinimum]+n[e.alphaMinimum][r][e.greenMinimum][e.blueMinimum]);break;case _WuQuant$1._green:i=n[e.alphaMaximum][e.redMaximum][r][e.blueMaximum]-n[e.alphaMaximum][e.redMinimum][r][e.blueMaximum]-n[e.alphaMinimum][e.redMaximum][r][e.blueMaximum]+n[e.alphaMinimum][e.redMinimum][r][e.blueMaximum]-(n[e.alphaMaximum][e.redMaximum][r][e.blueMinimum]-n[e.alphaMaximum][e.redMinimum][r][e.blueMinimum]-n[e.alphaMinimum][e.redMaximum][r][e.blueMinimum]+n[e.alphaMinimum][e.redMinimum][r][e.blueMinimum]);break;case _WuQuant$1._blue:i=n[e.alphaMaximum][e.redMaximum][e.greenMaximum][r]-n[e.alphaMaximum][e.redMaximum][e.greenMinimum][r]-n[e.alphaMaximum][e.redMinimum][e.greenMaximum][r]+n[e.alphaMaximum][e.redMinimum][e.greenMinimum][r]-(n[e.alphaMinimum][e.redMaximum][e.greenMaximum][r]-n[e.alphaMinimum][e.redMaximum][e.greenMinimum][r]-n[e.alphaMinimum][e.redMinimum][e.greenMaximum][r]+n[e.alphaMinimum][e.redMinimum][e.greenMinimum][r]);break;default:throw new Error("impossible")}return 0|i}static _bottom(e,t,r){switch(t){case _WuQuant$1._alpha:return-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMaximum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case _WuQuant$1._red:return-r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMaximum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case _WuQuant$1._green:return-r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMaximum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case _WuQuant$1._blue:return-r[e.alphaMaximum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]-(-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);default:return 0}}_calculateVariance(e){const t=_WuQuant$1._volume(e,this._momentsRed),r=_WuQuant$1._volume(e,this._momentsGreen),n=_WuQuant$1._volume(e,this._momentsBlue),i=_WuQuant$1._volume(e,this._momentsAlpha);return _WuQuant$1._volumeFloat(e,this._moments)-(t*t+r*r+n*n+i*i)/_WuQuant$1._volume(e,this._weights)}_maximize(e,t,r,n,i,a,o,s,u){const l=0|_WuQuant$1._bottom(e,t,this._momentsRed),c=0|_WuQuant$1._bottom(e,t,this._momentsGreen),f=0|_WuQuant$1._bottom(e,t,this._momentsBlue),h=0|_WuQuant$1._bottom(e,t,this._momentsAlpha),d=0|_WuQuant$1._bottom(e,t,this._weights);let p=0,m=-1;for(let g=r;gp&&(p=t,m=g))}}return{max:p,position:m}}_cut(e,t){let r;const n=_WuQuant$1._volume(e,this._momentsRed),i=_WuQuant$1._volume(e,this._momentsGreen),a=_WuQuant$1._volume(e,this._momentsBlue),o=_WuQuant$1._volume(e,this._momentsAlpha),s=_WuQuant$1._volume(e,this._weights),u=this._maximize(e,_WuQuant$1._red,e.redMinimum+1,e.redMaximum,n,i,a,o,s),l=this._maximize(e,_WuQuant$1._green,e.greenMinimum+1,e.greenMaximum,n,i,a,o,s),c=this._maximize(e,_WuQuant$1._blue,e.blueMinimum+1,e.blueMaximum,n,i,a,o,s),f=this._maximize(e,_WuQuant$1._alpha,e.alphaMinimum+1,e.alphaMaximum,n,i,a,o,s);if(f.max>=u.max&&f.max>=l.max&&f.max>=c.max){if(r=_WuQuant$1._alpha,f.position<0)return!1}else r=u.max>=f.max&&u.max>=l.max&&u.max>=c.max?_WuQuant$1._red:l.max>=f.max&&l.max>=u.max&&l.max>=c.max?_WuQuant$1._green:_WuQuant$1._blue;switch(t.redMaximum=e.redMaximum,t.greenMaximum=e.greenMaximum,t.blueMaximum=e.blueMaximum,t.alphaMaximum=e.alphaMaximum,r){case _WuQuant$1._red:t.redMinimum=e.redMaximum=u.position,t.greenMinimum=e.greenMinimum,t.blueMinimum=e.blueMinimum,t.alphaMinimum=e.alphaMinimum;break;case _WuQuant$1._green:t.greenMinimum=e.greenMaximum=l.position,t.redMinimum=e.redMinimum,t.blueMinimum=e.blueMinimum,t.alphaMinimum=e.alphaMinimum;break;case _WuQuant$1._blue:t.blueMinimum=e.blueMaximum=c.position,t.redMinimum=e.redMinimum,t.greenMinimum=e.greenMinimum,t.alphaMinimum=e.alphaMinimum;break;case _WuQuant$1._alpha:t.alphaMinimum=e.alphaMaximum=f.position,t.blueMinimum=e.blueMinimum,t.redMinimum=e.redMinimum,t.greenMinimum=e.greenMinimum}return e.volume=(e.redMaximum-e.redMinimum)*(e.greenMaximum-e.greenMinimum)*(e.blueMaximum-e.blueMinimum)*(e.alphaMaximum-e.alphaMinimum),t.volume=(t.redMaximum-t.redMinimum)*(t.greenMaximum-t.greenMinimum)*(t.blueMaximum-t.blueMinimum)*(t.alphaMaximum-t.alphaMinimum),!0}_initialize(e){this._colors=e,this._cubes=[];for(let t=0;tAbstractImageQuantizer$1,ErrorDiffusionArray:()=>ErrorDiffusionArray$1,ErrorDiffusionArrayKernel:()=>ErrorDiffusionArrayKernel$1,ErrorDiffusionRiemersma:()=>ErrorDiffusionRiemersma$1,NearestColor:()=>NearestColor$1});var AbstractImageQuantizer$1=class{quantizeSync(e,t){for(const r of this.quantize(e,t))if(r.pointContainer)return r.pointContainer;throw new Error("unreachable")}},NearestColor$1=class extends AbstractImageQuantizer$1{constructor(e){super(),__publicField$3(this,"_distance"),this._distance=e}*quantize(e,t){const r=e.getPointArray(),n=e.getWidth(),i=e.getHeight(),a=new ProgressTracker$1(i,99);for(let e=0;e(e[e.FloydSteinberg=0]="FloydSteinberg",e[e.FalseFloydSteinberg=1]="FalseFloydSteinberg",e[e.Stucki=2]="Stucki",e[e.Atkinson=3]="Atkinson",e[e.Jarvis=4]="Jarvis",e[e.Burkes=5]="Burkes",e[e.Sierra=6]="Sierra",e[e.TwoSierra=7]="TwoSierra",e[e.SierraLite=8]="SierraLite",e))(ErrorDiffusionArrayKernel$1||{}),ErrorDiffusionArray$1=class extends AbstractImageQuantizer$1{constructor(e,t,r=!0,n=0,i=!1){super(),__publicField$3(this,"_minColorDistance"),__publicField$3(this,"_serpentine"),__publicField$3(this,"_kernel"),__publicField$3(this,"_calculateErrorLikeGIMP"),__publicField$3(this,"_distance"),this._setKernel(t),this._distance=e,this._minColorDistance=n,this._serpentine=r,this._calculateErrorLikeGIMP=i}*quantize(e,t){const r=e.getPointArray(),n=new Point$1,i=e.getWidth(),a=e.getHeight(),o=[];let s=1,u=1;for(const e of this._kernel){const t=e[2]+1;u=0&&r+l=0&&n+et&&(e.length=t);const r=e.length;for(let t=0;t=0&&e.x=0&&e.y{const s=r[e+i*n];let{r:u,g:l,b:c,a:f}=s;for(let e=0;essim$1});var K1$1=.01,K2$1=.03;function ssim$1(e,t){if(e.getHeight()!==t.getHeight()||e.getWidth()!==t.getWidth())throw new Error("Images have different sizes!");const r=(255*K1$1)**2,n=(255*K2$1)**2;let i=0,a=0;return iterate$1(e,t,(e,t,o,s)=>{let u=0,l=0,c=0;for(let r=0;rprocess.nextTick(e):e=>setTimeout(e,0);function buildPaletteSync$1(e,{colorDistanceFormula:t,paletteQuantization:r,colors:n}={}){const i=paletteQuantizationToPaletteQuantizer$1(colorDistanceFormulaToColorDistance$1(t),r,n);return e.forEach(e=>i.sample(e)),i.quantizeSync()}async function buildPalette(e,{colorDistanceFormula:t,paletteQuantization:r,colors:n,onProgress:i}={}){return new Promise((a,o)=>{const s=paletteQuantizationToPaletteQuantizer$1(colorDistanceFormulaToColorDistance$1(t),r,n);let u;e.forEach(e=>s.sample(e));const l=s.quantize(),c=()=>{try{const e=l.next();e.done?a(u):(e.value.palette&&(u=e.value.palette),i&&i(e.value.progress),setImmediateImpl(c))}catch(e){o(e)}};setImmediateImpl(c)})}function applyPaletteSync$1(e,t,{colorDistanceFormula:r,imageQuantization:n}={}){return imageQuantizationToImageQuantizer$1(colorDistanceFormulaToColorDistance$1(r),n).quantizeSync(e,t)}async function applyPalette(e,t,{colorDistanceFormula:r,imageQuantization:n,onProgress:i}={}){return new Promise((a,o)=>{let s;const u=imageQuantizationToImageQuantizer$1(colorDistanceFormulaToColorDistance$1(r),n).quantize(e,t),l=()=>{try{const e=u.next();e.done?a(s):(e.value.pointContainer&&(s=e.value.pointContainer),i&&i(e.value.progress),setImmediateImpl(l))}catch(e){o(e)}};setImmediateImpl(l)})}function colorDistanceFormulaToColorDistance$1(e="euclidean-bt709"){switch(e){case"cie94-graphic-arts":return new CIE94GraphicArts$1;case"cie94-textiles":return new CIE94Textiles$1;case"ciede2000":return new CIEDE2000$1;case"color-metric":return new CMetric$1;case"euclidean":return new Euclidean$1;case"euclidean-bt709":return new EuclideanBT709$1;case"euclidean-bt709-noalpha":return new EuclideanBT709NoAlpha$1;case"manhattan":return new Manhattan$1;case"manhattan-bt709":return new ManhattanBT709$1;case"manhattan-nommyde":return new ManhattanNommyde$1;case"pngquant":return new PNGQuant$1;default:throw new Error(`Unknown colorDistanceFormula ${e}`)}}function imageQuantizationToImageQuantizer$1(e,t="floyd-steinberg"){switch(t){case"nearest":return new NearestColor$1(e);case"riemersma":return new ErrorDiffusionRiemersma$1(e);case"floyd-steinberg":return new ErrorDiffusionArray$1(e,0);case"false-floyd-steinberg":return new ErrorDiffusionArray$1(e,1);case"stucki":return new ErrorDiffusionArray$1(e,2);case"atkinson":return new ErrorDiffusionArray$1(e,3);case"jarvis":return new ErrorDiffusionArray$1(e,4);case"burkes":return new ErrorDiffusionArray$1(e,5);case"sierra":return new ErrorDiffusionArray$1(e,6);case"two-sierra":return new ErrorDiffusionArray$1(e,7);case"sierra-lite":return new ErrorDiffusionArray$1(e,8);default:throw new Error(`Unknown imageQuantization ${t}`)}}function paletteQuantizationToPaletteQuantizer$1(e,t="wuquant",r=256){switch(t){case"neuquant":return new NeuQuant$1(e,r);case"rgbquant":return new RGBQuant$1(e,r);case"wuquant":return new WuQuant$1(e,r);case"neuquant-float":return new NeuQuantFloat$1(e,r);default:throw new Error(`Unknown paletteQuantization ${t}`)}}var imageQ=__toCommonJS(src_exports),gifframe={};const BitmapImage$1=bitmapimage;let GifFrame$1=class e extends BitmapImage$1{constructor(...t){if(super(...t),t[0]instanceof e){const e=t[0];this.xOffset=e.xOffset,this.yOffset=e.yOffset,this.disposalMethod=e.disposalMethod,this.delayCentisecs=e.delayCentisecs,this.interlaced=e.interlaced}else{const r=t[t.length-1];let n={};"object"!=typeof r||r instanceof BitmapImage$1||(n=r),this.xOffset=n.xOffset||0,this.yOffset=n.yOffset||0,this.disposalMethod=void 0!==n.disposalMethod?n.disposalMethod:e.DisposeToBackgroundColor,this.delayCentisecs=n.delayCentisecs||8,this.interlaced=n.interlaced||!1}}getPalette(){const e=new Set,t=this.bitmap.data;let r=0,n=!1;for(;r>8&16777215;e.add(n)}r+=4}const i=new Array(e.size),a=e.values();for(r=0;re-t);let o=i.length;return n&&++o,{colors:i,usesTransparency:n,indexCount:o}}};var hasRequiredGifutil,hasRequiredGifcodec;function requireGifutil(){return hasRequiredGifutil||(hasRequiredGifutil=1,function(e){const t=require$$0,r=imageQ,n=bitmapimage,{GifFrame:i}=gifframe,{GifError:a}=gif$1,{GifCodec:o}=requireGifcodec(),s=[".jpg",".jpeg",".png",".bmp"],u=new o;function l(e,t,n,i,a){const o=Array.isArray(e)?e:[e];if(a){if(["FloydSteinberg","FalseFloydSteinberg","Stucki","Atkinson","Jarvis","Burkes","Sierra","TwoSierra","SierraLite"].indexOf(a.ditherAlgorithm)<0)throw new Error(`Invalid ditherAlgorithm '${a.ditherAlgorithm}'`);void 0===a.serpentine&&(a.serpentine=!0),void 0===a.minimumColorDistanceToDither&&(a.minimumColorDistanceToDither=0),void 0===a.calculateErrorLikeGIMP&&(a.calculateErrorLikeGIMP=!1)}const s=new r.distance.Euclidean,u=new r.palette[t](s,n,i);let l;l=a?new r.image.ErrorDiffusionArray(s,r.image.ErrorDiffusionArrayKernel[a.ditherAlgorithm],a.serpentine,a.minimumColorDistanceToDither,a.calculateErrorLikeGIMP):new r.image.NearestColor(s);const c=[];o.forEach(e=>{const t=e.bitmap.data,n=new ArrayBuffer(t.length),i=new Uint32Array(n);for(let e=0,r=0;e{t.push(new i(e))}),t},e.getColorInfo=function(e,t){let r=!1;const n=[];for(let t=0;t256)throw new a(`Frame ${t} uses more than 256 color indexes`);n.push(i)}if(0===t)return{usesTransparency:r,palettes:n};const i=new Set;n.forEach(e=>{e.colors.forEach(e=>{i.add(e)})});let o=i.size;if(r&&++o,t&&o>t)return{usesTransparency:r,palettes:n};const s=new Array(i.size),u=i.values();for(let e=0;ee-t),{colors:s,indexCount:o,usesTransparency:r,palettes:n}},e.copyAsJimp=function(t,r){return e.shareAsJimp(t,new n(r))},e.getMaxDimensions=function(e){let t=0,r=0;return e.forEach(e=>{const n=e.xOffset+e.bitmap.width;n>t&&(t=n);const i=e.yOffset+e.bitmap.height;i>r&&(r=i)}),{maxWidth:t,maxHeight:r}},e.quantizeDekker=function(e,t,r){l(e,"NeuQuantFloat",t=t||256,0,r)},e.quantizeSorokin=function(e,t,r,n){let i;switch(t=t||256,r=r||"min-pop"){case"min-pop":i=2;break;case"top-pop":i=1;break;default:throw new Error(`Invalid quantizeSorokin histogram '${r}'`)}l(e,"RGBQuant",t,i,n)},e.quantizeWu=function(e,t,r,n){if(t=t||256,(r=r||5)<1||r>8)throw new Error("Invalid quantization quality");l(e,"WuQuant",t,r,n)},e.read=function(e,r){return r=r||u,Buffer.isBuffer(e)?r.decodeGif(e):function(e){return new Promise((r,n)=>{t.readFile(e,(e,t)=>e?n(e):r(t))})}(e).then(e=>r.decodeGif(e))},e.shareAsJimp=function(e,t){const r=new e(t.bitmap.width,t.bitmap.height,0);return r.bitmap.data=t.bitmap.data,r},e.write=function(e,r,n,i){i=i||u;const a=e.match(/\.[a-zA-Z]+$/);if(null!==a&&s.includes(a[0].toLowerCase()))throw new Error(`GIF '${e}' has an unexpected suffix`);return i.encodeGif(r,n).then(r=>function(e,r){return new Promise((n,i)=>{t.writeFile(e,r,e=>e?i(e):n())})}(e,r.buffer).then(()=>r))}}(gifutil)),gifutil}function requireGifcodec(){if(hasRequiredGifcodec)return gifcodec;hasRequiredGifcodec=1;const e=omggif,{Gif:t,GifError:r}=gif$1;function n(){const e=requireGifutil();return n=function(){return e},e}const{GifFrame:i}=gifframe;function a(e,t){const r=e.indexOf(t);return-1===r?null:r}function o(e,t){for(var r,n=0,i=e.length-1;n<=i;)if(e[r=Math.floor((n+i)/2)]>t)i=r-1;else{if(!(e[r]n;)n<<=1;t.length=n,t.fill(0,r)}function u(e,t){let r=e.bitmap.width*e.bitmap.height;return r=Math.ceil(r*t/8),r+=Math.ceil(r/255),100+r+768}function l(e){let t=e.indexCount,r=0;for(--t;t;)++r,t>>=1;return r>0?r:1}function c(e,t,n,i,u){if(n.interlaced)throw new r("writing interlaced GIFs is not supported");const l=function(e,t,n){const i=n.colors,s=i.length<=8?a:o,u=t.bitmap.data,l=new Buffer(u.length/4);let c=i.length,f=0,h=0;for(;f>8&16777215;l[h]=s(i,e)}else l[h]=c;f+=4,++h}if(n.usesTransparency){if(256===c)throw new r(`Frame ${e} already has 256 colorsand so can't use transparency`)}else c=null;return{buffer:l,transparentIndex:c}}(t,n,i),c={delay:n.delayCentisecs,disposal:n.disposalMethod,transparent:l.transparentIndex};u&&(s(i),c.palette=i.colors);try{let t,r=e.getOutputBuffer(),i=e.getOutputBufferPosition(),a=!0;for(;a;)if(t=e.addFrame(n.xOffset,n.yOffset,n.bitmap.width,n.bitmap.height,l.buffer,c),a=!1,t>=r.length-1){const t=new Buffer(1.5*r.length);r.copy(t),e.setOutputBuffer(t),e.setOutputBufferPosition(i),r=t,a=!0}return r}catch(e){throw new r(e)}}return gifcodec.GifCodec=class{constructor(e={}){this._transparentRGB=null,"number"==typeof e.transparentRGB&&0!==e.transparentRGB&&(this._transparentRGBA=256*e.transparentRGB),this._testInitialBufferSize=0}decodeGif(n){try{let i;try{i=new e.GifReader(n)}catch(e){throw new r(e)}const a=i.numFrames(),o=[],s={width:i.width,height:i.height,loops:i.loopCount(),usesTransparency:!1};for(let e=0;ea.width)for(let t=0;t0)return this._testInitialBufferSize;let r=968;const n=l(e);return t.forEach(e=>{r+=u(e,n)}),r}_getSizeEstimateLocal(e,t){if(this._testInitialBufferSize>0)return this._testInitialBufferSize;let r=200;for(let n=0;n{const t=new src.BitmapImage(e);src.GifUtil.quantizeDekker(t,256);const r=new src.GifFrame(e),n=new src.GifCodec;return(await n.encodeGif([r],{})).buffer},decode:e=>{const t=new omggif.GifReader(e),r=Buffer.alloc(t.width*t.height*4);return t.decodeAndBlitFrameRGBA(0,r),{data:r,width:t.width,height:t.height}}}}var encoder={exports:{}};!function(e){function t(e){var t,r,n,i,a,o=Math.floor,s=new Array(64),u=new Array(64),l=new Array(64),c=new Array(64),f=new Array(65535),h=new Array(65535),d=new Array(64),p=new Array(64),m=[],g=0,b=7,y=new Array(64),_=new Array(64),v=new Array(64),w=new Array(256),x=new Array(2048),k=[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],B=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],E=[0,1,2,3,4,5,6,7,8,9,10,11],S=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],A=[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],C=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],I=[0,1,2,3,4,5,6,7,8,9,10,11],P=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],T=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function M(e,t){for(var r=0,n=0,i=new Array,a=1;a<=16;a++){for(var o=1;o<=e[a];o++)i[t[n]]=[],i[t[n]][0]=r,i[t[n]][1]=a,n++,r++;r*=2}return i}function R(e){for(var t=e[0],r=e[1]-1;r>=0;)t&1<>8&255),F(255&e)}function N(e,t,r,n,i){for(var a,o=i[0],s=i[240],u=function(e,t){var r,n,i,a,o,s,u,l,c,f,h=0;for(c=0;c<8;++c){r=e[h],n=e[h+1],i=e[h+2],a=e[h+3],o=e[h+4],s=e[h+5],u=e[h+6];var p=r+(l=e[h+7]),m=r-l,g=n+u,b=n-u,y=i+s,_=i-s,v=a+o,w=a-o,x=p+v,k=p-v,B=g+y,E=g-y;e[h]=x+B,e[h+4]=x-B;var S=.707106781*(E+k);e[h+2]=k+S,e[h+6]=k-S;var A=.382683433*((x=w+_)-(E=b+m)),C=.5411961*x+A,I=1.306562965*E+A,P=.707106781*(B=_+b),T=m+P,M=m-P;e[h+5]=M+C,e[h+3]=M-C,e[h+1]=T+I,e[h+7]=T-I,h+=8}for(h=0,c=0;c<8;++c){r=e[h],n=e[h+8],i=e[h+16],a=e[h+24],o=e[h+32],s=e[h+40],u=e[h+48];var R=r+(l=e[h+56]),F=r-l,O=n+u,N=n-u,L=i+s,D=i-s,z=a+o,U=a-o,$=R+z,j=R-z,Z=O+L,G=O-L;e[h]=$+Z,e[h+32]=$-Z;var W=.707106781*(G+j);e[h+16]=j+W,e[h+48]=j-W;var H=.382683433*(($=U+D)-(G=N+F)),q=.5411961*$+H,Q=1.306562965*G+H,V=.707106781*(Z=D+N),Y=F+V,K=F-V;e[h+40]=K+q,e[h+24]=K-q,e[h+8]=Y+Q,e[h+56]=Y-Q,h++}for(c=0;c<64;++c)f=e[c]*t[c],d[c]=f>0?f+.5|0:f-.5|0;return d}(e,t),l=0;l<64;++l)p[k[l]]=u[l];var c=p[0]-r;r=p[0],0==c?R(n[0]):(R(n[h[a=32767+c]]),R(f[a]));for(var m=63;m>0&&0==p[m];m--);if(0==m)return R(o),r;for(var g,b=1;b<=m;){for(var y=b;0==p[b]&&b<=m;++b);var _=b-y;if(_>=16){g=_>>4;for(var v=1;v<=g;++v)R(s);_&=15}a=32767+p[b],R(i[(_<<4)+h[a]]),R(f[a]),b++}return 63!=m&&R(o),r}function L(e){e<=0&&(e=1),e>100&&(e=100),a!=e&&(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var n=o((t[r]*e+50)/100);n<1?n=1:n>255&&(n=255),s[k[r]]=n}for(var i=[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 f=o((i[a]*e+50)/100);f<1?f=1:f>255&&(f=255),u[k[a]]=f}for(var h=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],d=0,p=0;p<8;p++)for(var m=0;m<8;m++)l[d]=1/(s[k[d]]*h[p]*h[m]*8),c[d]=1/(u[k[d]]*h[p]*h[m]*8),d++}(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),a=e)}this.encode=function(e,a){var o;(new Date).getTime(),a&&L(a),m=new Array,g=0,b=7,O(65496),O(65504),O(16),F(74),F(70),F(73),F(70),F(0),F(1),F(1),F(0),O(1),O(1),F(0),F(0),void 0!==(o=e.comments)&&o.constructor===Array&&o.forEach(e=>{if("string"==typeof e){O(65534);var t,r=e.length;for(O(r+2),t=0;t>3)*H+(U=4*(7&j)),q+$>=W&&(z-=H*(q+1+$-W)),p+U>=H&&(z-=p+U-H+4),w=Z[z++],k=Z[z++],M=Z[z++],y[j]=(x[w]+x[k+256|0]+x[M+512|0]>>16)-128,_[j]=(x[w+768|0]+x[k+1024|0]+x[M+1280|0]>>16)-128,v[j]=(x[w+1280|0]+x[k+1536|0]+x[M+1792|0]>>16)-128;f=N(y,l,f,t,n),h=N(_,c,h,r,i),d=N(v,c,d,r,i),p+=32}q+=8}if(b>=0){var Q=[];Q[1]=b+1,Q[0]=(1<0&&!e[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;i++}r+10)return m--,p>>m&1;if(255==(p=t[r++])){var e=t[r++];if(e)throw new Error("unexpected marker: "+(p<<8|e).toString(16))}return m=7,p>>>7}function b(e){for(var t,r=e;null!==(t=g());){if("number"==typeof(r=r[t]))return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(e){for(var t=0;e>0;){var r=g();if(null===r)return;t=t<<1|r,e--}return t}function _(e){var t=y(e);return t>=1<0)w--;else for(var n=o,i=s;n<=i;){var a=b(t.huffmanTableAC),u=15&a,c=a>>4;if(0!==u)r[e[n+=c]]=_(u)*(1<>4,0===h)a<15?(w=y(a)+(1<>4;if(0!==s)r[e[a+=u]]=_(s),a++;else{if(u<15)break;a+=16}}};var M,R,F,O,N=0;for(R=1==T?i[0].blocksPerLine*i[0].blocksPerColumn:f*n.mcusPerColumn,a||(a=R);N=65488&&M<=65495))break;r+=2}return r-d}function h(e,l){var c,f,h=[],d=l.blocksPerLine,p=l.blocksPerColumn,m=d<<3,b=new Int32Array(64),y=new Uint8Array(64);function _(e,c,f){var h,d,p,m,g,b,y,_,v,w,x=l.quantizationTable,k=f;for(w=0;w<64;w++)k[w]=e[w]*x[w];for(w=0;w<8;++w){var B=8*w;0!=k[1+B]||0!=k[2+B]||0!=k[3+B]||0!=k[4+B]||0!=k[5+B]||0!=k[6+B]||0!=k[7+B]?(h=s*k[0+B]+128>>8,d=s*k[4+B]+128>>8,p=k[2+B],m=k[6+B],g=u*(k[1+B]-k[7+B])+128>>8,_=u*(k[1+B]+k[7+B])+128>>8,b=k[3+B]<<4,y=k[5+B]<<4,v=h-d+1>>1,h=h+d+1>>1,d=v,v=p*o+m*a+128>>8,p=p*a-m*o+128>>8,m=v,v=g-y+1>>1,g=g+y+1>>1,y=v,v=_+b+1>>1,b=_-b+1>>1,_=v,v=h-m+1>>1,h=h+m+1>>1,m=v,v=d-p+1>>1,d=d+p+1>>1,p=v,v=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=v,v=b*r+y*t+2048>>12,b=b*t-y*r+2048>>12,y=v,k[0+B]=h+_,k[7+B]=h-_,k[1+B]=d+y,k[6+B]=d-y,k[2+B]=p+b,k[5+B]=p-b,k[3+B]=m+g,k[4+B]=m-g):(v=s*k[0+B]+512>>10,k[0+B]=v,k[1+B]=v,k[2+B]=v,k[3+B]=v,k[4+B]=v,k[5+B]=v,k[6+B]=v,k[7+B]=v)}for(w=0;w<8;++w){var E=w;0!=k[8+E]||0!=k[16+E]||0!=k[24+E]||0!=k[32+E]||0!=k[40+E]||0!=k[48+E]||0!=k[56+E]?(h=s*k[0+E]+2048>>12,d=s*k[32+E]+2048>>12,p=k[16+E],m=k[48+E],g=u*(k[8+E]-k[56+E])+2048>>12,_=u*(k[8+E]+k[56+E])+2048>>12,b=k[24+E],y=k[40+E],v=h-d+1>>1,h=h+d+1>>1,d=v,v=p*o+m*a+2048>>12,p=p*a-m*o+2048>>12,m=v,v=g-y+1>>1,g=g+y+1>>1,y=v,v=_+b+1>>1,b=_-b+1>>1,_=v,v=h-m+1>>1,h=h+m+1>>1,m=v,v=d-p+1>>1,d=d+p+1>>1,p=v,v=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=v,v=b*r+y*t+2048>>12,b=b*t-y*r+2048>>12,y=v,k[0+E]=h+_,k[56+E]=h-_,k[8+E]=d+y,k[48+E]=d-y,k[16+E]=p+b,k[40+E]=p-b,k[24+E]=m+g,k[32+E]=m-g):(v=s*f[w+0]+8192>>14,k[0+E]=v,k[8+E]=v,k[16+E]=v,k[24+E]=v,k[32+E]=v,k[40+E]=v,k[48+E]=v,k[56+E]=v)}for(w=0;w<64;++w){var S=128+(k[w]+8>>4);c[w]=S<0?0:S>255?255:S}}g(m*p*8);for(var v=0;v255?255:e}l.prototype={load:function(e){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){var e=new Uint8Array(t.response||t.mozResponseArrayBuffer);this.parse(e),this.onload&&this.onload()}.bind(this),t.send(null)},parse:function(t){var r=1e3*this.opts.maxResolutionInMP*1e3,n=0;function i(){var e=t[n]<<8|t[n+1];return n+=2,e}function a(e){var t,r,n=1,i=1;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i>4){if(E>>4!=1)throw new Error("DQT: invalid table spec");for(Q=0;Q<64;Q++)S[e[Q]]=i()}else for(Q=0;Q<64;Q++)S[e[Q]]=t[n++];m[15&E]=S}break;case 65472:case 65473:case 65474:i(),(o={}).extended=65473===v,o.progressive=65474===v,o.precision=t[n++],o.scanLines=i(),o.samplesPerLine=i(),o.components={},o.componentsOrder=[];var A=o.scanLines*o.samplesPerLine;if(A>r){var C=Math.ceil((A-r)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${C}MP`)}var I,P=t[n++];for(H=0;H>4,M=15&t[n+1],R=t[n+2];if(T<=0||M<=0)throw new Error("Invalid sampling factor, expected values above 0");o.componentsOrder.push(I),o.components[I]={h:T,v:M,quantizationIdx:R},n+=3}a(o),b.push(o);break;case 65476:var F=i();for(H=2;H>4?y:_)[15&O]=c(N,D)}break;case 65501:i(),s=i();break;case 65500:i(),i();break;case 65498:i();var z=t[n++],U=[];for(H=0;H>4],V.huffmanTableAC=y[15&$],U.push(V)}var j=t[n++],Z=t[n++],G=t[n++],W=f(t,n,o,U,s,j,Z,G>>4,15&G,this.opts);n+=W;break;case 65535:255!==t[n]&&n--;break;default:if(255==t[n-3]&&t[n-2]>=192&&t[n-2]<=254){n-=3;break}if(224===v||225==v){if(-1!==w)throw new Error(`first unknown JPEG marker at offset ${w.toString(16)}, second unknown JPEG marker ${v.toString(16)} at offset ${(n-1).toString(16)}`);w=n-1;const e=i();if(255===t[n+e-2]){n+=e-2;break}}throw new Error("unknown JPEG marker "+v.toString(16))}v=i()}if(1!=b.length)throw new Error("only single frame JPEGs supported");for(var H=0;Hm){var r=Math.ceil((t-m)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}p=t}return l.resetMaxMemoryUsage=function(e){p=0,m=e},l.getBytesAllocated=function(){return p},l.requestMemoryAllocation=g,l}(),module.exports=function(e,t={}){var r={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512,...t},n=new Uint8Array(e),i=new JpegImage;i.opts=r,JpegImage.resetMaxMemoryUsage(1024*r.maxMemoryUsageInMB*1024),i.parse(n);var a=r.formatAsRGBA?4:3,o=i.width*i.height*a;try{JpegImage.requestMemoryAllocation(o);var s={width:i.width,height:i.height,exifBuffer:i.exifBuffer,data:r.useTArray?new Uint8Array(o):Buffer.alloc(o)};i.comments.length>0&&(s.comments=i.comments)}catch(e){if(e instanceof RangeError)throw new Error("Could not allocate enough memory for the image. Required: "+o);if(e instanceof ReferenceError&&"Buffer is not defined"===e.message)throw new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true");throw e}return i.copyToImageData(s,r.formatAsRGBA),s};var decoderExports=decoder.exports,encode=encoderExports,decode=decoderExports,jpegJs={encode,decode},JPEG=getDefaultExportFromCjs(jpegJs);function jpeg$2(){return{mime:"image/jpeg",encode:(e,{quality:t=100}={})=>JPEG.encode(e,t).data,decode:(e,t)=>JPEG.decode(e,t)}}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var browser$1={exports:{}};browser$1.exports=function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var u="function"==typeof commonjsRequire&&commonjsRequire;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){return i(t[o][1][e]||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof commonjsRequire&&commonjsRequire,o=0;o=t.length)throw new Error("Ran out of data");let i=t[n];e[r]=i,e[r+1]=i,e[r+2]=i,e[r+3]=t[n+1]},function(e,t,r,n){if(n+2>=t.length)throw new Error("Ran out of data");e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=255},function(e,t,r,n){if(n+3>=t.length)throw new Error("Ran out of data");e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=t[n+3]}],a=[function(){},function(e,t,r,n){let i=t[0];e[r]=i,e[r+1]=i,e[r+2]=i,e[r+3]=n},function(e,t,r){let n=t[0];e[r]=n,e[r+1]=n,e[r+2]=n,e[r+3]=t[1]},function(e,t,r,n){e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=n},function(e,t,r){e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=t[3]}];function o(e,t,r,n,a,o){let s=e.width,u=e.height,l=e.index;for(let e=0;e>4,r.push(f,c);break;case 2:u=3&h,l=h>>2&3,c=h>>4&3,f=h>>6&3,r.push(f,c,l,u);break;case 1:i=1&h,a=h>>1&1,o=h>>2&1,s=h>>3&1,u=h>>4&1,l=h>>5&1,c=h>>6&1,f=h>>7&1,r.push(f,c,l,u,s,o,a,i)}}return{get:function(e){for(;r.length0&&(this._paused=!1,this.emit("drain"))}.bind(this))},o.prototype.write=function(e,t){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return r=n.isBuffer(e)?e:n.from(e,t||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},o.prototype.end=function(e,t){e&&this.write(e,t),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("Unexpected end of input")),this.destroy()},o.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},o.prototype._processReadAllowingLess=function(e){this._reads.shift();let t=this._buffers[0];t.length>e.length?(this._buffered-=e.length,this._buffers[0]=t.slice(e.length),e.func.call(this,t.slice(0,e.length))):(this._buffered-=t.length,this._buffers.shift(),e.func.call(this,t))},o.prototype._processRead=function(e){this._reads.shift();let t=0,r=0,i=n.alloc(e.length);for(;t0&&this._buffers.splice(0,r),this._buffered-=e.length,e.func.call(this,i)},o.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let e=this._reads[0];if(e.allowLess)this._processReadAllowingLess(e);else{if(!(this._buffered>=e.length))break;this._processRead(e)}}this._buffers&&!this.writable&&this._end()}catch(e){this.emit("error",e)}}}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:63,buffer:32,stream:65,util:84}],4:[function(e,t,r){t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],5:[function(e,t,r){let n=[];!function(){for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)1&t?t=3988292384^t>>>1:t>>>=1;n[e]=t}}();let i=t.exports=function(){this._crc=-1};i.prototype.write=function(e){for(let t=0;t>>8;return!0},i.prototype.crc32=function(){return~this._crc},i.crc32=function(e){let t=-1;for(let r=0;r>>8;return~t}},{}],6:[function(e,t,r){(function(r){(function(){let n=e("./paeth-predictor"),i={0:function(e,t,r,n,i){for(let a=0;a=a?e[t+o-a]:0,s=e[t+o]-r;n[i+o]=s}},2:function(e,t,r,n,i){for(let a=0;a0?e[t+a-r]:0,s=e[t+a]-o;n[i+a]=s}},3:function(e,t,r,n,i,a){for(let o=0;o=a?e[t+o-a]:0,u=t>0?e[t+o-r]:0,l=e[t+o]-(s+u>>1);n[i+o]=l}},4:function(e,t,r,i,a,o){for(let s=0;s=o?e[t+s-o]:0,l=t>0?e[t+s-r]:0,c=t>0&&s>=o?e[t+s-(r+o)]:0,f=e[t+s]-n(u,l,c);i[a+s]=f}}},a={0:function(e,t,r){let n=0,i=t+r;for(let r=t;r=n?e[t+a-n]:0,o=e[t+a]-r;i+=Math.abs(o)}return i},2:function(e,t,r){let n=0,i=t+r;for(let a=t;a0?e[a-r]:0,o=e[a]-i;n+=Math.abs(o)}return n},3:function(e,t,r,n){let i=0;for(let a=0;a=n?e[t+a-n]:0,s=t>0?e[t+a-r]:0,u=e[t+a]-(o+s>>1);i+=Math.abs(u)}return i},4:function(e,t,r,i){let a=0;for(let o=0;o=i?e[t+o-i]:0,u=t>0?e[t+o-r]:0,l=t>0&&o>=i?e[t+o-(r+i)]:0,c=e[t+o]-n(s,u,l);a+=Math.abs(c)}return a}};t.exports=function(e,t,n,o,s){let u;if("filterType"in o&&-1!==o.filterType){if("number"!=typeof o.filterType)throw new Error("unrecognised filter types");u=[o.filterType]}else u=[0,1,2,3,4];16===o.bitDepth&&(s*=2);let l=t*s,c=0,f=0,h=r.alloc((l+1)*n),d=u[0];for(let t=0;t1){let t=1/0;for(let r=0;ri?t[a-n]:0;t[a]=r+o}},o.prototype._unFilterType2=function(e,t,r){let n=this._lastLine;for(let i=0;ii?t[o-n]:0,l=Math.floor((u+s)/2);t[o]=r+l}},o.prototype._unFilterType4=function(e,t,r){let n=this._xComparison,a=n-1,o=this._lastLine;for(let s=0;sa?t[s-n]:0,c=s>a&&o?o[s-n]:0,f=i(l,u,c);t[s]=r+f}},o.prototype._reverseFilterLine=function(e){let t,n=e[0],i=this._images[this._imageIndex],a=i.byteWidth;if(0===n)t=e.slice(1,a+1);else switch(t=r.alloc(a),n){case 1:this._unFilterType1(e,t,a);break;case 2:this._unFilterType2(e,t,a);break;case 3:this._unFilterType3(e,t,a);break;case 4:this._unFilterType4(e,t,a);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(t),i.lineIndex++,i.lineIndex>=i.height?(this._lastLine=null,this._imageIndex++,i=this._images[this._imageIndex]):this._lastLine=t,i?this.read(i.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this)}).call(this,e("buffer").Buffer)},{"./interlace":11,"./paeth-predictor":15,buffer:32}],10:[function(e,t,r){(function(e){(function(){t.exports=function(t,r,n=!1){let i=r.depth,a=r.width,o=r.height,s=r.colorType,u=r.transColor,l=r.palette,c=t;return 3===s?function(e,t,r,n,i){let a=0;for(let o=0;o0&&l>0&&r.push({width:u,height:l,index:e})}return r},r.getInterlaceIterator=function(e){return function(t,r,i){let a=t%n[i].x.length,o=(t-a)/n[i].x.length*8+n[i].x[a],s=r%n[i].y.length;return 4*o+((r-s)/n[i].y.length*8+n[i].y[s])*e*4}}},{}],12:[function(e,t,r){(function(r){(function(){let n=e("util"),i=e("stream"),a=e("./constants"),o=e("./packer"),s=t.exports=function(e){i.call(this);let t=e||{};this._packer=new o(t),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,i),s.prototype.pack=function(e,t,n,i){this.emit("data",r.from(a.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(t,n)),i&&this.emit("data",this._packer.packGAMA(i));let o=this._packer.filterData(e,t,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(e){this.emit("data",this._packer.packIDAT(e))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":4,"./packer":14,buffer:32,stream:65,util:84}],13:[function(e,t,r){(function(r){(function(){let n=!0,i=e("zlib");i.deflateSync||(n=!1);let a=e("./constants"),o=e("./packer");t.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let s=new o(t||{}),u=[];u.push(r.from(a.PNG_SIGNATURE)),u.push(s.packIHDR(e.width,e.height)),e.gamma&&u.push(s.packGAMA(e.gamma));let l=s.filterData(e.data,e.width,e.height),c=i.deflateSync(l,s.getDeflateOptions());if(l=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return u.push(s.packIDAT(c)),u.push(s.packIEND()),r.concat(u)}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":4,"./packer":14,buffer:32,zlib:31}],14:[function(e,t,r){(function(r){(function(){let n=e("./constants"),i=e("./crc"),a=e("./bitpacker"),o=e("./filter-pack"),s=e("zlib"),u=t.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=null!=e.deflateLevel?e.deflateLevel:9,e.deflateStrategy=null!=e.deflateStrategy?e.deflateStrategy:3,e.inputHasAlpha=null==e.inputHasAlpha||e.inputHasAlpha,e.deflateFactory=e.deflateFactory||s.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType="number"==typeof e.colorType?e.colorType:n.COLORTYPE_COLOR_ALPHA,e.inputColorType="number"==typeof e.inputColorType?e.inputColorType:n.COLORTYPE_COLOR_ALPHA,-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(e.colorType))throw new Error("option color type:"+e.colorType+" is not supported at present");if(-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(e.inputColorType))throw new Error("option input color type:"+e.inputColorType+" is not supported at present");if(8!==e.bitDepth&&16!==e.bitDepth)throw new Error("option bit depth:"+e.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(e,t,r){let i=a(e,t,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return o(i,t,r,this._options,s)},u.prototype._packChunk=function(e,t){let n=t?t.length:0,a=r.alloc(n+12);return a.writeUInt32BE(n,0),a.writeUInt32BE(e,4),t&&t.copy(a,8),a.writeInt32BE(i.crc32(a.slice(4,a.length-4)),a.length-4),a},u.prototype.packGAMA=function(e){let t=r.alloc(4);return t.writeUInt32BE(Math.floor(e*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,t)},u.prototype.packIHDR=function(e,t){let i=r.alloc(13);return i.writeUInt32BE(e,0),i.writeUInt32BE(t,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(n.TYPE_IHDR,i)},u.prototype.packIDAT=function(e){return this._packChunk(n.TYPE_IDAT,e)},u.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}}).call(this)}).call(this,e("buffer").Buffer)},{"./bitpacker":2,"./constants":4,"./crc":5,"./filter-pack":6,buffer:32,zlib:31}],15:[function(e,t,r){t.exports=function(e,t,r){let n=e+t-r,i=Math.abs(n-e),a=Math.abs(n-t),o=Math.abs(n-r);return i<=a&&i<=o?e:a<=o?t:r}},{}],16:[function(e,t,r){let n=e("util"),i=e("zlib"),a=e("./chunkstream"),o=e("./filter-parse-async"),s=e("./parser"),u=e("./bitmapper"),l=e("./format-normaliser"),c=t.exports=function(e){a.call(this),this._parser=new s(e,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=e,this.writable=!0,this._parser.start()};n.inherits(c,a),c.prototype._handleError=function(e){this.emit("error",e),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},c.prototype._inflateData=function(e){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=i.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let e=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,t=Math.max(e,i.Z_MIN_CHUNK);this._inflate=i.createInflate({chunkSize:t});let r=e,n=this.emit.bind(this,"error");this._inflate.on("error",function(e){r&&n(e)}),this._filter.on("complete",this._complete.bind(this));let a=this._filter.write.bind(this._filter);this._inflate.on("data",function(e){r&&(e.length>r&&(e=e.slice(0,r)),r-=e.length,a(e))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(e)},c.prototype._handleMetaData=function(e){this._metaData=e,this._bitmapInfo=Object.create(e),this._filter=new o(this._bitmapInfo)},c.prototype._handleTransColor=function(e){this._bitmapInfo.transColor=e},c.prototype._handlePalette=function(e){this._bitmapInfo.palette=e},c.prototype._simpleTransparency=function(){this._metaData.alpha=!0},c.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},c.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},c.prototype._complete=function(e){if(this.errord)return;let t;try{let r=u.dataToBitMap(e,this._bitmapInfo);t=l(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(e){return void this._handleError(e)}this.emit("parsed",t)}},{"./bitmapper":1,"./chunkstream":3,"./filter-parse-async":7,"./format-normaliser":10,"./parser":18,util:84,zlib:31}],17:[function(e,t,r){(function(r){(function(){let n=!0,i=e("zlib"),a=e("./sync-inflate");i.deflateSync||(n=!1);let o=e("./sync-reader"),s=e("./filter-parse-sync"),u=e("./parser"),l=e("./bitmapper"),c=e("./format-normaliser");t.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let f,h,d,p=[],m=new o(e);if(new u(t,{read:m.read.bind(m),error:function(e){f=e},metadata:function(e){h=e},gamma:function(e){d=e},palette:function(e){h.palette=e},transColor:function(e){h.transColor=e},inflateData:function(e){p.push(e)},simpleTransparency:function(){h.alpha=!0}}).start(),m.process(),f)throw f;let g,b=r.concat(p);if(p.length=0,h.interlace)g=i.inflateSync(b);else{let e=(1+(h.width*h.bpp*h.depth+7>>3))*h.height;g=a(b,{chunkSize:e,maxLength:e})}if(b=null,!g||!g.length)throw new Error("bad png - invalid inflate data response");let y=s.process(g,h);b=null;let _=l.dataToBitMap(y,h);y=null;let v=c(_,h,t.skipRescale);return h.data=v,h.gamma=d||0,h}}).call(this)}).call(this,e("buffer").Buffer)},{"./bitmapper":1,"./filter-parse-sync":8,"./format-normaliser":10,"./parser":18,"./sync-inflate":21,"./sync-reader":22,buffer:32,zlib:31}],18:[function(e,t,r){(function(r){(function(){let n=e("./constants"),i=e("./crc"),a=t.exports=function(e,t){this._options=e,e.checkCRC=!1!==e.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=t.read,this.error=t.error,this.metadata=t.metadata,this.gamma=t.gamma,this.transColor=t.transColor,this.palette=t.palette,this.parsed=t.parsed,this.inflateData=t.inflateData,this.finished=t.finished,this.simpleTransparency=t.simpleTransparency,this.headersFinished=t.headersFinished||function(){}};a.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},a.prototype._parseSignature=function(e){let t=n.PNG_SIGNATURE;for(let r=0;rthis._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let t=0;t0?this._handleIDAT(r):this._handleChunkEnd()},a.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))},a.prototype._parseIEND=function(e){this._crc.write(e),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":4,"./crc":5,buffer:32}],19:[function(e,t,r){let n=e("./parser-sync"),i=e("./packer-sync");r.read=function(e,t){return n(e,t||{})},r.write=function(e,t){return i(e,t)}},{"./packer-sync":13,"./parser-sync":17}],20:[function(e,t,r){(function(t,n){(function(){let i=e("util"),a=e("stream"),o=e("./parser-async"),s=e("./packer-async"),u=e("./png-sync"),l=r.PNG=function(e){a.call(this),e=e||{},this.width=0|e.width,this.height=0|e.height,this.data=this.width>0&&this.height>0?n.alloc(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new o(e),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(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new s(e),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(l,a),l.sync=u,l.prototype.pack=function(){return this.data&&this.data.length?(t.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},l.prototype.parse=function(e,t){if(t){let e,r;e=function(e){this.removeListener("error",r),this.data=e,t(null,this)}.bind(this),r=function(r){this.removeListener("parsed",e),t(r,null)}.bind(this),this.once("parsed",e),this.once("error",r)}return this.end(e),this},l.prototype.write=function(e){return this._parser.write(e),!0},l.prototype.end=function(e){this._parser.end(e)},l.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit("metadata",e)},l.prototype._gamma=function(e){this.gamma=e},l.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},l.bitblt=function(e,t,r,n,i,a,o,s){if(n|=0,i|=0,a|=0,o|=0,s|=0,(r|=0)>e.width||n>e.height||r+i>e.width||n+a>e.height)throw new Error("bitblt reading outside image");if(o>t.width||s>t.height||o+i>t.width||s+a>t.height)throw new Error("bitblt writing outside image");for(let u=0;u=0,"have should not go down"),r>0){let e=c._buffer.slice(c._offset,c._offset+r);if(c._offset+=r,e.length>d&&(e=e.slice(0,d)),m.push(e),g+=e.length,d-=e.length,0===d)return!1}return(0===t||c._offset>=c._chunkSize)&&(h=c._chunkSize,c._offset=0,c._buffer=i.allocUnsafe(c._chunkSize)),0===t&&(p+=f-e,f=e,!0)}this.on("error",function(e){o=e}),n(this._handle,"zlib binding closed");do{u=this._handle.writeSync(t,e,p,f,this._buffer,this._offset,h),u=u||this._writeState}while(!this._hadError&&b(u[0],u[1]));if(this._hadError)throw o;if(g>=s)throw l(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes");let y=i.concat(m,g);return l(this),y},o.inherits(u,a.Inflate),t.exports=r=c,r.Inflate=u,r.createInflate=function(e){return new u(e)},r.inflateSync=c}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:63,assert:23,buffer:32,util:84,zlib:31}],22:[function(e,t,r){let n=t.exports=function(e){this._buffer=e,this._reads=[]};n.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t})},n.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let e=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=e.length||e.allowLess))break;{this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length),e.func.call(this,t.slice(0,e.length))}}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}},{}],23:[function(e,t,r){(function(r){(function(){var n=e("object-assign");function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i=0;l--)if(c[l]!==f[l])return!1;for(l=c.length-1;l>=0;l--)if(!_(e[s=c[l]],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function v(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function x(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&b(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!e&&i&&!r;if((!e&&o.isError(i)&&a&&w(i,r)||s)&&b(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(g(e.actual),128)+" "+e.operator+" "+m(g(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(h.AssertionError,Error),h.fail=b,h.ok=y,h.equal=function(e,t,r){e!=t&&b(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&b(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){_(e,t,!1)||b(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){_(e,t,!0)||b(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){_(e,t,!1)&&b(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){_(t,r,!0)&&b(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&b(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&b(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){x(!0,e,t,r)},h.doesNotThrow=function(e,t,r){x(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=n(function e(t,r){t||b(t,!0,r,"==",e)},h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var k=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this)}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":51,"util/":26}],24:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],25:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],26:[function(e,t,r){(function(t,n){(function(){var i=/%[sdj%]/g;r.format=function(e){if(!y(e)){for(var t=[],r=0;r=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(t)?n.showHidden=t:t&&r._extend(n,t),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function l(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&B(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return y(i)||(i=c(e,i,n)),i}var a=f(e,t);if(a)return a;var o=Object.keys(t),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),k(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(t);if(0===o.length){if(B(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(x(t))return e.stylize(Date.prototype.toString.call(t),"date");if(k(t))return h(t)}var l,m="",g=!1,b=["{","}"];return p(t)&&(g=!0,b=["[","]"]),B(t)&&(m=" [Function"+(t.name?": "+t.name:"")+"]"),v(t)&&(m=" "+RegExp.prototype.toString.call(t)),x(t)&&(m=" "+Date.prototype.toUTCString.call(t)),k(t)&&(m=" "+h(t)),0!==o.length||g&&0!=t.length?n<0?v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=g?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,m,b)):b[0]+m+b[1]}function f(e,t){if(_(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),C(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function p(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function b(e){return"number"==typeof e}function y(e){return"string"==typeof e}function _(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function k(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function B(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(_(a)&&(a=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var n=t.pid;o[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else o[e]=function(){};return o[e]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=m,r.isNull=g,r.isNullOrUndefined=function(e){return null==e},r.isNumber=b,r.isString=y,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=_,r.isRegExp=v,r.isObject=w,r.isDate=x,r.isError=k,r.isFunction=B,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log("%s - %s",function(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this)}).call(this,e("_process"),void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":25,_process:63,inherits:24}],27:[function(e,t,r){(function(e){(function(){var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?e:globalThis;t.exports=function(){for(var e=[],t=0;t0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=16383,s=0,u=r-i;su?u:s+o));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],a=t;ar.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=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}r.NONE=0,r.DEFLATE=1,r.INFLATE=2,r.GZIP=3,r.GUNZIP=4,r.DEFLATERAW=5,r.INFLATERAW=6,r.UNZIP=7,c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=r.UNZIP),this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||s.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,n,i,a,o){return this._write(!0,e,t,r,n,i,a,o)},c.prototype.writeSync=function(e,t,r,n,i,a,o){return this._write(!1,e,t,r,n,i,a,o)},c.prototype._write=function(e,a,o,s,u,l,c,f){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==r.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===a,"must provide flush value"),this.write_in_progress=!0,a!==r.Z_NO_FLUSH&&a!==r.Z_PARTIAL_FLUSH&&a!==r.Z_SYNC_FLUSH&&a!==r.Z_FULL_FLUSH&&a!==r.Z_FINISH&&a!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=n.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=l,this.strm.next_out=c,this.flush=a,!e)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return t.nextTick(function(){h._process(),h._after()}),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(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=s.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=s.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=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.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},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,t,n,a,o){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(e>=8&&e<=15,"invalid windowBits"),i(t>=-1&&t<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(a===r.Z_FILTERED||a===r.Z_HUFFMAN_ONLY||a===r.Z_RLE||a===r.Z_FIXED||a===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,n,a,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,t,n,i,u){switch(this.level=e,this.windowBits=t,this.memLevel=n,this.strategy=i,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 a,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.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=s.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=u,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==r.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:case r.GZIP:this.err=o.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=c}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:63,assert:23,buffer:32,"pako/lib/zlib/constants":54,"pako/lib/zlib/deflate.js":56,"pako/lib/zlib/inflate.js":58,"pako/lib/zlib/zstream":62}],31:[function(e,t,r){(function(t){(function(){var n=e("buffer").Buffer,i=e("stream").Transform,a=e("./binding"),o=e("util"),s=e("assert").ok,u=e("buffer").kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16384,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(a),f=0;f=u?o=new RangeError(l):t=n.concat(i,a),i=[],e.close(),r(o,t)}e.on("error",function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)}),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function _(e){if(!(this instanceof _))return new _(e);A.call(this,e,a.DEFLATE)}function v(e){if(!(this instanceof v))return new v(e);A.call(this,e,a.INFLATE)}function w(e){if(!(this instanceof w))return new w(e);A.call(this,e,a.GZIP)}function x(e){if(!(this instanceof x))return new x(e);A.call(this,e,a.GUNZIP)}function k(e){if(!(this instanceof k))return new k(e);A.call(this,e,a.DEFLATERAW)}function B(e){if(!(this instanceof B))return new B(e);A.call(this,e,a.INFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);A.call(this,e,a.UNZIP)}function S(e){return e===a.Z_NO_FLUSH||e===a.Z_PARTIAL_FLUSH||e===a.Z_SYNC_FLUSH||e===a.Z_FULL_FLUSH||e===a.Z_FINISH||e===a.Z_BLOCK}function A(e,t){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||r.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!S(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!S(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||a.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:a.Z_FINISH,e.chunkSize&&(e.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=r.Z_FILTERED&&e.strategy!=r.Z_HUFFMAN_ONLY&&e.strategy!=r.Z_RLE&&e.strategy!=r.Z_FIXED&&e.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(t);var s=this;this._hadError=!1,this._handle.onerror=function(e,t){C(s),s._hadError=!0;var n=new Error(e);n.errno=t,n.code=r.codes[t],s.emit("error",n)};var u=r.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var l=r.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(l=e.strategy),this._handle.init(e.windowBits||r.Z_DEFAULT_WINDOWBITS,u,e.memLevel||r.Z_DEFAULT_MEMLEVEL,l,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=l,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function C(e,r){r&&t.nextTick(r),e._handle&&(e._handle.close(),e._handle=null)}function I(e){e.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),r.Deflate=_,r.Inflate=v,r.Gzip=w,r.Gunzip=x,r.DeflateRaw=k,r.InflateRaw=B,r.Unzip=E,r.createDeflate=function(e){return new _(e)},r.createInflate=function(e){return new v(e)},r.createDeflateRaw=function(e){return new k(e)},r.createInflateRaw=function(e){return new B(e)},r.createGzip=function(e){return new w(e)},r.createGunzip=function(e){return new x(e)},r.createUnzip=function(e){return new E(e)},r.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new _(t),e,r)},r.deflateSync=function(e,t){return y(new _(t),e)},r.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new w(t),e,r)},r.gzipSync=function(e,t){return y(new w(t),e)},r.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new k(t),e,r)},r.deflateRawSync=function(e,t){return y(new k(t),e)},r.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new E(t),e,r)},r.unzipSync=function(e,t){return y(new E(t),e)},r.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new v(t),e,r)},r.inflateSync=function(e,t){return y(new v(t),e)},r.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new x(t),e,r)},r.gunzipSync=function(e,t){return y(new x(t),e)},r.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new B(t),e,r)},r.inflateRawSync=function(e,t){return y(new B(t),e)},o.inherits(A,i),A.prototype.params=function(e,n,i){if(er.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(n!=r.Z_FILTERED&&n!=r.Z_HUFFMAN_ONLY&&n!=r.Z_RLE&&n!=r.Z_FIXED&&n!=r.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==e||this._strategy!==n){var o=this;this.flush(a.Z_SYNC_FLUSH,function(){s(o._handle,"zlib binding closed"),o._handle.params(e,n),o._hadError||(o._level=e,o._strategy=n,i&&i())})}else t.nextTick(i)},A.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},A.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},A.prototype.flush=function(e,r){var i=this,o=this._writableState;("function"==typeof e||void 0===e&&!r)&&(r=e,e=a.Z_FULL_FLUSH),o.ended?r&&t.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",function(){return i.flush(e,r)}):(this._flushFlag=e,this.write(n.alloc(0),"",r))},A.prototype.close=function(e){C(this,e),t.nextTick(I,this)},A.prototype._transform=function(e,t,r){var i,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||n.isBuffer(e)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},A.prototype._processChunk=function(e,t,r){var i=e&&e.length,a=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var h,d=[],p=0;this.on("error",function(e){h=e}),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,i,this._buffer,this._offset,a)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw h;if(p>=u)throw C(this),new RangeError(l);var g=n.concat(d,p);return C(this),g}s(this._handle,"zlib binding closed");var b=this._handle.write(t,e,o,i,this._buffer,this._offset,a);function y(u,l){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var h=a-l;if(s(h>=0,"have should not go down"),h>0){var m=c._buffer.slice(c._offset,c._offset+h);c._offset+=h,f?c.push(m):(d.push(m),p+=m.length)}if((0===l||c._offset>=c._chunkSize)&&(a=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===l){if(o+=i-u,i=u,!f)return!0;var g=c._handle.write(t,e,o,i,c._buffer,c._offset,c._chunkSize);return g.callback=y,void(g.buffer=e)}if(!f)return!1;r()}}b.buffer=e,b.callback=y},o.inherits(_,A),o.inherits(v,A),o.inherits(w,A),o.inherits(x,A),o.inherits(k,A),o.inherits(B,A),o.inherits(E,A)}).call(this)}).call(this,e("_process"))},{"./binding":30,_process:63,assert:23,buffer:32,stream:65,util:84}],32:[function(e,t,r){(function(t){(function(){var t=e("base64-js"),n=e("ieee754");r.Buffer=o,r.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|h(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(e).length;default:if(i)return n?-1:L(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return B(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function p(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function k(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function B(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);for(var r="",n=0;nt&&(e+=" ... "),""},o.prototype.compare=function(e,t,r,n,i){if(U(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(a,s),l=this.slice(n,i),c=e.slice(t,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function S(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function M(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,i,a){return t=+t,r>>>=0,a||M(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function F(e,t,r,i,a){return t=+t,r>>>=0,a||M(e,0,r,8),n.write(e,t,r,i,52,8),r+8}o.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),n.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),n.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),n.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),n.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=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),e.length-t=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function D(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":28,buffer:32,ieee754:45}],33:[function(e,t,r){var n=e("get-intrinsic"),i=e("./"),a=i(n("String.prototype.indexOf"));t.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i(r):r}},{"./":34,"get-intrinsic":39}],34:[function(e,t,r){var n=e("function-bind"),i=e("get-intrinsic"),a=i("%Function.prototype.apply%"),o=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(o,a),u=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}t.exports=function(e){var t=s(n,o,arguments);return u&&l&&u(t,"length").configurable&&l(t,"length",{value:1+c(0,e.length-(arguments.length-1))}),t};var f=function(){return s(n,a,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},{"function-bind":38,"get-intrinsic":39}],35:[function(e,t,r){var n,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}b(e,t,a,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&b(e,"error",t,{once:!0})}(e,i)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,a,o;if(l(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var l=u.length,c=g(u,l);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],36:[function(e,t,r){var n=e("is-callable"),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty,o=function(e,t,r){for(var n=0,i=e.length;n=3&&(a=r),"[object Array]"===i.call(e)?o(e,t,a):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n1&&"boolean"!=typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===E(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=B(e,0,1),r=B(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return k(e,S,function(e,t,r,i){n[n.length]=r?k(i,A,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",a=C("%"+n+"%",t),s=a.name,l=a.value,c=!1,f=a.alias;f&&(n=f[0],x(r,w([0,1],f)));for(var h=1,d=!0;h=r.length){var y=u(l,p);l=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:l[p]}else d=v(l,p),l=l[p];d&&!c&&(m[s]=l)}}return l}},{"function-bind":38,has:44,"has-symbols":41}],40:[function(e,t,r){var n=e("get-intrinsic")("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}t.exports=n},{"get-intrinsic":39}],41:[function(e,t,r){var n="undefined"!=typeof Symbol&&Symbol,i=e("./shams");t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},{"./shams":42}],42:[function(e,t,r){t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},{}],43:[function(e,t,r){var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":42}],44:[function(e,t,r){var n=e("function-bind");t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":38}],45:[function(e,t,r){r.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=l}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,l-=8);e[r+d-p]|=128*m}},{}],46:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],47:[function(e,t,r){var n=e("has-tostringtag/shams")(),i=e("call-bind/callBound")("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,t.exports=s?a:o},{"call-bind/callBound":33,"has-tostringtag/shams":43}],48:[function(e,t,r){var n,i,a=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw i}}),i={},o(function(){throw 42},null,n)}catch(e){e!==i&&(o=null)}else o=null;var s=/^\s*class\b/,u=function(e){try{var t=a.call(e);return s.test(t)}catch(e){return!1}},l=function(e){try{return!u(e)&&(a.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,h=!(0 in[,]),d=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(d=function(e){if((h||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}t.exports=o?function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,n)}catch(e){if(e!==i)return!1}return!u(e)&&l(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(f)return l(e);if(u(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}},{}],49:[function(e,t,r){var n,i=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=e("has-tostringtag/shams")(),u=Object.getPrototypeOf;t.exports=function(e){if("function"!=typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},{"has-tostringtag/shams":43}],50:[function(e,t,r){(function(r){(function(){var n=e("for-each"),i=e("available-typed-arrays"),a=e("call-bind/callBound"),o=a("Object.prototype.toString"),s=e("has-tostringtag/shams")(),u=e("gopd"),l="undefined"==typeof globalThis?r:globalThis,c=i(),f=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!u&&function(e){var t=!1;return n(d,function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}}),t}(e)}}).call(this)}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":27,"call-bind/callBound":33,"for-each":36,gopd:40,"has-tostringtag/shams":43}],51:[function(e,t,r){var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==n.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,o,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u>>16&65535,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16}},{}],54:[function(e,t,r){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],55:[function(e,t,r){var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var a=n,o=i+r;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return~e}},{}],56:[function(e,t,r){var n,i=e("../utils/common"),a=e("./trees"),o=e("./adler32"),s=e("./crc32"),u=e("./messages"),l=-2,c=258,f=262,h=103,d=113,p=666;function m(e,t){return e.msg=u[t],t}function g(e){return(e<<1)-(e>4?9:0)}function b(e){for(var t=e.length;--t>=0;)e[t]=0}function y(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function _(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,y(e.strm)}function v(e,t){e.pending_buf[e.pending++]=t}function w(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function x(e,t,r,n){var a=e.avail_in;return a>n&&(a=n),0===a?0:(e.avail_in-=a,i.arraySet(t,e.input,e.next_in,a,r),1===e.state.wrap?e.adler=o(e.adler,t,a,r):2===e.state.wrap&&(e.adler=s(e.adler,t,a,r)),e.next_in+=a,e.total_in+=a,a)}function k(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,l=e.window,h=e.w_mask,d=e.prev,p=e.strstart+c,m=l[a+o-1],g=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+o]===g&&l[r+o-1]===m&&l[r]===l[a]&&l[++r]===l[a+1]){a+=2,r++;do{}while(l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;m=l[a+o-1],g=l[a+o]}}}while((t=d[t&h])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function B(e){var t,r,n,a,o,s=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-f)){i.arraySet(e.window,e.window,s,s,0),e.match_start-=s,e.strstart-=s,e.block_start-=s,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=s?n-s:0}while(--r);t=r=s;do{n=e.prev[--t],e.prev[t]=n>=s?n-s:0}while(--r);a+=s}if(0===e.strm.avail_in)break;if(r=x(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(s=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return m(e,l);8===n&&(n=9);var u=new C;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,_(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(_(e,!1),e.strm.avail_out),1)}),new A(4,4,8,4,E),new A(4,5,16,8,E),new A(4,6,32,32,E),new A(4,4,16,16,S),new A(8,16,32,32,S),new A(8,16,128,128,S),new A(8,32,128,256,S),new A(32,128,258,1024,S),new A(32,258,258,4096,S)],r.deflateInit=function(e,t){return T(e,t,8,15,8,0)},r.deflateInit2=T,r.deflateReset=P,r.deflateResetKeep=I,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?l:(e.state.gzhead=t,0):l},r.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>5||t<0)return e?m(e,l):l;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===p&&4!==t)return m(e,0===e.avail_out?-5:l);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,v(i,31),v(i,139),v(i,8),i.gzhead?(v(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),v(i,255&i.gzhead.time),v(i,i.gzhead.time>>8&255),v(i,i.gzhead.time>>16&255),v(i,i.gzhead.time>>24&255),v(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),v(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(v(i,255&i.gzhead.extra.length),v(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(v(i,0),v(i,0),v(i,0),v(i,0),v(i,0),v(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),v(i,3),i.status=d);else{var f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=d,w(i,f),0!==i.strstart&&(w(i,e.adler>>>16),w(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending!==i.pending_buf_size));)v(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&y(e),i.pending+2<=i.pending_buf_size&&(v(i,255&e.adler),v(i,e.adler>>8&255),e.adler=0,i.status=d)):i.status=d),0!==i.pending){if(y(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&g(t)<=g(r)&&4!==t)return m(e,-5);if(i.status===p&&0!==e.avail_in)return m(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==p){var x=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(B(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(_(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=c){if(B(e),e.lookahead<=c&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+c;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(_(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==x&&4!==x||(i.status=p),1===x||3===x)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===x&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(b(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),y(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(v(i,255&e.adler),v(i,e.adler>>8&255),v(i,e.adler>>16&255),v(i,e.adler>>24&255),v(i,255&e.total_in),v(i,e.total_in>>8&255),v(i,e.total_in>>16&255),v(i,e.total_in>>24&255)):(w(i,e.adler>>>16),w(i,65535&e.adler)),y(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},r.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==d&&t!==p?m(e,l):(e.state=null,t===d?m(e,-3):0):l},r.deflateSetDictionary=function(e,t){var r,n,a,s,u,c,f,h,d=t.length;if(!e||!e.state)return l;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return l;for(1===s&&(e.adler=o(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(b(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,d-r.w_size,r.w_size,0),t=h,d=r.w_size),u=e.avail_in,c=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,B(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<>>=v=_>>>24,p-=v,0==(v=_>>>16&255))S[a++]=65535&_;else{if(!(16&v)){if(64&v){if(32&v){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=m[(65535&_)+(d&(1<>>=v,p-=v),p<15&&(d+=E[n++]<>>=v=_>>>24,p-=v,16&(v=_>>>16&255)){if(x=65535&_,p<(v&=15)&&(d+=E[n++]<u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=v,p-=v,x>(v=a-o)){if((v=x-v)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=0,B=h,0===f){if(k+=l-v,v2;)S[a++]=B[k++],S[a++]=B[k++],S[a++]=B[k++],w-=3;w&&(S[a++]=B[k++],w>1&&(S[a++]=B[k++]))}else{k=a-x;do{S[a++]=S[k++],S[a++]=S[k++],S[a++]=S[k++],w-=3}while(w>2);w&&(S[a++]=S[k++],w>1&&(S[a++]=S[k++]))}break}if(64&v){e.msg="invalid distance code",r.mode=30;break e}_=g[(65535&_)+(d&(1<>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function p(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,d(e)):u}function m(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,p(e))):u}function g(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=m(e,t))&&(e.state=null),r):u}var b,y,_=!0;function v(e){if(_){var t;for(b=new n.Buf32(512),y=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,y,0,e.work,{bits:5}),_=!1}e.lencode=b,e.lenbits=9,e.distcode=y,e.distbits=5}function w(e,t,r,i){var a,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),n.arraySet(o.window,t,r-i,a,o.wnext),(i-=a)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=a(r.check,D,2,0),y=0,_=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",r.mode=c;break}if(8!=(15&y)){e.msg="unknown compression method",r.mode=c;break}if(_-=4,R=8+(15&(y>>>=4)),0===r.wbits)r.wbits=R;else if(R>r.wbits){e.msg="invalid window size",r.mode=c;break}r.dmax=1<>8&1),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,_=0,r.mode=3;case 3:for(;_<32;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}r.head&&(r.head.time=y),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,D[2]=y>>>16&255,D[3]=y>>>24&255,r.check=a(r.check,D,4,0)),y=0,_=0,r.mode=4;case 4:for(;_<16;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}r.head&&(r.head.xflags=255&y,r.head.os=y>>8),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,_=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}r.length=y,r.head&&(r.head.extra_len=y),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,_=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((B=r.length)>g&&(B=g),B&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,p,B,R)),512&r.flags&&(r.check=a(r.check,h,B,p)),g-=B,p+=B,r.length-=B),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break e;B=0;do{R=h[p+B++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&B>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=l;break;case 10:for(;_<32;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}e.adler=r.check=f(y),y=0,_=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=m,e.avail_out=b,e.next_in=p,e.avail_in=g,r.hold=y,r.bits=_,2;e.adler=r.check=1,r.mode=l;case l:if(5===t||6===t)break e;case 13:if(r.last){y>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}switch(r.last=1&y,_-=1,3&(y>>>=1)){case 0:r.mode=14;break;case 1:if(v(r),r.mode=20,6===t){y>>>=2,_-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=c}y>>>=2,_-=2;break;case 14:for(y>>>=7&_,_-=7&_;_<32;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if((65535&y)!=(y>>>16^65535)){e.msg="invalid stored block lengths",r.mode=c;break}if(r.length=65535&y,y=0,_=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(B=r.length){if(B>g&&(B=g),B>b&&(B=b),0===B)break e;n.arraySet(d,h,p,B,m),g-=B,p+=B,b-=B,m+=B,r.length-=B;break}r.mode=l;break;case 17:for(;_<14;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(r.nlen=257+(31&y),y>>>=5,_-=5,r.ndist=1+(31&y),y>>>=5,_-=5,r.ncode=4+(15&y),y>>>=4,_-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=c;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,_-=3}for(;r.have<19;)r.lens[z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},F=s(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,F){e.msg="invalid code lengths set",r.mode=c;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,I=65535&L,!((A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(I<16)y>>>=A,_-=A,r.lens[r.have++]=I;else{if(16===I){for(N=A+2;_>>=A,_-=A,0===r.have){e.msg="invalid bit length repeat",r.mode=c;break}R=r.lens[r.have-1],B=3+(3&y),y>>>=2,_-=2}else if(17===I){for(N=A+3;_>>=A)),y>>>=3,_-=3}else{for(N=A+7;_>>=A)),y>>>=7,_-=7}if(r.have+B>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=c;break}for(;B--;)r.lens[r.have++]=R}}if(r.mode===c)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=c;break}if(r.lenbits=9,O={bits:r.lenbits},F=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,F){e.msg="invalid literal/lengths set",r.mode=c;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},F=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,F){e.msg="invalid distances set",r.mode=c;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(g>=6&&b>=258){e.next_out=m,e.avail_out=b,e.next_in=p,e.avail_in=g,r.hold=y,r.bits=_,o(e,k),m=e.next_out,d=e.output,b=e.avail_out,p=e.next_in,h=e.input,g=e.avail_in,y=r.hold,_=r.bits,r.mode===l&&(r.back=-1);break}for(r.back=0;C=(L=r.lencode[y&(1<>>16&255,I=65535&L,!((A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(C&&!(240&C)){for(P=A,T=C,M=I;C=(L=r.lencode[M+((y&(1<>P)])>>>16&255,I=65535&L,!(P+(A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}y>>>=P,_-=P,r.back+=P}if(y>>>=A,_-=A,r.back+=A,r.length=I,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=l;break}if(64&C){e.msg="invalid literal/length code",r.mode=c;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(N=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(L=r.distcode[y&(1<>>16&255,I=65535&L,!((A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(!(240&C)){for(P=A,T=C,M=I;C=(L=r.distcode[M+((y&(1<>P)])>>>16&255,I=65535&L,!(P+(A=L>>>24)<=_);){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}y>>>=P,_-=P,r.back+=P}if(y>>>=A,_-=A,r.back+=A,64&C){e.msg="invalid distance code",r.mode=c;break}r.offset=I,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(N=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=c;break}r.mode=25;case 25:if(0===b)break e;if(B=k-b,r.offset>B){if((B=r.offset-B)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=c;break}B>r.wnext?(B-=r.wnext,E=r.wsize-B):E=r.wnext-B,B>r.length&&(B=r.length),S=r.window}else S=d,E=m-r.offset,B=r.length;B>b&&(B=b),b-=B,r.length-=B;do{d[m++]=S[E++]}while(--B);0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;d[m++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===g)break e;g--,y|=h[p++]<<_,_+=8}if(k-=b,e.total_out+=k,r.total+=k,k&&(e.adler=r.check=r.flags?a(r.check,d,k,m-k):i(r.check,d,k,m-k)),k=b,(r.flags?y:f(y))!==r.check){e.msg="incorrect data check",r.mode=c;break}y=0,_=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===g)break e;g--,y+=h[p++]<<_,_+=8}if(y!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=c;break}y=0,_=0}r.mode=29;case 29:F=1;break e;case c:F=-3;break e;case 31:return-4;default:return u}return e.next_out=m,e.avail_out=b,e.next_in=p,e.avail_in=g,r.hold=y,r.bits=_,(r.wsize||k!==e.avail_out&&r.mode=1&&0===O[S];S--);if(A>S&&(A=S),0===S)return l[c++]=20971520,l[c++]=20971520,h.bits=1,0;for(E=1;E0&&(0===e||1!==S))return-1;for(N[1]=0,k=1;k<15;k++)N[k+1]=N[k]+O[k];for(B=0;B852||2===e&&T>592)return 1;for(;;){_=k-I,f[B]y?(v=L[D+f[B]],w=R[F+f[B]]):(v=96,w=0),d=1<>I)+(p-=d)]=_<<24|v<<16|w}while(0!==p);for(d=1<>=1;if(0!==d?(M&=d-1,M+=d):M=0,B++,0==--O[k]){if(k===S)break;k=t[r+f[B]]}if(k>A&&(M&g)!==m){for(0===I&&(I=A),b+=E,P=1<<(C=k-I);C+I852||2===e&&T>592)return 1;l[m=M&g]=A<<24|C<<16|b-c}}return 0!==M&&(l[b+M]=k-I<<24|64<<16),h.bits=A,0}},{"../utils/common":52}],60:[function(e,t,r){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],61:[function(e,t,r){var n=e("../utils/common");function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=[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],o=[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],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],l=new Array(576);i(l);var c=new Array(60);i(c);var f=new Array(512);i(f);var h=new Array(256);i(h);var d=new Array(29);i(d);var p,m,g,b=new Array(30);function y(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function _(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function v(e){return e<256?f[e]:f[256+(e>>>7)]}function w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function x(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function E(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=15;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=B(a[s]++,s))}}function S(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function A(e){e.bi_valid>8?w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function C(e,t,r,i){A(e),w(e,r),w(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function I(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)P(e,a,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],P(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,P(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,u=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(a=0;a<=15;a++)e.bl_count[a]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=u[2*u[2*(n=e.heap[r])+1]+1]+1)>p&&(a=p,m++),u[2*n+1]=a,n>l||(e.bl_count[a]++,o=0,n>=d&&(o=h[n-d]),s=u[2*n],e.opt_len+=s*(a+o),f&&(e.static_len+=s*(c[2*n+1]+o)));if(0!==m){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>l||(u[2*i+1]!==a&&(e.opt_len+=(a-u[2*i+1])*u[2*i],u[2*i+1]=a),n--)}}(e,t),E(a,l,e.bl_count)}function R(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,l=4;for(0===o&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>=7;n<30;n++)for(b[n]=i<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),M(e,e.l_desc),M(e,e.d_desc),o=function(e){var t;for(R(e,e.dyn_ltree,e.l_desc.max_code),R(e,e.dyn_dtree,e.d_desc.max_code),M(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*u[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?N(e,t,r,n):4===e.strategy||a===i?(x(e,2+(n?1:0),3),T(e,l,c)):(x(e,4+(n?1:0),3),function(e,t,r,n){var i;for(x(e,t-257,5),x(e,r-1,5),x(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(h[r]+256+1)]++,e.dyn_dtree[2*v(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){x(e,2,3),k(e,256,l),function(e){16===e.bi_valid?(w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":52}],62:[function(e,t,r){t.exports=function(){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}},{}],63:[function(e,t,r){var n,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var l,c=[],f=!1,h=-1;function d(){f&&l&&(f=!1,l.length?c=l.concat(c):h=-1,c.length&&p())}function p(){if(!f){var e=u(d);f=!0;for(var t=c.length;t;){for(l=c,c=[];++h1)for(var r=1;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,r){var n,i;if("string"==typeof t&&function(e,t){return e.substr(0,4)===t}(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))i="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var o=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+1>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(a(t,"type"))}return i+". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],67:[function(e,t,r){(function(r){(function(){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(l,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?x(e,new w):A(e,s,t,!0);else if(s.ended)x(e,new _);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?A(e,s,t,!1):M(e,s)):A(e,s,t,!1)}else n||(s.reading=!1,M(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(T,e))}function T(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function M(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function O(e){a("readable nexttick read 0"),e.read(0)}function N(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function z(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(U,t,e))}function U(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function $(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?z(this):P(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&z(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&z(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){x(this,new v("_read()"))},E.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,a("pipe count=%d opts=%j",i.pipesCount,t);var s=t&&!1===t.end||e===r.stdout||e===r.stderr?b:l;function u(e,t){a("onunpipe"),e===n&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function l(){a("onend"),e.end()}i.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",u);var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,L(e))}}(n);e.on("drain",c);var f=!1;function h(){a("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",u),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c()}function d(t){a("ondata");var r=e.write(t);a("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==$(i.pipes,e))&&!f&&(a("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(t){a("onerror",t),b(),e.removeListener("error",p),0===o(e,"error")&&x(e,t)}function m(){e.removeListener("finish",g),b()}function g(){a("onfinish"),e.removeListener("close",m),b()}function b(){a("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",m),e.once("finish",g),e.emit("pipe",n),i.flowing||(a("pipe resume"),n.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?P(this):i.reading||r.nextTick(O,this))),n},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(F,this),n},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(F,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(N,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new m("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||L(this,n,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":66,"./_stream_duplex":67,"./internal/streams/destroy":74,"./internal/streams/state":78,"./internal/streams/stream":79,_process:63,buffer:32,inherits:46,"util-deprecate":81}],72:[function(e,t,r){(function(r){(function(){var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var r=e[h].read();null!==r&&(e[c]=null,e[o]=null,e[s]=null,t(d(r,!1)))}}function m(e){r.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((n={get stream(){return this[h]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise(function(t,n){r.nextTick(function(){e[u]?n(e[u]):t(d(void 0,!0))})});var n,i=this[c];if(i)n=new Promise(function(e,t){return function(r,n){e.then(function(){t[l]?r(d(void 0,!0)):t[f](r,n)},n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(d(a,!1));n=new Promise(this[f])}return this[c]=n,n}},i(n,Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),n),g);t.exports=function(e){var t,r=Object.create(b,(i(t={},h,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,l,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read();n?(r[c]=null,r[o]=null,r[s]=null,e(d(n,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[c]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[c]=null,r[o]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[o];null!==n&&(r[c]=null,r[o]=null,r[s]=null,n(d(void 0,!0))),r[l]=!0}),e.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":75,_process:63}],73:[function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("buffer").Buffer,o=e("util").inspect,s=o&&o.custom||"inspect";function u(e,t,r){a.prototype.copy.call(e,t,r)}t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return function(e,t){t&&function(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),r=this.head,n=0;r;)u(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0==(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return o(this,function(e){for(var t=1;t0,function(e){n||(n=e),e&&o.forEach(l),a||(o.forEach(l),i(n))})});return t.reduce(c)}},{"../../../errors":66,"./end-of-stream":75}],78:[function(e,t,r){var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":66}],79:[function(e,t,r){t.exports=e("events").EventEmitter},{events:35}],80:[function(e,t,r){var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":64}],81:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],82:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],83:[function(e,t,r){var n=e("is-arguments"),i=e("is-generator-function"),a=e("which-typed-array"),o=e("is-typed-array");function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,c=s(Object.prototype.toString),f=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(l)var m=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function b(e){return"[object Map]"===c(e)}function y(e){return"[object Set]"===c(e)}function _(e){return"[object WeakMap]"===c(e)}function v(e){return"[object WeakSet]"===c(e)}function w(e){return"[object ArrayBuffer]"===c(e)}function x(e){return"undefined"!=typeof ArrayBuffer&&(w.working?w(e):e instanceof ArrayBuffer)}function k(e){return"[object DataView]"===c(e)}function B(e){return"undefined"!=typeof DataView&&(k.working?k(e):e instanceof DataView)}r.isArgumentsObject=n,r.isGeneratorFunction=i,r.isTypedArray=o,r.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},r.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||B(e)},r.isUint8Array=function(e){return"Uint8Array"===a(e)},r.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},r.isUint16Array=function(e){return"Uint16Array"===a(e)},r.isUint32Array=function(e){return"Uint32Array"===a(e)},r.isInt8Array=function(e){return"Int8Array"===a(e)},r.isInt16Array=function(e){return"Int16Array"===a(e)},r.isInt32Array=function(e){return"Int32Array"===a(e)},r.isFloat32Array=function(e){return"Float32Array"===a(e)},r.isFloat64Array=function(e){return"Float64Array"===a(e)},r.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},r.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},b.working="undefined"!=typeof Map&&b(new Map),r.isMap=function(e){return"undefined"!=typeof Map&&(b.working?b(e):e instanceof Map)},y.working="undefined"!=typeof Set&&y(new Set),r.isSet=function(e){return"undefined"!=typeof Set&&(y.working?y(e):e instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),r.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(_.working?_(e):e instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),r.isWeakSet=function(e){return v(e)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),r.isArrayBuffer=x,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),r.isDataView=B;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function S(e){return"[object SharedArrayBuffer]"===c(e)}function A(e){return void 0!==E&&(void 0===S.working&&(S.working=S(new E)),S.working?S(e):e instanceof E)}function C(e){return g(e,f)}function I(e){return g(e,h)}function P(e){return g(e,d)}function T(e){return u&&g(e,p)}function M(e){return l&&g(e,m)}r.isSharedArrayBuffer=A,r.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},r.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},r.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},r.isGeneratorObject=function(e){return"[object Generator]"===c(e)},r.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},r.isNumberObject=C,r.isStringObject=I,r.isBooleanObject=P,r.isBigIntObject=T,r.isSymbolObject=M,r.isBoxedPrimitive=function(e){return C(e)||I(e)||P(e)||T(e)||M(e)},r.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(x(e)||A(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(r,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},{"is-arguments":47,"is-generator-function":49,"is-typed-array":50,"which-typed-array":85}],84:[function(e,t,r){(function(t){(function(){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(t)?n.showHidden=t:t&&r._extend(n,t),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),f(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function c(e,t){return e}function f(e,t,n){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return _(i)||(i=f(e,i,n)),i}var a=h(e,t);if(a)return a;var o=Object.keys(t),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),B(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return d(t);if(0===o.length){if(E(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(B(t))return d(t)}var l,c="",g=!1,b=["{","}"];return m(t)&&(g=!0,b=["[","]"]),E(t)&&(c=" [Function"+(t.name?": "+t.name:"")+"]"),w(t)&&(c=" "+RegExp.prototype.toString.call(t)),k(t)&&(c=" "+Date.prototype.toUTCString.call(t)),B(t)&&(c=" "+d(t)),0!==o.length||g&&0!=t.length?n<0?w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=g?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,b)):b[0]+c+b[1]}function h(e,t){if(v(t))return e.stylize("undefined","undefined");if(_(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return y(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),I(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function m(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function b(e){return null===e}function y(e){return"number"==typeof e}function _(e){return"string"==typeof e}function v(e){return void 0===e}function w(e){return x(e)&&"[object RegExp]"===S(e)}function x(e){return"object"==typeof e&&null!==e}function k(e){return x(e)&&"[object Date]"===S(e)}function B(e){return x(e)&&("[object Error]"===S(e)||e instanceof Error)}function E(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(o.test(e)){var n=t.pid;a[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else a[e]=function(){};return a[e]},r.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.types=e("./support/types"),r.isArray=m,r.isBoolean=g,r.isNull=b,r.isNullOrUndefined=function(e){return null==e},r.isNumber=y,r.isString=_,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=v,r.isRegExp=w,r.types.isRegExp=w,r.isObject=x,r.isDate=k,r.types.isDate=k,r.isError=B,r.types.isNativeError=B,r.isFunction=E,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log("%s - %s",function(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}r.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],a=0;a{const s=new browserExports.PNG({width:e.width,height:e.height});return s.data=e.data,browserExports.PNG.sync.write(s,{...o,deflateLevel:t,deflateStrategy:r,filterType:n,colorType:void 0!==i?i:a?PNGColorType.COLOR_ALPHA:PNGColorType.COLOR,inputHasAlpha:a})},decode:(e,t)=>{const r=browserExports.PNG.sync.read(e,t);return{data:r.data,width:r.width,height:r.height}}}}PNGFilterType2=PNGFilterType||(PNGFilterType={}),PNGFilterType2[PNGFilterType2.AUTO=-1]="AUTO",PNGFilterType2[PNGFilterType2.NONE=0]="NONE",PNGFilterType2[PNGFilterType2.SUB=1]="SUB",PNGFilterType2[PNGFilterType2.UP=2]="UP",PNGFilterType2[PNGFilterType2.AVERAGE=3]="AVERAGE",PNGFilterType2[PNGFilterType2.PATH=4]="PATH",PNGColorType2=PNGColorType||(PNGColorType={}),PNGColorType2[PNGColorType2.GRAYSCALE=0]="GRAYSCALE",PNGColorType2[PNGColorType2.COLOR=2]="COLOR",PNGColorType2[PNGColorType2.GRAYSCALE_ALPHA=4]="GRAYSCALE_ALPHA",PNGColorType2[PNGColorType2.COLOR_ALPHA=6]="COLOR_ALPHA";var UTIF={exports:{}},common={},hasRequiredCommon;function requireCommon(){return hasRequiredCommon||(hasRequiredCommon=1,function(e){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a=0;)e[t]=0}var r=[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],n=[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],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],a=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],o=new Array(576);t(o);var s=new Array(60);t(s);var u=new Array(512);t(u);var l=new Array(256);t(l);var c=new Array(29);t(c);var f,h,d,p=new Array(30);function m(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function g(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function b(e){return e<256?u[e]:u[256+(e>>>7)]}function y(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function _(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function x(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=15;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=w(a[s]++,s))}}function k(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function B(e){e.bi_valid>8?y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function E(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)S(e,a,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],S(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,S(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,u=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(a=0;a<=15;a++)e.bl_count[a]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=u[2*u[2*(n=e.heap[r])+1]+1]+1)>p&&(a=p,m++),u[2*n+1]=a,n>l||(e.bl_count[a]++,o=0,n>=d&&(o=h[n-d]),s=u[2*n],e.opt_len+=s*(a+o),f&&(e.static_len+=s*(c[2*n+1]+o)));if(0!==m){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>l||(u[2*i+1]!==a&&(e.opt_len+=(a-u[2*i+1])*u[2*i],u[2*i+1]=a),n--)}}(e,t),x(a,l,e.bl_count)}function I(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,l=4;for(0===o&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>=7;g<30;g++)for(p[g]=b<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),C(e,e.l_desc),C(e,e.d_desc),l=function(e){var t;for(I(e,e.dyn_ltree,e.l_desc.max_code),I(e,e.dyn_dtree,e.d_desc.max_code),C(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*a[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=i&&(i=u)):i=u=r+5,r+4<=i&&-1!==t?M(e,t,r,n):4===e.strategy||u===i?(_(e,2+(n?1:0),3),A(e,o,s)):(_(e,4+(n?1:0),3),function(e,t,r,n){var i;for(_(e,t-257,5),_(e,r-1,5),_(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(l[r]+256+1)]++,e.dyn_dtree[2*b(t)]++),e.last_lit===e.lit_bufsize-1},trees._tr_align=function(e){_(e,2,3),v(e,256,o),function(e){16===e.bi_valid?(y(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)},trees}function requireAdler32(){return hasRequiredAdler32||(hasRequiredAdler32=1,adler32_1=function(e,t,r,n){for(var i=65535&e,a=e>>>16&65535,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16}),adler32_1}function requireCrc32(){if(hasRequiredCrc32)return crc32_1;hasRequiredCrc32=1;var e=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();return crc32_1=function(t,r,n,i){var a=e,o=i+n;t^=-1;for(var s=i;s>>8^a[255&(t^r[s])];return~t},crc32_1}function requireMessages(){return hasRequiredMessages?messages:(hasRequiredMessages=1,messages={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"})}function requireDeflate$1(){if(hasRequiredDeflate$1)return deflate;hasRequiredDeflate$1=1;var e,t=requireCommon(),r=requireTrees(),n=requireAdler32(),i=requireCrc32(),a=requireMessages(),o=-2,s=258,u=262,l=103,c=113,f=666;function h(e,t){return e.msg=a[t],t}function d(e){return(e<<1)-(e>4?9:0)}function p(e){for(var t=e.length;--t>=0;)e[t]=0}function m(e){var r=e.state,n=r.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(t.arraySet(e.output,r.pending_buf,r.pending_out,n,e.next_out),e.next_out+=n,r.pending_out+=n,e.total_out+=n,e.avail_out-=n,r.pending-=n,0===r.pending&&(r.pending_out=0))}function g(e,t){r._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function b(e,t){e.pending_buf[e.pending++]=t}function y(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function _(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,l=e.nice_match,c=e.strstart>e.w_size-u?e.strstart-(e.w_size-u):0,f=e.window,h=e.w_mask,d=e.prev,p=e.strstart+s,m=f[a+o-1],g=f[a+o];e.prev_length>=e.good_match&&(i>>=2),l>e.lookahead&&(l=e.lookahead);do{if(f[(r=t)+o]===g&&f[r+o-1]===m&&f[r]===f[a]&&f[++r]===f[a+1]){a+=2,r++;do{}while(f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&ao){if(e.match_start=t,o=n,n>=l)break;m=f[a+o-1],g=f[a+o]}}}while((t=d[t&h])>c&&0!=--i);return o<=e.lookahead?o:e.lookahead}function v(e){var r,a,o,s,l,c,f,h,d,p,m=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-u)){t.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,r=a=e.hash_size;do{o=e.head[--r],e.head[r]=o>=m?o-m:0}while(--a);r=a=m;do{o=e.prev[--r],e.prev[r]=o>=m?o-m:0}while(--a);s+=m}if(0===e.strm.avail_in)break;if(c=e.strm,f=e.window,h=e.strstart+e.lookahead,d=s,p=void 0,(p=c.avail_in)>d&&(p=d),a=0===p?0:(c.avail_in-=p,t.arraySet(f,c.input,c.next_in,p,h),1===c.state.wrap?c.adler=n(c.adler,f,p,h):2===c.state.wrap&&(c.adler=i(c.adler,f,p,h)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=a,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(i=r._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,i=r._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=(e.ins_h<15&&(u=2,i-=16),a<1||a>9||8!==n||i<8||i>15||r<0||r>9||s<0||s>4)return h(e,o);8===i&&(i=9);var l=new B;return e.state=l,l.strm=e,l.wrap=u,l.gzhead=null,l.w_bits=i,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(v(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,g(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-u&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(g(e,!1),e.strm.avail_out),1)}),new k(4,4,8,4,w),new k(4,5,16,8,w),new k(4,6,32,32,w),new k(4,4,16,16,x),new k(8,16,32,32,x),new k(8,16,128,128,x),new k(8,32,128,256,x),new k(32,128,258,1024,x),new k(32,258,258,4096,x)],deflate.deflateInit=function(e,t){return A(e,t,8,15,8,0)},deflate.deflateInit2=A,deflate.deflateReset=S,deflate.deflateResetKeep=E,deflate.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?o:(e.state.gzhead=t,0):o},deflate.deflate=function(t,n){var a,u,_,w;if(!t||!t.state||n>5||n<0)return t?h(t,o):o;if(u=t.state,!t.output||!t.input&&0!==t.avail_in||u.status===f&&4!==n)return h(t,0===t.avail_out?-5:o);if(u.strm=t,a=u.last_flush,u.last_flush=n,42===u.status)if(2===u.wrap)t.adler=0,b(u,31),b(u,139),b(u,8),u.gzhead?(b(u,(u.gzhead.text?1:0)+(u.gzhead.hcrc?2:0)+(u.gzhead.extra?4:0)+(u.gzhead.name?8:0)+(u.gzhead.comment?16:0)),b(u,255&u.gzhead.time),b(u,u.gzhead.time>>8&255),b(u,u.gzhead.time>>16&255),b(u,u.gzhead.time>>24&255),b(u,9===u.level?2:u.strategy>=2||u.level<2?4:0),b(u,255&u.gzhead.os),u.gzhead.extra&&u.gzhead.extra.length&&(b(u,255&u.gzhead.extra.length),b(u,u.gzhead.extra.length>>8&255)),u.gzhead.hcrc&&(t.adler=i(t.adler,u.pending_buf,u.pending,0)),u.gzindex=0,u.status=69):(b(u,0),b(u,0),b(u,0),b(u,0),b(u,0),b(u,9===u.level?2:u.strategy>=2||u.level<2?4:0),b(u,3),u.status=c);else{var x=8+(u.w_bits-8<<4)<<8;x|=(u.strategy>=2||u.level<2?0:u.level<6?1:6===u.level?2:3)<<6,0!==u.strstart&&(x|=32),x+=31-x%31,u.status=c,y(u,x),0!==u.strstart&&(y(u,t.adler>>>16),y(u,65535&t.adler)),t.adler=1}if(69===u.status)if(u.gzhead.extra){for(_=u.pending;u.gzindex<(65535&u.gzhead.extra.length)&&(u.pending!==u.pending_buf_size||(u.gzhead.hcrc&&u.pending>_&&(t.adler=i(t.adler,u.pending_buf,u.pending-_,_)),m(t),_=u.pending,u.pending!==u.pending_buf_size));)b(u,255&u.gzhead.extra[u.gzindex]),u.gzindex++;u.gzhead.hcrc&&u.pending>_&&(t.adler=i(t.adler,u.pending_buf,u.pending-_,_)),u.gzindex===u.gzhead.extra.length&&(u.gzindex=0,u.status=73)}else u.status=73;if(73===u.status)if(u.gzhead.name){_=u.pending;do{if(u.pending===u.pending_buf_size&&(u.gzhead.hcrc&&u.pending>_&&(t.adler=i(t.adler,u.pending_buf,u.pending-_,_)),m(t),_=u.pending,u.pending===u.pending_buf_size)){w=1;break}w=u.gzindex_&&(t.adler=i(t.adler,u.pending_buf,u.pending-_,_)),0===w&&(u.gzindex=0,u.status=91)}else u.status=91;if(91===u.status)if(u.gzhead.comment){_=u.pending;do{if(u.pending===u.pending_buf_size&&(u.gzhead.hcrc&&u.pending>_&&(t.adler=i(t.adler,u.pending_buf,u.pending-_,_)),m(t),_=u.pending,u.pending===u.pending_buf_size)){w=1;break}w=u.gzindex_&&(t.adler=i(t.adler,u.pending_buf,u.pending-_,_)),0===w&&(u.status=l)}else u.status=l;if(u.status===l&&(u.gzhead.hcrc?(u.pending+2>u.pending_buf_size&&m(t),u.pending+2<=u.pending_buf_size&&(b(u,255&t.adler),b(u,t.adler>>8&255),t.adler=0,u.status=c)):u.status=c),0!==u.pending){if(m(t),0===t.avail_out)return u.last_flush=-1,0}else if(0===t.avail_in&&d(n)<=d(a)&&4!==n)return h(t,-5);if(u.status===f&&0!==t.avail_in)return h(t,-5);if(0!==t.avail_in||0!==u.lookahead||0!==n&&u.status!==f){var k=2===u.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(v(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=r._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}(u,n):3===u.strategy?function(e,t){for(var n,i,a,o,u=e.window;;){if(e.lookahead<=s){if(v(e),e.lookahead<=s&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=u[a=e.strstart-1])===u[++a]&&i===u[++a]&&i===u[++a]){o=e.strstart+s;do{}while(i===u[++a]&&i===u[++a]&&i===u[++a]&&i===u[++a]&&i===u[++a]&&i===u[++a]&&i===u[++a]&&i===u[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=r._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=r._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}(u,n):e[u.level].func(u,n);if(3!==k&&4!==k||(u.status=f),1===k||3===k)return 0===t.avail_out&&(u.last_flush=-1),0;if(2===k&&(1===n?r._tr_align(u):5!==n&&(r._tr_stored_block(u,0,0,!1),3===n&&(p(u.head),0===u.lookahead&&(u.strstart=0,u.block_start=0,u.insert=0))),m(t),0===t.avail_out))return u.last_flush=-1,0}return 4!==n?0:u.wrap<=0?1:(2===u.wrap?(b(u,255&t.adler),b(u,t.adler>>8&255),b(u,t.adler>>16&255),b(u,t.adler>>24&255),b(u,255&t.total_in),b(u,t.total_in>>8&255),b(u,t.total_in>>16&255),b(u,t.total_in>>24&255)):(y(u,t.adler>>>16),y(u,65535&t.adler)),m(t),u.wrap>0&&(u.wrap=-u.wrap),0!==u.pending?0:1)},deflate.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==l&&t!==c&&t!==f?h(e,o):(e.state=null,t===c?h(e,-3):0):o},deflate.deflateSetDictionary=function(e,r){var i,a,s,u,l,c,f,h,d=r.length;if(!e||!e.state)return o;if(2===(u=(i=e.state).wrap)||1===u&&42!==i.status||i.lookahead)return o;for(1===u&&(e.adler=n(e.adler,r,d,0)),i.wrap=0,d>=i.w_size&&(0===u&&(p(i.head),i.strstart=0,i.block_start=0,i.insert=0),h=new t.Buf8(i.w_size),t.arraySet(h,r,d-i.w_size,i.w_size,0),r=h,d=i.w_size),l=e.avail_in,c=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=r,v(i);i.lookahead>=3;){a=i.strstart,s=i.lookahead-2;do{i.ins_h=(i.ins_h<=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;function a(n,i){if(i<65534&&(n.subarray&&r||!n.subarray&&t))return String.fromCharCode.apply(null,e.shrinkBuf(n,i));for(var a="",o=0;o>>6,r[o++]=128|63&n):n<65536?(r[o++]=224|n>>>12,r[o++]=128|n>>>6&63,r[o++]=128|63&n):(r[o++]=240|n>>>18,r[o++]=128|n>>>12&63,r[o++]=128|n>>>6&63,r[o++]=128|63&n);return r},strings.buf2binstring=function(e){return a(e,e.length)},strings.binstring2buf=function(t){for(var r=new e.Buf8(t.length),n=0,i=r.length;n4)l[i++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r1?l[i++]=65533:o<65536?l[i++]=o:(o-=65536,l[i++]=55296|o>>10&1023,l[i++]=56320|1023&o)}return a(l,i)},strings.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+n[e[r]]>t?r:t},strings}function requireZstream(){return hasRequiredZstream?zstream:(hasRequiredZstream=1,zstream=function(){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})}function requireDeflate(){if(hasRequiredDeflate)return deflate$1;hasRequiredDeflate=1;var e=requireDeflate$1(),t=requireCommon(),r=requireStrings(),n=requireMessages(),i=requireZstream(),a=Object.prototype.toString;function o(s){if(!(this instanceof o))return new o(s);this.options=t.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},s||{});var u=this.options;u.raw&&u.windowBits>0?u.windowBits=-u.windowBits:u.gzip&&u.windowBits>0&&u.windowBits<16&&(u.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var l=e.deflateInit2(this.strm,u.level,u.method,u.windowBits,u.memLevel,u.strategy);if(0!==l)throw new Error(n[l]);if(u.header&&e.deflateSetHeader(this.strm,u.header),u.dictionary){var c;if(c="string"==typeof u.dictionary?r.string2buf(u.dictionary):"[object ArrayBuffer]"===a.call(u.dictionary)?new Uint8Array(u.dictionary):u.dictionary,0!==(l=e.deflateSetDictionary(this.strm,c)))throw new Error(n[l]);this._dict_set=!0}}function s(e,t){var r=new o(t);if(r.push(e,!0),r.err)throw r.msg||n[r.err];return r.result}return o.prototype.push=function(n,i){var o,s,u=this.strm,l=this.options.chunkSize;if(this.ended)return!1;s=i===~~i?i:!0===i?4:0,"string"==typeof n?u.input=r.string2buf(n):"[object ArrayBuffer]"===a.call(n)?u.input=new Uint8Array(n):u.input=n,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new t.Buf8(l),u.next_out=0,u.avail_out=l),1!==(o=e.deflate(u,s))&&0!==o)return this.onEnd(o),this.ended=!0,!1;0!==u.avail_out&&(0!==u.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(r.buf2binstring(t.shrinkBuf(u.output,u.next_out))):this.onData(t.shrinkBuf(u.output,u.next_out)))}while((u.avail_in>0||0===u.avail_out)&&1!==o);return 4===s?(o=e.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,0===o):2!==s||(this.onEnd(0),u.avail_out=0,!0)},o.prototype.onData=function(e){this.chunks.push(e)},o.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},deflate$1.Deflate=o,deflate$1.deflate=s,deflate$1.deflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},deflate$1.gzip=function(e,t){return(t=t||{}).gzip=!0,s(e,t)},deflate$1}var inflate$1={},inflate={},inffast,hasRequiredInffast,inftrees,hasRequiredInftrees,hasRequiredInflate$1,constants,hasRequiredConstants,gzheader,hasRequiredGzheader,hasRequiredInflate,pako_1,hasRequiredPako;function requireInffast(){return hasRequiredInffast||(hasRequiredInffast=1,inffast=function(e,t){var r,n,i,a,o,s,u,l,c,f,h,d,p,m,g,b,y,_,v,w,x,k,B,E,S;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),a=e.next_out,S=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),u=r.dmax,l=r.wsize,c=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,m=r.lencode,g=r.distcode,b=(1<>>=v=_>>>24,p-=v,0==(v=_>>>16&255))S[a++]=65535&_;else{if(!(16&v)){if(64&v){if(32&v){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=m[(65535&_)+(d&(1<>>=v,p-=v),p<15&&(d+=E[n++]<>>=v=_>>>24,p-=v,16&(v=_>>>16&255)){if(x=65535&_,p<(v&=15)&&(d+=E[n++]<u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=v,p-=v,x>(v=a-o)){if((v=x-v)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=0,B=h,0===f){if(k+=l-v,v2;)S[a++]=B[k++],S[a++]=B[k++],S[a++]=B[k++],w-=3;w&&(S[a++]=B[k++],w>1&&(S[a++]=B[k++]))}else{k=a-x;do{S[a++]=S[k++],S[a++]=S[k++],S[a++]=S[k++],w-=3}while(w>2);w&&(S[a++]=S[k++],w>1&&(S[a++]=S[k++]))}break}if(64&v){e.msg="invalid distance code",r.mode=30;break e}_=g[(65535&_)+(d&(1<>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n=1&&0===O[S];S--);if(A>S&&(A=S),0===S)return l[c++]=20971520,l[c++]=20971520,h.bits=1,0;for(E=1;E0&&(0===a||1!==S))return-1;for(N[1]=0,k=1;k<15;k++)N[k+1]=N[k]+O[k];for(B=0;B852||2===a&&T>592)return 1;for(;;){_=k-I,f[B]y?(v=L[D+f[B]],w=R[F+f[B]]):(v=96,w=0),d=1<>I)+(p-=d)]=_<<24|v<<16|w}while(0!==p);for(d=1<>=1;if(0!==d?(M&=d-1,M+=d):M=0,B++,0==--O[k]){if(k===S)break;k=o[s+f[B]]}if(k>A&&(M&g)!==m){for(0===I&&(I=A),b+=E,P=1<<(C=k-I);C+I852||2===a&&T>592)return 1;l[m=M&g]=A<<24|C<<16|b-c}}return 0!==M&&(l[b+M]=k-I<<24|64<<16),h.bits=A,0}}function requireInflate$1(){if(hasRequiredInflate$1)return inflate;hasRequiredInflate$1=1;var e=requireCommon(),t=requireAdler32(),r=requireCrc32(),n=requireInffast(),i=requireInftrees(),a=-2,o=12,s=30;function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){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 e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(t){var r;return t&&t.state?(r=t.state,t.total_in=t.total_out=r.total=0,t.msg="",r.wrap&&(t.adler=1&r.wrap),r.mode=1,r.last=0,r.havedict=0,r.dmax=32768,r.head=null,r.hold=0,r.bits=0,r.lencode=r.lendyn=new e.Buf32(852),r.distcode=r.distdyn=new e.Buf32(592),r.sane=1,r.back=-1,0):a}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,c(e)):a}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?a:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,f(e))):a}function d(e,t){var r,n;return e?(n=new l,e.state=n,n.window=null,0!==(r=h(e,t))&&(e.state=null),r):a}var p,m,g=!0;function b(t){if(g){var r;for(p=new e.Buf32(512),m=new e.Buf32(32),r=0;r<144;)t.lens[r++]=8;for(;r<256;)t.lens[r++]=9;for(;r<280;)t.lens[r++]=7;for(;r<288;)t.lens[r++]=8;for(i(1,t.lens,0,288,p,0,t.work,{bits:9}),r=0;r<32;)t.lens[r++]=5;i(2,t.lens,0,32,m,0,t.work,{bits:5}),g=!1}t.lencode=p,t.lenbits=9,t.distcode=m,t.distbits=5}function y(t,r,n,i){var a,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(e.arraySet(o.window,r,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),e.arraySet(o.window,r,n-i,a,o.wnext),(i-=a)?(e.arraySet(o.window,r,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,f.check=r(f.check,D,2,0),v=0,w=0,f.mode=2;break}if(f.flags=0,f.head&&(f.head.done=!1),!(1&f.wrap)||(((255&v)<<8)+(v>>8))%31){l.msg="incorrect header check",f.mode=s;break}if(8!=(15&v)){l.msg="unknown compression method",f.mode=s;break}if(w-=4,R=8+(15&(v>>>=4)),0===f.wbits)f.wbits=R;else if(R>f.wbits){l.msg="invalid window size",f.mode=s;break}f.dmax=1<>8&1),512&f.flags&&(D[0]=255&v,D[1]=v>>>8&255,f.check=r(f.check,D,2,0)),v=0,w=0,f.mode=3;case 3:for(;w<32;){if(0===g)break e;g--,v+=h[p++]<>>8&255,D[2]=v>>>16&255,D[3]=v>>>24&255,f.check=r(f.check,D,4,0)),v=0,w=0,f.mode=4;case 4:for(;w<16;){if(0===g)break e;g--,v+=h[p++]<>8),512&f.flags&&(D[0]=255&v,D[1]=v>>>8&255,f.check=r(f.check,D,2,0)),v=0,w=0,f.mode=5;case 5:if(1024&f.flags){for(;w<16;){if(0===g)break e;g--,v+=h[p++]<>>8&255,f.check=r(f.check,D,2,0)),v=0,w=0}else f.head&&(f.head.extra=null);f.mode=6;case 6:if(1024&f.flags&&((B=f.length)>g&&(B=g),B&&(f.head&&(R=f.head.extra_len-f.length,f.head.extra||(f.head.extra=new Array(f.head.extra_len)),e.arraySet(f.head.extra,h,p,B,R)),512&f.flags&&(f.check=r(f.check,h,B,p)),g-=B,p+=B,f.length-=B),f.length))break e;f.length=0,f.mode=7;case 7:if(2048&f.flags){if(0===g)break e;B=0;do{R=h[p+B++],f.head&&R&&f.length<65536&&(f.head.name+=String.fromCharCode(R))}while(R&&B>9&1,f.head.done=!0),l.adler=f.check=0,f.mode=o;break;case 10:for(;w<32;){if(0===g)break e;g--,v+=h[p++]<>>=7&w,w-=7&w,f.mode=27;break}for(;w<3;){if(0===g)break e;g--,v+=h[p++]<>>=1)){case 0:f.mode=14;break;case 1:if(b(f),f.mode=20,6===c){v>>>=2,w-=2;break e}break;case 2:f.mode=17;break;case 3:l.msg="invalid block type",f.mode=s}v>>>=2,w-=2;break;case 14:for(v>>>=7&w,w-=7&w;w<32;){if(0===g)break e;g--,v+=h[p++]<>>16^65535)){l.msg="invalid stored block lengths",f.mode=s;break}if(f.length=65535&v,v=0,w=0,f.mode=15,6===c)break e;case 15:f.mode=16;case 16:if(B=f.length){if(B>g&&(B=g),B>_&&(B=_),0===B)break e;e.arraySet(d,h,p,B,m),g-=B,p+=B,_-=B,m+=B,f.length-=B;break}f.mode=o;break;case 17:for(;w<14;){if(0===g)break e;g--,v+=h[p++]<>>=5,w-=5,f.ndist=1+(31&v),v>>>=5,w-=5,f.ncode=4+(15&v),v>>>=4,w-=4,f.nlen>286||f.ndist>30){l.msg="too many length or distance symbols",f.mode=s;break}f.have=0,f.mode=18;case 18:for(;f.have>>=3,w-=3}for(;f.have<19;)f.lens[z[f.have++]]=0;if(f.lencode=f.lendyn,f.lenbits=7,O={bits:f.lenbits},F=i(0,f.lens,0,19,f.lencode,0,f.work,O),f.lenbits=O.bits,F){l.msg="invalid code lengths set",f.mode=s;break}f.have=0,f.mode=19;case 19:for(;f.have>>16&255,I=65535&L,!((A=L>>>24)<=w);){if(0===g)break e;g--,v+=h[p++]<>>=A,w-=A,f.lens[f.have++]=I;else{if(16===I){for(N=A+2;w>>=A,w-=A,0===f.have){l.msg="invalid bit length repeat",f.mode=s;break}R=f.lens[f.have-1],B=3+(3&v),v>>>=2,w-=2}else if(17===I){for(N=A+3;w>>=A)),v>>>=3,w-=3}else{for(N=A+7;w>>=A)),v>>>=7,w-=7}if(f.have+B>f.nlen+f.ndist){l.msg="invalid bit length repeat",f.mode=s;break}for(;B--;)f.lens[f.have++]=R}}if(f.mode===s)break;if(0===f.lens[256]){l.msg="invalid code -- missing end-of-block",f.mode=s;break}if(f.lenbits=9,O={bits:f.lenbits},F=i(1,f.lens,0,f.nlen,f.lencode,0,f.work,O),f.lenbits=O.bits,F){l.msg="invalid literal/lengths set",f.mode=s;break}if(f.distbits=6,f.distcode=f.distdyn,O={bits:f.distbits},F=i(2,f.lens,f.nlen,f.ndist,f.distcode,0,f.work,O),f.distbits=O.bits,F){l.msg="invalid distances set",f.mode=s;break}if(f.mode=20,6===c)break e;case 20:f.mode=21;case 21:if(g>=6&&_>=258){l.next_out=m,l.avail_out=_,l.next_in=p,l.avail_in=g,f.hold=v,f.bits=w,n(l,k),m=l.next_out,d=l.output,_=l.avail_out,p=l.next_in,h=l.input,g=l.avail_in,v=f.hold,w=f.bits,f.mode===o&&(f.back=-1);break}for(f.back=0;C=(L=f.lencode[v&(1<>>16&255,I=65535&L,!((A=L>>>24)<=w);){if(0===g)break e;g--,v+=h[p++]<>P)])>>>16&255,I=65535&L,!(P+(A=L>>>24)<=w);){if(0===g)break e;g--,v+=h[p++]<>>=P,w-=P,f.back+=P}if(v>>>=A,w-=A,f.back+=A,f.length=I,0===C){f.mode=26;break}if(32&C){f.back=-1,f.mode=o;break}if(64&C){l.msg="invalid literal/length code",f.mode=s;break}f.extra=15&C,f.mode=22;case 22:if(f.extra){for(N=f.extra;w>>=f.extra,w-=f.extra,f.back+=f.extra}f.was=f.length,f.mode=23;case 23:for(;C=(L=f.distcode[v&(1<>>16&255,I=65535&L,!((A=L>>>24)<=w);){if(0===g)break e;g--,v+=h[p++]<>P)])>>>16&255,I=65535&L,!(P+(A=L>>>24)<=w);){if(0===g)break e;g--,v+=h[p++]<>>=P,w-=P,f.back+=P}if(v>>>=A,w-=A,f.back+=A,64&C){l.msg="invalid distance code",f.mode=s;break}f.offset=I,f.extra=15&C,f.mode=24;case 24:if(f.extra){for(N=f.extra;w>>=f.extra,w-=f.extra,f.back+=f.extra}if(f.offset>f.dmax){l.msg="invalid distance too far back",f.mode=s;break}f.mode=25;case 25:if(0===_)break e;if(B=k-_,f.offset>B){if((B=f.offset-B)>f.whave&&f.sane){l.msg="invalid distance too far back",f.mode=s;break}B>f.wnext?(B-=f.wnext,E=f.wsize-B):E=f.wnext-B,B>f.length&&(B=f.length),S=f.window}else S=d,E=m-f.offset,B=f.length;B>_&&(B=_),_-=B,f.length-=B;do{d[m++]=S[E++]}while(--B);0===f.length&&(f.mode=21);break;case 26:if(0===_)break e;d[m++]=f.length,_--,f.mode=21;break;case 27:if(f.wrap){for(;w<32;){if(0===g)break e;g--,v|=h[p++]<=0&&c.windowBits<16&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15)),!(c.windowBits>=0&&c.windowBits<16)||l&&l.windowBits||(c.windowBits+=32),c.windowBits>15&&c.windowBits<48&&(15&c.windowBits||(c.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var f=e.inflateInit2(this.strm,c.windowBits);if(f!==n.Z_OK)throw new Error(i[f]);if(this.header=new o,e.inflateGetHeader(this.strm,this.header),c.dictionary&&("string"==typeof c.dictionary?c.dictionary=r.string2buf(c.dictionary):"[object ArrayBuffer]"===s.call(c.dictionary)&&(c.dictionary=new Uint8Array(c.dictionary)),c.raw&&(f=e.inflateSetDictionary(this.strm,c.dictionary))!==n.Z_OK))throw new Error(i[f])}function l(e,t){var r=new u(t);if(r.push(e,!0),r.err)throw r.msg||i[r.err];return r.result}return u.prototype.push=function(i,a){var o,u,l,c,f,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;u=a===~~a?a:!0===a?n.Z_FINISH:n.Z_NO_FLUSH,"string"==typeof i?h.input=r.binstring2buf(i):"[object ArrayBuffer]"===s.call(i)?h.input=new Uint8Array(i):h.input=i,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new t.Buf8(d),h.next_out=0,h.avail_out=d),(o=e.inflate(h,n.Z_NO_FLUSH))===n.Z_NEED_DICT&&p&&(o=e.inflateSetDictionary(this.strm,p)),o===n.Z_BUF_ERROR&&!0===m&&(o=n.Z_OK,m=!1),o!==n.Z_STREAM_END&&o!==n.Z_OK)return this.onEnd(o),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&o!==n.Z_STREAM_END&&(0!==h.avail_in||u!==n.Z_FINISH&&u!==n.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(h.output,h.next_out),c=h.next_out-l,f=r.buf2string(h.output,l),h.next_out=c,h.avail_out=d-c,c&&t.arraySet(h.output,h.output,l,c,0),this.onData(f)):this.onData(t.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(m=!0)}while((h.avail_in>0||0===h.avail_out)&&o!==n.Z_STREAM_END);return o===n.Z_STREAM_END&&(u=n.Z_FINISH),u===n.Z_FINISH?(o=e.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===n.Z_OK):u!==n.Z_SYNC_FLUSH||(this.onEnd(n.Z_OK),h.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===n.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},inflate$1.Inflate=u,inflate$1.inflate=l,inflate$1.inflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},inflate$1.ungzip=l,inflate$1}function requirePako(){if(hasRequiredPako)return pako_1;hasRequiredPako=1;var e={};return(0,requireCommon().assign)(e,requireDeflate(),requireInflate(),requireConstants()),pako_1=e}!function(e){!function(){var t={};function r(){void 0!==process||console.log.apply(console,arguments)}e.exports=t,function(e,t){!function(){var t=function(){function e(e){this.message="JPEG error: "+e}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}(),r=function(){var e=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]),r=4017,i=799,a=3406,o=2276,s=1567,u=3784,l=5793,c=2896;function f(e){null==e&&(e={}),null==e.w&&(e.w=-1),this.V=e.n,this.N=e.w}function h(e,t){for(var r,n,i,a=0,o=[],s=16;s>0&&!e[s-1];)s--;o.push({children:[],index:0});var u=o[0];for(r=0;r0;)u=o.pop();for(u.index++,o.push(u);o.length<=r;)o.push(i={children:[],index:0}),u.children[u.index]=i.children,u=i;a++}r+10)return P--,I>>P&1;if(255===(I=r[i++])){var e=r[i++];if(e){if(220===e&&h){var o=n(r,i+=2);if(i+=2,o>0&&o!==a.s)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",o)}else if(217===e){if(h){var s=8*R;if(s>0&&s>>7}function N(e){for(var r=e;;){switch(typeof(r=r[O()])){case"number":return r;case"object":continue}throw new t("invalid huffman sequence")}}function L(e){for(var t=0;e>0;)t=t<<1|O(),e--;return t}function D(e){if(1===e)return 1===O()?1:-1;var t=L(e);return t>=1<0)T--;else for(var n=u,i=l;n<=i;){var a=N(t.i),o=15&a,s=a>>4;if(0!==o){var c=e[n+=s];t.D[r+c]=D(o)*(1<>4,0==(i=15&a))c<15?(T=L(c)+(1<>4;if(0!==s){var l=e[a+=u];t.D[r+l]=D(s),a++}else{if(u<15)break;a+=16}}},k=1===$?o[0].P*o[0].c:S*a.R;F<=k;){var j=s?Math.min(k-F,s):k;if(j>0){for(g=0;g<$;g++)o[g].Q=0;if(T=0,1===$)for(m=o[0],v=0;v=65488&&x.M<=65495))break;i+=2}return i-C}function m(e,n,f){var h,d,p,m,g,b,y,_,v,w,x,k,B,E,S,A,C,I=e.$,P=e.D;if(!I)throw new t("missing required Quantization Table.");for(var T=0;T<64;T+=8)v=P[n+T],w=P[n+T+1],x=P[n+T+2],k=P[n+T+3],B=P[n+T+4],E=P[n+T+5],S=P[n+T+6],A=P[n+T+7],v*=I[T],w|x|k|B|E|S|A?(w*=I[T+1],x*=I[T+2],k*=I[T+3],B*=I[T+4],E*=I[T+5],S*=I[T+6],A*=I[T+7],d=(h=(h=l*v+128>>8)+(d=l*B+128>>8)+1>>1)-d,C=(p=x)*u+(m=S)*s+128>>8,p=p*s-m*u+128>>8,y=(g=(g=c*(w-A)+128>>8)+(y=E<<4)+1>>1)-y,b=(_=(_=c*(w+A)+128>>8)+(b=k<<4)+1>>1)-b,m=(h=h+(m=C)+1>>1)-m,p=(d=d+p+1>>1)-p,C=g*o+_*a+2048>>12,g=g*a-_*o+2048>>12,_=C,C=b*i+y*r+2048>>12,b=b*r-y*i+2048>>12,y=C,f[T]=h+_,f[T+7]=h-_,f[T+1]=d+y,f[T+6]=d-y,f[T+2]=p+b,f[T+5]=p-b,f[T+3]=m+g,f[T+4]=m-g):(C=l*v+512>>10,f[T]=C,f[T+1]=C,f[T+2]=C,f[T+3]=C,f[T+4]=C,f[T+5]=C,f[T+6]=C,f[T+7]=C);for(var M=0;M<8;++M)v=f[M],(w=f[M+8])|(x=f[M+16])|(k=f[M+24])|(B=f[M+32])|(E=f[M+40])|(S=f[M+48])|(A=f[M+56])?(d=(h=4112+((h=l*v+2048>>12)+(d=l*B+2048>>12)+1>>1))-d,C=(p=x)*u+(m=S)*s+2048>>12,p=p*s-m*u+2048>>12,m=C,y=(g=(g=c*(w-A)+2048>>12)+(y=E)+1>>1)-y,b=(_=(_=c*(w+A)+2048>>12)+(b=k)+1>>1)-b,C=g*o+_*a+2048>>12,g=g*a-_*o+2048>>12,_=C,C=b*i+y*r+2048>>12,b=b*r-y*i+2048>>12,(v=(h=h+m+1>>1)+_)<16?v=0:v>=4080?v=255:v>>=4,(w=(d=d+p+1>>1)+(y=C))<16?w=0:w>=4080?w=255:w>>=4,(x=(p=d-p)+b)<16?x=0:x>=4080?x=255:x>>=4,(k=(m=h-m)+g)<16?k=0:k>=4080?k=255:k>>=4,(B=m-g)<16?B=0:B>=4080?B=255:B>>=4,(E=p-b)<16?E=0:E>=4080?E=255:E>>=4,(S=d-y)<16?S=0:S>=4080?S=255:S>>=4,(A=h-_)<16?A=0:A>=4080?A=255:A>>=4,P[n+M]=v,P[n+M+8]=w,P[n+M+16]=x,P[n+M+24]=k,P[n+M+32]=B,P[n+M+40]=E,P[n+M+48]=S,P[n+M+56]=A):(C=(C=l*v+8192>>14)<-2040?0:C>=2024?255:C+2056>>4,P[n+M]=C,P[n+M+8]=C,P[n+M+16]=C,P[n+M+24]=C,P[n+M+32]=C,P[n+M+40]=C,P[n+M+48]=C,P[n+M+56]=C)}function g(e,t){for(var r=t.P,n=t.c,i=new Int16Array(64),a=0;a=i)return null;var o=n(e,t);if(o>=65472&&o<=65534)return{u:null,M:o,offset:t};for(var s=n(e,a);!(s>=65472&&s<=65534);){if(++a>=i)return null;s=n(e,a)}return{u:o.toString(16),M:s,offset:a}}return f.prototype={parse(r,i){null==i&&(i={});var a,o,s=i.F,u=0,l=null,c=null,f=0;function d(){var e=n(r,u),t=(u+=2)+e-2,i=b(r,t,u);i&&i.u&&(t=i.offset);var a=r.subarray(u,t);return u+=a.length,a}function m(e){for(var t=Math.ceil(e.o/8/e.X),r=Math.ceil(e.s/8/e.B),n=0;n>4){if(A>>4!=1)throw new t("DQT - invalid table spec");for(k=0;k<64;k++)C[e[k]]=n(r,u),u+=2}else for(k=0;k<64;k++)C[e[k]]=r[u++];y[15&A]=C}break;case 65472:case 65473:case 65474:if(a)throw new t("Only single frame JPEGs supported");u+=2,(a={}).G=65473===w,a.Z=65474===w,a.precision=r[u++];var I,P=n(r,u),T=0,M=0;u+=2,a.s=s||P,a.o=n(r,u),u+=2,a.W=[],a._={};var R=r[u++];for(x=0;x>4,O=15&r[u+1];T>4?_:v)[15&D]=h(z,$)}break;case 65501:o=n(r,u+=2),u+=2;break;case 65498:var j,Z=1==++f&&!s;u+=2;var G=r[u++],W=[];for(x=0;x>4],j.i=_[15&Q],W.push(j)}var V=r[u++],Y=r[u++],K=r[u++];try{var X=p(r,u,a,W,o,V,Y,K>>4,15&K,Z);u+=X}catch(e){if(e instanceof DNLMarkerError)return this.parse(r,{F:e.s});if(e instanceof EOIMarkerError)break e;throw e}break;case 65500:u+=4;break;case 65535:255!==r[u]&&u--;break;default:var J=b(r,u-2,u-3);if(J&&J.u){u=J.offset;break}if(u>=r.length-1)break e;throw new t("JpegImage.parse - unknown marker: "+w.toString(16))}w=n(r,u),u+=2}for(this.width=a.o,this.height=a.s,this.g=l,this.b=c,this.W=[],x=0;x>8)+k[f+1];return v},get f(){return this.b?!!this.b.a:3===this.p?0!==this.N&&(82!==this.W[0].index||71!==this.W[1].index||66!==this.W[2].index):1===this.N},z:function(e){for(var t,r,n,i=0,a=e.length;i4)throw new t("Unsupported color mode");var o=this.Y(r,n,a);if(1===this.p&&i){for(var s=o.length,u=new Uint8ClampedArray(3*s),l=0,c=0;c3&&(n.t258=n.t258.slice(0,3));var l=n.t277?n.t277[0]:1,c=(n.t258?n.t258[0]:1)*l;1==s&&null!=n.t279&&n.t278&&32803==n.t262[0]&&(c=Math.round(8*n.t279[0]/(n.width*n.t278[0]))),n.t50885&&4==n.t50885[0]&&(c=3*n.t258[0]);var f=8*Math.ceil(n.width*c/8),h=n.t273;(null==h||n.t322)&&(h=n.t324);var d=n.t279;1==s&&1==h.length&&(d=[n.height*(f>>>3)]),(null==d||n.t322)&&(d=n.t325);var p=new Uint8Array(n.height*(f>>>3)),m=0;if(null!=n.t322){var g=n.t322[0],b=n.t323[0],y=Math.floor((n.width+g-1)/g),_=Math.floor((n.height+b-1)/b),v=new Uint8Array(0|Math.ceil(g*b*c/8));console.log("====",y,_);for(var w=0;w<_;w++)for(var x=0;x>>3,v=Math.ceil(b*y*h/8);if(16==b&&!n.isLE&&null==n.t33422)for(var w=0;w>>8&255}else if(3==y)for(p=3;p>3^16368]|A[x+1]<<8)>>(7&w)&~(-1<>4,k[1]=4095&((15&P(1))<<8|P(2)),k[2]=P(3)>>6&3,k[3]=(63&P(3))<<2|P(4)>>6,k[4]=(63&P(4))<<2|P(5)>>6,k[5]=(63&P(5))<<2|P(6)>>6,k[6]=P(6)>>4&3,k[7]=(15&P(6))<<4|P(7)>>4,k[8]=(15&P(7))<<4|P(8)>>4,k[9]=(15&P(8))<<4|P(9)>>4,k[10]=P(9)>>2&3,k[11]=(3&P(9))<<6|P(10)>>2,k[12]=(3&P(10))<<6|P(11)>>2,k[13]=(3&P(11))<<6|P(12)>>2,k[14]=3&P(12),k[15]=P(13),k[16]=P(14),k[17]=P(15),w+=16,x=0}:function(){k[0]=P(0)<<6|P(1)>>2,k[1]=16383&((3&P(1))<<12|P(2)<<4|P(3)>>4),k[2]=P(3)>>2&3,k[3]=(3&P(3))<<8|P(4),k[4]=P(5)<<2|P(6)>>6,k[5]=(63&P(6))<<4|P(7)>>4,k[6]=P(7)>>2&3,k[7]=(3&P(7))<<8|P(8),k[8]=P(9)<<2&1020|P(10)>>6,k[9]=1023&(P(10)<<4|P(11)>>4),k[10]=P(11)>>2&3,k[11]=(3&P(11))<<8|P(12),k[12]=1023&(P(13)<<2&1020|P(14)>>6),k[13]=1023&(P(14)<<4|P(15)>>4),w+=16,x=0},F=M?14:11,O=M?128:512,N=M?2048:8192,L=M?16383:65535,D=M?4095:16383,z=m/F,U=16*z,$=M?18:14;for(f=0;fc&&(H+=E[l]-c),E[l]=H):(B[l]=H,H?E[l]=H:H=E[l]),C[S+h++]=H-15<=L?H-15&L:H+2147483633>>31&D}}}}else if(5==y){var q=12==b?10:9;for(f=0;f>4),C[S++]=((15&k[4])<<8)+k[3],C[S++]=16*k[5]+(k[4]>>4),C[S++]=((15&k[7])<<8)+k[6],C[S++]=16*k[8]+(k[7]>>4),C[S++]=((15&k[10])<<8)+k[9],C[S++]=16*k[11]+(k[10]>>4),C[S++]=((15&k[13])<<8)+k[12],C[S++]=16*k[14]+(k[13]>>4)):14==b&&(C[S++]=k[0]+((63&k[1])<<8),C[S++]=(k[1]>>6)+4*k[2]+((15&k[3])<<10),C[S++]=(k[3]>>4)+16*k[4]+((3&k[5])<<12),C[S++]=((252&k[5])>>2)+(k[6]<<6),C[S++]=k[7]+((63&k[8])<<8),C[S++]=(k[8]>>6)+4*k[9]+((15&k[10])<<10),C[S++]=(k[10]>>4)+16*k[11]+((3&k[12])<<12),C[S++]=((252&k[12])>>2)+(k[13]<<6),C[S++]=k[14]+((63&k[15])<<8))}else{if(4!=y)throw y;for(f=0;f>3-I(2)),E[l]?0!=(s=I(8))&&(B[l]-=128<11)&&(B[l]=E[l]<<4|I(4))),C[S++]=B[1&h]}},e.decode._decodeVC5=function(){var t,r,n,i=[1,0,1,0,2,2,1,1,3,7,1,2,5,25,1,3,6,48,1,4,6,54,1,5,7,111,1,8,7,99,1,6,7,105,12,0,7,107,1,7,8,209,20,0,8,212,1,9,8,220,1,10,9,393,1,11,9,394,32,0,9,416,1,12,9,427,1,13,10,887,1,18,10,784,1,14,10,790,1,15,10,835,60,0,10,852,1,16,10,885,1,17,11,1571,1,19,11,1668,1,20,11,1669,100,0,11,1707,1,21,11,1772,1,22,12,3547,1,29,12,3164,1,24,12,3166,1,25,12,3140,1,23,12,3413,1,26,12,3537,1,27,12,3539,1,28,13,7093,1,35,13,6283,1,30,13,6331,1,31,13,6335,180,0,13,6824,1,32,13,7072,1,33,13,7077,320,0,13,7076,1,34,14,12565,1,36,14,12661,1,37,14,12669,1,38,14,13651,1,39,14,14184,1,40,15,28295,1,46,15,28371,1,47,15,25320,1,42,15,25336,1,43,15,25128,1,41,15,27300,1,44,15,28293,1,45,16,50259,1,48,16,50643,1,49,16,50675,1,50,16,56740,1,53,16,56584,1,51,16,56588,1,52,17,113483,1,61,17,113482,1,60,17,101285,1,55,17,101349,1,56,17,109205,1,57,17,109207,1,58,17,100516,1,54,17,113171,1,59,18,202568,1,62,18,202696,1,63,18,218408,1,64,18,218412,1,65,18,226340,1,66,18,226356,1,67,18,226358,1,68,19,402068,1,69,19,405138,1,70,19,405394,1,71,19,436818,1,72,19,436826,1,73,19,452714,1,75,19,452718,1,76,19,452682,1,74,20,804138,1,77,20,810279,1,78,20,810790,1,79,20,873638,1,80,20,873654,1,81,20,905366,1,82,20,905430,1,83,20,905438,1,84,21,1608278,1,85,21,1620557,1,86,21,1621582,1,87,21,1621583,1,88,21,1747310,1,89,21,1810734,1,90,21,1810735,1,91,21,1810863,1,92,21,1810879,1,93,22,3621725,1,99,22,3621757,1,100,22,3241112,1,94,22,3494556,1,95,22,3494557,1,96,22,3494622,1,97,22,3494623,1,98,23,6482227,1,102,23,6433117,1,101,23,6989117,1,103,23,6989119,1,105,23,6989118,1,104,23,7243449,1,106,23,7243512,1,107,24,13978233,1,111,24,12964453,1,109,24,12866232,1,108,24,14486897,1,113,24,13978232,1,110,24,14486896,1,112,24,14487026,1,114,24,14487027,1,115,25,25732598,1,225,25,25732597,1,189,25,25732596,1,188,25,25732595,1,203,25,25732594,1,202,25,25732593,1,197,25,25732592,1,207,25,25732591,1,169,25,25732590,1,223,25,25732589,1,159,25,25732522,1,235,25,25732579,1,152,25,25732575,1,192,25,25732489,1,179,25,25732573,1,201,25,25732472,1,172,25,25732576,1,149,25,25732488,1,178,25,25732566,1,120,25,25732571,1,219,25,25732577,1,150,25,25732487,1,127,25,25732506,1,211,25,25732548,1,125,25,25732588,1,158,25,25732486,1,247,25,25732467,1,238,25,25732508,1,163,25,25732552,1,228,25,25732603,1,183,25,25732513,1,217,25,25732587,1,168,25,25732520,1,122,25,25732484,1,128,25,25732562,1,249,25,25732505,1,187,25,25732504,1,186,25,25732483,1,136,25,25928905,1,181,25,25732560,1,255,25,25732500,1,230,25,25732482,1,135,25,25732555,1,233,25,25732568,1,222,25,25732583,1,145,25,25732481,1,134,25,25732586,1,167,25,25732521,1,248,25,25732518,1,209,25,25732480,1,243,25,25732512,1,216,25,25732509,1,164,25,25732547,1,140,25,25732479,1,157,25,25732544,1,239,25,25732574,1,191,25,25732564,1,251,25,25732478,1,156,25,25732546,1,139,25,25732498,1,242,25,25732557,1,133,25,25732477,1,162,25,25732515,1,213,25,25732584,1,165,25,25732514,1,212,25,25732476,1,227,25,25732494,1,198,25,25732531,1,236,25,25732530,1,234,25,25732529,1,117,25,25732528,1,215,25,25732527,1,124,25,25732526,1,123,25,25732525,1,254,25,25732524,1,253,25,25732523,1,148,25,25732570,1,218,25,25732580,1,146,25,25732581,1,147,25,25732569,1,224,25,25732533,1,143,25,25732540,1,184,25,25732541,1,185,25,25732585,1,166,25,25732556,1,132,25,25732485,1,129,25,25732563,1,250,25,25732578,1,151,25,25732501,1,119,25,25732502,1,193,25,25732536,1,176,25,25732496,1,245,25,25732553,1,229,25,25732516,1,206,25,25732582,1,144,25,25732517,1,208,25,25732558,1,137,25,25732543,1,241,25,25732466,1,237,25,25732507,1,190,25,25732542,1,240,25,25732551,1,131,25,25732554,1,232,25,25732565,1,252,25,25732475,1,171,25,25732493,1,205,25,25732492,1,204,25,25732491,1,118,25,25732490,1,214,25,25928904,1,180,25,25732549,1,126,25,25732602,1,182,25,25732539,1,175,25,25732545,1,141,25,25732559,1,138,25,25732537,1,177,25,25732534,1,153,25,25732503,1,194,25,25732606,1,160,25,25732567,1,121,25,25732538,1,174,25,25732497,1,246,25,25732550,1,130,25,25732572,1,200,25,25732474,1,170,25,25732511,1,221,25,25732601,1,196,25,25732532,1,142,25,25732519,1,210,25,25732495,1,199,25,25732605,1,155,25,25732535,1,154,25,25732499,1,244,25,25732510,1,220,25,25732600,1,195,25,25732607,1,161,25,25732604,1,231,25,25732473,1,173,25,25732599,1,226,26,51465122,1,116,26,51465123,0,1],a=[3,3,3,3,2,2,2,1,1,1];function o(e){var t=e[1],r=e[0][t>>>3]>>>7-(7&t)&1;return e[1]++,r}function s(e,r){if(null==t){t={};for(var n=0;n>>=1;return e}function l(e,t){return e>>t}function c(e,t,r,n,i,a){t[r]=l(l(11*e[i]-4*e[i+a]+e[i+a+a]+4,3)+e[n],1),t[r+a]=l(l(5*e[i]+4*e[i+a]-e[i+a+a]+4,3)-e[n],1)}function f(e,t,r,n,i,a){var o=e[i-a]-e[i+a],s=e[i],u=e[n];t[r]=l(l(o+4,3)+s+u,1),t[r+a]=l(l(4-o,3)+s-u,1)}function h(e,t,r,n,i,a){t[r]=l(l(5*e[i]+4*e[i-a]-e[i-a-a]+4,3)+e[n],1),t[r+a]=l(l(11*e[i]-4*e[i-a]+e[i-a-a]+4,3)-e[n],1)}function d(e){return n[e=e<0?0:e>4095?4095:e]>>>2}return function(t,i,o,l,p,m){l=new Uint16Array(l.buffer);var g,b,y,_,v,w,x,k,B=Date.now(),E=e._binBE,S=i+o;i+=4;for(var A=1==m[0];i>>1)*(b>>>1));for(k=new Int16Array((g>>>1)*(b>>>1)),r=new Int16Array(1024),R=0;R<1024;R++){var F=R-512,O=Math.abs(F),N=Math.floor(768*O*O*O/16581375)+O;r[R]=Math.sign(F)*N}for(n=new Uint16Array(4096),R=0;R<4096;R++){var L=R,D=65535*(Math.pow(113,L/4095)-1)/112;n[R]=Math.min(D,65535)}}var z=x[v],U=u(g,1+a[y]),$=u(b,1+a[y]);if(0==y)for(var j=0;j<$;j++)for(var Z=0;Z>>1)+Z]=t[G]<<8|t[G+1]}else{var W=[t,8*i],H=[],q=0,Q=U*$,V=[0,0],Y=0;for(I=0;q0;)H[q++]=I,Y--;var K=(y-1)%3,X=1!=K?U:0,J=0!=K?$:0;for(j=0;j<$;j++){var ee=(j+J)*(g>>>1)+X,te=j*U;for(Z=0;Z>>1,ne=2*U,ie=2*$;for(j=0;j<$;j++)for(Z=0;Z>14-2*ce&3;var fe=ue[le];if(0!=fe)for(j=0;j>>1)*(g>>>1)+(Z>>>1)],ye=de[G]-2048,_e=pe[G]-2048,ve=me[G]-2048,we=(ye<<1)+be,xe=(_e<<1)+be,ke=be+ve,Be=be-ve;A?(l[ge]=d(ke),l[ge+1]=d(xe),l[ge+g]=d(we),l[ge+g+1]=d(Be)):(l[ge]=d(we),l[ge+1]=d(ke),l[ge+g]=d(Be),l[ge+g+1]=d(xe))}}i+=4*M}}}console.log(Date.now()-B)}}(),e.decode._decodeLogLuv32=function(e,t,r,n,i,a){for(var o=e.width,s=4*o,u=0,l=new Uint8Array(s);u>>11,p=15&f>>>22,m=15&f>>>26,g=0;g<4&&128<>3))>>>(7&b)&127)<2047&&(_[x]=2047),b+=7);for(x=0;x<16;x++,A+=2)N=_[x]<<1,e.decode._putsF(a,(C*s+A)*l,N<<16-l);A-=1&A?1:31}}}else for(var x=0;x>>4,a[o+x+1]=k<<4|E>>>4,a[o+x+2]=E<<4|B>>>4}else{u+=8;var S,A,C,I=[n,0,0,0],P=new Uint16Array(32770),T=[3857,3856,3599,3342,3085,2828,2571,2314,2057,1800,1543,1286,1029,772,771,768,514,513],M=0,R=e.decode._ljpeg_diff;for(P[0]=15,S=x=0;x<18;x++)for(var F=32768>>>(T[x]>>>8),O=0;O1&&(T=Math.floor(P/(M-1))),68==_&&32==v&&T>0&&(d=x.readShort(b,562));var R=[0,0],F=p(u[h]),O=[i,0,0,0];for(E=0;E>>4),0)<<1)<>>1)&1<>>3;e[n]|=r>>>16,e[n+1]|=r>>>8,e[n+2]|=r},e.decode._getbithuff=function(t,r,n,i){var a;e.decode._get_byte;var o=r[0],s=r[1],u=r[2],l=r[3];if(0==n||u<0)return 0;for(;!l&&u>>32-n,i?(u-=i[a+1]>>>8,a=255&i[a+1]):u-=n,u<0)throw"e";return r[0]=o,r[1]=s,r[2]=u,r[3]=l,a},e.decode._make_decoder=function(e){var t,r,n,i,a,o=[];for(t=16;0!=t&&!e[t];t--);var s=17;for(o[0]=t,n=r=1;r<=t;r++)for(i=0;i>>8;else for(f=0;f>>8,a[o+(f<<1)+1]=255&m[f];else if(14==p||12==p||10==p){var b=16-p;for(f=0;f1),!d){if(255==t[n]&&t[n+1]==c)return{jpegOffset:n};if(null!=p&&(255==t[n+m]&&t[n+m+1]==c?f=n+m:r("JPEGInterchangeFormat does not point to SOI"),null==g?r("JPEGInterchangeFormatLength field is missing"):(m>=h||m+b<=h)&&r("JPEGInterchangeFormatLength field value is invalid"),null!=f))return{jpegOffset:f}}if(null!=_&&(v=_[0],w=_[1]),null!=p&&null!=g)if(b>=2&&m+b<=h){for(a=255==t[n+m+b-2]&&t[n+m+b-1]==c?new Uint8Array(b-2):new Uint8Array(b),s=0;s offset to first strip or tile");if(null==a){var B=0,E=[];E[B++]=255,E[B++]=c;var S=e.t519;if(null==S)throw new Error("JPEGQTables tag is missing");for(s=0;s>>8,E[B++]=255&C,E[B++]=s|l<<4,u=0;u<16;u++)E[B++]=t[n+A[s]+u];for(u=0;u>>8&255,E[B++]=255&e.height,E[B++]=e.width>>>8&255,E[B++]=255&e.width,E[B++]=x,1==x)E[B++]=1,E[B++]=17,E[B++]=0;else for(s=0;s<3;s++)E[B++]=s+1,E[B++]=0!=s?17:(15&v)<<4|15&w,E[B++]=s;null!=k&&0!=k[0]&&(E[B++]=255,E[B++]=221,E[B++]=0,E[B++]=4,E[B++]=k[0]>>>8&255,E[B++]=255&k[0]),a=new Uint8Array(E)}var I=-1;for(s=0;s>>8&255,a[T++]=255&e.height,a[T++]=e.width>>>8&255,a[T++]=255&e.width,a[T++]=x,1==x)a[T++]=1,a[T++]=17,a[T++]=0;else for(s=0;s<3;s++)a[T++]=s+1,a[T++]=0!=s?17:(15&v)<<4|15&w,a[T++]=s}if(255==t[h]&&218==t[h+1]){var M=t[h+2]<<8|t[h+3];for((o=new Uint8Array(M+2))[0]=t[h],o[1]=t[h+1],o[2]=t[h+2],o[3]=t[h+3],s=0;s>>8&255,l[f.sofPosition+6]=255&t.height,l[f.sofPosition+7]=t.width>>>8&255,l[f.sofPosition+8]=255&t.width,255==r[n]&&r[n+1]==SOS||(l.set(f.sosMarker,c),c+=sosMarker.length),p=0;p=0&&u<128)for(var l=0;l=-127&&u<0){for(l=0;l<1-u;l++)o[i]=a[t],i++;t++}}return i},e.decode._decodeThunder=function(e,t,r,n,i){for(var a=[0,1,0,-1],o=[0,1,2,3,0,-3,-2,-1],s=t+r,u=2*i,l=0;t>>6,h=63&c;if(t++,3==f&&(l=15&h,n[u>>>1]|=l<<4*(1-u&1),u++),0==f)for(var d=0;d>>1]|=l<<4*(1-u&1),u++;if(2==f)for(d=0;d<2;d++)4!=(p=h>>>3*(1-d)&7)&&(l+=o[p],n[u>>>1]|=l<<4*(1-u&1),u++);if(1==f)for(d=0;d<3;d++){var p;2!=(p=h>>>2*(2-d)&3)&&(l+=a[p],n[u>>>1]|=l<<4*(1-u&1),u++)}}},e.decode._dmap={1:0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3},e.decode._lens=function(){var e=function(e,t,r,n){for(var i=0;i>>3>>3]>>>7-(7&l)&1),2==s&&(B=t[l>>>3]>>>(7&l)&1),l++,f+=B,"H"==w){if(null!=u._lens[_][f]){var E=u._lens[_][f];f="",c+=E,E<64&&(u._addNtimes(h,c,_),m+=c,_=1-_,c=0,0==--x&&(w=""))}}else"0001"==f&&(f="",u._addNtimes(h,y-m,_),m=y),"001"==f&&(f="",w="H",x=2),null!=u._dmap[f]&&(g=b+u._dmap[f],u._addNtimes(h,g-m,_),m=g,f="",_=1-_);h.length==o&&""==w&&(u._writeBits(h,i,8*a+v*k),_=0,v++,m=0,d=u._makeDiff(h),h=[])}},e.decode._findDiff=function(e,t,r){for(var n=0;n=t&&e[n+1]==r)return e[n]},e.decode._makeDiff=function(e){var t=[];1==e[0]&&t.push(0,1);for(var r=1;r>>3>>3]>>>7-(7&l)&1),2==s&&(g=t[l>>>3]>>>(7&l)&1),l++,f+=g,null!=(c=u._lens[d][f])&&(u._addNtimes(h,c,d),f="",c<64&&(d=1-d),h.length==o&&(u._writeBits(h,i,8*a+p*m),h=[],p++,d=0,7&l&&(l+=8-(7&l)),c>=64&&(l+=8)))}},e.decode._decodeG3=function(t,r,n,i,a,o,s,u){for(var l=e.decode,c=r<<3,f=0,h="",d=[],p=[],m=0;m>>3>>3]>>>7-(7&c)&1),2==s&&(S=t[c>>>3]>>>(7&c)&1),c++,h+=S,B){if(null!=l._lens[v][h]){var A=l._lens[v][h];h="",f+=A,A<64&&(l._addNtimes(d,f,v),v=1-v,f=0)}}else"H"==x?null!=l._lens[v][h]&&(A=l._lens[v][h],h="",f+=A,A<64&&(l._addNtimes(d,f,v),g+=f,v=1-v,f=0,0==--k&&(x=""))):("0001"==h&&(h="",l._addNtimes(d,_-g,v),g=_),"001"==h&&(h="",x="H",k=2),null!=l._dmap[h]&&(b=y+l._dmap[h],l._addNtimes(d,b-g,v),g=b,h="",v=1-v));h.endsWith("000000000001")&&(w>=0&&l._writeBits(d,i,8*a+w*E),u&&(1==s&&(B=1==(t[c>>>3]>>>7-(7&c)&1)),2==s&&(B=1==(t[c>>>3]>>>(7&c)&1)),c++),h="",v=0,w++,g=0,p=l._makeDiff(d),d=[])}d.length==o&&l._writeBits(d,i,8*a+w*E)},e.decode._addNtimes=function(e,t,r){for(var n=0;n>>3]|=e[n]<<7-(r+n&7)},e.decode._decodeLZW=e.decode._decodeLZW=function(){var e,t,r,n,i=0,a=0,o=0,s=0,u=function(){var r=e>>>3,n=(t[r]<<16|t[r+1]<<8|t[r+2])>>>24-(7&e)-a&(1<>>----------------");for(var c=0;cn.buffer.byteLength&&(d=n.buffer.byteLength-g),m=new Uint8Array(n.buffer,g,d)}if(2==h){var b=d<5?i-4:p,y=n[b],_=Math.max(0,Math.min(d-1,n.length-b));y<128||0==_?m.push(t.readASCII(n,b,_)):m=new Uint8Array(n.buffer,b,_)}if(3==h)for(var v=0;v4&&(t.writeUint(n,i,u),g=u),1==h||7==h)for(var b=0;b4&&(u+=m+=1&m),i+=4}}return[i,u]},e.toRGBA8=function(e,t){function n(e){return e<.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}var i=e.width,a=e.height,o=i*a,s=e.data,u=new Uint8Array(4*o),l=e.t262?e.t262[0]:2,c=e.t258?Math.min(32,e.t258[0]):1;null==e.t262&&1==c&&(l=0);var f=e.t277?e.t277[0]:e.t258?e.t258.length:[1,1,3,1,1,4,3][l],h=e.t339?e.t339[0]:null;if(1==l&&32==c&&3!=h)throw"e";var d=Math.ceil(f*c*i/8);if(0==l){t=1/256;for(var p=0;p>3)]>>7-(7&b)&1;u[y]=u[y+1]=u[y+2]=255*(1-_),u[y+3]=255}if(4==c)for(b=0;b>1)]>>4-4*(1&b)&15,u[y]=u[y+1]=u[y+2]=17*(15-_),u[y+3]=255;if(8==c)for(b=0;b>3)]>>7-(7&b)&1,u[y]=u[y+1]=u[y+2]=255*_,u[y+3]=255;if(2==c)for(b=0;b>2)]>>6-2*(3&b)&3,u[y]=u[y+1]=u[y+2]=85*_,u[y+3]=255;if(8==c)for(b=0;b>>2)+b],u[y]=u[y+1]=u[y+2]=~~(.5+255*_),u[y+3]=255}}}else if(2==l)if(8==c){if(1==f)for(b=0;b=4)for(b=0;b1&&e.t338&&0!=e.t338[0];for(p=0;p>>3)]>>>7-(7&T)&1;else if(2==c)M=s[R+(T>>>2)]>>>6-2*(3&T)&3;else if(4==c)M=s[R+(T>>>1)]>>>4-4*(1&T)&15;else{if(8!=c)throw c;M=s[R+T*f]}u[y]=C[M]>>8,u[y+1]=C[I+M]>>8,u[y+2]=C[I+I+M]>>8,u[y+3]=P?s[R+T*f+1]:255}}else if(5==l){var F=f>4?1:0;for(b=0;b>>1))+(1&Z)];var G=s[O+2]-128,W=s[O+3]-128,H=D+((W>>2)+(W>>3)+(W>>5)),q=D-((G>>2)+(G>>4)+(G>>5))-((W>>1)+(W>>3)+(W>>4)+(W>>5)),Q=D+(G+(G>>1)+(G>>2)+(G>>6));u[y]=Math.max(0,Math.min(255,H)),u[y+1]=Math.max(0,Math.min(255,q)),u[y+2]=Math.max(0,Math.min(255,Q)),u[y+3]=255}}}else if(32845==l)for(p=0;pi&&(i=u,a=s)}}e.decodeImage(t,a,r);var l=e.toRGBA8(a),c=a.width,f=a.height,h=document.createElement("canvas");h.width=c,h.height=f;var d=h.getContext("2d"),p=new ImageData(new Uint8ClampedArray(l.buffer),c,f);return d.putImageData(p,0,0),h.toDataURL()},e._binBE={nextZero:function(e,t){for(;0!=e[t];)t++;return t},readUshort:function(e,t){return e[t]<<8|e[t+1]},readShort:function(t,r){var n=e._binBE.ui8;return n[0]=t[r+1],n[1]=t[r+0],e._binBE.i16[0]},readInt:function(t,r){var n=e._binBE.ui8;return n[0]=t[r+3],n[1]=t[r+2],n[2]=t[r+1],n[3]=t[r+0],e._binBE.i32[0]},readUint:function(t,r){var n=e._binBE.ui8;return n[0]=t[r+3],n[1]=t[r+2],n[2]=t[r+1],n[3]=t[r+0],e._binBE.ui32[0]},readASCII:function(e,t,r){for(var n="",i=0;i>8&255,e[t+1]=255&r},writeInt:function(t,r,n){var i=e._binBE.ui8;e._binBE.i32[0]=n,t[r+3]=i[0],t[r+2]=i[1],t[r+1]=i[2],t[r+0]=i[3]},writeUint:function(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},writeASCII:function(e,t,r){for(var n=0;n>8&255},writeInt:function(t,r,n){var i=e._binBE.ui8;e._binBE.i32[0]=n,t[r+0]=i[0],t[r+1]=i[1],t[r+2]=i[2],t[r+3]=i[3]},writeUint:function(e,t,r){e[t]=r>>>0&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24&255},writeASCII:e._binBE.writeASCII},e._copyTile=function(e,t,r,n,i,a,o,s){for(var u=Math.min(t,i-o),l=Math.min(r,a-s),c=0;c>--l&1)];u[o]=f}}function a(e,t,r,n){if(255!=e[t+3])return 0;if(0==r)return t;for(var i=0;i<2;i++){0==e[t+i]&&(e[t+i]=e.length,e.push(0,0,n,255));var o=a(e,e[t+i],r-1,n+1);if(0!=o)return o}return 0}function o(e){for(var t=e.b,r=e.f;t<25&&e.a>(t.b-=e)&65535>>16-e}function u(e,t){var r=e[0],n=0,i=255;t.b<16&&o(t);var a=t.f>>t.b-8&255;for(i=r[(n=e[1][a])+3],t.b-=r[n+2];255==i;)i=r[(n=r[n+(t.f>>--t.b&1)])+3];return i}function l(e,t){return e<32768>>16-t&&(e+=1-(1<>>1);else if(6==t)g=e[p]+(m-e[p-o]>>>1);else{if(7!=t)throw t;g=m+e[p]>>>1}e[d]+=g}}}return function(a){if(e=a,t=0,65496!=n())throw"e";for(var o=[],s=0,l=0,c=0,p=[],m=[],g=[],b=0,y=0,_=0;;){var v=n();if(65535!=v){var w=n();if(65475==v){l=r(),y=n(),_=n(),b=r();for(var x=0;x>4,15&B]}}else if(65476==v)for(var E=t+w-2;t>>4],p[S[0]]=S.slice(1)}s=r(),t+=2;break}65501==v?c=n():t+=w-2}}else t--}var A=new(l>8?Uint16Array:Uint8Array)(y*_*b),C={b:0,f:0,c:8==s,a:t,data:e,d:e.length,e:c};if(C.c)!function(r,n,i,a,o){for(var s=e.length-t,l=0;lP&&(P=j),($=M[1])>T&&(T=$),I.push(j*$)}if(1!=P||1!=T){if(3!=b||1!=I[1]||1!=I[2])throw"e";if(2!=P||1!=T&&2!=T)throw"e";var R=[],F=0;for(x=0;x>>1)*N+(j>>>1))*F,G=2*(1&$)+(1&j);A[W=($*_+j)*b]=U[Z+G],A[W+1]=U[Z+4],A[W+2]=U[Z+5]}else for(j=0;j<_;j++){var W;Z=($*N+(j>>>1))*F,G=1&j,A[W=($*_+j)*b]=U[Z+G],A[W+1]=U[Z+2],A[W+2]=U[Z+3]}}else if(f(A,_*b,C,g,b,y),0==c)d(A,s,_,y,0,b,b,l);else{var H=Math.floor(c/_);for($=0;$>>6),n=0;n<3;n++)for(var i=0;i<41;i++)t[n][i]=[r,1];return t}function o(e,t){var r=0,n=8-e.a;if(e.j,e.a,t){if(t>=n)do{r<<=n,t-=n,r|=e[e.j]&(1<=8);t&&(r<<=t,n-=t,r|=e[e.j]>>>n&(1<d&&h>>2,u)return void(y[m]=p);l=t.t*t.c[e.g+x-v]+t.c[e.g+w-x]}else p=x>w&&x>k||x>>2:B+E>>>1,l=t.t*t.c[e.g+x-w]+t.c[e.g+w-B];c=S(l);var A=function(e){for(var t=-1,r=0;!r;t++)r=e[e.j]>>>7-e.a&1,e.a++,e.a&=7,e.a||e.j++;return t}(r);if(A>>1):b>>>1,s[c][0]+=S(b),s[c][1]==e.f&&(s[c][0]>>>=1,s[c][1]>>>=1),s[c][1]++,p=l<0?p-b:p+b,e.i&&(p<0?p+=t.w:p>e.g&&(p-=t.w)),y[m]=p>=0?Math.min(p,e.g):0}function u(e,t,r){for(var n=e[0].length,i=t;i<=r;i++)e[i][0]=e[i-1][1],e[i][n-1]=e[i-1][n-2]}function l(e){u(e,7,12),u(e,2,4),u(e,15,17)}function c(e,t,r,i,a,o,u,c,f,h,d,p,m){for(var g=0,b=1,y=a4;b8&&(s(e,t,r,i,a,b,c[f]),s(e,t,r,i,o,b,c[f]),b+=2);l(i)}function f(e,t,r,n,i,a){c(e,t,r,n,2,7,i,a,0,0,1,0,8),c(e,t,r,n,8,15,i,a,1,0,1,0,8),c(e,t,r,n,3,9,i,a,2,1,0,3,0),c(e,t,r,n,10,16,i,a,0,0,0,3,2),c(e,t,r,n,4,11,i,a,1,0,0,3,2),c(e,t,r,n,12,17,i,a,2,1,0,3,0)}function h(e,t,r,n,i,a){var o=a.length,s=e.l;i+1==e.s&&(s=e.e-i*e.l);for(var u=6*e.e*n+i*e.l,l=0;l<6;l++){for(var c=0;c>>1):2==h?15+(l>>>1):7+l;var d=e.h?(2*c/3&2147483646|c%3&1)+(c%3>>>1):c>>>1;t[u+c]=r[f][d+1]}u+=e.e}}e._decompressRAF=function(o,s){var u=function(t){var r=e._binBE.readUshort,n={b:r(t,0),i:t[2],C:t[3],u:t[4],q:r(t,5),k:r(t,7),e:r(t,9),l:r(t,11),s:t[13],d:r(t,14)};if(18771!=n.b||n.i>1||n.q<6||n.q%6||n.e<768||n.e%24||768!=n.l||n.k=n.l||n.s>16||n.s!=n.k/n.l||n.s!=Math.ceil(n.e/n.l)||n.d!=n.q/6||12!=n.u&&14!=n.u&&16!=n.u||16!=n.C&&0!=n.C)throw"Invalid data";if(0==n.i)throw"Not implemented. We need this file!";return n.h=16==n.C,n.m=0|(n.h?2*n.l/3:n.l>>>1),n.A=n.m+2,n.f=64,n.g=(1<{const t=utif.encodeImage(e.data,e.width,e.height);return Buffer.from(t)},decode:e=>{const t=utif.decode(e),r=t[0];if(!r)throw new Error("No page found in TIFF");if(!r.t256)throw new Error("No image width found in TIFF");if(!r.t257)throw new Error("No image height found in TIFF");t.forEach(t=>{utif.decodeImage(e,t)});const n=utif.toRGBA8(r);return{data:Buffer.from(n),width:getDimensionValue(r.t256),height:getDimensionValue(r.t257)}}}}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(util$1||(util$1={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(objectUtil||(objectUtil={}));const ZodParsedType=util$1.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:null===e?ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$1.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;ne.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let r;switch(e.code){case ZodIssueCode.invalid_type:r=e.received===ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,util$1.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${util$1.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${util$1.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${util$1.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:util$1.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,util$1.assertNever(e)}return{message:r}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],o={...i,path:a};if(void 0!==i.message)return{...i,path:a,message:i.message};let s="";const u=n.filter(e=>!!e).slice().reverse();for(const e of u)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},EMPTY_PATH=[];function addIssueToContext(e,t){const r=getErrorMap(),n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===errorMap?void 0:errorMap].filter(e=>!!e)});e.common.issues.push(n)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return INVALID;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return ParseStatus.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:i}=n;if("aborted"===t.status)return INVALID;if("aborted"===i.status)return INVALID;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||void 0===i.value&&!n.alwaysSet||(r[t.value]=i.value)}return{status:e.value,value:r}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>"aborted"===e.status,isDirty=e=>"dirty"===e.status,isValid=e=>"valid"===e.status,isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise;function __classPrivateFieldGet(e,t,r,n){if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function __classPrivateFieldSet(e,t,r,n,i){if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var errorUtil,_ZodEnum_cache,_ZodNativeEnum_cache;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{var a,o;const{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:i.defaultError}:void 0===i.data?{message:null!==(a=null!=s?s:n)&&void 0!==a?a:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!==(o=null!=s?s:r)&&void 0!==o?o:i.defaultError}},description:i}}class ZodType{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},i=this._parseSync({data:e,path:n.path,parent:n});return handleResult(n,i)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await(isAsync(n)?n:Promise.resolve(n));return handleResult(r,i)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const i=e(t),a=()=>n.addIssue({code:ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(a(),!1)):!!i||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${dateRegexSource}T${timeRegexSource(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function isValidIP(e,t){return!("v4"!==t&&t||!ipv4Regex.test(e))||!("v6"!==t&&t||!ipv6Regex.test(e))}class ZodString extends ZodType{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ZodParsedType.string){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:t.parsedType}),INVALID}const t=new ParseStatus;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.lengthn.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const i=e.data.length>n.value,a=e.data.lengthe.test(t),{validation:t,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(r)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...errorUtil.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...errorUtil.errToObj(t)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ZodParsedType.number){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:t.parsedType}),INVALID}let t;const r=new ParseStatus;for(const n of this._def.checks)"int"===n.kind?util$1.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==floatSafeRemainder(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_finite,message:n.message}),r.dirty()):util$1.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,r,n){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:errorUtil.toString(n)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&util$1.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:t.parsedType}),INVALID}let t;const r=new ParseStatus;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):util$1.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,r,n){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:errorUtil.toString(n)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:t.parsedType}),INVALID}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ZodParsedType.date){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:t.parsedType}),INVALID}if(isNaN(e.data.getTime()))return addIssueToContext(this._getOrReturnCtx(e),{code:ZodIssueCode.invalid_date}),INVALID;const t=new ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):util$1.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:t.parsedType}),INVALID}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:t.parsedType}),INVALID}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.null){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:t.parsedType}),INVALID}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:t.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:t.parsedType}),INVALID}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==ZodParsedType.array)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:t.parsedType}),INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.lengthn.maxLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new ParseInputLazyPath(t,e,t.path,r)))).then(e=>ParseStatus.mergeArray(r,e));const i=[...t.data].map((e,r)=>n.type._parseSync(new ParseInputLazyPath(t,e,t.path,r)));return ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(e=>deepPartialify(e))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=util$1.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ZodParsedType.object){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||a.push(e);const o=[];for(const e of i){const t=n[e],i=r.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)o.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(addIssueToContext(r,{code:ZodIssueCode.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of o){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>ParseStatus.mergeObjectSync(t,e)):ParseStatus.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,a,o;const s=null!==(a=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=errorUtil.errToObj(e).message)&&void 0!==o?o:s}:{message:s}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};return util$1.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};return util$1.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};return util$1.objectKeys(this.shape).forEach(r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new ZodObject({...this._def,shape:()=>t})}required(e){const t={};return util$1.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ZodOptional;)e=e._def.innerType;t[r]=e}}),new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(util$1.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new ZodError(e.ctx.common.issues));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:r}),INVALID});{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map(e=>new ZodError(e));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:i}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util$1.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.object)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(addIssueToContext(t,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=getDiscriminator(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...processCreateParams(r)})}}function mergeValues(e,t){const r=getParsedType(e),n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===ZodParsedType.object&&n===ZodParsedType.object){const r=util$1.objectKeys(t),n=util$1.objectKeys(e).filter(e=>-1!==r.indexOf(e)),i={...e,...t};for(const r of n){const n=mergeValues(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n{if(isAborted(e)||isAborted(n))return INVALID;const i=mergeValues(e.value,n.value);return i.valid?((isDirty(e)||isDirty(n))&&t.dirty(),{status:t.value,value:i.data}):(addIssueToContext(r,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ZodIntersection.create=(e,t,r)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(r)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(r.data.lengththis._def.items.length&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new ParseInputLazyPath(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>ParseStatus.mergeArray(t,e)):ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;const n=[],i=this._def.keyType,a=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new ParseInputLazyPath(r,e,r.path,e)),value:a._parse(new ParseInputLazyPath(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?ParseStatus.mergeObjectAsync(t,n):ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(r)}:{keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.map)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:r.parsedType}),INVALID;const n=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new ParseInputLazyPath(r,e,r.path,[a,"key"])),value:i._parse(new ParseInputLazyPath(r,t,r.path,[a,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of a){const n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of a){const n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,r)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(r)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.set)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:r.parsedType}),INVALID;const n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const o=[...r.data.values()].map((e,t)=>i._parse(new ParseInputLazyPath(r,e,r.path,t)));return r.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.function)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:t.parsedType}),INVALID;function r(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter(e=>!!e),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter(e=>!!e),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return OK(async function(...t){const o=new ZodError([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(r(t,e)),o}),u=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(u,i).catch(e=>{throw o.addIssue(n(u,e)),o})})}{const e=this;return OK(function(...t){const o=e._def.args.safeParse(t,i);if(!o.success)throw new ZodError([r(t,o.error)]);const s=Reflect.apply(a,this,o.data),u=e._def.returns.safeParse(s,i);if(!u.success)throw new ZodError([n(s,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(r)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{expected:util$1.joinValues(r),received:t.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:r}),INVALID}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ZodEnum.create(e,{...this._def,...t})}exclude(e,t=this._def){return ZodEnum.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}_ZodEnum_cache=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(e){const t=util$1.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ZodParsedType.string&&r.parsedType!==ZodParsedType.number){const e=util$1.objectValues(t);return addIssueToContext(r,{expected:util$1.joinValues(e),received:r.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util$1.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(e.data)){const e=util$1.objectValues(t);return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:e}),INVALID}return OK(e.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap,ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.promise&&!1===t.common.async)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:t.parsedType}),INVALID;const r=t.parsedType===ZodParsedType.promise?t.data:Promise.resolve(t.data);return OK(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{addIssueToContext(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){const e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return INVALID;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?INVALID:"dirty"===n.status||"dirty"===t.value?DIRTY(n.value):n});{if("aborted"===t.value)return INVALID;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?INVALID:"dirty"===n.status||"dirty"===t.value?DIRTY(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!isValid(e))return e;const a=n.transform(e.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>isValid(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):e)}util$1.assertNever(n)}}ZodEffects.create=(e,t,r)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(r)}),ZodEffects.createWithPreprocess=(e,t,r)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(r)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return isAsync(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.nan){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:t.parsedType}),INVALID}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e),r=e=>(isValid(e)&&(e.value=Object.freeze(e.value)),e);return isAsync(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function custom(e,t={},r){return e?ZodAny.create().superRefine((n,i)=>{var a,o;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,s=null===(o=null!==(a=e.fatal)&&void 0!==a?a:r)||void 0===o||o,u="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...u,fatal:s})}}):ZodAny.create()}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom(t=>t instanceof e,t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util$1},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError}),Edge,Edge2;Edge2=Edge||(Edge={}),Edge2[Edge2.EXTEND=1]="EXTEND",Edge2[Edge2.WRAP=2]="WRAP",Edge2[Edge2.CROP=3]="CROP";const JimpClassSchema=z.object({bitmap:z.object({data:z.union([z.instanceof(Buffer),z.instanceof(Uint8Array)]),width:z.number(),height:z.number()})}),BlitOptionsSchemaComplex=z.object({src:JimpClassSchema,x:z.number().optional(),y:z.number().optional(),srcX:z.number().optional(),srcY:z.number().optional(),srcW:z.number().optional(),srcH:z.number().optional()}),BlitOptionsSchema=z.union([JimpClassSchema,BlitOptionsSchemaComplex]),methods$h={blit(e,t){const r=BlitOptionsSchema.parse(t);let{src:n,x:i=0,y:a=0,srcX:o=0,srcY:s=0,srcW:u=n.bitmap.width,srcH:l=n.bitmap.height}="bitmap"in r?{src:r}:r;if(!("bitmap"in n))throw new Error("The source must be a Jimp image");if("number"!=typeof i||"number"!=typeof a)throw new Error("x and y must be numbers");i=Math.round(i),a=Math.round(a),o=Math.round(o),s=Math.round(s),u=Math.round(u),l=Math.round(l);const c=e.bitmap.width,f=e.bitmap.height;return scan(n,o,s,u,l,function(t,r,u){const l=i+t-o,h=a+r-s;if(l>=0&&h>=0&&c-l>0&&f-h>0){const t=e.getPixelIndex(l,h),r={r:n.bitmap.data[u]||0,g:n.bitmap.data[u+1]||0,b:n.bitmap.data[u+2]||0,a:n.bitmap.data[u+3]||0},i={r:e.bitmap.data[t]||0,g:e.bitmap.data[t+1]||0,b:e.bitmap.data[t+2]||0,a:e.bitmap.data[t+3]||0};e.bitmap.data[t]=(r.a*(r.r-i.r)-i.r+255>>8)+i.r,e.bitmap.data[t+1]=(r.a*(r.g-i.g)-i.g+255>>8)+i.g,e.bitmap.data[t+2]=(r.a*(r.b-i.b)-i.b+255>>8)+i.b,e.bitmap.data[t+3]=limit255(i.a+r.a)}}),e}},mulTable=[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],shgTable=[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],methods$g={blur(e,t){if("number"!=typeof t)throw new Error("r must be a number");if(t<1)throw new Error("r must be greater than 0");let r,n,i,a,o,s,u,l,c,f,h,d,p;const m=e.bitmap.width-1,g=e.bitmap.height-1,b=t+1,y=mulTable[t],_=shgTable[t],v=[],w=[],x=[],k=[],B=[],E=[];let S=2;for(;S-- >0;){for(d=0,p=0,s=0;sm?m:u)<<2),r+=e.bitmap.data[l++],n+=e.bitmap.data[l++],i+=e.bitmap.data[l++],a+=e.bitmap.data[l];for(o=0;o0?l<<2:0),c=p+B[o],f=p+E[o],r+=e.bitmap.data[c++]-e.bitmap.data[f++],n+=e.bitmap.data[c++]-e.bitmap.data[f++],i+=e.bitmap.data[c++]-e.bitmap.data[f++],a+=e.bitmap.data[c]-e.bitmap.data[f++],d++;p+=e.bitmap.width<<2}for(o=0;og?0:e.bitmap.width,r+=v[h],n+=w[h],i+=x[h],a+=k[h];for(d=o<<2,s=0;s>>_),e.bitmap.data[d+1]=limit255(n*y>>>_),e.bitmap.data[d+2]=limit255(i*y>>>_),e.bitmap.data[d+3]=limit255(a*y>>>_),0===o&&(B[s]=((l=s+b)0?l*e.bitmap.width:0),c=o+B[s],f=o+E[s],r+=v[c]-v[f],n+=w[c]-w[f],i+=x[c]-x[f],a+=k[c]-k[f],d+=e.bitmap.width<<2}}return e},gaussian(e,t){if("number"!=typeof t)throw new Error("r must be a number");if(t<1)throw new Error("r must be greater than 0");const r=Math.ceil(2.57*t),n=2*r+1,i=t*t*2,a=i*Math.PI,o=[];for(let e=0;ee.bitmap.height?e.bitmap.height:e.bitmap.width)/2,i="number"==typeof r.x?r.x:e.bitmap.width/2,a="number"==typeof r.y?r.y:e.bitmap.height/2;return e.scan((t,r,o)=>{const s=Math.sqrt(Math.pow(t-i,2)+Math.pow(r-a,2));n-s<=0?e.bitmap.data[o+3]=0:n-s<1&&(e.bitmap.data[o+3]=255*(n-s))}),e}},ConvolutionMatrixSchema=z.array(z.number()).min(1).array(),ConvolutionComplexOptionsSchema=z.object({kernel:ConvolutionMatrixSchema,edgeHandling:z.nativeEnum(Edge).optional()}),ConvolutionOptionsSchema=z.union([ConvolutionMatrixSchema,ConvolutionComplexOptionsSchema]),ConvoluteComplexOptionsSchema=z.object({kernel:ConvolutionMatrixSchema,x:z.number().optional(),y:z.number().optional(),w:z.number().optional(),h:z.number().optional()}),ConvoluteOptionsSchema=z.union([ConvolutionMatrixSchema,ConvoluteComplexOptionsSchema]),PixelateSize=z.number().min(1).max(1/0),PixelateComplexOptionsSchema=z.object({size:PixelateSize,x:z.number().optional(),y:z.number().optional(),w:z.number().optional(),h:z.number().optional()}),PixelateOptionsSchema=z.union([PixelateSize,PixelateComplexOptionsSchema]);function applyKernel(e,t,r,n){const i=[0,0,0,0],a=(t.length-1)/2;for(let o=0;o{t.r[e.bitmap.data[i+0]]++,t.g[e.bitmap.data[i+1]]++,t.b[e.bitmap.data[i+2]]++}),t}const normalizeValue=function(e,t,r){return 255*(e-t)/(r-t)},getBounds=function(e){return[e.findIndex(e=>e>0),255-e.slice().reverse().findIndex(e=>e>0)]},methods$e={normalize(e){const t=histogram(e),r={r:getBounds(t.r),g:getBounds(t.g),b:getBounds(t.b)};return e.scan((t,n,i)=>{const a=e.bitmap.data[i+0],o=e.bitmap.data[i+1],s=e.bitmap.data[i+2];e.bitmap.data[i+0]=normalizeValue(a,r.r[0],r.r[1]),e.bitmap.data[i+1]=normalizeValue(o,r.g[0],r.g[1]),e.bitmap.data[i+2]=normalizeValue(s,r.b[0],r.b[1])}),e},invert:e=>(e.scan((t,r,n)=>{e.bitmap.data[n]=255-e.bitmap.data[n],e.bitmap.data[n+1]=255-e.bitmap.data[n+1],e.bitmap.data[n+2]=255-e.bitmap.data[n+2]}),e),brightness(e,t){if("number"!=typeof t)throw new Error("val must be numbers");return e.scan((r,n,i)=>{e.bitmap.data[i]=limit255(e.bitmap.data[i]*t),e.bitmap.data[i+1]=limit255(e.bitmap.data[i+1]*t),e.bitmap.data[i+2]=limit255(e.bitmap.data[i+2]*t)}),e},contrast(e,t){if("number"!=typeof t)throw new Error("val must be numbers");if(t<-1||t>1)throw new Error("val must be a number between -1 and +1");const r=(t+1)/(1-t);function n(e){return(e=Math.floor(r*(e-127)+127))<0?0:e>255?255:e}return e.scan((t,r,i)=>{e.bitmap.data[i]=n(e.bitmap.data[i]),e.bitmap.data[i+1]=n(e.bitmap.data[i+1]),e.bitmap.data[i+2]=n(e.bitmap.data[i+2])}),e},posterize(e,t){if("number"!=typeof t)throw new Error("n must be numbers");return t<2&&(t=2),e.scan((r,n,i)=>{const a=e.bitmap.data[i],o=e.bitmap.data[i+1],s=e.bitmap.data[i+2];e.bitmap.data[i]=Math.floor(a/255*(t-1))/(t-1)*255,e.bitmap.data[i+1]=Math.floor(o/255*(t-1))/(t-1)*255,e.bitmap.data[i+2]=Math.floor(s/255*(t-1))/(t-1)*255}),e},greyscale:e=>(e.scan((t,r,n)=>{const i=.2126*e.bitmap.data[n]+.7152*e.bitmap.data[n+1]+.0722*e.bitmap.data[n+2];e.bitmap.data[n]=i,e.bitmap.data[n+1]=i,e.bitmap.data[n+2]=i}),e),opacity(e,t){if("number"!=typeof t)throw new Error("f must be a number");if(t<0||t>1)throw new Error("f must be a number from 0 to 1");return e.scan((r,n,i)=>{const a=e.bitmap.data[i+3]*t;e.bitmap.data[i+3]=a}),e},sepia:e=>(e.scan((t,r,n)=>{let i=e.bitmap.data[n],a=e.bitmap.data[n+1],o=e.bitmap.data[n+2];i=.393*i+.769*a+.189*o,a=.349*i+.686*a+.168*o,o=.272*i+.534*a+.131*o,e.bitmap.data[n]=i<255?i:255,e.bitmap.data[n+1]=a<255?a:255,e.bitmap.data[n+2]=o<255?o:255}),e),fade(e,t){if("number"!=typeof t)throw new Error("f must be a number");if(t<0||t>1)throw new Error("f must be a number from 0 to 1");return this.opacity(e,1-t)},convolution(e,t){const r=ConvolutionOptionsSchema.parse(t),{kernel:n,edgeHandling:i=Edge.EXTEND}="kernel"in r?r:{kernel:r,edgeHandling:void 0};if(!n[0])throw new Error("kernel must be a matrix");const a=Buffer.from(e.bitmap.data),o=n.length,s=n[0].length,u=Math.floor(o/2),l=Math.floor(s/2),c=-u,f=-l;let h,d,p,m,g,b,y,_,v,w;return e.scan((t,r,o)=>{m=0,p=0,d=0;for(let a=c;a<=u;a++)for(let o=f;o<=l;o++)_=t+o,v=r+a,h=n[a+u][o+l],w=e.getPixelIndex(_,v,i),-1===w?(y=0,b=0,g=0):(g=e.bitmap.data[w+0],b=e.bitmap.data[w+1],y=e.bitmap.data[w+2]),d+=h*g,p+=h*b,m+=h*y;d<0&&(d=0),p<0&&(p=0),m<0&&(m=0),d>255&&(d=255),p>255&&(p=255),m>255&&(m=255),a[o+0]=d,a[o+1]=p,a[o+2]=m}),e.bitmap.data=a,e},opaque:e=>(e.scan((t,r,n)=>{e.bitmap.data[n+3]=255}),e),pixelate(e,t){const r=PixelateOptionsSchema.parse(t),{size:n,x:i=0,y:a=0,w:o=e.bitmap.width-i,h:s=e.bitmap.height-a}="number"==typeof r?{size:r}:r,u=[[1/16,2/16,1/16],[2/16,.25,2/16],[1/16,2/16,1/16]],l=clone(e);return scan(l,i,a,o,s,(t,r,i)=>{t=n*Math.floor(t/n),r=n*Math.floor(r/n);const a=applyKernel(l,u,t,r);e.bitmap.data[i]=a[0],e.bitmap.data[i+1]=a[1],e.bitmap.data[i+2]=a[2],e.bitmap.data[i+3]=a[3]}),e},convolute(e,t){const r=ConvoluteOptionsSchema.parse(t),{kernel:n,x:i=0,y:a=0,w:o=e.bitmap.width-i,h:s=e.bitmap.height-a}="kernel"in r?r:{kernel:r},u=clone(e);return scan(u,i,a,o,s,(t,r,i)=>{const a=applyKernel(u,n,t,r);e.bitmap.data[i]=limit255(a[0]),e.bitmap.data[i+1]=limit255(a[1]),e.bitmap.data[i+2]=limit255(a[2]),e.bitmap.data[i+3]=limit255(a[3])}),e},color(e,t){if(!t||!Array.isArray(t))throw new Error("actions must be an array");return t.forEach(e=>ColorActionNameSchema.parse(e)),t=t.map(e=>("xor"!==e.apply&&"mix"!==e.apply||(e.params[0]=tinycolor(e.params[0]).toRgb()),e)),e.scan((r,n,i)=>{let a={r:e.bitmap.data[i],g:e.bitmap.data[i+1],b:e.bitmap.data[i+2]};const o=(e,t)=>limit255(a[e]+t);t.forEach(e=>{if("mix"===e.apply)a=mix(a,e.params[0],e.params[1]);else if("tint"===e.apply)a=mix(a,{r:255,g:255,b:255},e.params?.[0]);else if("shade"===e.apply)a=mix(a,{r:0,g:0,b:0},e.params?.[0]);else if("xor"===e.apply)a={r:a.r^e.params[0].r,g:a.g^e.params[0].g,b:a.b^e.params[0].b};else if("red"===e.apply)a.r=o("r",e.params[0]);else if("green"===e.apply)a.g=o("g",e.params[0]);else if("blue"===e.apply)a.b=o("b",e.params[0]);else{"hue"===e.apply&&(e.apply="spin");const t=tinycolor(a),r=t[e.apply].bind(t);if(!r)throw new Error("action "+e.apply+" not supported");a=r(...e.params||[]).toRgb()}}),e.bitmap.data[i]=a.r,e.bitmap.data[i+1]=a.g,e.bitmap.data[i+2]=a.b}),e}};var lib$1={},ieee754={read:function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=l}return(d?-1:1)*o*Math.pow(2,a-n)},write:function(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,l-=8);e[r+d-p]|=128*m}};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AnsiStringType=e.StringType=e.BufferType=e.Uint8ArrayType=e.IgnoreType=e.Float80_LE=e.Float80_BE=e.Float64_LE=e.Float64_BE=e.Float32_LE=e.Float32_BE=e.Float16_LE=e.Float16_BE=e.INT64_BE=e.UINT64_BE=e.INT64_LE=e.UINT64_LE=e.INT32_LE=e.INT32_BE=e.INT24_BE=e.INT24_LE=e.INT16_LE=e.INT16_BE=e.INT8=e.UINT32_BE=e.UINT32_LE=e.UINT24_BE=e.UINT24_LE=e.UINT16_BE=e.UINT16_LE=e.UINT8=void 0;const t=ieee754;function r(e){return new DataView(e.buffer,e.byteOffset)}e.UINT8={len:1,get:(e,t)=>r(e).getUint8(t),put:(e,t,n)=>(r(e).setUint8(t,n),t+1)},e.UINT16_LE={len:2,get:(e,t)=>r(e).getUint16(t,!0),put:(e,t,n)=>(r(e).setUint16(t,n,!0),t+2)},e.UINT16_BE={len:2,get:(e,t)=>r(e).getUint16(t),put:(e,t,n)=>(r(e).setUint16(t,n),t+2)},e.UINT24_LE={len:3,get(e,t){const n=r(e);return n.getUint8(t)+(n.getUint16(t+1,!0)<<8)},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.UINT24_BE={len:3,get(e,t){const n=r(e);return(n.getUint16(t)<<8)+n.getUint8(t+2)},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.UINT32_LE={len:4,get:(e,t)=>r(e).getUint32(t,!0),put:(e,t,n)=>(r(e).setUint32(t,n,!0),t+4)},e.UINT32_BE={len:4,get:(e,t)=>r(e).getUint32(t),put:(e,t,n)=>(r(e).setUint32(t,n),t+4)},e.INT8={len:1,get:(e,t)=>r(e).getInt8(t),put:(e,t,n)=>(r(e).setInt8(t,n),t+1)},e.INT16_BE={len:2,get:(e,t)=>r(e).getInt16(t),put:(e,t,n)=>(r(e).setInt16(t,n),t+2)},e.INT16_LE={len:2,get:(e,t)=>r(e).getInt16(t,!0),put:(e,t,n)=>(r(e).setInt16(t,n,!0),t+2)},e.INT24_LE={len:3,get(t,r){const n=e.UINT24_LE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.INT24_BE={len:3,get(t,r){const n=e.UINT24_BE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.INT32_BE={len:4,get:(e,t)=>r(e).getInt32(t),put:(e,t,n)=>(r(e).setInt32(t,n),t+4)},e.INT32_LE={len:4,get:(e,t)=>r(e).getInt32(t,!0),put:(e,t,n)=>(r(e).setInt32(t,n,!0),t+4)},e.UINT64_LE={len:8,get:(e,t)=>r(e).getBigUint64(t,!0),put:(e,t,n)=>(r(e).setBigUint64(t,n,!0),t+8)},e.INT64_LE={len:8,get:(e,t)=>r(e).getBigInt64(t,!0),put:(e,t,n)=>(r(e).setBigInt64(t,n,!0),t+8)},e.UINT64_BE={len:8,get:(e,t)=>r(e).getBigUint64(t),put:(e,t,n)=>(r(e).setBigUint64(t,n),t+8)},e.INT64_BE={len:8,get:(e,t)=>r(e).getBigInt64(t),put:(e,t,n)=>(r(e).setBigInt64(t,n),t+8)},e.Float16_BE={len:2,get(e,r){return t.read(e,r,!1,10,this.len)},put(e,r,n){return t.write(e,n,r,!1,10,this.len),r+this.len}},e.Float16_LE={len:2,get(e,r){return t.read(e,r,!0,10,this.len)},put(e,r,n){return t.write(e,n,r,!0,10,this.len),r+this.len}},e.Float32_BE={len:4,get:(e,t)=>r(e).getFloat32(t),put:(e,t,n)=>(r(e).setFloat32(t,n),t+4)},e.Float32_LE={len:4,get:(e,t)=>r(e).getFloat32(t,!0),put:(e,t,n)=>(r(e).setFloat32(t,n,!0),t+4)},e.Float64_BE={len:8,get:(e,t)=>r(e).getFloat64(t),put:(e,t,n)=>(r(e).setFloat64(t,n),t+8)},e.Float64_LE={len:8,get:(e,t)=>r(e).getFloat64(t,!0),put:(e,t,n)=>(r(e).setFloat64(t,n,!0),t+8)},e.Float80_BE={len:10,get(e,r){return t.read(e,r,!1,63,this.len)},put(e,r,n){return t.write(e,n,r,!1,63,this.len),r+this.len}},e.Float80_LE={len:10,get(e,r){return t.read(e,r,!0,63,this.len)},put(e,r,n){return t.write(e,n,r,!0,63,this.len),r+this.len}},e.IgnoreType=class{constructor(e){this.len=e}get(e,t){}},e.Uint8ArrayType=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}},e.BufferType=class{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}},e.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class n{constructor(e){this.len=e}static decode(e,t,r){let i="";for(let a=t;a>10),56320+(1023&e)))}static singleByteDecoder(e){if(n.inRange(e,0,127))return e;const t=n.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return n.decode(e,t,t+this.len)}}e.AnsiStringType=n,n.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]}(lib$1);var core$1={},ReadStreamTokenizer$1={},AbstractTokenizer$1={},lib={},EndOfFileStream={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EndOfStreamError=e.defaultMessages=void 0,e.defaultMessages="End-Of-Stream";class t extends Error{constructor(){super(e.defaultMessages)}}e.EndOfStreamError=t}(EndOfFileStream);var StreamReader={},Deferred$1={};Object.defineProperty(Deferred$1,"__esModule",{value:!0}),Deferred$1.Deferred=void 0;class Deferred{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((e,t)=>{this.reject=t,this.resolve=e})}}Deferred$1.Deferred=Deferred,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;const t=EndOfFileStream,r=Deferred$1;var n=EndOfFileStream;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}}),e.StreamReader=class{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>this.reject(new t.EndOfStreamError)),this.s.once("error",e=>this.reject(e)),this.s.once("close",()=>this.reject(new Error("Stream closed")))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,r,n){if(0===n)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new t.EndOfStreamError;let i=n,a=0;for(;this.peekQueue.length>0&&i>0;){const t=this.peekQueue.pop();if(!t)throw new Error("peekData should be defined");const n=Math.min(t.length,i);e.set(t.subarray(0,n),r+a),a+=n,i-=n,n0&&!this.endOfStream;){const t=Math.min(i,1048576),n=await this.readFromStream(e,r+a,t);if(a+=n,n{this.readDeferred(i)}),i.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",()=>{this.readDeferred(e)})}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}}(StreamReader),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;var t=EndOfFileStream;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return t.EndOfStreamError}});var r=StreamReader;Object.defineProperty(e,"StreamReader",{enumerable:!0,get:function(){return r.StreamReader}})}(lib),Object.defineProperty(AbstractTokenizer$1,"__esModule",{value:!0}),AbstractTokenizer$1.AbstractTokenizer=void 0;const peek_readable_1$2=lib;class AbstractTokenizer{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i0){const i=new Uint8Array(r.length+t);return n=await this.peekBuffer(i,{mayBeLess:r.mayBeLess}),e.set(i.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof peek_readable_1$1.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n[...e].map(e=>e.charCodeAt(0)),tarHeaderChecksumMatches:(e,t=0)=>{const r=parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(r))return!1;let n=256;for(let r=t;r127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}},supported$1={extensions:["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd"]};const Token=lib$1,strtok3=core$1,{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=util,supported=supported$1,minimumBytes=4100;async function fromStream(e){const t=await strtok3.fromStream(e);try{return await fromTokenizer(t)}finally{await t.close()}}async function fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Buffer?e:Buffer.from(e);if(t&&t.length>1)return fromTokenizer(strtok3.fromBuffer(t))}function _check(e,t,r){r={offset:0,...r};for(const[n,i]of t.entries())if(r.mask){if(i!==(r.mask[n]&e[n+r.offset]))return!1}else if(i!==e[n+r.offset])return!1;return!0}async function fromTokenizer(e){try{return _fromTokenizer(e)}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}}async function _fromTokenizer(e){let t=Buffer.alloc(minimumBytes);const r=(e,r)=>_check(t,e,r),n=(e,t)=>r(stringToBytes(e),t);if(e.fileInfo.size||(e.fileInfo.size=Number.MAX_SAFE_INTEGER),await e.peekBuffer(t,{length:12,mayBeLess:!0}),r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(r([37,33]))return await e.peekBuffer(t,{length:24,mayBeLess:!0}),n("PS-Adobe-",{offset:2})&&n(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(n("ID3")){await e.ignore(6);const i=await e.readToken(uint32SyncSafeToken);return e.position+i>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(i),fromTokenizer(e))}if(n("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===t[0]||70===t[0])&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(n("FLIF"))return{ext:"flif",mime:"image/flif"};if(n("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(n("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(n("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(n("FORM"))return{ext:"aif",mime:"audio/aiff"};if(n("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(r([80,75,3,4])){try{for(;e.position+30=0?o:t.length)}else await e.ignore(a.compressedSize)}}catch(s){if(!(s instanceof strtok3.EndOfStreamError))throw s}return{ext:"zip",mime:"application/zip"}}if(n("OggS")){await e.ignore(28);const u=Buffer.alloc(8);return await e.readBuffer(u),_check(u,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(u,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(u,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(u,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(u,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(u,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(n("ftyp",{offset:4})&&96&t[8]){const l=t.toString("binary",8,12).replace("\0"," ").trim();switch(l){case"avif":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return l.startsWith("3g")?l.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(n("MThd"))return{ext:"mid",mime:"audio/midi"};if(n("wOFF")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(n("wOF2")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([212,195,178,161])||r([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(n("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(n("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(n("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(n("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(n("%PDF")){await e.ignore(1350);const c=10485760,f=Buffer.alloc(Math.min(c,e.fileInfo.size));return await e.readBuffer(f,{mayBeLess:!0}),f.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([73,73,42,0]))return n("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:r([28,0,254,0],{offset:8})||r([31,0,11,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:r([8,0,0,0],{offset:4})&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(t=Buffer.alloc(24),await e.peekBuffer(t),(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(n("MAC "))return{ext:"ape",mime:"audio/ape"};if(r([26,69,223,163])){async function h(){const t=await e.peekNumber(Token.UINT8);let r=128,n=0;for(;!(t&r)&&0!==r;)++n,r>>=1;const i=Buffer.alloc(n+1);return await e.readBuffer(i),i}async function d(){const e=await h(),t=await h();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function p(t,r){for(;r>0;){const t=await d();if(17026===t.id)return e.readToken(new Token.StringType(t.len,"utf-8"));await e.ignore(t.len),--r}}const m=await d();switch(await p(0,m.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}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(n("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(n("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(n("MSCF")||n("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(r([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(n("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(n("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(n("IMPM"))return{ext:"it",mime:"audio/x-it"};if(n("-lh0-",{offset:2})||n("-lh1-",{offset:2})||n("-lh2-",{offset:2})||n("-lh3-",{offset:2})||n("-lh4-",{offset:2})||n("-lh5-",{offset:2})||n("-lh6-",{offset:2})||n("-lh7-",{offset:2})||n("-lzs-",{offset:2})||n("-lz4-",{offset:2})||n("-lz5-",{offset:2})||n("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(r([0,0,1,186])){if(r([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(r([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(n("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(n(""))return await e.ignore(8),"debian-binary"===await e.readToken(new Token.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(r([137,80,78,71,13,10,26,10])){async function g(){return{length:await e.readToken(Token.INT32_BE),type:await e.readToken(new Token.StringType(4,"binary"))}}await e.ignore(8);do{const b=await g();if(b.length<0)return;switch(b.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(b.length+4)}}while(e.position+8=16){const x=t.readUInt32LE(12);if(x>12&&t.length>=x+16)try{const k=t.slice(16,x+16).toString();if(JSON.parse(k).files)return{ext:"asar",mime:"application/x-asar"}}catch(B){}}if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(n("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(r([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(r([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(t,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(n("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(t.length>=2&&r([255,224],{offset:0,mask:[255,224]})){if(r([16],{offset:1,mask:[22]}))return r([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(r([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}const stream=readableStream=>new Promise((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",async()=>{const e=new stream.PassThrough;let t;t=stream.pipeline?stream.pipeline(readableStream,e,()=>{}):readableStream.pipe(e);const r=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{const t=await fromBuffer(r);e.fileType=t}catch(e){reject(e)}resolve(t)})}),fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)});var core=fileType,fileType$1=getDefaultExportFromCjs(core);function to(e,t){return e.then(function(e){return[null,e]}).catch(function(e){return[e,void 0]})}const writeFile=async()=>{throw new Error("Not supported")};function Mime$1(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e1)&&(o=1),("number"!=typeof s||s<0||s>1)&&(s=1);const u=compositeModes[a];return r=Math.round(r),n=Math.round(n),1!==s&&e.scan((t,r,n)=>{const i=e.bitmap.data[n+3]*s;e.bitmap.data[n+3]=i}),t.scan((i,a,s)=>{const l=e.getPixelIndex(r+i,n+a,Edge.CROP);if(-1===l)return;const c=u({r:t.bitmap.data[s+0]/255,g:t.bitmap.data[s+1]/255,b:t.bitmap.data[s+2]/255,a:t.bitmap.data[s+3]/255},{r:e.bitmap.data[l+0]/255,g:e.bitmap.data[l+1]/255,b:e.bitmap.data[l+2]/255,a:e.bitmap.data[l+3]/255},o);e.bitmap.data[l+0]=limit255(255*c.r),e.bitmap.data[l+1]=limit255(255*c.g),e.bitmap.data[l+2]=limit255(255*c.b),e.bitmap.data[l+3]=limit255(255*c.a)}),e}var jpeg$1={parseSections:function(e,t){var r,n;for(e.setBigEndian(!0);e.remainingLength()>0&&218!==n;){if(255!==e.nextUInt8())throw new Error("Invalid JPEG section offset");r=(n=e.nextUInt8())>=208&&n<=217||218===n?0:e.nextUInt16()-2,t(n,e.branch(0,r)),e.skip(r)}},getSizeFromSOFSection:function(e){return e.skip(1),{height:e.nextUInt16(),width:e.nextUInt16()}},getSectionName:function(e){var t,r;switch(e){case 216:t="SOI";break;case 196:t="DHT";break;case 219:t="DQT";break;case 221:t="DRI";break;case 218:t="SOS";break;case 254:t="COM";break;case 217:t="EOI";break;default:e>=224&&e<=239?(t="APP",r=e-224):e>=192&&e<=207&&196!==e&&200!==e&&204!==e?(t="SOF",r=e-192):e>=208&&e<=215&&(t="RST",r=e-208)}var n={name:t};return"number"==typeof r&&(n.index=r),n}};function readExifValue(e,t){switch(e){case 1:return t.nextUInt8();case 3:case 8:return t.nextUInt16();case 4:case 9:return t.nextUInt32();case 5:return[t.nextUInt32(),t.nextUInt32()];case 6:return t.nextInt8();case 10:return[t.nextInt32(),t.nextInt32()];case 11:return t.nextFloat();case 12:return t.nextDouble();default:throw new Error("Invalid format while decoding: "+e)}}function getBytesPerComponent(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}}function readExifTag(e,t){var r,n,i=t.nextUInt16(),a=t.nextUInt16(),o=getBytesPerComponent(a),s=t.nextUInt32(),u=o*s;if(u>4&&(t=e.openWithOffset(t.nextUInt32())),2===a){var l=(r=t.nextString(s)).indexOf("\0");-1!==l&&(r=r.substr(0,l))}else if(7===a)r=t.nextBuffer(s);else if(0!==a)for(r=[],n=0;n4,n=r?e.bitmap.height:e.bitmap.width,i=r?e.bitmap.width:e.bitmap.height;t&&transformBitmap(e,n,i,t)}async function attemptExifRotate(e,t){try{e._exif=EXIFParser.create(t).parse(),exifRotate(e)}catch{}}var __defProp$2=Object.defineProperty,__defNormalProp$2=(e,t,r)=>t in e?__defProp$2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__publicField$2=(e,t,r)=>__defNormalProp$2(e,"symbol"!=typeof t?t+"":t,r);const emptyBitmap={data:Buffer.alloc(0),width:0,height:0};function bufferFromArrayBuffer(e){const t=Buffer.alloc(e.byteLength),r=new Uint8Array(e);for(let e=0;ee()),i=class{constructor(e=emptyBitmap){if(__publicField$2(this,"bitmap",emptyBitmap),__publicField$2(this,"background",0),__publicField$2(this,"formats",[]),__publicField$2(this,"mime"),this.formats=n,"data"in e)this.bitmap=e;else if(this.bitmap={data:Buffer.alloc(e.width*e.height*4),width:e.width,height:e.height},e.color){this.background="string"==typeof e.color?cssColorToHex(e.color):e.color;for(let e=0;e{const n=e[t]?.(this,...r);return"object"==typeof n&&"bitmap"in n?(this.bitmap=n.bitmap,this):n}}static async read(e,t){if(Buffer.isBuffer(e)||e instanceof ArrayBuffer)return this.fromBuffer(e);const[r,n]=await to(fetch(e));if(r)throw new Error(`Could not load Buffer from URL: ${e}`);if(!n.ok)throw new Error(`HTTP Status ${n.status} for url ${e}`);const[i,a]=await to(n.arrayBuffer());if(i)throw new Error(`Could not load Buffer from ${e}`);const o=bufferFromArrayBuffer(a);return this.fromBuffer(o,t)}static fromBitmap(e){let t;if(e.data instanceof Buffer&&(t=Buffer.from(e.data)),(e.data instanceof Uint8Array||e.data instanceof Uint8ClampedArray)&&(t=Buffer.from(e.data.buffer)),Array.isArray(e.data)&&(t=Buffer.concat(e.data.map(e=>Buffer.from(e.toString(16).padStart(8,"0"),"hex")))),!t)throw new Error("data must be a Buffer");if("number"!=typeof e.height||"number"!=typeof e.width)throw new Error("bitmap must have width and height");return new i({height:e.height,width:e.width,data:t})}static async fromBuffer(e,t){const r=e instanceof ArrayBuffer?bufferFromArrayBuffer(e):e,a=await fileType$1.fromBuffer(r);if(!a||!a.mime)throw new Error("Could not find MIME for Buffer");const o=n.find(e=>e.mime===a.mime);if(!o||!o.decode)throw new Error(`Mime type ${a.mime} does not support decoding`);const s=new i(await o.decode(r,t?.[o.mime]));return s.mime=a.mime,attemptExifRotate(s,r),s}inspect(){return""}toString(){return"[object Jimp]"}get width(){return this.bitmap.width}get height(){return this.bitmap.height}async getBuffer(e,t){const r=this.formats.find(t=>t.mime===e);if(!r||!r.encode)throw new Error(`Unsupported MIME type: ${e}`);let n;return r.hasAlpha?n=this:(n=new i({width:this.bitmap.width,height:this.bitmap.height,color:this.background}),composite(n,this)),r.encode(n.bitmap,t)}async getBase64(e,t){return"data:"+e+";base64,"+(await this.getBuffer(e,t)).toString("base64")}async write(e,t){const r=mime.getType(e);await writeFile(e,await this.getBuffer(r,t))}clone(){return new i({...this.bitmap,data:Buffer.from(this.bitmap.data)})}getPixelIndex(e,t,r){let n,i;if(r||(r=Edge.EXTEND),"number"!=typeof e||"number"!=typeof t)throw new Error("x and y must be numbers");n=e=Math.round(e),i=t=Math.round(t),r===Edge.EXTEND&&(e<0&&(n=0),e>=this.bitmap.width&&(n=this.bitmap.width-1),t<0&&(i=0),t>=this.bitmap.height&&(i=this.bitmap.height-1)),r===Edge.WRAP&&(e<0&&(n=this.bitmap.width+e),e>=this.bitmap.width&&(n=e%this.bitmap.width),t<0&&(i=this.bitmap.height+t),t>=this.bitmap.height&&(i=t%this.bitmap.height));let a=this.bitmap.width*i+n<<2;return(n<0||n>=this.bitmap.width)&&(a=-1),(i<0||i>=this.bitmap.height)&&(a=-1),a}getPixelColor(e,t){if("number"!=typeof e||"number"!=typeof t)throw new Error("x and y must be numbers");const r=this.getPixelIndex(e,t);return this.bitmap.data.readUInt32BE(r)}setPixelColor(e,t,r){if("number"!=typeof e||"number"!=typeof t||"number"!=typeof r)throw new Error("hex, x and y must be numbers");const n=this.getPixelIndex(t,r);return this.bitmap.data.writeUInt32BE(e,n),this}hasAlpha(){const{width:e,height:t,data:r}=this.bitmap,n=e*t<<2;for(let e=3;e0&&this.heightOriginal>0&&this.targetWidth>0&&this.targetHeight>0))throw console.log(this),new Error("Invalid settings specified for the resizer.");this.configurePasses()},Resize.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))},Resize.prototype._resizeWidthInterpolatedRGBChannels=function(e,t){const r=t?4:3,n=this.ratioWeightWidthPass,i=this.widthBuffer;let a,o,s=0,u=0,l=0,c=0,f=0;for(a=0;s<1/3;a+=r,s+=n)for(u=a,l=0;u=f)){d+=c;break}h+=r,d=h,c-=f}while(c>0&&h=u)){c+=s;break}l=d,c=l,s-=u}while(s>0&&l3&&(this.outputWidthWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.heightOriginal)))},Resize.prototype.initializeSecondPassBuffers=function(e){this.heightBuffer=this.generateUint8Buffer(this.finalResultSize),e||(this.outputHeightWorkBench=this.generateFloatBuffer(this.targetWidthMultipliedByChannels),this.colorChannels>3&&(this.outputHeightWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.targetWidth)))},Resize.prototype.generateFloatBuffer=function(e){try{return new Float32Array(e)}catch(e){return console.error(e),[]}},Resize.prototype.generateFloat64Buffer=function(e){try{return new Float64Array(e)}catch(e){return console.error(e),[]}},Resize.prototype.generateUint8Buffer=function(e){try{return new Uint8Array(e)}catch(e){return console.error(e),[]}};const operations={nearestNeighbor(e,t){const r=e.width,n=e.height,i=t.width,a=t.height,o=e.data,s=t.data;for(let e=0;e0?i[t-4]:2*i[t]-i[t+4],c=i[t],f=i[t+4],h=a0?p[t-4*f]:2*p[t]-p[t+4*f],l=p[t],c=p[t+4*f],h=i1)for(let e=0;e{e.bitmap.data=Buffer.from(t),e.bitmap.width=n,e.bitmap.height=i}).resize(e.bitmap.data);return e},scale(e,t){const{f:r,mode:n}="number"==typeof t?{f:t}:ScaleComplexOptionsSchema.parse(t),i=e.bitmap.width*r,a=e.bitmap.height*r;return this.resize(e,{w:i,h:a,mode:n})},scaleToFit(e,t){const{h:r,w:n,mode:i}=ScaleToFitOptionsSchema.parse(t),a=n/r>e.bitmap.width/e.bitmap.height?r/e.bitmap.height:n/e.bitmap.width;return this.scale(e,{f:a,mode:i})}},ContainOptionsSchema=z.object({w:z.number(),h:z.number(),align:z.number().optional(),mode:z.nativeEnum(ResizeStrategy).optional()}),methods$c={contain(e,t){const{w:r,h:n,align:i=HorizontalAlign.CENTER|VerticalAlign.MIDDLE,mode:a}=ContainOptionsSchema.parse(t),o=7&i,s=i>>3;if((0===o||o&o-1)&&(0===s||s&s-1))throw new Error("only use one flag per alignment direction");const u=o>>1,l=s>>1,c=r/n>e.bitmap.width/e.bitmap.height?n/e.bitmap.height:r/e.bitmap.width,f=methods$d.scale(clone(e),{f:c,mode:a});return(e=methods$d.resize(e,{w:r,h:n,mode:a})).scan((t,r,n)=>{e.bitmap.data.writeUInt32BE(e.background,n)}),e=methods$h.blit(e,{src:f,x:(e.bitmap.width-f.bitmap.width)/2*u,y:(e.bitmap.height-f.bitmap.height)/2*l})}},CropOptionsSchema=z.object({x:z.number(),y:z.number(),w:z.number(),h:z.number()}),AutocropComplexOptionsSchema=z.object({tolerance:z.number().min(0).max(1).optional(),cropOnlyFrames:z.boolean().optional(),cropSymmetric:z.boolean().optional(),leaveBorder:z.number().optional(),ignoreSides:z.object({north:z.boolean().optional(),south:z.boolean().optional(),east:z.boolean().optional(),west:z.boolean().optional()}).optional()}),methods$b={crop(e,t){let{x:r,y:n,w:i,h:a}=CropOptionsSchema.parse(t);if(r=Math.round(r),n=Math.round(n),i=Math.round(i),a=Math.round(a),0===r&&i===e.bitmap.width){const t=i*n+r<<2,o=t+(a*i<<2);e.bitmap.data=e.bitmap.data.slice(t,o)}else{const t=Buffer.allocUnsafe(i*a*4);let o=0;scan(e,r,n,i,a,function(r,n,i){const a=e.bitmap.data.readUInt32BE(i);t.writeUInt32BE(a,o),o+=4}),e.bitmap.data=t}return e.bitmap.width=i,e.bitmap.height=a,e},autocrop(e,t={}){const{tolerance:r=2e-4,cropOnlyFrames:n=!0,cropSymmetric:i=!1,leaveBorder:a=0,ignoreSides:o}="number"==typeof t?{tolerance:t}:AutocropComplexOptionsSchema.parse(t),s=e.bitmap.width,u=e.bitmap.height,l={north:!1,south:!1,east:!1,west:!1,...o};let c=e.getPixelColor(0,0);const f=intToRGBA$1(c);let h=0,d=0,p=0,m=0;if(c=e.getPixelColor(0,0),!l.north)e:for(let t=0;tr)break e;h++}if(c=e.getPixelColor(s,0),!l.west)e:for(let t=0;tr)break e;m++}if(c=e.getPixelColor(0,u),!l.south)e:for(let t=u-1;t>=h+1;t--){for(let n=s-d-1;n>=0;n--)if(colorDiff(f,intToRGBA$1(e.getPixelColor(n,t)))>r)break e;p++}if(c=e.getPixelColor(s,u),!l.east)e:for(let t=s-1;t>=0+m+1;t--){for(let n=u-1;n>=0+h;n--)if(colorDiff(f,intToRGBA$1(e.getPixelColor(t,n)))>r)break e;d++}let g=!1;if(m-=a,d-=a,h-=a,p-=a,i){const e=Math.min(d,m),t=Math.min(h,p);m=e,d=e,h=t,p=t}m=m>=0?m:0,d=d>=0?d:0,h=h>=0?h:0,p=p>=0?p:0;const b=s-(m+d),y=u-(p+h);return g=n?0!==d&&0!==h&&0!==m&&0!==p:0!==d||0!==h||0!==m||0!==p,g&&this.crop(e,{x:m,y:h,w:b,h:y}),e}},CoverOptionsSchema=z.object({w:z.number(),h:z.number(),align:z.number().optional(),mode:z.nativeEnum(ResizeStrategy).optional()}),methods$a={cover(e,t){const{w:r,h:n,align:i=HorizontalAlign.CENTER|VerticalAlign.MIDDLE,mode:a}=CoverOptionsSchema.parse(t),o=7&i,s=i>>3;if((0===o||o&o-1)&&(0===s||s&s-1))throw new Error("only use one flag per alignment direction");const u=o>>1,l=s>>1,c=r/n>e.bitmap.width/e.bitmap.height?r/e.bitmap.width:n/e.bitmap.height;return e=methods$d.scale(e,{f:c,mode:a}),methods$b.crop(e,{x:(e.bitmap.width-r)/2*u,y:(e.bitmap.height-n)/2*l,w:r,h:n})}},DisplaceOptionsSchema=z.object({map:JimpClassSchema,offset:z.number()}),methods$9={displace(e,t){const{map:r,offset:n}=DisplaceOptionsSchema.parse(t),i=clone(e);return e.scan((t,a,o)=>{let s=r.bitmap.data[o]/256*n;s=Math.round(s);const u=e.getPixelIndex(t+s,a);e.bitmap.data[u]=i.bitmap.data[o],e.bitmap.data[u+1]=i.bitmap.data[o+1],e.bitmap.data[u+2]=i.bitmap.data[o+2]}),e}},methods$8={dither(e){const t=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];return e.scan((r,n,i)=>{const a=t[((3&n)<<2)+r%4];e.bitmap.data[i]=Math.min(e.bitmap.data[i]+a,255),e.bitmap.data[i+1]=Math.min(e.bitmap.data[i+1]+a,255),e.bitmap.data[i+2]=Math.min(e.bitmap.data[i+2]+a,255)}),e}},FisheyeOptionsSchema=z.object({radius:z.number().min(0).optional()}),methods$7={fisheye(e,t={}){const{radius:r=2.5}=FisheyeOptionsSchema.parse(t),n=clone(e),{width:i,height:a}=n.bitmap;return n.scan((t,o)=>{const s=t/i,u=o/a,l=Math.sqrt(Math.pow(s-.5,2)+Math.pow(u-.5,2)),c=2*Math.pow(l,r),f=(s-.5)/l,h=(u-.5)/l,d=Math.round((c*f+.5)*i),p=Math.round((c*h+.5)*a),m=n.getPixelColor(d,p);e.setPixelColor(m,t,o)}),e.setPixelColor(n.getPixelColor(i/2,a/2),i/2,a/2),e}},FlipOptionsSchema=z.object({horizontal:z.boolean().optional(),vertical:z.boolean().optional()}),methods$6={flip(e,t){const{horizontal:r,vertical:n}=FlipOptionsSchema.parse(t),i=Buffer.alloc(e.bitmap.data.length);return e.scan((t,a,o)=>{const s=r?e.bitmap.width-1-t:t,u=n?e.bitmap.height-1-a:a,l=e.bitmap.width*u+s<<2,c=e.bitmap.data.readUInt32BE(o);i.writeUInt32BE(c,l)}),e.bitmap.data=Buffer.from(i),e}};function Converter$1(e,t){if(!(e&&t&&e.length&&t.length))throw new Error("Bad alphabet");this.srcAlphabet=e,this.dstAlphabet=t}Converter$1.prototype.convert=function(e){var t,r,n,i={},a=this.srcAlphabet.length,o=this.dstAlphabet.length,s=e.length,u="string"==typeof e?"":[];if(!this.isValid(e))throw new Error('Number "'+e+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return e;for(t=0;t=o?(i[n++]=parseInt(r/o,10),r%=o):n>0&&(i[n++]=0);s=n,u=this.dstAlphabet.slice(r,r+1).concat(u)}while(0!==n);return u},Converter$1.prototype.isValid=function(e){for(var t=0;tt in e?__defProp$1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__publicField$1=(e,t,r)=>__defNormalProp$1(e,"symbol"!=typeof t?t+"":t,r);class ImagePHash{constructor(e,t){__publicField$1(this,"size"),__publicField$1(this,"smallerSize"),this.size=e||32,this.smallerSize=t||8,initCoefficients(this.size)}distance(e,t){let r=0;for(let n=0;ni?"1":"0";return a}}function intToRGBA(e){const t=255&e,r=255&(e>>>=8),n=255&(e>>>=8);return{r:255&(e>>>=8),g:n,b:r,a:t}}const c$1=[];function initCoefficients(e){for(let t=1;t(new ImagePHash).getHash(e),hash(e,t=64){if(t<2||t>64)throw new Error("base must be a number between 2 and 64");const r=alphabet.slice(0,t),n=this.pHash(e),i=maxHashLength[t];return anyBase$1(anyBase$1.BIN,r)(n).padStart(i,"0")},distanceFromHash(e,t){const r=new ImagePHash,n=r.getHash(e);return r.distance(n,t)}};function distance(e,t){const r=new ImagePHash,n=r.getHash(e),i=r.getHash(t);return r.distance(n,i)}function compareHashes(e,t){return(new ImagePHash).distance(e,t)}const MaskOptionsObjectSchema=z.object({src:JimpClassSchema,x:z.number().optional(),y:z.number().optional()}),MaskOptionsSchema=z.union([JimpClassSchema,MaskOptionsObjectSchema]),methods$4={mask(e,t){let r,n,i;MaskOptionsSchema.parse(t),"bitmap"in t?(r=t,n=0,i=0):(r=t.src,n=t.x??0,i=t.y??0),n=Math.round(n),i=Math.round(i);const a=e.bitmap.width,o=e.bitmap.height;return r.scan(function(t,s,u){const l=n+t,c=i+s;if(l>=0&&c>=0&&l{if(measureText(e,t+(n.length>1?" ":""))>r){const n=t[Symbol.iterator]();let o="";for(const t of n){const n=[...a,o+t].join(" "),s=measureText(e,n);sr?(i.push([...a,o]),a=[],o=t):(i.push([...a,o+t]),a=[],o="")}return}const s=[...a,t].join(" "),u=measureText(e,s);u<=r&&!t.includes("\n")?(u>o&&(o=u),a.push(t)):(i.push(a),a=[t.replace("\n","")])}),i.push(a),{lines:i,longestLine:o}}function measureTextHeight(e,t,r){const{lines:n}=splitLines(e,t,r);return n.length*e.common.lineHeight}const PrintOptionsSchema=z.object({x:z.number(),y:z.number(),text:z.union([z.union([z.string(),z.number()]),z.object({text:z.union([z.string(),z.number()]),alignmentX:z.nativeEnum(HorizontalAlign).optional(),alignmentY:z.nativeEnum(VerticalAlign).optional()})]),maxWidth:z.number().optional(),maxHeight:z.number().optional(),cb:z.function(z.tuple([z.object({x:z.number(),y:z.number()})])).optional()});function xOffsetBasedOnAlignment(e,t,r,n){return n===HorizontalAlign.LEFT?0:n===HorizontalAlign.CENTER?(r-measureText(e,t))/2:r-measureText(e,t)}function drawCharacter(e,t,r,n,i){if(i.width>0&&i.height>0){const a=t.pages[i.page];a&&(e=methods$h.blit(e,{src:a,x:r+i.xoffset,y:n+i.yoffset,srcX:i.x,srcY:i.y,srcW:i.width,srcH:i.height}))}return e}function printText(e,t,r,n,i,a){for(let o=0;o{}}=PrintOptionsSchema.parse(r);"object"==typeof s&&null!==s.text&&void 0!==s.text?(n=s.alignmentX||HorizontalAlign.LEFT,i=s.alignmentY||VerticalAlign.TOP,({text:s}=s)):(n=HorizontalAlign.LEFT,i=VerticalAlign.TOP,s=s.toString()),"number"==typeof s&&(s=s.toString()),l!==1/0&&i===VerticalAlign.BOTTOM?o+=l-measureTextHeight(t,s,u):l!==1/0&&i===VerticalAlign.MIDDLE&&(o+=l/2-measureTextHeight(t,s,u)/2);const f=Object.entries(t.chars).find(e=>e[1].xadvance)?.[1].xadvance;if("number"!=typeof f)throw new Error("Could not find default character width");const{lines:h,longestLine:d}=splitLines(t,s,u);return h.forEach(r=>{const i=r.join(" "),s=xOffsetBasedOnAlignment(t,i,u,n);printText(e,t,a+s,o,i,f),o+=t.common.lineHeight}),c.bind(e)({x:a+d,y:o}),e}},RotateOptionsSchema=z.union([z.number(),z.object({deg:z.number(),mode:z.union([z.boolean(),z.nativeEnum(ResizeStrategy)]).optional()})]);function createIdxTranslationFunction(e){return function(t,r){return r*e+t<<2}}function matrixRotate(e,t){if(Math.abs(t)%90!=0)throw new Error("Unsupported matrix rotation degree");const r=e.bitmap.width,n=e.bitmap.height;let i;switch(t){case 90:case-270:i=90;break;case 180:case-180:i=180;break;case 270:case-90:i=-90;break;default:throw new Error("Unsupported matrix rotation degree")}const a=180===i?r:n,o=180===i?n:r,s=Buffer.alloc(e.bitmap.data.length),u=createIdxTranslationFunction(r),l=createIdxTranslationFunction(a);for(let t=0;t{e.bitmap.data.writeUInt32BE(e.background,n)});const n=Math.max(o,s,e.bitmap.width,e.bitmap.height);e=composite(e=methods$d.resize(e,{h:n,w:n,mode:!0===r?void 0:r}),t,e.bitmap.width/2-t.bitmap.width/2,e.bitmap.height/2-t.bitmap.height/2)}const u=e.bitmap.width,l=e.bitmap.height,c=Buffer.alloc(e.bitmap.data.length),f=createTranslationFunction(-u/2,-l/2),h=createTranslationFunction(u/2+.5,l/2+.5);for(let t=1;t<=l;t++)for(let r=1;r<=u;r++){const n=f(r,t),o=h(i*n.x-a*n.y,i*n.y+a*n.x),s=u*(t-1)+r-1<<2;if(o.x>=0&&o.x=0&&o.y{const o=e.bitmap.data[a]t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__publicField=(e,t,r)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,r),r),constants_exports={};__export(constants_exports,{bt709:()=>bt709_exports});var bt709_exports={};__export(bt709_exports,{Y:()=>Y,x:()=>x$1,y:()=>y$1});var Y=(e=>(e[e.RED=.2126]="RED",e[e.GREEN=.7152]="GREEN",e[e.BLUE=.0722]="BLUE",e[e.WHITE=1]="WHITE",e))(Y||{}),x$1=(e=>(e[e.RED=.64]="RED",e[e.GREEN=.3]="GREEN",e[e.BLUE=.15]="BLUE",e[e.WHITE=.3127]="WHITE",e))(x$1||{}),y$1=(e=>(e[e.RED=.33]="RED",e[e.GREEN=.6]="GREEN",e[e.BLUE=.06]="BLUE",e[e.WHITE=.329]="WHITE",e))(y$1||{}),conversion_exports={};function correctGamma(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}function rgb2xyz(e,t,r){return{x:.4124*(e=correctGamma(e/255))+.3576*(t=correctGamma(t/255))+.1805*(r=correctGamma(r/255)),y:.2126*e+.7152*t+.0722*r,z:.0193*e+.1192*t+.9505*r}}__export(conversion_exports,{lab2rgb:()=>lab2rgb,lab2xyz:()=>lab2xyz,rgb2hsl:()=>rgb2hsl,rgb2lab:()=>rgb2lab,rgb2xyz:()=>rgb2xyz,xyz2lab:()=>xyz2lab,xyz2rgb:()=>xyz2rgb});var arithmetic_exports={};function degrees2radians(e){return e*(Math.PI/180)}function max3(e,t,r){let n=e;return nt&&(n=t),n>r&&(n=r),n}function intInRange(e,t,r){return e>r&&(e=r),e255?e=255:e<0&&(e=0),e}function inRange0to255(e){return e>255?e=255:e<0&&(e=0),e}function stableSort(e,t){const r=typeof e[0];let n;if("number"===r||"string"===r){const r=Object.create(null);for(let t=0,n=e.length;tt(e,n)||r[e]-r[n])}else{const r=e.slice(0);n=e.sort((e,n)=>t(e,n)||r.indexOf(e)-r.indexOf(n))}return n}function rgb2hsl(e,t,r){const n=min3(e,t,r),i=max3(e,t,r),a=i-n,o=(n+i)/510;let s=0;o>0&&o<1&&(s=a/(o<.5?i+n:510-i-n));let u=0;return a>0&&(u=i===e?(t-r)/a:i===t?2+(r-e)/a:4+(e-t)/a,u*=60,u<0&&(u+=360)),{h:u,s,l:o}}__export(arithmetic_exports,{degrees2radians:()=>degrees2radians,inRange0to255:()=>inRange0to255,inRange0to255Rounded:()=>inRange0to255Rounded,intInRange:()=>intInRange,max3:()=>max3,min3:()=>min3,stableSort:()=>stableSort});var refX=.95047,refY=1,refZ=1.08883;function pivot(e){return e>.008856?e**(1/3):7.787*e+16/116}function xyz2lab(e,t,r){if(e=pivot(e/refX),t=pivot(t/refY),r=pivot(r/refZ),116*t-16<0)throw new Error("xxx");return{L:Math.max(0,116*t-16),a:500*(e-t),b:200*(t-r)}}function rgb2lab(e,t,r){const n=rgb2xyz(e,t,r);return xyz2lab(n.x,n.y,n.z)}var refX2=.95047,refY2=1,refZ2=1.08883;function pivot2(e){return e>.206893034?e**3:(e-16/116)/7.787}function lab2xyz(e,t,r){const n=(e+16)/116,i=n-r/200;return{x:refX2*pivot2(t/500+n),y:refY2*pivot2(n),z:refZ2*pivot2(i)}}function correctGamma2(e){return e>.0031308?1.055*e**(1/2.4)-.055:12.92*e}function xyz2rgb(e,t,r){const n=correctGamma2(3.2406*e+-1.5372*t+-.4986*r),i=correctGamma2(-.9689*e+1.8758*t+.0415*r),a=correctGamma2(.0557*e+-.204*t+1.057*r);return{r:inRange0to255Rounded(255*n),g:inRange0to255Rounded(255*i),b:inRange0to255Rounded(255*a)}}function lab2rgb(e,t,r){const n=lab2xyz(e,t,r);return xyz2rgb(n.x,n.y,n.z)}var distance_exports={};__export(distance_exports,{AbstractDistanceCalculator:()=>AbstractDistanceCalculator,AbstractEuclidean:()=>AbstractEuclidean,AbstractManhattan:()=>AbstractManhattan,CIE94GraphicArts:()=>CIE94GraphicArts,CIE94Textiles:()=>CIE94Textiles,CIEDE2000:()=>CIEDE2000,CMetric:()=>CMetric,Euclidean:()=>Euclidean,EuclideanBT709:()=>EuclideanBT709,EuclideanBT709NoAlpha:()=>EuclideanBT709NoAlpha,Manhattan:()=>Manhattan,ManhattanBT709:()=>ManhattanBT709,ManhattanNommyde:()=>ManhattanNommyde,PNGQuant:()=>PNGQuant});var AbstractDistanceCalculator=class{constructor(){__publicField(this,"_maxDistance"),__publicField(this,"_whitePoint"),this._setDefaults(),this.setWhitePoint(255,255,255,255)}setWhitePoint(e,t,r,n){this._whitePoint={r:e>0?255/e:0,g:t>0?255/t:0,b:r>0?255/r:0,a:n>0?255/n:0},this._maxDistance=this.calculateRaw(e,t,r,n,0,0,0,0)}calculateNormalized(e,t){return this.calculateRaw(e.r,e.g,e.b,e.a,t.r,t.g,t.b,t.a)/this._maxDistance}},AbstractCIE94=class extends AbstractDistanceCalculator{calculateRaw(e,t,r,n,i,a,o,s){const u=rgb2lab(inRange0to255(e*this._whitePoint.r),inRange0to255(t*this._whitePoint.g),inRange0to255(r*this._whitePoint.b)),l=rgb2lab(inRange0to255(i*this._whitePoint.r),inRange0to255(a*this._whitePoint.g),inRange0to255(o*this._whitePoint.b)),c=u.L-l.L,f=u.a-l.a,h=u.b-l.b,d=Math.sqrt(u.a*u.a+u.b*u.b),p=d-Math.sqrt(l.a*l.a+l.b*l.b);let m=f*f+h*h-p*p;m=m<0?0:Math.sqrt(m);const g=(s-n)*this._whitePoint.a*this._kA;return Math.sqrt((c/this._Kl)**2+(p/(1+this._K1*d))**2+(m/(1+this._K2*d))**2+g**2)}},CIE94Textiles=class extends AbstractCIE94{_setDefaults(){this._Kl=2,this._K1=.048,this._K2=.014,this._kA=12.5/255}},CIE94GraphicArts=class extends AbstractCIE94{_setDefaults(){this._Kl=1,this._K1=.045,this._K2=.015,this._kA=25/255}},_CIEDE2000=class extends AbstractDistanceCalculator{_setDefaults(){}static _calculatehp(e,t){const r=Math.atan2(e,t);return r>=0?r:r+_CIEDE2000._deg360InRad}static _calculateRT(e,t){const r=t**7,n=2*Math.sqrt(r/(r+_CIEDE2000._pow25to7)),i=_CIEDE2000._deg30InRad*Math.exp(-(((e-_CIEDE2000._deg275InRad)/_CIEDE2000._deg25InRad)**2));return-Math.sin(2*i)*n}static _calculateT(e){return 1-.17*Math.cos(e-_CIEDE2000._deg30InRad)+.24*Math.cos(2*e)+.32*Math.cos(3*e+_CIEDE2000._deg6InRad)-.2*Math.cos(4*e-_CIEDE2000._deg63InRad)}static _calculate_ahp(e,t,r,n){const i=r+n;return 0===e?i:t<=_CIEDE2000._deg180InRad?i/2:i<_CIEDE2000._deg360InRad?(i+_CIEDE2000._deg360InRad)/2:(i-_CIEDE2000._deg360InRad)/2}static _calculate_dHp(e,t,r,n){let i;return i=0===e?0:t<=_CIEDE2000._deg180InRad?r-n:r<=n?r-n+_CIEDE2000._deg360InRad:r-n-_CIEDE2000._deg360InRad,2*Math.sqrt(e)*Math.sin(i/2)}calculateRaw(e,t,r,n,i,a,o,s){const u=rgb2lab(inRange0to255(e*this._whitePoint.r),inRange0to255(t*this._whitePoint.g),inRange0to255(r*this._whitePoint.b)),l=rgb2lab(inRange0to255(i*this._whitePoint.r),inRange0to255(a*this._whitePoint.g),inRange0to255(o*this._whitePoint.b)),c=(s-n)*this._whitePoint.a*_CIEDE2000._kA,f=this.calculateRawInLab(u,l);return Math.sqrt(f+c*c)}calculateRawInLab(e,t){const r=e.L,n=e.a,i=e.b,a=t.L,o=t.a,s=t.b,u=((Math.sqrt(n*n+i*i)+Math.sqrt(o*o+s*s))/2)**7,l=.5*(1-Math.sqrt(u/(u+_CIEDE2000._pow25to7))),c=(1+l)*n,f=(1+l)*o,h=Math.sqrt(c*c+i*i),d=Math.sqrt(f*f+s*s),p=h*d,m=_CIEDE2000._calculatehp(i,c),g=_CIEDE2000._calculatehp(s,f),b=Math.abs(m-g),y=a-r,_=d-h,v=_CIEDE2000._calculate_dHp(p,b,g,m),w=_CIEDE2000._calculate_ahp(p,b,m,g),x=(h+d)/2,k=((r+a)/2-50)**2,B=_/(1+.045*x),E=v/(1+.015*_CIEDE2000._calculateT(w)*x);return(y/(1+.015*k/Math.sqrt(20+k)))**2+B**2+E**2+_CIEDE2000._calculateRT(w,x)*B*E}},CIEDE2000=_CIEDE2000;__publicField(CIEDE2000,"_kA",25/255),__publicField(CIEDE2000,"_pow25to7",25**7),__publicField(CIEDE2000,"_deg360InRad",degrees2radians(360)),__publicField(CIEDE2000,"_deg180InRad",degrees2radians(180)),__publicField(CIEDE2000,"_deg30InRad",degrees2radians(30)),__publicField(CIEDE2000,"_deg6InRad",degrees2radians(6)),__publicField(CIEDE2000,"_deg63InRad",degrees2radians(63)),__publicField(CIEDE2000,"_deg275InRad",degrees2radians(275)),__publicField(CIEDE2000,"_deg25InRad",degrees2radians(25));var CMetric=class extends AbstractDistanceCalculator{calculateRaw(e,t,r,n,i,a,o,s){const u=(e+i)/2*this._whitePoint.r,l=(e-i)*this._whitePoint.r,c=(t-a)*this._whitePoint.g,f=(r-o)*this._whitePoint.b,h=((512+u)*l*l>>8)+4*c*c+((767-u)*f*f>>8),d=(s-n)*this._whitePoint.a;return Math.sqrt(h+d*d)}_setDefaults(){}},AbstractEuclidean=class extends AbstractDistanceCalculator{calculateRaw(e,t,r,n,i,a,o,s){const u=i-e,l=a-t,c=o-r,f=s-n;return Math.sqrt(this._kR*u*u+this._kG*l*l+this._kB*c*c+this._kA*f*f)}},Euclidean=class extends AbstractEuclidean{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},EuclideanBT709=class extends AbstractEuclidean{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},EuclideanBT709NoAlpha=class extends AbstractEuclidean{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=0}},AbstractManhattan=class extends AbstractDistanceCalculator{calculateRaw(e,t,r,n,i,a,o,s){let u=i-e,l=a-t,c=o-r,f=s-n;return u<0&&(u=0-u),l<0&&(l=0-l),c<0&&(c=0-c),f<0&&(f=0-f),this._kR*u+this._kG*l+this._kB*c+this._kA*f}},Manhattan=class extends AbstractManhattan{_setDefaults(){this._kR=1,this._kG=1,this._kB=1,this._kA=1}},ManhattanNommyde=class extends AbstractManhattan{_setDefaults(){this._kR=.4984,this._kG=.8625,this._kB=.2979,this._kA=1}},ManhattanBT709=class extends AbstractManhattan{_setDefaults(){this._kR=.2126,this._kG=.7152,this._kB=.0722,this._kA=1}},PNGQuant=class extends AbstractDistanceCalculator{calculateRaw(e,t,r,n,i,a,o,s){const u=(s-n)*this._whitePoint.a;return this._colordifferenceCh(e*this._whitePoint.r,i*this._whitePoint.r,u)+this._colordifferenceCh(t*this._whitePoint.g,a*this._whitePoint.g,u)+this._colordifferenceCh(r*this._whitePoint.b,o*this._whitePoint.b,u)}_colordifferenceCh(e,t,r){const n=e-t,i=n+r;return n*n+i*i}_setDefaults(){}},palette_exports={};__export(palette_exports,{AbstractPaletteQuantizer:()=>AbstractPaletteQuantizer,ColorHistogram:()=>ColorHistogram,NeuQuant:()=>NeuQuant,NeuQuantFloat:()=>NeuQuantFloat,RGBQuant:()=>RGBQuant,WuColorCube:()=>WuColorCube,WuQuant:()=>WuQuant});var AbstractPaletteQuantizer=class{quantizeSync(){for(const e of this.quantize())if(e.palette)return e.palette;throw new Error("unreachable")}},Point=class{constructor(){__publicField(this,"r"),__publicField(this,"g"),__publicField(this,"b"),__publicField(this,"a"),__publicField(this,"uint32"),__publicField(this,"rgba"),this.uint32=-1>>>0,this.r=this.g=this.b=this.a=0,this.rgba=new Array(4),this.rgba[0]=0,this.rgba[1]=0,this.rgba[2]=0,this.rgba[3]=0}static createByQuadruplet(e){const t=new Point;return t.r=0|e[0],t.g=0|e[1],t.b=0|e[2],t.a=0|e[3],t._loadUINT32(),t._loadQuadruplet(),t}static createByRGBA(e,t,r,n){const i=new Point;return i.r=0|e,i.g=0|t,i.b=0|r,i.a=0|n,i._loadUINT32(),i._loadQuadruplet(),i}static createByUint32(e){const t=new Point;return t.uint32=e>>>0,t._loadRGBA(),t._loadQuadruplet(),t}from(e){this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this.uint32=e.uint32,this.rgba[0]=e.r,this.rgba[1]=e.g,this.rgba[2]=e.b,this.rgba[3]=e.a}getLuminosity(e){let t=this.r,r=this.g,n=this.b;return e&&(t=Math.min(255,255-this.a+this.a*t/255),r=Math.min(255,255-this.a+this.a*r/255),n=Math.min(255,255-this.a+this.a*n/255)),.2126*t+.7152*r+.0722*n}_loadUINT32(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0}_loadRGBA(){this.r=255&this.uint32,this.g=this.uint32>>>8&255,this.b=this.uint32>>>16&255,this.a=this.uint32>>>24&255}_loadQuadruplet(){this.rgba[0]=this.r,this.rgba[1]=this.g,this.rgba[2]=this.b,this.rgba[3]=this.a}},PointContainer=class{constructor(){__publicField(this,"_pointArray"),__publicField(this,"_width"),__publicField(this,"_height"),this._width=0,this._height=0,this._pointArray=[]}getWidth(){return this._width}getHeight(){return this._height}setWidth(e){this._width=e}setHeight(e){this._height=e}getPointArray(){return this._pointArray}clone(){const e=new PointContainer;e._width=this._width,e._height=this._height;for(let t=0,r=this._pointArray.length;t=i&&e=0;t--)if(e.uint32===this._pointArray[t].uint32)return!0;return!1}getNearestColor(e,t){return this._pointArray[0|this._getNearestIndex(e,t)]}getPointContainer(){return this._pointContainer}_nearestPointFromCache(e){return"number"==typeof this._i32idx[e]?this._i32idx[e]:-1}_getNearestIndex(e,t){let r=this._nearestPointFromCache(""+t.uint32);if(r>=0)return r;let n=Number.MAX_VALUE;r=0;for(let i=0,a=this._pointArray.length;i{const r=rgb2hsl(e.r,e.g,e.b),n=rgb2hsl(t.r,t.g,t.b),i=e.r===e.g&&e.g===e.b?0:1+hueGroup(r.h,hueGroups),a=(t.r===t.g&&t.g===t.b?0:1+hueGroup(n.h,hueGroups))-i;if(a)return-a;const o=e.getLuminosity(!0),s=t.getLuminosity(!0);if(s-o!=0)return s-o;const u=(100*n.s|0)-(100*r.s|0);return u?-u:0})}},utils_exports={};__export(utils_exports,{HueStatistics:()=>HueStatistics,Palette:()=>Palette,Point:()=>Point,PointContainer:()=>PointContainer,ProgressTracker:()=>ProgressTracker,arithmetic:()=>arithmetic_exports});var HueGroup=class{constructor(){__publicField(this,"num",0),__publicField(this,"cols",[])}},HueStatistics=class{constructor(e,t){__publicField(this,"_numGroups"),__publicField(this,"_minCols"),__publicField(this,"_stats"),__publicField(this,"_groupsFull"),this._numGroups=e,this._minCols=t,this._stats=[];for(let t=0;t<=e;t++)this._stats[t]=new HueGroup;this._groupsFull=0}check(e){this._groupsFull===this._numGroups+1&&(this.check=()=>{});const t=255&e,r=e>>>8&255,n=e>>>16&255,i=t===r&&r===n?0:1+hueGroup(rgb2hsl(t,r,n).h,this._numGroups),a=this._stats[i],o=this._minCols;a.num++,a.num>o||(a.num===o&&this._groupsFull++,a.num<=o&&this._stats[i].cols.push(e))}injectIntoDictionary(e){for(let t=0;t<=this._numGroups;t++)this._stats[t].num<=this._minCols&&this._stats[t].cols.forEach(t=>{e[t]?e[t]++:e[t]=1})}injectIntoArray(e){for(let t=0;t<=this._numGroups;t++)this._stats[t].num<=this._minCols&&this._stats[t].cols.forEach(t=>{-1===e.indexOf(t)&&e.push(t)})}},_ProgressTracker=class{constructor(e,t){__publicField(this,"progress"),__publicField(this,"_step"),__publicField(this,"_range"),__publicField(this,"_last"),__publicField(this,"_progressRange"),this._range=e,this._progressRange=t,this._step=Math.max(1,this._range/(_ProgressTracker.steps+1)|0),this._last=-this._step,this.progress=0}shouldNotify(e){return e-this._last>=this._step&&(this._last=e,this.progress=Math.min(this._progressRange*this._last/this._range,this._progressRange),!0)}},ProgressTracker=_ProgressTracker;__publicField(ProgressTracker,"steps",100);var networkBiasShift=3,Neuron=class{constructor(e){__publicField(this,"r"),__publicField(this,"g"),__publicField(this,"b"),__publicField(this,"a"),this.r=this.g=this.b=this.a=e}toPoint(){return Point.createByRGBA(this.r>>networkBiasShift,this.g>>networkBiasShift,this.b>>networkBiasShift,this.a>>networkBiasShift)}subtract(e,t,r,n){this.r-=0|e,this.g-=0|t,this.b-=0|r,this.a-=0|n}},_NeuQuant=class extends AbstractPaletteQuantizer{constructor(e,t=256){super(),__publicField(this,"_pointArray"),__publicField(this,"_networkSize"),__publicField(this,"_network"),__publicField(this,"_sampleFactor"),__publicField(this,"_radPower"),__publicField(this,"_freq"),__publicField(this,"_bias"),__publicField(this,"_distance"),this._distance=e,this._pointArray=[],this._sampleFactor=1,this._networkSize=t,this._distance.setWhitePoint(255<>3)*_NeuQuant._radiusBias,u=s>>_NeuQuant._radiusBiasShift;u<=1&&(u=0);for(let e=0;e>>0;i=t<_NeuQuant._minpicturebytes?1:t%_NeuQuant._prime1!=0?_NeuQuant._prime1:t%_NeuQuant._prime2!=0?_NeuQuant._prime2:t%_NeuQuant._prime3!=0?_NeuQuant._prime3:_NeuQuant._prime4;const l=new ProgressTracker(n,99);for(let e=0,c=0;e=t&&(c-=t),e++,0===a&&(a=1),e%a==0){o-=o/r|0,s-=s/_NeuQuant._radiusDecrease|0,u=s>>_NeuQuant._radiusBiasShift,u<=1&&(u=0);for(let e=0;e>>0}}}_buildPalette(){const e=new Palette;return this._network.forEach(t=>{e.add(t.toPoint())}),e.sort(),e}_alterNeighbour(e,t,r,n,i,a){let o=t-e;o<-1&&(o=-1);let s=t+e;s>this._networkSize&&(s=this._networkSize);let u=t+1,l=t-1,c=1;for(;uo;){const e=this._radPower[c++]/_NeuQuant._alphaRadBias;if(uo){const t=this._network[l--];t.subtract(e*(t.r-i),e*(t.g-n),e*(t.b-r),e*(t.a-a))}}}_alterSingle(e,t,r,n,i,a){e/=_NeuQuant._initAlpha;const o=this._network[t];o.subtract(e*(o.r-i),e*(o.g-n),e*(o.b-r),e*(o.a-a))}_contest(e,t,r,n){const i=1020<>_NeuQuant._initialBiasShift-networkBiasShift);h>_NeuQuant._betaShift;this._freq[l]-=d,this._bias[l]+=d<<_NeuQuant._gammaShift}return this._freq[s]+=_NeuQuant._beta,this._bias[s]-=_NeuQuant._betaGamma,u}},NeuQuant=_NeuQuant;__publicField(NeuQuant,"_prime1",499),__publicField(NeuQuant,"_prime2",491),__publicField(NeuQuant,"_prime3",487),__publicField(NeuQuant,"_prime4",503),__publicField(NeuQuant,"_minpicturebytes",_NeuQuant._prime4),__publicField(NeuQuant,"_nCycles",100),__publicField(NeuQuant,"_initialBiasShift",16),__publicField(NeuQuant,"_initialBias",1<<_NeuQuant._initialBiasShift),__publicField(NeuQuant,"_gammaShift",10),__publicField(NeuQuant,"_betaShift",10),__publicField(NeuQuant,"_beta",_NeuQuant._initialBias>>_NeuQuant._betaShift),__publicField(NeuQuant,"_betaGamma",_NeuQuant._initialBias<<_NeuQuant._gammaShift-_NeuQuant._betaShift),__publicField(NeuQuant,"_radiusBiasShift",6),__publicField(NeuQuant,"_radiusBias",1<<_NeuQuant._radiusBiasShift),__publicField(NeuQuant,"_radiusDecrease",30),__publicField(NeuQuant,"_alphaBiasShift",10),__publicField(NeuQuant,"_initAlpha",1<<_NeuQuant._alphaBiasShift),__publicField(NeuQuant,"_radBiasShift",8),__publicField(NeuQuant,"_radBias",1<<_NeuQuant._radBiasShift),__publicField(NeuQuant,"_alphaRadBiasShift",_NeuQuant._alphaBiasShift+_NeuQuant._radBiasShift),__publicField(NeuQuant,"_alphaRadBias",1<<_NeuQuant._alphaRadBiasShift);var networkBiasShift2=3,NeuronFloat=class{constructor(e){__publicField(this,"r"),__publicField(this,"g"),__publicField(this,"b"),__publicField(this,"a"),this.r=this.g=this.b=this.a=e}toPoint(){return Point.createByRGBA(this.r>>networkBiasShift2,this.g>>networkBiasShift2,this.b>>networkBiasShift2,this.a>>networkBiasShift2)}subtract(e,t,r,n){this.r-=e,this.g-=t,this.b-=r,this.a-=n}},_NeuQuantFloat=class extends AbstractPaletteQuantizer{constructor(e,t=256){super(),__publicField(this,"_pointArray"),__publicField(this,"_networkSize"),__publicField(this,"_network"),__publicField(this,"_sampleFactor"),__publicField(this,"_radPower"),__publicField(this,"_freq"),__publicField(this,"_bias"),__publicField(this,"_distance"),this._distance=e,this._pointArray=[],this._sampleFactor=1,this._networkSize=t,this._distance.setWhitePoint(255<>3)*_NeuQuantFloat._radiusBias,u=s>>_NeuQuantFloat._radiusBiasShift;u<=1&&(u=0);for(let e=0;e=t&&(c-=t),e++,0===a&&(a=1),e%a==0){o-=o/r,s-=s/_NeuQuantFloat._radiusDecrease,u=s>>_NeuQuantFloat._radiusBiasShift,u<=1&&(u=0);for(let e=0;e{e.add(t.toPoint())}),e.sort(),e}_alterNeighbour(e,t,r,n,i,a){let o=t-e;o<-1&&(o=-1);let s=t+e;s>this._networkSize&&(s=this._networkSize);let u=t+1,l=t-1,c=1;for(;uo;){const e=this._radPower[c++]/_NeuQuantFloat._alphaRadBias;if(uo){const t=this._network[l--];t.subtract(e*(t.r-i),e*(t.g-n),e*(t.b-r),e*(t.a-a))}}}_alterSingle(e,t,r,n,i,a){e/=_NeuQuantFloat._initAlpha;const o=this._network[t];o.subtract(e*(o.r-i),e*(o.g-n),e*(o.b-r),e*(o.a-a))}_contest(e,t,r,n){const i=1020<>_NeuQuantFloat._initialBiasShift-networkBiasShift2);h>_NeuQuantFloat._betaShift;this._freq[l]-=d,this._bias[l]+=d<<_NeuQuantFloat._gammaShift}return this._freq[s]+=_NeuQuantFloat._beta,this._bias[s]-=_NeuQuantFloat._betaGamma,u}},NeuQuantFloat=_NeuQuantFloat;__publicField(NeuQuantFloat,"_prime1",499),__publicField(NeuQuantFloat,"_prime2",491),__publicField(NeuQuantFloat,"_prime3",487),__publicField(NeuQuantFloat,"_prime4",503),__publicField(NeuQuantFloat,"_minpicturebytes",_NeuQuantFloat._prime4),__publicField(NeuQuantFloat,"_nCycles",100),__publicField(NeuQuantFloat,"_initialBiasShift",16),__publicField(NeuQuantFloat,"_initialBias",1<<_NeuQuantFloat._initialBiasShift),__publicField(NeuQuantFloat,"_gammaShift",10),__publicField(NeuQuantFloat,"_betaShift",10),__publicField(NeuQuantFloat,"_beta",_NeuQuantFloat._initialBias>>_NeuQuantFloat._betaShift),__publicField(NeuQuantFloat,"_betaGamma",_NeuQuantFloat._initialBias<<_NeuQuantFloat._gammaShift-_NeuQuantFloat._betaShift),__publicField(NeuQuantFloat,"_radiusBiasShift",6),__publicField(NeuQuantFloat,"_radiusBias",1<<_NeuQuantFloat._radiusBiasShift),__publicField(NeuQuantFloat,"_radiusDecrease",30),__publicField(NeuQuantFloat,"_alphaBiasShift",10),__publicField(NeuQuantFloat,"_initAlpha",1<<_NeuQuantFloat._alphaBiasShift),__publicField(NeuQuantFloat,"_radBiasShift",8),__publicField(NeuQuantFloat,"_radBias",1<<_NeuQuantFloat._radBiasShift),__publicField(NeuQuantFloat,"_alphaRadBiasShift",_NeuQuantFloat._alphaBiasShift+_NeuQuantFloat._radBiasShift),__publicField(NeuQuantFloat,"_alphaRadBias",1<<_NeuQuantFloat._alphaRadBiasShift);var _ColorHistogram=class{constructor(e,t){__publicField(this,"_method"),__publicField(this,"_hueStats"),__publicField(this,"_histogram"),__publicField(this,"_initColors"),__publicField(this,"_minHueCols"),this._method=e,this._minHueCols=t<<2,this._initColors=t<<2,this._hueStats=new HueStatistics(_ColorHistogram._hueGroups,this._minHueCols),this._histogram=Object.create(null)}sample(e){switch(this._method){case 1:this._colorStats1D(e);break;case 2:this._colorStats2D(e)}}getImportanceSortedColorsIDXI32(){const e=stableSort(Object.keys(this._histogram),(e,t)=>this._histogram[t]-this._histogram[e]);if(0===e.length)return[];let t;switch(this._method){case 1:const r=Math.min(e.length,this._initColors),n=e[r-1],i=this._histogram[n];t=e.slice(0,r);let a=r;const o=e.length;for(;a+e)}_colorStats1D(e){const t=this._histogram,r=e.getPointArray(),n=r.length;for(let e=0;e{let r=Math.round(e.w*e.h/o)*_ColorHistogram._boxPixels;r<2&&(r=2);const i={};this._iterateBox(e,t,e=>{const t=n[e].uint32;this._hueStats.check(t),t in u?u[t]++:t in i?++i[t]>=r&&(u[t]=i[t]):i[t]=1})}),this._hueStats.injectIntoDictionary(u)}_iterateBox(e,t,r){const n=e,i=n.y*t+n.x,a=(n.y+n.h-1)*t+(n.x+n.w-1),o=t-n.w+1;let s=0,u=i;do{r.call(this,u),u+=++s%n.w==0?o:1}while(u<=a)}_makeBoxes(e,t,r,n){const i=e%r,a=t%n,o=e-i,s=t-a,u=[];for(let l=0;lthis._colors;){a.length=0;for(let e=0;e3*this._colors?this._initialDistance:this._distanceIncrement}if(ot.distance-e.distance);let e=0;for(;o=0;e--)0===n[e]&&(e!==l-1&&(r[e]=r[l-1]),--l);r.length=l,t.sort(),yield{palette:t,progress:100}}};function createArray1D(e){const t=[];for(let r=0;r0){const r=this._sums[t],n=this._reds[t]/r,i=this._greens[t]/r,a=this._blues[t]/r,o=this._alphas[t]/r,s=Point.createByRGBA(0|n,0|i,0|a,0|o);e.add(s)}e.sort(),yield{palette:e,progress:100}}*_preparePalette(){yield*this._calculateMoments();let e=0;const t=createArray1D(this._colors);for(let r=1;r1?this._calculateVariance(this._cubes[e]):0,t[r]=this._cubes[r].volume>1?this._calculateVariance(this._cubes[r]):0):(t[e]=0,r--),e=0;let n=t[0];for(let i=1;i<=r;++i)t[i]>n&&(n=t[i],e=i);if(n<=0){this._colors=r+1;break}}const r=[],n=[],i=[],a=[];for(let e=0;e0?(r[e]=_WuQuant._volume(this._cubes[e],this._momentsRed)/t|0,n[e]=_WuQuant._volume(this._cubes[e],this._momentsGreen)/t|0,i[e]=_WuQuant._volume(this._cubes[e],this._momentsBlue)/t|0,a[e]=_WuQuant._volume(this._cubes[e],this._momentsAlpha)/t|0):(r[e]=0,n[e]=0,i[e]=0,a[e]=0)}this._reds=createArray1D(this._colors+1),this._greens=createArray1D(this._colors+1),this._blues=createArray1D(this._colors+1),this._alphas=createArray1D(this._colors+1),this._sums=createArray1D(this._colors+1);for(let e=0,t=this._pixels.length;e>t),n=1+(e.g>>t),i=1+(e.b>>t),a=1+(e.a>>t);this._weights[a][r][n][i]++,this._momentsRed[a][r][n][i]+=e.r,this._momentsGreen[a][r][n][i]+=e.g,this._momentsBlue[a][r][n][i]+=e.b,this._momentsAlpha[a][r][n][i]+=e.a,this._moments[a][r][n][i]+=this._table[e.r]+this._table[e.g]+this._table[e.b]+this._table[e.a]}*_calculateMoments(){const e=[],t=[],r=[],n=[],i=[],a=[],o=createArray3D(this._sideSize,this._sideSize,this._sideSize),s=createArray3D(this._sideSize,this._sideSize,this._sideSize),u=createArray3D(this._sideSize,this._sideSize,this._sideSize),l=createArray3D(this._sideSize,this._sideSize,this._sideSize),c=createArray3D(this._sideSize,this._sideSize,this._sideSize),f=createArray3D(this._sideSize,this._sideSize,this._sideSize);let h=0;const d=new ProgressTracker(this._alphaMaxSideIndex*this._maxSideIndex,99);for(let p=1;p<=this._alphaMaxSideIndex;++p){fillArray3D(o,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D(s,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D(u,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D(l,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D(c,this._sideSize,this._sideSize,this._sideSize,0),fillArray3D(f,this._sideSize,this._sideSize,this._sideSize,0);for(let m=1;m<=this._maxSideIndex;++m,++h){d.shouldNotify(h)&&(yield{progress:d.progress}),fillArray1D(e,this._sideSize,0),fillArray1D(t,this._sideSize,0),fillArray1D(r,this._sideSize,0),fillArray1D(n,this._sideSize,0),fillArray1D(i,this._sideSize,0),fillArray1D(a,this._sideSize,0);for(let h=1;h<=this._maxSideIndex;++h){let d=0,g=0,b=0,y=0,_=0,v=0;for(let w=1;w<=this._maxSideIndex;++w)d+=this._weights[p][m][h][w],g+=this._momentsRed[p][m][h][w],b+=this._momentsGreen[p][m][h][w],y+=this._momentsBlue[p][m][h][w],_+=this._momentsAlpha[p][m][h][w],v+=this._moments[p][m][h][w],e[w]+=d,t[w]+=g,r[w]+=b,n[w]+=y,i[w]+=_,a[w]+=v,o[m][h][w]=o[m-1][h][w]+e[w],s[m][h][w]=s[m-1][h][w]+t[w],u[m][h][w]=u[m-1][h][w]+r[w],l[m][h][w]=l[m-1][h][w]+n[w],c[m][h][w]=c[m-1][h][w]+i[w],f[m][h][w]=f[m-1][h][w]+a[w],this._weights[p][m][h][w]=this._weights[p-1][m][h][w]+o[m][h][w],this._momentsRed[p][m][h][w]=this._momentsRed[p-1][m][h][w]+s[m][h][w],this._momentsGreen[p][m][h][w]=this._momentsGreen[p-1][m][h][w]+u[m][h][w],this._momentsBlue[p][m][h][w]=this._momentsBlue[p-1][m][h][w]+l[m][h][w],this._momentsAlpha[p][m][h][w]=this._momentsAlpha[p-1][m][h][w]+c[m][h][w],this._moments[p][m][h][w]=this._moments[p-1][m][h][w]+f[m][h][w]}}}}static _volumeFloat(e,t){return t[e.alphaMaximum][e.redMaximum][e.greenMaximum][e.blueMaximum]-t[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMaximum]-t[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMaximum]+t[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]-t[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMaximum]+t[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]+t[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-t[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(t[e.alphaMaximum][e.redMaximum][e.greenMaximum][e.blueMinimum]-t[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]-t[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+t[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]-t[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]+t[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]+t[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]-t[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum])}static _volume(e,t){return 0|_WuQuant._volumeFloat(e,t)}static _top(e,t,r,n){let i;switch(t){case _WuQuant._alpha:i=n[r][e.redMaximum][e.greenMaximum][e.blueMaximum]-n[r][e.redMaximum][e.greenMinimum][e.blueMaximum]-n[r][e.redMinimum][e.greenMaximum][e.blueMaximum]+n[r][e.redMinimum][e.greenMinimum][e.blueMaximum]-(n[r][e.redMaximum][e.greenMaximum][e.blueMinimum]-n[r][e.redMaximum][e.greenMinimum][e.blueMinimum]-n[r][e.redMinimum][e.greenMaximum][e.blueMinimum]+n[r][e.redMinimum][e.greenMinimum][e.blueMinimum]);break;case _WuQuant._red:i=n[e.alphaMaximum][r][e.greenMaximum][e.blueMaximum]-n[e.alphaMaximum][r][e.greenMinimum][e.blueMaximum]-n[e.alphaMinimum][r][e.greenMaximum][e.blueMaximum]+n[e.alphaMinimum][r][e.greenMinimum][e.blueMaximum]-(n[e.alphaMaximum][r][e.greenMaximum][e.blueMinimum]-n[e.alphaMaximum][r][e.greenMinimum][e.blueMinimum]-n[e.alphaMinimum][r][e.greenMaximum][e.blueMinimum]+n[e.alphaMinimum][r][e.greenMinimum][e.blueMinimum]);break;case _WuQuant._green:i=n[e.alphaMaximum][e.redMaximum][r][e.blueMaximum]-n[e.alphaMaximum][e.redMinimum][r][e.blueMaximum]-n[e.alphaMinimum][e.redMaximum][r][e.blueMaximum]+n[e.alphaMinimum][e.redMinimum][r][e.blueMaximum]-(n[e.alphaMaximum][e.redMaximum][r][e.blueMinimum]-n[e.alphaMaximum][e.redMinimum][r][e.blueMinimum]-n[e.alphaMinimum][e.redMaximum][r][e.blueMinimum]+n[e.alphaMinimum][e.redMinimum][r][e.blueMinimum]);break;case _WuQuant._blue:i=n[e.alphaMaximum][e.redMaximum][e.greenMaximum][r]-n[e.alphaMaximum][e.redMaximum][e.greenMinimum][r]-n[e.alphaMaximum][e.redMinimum][e.greenMaximum][r]+n[e.alphaMaximum][e.redMinimum][e.greenMinimum][r]-(n[e.alphaMinimum][e.redMaximum][e.greenMaximum][r]-n[e.alphaMinimum][e.redMaximum][e.greenMinimum][r]-n[e.alphaMinimum][e.redMinimum][e.greenMaximum][r]+n[e.alphaMinimum][e.redMinimum][e.greenMinimum][r]);break;default:throw new Error("impossible")}return 0|i}static _bottom(e,t,r){switch(t){case _WuQuant._alpha:return-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMaximum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case _WuQuant._red:return-r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMaximum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case _WuQuant._green:return-r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMaximum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case _WuQuant._blue:return-r[e.alphaMaximum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]-(-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);default:return 0}}_calculateVariance(e){const t=_WuQuant._volume(e,this._momentsRed),r=_WuQuant._volume(e,this._momentsGreen),n=_WuQuant._volume(e,this._momentsBlue),i=_WuQuant._volume(e,this._momentsAlpha);return _WuQuant._volumeFloat(e,this._moments)-(t*t+r*r+n*n+i*i)/_WuQuant._volume(e,this._weights)}_maximize(e,t,r,n,i,a,o,s,u){const l=0|_WuQuant._bottom(e,t,this._momentsRed),c=0|_WuQuant._bottom(e,t,this._momentsGreen),f=0|_WuQuant._bottom(e,t,this._momentsBlue),h=0|_WuQuant._bottom(e,t,this._momentsAlpha),d=0|_WuQuant._bottom(e,t,this._weights);let p=0,m=-1;for(let g=r;gp&&(p=t,m=g))}}return{max:p,position:m}}_cut(e,t){let r;const n=_WuQuant._volume(e,this._momentsRed),i=_WuQuant._volume(e,this._momentsGreen),a=_WuQuant._volume(e,this._momentsBlue),o=_WuQuant._volume(e,this._momentsAlpha),s=_WuQuant._volume(e,this._weights),u=this._maximize(e,_WuQuant._red,e.redMinimum+1,e.redMaximum,n,i,a,o,s),l=this._maximize(e,_WuQuant._green,e.greenMinimum+1,e.greenMaximum,n,i,a,o,s),c=this._maximize(e,_WuQuant._blue,e.blueMinimum+1,e.blueMaximum,n,i,a,o,s),f=this._maximize(e,_WuQuant._alpha,e.alphaMinimum+1,e.alphaMaximum,n,i,a,o,s);if(f.max>=u.max&&f.max>=l.max&&f.max>=c.max){if(r=_WuQuant._alpha,f.position<0)return!1}else r=u.max>=f.max&&u.max>=l.max&&u.max>=c.max?_WuQuant._red:l.max>=f.max&&l.max>=u.max&&l.max>=c.max?_WuQuant._green:_WuQuant._blue;switch(t.redMaximum=e.redMaximum,t.greenMaximum=e.greenMaximum,t.blueMaximum=e.blueMaximum,t.alphaMaximum=e.alphaMaximum,r){case _WuQuant._red:t.redMinimum=e.redMaximum=u.position,t.greenMinimum=e.greenMinimum,t.blueMinimum=e.blueMinimum,t.alphaMinimum=e.alphaMinimum;break;case _WuQuant._green:t.greenMinimum=e.greenMaximum=l.position,t.redMinimum=e.redMinimum,t.blueMinimum=e.blueMinimum,t.alphaMinimum=e.alphaMinimum;break;case _WuQuant._blue:t.blueMinimum=e.blueMaximum=c.position,t.redMinimum=e.redMinimum,t.greenMinimum=e.greenMinimum,t.alphaMinimum=e.alphaMinimum;break;case _WuQuant._alpha:t.alphaMinimum=e.alphaMaximum=f.position,t.blueMinimum=e.blueMinimum,t.redMinimum=e.redMinimum,t.greenMinimum=e.greenMinimum}return e.volume=(e.redMaximum-e.redMinimum)*(e.greenMaximum-e.greenMinimum)*(e.blueMaximum-e.blueMinimum)*(e.alphaMaximum-e.alphaMinimum),t.volume=(t.redMaximum-t.redMinimum)*(t.greenMaximum-t.greenMinimum)*(t.blueMaximum-t.blueMinimum)*(t.alphaMaximum-t.alphaMinimum),!0}_initialize(e){this._colors=e,this._cubes=[];for(let t=0;tAbstractImageQuantizer,ErrorDiffusionArray:()=>ErrorDiffusionArray,ErrorDiffusionArrayKernel:()=>ErrorDiffusionArrayKernel,ErrorDiffusionRiemersma:()=>ErrorDiffusionRiemersma,NearestColor:()=>NearestColor});var AbstractImageQuantizer=class{quantizeSync(e,t){for(const r of this.quantize(e,t))if(r.pointContainer)return r.pointContainer;throw new Error("unreachable")}},NearestColor=class extends AbstractImageQuantizer{constructor(e){super(),__publicField(this,"_distance"),this._distance=e}*quantize(e,t){const r=e.getPointArray(),n=e.getWidth(),i=e.getHeight(),a=new ProgressTracker(i,99);for(let e=0;e(e[e.FloydSteinberg=0]="FloydSteinberg",e[e.FalseFloydSteinberg=1]="FalseFloydSteinberg",e[e.Stucki=2]="Stucki",e[e.Atkinson=3]="Atkinson",e[e.Jarvis=4]="Jarvis",e[e.Burkes=5]="Burkes",e[e.Sierra=6]="Sierra",e[e.TwoSierra=7]="TwoSierra",e[e.SierraLite=8]="SierraLite",e))(ErrorDiffusionArrayKernel||{}),ErrorDiffusionArray=class extends AbstractImageQuantizer{constructor(e,t,r=!0,n=0,i=!1){super(),__publicField(this,"_minColorDistance"),__publicField(this,"_serpentine"),__publicField(this,"_kernel"),__publicField(this,"_calculateErrorLikeGIMP"),__publicField(this,"_distance"),this._setKernel(t),this._distance=e,this._minColorDistance=n,this._serpentine=r,this._calculateErrorLikeGIMP=i}*quantize(e,t){const r=e.getPointArray(),n=new Point,i=e.getWidth(),a=e.getHeight(),o=[];let s=1,u=1;for(const e of this._kernel){const t=e[2]+1;u=0&&r+l=0&&n+et&&(e.length=t);const r=e.length;for(let t=0;t=0&&e.x=0&&e.y{const s=r[e+i*n];let{r:u,g:l,b:c,a:f}=s;for(let e=0;essim});var K1=.01,K2=.03;function ssim(e,t){if(e.getHeight()!==t.getHeight()||e.getWidth()!==t.getWidth())throw new Error("Images have different sizes!");const r=(255*K1)**2,n=(255*K2)**2;let i=0,a=0;return iterate(e,t,(e,t,o,s)=>{let u=0,l=0,c=0;for(let r=0;ri.sample(e)),i.quantizeSync()}function applyPaletteSync(e,t,{colorDistanceFormula:r,imageQuantization:n}={}){return imageQuantizationToImageQuantizer(colorDistanceFormulaToColorDistance(r),n).quantizeSync(e,t)}function colorDistanceFormulaToColorDistance(e="euclidean-bt709"){switch(e){case"cie94-graphic-arts":return new CIE94GraphicArts;case"cie94-textiles":return new CIE94Textiles;case"ciede2000":return new CIEDE2000;case"color-metric":return new CMetric;case"euclidean":return new Euclidean;case"euclidean-bt709":return new EuclideanBT709;case"euclidean-bt709-noalpha":return new EuclideanBT709NoAlpha;case"manhattan":return new Manhattan;case"manhattan-bt709":return new ManhattanBT709;case"manhattan-nommyde":return new ManhattanNommyde;case"pngquant":return new PNGQuant;default:throw new Error(`Unknown colorDistanceFormula ${e}`)}}function imageQuantizationToImageQuantizer(e,t="floyd-steinberg"){switch(t){case"nearest":return new NearestColor(e);case"riemersma":return new ErrorDiffusionRiemersma(e);case"floyd-steinberg":return new ErrorDiffusionArray(e,0);case"false-floyd-steinberg":return new ErrorDiffusionArray(e,1);case"stucki":return new ErrorDiffusionArray(e,2);case"atkinson":return new ErrorDiffusionArray(e,3);case"jarvis":return new ErrorDiffusionArray(e,4);case"burkes":return new ErrorDiffusionArray(e,5);case"sierra":return new ErrorDiffusionArray(e,6);case"two-sierra":return new ErrorDiffusionArray(e,7);case"sierra-lite":return new ErrorDiffusionArray(e,8);default:throw new Error(`Unknown imageQuantization ${t}`)}}function paletteQuantizationToPaletteQuantizer(e,t="wuquant",r=256){switch(t){case"neuquant":return new NeuQuant(e,r);case"rgbquant":return new RGBQuant(e,r);case"wuquant":return new WuQuant(e,r);case"neuquant-float":return new NeuQuantFloat(e,r);default:throw new Error(`Unknown paletteQuantization ${t}`)}}"function"==typeof setImmediate?setImmediate:void 0!==process&&(null==process||process.nextTick);const QuantizeOptionsSchema=z.object({colors:z.number().optional(),colorDistanceFormula:z.union([z.literal("cie94-textiles"),z.literal("cie94-graphic-arts"),z.literal("ciede2000"),z.literal("color-metric"),z.literal("euclidean"),z.literal("euclidean-bt709-noalpha"),z.literal("euclidean-bt709"),z.literal("manhattan"),z.literal("manhattan-bt709"),z.literal("manhattan-nommyde"),z.literal("pngquant")]).optional(),paletteQuantization:z.union([z.literal("neuquant"),z.literal("neuquant-float"),z.literal("rgbquant"),z.literal("wuquant")]).optional(),imageQuantization:z.union([z.literal("nearest"),z.literal("riemersma"),z.literal("floyd-steinberg"),z.literal("false-floyd-steinberg"),z.literal("stucki"),z.literal("atkinson"),z.literal("jarvis"),z.literal("burkes"),z.literal("sierra"),z.literal("two-sierra"),z.literal("sierra-lite")]).optional()}),methods={quantize(e,t){const{colors:r,colorDistanceFormula:n,paletteQuantization:i,imageQuantization:a}=QuantizeOptionsSchema.parse(t),o=utils_exports.PointContainer.fromUint8Array(e.bitmap.data,e.bitmap.width,e.bitmap.height),s=applyPaletteSync(o,buildPaletteSync([o],{colors:r,colorDistanceFormula:n,paletteQuantization:i}),{colorDistanceFormula:n,imageQuantization:a});return e.bitmap.data=Buffer.from(s.toUint8Array()),e}};var parseBmfontAscii=function(e){if(!e)throw new Error("no data provided");var t={pages:[],chars:[],kernings:[]},r=(e=e.toString().trim()).split(/\r\n?|\n/g);if(0===r.length)throw new Error("no data in BMFont file");for(var n=0;n element");for(var i=n.getElementsByTagName("page"),a=0;a3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var n={kernings:[],chars:[]},i=0;i<5;i++)r+=readBlock(n,e,r);return n};function readBlock(e,t,r){if(r>t.length-1)return 0;var n=t.readUInt8(r++),i=t.readInt32LE(r);switch(r+=4,n){case 1:e.info=readInfo(t,r);break;case 2:e.common=readCommon(t,r);break;case 3:e.pages=readPages(t,r,i);break;case 4:e.chars=readChars(t,r,i);break;case 5:e.kernings=readKernings(t,r,i)}return 5+i}function readInfo(e,t){var r={};r.size=e.readInt16LE(t);var n=e.readUInt8(t+2);return r.smooth=n>>7&1,r.unicode=n>>6&1,r.italic=n>>5&1,r.bold=n>>4&1,n>>3&1&&(r.fixedHeight=1),r.charset=e.readUInt8(t+3)||"",r.stretchH=e.readUInt16LE(t+4),r.aa=e.readUInt8(t+6),r.padding=[e.readInt8(t+7),e.readInt8(t+8),e.readInt8(t+9),e.readInt8(t+10)],r.spacing=[e.readInt8(t+11),e.readInt8(t+12)],r.outline=e.readUInt8(t+13),r.face=readStringNT(e,t+14),r}function readCommon(e,t){var r={};return r.lineHeight=e.readUInt16LE(t),r.base=e.readUInt16LE(t+2),r.scaleW=e.readUInt16LE(t+4),r.scaleH=e.readUInt16LE(t+6),r.pages=e.readUInt16LE(t+8),e.readUInt8(t+10),r.packed=0,r.alphaChnl=e.readUInt8(t+11),r.redChnl=e.readUInt8(t+12),r.greenChnl=e.readUInt8(t+13),r.blueChnl=e.readUInt8(t+14),r}function readPages(e,t,r){for(var n=[],i=readNameNT(e,t),a=i.length+1,o=r/a,s=0;s=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,splitPath=function(e){return splitPathRe.exec(e).slice(1)};function resolve(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=normalizeArray(filter(e.split("/"),function(e){return!!e}),!t).join("/"))||"."}function normalize(e){var t=isAbsolute(e),r="/"===substr(e,-1);return(e=normalizeArray(filter(e.split("/"),function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function isAbsolute(e){return"/"===e.charAt(0)}function join(){return normalize(filter(Array.prototype.slice.call(arguments,0),function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))}function relative(e,t){function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=resolve(e).substr(1),t=resolve(t).substr(1);for(var n=r(e.split("/")),i=r(t.split("/")),a=Math.min(n.length,i.length),o=a,s=0;s{if(!e)return null;const n={};switch(e.type){case"ELEMENT":{let i={};const a=E(e.value.attributes),o=t(e.value.children);if(a&&(i=Object.assign(i,a)),o){const t=r(e.value.children);i=Object.assign(i,t)}n[e.value.type]=i;break}case"ATTRIBUTE":{const t=e.value;n[t.name]=t.value;break}case"CONTENT":return{content:e.value}}return n},r=e=>e&&Array.isArray(e)&&0!==e.length?n(e)?{content:e[0].value}:{children:e.map(t)}:null,n=e=>e&&Array.isArray(e)&&1===e.length&&"CONTENT"===e[0].type,E=e=>e&&Array.isArray(e)?e.map(t).reduce((e,t)=>Object.assign(e,t),{}):null;var s={convert:e=>t(e.value.children[0])},a={Token:(e,t)=>({type:e,value:t}),TOKEN_TYPE:{OPEN_BRACKET:"OPEN_BRACKET",ELEMENT_TYPE:"ELEMENT_TYPE",CLOSE_ELEMENT:"CLOSE_ELEMENT",ATTRIB_NAME:"ATTRIB_NAME",ATTRIB_VALUE:"ATTRIB_VALUE",ASSIGN:"ASSIGN",CLOSE_BRACKET:"CLOSE_BRACKET",CONTENT:"CONTENT",EOF:"EOF"}};const{Token:T,TOKEN_TYPE:u}=a,c=T("EOF"),l=e=>" "===e||"\n"===e||"\r"===e||"\t"===e,o=e=>e.replace(/'/g,'"');var N={createLexer:function(e){let t=null,r=(e=>{let t=0;for(;t{if(e.startsWith(""===e[t+1])return t+2;t++}}return t})(e,t)})(e),n=[];const i=()=>e[r],a=()=>t!==c&&r'"'===e||"'"===e,f=()=>{for(;a()&&l(e[r]);)r++},h=t=>{if(a()){if("<"===e[r]){let t="<";return r++,a()&&"/"===e[r]?(r++,t=""===i()&&(r++,e="/>"),e}if("="===e[r]||">"===e[r]){const t=e[r];return r++,t}}return d(!!t)},d=t=>{const n=t?/[^>=<]/u:/[a-zA-Z0-9_:-]/;let i=r;for(;a()&&e[r].match(n);)r++;return o(e.substring(i,r))},p=()=>{const l=r;f();const m=r-l;if(a())if(t&&t.type===u.OPEN_BRACKET){f();const e=h(!1);t=T(u.ELEMENT_TYPE,e),n.push(e)}else if(t&&t.type===u.ASSIGN){a()&&s(i())&&r++;let n=r;for(;a()&&!s(i());)r++;const l=o(e.substring(n,r));r++,t=T(u.ATTRIB_VALUE,l)}else{f();let o=h(!0);switch(o){case"=":t=t.type===u.ATTRIB_NAME?T(u.ASSIGN):T(u.CONTENT,o);break;case""!==e[r];)r++;t=T(u.CLOSE_ELEMENT,e.substring(i,r)),r++,n.pop();break}case"/>":{const e=n.pop();t=T(u.CLOSE_ELEMENT,e);break}case"\x3c!--":{const t=["!","-","-"];for(;a()&&(">"!==t[2]||"-"!==t[1]||"-"!==t[0]);)t.shift(),t.push(e[r]),r++;return p()}case">":t=T(u.CLOSE_BRACKET);break;case"<":t=T(u.OPEN_BRACKET);break;default:if(o&&o.length>0){if(t.type===u.CLOSE_BRACKET){let e="";"<"!==i()&&(e=d(!0)),t=T(u.CONTENT,o+e)}else if(t.type!==u.ATTRIB_NAME&&t.type!==u.CONTENT)t.type===u.CLOSE_ELEMENT?(o=" ".repeat(m)+o,t=T(u.CONTENT,o)):t=T(u.ATTRIB_NAME,o);else{const e=" ".repeat(m)+o;t=T(u.CONTENT,e)}break}{const t='Unknown Syntax : "'+e[r]+'"';throw new Error(t)}}}else t=c;return t};return{peek:i,next:p,hasNext:a}}};const{createLexer:i}=N,{Token:p,TOKEN_TYPE:O}=a,[A,f,C,h]=["ROOT","ELEMENT","ATTRIBUTE","CONTENT"],_=(e,t)=>({type:e,value:t}),L=e=>_(h,e),y=(e,t,r)=>_(f,{type:e,attributes:t,children:r}),v=(e,t)=>_(C,{name:e,value:t}),S=(e,t)=>{const r=[];for(;e.hasNext();){const n=e.next();switch(n.type){case O.OPEN_BRACKET:{const t=e.next(),[n,i]=R(e);let a=[];i.type!==O.CLOSE_ELEMENT&&(a=S(e,t)),a&&a.length>0&&a[0].type===O.CONTENT&&(a=b(a)),r.push(y(t.value,n,a));break}case O.CLOSE_ELEMENT:if(n.value===t.value)return r;break;case O.CONTENT:r.push(L(n.value));break;case O.EOF:return r;default:throw new Error(`Unknown Lexem type: ${n.type} "${n.value}, scoping element: ${t.value}"`)}}return r},R=e=>{const t=[];let r=e.peek();if(!e.hasNext()||r&&r.type===O.CLOSE_BRACKET||r&&r.type===O.CLOSE_ELEMENT)return[t,r];for(r=e.next();e.hasNext()&&r&&r.type!==O.CLOSE_BRACKET&&r.type!==O.CLOSE_ELEMENT;){const n=r;e.next();const i=e.next(),a=v(n.value,i.value);t.push(a),r=e.next()}return[t,r]};function b(e){let t=[],r="";return e.forEach(e=>{e.type===O.CONTENT?r+=e.value:(r.length&&(t.push(L(r)),r=""),t.push(e))}),r.length&&t.push(L(r)),t}var B={transpile:function(e,t){const r=(e=>_(A,{children:S(e,p(A,"ROOT"))}))(i(e));return t?t.convert(r):r},Node:_,ElementNode:y,AttribNode:v};const M=s,{transpile:x}=B;var k=e({convertXML:function(e,t){return x(e,t||M)},createAST:function(e){return x(e)}}),simpleXmlToJson_min=k,xmlPackage=getDefaultExportFromCjs(simpleXmlToJson_min);const{convertXML}=xmlPackage,isWebWorker="undefined"!=typeof self&&void 0===self.document,CharacterJimp=createJimp({formats:[png]}),HEADER=Buffer.from([66,77,70,3]);function isBinary(e){if("string"==typeof e)return"BMF"===e.substring(0,3);const t=e.slice(0,4);return e.length>4&&t[0]===HEADER[0]&&t[1]===HEADER[1]&&t[2]===HEADER[2]}function parseFont(e,t){return isBinary(t)?("string"==typeof t&&(t=Buffer.from(t,"binary")),readBinary(t)):(t=t.toString().trim(),/.json$/.test(e)||"{"===t.charAt(0)?JSON.parse(t):/.xml$/.test(e)||"<"===t.charAt(0)?parseXML(t):parseASCII(t))}function parseNumbersInObject(e){for(const t in e){try{e[t]=parseInt(e[t],10)}catch{}"object"==typeof e[t]&&parseNumbersInObject(e[t])}return e}async function loadBitmapFontData(e){if(isWebWorker&&"string"==typeof e){const t=await fetch(e),r=await t.text(),n=convertXML(r).font.children.reduce((e,t)=>({...e,...t}),{}),i=[],a=[],o=[];for(let e=0;eCharacterJimp.read(path.join(path.dirname(e),t))))}}async function loadFont(e){let t=e;if("undefined"==typeof window&&!isWebWorker){const{existsSync:r,promises:n}=await Promise.resolve().then(function(){return _polyfillNode_fs$1});r(e)&&(t=await n.readFile(e))}return processBitmapFont(e,await loadBitmapFontData(t))}var pixelmatch_1=pixelmatch;const defaultOptions={threshold:.1,includeAA:!1,alpha:.1,aaColor:[255,255,0],diffColor:[255,0,0],diffColorAlt:null,diffMask:!1};function pixelmatch(e,t,r,n,i,a){if(!isPixelData(e)||!isPixelData(t)||r&&!isPixelData(r))throw new Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");if(e.length!==t.length||r&&r.length!==e.length)throw new Error("Image sizes do not match.");if(e.length!==n*i*4)throw new Error("Image data size does not match width/height.");a=Object.assign({},defaultOptions,a);const o=n*i,s=new Uint32Array(e.buffer,e.byteOffset,o),u=new Uint32Array(t.buffer,t.byteOffset,o);let l=!0;for(let e=0;ec?a.includeAA||!antialiased(e,s,o,n,i,t)&&!antialiased(t,s,o,n,i,e)?(r&&drawPixel(r,u,...l<0&&a.diffColorAlt||a.diffColor),f++):r&&!a.diffMask&&drawPixel(r,u,...a.aaColor):r&&(a.diffMask||drawGrayPixel(e,u,a.alpha,r))}return f}function isPixelData(e){return ArrayBuffer.isView(e)&&1===e.constructor.BYTES_PER_ELEMENT}function antialiased(e,t,r,n,i,a){const o=Math.max(t-1,0),s=Math.max(r-1,0),u=Math.min(t+1,n-1),l=Math.min(r+1,i-1),c=4*(r*n+t);let f,h,d,p,m=t===o||t===u||r===s||r===l?1:0,g=0,b=0;for(let i=o;i<=u;i++)for(let a=s;a<=l;a++){if(i===t&&a===r)continue;const o=colorDelta(e,e,c,4*(a*n+i),!0);if(0===o){if(m++,m>2)return!1}else ob&&(b=o,d=i,p=a)}return 0!==g&&0!==b&&(hasManySiblings(e,f,h,n,i)&&hasManySiblings(a,f,h,n,i)||hasManySiblings(e,d,p,n,i)&&hasManySiblings(a,d,p,n,i))}function hasManySiblings(e,t,r,n,i){const a=Math.max(t-1,0),o=Math.max(r-1,0),s=Math.min(t+1,n-1),u=Math.min(r+1,i-1),l=4*(r*n+t);let c=t===a||t===s||r===o||r===u?1:0;for(let i=a;i<=s;i++)for(let a=o;a<=u;a++){if(i===t&&a===r)continue;const o=4*(a*n+i);if(e[l]===e[o]&&e[l+1]===e[o+1]&&e[l+2]===e[o+2]&&e[l+3]===e[o+3]&&c++,c>2)return!0}return!1}function colorDelta(e,t,r,n,i){let a=e[r+0],o=e[r+1],s=e[r+2],u=e[r+3],l=t[n+0],c=t[n+1],f=t[n+2],h=t[n+3];if(u===h&&a===l&&o===c&&s===f)return 0;u<255&&(u/=255,a=blend(a,u),o=blend(o,u),s=blend(s,u)),h<255&&(h/=255,l=blend(l,h),c=blend(c,h),f=blend(f,h));const d=rgb2y(a,o,s),p=rgb2y(l,c,f),m=d-p;if(i)return m;const g=rgb2i(a,o,s)-rgb2i(l,c,f),b=rgb2q(a,o,s)-rgb2q(l,c,f),y=.5053*m*m+.299*g*g+.1957*b*b;return d>p?-y:y}function rgb2y(e,t,r){return.29889531*e+.58662247*t+.11448223*r}function rgb2i(e,t,r){return.59597799*e-.2741761*t-.32180189*r}function rgb2q(e,t,r){return.21147017*e-.52261711*t+.31114694*r}function blend(e,t){return 255+(e-255)*t}function drawPixel(e,t,r,n,i){e[t+0]=r,e[t+1]=n,e[t+2]=i,e[t+3]=255}function drawGrayPixel(e,t,r,n){const i=blend(rgb2y(e[t+0],e[t+1],e[t+2]),r*e[t+3]/255);drawPixel(n,t,i,i,i)}var pixelMatch=getDefaultExportFromCjs(pixelmatch_1);function diff(e,t,r=.1){let n=e.bitmap,i=t.bitmap;if(n.width===i.width&&n.height===i.height||(n.width*n.height>i.width*i.height?n=methods$d.resize(clone(e),{w:i.width,h:i.height}).bitmap:i=methods$d.resize(clone(t),{w:n.width,h:n.height}).bitmap),"number"!=typeof r||r<0||r>1)throw new Error("threshold must be a number between 0 and 1");const a=new e.constructor({width:n.width,height:n.height,color:4294967295});return{percent:pixelMatch(n.data,i.data,a.bitmap.data,a.bitmap.width,a.bitmap.height,{threshold:r})/(a.bitmap.width*a.bitmap.height),image:a}}const defaultPlugins=[methods$h,methods$g,methods$f,methods$e,methods$c,methods$a,methods$b,methods$9,methods$8,methods$7,methods$6,methods$5,methods$4,methods$3,methods$d,methods$2,methods$1,methods],defaultFormats=[bmp,msBmp,gif,jpeg$2,png,tiff],JimpMime={bmp:bmp().mime,gif:gif().mime,jpeg:jpeg$2().mime,png:png().mime,tiff:tiff().mime},Jimp=createJimp({formats:defaultFormats,plugins:defaultPlugins})}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);__webpack_require__.r(r);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach(t=>n[t]=()=>e[t]);return n.default=()=>e,__webpack_require__.d(r,n),r},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.p="";var __webpack_exports__={};(()=>{"use strict";function e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,u,"next",t)}function u(t){e(o,i,a,s,u,"throw",t)}s(void 0)})}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}function a(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if("string"==typeof e&&(e=O.strToArrayBuffer(e)),e instanceof ArrayBuffer&&(e=new Uint8Array(e)),64!==(t=O.expandAlphRange(t).join("")).length&&65!==t.length)throw new k(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,n,i,a,o,s,u,l="",c=0;c>2,o=(3&r)<<4|(n=e[c++])>>4,s=(15&n)<<2|(i=e[c++])>>6,u=63&i,isNaN(n)?s=u=64:isNaN(i)&&(u=64),l+=t.charAt(a)+t.charAt(o)+t.charAt(s)+t.charAt(u);return l}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=O.expandAlphRange(t).join("")).length&&65!==t.length)throw new k(`Error: Base64 alphabet should be 64 characters long, or 65 with a padding character. Found ${t.length}: ${t}`);if(n){var a=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(a,"")}if(i){if(e.length%4==1)throw new k(`Error: Invalid Base64 input length (${e.length}). Cannot be 4n+1, even without padding chars.`);if(65===t.length){var o=t.charAt(64),s=e.indexOf(o);if(s>=0){if(s>2,c=(3&d)<<6|p,(u=f<<2|h>>4)>=0&&u<256&&m.push(u),l>=0&&l<256&&64!==d&&m.push(l),c>=0&&c<256&&64!==p&&m.push(c)}return"string"===r?O.byteArrayToUtf8(m):m}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(r<1||Math.round(r)!==r)throw new k("Byte length must be a positive integer");if("None"!==t){var n="Auto"===t?/[^a-f\d]|0x/gi:O.regexRep(t);e=e.split(n)}else e=[e];for(var i=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:"Auto";t=O.charRep(t);var r=[],n=e.split(t);""===n[n.length-1]&&(n=n.slice(0,n.length-1));for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(r<1||Math.round(r)!==r)throw new k("Byte length must be a positive integer");var n=O.regexRep(t);e=e.replace(n,"");for(var i=[],a=0;a65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),m(e).forEach(function(e,t){n[t]=e}),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(t="string"==typeof t?e.ord(t):t).toString(16).padStart(r,"0")}},{key:"bin",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(t="string"==typeof t?e.ord(t):t).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.replace(/[^\x20-\x7e]/g,"."):(e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),t||(e=e.replace(/[\x09-\x10\u2028\u2029]/g,".")),e)}},{key:"escapeWhitespace",value:function(e){return e.replace(/[\x09-\x10]/g,function(e){return String.fromCharCode(57344+e.charCodeAt(0))})}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([abfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"a":return String.fromCharCode(7);case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}})}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(t){for(var r=[],n=0;n=0;i--)r=256*r+e[i];return r}},{key:"intToByteArray",value:function(e,t,r){var n=new Array(t);if("little"===r)for(var i=0;i>>=8;else for(var a=t-1;a>=0;a--)n[a]=255&e,e>>>=8;return n}},{key:"strToArrayBuffer",value:function(t){if(b().debug(`Converting string[${null==t?void 0:t.length}] to array buffer`),!t)return new ArrayBuffer;for(var r,n=new Uint8Array(t.length),i=t.length;i--;)if(r=t.charCodeAt(i),n[i]=r,r>255)return e.strToUtf8ArrayBuffer(t);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){if(b().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 array buffer`),!e)return new ArrayBuffer;var t=new TextEncoder("utf-8").encode(e);return e.length!==t.length&&(F()&&self&&"function"==typeof self.setOption?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),t.buffer}},{key:"strToByteArray",value:function(t){if(b().debug(`Converting string[${null==t?void 0:t.length}] to byte array`),!t)return[];for(var r,n=new Array(t.length),i=t.length;i--;)if(r=t.charCodeAt(i),n[i]=r,r>255)return e.strToUtf8ByteArray(t);return n}},{key:"strToUtf8ByteArray",value:function(t){if(b().debug(`Converting string[${null==t?void 0:t.length}] to UTF8 byte array`),!t)return[];var r=_().encode(t);return t.length!==r.length&&(F()?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),e.strToByteArray(r)}},{key:"strToCharcode",value:function(t){if(b().debug(`Converting string[${null==t?void 0:t.length}] to charcode`),!t)return[];for(var r=[],n=0;n=55296&&i<56320){var a=t[n+1].charCodeAt(0);a>=56320&&a<57344&&(i=e.ord(t[n]+t[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(t){var r;if(b().debug(`Converting byte array[${null===(r=t)||void 0===r?void 0:r.length}] to UTF8`),!t||!t.length)return"";t instanceof Uint8Array||(t=new Uint8Array(t));try{var n=new TextDecoder("utf-8",{fatal:!0}).decode(t);return n.length!==t.length&&(F()?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),n}catch(r){return e.byteArrayToChars(t)}}},{key:"byteArrayToChars",value:function(e){if(b().debug(`Converting byte array[${null==e?void 0:e.length}] to chars`),!e||!e.length)return"";for(var t="",r=0;r1&&void 0!==arguments[1])||arguments[1];if(b().debug(`Converting array buffer[${null==t?void 0:t.byteLength}] to str`),!t||!t.byteLength)return"";var n=new Uint8Array(t);return r?e.byteArrayToUtf8(n):e.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t0&&r.push(n[t]/e.length);var i,a=0;for(t=0;t1&&void 0!==arguments[1]?arguments[1]:[","],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],a=!1,o=!1,s="",u=[],l=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var c=0;c=0?(u.push(s),s=""):!o&&i.indexOf(t)>=0?(u.push(s),s="",l.push(u),u=[],i.indexOf(r)>=0&&r!==t&&c++):s+=t:o=!0;return u.length&&(u.push(s),l.push(u)),l}},{key:"stripHtmlTags",value:function(e){function t(e,r){var n=r.replace(e,"");return n.length===r.length?n:t(e,n)}return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=t(/]*>(\s|\S)*?<\/script[^>]*>/gi,e),e=t(/]*>(\s|\S)*?<\/style[^>]*>/gi,e)),t(/<[^>]+>/g,e)}},{key:"escapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\0":""};return e?e.replace(/[&<>"'`\u0000]/g,function(e){return t[e]}):e}},{key:"unescapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`","":"\0"};return e.replace(/(&#?x?[a-z0-9]{2,4};|\ue000)/gi,function(e){return t[e]||e})}},{key:"toTitleCase",value:function(e){return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,function(e){return t[e]||e})}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",i="",a="",o="";return e.forEach(function(e){n=e.op.replace(/ /g,"_"),i=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),a=e.disabled?"/disabled":"",o=e.breakpoint?"/breakpoint":"",r+=`${n}(${i}${a}${o})`,t&&(r+="\n")}),r}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,r;e=e.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,i=[];t=n.exec(e);){r="["+(r=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var a={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(a.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(a.breakpoint=!0),i.push(a)}return i}},{key:"displayFilesAsHTML",value:(n=t(h().mark(function r(n){var i,a,o,s,u,l;return h().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=function(t){return`
\n
\n
\n ${e.escapeHtml(t.name)}\n
\n
\n
`},a=function(t,r){if(r.startsWith("image")){var n="data:";return n+=r+";",""}return`
${e.escapeHtml(e.arrayBufferToStr(t.buffer))}
`},o=function(){var r=t(h().mark(function t(r,n){var i,o,s,u;return h().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.readFile(r);case 1:return i=t.sent,o=new Blob([i],{type:r.type||"octet/stream"}),s=URL.createObjectURL(o),u=`
\n
\n
\n \n \n ${r.size.toLocaleString()} bytes\n \n save\n \n \n open_in_browser\n \n \n
\n
\n
\n
\n ${a(i,r.type)}\n
\n
\n
`,t.abrupt("return",u);case 2:case"end":return t.stop()}},t)}));return function(e,t){return r.apply(this,arguments)}}(),s=`
\n ${n.length} file(s) found\n
`,u=0;case 1:if(!(u=e.size)t(i);else{var r=e.slice(a,a+o);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),a),a+=o,s()},n.onerror=function(e){r(n.error.message)},s()})}},{key:"readFileSync",value:function(e){if(!M())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(t,r){return r?e.gcd(r,t%r):t}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;re?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))});const L=function(e){function t(){var e,n,i,a;r(this,t);for(var o=arguments.length,l=new Array(o),c=0;c0||e===t?t:t-1}function Y(e){for(var t,r,n=1,i=e.length,a=e[0]+"";nl^r?1:-1;for(s=(u=i.length)<(l=a.length)?u:l,o=0;oa[o]^r?1:-1;return u==l?0:u>l^r?1:-1}function X(e,t,r,n){if(er||e!==U(e))throw Error($+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function J(e){var t=e.c.length-1;return V(e.e/G)==t&&e.c[t]%2!=0}function ee(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function te(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t_?h.c=h.e=null:e.e=10;u/=10,s++);return void(s>_?h.c=h.e=null:(h.e=s,h.c=[e]))}f=String(e)}else{if(!D.test(f=String(e)))return i(h,f,l);h.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(s<0&&(s=u),s+=+f.slice(u+1),f=f.substring(0,u)):s<0&&(s=f.length)}else{if(X(t,2,B.length,"Base"),10==t&&E)return P(h=new S(e),p+h.e+1,m);if(f=String(e),l="number"==typeof e){if(0*e!=0)return i(h,f,l,t);if(h.s=1/e<0?(f=f.slice(1),-1):1,S.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(j+e)}else h.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=B.slice(0,t),s=u=0,c=f.length;us){s=c;continue}}else if(!o&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){o=!0,u=-1,s=0;continue}return i(h,String(e),l,t)}l=!1,(s=(f=n(f,t,10,h.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(u=0;48===f.charCodeAt(u);u++);for(c=f.length;48===f.charCodeAt(--c););if(f=f.slice(u,++c)){if(c-=u,l&&S.DEBUG&&c>15&&(e>W||e!==U(e)))throw Error(j+h.s*e);if((s=s-u-1)>_)h.c=h.e=null;else if(s=b)?ee(u,o):te(u,o,"0");else if(a=(e=P(new S(e),t,r)).e,s=(u=Y(e.c)).length,1==n||2==n&&(t<=a||a<=g)){for(;so),u=te(u,a,"0"),a+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=a-s)>0)for(a+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function C(e,t){for(var r,n,i=1,a=new S(e[0]);i=10;i/=10,n++);return(r=n+r*G-1)>_?e.c=e.e=null:r=10;s/=10,i++);if((a=t-i)<0)a+=G,o=t,u=f[l=0],c=U(u/h[i-o-1]%10);else if((l=z((a+1)/G))>=f.length){if(!n)break e;for(;f.length<=l;f.push(0));u=c=0,i=1,o=(a%=G)-G+1}else{for(u=s=f[l],i=1;s>=10;s/=10,i++);c=(o=(a%=G)-G+i)<0?0:U(u/h[i-o-1]%10)}if(n=n||t<0||null!=f[l+1]||(o<0?u:u%h[i-o-1]),n=r<4?(c||n)&&(0==r||r==(e.s<0?3:2)):c>5||5==c&&(4==r||n||6==r&&(a>0?o>0?u/h[i-o]:0:f[l-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=h[(G-t%G)%G],e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=l,s=1,l--):(f.length=l+1,s=h[G-a],f[l]=o>0?U(u/h[i-o]%h[o])*s:0),n)for(;;){if(0==l){for(a=1,o=f[0];o>=10;o/=10,a++);for(o=f[0]+=s,s=1;o>=10;o/=10,s++);a!=s&&(e.e++,f[0]==Z&&(f[0]=1));break}if(f[l]+=s,f[l]!=Z)break;f[l--]=0,s=1}for(a=f.length;0===f[--a];f.pop());}e.e>_?e.c=e.e=null:e.e=b?ee(t,r):te(t,r,"0"),e.s<0?"-"+t:t)}return S.clone=e,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error($+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(X(r=e[t],0,Q,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(X(r=e[t],0,8,t),m=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(X(r[0],-Q,0,t),X(r[1],0,Q,t),g=r[0],b=r[1]):(X(r,-Q,Q,t),g=-(b=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)X(r[0],-Q,-1,t),X(r[1],1,Q,t),y=r[0],_=r[1];else{if(X(r,-Q,Q,t),!r)throw Error($+t+" cannot be zero: "+r);y=-(_=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error($+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw v=!r,Error($+"crypto unavailable");v=r}else v=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(X(r=e[t],0,9,t),w=r),e.hasOwnProperty(t="POW_PRECISION")&&(X(r=e[t],0,Q,t),x=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error($+t+" not an object: "+r);k=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error($+t+" invalid: "+r);E="0123456789"==r.slice(0,10),B=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:m,EXPONENTIAL_AT:[g,b],RANGE:[y,_],CRYPTO:v,MODULO_MODE:w,POW_PRECISION:x,FORMAT:k,ALPHABET:B}},S.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!S.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-Q&&i<=Q&&i===U(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%G)<1&&(t+=G),String(n[0]).length==t){for(t=0;t=Z||r!==U(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error($+"Invalid BigNumber: "+e)},S.maximum=S.max=function(){return C(arguments,-1)},S.minimum=S.min=function(){return C(arguments,1)},S.random=(a=9007199254740992,o=Math.random()*a&2097151?function(){return U(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,s=0,u=[],l=new S(d);if(null==e?e=p:X(e,0,Q),i=z(e/G),v)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(u.push(a%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw v=!1,Error($+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s=9e15?crypto.randomBytes(7).copy(t,s):(u.push(a%1e14),s+=7);s=i/7}if(!v)for(;s=10;a/=10,s++);sr-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,a,o,s){var u,l,c,f,h,d,g,b,y=n.indexOf("."),_=p,v=m;for(y>=0&&(f=x,x=0,n=n.replace(".",""),d=(b=new S(i)).pow(n.length-y),x=f,b.c=t(te(Y(d.c),d.e,"0"),10,a,e),b.e=b.c.length),c=f=(g=t(n,i,a,s?(u=B,e):(u=e,B))).length;0==g[--f];g.pop());if(!g[0])return u.charAt(0);if(y<0?--c:(d.c=g,d.e=c,d.s=o,g=(d=r(d,b,_,v,a)).c,h=d.r,c=d.e),y=g[l=c+_+1],f=a/2,h=h||l<0||null!=g[l+1],h=v<4?(null!=y||h)&&(0==v||v==(d.s<0?3:2)):y>f||y==f&&(4==v||h||6==v&&1&g[l-1]||v==(d.s<0?8:7)),l<1||!g[0])n=h?te(u.charAt(1),-_,u.charAt(0)):u.charAt(0);else{if(g.length=l,h)for(--a;++g[--l]>a;)g[l]=0,l||(++c,g=[1].concat(g));for(f=g.length;!g[--f];);for(y=0,n="";y<=f;n+=u.charAt(g[y++]));n=te(n,c,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,a,o,s=0,u=e.length,l=t%q,c=t/q|0;for(e=e.slice();u--;)s=((i=l*(a=e[u]%q)+(n=c*a+(o=e[u]/q|0)*l)%q*q+s)/r|0)+(n/q|0)+c*o,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,a,o,s){var u,l,c,f,h,d,p,m,g,b,y,_,v,w,x,k,B,E=n.s==i.s?1:-1,A=n.c,C=i.c;if(!(A&&A[0]&&C&&C[0]))return new S(n.s&&i.s&&(A?!C||A[0]!=C[0]:C)?A&&0==A[0]||!C?0*E:E/0:NaN);for(g=(m=new S(E)).c=[],E=a+(l=n.e-i.e)+1,s||(s=Z,l=V(n.e/G)-V(i.e/G),E=E/G|0),c=0;C[c]==(A[c]||0);c++);if(C[c]>(A[c]||0)&&l--,E<0)g.push(1),f=!0;else{for(w=A.length,k=C.length,c=0,E+=2,(h=U(s/(C[0]+1)))>1&&(C=e(C,h,s),A=e(A,h,s),k=C.length,w=A.length),v=k,y=(b=A.slice(0,k)).length;y=s/2&&x++;do{if(h=0,(u=t(C,b,k,y))<0){if(_=b[0],k!=y&&(_=_*s+(b[1]||0)),(h=U(_/x))>1)for(h>=s&&(h=s-1),p=(d=e(C,h,s)).length,y=b.length;1==t(d,b,p,y);)h--,r(d,k=10;E/=10,c++);P(m,a+(m.e=c+l*G-1)+1,o,f)}else m.e=l,m.r=+f;return m}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,l=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,a=r?t:t.replace(f,"");if(c.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(s,function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t}),n&&(i=n,a=a.replace(u,"$1").replace(l,"0.$1")),t!=a))return new S(a,i);if(S.DEBUG)throw Error($+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},h.absoluteValue=h.abs=function(){var e=new S(this);return e.s<0&&(e.s=1),e},h.comparedTo=function(e,t){return K(this,new S(e,t))},h.decimalPlaces=h.dp=function(e,t){var r,n,i,a=this;if(null!=e)return X(e,0,Q),null==t?t=m:X(t,0,8),P(new S(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-V(this.e/G))*G,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},h.dividedBy=h.div=function(e,t){return r(this,new S(e,t),p,m)},h.dividedToIntegerBy=h.idiv=function(e,t){return r(this,new S(e,t),0,1)},h.exponentiatedBy=h.pow=function(e,t){var r,n,i,a,o,s,u,l,c=this;if((e=new S(e)).c&&!e.isInteger())throw Error($+"Exponent not an integer: "+T(e));if(null!=t&&(t=new S(t)),o=e.e>14,!c.c||!c.c[0]||1==c.c[0]&&!c.e&&1==c.c.length||!e.c||!e.c[0])return l=new S(Math.pow(+T(c),o?e.s*(2-J(e)):+T(e))),t?l.mod(t):l;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new S(NaN);(n=!s&&c.isInteger()&&t.isInteger())&&(c=c.mod(t))}else{if(e.e>9&&(c.e>0||c.e<-1||(0==c.e?c.c[0]>1||o&&c.c[1]>=24e7:c.c[0]<8e13||o&&c.c[0]<=9999975e7)))return a=c.s<0&&J(e)?-0:0,c.e>-1&&(a=1/a),new S(s?1/a:a);x&&(a=z(x/G+2))}for(o?(r=new S(.5),s&&(e.s=1),u=J(e)):u=(i=Math.abs(+T(e)))%2,l=new S(d);;){if(u){if(!(l=l.times(c)).c)break;a?l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}if(i){if(0===(i=U(i/2)))break;u=i%2}else if(P(e=e.times(r),e.e+1,1),e.e>14)u=J(e);else{if(0===(i=+T(e)))break;u=i%2}c=c.times(c),a?c.c&&c.c.length>a&&(c.c.length=a):n&&(c=c.mod(t))}return n?l:(s&&(l=d.div(l)),t?l.mod(t):a?P(l,x,m,void 0):l)},h.integerValue=function(e){var t=new S(this);return null==e?e=m:X(e,0,8),P(t,t.e+1,e)},h.isEqualTo=h.eq=function(e,t){return 0===K(this,new S(e,t))},h.isFinite=function(){return!!this.c},h.isGreaterThan=h.gt=function(e,t){return K(this,new S(e,t))>0},h.isGreaterThanOrEqualTo=h.gte=function(e,t){return 1===(t=K(this,new S(e,t)))||0===t},h.isInteger=function(){return!!this.c&&V(this.e/G)>this.c.length-2},h.isLessThan=h.lt=function(e,t){return K(this,new S(e,t))<0},h.isLessThanOrEqualTo=h.lte=function(e,t){return-1===(t=K(this,new S(e,t)))||0===t},h.isNaN=function(){return!this.s},h.isNegative=function(){return this.s<0},h.isPositive=function(){return this.s>0},h.isZero=function(){return!!this.c&&0==this.c[0]},h.minus=function(e,t){var r,n,i,a,o=this,s=o.s;if(t=(e=new S(e,t)).s,!s||!t)return new S(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/G,l=e.e/G,c=o.c,f=e.c;if(!u||!l){if(!c||!f)return c?(e.s=-t,e):new S(f?o:NaN);if(!c[0]||!f[0])return f[0]?(e.s=-t,e):new S(c[0]?o:3==m?-0:0)}if(u=V(u),l=V(l),c=c.slice(),s=u-l){for((a=s<0)?(s=-s,i=c):(l=u,i=f),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(a=(s=c.length)<(t=f.length))?s:t,s=t=0;t0)for(;t--;c[r++]=0);for(t=Z-1;n>s;){if(c[--n]=0;){for(r=0,h=_[i]%g,d=_[i]/g|0,a=i+(o=u);a>i;)r=((l=h*(l=y[--o]%g)+(s=d*l+(c=y[o]/g|0)*h)%g*g+p[a]+r)/m|0)+(s/g|0)+d*c,p[a--]=l%m;p[a]=r}return r?++n:p.splice(0,1),I(e,p,n)},h.negated=function(){var e=new S(this);return e.s=-e.s||null,e},h.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new S(e,t)).s,!i||!t)return new S(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/G,o=e.e/G,s=n.c,u=e.c;if(!a||!o){if(!s||!u)return new S(i/0);if(!s[0]||!u[0])return u[0]?e:new S(s[0]?n:0*i)}if(a=V(a),o=V(o),s=s.slice(),i=a-o){for(i>0?(o=a,r=u):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/Z|0,s[t]=Z===s[t]?0:s[t]%Z;return i&&(s=[i].concat(s),++o),I(e,s,o)},h.precision=h.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return X(e,1,Q),null==t?t=m:X(t,0,8),P(new S(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*G+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},h.shiftedBy=function(e){return X(e,-9007199254740991,W),this.times("1e"+e)},h.squareRoot=h.sqrt=function(){var e,t,n,i,a,o=this,s=o.c,u=o.s,l=o.e,c=p+4,f=new S("0.5");if(1!==u||!s||!s[0])return new S(!u||u<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(u=Math.sqrt(+T(o)))||u==1/0?(((t=Y(s)).length+l)%2==0&&(t+="0"),u=Math.sqrt(+t),l=V((l+1)/2)-(l<0||l%2),n=new S(t=u==1/0?"5e"+l:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new S(u+""),n.c[0])for((u=(l=n.e)+c)<3&&(u=0);;)if(a=n,n=f.times(a.plus(r(o,a,c,1))),Y(a.c).slice(0,u)===(t=Y(n.c)).slice(0,u)){if(n.e0&&p>0){for(a=p%s||s,c=d.substr(0,a);a0&&(c+=l+d.slice(a)),h&&(c="-"+c)}n=f?c+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):c}return(r.prefix||"")+n+(r.suffix||"")},h.toFraction=function(e){var t,n,i,a,o,s,u,l,c,f,h,p,g=this,b=g.c;if(null!=e&&(!(u=new S(e)).isInteger()&&(u.c||1!==u.s)||u.lt(d)))throw Error($+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+T(u));if(!b)return new S(g);for(t=new S(d),c=n=new S(d),i=l=new S(d),p=Y(b),o=t.e=p.length-g.e-1,t.c[0]=H[(s=o%G)<0?G+s:s],e=!e||u.comparedTo(t)>0?o>0?t:c:u,s=_,_=1/0,u=new S(p),l.c[0]=0;f=r(u,t,0,1),1!=(a=n.plus(f.times(i))).comparedTo(e);)n=i,i=a,c=l.plus(f.times(a=c)),l=a,t=u.minus(f.times(a=t)),u=a;return a=r(e.minus(n),i,0,1),l=l.plus(a.times(c)),n=n.plus(a.times(i)),l.s=c.s=g.s,h=r(c,i,o*=2,m).minus(g).abs().comparedTo(r(l,n,o,m).minus(g).abs())<1?[c,i]:[l,n],_=s,h},h.toNumber=function(){return+T(this)},h.toPrecision=function(e,t){return null!=e&&X(e,1,Q),A(this,e,t,2)},h.toString=function(e){var t,r=this,i=r.s,a=r.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=g||a>=b?ee(Y(r.c),a):te(Y(r.c),a,"0"):10===e&&E?t=te(Y((r=P(new S(r),p+a+1,m)).c),r.e,"0"):(X(e,2,B.length,"Base"),t=n(te(Y(r.c),a,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},h.valueOf=h.toJSON=function(){return T(this)},h._isBigNumber=!0,h[Symbol.toStringTag]="BigNumber",h[Symbol.for("nodejs.util.inspect.custom")]=h.valueOf,null!=t&&S.set(t),S}();const ne=re;function ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ae=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;r(this,e),this.bytes=t,this.length=this.bytes.length,this.position=n,this.bitPos=i}return o(e,[{key:"clone",value:function(){return new e(this.bytes,this.position,this.bitPos)}},{key:"getBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!(this.position>this.length)){var t=null!==e?this.position+e:this.length,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(this.position>this.length)){-1===e&&(e=this.length-this.position);for(var t="",r=this.position;r1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n=this.position;i--)r<<=8,r|=this.bytes[i];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r,n=0,i=0;for(n=this.bytes[this.position++]&(r=this.bitPos,"be"===t?(1<<8-r)-1:256-(1<>>=this.bitPos),i=8-this.bitPos,this.bitPos=0;ie){var a=i-e;"be"===t?n>>>=a:n&=(1<this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n,i=function(e,t){var r=new Array;return e.forEach(function(e,n){r[e]=t-n}),r}(e,t);this.position=0;a--)if(this.bytes[this.position-t+a]!==e[a]){n=!1,this.position+=i[e[a]];break}if(n){this.position-=t;break}}}else for(;++this.positionthis.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;return this.bitPos>0&&t++,this.bytes.slice(e,t)}}])}();function oe(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return se(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?se(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r>4],u=i[(15&o)>>2],l=(2&o)>>1;if("free"===s||"bad"===s||"reserved"===u){r.moveBackwardsBy(1);break}var c=Math.floor(144*s/u+l);if(r.position+c>r.length){r.moveTo(r.length);break}r.moveForwardsBy(c-3)}return r.carve()}},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new ae(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new ae(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");for(n++;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:le},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:le}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new ae(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var i=r.readInt(2,"le");r.moveForwardsBy(16);var a=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(a-2),r.moveForwardsBy(32);var o=r.readInt(4,"le"),s=r.readInt(4,"le");if(o>0)return r.moveTo(o+s),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(i-1)),r.moveForwardsBy(16);var u=r.readInt(4,"le"),l=r.readInt(4,"le");return r.moveTo(l+u),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new ae(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),i=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var a=n?r.readInt(4,i):r.readInt(8,i);r.moveForwardsBy(10);var o=r.readInt(2,i),s=r.readInt(2,i);return r.moveTo(a),r.moveForwardsBy(o*s),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:ce},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:ce},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:le},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){for(var r=new ae(e.slice(t)),n=function(){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join(""))return r.moveBackwardsBy(262),1;r.moveBackwardsBy(138);var e=0;r.getBytes(11).forEach(function(t,r){e+=(t-48).toString()}),e=512*Math.ceil(parseInt(e,8)/512),r.moveForwardsBy(e+377)};r.hasMore()&&!n(););return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new ae(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var i=r.readInt(2,"le");r.moveForwardsby(i)}return 8&n&&(r.continueUntil(0),r.moveForwardsBy(1)),16&n&&(r.continueUntil(0),r.moveForwardsBy(1)),2&n&&r.moveForwardsBy(2),ge(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new ae(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],i=0;i=2368&&r.moveForwardsBy(4);var s=r.readInt(1,"be");if(r.moveForwardsBy(s),64&o){var u=r.readInt(4,"be");r.moveForwardsBy(u)}for(r.moveForwardsBy(4);r.hasMore();){var l=r.readInt(4,"be");if(0===l)break;var c=r.readInt(4,"be"),f=l===c?i:i+n;r.moveForwardsBy(c+4*f)}return r.carve()}},{name:"Linux deb package",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:function(e,t){var r=new ae(e.slice(t));for(r.moveForwardsBy(8);r.hasMore();){r.moveForwardsBy(48);var n,i="",a=oe(r.getBytes(10));try{for(a.s();!(n=a.n()).done;){var o=n.value;i+=String.fromCharCode(o)}}catch(e){a.e(e)}finally{a.f()}i=parseInt(i.trim(),10),r.moveForwardsBy(2),r.moveForwardsBy(i)}return r.carve()}},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new ae(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var i=r.readInt(4);return r.moveTo(n*i),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new ae(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var i=r.readInt(4,"le");return r.moveForwardsBy(i-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new ae(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;for(r.moveForwardsBy(n);r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(112),r.moveTo(4096*(r.readInt(4,"le")+1)),r.carve()}},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(12),r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new ae(e.slice(t)),n=0;for(r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(20),r.moveForwardsBy(r.readInt(4)),r.carve()}},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4},{0:149,1:5,2:134,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(52),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function le(e,t){var r=new ae(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function ce(e,t){var r="207250237254",n=new ae(e.slice(t)),i=n.getBytes(4).join("");return n.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var i=e.readInt(4,r);return function(e,t,r,n){for(var i=0,a=0;a0&&e.moveForwardsBy(1)}var be=[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,0,0],ye=[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];function _e(e,t,r){for(var n,i=0;(n=we(e,t))&&256!==n;){if(++i>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(be[n-257],"le"),n=we(e,r),e.readBits(ye[n],"le"))}}function ve(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<>=1;for(var h=a<<16|u,d=l;d>>16;if(o>i)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${o}`);return e.moveBackwardsByBits(i-o),65535&a}function xe(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var i=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[i]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[i])<0)return!1;break;case"function":if(!e[n](t[i]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}function Be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(ue);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var i in ue)t.includes(i)&&(n[i]=ue[i]);for(var a in n)n[a].forEach(function(t){xe(t.signature,e)&&r.push(t)});return r}function Ee(e){return function(e,t){var r=Be(t);return!!r.length&&r.reduce(function(t,r){var n=!!r.mime.startsWith(e)&&r.mime;return t||n},!1)}("image",e)}const Se=function(){return o(function e(){r(this,e)},null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){throw new Error("fromArrayBuffer has not been implemented")}}])}();function Ae(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ae=function(){return!!e})()}const Ce=function(e){function t(){return r(this,t),e=this,i=arguments,n=u(n=t),s(e,Ae()?Reflect.construct(n,i||[],u(e).constructor):n.apply(e,i));var e,n,i}return c(t,e),o(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}])}(Se);function Ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ie=function(){return!!e})()}const Pe=function(e){function t(){return r(this,t),e=this,i=arguments,n=u(n=t),s(e,Ie()?Reflect.construct(n,i||[],u(e).constructor):n.apply(e,i));var e,n,i}return c(t,e),o(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=ne.isBigNumber(this.value)?O.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value);try{this.value=new ne(O.arrayBufferToStr(this.value))}catch(e){this.value=new ne(NaN)}}}])}(Se);function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Te=function(){return!!e})()}const Me=function(e){function t(){return r(this,t),e=this,i=arguments,n=u(n=t),s(e,Te()?Reflect.construct(n,i||[],u(e).constructor):n.apply(e,i));var e,n,i}return c(t,e),o(t,null,[{key:"toArrayBuffer",value:function(){var e=this;if(t.checkForValue(this.value),!M())return new Promise(function(t,r){O.readFile(e.value).then(function(t){return e.value=t.buffer}).then(t).catch(r)});this.value=O.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new File(this.value,"unknown")}}])}(Se);function Re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Re=function(){return!!e})()}const Fe=function(e){function t(){return r(this,t),e=this,i=arguments,n=u(n=t),s(e,Re()?Reflect.construct(n,i||[],u(e).constructor):n.apply(e,i));var e,n,i}return c(t,e),o(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?O.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?O.arrayBufferToStr(this.value):""}}])}(Se);function Oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Oe=function(){return!!e})()}const Ne=function(e){function t(){return r(this,t),e=this,i=arguments,n=u(n=t),s(e,Oe()?Reflect.construct(n,i||[],u(e).constructor):n.apply(e,i));var e,n,i}return c(t,e),o(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?O.strToArrayBuffer(O.unescapeHtml(O.stripHtmlTags(this.value,!0))):new ArrayBuffer}}])}(Fe);function Le(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Le=function(){return!!e})()}const De=function(e){function t(){return r(this,t),e=this,i=arguments,n=u(n=t),s(e,Le()?Reflect.construct(n,i||[],u(e).constructor):n.apply(e,i));var e,n,i}return c(t,e),o(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=void 0!==this.value?O.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=JSON.parse(O.arrayBufferToStr(this.value))}}])}(Se);function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ze=function(){return!!e})()}const Ue=function(e){function n(){return r(this,n),e=this,i=arguments,t=u(t=n),s(e,ze()?Reflect.construct(t,i||[],u(e).constructor):t.apply(e,i));var e,t,i}return c(n,e),o(n,null,[{key:"toArrayBuffer",value:(a=t(h().mark(function e(){return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.checkForValue(this.value),!M()){e.next=1;break}this.value=this.value.map(function(e){return Uint8Array.from(e.data)}),e.next=3;break;case 1:return e.next=2,n.concatenateTypedArraysWithTypedElements.apply(n,m(this.value));case 2:this.value=e.sent;case 3:case"end":return e.stop()}},e,this)})),function(){return a.apply(this,arguments)})},{key:"fromArrayBuffer",value:function(){n.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:(i=t(h().mark(function e(){var t,r,n,i,a,o,s,u,l,c,f,d,p,m=arguments;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0,r=m.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r(this,e),this.value=new ArrayBuffer(0),this.type=e.ARRAY_BUFFER,t&&Object.prototype.hasOwnProperty.call(t,"value")&&Object.prototype.hasOwnProperty.call(t,"type"))this.set(t.value,t.type);else if(t&&null!==n)this.set(t,n);else if(t){var i=e.typeEnum(t.constructor.name);this.set(t,i)}}return o(e,[{key:"get",value:function(t){var r=this;return"string"==typeof t&&(t=e.typeEnum(t)),this.type!==t?M()?(this._translate(t),this.value):new Promise(function(e,n){r._translate(t).then(function(){e(r.value)}).catch(n)}):this.value}},{key:"set",value:function(t,r){if("string"==typeof r&&(r=e.typeEnum(r)),b().debug("Dish type: "+e.enumLookup(r)),this.value=t,this.type=r,!this.valid()){var n=O.truncate(JSON.stringify(this.value),25);throw new L(`Data is not a valid ${e.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){return this.clone().get(e)}},{key:"detectDishType",value:function(){var e=Be(new Uint8Array(this.value.slice(0,2048)));return e.length&&e[0].mime&&"text/plain"===e[0].mime?e[0].mime:null}},{key:"getTitle",value:(n=t(h().mark(function t(r){var n,i,a,o;return h().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n="",a=this.type,t.next=a===e.FILE?1:a===e.LIST_FILE?2:a===e.JSON?3:a===e.NUMBER||a===e.BIG_NUMBER?4:a===e.ARRAY_BUFFER||a===e.BYTE_ARRAY?5:6;break;case 1:return n=this.value.name,t.abrupt("continue",9);case 2:return n=`${this.value.length} file(s)`,t.abrupt("continue",9);case 3:return n="application/json",t.abrupt("continue",9);case 4:return n=this.value.toString(),t.abrupt("continue",9);case 5:if(null===(n=this.detectDishType())){t.next=6;break}return t.abrupt("continue",9);case 6:return t.prev=6,(i=this.clone()).value=i.value.slice(0,256),t.next=7,i.get(e.STRING);case 7:n=t.sent,t.next=9;break;case 8:t.prev=8,o=t.catch(6),b().error(`${e.enumLookup(this.type)} cannot be sliced. ${o}`);case 9:return t.abrupt("return",n.slice(0,r));case 10:case"end":return t.stop()}},t,this,[[6,8]])})),function(e){return n.apply(this,arguments)})},{key:"valid",value:function(){switch(this.type){case e.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var t=0;t255)return!1;return!0;case e.STRING:case e.HTML:return"string"==typeof this.value;case e.NUMBER:return"number"==typeof this.value;case e.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case e.BIG_NUMBER:if(ne.isBigNumber(this.value))return!0;if(Object.keys(this.value).sort().equals(["c","e","s"])){var r=new ne;return r.c=this.value.c,r.e=this.value.e,r.s=this.value.s,this.value=r,!0}return!1;case e.JSON:return!0;case e.FILE:return this.value instanceof File;case e.LIST_FILE:return this.value instanceof Array&&this.value.reduce(function(e,t){return e&&t instanceof File},!0);default:return!1}}},{key:"size",get:function(){switch(this.type){case e.BYTE_ARRAY:case e.STRING:case e.HTML:return this.value.length;case e.NUMBER:case e.BIG_NUMBER:return this.value.toString().length;case e.ARRAY_BUFFER:return this.value.byteLength;case e.JSON:return JSON.stringify(this.value).length;case e.FILE:return this.value.size;case e.LIST_FILE:return this.value.reduce(function(e,t){return e+t.size},0);default:return-1}}},{key:"clone",value:function(){var t=new e;switch(this.type){case e.STRING:case e.HTML:case e.NUMBER:case e.BIG_NUMBER:t.set(this.value,this.type);break;case e.BYTE_ARRAY:case e.JSON:t.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case e.ARRAY_BUFFER:t.set(this.value.slice(0),this.type);break;case e.FILE:t.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case e.LIST_FILE:t.set(this.value.map(function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})}),this.type);break;default:throw new L("Cannot clone Dish, unknown type")}return t}},{key:"_translate",value:function(t){var r=this;if(b().debug(`Translating Dish from ${e.enumLookup(this.type)} to ${e.enumLookup(t)}`),!M())return new Promise(function(n,i){r._toArrayBuffer().then(function(){return r.type=e.ARRAY_BUFFER}).then(function(){r._fromArrayBuffer(t),n()}).catch(i)});this._toArrayBuffer(),this.type=e.ARRAY_BUFFER,this._fromArrayBuffer(t)}},{key:"_toArrayBuffer",value:function(){var t=this,r={browser:{[e.STRING]:function(){return Promise.resolve(Fe.toArrayBuffer.bind(t)())},[e.NUMBER]:function(){return Promise.resolve(je.toArrayBuffer.bind(t)())},[e.HTML]:function(){return Promise.resolve(Ne.toArrayBuffer.bind(t)())},[e.ARRAY_BUFFER]:function(){return Promise.resolve()},[e.BIG_NUMBER]:function(){return Promise.resolve(Pe.toArrayBuffer.bind(t)())},[e.JSON]:function(){return Promise.resolve(De.toArrayBuffer.bind(t)())},[e.FILE]:function(){return Me.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return Promise.resolve(Ue.toArrayBuffer.bind(t)())},[e.BYTE_ARRAY]:function(){return Promise.resolve(Ce.toArrayBuffer.bind(t)())}},node:{[e.STRING]:function(){return Fe.toArrayBuffer.bind(t)()},[e.NUMBER]:function(){return je.toArrayBuffer.bind(t)()},[e.HTML]:function(){return Ne.toArrayBuffer.bind(t)()},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return Pe.toArrayBuffer.bind(t)()},[e.JSON]:function(){return De.toArrayBuffer.bind(t)()},[e.FILE]:function(){return Me.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return Ue.toArrayBuffer.bind(t)()},[e.BYTE_ARRAY]:function(){return Ce.toArrayBuffer.bind(t)()}}};try{return r[M()?"node":"browser"][this.type]()}catch(t){throw new L(`Error translating from ${e.enumLookup(this.type)} to ArrayBuffer: ${t}`)}}},{key:"_fromArrayBuffer",value:function(t){var r=this,n={[e.STRING]:function(){return Fe.fromArrayBuffer.bind(r)()},[e.NUMBER]:function(){return je.fromArrayBuffer.bind(r)()},[e.HTML]:function(){return Ne.fromArrayBuffer.bind(r)()},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return Pe.fromArrayBuffer.bind(r)()},[e.JSON]:function(){return De.fromArrayBuffer.bind(r)()},[e.FILE]:function(){return Me.fromArrayBuffer.bind(r)()},[e.LIST_FILE]:function(){return Ue.fromArrayBuffer.bind(r)()},[e.BYTE_ARRAY]:function(){return Ce.fromArrayBuffer.bind(r)()}};try{n[t](),this.type=t}catch(r){throw new L(`Error translating from ArrayBuffer to ${e.enumLookup(t)}: ${r}`)}}}],[{key:"typeEnum",value:function(t){switch(t.toLowerCase()){case"bytearray":case"byte array":return e.BYTE_ARRAY;case"string":return e.STRING;case"number":return e.NUMBER;case"html":return e.HTML;case"arraybuffer":case"array buffer":return e.ARRAY_BUFFER;case"bignumber":case"big number":return e.BIG_NUMBER;case"json":case"object":return e.JSON;case"file":return e.FILE;case"list":return e.LIST_FILE;default:throw new L("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(t){switch(t){case e.BYTE_ARRAY:return"byteArray";case e.STRING:return"string";case e.NUMBER:return"number";case e.HTML:return"html";case e.ARRAY_BUFFER:return"ArrayBuffer";case e.BIG_NUMBER:return"BigNumber";case e.JSON:return"JSON";case e.FILE:return"File";case e.LIST_FILE:return"List";default:throw new L("Invalid data type enum. No matching type.")}}}]);var n}();Ze.BYTE_ARRAY=0,Ze.STRING=1,Ze.NUMBER=2,Ze.HTML=3,Ze.ARRAY_BUFFER=4,Ze.BIG_NUMBER=5,Ze.JSON=6,Ze.FILE=7,Ze.LIST_FILE=8;const Ge=Ze,We=function(){function e(t){r(this,e),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.maxLength=null,this.min=null,this.max=null,this.step=1,t&&this._parseConfig(t)}return o(e,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.maxLength=e.maxLength||null,this.min=e.min,this.max=e.max,this.step=e.step}},{key:"config",get:function(){return this._value}},{key:"value",get:function(){return this._value},set:function(t){this._value=e.prepare(t,this.type)}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return O.parseEscapedChars(e);case"byteArray":return"string"==typeof e?S(e=e.replace(/\s+/g,"")):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+O.truncate(e.toString(),10);return r;default:return e}}}])}();var He=function(){return o(function e(){r(this,e),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null},[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"inputType",get:function(){return Ge.enumLookup(this._inputType)},set:function(e){this._inputType=Ge.typeEnum(e)}},{key:"outputType",get:function(){return Ge.enumLookup(this._outputType)},set:function(e){this._outputType=Ge.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)}},{key:"presentType",get:function(){return Ge.enumLookup(this._presentType)},set:function(e){this._presentType=Ge.typeEnum(e)}},{key:"args",get:function(){return this._ingList.map(function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),e.maxLength&&(t.maxLength=e.maxLength),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),t})},set:function(e){var t=this;e.forEach(function(e){var r=new We(e);t.addIngredient(r)})}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map(function(e){return e.config})}}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"ingValues",get:function(){return this._ingList.map(function(e){return e.value})},set:function(e){var t=this;e.forEach(function(e,r){t._ingList[r].value=e})}},{key:"breakpoint",get:function(){return this._breakpoint},set:function(e){this._breakpoint=!!e}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=!!e}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}])}();const qe=He;var Qe=__webpack_require__(69962);function Ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ve=function(){return!!e})()}const Ye=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Ve()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Add Text To Image",e.module="Image",e.description="Adds text onto an image.

Text can be horizontally or vertically aligned, or the position can be manually specified.
Variants of the Roboto font face are available in any size or colour.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Text",type:"string",value:""},{name:"Horizontal align",type:"option",value:["None","Left","Center","Right"]},{name:"Vertical align",type:"option",value:["None","Top","Middle","Bottom"]},{name:"X position",type:"number",value:0},{name:"Y position",type:"number",value:0},{name:"Size",type:"number",value:32,min:8},{name:"Font face",type:"option",value:["Roboto","Roboto Black","Roboto Mono","Roboto Slab"]},{name:"Red",type:"number",value:255,min:0,max:255},{name:"Green",type:"number",value:255,min:0,max:255},{name:"Blue",type:"number",value:255,min:0,max:255},{name:"Alpha",type:"number",value:255,min:0,max:255}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d,p,m,g,b,y,_,v,w,x,B,E,S,A,C,I,P;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r[0],i=r[1],a=r[2],o=r[5],s=r[6],u=r[7],l=r[8],c=r[9],f=r[10],d=r[3],p=r[4],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:m=e.sent,e.next=4;break;case 3:throw e.prev=3,B=e.catch(1),new k(`Error loading image. (${B})`);case 4:return F()&&self.sendStatusMessage("Adding text to image..."),g={},e.prev=5,b=[Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,85966,17)),Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,60261,17)),Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,13773,17)),Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,6758,17))],e.next=6,Promise.all(b).then(function(e){g.Roboto=e[0],g["Roboto Black"]=e[1],g["Roboto Mono"]=e[2],g["Roboto Slab"]=e[3]});case 6:return e.next=7,Promise.all([Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,47707,17)),Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,25971,17)),Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,53968,17)),Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,55560,17))]);case 7:e.next=9;break;case 8:throw e.prev=8,E=e.catch(5),new k(`Error preparing fonts. (${E})`);case 9:return e.prev=9,_=g[s],e.next=10,(0,Qe.Al)(self.docURL+"/"+_.default);case 10:(y=e.sent).pages.forEach(function(e){if(e.bitmap)for(var t=e.bitmap.width,r=e.bitmap.height,n=0;n0?o:0,e.bitmap.data[a+1]=s>0?s:0,e.bitmap.data[a+2]=h>0?h:0,e.bitmap.data[a+3]=d>0?d:0}}),e.next=12;break;case 11:throw e.prev=11,S=e.catch(9),new k(`Error loading font. (${S})`);case 12:e.prev=12,(v=new Qe.dK({width:(0,Qe.kD)(y,n),height:(0,Qe.Rf)(y,n)})).print({font:y,x:0,y:0,text:n}),w=o/72,1!==o&&(o>1?v.scale({f:w,mode:Qe.od.BICUBIC}):v.scale({f:w,mode:Qe.od.BILINEAR})),A=i,e.next="Left"===A?13:"Center"===A?14:"Right"===A?15:16;break;case 13:return d=0,e.abrupt("continue",16);case 14:return d=m.width/2-v.width/2,e.abrupt("continue",16);case 15:return d=m.width-v.width,e.abrupt("continue",16);case 16:C=a,e.next="Top"===C?17:"Middle"===C?18:"Bottom"===C?19:20;break;case 17:return p=0,e.abrupt("continue",20);case 18:return p=m.height/2-v.height/2,e.abrupt("continue",20);case 19:return p=m.height-v.height,e.abrupt("continue",20);case 20:m.blit({src:v,x:d,y:p}),e.next=22;break;case 21:throw e.prev=21,I=e.catch(12),new k(`Error adding text to image. (${I})`);case 22:if(e.prev=22,"image/gif"!==m.mime){e.next=24;break}return e.next=23,m.getBuffer(Qe.pY.png);case 23:x=e.sent,e.next=26;break;case 24:return e.next=25,m.getBuffer(m.mime);case 25:x=e.sent;case 26:return e.abrupt("return",x.buffer);case 27:throw e.prev=27,P=e.catch(22),new k(`Error exporting image. (${P})`);case 28:case"end":return e.stop()}},e,null,[[1,3],[5,8],[9,11],[12,21],[22,27]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function Ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ke=function(){return!!e})()}const Xe=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Ke()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Blur Image",e.module="Image",e.description="Applies a blur effect to the image.

Gaussian blur is much slower than fast blur, but produces better results.",e.infoURL="https://wikipedia.org/wiki/Gaussian_blur",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Amount",type:"number",value:5,min:1},{name:"Type",type:"option",value:["Fast","Gaussian"]}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,2),i=n[0],a=n[1],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:o=e.sent,e.next=4;break;case 3:throw e.prev=3,u=e.catch(1),new k(`Error loading image. (${u})`);case 4:e.prev=4,l=a,e.next="Fast"===l?5:"Gaussian"===l?6:7;break;case 5:return F()&&self.sendStatusMessage("Fast blurring image..."),o.blur(i),e.abrupt("continue",7);case 6:return F()&&self.sendStatusMessage("Gaussian blurring image..."),o.gaussian(i),e.abrupt("continue",7);case 7:if("image/gif"!==o.mime){e.next=9;break}return e.next=8,o.getBuffer(Qe.pY.png);case 8:s=e.sent,e.next=11;break;case 9:return e.next=10,o.getBuffer(o.mime);case 10:s=e.sent;case 11:return e.abrupt("return",s.buffer);case 12:throw e.prev=12,c=e.catch(4),new k(`Error blurring image. (${c})`);case 13:case"end":return e.stop()}},e,null,[[1,3],[4,12]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function Je(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Je=function(){return!!e})()}const et=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Je()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Contain Image",e.module="Image",e.description="Scales an image to the specified width and height, maintaining the aspect ratio. The image may be letterboxed.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Width",type:"number",value:100,min:1},{name:"Height",type:"number",value:100,min:1},{name:"Horizontal align",type:"option",value:["Left","Center","Right"],defaultIndex:1},{name:"Vertical align",type:"option",value:["Top","Middle","Bottom"],defaultIndex:1},{name:"Resizing algorithm",type:"option",value:["Nearest Neighbour","Bilinear","Bicubic","Hermite","Bezier"],defaultIndex:1},{name:"Opaque background",type:"boolean",value:!0}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d,p,m,g,b,y;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],l=n[5],c={"Nearest Neighbour":Qe.od.NEAREST_NEIGHBOR,Bilinear:Qe.od.BILINEAR,Bicubic:Qe.od.BICUBIC,Hermite:Qe.od.HERMITE,Bezier:Qe.od.BEZIER},f={Left:Qe.wq.LEFT,Center:Qe.wq.CENTER,Right:Qe.wq.RIGHT,Top:Qe.G4.TOP,Middle:Qe.G4.MIDDLE,Bottom:Qe.G4.BOTTOM},Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:d=e.sent,e.next=4;break;case 3:throw e.prev=3,b=e.catch(1),new k(`Error loading image. (${b})`);case 4:if(p=d.mime,e.prev=5,F()&&self.sendStatusMessage("Containing image..."),d.contain({w:i,h:a,align:f[o]|f[s],mode:c[u]}),l&&(m=new Qe.dK({width:i,height:a,color:255}),d=m.blit({src:d,x:0,y:0})),"image/gif"!==p){e.next=7;break}return e.next=6,d.getBuffer(Qe.pY.png);case 6:g=e.sent,e.next=9;break;case 7:return e.next=8,d.getBuffer(p);case 8:g=e.sent;case 9:return e.abrupt("return",g.buffer);case 10:throw e.prev=10,y=e.catch(5),new k(`Error containing image. (${y})`);case 11:case"end":return e.stop()}},e,null,[[1,3],[5,10]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function tt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tt=function(){return!!e})()}const rt=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,tt()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Convert Image Format",e.module="Image",e.description="Converts an image between different formats. Supported formats:
  • Joint Photographic Experts Group (JPEG)
  • Portable Network Graphics (PNG)
  • Bitmap (BMP)
  • Tagged Image File Format (TIFF)

Note: GIF files are supported for input, but cannot be outputted.",e.infoURL="https://wikipedia.org/wiki/Image_file_formats",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Output Format",type:"option",value:["JPEG","PNG","BMP","TIFF"]},{name:"JPEG Quality",type:"number",value:80,min:1,max:100},{name:"PNG Filter Type",type:"option",value:["Auto","None","Sub","Up","Average","Paeth"]},{name:"PNG Deflate Level",type:"number",value:9,min:0,max:9}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d,p,m,g;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,4),i=n[0],a=n[1],o=n[2],s=n[3],u={JPEG:Qe.pY.jpeg,PNG:Qe.pY.png,BMP:Qe.pY.bmp,TIFF:Qe.pY.tiff},l={Auto:Qe.ej.AUTO,None:Qe.ej.NONE,Sub:Qe.ej.SUB,Up:Qe.ej.UP,Average:Qe.ej.AVERAGE,Paeth:Qe.ej.PATH},c=u[i],Ee(t)){e.next=1;break}throw new k("Invalid file format.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:f=e.sent,e.next=4;break;case 3:throw e.prev=3,p=e.catch(1),new k(`Error opening image file. (${p})`);case 4:e.prev=4,m=c,e.next=m===Qe.pY.jpeg?5:m===Qe.pY.png?7:9;break;case 5:return e.next=6,f.getBuffer(c,{quality:a});case 6:case 8:case 10:return d=e.sent,e.abrupt("continue",11);case 7:return e.next=8,f.getBuffer(c,{filterType:l[o],deflateLevel:s});case 9:return e.next=10,f.getBuffer(c);case 11:return e.abrupt("return",d.buffer);case 12:throw e.prev=12,g=e.catch(4),new k(`Error converting image format. (${g})`);case 13:case"end":return e.stop()}},e,null,[[1,3],[4,12]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function nt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(nt=function(){return!!e})()}const it=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,nt()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Cover Image",e.module="Image",e.description="Scales the image to the given width and height, keeping the aspect ratio. The image may be clipped.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Width",type:"number",value:100,min:1},{name:"Height",type:"number",value:100,min:1},{name:"Horizontal align",type:"option",value:["Left","Center","Right"],defaultIndex:1},{name:"Vertical align",type:"option",value:["Top","Middle","Bottom"],defaultIndex:1},{name:"Resizing algorithm",type:"option",value:["Nearest Neighbour","Bilinear","Bicubic","Hermite","Bezier"],defaultIndex:1}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d,p,m;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,5),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],l={"Nearest Neighbour":Qe.od.NEAREST_NEIGHBOR,Bilinear:Qe.od.BILINEAR,Bicubic:Qe.od.BICUBIC,Hermite:Qe.od.HERMITE,Bezier:Qe.od.BEZIER},c={Left:Qe.wq.LEFT,Center:Qe.wq.CENTER,Right:Qe.wq.RIGHT,Top:Qe.G4.TOP,Middle:Qe.G4.MIDDLE,Bottom:Qe.G4.BOTTOM},Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:f=e.sent,e.next=4;break;case 3:throw e.prev=3,p=e.catch(1),new k(`Error loading image. (${p})`);case 4:if(e.prev=4,F()&&self.sendStatusMessage("Covering image..."),f.cover({w:i,h:a,align:c[o]|c[s],mode:l[u]}),"image/gif"!==f.mime){e.next=6;break}return e.next=5,f.getBuffer(Qe.pY.png);case 5:d=e.sent,e.next=8;break;case 6:return e.next=7,f.getBuffer(f.mime);case 7:d=e.sent;case 8:return e.abrupt("return",d.buffer);case 9:throw e.prev=9,m=e.catch(4),new k(`Error covering image. (${m})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function at(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(at=function(){return!!e})()}const ot=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,at()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Crop Image",e.module="Image",e.description="Crops an image to the specified region, or automatically crops edges.

Autocrop
Automatically crops same-colour borders from the image.

Autocrop tolerance
A percentage value for the tolerance of colour difference between pixels.

Only autocrop frames
Only crop real frames (all sides must have the same border)

Symmetric autocrop
Force autocrop to be symmetric (top/bottom and left/right are cropped by the same amount)

Autocrop keep border
The number of pixels of border to leave around the image.",e.infoURL="https://wikipedia.org/wiki/Cropping_(image)",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"X Position",type:"number",value:0,min:0},{name:"Y Position",type:"number",value:0,min:0},{name:"Width",type:"number",value:10,min:1},{name:"Height",type:"number",value:10,min:1},{name:"Autocrop",type:"boolean",value:!1},{name:"Autocrop tolerance (%)",type:"number",value:.02,min:0,max:100,step:.01},{name:"Only autocrop frames",type:"boolean",value:!0},{name:"Symmetric autocrop",type:"boolean",value:!1},{name:"Autocrop keep border (px)",type:"number",value:0,min:0}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d,p,m,g,b;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,9),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],l=n[5],c=n[6],f=n[7],d=n[8],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:p=e.sent,e.next=4;break;case 3:throw e.prev=3,g=e.catch(1),new k(`Error loading image. (${g})`);case 4:if(e.prev=4,F()&&self.sendStatusMessage("Cropping image..."),u?p.autocrop({tolerance:l/100,cropOnlyFrames:c,cropSymmetric:f,leaveBorder:d}):p.crop({x:i,y:a,w:o,h:s}),"image/gif"!==p.mime){e.next=6;break}return e.next=5,p.getBuffer(Qe.pY.png);case 5:m=e.sent,e.next=8;break;case 6:return e.next=7,p.getBuffer(p.mime);case 7:m=e.sent;case 8:return e.abrupt("return",m.buffer);case 9:throw e.prev=9,b=e.catch(4),new k(`Error cropping image. (${b})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function st(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(st=function(){return!!e})()}const ut=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,st()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Dither Image",e.module="Image",e.description="Apply a dither effect to an image.",e.infoURL="https://wikipedia.org/wiki/Dither",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:n=e.sent,e.next=4;break;case 3:throw e.prev=3,a=e.catch(1),new k(`Error loading image. (${a})`);case 4:if(e.prev=4,F()&&self.sendStatusMessage("Applying dither to image..."),n.dither(),"image/gif"!==n.mime){e.next=6;break}return e.next=5,n.getBuffer(Qe.pY.png);case 5:i=e.sent,e.next=8;break;case 6:return e.next=7,n.getBuffer(n.mime);case 7:i=e.sent;case 8:return e.abrupt("return",i.buffer);case 9:throw e.prev=9,o=e.catch(4),new k(`Error applying dither to image. (${o})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);var lt=__webpack_require__(87833),ct=__webpack_require__.n(lt);function ft(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ft=function(){return!!e})()}const ht=function(e){function t(){var e,n,i,a;return r(this,t),n=this,i=u(i=t),(e=s(n,ft()?Reflect.construct(i,[],u(n).constructor):i.apply(n,a))).name="Extract EXIF",e.module="Image",e.description=["Extracts EXIF data from an image.","

","EXIF data is metadata embedded in images (JPEG, JPG, TIFF) and audio files.","

","EXIF data from photos usually contains information about the image file itself as well as the device used to create it."].join("\n"),e.infoURL="https://wikipedia.org/wiki/Exif",e.inputType="ArrayBuffer",e.outputType="string",e.args=[],e}return c(t,e),o(t,[{key:"run",value:function(e,t){try{var r=ct().create(e).parse(),n=[];for(var i in r.tags){var a=r.tags[i];n.push(`${i}: ${a}`)}var o=n.length;return n.unshift(`Found ${o} tags.\n`),n.join("\n")}catch(e){throw new k(`Could not extract EXIF data from image: ${e}`)}}}])}(qe);function dt(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return pt(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r7)){e.next=3;break}throw new k("Error: Bit argument must be between 0 and 7");case 3:if(f="","Row"===i)for(c=0;c`}}]);var i}(qe);function Bt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Bt=function(){return!!e})()}var Et=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Bt()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Generate Image",e.module="Image",e.description="Generates an image using the input as pixel values.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Mode",type:"option",value:["Greyscale","RG","RGB","RGBA","Bits"]},{name:"Pixel Scale Factor",type:"number",value:8},{name:"Pixels per row",type:"number",value:64}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d,p,m,g,b,y,_,v,w,x,B,E,S,A,C,I,P,T,M;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,3),i=n[0],a=n[1],o=n[2],t=new Uint8Array(t),!(a<=0)){e.next=1;break}throw new k("Pixel Scale Factor needs to be > 0");case 1:if(!(o<=0)){e.next=2;break}throw new k("Pixels per Row needs to be > 0");case 2:if(!((s={Greyscale:1,RG:2,RGB:3,RGBA:4,Bits:1/8}[i])>0&&t.length%s!==0)){e.next=3;break}throw new k(`Number of bytes is not a divisor of ${s}`);case 3:if(u=Math.ceil(t.length/s/o),l=new Qe.dK({width:o,height:u}),F()&&self.sendStatusMessage("Generating image from data..."),"Bits"!==i){e.next=4;break}for(c=0,f=0;f`}}]);var i}(qe);const St=Et;var At=__webpack_require__(66624),Ct=__webpack_require__.n(At),It=__webpack_require__(65235),Pt=__webpack_require__.n(It);function Tt(e,t){return Mt.apply(this,arguments)}function Mt(){return(Mt=t(h().mark(function e(t,r){var n,i,a,o,s;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Qe.dK.read(t);case 1:n=e.sent,e.next=3;break;case 2:throw e.prev=2,a=e.catch(0),new k(`Error opening image. (${a})`);case 3:e.prev=3,r&&(n.greyscale(),n.normalize()),e.next=5;break;case 4:throw e.prev=4,o=e.catch(3),new k(`Error normalising image. (${o})`);case 5:return n.scan(function(e,t,r){0===n.bitmap.data[r+3]&&(n.bitmap.data[r+0]=255,n.bitmap.data[r+1]=255,n.bitmap.data[r+2]=255),n.bitmap.data[r+3]=255}),s=Qe.dK,e.next=6,n.getBuffer(Qe.pY.jpeg);case 6:return e.next=7,s.read.call(s,e.sent);case 7:if(n=e.sent,!(i=Ct()(new Uint8ClampedArray(n.bitmap.data),n.width,n.height))){e.next=8;break}return e.abrupt("return",i.data);case 8:throw new k("Could not read a QR code from the image.");case 9:case"end":return e.stop()}},e,null,[[0,2],[3,4]])}))).apply(this,arguments)}function Rt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Rt=function(){return!!e})()}const Ft=function(e){function t(){var e,n,i,a;return r(this,t),n=this,i=u(i=t),(e=s(n,Rt()?Reflect.construct(i,[],u(n).constructor):i.apply(n,a))).name="Generate QR Code",e.module="Image",e.description="Generates a Quick Response (QR) code from the input text.

A QR code is a type of matrix barcode (or two-dimensional barcode) first designed in 1994 for the automotive industry in Japan. A barcode is a machine-readable optical label that contains information about the item to which it is attached.",e.infoURL="https://wikipedia.org/wiki/QR_code",e.inputType="string",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Image Format",type:"option",value:["PNG","SVG","EPS","PDF"]},{name:"Module size (px)",type:"number",value:5,min:1},{name:"Margin (num modules)",type:"number",value:4,min:0},{name:"Error correction",type:"option",value:["Low","Medium","Quartile","High"],defaultIndex:1}],e}return c(t,e),o(t,[{key:"run",value:function(e,t){var r=ie(t,4);return function(e,t,r,n,i){var a;if(!["SVG","EPS","PDF","PNG"].includes(t.toUpperCase()))throw new k("Unsupported QR code format.");try{a=Pt().imageSync(e,{type:t,size:r,margin:n,ec_level:i.charAt(0).toUpperCase()})}catch(e){throw new k(`Error generating QR code. (${e})`)}if(!a)throw new k("Error generating QR code.");switch(t){case"SVG":case"EPS":case"PDF":return O.strToArrayBuffer(a);case"PNG":return a.buffer.slice(a.byteOffset,a.byteLength+a.byteOffset);default:throw new k("Unsupported QR code format.")}}(e,r[0],r[1],r[2],r[3])}},{key:"present",value:function(e,t){if(!e.byteLength&&!e.length)return"";var r=new Uint8Array(e);if("PNG"===ie(t,1)[0]){var n=Ee(r);if(!n)throw new k("Invalid file type.");return``}return O.arrayBufferToStr(e)}}])}(qe);function Ot(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ot=function(){return!!e})()}const Nt=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Ot()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Image Brightness / Contrast",e.module="Image",e.description="Adjust the brightness or contrast of an image.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Brightness",type:"number",value:0,min:-100,max:100},{name:"Contrast",type:"number",value:0,min:-100,max:100}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,2),i=n[0],a=n[1],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:o=e.sent,e.next=4;break;case 3:throw e.prev=3,u=e.catch(1),new k(`Error loading image. (${u})`);case 4:if(e.prev=4,0!==i&&(F()&&self.sendStatusMessage("Changing image brightness..."),o.brightness(i/100)),0!==a&&(F()&&self.sendStatusMessage("Changing image contrast..."),o.contrast(a/100)),"image/gif"!==o.mime){e.next=6;break}return e.next=5,o.getBuffer(Qe.pY.png);case 5:s=e.sent,e.next=8;break;case 6:return e.next=7,o.getBuffer(o.mime);case 7:s=e.sent;case 8:return e.abrupt("return",s.buffer);case 9:throw e.prev=9,l=e.catch(4),new k(`Error adjusting image brightness or contrast. (${l})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function Lt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Lt=function(){return!!e})()}const Dt=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Lt()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Image Filter",e.module="Image",e.description="Applies a greyscale or sepia filter to an image.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Filter type",type:"option",value:["Greyscale","Sepia"]}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,1),i=n[0],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:a=e.sent,e.next=4;break;case 3:throw e.prev=3,s=e.catch(1),new k(`Error loading image. (${s})`);case 4:if(e.prev=4,F()&&self.sendStatusMessage("Applying "+i.toLowerCase()+" filter to image..."),"Greyscale"===i?a.greyscale():a.sepia(),"image/gif"!==a.mime){e.next=6;break}return e.next=5,a.getBuffer(Qe.pY.png);case 5:o=e.sent,e.next=8;break;case 6:return e.next=7,a.getBuffer(a.mime);case 7:o=e.sent;case 8:return e.abrupt("return",o.buffer);case 9:throw e.prev=9,u=e.catch(4),new k(`Error applying filter to image. (${u})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(zt=function(){return!!e})()}const Ut=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,zt()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Image Hue/Saturation/Lightness",e.module="Image",e.description="Adjusts the hue / saturation / lightness (HSL) values of an image.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Hue",type:"number",value:0,min:-360,max:360},{name:"Saturation",type:"number",value:0,min:-100,max:100},{name:"Lightness",type:"number",value:0,min:-100,max:100}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,3),i=n[0],a=n[1],o=n[2],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:s=e.sent,e.next=4;break;case 3:throw e.prev=3,l=e.catch(1),new k(`Error loading image. (${l})`);case 4:if(e.prev=4,0!==i&&(F()&&self.sendStatusMessage("Changing image hue..."),s.color([{apply:"hue",params:[i]}])),0!==a&&(F()&&self.sendStatusMessage("Changing image saturation..."),s.color([{apply:"saturate",params:[a]}])),0!==o&&(F()&&self.sendStatusMessage("Changing image lightness..."),s.color([{apply:"lighten",params:[o]}])),"image/gif"!==s.mime){e.next=6;break}return e.next=5,s.getBuffer(Qe.pY.png);case 5:u=e.sent,e.next=8;break;case 6:return e.next=7,s.getBuffer(s.mime);case 7:u=e.sent;case 8:return e.abrupt("return",u.buffer);case 9:throw e.prev=9,c=e.catch(4),new k(`Error adjusting image hue / saturation / lightness. (${c})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function $t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($t=function(){return!!e})()}const jt=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,$t()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Image Opacity",e.module="Image",e.description="Adjust the opacity of an image.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Opacity (%)",type:"number",value:100,min:0,max:100}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,1),i=n[0],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:a=e.sent,e.next=4;break;case 3:throw e.prev=3,s=e.catch(1),new k(`Error loading image. (${s})`);case 4:if(e.prev=4,F()&&self.sendStatusMessage("Changing image opacity..."),a.opacity(i/100),"image/gif"!==a.mime){e.next=6;break}return e.next=5,a.getBuffer(Qe.pY.png);case 5:o=e.sent,e.next=8;break;case 6:return e.next=7,a.getBuffer(a.mime);case 7:o=e.sent;case 8:return e.abrupt("return",o.buffer);case 9:throw e.prev=9,u=e.catch(4),new k(`Error changing image opacity. (${u})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Zt=function(){return!!e})()}const Gt=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Zt()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Invert Image",e.module="Image",e.description="Invert the colours of an image.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ee(t)){e.next=1;break}throw new k("Invalid input file format.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:n=e.sent,e.next=4;break;case 3:throw e.prev=3,a=e.catch(1),new k(`Error loading image. (${a})`);case 4:if(e.prev=4,F()&&self.sendStatusMessage("Inverting image..."),n.invert(),"image/gif"!==n.mime){e.next=6;break}return e.next=5,n.getBuffer(Qe.pY.png);case 5:i=e.sent,e.next=8;break;case 6:return e.next=7,n.getBuffer(n.mime);case 7:i=e.sent;case 8:return e.abrupt("return",i.buffer);case 9:throw e.prev=9,o=e.catch(4),new k(`Error inverting image. (${o})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function Wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Wt=function(){return!!e})()}const Ht=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Wt()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Normalise Image",e.module="Image",e.description="Normalise the image colours.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:n=e.sent,e.next=4;break;case 3:throw e.prev=3,a=e.catch(1),new k(`Error opening image file. (${a})`);case 4:if(e.prev=4,n.normalize(),"image/gif"!==n.mime){e.next=6;break}return e.next=5,n.getBuffer(Qe.pY.png);case 5:i=e.sent,e.next=8;break;case 6:return e.next=7,n.getBuffer(n.mime);case 7:i=e.sent;case 8:return e.abrupt("return",i.buffer);case 9:throw e.prev=9,o=e.catch(4),new k(`Error normalising image. (${o})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(qt=function(){return!!e})()}const Qt=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,qt()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Parse QR Code",e.module="Image",e.description="Reads an image file and attempts to detect and read a Quick Response (QR) code from the image.

Normalise Image
Attempts to normalise the image before parsing it to improve detection of a QR code.",e.infoURL="https://wikipedia.org/wiki/QR_code",e.inputType="ArrayBuffer",e.outputType="string",e.args=[{name:"Normalise image",type:"boolean",value:!1}],e.checks=[{pattern:"^(?:\\xff\\xd8\\xff|\\x89\\x50\\x4e\\x47|\\x47\\x49\\x46|.{8}\\x57\\x45\\x42\\x50|\\x42\\x4d)",flags:"",args:[!1],useful:!0}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,1),i=n[0],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.abrupt("return",Tt(t,i));case 2:case"end":return e.stop()}},e)})),function(e,t){return i.apply(this,arguments)})}]);var i}(qe);function Vt(){return Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Vt.apply(null,arguments)}const Yt=function(){return o(function e(t){r(this,e),this.unitSize=4,this.unitOrder=0,this.blockSize=16,this.blockSizeInBytes=this.blockSize*this.unitSize,this.options=t||{},this.reset()},[{key:"reset",value:function(){this.state={},this.state.message="",this.state.length=0}},{key:"getState",value:function(){return JSON.parse(JSON.stringify(this.state))}},{key:"setState",value:function(e){this.state=e}},{key:"update",value:function(e){this.state.message+=e,this.state.length+=e.length,this.process()}},{key:"process",value:function(){}},{key:"finalize",value:function(){return""}},{key:"getStateHash",value:function(e){return""}},{key:"addPaddingPKCS7",value:function(e){this.state.message+=new Array(e+1).join(String.fromCharCode(e))}},{key:"addPaddingISO7816",value:function(e){this.state.message+="€"+new Array(e).join("\0")}},{key:"addPaddingZero",value:function(e){this.state.message+=new Array(e+1).join("\0")}}])}();function Kt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Kt=function(){return!!e})()}var Xt=function(e){function t(e){var n,i,a,o;return r(this,t),i=this,o=[e],a=u(a=t),(n=s(i,Kt()?Reflect.construct(a,o||[],u(i).constructor):a.apply(i,o))).blockUnits=[],n}return c(t,e),o(t,[{key:"process",value:function(){for(;this.state.message.length>=this.blockSizeInBytes;){this.blockUnits=[];for(var e=0;e>8&255)+String.fromCharCode(this.state.hash[r]>>16&255)+String.fromCharCode(this.state.hash[r]>>24&255);return t}},{key:"addLengthBits",value:function(){this.state.message+=String.fromCharCode(this.state.length<<3&255)+String.fromCharCode(this.state.length>>5&255)+String.fromCharCode(this.state.length>>13&255)+String.fromCharCode(this.state.length>>21&255)+String.fromCharCode(this.state.length>>29&255)+"\0\0\0"}}])}(Yt);const Jt=Xt;function er(e,t){return e<>>32-t}function tr(e,t){return e>>>t|e<<32-t}function rr(e,t,r){return 32===r?t:r>32?rr(t,e,r-32):4294967295&(e>>>r|t<<32-r)}function nr(e,t,r){return 32===r?e:r>32?nr(t,e,r-32):4294967295&(t>>>r|e<<32-r)}function ir(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ir=function(){return!!e})()}var ar=[0,1518500249,1859775393,2400959708],or=[5,11,7,15,6,13,8,14,7,12,9,11,8,15,6,12,9,14,5,13],sr=[10,17,25,30],ur=[18,0,1,2,3,19,4,5,6,7,16,8,9,10,11,17,12,13,14,15,22,3,6,9,12,23,15,2,5,8,20,11,14,1,4,21,7,10,13,0,26,12,5,14,7,27,0,9,2,11,24,4,13,6,15,25,8,1,10,3,30,7,2,13,8,31,3,14,9,4,28,15,10,5,0,29,11,6,1,12],lr=function(e){function t(e){var n,i,a,o;return r(this,t),i=this,o=[e],a=u(a=t),(n=s(i,ir()?Reflect.construct(a,o||[],u(i).constructor):a.apply(i,o))).options.rounds=n.options.rounds||80,n.W=new Array(32),n}return c(t,e),o(t,[{key:"reset",value:function(){var e,r,n;(e=t,r=this,"function"==typeof(n=Vt(u(1&3?e.prototype:e),"reset",r))?function(e){return n.apply(r,e)}:n)([]),this.state.hash=[1732584193,4023233417,2562383102,271733878,3285377520]}},{key:"processBlock",value:function(e){for(var t=0|this.state.hash[0],r=0|this.state.hash[1],n=0|this.state.hash[2],i=0|this.state.hash[3],a=0|this.state.hash[4],o=0;o<16;o++)this.W[o]=0|e[o];this.W[16]=this.W[0]^this.W[1]^this.W[2]^this.W[3]|0,this.W[17]=this.W[4]^this.W[5]^this.W[6]^this.W[7]|0,this.W[18]=this.W[8]^this.W[9]^this.W[10]^this.W[11]|0,this.W[19]=this.W[12]^this.W[13]^this.W[14]^this.W[15]|0,this.W[20]=this.W[3]^this.W[6]^this.W[9]^this.W[12]|0,this.W[21]=this.W[2]^this.W[5]^this.W[8]^this.W[15]|0,this.W[22]=this.W[1]^this.W[4]^this.W[11]^this.W[14]|0,this.W[23]=this.W[0]^this.W[7]^this.W[10]^this.W[13]|0,this.W[24]=this.W[5]^this.W[7]^this.W[12]^this.W[14]|0,this.W[25]=this.W[0]^this.W[2]^this.W[9]^this.W[11]|0,this.W[26]=this.W[4]^this.W[6]^this.W[13]^this.W[15]|0,this.W[27]=this.W[1]^this.W[3]^this.W[8]^this.W[10]|0,this.W[28]=this.W[2]^this.W[7]^this.W[8]^this.W[13]|0,this.W[29]=this.W[3]^this.W[4]^this.W[9]^this.W[14]|0,this.W[30]=this.W[0]^this.W[5]^this.W[10]^this.W[15]|0,this.W[31]=this.W[1]^this.W[6]^this.W[11]^this.W[12]|0;for(var s=0;s=this.blockSizeInBytes;){this.blockUnits=new Array(this.blockSizeInBytes);for(var e=0;e=this.blockSizeInBytes;){this.blockUnits=[];for(var e=0;e>24&255)+String.fromCharCode(this.state.hash[r]>>16&255)+String.fromCharCode(this.state.hash[r]>>8&255)+String.fromCharCode(255&this.state.hash[r]);return t}},{key:"addLengthBits",value:function(){this.state.message+="\0\0\0"+String.fromCharCode(this.state.length>>29&255)+String.fromCharCode(this.state.length>>21&255)+String.fromCharCode(this.state.length>>13&255)+String.fromCharCode(this.state.length>>5&255)+String.fromCharCode(this.state.length<<3&255)}}])}(Yt);const Nr=Or;function Lr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Lr=function(){return!!e})()}var Dr=[1518500249,1859775393,2400959708,3395469782],zr=function(e){function t(e){var n,i,a,o;return r(this,t),i=this,o=[e],a=u(a=t),(n=s(i,Lr()?Reflect.construct(a,o||[],u(i).constructor):a.apply(i,o))).options.rounds=n.options.rounds||80,n.W=new Array(80),n}return c(t,e),o(t,[{key:"reset",value:function(){var e,r,n;(e=t,r=this,"function"==typeof(n=Vt(u(1&3?e.prototype:e),"reset",r))?function(e){return n.apply(r,e)}:n)([]),this.state.hash=[1732584193,-271733879,-1732584194,271733878,-1009589776]}},{key:"processBlock",value:function(e){for(var t=0|this.state.hash[0],r=0|this.state.hash[1],n=0|this.state.hash[2],i=0|this.state.hash[3],a=0|this.state.hash[4],o=0;o>>3)+this.W[l-7]+(tr(this.W[l-2],17)^tr(this.W[l-2],19)^this.W[l-2]>>>10)|0;var c=u+(tr(a,6)^tr(a,11)^tr(a,25))+(a&o^~a&s)+Hr[l]+this.W[l]|0,f=(tr(t,2)^tr(t,13)^tr(t,22))+(t&r^t&n^r&n)|0;u=s,s=o,o=a,a=i+c|0,i=n,n=r,r=t,t=c+f|0}this.state.hash[0]=this.state.hash[0]+t|0,this.state.hash[1]=this.state.hash[1]+r|0,this.state.hash[2]=this.state.hash[2]+n|0,this.state.hash[3]=this.state.hash[3]+i|0,this.state.hash[4]=this.state.hash[4]+a|0,this.state.hash[5]=this.state.hash[5]+o|0,this.state.hash[6]=this.state.hash[6]+s|0,this.state.hash[7]=this.state.hash[7]+u|0}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<56?56-this.state.message.length|0:120-this.state.message.length|0),this.addLengthBits(),this.process(),this.getStateHash(this.options.length/32|0)}}])}(Nr);const Qr=qr;function Vr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Vr=function(){return!!e})()}var Yr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Kr=function(e){function t(e){var n,i,a,o;return r(this,t),(e=e||{}).length=e.length||512,e.rounds=e.rounds||160,i=this,o=[e],a=u(a=t),(n=s(i,Vr()?Reflect.construct(a,o||[],u(i).constructor):a.apply(i,o))).blockSize=32,n.blockSizeInBytes=n.blockSize*n.unitSize,n.W=new Array(160),n}return c(t,e),o(t,[{key:"reset",value:function(){var e,r,n;switch((e=t,r=this,"function"==typeof(n=Vt(u(1&3?e.prototype:e),"reset",r))?function(e){return n.apply(r,e)}:n)([]),this.options.length){case 384:this.state.hash=[-876896931,-1056596264,1654270250,914150663,-1856437926,812702999,355462360,-150054599,1731405415,-4191439,-1900787065,1750603025,-619958771,1694076839,1203062813,-1090891868];break;case 512:this.state.hash=[1779033703,-205731576,-1150833019,-2067093701,1013904242,-23791573,-1521486534,1595750129,1359893119,-1377402159,-1694144372,725511199,528734635,-79577749,1541459225,327033209];break;default:for(var i=new t,a=0;a<16;a++)i.state.hash[a]=2779096485^i.state.hash[a];i.update("SHA-512/"+this.options.length);var o=i.finalize();this.state.hash=[];for(var s=0;s<64;s+=4)this.state.hash.push(o.charCodeAt(s)<<24|o.charCodeAt(s+1)<<16|o.charCodeAt(s+2)<<8|o.charCodeAt(s+3))}}},{key:"processBlock",value:function(e){for(var t,r,n,i,a=this.state.hash[0],o=this.state.hash[1],s=this.state.hash[2],u=this.state.hash[3],l=this.state.hash[4],c=this.state.hash[5],f=this.state.hash[6],h=this.state.hash[7],d=this.state.hash[8],p=this.state.hash[9],m=this.state.hash[10],g=this.state.hash[11],b=this.state.hash[12],y=this.state.hash[13],_=this.state.hash[14],v=this.state.hash[15],w=0;w>>7,r=nr(this.W[w-30],this.W[w-29],1)^nr(this.W[w-30],this.W[w-29],8)^(this.W[w-29]>>>7|this.W[w-30]<<25),n=rr(this.W[w-4],this.W[w-3],19)^rr(this.W[w-4],this.W[w-3],61)^this.W[w-4]>>>6,i=nr(this.W[w-4],this.W[w-3],19)^nr(this.W[w-4],this.W[w-3],61)^(this.W[w-3]>>>6|this.W[w-4]<<26);var x=(65535&this.W[w-13])+(65535&this.W[w-31])+(65535&r)+(65535&i)|0,k=(this.W[w-13]>>>16)+(this.W[w-31]>>>16)+(r>>>16)+(i>>>16)+(x>>>16)|0,B=(65535&this.W[w-14])+(65535&this.W[w-32])+(65535&t)+(65535&n)+(k>>>16)|0,E=(this.W[w-14]>>>16)+(this.W[w-32]>>>16)+(t>>>16)+(n>>>16)+(B>>>16)|0;this.W[w]=4294967295&(E<<16|65535&B),this.W[w+1]=4294967295&(k<<16|65535&x)}t=rr(a,o,28)^rr(a,o,34)^rr(a,o,39),r=nr(a,o,28)^nr(a,o,34)^nr(a,o,39),n=rr(d,p,14)^rr(d,p,18)^rr(d,p,41);var S=p&g^~p&y,A=a&s^a&l^s&l,C=o&u^o&c^u&c,I=v+(i=nr(d,p,14)^nr(d,p,18)^nr(d,p,41))|0,P=_+n+(I>>>0>>0?1:0)|0;P=(P=P+(d&m^~d&b)+((I=I+S|0)>>>0>>0?1:0)|0)+Yr[w]+((I=I+Yr[w+1]|0)>>>0>>0?1:0)|0,I=I+this.W[w+1]|0;var T=r+C|0;_=b,v=y,b=m,y=g,m=d,g=p,d=f+(P=P+this.W[w]+(I>>>0>>0?1:0)|0)+((p=h+I|0)>>>0>>0?1:0)|0,f=l,h=c,l=s,c=u,s=a,u=o,a=P+(t+A+(T>>>0>>0?1:0)|0)+((o=I+T|0)>>>0>>0?1:0)|0}this.state.hash[1]=this.state.hash[1]+o|0,this.state.hash[0]=this.state.hash[0]+a+(this.state.hash[1]>>>0>>0?1:0)|0,this.state.hash[3]=this.state.hash[3]+u|0,this.state.hash[2]=this.state.hash[2]+s+(this.state.hash[3]>>>0>>0?1:0)|0,this.state.hash[5]=this.state.hash[5]+c|0,this.state.hash[4]=this.state.hash[4]+l+(this.state.hash[5]>>>0>>0?1:0)|0,this.state.hash[7]=this.state.hash[7]+h|0,this.state.hash[6]=this.state.hash[6]+f+(this.state.hash[7]>>>0>>0?1:0)|0,this.state.hash[9]=this.state.hash[9]+p|0,this.state.hash[8]=this.state.hash[8]+d+(this.state.hash[9]>>>0

>>0?1:0)|0,this.state.hash[11]=this.state.hash[11]+g|0,this.state.hash[10]=this.state.hash[10]+m+(this.state.hash[11]>>>0>>0?1:0)|0,this.state.hash[13]=this.state.hash[13]+y|0,this.state.hash[12]=this.state.hash[12]+b+(this.state.hash[13]>>>0>>0?1:0)|0,this.state.hash[15]=this.state.hash[15]+v|0,this.state.hash[14]=this.state.hash[14]+_+(this.state.hash[15]>>>0>>0?1:0)|0}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<112?112-this.state.message.length|0:240-this.state.message.length|0),this.state.message+="\0\0\0\0\0\0\0\0",this.addLengthBits(),this.process(),this.getStateHash(this.options.length/32|0)}}])}(Nr);const Xr=Kr;function Jr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Jr=function(){return!!e})()}var en=[10097,32533,76520,13586,34673,54876,80959,9117,39292,74945,37542,4805,64894,74296,24805,24037,20636,10402,822,91665,8422,68953,19645,9303,23209,2560,15953,34764,35080,33606,99019,2529,9376,70715,38311,31165,88676,74397,4436,27659,12807,99970,80157,36147,64032,36653,98951,16877,12171,76833,66065,74717,34072,76850,36697,36170,65813,39885,11199,29170,31060,10805,45571,82406,35303,42614,86799,7439,23403,9732,85269,77602,2051,65692,68665,74818,73053,85247,18623,88579,63573,32135,5325,47048,90553,57548,28468,28709,83491,25624,73796,45753,3529,64778,35808,34282,60935,20344,35273,88435,98520,17767,14905,68607,22109,40558,60970,93433,50500,73998,11805,5431,39808,27732,50725,68248,29405,24201,52775,67851,83452,99634,6288,98083,13746,70078,18475,40610,68711,77817,88685,40200,86507,58401,36766,67951,90364,76493,29609,11062,99594,67348,87517,64969,91826,8928,93785,61368,23478,34113,65481,17674,17468,50950,58047,76974,73039,57186,40218,16544,80124,35635,17727,8015,45318,22374,21115,78253,14385,53763,74350,99817,77402,77214,43236,210,45521,64237,96286,2655,69916,26803,66252,29148,36936,87203,76621,13990,94400,56418,9893,20505,14225,68514,46427,56788,96297,78822,54382,14598,91499,14523,68479,27686,46162,83554,94750,89923,37089,20048,80336,94598,26940,36858,70297,34135,53140,33340,42050,82341,44104,81949,85157,47954,32979,26575,57600,40881,22222,6413,12550,73742,11100,2040,12860,74697,96644,89439,28707,25815,63606,49329,16505,34484,40219,52563,43651,77082,7207,31790,61196,90446,26457,47774,51924,33729,65394,59593,42582,60527,15474,45266,95270,79953,59367,83848,82396,10118,33211,59466,94557,28573,67897,54387,54622,44431,91190,42592,92927,45973,42481,16213,97344,8721,16868,48767,3071,12059,25701,46670,23523,78317,73208,89837,68935,91416,26252,29663,5522,82562,4493,52494,75246,33824,45862,51025,61962,79335,65337,12472,549,97654,64051,88159,96119,63896,54692,82391,23287,29529,35963,15307,26898,9354,33351,35462,77974,50024,90103,39333,59808,8391,45427,26842,83609,49700,13021,24892,78565,20106,46058,85236,1390,92286,77281,44077,93910,83647,70617,42941,32179,597,87379,25241,5567,7007,86743,17157,85394,11838,69234,61406,20117,45204,15956,6e4,18743,92423,97118,96338,19565,41430,1758,75379,40419,21585,66674,36806,84962,85207,45155,14938,19476,7246,43667,94543,59047,90033,20826,69541,94864,31994,36168,10851,34888,81553,1540,35456,5014,51176,98086,24826,45240,28404,44999,8896,39094,73407,35441,31880,33185,16232,41941,50949,89435,48581,88695,41994,37548,73043,80951,406,96382,70774,20151,23387,25016,25298,94624,61171,79752,49140,71961,28296,69861,2591,74852,20539,387,59579,18633,32537,98145,6571,31010,24674,5455,61427,77938,91936,74029,43902,77557,32270,97790,17119,52527,58021,80814,51748,54178,45611,80993,37143,5335,12969,56127,19255,36040,90324,11664,49883,52079,84827,59381,71539,9973,33440,88461,23356,48324,77928,31249,64710,2295,36870,32307,57546,15020,9994,69074,94138,87637,91976,35584,4401,10518,21615,1848,76938,9188,20097,32825,39527,4220,86304,83389,87374,64278,58044,90045,85497,51981,50654,94938,81997,91870,76150,68476,64659,73189,50207,47677,26269,62290,64464,27124,67018,41361,82760,75768,76490,20971,87749,90429,12272,95375,5871,93823,43178,54016,44056,66281,31003,682,27398,20714,53295,7706,17813,8358,69910,78542,42785,13661,58873,4618,97553,31223,8420,28306,3264,81333,10591,40510,7893,32604,60475,94119,1840,53840,86233,81594,13628,51215,90290,28466,68795,77762,20791,91757,53741,61613,62269,50263,90212,55781,76514,83483,47055,89415,92694,397,58391,12607,17646,48949,72306,94541,37408,77513,3820,86864,29901,68414,82774,51908,13980,72893,55507,19502,37174,69979,20288,55210,29773,74287,75251,65344,67415,21818,59313,93278,81757,5686,73156,7082,85046,31853,38452,51474,66499,68107,23621,94049,91345,42836,9191,8007,45449,99559,68331,62535,24170,69777,12830,74819,78142,43860,72834,33713,48007,93584,72869,51926,64721,58303,29822,93174,93972,85274,86893,11303,22970,28834,34137,73515,90400,71148,43643,84133,89640,44035,52166,73852,70091,61222,60561,62327,18423,56732,16234,17395,96131,10123,91622,85496,57560,81604,18880,65138,56806,87648,85261,34313,65861,45875,21069,85644,47277,38001,2176,81719,11711,71602,92937,74219,64049,65584,49698,37402,96397,1304,77586,56271,10086,47324,62605,40030,37438,97125,40348,87083,31417,21815,39250,75237,62047,15501,29578,21826,41134,47143,34072,64638,85902,49139,6441,3856,54552,73135,42742,95719,9035,85794,74296,8789,88156,64691,19202,7638,77929,3061,18072,96207,44156,23821,99538,4713,66994,60528,83441,7954,19814,59175,20695,5533,52139,61212,6455,83596,35655,6958,92983,5128,9719,77433,53783,92301,50498,10850,62746,99599,10507,13499,6319,53075,71839,6410,19362,39820,98952,43622,63147,64421,80814,43800,9351,31024,73167,59580,6478,75569,78800,88835,54486,23768,6156,4111,8408,38508,7341,23793,48763,90822,97022,17719,4207,95954,49953,30692,70668,94688,16127,56196,80091,82067,63400,5462,69200,65443,95659,18288,27437,49632,24041,8337,65676,96299,90836,27267,50264,13192,72294,7477,44606,17985,48911,97341,30358,91307,6991,19072,24210,36699,53728,28825,35793,28976,66252,68434,94688,84473,13622,62126,98408,12843,82590,9815,93146,48908,15877,54745,24591,35700,4754,83824,52692,54130,55160,6913,45197,42672,78601,11883,9528,63011,98901,14974,40344,10455,16019,14210,33712,91342,37821,88325,80851,43667,70883,12883,97343,65027,61184,4285,1392,17974,15077,90712,26769,21778,30976,38807,36961,31649,42096,63281,2023,8816,47449,19523,59515,65122,59659,86283,68258,69572,13798,16435,91529,67245,52670,35583,16563,79246,86686,76463,34222,26655,90802,60584,47377,7500,37992,45134,26529,26760,83637,41326,44344,53853,41377,36066,94850,58838,73859,49364,73331,96240,43642,24637,38736,74384,89342,52623,7992,12369,18601,3742,83873,83080,12451,38992,22815,7759,51777,97377,27585,51972,37867,16444,24334,36151,99073,27493,70939,85130,32552,54846,54759,60790,18157,57178,65762,11161,78576,45819,52979,65130,4860,3991,10461,93716,16894,66083,24653,84609,58232,88618,19161,38555,95554,32886,59780,8355,60860,29735,47762,71299,23853,17546,73704,92052,46215,55121,29281,59076,7936,27954,58909,32643,52861,95819,6831,911,98936,76355,93779,80863,514,69572,68777,39510,35905,14060,40619,29549,69616,33564,60780,24122,66591,27699,6494,14845,46672,61958,77100,90899,75754,61196,30231,92962,61773,41839,55382,17267,70943,78038,70267,30532,21704,10274,12202,39685,23309,10061,68829,55986,66485,3788,97599,75867,20717,74416,53166,35208,33374,87539,8823,48228,63379,85783,47619,53152,67433,35663,52972,16818,60311,60365,94653,35075,33949,42614,29297,1918,28316,98953,73231,83799,42402,56623,34442,34994,41374,70071,14736,9958,18065,32960,7405,36409,83232,99385,41600,11133,7586,15917,6253,19322,53845,57620,52606,66497,68646,78138,66559,19640,99413,11220,94747,7399,37408,48509,23929,27482,45476,85244,35159,31751,57260,68980,5339,15470,48355,88651,22596,3152,19121,88492,99382,14454,4504,20094,98977,74843,93413,22109,78508,30934,47744,7481,83828,73788,6533,28597,20405,94205,20380,22888,48893,27499,98748,60530,45128,74022,84617,82037,10268,78212,16993,35902,91386,44372,15486,65741,14014,87481,37220,41849,84547,46850,52326,34677,58300,74910,64345,19325,81549,46352,33049,69248,93460,45305,7521,61318,31855,14413,70951,11087,96294,14013,31792,59747,67277,76503,34513,39663,77544,52701,8337,56303,87315,16520,69676,11654,99893,2181,68161,57275,36898,81304,48585,68652,27376,92852,55866,88448,3584,20857,73156,70284,24326,79375,95220,1159,63267,10622,48391,15633,84924,90415,93614,33521,26665,55823,47641,86225,31704,92694,48297,39904,2115,59589,49067,66821,41575,49767,4037,77613,19019,88152,80,20554,91409,96277,48257,50816,97616,38688,32486,45134,63545,59404,72059,43947,51680,43852,59693,25163,1889,70014,15021,41290,67312,71857,15957,68971,11403,65251,7629,37239,33295,5870,1119,92784,26340,18477,65622,36815,43625,18637,37509,82444,99005,4921,73701,14707,93997,64397,11692,5327,82162,20247,81759,45197,25332,83745,22567,4515,25624,95096,67946,48460,85558,15191,18782,16930,33361,83761,60873,43253,84145,60833,25983,1291,41349,20368,7126,14387,6345,80854,9279,43529,6318,38384,74761,41196,37480,51321,92246,80088,77074,88722,56736,66164,49431,66919,31678,72472,8,80890,18002,94813,31900,54155,83436,35352,54131,5466,55306,93128,18464,74457,90561,72848,11834,79982,68416,39528,72484,82474,25593,48545,35247,18619,13674,18611,19241,81616,18711,53342,44276,75122,11724,74627,73707,58319,15997,7586,16120,82641,22820,92904,13141,32392,19763,61199,67940,90767,4235,13574,17200,69902,63742,78464,22501,18627,90872,40188,28193,29593,88627,94972,11598,62095,36787,441,58997,34414,82157,86887,55087,19152,23,12302,80783,32624,68691,63439,75363,44989,16822,36024,867,76378,41605,65961,73488,67049,9070,93399,45547,94458,74284,5041,49807,20288,34060,79495,4146,52162,90286,54158,34243,46978,35482,59362,95938,91704,30552,4737,21031,75051,93029,47665,64382,99782,93478,94015,46874,32444,48277,59820,96163,64654,25843,41145,42820,74108,88222,88570,74015,25704,91035,1755,14750,48968,38603,62880,87873,95160,59221,22304,90314,72877,17334,39283,4149,11748,12102,80580,41867,17710,59621,6554,7850,73950,79552,17944,5600,60478,3343,25852,58905,57216,39618,49856,99326,66067,42792,95043,52680,46780,56487,9971,59481,37006,22186,54244,91030,45547,70818,59849,96169,61459,21647,87417,17198,30945,57589,31732,57260,47670,7654,46376,25366,94746,49580,69170,37403,86995,90307,94304,71803,26825,5511,12459,91314,8345,88975,35841,85771,8105,59987,87112,21476,14713,71181,27767,43584,85301,88977,29490,69714,73035,41207,74699,9310,13025,14338,54066,15243,47724,66733,47431,43905,31048,56699,80217,36292,98525,24335,24432,24896,43277,58874,11466,16082,10875,62004,90391,61105,57411,6368,53856,30743,8670,84741,54127,57326,26629,19087,24472,88779,30540,27886,61732,75454,60311,42824,37301,42678,45990,43242,17374,52003,70707,70214,49739,71484,92003,98086,76668,73209,59202,11973,2902,33250,78626,51594,16453,94614,39014,97066,83012,9832,25571,77628,66692,13986,99837,582,81232,44987,9504,96412,90193,79568,44071,28091,7362,97703,76447,42537,98524,97831,65704,9514,41468,85149,49554,17994,14924,39650,95294,556,70481,6905,94559,37559,49678,53119,70312,5682,66986,34099,74474,20740,41615,70360,64114,58660,90850,64618,80620,51790,11436,38072,50273,93113,41794,86861,24781,89683,55411,85667,77535,99892,41396,80504,90670,8289,40902,5069,95083,6783,28102,57816,25807,24260,71529,78920,72682,7385,90726,57166,98884,8583,6170,97965,88302,98041,21443,41808,68984,83620,89747,98882,60808,54444,74412,81105,1176,28838,36421,16489,18059,51061,80940,44893,10408,36222,80582,71944,92638,40333,67054,16067,19516,90120,46759,71643,13177,55292,21036,82808,77501,97427,49386,54480,23604,23554,21785,41101,91178,10174,29420,90438,6312,88940,15995,69321,47458,64809,98189,81851,29651,84215,60942,307,11897,92674,40405,68032,96717,54244,10701,41393,92329,98932,78284,46347,71209,92061,39448,93136,25722,8564,77936,63574,31384,51924,85561,29671,58137,17820,22751,36518,38101,77756,11657,13897,95889,57067,47648,13885,70669,93406,39641,69457,91339,22502,92613,89719,11947,56203,19324,20504,84054,40455,99396,63680,67667,60631,69181,96845,38525,11600,47468,3577,57649,63266,24700,71594,14004,23153,69249,5747,43321,31370,28977,23896,76479,68562,62342,7589,8899,5985,64281,61826,18555,64937,13173,33365,78851,16499,87064,13075,66847,70495,32350,2985,86716,38746,26313,77463,55387,72681,72461,33230,21529,53424,92581,2262,78438,66276,18396,73538,21032,91050,13058,16218,12470,56500,15292,76139,59526,52113,95362,67011,6651,16136,1016,857,55018,56374,35824,71708,49712,97380,10404,55452,34030,60726,75211,10271,36633,68424,58275,61764,97586,54716,50259,46345,87195,46092,26787,60939,89514,11788,68224,23417,73959,76145,30342,40277,11049,72049,15472,50669,48139,36732,46874,37088,73465,9819,58869,35220,12120,86124,51247,44302,60883,52109,21437,36786,49226,77837,19612,78430,11661,94770,77603,65669,86868,12665,30012,75989,39141,77400,28e3,64238,73258,71794,31340,26256,66453,37016,64756,80457,8747,12836,3469,50678,3274,43423,66677,82556,92901,51878,56441,22998,29718,38447,6453,25311,7565,53771,3551,90070,9483,94050,45938,18135,36908,43321,11073,51803,98884,66209,6830,53656,14663,56346,71430,4909,19818,5707,27369,86882,53473,7541,53633,70863,3748,12822,19360,49088,59066,75974,63335,20483,43514,37481,58278,26967,49325,43951,91647,93783,64169,49022,98588,9495,49829,59068,38831,4838,83605,92419,39542,7772,71568,75673,35185,89759,44901,74291,24895,88530,70774,35439,46758,70472,70207,92675,91623,61275,35720,26556,95596,20094,73750,85788,34264,1703,46833,65248,14141,53410,38649,6343,57256,61342,72709,75318,90379,37562,27416,75670,92176,72535,93119,56077,6886,18244,92344,31374,82071,7429,81007,47749,40744,56974,23336,88821,53841,10536,21445,82793,24831,93241,14199,76268,70883,68002,3829,17443,72513,76400,52225,92348,62308,98481,29744,33165,33141,61020,71479,45027,76160,57411,13780,13632,52308,77762,88874,33697,83210,51466,9088,50395,26743,5306,21706,70001,99439,80767,68749,95148,94897,78636,96750,9024,94538,91143,96693,61886,5184,75763,47075,88158,5313,53439,14908,8830,60096,21551,13651,62546,96892,25240,47511,58483,87342,78818,7855,39269,566,21220,292,24069,25072,29519,52548,54091,21282,21296,50958,17695,58072,68990,60329,95955,71586,63417,35947,67807,57621,64547,46850,37981,38527,9037,64756,3324,4986,83666,9282,25844,79139,78435,35428,43561,69799,63314,12991,93516,23394,94206,93432,37836,94919,26846,2555,74410,94915,48199,5280,37470,93622,4345,15092,19510,18094,16613,78234,50001,95491,97976,38306,32192,82639,54624,72434,92606,23191,74693,78521,104,18248,75583,90326,50785,54034,66251,35774,14692,96345,44579,85932,44053,75704,20840,86583,83944,52456,73766,77963,31151,32364,91691,47357,40338,23435,24065,8458,95366,7520,11294,23238,1748,41690,67328,54814,37777,10057,42332,38423,2309,70703,85736,46148,14258,29236,12152,5088,65825,2463,65533,21199,60555,33928,1817,7396,89215,30722,22102,15880,92261,17292,88190,61781,48898,92525,21283,88581,60098,71926,819,59144,224,30570,90194,18329,6999,26857,19238,64425,28108,16554,16016,42,83229,10333,36168,65617,94834,79782,23924,49440,30432,81077,31543,95216,64865,13658,51081,35337,74538,44553,64672,90960,41849,93865,44608,93176,34851,5249,29329,19715,94082,14738,86667,43708,66354,93692,25527,56463,99380,38793,85774,19056,13939,46062,27647,66146,63210,96296,33121,54196,34108,75814,85986,71171,15102,28992,63165,98380,36269,60014,7201,62448,46385,42175,88350,46182,49126,52567,64350,16315,53969,80395,81114,54358,64578,47269,15747,78498,90830,25955,99236,43286,91064,99969,95144,64424,77377,49553,24241,8150,89535,8703,91041,77323,81079,45127,93686,32151,7075,83155,10252,73100,88618,23891,87418,45417,20268,11314,50363,26860,27799,49416,83534,19187,8059,76677,2110,12364,71210,87052,50241,90785,97889,81399,58130,64439,5614,59467,58309,87834,57213,37510,33689,1259,62486,56320,46265,73452,17619,56421,40725,23439,41701,93223,41682,45026,47505,27635,56293,91700,4391,67317,89604,73020,69853,61517,51207,86040,2596,1655,9918,45161,222,54577,74821,47335,8582,52403,94255,26351,46527,68224,90183,85057,72310,34963,83462,49465,46581,61499,4844,94626,2963,41482,83879,44942,63915,94365,92560,12363,30246,2086,75036,88620,91088,67691,67762,34261,8769,91830,23313,18256,28850,37639,92748,57791,71328,37110,66538,39318,15626,44324,82827,8782,65960,58167,1305,83950,45424,72453,19444,68219,64733,94088,62006,89985,36936,61630,97966,76537,46467,30942,7479,67971,14558,22458,35148,1929,17165,12037,74558,16250,71750,55546,29693,94984,37782,41659,39098,23982,29899,71594,77979,54477,13764,17315,72893,32031,39608,75992,73445,1317,50525,87313,45191,30214,19769,90043,93478,58044,6949,31176,88370,50274,83987,45316,38551,79418,14322,91065,7841,36130,86602,10659,40859,964,71577,85447,61079,96910,72906,7361,84338,34114,52096,66715,51091,86219,81115,49625,48799,89485,24855,13684,68433,70595,70102,71712,88559,92476,32903,68009,58417,87962,11787,16644,72964,29776,63075,13270,84758,49560,10317,28778,23006,31036,84906,81488,17340,74154,42801,27917,89792,62604,62234,13124,76471,51667,37589,87147,24743,48023,6325,79794,35889,13255,4925,99004,70322,60832,76636,56907,56534,72615,46288,36788,93196,68656,66492,35933,52293,47953,95495,95304,50009,83464,28608,38074,74083,9337,7965,65047,36871,59015,21769,30398,44855,1020,80680,59328,8712,48190,45332,27284,31287,66011,9376,86379,74508,33579,77114,92955,23085,92824,3054,25242,16322,48498,9938,44420,13484,52319,58875,2012,88591,52500,95795,41800,95363,54142,17482,32705,60564,12505,40954,46174,64130,63026,96712,79883,39225,52653,69549,36693,59822,22684,31661,88298,15489,16030,42480,15372,38781,71995,77438,91161,10192,7839,62735,99218,25624,2547,27445,69187,55749,32322,15504,73298,51108,48717,92926,75705,89787,96114,99902,37749,96305,12829,70474,838,50385,91711,80370,56504,56857,80906,9018,76569,61072,48568,36491,22587,44363,39592,61546,90181,37348,41665,41339,62106,44203,6732,76111,79840,67999,32231,76869,58652,49983,1669,27464,79553,52855,25988,18087,38052,17529,13607,657,76173,43357,77334,24140,53860,2906,89863,44651,55715,26203,65933,51087,98234,40625,45545,63563,89148,82581,4110,66683,99001,9796,47349,65003,66524,81970,71262,14479,31300,8681,58068,44115,40064,77879,23965,69019,73985,19453,26225,97543,37044,7494,85778,35345,61115,92498,49737,64599,7158,82763,25072,38478,57782,75291,62155,52056,4786,11585,71251,25572,79771,93328,66927,54069,58752,26624,50463,77361,29991,96526,2820,91659,12818,96356,49499,1507,40223,9171,83642,21057,2677,9367,38097,16100,19355,6120,15378,56559,69167,30235,6767,66323,78294,14916,19124,88044,16673,66102,86018,29406,75415,22038,27056,26906,25867,14751,92380,30434,44114,6026,79553,55091,95385,41212,37882,46864,54717,97038,53805,64150,70915,63127,63695,41288,38192,72437,75075,18570,52065,8853,30104,79937,66913,53200,84570,78079,28970,53859,37632,80274,35240,32960,74859,7359,55176,3930,38984,35151,82576,82805,94031,12779,90879,24109,25367,77861,9541,85739,69023,64971,99321,7521,95909,43897,71724,92581,5471,64337,98949,3606,78236,78985,29212,57369,34857,67757,58019,58872,96526,28749,56592,37871,72905,70198,57319,54116,47014,18285,33692,72111,60958,96848,17893,40993,50445,14186,76877,87867,50335,9513,44346,26439,55293,6449,44301,63740,40158,72703,88321,85062,57345,66231,15409,3451,95261,43561,15673,28956,90303,62469,82517,43035,36850,15592,64098,59022,31752,4370,50486,11885,23085,41712,80692,48492,16495,99721,36912,28267,27882,16269,64483,11273,2680,1616,46138,54606,14761,5134,45144,63213,49666,27441,86989,29884,54334,6740,8368,80051,81020,17882,74973,74531,94994,24927,64894,22667,20466,82948,66831,47427,76033,31197,59817,20064,61135,28556,29695,80179,74058,18293,9963,35278,13062,83094,23373,90287,33477,48865,30348,70174,11468,25994,25343,22317,1587,30682,1,67814,59557,23362,13746,82244,42093,24671,79458,93730,45488,60234,67098,9899,25775,332,36636,57594,19958,85564,58977,12247,60774,66371,69442,20385,14486,91330,50332,46023,75768,59877,60081,92936,72302,75064,85727,52987,5750,19384,33684,78859,80458,69902,34870,88684,49762,40801,86291,18194,90366,82639,53844,96326,65728,48563,26027,52692,62406,76294,41848,63010,69841,29451,36170,21529,16525,64326,22086,24469,57407,96033,37771,31002,18311,93285,31948,14331,58335,15977,80336,81667,27286,24361,61638,57580,95270,46180,76990,53031,94366,2727,49944,19278,5756,51875,53445,33342,1965,7937,10054,97712,87693,58124,46064,39133,77385,9605,65359,70113,90563,86637,94282,12025,31926,24541,23854,58407,32131,92845,20714,27898,26917,50326,35145,50859,72119,95094,29441,42301,62460,75252,94267,38422,73047,24200,85349,72049,91723,97802,98496,12734,73432,10371,57213,53300,80847,46229,7099,72961,13767,65654,31102,82119,96946,65919,81083,3819,57888,57908,16849,77111,41429,92261,45263,1172,55926,78835,27697,48420,58865,41207,21406,8582,10785,36233,12237,7866,13706,92551,11021,63813,71512,65206,37768,94325,14721,20990,54235,71986,5345,56239,52028,1419,7215,55067,11669,21738,66605,69621,69827,8537,18638,60982,28151,98885,76431,25566,3085,23639,30849,63986,73287,26201,36174,14106,54102,57041,16141,64174,3591,90024,73332,31254,17288,59809,25061,51612,47951,16570,43330,79213,11354,55585,19646,99246,37564,32660,20632,21124,60597,69315,31312,57741,85108,21615,24365,27684,16124,33888,14966,35303,69921,15795,4020,67672,86816,63027,84470,45605,44887,26222,79888,58982,22466,98844,48353,60666,58256,31140,93507,69561,6256,88526,18655,865,75247,264,65957,98261,72706,36396,46065,85700,32121,99975,73627,78812,89638,86602,96758,65099,52777,46792,13790,55240,52002,10313,91933,71231,10053,78416,54563,96004,42215,30094,45958,48437,49591,50483,13422,69108,59952,27896,40450,79327,31962,46456,39260,51479,61882,48181,50691,64709,32902,10676,12083,35771,79656,56667,76783,3937,99859,10362,57411,40986,35045,2838,29255,64230,84418,34988,77644,39892,77327,74129,53444,35487,95803,38640,20383,55402,25793,14213,87082,42837,95030,97198,61608,97723,79390,35290,34683,81419,87133,70447,53127,97146,28299,56763,12868,1145,12147,58158,92124,60934,18414,97510,7056,54488,20719,53743,91037,44797,52110,8512,18991,20129,31441,51449,14661,71126,23180,68124,18807,70997,21913,19594,70355,73637,68266,60775,43164,52643,96363,77989,79332,39890,65379,20405,52935,43816,92740,95319,4538,60660,28982,15328,80475,34690,2293,19646,46524,96627,33159,42081,8816,74931,20674,8697,66169,46460,46326,39923,60625,28386,22919,19415,75766,43668,31626,70301,67053,3949,70082,2303,48642,38429,94053,38770,68137,68441,52928,70244,91954,17401,92693,98342,21451,84988,80487,33807,73797,49494,41878,76635,83227,76618,11946,13451,87591,78381,21407,90038,72638,69692,51599,86413,32019,64856,74730,41531,11064,1790,58817,86400,66213,92599,70905,78324,54326,43659,34206,63132,38837,40210,96346,16967,81619,96503,14881,89405,32205,49508,98425,2451,35423,56072,36810,30332,85998,49358,92748,84147,79835,94867,41224,61794,35066,82220,66684,20096,2754,41731,37068,32753,91059,13407,5607,69384,53329,95909,44968,11397,92973,50014,92997,80968,93761,57598,74703,7768,37978,73873,33475,9720,97852,98449,48722,84977,11271,11728,68318,22312,78792,87508,88466,72976,47099,84126,38595,85124,64405,90020,7492,52413,95111,34455,86311,68892,1074,60274,28136,19328,38161,57475,13771,63562,84207,94121,18901,52768,33801,82087,86091,59969,90398,56870,55756,78841,98450,54165,55106,50343,70519,14567,36780,55450,19606,83749,67562,64765,38543,16585,86841,73742,8766,39252,75678,75379,78760,37279,15280,13558,95916,89759,76686,76467,67147,63110,94008,8037,35263,53710,16667,79008,11231,29397,67136,18601,64502,90228,89109,72849,22711,65547,34542,26686,81678,87765,77654,23664,96352,14106,32938,28083,18633,80286,65507,46197,52722,75476,77816,47204,34876,45963,79262,90181,84041,3745,90041,30780,27226,92847,85572,15308,80688,5761,82638,13464,23683,81015,54214,64175,43701,86845,15569,50687,52679,87696,8285,97444,47599,94472,64150,87753,68652,60726,26213,17320,64553,81285,98126,12158,52095,64833,492,35817,55571,91300,97812,37507,4209,53515,64342,21223,16662,43265,68219,3529,43636,68417,53640,95326,93381,37113,80751,76469,96677,43054,22937,31954,13266,34140,27253,2734,99070,60077,57988,93211,92795,83795,57477,3941,39007,14619,38320,93449,31336,25279,97030,26245,47394,39475,90621,23820,29344,94859,91604,14033,41868,14816,4075,66644,87803,97815,99552,78666,3942,8175,22345,19983,76783,99044,20851,84981,59052,77178,72109,76475,21619,73017,6812,56633,50612,55289,4671,84419,94072,94446,80603,32188,93415,23464,43947,43728,74284,67177,57105,31059,10642,13803,69602,46961,66567,19359,84676,63918,40650,12923,15974,79732,20225,92525,71179,4859,91208,60430,5239,61458,24089,68852,60171,29603,42535,86365,93905,28237,45317,60718,82001,41679,20679,56304,70043,87568,21386,59049,78353,48696,77379,55309,23780,28391,5940,55583,81256,59418,97521,32846,70761,90115,45325,5490,65974,11186,15357,3568,450,96644,58976,36211,88240,92457,89200,94696,11370,91157,48487,59501,56983,89795,42789,69758,79701,29511,55968,41472,89474,84344,80517,7485,97523,17264,82840,59556,37119,30985,48866,60605,95719,70417,59083,95137,76538,44155,67286,57897,28262,4052,919,86207,79932,44236,10089,44373,65670,44285,6903,20834,49701,95735,21149,3425,17594,31427,14262,32252,68540,39427,44026,47257,45055,95091,8367,28381,57375,41562,83883,27715,10122,67745,46497,28626,87297,36568,39483,11385,63292,92305,78683,6146,81905,15038,38338,51206,65749,34119,71516,74068,51094,6665,91884,66762,11428,70908,21506,480,94183,78484,66507,75901,25728,52539,86806,69944,65036,27882,2530,4918,74351,65737,89178,8791,39342,94963,22581,56917,17541,83578,75376,65202,30935,79270,91986,99286,45236,44720,81915,70881,45886,43213,49789,97081,16075,20517,69980,25310,91953,1759,67635,88933,54558,18395,73375,62251,58871,9870,70538,48936,7757,90374,56631,88862,30487,38794,36079,32712,11130,55451,25137,38785,83558,31960,69473,45950,18225,9871,88502,75179,11551,75664,74321,67351,27703,83717,18913,42470,8816,37627,14288,62831,44047,67612,72738,26995,50933,63758,50003,43693,52661,55852,52372,59042,37595,4931,73622,68387,86478,40997,5245,75300,24902,59609,35653,15970,37681,69365,22236,86374,65550,343,98377,35354,65770,15365,41422,71356,16630,40044,19290,66449,53629,79452,71674,30260,97303,6487,62789,13005,70152,22501,49867,89294,59232,31776,54919,99851,5438,1096,72269,50486,16719,6144,82041,38332,64452,31840,99287,59928,25503,8407,46970,45907,99238,74547,19704,72035,26542,54600,79172,58779,35747,78956,11478,41195,58135,63856,33037,45753,60159,25193,71838,7526,7985,60714,88627,75790,38454,96110,39237,19792,34534,70169,24805,63215,38175,38784,38855,24826,50917,25147,17082,26997,32295,10894,21805,65245,85407,37926,69214,38579,84721,23544,88548,65626,75517,69737,55626,52175,21697,19453,16908,82841,24060,40285,19195,80281,89322,15232,70043,60691,86370,91949,19017,83846,77869,14321,95102,87073,71467,31305,64677,80358,52629,79419,22359,87867,48296,50141,46807,82184,95812,84665,74511,59914,4146,90417,58508,62875,17630,21868,9199,30322,33352,43374,25473,4119,63086,14147,14863,38020,44757,98628,57916,22199,11865,42911,62651,78290,9392,77294,63168,21043,17409,13786,27475,75979,89668,43596,74316,84489,54941,95992,45445,41059,55142,15214,42903,16799,88254,95984,48575,77822,21067,57238,35352,96779,89564,23797,99937,46379,27119,16060,30302,95327,12849,38111,97090,7598,78473,63079,18570,72803,70040,91385,96436,96263,17368,56188,85999,50026,36050,73736,13351,48321,28357,51718,65636,72903,21584,21060,39829,15564,4716,14594,22363,97639,65937,17802,31535,42767,98761,30987,57657,33398,63053,25926,20944,19306,81727,2695,97479,79172,72764,66446,78864,12698,15812,97209,38827,91016,91281,57875,45228,49211,69755,99224,43999,62879,8879,80015,74396,57146,64665,31159,6980,79069,37409,75037,69977,85919,42826,6974,61063,97640,13433,92528,91311,8440,38840,22362,93929,1836,36590,75052,89475,15437,65648,99012,70236,12307,83585,414,62851,48787,28447,21702,57033,29633,44760,34165,27548,37516,24343,63046,2081,20378,19510,42226,97134,68739,32982,56455,53129,77693,25022,55534,99375,30086,98001,7432,67126,76656,29347,28492,43108,64736,32278,84816,80440,30461,818,9136,1952,48442,91058,92590,10443,5195,34009,32141,62209,43740,54102,76895,98172,31583,4155,66492,58981,16591,11331,6838,3818,77063,12523,45570,68970,70055,77751,73743,71732,4704,61384,57343,66682,44500,89745,10436,67202,36455,42467,88801,91280,1056,27534,81619,79004,25824,66362,33280,20706,31929,57422,18730,96197,22101,47592,2180,18287,82310,60430,59627,26471,7794,60475,76713,45427,89654,14370,81674,41246,98416,8669,48883,77154,9806,94015,60347,20027,8405,33150,27368,53375,70171,59431,14534,34018,85665,77797,17944,49602,74391,48830,55029,10371,94261,16658,68400,44148,28150,40364,90913,73151,64463,50058,78191,84439,82478,62398,3113,17578,12830,6571,95934,9132,25287,78731,80683,67207,76597,42096,34934,76609,52553,47508,71561,8038,83011,72577,95790,40076,20292,32138,61197,95476,23123,26648,13611,48452,39963,85857,4855,27029,1542,72443,53688,82635,56264,7977,23090,93553,65434,12124,91087,87800,95675,99419,44659,30382,55263,82514,86800,16781,65977,65946,13033,93895,4056,75895,47878,91309,51233,81409,46773,69135,56906,84493,34530,84534,38312,54574,92933,77341,20839,36126,1143,35356,35459,7959,98335,53266,36146,78047,50607,22486,63308,8996,96056,39085,26567,6779,62663,30523,47881,41279,49864,82248,78333,29466,48151,41957,93235,53308,22682,90722,54478,7235,34306,15827,20121,96837,6283,80172,66109,92592,48238,76428,94546,45430,16288,74839,740,25553,83767,35900,5998,7493,46755,11449,88824,44906,33143,7454,56652,34755,63992,59674,65131,46358,12799,96988,51158,73176,1184,49925,63519,11785,29073,72850,47997,75172,55187,15313,40725,33225,56643,10465,38583,86440,97967,26401,17078,38765,33454,19136,57712,48446,98790,27315,71074,10157,57946,35582,49383,61324,26572,84503,3496,60449,17962,26017,65651,40400,83246,80056,75306,75147,41863,25581,87530,33193,43294,5065,99644,62771,75986,79005,44924,18703,40889,4403,5862,2571,82500,74200,36170,46836,74642,65471,26815,30937,64946,10160,15544,31962,54015,28853,66533,14573,79398,47391,73165,47805,77589,16881,13423,89452,76992,62509,9796,57540,13486,48855,25546,47589,21012,47388,78428,70196,84413,81026,87597,22445,83769,85937,38321,85485,87359,9839,67228,71179,94372,4446,62801,50775,96179,40646,44272,12417,47199,39701,30665,32775,66525,53558,78882,31939,67209,38906,34533,99914,27719,216,99225,96537,3843,90564,91110,51838,30300,9559,37795,94880,11325,44979,89696,28129,29931,89971,46292,92710,11036,74760,75307,12291,49618,16293,92408,67928,80823,32872,25460,66819,35374,4035,99087,61129,11341,39118,10891,37217,63638,75477,30068,42334,57570,6890,59353,89939,37692,15232,20033,32202,22348,2766,96791,58448,92248,5769,96684,67885,99295,47271,38655,59513,96960,31718,8974,16122,20535,52380,29769,70660,57425,50891,75044,84257,73315,38181,28673,93140,26307,82265,78382,19681,56585,8975,76764,39956,83450,84663,89963,71584,57696,30829,60527,64947,34899,28805,28397,91830,51842,99838,39839,66971,67177,74219,35637,35634,93581,81746,29991,81096,94279,2968,62561,2479,82126,25702,67953,88088,50293,83423,86206,39935,23253,43041,48941,85787,8388,6671,43574,84908,67295,33623,55060,28174,48415,2529,22009,24524,5283,30460,32399,80423,56929,40852,69969,88541,5979,91496,64730,57198,83145,39750,3568,54669,98679,4297,51047,31492,47734,31343,31180,232,19707,24823,75079,73943,17997,8446,91252,39879,58682,82972,18417,39203,36681,42895,8459,15618,17941,52594,43277,16530,40052,91100,87422,47230,95699,49794,50492,87439,86354,4546,65333,11057,77727,19748,38722,91821,18107,42125,89239,28847,54623,38783,47803,31414,38450,3697,89186,30579,44188,26532,8420,80723,48100,60748,76330,45832,8311,16051,4475,13400,48527,46073,17439,56498,94632,9021,16871,83366,14896,4219,38375,87890,90217,42370,61028,85101,76771,83715,94737,69973,74187,1958,59691,86712,86570,60984,76342,13648,85250,28323,48379,45141,36277,51845,29039,3553,5128,59866,51281,68124,17007,24729,29710,41439,40574,11774,86746,89698,56020,37810,88972,11361,95583,70786,589,74473,87513,17690,61427,72914,32517,1804,97910,6327,30246,33049,2622,41026,80875,41293,16752,84225,84414,37137,68956,8095,64981,28180,38629,76962,23840,17477,75268,48297,70340,57888,13938,38554,86836,2195,30270,55484,53364,54705,41380,56316,37723,234,21424,26664,63804,75139,36534,18579,9833,98849,72762,59767,52497,24227,83152,71794,21398,99456,89215,51632,54799,27973,68568,68465,98500,28681,18369,24279,96335,12874,82160,67202,85199,27908,67022,49810,77929,96212,81153,77884,7032,1671,53362,28119,56786,30883,28540,76029,3774,64611,19736,25589,46569,45206,48215,69523,17423,91807,90039,30393,58319,85098,66519,57571,24541,3562,14400,62731,82534,61477,89731,18421,29861,52829,838,78040,43350,74323,82892,84746,28302,13264,7595,134,12933,46831,24864,47275,20527,9110,28485,30326,99826,64005,99308,65779,42760,90066,3974,38688,39968,32604,11694,46262,73262,45405,43923,67397,88228,56405,17839,92073,57622,93328,15442,50186,7570,58001,31e3,8915,11467,14793,82691,51238,12485,51745,18192,5985,36826,89434,38669,91592,88799,65621,67237,59541,19657,93402,58705,73553,78280,69125,95591,81168,91927,25976,89077,71690,19404,64603,59752,74698,44233,67602,38615,31303,28650,53700,89819,7783,4351,77451,47350,21234,16016,41532,76508,23063,44993,43983,33356,61715,96485,22121,78004,6316,87896,99289,93981,37850,66128,92735,45064,50924,24204,58816,65290,34392,55567,66416,72353,45775,68590,85685,72683,60090,37149,85347,57414,72336,12979,5720,92754,76911,96883,74420,5220,85815,23557,80567,44365,70254,50864,36619,51479,23281,76428,18580,34240,59289,49076,18439,29522,42541,4024,84446,92434,90407,77241,19690,78143,65919,13699,91844,91241,38361,67171,90551,5709,3474,76025,97043,33834,44638,54040,82797,545,38159,16089,35870,89158,55864,98078,50563,36492,10994,85909,9018,19252,73887,67928,60045,70782,11937,4074,53814,46621,52577,94853,45968,73667,65062,73306,76045,78649,91654,53958,96537,95542,67622,54579,17279,67440,56441,20681,64011,52226,96618,32831,60664,67547,39523,2043,59748,1887,69229,94653,99271,98164,62155,9234,47367,13047,6364,35064,10073,6793,80248,29009,44969,11129,17139,79630,89772,26921,56949,23465,30036,17173,82459,96218,60768,76417,24405,18710,68887,82394,69729,82503,40873,41590,67255,30757,9657,91881,34578,9511,5417,58953,18532,10721,22029,48524,47778,881,83489,3464,57462,97459,86689,39755,39547,740,36666,7993,31671,86304,12970,73402,52849,31652,79655,11250,18463,57518,20306,25301,1374,51208,33298,87662,61849,60923,68685,69411,39266,80320,34844,89416,81569,83651,35795,40168,33501,1042,58931,3892,85188,74740,85476,23790,33842,89565,53359,25579,59049,62394,72435,12457,21904,18370,97035,57905,9581,91227,92754,37760,1411,7440,87175,88318,63242,85960,56690,12618,30493,11569,73723,7448,58830,157,65814,21118,22140,73793,57855,81830,6795,13183,12625,30635,56429,73216,12342,36722,83886,96828,82870,90954,97614,2370,42160,73370,11944,49067,59452,80495,43911,46712,17033,68037,41963,3874,44856,82985,57453,84358,16120,4454,76624,405,62369,55080,61880,51270,87807,10653,36894,70850,35660,234,14705,93418,94084,82856,25384,71555,56754,78315,18291,91656,98079,52384,43306,65205,75903,58701,99496,50048,33557,87793,90857,10143,46726,84284,43635,41213,83845,70986,91408,80220,5728,68890,46577,21152,43759,43301,93661,97252,50106,10099,13722,18572,44024,351,18173,23717,85114,85998,57782,63951,53723,86853,63851,79430,49181,46386,69666,55743,76162,71724,40028,94786,34457,16906,90040,30789,40281,94697,96584,81907,4055,53990,66397,80579,42517,78181,39251,9467,67097,95523,66568,63632,71048,15581,39904,75774,77495,75994,29911,65690,41178,47712,70355,16998,56025,5230,10093,71495,34784,70950,54680,57811,53782,39145,36829,85342,40406,35883,45668,3459,29870,78252,70088,70621,67153,5737,40933,91075,93335,86853,15860,81167,91259,16118,52401,83593,84474,2423,75608,39646,90871,70284,82100,96032,5115,63678,2225,88087,58581,44364,57468,21539,13042,64150,63754,5210,87644,54114,64013,63562,41388,32397,74152,23982,71982,71700,33026,66477,47838,46712,39848,35083,65927,97868,11067,76771,71799,43836,41014,97025,93225,8511,63096,26628,73012,12543,76269,99708,2629,49845,73677,19193,14924,57236,95564,15010,59667,73773,78515,2624,99744,13585,33746,58771,94785,62628,99585,11363,80832,59979,9444,78700,2596,85984,69438,16913,96475,93283,18625,77086,45911,39746,64722,39938,43930,54619,302,50384,2738,75714,75249,95439,80714,52555,47266,96190,78750,94973,83669,16479,53163,48071,28e3,45011,26733,67132,83362,84162,43028,8415,27236,52651,89059,64844,80910,1676,91752,57815,26264,3415,57532,29981,61200,96036,62600,20068,56530,38487,8432,89514,26883,69165,97237,22361,55276,39902,95927,82190,49269,27212,46095,37106,64254,27460,49572,51700,27679,12574,33891,3867,9925,6476,82018,45094,59014,67113,44192,75,23318,79895,70550,81717,28833,30271,15821,14999,88174,62617,57517,55256,50281,51583,96879,5225,42272,5339,20483,57596,41011,75937,22767,50120,95938,49753,63882,99616,69083,38721,73889,80236,99531,23053,71237,48861,59046,76283,60538,19732,93877,30345,64882,66660,17026,70364,45676,8039,96228,89936,59141,95585,89552,97247,59325,27848,80058,15950,61481,90906,40998,44137,16144,66300,44091,50018,81364,18211,60294,76559,20279,27414,10589,39860,23e3,31767,95618,56738,50332,16936,70342,92481,30702,76264,62619,68678,62284,83112,93032,55203,52614,36950,41796,45403,79262,2887,53596,61308,20738,34811,27099,90956,65448,3080,75795,29753,97699,80872,23830,85882,74427,99523,74904,28017,45898,57232,48525,7086,26805,74533,92470,18840,76011,93109,14344,55614,50284,15865,19458,35856,13464,53679,64603,51571,56124,79107,29596,89572,78198,57121,73649,8804,87977,87959,70859,40909,77295,87877,75158,62810,92074,23244,59516,50552,31602,41899,6347,27821,68370,48596,88577,30231,25267,84622,31449,12086,56461,22962,78213,62483,93966,60437,52239,58113,32526,38708,81607,57016,1695,90110,4649,59990,23979,3855,10297,46516,96092,82305,30760,78756,4967,82876,4773,86651,16648,53133,82439,78851,49766,24553,15273,36417,1901,33386,76979,25920,33372,2695,11982,40911,6230,91696,43907,17827,30332,89203,32215,91806,23080,49102,9174,11548,54590,75803,66108,73882,62324,26017,72716,33887,1285,31604,71039,24337,53514,58964,89901,22040,92751,12617,37007,5523,61672,62557,98540,26094,60284,19621,96230,38044,6545,9458,42988,2913,86345,67936,90174,40840,44991,24256,34989,74086,13652,68706,1363,4294,88008,78693,83068,94746,221,89299,53186,5930,61889,51341,45412,58860,72568,11381,59785,36887,10690,31347,93326,96267,86987,57565,86836,49071,90331,41248,34629,30240,27270,3864,84308,3035,61369,36902,51017,44409,17120,23823,36460,63359,8333,63173,19134,6493,303,18550,26191,19051,81502,66343,6737,90430,65478,58982,82484,16483,47704,44640,68322,44548,72787,2335,28749,39320,5436,98146,56596,812,51445,35533,35478,47573,38414,25542,38032,13442,42983,97207,77854,57806,81616,52828,79429,47389,96795,57764,19605,24767,63253,18809,65093,44449,22952,76872,30983,38948,9310,48336,87651,27110,84427,76209,56412,12760,16747,14551,82626,31224,98636,75100,84882,79479,83420,5347,6803,90063,4617,40257,79183,41766,71873,25242,12275,336,40798,42055,74066,69128,32547,76508,32530,42359,89207,49758,58984,92732,15779,7234,28884,28226,50011,35883,99606,45423,76224,75427,85747,33879,97978,57441,927,19164,74716,40702,19715,70917,60344,40236,9019,50577,15598,53136,57285,20536,7539,74832,89184,41501,39447,97422,97041,21913,40581,76081,13089,28776,54164,55736,36263,71841,34488,74988,55467,43322,9214,36746,67981,71877,81683,32461,84091,19422,88366,62054,85664,13409,8003,88276,6989,16607,33633,85349,5784,25950,97998,74110,16699,60184,92818,79705,10381,1474,18656,50434,18232,92132,66537,70141,42854,25120,39581,28249,14215,34810,19767,3409,11807,6566,66138,42997,41999,67504,87117,28961,5e3,29673,77726,73225,54753,69712,71576,92337,17713,63185,87923,91889,68351,17712,75532,93849,48280,62219,317,25290,29209,90927,92929,92762,60413,2018,31793,76290,73373,80777,60819,77375,57886,47291,99670,32605,29064,99476,80999,31217,35,91300,14892,73653,26593,25305,56797,12837,39560,27582,37253,38531,76489,49946,69108,58687,43092,73807,96282,6648,67431,87124,57694,21660,64002,6,33600,30245,60636,80164,9285,61426,4658,54130,14710,76553,1904,93668,63110,98618,5601,32199,74923,98049,49717,55539,35940,58545,43295,35810,45451,38735,42065,66769,69825,45461,83881,67372,67351,90612,79502,69460,23108,74421,82990,46821,40683,71603,55267,48192,50242,79738,96417,6664,19929,23644,41116,51056,219,45086,32747,49492,15399,24874,80825,95928,61457,45813,59037,16136,3953,83583,5910,12654,53630,92997,22168,93491,71897,74579,24022,6278,24049,71670,43044,8474,38572,77402,35800,7455,96177,41653,74493,20802,65843,73050,73349,2638,65813,96209,49196,45007,32207,14097,66059,46681,7534,71263,20582,10171,51514,52142,60961,57951,25637,37860,21683,86190,90434,94481,85697,95344,2606,74095,61133,7472,64777,94050,41482,975,23471,76052,82021,87676,91345,20196,2612,86299,44996,40312,65712,46079,88514,8610,3685,63197,9073,53105,86824,28112,99306,40706,66840,83003,51590,52755,32285,68454,85058,13645,23073,24724,52989,71880,21952,44144,74975,76715,7844,46447,86643,75579,29276,10864,83179,36721,19300,35066,29383,47478,56644,33354,31414,17643,92374,85085,88458,87191,85248,34963,76278,53230,13953,76985,70959,36663,5293,32658,56767,56997,76736,6558,64248,11907,29123,78458,17678,63805,89973,5076,39263,54404,4355,64957,74407,99838,18836,78098,6490,74888,73719,80675,86178,56283,33591,96957,38382,18772,74773,71229,2603,52673,44609,14843,58418,18060,95459,626,30914,13550,42195,44863,8871,89182,64446,78422,41140,15312,98274,48168,95651,35562,85386,56252,72136,85088,68761,78434,98143,61330,2446,64409,49406,99127,98626,55095,44808,13594,87370,89472,12833,98932,68064,58193,20225,5192,28425,23978,24542,80845,55858,4015,21454,37346,51007,17202,10242,12682,55933,96922,22280,75597,50227,70712,44236,20470,36320,49339,60536,80083,38880,93327,49522,93585,9918,55268,4671,57526,11457,48424,54610,7211,78610,9473,72923,27347,30057,76968,26177,59367,46172,88951,40229,34921,60405,88959,16779,29547,92231,61997,36002,21080,39795,77221,10012,49748,76900,15964,3803,40260,92351,92844,10288,57483,10881,70408,75688,16610,1638,93082,44282,66849,75702,69428,34047,84968,71281,72328,73143,88672,49802,50639,18129,93659,58389,49095,45971,34196,84609,59222,19332,17777,41004,47057,30688,16039,20906,41477,42915,60877,33864,75195,62294,3371,11672,1370,2486,35553,17907,90621,45136,9722,67635,12114,63055,16004,21625,24321,20491,26881,66259,94287,54751,36242,36557,5842,30687,65418,94608,24741,45887,78800,86912,42076,50287,9284,68891,76368,83094,96302,35997,30761,97081,9501,68887,32876,1705,34260,95065,45528,88241,30402,12318,52430,40139,96986,84900,72408,42027,31676,54382,73370,26184,14024,57444,57660,52173,30274,93448,63273,77681,74946,2099,69091,19372,66961,14595,58642,75760,52253,53148,26074,52293,65359,63971,4833,86492,1227,54505,19515,89889,46933,13364,33883,83389,36952,52505,67513,40071,31001,3105,87912,29610,75108,37363,28479,43546,89992,19550,54863,82633,19209,21548,35022,21960,57961,11815,95867,559,26428,69386,57453,70147,73538,49562,46806,64550,36653,25718,68792,31113,7607,48037,71020,22666,65957,11141,39227,7990,19849,65972,74528,40888,55386,95918,92088,91125,53648,66122,138,79933,71058,34826,97725,69513,22915,18246,52244,91161,40861,40374,13239,56162,4703,95851,22824,41271,28202,62852,84238,46625,20031,8524,20077,65817,21174,29279,57712,22401,67500,30980,74485,26480,21343,30031,61921,35744,57308,71196,1865,49234,62616,54021,29008,83672,85839,96836,45077,80900,66906,63526,93824,71820,11033,20183,85704,4683,63512,39144,56880,64424,95979,17709,94849,31771,5737,84286,16757,46256,24478,73180,59978,8254,78963,95437,86351,33824,32540,18357,2668,99260,21284,81351,70961,10255,6911,47394,72408,23827,59865,96395,30665,43699,3593,29165,23388,26628,92402,16731,86740,29493,9069,78653,90094,42735,33682,95041,89887,92369,57949,81585,50593,14698,4737,72551,57271,59433,156,33966,58773,59108,49578,18100,59836,73221,21110,1650,11058,47770,66141,84576,58388,40915,94507,32209,17272,65674,95552,25685,5345,36995,36302,7971,67001,62062,75939,36005,26739,56484,46885,66348,87666,78055,44485,82955,85936,9219,1847,92687,72579,45457,78252,98239,4e4,75563,92408,17175,78845,32638,26959,35406,59553,57852,7506,9,93172,77713,93880,40981,27924,9678,24538,52426,84852,83781,23712,82490,77890,22482,66668,55850,25644,44972,62275,78089,28894,98685,32998,98766,89119,34355,75127,69797,71419,62067,57990,96514,50603,79807,26135,29207,43632,32905,38513,18924,88872,20758,70232,60425,1116,24077,21369,93541,75329,78656,44251,42014,98154,42552,14575,30765,348,1134,71581,68420,78141,21105,63305,9718,54851,65867,8595,47390,39182,51174,41478,64433,59628,31945,87322,78667,95282,5622,26224,19972,97269,98376,14779,51138,49658,45345,4972,52794,15737,496,48939,63485,42780,16061,59631,37171,13483,56058,51093,62290,88227,17400,88433,67363,89507,26482,85964,71336,67799,28342,37747,61722,27180,78755,18603,42953,6606,23875,56766,1932,36113,62807,84012,21103,9685,69662,76755,13701,95168,13169,44726,15284,16702,89617,54397,52052,12835,37741,86434,22400,37947,95763,86337,35189,22756,47473,16618,42479,47405,14055,64262,66670,89692,54032,94591,44149,29854,76691,33263,62048,25116,88598,16119,62116,54517,31883,86707,18895,81790,71294,2684,15292,48107,14341,91416,75609,92564,39987,2283,89970,95855,80970,5432,89860,90293,99851,94648,5598,32171,28793,92305,64244,8277,93391,96717,34464,29838,10664,28050,60122,77934,10758,84922,92220,45071,97697,36368,17792,84792,76594,67319,51886,5665,45201,11348,9254,7510,51039,91683,84500,85338,5555,19633,3870,39576,41486,58524,54508,20707,58504,39642,22454,80069,83455,31043,90794,51934,3295,26582,16300,74990,22197,83310,69642,81113,58558,84833,17105,46659,25003,85749,44829,4103,67516,76458,52392,53546,70291,98846,67315,30686,18555,29755,5923,22732,19501,56181,85351,5023,4808,56911,16793,75336,49712,27723,96974,34321,5454,12862,71924,45928,95697,68664,58183,78104,42483,71204,99628,40642,56410,17350,13396,76724,87509,9158,83708,27298,92651,95086,38851,63558,89810,1580,32518,35795,26514,56322,78635,63731,91428,7247,66460,38671,26799,22549,47991,46064,80467,40083,17141,39152,99872,27561,75389,74778,94893,82935,99076,93419,10474,84436,47536,16719,60136,80566,28404,74525,74212,3704,65516,98197,34210,64140,22238,49939,99542,27481,21992,78181,90060,71365,66935,29578,14961,8569,9454,43308,66753,45972,93572,16382,87320,37183,25478,38164,31997,69856,60898,63968,62264,4799,17591,89937,73905,55890,88285,2448,40398,54180,65869,45155,43407,39105,339,51619,20203,21189,68245,76912,1222,76411,82679,7,66047,32043,42627,16638,27019,15248,66444,8249,18790,82150,54084,84469,3426,50226,99868,88894,43769,66384,8593,41414,2976,60053,51866,87904,74135,53842,59520,67482,16995,32328,29555,49067,2799,68851,41049,97190,53984,99755,46412,45885,64e3,21962,36438,71742,57223,66599,86071,31436,32667,98099,38399,47377,5171,2742,48803,17823,22093,9866,691,5514,25546,2114,5919,56181,96052,67211,61712,25995,3188,23833,38549,44775,55355,61548,55988,47309,23749,30667,70732,33299,16127,30842,78961,41072,9876,18903,30292,25275,61881,15939,72573,84502,92654,97226,53434,77025,63892,12421,33644,39445,30933,84218,13757,37719,84450,2697,60309,22402,80310,92771,45205,72792,95776,85945,74651,216,50842,47854,21916,61588,75405,10495,83083,60427,78495,99809,47890,22993,21508,9459,26845,98130,1184,46438,27698,40652,65654,98517,1096,6998,49133,57041,77983,58708,42176,67356,324,70063,10597,65205,25622,34336,16640,27896,26907,86760,48244,89650,44997,51609,28934,9171,97859,97213,19859,41037,64081,94781,27683,41521,52871,86935,26486,38744,25943,60617,6414,42292,46204,53262,30201,38776,88831,97253,67282,72860,18452,60927,81504,57713,30296,10896,39900,67135,42772,4631,55283,39253,25264,1809,12874,88035,88421,90491,83290,6884,15444,90113,20406,20796,40239,34431,15018,45600,17241,26611,9551,89126,65673,31708,91252,39647,63011,24193,58932,89326,33491,53217,27976,70151,37531,53576,23931,11789,73073,52171,89301,51718,15385,79487,66436,35771,34163,86540,42665,80748,77622,14679,40185,25030,42622,13162,17048,24243,59985,59807,60562,3595,10135,29199,69784,59796,38194,58432,50943,40422,63035,3208,81440,90749,88046,32218,88092,22224,2627,91576,16781,43948,57795,71073,27817,87077,82717,24473,42096,76920,88864,90537,14715,42551,45066,24316,37361,38582,21871,14672,93362,21727,57021,94313,39562,64985,94028,46094,43845,91838,79574,7597,3153,56783,18817,74711,6883,91061,31674,73729,99315,66183,57647,74484,68077,33224,397,56753,53158,71872,68153,9298,20961,49656,33407,95683,14328,44708,72952,27048,67887,28741,46752,88177,95894,40086,88534,87112,68614,83073,88794,96799,67588,75049,84603,83140,97347,87316,73087,77135,71883,98643,3808,8848,14133,60447,1366,72976,1868,51667,63279,60040,88264,79152,3474,61366,20523,21584,93712,83654,89761,90154,96345,37539,32556,74254,70603,97122,44978,78028,8943,13778,11080,34271,68276,85372,48410,94516,15427,75323,71685,70774,50342,33771,3678,42321,69788,41758,55004,30992,17402,63523,42328,87171,24751,15084,33884,83655,88345,69602,52606,57886,18034,3381,75796,35901,77480,28683,68324,66035,7223,14926,16128,13645,90370,31949,11057,98849,29499,21565,30786,83292,92392,37104,36899,49906,79368,43710,80365,88735,75275,21664,57965,19002,301,12658,94385,1717,96191,50404,80166,93965,24688,27839,10812,31715,92127,42588,93307,80834,11317,26583,25769,98227,14884,58462,29148,68662,26872,72927,79021,51622,29521,33355,45701,45996,33782,93424,16530,96086,17329,74020,11501,46660,5583,22277,77653,55430,84644,448,86828,58855,67451,95264,67386,82424,52611,60012,88620,72894,94716,22262,99813,69592,63464,33163,91857,47904,22209,78590,68615,52952,31441,41313,18550,72685,68825,4795,53971,14592,39634,23682,76630,2731,81481,86542,23727,54291,56045,61635,32186,9355,73416,63532,24340,18886,84832,30654,48543,18339,65024,91197,64624,74648,9660,27897,49771,11123,8732,49393,12911,72416,17834,18878,62754,85072,23727,56577,51257,83291,12329,16203,91681,68137,79959,43609,58987,2026,42969,59144,84349,75214,76972,22633,64104,53799,16851,99197,70476,77113,46320,88693,37711,96536,68156,7119,2104,49435,77706,18924,24957,92406,87148,70482,36491,42605,54440,7893,31618,35707,65130,30007,75706,77266,37100,9601,87681,42543,69847,81848,32034,49429,99434,62209,17125,55227,61634,52574,83649,28725,70119,62467,80676,21192,99584,21310,25292,72781,17186,10393,98390,19789,92931,36234,62627,23437,3885,58822,82941,43806,8172,23790,72295,36196,98200,2889,87619,13846,56197,27151,21238,48794,81100,62643,40001,39243,33213,78416,194,91369,79342,36404,52308,13741,24442,88610,12659,11574,70052,93039,79367,41792,61816,35435,47192,97596,28330,41145,16918,62865,9576,45857,68737,90124,16703,7071,48433,57222,34435,800,72496,16449,68187,28739,97672,86818,50768,40807,88681,64340,2224,19703,59245,90905,31239,84216,93942,97371,16842,92168,52692,16064,84686,89444,27938,98406,41365,4515,20494,18813,16242,10634,61566,18592,78057,8720,33739,78345,87693,30242,70545,55521,23687,9160,8655,38811,61768,7228,5567,5561,82071,85,50145,23113,97761,88441,14891,72188,85166,37189,75671,81377,92470,73645,93258,6610,12185,43065,26704,47922,56650,7527,18006,56948,51675,16658,66402,1047,81624,77395,62310,73262,66050,57275,32936,87641,51528,58183,21952,84098,28913,28622,18140,89796,41317,93954,67690,64667,57092,21315,4731,76115,77291,11204,8634,93034,27411,27149,13843,9817,9407,84492,28444,59901,14592,89654,66207,66232,80293,74502,36925,55515,10121,16768,4720,71502,40500,21406,571,87320,81683,42788,86367,44686,22159,67015,35892,49668,83991,72088,30210,74009,86370,97956,2132,93512,54819,26094,51409,21485,94764,85806,13393,48543,7042,76538,64224,47909,9994,23750,17351,52141,30486,60380,86546,66606,36913,58173,45709,83679,82617,23381,9603,61107,566,6572,64745,10614,86371,43244,97154,10397,50975,68006,20045,16942,25536,74031,31807,70133,78790,40341,68730,39635,39013,66841,44043,96215,21270,59427,25034,40645,84741,52083,54503,36861,27659,95463,53847,40921,70116,61536,56756,8967,31079,20097,76014,99818,16606,19713,66904,27106,24874,96701,73287,76772,6073,57343,51428,91171,28299,17520,64903,4177,36071,94952,59008,28543,11576,74547,13260,20688,41261,2780,6633,37536,8844,95774,49323,30448,14154,83379,71259,23302,68402,43750,88505,15575,44927,6584,29867,21541,65763,12154,86616,79877,73259,68626,98962,68548,86576,48046,51755,64995,3661,64585,81550,46798,49319,50206,22024,5175,12923,23427,55915,91723,55831,83784,81034,86779,34622,84570,18960,48798,42970,95789,39465,82353,68905,44234,18244,54345,5592,89361,14644,67924,66415,89349,88530,72096,44459,5258,48317,48866,56886,90458,75889,4514,37227,11302,4667,2129,80414,86289,15887,87380,50749,83220,50529,20619,11606,36531,23409,78122,19566,76564,33045,66703,30017,35347,35038,12952,13971,3922,98702,11786,38388,69556,76728,60535,59961,23634,42211,98387,34880,27755,93182,99040,96390,65989,38375,3652,59657,57431,24666,11061,64713,85185,72849,58611,31220,26657,77056,24553,24993,5210,89024,32054,46997,92652,28363,98992,22593,97710,47766,37646,93573,95502,33790,92973,27766,62671,89698,10877,73893,41004,96035,18795,48080,59666,30241,35233,87353,43647,13404,41982,19264,29229,61369,8309,39383,42305,25944,13577,51545,68990,69801,37145,79189,55897,57793,66816,21930,56771,79296,73793,21632,42301,23696,72641,56310,85576,3004,25669,69221,32996,23040,65782,23712,13414,10758,15590,97298,74246,51511,46900,36795,38292,3852,6384,84421,3446,91670,45312,27609,87034,6683,83891,88991,16533,9197,34427,60384,48525,90978,46107,21693,12956,21804,46558,37682,81207,85840,53238,35026,4835,53264,41376,17783,64756,39278,25403,33042,20954,31193,24247,45911,92453,25370,86602,48574,57865,26436,16122,76614,17028,21262,59718,77821,14036,31033,90563,45410,15158,90209,84089,38053,60780,54166,14255,33120,27171,71798,91214,80040,56699,12475,40193,59415,4769,75920,1036,2692,75862,16612,73670,61182,3305,90334,187,91659,28063,75684,50017,82643,9282,77376,85469,8164,5584,36623,82597,83859,3435,98460,70095,80257,4381,6501,8924,35514,14297,54373,71369,5172,15955,82441,4636,48215,6821,3385,17663,40107,55679,30366,42390,95895,16083,58499,17176,55993,51034,49296,4010,78974,35930,2019,96226,27167,68245,53109,59037,37843,79243,10262,58797,61490,82590,52411,54783,29447,94551,30026,97959,93939,73217,82573,62154,78291,33728,39102,11484,86210,43794,73553,87435,1110,77108,56521,78610,8254,1842,43068,70415,79195,26136,49786,47279,38471,20379,54704,86614,91138,51595,50818,80186,73087,17262,94735,4952,27935,4928,74862,51392,62388,9570,38485,30594,56278,47395,72762,94597,72279,16010,34697,54475,67874,78014,88381,4045,41494,55178,46054,24373,1824,55333,7525,97908,61178,84635,2199,35361,4803,21907,79414,66083,54782,58692,28332,41851,28198,55819,37313,67046,16147,90478,71230,34141,85002,44332,35906,429,39744,773,22909,19536,98986,90945,45209,85439,92265,25291,22775,60611,49159,95701,36113,53923,60824,84935,29656,50007,86624,61691,76150,32187,42765,60660,13859,10792,88210,29374,29563,45188,28811,19739,67649,73775,99247,48414,91067,68253,9452,90116,91737,73979,62370,69112,58791,20349,71480,56852,36919,87977,77609,68738,85159,4918,70076,46473,4122,57713,1426,50987,77910,66211,62546,77749,96462,34304,77441,12104,91805,10287,60943,49632,83116,25716,23113,22707,77770,31176,6759,46130,4739,55554,3843,31653,70834,72877,41561,36903,23010,6663,2266,16360,70118,91936,17098,77278,4880,23484,94970,41826,46733,93484,68350,38861,18134,32936,241,24803,13876,93278,5039,35873,44418,5305,28510,36115,46717,15238,78607,23464,68635,55712,55007,92411,65739,4858,67537,37041,67453,89801,45963,14800,14225,65655,80463,9716,77255,65136,11230,76323,81433,36445,86523,61058,59560,19380,40791,48073,29626,36661,87907,57369,41623,13705,3880,45088,55444,41003,27754,1450,75312,71801,99600,60719,54182,29245,63315,73758,42973,32702,10855,56363,14638,84424,27178,78195,3133,70865,48019,26117,7151,52107,85562,41347,50486,69457,86961,95482,11857,93587,45680,42145,13029,10043,5142,49213,54525,85761,42707,70754,33768,87671,85038,58900,88438,20004,63390,14815,38875,73417,82875,89481,55517,944,15773,61814,32915,27868,5510,21916,28426,89881,16680,88850,11056,51991,4230,39107,49216,40065,4523,75848,95349,56034,10724,9885,88232,42478,65702,95696,39746,66032,88082,86905,30007,75068,66629,7358,26706,90511,72843,67857,20061,98581,69682,38e3,14186,70,2290,17269,30909,69449,19997,13275,2444,84985,51290,97641,15092,69650,21920,19617,7418,49725,91090,20805,28627,80665,67192,34697,57667,99323,50101,40587,35081,14037,34414,19898,60779,83267,87499,29596,41852,15813,32419,72232,8322,39184,46525,13833,65743,94595,37363,4711,35386,96413,10627,62625,56555,12919,93218,25191,98380,51923,66181,5788,73491,1452,487,12277,45415,11884,61300,94528,9181,26616,11455,31514,63290,45035,42759,33804,85721,80979,46010,50975,72482,31231,3086,58941,46102,25773,89742,29788,96741,88523,14922,88262,76305,57676,93259,2396,69145,26074,30056,3853,75317,56639,66203,38923,48939,22813,91864,10934,6714,84099,25631,73223,95630,97552,45950,22197,42886,33764,1263,41856,82057,62349,94091,78028,62651,18911,5693,92561,97821,41994,92343,76785,22216,4203,5038,86151,23596,24338,77181,51761,97693,10955,98159,37568,58932,72128,27303,99608,31688,57557,91022,43036,93927,32869,53653,55205,33139,47271,31224,51650,36422,86857,73799,22068,43376,84760,44898,65776,42451,71480,38509,41673,44141,75918,95652,68981,83001,48815,98086,67950,27986,33175,43624,55274,71051,61124,51550,64967,31570,15748,19159,38174,51078,79811,39183,57527,96550,85168,28824,47466,56993,13151,96664,29735,70251,1079,4314,77714,11507,1440,48415,31984,99915,20282,26524,18057,4992,40521,98108,84045,91961,79256,72244,25788,5487,23595,73302,14205,8925,27625,64343,28821,37992,67156,83320,31106,10884,30735,15067,51091,15668,48777,50770,19169,76504,41165,29749,92812,8065,66782,26841,1411,95461,61134,18699,52261,60469,81373,44825,11448,73320,30151,56991,31372,6655,36472,86292,30247,30931,21029,53410,9859,37267,47514,3492,49008,94727,25234,40546,53417,36492,25723,76227,58456,15979,34876,9574,34392,3751,36933,83921,65108,63135,67572,40184,21098],tn=new Array(16),rn=[16,8,16,24],nn=4,an=0;function on(){return nn<0&&(nn=4,an++),en[an]%Math.pow(10,nn+1)/Math.pow(10,nn--)|0}function sn(e,t){var r=t-e+1,n=0,i=1;do{for(n=0,i=1;i=(i/r|0)*r);return e+n%r|0}!function(){for(var e=0;e<16;e++){tn[e]=new Array(256);for(var t=0;t<256;t++)tn[e][t]=t|t<<8|t<<16|t<<24;for(var r=3;r>=0;r--)for(var n=0;n<255;n++){var i=255<<(r<<3),a=0|tn[e][n],o=sn(n,255);tn[e][n]=tn[e][n]&~i|tn[e][o]&i|0,tn[e][o]=tn[e][o]&~i|a&i|0}}}();var un=function(e){function t(e){var n,i,a,o;return r(this,t),(e=e||{}).length=e.length||128,e.rounds=e.rounds||8,i=this,o=[e],a=u(a=t),(n=s(i,Jr()?Reflect.construct(a,o||[],u(i).constructor):a.apply(i,o))).blockSize=16-n.state.hash.length,n.blockSizeInBytes=n.blockSize*n.unitSize,n.W=new Array(16),n}return c(t,e),o(t,[{key:"reset",value:function(){var e,r,n;(e=t,r=this,"function"==typeof(n=Vt(u(1&3?e.prototype:e),"reset",r))?function(e){return n.apply(r,e)}:n)([]),this.state.hash=new Array(this.options.length/32|0);for(var i=0;i>>0&15]^=o,this.W[a+1&15]^=o}for(var s=0;s<16;s++)this.W[s]=tr(this.W[s],rn[i])}for(var u=0;u0&&this.addPaddingZero(this.blockSizeInBytes-this.state.message.length|0),this.addPaddingZero(this.blockSizeInBytes-8|0),this.addLengthBits(),this.process(),this.getStateHash()}}])}(Nr);const ln=un;function cn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(cn=function(){return!!e})()}var fn=new Array(256),hn=[104,208,235,43,72,157,106,228,227,163,86,129,125,241,133,158,44,142,120,202,23,169,97,213,93,11,140,60,119,81,34,66,63,84,65,128,204,134,179,24,46,87,6,98,244,54,209,107,27,101,117,16,218,73,38,249,203,102,231,186,174,80,82,171,5,240,13,115,59,4,32,254,221,245,180,95,10,181,192,160,113,165,45,96,114,147,57,8,131,33,92,135,177,224,0,195,18,145,138,2,28,230,69,194,196,253,191,68,161,76,51,197,132,35,124,176,37,21,53,105,255,148,77,112,162,175,205,214,108,183,248,9,243,103,164,234,236,182,212,210,20,30,225,36,56,198,219,75,122,58,222,94,223,149,252,170,215,206,7,15,61,88,154,152,156,242,167,17,126,139,67,3,226,220,229,178,78,199,109,233,39,64,216,55,146,143,1,29,83,62,89,193,79,50,22,250,116,251,99,159,52,26,42,90,141,201,207,246,144,40,136,155,49,14,189,74,232,150,166,12,200,121,188,190,239,110,70,151,91,237,25,217,172,153,168,41,100,31,173,85,19,187,247,111,185,71,47,238,184,123,137,48,211,127,118,130],dn=[1,11,9,12,13,6,15,3,14,8,7,4,10,2,5,0],pn=[7,12,11,13,14,4,9,15,6,3,8,10,2,5,1,0],mn=new Array(16),gn=[1,1,4,1,8,5,2,9],bn=[1,1,3,1,5,8,9,5],yn=new Array(512),_n=new Array(22),vn=new Array(512),wn=new Array(22),xn=new Array(512),kn=new Array(22);function Bn(e,t){for(var r=new Array(512),n=new Array(22),i=0;i<8;i++)r[i]=[];for(var a=0;a<256;a++){var o=new Array(10);o[1]=e[a],o[2]=o[1]<<1,o[2]>=256&&(o[2]^=285),o[3]=o[2]^o[1],o[4]=o[2]<<1,o[4]>=256&&(o[4]^=285),o[5]=o[4]^o[1],o[8]=o[4]<<1,o[8]>=256&&(o[8]^=285),o[9]=o[8]^o[1],r[0][2*a]=o[t[0]]<<24|o[t[1]]<<16|o[t[2]]<<8|o[t[3]],r[0][2*a+1]=o[t[4]]<<24|o[t[5]]<<16|o[t[6]]<<8|o[t[7]];for(var s=1;s<8;s++)r[s][2*a]=nr(r[0][2*a+1],r[0][2*a],s<<3),r[s][2*a+1]=rr(r[0][2*a+1],r[0][2*a],s<<3)}n[0]=0,n[1]=0;for(var u=1;u<=10;u++)n[2*u]=4278190080&r[0][16*u-16]^16711680&r[1][16*u-14]^65280&r[2][16*u-12]^255&r[3][16*u-10],n[2*u+1]=4278190080&r[4][16*u-7]^16711680&r[5][16*u-5]^65280&r[6][16*u-3]^255&r[7][16*u-1];return[r,n]}!function(){!function(){for(var e=0;e<16;e++)mn[dn[e]]=0|e;for(var t=0;t<256;t++){var r=dn[t>>4],n=mn[15&t],i=pn[r^n];fn[t]=dn[r^i]<<4|mn[n^i]}}();var e=Bn(hn,bn);vn=e[0],wn=e[1],e=Bn(fn,bn),xn=e[0],kn=e[1],e=Bn(fn,gn),yn=e[0],_n=e[1]}();var En=function(e){function t(e){var n,i,a,o;switch(r(this,t),(e=e||{}).type=e.type||"",e.rounds=e.rounds||10,i=this,o=[e],a=u(a=t),(n=s(i,cn()?Reflect.construct(a,o||[],u(i).constructor):a.apply(i,o))).options.type){case"0":case 0:n.C=vn,n.RC=wn;break;case"t":n.C=xn,n.RC=kn;break;default:n.C=yn,n.RC=_n}return n}return c(t,e),o(t,[{key:"reset",value:function(){var e,r,n;(e=t,r=this,"function"==typeof(n=Vt(u(1&3?e.prototype:e),"reset",r))?function(e){return n.apply(r,e)}:n)([]),this.state.hash=new Array(16);for(var i=0;i<16;i++)this.state.hash[i]=0}},{key:"processBlock",value:function(e){for(var t=new Array(16),r=[],n=0;n<16;n++)r[n]=e[n]^(t[n]=this.state.hash[n])|0;for(var i=[],a=1;a<=this.options.rounds;a++){for(var o=0;o<8;o++){i[2*o]=0,i[2*o+1]=0;for(var s=0,u=56,l=0;s<8;s++,l=(u-=8)<32?1:0)i[2*o]^=this.C[s][2*(t[2*(o-s&7)+l]>>>u%32&255)],i[2*o+1]^=this.C[s][2*(t[2*(o-s&7)+l]>>>u%32&255)+1]}for(var c=0;c<16;c++)t[c]=i[c];t[0]^=this.RC[2*a],t[1]^=this.RC[2*a+1];for(var f=0;f<8;f++){i[2*f]=t[2*f],i[2*f+1]=t[2*f+1];for(var h=0,d=56,p=0;h<8;h++,p=(d-=8)<32?1:0)i[2*f]^=this.C[h][2*(r[2*(f-h&7)+p]>>>d%32&255)],i[2*f+1]^=this.C[h][2*(r[2*(f-h&7)+p]>>>d%32&255)+1]}for(var m=0;m<16;m++)r[m]=i[m]}for(var g=0;g<16;g++)this.state.hash[g]^=r[g]^e[g]}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<32?56-this.state.message.length|0:120-this.state.message.length|0),this.addLengthBits(),this.process(),this.getStateHash()}}])}(Nr);const Sn=En;function An(e){for(var t="",r=0,n=e.length;r>6),t+=String.fromCharCode(128|63&i)):i<55296||i>=57344?(t+=String.fromCharCode(224|i>>12),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|63&i)):(r++,i=65536+((1023&i)<<10|1023&e.charCodeAt(r)),t+=String.fromCharCode(240|i>>18),t+=String.fromCharCode(128|i>>12&63),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|63&i))}return t}function Cn(e){for(var t="",r=new Uint8Array(e),n=0;n>18)+Pn.charAt(n>>12&63)+Pn.charAt(n>>6&63)+Pn.charAt(63&n);return e.length-r===2?(n=e.charCodeAt(r)<<16|e.charCodeAt(r+1)<<8,t+=Pn.charAt(n>>18)+Pn.charAt(n>>12&63)+Pn.charAt(n>>6&63)+"="):e.length-r===1&&(n=e.charCodeAt(r)<<16,t+=Pn.charAt(n>>18)+Pn.charAt(n>>12&63)+"=="),t}var Mn=function(){return o(function e(t,n){r(this,e),t.length>n.blockSizeInBytes&&(n.update(t),t=n.finalize(),n.reset());for(var i=t.length;i2&&void 0!==arguments[2]?arguments[2]:{},n=O.arrayBufferToStr(t,!1),i=On.getHasher(e,r);return i.update(n),On.encoder.toHex(i.finalize())}function Ln(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ln=function(){return!!e})()}const Dn=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Ln()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Randomize Colour Palette",e.module="Image",e.description="Randomizes each colour in an image's colour palette. This can often reveal text or symbols that were previously a very similar colour to their surroundings, a technique sometimes used in Steganography.",e.infoURL="https://wikipedia.org/wiki/Indexed_color",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Seed",type:"string",value:""}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ee(t)){e.next=1;break}throw new k("Please enter a valid image file.");case 1:return n=r[0]||Math.random().toString().substr(2),e.next=2,Qe.dK.read(t);case 2:return i=e.sent,a=i.bitmap.width,o=i.bitmap.height,i.scan(0,0,a,o,function(e,t,r){s=this.bitmap.data.slice(r,r+3).join("."),u=Nn("md5",O.strToArrayBuffer(n+s)),l=u.substr(0,6)+"ff",i.setPixelColor(parseInt(l,16),e,t)}),e.next=3,i.getBuffer(i.mime);case 3:return c=e.sent,e.abrupt("return",new Uint8Array(c).buffer);case 4:case"end":return e.stop()}},e)})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){return e.byteLength?``:""}}]);var i}(qe);function zn(e,t){if("string"!=typeof t)throw"'unpack' error. Got invalid type argument.";for(var r,n=0,i=1;i"!=e[0])throw"'unpack' error.";r=!1}for(var a=[],o=0,s=1,u=null,l=null,c=null,f="";l=e[s];){if("b"==l.toLowerCase())c=1,u=(f=t.slice(o,o+c)).charCodeAt(0),"b"==l&&u>=128&&(u-=256);else if("H"==l)c=2,f=t.slice(o,o+c),r&&(f=f.split("").reverse().join("")),u=256*f.charCodeAt(0)+f.charCodeAt(1);else{if("l"!=l.toLowerCase())throw"'unpack' error. "+l;c=4,f=t.slice(o,o+c),r&&(f=f.split("").reverse().join("")),u=16777216*f.charCodeAt(0)+65536*f.charCodeAt(1)+256*f.charCodeAt(2)+f.charCodeAt(3),"l"==l&&u>=2147483648&&(u-=4294967296)}a.push(u),o+=c,s+=1}return a}function Un(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Un=function(){return!!e})()}const $n=function(e){function t(){var e,n,i,a;return r(this,t),n=this,i=u(i=t),(e=s(n,Un()?Reflect.construct(i,[],u(n).constructor):i.apply(n,a))).name="Remove EXIF",e.module="Image",e.description=["Removes EXIF data from a JPEG image.","

","EXIF data embedded in photos usually contains information about the image file itself as well as the device used to create it."].join("\n"),e.infoURL="https://wikipedia.org/wiki/Exif",e.inputType="ArrayBuffer",e.outputType="byteArray",e.args=[],e}return c(t,e),o(t,[{key:"run",value:function(e,t){if(0===(e=new Uint8Array(e)).length)return e;try{return function(e){if("ÿØ"!=(e=O.byteArrayToChars(e)).slice(0,2))throw"Given data is not jpeg.";var t=function(e){if("ÿØ"!=e.slice(0,2))throw"Given data isn't JPEG.";for(var t=2,r=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){r.push(e.slice(t));break}var n=t+zn(">H",e.slice(t+2,t+4))[0]+2;if(r.push(e.slice(t,n)),(t=n)>=e.length)throw"Wrong JPEG data."}return r}(e);if("ÿá"==t[1].slice(0,2)&&"Exif\0\0"==t[1].slice(4,10))t=[t[0]].concat(t.slice(2));else{if("ÿá"!=t[2].slice(0,2)||"Exif\0\0"!=t[2].slice(4,10))throw"Exif not found.";t=t.slice(0,2).concat(t.slice(3))}var r=t.join("");return O.strToCharcode(r)}(e)}catch(t){if("Exif not found."===t)return e;throw new k(`Could not remove EXIF data from image: ${t}`)}}}])}(qe);function jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jn=function(){return!!e})()}const Zn=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,jn()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Render Image",e.module="Image",e.description="Displays the input as an image. Supports the following formats:

  • jpg/jpeg
  • png
  • gif
  • webp
  • bmp
  • ico
",e.inputType="string",e.outputType="byteArray",e.presentType="html",e.args=[{name:"Input format",type:"option",value:["Raw","Base64","Hex"]}],e.checks=[{pattern:"^(?:\\xff\\xd8\\xff|\\x89\\x50\\x4e\\x47|\\x47\\x49\\x46|.{8}\\x57\\x45\\x42\\x50|\\x42\\x4d)",flags:"",args:["Raw"],useful:!0,output:{mime:"image"}}],e}return c(n,e),o(n,[{key:"run",value:function(e,t){var r=t[0];if(!e.length)return[];switch(r){case"Hex":e=S(e);break;case"Base64":e=E(e,void 0,"byteArray");break;default:e=O.strToByteArray(e)}if(!Ee(e))throw new k("Invalid file type");return e}},{key:"present",value:(i=t(h().mark(function e(t){var r,n;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=1;break}return e.abrupt("return","");case 1:if(r="data:",!(n=Ee(t))){e.next=2;break}r+=n+";",e.next=3;break;case 2:throw new k("Invalid file type");case 3:return r+="base64,"+B(t),e.abrupt("return","");case 4:case"end":return e.stop()}},e)})),function(e){return i.apply(this,arguments)})}]);var i}(qe);function Gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Gn=function(){return!!e})()}const Wn=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Gn()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Resize Image",e.module="Image",e.description="Resizes an image to the specified width and height values.",e.infoURL="https://wikipedia.org/wiki/Image_scaling",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Width",type:"number",value:100,min:1},{name:"Height",type:"number",value:100,min:1},{name:"Unit type",type:"option",value:["Pixels","Percent"]},{name:"Maintain aspect ratio",type:"boolean",value:!1},{name:"Resizing algorithm",type:"option",value:["Nearest Neighbour","Bilinear","Bicubic","Hermite","Bezier"],defaultIndex:1}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u={"Nearest Neighbour":Qe.od.NEAREST_NEIGHBOR,Bilinear:Qe.od.BILINEAR,Bicubic:Qe.od.BICUBIC,Hermite:Qe.od.HERMITE,Bezier:Qe.od.BEZIER},Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:l=e.sent,e.next=4;break;case 3:throw e.prev=3,f=e.catch(1),new k(`Error loading image. (${f})`);case 4:if(e.prev=4,"Percent"===a&&(n=l.width*(n/100),i=l.height*(i/100)),F()&&self.sendStatusMessage("Resizing image..."),o?l.scaleToFit({w:n,h:i,mode:u[s]}):l.resize({w:n,h:i,mode:u[s]}),"image/gif"!==l.mime){e.next=6;break}return e.next=5,l.getBuffer(Qe.pY.png);case 5:c=e.sent,e.next=8;break;case 6:return e.next=7,l.getBuffer(l.mime);case 7:c=e.sent;case 8:return e.abrupt("return",c.buffer);case 9:throw e.prev=9,d=e.catch(4),new k(`Error resizing image. (${d})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function Hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Hn=function(){return!!e})()}const qn=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Hn()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Rotate Image",e.module="Image",e.description="Rotates an image by the specified number of degrees.",e.infoURL="",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Rotation amount (degrees)",type:"number",value:90}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,1),i=n[0],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:a=e.sent,e.next=4;break;case 3:throw e.prev=3,s=e.catch(1),new k(`Error loading image. (${s})`);case 4:if(e.prev=4,F()&&self.sendStatusMessage("Rotating image..."),a.rotate(i),"image/gif"!==a.mime){e.next=6;break}return e.next=5,a.getBuffer(Qe.pY.png);case 5:o=e.sent,e.next=8;break;case 6:return e.next=7,a.getBuffer(a.mime);case 7:o=e.sent;case 8:return e.abrupt("return",o.buffer);case 9:throw e.prev=9,u=e.catch(4),new k(`Error rotating image. (${u})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);function Qn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Qn=function(){return!!e})()}const Vn=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Qn()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Sharpen Image",e.module="Image",e.description="Sharpens an image (Unsharp mask)",e.infoURL="https://wikipedia.org/wiki/Unsharp_masking",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Radius",type:"number",value:2,min:1},{name:"Amount",type:"number",value:1,min:0,step:.1},{name:"Threshold",type:"number",value:10,min:0,max:100}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(r,3),i=n[0],a=n[1],o=n[2],Ee(t)){e.next=1;break}throw new k("Invalid file type.");case 1:return e.prev=1,e.next=2,Qe.dK.read(t);case 2:s=e.sent,e.next=4;break;case 3:throw e.prev=3,f=e.catch(1),new k(`Error loading image. (${f})`);case 4:if(e.prev=4,F()&&self.sendStatusMessage("Sharpening image... (Cloning image)"),u=s.clone(),F()&&self.sendStatusMessage("Sharpening image... (Blurring cloned image)"),l=s.clone().gaussian(i),F()&&self.sendStatusMessage("Sharpening image... (Creating unsharp mask)"),u.scan(0,0,u.bitmap.width,u.bitmap.height,function(e,t,r){var n=l.bitmap.data[r],i=l.bitmap.data[r+1],a=l.bitmap.data[r+2],o=this.bitmap.data[r],s=this.bitmap.data[r+1],u=this.bitmap.data[r+2];this.bitmap.data[r]=o>n?o-n:0,this.bitmap.data[r+1]=s>i?s-i:0,this.bitmap.data[r+2]=u>a?u-a:0}),F()&&self.sendStatusMessage("Sharpening image... (Merging with unsharp mask)"),s.scan(0,0,s.bitmap.width,s.bitmap.height,function(e,t,r){var n=u.bitmap.data[r],i=u.bitmap.data[r+1],s=u.bitmap.data[r+2],l=this.bitmap.data[r],c=this.bitmap.data[r+1],f=this.bitmap.data[r+2],h=.2126*n+.7152*i+.0722*s,d=.2126*l+.7152*c+.0722*f;n*=a,i*=a,s*=a,(h>d?h-d:d-h)/255*100>=o&&(this.bitmap.data[r]=l+n<=255?l+n:255,this.bitmap.data[r+1]=c+i<=255?c+i:255,this.bitmap.data[r+2]=f+s<=255?f+s:255)}),"image/gif"!==s.mime){e.next=6;break}return e.next=5,s.getBuffer(Qe.pY.png);case 5:c=e.sent,e.next=8;break;case 6:return e.next=7,s.getBuffer(s.mime);case 7:c=e.sent;case 8:return e.abrupt("return",c.buffer);case 9:throw e.prev=9,d=e.catch(4),new k(`Error sharpening image. (${d})`);case 10:case"end":return e.stop()}},e,null,[[1,3],[4,9]])})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){if(!e.byteLength)return"";var t=new Uint8Array(e),r=Ee(t);if(!r)throw new k("Invalid file type.");return``}}]);var i}(qe);var Yn=__webpack_require__(48287).Buffer;function Kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Kn=function(){return!!e})()}const Xn=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Kn()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="Split Colour Channels",e.module="Image",e.description="Splits the given image into its red, green and blue colour channels.",e.infoURL="https://wikipedia.org/wiki/Channel_(digital_image)",e.inputType="ArrayBuffer",e.outputType="List",e.presentType="html",e.args=[],e}return c(n,e),o(n,[{key:"run",value:(a=t(h().mark(function e(r,n){var i,a,o,s;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ee(r=new Uint8Array(r))){e.next=1;break}throw new k("Invalid file type.");case 1:return e.next=2,Qe.dK.read(Yn.from(r));case 2:return i=e.sent,a=new Promise(function(){var e=t(h().mark(function e(t,r){var n,a,o,s,u,l,c;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=i.clone().color([{apply:"blue",params:[-255]},{apply:"green",params:[-255]}]).getBuffer(Qe.pY.png),a=t,o=File,s=Uint8Array,e.next=1,n;case 1:u=e.sent.values(),l=new s(u),a(new o([l],"red.png",{type:"image/png"})),e.next=3;break;case 2:e.prev=2,c=e.catch(0),r(new k(`Could not split red channel: ${c}`));case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t,r){return e.apply(this,arguments)}}()),o=new Promise(function(){var e=t(h().mark(function e(t,r){var n,a,o,s,u,l,c;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=i.clone().color([{apply:"red",params:[-255]},{apply:"blue",params:[-255]}]).getBuffer(Qe.pY.png),a=t,o=File,s=Uint8Array,e.next=1,n;case 1:u=e.sent.values(),l=new s(u),a(new o([l],"green.png",{type:"image/png"})),e.next=3;break;case 2:e.prev=2,c=e.catch(0),r(new k(`Could not split green channel: ${c}`));case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t,r){return e.apply(this,arguments)}}()),s=new Promise(function(){var e=t(h().mark(function e(t,r){var n,a,o,s,u,l,c;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=i.color([{apply:"red",params:[-255]},{apply:"green",params:[-255]}]).getBuffer(Qe.pY.png),a=t,o=File,s=Uint8Array,e.next=1,n;case 1:u=e.sent.values(),l=new s(u),a(new o([l],"blue.png",{type:"image/png"})),e.next=3;break;case 2:e.prev=2,c=e.catch(0),r(new k(`Could not split blue channel: ${c}`));case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t,r){return e.apply(this,arguments)}}()),e.next=3,Promise.all([a,o,s]);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e)})),function(e,t){return a.apply(this,arguments)})},{key:"present",value:(i=t(h().mark(function e(t){return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,O.displayFilesAsHTML(t);case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},e)})),function(e){return i.apply(this,arguments)})}]);var i,a}(qe);function Jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Jn=function(){return!!e})()}var ei=function(e){function n(){var e,t,i,a;return r(this,n),t=this,i=u(i=n),(e=s(t,Jn()?Reflect.construct(i,[],u(t).constructor):i.apply(t,a))).name="View Bit Plane",e.module="Image",e.description="Extracts and displays a bit plane of any given image. These show only a single bit from each pixel, and can be used to hide messages in Steganography.",e.infoURL="https://wikipedia.org/wiki/Bit_plane",e.inputType="ArrayBuffer",e.outputType="ArrayBuffer",e.presentType="html",e.args=[{name:"Colour",type:"option",value:ti},{name:"Bit",type:"number",value:0}],e}return c(n,e),o(n,[{key:"run",value:(i=t(h().mark(function e(t,r){var n,i,a,o,s,u,l,c,f,d,p,m;return h().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ee(t)){e.next=1;break}throw new k("Please enter a valid image file.");case 1:return n=ie(r,2),i=n[0],a=n[1],e.next=2,Qe.dK.read(t);case 2:if(o=e.sent,s=o.bitmap.width,u=o.bitmap.height,l=ti.indexOf(i),c=7-a,!(a<0||a>7)){e.next=3;break}throw new k("Error: Bit argument must be between 0 and 7");case 3:return o.scan(0,0,s,u,function(e,t,r){f=this.bitmap.data[r+l],d=O.bin(f),p=255,"1"===d.charAt(c)&&(p=0);for(var n=0;n<3;n++)this.bitmap.data[r+n]=p;this.bitmap.data[r+3]=255}),e.next=4,o.getBuffer(o.mime);case 4:return m=e.sent,e.abrupt("return",new Uint8Array(m).buffer);case 5:case"end":return e.stop()}},e)})),function(e,t){return i.apply(this,arguments)})},{key:"present",value:function(e){return e.byteLength?``:""}}]);var i}(qe),ti=["Red","Green","Blue","Alpha"];const ri=ei;("undefined"==typeof self?{}:self.OpModules||{}).Image={"Add Text To Image":Ye,"Blur Image":Xe,"Contain Image":et,"Convert Image Format":rt,"Cover Image":it,"Crop Image":ot,"Dither Image":ut,"Extract EXIF":ht,"Extract LSB":yt,"Extract RGBA":wt,"Flip Image":kt,"Generate Image":St,"Generate QR Code":Ft,"Image Brightness / Contrast":Nt,"Image Filter":Dt,"Image Hue/Saturation/Lightness":Ut,"Image Opacity":jt,"Invert Image":Gt,"Normalise Image":Ht,"Parse QR Code":Qt,"Randomize Colour Palette":Dn,"Remove EXIF":$n,"Render Image":Zn,"Resize Image":Wn,"Rotate Image":qn,"Sharpen Image":Vn,"Split Colour Channels":Xn,"View Bit Plane":ri}})()})();