From 824e4710e2e4031d8d1ece7ff59889c33f3fa2b7 Mon Sep 17 00:00:00 2001 From: Jerome Wu Date: Fri, 10 May 2019 11:44:02 +0800 Subject: [PATCH] Update .gitignore --- .gitignore | 2 +- dist/tesseract.min.js | 9 --------- dist/tesseract.min.js.map | 1 - dist/worker.min.js | 9 --------- dist/worker.min.js.map | 1 - 5 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 dist/tesseract.min.js delete mode 100644 dist/tesseract.min.js.map delete mode 100644 dist/worker.min.js delete mode 100644 dist/worker.min.js.map diff --git a/.gitignore b/.gitignore index d6c387972..45a4f41fb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ worker.dev.js /*.traineddata /examples/**/*.traineddata .nyc_output -dist +dist/ diff --git a/dist/tesseract.min.js b/dist/tesseract.min.js deleted file mode 100644 index 9ac516401..000000000 --- a/dist/tesseract.min.js +++ /dev/null @@ -1,9 +0,0 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Tesseract=e():t.Tesseract=e()}(window,function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,e,r){"use strict";(function(t){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -var i=r(15),n=r(16),s=r(17);function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,e){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(i)return N(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=f.from(e,i)),f.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var s,o=1,a=t.length,f=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,f/=2,r/=2}function h(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var u=-1;for(s=r;sa&&(r=a-f),s=r;s>=0;s--){for(var c=!0,l=0;ln&&(i=n):i=n;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function k(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function U(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:h>223?3:h>191?2:1;if(n+c<=r)switch(c){case 1:h<128&&(u=h);break;case 2:128==(192&(s=t[n+1]))&&(f=(31&h)<<6|63&s)>127&&(u=f);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&(f=(15&h)<<12|(63&s)<<6|63&o)>2047&&(f<55296||f>57343)&&(u=f);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(f=(15&h)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&f<1114112&&(u=f)}null===u?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),n+=c}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return U(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},f.prototype.compare=function(t,e,r,i,n){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),h=this.slice(i,n),u=t.slice(e,r),c=0;cn)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function I(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,i,n,s){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function j(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function L(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function O(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,i,s){return s||O(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function z(t,e,r,i,s){return s||O(t,0,r,8),n.write(t,e,r,i,52,8),r+8}f.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},f.prototype.readUInt8=function(t,e){return e||S(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||S(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||S(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||S(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},f.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||S(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},f.prototype.readInt8=function(t,e){return e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return e||S(t,4,this.length),n.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||S(t,4,this.length),n.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||S(t,8,this.length),n.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||S(t,8,this.length),n.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+n]=t/s&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},f.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+r},f.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(s<1e3||!f.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function D(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(M,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(14))},function(t,e){var r,i,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(t){r=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var f,h=[],u=!1,c=-1;function l(){u&&f&&(u=!1,f.length?h=f.concat(h):c=-1,h.length&&p())}function p(){if(!u){var t=a(l);u=!0;for(var e=h.length;e;){for(f=h,h=[];++c1)for(var r=1;rd&&te}function A(t,e){return w(t)&&t=e}function k(t,e){return w(t)&&t<=e}function U(t){return"string"==typeof t}function _(t){return U(t)&&""!==t}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function P(t,e){try{return t instanceof e}catch(t){return!1}}function T(t,e){var r;for(r in e)if(e.hasOwnProperty(r)){if(!1===t.hasOwnProperty(r)||typeof t[r]!=typeof e[r])return!1;if(I(t[r])&&!1===T(t[r],e[r]))return!1}return!0}function B(t){return g(t)}function S(t){return b(t)&&E(t.length,0)}function R(t){return"function"==typeof t}function j(t,e){var r;for(r=0;rr}},{n:"greaterOrEqual",f:E},{n:"lessOrEqual",f:k},{n:"inRange",f:function(t,e,r){if(e=r}},{n:"positive",f:function(t){return x(t,0)}},{n:"negative",f:function(t){return A(t,0)}},{n:"string",f:U,s:"s"},{n:"emptyString",f:function(t){return""===t},s:"s"},{n:"nonEmptyString",f:_,s:"s"},{n:"contains",f:function(t,e){return U(t)&&-1!==t.indexOf(e)},s:"s"},{n:"match",f:function(t,e){return U(t)&&!!t.match(e)},s:"s"},{n:"boolean",f:function(t){return!1===t||!0===t},s:"b"},{n:"object",f:I,s:"o"},{n:"emptyObject",f:function(t){return I(t)&&0===Object.keys(t).length},s:"o"},{n:"nonEmptyObject",f:function(t){return I(t)&&Object.keys(t).length>0},s:"o"},{n:"instanceStrict",f:P,s:"t"},{n:"instance",f:function(t,e){try{return P(t,e)||t.constructor.name===e.name||Object.prototype.toString.call(t)==="[object "+e.name+"]"}catch(t){return!1}},s:"t"},{n:"like",f:T,s:"t"},{n:"array",f:B,s:"a"},{n:"emptyArray",f:function(t){return B(t)&&0===t.length},s:"a"},{n:"nonEmptyArray",f:function(t){return B(t)&&x(t.length,0)},s:"a"},{n:"arrayLike",f:S,s:"al"},{n:"iterable",f:function(t){if(!y)return S(t);return b(t)&&R(t[Symbol.iterator])},s:"i"},{n:"date",f:function(t){return P(t,Date)&&v(t.getTime())},s:"d"},{n:"function",f:R,s:"f"},{n:"hasLength",f:function(t,e){return b(t)&&t.length===e},s:"l"}].map(function(t){var e=t.n;o[e]="Invalid "+s[t.s||"n"],a[e]=t.f}),f={apply:function(t,e){if(h.array(t),R(e))return t.map(function(t){return e(t)});return h.array(e),h.hasLength(t,e.length),t.map(function(t,r){return e[r](t)})},map:function(t,e){if(h.object(t),R(e))return function(t,e){var r={};return Object.keys(t).forEach(function(i){r[i]=e(t[i])}),r}(t,e);return h.object(e),function t(e,r){var i={};return Object.keys(r).forEach(function(n){var s=r[n];R(s)?u.assigned(e)?i[n]=!!s.m:i[n]=s(e[n]):I(s)&&(i[n]=t(e[n],s))}),i}(t,e)},all:function(t){if(B(t))return j(t,!1);return h.object(t),L(t,!1)},any:function(t){if(B(t))return j(t,!0);return h.object(t),L(t,!0)}},l=["array","arrayLike","iterable","object"],p=Array.prototype.slice,d=Number.NEGATIVE_INFINITY,m=Number.POSITIVE_INFINITY,g=Array.isArray,y="function"==typeof Symbol,f=O(f,a),h=D(C,z),u=D(M,Y),c=D(function(t){var e=function(){return!!u.assigned(arguments[0])||t.apply(null,arguments)};return e.l=t.length,e.m=!0,e},function(t){if(!1===b(t))return!0;return t}),h.not=F(C,u),h.maybe=F(C,c),l.forEach(function(t){a[t].of=q([N.bind(null,null),a[t],a,null])}),$(h,C),$(u,M),l.forEach(function(t){c[t].of=q([N.bind(null,"maybe"),a[t],a,null]),h.maybe[t].of=F(C,c[t].of),h.not[t].of=F(C,u[t].of)}),function(n){void 0===(i=function(){return n}.call(e,r,e,t))||(t.exports=i)}(O(f,{assert:h,not:u,maybe:c}))}()},function(t,e,r){(function(t){const i=r(3),n=r(2),{defaultOptions:s}=r(24),{version:o}=r(25),a=(t,e)=>{const r=new FileReader;r.onload=(()=>{e(r.result)}),r.readAsArrayBuffer(t)},f=t=>{if(i.string(t))return fetch(n(t)).then(t=>t.arrayBuffer());if(i.instance(t,HTMLElement)){if("IMG"===t.tagName)return f(t.src);if("VIDEO"===t.tagName)return f(t.poster);if("CANVAS"===t.tagName)return new Promise(e=>{t.toBlob(t=>{a(t,e)})})}return i.instance(t,File)?new Promise(e=>{a(t,e)}):Promise.reject()};e.defaultOptions={...s,workerPath:"development"===t.env.TESS_ENV?n(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`):`https://cdn.jsdelivr.net/gh/naptha/tesseract.js@v${o}/dist/worker.min.js`,corePath:`https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core${"object"==typeof WebAssembly?"":".asm"}.js`},e.spawnWorker=((t,{workerPath:e})=>{let r;if(window.Blob&&window.URL){const t=new Blob([`importScripts("${e}");`]);r=new Worker(window.URL.createObjectURL(t))}else r=new Worker(e);return r.onmessage=(({data:e})=>{t.recv(e)}),r}),e.terminateWorker=(t=>{t.worker.terminate()}),e.sendPacket=((t,e)=>{const r={...e};f(r.payload.image).then(t=>new Uint8Array(t)).then(e=>{r.payload.image=Array.from(e),t.worker.postMessage(r)})})}).call(this,r(1))},function(t,e,r){const i=r(6),n=r(23);t.exports={TesseractWorker:n,utils:i}},function(t,e,r){const i=r(7);t.exports={loadLang:r(9)({fetch:r(11),gunzip:r(12),resolveURL:r(2),...i}),readImage:r(18),cache:i}},function(t,e,r){const{set:i,get:n,del:s}=r(8);t.exports={readCache:n,writeCache:i,deleteCache:s,checkCache:t=>n(t).then(t=>void 0!==t)}},function(t,e,r){"use strict";r.r(e),r.d(e,"Store",function(){return i}),r.d(e,"get",function(){return o}),r.d(e,"set",function(){return a}),r.d(e,"del",function(){return f}),r.d(e,"clear",function(){return h}),r.d(e,"keys",function(){return u});class i{constructor(t="keyval-store",e="keyval"){this.storeName=e,this._dbp=new Promise((r,i)=>{const n=indexedDB.open(t,1);n.onerror=(()=>i(n.error)),n.onsuccess=(()=>r(n.result)),n.onupgradeneeded=(()=>{n.result.createObjectStore(e)})})}_withIDBStore(t,e){return this._dbp.then(r=>new Promise((i,n)=>{const s=r.transaction(this.storeName,t);s.oncomplete=(()=>i()),s.onabort=s.onerror=(()=>n(s.error)),e(s.objectStore(this.storeName))}))}}let n;function s(){return n||(n=new i),n}function o(t,e=s()){let r;return e._withIDBStore("readonly",e=>{r=e.get(t)}).then(()=>r.result)}function a(t,e,r=s()){return r._withIDBStore("readwrite",r=>{r.put(e,t)})}function f(t,e=s()){return e._withIDBStore("readwrite",e=>{e.delete(t)})}function h(t=s()){return t._withIDBStore("readwrite",t=>{t.clear()})}function u(t=s()){const e=[];return t._withIDBStore("readonly",t=>{(t.openKeyCursor||t.openCursor).call(t).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(()=>e)}},function(t,e,r){(function(e){const i=r(10),n=t=>({TessModule:e,dataPath:r,cachePath:i,cacheMethod:n,lang:s})=>o=>{if(e){if(r)try{e.FS.mkdir(r)}catch(t){}e.FS.writeFile(`${r||"."}/${s}.traineddata`,o)}return["write","refresh",void 0].includes(n)?t.writeCache(`${i||"."}/${s}.traineddata`,o).then(()=>o):o};t.exports=(t=>({lang:r,...s})=>Promise.all(r.split("+").map((t=>({langPath:r,cachePath:s,cacheMethod:o,...a})=>f=>{let{readCache:h}=t;return["refresh","none"].includes(o)&&(h=(()=>Promise.resolve())),h(`${s||"."}/${f}.traineddata`).then(e=>void 0===e?Promise.reject():n(t)({cachePath:s,cacheMethod:o,lang:f,...a})(e)).catch(()=>{const h=e=>t.fetch(`${e}/${f}.traineddata.gz`).then(t=>t.arrayBuffer()).then(e=>t.gunzip(new Uint8Array(e))).then(n(t)({cachePath:s,cacheMethod:o,lang:f,...a}));return i(r)?h(r):e.browser?h(t.resolveURL(r)):t.readCache(`${r}/${f}.traineddata.gz`).then(e=>t.gunzip(new Uint8Array(e))).then(n(t)({cachePath:s,cacheMethod:o,lang:f,...a}))})})(t)(s))))}).call(this,r(1))},function(t,e){t.exports=function(t){if("string"!=typeof t)return!1;var e=t.match(r);if(!e)return!1;var s=e[1];if(!s)return!1;if(i.test(s)||n.test(s))return!0;return!1};var r=/^(?:\w+:)?\/\/(\S+)$/,i=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/},function(t,e){t.exports=fetch.bind()},function(t,e,r){t.exports=r(13).gunzipSync},function(t,e,r){(function(t,r){/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function(){"use strict";function i(t){throw t}var n=void 0,s=!0,o="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;function a(t,e){this.index="number"==typeof e?e:0,this.m=0,this.buffer=t instanceof(o?Uint8Array:Array)?t:new(o?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&i(Error("invalid index")),this.buffer.length<=this.index&&this.f()}a.prototype.f=function(){var t,e=this.buffer,r=e.length,i=new(o?Uint8Array:Array)(r<<1);if(o)i.set(e);else for(t=0;t>>8&255]<<16|p[t>>>16&255]<<8|p[t>>>24&255])>>32-e:p[t]>>8-e),8>e+o)a=a<>e-i-1&1,8==++o&&(o=0,n[s++]=p[a],a=0,s===n.length&&(n=this.f()));n[s]=a,this.buffer=n,this.m=o,this.index=s},a.prototype.finish=function(){var t,e=this.buffer,r=this.index;return 0f;++f){for(var u=l=f,c=7,l=l>>>1;l;l>>>=1)u<<=1,u|=1&l,--c;h[f]=(u<>>0}var p=h;function d(t,e,r){var i,n="number"==typeof e?e:e=0,s="number"==typeof r?r:t.length;for(i=-1,n=7&s;n--;++e)i=i>>>8^g[255&(i^t[e])];for(n=s>>3;n--;e+=8)i=(i=(i=(i=(i=(i=(i=(i=i>>>8^g[255&(i^t[e])])>>>8^g[255&(i^t[e+1])])>>>8^g[255&(i^t[e+2])])>>>8^g[255&(i^t[e+3])])>>>8^g[255&(i^t[e+4])])>>>8^g[255&(i^t[e+5])])>>>8^g[255&(i^t[e+6])])>>>8^g[255&(i^t[e+7])];return(4294967295^i)>>>0}var m=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],g=o?new Uint32Array(m):m;function y(){}function b(t){this.buffer=new(o?Uint16Array:Array)(2*t),this.length=0}function w(t){var e,r,i,n,s,a,f,h,u,c,l=t.length,p=0,d=Number.POSITIVE_INFINITY;for(h=0;hp&&(p=t[h]),t[h]>=1;for(c=i<<16|h,u=a;us[i]);)n=s[r],s[r]=s[i],s[i]=n,n=s[r+1],s[r+1]=s[i+1],s[i+1]=n,r=i;return this.length},b.prototype.pop=function(){var t,e,r,i,n,s=this.buffer;for(e=s[0],t=s[1],this.length-=2,s[0]=s[this.length],s[1]=s[this.length+1],n=0;!((i=2*n+2)>=this.length)&&(i+2s[i]&&(i+=2),s[i]>s[n]);)r=s[n],s[n]=s[i],s[i]=r,r=s[n+1],s[n+1]=s[i+1],s[i+1]=r,n=i;return{index:t,value:e,length:this.length}};var x,A=2,E={NONE:0,L:1,t:A,X:3},k=[];for(x=0;288>x;x++)switch(s){case 143>=x:k.push([x+48,8]);break;case 255>=x:k.push([x-144+400,9]);break;case 279>=x:k.push([x-256+0,7]);break;case 287>=x:k.push([x-280+192,8]);break;default:i("invalid literal: "+x)}function U(t,e){this.length=t,this.N=e}v.prototype.h=function(){var t,e,r,f,h=this.input;switch(this.k){case 0:for(r=0,f=h.length;r>>8&255,y[b++]=255&l,y[b++]=l>>>8&255,o)y.set(p,b),b+=p.length,y=y.subarray(0,b);else{for(m=0,g=p.length;mH)for(;0H?H:138)>H-3&&X=X?(rt[K++]=17,rt[K++]=X-3,it[17]++):(rt[K++]=18,rt[K++]=X-11,it[18]++),H-=X;else if(rt[K++]=et[G],it[et[G]]++,3>--H)for(;0H?H:6)>H-3&&Xq;q++)V[q]=M[J[q]];for(j=19;4=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:i("invalid length: "+t)}}var e,r,n=[];for(e=3;258>=e;e++)r=t(e),n[e]=r[2]<<24|r[1]<<16|r[0];return n}(),I=o?new Uint32Array(_):_;function P(t,e){function r(t,e){var r,n,o,a,f=t.N,h=[],u=0;switch(r=I[t.length],h[u++]=65535&r,h[u++]=r>>16&255,h[u++]=r>>24,s){case 1===f:n=[0,f-1,0];break;case 2===f:n=[1,f-2,0];break;case 3===f:n=[2,f-3,0];break;case 4===f:n=[3,f-4,0];break;case 6>=f:n=[4,f-5,1];break;case 8>=f:n=[5,f-7,1];break;case 12>=f:n=[6,f-9,2];break;case 16>=f:n=[7,f-13,2];break;case 24>=f:n=[8,f-17,3];break;case 32>=f:n=[9,f-25,3];break;case 48>=f:n=[10,f-33,4];break;case 64>=f:n=[11,f-49,4];break;case 96>=f:n=[12,f-65,5];break;case 128>=f:n=[13,f-97,5];break;case 192>=f:n=[14,f-129,6];break;case 256>=f:n=[15,f-193,6];break;case 384>=f:n=[16,f-257,7];break;case 512>=f:n=[17,f-385,7];break;case 768>=f:n=[18,f-513,8];break;case 1024>=f:n=[19,f-769,8];break;case 1536>=f:n=[20,f-1025,9];break;case 2048>=f:n=[21,f-1537,9];break;case 3072>=f:n=[22,f-2049,10];break;case 4096>=f:n=[23,f-3073,10];break;case 6144>=f:n=[24,f-4097,11];break;case 8192>=f:n=[25,f-6145,11];break;case 12288>=f:n=[26,f-8193,12];break;case 16384>=f:n=[27,f-12289,12];break;case 24576>=f:n=[28,f-16385,13];break;case 32768>=f:n=[29,f-24577,13];break;default:i("invalid distance")}for(r=n,h[u++]=r[0],h[u++]=r[1],h[u++]=r[2],o=0,a=h.length;o=h;)v[h++]=0;for(h=0;29>=h;)x[h++]=0}for(v[256]=1,a=0,f=e.length;a=f){for(d&&r(d,-1),h=0,u=f-a;hs&&e+sh&&(n=i,h=s),258===s)break}return new U(h,e-n)}function B(t,e){var r,i,n,s,a,f=t.length,h=new b(572),u=new(o?Uint8Array:Array)(f);if(!o)for(s=0;s2*u[s-1]+c[s]&&(u[s]=2*u[s-1]+c[s]),p[s]=Array(u[s]),d[s]=Array(u[s]);for(n=0;nt[n]?(p[s][a]=f,d[s][a]=e,h+=2):(p[s][a]=t[n],d[s][a]=n,++n);m[s]=0,1===c[s]&&i(s)}return l}(i,i.length,e),s=0,a=r.length;s>>=1;return s}function R(t,e){this.input=t,this.b=this.c=0,this.g={},e&&(e.flags&&(this.g=e.flags),"string"==typeof e.filename&&(this.filename=e.filename),"string"==typeof e.comment&&(this.w=e.comment),e.deflateOptions&&(this.l=e.deflateOptions)),this.l||(this.l={})}R.prototype.h=function(){var t,e,r,i,s,a,f,h,u=new(o?Uint8Array:Array)(32768),c=0,l=this.input,p=this.c,m=this.filename,g=this.w;if(u[c++]=31,u[c++]=139,u[c++]=8,t=0,this.g.fname&&(t|=O),this.g.fcomment&&(t|=C),this.g.fhcrc&&(t|=L),u[c++]=t,e=(Date.now?Date.now():+new Date)/1e3|0,u[c++]=255&e,u[c++]=e>>>8&255,u[c++]=e>>>16&255,u[c++]=e>>>24&255,u[c++]=0,u[c++]=j,this.g.fname!==n){for(f=0,h=m.length;f>>8&255),u[c++]=255&a;u[c++]=0}if(this.g.comment){for(f=0,h=g.length;f>>8&255),u[c++]=255&a;u[c++]=0}return this.g.fhcrc&&(r=65535&d(u,0,c),u[c++]=255&r,u[c++]=r>>>8&255),this.l.outputBuffer=u,this.l.outputIndex=c,u=(s=new v(l,this.l)).h(),c=s.b,o&&(c+8>u.buffer.byteLength?(this.a=new Uint8Array(c+8),this.a.set(new Uint8Array(u.buffer)),u=this.a):u=new Uint8Array(u.buffer)),i=d(l,n,n),u[c++]=255&i,u[c++]=i>>>8&255,u[c++]=i>>>16&255,u[c++]=i>>>24&255,h=l.length,u[c++]=255&h,u[c++]=h>>>8&255,u[c++]=h>>>16&255,u[c++]=h>>>24&255,this.c=p,o&&c>>=1){case 0:var e=this.input,r=this.c,a=this.a,f=this.b,h=e.length,u=n,c=a.length,l=n;switch(this.e=this.j=0,r+1>=h&&i(Error("invalid uncompressed block header: LEN")),u=e[r++]|e[r++]<<8,r+1>=h&&i(Error("invalid uncompressed block header: NLEN")),u===~(e[r++]|e[r++]<<8)&&i(Error("invalid uncompressed block header: length verify")),r+u>e.length&&i(Error("input buffer is broken")),this.q){case M:for(;f+u>a.length;){if(u-=l=c-f,o)a.set(e.subarray(r,r+l),f),f+=l,r+=l;else for(;l--;)a[f++]=e[r++];this.b=f,a=this.f(),f=this.b}break;case Y:for(;f+u>a.length;)a=this.f({B:2});break;default:i(Error("invalid inflate mode"))}if(o)a.set(e.subarray(r,r+u),f),f+=u,r+=u;else for(;u--;)a[f++]=e[r++];this.c=r,this.b=f,this.a=a;break;case 1:this.r(et,it);break;case 2:var p,d,m,g,y=nt(this,5)+257,b=nt(this,5)+1,v=nt(this,4)+4,x=new(o?Uint8Array:Array)(F.length),A=n,E=n,k=n,U=n,_=n;for(_=0;_=N?8:255>=N?9:279>=N?7:8;var Q,tt,et=w(X),rt=new(o?Uint8Array:Array)(30);for(Q=0,tt=rt.length;Q=f&&i(Error("input buffer is broken")),n|=o[a++]<>>e,t.e=s-e,t.c=a,r}function st(t,e){for(var r,n,s=t.j,o=t.e,a=t.input,f=t.c,h=a.length,u=e[0],c=e[1];o=h);)s|=a[f++]<>>16)>o&&i(Error("invalid code length: "+n)),t.j=s>>n,t.e=o-n,t.c=f,65535&r}function ot(t){this.input=t,this.c=0,this.G=[],this.R=!1}function at(t){if("string"==typeof t){var e,r,i=t.split("");for(e=0,r=i.length;e>>0;t=i}for(var n,s=1,o=0,a=t.length,f=0;0>>0}function ft(t,e){var r,n;switch(this.input=t,this.c=0,!e&&(e={})||(e.index&&(this.c=e.index),e.verify&&(this.V=e.verify)),r=t[this.c++],n=t[this.c++],15&r){case ht:this.method=ht;break;default:i(Error("unsupported compression method"))}0!=((r<<8)+n)%31&&i(Error("invalid fcheck flag:"+((r<<8)+n)%31)),32&n&&i(Error("fdict flag is not supported")),this.J=new z(t,{index:this.c,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}z.prototype.r=function(t,e){var r=this.a,i=this.b;this.A=t;for(var n,s,o,a,f=r.length-258;256!==(n=st(this,t));)if(256>n)i>=f&&(this.b=i,r=this.f(),i=this.b),r[i++]=n;else for(a=J[s=n-257],0=f&&(this.b=i,r=this.f(),i=this.b);a--;)r[i]=r[i++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=i},z.prototype.Q=function(t,e){var r=this.a,i=this.b;this.A=t;for(var n,s,o,a,f=r.length;256!==(n=st(this,t));)if(256>n)i>=f&&(f=(r=this.f()).length),r[i++]=n;else for(a=J[s=n-257],0f&&(f=(r=this.f()).length);a--;)r[i]=r[i++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=i},z.prototype.f=function(){var t,e,r=new(o?Uint8Array:Array)(this.b-32768),i=this.b-32768,n=this.a;if(o)r.set(n.subarray(32768,r.length));else for(t=0,e=r.length;tt;++t)n[t]=n[i+t];return this.b=32768,n},z.prototype.S=function(t){var e,r,i,n=this.input.length/this.c+1|0,s=this.input,a=this.a;return t&&("number"==typeof t.B&&(n=t.B),"number"==typeof t.M&&(n+=t.M)),2>n?r=(i=(s.length-this.c)/this.A[2]/2*258|0)e&&(this.a.length=e),t=this.a),this.buffer=t},ot.prototype.i=function(){for(var t=this.input.length;this.c>>0,d(e,n,n)!==m&&i(Error("invalid CRC-32 checksum: 0x"+d(e,n,n).toString(16)+" / 0x"+m.toString(16))),a.Z=f=(g[b++]|g[b++]<<8|g[b++]<<16|g[b++]<<24)>>>0,(4294967295&e.length)!==f&&i(Error("invalid input size: "+(4294967295&e.length)+" / "+f)),this.G.push(a),this.c=b}this.R=s;var w,v,x,A=this.G,E=0,k=0;for(w=0,v=A.length;w>>0!==at(t)&&i(Error("invalid adler-32 checksum"))),t};var ht=8;function ut(t,e){this.input=t,this.a=new(o?Uint8Array:Array)(32768),this.k=ct.t;var r,i={};for(r in!e&&(e={})||"number"!=typeof e.compressionType||(this.k=e.compressionType),e)i[r]=e[r];i.outputBuffer=this.a,this.I=new v(this.input,i)}var ct=E;function lt(t,e){var r;return r=new ut(t).h(),e||(e={}),e.H?r:gt(r)}function pt(t,e){var r;return t.subarray=t.slice,r=new ft(t).i(),e||(e={}),e.noBuffer?r:gt(r)}function dt(t,e){var r;return t.subarray=t.slice,r=new R(t).h(),e||(e={}),e.H?r:gt(r)}function mt(t,e){var r;return t.subarray=t.slice,r=new ot(t).i(),e||(e={}),e.H?r:gt(r)}function gt(t){var e,i,n=new r(t.length);for(e=0,i=t.length;e>24&255,f[h++]=a>>16&255,f[h++]=a>>8&255,f[h++]=255&a,f},e.deflate=function(e,r,i){t.nextTick(function(){var t,n;try{n=lt(e,i)}catch(e){t=e}r(t,n)})},e.deflateSync=lt,e.inflate=function(e,r,i){t.nextTick(function(){var t,n;try{n=pt(e,i)}catch(e){t=e}r(t,n)})},e.inflateSync=pt,e.gzip=function(e,r,i){t.nextTick(function(){var t,n;try{n=dt(e,i)}catch(e){t=e}r(t,n)})},e.gzipSync=dt,e.gunzip=function(e,r,i){t.nextTick(function(){var t,n;try{n=mt(e,i)}catch(e){t=e}r(t,n)})},e.gunzipSync=mt}).call(this)}).call(this,r(1),r(0).Buffer)},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){return 3*t.length/4-h(t)},e.toByteArray=function(t){var e,r,i,o,a,f=t.length;o=h(t),a=new s(3*f/4-o),r=o>0?f-4:f;var u=0;for(e=0;e>16&255,a[u++]=i>>8&255,a[u++]=255&i;2===o?(i=n[t.charCodeAt(e)]<<2|n[t.charCodeAt(e+1)]>>4,a[u++]=255&i):1===o&&(i=n[t.charCodeAt(e)]<<10|n[t.charCodeAt(e+1)]<<4|n[t.charCodeAt(e+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i);return a},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,s="",o=[],a=0,f=r-n;af?f:a+16383));1===n?(e=t[r-1],s+=i[e>>2],s+=i[e<<4&63],s+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],s+=i[e>>10],s+=i[e>>4&63],s+=i[e<<2&63],s+="=");return o.push(s),o.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,f=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function u(t,e,r){for(var n,s,o=[],a=e;a>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,f=(1<>1,u=-7,c=r?n-1:0,l=r?-1:1,p=t[e+c];for(c+=l,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+t[e+c],c+=l,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+c],c+=l,u-=8);if(0===s)s=1-h;else{if(s===f)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=h}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,f,h=8*s-n-1,u=(1<>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,d=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),(e+=o+c>=1?l/f:l*Math.pow(2,1-c))*f>=2&&(o++,f/=2),o+c>=u?(a=0,o=u):o+c>=1?(a=(e*f-1)*Math.pow(2,n),o+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+p]=255&a,p+=d,a/=256,n-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,h-=8);t[r+p-d]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e){const i=r(19),n=r(22);t.exports=((t,r,s=70)=>{const o=e.from(r),a=n(o);let f=0,h=null,u=null,c=0,l=0;if(a&&"image/bmp"===a.mime){const e=i.decode(o);h=t._malloc(e.data.length*Uint8Array.BYTES_PER_ELEMENT),t.HEAPU8.set(e.data,h),c=e.width,l=e.height,f=4}else{const e=t._malloc(o.length*Uint8Array.BYTES_PER_ELEMENT);t.HEAPU8.set(o,e),u=t._pixReadMem(e,o.length),0===t.getValue(u+28,"i32")&&t.setValue(u+28,s,"i32"),[c,l]=Array(2).fill(0).map((e,r)=>t.getValue(u+4*r,"i32"))}return{w:c,h:l,bytesPerPixel:f,data:h,pix:u}})}).call(this,r(0).Buffer)},function(t,e,r){var i=r(20),n=r(21);t.exports={encode:i,decode:n}},function(t,e,r){(function(e){function r(t){this.buffer=t.data,this.width=t.width,this.height=t.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}r.prototype.encode=function(){var t=new e(this.offset+this.rgbSize);this.pos=0,t.write(this.flag,this.pos,2),this.pos+=2,t.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,t.writeUInt32LE(this.reserved,this.pos),this.pos+=4,t.writeUInt32LE(this.offset,this.pos),this.pos+=4,t.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,t.writeUInt32LE(this.width,this.pos),this.pos+=4,t.writeInt32LE(-this.height,this.pos),this.pos+=4,t.writeUInt16LE(this.planes,this.pos),this.pos+=2,t.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,t.writeUInt32LE(this.compress,this.pos),this.pos+=4,t.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,t.writeUInt32LE(this.hr,this.pos),this.pos+=4,t.writeUInt32LE(this.vr,this.pos),this.pos+=4,t.writeUInt32LE(this.colors,this.pos),this.pos+=4,t.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var r=0,i=3*this.width+this.extraBytes,n=0;n0){var a=this.pos+n*i+3*this.width;t.fill(0,a,a+this.extraBytes)}}return t},t.exports=function(t,e){return void 0===e&&(e=100),{data:new r(t).encode(),width:t.width,height:t.height}}}).call(this,r(0).Buffer)},function(t,e,r){(function(e){function r(t,e){if(this.pos=0,this.buffer=t,this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),"BM"!=this.flag)throw new Error("Invalid BMP File");this.parseHeader(),this.parseRGBA()}r.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<=0?this.height-1:-this.height;for(r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n>7-a&1];this.data[o+4*a]=0,this.data[o+4*a+1]=f.blue,this.data[o+4*a+2]=f.green,this.data[o+4*a+3]=f.red}0!=e&&(this.pos+=4-e)}},r.prototype.bit4=function(){if(2==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0,r=!1;t>4),1&f&&f+1>1&1)&&this.pos++}}else for(f=0;f>4),r=!r}function h(e){var r=this.palette[e];this.data[t]=0,this.data[t+1]=r.blue,this.data[t+2]=r.green,this.data[t+3]=r.red,t+=4}}else{var u=Math.ceil(this.width/2),c=u%4;for(o=this.height-1;o>=0;o--){var l=this.bottom_up?o:this.height-1-o;for(s=0;s>4,d=15&n,m=this.palette[p];if(this.data[t]=0,this.data[t+1]=m.blue,this.data[t+2]=m.green,this.data[t+3]=m.red,2*s+1>=this.width)break;m=this.palette[d],this.data[t+4]=0,this.data[t+4+1]=m.blue,this.data[t+4+2]=m.green,this.data[t+4+3]=m.red}0!=c&&(this.pos+=4-c)}}},r.prototype.bit8=function(){if(1==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0;t=0;s--){var u=this.bottom_up?s:this.height-1-s;for(n=0;n=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n>5&e)/e*255|0,f=(s>>10&e)/e*255|0,h=s>>15?255:0,u=i*this.width*4+4*n;this.data[u]=h,this.data[u+1]=o,this.data[u+2]=a,this.data[u+3]=f}this.pos+=t}},r.prototype.bit16=function(){var t=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,3==this.compress&&(this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4);for(var e=[0,0,0],r=0;r<16;r++)this.maskRed>>r&1&&e[0]++,this.maskGreen>>r&1&&e[1]++,this.maskBlue>>r&1&&e[2]++;e[1]+=e[0],e[2]+=e[1],e[0]=8-e[0],e[1]-=8,e[2]-=8;for(var i=this.height-1;i>=0;i--){for(var n=this.bottom_up?i:this.height-1-i,s=0;s>e[1],h=(o&this.maskRed)>>e[2],u=n*this.width*4+4*s;this.data[u]=0,this.data[u+1]=a,this.data[u+2]=f,this.data[u+3]=h}this.pos+=t}},r.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r=0;t--)for(e=this.bottom_up?t:this.height-1-t,r=0;r[...t].map(t=>t.charCodeAt(0)),xpiZipFilename=toBytes("META-INF/mozilla.rsa"),oxmlContentTypes=toBytes("[Content_Types].xml"),oxmlRels=toBytes("_rels/.rels");function readUInt64LE(t,e=0){let r=t[e],i=1,n=0;for(;++n<8;)i*=256,r+=t[e+n]*i;return r}const fileType=t=>{if(!(t instanceof Uint8Array||t instanceof ArrayBuffer||Buffer.isBuffer(t)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof t}\``);const e=t instanceof Uint8Array?t:new Uint8Array(t);if(!(e&&e.length>1))return null;const r=(t,r)=>{r=Object.assign({offset:0},r);for(let i=0;ir(toBytes(t),e);if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(r([80,75,3,4])){if(r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r(xpiZipFilename,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(i("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30}))return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};if(i("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30}))return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};if(i("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30}))return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};const t=(t,e=0)=>t.findIndex((t,r,i)=>r>=e&&80===i[r]&&75===i[r+1]&&3===i[r+2]&&4===i[r+3]);let n=0,s=!1,o=null;do{const a=n+30;if(s||(s=r(oxmlContentTypes,{offset:a})||r(oxmlRels,{offset:a})),o||(i("word/",{offset:a})?o={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:i("ppt/",{offset:a})?o={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:i("xl/",{offset:a})&&(o={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),s&&o)return o;n=t(e,a)}while(n>=0);if(o)return o}if(r([80,75])&&(3===e[2]||5===e[2]||7===e[2])&&(4===e[3]||6===e[3]||8===e[3]))return{ext:"zip",mime:"application/zip"};if(r([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(0===e[6]||1===e[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([51,103,112,53])||r([0,0,0])&&r([102,116,121,112],{offset:4})&&(r([109,112,52,49],{offset:8})||r([109,112,52,50],{offset:8})||r([105,115,111,109],{offset:8})||r([105,115,111,50],{offset:8})||r([109,109,112,52],{offset:8})||r([77,52,86],{offset:8})||r([100,97,115,104],{offset:8})))return{ext:"mp4",mime:"video/mp4"};if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){const t=e.subarray(4,4100),r=t.findIndex((t,e,r)=>66===r[e]&&130===r[e+1]);if(-1!==r){const e=r+3,i=r=>[...r].every((r,i)=>t[e+i]===r.charCodeAt(0));if(i("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(i("webm"))return{ext:"webm",mime:"video/webm"}}}if(r([0,0,0,20,102,116,121,112,113,116,32,32])||r([102,114,101,101],{offset:4})||r([102,116,121,112,113,116,32,32],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(r([48,38,178,117,142,102,207,17,166,217])){let t=30;do{const i=readUInt64LE(e,t+16);if(r([145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101],{offset:t})){if(r([64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wma",mime:"audio/x-ms-wma"};if(r([192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wmv",mime:"video/x-ms-asf"};break}t+=i}while(t+24<=e.length);return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([102,116,121,112,51,103],{offset:4}))return{ext:"3gp",mime:"video/3gpp"};for(let t=0;t<2&&tnew Promise((resolve,reject)=>{const stream=eval("require")("stream");readableStream.once("readable",()=>{const t=new stream.PassThrough,e=readableStream.read(module.exports.minimumBytes)||readableStream.read();try{t.fileType=fileType(e)}catch(t){reject(t)}readableStream.unshift(e),stream.pipeline?resolve(stream.pipeline(readableStream,t,()=>{})):resolve(readableStream.pipe(t))})}))}).call(this,__webpack_require__(0).Buffer)},function(t,e,r){(function(e){const i=r(3),n=e.browser?r(2):t=>t,s=r(4),o=r(26),a=r(27);t.exports=class{constructor(t={}){this.worker=null,this.options={...s.defaultOptions,...t},["corePath","workerPath","langPath"].forEach(e=>{i.not.undefined(t[e])&&(this.options={...this.options,[e]:n(t[e])})}),this._currentJob=null,this._queue=[]}recognize(t,e="eng",r={}){return this._sendJob("recognize",t,e,r)}detect(t,e={}){return this._sendJob("detect",t,"osd",e)}recv(t){this._currentJob.id===t.jobId?this._currentJob.handle({...t,data:"resolve"===t.status&&"recognize"===t.action?o(t.data):t.data}):console.warn(`Job ID ${t.jobId} not known.`)}dequeue(){this._currentJob=null,this._queue.length&&this._queue[0]()}terminate(){this.worker&&s.terminateWorker(this),this.worker=null,this._currentJob=null,this._queue=[]}_sendJob(t,e,r,i){return this._delay(n=>{n.send(t,{image:e,lang:r,params:i,options:this.options})})}_delay(t){i.null(this.worker)&&(this.worker=s.spawnWorker(this,this.options));const e=new a(this);return this._queue.push(()=>{this._queue.shift(),this._currentJob=e,t(e)}),i.null(this._currentJob)&&this.dequeue(),e}}}).call(this,r(1))},function(t,e){t.exports={defaultOptions:{langPath:"https://tessdata.projectnaptha.com/4.0.0"}}},function(t){t.exports={name:"tesseract.js",version:"2.0.0-alpha.2",description:"Pure Javascript Multilingual OCR",main:"src/index.js",scripts:{start:"node scripts/server.js",build:"webpack --config scripts/webpack.config.prod.js",prepublishOnly:"npm run build",test:"npm run test:node","test:node":"nyc mocha --exit --bail --require ./scripts/test-helper.js ./tests/*.test.js",lint:"eslint src"},browser:{"./src/node/index.js":"./src/browser/index.js"},author:"",contributors:["jeromewu"],license:"Apache-2.0",devDependencies:{eslint:"^5.9.0","eslint-config-airbnb":"^17.1.0","eslint-plugin-import":"^2.14.0","eslint-plugin-jsx-a11y":"^6.1.2","eslint-plugin-react":"^7.11.1","expect.js":"^0.3.1",express:"^4.16.4",mocha:"^5.2.0",nyc:"^13.1.0",webpack:"^4.26.0","webpack-cli":"^3.1.2","webpack-dev-middleware":"^3.4.0"},dependencies:{"check-types":"^7.4.0","is-url":"1.2.2","node-fetch":"^2.3.0","resolve-url":"^0.2.1","tesseract.js-core":"^2.0.0-beta.5","tesseract.js-utils":"^1.0.0-beta.5"},repository:{type:"git",url:"https://github.com/naptha/tesseract.js.git"},bugs:{url:"https://github.com/naptha/tesseract.js/issues"},homepage:"https://github.com/naptha/tesseract.js"}},function(t,e){t.exports=(t=>{const e={...t,paragraphs:[],lines:[],words:[],symbols:[]};return e.blocks.forEach(t=>{const r={...t,page:e,lines:[],words:[],symbols:[]};r.paragraphs.forEach(t=>{const i={...t,block:r,page:e,words:[],symbols:[]};i.lines.forEach(t=>{const n={...t,paragraph:i,block:r,page:e,symbols:[]};n.words.forEach(t=>{const s={...t,line:n,paragraph:i,block:r,page:e};s.symbols.forEach(t=>{const o={...t,word:s,line:n,paragraph:i,block:r,page:e};o.line.symbols.push(o),o.paragraph.symbols.push(o),o.block.symbols.push(o),o.page.symbols.push(o)}),s.paragraph.words.push(s),s.block.words.push(s),s.page.words.push(s)}),n.block.lines.push(n),n.page.lines.push(n)}),i.page.paragraphs.push(i)})}),e})},function(t,e,r){const i=r(4);let n=0;t.exports=class{constructor(t){n+=1,this.id=`Job-${n}-${Math.random().toString(16).slice(3,8)}`,this._worker=t,this._resolve=[],this._reject=[],this._progress=[],this._finally=[]}then(t,e){return this._resolve.push?this._resolve.push(t):t(this._resolve),e&&this.catch(e),this}catch(t){return this._reject.push?this._reject.push(t):t(this._reject),this}progress(t){return this._progress.push(t),this}finally(t){return this._finally.push(t),this}send(t,e){i.sendPacket(this._worker,{jobId:this.id,action:t,payload:e})}handle(t){const{data:e}=t;let r=!1;"resolve"===t.status?(0===this._resolve.length&&console.log(e),this._resolve.forEach(t=>{const r=t(e);r&&"function"==typeof r.then&&console.warn("TesseractJob instances do not chain like ES6 Promises. To convert it into a real promise, use Promise.resolve.")}),this._resolve=e,this._worker.dequeue(),r=!0):"reject"===t.status?(0===this._reject.length&&console.error(e),this._reject.forEach(t=>t(e)),this._reject=e,this._worker.dequeue(),r=!0):"progress"===t.status?this._progress.forEach(t=>t(e)):console.warn("Message type unknown",t.status),r&&this._finally.forEach(t=>t(e))}}}])}); -//# sourceMappingURL=tesseract.min.js.map \ No newline at end of file diff --git a/dist/tesseract.min.js.map b/dist/tesseract.min.js.map deleted file mode 100644 index 793f01a23..000000000 --- a/dist/tesseract.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack://Tesseract/webpack/universalModuleDefinition","webpack://Tesseract/webpack/bootstrap","webpack://Tesseract/./node_modules/buffer/index.js","webpack://Tesseract/./node_modules/process/browser.js","webpack://Tesseract/./node_modules/resolve-url/resolve-url.js","webpack://Tesseract/./node_modules/check-types/src/check-types.js","webpack://Tesseract/./src/browser/index.js","webpack://Tesseract/./src/index.js","webpack://Tesseract/./node_modules/tesseract.js-utils/src/index.browser.js","webpack://Tesseract/./node_modules/tesseract.js-utils/src/common/browser/cache.js","webpack://Tesseract/./node_modules/idb-keyval/dist/idb-keyval.mjs","webpack://Tesseract/./node_modules/tesseract.js-utils/src/loadLang.js","webpack://Tesseract/./node_modules/tesseract.js-utils/node_modules/is-url/index.js","webpack://Tesseract/./node_modules/tesseract.js-utils/src/common/browser/fetch.js","webpack://Tesseract/./node_modules/tesseract.js-utils/src/common/browser/gunzip.js","webpack://Tesseract/./node_modules/zlibjs/bin/node-zlib.js","webpack://Tesseract/(webpack)/buildin/global.js","webpack://Tesseract/./node_modules/base64-js/index.js","webpack://Tesseract/./node_modules/ieee754/index.js","webpack://Tesseract/./node_modules/isarray/index.js","webpack://Tesseract/./node_modules/tesseract.js-utils/src/readImage.js","webpack://Tesseract/./node_modules/bmp-js/index.js","webpack://Tesseract/./node_modules/bmp-js/lib/encoder.js","webpack://Tesseract/./node_modules/bmp-js/lib/decoder.js","webpack://Tesseract/./node_modules/file-type/index.js","webpack://Tesseract/./src/common/TesseractWorker.js","webpack://Tesseract/./src/common/options.js","webpack://Tesseract/./src/common/circularize.js","webpack://Tesseract/./src/common/TesseractJob.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","global","base64","ieee754","isArray","kMaxLength","Buffer","TYPED_ARRAY_SUPPORT","createBuffer","that","length","RangeError","Uint8Array","__proto__","arg","encodingOrOffset","this","Error","allocUnsafe","from","TypeError","ArrayBuffer","array","byteOffset","byteLength","undefined","fromArrayLike","fromArrayBuffer","string","encoding","isEncoding","actual","write","slice","fromString","obj","isBuffer","len","checked","copy","buffer","val","type","data","fromObject","assertSize","size","toString","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","swap","b","bidirectionalIndexOf","dir","isNaN","arrayIndexOf","indexOf","lastIndexOf","arr","indexSize","arrLength","valLength","String","read","buf","readUInt16BE","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","str","byteArray","push","charCodeAt","asciiToBytes","latin1Write","base64Write","ucs2Write","units","hi","lo","utf16leToBytes","base64Slice","start","end","fromByteArray","utf8Slice","Math","min","res","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","MAX_ARGUMENTS_LENGTH","fromCharCode","apply","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","foo","subarray","e","typedArraySupport","poolSize","_augment","species","configurable","fill","allocUnsafeSlow","_isBuffer","compare","a","x","y","concat","list","pos","swap16","swap32","swap64","arguments","hexSlice","asciiSlice","latin1Slice","utf16leSlice","equals","inspect","max","match","join","target","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","Array","_arr","ret","out","toHex","bytes","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","set","code","INVALID_BASE64_RE","Infinity","leadSurrogate","toByteArray","trim","replace","stringtrim","base64clean","src","dst","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","timeout","run","marker","runClearTimeout","Item","noop","nextTick","args","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","umask","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_RESULT__","numUrls","base","document","createElement","href","head","getElementsByTagName","insertBefore","firstChild","resolved","index","removeChild","globals","strings","messages","predicates","functions","assert","not","maybe","collections","neginf","posinf","haveSymbols","assigned","number","integer","greater","lhs","rhs","less","greaterOrEqual","lessOrEqual","nonEmptyString","instanceStrict","error","like","archetype","arrayLike","isFunction","testArray","result","testObject","mixin","source","keys","forEach","assertModifier","predicate","defaultMessage","argCount","message","ErrorType","assertImpl","assertPredicate","notModifier","modifiedPredicate","notImpl","ofModifier","collection","map","coerceCollection","item","ignore","createModifiedPredicates","modifier","createModifiedFunctions","shift","pop","writable","createModifiedModifier","modified","createOfModifiers","of","v","al","f","iterator","iteration","values","next","done","substring","regex","constructor","Date","getTime","hasLength","mapSimple","mapComplex","all","any","NEGATIVE_INFINITY","POSITIVE_INFINITY","exportFunctions","check","resolveURL","defaultOptions","readFromBlobOrFile","blob","fileReader","FileReader","onload","readAsArrayBuffer","loadImage","image","fetch","then","resp","arrayBuffer","instance","HTMLElement","tagName","poster","Promise","toBlob","File","reject","workerPath","TESS_ENV","random","corePath","WebAssembly","spawnWorker","worker","Blob","URL","Worker","createObjectURL","onmessage","recv","terminateWorker","terminate","sendPacket","iPacket","packet","payload","img","postMessage","utils","TesseractWorker","cache","loadLang","gunzip","readImage","del","readCache","writeCache","deleteCache","checkCache","path","__webpack_exports__","Store","clear","[object Object]","dbName","storeName","_dbp","resolve","openreq","indexedDB","open","onerror","onsuccess","onupgradeneeded","createObjectStore","callback","db","transaction","oncomplete","onabort","objectStore","store","getDefaultStore","req","_withIDBStore","put","delete","openKeyCursor","openCursor","continue","isURL","handleLang","TessModule","dataPath","cachePath","cacheMethod","lang","FS","mkdir","err","writeFile","langs","options","split","langPath","catch","fetchTrainedData","iLangPath","loadAndGunzipFile","protocolAndDomainRE","everythingAfterProtocol","localhostDomainRE","test","nonLocalhostDomainRE","gunzipSync","q","B","Uint16Array","Uint32Array","DataView","G","k","g","I","finish","L","aa","ba","R","ca","ha","S","ia","ja","ka","T","h","na","oa","F","input","lazy","compressionType","outputBuffer","outputIndex","getParent","U","pa","NONE","X","qa","va","N","w","C","u","ra","M","z","Y","da","Fa","ea","Ga","la","Ha","Z","ma","E","Ia","D","qb","ta","ua","sa","O","A","fa","H","Ja","Ka","K","J","P","Q","Na","ga","wa","Oa","Pa","Qa","Ra","La","Ma","xa","ya","za","Aa","Ba","flags","filename","comment","deflateOptions","fname","Ca","fcomment","Da","fhcrc","Ea","now","Sa","V","Ta","bufferSize","bufferType","resize","Ua","W","Va","Wa","Xa","Ya","$","ib","Za","$a","ab","bb","cb","eb","fb","gb","hb","kb","lb","jb","mb","nb","ob","verify","pb","method","rb","sb","ub","Bb","wb","noBuffer","yb","Ab","LOG2E","log","deflate","deflateSync","inflate","inflateSync","gzip","gzipSync","Function","eval","b64","placeHoldersCount","tmp","placeHolders","Arr","revLookup","uint8","extraBytes","output","parts","len2","encodeChunk","lookup","num","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","NaN","rt","abs","LN2","bmp","fileType","iBuf","yres","bytesPerPixel","pix","mime","bmpBuf","decode","_malloc","BYTES_PER_ELEMENT","HEAPU8","width","height","ptr","_pixReadMem","getValue","setValue","idx","encode","BmpEncoder","imgData","rgbSize","headerInfoSize","flag","reserved","fileSize","planes","bitPP","compress","hr","vr","colors","importantColors","tempBuffer","rowBytes","fillOffset","quality","BmpDecoder","is_with_alpha","bottom_up","parseHeader","parseRGBA","headerSize","rawSize","palette","blue","green","red","quad","bitn","bit1","xlen","ceil","line","location","rgb","bit4","lines","low_nibble","setPixelData","rgbIndex","before","after","bit8","bit15","dif_w","_1_5","alpha","bit16","maskRed","maskGreen","maskBlue","mask0","bit24","bit32","getData","bmpData","toBytes","xpiZipFilename","oxmlContentTypes","oxmlRels","readUInt64LE","header","assign","mask","checkString","findNextZipHeaderIndex","startAt","findIndex","el","zipHeaderIndex","oxmlFound","sliced","idPos","docTypePos","findDocType","every","objectSize","default","stream","readableStream","pass","PassThrough","chunk","minimumBytes","unshift","pipeline","pipe","adapter","circularize","TesseractJob","_currentJob","_queue","params","_sendJob","id","jobId","handle","status","action","console","warn","_delay","job","send","fn","null","dequeue","iPage","page","paragraphs","words","symbols","blocks","iBlock","block","iPara","para","iLine","paragraph","iWord","word","iSym","sym","jobCounter","_worker","_resolve","_reject","_progress","_finally","runFinallyCbs"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,OAAA,KA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AiT,GAEAA,EAAAtX,KAAA6wB,SAEA7wB,KAYA2Z,SAAA4V,GAEA,OADAvvB,KAAA8wB,UAAAzsB,KAAAkrB,GACAvvB,KAWA2Z,QAAA4V,GAEA,OADAvvB,KAAA+wB,SAAA1sB,KAAAkrB,GACAvvB,KAYA2Z,KAAAsV,EAAAxW,GACA6V,EAAAhW,WAAAtY,KAAA2wB,QAAA,CACA7B,MAAA9uB,KAAA6uB,GACAI,SACAxW,YAYAkB,OAAAnB,GACA,MAAA7W,KAAWA,GAAO6W,EAClB,IAAAwY,GAAA,EAEA,YAAAxY,EAAAwW,QACA,IAAAhvB,KAAA4wB,SAAAlxB,QAAAwvB,QAAA3J,IAAA5jB,GACA3B,KAAA4wB,SAAA7d,QAAAwc,IACA,MAAAxmB,EAAAwmB,EAAA5tB,GACAoH,GAAA,mBAAAA,EAAA6N,MACAsY,QAAAC,KAAA,oHAGAnvB,KAAA4wB,SAAAjvB,EACA3B,KAAA2wB,QAAAlB,UACAuB,GAAA,GACK,WAAAxY,EAAAwW,QACL,IAAAhvB,KAAA6wB,QAAAnxB,QAAAwvB,QAAA9c,MAAAzQ,GACA3B,KAAA6wB,QAAA9d,QAAAwc,KAAA5tB,IACA3B,KAAA6wB,QAAAlvB,EACA3B,KAAA2wB,QAAAlB,UACAuB,GAAA,GACK,aAAAxY,EAAAwW,OACLhvB,KAAA8wB,UAAA/d,QAAAwc,KAAA5tB,IAEAutB,QAAAC,KAAA,uBAAA3W,EAAAwW,QAGAgC,GACAhxB,KAAA+wB,SAAAhe,QAAAwc,KAAA5tB","file":"tesseract.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Tesseract\"] = factory();\n\telse\n\t\troot[\"Tesseract\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// Copyright 2014 Simon Lydell\r\n// X11 (“MIT”) Licensed. (See LICENSE.)\r\n\r\nvoid (function(root, factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define(factory)\r\n } else if (typeof exports === \"object\") {\r\n module.exports = factory()\r\n } else {\r\n root.resolveUrl = factory()\r\n }\r\n}(this, function() {\r\n\r\n function resolveUrl(/* ...urls */) {\r\n var numUrls = arguments.length\r\n\r\n if (numUrls === 0) {\r\n throw new Error(\"resolveUrl requires at least one argument; got none.\")\r\n }\r\n\r\n var base = document.createElement(\"base\")\r\n base.href = arguments[0]\r\n\r\n if (numUrls === 1) {\r\n return base.href\r\n }\r\n\r\n var head = document.getElementsByTagName(\"head\")[0]\r\n head.insertBefore(base, head.firstChild)\r\n\r\n var a = document.createElement(\"a\")\r\n var resolved\r\n\r\n for (var index = 1; index < numUrls; index++) {\r\n a.href = arguments[index]\r\n resolved = a.href\r\n base.href = resolved\r\n }\r\n\r\n head.removeChild(base)\r\n\r\n return resolved\r\n }\r\n\r\n return resolveUrl\r\n\r\n}));\r\n","/*globals define, module, Symbol */\n/*jshint -W056 */\n\n(function (globals) {\n 'use strict';\n\n var strings, messages, predicates, functions, assert, not, maybe,\n collections, slice, neginf, posinf, isArray, haveSymbols;\n\n strings = {\n v: 'value',\n n: 'number',\n s: 'string',\n b: 'boolean',\n o: 'object',\n t: 'type',\n a: 'array',\n al: 'array-like',\n i: 'iterable',\n d: 'date',\n f: 'function',\n l: 'length'\n };\n\n messages = {};\n predicates = {};\n\n [\n { n: 'equal', f: equal, s: 'v' },\n { n: 'undefined', f: isUndefined, s: 'v' },\n { n: 'null', f: isNull, s: 'v' },\n { n: 'assigned', f: assigned, s: 'v' },\n { n: 'primitive', f: primitive, s: 'v' },\n { n: 'includes', f: includes, s: 'v' },\n { n: 'zero', f: zero },\n { n: 'infinity', f: infinity },\n { n: 'number', f: number },\n { n: 'integer', f: integer },\n { n: 'even', f: even },\n { n: 'odd', f: odd },\n { n: 'greater', f: greater },\n { n: 'less', f: less },\n { n: 'between', f: between },\n { n: 'greaterOrEqual', f: greaterOrEqual },\n { n: 'lessOrEqual', f: lessOrEqual },\n { n: 'inRange', f: inRange },\n { n: 'positive', f: positive },\n { n: 'negative', f: negative },\n { n: 'string', f: string, s: 's' },\n { n: 'emptyString', f: emptyString, s: 's' },\n { n: 'nonEmptyString', f: nonEmptyString, s: 's' },\n { n: 'contains', f: contains, s: 's' },\n { n: 'match', f: match, s: 's' },\n { n: 'boolean', f: boolean, s: 'b' },\n { n: 'object', f: object, s: 'o' },\n { n: 'emptyObject', f: emptyObject, s: 'o' },\n { n: 'nonEmptyObject', f: nonEmptyObject, s: 'o' },\n { n: 'instanceStrict', f: instanceStrict, s: 't' },\n { n: 'instance', f: instance, s: 't' },\n { n: 'like', f: like, s: 't' },\n { n: 'array', f: array, s: 'a' },\n { n: 'emptyArray', f: emptyArray, s: 'a' },\n { n: 'nonEmptyArray', f: nonEmptyArray, s: 'a' },\n { n: 'arrayLike', f: arrayLike, s: 'al' },\n { n: 'iterable', f: iterable, s: 'i' },\n { n: 'date', f: date, s: 'd' },\n { n: 'function', f: isFunction, s: 'f' },\n { n: 'hasLength', f: hasLength, s: 'l' },\n ].map(function (data) {\n var n = data.n;\n messages[n] = 'Invalid ' + strings[data.s || 'n'];\n predicates[n] = data.f;\n });\n\n functions = {\n apply: apply,\n map: map,\n all: all,\n any: any\n };\n\n collections = [ 'array', 'arrayLike', 'iterable', 'object' ];\n slice = Array.prototype.slice;\n neginf = Number.NEGATIVE_INFINITY;\n posinf = Number.POSITIVE_INFINITY;\n isArray = Array.isArray;\n haveSymbols = typeof Symbol === 'function';\n\n functions = mixin(functions, predicates);\n assert = createModifiedPredicates(assertModifier, assertImpl);\n not = createModifiedPredicates(notModifier, notImpl);\n maybe = createModifiedPredicates(maybeModifier, maybeImpl);\n assert.not = createModifiedModifier(assertModifier, not);\n assert.maybe = createModifiedModifier(assertModifier, maybe);\n\n collections.forEach(createOfPredicates);\n createOfModifiers(assert, assertModifier);\n createOfModifiers(not, notModifier);\n collections.forEach(createMaybeOfModifiers);\n\n exportFunctions(mixin(functions, {\n assert: assert,\n not: not,\n maybe: maybe\n }));\n\n /**\n * Public function `equal`.\n *\n * Returns true if `lhs` and `rhs` are strictly equal, without coercion.\n * Returns false otherwise.\n */\n function equal (lhs, rhs) {\n return lhs === rhs;\n }\n\n /**\n * Public function `undefined`.\n *\n * Returns true if `data` is undefined, false otherwise.\n */\n function isUndefined (data) {\n return data === undefined;\n }\n\n /**\n * Public function `null`.\n *\n * Returns true if `data` is null, false otherwise.\n */\n function isNull (data) {\n return data === null;\n }\n\n /**\n * Public function `assigned`.\n *\n * Returns true if `data` is not null or undefined, false otherwise.\n */\n function assigned (data) {\n return data !== undefined && data !== null;\n }\n\n /**\n * Public function `primitive`.\n *\n * Returns true if `data` is a primitive type, false otherwise.\n */\n function primitive (data) {\n var type;\n\n switch (data) {\n case null:\n case undefined:\n case false:\n case true:\n return true;\n }\n\n type = typeof data;\n return type === 'string' || type === 'number' || (haveSymbols && type === 'symbol');\n }\n\n /**\n * Public function `zero`.\n *\n * Returns true if `data` is zero, false otherwise.\n */\n function zero (data) {\n return data === 0;\n }\n\n /**\n * Public function `infinity`.\n *\n * Returns true if `data` is positive or negative infinity, false otherwise.\n */\n function infinity (data) {\n return data === neginf || data === posinf;\n }\n\n /**\n * Public function `number`.\n *\n * Returns true if `data` is a number, false otherwise.\n */\n function number (data) {\n return typeof data === 'number' && data > neginf && data < posinf;\n }\n\n /**\n * Public function `integer`.\n *\n * Returns true if `data` is an integer, false otherwise.\n */\n function integer (data) {\n return typeof data === 'number' && data % 1 === 0;\n }\n\n /**\n * Public function `even`.\n *\n * Returns true if `data` is an even number, false otherwise.\n */\n function even (data) {\n return typeof data === 'number' && data % 2 === 0;\n }\n\n /**\n * Public function `odd`.\n *\n * Returns true if `data` is an odd number, false otherwise.\n */\n function odd (data) {\n return integer(data) && data % 2 !== 0;\n }\n\n /**\n * Public function `greater`.\n *\n * Returns true if `lhs` is a number greater than `rhs`, false otherwise.\n */\n function greater (lhs, rhs) {\n return number(lhs) && lhs > rhs;\n }\n\n /**\n * Public function `less`.\n *\n * Returns true if `lhs` is a number less than `rhs`, false otherwise.\n */\n function less (lhs, rhs) {\n return number(lhs) && lhs < rhs;\n }\n\n /**\n * Public function `between`.\n *\n * Returns true if `data` is a number between `x` and `y`, false otherwise.\n */\n function between (data, x, y) {\n if (x < y) {\n return greater(data, x) && data < y;\n }\n\n return less(data, x) && data > y;\n }\n\n /**\n * Public function `greaterOrEqual`.\n *\n * Returns true if `lhs` is a number greater than or equal to `rhs`, false\n * otherwise.\n */\n function greaterOrEqual (lhs, rhs) {\n return number(lhs) && lhs >= rhs;\n }\n\n /**\n * Public function `lessOrEqual`.\n *\n * Returns true if `lhs` is a number less than or equal to `rhs`, false\n * otherwise.\n */\n function lessOrEqual (lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }\n\n /**\n * Public function `inRange`.\n *\n * Returns true if `data` is a number in the range `x..y`, false otherwise.\n */\n function inRange (data, x, y) {\n if (x < y) {\n return greaterOrEqual(data, x) && data <= y;\n }\n\n return lessOrEqual(data, x) && data >= y;\n }\n\n /**\n * Public function `positive`.\n *\n * Returns true if `data` is a positive number, false otherwise.\n */\n function positive (data) {\n return greater(data, 0);\n }\n\n /**\n * Public function `negative`.\n *\n * Returns true if `data` is a negative number, false otherwise.\n */\n function negative (data) {\n return less(data, 0);\n }\n\n /**\n * Public function `string`.\n *\n * Returns true if `data` is a string, false otherwise.\n */\n function string (data) {\n return typeof data === 'string';\n }\n\n /**\n * Public function `emptyString`.\n *\n * Returns true if `data` is the empty string, false otherwise.\n */\n function emptyString (data) {\n return data === '';\n }\n\n /**\n * Public function `nonEmptyString`.\n *\n * Returns true if `data` is a non-empty string, false otherwise.\n */\n function nonEmptyString (data) {\n return string(data) && data !== '';\n }\n\n /**\n * Public function `contains`.\n *\n * Returns true if `data` is a string that contains `substring`, false\n * otherwise.\n */\n function contains (data, substring) {\n return string(data) && data.indexOf(substring) !== -1;\n }\n\n /**\n * Public function `match`.\n *\n * Returns true if `data` is a string that matches `regex`, false otherwise.\n */\n function match (data, regex) {\n return string(data) && !! data.match(regex);\n }\n\n /**\n * Public function `boolean`.\n *\n * Returns true if `data` is a boolean value, false otherwise.\n */\n function boolean (data) {\n return data === false || data === true;\n }\n\n /**\n * Public function `object`.\n *\n * Returns true if `data` is a plain-old JS object, false otherwise.\n */\n function object (data) {\n return Object.prototype.toString.call(data) === '[object Object]';\n }\n\n /**\n * Public function `emptyObject`.\n *\n * Returns true if `data` is an empty object, false otherwise.\n */\n function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }\n\n /**\n * Public function `nonEmptyObject`.\n *\n * Returns true if `data` is a non-empty object, false otherwise.\n */\n function nonEmptyObject (data) {\n return object(data) && Object.keys(data).length > 0;\n }\n\n /**\n * Public function `instanceStrict`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n */\n function instanceStrict (data, prototype) {\n try {\n return data instanceof prototype;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `instance`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n * Falls back to testing constructor.name and Object.prototype.toString\n * if the initial instanceof test fails.\n */\n function instance (data, prototype) {\n try {\n return instanceStrict(data, prototype) ||\n data.constructor.name === prototype.name ||\n Object.prototype.toString.call(data) === '[object ' + prototype.name + ']';\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `like`.\n *\n * Tests whether `data` 'quacks like a duck'. Returns true if `data` has all\n * of the properties of `archetype` (the 'duck'), false otherwise.\n */\n function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /**\n * Public function `array`.\n *\n * Returns true if `data` is an array, false otherwise.\n */\n function array (data) {\n return isArray(data);\n }\n\n /**\n * Public function `emptyArray`.\n *\n * Returns true if `data` is an empty array, false otherwise.\n */\n function emptyArray (data) {\n return array(data) && data.length === 0;\n }\n\n /**\n * Public function `nonEmptyArray`.\n *\n * Returns true if `data` is a non-empty array, false otherwise.\n */\n function nonEmptyArray (data) {\n return array(data) && greater(data.length, 0);\n }\n\n /**\n * Public function `arrayLike`.\n *\n * Returns true if `data` is an array-like object, false otherwise.\n */\n function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }\n\n /**\n * Public function `iterable`.\n *\n * Returns true if `data` is an iterable, false otherwise.\n */\n function iterable (data) {\n if (! haveSymbols) {\n // Fall back to `arrayLike` predicate in pre-ES6 environments.\n return arrayLike(data);\n }\n\n return assigned(data) && isFunction(data[Symbol.iterator]);\n }\n\n /**\n * Public function `includes`.\n *\n * Returns true if `data` contains `value`, false otherwise.\n */\n function includes (data, value) {\n var iterator, iteration, keys, length, i;\n\n if (! assigned(data)) {\n return false;\n }\n\n if (haveSymbols && data[Symbol.iterator] && isFunction(data.values)) {\n iterator = data.values();\n\n do {\n iteration = iterator.next();\n\n if (iteration.value === value) {\n return true;\n }\n } while (! iteration.done);\n\n return false;\n }\n\n keys = Object.keys(data);\n length = keys.length;\n for (i = 0; i < length; ++i) {\n if (data[keys[i]] === value) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Public function `hasLength`.\n *\n * Returns true if `data` has a length property that equals `length`, false\n * otherwise.\n */\n function hasLength (data, length) {\n return assigned(data) && data.length === length;\n }\n\n /**\n * Public function `date`.\n *\n * Returns true if `data` is a valid date, false otherwise.\n */\n function date (data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }\n\n /**\n * Public function `function`.\n *\n * Returns true if `data` is a function, false otherwise.\n */\n function isFunction (data) {\n return typeof data === 'function';\n }\n\n /**\n * Public function `apply`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result array. If the same function is to be applied across all of the\n * data, a single predicate function may be passed in.\n *\n */\n function apply (data, predicates) {\n assert.array(data);\n\n if (isFunction(predicates)) {\n return data.map(function (value) {\n return predicates(value);\n });\n }\n\n assert.array(predicates);\n assert.hasLength(data, predicates.length);\n\n return data.map(function (value, index) {\n return predicates[index](value);\n });\n }\n\n /**\n * Public function `map`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result object. Supports nested objects. If the `data` is not nested and\n * the same function is to be applied across all of it, a single predicate\n * function may be passed in.\n *\n */\n function map (data, predicates) {\n assert.object(data);\n\n if (isFunction(predicates)) {\n return mapSimple(data, predicates);\n }\n\n assert.object(predicates);\n\n return mapComplex(data, predicates);\n }\n\n function mapSimple (data, predicate) {\n var result = {};\n\n Object.keys(data).forEach(function (key) {\n result[key] = predicate(data[key]);\n });\n\n return result;\n }\n\n function mapComplex (data, predicates) {\n var result = {};\n\n Object.keys(predicates).forEach(function (key) {\n var predicate = predicates[key];\n\n if (isFunction(predicate)) {\n if (not.assigned(data)) {\n result[key] = !!predicate.m;\n } else {\n result[key] = predicate(data[key]);\n }\n } else if (object(predicate)) {\n result[key] = mapComplex(data[key], predicate);\n }\n });\n\n return result;\n }\n\n /**\n * Public function `all`\n *\n * Check that all boolean values are true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n return testObject(data, false);\n }\n\n function testArray (data, result) {\n var i;\n\n for (i = 0; i < data.length; i += 1) {\n if (data[i] === result) {\n return result;\n }\n }\n\n return !result;\n }\n\n function testObject (data, result) {\n var key, value;\n\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n value = data[key];\n\n if (object(value) && testObject(value, result) === result) {\n return result;\n }\n\n if (value === result) {\n return result;\n }\n }\n }\n\n return !result;\n }\n\n /**\n * Public function `any`\n *\n * Check that at least one boolean value is true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function any (data) {\n if (array(data)) {\n return testArray(data, true);\n }\n\n assert.object(data);\n\n return testObject(data, true);\n }\n\n function mixin (target, source) {\n Object.keys(source).forEach(function (key) {\n target[key] = source[key];\n });\n\n return target;\n }\n\n /**\n * Public modifier `assert`.\n *\n * Throws if `predicate` returns false.\n */\n function assertModifier (predicate, defaultMessage) {\n return function () {\n return assertPredicate(predicate, arguments, defaultMessage);\n };\n }\n\n function assertPredicate (predicate, args, defaultMessage) {\n var argCount = predicate.l || predicate.length;\n var message = args[argCount];\n var ErrorType = args[argCount + 1];\n assertImpl(\n predicate.apply(null, args),\n nonEmptyString(message) ? message : defaultMessage,\n isFunction(ErrorType) ? ErrorType : TypeError\n );\n return args[0];\n }\n\n function assertImpl (value, message, ErrorType) {\n if (value) {\n return value;\n }\n throw new (ErrorType || Error)(message || 'Assertion failed');\n }\n\n /**\n * Public modifier `not`.\n *\n * Negates `predicate`.\n */\n function notModifier (predicate) {\n var modifiedPredicate = function () {\n return notImpl(predicate.apply(null, arguments));\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function notImpl (value) {\n return !value;\n }\n\n /**\n * Public modifier `maybe`.\n *\n * Returns true if predicate argument is null or undefined,\n * otherwise propagates the return value from `predicate`.\n */\n function maybeModifier (predicate) {\n var modifiedPredicate = function () {\n if (not.assigned(arguments[0])) {\n return true;\n }\n\n return predicate.apply(null, arguments);\n };\n modifiedPredicate.l = predicate.length;\n\n // Hackishly indicate that this is a maybe.xxx predicate.\n // Without this flag, the alternative would be to iterate\n // through the maybe predicates or use indexOf to check,\n // which would be time-consuming.\n modifiedPredicate.m = true;\n\n return modifiedPredicate;\n }\n\n function maybeImpl (value) {\n if (assigned(value) === false) {\n return true;\n }\n\n return value;\n }\n\n /**\n * Public modifier `of`.\n *\n * Applies the chained predicate to members of the collection.\n */\n function ofModifier (target, type, predicate) {\n var modifiedPredicate = function () {\n var collection, args;\n\n collection = arguments[0];\n\n if (target === 'maybe' && not.assigned(collection)) {\n return true;\n }\n\n if (!type(collection)) {\n return false;\n }\n\n collection = coerceCollection(type, collection);\n args = slice.call(arguments, 1);\n\n try {\n collection.forEach(function (item) {\n if (\n (target !== 'maybe' || assigned(item)) &&\n !predicate.apply(null, [ item ].concat(args))\n ) {\n // TODO: Replace with for...of when ES6 is required.\n throw 0;\n }\n });\n } catch (ignore) {\n return false;\n }\n\n return true;\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function coerceCollection (type, collection) {\n switch (type) {\n case arrayLike:\n return slice.call(collection);\n case object:\n return Object.keys(collection).map(function (key) {\n return collection[key];\n });\n default:\n return collection;\n }\n }\n\n function createModifiedPredicates (modifier, object) {\n return createModifiedFunctions([ modifier, predicates, object ]);\n }\n\n function createModifiedFunctions (args) {\n var modifier, object, functions, result;\n\n modifier = args.shift();\n object = args.pop();\n functions = args.pop();\n\n result = object || {};\n\n Object.keys(functions).forEach(function (key) {\n Object.defineProperty(result, key, {\n configurable: false,\n enumerable: true,\n writable: false,\n value: modifier.apply(null, args.concat(functions[key], messages[key]))\n });\n });\n\n return result;\n }\n\n function createModifiedModifier (modifier, modified) {\n return createModifiedFunctions([ modifier, modified, null ]);\n }\n\n function createOfPredicates (key) {\n predicates[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, null), predicates[key], predicates, null ]\n );\n }\n\n function createOfModifiers (base, modifier) {\n collections.forEach(function (key) {\n base[key].of = createModifiedModifier(modifier, predicates[key].of);\n });\n }\n\n function createMaybeOfModifiers (key) {\n maybe[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, 'maybe'), predicates[key], predicates, null ]\n );\n assert.maybe[key].of = createModifiedModifier(assertModifier, maybe[key].of);\n assert.not[key].of = createModifiedModifier(assertModifier, not[key].of);\n }\n\n function exportFunctions (functions) {\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return functions;\n });\n } else if (typeof module !== 'undefined' && module !== null && module.exports) {\n module.exports = functions;\n } else {\n globals.check = functions;\n }\n }\n}(this));\n","/**\n *\n * Tesseract Worker adapter for browser\n *\n * @fileoverview Tesseract Worker adapter for browser\n * @author Kevin Kwok \n * @author Guillermo Webster \n * @author Jerome Wu \n */\nconst check = require('check-types');\nconst resolveURL = require('resolve-url');\nconst { defaultOptions } = require('../common/options');\nconst { version } = require('../../package.json');\n\n/**\n * readFromBlobOrFile\n *\n * @name readFromBlobOrFile\n * @function\n * @access private\n * @param {object} blob A blob or file objec to read\n * @param {function} res callback function after reading completes\n */\nconst readFromBlobOrFile = (blob, res) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n res(fileReader.result);\n };\n fileReader.readAsArrayBuffer(blob);\n};\n\n/**\n * loadImage\n *\n * @name loadImage\n * @function load image from different source\n * @access private\n * @param {string, object} image - image source, supported formats:\n * string: URL string, can be relative path\n * img HTMLElement: extract image source from src attribute\n * video HTMLElement: extract image source from poster attribute\n * canvas HTMLElement: extract image data by converting to Blob \n * File instance: data from \n * @returns {array} binary image in array format\n */\nconst loadImage = (image) => {\n if (check.string(image)) {\n return fetch(resolveURL(image))\n .then(resp => resp.arrayBuffer());\n }\n if (check.instance(image, HTMLElement)) {\n if (image.tagName === 'IMG') {\n return loadImage(image.src);\n }\n if (image.tagName === 'VIDEO') {\n return loadImage(image.poster);\n }\n if (image.tagName === 'CANVAS') {\n return new Promise((res) => {\n image.toBlob((blob) => {\n readFromBlobOrFile(blob, res);\n });\n });\n }\n }\n if (check.instance(image, File)) {\n return new Promise((res) => {\n readFromBlobOrFile(image, res);\n });\n }\n return Promise.reject();\n};\n\n/*\n * Default options for browser worker\n */\nexports.defaultOptions = {\n ...defaultOptions,\n workerPath: process.env.TESS_ENV === 'development'\n ? resolveURL(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`)\n : `https://cdn.jsdelivr.net/gh/naptha/tesseract.js@v${version}/dist/worker.min.js`,\n /*\n * If browser doesn't support WebAssembly,\n * load ASM version instead\n */\n corePath: `https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core${typeof WebAssembly === 'object' ? '' : '.asm'}.js`,\n};\n\n/**\n * spawnWorker\n *\n * @name spawnWorker\n * @function create a new Worker in browser\n * @access public\n * @param {object} instance - TesseractWorker instance\n * @param {object} options\n * @param {string} options.workerPath - worker script path\n */\nexports.spawnWorker = (instance, { workerPath }) => {\n let worker;\n if (window.Blob && window.URL) {\n const blob = new Blob([`importScripts(\"${workerPath}\");`]);\n worker = new Worker(window.URL.createObjectURL(blob));\n } else {\n worker = new Worker(workerPath);\n }\n\n worker.onmessage = ({ data }) => {\n instance.recv(data);\n };\n\n return worker;\n};\n\n/**\n * terminateWorker\n *\n * @name terminateWorker\n * @function terminate worker\n * @access public\n * @param {object} instance TesseractWorker instance\n */\nexports.terminateWorker = (instance) => {\n instance.worker.terminate();\n};\n\n/**\n * sendPacket\n *\n * @name sendPacket\n * @function send packet to worker and create a job\n * @access public\n * @param {object} instance TesseractWorker instance\n * @param {object} iPacket data for worker\n */\nexports.sendPacket = (instance, iPacket) => {\n const packet = { ...iPacket };\n loadImage(packet.payload.image)\n .then(buf => new Uint8Array(buf))\n .then((img) => {\n packet.payload.image = Array.from(img);\n instance.worker.postMessage(packet);\n });\n};\n","/**\n *\n * Entry point for tesseract.js, should be the entry when bundling.\n *\n * @fileoverview entry point for tesseract.js\n * @author Kevin Kwok \n * @author Guillermo Webster \n * @author Jerome Wu \n */\nconst utils = require('tesseract.js-utils');\nconst TesseractWorker = require('./common/TesseractWorker');\n\nmodule.exports = {\n /** Worker for OCR, @see common/TesseractWorker.js */\n TesseractWorker,\n /** Utilities for tesseract.js, @see {@link https://www.npmjs.com/package/tesseract.js-utils} */\n utils,\n};\n","const cache = require('./common/browser/cache');\n\nmodule.exports = {\n loadLang: require('./loadLang')({\n fetch: require('./common/browser/fetch'),\n gunzip: require('./common/browser/gunzip'),\n resolveURL: require('resolve-url'),\n ...cache,\n }),\n readImage: require('./readImage'),\n cache,\n};\n","const { set, get, del } = require('idb-keyval');\n\nmodule.exports = {\n readCache: get,\n writeCache: set,\n deleteCache: del,\n checkCache: path => (\n get(path)\n .then(v => typeof v !== 'undefined')\n ),\n};\n","class Store {\r\n constructor(dbName = 'keyval-store', storeName = 'keyval') {\r\n this.storeName = storeName;\r\n this._dbp = new Promise((resolve, reject) => {\r\n const openreq = indexedDB.open(dbName, 1);\r\n openreq.onerror = () => reject(openreq.error);\r\n openreq.onsuccess = () => resolve(openreq.result);\r\n // First time setup: create an empty object store\r\n openreq.onupgradeneeded = () => {\r\n openreq.result.createObjectStore(storeName);\r\n };\r\n });\r\n }\r\n _withIDBStore(type, callback) {\r\n return this._dbp.then(db => new Promise((resolve, reject) => {\r\n const transaction = db.transaction(this.storeName, type);\r\n transaction.oncomplete = () => resolve();\r\n transaction.onabort = transaction.onerror = () => reject(transaction.error);\r\n callback(transaction.objectStore(this.storeName));\r\n }));\r\n }\r\n}\r\nlet store;\r\nfunction getDefaultStore() {\r\n if (!store)\r\n store = new Store();\r\n return store;\r\n}\r\nfunction get(key, store = getDefaultStore()) {\r\n let req;\r\n return store._withIDBStore('readonly', store => {\r\n req = store.get(key);\r\n }).then(() => req.result);\r\n}\r\nfunction set(key, value, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.put(value, key);\r\n });\r\n}\r\nfunction del(key, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.delete(key);\r\n });\r\n}\r\nfunction clear(store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.clear();\r\n });\r\n}\r\nfunction keys(store = getDefaultStore()) {\r\n const keys = [];\r\n return store._withIDBStore('readonly', store => {\r\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\r\n // And openKeyCursor isn't supported by Safari.\r\n (store.openKeyCursor || store.openCursor).call(store).onsuccess = function () {\r\n if (!this.result)\r\n return;\r\n keys.push(this.result.key);\r\n this.result.continue();\r\n };\r\n }).then(() => keys);\r\n}\n\nexport { Store, get, set, del, clear, keys };\n","const isURL = require('is-url');\n\nconst handleLang = modules => ({\n TessModule,\n dataPath,\n cachePath,\n cacheMethod,\n lang,\n}) => (data) => {\n if (TessModule) {\n if (dataPath) {\n try {\n TessModule.FS.mkdir(dataPath);\n } catch (err) {\n // TODO: Do some error handling here.\n }\n }\n TessModule.FS.writeFile(`${dataPath || '.'}/${lang}.traineddata`, data);\n }\n if (['write', 'refresh', undefined].includes(cacheMethod)) {\n return modules.writeCache(`${cachePath || '.'}/${lang}.traineddata`, data)\n .then(() => data);\n }\n\n return data;\n};\n\nconst loadAndGunzipFile = modules => ({\n langPath,\n cachePath,\n cacheMethod,\n ...options\n}) => (lang) => {\n let { readCache } = modules;\n if (['refresh', 'none'].includes(cacheMethod)) {\n readCache = () => Promise.resolve();\n }\n\n return readCache(`${cachePath || '.'}/${lang}.traineddata`)\n .then((data) => {\n if (typeof data === 'undefined') {\n return Promise.reject();\n }\n return handleLang(modules)({\n cachePath, cacheMethod, lang, ...options,\n })(data);\n })\n .catch(() => {\n const fetchTrainedData = iLangPath => (\n modules.fetch(`${iLangPath}/${lang}.traineddata.gz`)\n .then(resp => resp.arrayBuffer())\n .then(buf => modules.gunzip(new Uint8Array(buf)))\n .then(handleLang(modules)({\n cachePath, cacheMethod, lang, ...options,\n }))\n );\n\n /** When langPath is an URL, just do the fetch */\n if (isURL(langPath)) {\n return fetchTrainedData(langPath);\n }\n\n /** When langPath is not an URL in browser environment */\n if (process.browser) {\n return fetchTrainedData(modules.resolveURL(langPath));\n }\n\n /** When langPath is not an URL in Node.js environment */\n return modules.readCache(`${langPath}/${lang}.traineddata.gz`)\n .then(buf => modules.gunzip(new Uint8Array(buf)))\n .then(handleLang(modules)({\n cachePath, cacheMethod, lang, ...options,\n }));\n });\n};\n\n/**\n *\n * @name loadLang\n * @function load language(s) from local cache, download from remote if not in cache.\n * @param {object} options\n * @param {string} options.lang - langs to load, use '+' for multiple languages, ex: eng+chi_tra\n * @param {object} options.TessModule - TesseractModule\n * @param {string} options.langPath - prefix path for downloading lang file\n * @param {string} options.cachePath - path to find cache\n * @param {string} options.dataPath - path to store data in mem\n * @param {string} options.cacheMethod -\n * method of cache invaliation, should one of following options:\n * write: read cache and write back (default method)\n * readOnly: read cache and not to write back\n * refresh: not to read cache and write back\n * none: not to read cache and not to write back\n *\n */\nmodule.exports = modules => ({\n lang: langs,\n ...options\n}) => (\n Promise\n .all(langs.split('+').map(loadAndGunzipFile(modules)(options)))\n);\n","\n/**\n * Expose `isUrl`.\n */\n\nmodule.exports = isUrl;\n\n/**\n * RegExps.\n * A URL must match #1 and then at least one of #2/#3.\n * Use two levels of REs to avoid REDOS.\n */\n\nvar protocolAndDomainRE = /^(?:\\w+:)?\\/\\/(\\S+)$/;\n\nvar localhostDomainRE = /^localhost[\\:?\\d]*(?:[^\\:?\\d]\\S*)?$/\nvar nonLocalhostDomainRE = /^[^\\s\\.]+\\.\\S{2,}$/;\n\n/**\n * Loosely validate a URL `string`.\n *\n * @param {String} string\n * @return {Boolean}\n */\n\nfunction isUrl(string){\n if (typeof string !== 'string') {\n return false;\n }\n\n var match = string.match(protocolAndDomainRE);\n if (!match) {\n return false;\n }\n\n var everythingAfterProtocol = match[1];\n if (!everythingAfterProtocol) {\n return false;\n }\n\n if (localhostDomainRE.test(everythingAfterProtocol) ||\n nonLocalhostDomainRE.test(everythingAfterProtocol)) {\n return true;\n }\n\n return false;\n}\n","module.exports = fetch.bind();\n","module.exports = require('zlibjs').gunzipSync;\n","/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function q(b){throw b;}var t=void 0,v=!0;var B=\"undefined\"!==typeof Uint8Array&&\"undefined\"!==typeof Uint16Array&&\"undefined\"!==typeof Uint32Array&&\"undefined\"!==typeof DataView;function G(b,a){this.index=\"number\"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error(\"invalid index\"));this.buffer.length<=this.index&&this.f()}G.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new (B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a>>8&255]<<16|I[b>>>16&255]<<8|I[b>>>24&255])>>32-a:I[b]>>8-a);if(8>a+f)g=g<>a-k-1&1,8===++f&&(f=0,d[e++]=I[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};G.prototype.finish=function(){var b=this.buffer,a=this.index,c;0L;++L){for(var R=L,ba=R,ca=7,R=R>>>1;R;R>>>=1)ba<<=1,ba|=R&1,--ca;aa[L]=(ba<>>0}var I=aa;function ha(b,a,c){var d,e=\"number\"===typeof a?a:a=0,f=\"number\"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^S[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^S[(d^b[a])&255],d=d>>>8^S[(d^b[a+1])&255],d=d>>>8^S[(d^b[a+2])&255],d=d>>>8^S[(d^b[a+3])&255],d=d>>>8^S[(d^b[a+4])&255],d=d>>>8^S[(d^b[a+5])&255],d=d>>>8^S[(d^b[a+6])&255],d=d>>>8^S[(d^b[a+7])&255];return(d^4294967295)>>>0}\nvar ia=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,\n2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,\n2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,\n2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,\n3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,\n936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],S=B?new Uint32Array(ia):ia;function ja(){};function ka(b){this.buffer=new (B?Uint16Array:Array)(2*b);this.length=0}ka.prototype.getParent=function(b){return 2*((b-2)/4|0)};ka.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};\nka.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function T(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,m,r,p,l,n;for(p=0;pc&&(c=b[p]),b[p]>=1;n=g<<16|p;for(l=m;lU;U++)switch(v){case 143>=U:qa.push([U+48,8]);break;case 255>=U:qa.push([U-144+400,9]);break;case 279>=U:qa.push([U-256+0,7]);break;case 287>=U:qa.push([U-280+192,8]);break;default:q(\"invalid literal: \"+U)}\nna.prototype.h=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c>>8&255;l[n++]=m&255;l[n++]=m>>>8&255;if(B)l.set(f,n),n+=f.length,l=l.subarray(0,n);else{r=0;for(p=f.length;rA)for(;0A?A:138,F>A-3&&F=F?(J[H++]=17,J[H++]=F-3,P[17]++):(J[H++]=18,J[H++]=F-11,P[18]++),A-=F;else if(J[H++]=K[y],P[K[y]]++,A--,3>A)for(;0A?A:6,F>A-3&&FE;E++)ta[E]=la[qb[E]];for(Y=19;4=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,\na-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q(\"invalid length: \"+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<\n16|d[0];return a}(),ya=B?new Uint32Array(xa):xa;\nfunction ra(b,a){function c(a,c){var b=a.N,d=[],f=0,e;e=ya[a.length];d[f++]=e&65535;d[f++]=e>>16&255;d[f++]=e>>24;var g;switch(v){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-\n65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=\nb:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q(\"invalid distance\")}e=g;d[f++]=e[0];d[f++]=e[1];d[f++]=e[2];var h,k;h=0;for(k=d.length;h=f;)u[f++]=0;for(f=0;29>=f;)w[f++]=0}u[256]=1;d=0;for(e=a.length;d=e){p&&c(p,-1);f=0;for(g=e-d;fg&&a+gf&&(e=d,f=g);if(258===g)break}return new va(f,a-e)}\nfunction sa(b,a){var c=b.length,d=new ka(572),e=new (B?Uint8Array:Array)(c),f,g,k,h,m;if(!B)for(h=0;h2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(l=0;lb[l]?(k[n][s]=u,h[n][s]=a,w+=2):(k[n][s]=b[l],h[n][s]=l,++l);m[n]=0;1===f[n]&&d(n)}return g}\nfunction ua(b){var a=new (B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f>>=1}return a};function Ba(b,a){this.input=b;this.b=this.c=0;this.g={};a&&(a.flags&&(this.g=a.flags),\"string\"===typeof a.filename&&(this.filename=a.filename),\"string\"===typeof a.comment&&(this.w=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}\nBa.prototype.h=function(){var b,a,c,d,e,f,g,k,h=new (B?Uint8Array:Array)(32768),m=0,r=this.input,p=this.c,l=this.filename,n=this.w;h[m++]=31;h[m++]=139;h[m++]=8;b=0;this.g.fname&&(b|=Ca);this.g.fcomment&&(b|=Da);this.g.fhcrc&&(b|=Ea);h[m++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[m++]=a&255;h[m++]=a>>>8&255;h[m++]=a>>>16&255;h[m++]=a>>>24&255;h[m++]=0;h[m++]=Sa;if(this.g.fname!==t){g=0;for(k=l.length;g>>8&255),h[m++]=f&255;h[m++]=0}if(this.g.comment){g=\n0;for(k=n.length;g>>8&255),h[m++]=f&255;h[m++]=0}this.g.fhcrc&&(c=ha(h,0,m)&65535,h[m++]=c&255,h[m++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=m;e=new na(r,this.l);h=e.h();m=e.b;B&&(m+8>h.buffer.byteLength?(this.a=new Uint8Array(m+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ha(r,t,t);h[m++]=d&255;h[m++]=d>>>8&255;h[m++]=d>>>16&255;h[m++]=d>>>24&255;k=r.length;h[m++]=k&255;h[m++]=k>>>8&255;h[m++]=k>>>16&255;h[m++]=\nk>>>24&255;this.c=p;B&&m>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,m=t;this.e=this.j=0;c+1>=f&&q(Error(\"invalid uncompressed block header: LEN\"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error(\"invalid uncompressed block header: NLEN\"));k=a[c++]|a[c++]<<8;g===~k&&q(Error(\"invalid uncompressed block header: length verify\"));c+g>a.length&&q(Error(\"input buffer is broken\"));switch(this.q){case Ua:for(;e+g>d.length;){m=\nh-e;g-=m;if(B)d.set(a.subarray(c,c+m),e),e+=m,c+=m;else for(;m--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ta:for(;e+g>d.length;)d=this.f({B:2});break;default:q(Error(\"invalid inflate mode\"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.r(Va,Wa);break;case 2:for(var r=W(this,5)+257,p=W(this,5)+1,l=W(this,4)+4,n=new (B?Uint8Array:Array)(Xa.length),s=t,u=t,w=t,C=t,x=t,D=t,M=t,z=t,N=t,z=0;z=$?8:255>=$?9:279>=$?7:8;var Va=T(hb),jb=new (B?Uint8Array:Array)(30),kb,lb;kb=0;for(lb=jb.length;kb=g&&q(Error(\"input buffer is broken\")),c|=e[f++]<>>a;b.e=d-a;b.c=f;return k}\nfunction Ya(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],m,r;d=g);)c|=e[f++]<>>16;r>d&&q(Error(\"invalid code length: \"+r));b.j=c>>r;b.e=d-r;b.c=f;return m&65535}\nV.prototype.r=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length-258,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=ab[g];0=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.Q=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=ab[g];0e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.f=function(){var b=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;cc;++c)e[c]=e[a+c];this.b=32768;return e};\nV.prototype.S=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&(\"number\"===typeof b.B&&(c=b.B),\"number\"===typeof b.M&&(c+=b.M));2>c?(d=(g.length-this.c)/this.A[2],f=258*(d/2)|0,e=fa&&(this.a.length=a),b=this.a);return this.buffer=b};function mb(b){this.input=b;this.c=0;this.G=[];this.R=!1}\nmb.prototype.i=function(){for(var b=this.input.length;this.c>>0;ha(e,t,t)!==r&&q(Error(\"invalid CRC-32 checksum: 0x\"+ha(e,t,t).toString(16)+\" / 0x\"+\nr.toString(16)));a.Z=c=(p[l++]|p[l++]<<8|p[l++]<<16|p[l++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error(\"invalid input size: \"+(e.length&4294967295)+\" / \"+c));this.G.push(a);this.c=l}this.R=v;var n=this.G,s,u,w=0,C=0,x;s=0;for(u=n.length;s>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0>>0};function ob(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.V=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case pb:this.method=pb;break;default:q(Error(\"unsupported compression method\"))}0!==((c<<8)+d)%31&&q(Error(\"invalid fcheck flag:\"+((c<<8)+d)%31));d&32&&q(Error(\"fdict flag is not supported\"));this.J=new V(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}\nob.prototype.i=function(){var b=this.input,a,c;a=this.J.i();this.c=this.J.c;this.V&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==nb(a)&&q(Error(\"invalid adler-32 checksum\")));return a};var pb=8;function rb(b,a){this.input=b;this.a=new (B?Uint8Array:Array)(32768);this.k=sb.t;var c={},d;if((a||!(a={}))&&\"number\"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.I=new na(this.input,c)}var sb=pa;\nrb.prototype.h=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=pb;switch(b){case pb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error(\"invalid compression method\"))}c=a<<4|b;g[k++]=c;switch(b){case pb:switch(this.k){case sb.NONE:e=0;break;case sb.L:e=1;break;case sb.t:e=2;break;default:q(Error(\"unsupported compression type\"))}break;default:q(Error(\"invalid compression method\"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=nb(this.input);this.I.b=k;g=this.I.h();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=\nk+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};exports.deflate=tb;exports.deflateSync=ub;exports.inflate=vb;exports.inflateSync=wb;exports.gzip=xb;exports.gzipSync=yb;exports.gunzip=zb;exports.gunzipSync=Ab;function tb(b,a,c){process.nextTick(function(){var d,e;try{e=ub(b,c)}catch(f){d=f}a(d,e)})}function ub(b,a){var c;c=(new rb(b)).h();a||(a={});return a.H?c:Bb(c)}function vb(b,a,c){process.nextTick(function(){var d,e;try{e=wb(b,c)}catch(f){d=f}a(d,e)})}\nfunction wb(b,a){var c;b.subarray=b.slice;c=(new ob(b)).i();a||(a={});return a.noBuffer?c:Bb(c)}function xb(b,a,c){process.nextTick(function(){var d,e;try{e=yb(b,c)}catch(f){d=f}a(d,e)})}function yb(b,a){var c;b.subarray=b.slice;c=(new Ba(b)).h();a||(a={});return a.H?c:Bb(c)}function zb(b,a,c){process.nextTick(function(){var d,e;try{e=Ab(b,c)}catch(f){d=f}a(d,e)})}function Ab(b,a){var c;b.subarray=b.slice;c=(new mb(b)).i();a||(a={});return a.H?c:Bb(c)}\nfunction Bb(b){var a=new Buffer(b.length),c,d;c=0;for(d=b.length;c 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","const bmp = require('bmp-js');\nconst fileType = require('file-type');\n\nmodule.exports = (TessModule, iBuf, yres = 70) => {\n const buf = Buffer.from(iBuf);\n const type = fileType(buf);\n let bytesPerPixel = 0;\n let data = null;\n let pix = null;\n let w = 0;\n let h = 0;\n\n /*\n * Although leptonica should support reading bmp, there is a bug of \"compressed BMP files\".\n * As there is no solution, we need to use bmp-js for now.\n * @see https://groups.google.com/forum/#!topic/tesseract-ocr/4mPD9zTxdxE\n */\n if (type && type.mime === 'image/bmp') {\n const bmpBuf = bmp.decode(buf);\n data = TessModule._malloc(bmpBuf.data.length * Uint8Array.BYTES_PER_ELEMENT);\n TessModule.HEAPU8.set(bmpBuf.data, data);\n w = bmpBuf.width;\n h = bmpBuf.height;\n bytesPerPixel = 4;\n } else {\n const ptr = TessModule._malloc(buf.length * Uint8Array.BYTES_PER_ELEMENT);\n TessModule.HEAPU8.set(buf, ptr);\n pix = TessModule._pixReadMem(ptr, buf.length);\n if (TessModule.getValue(pix + (7 * 4), 'i32') === 0) {\n /*\n * Set a yres default value to prevent warning from tesseract\n * See kMinCredibleResolution in tesseract/src/ccstruct/publictypes.h\n */\n TessModule.setValue(pix + (7 * 4), yres, 'i32');\n }\n [w, h] = Array(2).fill(0)\n .map((v, idx) => (\n TessModule.getValue(pix + (idx * 4), 'i32')\n ));\n }\n\n return {\n w,\n h,\n bytesPerPixel,\n data,\n pix,\n };\n};\n","/**\n * @author shaozilee\n *\n * support 1bit 4bit 8bit 24bit decode\n * encode with 24bit\n * \n */\n\nvar encode = require('./lib/encoder'),\n decode = require('./lib/decoder');\n\nmodule.exports = {\n encode: encode,\n decode: decode\n};\n","/**\n * @author shaozilee\n *\n * BMP format encoder,encode 24bit BMP\n * Not support quality compression\n *\n */\n\nfunction BmpEncoder(imgData){\n\tthis.buffer = imgData.data;\n\tthis.width = imgData.width;\n\tthis.height = imgData.height;\n\tthis.extraBytes = this.width%4;\n\tthis.rgbSize = this.height*(3*this.width+this.extraBytes);\n\tthis.headerInfoSize = 40;\n\n\tthis.data = [];\n\t/******************header***********************/\n\tthis.flag = \"BM\";\n\tthis.reserved = 0;\n\tthis.offset = 54;\n\tthis.fileSize = this.rgbSize+this.offset;\n\tthis.planes = 1;\n\tthis.bitPP = 24;\n\tthis.compress = 0;\n\tthis.hr = 0;\n\tthis.vr = 0;\n\tthis.colors = 0;\n\tthis.importantColors = 0;\n}\n\nBmpEncoder.prototype.encode = function() {\n\tvar tempBuffer = new Buffer(this.offset+this.rgbSize);\n\tthis.pos = 0;\n\ttempBuffer.write(this.flag,this.pos,2);this.pos+=2;\n\ttempBuffer.writeUInt32LE(this.fileSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.reserved,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.offset,this.pos);this.pos+=4;\n\n\ttempBuffer.writeUInt32LE(this.headerInfoSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.width,this.pos);this.pos+=4;\n\ttempBuffer.writeInt32LE(-this.height,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt16LE(this.planes,this.pos);this.pos+=2;\n\ttempBuffer.writeUInt16LE(this.bitPP,this.pos);this.pos+=2;\n\ttempBuffer.writeUInt32LE(this.compress,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.rgbSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.hr,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.vr,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.colors,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.importantColors,this.pos);this.pos+=4;\n\n\tvar i=0;\n\tvar rowBytes = 3*this.width+this.extraBytes;\n\n\tfor (var y = 0; y 0){\n\t\t\tvar fillOffset = this.pos+y*rowBytes+this.width*3;\n\t\t\ttempBuffer.fill(0,fillOffset,fillOffset+this.extraBytes);\n\t\t}\n\t}\n\n\treturn tempBuffer;\n};\n\nmodule.exports = function(imgData, quality) {\n if (typeof quality === 'undefined') quality = 100;\n \tvar encoder = new BmpEncoder(imgData);\n\tvar data = encoder.encode();\n return {\n data: data,\n width: imgData.width,\n height: imgData.height\n };\n};\n","/**\n * @author shaozilee\n *\n * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp\n *\n */\n\nfunction BmpDecoder(buffer,is_with_alpha) {\n this.pos = 0;\n this.buffer = buffer;\n this.is_with_alpha = !!is_with_alpha;\n this.bottom_up = true;\n this.flag = this.buffer.toString(\"utf-8\", 0, this.pos += 2);\n if (this.flag != \"BM\") throw new Error(\"Invalid BMP File\");\n this.parseHeader();\n this.parseRGBA();\n}\n\nBmpDecoder.prototype.parseHeader = function() {\n this.fileSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.reserved = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.offset = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.headerSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.width = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.height = this.buffer.readInt32LE(this.pos);\n this.pos += 4;\n this.planes = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n this.bitPP = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n this.compress = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.rawSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.hr = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.vr = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.colors = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.importantColors = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n\n if(this.bitPP === 16 && this.is_with_alpha){\n this.bitPP = 15\n }\n if (this.bitPP < 15) {\n var len = this.colors === 0 ? 1 << this.bitPP : this.colors;\n this.palette = new Array(len);\n for (var i = 0; i < len; i++) {\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var quad = this.buffer.readUInt8(this.pos++);\n this.palette[i] = {\n red: red,\n green: green,\n blue: blue,\n quad: quad\n };\n }\n }\n if(this.height < 0) {\n this.height *= -1;\n this.bottom_up = false;\n }\n\n}\n\nBmpDecoder.prototype.parseRGBA = function() {\n var bitn = \"bit\" + this.bitPP;\n var len = this.width * this.height * 4;\n this.data = new Buffer(len);\n this[bitn]();\n};\n\nBmpDecoder.prototype.bit1 = function() {\n var xlen = Math.ceil(this.width / 8);\n var mode = xlen%4;\n var y = this.height >= 0 ? this.height - 1 : -this.height\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < xlen; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x*8*4;\n for (var i = 0; i < 8; i++) {\n if(x*8+i>(7-i))&0x1)];\n\n this.data[location+i*4] = 0;\n this.data[location+i*4 + 1] = rgb.blue;\n this.data[location+i*4 + 2] = rgb.green;\n this.data[location+i*4 + 3] = rgb.red;\n\n }else{\n break;\n }\n }\n }\n\n if (mode != 0){\n this.pos+=(4 - mode);\n }\n }\n};\n\nBmpDecoder.prototype.bit4 = function() {\n //RLE-4\n if(this.compress == 2){\n this.data.fill(0xff);\n\n var location = 0;\n var lines = this.bottom_up?this.height-1:0;\n var low_nibble = false;//for all count of pixel\n\n while(location>4);\n }\n\n if ((i & 1) && (i+1 < b)){\n c = this.buffer.readUInt8(this.pos++);\n }\n\n low_nibble = !low_nibble;\n }\n\n if ((((b+1) >> 1) & 1 ) == 1){\n this.pos++\n }\n }\n\n }else{//encoded mode\n for (var i = 0; i < a; i++) {\n if (low_nibble) {\n setPixelData.call(this, (b & 0x0f));\n } else {\n setPixelData.call(this, (b & 0xf0)>>4);\n }\n low_nibble = !low_nibble;\n }\n }\n\n }\n\n\n\n\n function setPixelData(rgbIndex){\n var rgb = this.palette[rgbIndex];\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n location+=4;\n }\n }else{\n\n var xlen = Math.ceil(this.width/2);\n var mode = xlen%4;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < xlen; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x*2*4;\n\n var before = b>>4;\n var after = b&0x0F;\n\n var rgb = this.palette[before];\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n\n\n if(x*2+1>=this.width)break;\n\n rgb = this.palette[after];\n\n this.data[location+4] = 0;\n this.data[location+4 + 1] = rgb.blue;\n this.data[location+4 + 2] = rgb.green;\n this.data[location+4 + 3] = rgb.red;\n\n }\n\n if (mode != 0){\n this.pos+=(4 - mode);\n }\n }\n\n }\n\n};\n\nBmpDecoder.prototype.bit8 = function() {\n //RLE-8\n if(this.compress == 1){\n this.data.fill(0xff);\n\n var location = 0;\n var lines = this.bottom_up?this.height-1:0;\n\n while(location= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n if (b < this.palette.length) {\n var rgb = this.palette[b];\n\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n\n } else {\n this.data[location] = 0;\n this.data[location + 1] = 0xFF;\n this.data[location + 2] = 0xFF;\n this.data[location + 3] = 0xFF;\n }\n }\n if (mode != 0) {\n this.pos += (4 - mode);\n }\n }\n }\n};\n\nBmpDecoder.prototype.bit15 = function() {\n var dif_w =this.width % 3;\n var _11111 = parseInt(\"11111\", 2),_1_5 = _11111;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n\n var B = this.buffer.readUInt16LE(this.pos);\n this.pos+=2;\n var blue = (B & _1_5) / _1_5 * 255 | 0;\n var green = (B >> 5 & _1_5 ) / _1_5 * 255 | 0;\n var red = (B >> 10 & _1_5) / _1_5 * 255 | 0;\n var alpha = (B>>15)?0xFF:0x00;\n\n var location = line * this.width * 4 + x * 4;\n\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += dif_w;\n }\n};\n\nBmpDecoder.prototype.bit16 = function() {\n var dif_w =(this.width % 2)*2;\n //default xrgb555\n this.maskRed = 0x7C00;\n this.maskGreen = 0x3E0;\n this.maskBlue =0x1F;\n this.mask0 = 0;\n\n if(this.compress == 3){\n this.maskRed = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskGreen = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskBlue = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.mask0 = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n }\n\n\n var ns=[0,0,0];\n for (var i=0;i<16;i++){\n if ((this.maskRed>>i)&0x01) ns[0]++;\n if ((this.maskGreen>>i)&0x01) ns[1]++;\n if ((this.maskBlue>>i)&0x01) ns[2]++;\n }\n ns[1]+=ns[0]; ns[2]+=ns[1];\tns[0]=8-ns[0]; ns[1]-=8; ns[2]-=8;\n\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n\n var B = this.buffer.readUInt16LE(this.pos);\n this.pos+=2;\n\n var blue = (B&this.maskBlue)<>ns[1];\n var red = (B&this.maskRed)>>ns[2];\n\n var location = line * this.width * 4 + x * 4;\n\n this.data[location] = 0;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += dif_w;\n }\n};\n\nBmpDecoder.prototype.bit24 = function() {\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n //Little Endian rgb\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = 0;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += (this.width % 4);\n }\n\n};\n\n/**\n * add 32bit decode func\n * @author soubok\n */\nBmpDecoder.prototype.bit32 = function() {\n //BI_BITFIELDS\n if(this.compress == 3){\n this.maskRed = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskGreen = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskBlue = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.mask0 = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n //Little Endian rgba\n var alpha = this.buffer.readUInt8(this.pos++);\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n }\n\n }else{\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n //Little Endian argb\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var alpha = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n }\n\n }\n\n\n\n\n};\n\nBmpDecoder.prototype.getData = function() {\n return this.data;\n};\n\nmodule.exports = function(bmpData) {\n var decoder = new BmpDecoder(bmpData);\n return decoder;\n};\n","'use strict';\nconst toBytes = s => [...s].map(c => c.charCodeAt(0));\nconst xpiZipFilename = toBytes('META-INF/mozilla.rsa');\nconst oxmlContentTypes = toBytes('[Content_Types].xml');\nconst oxmlRels = toBytes('_rels/.rels');\n\nfunction readUInt64LE(buf, offset = 0) {\n\tlet n = buf[offset];\n\tlet mul = 1;\n\tlet i = 0;\n\twhile (++i < 8) {\n\t\tmul *= 0x100;\n\t\tn += buf[offset + i] * mul;\n\t}\n\n\treturn n;\n}\n\nconst fileType = input => {\n\tif (!(input instanceof Uint8Array || input instanceof ArrayBuffer || Buffer.isBuffer(input))) {\n\t\tthrow new TypeError(`Expected the \\`input\\` argument to be of type \\`Uint8Array\\` or \\`Buffer\\` or \\`ArrayBuffer\\`, got \\`${typeof input}\\``);\n\t}\n\n\tconst buf = input instanceof Uint8Array ? input : new Uint8Array(input);\n\n\tif (!(buf && buf.length > 1)) {\n\t\treturn null;\n\t}\n\n\tconst check = (header, options) => {\n\t\toptions = Object.assign({\n\t\t\toffset: 0\n\t\t}, options);\n\n\t\tfor (let i = 0; i < header.length; i++) {\n\t\t\t// If a bitmask is set\n\t\t\tif (options.mask) {\n\t\t\t\t// If header doesn't equal `buf` with bits masked off\n\t\t\t\tif (header[i] !== (options.mask[i] & buf[i + options.offset])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (header[i] !== buf[i + options.offset]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t};\n\n\tconst checkString = (header, options) => check(toBytes(header), options);\n\n\tif (check([0xFF, 0xD8, 0xFF])) {\n\t\treturn {\n\t\t\text: 'jpg',\n\t\t\tmime: 'image/jpeg'\n\t\t};\n\t}\n\n\tif (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) {\n\t\treturn {\n\t\t\text: 'png',\n\t\t\tmime: 'image/png'\n\t\t};\n\t}\n\n\tif (check([0x47, 0x49, 0x46])) {\n\t\treturn {\n\t\t\text: 'gif',\n\t\t\tmime: 'image/gif'\n\t\t};\n\t}\n\n\tif (check([0x57, 0x45, 0x42, 0x50], {offset: 8})) {\n\t\treturn {\n\t\t\text: 'webp',\n\t\t\tmime: 'image/webp'\n\t\t};\n\t}\n\n\tif (check([0x46, 0x4C, 0x49, 0x46])) {\n\t\treturn {\n\t\t\text: 'flif',\n\t\t\tmime: 'image/flif'\n\t\t};\n\t}\n\n\t// Needs to be before `tif` check\n\tif (\n\t\t(check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) &&\n\t\tcheck([0x43, 0x52], {offset: 8})\n\t) {\n\t\treturn {\n\t\t\text: 'cr2',\n\t\t\tmime: 'image/x-canon-cr2'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x49, 0x49, 0x2A, 0x0]) ||\n\t\tcheck([0x4D, 0x4D, 0x0, 0x2A])\n\t) {\n\t\treturn {\n\t\t\text: 'tif',\n\t\t\tmime: 'image/tiff'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x4D])) {\n\t\treturn {\n\t\t\text: 'bmp',\n\t\t\tmime: 'image/bmp'\n\t\t};\n\t}\n\n\tif (check([0x49, 0x49, 0xBC])) {\n\t\treturn {\n\t\t\text: 'jxr',\n\t\t\tmime: 'image/vnd.ms-photo'\n\t\t};\n\t}\n\n\tif (check([0x38, 0x42, 0x50, 0x53])) {\n\t\treturn {\n\t\t\text: 'psd',\n\t\t\tmime: 'image/vnd.adobe.photoshop'\n\t\t};\n\t}\n\n\t// Zip-based file formats\n\t// Need to be before the `zip` check\n\tif (check([0x50, 0x4B, 0x3, 0x4])) {\n\t\tif (\n\t\t\tcheck([0x6D, 0x69, 0x6D, 0x65, 0x74, 0x79, 0x70, 0x65, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x65, 0x70, 0x75, 0x62, 0x2B, 0x7A, 0x69, 0x70], {offset: 30})\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'epub',\n\t\t\t\tmime: 'application/epub+zip'\n\t\t\t};\n\t\t}\n\n\t\t// Assumes signed `.xpi` from addons.mozilla.org\n\t\tif (check(xpiZipFilename, {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'xpi',\n\t\t\t\tmime: 'application/x-xpinstall'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.text', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'odt',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.text'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.spreadsheet', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'ods',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.spreadsheet'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.presentation', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'odp',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.presentation'\n\t\t\t};\n\t\t}\n\n\t\t// The docx, xlsx and pptx file types extend the Office Open XML file format:\n\t\t// https://en.wikipedia.org/wiki/Office_Open_XML_file_formats\n\t\t// We look for:\n\t\t// - one entry named '[Content_Types].xml' or '_rels/.rels',\n\t\t// - one entry indicating specific type of file.\n\t\t// MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it.\n\t\tconst findNextZipHeaderIndex = (arr, startAt = 0) => arr.findIndex((el, i, arr) => i >= startAt && arr[i] === 0x50 && arr[i + 1] === 0x4B && arr[i + 2] === 0x3 && arr[i + 3] === 0x4);\n\n\t\tlet zipHeaderIndex = 0; // The first zip header was already found at index 0\n\t\tlet oxmlFound = false;\n\t\tlet type = null;\n\n\t\tdo {\n\t\t\tconst offset = zipHeaderIndex + 30;\n\n\t\t\tif (!oxmlFound) {\n\t\t\t\toxmlFound = (check(oxmlContentTypes, {offset}) || check(oxmlRels, {offset}));\n\t\t\t}\n\n\t\t\tif (!type) {\n\t\t\t\tif (checkString('word/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'docx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n\t\t\t\t\t};\n\t\t\t\t} else if (checkString('ppt/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'pptx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n\t\t\t\t\t};\n\t\t\t\t} else if (checkString('xl/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'xlsx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (oxmlFound && type) {\n\t\t\t\treturn type;\n\t\t\t}\n\n\t\t\tzipHeaderIndex = findNextZipHeaderIndex(buf, offset);\n\t\t} while (zipHeaderIndex >= 0);\n\n\t\t// No more zip parts available in the buffer, but maybe we are almost certain about the type?\n\t\tif (type) {\n\t\t\treturn type;\n\t\t}\n\t}\n\n\tif (\n\t\tcheck([0x50, 0x4B]) &&\n\t\t(buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) &&\n\t\t(buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)\n\t) {\n\t\treturn {\n\t\t\text: 'zip',\n\t\t\tmime: 'application/zip'\n\t\t};\n\t}\n\n\tif (check([0x75, 0x73, 0x74, 0x61, 0x72], {offset: 257})) {\n\t\treturn {\n\t\t\text: 'tar',\n\t\t\tmime: 'application/x-tar'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) &&\n\t\t(buf[6] === 0x0 || buf[6] === 0x1)\n\t) {\n\t\treturn {\n\t\t\text: 'rar',\n\t\t\tmime: 'application/x-rar-compressed'\n\t\t};\n\t}\n\n\tif (check([0x1F, 0x8B, 0x8])) {\n\t\treturn {\n\t\t\text: 'gz',\n\t\t\tmime: 'application/gzip'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x5A, 0x68])) {\n\t\treturn {\n\t\t\text: 'bz2',\n\t\t\tmime: 'application/x-bzip2'\n\t\t};\n\t}\n\n\tif (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) {\n\t\treturn {\n\t\t\text: '7z',\n\t\t\tmime: 'application/x-7z-compressed'\n\t\t};\n\t}\n\n\tif (check([0x78, 0x01])) {\n\t\treturn {\n\t\t\text: 'dmg',\n\t\t\tmime: 'application/x-apple-diskimage'\n\t\t};\n\t}\n\n\tif (check([0x33, 0x67, 0x70, 0x35]) || // 3gp5\n\t\t(\n\t\t\tcheck([0x0, 0x0, 0x0]) && check([0x66, 0x74, 0x79, 0x70], {offset: 4}) &&\n\t\t\t\t(\n\t\t\t\t\tcheck([0x6D, 0x70, 0x34, 0x31], {offset: 8}) || // MP41\n\t\t\t\t\tcheck([0x6D, 0x70, 0x34, 0x32], {offset: 8}) || // MP42\n\t\t\t\t\tcheck([0x69, 0x73, 0x6F, 0x6D], {offset: 8}) || // ISOM\n\t\t\t\t\tcheck([0x69, 0x73, 0x6F, 0x32], {offset: 8}) || // ISO2\n\t\t\t\t\tcheck([0x6D, 0x6D, 0x70, 0x34], {offset: 8}) || // MMP4\n\t\t\t\t\tcheck([0x4D, 0x34, 0x56], {offset: 8}) || // M4V\n\t\t\t\t\tcheck([0x64, 0x61, 0x73, 0x68], {offset: 8}) // DASH\n\t\t\t\t)\n\t\t)) {\n\t\treturn {\n\t\t\text: 'mp4',\n\t\t\tmime: 'video/mp4'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x54, 0x68, 0x64])) {\n\t\treturn {\n\t\t\text: 'mid',\n\t\t\tmime: 'audio/midi'\n\t\t};\n\t}\n\n\t// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska\n\tif (check([0x1A, 0x45, 0xDF, 0xA3])) {\n\t\tconst sliced = buf.subarray(4, 4 + 4096);\n\t\tconst idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82);\n\n\t\tif (idPos !== -1) {\n\t\t\tconst docTypePos = idPos + 3;\n\t\t\tconst findDocType = type => [...type].every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0));\n\n\t\t\tif (findDocType('matroska')) {\n\t\t\t\treturn {\n\t\t\t\t\text: 'mkv',\n\t\t\t\t\tmime: 'video/x-matroska'\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (findDocType('webm')) {\n\t\t\t\treturn {\n\t\t\t\t\text: 'webm',\n\t\t\t\t\tmime: 'video/webm'\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\tif (check([0x0, 0x0, 0x0, 0x14, 0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20]) ||\n\t\tcheck([0x66, 0x72, 0x65, 0x65], {offset: 4}) || // Type: `free`\n\t\tcheck([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], {offset: 4}) ||\n\t\tcheck([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // MJPEG\n\t\tcheck([0x6D, 0x6F, 0x6F, 0x76], {offset: 4}) || // Type: `moov`\n\t\tcheck([0x77, 0x69, 0x64, 0x65], {offset: 4})) {\n\t\treturn {\n\t\t\text: 'mov',\n\t\t\tmime: 'video/quicktime'\n\t\t};\n\t}\n\n\t// RIFF file format which might be AVI, WAV, QCP, etc\n\tif (check([0x52, 0x49, 0x46, 0x46])) {\n\t\tif (check([0x41, 0x56, 0x49], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'avi',\n\t\t\t\tmime: 'video/vnd.avi'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x57, 0x41, 0x56, 0x45], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'wav',\n\t\t\t\tmime: 'audio/vnd.wave'\n\t\t\t};\n\t\t}\n\n\t\t// QLCM, QCP file\n\t\tif (check([0x51, 0x4C, 0x43, 0x4D], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'qcp',\n\t\t\t\tmime: 'audio/qcelp'\n\t\t\t};\n\t\t}\n\t}\n\n\t// ASF_Header_Object first 80 bytes\n\tif (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) {\n\t\t// Search for header should be in first 1KB of file.\n\n\t\tlet offset = 30;\n\t\tdo {\n\t\t\tconst objectSize = readUInt64LE(buf, offset + 16);\n\t\t\tif (check([0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65], {offset})) {\n\t\t\t\t// Sync on Stream-Properties-Object (B7DC0791-A9B7-11CF-8EE6-00C00C205365)\n\t\t\t\tif (check([0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) {\n\t\t\t\t\t// Found audio:\n\t\t\t\t\treturn {\n\t\t\t\t\t\text: 'wma',\n\t\t\t\t\t\tmime: 'audio/x-ms-wma'\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (check([0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) {\n\t\t\t\t\t// Found video:\n\t\t\t\t\treturn {\n\t\t\t\t\t\text: 'wmv',\n\t\t\t\t\t\tmime: 'video/x-ms-asf'\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\toffset += objectSize;\n\t\t} while (offset + 24 <= buf.length);\n\n\t\t// Default to ASF generic extension\n\t\treturn {\n\t\t\text: 'asf',\n\t\t\tmime: 'application/vnd.ms-asf'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x0, 0x0, 0x1, 0xBA]) ||\n\t\tcheck([0x0, 0x0, 0x1, 0xB3])\n\t) {\n\t\treturn {\n\t\t\text: 'mpg',\n\t\t\tmime: 'video/mpeg'\n\t\t};\n\t}\n\n\tif (check([0x66, 0x74, 0x79, 0x70, 0x33, 0x67], {offset: 4})) {\n\t\treturn {\n\t\t\text: '3gp',\n\t\t\tmime: 'video/3gpp'\n\t\t};\n\t}\n\n\t// Check for MPEG header at different starting offsets\n\tfor (let start = 0; start < 2 && start < (buf.length - 16); start++) {\n\t\tif (\n\t\t\tcheck([0x49, 0x44, 0x33], {offset: start}) || // ID3 header\n\t\t\tcheck([0xFF, 0xE2], {offset: start, mask: [0xFF, 0xE2]}) // MPEG 1 or 2 Layer 3 header\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp3',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xE4], {offset: start, mask: [0xFF, 0xE4]}) // MPEG 1 or 2 Layer 2 header\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp2',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xF8], {offset: start, mask: [0xFF, 0xFC]}) // MPEG 2 layer 0 using ADTS\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp2',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xF0], {offset: start, mask: [0xFF, 0xFC]}) // MPEG 4 layer 0 using ADTS\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp4',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\t}\n\n\tif (\n\t\tcheck([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4})\n\t) {\n\t\treturn { // MPEG-4 layer 3 (audio)\n\t\t\text: 'm4a',\n\t\t\tmime: 'audio/mp4' // RFC 4337\n\t\t};\n\t}\n\n\t// Needs to be before `ogg` check\n\tif (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) {\n\t\treturn {\n\t\t\text: 'opus',\n\t\t\tmime: 'audio/opus'\n\t\t};\n\t}\n\n\t// If 'OggS' in first bytes, then OGG container\n\tif (check([0x4F, 0x67, 0x67, 0x53])) {\n\t\t// This is a OGG container\n\n\t\t// If ' theora' in header.\n\t\tif (check([0x80, 0x74, 0x68, 0x65, 0x6F, 0x72, 0x61], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogv',\n\t\t\t\tmime: 'video/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// If '\\x01video' in header.\n\t\tif (check([0x01, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x00], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogm',\n\t\t\t\tmime: 'video/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// If ' FLAC' in header https://xiph.org/flac/faq.html\n\t\tif (check([0x7F, 0x46, 0x4C, 0x41, 0x43], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'oga',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// 'Speex ' in header https://en.wikipedia.org/wiki/Speex\n\t\tif (check([0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'spx',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// If '\\x01vorbis' in header\n\t\tif (check([0x01, 0x76, 0x6F, 0x72, 0x62, 0x69, 0x73], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogg',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// Default OGG container https://www.iana.org/assignments/media-types/application/ogg\n\t\treturn {\n\t\t\text: 'ogx',\n\t\t\tmime: 'application/ogg'\n\t\t};\n\t}\n\n\tif (check([0x66, 0x4C, 0x61, 0x43])) {\n\t\treturn {\n\t\t\text: 'flac',\n\t\t\tmime: 'audio/x-flac'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x41, 0x43, 0x20])) { // 'MAC '\n\t\treturn {\n\t\t\text: 'ape',\n\t\t\tmime: 'audio/ape'\n\t\t};\n\t}\n\n\tif (check([0x77, 0x76, 0x70, 0x6B])) { // 'wvpk'\n\t\treturn {\n\t\t\text: 'wv',\n\t\t\tmime: 'audio/wavpack'\n\t\t};\n\t}\n\n\tif (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) {\n\t\treturn {\n\t\t\text: 'amr',\n\t\t\tmime: 'audio/amr'\n\t\t};\n\t}\n\n\tif (check([0x25, 0x50, 0x44, 0x46])) {\n\t\treturn {\n\t\t\text: 'pdf',\n\t\t\tmime: 'application/pdf'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x5A])) {\n\t\treturn {\n\t\t\text: 'exe',\n\t\t\tmime: 'application/x-msdownload'\n\t\t};\n\t}\n\n\tif (\n\t\t(buf[0] === 0x43 || buf[0] === 0x46) &&\n\t\tcheck([0x57, 0x53], {offset: 1})\n\t) {\n\t\treturn {\n\t\t\text: 'swf',\n\t\t\tmime: 'application/x-shockwave-flash'\n\t\t};\n\t}\n\n\tif (check([0x7B, 0x5C, 0x72, 0x74, 0x66])) {\n\t\treturn {\n\t\t\text: 'rtf',\n\t\t\tmime: 'application/rtf'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x61, 0x73, 0x6D])) {\n\t\treturn {\n\t\t\text: 'wasm',\n\t\t\tmime: 'application/wasm'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x77, 0x4F, 0x46, 0x46]) &&\n\t\t(\n\t\t\tcheck([0x00, 0x01, 0x00, 0x00], {offset: 4}) ||\n\t\t\tcheck([0x4F, 0x54, 0x54, 0x4F], {offset: 4})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'woff',\n\t\t\tmime: 'font/woff'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x77, 0x4F, 0x46, 0x32]) &&\n\t\t(\n\t\t\tcheck([0x00, 0x01, 0x00, 0x00], {offset: 4}) ||\n\t\t\tcheck([0x4F, 0x54, 0x54, 0x4F], {offset: 4})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'woff2',\n\t\t\tmime: 'font/woff2'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x4C, 0x50], {offset: 34}) &&\n\t\t(\n\t\t\tcheck([0x00, 0x00, 0x01], {offset: 8}) ||\n\t\t\tcheck([0x01, 0x00, 0x02], {offset: 8}) ||\n\t\t\tcheck([0x02, 0x00, 0x02], {offset: 8})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'eot',\n\t\t\tmime: 'application/vnd.ms-fontobject'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x01, 0x00, 0x00, 0x00])) {\n\t\treturn {\n\t\t\text: 'ttf',\n\t\t\tmime: 'font/ttf'\n\t\t};\n\t}\n\n\tif (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {\n\t\treturn {\n\t\t\text: 'otf',\n\t\t\tmime: 'font/otf'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x01, 0x00])) {\n\t\treturn {\n\t\t\text: 'ico',\n\t\t\tmime: 'image/x-icon'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x02, 0x00])) {\n\t\treturn {\n\t\t\text: 'cur',\n\t\t\tmime: 'image/x-icon'\n\t\t};\n\t}\n\n\tif (check([0x46, 0x4C, 0x56, 0x01])) {\n\t\treturn {\n\t\t\text: 'flv',\n\t\t\tmime: 'video/x-flv'\n\t\t};\n\t}\n\n\tif (check([0x25, 0x21])) {\n\t\treturn {\n\t\t\text: 'ps',\n\t\t\tmime: 'application/postscript'\n\t\t};\n\t}\n\n\tif (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) {\n\t\treturn {\n\t\t\text: 'xz',\n\t\t\tmime: 'application/x-xz'\n\t\t};\n\t}\n\n\tif (check([0x53, 0x51, 0x4C, 0x69])) {\n\t\treturn {\n\t\t\text: 'sqlite',\n\t\t\tmime: 'application/x-sqlite3'\n\t\t};\n\t}\n\n\tif (check([0x4E, 0x45, 0x53, 0x1A])) {\n\t\treturn {\n\t\t\text: 'nes',\n\t\t\tmime: 'application/x-nintendo-nes-rom'\n\t\t};\n\t}\n\n\tif (check([0x43, 0x72, 0x32, 0x34])) {\n\t\treturn {\n\t\t\text: 'crx',\n\t\t\tmime: 'application/x-google-chrome-extension'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x4D, 0x53, 0x43, 0x46]) ||\n\t\tcheck([0x49, 0x53, 0x63, 0x28])\n\t) {\n\t\treturn {\n\t\t\text: 'cab',\n\t\t\tmime: 'application/vnd.ms-cab-compressed'\n\t\t};\n\t}\n\n\t// Needs to be before `ar` check\n\tif (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])) {\n\t\treturn {\n\t\t\text: 'deb',\n\t\t\tmime: 'application/x-deb'\n\t\t};\n\t}\n\n\tif (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E])) {\n\t\treturn {\n\t\t\text: 'ar',\n\t\t\tmime: 'application/x-unix-archive'\n\t\t};\n\t}\n\n\tif (check([0xED, 0xAB, 0xEE, 0xDB])) {\n\t\treturn {\n\t\t\text: 'rpm',\n\t\t\tmime: 'application/x-rpm'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x1F, 0xA0]) ||\n\t\tcheck([0x1F, 0x9D])\n\t) {\n\t\treturn {\n\t\t\text: 'Z',\n\t\t\tmime: 'application/x-compress'\n\t\t};\n\t}\n\n\tif (check([0x4C, 0x5A, 0x49, 0x50])) {\n\t\treturn {\n\t\t\text: 'lz',\n\t\t\tmime: 'application/x-lzip'\n\t\t};\n\t}\n\n\tif (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) {\n\t\treturn {\n\t\t\text: 'msi',\n\t\t\tmime: 'application/x-msi'\n\t\t};\n\t}\n\n\tif (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) {\n\t\treturn {\n\t\t\text: 'mxf',\n\t\t\tmime: 'application/mxf'\n\t\t};\n\t}\n\n\tif (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) {\n\t\treturn {\n\t\t\text: 'mts',\n\t\t\tmime: 'video/mp2t'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) {\n\t\treturn {\n\t\t\text: 'blend',\n\t\t\tmime: 'application/x-blender'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x50, 0x47, 0xFB])) {\n\t\treturn {\n\t\t\text: 'bpg',\n\t\t\tmime: 'image/bpg'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A])) {\n\t\t// JPEG-2000 family\n\n\t\tif (check([0x6A, 0x70, 0x32, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jp2',\n\t\t\t\tmime: 'image/jp2'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6A, 0x70, 0x78, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jpx',\n\t\t\t\tmime: 'image/jpx'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6A, 0x70, 0x6D, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jpm',\n\t\t\t\tmime: 'image/jpm'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6D, 0x6A, 0x70, 0x32], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'mj2',\n\t\t\t\tmime: 'image/mj2'\n\t\t\t};\n\t\t}\n\t}\n\n\tif (check([0x46, 0x4F, 0x52, 0x4D])) {\n\t\treturn {\n\t\t\text: 'aif',\n\t\t\tmime: 'audio/aiff'\n\t\t};\n\t}\n\n\tif (checkString(' new Promise((resolve, reject) => {\n\t// Using `eval` to work around issues when bundling with Webpack\n\tconst stream = eval('require')('stream'); // eslint-disable-line no-eval\n\n\treadableStream.once('readable', () => {\n\t\tconst pass = new stream.PassThrough();\n\t\tconst chunk = readableStream.read(module.exports.minimumBytes) || readableStream.read();\n\t\ttry {\n\t\t\tpass.fileType = fileType(chunk);\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\n\t\treadableStream.unshift(chunk);\n\n\t\tif (stream.pipeline) {\n\t\t\tresolve(stream.pipeline(readableStream, pass, () => {}));\n\t\t} else {\n\t\t\tresolve(readableStream.pipe(pass));\n\t\t}\n\t});\n});\n","/**\n *\n * The core part of tesseract.js to execute the OCR jobs.\n *\n * @fileoverview Worker for OCR jobs\n * @author Kevin Kwok \n * @author Guillermo Webster \n * @author Jerome Wu \n */\nconst check = require('check-types');\nconst resolveURL = process.browser ? require('resolve-url') : s => s;\nconst adapter = require('../node');\nconst circularize = require('./circularize');\nconst TesseractJob = require('./TesseractJob');\n\n/**\n * TesseractWorker\n * @name TesseractWorker\n * @function execute TesseractJob with a queue mechanism\n * @access public\n */\nclass TesseractWorker {\n /**\n * constructor\n *\n * @name constructor\n * @function initialize the worker\n * @access public\n * @param {object} options - worker configurations\n * @param {string} options.workerPath -\n * A remote path to load worker script.\n * In browser-like environment, it is downloaded from a CDN service.\n * Please update this option if you self-host the worker script.\n * In Node.js environment, this option is not used as the worker script is in local.\n * @param {string} options.corePath -\n * A remote path to load tesseract.js-core script.\n * In browser-like environment, it is downloaded from a CDN service.\n * Please update this option if you self-host the core script.\n * In Node.js environment, this option is not used as the core script is in local.\n * @param {string} options.langPath -\n * A remote path to load *.traineddata.gz, it is download from a CDN service.\n * Please update this option if you self-host the worker script.\n * @param {string} [options.cachePath=.] - @see {@link https://github.com/jeromewu/tesseract.js-utils/blob/master/src/loadLang.js}\n * @param {string} [options.cacheMethod=write] - @see {@link https://github.com/jeromewu/tesseract.js-utils/blob/master/src/loadLang.js}\n * @param {string} [options.dataPath=.] - @see {@link https://github.com/jeromewu/tesseract.js-utils/blob/master/src/loadLang.js}\n *\n */\n constructor(options = {}) {\n this.worker = null;\n this.options = {\n ...adapter.defaultOptions,\n ...options,\n };\n ['corePath', 'workerPath', 'langPath'].forEach((key) => {\n if (check.not.undefined(options[key])) {\n this.options = { ...this.options, [key]: resolveURL(options[key]) };\n }\n });\n this._currentJob = null;\n this._queue = [];\n }\n\n /**\n * recognize\n *\n * @name recognize\n * @function recognize text in given image\n * @access public\n * @param {Buffer, string} image - image to be recognized\n * @param {string} [lang=eng] - language to recognize\n * @param {object} params - tesseract parameters\n *\n */\n recognize(image, lang = 'eng', params = {}) {\n return this._sendJob('recognize', image, lang, params);\n }\n\n /**\n * detect\n *\n * @name detect\n * @function detect language of the text in the image\n * @access public\n * @param {Buffer, string} image - image to be recognized\n * @param {object} params - tesseract parameters\n *\n */\n detect(image, params = {}) {\n return this._sendJob('detect', image, 'osd', params);\n }\n\n /**\n * recv\n *\n * @name recv\n * @function handle completed job\n * @access public\n * @param {object} packet job data\n */\n recv(packet) {\n if (this._currentJob.id === packet.jobId) {\n this._currentJob.handle({\n ...packet,\n data: packet.status === 'resolve' && packet.action === 'recognize'\n ? circularize(packet.data)\n : packet.data,\n });\n } else {\n console.warn(`Job ID ${packet.jobId} not known.`);\n }\n }\n\n /**\n * dequeue\n *\n * @name dequeue\n * @function dequeue and execute the rear job\n * @access public\n */\n dequeue() {\n this._currentJob = null;\n if (this._queue.length) {\n this._queue[0]();\n }\n }\n\n /**\n * terminate\n *\n * @name terminate\n * @function terminate the worker\n * @access public\n *\n */\n terminate() {\n if (this.worker) {\n adapter.terminateWorker(this);\n }\n this.worker = null;\n this._currentJob = null;\n this._queue = [];\n }\n\n /**\n * _sendJob\n *\n * @name _sendJob\n * @function append a new job to the job queue\n * @access private\n * @param {string} type job type, should be recognize or detect\n * @param {Buffer, string} image image to recognize\n * @param {string} lang language to recognize\n * @param {object} params tesseract parameters\n */\n _sendJob(type, image, lang, params) {\n return this._delay((job) => {\n job.send(\n type,\n {\n image,\n lang,\n params,\n options: this.options,\n },\n );\n });\n }\n\n /**\n * _delay\n *\n * @name _delay\n * @function delays the fn to execute until it is on the rear of the queue\n * @access private\n * @param {function} fn A handler function for the job\n */\n _delay(fn) {\n if (check.null(this.worker)) {\n this.worker = adapter.spawnWorker(this, this.options);\n }\n\n const job = new TesseractJob(this);\n this._queue.push(() => {\n this._queue.shift();\n this._currentJob = job;\n fn(job);\n });\n if (check.null(this._currentJob)) {\n this.dequeue();\n }\n return job;\n }\n}\n\nmodule.exports = TesseractWorker;\n","module.exports = {\n defaultOptions: {\n /*\n * default path for downloading *.traineddata, this URL basically\n * points to a github page, not using jsDelivr as there is is limitation\n * of 20 MB.\n */\n langPath: 'https://tessdata.projectnaptha.com/4.0.0',\n },\n};\n","/**\n * The result of dump.js is a big JSON tree\n * which can be easily serialized (for instance\n * to be sent from a webworker to the main app\n * or through Node's IPC), but we want\n * a (circular) DOM-like interface for walking\n * through the data.\n *\n * @fileoverview DOM-like interface for walking through data\n * @author Kevin Kwok \n * @author Guillermo Webster \n * @author Jerome Wu \n */\n\nmodule.exports = (iPage) => {\n const page = {\n ...iPage,\n paragraphs: [],\n lines: [],\n words: [],\n symbols: [],\n };\n\n page.blocks.forEach((iBlock) => {\n const block = {\n ...iBlock,\n page,\n lines: [],\n words: [],\n symbols: [],\n };\n\n block.paragraphs.forEach((iPara) => {\n const para = {\n ...iPara,\n block,\n page,\n words: [],\n symbols: [],\n };\n\n para.lines.forEach((iLine) => {\n const line = {\n ...iLine,\n paragraph: para,\n block,\n page,\n symbols: [],\n };\n\n line.words.forEach((iWord) => {\n const word = {\n ...iWord,\n line,\n paragraph: para,\n block,\n page,\n };\n\n word.symbols.forEach((iSym) => {\n const sym = {\n ...iSym,\n word,\n line,\n paragraph: para,\n block,\n page,\n };\n\n sym.line.symbols.push(sym);\n sym.paragraph.symbols.push(sym);\n sym.block.symbols.push(sym);\n sym.page.symbols.push(sym);\n });\n word.paragraph.words.push(word);\n word.block.words.push(word);\n word.page.words.push(word);\n });\n line.block.lines.push(line);\n line.page.lines.push(line);\n });\n para.page.paragraphs.push(para);\n });\n });\n return page;\n};\n","/**\n *\n * The job exectued by worker, each job is basically a recognition of an image.\n *\n * @fileoverview Job excuted by Worker\n * @author Kevin Kwok \n * @author Guillermo Webster \n * @author Jerome Wu \n */\nconst adapter = require('../node/');\n\n/** A global job counter as part of job id */\nlet jobCounter = 0;\n\nclass TesseractJob {\n /**\n * constructor\n *\n * @name constructor\n * @function initial a TesseractJob\n * @access public\n * @param {object} worker - An instance of TesseractWorker\n */\n constructor(worker) {\n jobCounter += 1;\n this.id = `Job-${jobCounter}-${Math.random().toString(16).slice(3, 8)}`;\n\n this._worker = worker;\n\n /**\n * As all the callback functions are saved in an array.\n * Basically you can register more than callback function\n * for then, catch, progress and finally.\n */\n this._resolve = [];\n this._reject = [];\n this._progress = [];\n this._finally = [];\n }\n\n /**\n * then\n *\n * @name then\n * @function A function to chain like Promise\n * @access public\n * @param {function} resolve - called when the job succeeds\n * @param {function} reject - called when the job fails\n */\n then(resolve, reject) {\n if (this._resolve.push) {\n this._resolve.push(resolve);\n } else {\n resolve(this._resolve);\n }\n\n if (reject) this.catch(reject);\n return this;\n }\n\n /**\n * catch\n *\n * @name catch\n * @function register a function to call when there is an error\n * @access public\n * @param {function} reject - callback function for error\n */\n catch(reject) {\n if (this._reject.push) {\n this._reject.push(reject);\n } else {\n reject(this._reject);\n }\n return this;\n }\n\n /**\n * progress\n *\n * @name progress\n * @function register a function to show progress of the recognition,\n * use res.progress to print the message\n * @access public\n * @param {function} fn - callback function for progress information\n */\n progress(fn) {\n this._progress.push(fn);\n return this;\n }\n\n /**\n * finally\n *\n * @name finally\n * @function registry a callback function for final\n * @access public\n * @param {function} fn - callback function for final\n */\n finally(fn) {\n this._finally.push(fn);\n return this;\n }\n\n /**\n * send\n *\n * @name send\n * @function send specific action with payload a worker\n * @access public\n * @param {string} action - action to trigger, should be \"recognize\" or \"detect\"\n * @param {object} payload - data to be consumed\n */\n send(action, payload) {\n adapter.sendPacket(this._worker, {\n jobId: this.id,\n action,\n payload,\n });\n }\n\n /**\n * handle\n *\n * @name handle\n * @function execute packet action\n * @access public\n * @param {object} packet action and payload to handle\n */\n handle(packet) {\n const { data } = packet;\n let runFinallyCbs = false;\n\n if (packet.status === 'resolve') {\n if (this._resolve.length === 0) console.log(data);\n this._resolve.forEach((fn) => {\n const ret = fn(data);\n if (ret && typeof ret.then === 'function') {\n console.warn('TesseractJob instances do not chain like ES6 Promises. To convert it into a real promise, use Promise.resolve.');\n }\n });\n this._resolve = data;\n this._worker.dequeue();\n runFinallyCbs = true;\n } else if (packet.status === 'reject') {\n if (this._reject.length === 0) console.error(data);\n this._reject.forEach(fn => fn(data));\n this._reject = data;\n this._worker.dequeue();\n runFinallyCbs = true;\n } else if (packet.status === 'progress') {\n this._progress.forEach(fn => fn(data));\n } else {\n console.warn('Message type unknown', packet.status);\n }\n\n if (runFinallyCbs) {\n this._finally.forEach(fn => fn(data));\n }\n }\n}\n\nmodule.exports = TesseractJob;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/worker.min.js b/dist/worker.min.js deleted file mode 100644 index cc49dc8d2..000000000 --- a/dist/worker.min.js +++ /dev/null @@ -1,9 +0,0 @@ -!function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=3)}([function(t,e,r){"use strict";(function(t){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -var i=r(14),n=r(15),s=r(16);function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,e){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(i)return D(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function m(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=f.from(e,i)),f.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var s,o=1,a=t.length,f=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,f/=2,r/=2}function h(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var u=-1;for(s=r;sa&&(r=a-f),s=r;s>=0;s--){for(var c=!0,l=0;ln&&(i=n):i=n;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function _(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function U(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:h>223?3:h>191?2:1;if(n+c<=r)switch(c){case 1:h<128&&(u=h);break;case 2:128==(192&(s=t[n+1]))&&(f=(31&h)<<6|63&s)>127&&(u=f);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&(f=(15&h)<<12|(63&s)<<6|63&o)>2047&&(f<55296||f>57343)&&(u=f);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(f=(15&h)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&f<1114112&&(u=f)}null===u?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),n+=c}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return U(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return _(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},f.prototype.compare=function(t,e,r,i,n){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),h=this.slice(i,n),u=t.slice(e,r),c=0;cn)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function k(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,i,n,s){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function L(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function O(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function C(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,i,s){return s||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function M(t,e,r,i,s){return s||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}f.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},f.prototype.readUInt8=function(t,e){return e||S(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||S(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||S(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||S(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},f.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||S(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},f.prototype.readInt8=function(t,e){return e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return e||S(t,4,this.length),n.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||S(t,4,this.length),n.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||S(t,8,this.length),n.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||S(t,8,this.length),n.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+n]=t/s&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},f.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+r},f.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(s<1e3||!f.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function N(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(1))},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,i,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(t){r=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var f,h=[],u=!1,c=-1;function l(){u&&f&&(u=!1,f.length?h=f.concat(h):c=-1,h.length&&p())}function p(){if(!u){var t=a(l);u=!0;for(var e=h.length;e;){for(f=h,h=[];++c1)for(var r=1;r{i.dispatchHandlers(t,t=>postMessage(t))}),i.setAdapter({getCore:(r,i)=>(e.undefined(t.TesseractCore)&&(i.progress({status:"loading tesseract core",progress:0}),t.importScripts(r),t.TesseractCore="object"==typeof WebAssembly?t.TesseractCoreWASM:t.TesseractCoreASM,i.progress({status:"loading tesseract core",progress:1})),t.TesseractCore)})}).call(this,r(1))},function(t,e,r){var i;!function(n){"use strict";var s,o,a,f,h,u,c,l,p,d,g,m,y;function b(t){return null!=t}function v(t){return"number"==typeof t&&t>d&&te}function A(t,e){return v(t)&&t=e}function _(t,e){return v(t)&&t<=e}function U(t){return"string"==typeof t}function I(t){return U(t)&&""!==t}function k(t){return"[object Object]"===Object.prototype.toString.call(t)}function T(t,e){try{return t instanceof e}catch(t){return!1}}function B(t,e){var r;for(r in e)if(e.hasOwnProperty(r)){if(!1===t.hasOwnProperty(r)||typeof t[r]!=typeof e[r])return!1;if(k(t[r])&&!1===B(t[r],e[r]))return!1}return!0}function R(t){return m(t)}function S(t){return b(t)&&E(t.length,0)}function P(t){return"function"==typeof t}function L(t,e){var r;for(r=0;rr}},{n:"greaterOrEqual",f:E},{n:"lessOrEqual",f:_},{n:"inRange",f:function(t,e,r){if(e=r}},{n:"positive",f:function(t){return x(t,0)}},{n:"negative",f:function(t){return A(t,0)}},{n:"string",f:U,s:"s"},{n:"emptyString",f:function(t){return""===t},s:"s"},{n:"nonEmptyString",f:I,s:"s"},{n:"contains",f:function(t,e){return U(t)&&-1!==t.indexOf(e)},s:"s"},{n:"match",f:function(t,e){return U(t)&&!!t.match(e)},s:"s"},{n:"boolean",f:function(t){return!1===t||!0===t},s:"b"},{n:"object",f:k,s:"o"},{n:"emptyObject",f:function(t){return k(t)&&0===Object.keys(t).length},s:"o"},{n:"nonEmptyObject",f:function(t){return k(t)&&Object.keys(t).length>0},s:"o"},{n:"instanceStrict",f:T,s:"t"},{n:"instance",f:function(t,e){try{return T(t,e)||t.constructor.name===e.name||Object.prototype.toString.call(t)==="[object "+e.name+"]"}catch(t){return!1}},s:"t"},{n:"like",f:B,s:"t"},{n:"array",f:R,s:"a"},{n:"emptyArray",f:function(t){return R(t)&&0===t.length},s:"a"},{n:"nonEmptyArray",f:function(t){return R(t)&&x(t.length,0)},s:"a"},{n:"arrayLike",f:S,s:"al"},{n:"iterable",f:function(t){if(!y)return S(t);return b(t)&&P(t[Symbol.iterator])},s:"i"},{n:"date",f:function(t){return T(t,Date)&&w(t.getTime())},s:"d"},{n:"function",f:P,s:"f"},{n:"hasLength",f:function(t,e){return b(t)&&t.length===e},s:"l"}].map(function(t){var e=t.n;o[e]="Invalid "+s[t.s||"n"],a[e]=t.f}),f={apply:function(t,e){if(h.array(t),P(e))return t.map(function(t){return e(t)});return h.array(e),h.hasLength(t,e.length),t.map(function(t,r){return e[r](t)})},map:function(t,e){if(h.object(t),P(e))return function(t,e){var r={};return Object.keys(t).forEach(function(i){r[i]=e(t[i])}),r}(t,e);return h.object(e),function t(e,r){var i={};return Object.keys(r).forEach(function(n){var s=r[n];P(s)?u.assigned(e)?i[n]=!!s.m:i[n]=s(e[n]):k(s)&&(i[n]=t(e[n],s))}),i}(t,e)},all:function(t){if(R(t))return L(t,!1);return h.object(t),O(t,!1)},any:function(t){if(R(t))return L(t,!0);return h.object(t),O(t,!0)}},l=["array","arrayLike","iterable","object"],p=Array.prototype.slice,d=Number.NEGATIVE_INFINITY,g=Number.POSITIVE_INFINITY,m=Array.isArray,y="function"==typeof Symbol,f=C(f,a),h=N(j,M),u=N(z,Y),c=N(function(t){var e=function(){return!!u.assigned(arguments[0])||t.apply(null,arguments)};return e.l=t.length,e.m=!0,e},function(t){if(!1===b(t))return!0;return t}),h.not=G(j,u),h.maybe=G(j,c),l.forEach(function(t){a[t].of=F([D.bind(null,null),a[t],a,null])}),q(h,j),q(u,z),l.forEach(function(t){c[t].of=F([D.bind(null,"maybe"),a[t],a,null]),h.maybe[t].of=G(j,c[t].of),h.not[t].of=G(j,u[t].of)}),function(n){void 0===(i=function(){return n}.call(e,r,e,t))||(t.exports=i)}(C(f,{assert:h,not:u,maybe:c}))}()},function(t,e,r){const{readImage:i,loadLang:n}=r(6),s=r(23);let o,a,f,h={};const u=t=>{const{w:e,h:r,bytesPerPixel:n,data:s,pix:f}=i(o,Array.from(t));return null===s?a.SetImage(f):a.SetImage(s,e,r,n,e*n),a.SetRectangle(0,0,e,r),null===s?f:s},c=({corePath:t},e)=>{if(!o){const r=h.getCore(t,e);return e.progress({status:"initializing tesseract",progress:0}),r({TesseractProgress(t){f.progress({status:"recognizing text",progress:Math.max(0,(t-30)/70)})}}).then(t=>{a=new(o=t).TessBaseAPI,e.progress({status:"initialized tesseract",progress:1})})}return Promise.resolve()},l=({lang:t,options:e},r)=>(r.progress({status:"loading language traineddata",progress:0}),n({lang:t,TessModule:o,...e}).then((...t)=>(r.progress({status:"loaded language traineddata",progress:1}),t)));e.dispatchHandlers=(({jobId:t,action:e,payload:r},i)=>{const n=(r,n)=>{i({jobId:t,status:r,action:e,data:n})};n.resolve=n.bind(this,"resolve"),n.reject=n.bind(this,"reject"),n.progress=n.bind(this,"progress"),f=n;try{"recognize"===e?(({image:t,lang:e,options:r,params:i},n)=>c(r,n).then(()=>l({lang:e,options:r},n).then(()=>{const r=t=>{n.progress({status:"initializing api",progress:t})};r(0),a.Init(null,e),r(.3),Object.keys(i).forEach(t=>{a.SetVariable(t,i[t])}),r(.6);const f=u(t);r(1),a.Recognize(null);const h=s(o,a);a.End(),o._free(f),n.resolve(h)})))(r,n):"detect"===e&&(({image:t,lang:e,options:r},i)=>c(r,i).then(()=>l({lang:e,options:r},i).then(()=>{a.Init(null,e),a.SetPageSegMode(o.PSM_OSD_ONLY);const r=u(t),n=new o.OSResults;if(a.DetectOS(n)){const t=n.best_result,e=t.orientation_id,s=t.script_id;a.End(),o._free(r),i.resolve({tesseract_script_id:s,script:n.unicharset.get_script_from_script_id(s),script_confidence:t.sconfidence,orientation_degrees:[0,270,180,90][e],orientation_confidence:t.oconfidence})}else a.End(),o._free(r),i.reject("Failed to detect OS")})))(r,n)}catch(t){n.reject(t.toString())}}),e.setAdapter=(t=>{h=t})},function(t,e,r){const i=r(7);t.exports={loadLang:r(9)({fetch:r(11),gunzip:r(12),resolveURL:r(17),...i}),readImage:r(18),cache:i}},function(t,e,r){const{set:i,get:n,del:s}=r(8);t.exports={readCache:n,writeCache:i,deleteCache:s,checkCache:t=>n(t).then(t=>void 0!==t)}},function(t,e,r){"use strict";r.r(e),r.d(e,"Store",function(){return i}),r.d(e,"get",function(){return o}),r.d(e,"set",function(){return a}),r.d(e,"del",function(){return f}),r.d(e,"clear",function(){return h}),r.d(e,"keys",function(){return u});class i{constructor(t="keyval-store",e="keyval"){this.storeName=e,this._dbp=new Promise((r,i)=>{const n=indexedDB.open(t,1);n.onerror=(()=>i(n.error)),n.onsuccess=(()=>r(n.result)),n.onupgradeneeded=(()=>{n.result.createObjectStore(e)})})}_withIDBStore(t,e){return this._dbp.then(r=>new Promise((i,n)=>{const s=r.transaction(this.storeName,t);s.oncomplete=(()=>i()),s.onabort=s.onerror=(()=>n(s.error)),e(s.objectStore(this.storeName))}))}}let n;function s(){return n||(n=new i),n}function o(t,e=s()){let r;return e._withIDBStore("readonly",e=>{r=e.get(t)}).then(()=>r.result)}function a(t,e,r=s()){return r._withIDBStore("readwrite",r=>{r.put(e,t)})}function f(t,e=s()){return e._withIDBStore("readwrite",e=>{e.delete(t)})}function h(t=s()){return t._withIDBStore("readwrite",t=>{t.clear()})}function u(t=s()){const e=[];return t._withIDBStore("readonly",t=>{(t.openKeyCursor||t.openCursor).call(t).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(()=>e)}},function(t,e,r){(function(e){const i=r(10),n=t=>({TessModule:e,dataPath:r,cachePath:i,cacheMethod:n,lang:s})=>o=>{if(e){if(r)try{e.FS.mkdir(r)}catch(t){}e.FS.writeFile(`${r||"."}/${s}.traineddata`,o)}return["write","refresh",void 0].includes(n)?t.writeCache(`${i||"."}/${s}.traineddata`,o).then(()=>o):o};t.exports=(t=>({lang:r,...s})=>Promise.all(r.split("+").map((t=>({langPath:r,cachePath:s,cacheMethod:o,...a})=>f=>{let{readCache:h}=t;return["refresh","none"].includes(o)&&(h=(()=>Promise.resolve())),h(`${s||"."}/${f}.traineddata`).then(e=>void 0===e?Promise.reject():n(t)({cachePath:s,cacheMethod:o,lang:f,...a})(e)).catch(()=>{const h=e=>t.fetch(`${e}/${f}.traineddata.gz`).then(t=>t.arrayBuffer()).then(e=>t.gunzip(new Uint8Array(e))).then(n(t)({cachePath:s,cacheMethod:o,lang:f,...a}));return i(r)?h(r):e.browser?h(t.resolveURL(r)):t.readCache(`${r}/${f}.traineddata.gz`).then(e=>t.gunzip(new Uint8Array(e))).then(n(t)({cachePath:s,cacheMethod:o,lang:f,...a}))})})(t)(s))))}).call(this,r(2))},function(t,e){t.exports=function(t){if("string"!=typeof t)return!1;var e=t.match(r);if(!e)return!1;var s=e[1];if(!s)return!1;if(i.test(s)||n.test(s))return!0;return!1};var r=/^(?:\w+:)?\/\/(\S+)$/,i=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/},function(t,e){t.exports=fetch.bind()},function(t,e,r){t.exports=r(13).gunzipSync},function(t,e,r){(function(t,r){/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function(){"use strict";function i(t){throw t}var n=void 0,s=!0,o="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;function a(t,e){this.index="number"==typeof e?e:0,this.m=0,this.buffer=t instanceof(o?Uint8Array:Array)?t:new(o?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&i(Error("invalid index")),this.buffer.length<=this.index&&this.f()}a.prototype.f=function(){var t,e=this.buffer,r=e.length,i=new(o?Uint8Array:Array)(r<<1);if(o)i.set(e);else for(t=0;t>>8&255]<<16|p[t>>>16&255]<<8|p[t>>>24&255])>>32-e:p[t]>>8-e),8>e+o)a=a<>e-i-1&1,8==++o&&(o=0,n[s++]=p[a],a=0,s===n.length&&(n=this.f()));n[s]=a,this.buffer=n,this.m=o,this.index=s},a.prototype.finish=function(){var t,e=this.buffer,r=this.index;return 0f;++f){for(var u=l=f,c=7,l=l>>>1;l;l>>>=1)u<<=1,u|=1&l,--c;h[f]=(u<>>0}var p=h;function d(t,e,r){var i,n="number"==typeof e?e:e=0,s="number"==typeof r?r:t.length;for(i=-1,n=7&s;n--;++e)i=i>>>8^m[255&(i^t[e])];for(n=s>>3;n--;e+=8)i=(i=(i=(i=(i=(i=(i=(i=i>>>8^m[255&(i^t[e])])>>>8^m[255&(i^t[e+1])])>>>8^m[255&(i^t[e+2])])>>>8^m[255&(i^t[e+3])])>>>8^m[255&(i^t[e+4])])>>>8^m[255&(i^t[e+5])])>>>8^m[255&(i^t[e+6])])>>>8^m[255&(i^t[e+7])];return(4294967295^i)>>>0}var g=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],m=o?new Uint32Array(g):g;function y(){}function b(t){this.buffer=new(o?Uint16Array:Array)(2*t),this.length=0}function v(t){var e,r,i,n,s,a,f,h,u,c,l=t.length,p=0,d=Number.POSITIVE_INFINITY;for(h=0;hp&&(p=t[h]),t[h]>=1;for(c=i<<16|h,u=a;us[i]);)n=s[r],s[r]=s[i],s[i]=n,n=s[r+1],s[r+1]=s[i+1],s[i+1]=n,r=i;return this.length},b.prototype.pop=function(){var t,e,r,i,n,s=this.buffer;for(e=s[0],t=s[1],this.length-=2,s[0]=s[this.length],s[1]=s[this.length+1],n=0;!((i=2*n+2)>=this.length)&&(i+2s[i]&&(i+=2),s[i]>s[n]);)r=s[n],s[n]=s[i],s[i]=r,r=s[n+1],s[n+1]=s[i+1],s[i+1]=r,n=i;return{index:t,value:e,length:this.length}};var x,A=2,E={NONE:0,L:1,t:A,X:3},_=[];for(x=0;288>x;x++)switch(s){case 143>=x:_.push([x+48,8]);break;case 255>=x:_.push([x-144+400,9]);break;case 279>=x:_.push([x-256+0,7]);break;case 287>=x:_.push([x-280+192,8]);break;default:i("invalid literal: "+x)}function U(t,e){this.length=t,this.N=e}w.prototype.h=function(){var t,e,r,f,h=this.input;switch(this.k){case 0:for(r=0,f=h.length;r>>8&255,y[b++]=255&l,y[b++]=l>>>8&255,o)y.set(p,b),b+=p.length,y=y.subarray(0,b);else{for(g=0,m=p.length;gK)for(;0K?K:138)>K-3&&J=J?(rt[Z++]=17,rt[Z++]=J-3,it[17]++):(rt[Z++]=18,rt[Z++]=J-11,it[18]++),K-=J;else if(rt[Z++]=et[W],it[et[W]]++,3>--K)for(;0K?K:6)>K-3&&JF;F++)V[F]=z[$[F]];for(L=19;4=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:i("invalid length: "+t)}}var e,r,n=[];for(e=3;258>=e;e++)r=t(e),n[e]=r[2]<<24|r[1]<<16|r[0];return n}(),k=o?new Uint32Array(I):I;function T(t,e){function r(t,e){var r,n,o,a,f=t.N,h=[],u=0;switch(r=k[t.length],h[u++]=65535&r,h[u++]=r>>16&255,h[u++]=r>>24,s){case 1===f:n=[0,f-1,0];break;case 2===f:n=[1,f-2,0];break;case 3===f:n=[2,f-3,0];break;case 4===f:n=[3,f-4,0];break;case 6>=f:n=[4,f-5,1];break;case 8>=f:n=[5,f-7,1];break;case 12>=f:n=[6,f-9,2];break;case 16>=f:n=[7,f-13,2];break;case 24>=f:n=[8,f-17,3];break;case 32>=f:n=[9,f-25,3];break;case 48>=f:n=[10,f-33,4];break;case 64>=f:n=[11,f-49,4];break;case 96>=f:n=[12,f-65,5];break;case 128>=f:n=[13,f-97,5];break;case 192>=f:n=[14,f-129,6];break;case 256>=f:n=[15,f-193,6];break;case 384>=f:n=[16,f-257,7];break;case 512>=f:n=[17,f-385,7];break;case 768>=f:n=[18,f-513,8];break;case 1024>=f:n=[19,f-769,8];break;case 1536>=f:n=[20,f-1025,9];break;case 2048>=f:n=[21,f-1537,9];break;case 3072>=f:n=[22,f-2049,10];break;case 4096>=f:n=[23,f-3073,10];break;case 6144>=f:n=[24,f-4097,11];break;case 8192>=f:n=[25,f-6145,11];break;case 12288>=f:n=[26,f-8193,12];break;case 16384>=f:n=[27,f-12289,12];break;case 24576>=f:n=[28,f-16385,13];break;case 32768>=f:n=[29,f-24577,13];break;default:i("invalid distance")}for(r=n,h[u++]=r[0],h[u++]=r[1],h[u++]=r[2],o=0,a=h.length;o=h;)w[h++]=0;for(h=0;29>=h;)x[h++]=0}for(w[256]=1,a=0,f=e.length;a=f){for(d&&r(d,-1),h=0,u=f-a;hs&&e+sh&&(n=i,h=s),258===s)break}return new U(h,e-n)}function R(t,e){var r,i,n,s,a,f=t.length,h=new b(572),u=new(o?Uint8Array:Array)(f);if(!o)for(s=0;s2*u[s-1]+c[s]&&(u[s]=2*u[s-1]+c[s]),p[s]=Array(u[s]),d[s]=Array(u[s]);for(n=0;nt[n]?(p[s][a]=f,d[s][a]=e,h+=2):(p[s][a]=t[n],d[s][a]=n,++n);g[s]=0,1===c[s]&&i(s)}return l}(i,i.length,e),s=0,a=r.length;s>>=1;return s}function P(t,e){this.input=t,this.b=this.c=0,this.g={},e&&(e.flags&&(this.g=e.flags),"string"==typeof e.filename&&(this.filename=e.filename),"string"==typeof e.comment&&(this.w=e.comment),e.deflateOptions&&(this.l=e.deflateOptions)),this.l||(this.l={})}P.prototype.h=function(){var t,e,r,i,s,a,f,h,u=new(o?Uint8Array:Array)(32768),c=0,l=this.input,p=this.c,g=this.filename,m=this.w;if(u[c++]=31,u[c++]=139,u[c++]=8,t=0,this.g.fname&&(t|=C),this.g.fcomment&&(t|=j),this.g.fhcrc&&(t|=O),u[c++]=t,e=(Date.now?Date.now():+new Date)/1e3|0,u[c++]=255&e,u[c++]=e>>>8&255,u[c++]=e>>>16&255,u[c++]=e>>>24&255,u[c++]=0,u[c++]=L,this.g.fname!==n){for(f=0,h=g.length;f>>8&255),u[c++]=255&a;u[c++]=0}if(this.g.comment){for(f=0,h=m.length;f>>8&255),u[c++]=255&a;u[c++]=0}return this.g.fhcrc&&(r=65535&d(u,0,c),u[c++]=255&r,u[c++]=r>>>8&255),this.l.outputBuffer=u,this.l.outputIndex=c,u=(s=new w(l,this.l)).h(),c=s.b,o&&(c+8>u.buffer.byteLength?(this.a=new Uint8Array(c+8),this.a.set(new Uint8Array(u.buffer)),u=this.a):u=new Uint8Array(u.buffer)),i=d(l,n,n),u[c++]=255&i,u[c++]=i>>>8&255,u[c++]=i>>>16&255,u[c++]=i>>>24&255,h=l.length,u[c++]=255&h,u[c++]=h>>>8&255,u[c++]=h>>>16&255,u[c++]=h>>>24&255,this.c=p,o&&c>>=1){case 0:var e=this.input,r=this.c,a=this.a,f=this.b,h=e.length,u=n,c=a.length,l=n;switch(this.e=this.j=0,r+1>=h&&i(Error("invalid uncompressed block header: LEN")),u=e[r++]|e[r++]<<8,r+1>=h&&i(Error("invalid uncompressed block header: NLEN")),u===~(e[r++]|e[r++]<<8)&&i(Error("invalid uncompressed block header: length verify")),r+u>e.length&&i(Error("input buffer is broken")),this.q){case z:for(;f+u>a.length;){if(u-=l=c-f,o)a.set(e.subarray(r,r+l),f),f+=l,r+=l;else for(;l--;)a[f++]=e[r++];this.b=f,a=this.f(),f=this.b}break;case Y:for(;f+u>a.length;)a=this.f({B:2});break;default:i(Error("invalid inflate mode"))}if(o)a.set(e.subarray(r,r+u),f),f+=u,r+=u;else for(;u--;)a[f++]=e[r++];this.c=r,this.b=f,this.a=a;break;case 1:this.r(et,it);break;case 2:var p,d,g,m,y=nt(this,5)+257,b=nt(this,5)+1,w=nt(this,4)+4,x=new(o?Uint8Array:Array)(G.length),A=n,E=n,_=n,U=n,I=n;for(I=0;I=D?8:255>=D?9:279>=D?7:8;var Q,tt,et=v(J),rt=new(o?Uint8Array:Array)(30);for(Q=0,tt=rt.length;Q=f&&i(Error("input buffer is broken")),n|=o[a++]<>>e,t.e=s-e,t.c=a,r}function st(t,e){for(var r,n,s=t.j,o=t.e,a=t.input,f=t.c,h=a.length,u=e[0],c=e[1];o=h);)s|=a[f++]<>>16)>o&&i(Error("invalid code length: "+n)),t.j=s>>n,t.e=o-n,t.c=f,65535&r}function ot(t){this.input=t,this.c=0,this.G=[],this.R=!1}function at(t){if("string"==typeof t){var e,r,i=t.split("");for(e=0,r=i.length;e>>0;t=i}for(var n,s=1,o=0,a=t.length,f=0;0>>0}function ft(t,e){var r,n;switch(this.input=t,this.c=0,!e&&(e={})||(e.index&&(this.c=e.index),e.verify&&(this.V=e.verify)),r=t[this.c++],n=t[this.c++],15&r){case ht:this.method=ht;break;default:i(Error("unsupported compression method"))}0!=((r<<8)+n)%31&&i(Error("invalid fcheck flag:"+((r<<8)+n)%31)),32&n&&i(Error("fdict flag is not supported")),this.J=new M(t,{index:this.c,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}M.prototype.r=function(t,e){var r=this.a,i=this.b;this.A=t;for(var n,s,o,a,f=r.length-258;256!==(n=st(this,t));)if(256>n)i>=f&&(this.b=i,r=this.f(),i=this.b),r[i++]=n;else for(a=$[s=n-257],0=f&&(this.b=i,r=this.f(),i=this.b);a--;)r[i]=r[i++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=i},M.prototype.Q=function(t,e){var r=this.a,i=this.b;this.A=t;for(var n,s,o,a,f=r.length;256!==(n=st(this,t));)if(256>n)i>=f&&(f=(r=this.f()).length),r[i++]=n;else for(a=$[s=n-257],0f&&(f=(r=this.f()).length);a--;)r[i]=r[i++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=i},M.prototype.f=function(){var t,e,r=new(o?Uint8Array:Array)(this.b-32768),i=this.b-32768,n=this.a;if(o)r.set(n.subarray(32768,r.length));else for(t=0,e=r.length;tt;++t)n[t]=n[i+t];return this.b=32768,n},M.prototype.S=function(t){var e,r,i,n=this.input.length/this.c+1|0,s=this.input,a=this.a;return t&&("number"==typeof t.B&&(n=t.B),"number"==typeof t.M&&(n+=t.M)),2>n?r=(i=(s.length-this.c)/this.A[2]/2*258|0)e&&(this.a.length=e),t=this.a),this.buffer=t},ot.prototype.i=function(){for(var t=this.input.length;this.c>>0,d(e,n,n)!==g&&i(Error("invalid CRC-32 checksum: 0x"+d(e,n,n).toString(16)+" / 0x"+g.toString(16))),a.Z=f=(m[b++]|m[b++]<<8|m[b++]<<16|m[b++]<<24)>>>0,(4294967295&e.length)!==f&&i(Error("invalid input size: "+(4294967295&e.length)+" / "+f)),this.G.push(a),this.c=b}this.R=s;var v,w,x,A=this.G,E=0,_=0;for(v=0,w=A.length;v>>0!==at(t)&&i(Error("invalid adler-32 checksum"))),t};var ht=8;function ut(t,e){this.input=t,this.a=new(o?Uint8Array:Array)(32768),this.k=ct.t;var r,i={};for(r in!e&&(e={})||"number"!=typeof e.compressionType||(this.k=e.compressionType),e)i[r]=e[r];i.outputBuffer=this.a,this.I=new w(this.input,i)}var ct=E;function lt(t,e){var r;return r=new ut(t).h(),e||(e={}),e.H?r:mt(r)}function pt(t,e){var r;return t.subarray=t.slice,r=new ft(t).i(),e||(e={}),e.noBuffer?r:mt(r)}function dt(t,e){var r;return t.subarray=t.slice,r=new P(t).h(),e||(e={}),e.H?r:mt(r)}function gt(t,e){var r;return t.subarray=t.slice,r=new ot(t).i(),e||(e={}),e.H?r:mt(r)}function mt(t){var e,i,n=new r(t.length);for(e=0,i=t.length;e>24&255,f[h++]=a>>16&255,f[h++]=a>>8&255,f[h++]=255&a,f},e.deflate=function(e,r,i){t.nextTick(function(){var t,n;try{n=lt(e,i)}catch(e){t=e}r(t,n)})},e.deflateSync=lt,e.inflate=function(e,r,i){t.nextTick(function(){var t,n;try{n=pt(e,i)}catch(e){t=e}r(t,n)})},e.inflateSync=pt,e.gzip=function(e,r,i){t.nextTick(function(){var t,n;try{n=dt(e,i)}catch(e){t=e}r(t,n)})},e.gzipSync=dt,e.gunzip=function(e,r,i){t.nextTick(function(){var t,n;try{n=gt(e,i)}catch(e){t=e}r(t,n)})},e.gunzipSync=gt}).call(this)}).call(this,r(2),r(0).Buffer)},function(t,e,r){"use strict";e.byteLength=function(t){return 3*t.length/4-h(t)},e.toByteArray=function(t){var e,r,i,o,a,f=t.length;o=h(t),a=new s(3*f/4-o),r=o>0?f-4:f;var u=0;for(e=0;e>16&255,a[u++]=i>>8&255,a[u++]=255&i;2===o?(i=n[t.charCodeAt(e)]<<2|n[t.charCodeAt(e+1)]>>4,a[u++]=255&i):1===o&&(i=n[t.charCodeAt(e)]<<10|n[t.charCodeAt(e+1)]<<4|n[t.charCodeAt(e+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i);return a},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,s="",o=[],a=0,f=r-n;af?f:a+16383));1===n?(e=t[r-1],s+=i[e>>2],s+=i[e<<4&63],s+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],s+=i[e>>10],s+=i[e>>4&63],s+=i[e<<2&63],s+="=");return o.push(s),o.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,f=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function u(t,e,r){for(var n,s,o=[],a=e;a>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,f=(1<>1,u=-7,c=r?n-1:0,l=r?-1:1,p=t[e+c];for(c+=l,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+t[e+c],c+=l,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+c],c+=l,u-=8);if(0===s)s=1-h;else{if(s===f)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=h}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,f,h=8*s-n-1,u=(1<>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,d=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),(e+=o+c>=1?l/f:l*Math.pow(2,1-c))*f>=2&&(o++,f/=2),o+c>=u?(a=0,o=u):o+c>=1?(a=(e*f-1)*Math.pow(2,n),o+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+p]=255&a,p+=d,a/=256,n-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,h-=8);t[r+p-d]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var i,n;void 0===(n="function"==typeof(i=function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var i,n=document.createElement("a"),s=1;s{const o=e.from(r),a=n(o);let f=0,h=null,u=null,c=0,l=0;if(a&&"image/bmp"===a.mime){const e=i.decode(o);h=t._malloc(e.data.length*Uint8Array.BYTES_PER_ELEMENT),t.HEAPU8.set(e.data,h),c=e.width,l=e.height,f=4}else{const e=t._malloc(o.length*Uint8Array.BYTES_PER_ELEMENT);t.HEAPU8.set(o,e),u=t._pixReadMem(e,o.length),0===t.getValue(u+28,"i32")&&t.setValue(u+28,s,"i32"),[c,l]=Array(2).fill(0).map((e,r)=>t.getValue(u+4*r,"i32"))}return{w:c,h:l,bytesPerPixel:f,data:h,pix:u}})}).call(this,r(0).Buffer)},function(t,e,r){var i=r(20),n=r(21);t.exports={encode:i,decode:n}},function(t,e,r){(function(e){function r(t){this.buffer=t.data,this.width=t.width,this.height=t.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}r.prototype.encode=function(){var t=new e(this.offset+this.rgbSize);this.pos=0,t.write(this.flag,this.pos,2),this.pos+=2,t.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,t.writeUInt32LE(this.reserved,this.pos),this.pos+=4,t.writeUInt32LE(this.offset,this.pos),this.pos+=4,t.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,t.writeUInt32LE(this.width,this.pos),this.pos+=4,t.writeInt32LE(-this.height,this.pos),this.pos+=4,t.writeUInt16LE(this.planes,this.pos),this.pos+=2,t.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,t.writeUInt32LE(this.compress,this.pos),this.pos+=4,t.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,t.writeUInt32LE(this.hr,this.pos),this.pos+=4,t.writeUInt32LE(this.vr,this.pos),this.pos+=4,t.writeUInt32LE(this.colors,this.pos),this.pos+=4,t.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var r=0,i=3*this.width+this.extraBytes,n=0;n0){var a=this.pos+n*i+3*this.width;t.fill(0,a,a+this.extraBytes)}}return t},t.exports=function(t,e){return void 0===e&&(e=100),{data:new r(t).encode(),width:t.width,height:t.height}}}).call(this,r(0).Buffer)},function(t,e,r){(function(e){function r(t,e){if(this.pos=0,this.buffer=t,this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),"BM"!=this.flag)throw new Error("Invalid BMP File");this.parseHeader(),this.parseRGBA()}r.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<=0?this.height-1:-this.height;for(r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n>7-a&1];this.data[o+4*a]=0,this.data[o+4*a+1]=f.blue,this.data[o+4*a+2]=f.green,this.data[o+4*a+3]=f.red}0!=e&&(this.pos+=4-e)}},r.prototype.bit4=function(){if(2==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0,r=!1;t>4),1&f&&f+1>1&1)&&this.pos++}}else for(f=0;f>4),r=!r}function h(e){var r=this.palette[e];this.data[t]=0,this.data[t+1]=r.blue,this.data[t+2]=r.green,this.data[t+3]=r.red,t+=4}}else{var u=Math.ceil(this.width/2),c=u%4;for(o=this.height-1;o>=0;o--){var l=this.bottom_up?o:this.height-1-o;for(s=0;s>4,d=15&n,g=this.palette[p];if(this.data[t]=0,this.data[t+1]=g.blue,this.data[t+2]=g.green,this.data[t+3]=g.red,2*s+1>=this.width)break;g=this.palette[d],this.data[t+4]=0,this.data[t+4+1]=g.blue,this.data[t+4+2]=g.green,this.data[t+4+3]=g.red}0!=c&&(this.pos+=4-c)}}},r.prototype.bit8=function(){if(1==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0;t=0;s--){var u=this.bottom_up?s:this.height-1-s;for(n=0;n=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n>5&e)/e*255|0,f=(s>>10&e)/e*255|0,h=s>>15?255:0,u=i*this.width*4+4*n;this.data[u]=h,this.data[u+1]=o,this.data[u+2]=a,this.data[u+3]=f}this.pos+=t}},r.prototype.bit16=function(){var t=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,3==this.compress&&(this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4);for(var e=[0,0,0],r=0;r<16;r++)this.maskRed>>r&1&&e[0]++,this.maskGreen>>r&1&&e[1]++,this.maskBlue>>r&1&&e[2]++;e[1]+=e[0],e[2]+=e[1],e[0]=8-e[0],e[1]-=8,e[2]-=8;for(var i=this.height-1;i>=0;i--){for(var n=this.bottom_up?i:this.height-1-i,s=0;s>e[1],h=(o&this.maskRed)>>e[2],u=n*this.width*4+4*s;this.data[u]=0,this.data[u+1]=a,this.data[u+2]=f,this.data[u+3]=h}this.pos+=t}},r.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r=0;t--)for(e=this.bottom_up?t:this.height-1-t,r=0;r[...t].map(t=>t.charCodeAt(0)),xpiZipFilename=toBytes("META-INF/mozilla.rsa"),oxmlContentTypes=toBytes("[Content_Types].xml"),oxmlRels=toBytes("_rels/.rels");function readUInt64LE(t,e=0){let r=t[e],i=1,n=0;for(;++n<8;)i*=256,r+=t[e+n]*i;return r}const fileType=t=>{if(!(t instanceof Uint8Array||t instanceof ArrayBuffer||Buffer.isBuffer(t)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof t}\``);const e=t instanceof Uint8Array?t:new Uint8Array(t);if(!(e&&e.length>1))return null;const r=(t,r)=>{r=Object.assign({offset:0},r);for(let i=0;ir(toBytes(t),e);if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(r([80,75,3,4])){if(r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r(xpiZipFilename,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(i("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30}))return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};if(i("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30}))return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};if(i("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30}))return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};const t=(t,e=0)=>t.findIndex((t,r,i)=>r>=e&&80===i[r]&&75===i[r+1]&&3===i[r+2]&&4===i[r+3]);let n=0,s=!1,o=null;do{const a=n+30;if(s||(s=r(oxmlContentTypes,{offset:a})||r(oxmlRels,{offset:a})),o||(i("word/",{offset:a})?o={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:i("ppt/",{offset:a})?o={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:i("xl/",{offset:a})&&(o={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),s&&o)return o;n=t(e,a)}while(n>=0);if(o)return o}if(r([80,75])&&(3===e[2]||5===e[2]||7===e[2])&&(4===e[3]||6===e[3]||8===e[3]))return{ext:"zip",mime:"application/zip"};if(r([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(0===e[6]||1===e[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([51,103,112,53])||r([0,0,0])&&r([102,116,121,112],{offset:4})&&(r([109,112,52,49],{offset:8})||r([109,112,52,50],{offset:8})||r([105,115,111,109],{offset:8})||r([105,115,111,50],{offset:8})||r([109,109,112,52],{offset:8})||r([77,52,86],{offset:8})||r([100,97,115,104],{offset:8})))return{ext:"mp4",mime:"video/mp4"};if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){const t=e.subarray(4,4100),r=t.findIndex((t,e,r)=>66===r[e]&&130===r[e+1]);if(-1!==r){const e=r+3,i=r=>[...r].every((r,i)=>t[e+i]===r.charCodeAt(0));if(i("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(i("webm"))return{ext:"webm",mime:"video/webm"}}}if(r([0,0,0,20,102,116,121,112,113,116,32,32])||r([102,114,101,101],{offset:4})||r([102,116,121,112,113,116,32,32],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(r([48,38,178,117,142,102,207,17,166,217])){let t=30;do{const i=readUInt64LE(e,t+16);if(r([145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101],{offset:t})){if(r([64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wma",mime:"audio/x-ms-wma"};if(r([192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wmv",mime:"video/x-ms-asf"};break}t+=i}while(t+24<=e.length);return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([102,116,121,112,51,103],{offset:4}))return{ext:"3gp",mime:"video/3gpp"};for(let t=0;t<2&&tnew Promise((resolve,reject)=>{const stream=eval("require")("stream");readableStream.once("readable",()=>{const t=new stream.PassThrough,e=readableStream.read(module.exports.minimumBytes)||readableStream.read();try{t.fileType=fileType(e)}catch(t){reject(t)}readableStream.unshift(e),stream.pipeline?resolve(stream.pipeline(readableStream,t,()=>{})):resolve(readableStream.pipe(t))})}))}).call(this,__webpack_require__(0).Buffer)},function(t,e){t.exports=((t,e)=>{const r=e.GetIterator(),i=[];let n,s,o,a,f;const h=(e,r)=>Object.keys(t).filter(t=>t.substr(0,r.length+1)===`${r}_`).filter(r=>t[r]===e).map(t=>t.slice(r.length+1))[0];r.Begin();do{if(r.IsAtBeginningOf(t.RIL_BLOCK)){const e=r.BlockPolygon();let s=null;if(t.getPointer(e)>0){const r=e.get_n(),i=e.get_x(),n=e.get_y();s=[];for(let t=0;t{const e=t.split("\n");if(" "===e[0].substring(0,2))for(let t=0;t \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/**\n *\n * Browser worker implementation\n *\n * @fileoverview Browser worker implementation\n * @author Kevin Kwok \n * @author Guillermo Webster \n * @author Jerome Wu \n */\n\nconst check = require('check-types');\nconst workerUtils = require('../common/workerUtils');\n\n/*\n * register message handler\n */\nglobal.addEventListener('message', ({ data }) => {\n workerUtils.dispatchHandlers(data, obj => postMessage(obj));\n});\n\n/*\n * getCore is a sync function to load and return\n * TesseractCore.\n */\nworkerUtils.setAdapter({\n getCore: (corePath, res) => {\n if (check.undefined(global.TesseractCore)) {\n res.progress({ status: 'loading tesseract core', progress: 0 });\n global.importScripts(corePath);\n /*\n * Depending on whether the browser supports WebAssembly,\n * the version of the TesseractCore will be different.\n */\n global.TesseractCore = typeof WebAssembly === 'object' ? global.TesseractCoreWASM : global.TesseractCoreASM;\n res.progress({ status: 'loading tesseract core', progress: 1 });\n }\n return global.TesseractCore;\n },\n});\n","/*globals define, module, Symbol */\n/*jshint -W056 */\n\n(function (globals) {\n 'use strict';\n\n var strings, messages, predicates, functions, assert, not, maybe,\n collections, slice, neginf, posinf, isArray, haveSymbols;\n\n strings = {\n v: 'value',\n n: 'number',\n s: 'string',\n b: 'boolean',\n o: 'object',\n t: 'type',\n a: 'array',\n al: 'array-like',\n i: 'iterable',\n d: 'date',\n f: 'function',\n l: 'length'\n };\n\n messages = {};\n predicates = {};\n\n [\n { n: 'equal', f: equal, s: 'v' },\n { n: 'undefined', f: isUndefined, s: 'v' },\n { n: 'null', f: isNull, s: 'v' },\n { n: 'assigned', f: assigned, s: 'v' },\n { n: 'primitive', f: primitive, s: 'v' },\n { n: 'includes', f: includes, s: 'v' },\n { n: 'zero', f: zero },\n { n: 'infinity', f: infinity },\n { n: 'number', f: number },\n { n: 'integer', f: integer },\n { n: 'even', f: even },\n { n: 'odd', f: odd },\n { n: 'greater', f: greater },\n { n: 'less', f: less },\n { n: 'between', f: between },\n { n: 'greaterOrEqual', f: greaterOrEqual },\n { n: 'lessOrEqual', f: lessOrEqual },\n { n: 'inRange', f: inRange },\n { n: 'positive', f: positive },\n { n: 'negative', f: negative },\n { n: 'string', f: string, s: 's' },\n { n: 'emptyString', f: emptyString, s: 's' },\n { n: 'nonEmptyString', f: nonEmptyString, s: 's' },\n { n: 'contains', f: contains, s: 's' },\n { n: 'match', f: match, s: 's' },\n { n: 'boolean', f: boolean, s: 'b' },\n { n: 'object', f: object, s: 'o' },\n { n: 'emptyObject', f: emptyObject, s: 'o' },\n { n: 'nonEmptyObject', f: nonEmptyObject, s: 'o' },\n { n: 'instanceStrict', f: instanceStrict, s: 't' },\n { n: 'instance', f: instance, s: 't' },\n { n: 'like', f: like, s: 't' },\n { n: 'array', f: array, s: 'a' },\n { n: 'emptyArray', f: emptyArray, s: 'a' },\n { n: 'nonEmptyArray', f: nonEmptyArray, s: 'a' },\n { n: 'arrayLike', f: arrayLike, s: 'al' },\n { n: 'iterable', f: iterable, s: 'i' },\n { n: 'date', f: date, s: 'd' },\n { n: 'function', f: isFunction, s: 'f' },\n { n: 'hasLength', f: hasLength, s: 'l' },\n ].map(function (data) {\n var n = data.n;\n messages[n] = 'Invalid ' + strings[data.s || 'n'];\n predicates[n] = data.f;\n });\n\n functions = {\n apply: apply,\n map: map,\n all: all,\n any: any\n };\n\n collections = [ 'array', 'arrayLike', 'iterable', 'object' ];\n slice = Array.prototype.slice;\n neginf = Number.NEGATIVE_INFINITY;\n posinf = Number.POSITIVE_INFINITY;\n isArray = Array.isArray;\n haveSymbols = typeof Symbol === 'function';\n\n functions = mixin(functions, predicates);\n assert = createModifiedPredicates(assertModifier, assertImpl);\n not = createModifiedPredicates(notModifier, notImpl);\n maybe = createModifiedPredicates(maybeModifier, maybeImpl);\n assert.not = createModifiedModifier(assertModifier, not);\n assert.maybe = createModifiedModifier(assertModifier, maybe);\n\n collections.forEach(createOfPredicates);\n createOfModifiers(assert, assertModifier);\n createOfModifiers(not, notModifier);\n collections.forEach(createMaybeOfModifiers);\n\n exportFunctions(mixin(functions, {\n assert: assert,\n not: not,\n maybe: maybe\n }));\n\n /**\n * Public function `equal`.\n *\n * Returns true if `lhs` and `rhs` are strictly equal, without coercion.\n * Returns false otherwise.\n */\n function equal (lhs, rhs) {\n return lhs === rhs;\n }\n\n /**\n * Public function `undefined`.\n *\n * Returns true if `data` is undefined, false otherwise.\n */\n function isUndefined (data) {\n return data === undefined;\n }\n\n /**\n * Public function `null`.\n *\n * Returns true if `data` is null, false otherwise.\n */\n function isNull (data) {\n return data === null;\n }\n\n /**\n * Public function `assigned`.\n *\n * Returns true if `data` is not null or undefined, false otherwise.\n */\n function assigned (data) {\n return data !== undefined && data !== null;\n }\n\n /**\n * Public function `primitive`.\n *\n * Returns true if `data` is a primitive type, false otherwise.\n */\n function primitive (data) {\n var type;\n\n switch (data) {\n case null:\n case undefined:\n case false:\n case true:\n return true;\n }\n\n type = typeof data;\n return type === 'string' || type === 'number' || (haveSymbols && type === 'symbol');\n }\n\n /**\n * Public function `zero`.\n *\n * Returns true if `data` is zero, false otherwise.\n */\n function zero (data) {\n return data === 0;\n }\n\n /**\n * Public function `infinity`.\n *\n * Returns true if `data` is positive or negative infinity, false otherwise.\n */\n function infinity (data) {\n return data === neginf || data === posinf;\n }\n\n /**\n * Public function `number`.\n *\n * Returns true if `data` is a number, false otherwise.\n */\n function number (data) {\n return typeof data === 'number' && data > neginf && data < posinf;\n }\n\n /**\n * Public function `integer`.\n *\n * Returns true if `data` is an integer, false otherwise.\n */\n function integer (data) {\n return typeof data === 'number' && data % 1 === 0;\n }\n\n /**\n * Public function `even`.\n *\n * Returns true if `data` is an even number, false otherwise.\n */\n function even (data) {\n return typeof data === 'number' && data % 2 === 0;\n }\n\n /**\n * Public function `odd`.\n *\n * Returns true if `data` is an odd number, false otherwise.\n */\n function odd (data) {\n return integer(data) && data % 2 !== 0;\n }\n\n /**\n * Public function `greater`.\n *\n * Returns true if `lhs` is a number greater than `rhs`, false otherwise.\n */\n function greater (lhs, rhs) {\n return number(lhs) && lhs > rhs;\n }\n\n /**\n * Public function `less`.\n *\n * Returns true if `lhs` is a number less than `rhs`, false otherwise.\n */\n function less (lhs, rhs) {\n return number(lhs) && lhs < rhs;\n }\n\n /**\n * Public function `between`.\n *\n * Returns true if `data` is a number between `x` and `y`, false otherwise.\n */\n function between (data, x, y) {\n if (x < y) {\n return greater(data, x) && data < y;\n }\n\n return less(data, x) && data > y;\n }\n\n /**\n * Public function `greaterOrEqual`.\n *\n * Returns true if `lhs` is a number greater than or equal to `rhs`, false\n * otherwise.\n */\n function greaterOrEqual (lhs, rhs) {\n return number(lhs) && lhs >= rhs;\n }\n\n /**\n * Public function `lessOrEqual`.\n *\n * Returns true if `lhs` is a number less than or equal to `rhs`, false\n * otherwise.\n */\n function lessOrEqual (lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }\n\n /**\n * Public function `inRange`.\n *\n * Returns true if `data` is a number in the range `x..y`, false otherwise.\n */\n function inRange (data, x, y) {\n if (x < y) {\n return greaterOrEqual(data, x) && data <= y;\n }\n\n return lessOrEqual(data, x) && data >= y;\n }\n\n /**\n * Public function `positive`.\n *\n * Returns true if `data` is a positive number, false otherwise.\n */\n function positive (data) {\n return greater(data, 0);\n }\n\n /**\n * Public function `negative`.\n *\n * Returns true if `data` is a negative number, false otherwise.\n */\n function negative (data) {\n return less(data, 0);\n }\n\n /**\n * Public function `string`.\n *\n * Returns true if `data` is a string, false otherwise.\n */\n function string (data) {\n return typeof data === 'string';\n }\n\n /**\n * Public function `emptyString`.\n *\n * Returns true if `data` is the empty string, false otherwise.\n */\n function emptyString (data) {\n return data === '';\n }\n\n /**\n * Public function `nonEmptyString`.\n *\n * Returns true if `data` is a non-empty string, false otherwise.\n */\n function nonEmptyString (data) {\n return string(data) && data !== '';\n }\n\n /**\n * Public function `contains`.\n *\n * Returns true if `data` is a string that contains `substring`, false\n * otherwise.\n */\n function contains (data, substring) {\n return string(data) && data.indexOf(substring) !== -1;\n }\n\n /**\n * Public function `match`.\n *\n * Returns true if `data` is a string that matches `regex`, false otherwise.\n */\n function match (data, regex) {\n return string(data) && !! data.match(regex);\n }\n\n /**\n * Public function `boolean`.\n *\n * Returns true if `data` is a boolean value, false otherwise.\n */\n function boolean (data) {\n return data === false || data === true;\n }\n\n /**\n * Public function `object`.\n *\n * Returns true if `data` is a plain-old JS object, false otherwise.\n */\n function object (data) {\n return Object.prototype.toString.call(data) === '[object Object]';\n }\n\n /**\n * Public function `emptyObject`.\n *\n * Returns true if `data` is an empty object, false otherwise.\n */\n function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }\n\n /**\n * Public function `nonEmptyObject`.\n *\n * Returns true if `data` is a non-empty object, false otherwise.\n */\n function nonEmptyObject (data) {\n return object(data) && Object.keys(data).length > 0;\n }\n\n /**\n * Public function `instanceStrict`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n */\n function instanceStrict (data, prototype) {\n try {\n return data instanceof prototype;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `instance`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n * Falls back to testing constructor.name and Object.prototype.toString\n * if the initial instanceof test fails.\n */\n function instance (data, prototype) {\n try {\n return instanceStrict(data, prototype) ||\n data.constructor.name === prototype.name ||\n Object.prototype.toString.call(data) === '[object ' + prototype.name + ']';\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `like`.\n *\n * Tests whether `data` 'quacks like a duck'. Returns true if `data` has all\n * of the properties of `archetype` (the 'duck'), false otherwise.\n */\n function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /**\n * Public function `array`.\n *\n * Returns true if `data` is an array, false otherwise.\n */\n function array (data) {\n return isArray(data);\n }\n\n /**\n * Public function `emptyArray`.\n *\n * Returns true if `data` is an empty array, false otherwise.\n */\n function emptyArray (data) {\n return array(data) && data.length === 0;\n }\n\n /**\n * Public function `nonEmptyArray`.\n *\n * Returns true if `data` is a non-empty array, false otherwise.\n */\n function nonEmptyArray (data) {\n return array(data) && greater(data.length, 0);\n }\n\n /**\n * Public function `arrayLike`.\n *\n * Returns true if `data` is an array-like object, false otherwise.\n */\n function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }\n\n /**\n * Public function `iterable`.\n *\n * Returns true if `data` is an iterable, false otherwise.\n */\n function iterable (data) {\n if (! haveSymbols) {\n // Fall back to `arrayLike` predicate in pre-ES6 environments.\n return arrayLike(data);\n }\n\n return assigned(data) && isFunction(data[Symbol.iterator]);\n }\n\n /**\n * Public function `includes`.\n *\n * Returns true if `data` contains `value`, false otherwise.\n */\n function includes (data, value) {\n var iterator, iteration, keys, length, i;\n\n if (! assigned(data)) {\n return false;\n }\n\n if (haveSymbols && data[Symbol.iterator] && isFunction(data.values)) {\n iterator = data.values();\n\n do {\n iteration = iterator.next();\n\n if (iteration.value === value) {\n return true;\n }\n } while (! iteration.done);\n\n return false;\n }\n\n keys = Object.keys(data);\n length = keys.length;\n for (i = 0; i < length; ++i) {\n if (data[keys[i]] === value) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Public function `hasLength`.\n *\n * Returns true if `data` has a length property that equals `length`, false\n * otherwise.\n */\n function hasLength (data, length) {\n return assigned(data) && data.length === length;\n }\n\n /**\n * Public function `date`.\n *\n * Returns true if `data` is a valid date, false otherwise.\n */\n function date (data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }\n\n /**\n * Public function `function`.\n *\n * Returns true if `data` is a function, false otherwise.\n */\n function isFunction (data) {\n return typeof data === 'function';\n }\n\n /**\n * Public function `apply`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result array. If the same function is to be applied across all of the\n * data, a single predicate function may be passed in.\n *\n */\n function apply (data, predicates) {\n assert.array(data);\n\n if (isFunction(predicates)) {\n return data.map(function (value) {\n return predicates(value);\n });\n }\n\n assert.array(predicates);\n assert.hasLength(data, predicates.length);\n\n return data.map(function (value, index) {\n return predicates[index](value);\n });\n }\n\n /**\n * Public function `map`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result object. Supports nested objects. If the `data` is not nested and\n * the same function is to be applied across all of it, a single predicate\n * function may be passed in.\n *\n */\n function map (data, predicates) {\n assert.object(data);\n\n if (isFunction(predicates)) {\n return mapSimple(data, predicates);\n }\n\n assert.object(predicates);\n\n return mapComplex(data, predicates);\n }\n\n function mapSimple (data, predicate) {\n var result = {};\n\n Object.keys(data).forEach(function (key) {\n result[key] = predicate(data[key]);\n });\n\n return result;\n }\n\n function mapComplex (data, predicates) {\n var result = {};\n\n Object.keys(predicates).forEach(function (key) {\n var predicate = predicates[key];\n\n if (isFunction(predicate)) {\n if (not.assigned(data)) {\n result[key] = !!predicate.m;\n } else {\n result[key] = predicate(data[key]);\n }\n } else if (object(predicate)) {\n result[key] = mapComplex(data[key], predicate);\n }\n });\n\n return result;\n }\n\n /**\n * Public function `all`\n *\n * Check that all boolean values are true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n return testObject(data, false);\n }\n\n function testArray (data, result) {\n var i;\n\n for (i = 0; i < data.length; i += 1) {\n if (data[i] === result) {\n return result;\n }\n }\n\n return !result;\n }\n\n function testObject (data, result) {\n var key, value;\n\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n value = data[key];\n\n if (object(value) && testObject(value, result) === result) {\n return result;\n }\n\n if (value === result) {\n return result;\n }\n }\n }\n\n return !result;\n }\n\n /**\n * Public function `any`\n *\n * Check that at least one boolean value is true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function any (data) {\n if (array(data)) {\n return testArray(data, true);\n }\n\n assert.object(data);\n\n return testObject(data, true);\n }\n\n function mixin (target, source) {\n Object.keys(source).forEach(function (key) {\n target[key] = source[key];\n });\n\n return target;\n }\n\n /**\n * Public modifier `assert`.\n *\n * Throws if `predicate` returns false.\n */\n function assertModifier (predicate, defaultMessage) {\n return function () {\n return assertPredicate(predicate, arguments, defaultMessage);\n };\n }\n\n function assertPredicate (predicate, args, defaultMessage) {\n var argCount = predicate.l || predicate.length;\n var message = args[argCount];\n var ErrorType = args[argCount + 1];\n assertImpl(\n predicate.apply(null, args),\n nonEmptyString(message) ? message : defaultMessage,\n isFunction(ErrorType) ? ErrorType : TypeError\n );\n return args[0];\n }\n\n function assertImpl (value, message, ErrorType) {\n if (value) {\n return value;\n }\n throw new (ErrorType || Error)(message || 'Assertion failed');\n }\n\n /**\n * Public modifier `not`.\n *\n * Negates `predicate`.\n */\n function notModifier (predicate) {\n var modifiedPredicate = function () {\n return notImpl(predicate.apply(null, arguments));\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function notImpl (value) {\n return !value;\n }\n\n /**\n * Public modifier `maybe`.\n *\n * Returns true if predicate argument is null or undefined,\n * otherwise propagates the return value from `predicate`.\n */\n function maybeModifier (predicate) {\n var modifiedPredicate = function () {\n if (not.assigned(arguments[0])) {\n return true;\n }\n\n return predicate.apply(null, arguments);\n };\n modifiedPredicate.l = predicate.length;\n\n // Hackishly indicate that this is a maybe.xxx predicate.\n // Without this flag, the alternative would be to iterate\n // through the maybe predicates or use indexOf to check,\n // which would be time-consuming.\n modifiedPredicate.m = true;\n\n return modifiedPredicate;\n }\n\n function maybeImpl (value) {\n if (assigned(value) === false) {\n return true;\n }\n\n return value;\n }\n\n /**\n * Public modifier `of`.\n *\n * Applies the chained predicate to members of the collection.\n */\n function ofModifier (target, type, predicate) {\n var modifiedPredicate = function () {\n var collection, args;\n\n collection = arguments[0];\n\n if (target === 'maybe' && not.assigned(collection)) {\n return true;\n }\n\n if (!type(collection)) {\n return false;\n }\n\n collection = coerceCollection(type, collection);\n args = slice.call(arguments, 1);\n\n try {\n collection.forEach(function (item) {\n if (\n (target !== 'maybe' || assigned(item)) &&\n !predicate.apply(null, [ item ].concat(args))\n ) {\n // TODO: Replace with for...of when ES6 is required.\n throw 0;\n }\n });\n } catch (ignore) {\n return false;\n }\n\n return true;\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function coerceCollection (type, collection) {\n switch (type) {\n case arrayLike:\n return slice.call(collection);\n case object:\n return Object.keys(collection).map(function (key) {\n return collection[key];\n });\n default:\n return collection;\n }\n }\n\n function createModifiedPredicates (modifier, object) {\n return createModifiedFunctions([ modifier, predicates, object ]);\n }\n\n function createModifiedFunctions (args) {\n var modifier, object, functions, result;\n\n modifier = args.shift();\n object = args.pop();\n functions = args.pop();\n\n result = object || {};\n\n Object.keys(functions).forEach(function (key) {\n Object.defineProperty(result, key, {\n configurable: false,\n enumerable: true,\n writable: false,\n value: modifier.apply(null, args.concat(functions[key], messages[key]))\n });\n });\n\n return result;\n }\n\n function createModifiedModifier (modifier, modified) {\n return createModifiedFunctions([ modifier, modified, null ]);\n }\n\n function createOfPredicates (key) {\n predicates[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, null), predicates[key], predicates, null ]\n );\n }\n\n function createOfModifiers (base, modifier) {\n collections.forEach(function (key) {\n base[key].of = createModifiedModifier(modifier, predicates[key].of);\n });\n }\n\n function createMaybeOfModifiers (key) {\n maybe[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, 'maybe'), predicates[key], predicates, null ]\n );\n assert.maybe[key].of = createModifiedModifier(assertModifier, maybe[key].of);\n assert.not[key].of = createModifiedModifier(assertModifier, not[key].of);\n }\n\n function exportFunctions (functions) {\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return functions;\n });\n } else if (typeof module !== 'undefined' && module !== null && module.exports) {\n module.exports = functions;\n } else {\n globals.check = functions;\n }\n }\n}(this));\n","/**\n *\n * Worker utilities for browser and node\n *\n * @fileoverview Worker utilities for browser and node\n * @author Kevin Kwok \n * @author Guillermo Webster \n * @author Jerome Wu \n */\nconst { readImage, loadLang } = require('tesseract.js-utils');\nconst dump = require('./dump');\n\n/*\n * Tesseract Module returned by TesseractCore.\n */\nlet TessModule;\n/*\n * TessearctBaseAPI instance\n */\nlet api;\nlet latestJob;\nlet adapter = {};\n\n/**\n * setImage\n *\n * @name setImage\n * @function set image in tesseract for recognition\n * @access public\n * @param {array} image - binary array in array format\n * @returns {number} - an emscripten pointer of the image\n */\nconst setImage = (image) => {\n const {\n w, h, bytesPerPixel, data, pix,\n } = readImage(TessModule, Array.from(image));\n\n /*\n * As some image format (ex. bmp) is not supported natiely by tesseract,\n * sometimes it will not return pix directly, but data and bytesPerPixel\n * for another SetImage usage.\n *\n */\n if (data === null) {\n api.SetImage(pix);\n } else {\n api.SetImage(data, w, h, bytesPerPixel, w * bytesPerPixel);\n }\n api.SetRectangle(0, 0, w, h);\n return data === null ? pix : data;\n};\n\n/**\n * handleInit\n *\n * @name handleInit\n * @function handle initialization of TessModule\n * @access public\n * @param {object} req - job payload\n * @param {string} req.corePath - path to the tesseract-core.js\n * @param {object} res - job instance\n * @returns {Promise} A Promise for callback\n */\nconst handleInit = ({ corePath }, res) => {\n if (!TessModule) {\n const Core = adapter.getCore(corePath, res);\n\n res.progress({ status: 'initializing tesseract', progress: 0 });\n\n return Core({\n TesseractProgress(percent) {\n latestJob.progress({ status: 'recognizing text', progress: Math.max(0, (percent - 30) / 70) });\n },\n })\n .then((tessModule) => {\n TessModule = tessModule;\n api = new TessModule.TessBaseAPI();\n res.progress({ status: 'initialized tesseract', progress: 1 });\n });\n }\n\n return Promise.resolve();\n};\n\n/**\n * loadLanguage\n *\n * @name loadLanguage\n * @function load language from remote or local cache\n * @access public\n * @param {object} req - job payload\n * @param {string} req.lang - languages to load, ex: eng, eng+chi_tra\n * @param {object} req.options - other options for loadLang function\n * @param {object} res - job instance\n * @returns {Promise} A Promise for callback\n */\nconst loadLanguage = ({ lang, options }, res) => {\n res.progress({ status: 'loading language traineddata', progress: 0 });\n return loadLang({ lang, TessModule, ...options }).then((...args) => {\n res.progress({ status: 'loaded language traineddata', progress: 1 });\n return args;\n });\n};\n\n/**\n * handleRecognize\n *\n * @name handleRecognize\n * @function handle recognition job\n * @access public\n * @param {object} req - job payload\n * @param {array} req.image - binary image in array format\n * @param {string} req.lang - languages to load, ex: eng, eng+chi_tra\n * @param {object} req.options - other options for loadLang function\n * @param {object} req.params - parameters for tesseract\n * @param {object} res - job instance\n */\nconst handleRecognize = ({\n image, lang, options, params,\n}, res) => (\n handleInit(options, res)\n .then(() => (\n loadLanguage({ lang, options }, res)\n .then(() => {\n const progressUpdate = (progress) => {\n res.progress({ status: 'initializing api', progress });\n };\n progressUpdate(0);\n api.Init(null, lang);\n progressUpdate(0.3);\n Object.keys(params).forEach((key) => {\n api.SetVariable(key, params[key]);\n });\n progressUpdate(0.6);\n const ptr = setImage(image);\n progressUpdate(1);\n api.Recognize(null);\n const result = dump(TessModule, api);\n api.End();\n TessModule._free(ptr);\n res.resolve(result);\n })\n ))\n);\n\n/**\n * handleDetect\n *\n * @name handleDetect\n * @function handle detect (Orientation and Script Detection / OSD) job\n * @access public\n * @param {object} req - job payload\n * @param {array} req.image - binary image in array format\n * @param {string} req.lang - languages to load, ex: eng, eng+chi_tra\n * @param {object} req.options - other options for loadLang function\n * @param {object} res - job instance\n */\nconst handleDetect = ({\n image, lang, options,\n}, res) => (\n handleInit(options, res)\n .then(() => (\n loadLanguage({ lang, options }, res)\n .then(() => {\n api.Init(null, lang);\n api.SetPageSegMode(TessModule.PSM_OSD_ONLY);\n\n const ptr = setImage(image);\n const results = new TessModule.OSResults();\n\n if (!api.DetectOS(results)) {\n api.End();\n TessModule._free(ptr);\n res.reject('Failed to detect OS');\n } else {\n const best = results.best_result;\n const oid = best.orientation_id;\n const sid = best.script_id;\n\n api.End();\n TessModule._free(ptr);\n\n res.resolve({\n tesseract_script_id: sid,\n script: results.unicharset.get_script_from_script_id(sid),\n script_confidence: best.sconfidence,\n orientation_degrees: [0, 270, 180, 90][oid],\n orientation_confidence: best.oconfidence,\n });\n }\n })\n ))\n);\n\n/**\n * dispatchHandlers\n *\n * @name dispatchHandlers\n * @function worker data handler\n * @access public\n * @param {object} data\n * @param {string} data.jobId - unique job id\n * @param {string} data.action - action of the job, only recognize and detect for now\n * @param {object} data.payload - data for the job\n * @param {function} send - trigger job to work\n */\nexports.dispatchHandlers = ({ jobId, action, payload }, send) => {\n const res = (status, data) => {\n send({\n jobId,\n status,\n action,\n data,\n });\n };\n res.resolve = res.bind(this, 'resolve');\n res.reject = res.bind(this, 'reject');\n res.progress = res.bind(this, 'progress');\n\n latestJob = res;\n\n try {\n if (action === 'recognize') {\n handleRecognize(payload, res);\n } else if (action === 'detect') {\n handleDetect(payload, res);\n }\n } catch (err) {\n /** Prepare exception to travel through postMessage */\n res.reject(err.toString());\n }\n};\n\n/**\n * setAdapter\n *\n * @name setAdapter\n * @function\n * @access public\n * @param {object} impl - implementation of the worker, different in browser and node environment\n */\nexports.setAdapter = (impl) => {\n adapter = impl;\n};\n","const cache = require('./common/browser/cache');\n\nmodule.exports = {\n loadLang: require('./loadLang')({\n fetch: require('./common/browser/fetch'),\n gunzip: require('./common/browser/gunzip'),\n resolveURL: require('resolve-url'),\n ...cache,\n }),\n readImage: require('./readImage'),\n cache,\n};\n","const { set, get, del } = require('idb-keyval');\n\nmodule.exports = {\n readCache: get,\n writeCache: set,\n deleteCache: del,\n checkCache: path => (\n get(path)\n .then(v => typeof v !== 'undefined')\n ),\n};\n","class Store {\r\n constructor(dbName = 'keyval-store', storeName = 'keyval') {\r\n this.storeName = storeName;\r\n this._dbp = new Promise((resolve, reject) => {\r\n const openreq = indexedDB.open(dbName, 1);\r\n openreq.onerror = () => reject(openreq.error);\r\n openreq.onsuccess = () => resolve(openreq.result);\r\n // First time setup: create an empty object store\r\n openreq.onupgradeneeded = () => {\r\n openreq.result.createObjectStore(storeName);\r\n };\r\n });\r\n }\r\n _withIDBStore(type, callback) {\r\n return this._dbp.then(db => new Promise((resolve, reject) => {\r\n const transaction = db.transaction(this.storeName, type);\r\n transaction.oncomplete = () => resolve();\r\n transaction.onabort = transaction.onerror = () => reject(transaction.error);\r\n callback(transaction.objectStore(this.storeName));\r\n }));\r\n }\r\n}\r\nlet store;\r\nfunction getDefaultStore() {\r\n if (!store)\r\n store = new Store();\r\n return store;\r\n}\r\nfunction get(key, store = getDefaultStore()) {\r\n let req;\r\n return store._withIDBStore('readonly', store => {\r\n req = store.get(key);\r\n }).then(() => req.result);\r\n}\r\nfunction set(key, value, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.put(value, key);\r\n });\r\n}\r\nfunction del(key, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.delete(key);\r\n });\r\n}\r\nfunction clear(store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.clear();\r\n });\r\n}\r\nfunction keys(store = getDefaultStore()) {\r\n const keys = [];\r\n return store._withIDBStore('readonly', store => {\r\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\r\n // And openKeyCursor isn't supported by Safari.\r\n (store.openKeyCursor || store.openCursor).call(store).onsuccess = function () {\r\n if (!this.result)\r\n return;\r\n keys.push(this.result.key);\r\n this.result.continue();\r\n };\r\n }).then(() => keys);\r\n}\n\nexport { Store, get, set, del, clear, keys };\n","const isURL = require('is-url');\n\nconst handleLang = modules => ({\n TessModule,\n dataPath,\n cachePath,\n cacheMethod,\n lang,\n}) => (data) => {\n if (TessModule) {\n if (dataPath) {\n try {\n TessModule.FS.mkdir(dataPath);\n } catch (err) {\n // TODO: Do some error handling here.\n }\n }\n TessModule.FS.writeFile(`${dataPath || '.'}/${lang}.traineddata`, data);\n }\n if (['write', 'refresh', undefined].includes(cacheMethod)) {\n return modules.writeCache(`${cachePath || '.'}/${lang}.traineddata`, data)\n .then(() => data);\n }\n\n return data;\n};\n\nconst loadAndGunzipFile = modules => ({\n langPath,\n cachePath,\n cacheMethod,\n ...options\n}) => (lang) => {\n let { readCache } = modules;\n if (['refresh', 'none'].includes(cacheMethod)) {\n readCache = () => Promise.resolve();\n }\n\n return readCache(`${cachePath || '.'}/${lang}.traineddata`)\n .then((data) => {\n if (typeof data === 'undefined') {\n return Promise.reject();\n }\n return handleLang(modules)({\n cachePath, cacheMethod, lang, ...options,\n })(data);\n })\n .catch(() => {\n const fetchTrainedData = iLangPath => (\n modules.fetch(`${iLangPath}/${lang}.traineddata.gz`)\n .then(resp => resp.arrayBuffer())\n .then(buf => modules.gunzip(new Uint8Array(buf)))\n .then(handleLang(modules)({\n cachePath, cacheMethod, lang, ...options,\n }))\n );\n\n /** When langPath is an URL, just do the fetch */\n if (isURL(langPath)) {\n return fetchTrainedData(langPath);\n }\n\n /** When langPath is not an URL in browser environment */\n if (process.browser) {\n return fetchTrainedData(modules.resolveURL(langPath));\n }\n\n /** When langPath is not an URL in Node.js environment */\n return modules.readCache(`${langPath}/${lang}.traineddata.gz`)\n .then(buf => modules.gunzip(new Uint8Array(buf)))\n .then(handleLang(modules)({\n cachePath, cacheMethod, lang, ...options,\n }));\n });\n};\n\n/**\n *\n * @name loadLang\n * @function load language(s) from local cache, download from remote if not in cache.\n * @param {object} options\n * @param {string} options.lang - langs to load, use '+' for multiple languages, ex: eng+chi_tra\n * @param {object} options.TessModule - TesseractModule\n * @param {string} options.langPath - prefix path for downloading lang file\n * @param {string} options.cachePath - path to find cache\n * @param {string} options.dataPath - path to store data in mem\n * @param {string} options.cacheMethod -\n * method of cache invaliation, should one of following options:\n * write: read cache and write back (default method)\n * readOnly: read cache and not to write back\n * refresh: not to read cache and write back\n * none: not to read cache and not to write back\n *\n */\nmodule.exports = modules => ({\n lang: langs,\n ...options\n}) => (\n Promise\n .all(langs.split('+').map(loadAndGunzipFile(modules)(options)))\n);\n","\n/**\n * Expose `isUrl`.\n */\n\nmodule.exports = isUrl;\n\n/**\n * RegExps.\n * A URL must match #1 and then at least one of #2/#3.\n * Use two levels of REs to avoid REDOS.\n */\n\nvar protocolAndDomainRE = /^(?:\\w+:)?\\/\\/(\\S+)$/;\n\nvar localhostDomainRE = /^localhost[\\:?\\d]*(?:[^\\:?\\d]\\S*)?$/\nvar nonLocalhostDomainRE = /^[^\\s\\.]+\\.\\S{2,}$/;\n\n/**\n * Loosely validate a URL `string`.\n *\n * @param {String} string\n * @return {Boolean}\n */\n\nfunction isUrl(string){\n if (typeof string !== 'string') {\n return false;\n }\n\n var match = string.match(protocolAndDomainRE);\n if (!match) {\n return false;\n }\n\n var everythingAfterProtocol = match[1];\n if (!everythingAfterProtocol) {\n return false;\n }\n\n if (localhostDomainRE.test(everythingAfterProtocol) ||\n nonLocalhostDomainRE.test(everythingAfterProtocol)) {\n return true;\n }\n\n return false;\n}\n","module.exports = fetch.bind();\n","module.exports = require('zlibjs').gunzipSync;\n","/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function q(b){throw b;}var t=void 0,v=!0;var B=\"undefined\"!==typeof Uint8Array&&\"undefined\"!==typeof Uint16Array&&\"undefined\"!==typeof Uint32Array&&\"undefined\"!==typeof DataView;function G(b,a){this.index=\"number\"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error(\"invalid index\"));this.buffer.length<=this.index&&this.f()}G.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new (B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a>>8&255]<<16|I[b>>>16&255]<<8|I[b>>>24&255])>>32-a:I[b]>>8-a);if(8>a+f)g=g<>a-k-1&1,8===++f&&(f=0,d[e++]=I[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};G.prototype.finish=function(){var b=this.buffer,a=this.index,c;0L;++L){for(var R=L,ba=R,ca=7,R=R>>>1;R;R>>>=1)ba<<=1,ba|=R&1,--ca;aa[L]=(ba<>>0}var I=aa;function ha(b,a,c){var d,e=\"number\"===typeof a?a:a=0,f=\"number\"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^S[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^S[(d^b[a])&255],d=d>>>8^S[(d^b[a+1])&255],d=d>>>8^S[(d^b[a+2])&255],d=d>>>8^S[(d^b[a+3])&255],d=d>>>8^S[(d^b[a+4])&255],d=d>>>8^S[(d^b[a+5])&255],d=d>>>8^S[(d^b[a+6])&255],d=d>>>8^S[(d^b[a+7])&255];return(d^4294967295)>>>0}\nvar ia=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,\n2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,\n2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,\n2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,\n3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,\n936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],S=B?new Uint32Array(ia):ia;function ja(){};function ka(b){this.buffer=new (B?Uint16Array:Array)(2*b);this.length=0}ka.prototype.getParent=function(b){return 2*((b-2)/4|0)};ka.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};\nka.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function T(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,m,r,p,l,n;for(p=0;pc&&(c=b[p]),b[p]>=1;n=g<<16|p;for(l=m;lU;U++)switch(v){case 143>=U:qa.push([U+48,8]);break;case 255>=U:qa.push([U-144+400,9]);break;case 279>=U:qa.push([U-256+0,7]);break;case 287>=U:qa.push([U-280+192,8]);break;default:q(\"invalid literal: \"+U)}\nna.prototype.h=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c>>8&255;l[n++]=m&255;l[n++]=m>>>8&255;if(B)l.set(f,n),n+=f.length,l=l.subarray(0,n);else{r=0;for(p=f.length;rA)for(;0A?A:138,F>A-3&&F=F?(J[H++]=17,J[H++]=F-3,P[17]++):(J[H++]=18,J[H++]=F-11,P[18]++),A-=F;else if(J[H++]=K[y],P[K[y]]++,A--,3>A)for(;0A?A:6,F>A-3&&FE;E++)ta[E]=la[qb[E]];for(Y=19;4=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,\na-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q(\"invalid length: \"+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<\n16|d[0];return a}(),ya=B?new Uint32Array(xa):xa;\nfunction ra(b,a){function c(a,c){var b=a.N,d=[],f=0,e;e=ya[a.length];d[f++]=e&65535;d[f++]=e>>16&255;d[f++]=e>>24;var g;switch(v){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-\n65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=\nb:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q(\"invalid distance\")}e=g;d[f++]=e[0];d[f++]=e[1];d[f++]=e[2];var h,k;h=0;for(k=d.length;h=f;)u[f++]=0;for(f=0;29>=f;)w[f++]=0}u[256]=1;d=0;for(e=a.length;d=e){p&&c(p,-1);f=0;for(g=e-d;fg&&a+gf&&(e=d,f=g);if(258===g)break}return new va(f,a-e)}\nfunction sa(b,a){var c=b.length,d=new ka(572),e=new (B?Uint8Array:Array)(c),f,g,k,h,m;if(!B)for(h=0;h2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(l=0;lb[l]?(k[n][s]=u,h[n][s]=a,w+=2):(k[n][s]=b[l],h[n][s]=l,++l);m[n]=0;1===f[n]&&d(n)}return g}\nfunction ua(b){var a=new (B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f>>=1}return a};function Ba(b,a){this.input=b;this.b=this.c=0;this.g={};a&&(a.flags&&(this.g=a.flags),\"string\"===typeof a.filename&&(this.filename=a.filename),\"string\"===typeof a.comment&&(this.w=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}\nBa.prototype.h=function(){var b,a,c,d,e,f,g,k,h=new (B?Uint8Array:Array)(32768),m=0,r=this.input,p=this.c,l=this.filename,n=this.w;h[m++]=31;h[m++]=139;h[m++]=8;b=0;this.g.fname&&(b|=Ca);this.g.fcomment&&(b|=Da);this.g.fhcrc&&(b|=Ea);h[m++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[m++]=a&255;h[m++]=a>>>8&255;h[m++]=a>>>16&255;h[m++]=a>>>24&255;h[m++]=0;h[m++]=Sa;if(this.g.fname!==t){g=0;for(k=l.length;g>>8&255),h[m++]=f&255;h[m++]=0}if(this.g.comment){g=\n0;for(k=n.length;g>>8&255),h[m++]=f&255;h[m++]=0}this.g.fhcrc&&(c=ha(h,0,m)&65535,h[m++]=c&255,h[m++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=m;e=new na(r,this.l);h=e.h();m=e.b;B&&(m+8>h.buffer.byteLength?(this.a=new Uint8Array(m+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ha(r,t,t);h[m++]=d&255;h[m++]=d>>>8&255;h[m++]=d>>>16&255;h[m++]=d>>>24&255;k=r.length;h[m++]=k&255;h[m++]=k>>>8&255;h[m++]=k>>>16&255;h[m++]=\nk>>>24&255;this.c=p;B&&m>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,m=t;this.e=this.j=0;c+1>=f&&q(Error(\"invalid uncompressed block header: LEN\"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error(\"invalid uncompressed block header: NLEN\"));k=a[c++]|a[c++]<<8;g===~k&&q(Error(\"invalid uncompressed block header: length verify\"));c+g>a.length&&q(Error(\"input buffer is broken\"));switch(this.q){case Ua:for(;e+g>d.length;){m=\nh-e;g-=m;if(B)d.set(a.subarray(c,c+m),e),e+=m,c+=m;else for(;m--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ta:for(;e+g>d.length;)d=this.f({B:2});break;default:q(Error(\"invalid inflate mode\"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.r(Va,Wa);break;case 2:for(var r=W(this,5)+257,p=W(this,5)+1,l=W(this,4)+4,n=new (B?Uint8Array:Array)(Xa.length),s=t,u=t,w=t,C=t,x=t,D=t,M=t,z=t,N=t,z=0;z=$?8:255>=$?9:279>=$?7:8;var Va=T(hb),jb=new (B?Uint8Array:Array)(30),kb,lb;kb=0;for(lb=jb.length;kb=g&&q(Error(\"input buffer is broken\")),c|=e[f++]<>>a;b.e=d-a;b.c=f;return k}\nfunction Ya(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],m,r;d=g);)c|=e[f++]<>>16;r>d&&q(Error(\"invalid code length: \"+r));b.j=c>>r;b.e=d-r;b.c=f;return m&65535}\nV.prototype.r=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length-258,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=ab[g];0=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.Q=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=ab[g];0e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.f=function(){var b=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;cc;++c)e[c]=e[a+c];this.b=32768;return e};\nV.prototype.S=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&(\"number\"===typeof b.B&&(c=b.B),\"number\"===typeof b.M&&(c+=b.M));2>c?(d=(g.length-this.c)/this.A[2],f=258*(d/2)|0,e=fa&&(this.a.length=a),b=this.a);return this.buffer=b};function mb(b){this.input=b;this.c=0;this.G=[];this.R=!1}\nmb.prototype.i=function(){for(var b=this.input.length;this.c>>0;ha(e,t,t)!==r&&q(Error(\"invalid CRC-32 checksum: 0x\"+ha(e,t,t).toString(16)+\" / 0x\"+\nr.toString(16)));a.Z=c=(p[l++]|p[l++]<<8|p[l++]<<16|p[l++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error(\"invalid input size: \"+(e.length&4294967295)+\" / \"+c));this.G.push(a);this.c=l}this.R=v;var n=this.G,s,u,w=0,C=0,x;s=0;for(u=n.length;s>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0>>0};function ob(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.V=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case pb:this.method=pb;break;default:q(Error(\"unsupported compression method\"))}0!==((c<<8)+d)%31&&q(Error(\"invalid fcheck flag:\"+((c<<8)+d)%31));d&32&&q(Error(\"fdict flag is not supported\"));this.J=new V(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}\nob.prototype.i=function(){var b=this.input,a,c;a=this.J.i();this.c=this.J.c;this.V&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==nb(a)&&q(Error(\"invalid adler-32 checksum\")));return a};var pb=8;function rb(b,a){this.input=b;this.a=new (B?Uint8Array:Array)(32768);this.k=sb.t;var c={},d;if((a||!(a={}))&&\"number\"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.I=new na(this.input,c)}var sb=pa;\nrb.prototype.h=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=pb;switch(b){case pb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error(\"invalid compression method\"))}c=a<<4|b;g[k++]=c;switch(b){case pb:switch(this.k){case sb.NONE:e=0;break;case sb.L:e=1;break;case sb.t:e=2;break;default:q(Error(\"unsupported compression type\"))}break;default:q(Error(\"invalid compression method\"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=nb(this.input);this.I.b=k;g=this.I.h();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=\nk+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};exports.deflate=tb;exports.deflateSync=ub;exports.inflate=vb;exports.inflateSync=wb;exports.gzip=xb;exports.gzipSync=yb;exports.gunzip=zb;exports.gunzipSync=Ab;function tb(b,a,c){process.nextTick(function(){var d,e;try{e=ub(b,c)}catch(f){d=f}a(d,e)})}function ub(b,a){var c;c=(new rb(b)).h();a||(a={});return a.H?c:Bb(c)}function vb(b,a,c){process.nextTick(function(){var d,e;try{e=wb(b,c)}catch(f){d=f}a(d,e)})}\nfunction wb(b,a){var c;b.subarray=b.slice;c=(new ob(b)).i();a||(a={});return a.noBuffer?c:Bb(c)}function xb(b,a,c){process.nextTick(function(){var d,e;try{e=yb(b,c)}catch(f){d=f}a(d,e)})}function yb(b,a){var c;b.subarray=b.slice;c=(new Ba(b)).h();a||(a={});return a.H?c:Bb(c)}function zb(b,a,c){process.nextTick(function(){var d,e;try{e=Ab(b,c)}catch(f){d=f}a(d,e)})}function Ab(b,a){var c;b.subarray=b.slice;c=(new mb(b)).i();a||(a={});return a.H?c:Bb(c)}\nfunction Bb(b){var a=new Buffer(b.length),c,d;c=0;for(d=b.length;c 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","// Copyright 2014 Simon Lydell\r\n// X11 (“MIT”) Licensed. (See LICENSE.)\r\n\r\nvoid (function(root, factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define(factory)\r\n } else if (typeof exports === \"object\") {\r\n module.exports = factory()\r\n } else {\r\n root.resolveUrl = factory()\r\n }\r\n}(this, function() {\r\n\r\n function resolveUrl(/* ...urls */) {\r\n var numUrls = arguments.length\r\n\r\n if (numUrls === 0) {\r\n throw new Error(\"resolveUrl requires at least one argument; got none.\")\r\n }\r\n\r\n var base = document.createElement(\"base\")\r\n base.href = arguments[0]\r\n\r\n if (numUrls === 1) {\r\n return base.href\r\n }\r\n\r\n var head = document.getElementsByTagName(\"head\")[0]\r\n head.insertBefore(base, head.firstChild)\r\n\r\n var a = document.createElement(\"a\")\r\n var resolved\r\n\r\n for (var index = 1; index < numUrls; index++) {\r\n a.href = arguments[index]\r\n resolved = a.href\r\n base.href = resolved\r\n }\r\n\r\n head.removeChild(base)\r\n\r\n return resolved\r\n }\r\n\r\n return resolveUrl\r\n\r\n}));\r\n","const bmp = require('bmp-js');\nconst fileType = require('file-type');\n\nmodule.exports = (TessModule, iBuf, yres = 70) => {\n const buf = Buffer.from(iBuf);\n const type = fileType(buf);\n let bytesPerPixel = 0;\n let data = null;\n let pix = null;\n let w = 0;\n let h = 0;\n\n /*\n * Although leptonica should support reading bmp, there is a bug of \"compressed BMP files\".\n * As there is no solution, we need to use bmp-js for now.\n * @see https://groups.google.com/forum/#!topic/tesseract-ocr/4mPD9zTxdxE\n */\n if (type && type.mime === 'image/bmp') {\n const bmpBuf = bmp.decode(buf);\n data = TessModule._malloc(bmpBuf.data.length * Uint8Array.BYTES_PER_ELEMENT);\n TessModule.HEAPU8.set(bmpBuf.data, data);\n w = bmpBuf.width;\n h = bmpBuf.height;\n bytesPerPixel = 4;\n } else {\n const ptr = TessModule._malloc(buf.length * Uint8Array.BYTES_PER_ELEMENT);\n TessModule.HEAPU8.set(buf, ptr);\n pix = TessModule._pixReadMem(ptr, buf.length);\n if (TessModule.getValue(pix + (7 * 4), 'i32') === 0) {\n /*\n * Set a yres default value to prevent warning from tesseract\n * See kMinCredibleResolution in tesseract/src/ccstruct/publictypes.h\n */\n TessModule.setValue(pix + (7 * 4), yres, 'i32');\n }\n [w, h] = Array(2).fill(0)\n .map((v, idx) => (\n TessModule.getValue(pix + (idx * 4), 'i32')\n ));\n }\n\n return {\n w,\n h,\n bytesPerPixel,\n data,\n pix,\n };\n};\n","/**\n * @author shaozilee\n *\n * support 1bit 4bit 8bit 24bit decode\n * encode with 24bit\n * \n */\n\nvar encode = require('./lib/encoder'),\n decode = require('./lib/decoder');\n\nmodule.exports = {\n encode: encode,\n decode: decode\n};\n","/**\n * @author shaozilee\n *\n * BMP format encoder,encode 24bit BMP\n * Not support quality compression\n *\n */\n\nfunction BmpEncoder(imgData){\n\tthis.buffer = imgData.data;\n\tthis.width = imgData.width;\n\tthis.height = imgData.height;\n\tthis.extraBytes = this.width%4;\n\tthis.rgbSize = this.height*(3*this.width+this.extraBytes);\n\tthis.headerInfoSize = 40;\n\n\tthis.data = [];\n\t/******************header***********************/\n\tthis.flag = \"BM\";\n\tthis.reserved = 0;\n\tthis.offset = 54;\n\tthis.fileSize = this.rgbSize+this.offset;\n\tthis.planes = 1;\n\tthis.bitPP = 24;\n\tthis.compress = 0;\n\tthis.hr = 0;\n\tthis.vr = 0;\n\tthis.colors = 0;\n\tthis.importantColors = 0;\n}\n\nBmpEncoder.prototype.encode = function() {\n\tvar tempBuffer = new Buffer(this.offset+this.rgbSize);\n\tthis.pos = 0;\n\ttempBuffer.write(this.flag,this.pos,2);this.pos+=2;\n\ttempBuffer.writeUInt32LE(this.fileSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.reserved,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.offset,this.pos);this.pos+=4;\n\n\ttempBuffer.writeUInt32LE(this.headerInfoSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.width,this.pos);this.pos+=4;\n\ttempBuffer.writeInt32LE(-this.height,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt16LE(this.planes,this.pos);this.pos+=2;\n\ttempBuffer.writeUInt16LE(this.bitPP,this.pos);this.pos+=2;\n\ttempBuffer.writeUInt32LE(this.compress,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.rgbSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.hr,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.vr,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.colors,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.importantColors,this.pos);this.pos+=4;\n\n\tvar i=0;\n\tvar rowBytes = 3*this.width+this.extraBytes;\n\n\tfor (var y = 0; y 0){\n\t\t\tvar fillOffset = this.pos+y*rowBytes+this.width*3;\n\t\t\ttempBuffer.fill(0,fillOffset,fillOffset+this.extraBytes);\n\t\t}\n\t}\n\n\treturn tempBuffer;\n};\n\nmodule.exports = function(imgData, quality) {\n if (typeof quality === 'undefined') quality = 100;\n \tvar encoder = new BmpEncoder(imgData);\n\tvar data = encoder.encode();\n return {\n data: data,\n width: imgData.width,\n height: imgData.height\n };\n};\n","/**\n * @author shaozilee\n *\n * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp\n *\n */\n\nfunction BmpDecoder(buffer,is_with_alpha) {\n this.pos = 0;\n this.buffer = buffer;\n this.is_with_alpha = !!is_with_alpha;\n this.bottom_up = true;\n this.flag = this.buffer.toString(\"utf-8\", 0, this.pos += 2);\n if (this.flag != \"BM\") throw new Error(\"Invalid BMP File\");\n this.parseHeader();\n this.parseRGBA();\n}\n\nBmpDecoder.prototype.parseHeader = function() {\n this.fileSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.reserved = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.offset = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.headerSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.width = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.height = this.buffer.readInt32LE(this.pos);\n this.pos += 4;\n this.planes = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n this.bitPP = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n this.compress = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.rawSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.hr = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.vr = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.colors = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.importantColors = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n\n if(this.bitPP === 16 && this.is_with_alpha){\n this.bitPP = 15\n }\n if (this.bitPP < 15) {\n var len = this.colors === 0 ? 1 << this.bitPP : this.colors;\n this.palette = new Array(len);\n for (var i = 0; i < len; i++) {\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var quad = this.buffer.readUInt8(this.pos++);\n this.palette[i] = {\n red: red,\n green: green,\n blue: blue,\n quad: quad\n };\n }\n }\n if(this.height < 0) {\n this.height *= -1;\n this.bottom_up = false;\n }\n\n}\n\nBmpDecoder.prototype.parseRGBA = function() {\n var bitn = \"bit\" + this.bitPP;\n var len = this.width * this.height * 4;\n this.data = new Buffer(len);\n this[bitn]();\n};\n\nBmpDecoder.prototype.bit1 = function() {\n var xlen = Math.ceil(this.width / 8);\n var mode = xlen%4;\n var y = this.height >= 0 ? this.height - 1 : -this.height\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < xlen; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x*8*4;\n for (var i = 0; i < 8; i++) {\n if(x*8+i>(7-i))&0x1)];\n\n this.data[location+i*4] = 0;\n this.data[location+i*4 + 1] = rgb.blue;\n this.data[location+i*4 + 2] = rgb.green;\n this.data[location+i*4 + 3] = rgb.red;\n\n }else{\n break;\n }\n }\n }\n\n if (mode != 0){\n this.pos+=(4 - mode);\n }\n }\n};\n\nBmpDecoder.prototype.bit4 = function() {\n //RLE-4\n if(this.compress == 2){\n this.data.fill(0xff);\n\n var location = 0;\n var lines = this.bottom_up?this.height-1:0;\n var low_nibble = false;//for all count of pixel\n\n while(location>4);\n }\n\n if ((i & 1) && (i+1 < b)){\n c = this.buffer.readUInt8(this.pos++);\n }\n\n low_nibble = !low_nibble;\n }\n\n if ((((b+1) >> 1) & 1 ) == 1){\n this.pos++\n }\n }\n\n }else{//encoded mode\n for (var i = 0; i < a; i++) {\n if (low_nibble) {\n setPixelData.call(this, (b & 0x0f));\n } else {\n setPixelData.call(this, (b & 0xf0)>>4);\n }\n low_nibble = !low_nibble;\n }\n }\n\n }\n\n\n\n\n function setPixelData(rgbIndex){\n var rgb = this.palette[rgbIndex];\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n location+=4;\n }\n }else{\n\n var xlen = Math.ceil(this.width/2);\n var mode = xlen%4;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < xlen; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x*2*4;\n\n var before = b>>4;\n var after = b&0x0F;\n\n var rgb = this.palette[before];\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n\n\n if(x*2+1>=this.width)break;\n\n rgb = this.palette[after];\n\n this.data[location+4] = 0;\n this.data[location+4 + 1] = rgb.blue;\n this.data[location+4 + 2] = rgb.green;\n this.data[location+4 + 3] = rgb.red;\n\n }\n\n if (mode != 0){\n this.pos+=(4 - mode);\n }\n }\n\n }\n\n};\n\nBmpDecoder.prototype.bit8 = function() {\n //RLE-8\n if(this.compress == 1){\n this.data.fill(0xff);\n\n var location = 0;\n var lines = this.bottom_up?this.height-1:0;\n\n while(location= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n if (b < this.palette.length) {\n var rgb = this.palette[b];\n\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n\n } else {\n this.data[location] = 0;\n this.data[location + 1] = 0xFF;\n this.data[location + 2] = 0xFF;\n this.data[location + 3] = 0xFF;\n }\n }\n if (mode != 0) {\n this.pos += (4 - mode);\n }\n }\n }\n};\n\nBmpDecoder.prototype.bit15 = function() {\n var dif_w =this.width % 3;\n var _11111 = parseInt(\"11111\", 2),_1_5 = _11111;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n\n var B = this.buffer.readUInt16LE(this.pos);\n this.pos+=2;\n var blue = (B & _1_5) / _1_5 * 255 | 0;\n var green = (B >> 5 & _1_5 ) / _1_5 * 255 | 0;\n var red = (B >> 10 & _1_5) / _1_5 * 255 | 0;\n var alpha = (B>>15)?0xFF:0x00;\n\n var location = line * this.width * 4 + x * 4;\n\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += dif_w;\n }\n};\n\nBmpDecoder.prototype.bit16 = function() {\n var dif_w =(this.width % 2)*2;\n //default xrgb555\n this.maskRed = 0x7C00;\n this.maskGreen = 0x3E0;\n this.maskBlue =0x1F;\n this.mask0 = 0;\n\n if(this.compress == 3){\n this.maskRed = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskGreen = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskBlue = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.mask0 = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n }\n\n\n var ns=[0,0,0];\n for (var i=0;i<16;i++){\n if ((this.maskRed>>i)&0x01) ns[0]++;\n if ((this.maskGreen>>i)&0x01) ns[1]++;\n if ((this.maskBlue>>i)&0x01) ns[2]++;\n }\n ns[1]+=ns[0]; ns[2]+=ns[1];\tns[0]=8-ns[0]; ns[1]-=8; ns[2]-=8;\n\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n\n var B = this.buffer.readUInt16LE(this.pos);\n this.pos+=2;\n\n var blue = (B&this.maskBlue)<>ns[1];\n var red = (B&this.maskRed)>>ns[2];\n\n var location = line * this.width * 4 + x * 4;\n\n this.data[location] = 0;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += dif_w;\n }\n};\n\nBmpDecoder.prototype.bit24 = function() {\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n //Little Endian rgb\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = 0;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += (this.width % 4);\n }\n\n};\n\n/**\n * add 32bit decode func\n * @author soubok\n */\nBmpDecoder.prototype.bit32 = function() {\n //BI_BITFIELDS\n if(this.compress == 3){\n this.maskRed = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskGreen = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskBlue = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.mask0 = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n //Little Endian rgba\n var alpha = this.buffer.readUInt8(this.pos++);\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n }\n\n }else{\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n //Little Endian argb\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var alpha = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n }\n\n }\n\n\n\n\n};\n\nBmpDecoder.prototype.getData = function() {\n return this.data;\n};\n\nmodule.exports = function(bmpData) {\n var decoder = new BmpDecoder(bmpData);\n return decoder;\n};\n","'use strict';\nconst toBytes = s => [...s].map(c => c.charCodeAt(0));\nconst xpiZipFilename = toBytes('META-INF/mozilla.rsa');\nconst oxmlContentTypes = toBytes('[Content_Types].xml');\nconst oxmlRels = toBytes('_rels/.rels');\n\nfunction readUInt64LE(buf, offset = 0) {\n\tlet n = buf[offset];\n\tlet mul = 1;\n\tlet i = 0;\n\twhile (++i < 8) {\n\t\tmul *= 0x100;\n\t\tn += buf[offset + i] * mul;\n\t}\n\n\treturn n;\n}\n\nconst fileType = input => {\n\tif (!(input instanceof Uint8Array || input instanceof ArrayBuffer || Buffer.isBuffer(input))) {\n\t\tthrow new TypeError(`Expected the \\`input\\` argument to be of type \\`Uint8Array\\` or \\`Buffer\\` or \\`ArrayBuffer\\`, got \\`${typeof input}\\``);\n\t}\n\n\tconst buf = input instanceof Uint8Array ? input : new Uint8Array(input);\n\n\tif (!(buf && buf.length > 1)) {\n\t\treturn null;\n\t}\n\n\tconst check = (header, options) => {\n\t\toptions = Object.assign({\n\t\t\toffset: 0\n\t\t}, options);\n\n\t\tfor (let i = 0; i < header.length; i++) {\n\t\t\t// If a bitmask is set\n\t\t\tif (options.mask) {\n\t\t\t\t// If header doesn't equal `buf` with bits masked off\n\t\t\t\tif (header[i] !== (options.mask[i] & buf[i + options.offset])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (header[i] !== buf[i + options.offset]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t};\n\n\tconst checkString = (header, options) => check(toBytes(header), options);\n\n\tif (check([0xFF, 0xD8, 0xFF])) {\n\t\treturn {\n\t\t\text: 'jpg',\n\t\t\tmime: 'image/jpeg'\n\t\t};\n\t}\n\n\tif (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) {\n\t\treturn {\n\t\t\text: 'png',\n\t\t\tmime: 'image/png'\n\t\t};\n\t}\n\n\tif (check([0x47, 0x49, 0x46])) {\n\t\treturn {\n\t\t\text: 'gif',\n\t\t\tmime: 'image/gif'\n\t\t};\n\t}\n\n\tif (check([0x57, 0x45, 0x42, 0x50], {offset: 8})) {\n\t\treturn {\n\t\t\text: 'webp',\n\t\t\tmime: 'image/webp'\n\t\t};\n\t}\n\n\tif (check([0x46, 0x4C, 0x49, 0x46])) {\n\t\treturn {\n\t\t\text: 'flif',\n\t\t\tmime: 'image/flif'\n\t\t};\n\t}\n\n\t// Needs to be before `tif` check\n\tif (\n\t\t(check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) &&\n\t\tcheck([0x43, 0x52], {offset: 8})\n\t) {\n\t\treturn {\n\t\t\text: 'cr2',\n\t\t\tmime: 'image/x-canon-cr2'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x49, 0x49, 0x2A, 0x0]) ||\n\t\tcheck([0x4D, 0x4D, 0x0, 0x2A])\n\t) {\n\t\treturn {\n\t\t\text: 'tif',\n\t\t\tmime: 'image/tiff'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x4D])) {\n\t\treturn {\n\t\t\text: 'bmp',\n\t\t\tmime: 'image/bmp'\n\t\t};\n\t}\n\n\tif (check([0x49, 0x49, 0xBC])) {\n\t\treturn {\n\t\t\text: 'jxr',\n\t\t\tmime: 'image/vnd.ms-photo'\n\t\t};\n\t}\n\n\tif (check([0x38, 0x42, 0x50, 0x53])) {\n\t\treturn {\n\t\t\text: 'psd',\n\t\t\tmime: 'image/vnd.adobe.photoshop'\n\t\t};\n\t}\n\n\t// Zip-based file formats\n\t// Need to be before the `zip` check\n\tif (check([0x50, 0x4B, 0x3, 0x4])) {\n\t\tif (\n\t\t\tcheck([0x6D, 0x69, 0x6D, 0x65, 0x74, 0x79, 0x70, 0x65, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x65, 0x70, 0x75, 0x62, 0x2B, 0x7A, 0x69, 0x70], {offset: 30})\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'epub',\n\t\t\t\tmime: 'application/epub+zip'\n\t\t\t};\n\t\t}\n\n\t\t// Assumes signed `.xpi` from addons.mozilla.org\n\t\tif (check(xpiZipFilename, {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'xpi',\n\t\t\t\tmime: 'application/x-xpinstall'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.text', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'odt',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.text'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.spreadsheet', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'ods',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.spreadsheet'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.presentation', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'odp',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.presentation'\n\t\t\t};\n\t\t}\n\n\t\t// The docx, xlsx and pptx file types extend the Office Open XML file format:\n\t\t// https://en.wikipedia.org/wiki/Office_Open_XML_file_formats\n\t\t// We look for:\n\t\t// - one entry named '[Content_Types].xml' or '_rels/.rels',\n\t\t// - one entry indicating specific type of file.\n\t\t// MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it.\n\t\tconst findNextZipHeaderIndex = (arr, startAt = 0) => arr.findIndex((el, i, arr) => i >= startAt && arr[i] === 0x50 && arr[i + 1] === 0x4B && arr[i + 2] === 0x3 && arr[i + 3] === 0x4);\n\n\t\tlet zipHeaderIndex = 0; // The first zip header was already found at index 0\n\t\tlet oxmlFound = false;\n\t\tlet type = null;\n\n\t\tdo {\n\t\t\tconst offset = zipHeaderIndex + 30;\n\n\t\t\tif (!oxmlFound) {\n\t\t\t\toxmlFound = (check(oxmlContentTypes, {offset}) || check(oxmlRels, {offset}));\n\t\t\t}\n\n\t\t\tif (!type) {\n\t\t\t\tif (checkString('word/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'docx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n\t\t\t\t\t};\n\t\t\t\t} else if (checkString('ppt/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'pptx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n\t\t\t\t\t};\n\t\t\t\t} else if (checkString('xl/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'xlsx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (oxmlFound && type) {\n\t\t\t\treturn type;\n\t\t\t}\n\n\t\t\tzipHeaderIndex = findNextZipHeaderIndex(buf, offset);\n\t\t} while (zipHeaderIndex >= 0);\n\n\t\t// No more zip parts available in the buffer, but maybe we are almost certain about the type?\n\t\tif (type) {\n\t\t\treturn type;\n\t\t}\n\t}\n\n\tif (\n\t\tcheck([0x50, 0x4B]) &&\n\t\t(buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) &&\n\t\t(buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)\n\t) {\n\t\treturn {\n\t\t\text: 'zip',\n\t\t\tmime: 'application/zip'\n\t\t};\n\t}\n\n\tif (check([0x75, 0x73, 0x74, 0x61, 0x72], {offset: 257})) {\n\t\treturn {\n\t\t\text: 'tar',\n\t\t\tmime: 'application/x-tar'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) &&\n\t\t(buf[6] === 0x0 || buf[6] === 0x1)\n\t) {\n\t\treturn {\n\t\t\text: 'rar',\n\t\t\tmime: 'application/x-rar-compressed'\n\t\t};\n\t}\n\n\tif (check([0x1F, 0x8B, 0x8])) {\n\t\treturn {\n\t\t\text: 'gz',\n\t\t\tmime: 'application/gzip'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x5A, 0x68])) {\n\t\treturn {\n\t\t\text: 'bz2',\n\t\t\tmime: 'application/x-bzip2'\n\t\t};\n\t}\n\n\tif (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) {\n\t\treturn {\n\t\t\text: '7z',\n\t\t\tmime: 'application/x-7z-compressed'\n\t\t};\n\t}\n\n\tif (check([0x78, 0x01])) {\n\t\treturn {\n\t\t\text: 'dmg',\n\t\t\tmime: 'application/x-apple-diskimage'\n\t\t};\n\t}\n\n\tif (check([0x33, 0x67, 0x70, 0x35]) || // 3gp5\n\t\t(\n\t\t\tcheck([0x0, 0x0, 0x0]) && check([0x66, 0x74, 0x79, 0x70], {offset: 4}) &&\n\t\t\t\t(\n\t\t\t\t\tcheck([0x6D, 0x70, 0x34, 0x31], {offset: 8}) || // MP41\n\t\t\t\t\tcheck([0x6D, 0x70, 0x34, 0x32], {offset: 8}) || // MP42\n\t\t\t\t\tcheck([0x69, 0x73, 0x6F, 0x6D], {offset: 8}) || // ISOM\n\t\t\t\t\tcheck([0x69, 0x73, 0x6F, 0x32], {offset: 8}) || // ISO2\n\t\t\t\t\tcheck([0x6D, 0x6D, 0x70, 0x34], {offset: 8}) || // MMP4\n\t\t\t\t\tcheck([0x4D, 0x34, 0x56], {offset: 8}) || // M4V\n\t\t\t\t\tcheck([0x64, 0x61, 0x73, 0x68], {offset: 8}) // DASH\n\t\t\t\t)\n\t\t)) {\n\t\treturn {\n\t\t\text: 'mp4',\n\t\t\tmime: 'video/mp4'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x54, 0x68, 0x64])) {\n\t\treturn {\n\t\t\text: 'mid',\n\t\t\tmime: 'audio/midi'\n\t\t};\n\t}\n\n\t// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska\n\tif (check([0x1A, 0x45, 0xDF, 0xA3])) {\n\t\tconst sliced = buf.subarray(4, 4 + 4096);\n\t\tconst idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82);\n\n\t\tif (idPos !== -1) {\n\t\t\tconst docTypePos = idPos + 3;\n\t\t\tconst findDocType = type => [...type].every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0));\n\n\t\t\tif (findDocType('matroska')) {\n\t\t\t\treturn {\n\t\t\t\t\text: 'mkv',\n\t\t\t\t\tmime: 'video/x-matroska'\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (findDocType('webm')) {\n\t\t\t\treturn {\n\t\t\t\t\text: 'webm',\n\t\t\t\t\tmime: 'video/webm'\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\tif (check([0x0, 0x0, 0x0, 0x14, 0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20]) ||\n\t\tcheck([0x66, 0x72, 0x65, 0x65], {offset: 4}) || // Type: `free`\n\t\tcheck([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], {offset: 4}) ||\n\t\tcheck([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // MJPEG\n\t\tcheck([0x6D, 0x6F, 0x6F, 0x76], {offset: 4}) || // Type: `moov`\n\t\tcheck([0x77, 0x69, 0x64, 0x65], {offset: 4})) {\n\t\treturn {\n\t\t\text: 'mov',\n\t\t\tmime: 'video/quicktime'\n\t\t};\n\t}\n\n\t// RIFF file format which might be AVI, WAV, QCP, etc\n\tif (check([0x52, 0x49, 0x46, 0x46])) {\n\t\tif (check([0x41, 0x56, 0x49], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'avi',\n\t\t\t\tmime: 'video/vnd.avi'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x57, 0x41, 0x56, 0x45], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'wav',\n\t\t\t\tmime: 'audio/vnd.wave'\n\t\t\t};\n\t\t}\n\n\t\t// QLCM, QCP file\n\t\tif (check([0x51, 0x4C, 0x43, 0x4D], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'qcp',\n\t\t\t\tmime: 'audio/qcelp'\n\t\t\t};\n\t\t}\n\t}\n\n\t// ASF_Header_Object first 80 bytes\n\tif (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) {\n\t\t// Search for header should be in first 1KB of file.\n\n\t\tlet offset = 30;\n\t\tdo {\n\t\t\tconst objectSize = readUInt64LE(buf, offset + 16);\n\t\t\tif (check([0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65], {offset})) {\n\t\t\t\t// Sync on Stream-Properties-Object (B7DC0791-A9B7-11CF-8EE6-00C00C205365)\n\t\t\t\tif (check([0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) {\n\t\t\t\t\t// Found audio:\n\t\t\t\t\treturn {\n\t\t\t\t\t\text: 'wma',\n\t\t\t\t\t\tmime: 'audio/x-ms-wma'\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (check([0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) {\n\t\t\t\t\t// Found video:\n\t\t\t\t\treturn {\n\t\t\t\t\t\text: 'wmv',\n\t\t\t\t\t\tmime: 'video/x-ms-asf'\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\toffset += objectSize;\n\t\t} while (offset + 24 <= buf.length);\n\n\t\t// Default to ASF generic extension\n\t\treturn {\n\t\t\text: 'asf',\n\t\t\tmime: 'application/vnd.ms-asf'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x0, 0x0, 0x1, 0xBA]) ||\n\t\tcheck([0x0, 0x0, 0x1, 0xB3])\n\t) {\n\t\treturn {\n\t\t\text: 'mpg',\n\t\t\tmime: 'video/mpeg'\n\t\t};\n\t}\n\n\tif (check([0x66, 0x74, 0x79, 0x70, 0x33, 0x67], {offset: 4})) {\n\t\treturn {\n\t\t\text: '3gp',\n\t\t\tmime: 'video/3gpp'\n\t\t};\n\t}\n\n\t// Check for MPEG header at different starting offsets\n\tfor (let start = 0; start < 2 && start < (buf.length - 16); start++) {\n\t\tif (\n\t\t\tcheck([0x49, 0x44, 0x33], {offset: start}) || // ID3 header\n\t\t\tcheck([0xFF, 0xE2], {offset: start, mask: [0xFF, 0xE2]}) // MPEG 1 or 2 Layer 3 header\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp3',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xE4], {offset: start, mask: [0xFF, 0xE4]}) // MPEG 1 or 2 Layer 2 header\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp2',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xF8], {offset: start, mask: [0xFF, 0xFC]}) // MPEG 2 layer 0 using ADTS\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp2',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xF0], {offset: start, mask: [0xFF, 0xFC]}) // MPEG 4 layer 0 using ADTS\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp4',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\t}\n\n\tif (\n\t\tcheck([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4})\n\t) {\n\t\treturn { // MPEG-4 layer 3 (audio)\n\t\t\text: 'm4a',\n\t\t\tmime: 'audio/mp4' // RFC 4337\n\t\t};\n\t}\n\n\t// Needs to be before `ogg` check\n\tif (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) {\n\t\treturn {\n\t\t\text: 'opus',\n\t\t\tmime: 'audio/opus'\n\t\t};\n\t}\n\n\t// If 'OggS' in first bytes, then OGG container\n\tif (check([0x4F, 0x67, 0x67, 0x53])) {\n\t\t// This is a OGG container\n\n\t\t// If ' theora' in header.\n\t\tif (check([0x80, 0x74, 0x68, 0x65, 0x6F, 0x72, 0x61], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogv',\n\t\t\t\tmime: 'video/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// If '\\x01video' in header.\n\t\tif (check([0x01, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x00], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogm',\n\t\t\t\tmime: 'video/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// If ' FLAC' in header https://xiph.org/flac/faq.html\n\t\tif (check([0x7F, 0x46, 0x4C, 0x41, 0x43], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'oga',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// 'Speex ' in header https://en.wikipedia.org/wiki/Speex\n\t\tif (check([0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'spx',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// If '\\x01vorbis' in header\n\t\tif (check([0x01, 0x76, 0x6F, 0x72, 0x62, 0x69, 0x73], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogg',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// Default OGG container https://www.iana.org/assignments/media-types/application/ogg\n\t\treturn {\n\t\t\text: 'ogx',\n\t\t\tmime: 'application/ogg'\n\t\t};\n\t}\n\n\tif (check([0x66, 0x4C, 0x61, 0x43])) {\n\t\treturn {\n\t\t\text: 'flac',\n\t\t\tmime: 'audio/x-flac'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x41, 0x43, 0x20])) { // 'MAC '\n\t\treturn {\n\t\t\text: 'ape',\n\t\t\tmime: 'audio/ape'\n\t\t};\n\t}\n\n\tif (check([0x77, 0x76, 0x70, 0x6B])) { // 'wvpk'\n\t\treturn {\n\t\t\text: 'wv',\n\t\t\tmime: 'audio/wavpack'\n\t\t};\n\t}\n\n\tif (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) {\n\t\treturn {\n\t\t\text: 'amr',\n\t\t\tmime: 'audio/amr'\n\t\t};\n\t}\n\n\tif (check([0x25, 0x50, 0x44, 0x46])) {\n\t\treturn {\n\t\t\text: 'pdf',\n\t\t\tmime: 'application/pdf'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x5A])) {\n\t\treturn {\n\t\t\text: 'exe',\n\t\t\tmime: 'application/x-msdownload'\n\t\t};\n\t}\n\n\tif (\n\t\t(buf[0] === 0x43 || buf[0] === 0x46) &&\n\t\tcheck([0x57, 0x53], {offset: 1})\n\t) {\n\t\treturn {\n\t\t\text: 'swf',\n\t\t\tmime: 'application/x-shockwave-flash'\n\t\t};\n\t}\n\n\tif (check([0x7B, 0x5C, 0x72, 0x74, 0x66])) {\n\t\treturn {\n\t\t\text: 'rtf',\n\t\t\tmime: 'application/rtf'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x61, 0x73, 0x6D])) {\n\t\treturn {\n\t\t\text: 'wasm',\n\t\t\tmime: 'application/wasm'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x77, 0x4F, 0x46, 0x46]) &&\n\t\t(\n\t\t\tcheck([0x00, 0x01, 0x00, 0x00], {offset: 4}) ||\n\t\t\tcheck([0x4F, 0x54, 0x54, 0x4F], {offset: 4})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'woff',\n\t\t\tmime: 'font/woff'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x77, 0x4F, 0x46, 0x32]) &&\n\t\t(\n\t\t\tcheck([0x00, 0x01, 0x00, 0x00], {offset: 4}) ||\n\t\t\tcheck([0x4F, 0x54, 0x54, 0x4F], {offset: 4})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'woff2',\n\t\t\tmime: 'font/woff2'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x4C, 0x50], {offset: 34}) &&\n\t\t(\n\t\t\tcheck([0x00, 0x00, 0x01], {offset: 8}) ||\n\t\t\tcheck([0x01, 0x00, 0x02], {offset: 8}) ||\n\t\t\tcheck([0x02, 0x00, 0x02], {offset: 8})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'eot',\n\t\t\tmime: 'application/vnd.ms-fontobject'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x01, 0x00, 0x00, 0x00])) {\n\t\treturn {\n\t\t\text: 'ttf',\n\t\t\tmime: 'font/ttf'\n\t\t};\n\t}\n\n\tif (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {\n\t\treturn {\n\t\t\text: 'otf',\n\t\t\tmime: 'font/otf'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x01, 0x00])) {\n\t\treturn {\n\t\t\text: 'ico',\n\t\t\tmime: 'image/x-icon'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x02, 0x00])) {\n\t\treturn {\n\t\t\text: 'cur',\n\t\t\tmime: 'image/x-icon'\n\t\t};\n\t}\n\n\tif (check([0x46, 0x4C, 0x56, 0x01])) {\n\t\treturn {\n\t\t\text: 'flv',\n\t\t\tmime: 'video/x-flv'\n\t\t};\n\t}\n\n\tif (check([0x25, 0x21])) {\n\t\treturn {\n\t\t\text: 'ps',\n\t\t\tmime: 'application/postscript'\n\t\t};\n\t}\n\n\tif (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) {\n\t\treturn {\n\t\t\text: 'xz',\n\t\t\tmime: 'application/x-xz'\n\t\t};\n\t}\n\n\tif (check([0x53, 0x51, 0x4C, 0x69])) {\n\t\treturn {\n\t\t\text: 'sqlite',\n\t\t\tmime: 'application/x-sqlite3'\n\t\t};\n\t}\n\n\tif (check([0x4E, 0x45, 0x53, 0x1A])) {\n\t\treturn {\n\t\t\text: 'nes',\n\t\t\tmime: 'application/x-nintendo-nes-rom'\n\t\t};\n\t}\n\n\tif (check([0x43, 0x72, 0x32, 0x34])) {\n\t\treturn {\n\t\t\text: 'crx',\n\t\t\tmime: 'application/x-google-chrome-extension'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x4D, 0x53, 0x43, 0x46]) ||\n\t\tcheck([0x49, 0x53, 0x63, 0x28])\n\t) {\n\t\treturn {\n\t\t\text: 'cab',\n\t\t\tmime: 'application/vnd.ms-cab-compressed'\n\t\t};\n\t}\n\n\t// Needs to be before `ar` check\n\tif (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])) {\n\t\treturn {\n\t\t\text: 'deb',\n\t\t\tmime: 'application/x-deb'\n\t\t};\n\t}\n\n\tif (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E])) {\n\t\treturn {\n\t\t\text: 'ar',\n\t\t\tmime: 'application/x-unix-archive'\n\t\t};\n\t}\n\n\tif (check([0xED, 0xAB, 0xEE, 0xDB])) {\n\t\treturn {\n\t\t\text: 'rpm',\n\t\t\tmime: 'application/x-rpm'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x1F, 0xA0]) ||\n\t\tcheck([0x1F, 0x9D])\n\t) {\n\t\treturn {\n\t\t\text: 'Z',\n\t\t\tmime: 'application/x-compress'\n\t\t};\n\t}\n\n\tif (check([0x4C, 0x5A, 0x49, 0x50])) {\n\t\treturn {\n\t\t\text: 'lz',\n\t\t\tmime: 'application/x-lzip'\n\t\t};\n\t}\n\n\tif (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) {\n\t\treturn {\n\t\t\text: 'msi',\n\t\t\tmime: 'application/x-msi'\n\t\t};\n\t}\n\n\tif (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) {\n\t\treturn {\n\t\t\text: 'mxf',\n\t\t\tmime: 'application/mxf'\n\t\t};\n\t}\n\n\tif (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) {\n\t\treturn {\n\t\t\text: 'mts',\n\t\t\tmime: 'video/mp2t'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) {\n\t\treturn {\n\t\t\text: 'blend',\n\t\t\tmime: 'application/x-blender'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x50, 0x47, 0xFB])) {\n\t\treturn {\n\t\t\text: 'bpg',\n\t\t\tmime: 'image/bpg'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A])) {\n\t\t// JPEG-2000 family\n\n\t\tif (check([0x6A, 0x70, 0x32, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jp2',\n\t\t\t\tmime: 'image/jp2'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6A, 0x70, 0x78, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jpx',\n\t\t\t\tmime: 'image/jpx'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6A, 0x70, 0x6D, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jpm',\n\t\t\t\tmime: 'image/jpm'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6D, 0x6A, 0x70, 0x32], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'mj2',\n\t\t\t\tmime: 'image/mj2'\n\t\t\t};\n\t\t}\n\t}\n\n\tif (check([0x46, 0x4F, 0x52, 0x4D])) {\n\t\treturn {\n\t\t\text: 'aif',\n\t\t\tmime: 'audio/aiff'\n\t\t};\n\t}\n\n\tif (checkString(' new Promise((resolve, reject) => {\n\t// Using `eval` to work around issues when bundling with Webpack\n\tconst stream = eval('require')('stream'); // eslint-disable-line no-eval\n\n\treadableStream.once('readable', () => {\n\t\tconst pass = new stream.PassThrough();\n\t\tconst chunk = readableStream.read(module.exports.minimumBytes) || readableStream.read();\n\t\ttry {\n\t\t\tpass.fileType = fileType(chunk);\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\n\t\treadableStream.unshift(chunk);\n\n\t\tif (stream.pipeline) {\n\t\t\tresolve(stream.pipeline(readableStream, pass, () => {}));\n\t\t} else {\n\t\t\tresolve(readableStream.pipe(pass));\n\t\t}\n\t});\n});\n","/**\n *\n * Dump data to a big JSON tree\n *\n * @fileoverview dump data to JSON tree\n * @author Kevin Kwok \n * @author Guillermo Webster \n * @author Jerome Wu \n */\n\n/**\n * deindent\n *\n * The generated HOCR is excessively indented, so\n * we get rid of that indentation\n *\n * @name deindent\n * @function deindent string\n * @access public\n * @param {string} html HOCR in html format\n * @returns {string} deindent html string\n */\nconst deindent = (html) => {\n const lines = html.split('\\n');\n if (lines[0].substring(0, 2) === ' ') {\n for (let i = 0; i < lines.length; i += 1) {\n if (lines[i].substring(0, 2) === ' ') {\n lines[i] = lines[i].slice(2);\n }\n }\n }\n return lines.join('\\n');\n};\n\n/**\n * dump\n *\n * @name dump\n * @function dump recognition result to a JSON object\n * @access public\n * @param {object} TessModule TessModule from TesseractCore\n * @param {object} api TesseractBaseAPI instance\n * @returns {object} dumpped JSON object\n */\nmodule.exports = (TessModule, api) => {\n const ri = api.GetIterator();\n const blocks = [];\n let block;\n let para;\n let textline;\n let word;\n let symbol;\n\n const enumToString = (value, prefix) => (\n Object.keys(TessModule)\n .filter(e => (e.substr(0, prefix.length + 1) === `${prefix}_`))\n .filter(e => TessModule[e] === value)\n .map(e => e.slice(prefix.length + 1))[0]\n );\n\n ri.Begin();\n do {\n if (ri.IsAtBeginningOf(TessModule.RIL_BLOCK)) {\n const poly = ri.BlockPolygon();\n let polygon = null;\n // BlockPolygon() returns null when automatic page segmentation is off\n if (TessModule.getPointer(poly) > 0) {\n const n = poly.get_n();\n const px = poly.get_x();\n const py = poly.get_y();\n polygon = [];\n for (let i = 0; i < n; i += 1) {\n polygon.push([px.getValue(i), py.getValue(i)]);\n }\n TessModule._ptaDestroy(TessModule.getPointer(poly));\n }\n\n block = {\n paragraphs: [],\n text: ri.GetUTF8Text(TessModule.RIL_BLOCK),\n confidence: ri.Confidence(TessModule.RIL_BLOCK),\n baseline: ri.getBaseline(TessModule.RIL_BLOCK),\n bbox: ri.getBoundingBox(TessModule.RIL_BLOCK),\n blocktype: enumToString(ri.BlockType(), 'PT'),\n polygon,\n };\n blocks.push(block);\n }\n if (ri.IsAtBeginningOf(TessModule.RIL_PARA)) {\n para = {\n lines: [],\n text: ri.GetUTF8Text(TessModule.RIL_PARA),\n confidence: ri.Confidence(TessModule.RIL_PARA),\n baseline: ri.getBaseline(TessModule.RIL_PARA),\n bbox: ri.getBoundingBox(TessModule.RIL_PARA),\n is_ltr: !!ri.ParagraphIsLtr(),\n };\n block.paragraphs.push(para);\n }\n if (ri.IsAtBeginningOf(TessModule.RIL_TEXTLINE)) {\n textline = {\n words: [],\n text: ri.GetUTF8Text(TessModule.RIL_TEXTLINE),\n confidence: ri.Confidence(TessModule.RIL_TEXTLINE),\n baseline: ri.getBaseline(TessModule.RIL_TEXTLINE),\n bbox: ri.getBoundingBox(TessModule.RIL_TEXTLINE),\n };\n para.lines.push(textline);\n }\n if (ri.IsAtBeginningOf(TessModule.RIL_WORD)) {\n const fontInfo = ri.getWordFontAttributes();\n const wordDir = ri.WordDirection();\n word = {\n symbols: [],\n choices: [],\n\n text: ri.GetUTF8Text(TessModule.RIL_WORD),\n confidence: ri.Confidence(TessModule.RIL_WORD),\n baseline: ri.getBaseline(TessModule.RIL_WORD),\n bbox: ri.getBoundingBox(TessModule.RIL_WORD),\n\n is_numeric: !!ri.WordIsNumeric(),\n in_dictionary: !!ri.WordIsFromDictionary(),\n direction: enumToString(wordDir, 'DIR'),\n language: ri.WordRecognitionLanguage(),\n\n is_bold: fontInfo.is_bold,\n is_italic: fontInfo.is_italic,\n is_underlined: fontInfo.is_underlined,\n is_monospace: fontInfo.is_monospace,\n is_serif: fontInfo.is_serif,\n is_smallcaps: fontInfo.is_smallcaps,\n font_size: fontInfo.pointsize,\n font_id: fontInfo.font_id,\n font_name: fontInfo.font_name,\n };\n const wc = new TessModule.WordChoiceIterator(ri);\n do {\n word.choices.push({\n text: wc.GetUTF8Text(),\n confidence: wc.Confidence(),\n });\n } while (wc.Next());\n TessModule.destroy(wc);\n textline.words.push(word);\n }\n\n // let image = null;\n // var pix = ri.GetBinaryImage(TessModule.RIL_SYMBOL)\n // var image = pix2array(pix);\n // // for some reason it seems that things stop working if you destroy pics\n // TessModule._pixDestroy(TessModule.getPointer(pix));\n if (ri.IsAtBeginningOf(TessModule.RIL_SYMBOL)) {\n symbol = {\n choices: [],\n image: null,\n text: ri.GetUTF8Text(TessModule.RIL_SYMBOL),\n confidence: ri.Confidence(TessModule.RIL_SYMBOL),\n baseline: ri.getBaseline(TessModule.RIL_SYMBOL),\n bbox: ri.getBoundingBox(TessModule.RIL_SYMBOL),\n is_superscript: !!ri.SymbolIsSuperscript(),\n is_subscript: !!ri.SymbolIsSubscript(),\n is_dropcap: !!ri.SymbolIsDropcap(),\n };\n word.symbols.push(symbol);\n const ci = new TessModule.ChoiceIterator(ri);\n do {\n symbol.choices.push({\n text: ci.GetUTF8Text(),\n confidence: ci.Confidence(),\n });\n } while (ci.Next());\n // TessModule.destroy(i);\n }\n } while (ri.Next(TessModule.RIL_SYMBOL));\n TessModule.destroy(ri);\n\n return {\n text: api.GetUTF8Text(),\n html: deindent(api.GetHOCRText()),\n confidence: api.MeanTextConf(),\n blocks,\n psm: enumToString(api.GetPageSegMode(), 'PSM'),\n oem: enumToString(api.oem(), 'OEM'),\n version: api.Version(),\n };\n};\n"],"sourceRoot":""} \ No newline at end of file