hl

Форк
0
/
browserfs.min.js 
15 строк · 242.9 Кб
1
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BrowserFS=e():t.BrowserFS=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(t,r,i,o){"use strict";function s(t){if(t)return t;throw new be(ve.EIO,"Initialize BrowserFS with a file system using BrowserFS.initialize(filesystem)")}function a(t,e){switch(typeof t){case"number":return t;case"string":var n=parseInt(t,8);return isNaN(n)?e:n;default:return e}}function c(t){if(t instanceof Date)return t;if("number"==typeof t)return new Date(1e3*t);throw new be(ve.EINVAL,"Invalid time.")}function u(t){if(t.indexOf("\0")>=0)throw new be(ve.EINVAL,"Path must be a string without null bytes.");if(""===t)throw new be(ve.EINVAL,"Path must not be empty.");return me.resolve(t)}function f(t,e,n,r){switch(typeof t){case"object":return{encoding:"undefined"!=typeof t.encoding?t.encoding:e,flag:"undefined"!=typeof t.flag?t.flag:n,mode:a(t.mode,r)};case"string":return{encoding:t,flag:n,mode:r};default:return{encoding:e,flag:n,mode:r}}}function h(){}function l(t,e,n){t&&console.warn("["+e+"] Direct file system constructor usage is deprecated for this file system, and will be removed in the next major version. Please use the '"+e+".Create("+JSON.stringify(n)+", callback)' method instead. See https://github.com/jvilk/BrowserFS/issues/176 for more details.")}function p(){throw new Error("BFS has reached an impossible code path; please file a bug.")}function d(t,e,n){n.existsSync(t)||(d(me.dirname(t),e,n),n.mkdirSync(t,e))}function y(t){var e=g(t),n=e.byteOffset,r=e.byteLength;return 0===n&&r===e.buffer.byteLength?e.buffer:e.buffer.slice(n,n+r)}function g(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function _(e){return e instanceof t?e:e instanceof Uint8Array?v(e):t.from(e)}function v(e){return e instanceof t?e:0===e.byteOffset&&e.byteLength===e.buffer.byteLength?w(e.buffer):t.from(e.buffer,e.byteOffset,e.byteLength)}function w(e){return t.from(e)}function m(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=t.length),e<0||n<0||n>t.length||e>n)throw new TypeError("Invalid slice bounds on buffer of length "+t.length+": ["+e+", "+n+"]");if(0===t.length)return S();var r=g(t),i=t[0],o=(i+1)%255;return t[0]=o,r[0]===o?(r[0]=i,v(r.slice(e,n))):(t[0]=i,v(r.subarray(e,n)))}function S(){return Pe?Pe:Pe=t.alloc(0)}function E(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function b(t,e,n){return e=Ze(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Ze(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(s),E(t,this,a)}}function k(t){return t}function I(t,e){return b(t,e,k)}function O(t){return I(function(e,n){var r=Xe(function(n,r){var i=this;return t(e,function(t,e){t.apply(i,n.concat(e))},r)});return n.length?r.apply(this,n):r})}function F(t){var e=tn.call(t,nn),n=t[nn];try{t[nn]=void 0;var r=!0}catch(t){}var i=en.call(t);return r&&(e?t[nn]=n:delete t[nn]),i}function R(t){return on.call(t)}function N(t){return null==t?void 0===t?an:sn:cn&&cn in Object(t)?F(t):R(t)}function T(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function L(t){if(!T(t))return!1;var e=N(t);return e==fn||e==hn||e==un||e==ln}function A(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=pn}function D(t){return null!=t&&A(t.length)&&!L(t)}function x(){}function P(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}function C(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function U(t){return null!=t&&"object"==typeof t}function M(t){return U(t)&&N(t)==_n}function j(){return!1}function B(t,e){return e=null==e?Nn:e,!!e&&("number"==typeof t||Tn.test(t))&&t>-1&&t%1==0&&t<e}function z(t){return U(t)&&A(t.length)&&!!er[N(t)]}function Y(t){return function(e){return t(e)}}function q(t,e){var n=En(t),r=!n&&Sn(t),i=!n&&!r&&Rn(t),o=!n&&!r&&!i&&cr(t),s=n||r||i||o,a=s?C(t.length,String):[],c=a.length;for(var u in t)!e&&!fr.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||B(u,c))||a.push(u);return a}function W(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||hr;return t===n}function H(t,e){return function(n){return t(e(n))}}function V(t){if(!W(t))return lr(t);var e=[];for(var n in Object(t))dr.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Z(t){return D(t)?q(t):V(t)}function X(t){var e=-1,n=t.length;return function(){return++e<n?{value:t[e],key:e}:null}}function K(t){var e=-1;return function(){var n=t.next();return n.done?null:(e++,{value:n.value,key:e})}}function J(t){var e=Z(t),n=-1,r=e.length;return function(){var i=e[++n];return n<r?{value:t[i],key:i}:null}}function G(t){if(D(t))return X(t);var e=gn(t);return e?K(e):J(t)}function Q(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}function $(t){return function(e,n,r){function i(t,e){if(c-=1,t)a=!0,r(t);else{if(e===dn||a&&c<=0)return a=!0,r(null);o()}}function o(){for(;c<t&&!a;){var e=s();if(null===e)return a=!0,void(c<=0&&r(null));c+=1,n(e.value,e.key,Q(i))}}if(r=P(r||x),t<=0||!e)return r(null);var s=G(e),a=!1,c=0;o()}}function tt(t,e,n,r){$(e)(t,n,r)}function et(t,e){return function(n,r,i){return t(n,e,r,i)}}function nt(t,e,n){function r(t,e){t?n(t):++o!==s&&e!==dn||n(null)}n=P(n||x);var i=0,o=0,s=t.length;for(0===s&&n(null);i<s;i++)e(t[i],i,Q(r))}function rt(t){return function(e,n,r){return t(gr,e,n,r)}}function it(t,e,n,r){r=r||x,e=e||[];var i=[],o=0;t(e,function(t,e,r){var s=o++;n(t,function(t,e){i[s]=e,r(t)})},function(t){r(t,i)})}function ot(t){return function(e,n,r,i){return t($(n),e,r,i)}}function st(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function at(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var c=s[t?a:++i];if(n(o[c],c,o)===!1)break}return e}}function ct(t){setTimeout(t,0)}function ut(t){return I(function(e,n){t(function(){e.apply(null,n)})})}function ft(t,e,n,r){r=P(r||x),jr(t,function(t,r,i){n(e,t,function(t,n){e=n,i(t)})},function(t){r(t,e)})}function ht(t){return I(function(e,n){e.apply(null,n.concat(I(function(e,n){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&st(n,function(e){console[t](e)}))})))})}function lt(t){return function(e,n,r){return t(e,r)}}function pt(t,e,n){gr(t,lt(e),n)}function dt(){Yr||(Yr={},Yr[Dropbox.ApiError.NETWORK_ERROR]=ve.EIO,Yr[Dropbox.ApiError.INVALID_PARAM]=ve.EINVAL,Yr[Dropbox.ApiError.INVALID_TOKEN]=ve.EPERM,Yr[Dropbox.ApiError.OAUTH_ERROR]=ve.EPERM,Yr[Dropbox.ApiError.NOT_FOUND]=ve.ENOENT,Yr[Dropbox.ApiError.INVALID_METHOD]=ve.EINVAL,Yr[Dropbox.ApiError.NOT_ACCEPTABLE]=ve.EINVAL,Yr[Dropbox.ApiError.CONFLICT]=ve.EINVAL,Yr[Dropbox.ApiError.RATE_LIMITED]=ve.EBUSY,Yr[Dropbox.ApiError.SERVER_ERROR]=ve.EBUSY,Yr[Dropbox.ApiError.OVER_QUOTA]=ve.ENOSPC)}function yt(t){return t&&t.stat.isFile}function gt(t){return t&&t.stat.isFolder}function _t(t){return null===t||void 0===t||"object"==typeof t&&"number"==typeof t.byteLength}function vt(t,e){void 0===e&&(e="");for(var n=t.errno,r=t.node,i=[];r&&(i.unshift(r.name),r!==r.parent);)r=r.parent;return new be(n,Se[n],i.length>0?"/"+i.join("/"):e)}function wt(t,e){if(null!==e&&"object"==typeof e){var n=e,r=n.path;r&&(r="/"+me.relative(t,r),n.message=n.message.replace(n.path,r),n.path=r)}return e}function mt(t,e){return"function"==typeof e?function(n){arguments.length>0&&(arguments[0]=wt(t,n)),e.apply(null,arguments)}:e}function St(t,e,n){return"Sync"!==t.slice(t.length-4)?function(){return arguments.length>0&&(e&&(arguments[0]=me.join(this._folder,arguments[0])),n&&(arguments[1]=me.join(this._folder,arguments[1])),arguments[arguments.length-1]=mt(this._folder,arguments[arguments.length-1])),this._wrapped[t].apply(this._wrapped,arguments)}:function(){try{return e&&(arguments[0]=me.join(this._folder,arguments[0])),n&&(arguments[1]=me.join(this._folder,arguments[1])),this._wrapped[t].apply(this._wrapped,arguments)}catch(t){throw wt(this._folder,t)}}}function Et(t){return t.isDirectory}function bt(t,e,n,r){if("undefined"!=typeof navigator.webkitPersistentStorage)switch(t){case Jr.PERSISTENT:navigator.webkitPersistentStorage.requestQuota(e,n,r);break;case Jr.TEMPORARY:navigator.webkitTemporaryStorage.requestQuota(e,n,r);break;default:r(new TypeError("Invalid storage type: "+t))}else Jr.webkitStorageInfo.requestQuota(t,e,n,r)}function kt(t){return Array.prototype.slice.call(t||[],0)}function It(t,e,n){switch(t.name){case"PathExistsError":return be.EEXIST(e);case"QuotaExceededError":return be.FileError(ve.ENOSPC,e);case"NotFoundError":return be.ENOENT(e);case"SecurityError":return be.FileError(ve.EACCES,e);case"InvalidModificationError":return be.FileError(ve.EPERM,e);case"TypeMismatchError":return be.FileError(n?ve.ENOTDIR:ve.EISDIR,e);case"EncodingError":case"InvalidStateError":case"NoModificationAllowedError":default:return be.FileError(ve.EINVAL,e)}}function Ot(){return ni?ni:ni=t.from("{}")}function Ft(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"===t?e:3&e|8;return n.toString(16)})}function Rt(t,e){return!t||(e(t),!1)}function Nt(t,e,n){return!t||(e.abort(function(){n(t)}),!1)}function Tt(t,e){switch(void 0===e&&(e=t.toString()),t.name){case"NotFoundError":return new be(ve.ENOENT,e);case"QuotaExceededError":return new be(ve.ENOSPC,e);default:return new be(ve.EIO,e)}}function Lt(t,e,n){return void 0===e&&(e=ve.EIO),void 0===n&&(n=null),function(r){r.preventDefault(),t(new be(e,null!==n?n:void 0))}}function At(t,e,n){return e?function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=e[0],i=this._getFs(r);e[0]=i.path;try{return i.fs[t].apply(i.fs,e)}catch(t){throw this.standardizeError(t,i.path,r),t}}:function(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];var i=n[0],o=this._getFs(i);if(n[0]=o.path,"function"==typeof n[n.length-1]){var s=n[n.length-1];n[n.length-1]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];t.length>0&&t[0]instanceof be&&e.standardizeError(t[0],o.path,i),s.apply(null,t)}}return o.fs[t].apply(o.fs,n)}}function Dt(t){return 146|t}function xt(t){return Ie.getFileFlag(t)}function Pt(t){return{type:Pi.API_ERROR,errorData:qt(t.writeToBuffer())}}function Ct(t){return be.fromBuffer(Wt(t.errorData))}function Ut(t){return{type:Pi.ERROR,name:t.name,message:t.message,stack:t.stack}}function Mt(t){var e=Jr[t.name];"function"!=typeof e&&(e=Error);var n=new e(t.message);return n.stack=t.stack,n}function jt(t){return{type:Pi.STATS,statsData:qt(t.toBuffer())}}function Bt(t){return Fe.fromBuffer(Wt(t.statsData))}function zt(t){return{type:Pi.FILEFLAG,flagStr:t.getFlagString()}}function Yt(t){return Ie.getFileFlag(t.flagStr)}function qt(t){return y(t)}function Wt(t){return w(t)}function Ht(t){return{type:Pi.BUFFER,data:qt(t)}}function Vt(t){return Wt(t.data)}function Zt(t){return t&&"object"==typeof t&&t.hasOwnProperty("browserfsMessage")&&t.browserfsMessage}function Xt(t){return t&&"object"==typeof t&&t.hasOwnProperty("browserfsMessage")&&t.browserfsMessage}function Kt(e,n,r){var i=new XMLHttpRequest;i.open("GET",e,!0);var o=!0;switch(n){case"buffer":i.responseType="arraybuffer";break;case"json":try{i.responseType="json",o="json"===i.responseType}catch(t){o=!1}break;default:return r(new be(ve.EINVAL,"Invalid download type: "+n))}i.onreadystatechange=function(e){if(4===i.readyState){if(200!==i.status)return r(new be(i.status,"XHR error."));switch(n){case"buffer":return r(null,i.response?t.from(i.response):S());case"json":return o?r(null,i.response):r(null,JSON.parse(i.responseText))}}},i.send()}function Jt(e,n){var r=new XMLHttpRequest;r.open("GET",e,!1);var i=null,o=null;if(r.overrideMimeType("text/plain; charset=x-user-defined"),r.onreadystatechange=function(e){if(4===r.readyState){if(200!==r.status)return void(o=new be(r.status,"XHR error."));switch(n){case"buffer":var s=r.responseText;i=t.alloc(s.length);for(var a=0;a<s.length;a++)i[a]=s.charCodeAt(a);return;case"json":return void(i=JSON.parse(r.responseText))}}},r.send(),o)throw o;return i}function Gt(e,n){var r=new XMLHttpRequest;switch(r.open("GET",e,!1),n){case"buffer":r.responseType="arraybuffer";break;case"json":break;default:throw new be(ve.EINVAL,"Invalid download type: "+n)}var i,o;if(r.onreadystatechange=function(e){if(4===r.readyState)if(200===r.status)switch(n){case"buffer":i=t.from(r.response);break;case"json":i=JSON.parse(r.response)}else o=new be(r.status,"XHR error.")},r.send(),o)throw o;return i}function Qt(t,e,n){var r=new XMLHttpRequest;r.open("HEAD",e,t),r.onreadystatechange=function(t){if(4===r.readyState){if(200!==r.status)return n(new be(r.status,"XHR HEAD error."));try{return n(null,parseInt(r.getResponseHeader("Content-Length")||"-1",10))}catch(t){return n(new be(ve.EIO,"XHR HEAD error: Could not read content-length."))}}},r.send()}function $t(t){var e=-1;return Qt(!1,t,function(t,n){if(t)throw t;e=n}),e}function te(t,e){Qt(!0,t,e)}function ee(t){return!!t&&t.isFile()}function ne(t){return!!t&&t.isDir()}function re(t,e,n){try{n(null,t.toString(e))}catch(t){n(t)}}function ie(t,e){var n=31&e,r=(e>>5&15)-1,i=(e>>9)+1980,o=31&t,s=t>>5&63,a=t>>11;return new Date(i,r,n,a,s,o)}function oe(t,e,n,r){return 0===r?"":e?t.toString("utf8",n,n+r):Ji.byte2str(t.slice(n,n+r))}function se(t,e,n){return t.toString("ascii",e,e+n).trim()}function ae(t,e,n){if(1===n)return String.fromCharCode(t[e]);for(var r=Math.floor(n/2),i=new Array(r),o=0;o<r;o++){var s=e+(o<<1);i[o]=String.fromCharCode(t[s+1]|t[s]<<8)}return i.join("")}function ce(t,e){var n=parseInt(se(t,e,4),10),r=parseInt(se(t,e+4,2),10),i=parseInt(se(t,e+6,2),10),o=parseInt(se(t,e+8,2),10),s=parseInt(se(t,e+10,2),10),a=parseInt(se(t,e+12,2),10),c=parseInt(se(t,e+14,2),10);return new Date(n,r,i,o,s,a,100*c)}function ue(t,e){var n=t[e],r=t[e+1],i=t[e+2],o=t[e+3],s=t[e+4],a=t[e+5];return new Date(n,r-1,i,o,s,a)}function fe(t,e){var n=t.slice(e),r=new wo(n);switch(r.signatureWord()){case 17221:return new mo(n);case 20548:return new So(n);case 21328:return new Eo(n);case 21332:return new bo(n);case 17746:return new ko(n);case 17747:return new Io(n);case 20568:return new Fo(n);case 20558:return new Ro(n);case 21324:return new No(n);case 20045:return new Lo(n);case 17228:return new Ao(n);case 20556:return new Do(n);case 21061:return new xo(n);case 21574:return new Po(n);case 21318:return new Co(n);case 21074:return new Oo(n);default:return r}}function he(t,e,n,r){n-=4;for(var i=new Array;e<n;){var o=fe(t,e),s=o.length();if(0===s)return i;if(e+=s,o instanceof bo)break;o instanceof mo?i=i.concat(o.getEntries(r)):i.push(o)}return i}function le(e){e.Buffer=t,e.process=o;var n=e.require?e.require:null;e.require=function(t){var e=de(t);return e?e:n.apply(null,Array.prototype.slice.call(arguments,0))}}function pe(t,e){zo[t]=e}function de(t){switch(t){case"fs":return Le;case"path":return me;case"buffer":return we;case"process":return o;case"bfs_utils":return Ce;default:return zo[t]}}function ye(t){return Le.initialize(t)}function ge(t,e){_e(t,function(t,n){n?(ye(n),e()):e(t)})}function _e(t,e){function n(){if(!s){s=!0;var t=zo[r];t?t.Create(i,e):e(new be(ve.EPERM,"File system "+r+" is not available in BrowserFS."))}}var r=t.fs;if(!r)return e(new be(ve.EPERM,'Missing "fs" property on configuration object.'));var i=t.options,o=0,s=!1;if(null!==i&&"object"==typeof i){var a=!1,c=Object.keys(i).filter(function(t){return"fs"!==t});c.forEach(function(t){var r=i[t];null!==r&&"object"==typeof r&&r.fs&&(o++,_e(r,function(r,c){if(o--,r){if(s)return;s=!0,e(r)}else i[t]=c,0===o&&a&&n()}))}),a=!0}0===o&&n()}Object.defineProperty(e,"__esModule",{value:!0});var ve,we=n(10),me=n(13);!function(t){t[t.EPERM=1]="EPERM",t[t.ENOENT=2]="ENOENT",t[t.EIO=5]="EIO",t[t.EBADF=9]="EBADF",t[t.EACCES=13]="EACCES",t[t.EBUSY=16]="EBUSY",t[t.EEXIST=17]="EEXIST",t[t.ENOTDIR=20]="ENOTDIR",t[t.EISDIR=21]="EISDIR",t[t.EINVAL=22]="EINVAL",t[t.EFBIG=27]="EFBIG",t[t.ENOSPC=28]="ENOSPC",t[t.EROFS=30]="EROFS",t[t.ENOTEMPTY=39]="ENOTEMPTY",t[t.ENOTSUP=95]="ENOTSUP"}(ve||(ve={}));var Se={};Se[ve.EPERM]="Operation not permitted.",Se[ve.ENOENT]="No such file or directory.",Se[ve.EIO]="Input/output error.",Se[ve.EBADF]="Bad file descriptor.",Se[ve.EACCES]="Permission denied.",Se[ve.EBUSY]="Resource busy or locked.",Se[ve.EEXIST]="File exists.",Se[ve.ENOTDIR]="File is not a directory.",Se[ve.EISDIR]="File is a directory.",Se[ve.EINVAL]="Invalid argument.",Se[ve.EFBIG]="File is too big.",Se[ve.ENOSPC]="No space left on disk.",Se[ve.EROFS]="Cannot modify a read-only file system.",Se[ve.ENOTEMPTY]="Directory is not empty.",Se[ve.ENOTSUP]="Operation is not supported.";var Ee,be=function(e){function n(t,n,r){void 0===n&&(n=Se[t]),e.call(this,n),this.syscall="",this.errno=t,this.code=ve[t],this.path=r,this.stack=(new e).stack,this.message="Error: "+this.code+": "+n+(this.path?", '"+this.path+"'":"")}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.fromJSON=function(t){var e=new n(0);return e.errno=t.errno,e.code=t.code,e.path=t.path,e.stack=t.stack,e.message=t.message,e},n.fromBuffer=function(t,e){return void 0===e&&(e=0),n.fromJSON(JSON.parse(t.toString("utf8",e+4,e+4+t.readUInt32LE(e))))},n.FileError=function(t,e){return new n(t,Se[t],e)},n.ENOENT=function(t){return this.FileError(ve.ENOENT,t)},n.EEXIST=function(t){return this.FileError(ve.EEXIST,t)},n.EISDIR=function(t){return this.FileError(ve.EISDIR,t)},n.ENOTDIR=function(t){return this.FileError(ve.ENOTDIR,t)},n.EPERM=function(t){return this.FileError(ve.EPERM,t)},n.ENOTEMPTY=function(t){return this.FileError(ve.ENOTEMPTY,t)},n.prototype.toString=function(){return this.message},n.prototype.toJSON=function(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}},n.prototype.writeToBuffer=function(e,n){void 0===e&&(e=t.alloc(this.bufferSize())),void 0===n&&(n=0);var r=e.write(JSON.stringify(this.toJSON()),n+4);return e.writeUInt32LE(r,n),e},n.prototype.bufferSize=function(){return 4+t.byteLength(JSON.stringify(this.toJSON()))},n}(Error),ke=Object.freeze({get ErrorCode(){return ve},ErrorStrings:Se,ApiError:be});!function(t){t[t.NOP=0]="NOP",t[t.THROW_EXCEPTION=1]="THROW_EXCEPTION",t[t.TRUNCATE_FILE=2]="TRUNCATE_FILE",t[t.CREATE_FILE=3]="CREATE_FILE"}(Ee||(Ee={}));var Ie=function t(e){if(this.flagStr=e,t.validFlagStrs.indexOf(e)<0)throw new be(ve.EINVAL,"Invalid flag: "+e)};Ie.getFileFlag=function(t){return Ie.flagCache.hasOwnProperty(t)?Ie.flagCache[t]:Ie.flagCache[t]=new Ie(t)},Ie.prototype.getFlagString=function(){return this.flagStr},Ie.prototype.isReadable=function(){return this.flagStr.indexOf("r")!==-1||this.flagStr.indexOf("+")!==-1},Ie.prototype.isWriteable=function(){return this.flagStr.indexOf("w")!==-1||this.flagStr.indexOf("a")!==-1||this.flagStr.indexOf("+")!==-1},Ie.prototype.isTruncating=function(){return this.flagStr.indexOf("w")!==-1},Ie.prototype.isAppendable=function(){return this.flagStr.indexOf("a")!==-1},Ie.prototype.isSynchronous=function(){return this.flagStr.indexOf("s")!==-1},Ie.prototype.isExclusive=function(){return this.flagStr.indexOf("x")!==-1},Ie.prototype.pathExistsAction=function(){return this.isExclusive()?Ee.THROW_EXCEPTION:this.isTruncating()?Ee.TRUNCATE_FILE:Ee.NOP},Ie.prototype.pathNotExistsAction=function(){return(this.isWriteable()||this.isAppendable())&&"r+"!==this.flagStr?Ee.CREATE_FILE:Ee.THROW_EXCEPTION},Ie.flagCache={},Ie.validFlagStrs=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];var Oe;!function(t){t[t.FILE=32768]="FILE",t[t.DIRECTORY=16384]="DIRECTORY",t[t.SYMLINK=40960]="SYMLINK"}(Oe||(Oe={}));var Fe=function(t,e,n,r,i,o){if(void 0===r&&(r=new Date),void 0===i&&(i=new Date),void 0===o&&(o=new Date),this.size=e,this.atime=r,this.mtime=i,this.ctime=o,this.dev=0,this.ino=0,this.rdev=0,this.nlink=1,this.blksize=4096,this.uid=0,this.gid=0,this.birthtime=new Date(0),this.fileData=null,n)this.mode=n;else switch(t){case Oe.FILE:this.mode=420;break;case Oe.DIRECTORY:default:this.mode=511}this.blocks=Math.ceil(e/512),this.mode<4096&&(this.mode|=t)};Fe.fromBuffer=function(t){var e=t.readUInt32LE(0),n=t.readUInt32LE(4),r=t.readDoubleLE(8),i=t.readDoubleLE(16),o=t.readDoubleLE(24);return new Fe(61440&n,e,4095&n,new Date(r),new Date(i),new Date(o))},Fe.prototype.toBuffer=function(){var e=t.alloc(32);return e.writeUInt32LE(this.size,0),e.writeUInt32LE(this.mode,4),e.writeDoubleLE(this.atime.getTime(),8),e.writeDoubleLE(this.mtime.getTime(),16),e.writeDoubleLE(this.ctime.getTime(),24),e},Fe.prototype.clone=function(){return new Fe(61440&this.mode,this.size,4095&this.mode,this.atime,this.mtime,this.ctime)},Fe.prototype.isFile=function(){return(61440&this.mode)===Oe.FILE},Fe.prototype.isDirectory=function(){return(61440&this.mode)===Oe.DIRECTORY},Fe.prototype.isSymbolicLink=function(){return(61440&this.mode)===Oe.SYMLINK},Fe.prototype.chmod=function(t){this.mode=61440&this.mode|t},Fe.prototype.isSocket=function(){return!1},Fe.prototype.isBlockDevice=function(){return!1},Fe.prototype.isCharacterDevice=function(){return!1},Fe.prototype.isFIFO=function(){return!1};var Re=function(t,e){return t},Ne=function(){this.F_OK=0,this.R_OK=4,this.W_OK=2,this.X_OK=1,this.root=null,this.fdMap={},this.nextFd=100};Ne.prototype.initialize=function(t){if(!t.constructor.isAvailable())throw new be(ve.EINVAL,"Tried to instantiate BrowserFS with an unavailable file system.");return this.root=t},Ne.prototype._toUnixTimestamp=function(t){if("number"==typeof t)return t;if(t instanceof Date)return t.getTime()/1e3;throw new Error("Cannot parse time: "+t)},Ne.prototype.getRootFS=function(){return this.root?this.root:null},Ne.prototype.rename=function(t,e,n){void 0===n&&(n=h);var r=Re(n,1);try{s(this.root).rename(u(t),u(e),r)}catch(t){r(t)}},Ne.prototype.renameSync=function(t,e){s(this.root).renameSync(u(t),u(e))},Ne.prototype.exists=function(t,e){void 0===e&&(e=h);var n=Re(e,1);try{return s(this.root).exists(u(t),n)}catch(t){return n(!1)}},Ne.prototype.existsSync=function(t){try{return s(this.root).existsSync(u(t))}catch(t){return!1}},Ne.prototype.stat=function(t,e){void 0===e&&(e=h);var n=Re(e,2);try{return s(this.root).stat(u(t),!1,n)}catch(t){return n(t)}},Ne.prototype.statSync=function(t){return s(this.root).statSync(u(t),!1)},Ne.prototype.lstat=function(t,e){void 0===e&&(e=h);var n=Re(e,2);try{return s(this.root).stat(u(t),!0,n)}catch(t){return n(t)}},Ne.prototype.lstatSync=function(t){return s(this.root).statSync(u(t),!0)},Ne.prototype.truncate=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=h);var r=0;"function"==typeof e?n=e:"number"==typeof e&&(r=e);var i=Re(n,1);try{if(r<0)throw new be(ve.EINVAL);return s(this.root).truncate(u(t),r,i)}catch(t){return i(t)}},Ne.prototype.truncateSync=function(t,e){if(void 0===e&&(e=0),e<0)throw new be(ve.EINVAL);return s(this.root).truncateSync(u(t),e)},Ne.prototype.unlink=function(t,e){void 0===e&&(e=h);var n=Re(e,1);try{return s(this.root).unlink(u(t),n)}catch(t){return n(t)}},Ne.prototype.unlinkSync=function(t){return s(this.root).unlinkSync(u(t))},Ne.prototype.open=function(t,e,n,r){var i=this;void 0===r&&(r=h);var o=a(n,420);r="function"==typeof n?n:r;var c=Re(r,2);try{s(this.root).open(u(t),Ie.getFileFlag(e),o,function(t,e){e?c(t,i.getFdForFile(e)):c(t)})}catch(t){c(t)}},Ne.prototype.openSync=function(t,e,n){return void 0===n&&(n=420),this.getFdForFile(s(this.root).openSync(u(t),Ie.getFileFlag(e),a(n,420)))},Ne.prototype.readFile=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n=h);var r=f(e,null,"r",null);n="function"==typeof e?e:n;var i=Re(n,2);try{var o=Ie.getFileFlag(r.flag);return o.isReadable()?s(this.root).readFile(u(t),r.encoding,o,i):i(new be(ve.EINVAL,"Flag passed to readFile must allow for reading."))}catch(t){return i(t)}},Ne.prototype.readFileSync=function(t,e){void 0===e&&(e={});var n=f(e,null,"r",null),r=Ie.getFileFlag(n.flag);if(!r.isReadable())throw new be(ve.EINVAL,"Flag passed to readFile must allow for reading.");return s(this.root).readFileSync(u(t),n.encoding,r)},Ne.prototype.writeFile=function(t,e,n,r){void 0===n&&(n={}),void 0===r&&(r=h);var i=f(n,"utf8","w",420);r="function"==typeof n?n:r;var o=Re(r,1);try{var a=Ie.getFileFlag(i.flag);return a.isWriteable()?s(this.root).writeFile(u(t),e,i.encoding,a,i.mode,o):o(new be(ve.EINVAL,"Flag passed to writeFile must allow for writing."))}catch(t){return o(t)}},Ne.prototype.writeFileSync=function(t,e,n){var r=f(n,"utf8","w",420),i=Ie.getFileFlag(r.flag);if(!i.isWriteable())throw new be(ve.EINVAL,"Flag passed to writeFile must allow for writing.");return s(this.root).writeFileSync(u(t),e,r.encoding,i,r.mode)},Ne.prototype.appendFile=function(t,e,n,r){void 0===r&&(r=h);var i=f(n,"utf8","a",420);r="function"==typeof n?n:r;var o=Re(r,1);try{var a=Ie.getFileFlag(i.flag);if(!a.isAppendable())return o(new be(ve.EINVAL,"Flag passed to appendFile must allow for appending."));s(this.root).appendFile(u(t),e,i.encoding,a,i.mode,o)}catch(t){o(t)}},Ne.prototype.appendFileSync=function(t,e,n){var r=f(n,"utf8","a",420),i=Ie.getFileFlag(r.flag);if(!i.isAppendable())throw new be(ve.EINVAL,"Flag passed to appendFile must allow for appending.");return s(this.root).appendFileSync(u(t),e,r.encoding,i,r.mode)},Ne.prototype.fstat=function(t,e){void 0===e&&(e=h);var n=Re(e,2);try{var r=this.fd2file(t);r.stat(n)}catch(t){n(t)}},Ne.prototype.fstatSync=function(t){return this.fd2file(t).statSync()},Ne.prototype.close=function(t,e){var n=this;void 0===e&&(e=h);var r=Re(e,1);try{this.fd2file(t).close(function(e){e||n.closeFd(t),r(e)})}catch(t){r(t)}},Ne.prototype.closeSync=function(t){this.fd2file(t).closeSync(),this.closeFd(t)},Ne.prototype.ftruncate=function(t,e,n){void 0===n&&(n=h);var r="number"==typeof e?e:0;n="function"==typeof e?e:n;var i=Re(n,1);try{var o=this.fd2file(t);if(r<0)throw new be(ve.EINVAL);o.truncate(r,i)}catch(t){i(t)}},Ne.prototype.ftruncateSync=function(t,e){void 0===e&&(e=0);var n=this.fd2file(t);if(e<0)throw new be(ve.EINVAL);n.truncateSync(e)},Ne.prototype.fsync=function(t,e){void 0===e&&(e=h);var n=Re(e,1);try{this.fd2file(t).sync(n)}catch(t){n(t)}},Ne.prototype.fsyncSync=function(t){this.fd2file(t).syncSync()},Ne.prototype.fdatasync=function(t,e){void 0===e&&(e=h);var n=Re(e,1);try{this.fd2file(t).datasync(n)}catch(t){n(t)}},Ne.prototype.fdatasyncSync=function(t){this.fd2file(t).datasyncSync()},Ne.prototype.write=function(e,n,r,i,o,s){void 0===s&&(s=h);var a,c,u,f=null;if("string"==typeof n){var l="utf8";switch(typeof r){case"function":s=r;break;case"number":f=r,l="string"==typeof i?i:"utf8",s="function"==typeof o?o:s;break;default:return(s="function"==typeof i?i:"function"==typeof o?o:s)(new be(ve.EINVAL,"Invalid arguments."))}a=t.from(n,l),c=0,u=a.length}else a=n,c=r,u=i,f="number"==typeof o?o:null,s="function"==typeof o?o:s;var p=Re(s,3);try{var d=this.fd2file(e);void 0!==f&&null!==f||(f=d.getPos()),d.write(a,c,u,f,p)}catch(t){p(t)}},Ne.prototype.writeSync=function(e,n,r,i,o){var s,a,c,u=0;if("string"==typeof n){c="number"==typeof r?r:null;var f="string"==typeof i?i:"utf8";u=0,s=t.from(n,f),a=s.length}else s=n,u=r,a=i,c="number"==typeof o?o:null;var h=this.fd2file(e);return void 0!==c&&null!==c||(c=h.getPos()),h.writeSync(s,u,a,c)},Ne.prototype.read=function(e,n,r,i,o,s){void 0===s&&(s=h);var a,c,u,f,l;if("number"==typeof n){u=n,a=r;var p=i;s="function"==typeof o?o:s,c=0,f=t.alloc(u),l=Re(function(t,e,n){return t?s(t):void s(t,n.toString(p),e)},3)}else f=n,c=r,u=i,a=o,l=Re(s,3);try{var d=this.fd2file(e);void 0!==a&&null!==a||(a=d.getPos()),d.read(f,c,u,a,l)}catch(t){l(t)}},Ne.prototype.readSync=function(e,n,r,i,o){var s,a,c,u,f=!1,h="utf8";"number"==typeof n?(c=n,u=r,h=i,a=0,s=t.alloc(c),f=!0):(s=n,a=r,c=i,u=o);var l=this.fd2file(e);void 0!==u&&null!==u||(u=l.getPos());var p=l.readSync(s,a,c,u);return f?[s.toString(h),p]:p},Ne.prototype.fchown=function(t,e,n,r){void 0===r&&(r=h);var i=Re(r,1);try{this.fd2file(t).chown(e,n,i)}catch(t){i(t)}},Ne.prototype.fchownSync=function(t,e,n){this.fd2file(t).chownSync(e,n)},Ne.prototype.fchmod=function(t,e,n){var r=Re(n,1);try{var i="string"==typeof e?parseInt(e,8):e;this.fd2file(t).chmod(i,r)}catch(t){r(t)}},Ne.prototype.fchmodSync=function(t,e){var n="string"==typeof e?parseInt(e,8):e;this.fd2file(t).chmodSync(n)},Ne.prototype.futimes=function(t,e,n,r){void 0===r&&(r=h);var i=Re(r,1);try{var o=this.fd2file(t);"number"==typeof e&&(e=new Date(1e3*e)),"number"==typeof n&&(n=new Date(1e3*n)),o.utimes(e,n,i)}catch(t){i(t)}},Ne.prototype.futimesSync=function(t,e,n){this.fd2file(t).utimesSync(c(e),c(n))},Ne.prototype.rmdir=function(t,e){void 0===e&&(e=h);var n=Re(e,1);try{t=u(t),s(this.root).rmdir(t,n)}catch(t){n(t)}},Ne.prototype.rmdirSync=function(t){return t=u(t),s(this.root).rmdirSync(t)},Ne.prototype.mkdir=function(t,e,n){void 0===n&&(n=h),"function"==typeof e&&(n=e,e=511);var r=Re(n,1);try{t=u(t),s(this.root).mkdir(t,e,r)}catch(t){r(t)}},Ne.prototype.mkdirSync=function(t,e){s(this.root).mkdirSync(u(t),a(e,511))},Ne.prototype.readdir=function(t,e){void 0===e&&(e=h);var n=Re(e,2);try{t=u(t),s(this.root).readdir(t,n)}catch(t){n(t)}},Ne.prototype.readdirSync=function(t){return t=u(t),s(this.root).readdirSync(t)},Ne.prototype.link=function(t,e,n){void 0===n&&(n=h);var r=Re(n,1);try{t=u(t),e=u(e),s(this.root).link(t,e,r)}catch(t){r(t)}},Ne.prototype.linkSync=function(t,e){return t=u(t),e=u(e),s(this.root).linkSync(t,e)},Ne.prototype.symlink=function(t,e,n,r){void 0===r&&(r=h);var i="string"==typeof n?n:"file";r="function"==typeof n?n:r;var o=Re(r,1);try{if("file"!==i&&"dir"!==i)return o(new be(ve.EINVAL,"Invalid type: "+i));t=u(t),e=u(e),s(this.root).symlink(t,e,i,o)}catch(t){o(t)}},Ne.prototype.symlinkSync=function(t,e,n){if(n){if("file"!==n&&"dir"!==n)throw new be(ve.EINVAL,"Invalid type: "+n)}else n="file";return t=u(t),e=u(e),s(this.root).symlinkSync(t,e,n)},Ne.prototype.readlink=function(t,e){void 0===e&&(e=h);var n=Re(e,2);try{t=u(t),s(this.root).readlink(t,n)}catch(t){n(t)}},Ne.prototype.readlinkSync=function(t){return t=u(t),s(this.root).readlinkSync(t)},Ne.prototype.chown=function(t,e,n,r){void 0===r&&(r=h);var i=Re(r,1);try{t=u(t),s(this.root).chown(t,!1,e,n,i)}catch(t){i(t)}},Ne.prototype.chownSync=function(t,e,n){t=u(t),s(this.root).chownSync(t,!1,e,n)},Ne.prototype.lchown=function(t,e,n,r){void 0===r&&(r=h);var i=Re(r,1);try{t=u(t),s(this.root).chown(t,!0,e,n,i)}catch(t){i(t)}},Ne.prototype.lchownSync=function(t,e,n){t=u(t),s(this.root).chownSync(t,!0,e,n)},Ne.prototype.chmod=function(t,e,n){void 0===n&&(n=h);var r=Re(n,1);try{var i=a(e,-1);if(i<0)throw new be(ve.EINVAL,"Invalid mode.");s(this.root).chmod(u(t),!1,i,r)}catch(t){r(t)}},Ne.prototype.chmodSync=function(t,e){var n=a(e,-1);if(n<0)throw new be(ve.EINVAL,"Invalid mode.");t=u(t),s(this.root).chmodSync(t,!1,n)},Ne.prototype.lchmod=function(t,e,n){void 0===n&&(n=h);var r=Re(n,1);try{var i=a(e,-1);if(i<0)throw new be(ve.EINVAL,"Invalid mode.");s(this.root).chmod(u(t),!0,i,r)}catch(t){r(t)}},Ne.prototype.lchmodSync=function(t,e){var n=a(e,-1);if(n<1)throw new be(ve.EINVAL,"Invalid mode.");s(this.root).chmodSync(u(t),!0,n)},Ne.prototype.utimes=function(t,e,n,r){void 0===r&&(r=h);var i=Re(r,1);try{s(this.root).utimes(u(t),c(e),c(n),i)}catch(t){i(t)}},Ne.prototype.utimesSync=function(t,e,n){s(this.root).utimesSync(u(t),c(e),c(n))},Ne.prototype.realpath=function(t,e,n){void 0===n&&(n=h);var r="object"==typeof e?e:{};n="function"==typeof e?e:h;var i=Re(n,2);try{t=u(t),s(this.root).realpath(t,r,i)}catch(t){i(t)}},Ne.prototype.realpathSync=function(t,e){return void 0===e&&(e={}),t=u(t),s(this.root).realpathSync(t,e)},Ne.prototype.watchFile=function(t,e,n){throw void 0===n&&(n=h),
2
new be(ve.ENOTSUP)},Ne.prototype.unwatchFile=function(t,e){throw void 0===e&&(e=h),new be(ve.ENOTSUP)},Ne.prototype.watch=function(t,e,n){throw void 0===n&&(n=h),new be(ve.ENOTSUP)},Ne.prototype.access=function(t,e,n){throw void 0===n&&(n=h),new be(ve.ENOTSUP)},Ne.prototype.accessSync=function(t,e){throw new be(ve.ENOTSUP)},Ne.prototype.createReadStream=function(t,e){throw new be(ve.ENOTSUP)},Ne.prototype.createWriteStream=function(t,e){throw new be(ve.ENOTSUP)},Ne.prototype.wrapCallbacks=function(t){Re=t},Ne.prototype.getFdForFile=function(t){var e=this.nextFd++;return this.fdMap[e]=t,e},Ne.prototype.fd2file=function(t){var e=this.fdMap[t];if(e)return e;throw new be(ve.EBADF,"Invalid file descriptor.")},Ne.prototype.closeFd=function(t){delete this.fdMap[t]},Ne.Stats=Fe;var Te=new Ne,Le={},Ae=Ne.prototype;Object.keys(Ae).forEach(function(t){"function"==typeof Te[t]?Le[t]=function(){return Te[t].apply(Te,arguments)}:Le[t]=Te[t]}),Le.changeFSModule=function(t){Te=t},Le.getFSModule=function(){return Te},Le.FS=Ne;var De="undefined"!=typeof navigator&&!(!/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())&&navigator.userAgent.indexOf("Trident")===-1),xe="undefined"==typeof window,Pe=null,Ce=Object.freeze({deprecationMessage:l,isIE:De,isWebWorker:xe,fail:p,mkdirpSync:d,buffer2ArrayBuffer:y,buffer2Uint8array:g,arrayish2Buffer:_,uint8Array2Buffer:v,arrayBuffer2Buffer:w,copyingSlice:m,emptyBuffer:S}),Ue=function(t){this.fs=t,this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()};Ue.prototype.open=function(t){var e=this.fs.realPath(t.node),n=this.FS;try{n.isFile(t.node.mode)&&(t.nfd=this.nodefs.openSync(e,this.fs.flagsToPermissionString(t.flags)))}catch(t){if(!t.code)throw t;throw new n.ErrnoError(this.ERRNO_CODES[t.code])}},Ue.prototype.close=function(t){var e=this.FS;try{e.isFile(t.node.mode)&&t.nfd&&this.nodefs.closeSync(t.nfd)}catch(t){if(!t.code)throw t;throw new e.ErrnoError(this.ERRNO_CODES[t.code])}},Ue.prototype.read=function(t,e,n,r,i){try{return this.nodefs.readSync(t.nfd,v(e),n,r,i)}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Ue.prototype.write=function(t,e,n,r,i){try{return this.nodefs.writeSync(t.nfd,v(e),n,r,i)}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Ue.prototype.llseek=function(t,e,n){var r=e;if(1===n)r+=t.position;else if(2===n&&this.FS.isFile(t.node.mode))try{var i=this.nodefs.fstatSync(t.nfd);r+=i.size}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}if(r<0)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return t.position=r,r};var Me=function(t){this.fs=t,this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()};Me.prototype.getattr=function(t){var e,n=this.fs.realPath(t);try{e=this.nodefs.lstatSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},Me.prototype.setattr=function(t,e){var n=this.fs.realPath(t);try{if(void 0!==e.mode&&(this.nodefs.chmodSync(n,e.mode),t.mode=e.mode),void 0!==e.timestamp){var r=new Date(e.timestamp);this.nodefs.utimesSync(n,r,r)}}catch(t){if(!t.code)throw t;if("ENOTSUP"!==t.code)throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}if(void 0!==e.size)try{this.nodefs.truncateSync(n,e.size)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Me.prototype.lookup=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e),r=this.fs.getMode(n);return this.fs.createNode(t,e,r)},Me.prototype.mknod=function(t,e,n,r){var i=this.fs.createNode(t,e,n,r),o=this.fs.realPath(i);try{this.FS.isDir(i.mode)?this.nodefs.mkdirSync(o,i.mode):this.nodefs.writeFileSync(o,"",{mode:i.mode})}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return i},Me.prototype.rename=function(t,e,n){var r=this.fs.realPath(t),i=this.PATH.join2(this.fs.realPath(e),n);try{this.nodefs.renameSync(r,i),t.name=n,t.parent=e}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Me.prototype.unlink=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.unlinkSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Me.prototype.rmdir=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.rmdirSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Me.prototype.readdir=function(t){var e=this.fs.realPath(t);try{var n=this.nodefs.readdirSync(e);return n.push(".",".."),n}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Me.prototype.symlink=function(t,e,n){var r=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.symlinkSync(n,r)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Me.prototype.readlink=function(t){var e=this.fs.realPath(t);try{return this.nodefs.readlinkSync(e)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}};var je=function(t,e,n,r){void 0===t&&(t=self.FS),void 0===e&&(e=self.PATH),void 0===n&&(n=self.ERRNO_CODES),void 0===r&&(r=Le),this.flagsToPermissionStringMap={0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},this.nodefs=r,this.FS=t,this.PATH=e,this.ERRNO_CODES=n,this.node_ops=new Me(this),this.stream_ops=new Ue(this)};je.prototype.mount=function(t){return this.createNode(null,"/",this.getMode(t.opts.root),0)},je.prototype.createNode=function(t,e,n,r){var i=this.FS;if(!i.isDir(n)&&!i.isFile(n)&&!i.isLink(n))throw new i.ErrnoError(this.ERRNO_CODES.EINVAL);var o=i.createNode(t,e,n);return o.node_ops=this.node_ops,o.stream_ops=this.stream_ops,o},je.prototype.getMode=function(t){var e;try{e=this.nodefs.lstatSync(t)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return e.mode},je.prototype.realPath=function(t){for(var e=[];t.parent!==t;)e.push(t.name),t=t.parent;return e.push(t.mount.opts.root),e.reverse(),this.PATH.join.apply(null,e)},je.prototype.flagsToPermissionString=function(t){var e="string"==typeof t?parseInt(t,10):t;return e&=8191,e in this.flagsToPermissionStringMap?this.flagsToPermissionStringMap[e]:t},je.prototype.getNodeFS=function(){return this.nodefs},je.prototype.getFS=function(){return this.FS},je.prototype.getPATH=function(){return this.PATH},je.prototype.getERRNO_CODES=function(){return this.ERRNO_CODES};var Be=function(){};Be.prototype.supportsLinks=function(){return!1},Be.prototype.diskSpace=function(t,e){e(0,0)},Be.prototype.openFile=function(t,e,n){throw new be(ve.ENOTSUP)},Be.prototype.createFile=function(t,e,n,r){throw new be(ve.ENOTSUP)},Be.prototype.open=function(t,e,n,r){var i=this,o=function(o,s){if(o)switch(e.pathNotExistsAction()){case Ee.CREATE_FILE:return i.stat(me.dirname(t),!1,function(o,s){o?r(o):s&&!s.isDirectory()?r(be.ENOTDIR(me.dirname(t))):i.createFile(t,e,n,r)});case Ee.THROW_EXCEPTION:return r(be.ENOENT(t));default:return r(new be(ve.EINVAL,"Invalid FileFlag object."))}else{if(s&&s.isDirectory())return r(be.EISDIR(t));switch(e.pathExistsAction()){case Ee.THROW_EXCEPTION:return r(be.EEXIST(t));case Ee.TRUNCATE_FILE:return i.openFile(t,e,function(t,e){t?r(t):e?e.truncate(0,function(){e.sync(function(){r(null,e)})}):p()});case Ee.NOP:return i.openFile(t,e,r);default:return r(new be(ve.EINVAL,"Invalid FileFlag object."))}}};this.stat(t,!1,o)},Be.prototype.rename=function(t,e,n){n(new be(ve.ENOTSUP))},Be.prototype.renameSync=function(t,e){throw new be(ve.ENOTSUP)},Be.prototype.stat=function(t,e,n){n(new be(ve.ENOTSUP))},Be.prototype.statSync=function(t,e){throw new be(ve.ENOTSUP)},Be.prototype.openFileSync=function(t,e,n){throw new be(ve.ENOTSUP)},Be.prototype.createFileSync=function(t,e,n){throw new be(ve.ENOTSUP)},Be.prototype.openSync=function(t,e,n){var r;try{r=this.statSync(t,!1)}catch(r){switch(e.pathNotExistsAction()){case Ee.CREATE_FILE:var i=this.statSync(me.dirname(t),!1);if(!i.isDirectory())throw be.ENOTDIR(me.dirname(t));return this.createFileSync(t,e,n);case Ee.THROW_EXCEPTION:throw be.ENOENT(t);default:throw new be(ve.EINVAL,"Invalid FileFlag object.")}}if(r.isDirectory())throw be.EISDIR(t);switch(e.pathExistsAction()){case Ee.THROW_EXCEPTION:throw be.EEXIST(t);case Ee.TRUNCATE_FILE:return this.unlinkSync(t),this.createFileSync(t,e,r.mode);case Ee.NOP:return this.openFileSync(t,e,n);default:throw new be(ve.EINVAL,"Invalid FileFlag object.")}},Be.prototype.unlink=function(t,e){e(new be(ve.ENOTSUP))},Be.prototype.unlinkSync=function(t){throw new be(ve.ENOTSUP)},Be.prototype.rmdir=function(t,e){e(new be(ve.ENOTSUP))},Be.prototype.rmdirSync=function(t){throw new be(ve.ENOTSUP)},Be.prototype.mkdir=function(t,e,n){n(new be(ve.ENOTSUP))},Be.prototype.mkdirSync=function(t,e){throw new be(ve.ENOTSUP)},Be.prototype.readdir=function(t,e){e(new be(ve.ENOTSUP))},Be.prototype.readdirSync=function(t){throw new be(ve.ENOTSUP)},Be.prototype.exists=function(t,e){this.stat(t,null,function(t){e(!t)})},Be.prototype.existsSync=function(t){try{return this.statSync(t,!0),!0}catch(t){return!1}},Be.prototype.realpath=function(t,e,n){if(this.supportsLinks())for(var r=t.split(me.sep),i=0;i<r.length;i++){var o=r.slice(0,i+1);r[i]=me.join.apply(null,o)}else this.exists(t,function(e){e?n(null,t):n(be.ENOENT(t))})},Be.prototype.realpathSync=function(t,e){if(this.supportsLinks()){for(var n=t.split(me.sep),r=0;r<n.length;r++){var i=n.slice(0,r+1);n[r]=me.join.apply(me,i)}return n.join(me.sep)}if(this.existsSync(t))return t;throw be.ENOENT(t)},Be.prototype.truncate=function(t,e,n){this.open(t,Ie.getFileFlag("r+"),420,function(t,r){return t?n(t):void r.truncate(e,function(t){r.close(function(e){n(t||e)})})})},Be.prototype.truncateSync=function(t,e){var n=this.openSync(t,Ie.getFileFlag("r+"),420);try{n.truncateSync(e)}catch(t){throw t}finally{n.closeSync()}},Be.prototype.readFile=function(e,n,r,i){var o=i;this.open(e,r,420,function(e,r){return e?i(e):(i=function(t,e){r.close(function(n){return t||(t=n),o(t,e)})},void r.stat(function(e,o){if(e)return i(e);var s=t.alloc(o.size);r.read(s,0,o.size,0,function(t){if(t)return i(t);if(null===n)return i(t,s);try{i(null,s.toString(n))}catch(t){i(t)}})}))})},Be.prototype.readFileSync=function(e,n,r){var i=this.openSync(e,r,420);try{var o=i.statSync(),s=t.alloc(o.size);return i.readSync(s,0,o.size,0),i.closeSync(),null===n?s:s.toString(n)}finally{i.closeSync()}},Be.prototype.writeFile=function(e,n,r,i,o,s){var a=s;this.open(e,i,420,function(e,i){if(e)return s(e);s=function(t){i.close(function(e){a(t?t:e)})};try{"string"==typeof n&&(n=t.from(n,r))}catch(t){return s(t)}i.write(n,0,n.length,0,s)})},Be.prototype.writeFileSync=function(e,n,r,i,o){var s=this.openSync(e,i,o);try{"string"==typeof n&&(n=t.from(n,r)),s.writeSync(n,0,n.length,0)}finally{s.closeSync()}},Be.prototype.appendFile=function(e,n,r,i,o,s){var a=s;this.open(e,i,o,function(e,i){return e?s(e):(s=function(t){i.close(function(e){a(t?t:e)})},"string"==typeof n&&(n=t.from(n,r)),void i.write(n,0,n.length,null,s))})},Be.prototype.appendFileSync=function(e,n,r,i,o){var s=this.openSync(e,i,o);try{"string"==typeof n&&(n=t.from(n,r)),s.writeSync(n,0,n.length,null)}finally{s.closeSync()}},Be.prototype.chmod=function(t,e,n,r){r(new be(ve.ENOTSUP))},Be.prototype.chmodSync=function(t,e,n){throw new be(ve.ENOTSUP)},Be.prototype.chown=function(t,e,n,r,i){i(new be(ve.ENOTSUP))},Be.prototype.chownSync=function(t,e,n,r){throw new be(ve.ENOTSUP)},Be.prototype.utimes=function(t,e,n,r){r(new be(ve.ENOTSUP))},Be.prototype.utimesSync=function(t,e,n){throw new be(ve.ENOTSUP)},Be.prototype.link=function(t,e,n){n(new be(ve.ENOTSUP))},Be.prototype.linkSync=function(t,e){throw new be(ve.ENOTSUP)},Be.prototype.symlink=function(t,e,n,r){r(new be(ve.ENOTSUP))},Be.prototype.symlinkSync=function(t,e,n){throw new be(ve.ENOTSUP)},Be.prototype.readlink=function(t,e){e(new be(ve.ENOTSUP))},Be.prototype.readlinkSync=function(t){throw new be(ve.ENOTSUP)};var ze=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.supportsSynch=function(){return!0},e.prototype.rename=function(t,e,n){try{this.renameSync(t,e),n()}catch(t){n(t)}},e.prototype.stat=function(t,e,n){try{n(null,this.statSync(t,e))}catch(t){n(t)}},e.prototype.open=function(t,e,n,r){try{r(null,this.openSync(t,e,n))}catch(t){r(t)}},e.prototype.unlink=function(t,e){try{this.unlinkSync(t),e()}catch(t){e(t)}},e.prototype.rmdir=function(t,e){try{this.rmdirSync(t),e()}catch(t){e(t)}},e.prototype.mkdir=function(t,e,n){try{this.mkdirSync(t,e),n()}catch(t){n(t)}},e.prototype.readdir=function(t,e){try{e(null,this.readdirSync(t))}catch(t){e(t)}},e.prototype.chmod=function(t,e,n,r){try{this.chmodSync(t,e,n),r()}catch(t){r(t)}},e.prototype.chown=function(t,e,n,r,i){try{this.chownSync(t,e,n,r),i()}catch(t){i(t)}},e.prototype.utimes=function(t,e,n,r){try{this.utimesSync(t,e,n),r()}catch(t){r(t)}},e.prototype.link=function(t,e,n){try{this.linkSync(t,e),n()}catch(t){n(t)}},e.prototype.symlink=function(t,e,n,r){try{this.symlinkSync(t,e,n),r()}catch(t){r(t)}},e.prototype.readlink=function(t,e){try{e(null,this.readlinkSync(t))}catch(t){e(t)}},e}(Be),Ye=function(){};Ye.prototype.sync=function(t){t(new be(ve.ENOTSUP))},Ye.prototype.syncSync=function(){throw new be(ve.ENOTSUP)},Ye.prototype.datasync=function(t){this.sync(t)},Ye.prototype.datasyncSync=function(){return this.syncSync()},Ye.prototype.chown=function(t,e,n){n(new be(ve.ENOTSUP))},Ye.prototype.chownSync=function(t,e){throw new be(ve.ENOTSUP)},Ye.prototype.chmod=function(t,e){e(new be(ve.ENOTSUP))},Ye.prototype.chmodSync=function(t){throw new be(ve.ENOTSUP)},Ye.prototype.utimes=function(t,e,n){n(new be(ve.ENOTSUP))},Ye.prototype.utimesSync=function(t,e){throw new be(ve.ENOTSUP)};var qe=function(e){function n(t,n,r,i,o){if(e.call(this),this._pos=0,this._dirty=!1,this._fs=t,this._path=n,this._flag=r,this._stat=i,o?this._buffer=o:this._buffer=S(),this._stat.size!==this._buffer.length&&this._flag.isReadable())throw new Error("Invalid buffer: Buffer is "+this._buffer.length+" long, yet Stats object specifies that file is "+this._stat.size+" long.")}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.getBuffer=function(){return this._buffer},n.prototype.getStats=function(){return this._stat},n.prototype.getFlag=function(){return this._flag},n.prototype.getPath=function(){return this._path},n.prototype.getPos=function(){return this._flag.isAppendable()?this._stat.size:this._pos},n.prototype.advancePos=function(t){return this._pos+=t},n.prototype.setPos=function(t){return this._pos=t},n.prototype.sync=function(t){try{this.syncSync(),t()}catch(e){t(e)}},n.prototype.syncSync=function(){throw new be(ve.ENOTSUP)},n.prototype.close=function(t){try{this.closeSync(),t()}catch(e){t(e)}},n.prototype.closeSync=function(){throw new be(ve.ENOTSUP)},n.prototype.stat=function(t){try{t(null,this._stat.clone())}catch(e){t(e)}},n.prototype.statSync=function(){return this._stat.clone()},n.prototype.truncate=function(t,e){try{this.truncateSync(t),this._flag.isSynchronous()&&!Le.getRootFS().supportsSynch()&&this.sync(e),e()}catch(t){return e(t)}},n.prototype.truncateSync=function(e){if(this._dirty=!0,!this._flag.isWriteable())throw new be(ve.EPERM,"File not opened with a writeable mode.");if(this._stat.mtime=new Date,e>this._buffer.length){var n=t.alloc(e-this._buffer.length,0);return this.writeSync(n,0,n.length,this._buffer.length),void(this._flag.isSynchronous()&&Le.getRootFS().supportsSynch()&&this.syncSync())}this._stat.size=e;var r=t.alloc(e);this._buffer.copy(r,0,0,e),this._buffer=r,this._flag.isSynchronous()&&Le.getRootFS().supportsSynch()&&this.syncSync()},n.prototype.write=function(t,e,n,r,i){try{i(null,this.writeSync(t,e,n,r),t)}catch(t){i(t)}},n.prototype.writeSync=function(e,n,r,i){if(this._dirty=!0,void 0!==i&&null!==i||(i=this.getPos()),!this._flag.isWriteable())throw new be(ve.EPERM,"File not opened with a writeable mode.");var o=i+r;if(o>this._stat.size&&(this._stat.size=o,o>this._buffer.length)){var s=t.alloc(o);this._buffer.copy(s),this._buffer=s}var a=e.copy(this._buffer,i,n,n+r);return this._stat.mtime=new Date,this._flag.isSynchronous()?(this.syncSync(),a):(this.setPos(i+a),a)},n.prototype.read=function(t,e,n,r,i){try{i(null,this.readSync(t,e,n,r),t)}catch(t){i(t)}},n.prototype.readSync=function(t,e,n,r){if(!this._flag.isReadable())throw new be(ve.EPERM,"File not opened with a readable mode.");void 0!==r&&null!==r||(r=this.getPos());var i=r+n;i>this._stat.size&&(n=this._stat.size-r);var o=this._buffer.copy(t,e,r,r+n);return this._stat.atime=new Date,this._pos=r+n,o},n.prototype.chmod=function(t,e){try{this.chmodSync(t),e()}catch(t){e(t)}},n.prototype.chmodSync=function(t){if(!this._fs.supportsProps())throw new be(ve.ENOTSUP);this._dirty=!0,this._stat.chmod(t),this.syncSync()},n.prototype.isDirty=function(){return this._dirty},n.prototype.resetDirty=function(){this._dirty=!1},n}(Ye),We=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.close=function(t){t()},e.prototype.closeSync=function(){},e}(qe),He=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.closeSync=function(){this.syncSync()},e}(qe),Ve=function(t){function e(e,n,r){if(void 0===r&&(r=!0),t.call(this),this._queue=[],this._queueRunning=!1,this._isInitialized=!1,this._initializeCallbacks=[],this._sync=e,this._async=n,!e.supportsSynch())throw new Error("The first argument to AsyncMirror needs to be a synchronous file system.");l(r,"AsyncMirror",{sync:"sync file system instance",async:"async file system instance"})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{var r=new e(t.sync,t.async,!1);r.initialize(function(t){t?n(t):n(null,r)},!1)}catch(t){n(t)}},e.isAvailable=function(){return!0},e.prototype.getName=function(){return"AsyncMirror"},e.prototype._syncSync=function(t){this._sync.writeFileSync(t.getPath(),t.getBuffer(),null,Ie.getFileFlag("w"),t.getStats().mode),this.enqueueOp({apiMethod:"writeFile",arguments:[t.getPath(),t.getBuffer(),null,t.getFlag(),t.getStats().mode]})},e.prototype.initialize=function(t,e){var n=this;void 0===e&&(e=!0),e&&console.warn("[AsyncMirror] AsyncMirror.initialize() is deprecated and will be removed in the next major version. Please use 'AsyncMirror.Create({ sync: (sync file system instance), async: (async file system instance)}, cb)' to create and initialize AsyncMirror instances.");var r=this._initializeCallbacks,i=function(t){n._isInitialized=!t,n._initializeCallbacks=[],r.forEach(function(e){return e(t)})};if(this._isInitialized)t();else if(1===r.push(t)){var o=function(t,e,r){"/"!==t&&n._sync.mkdirSync(t,e),n._async.readdir(t,function(e,n){function i(e){e?r(e):o<n.length?(a(me.join(t,n[o]),i),o++):r()}var o=0;e?r(e):i()})},s=function(t,e,r){n._async.readFile(t,null,Ie.getFileFlag("r"),function(i,o){if(i)r(i);else try{n._sync.writeFileSync(t,o,null,Ie.getFileFlag("w"),e)}catch(t){i=t}finally{r(i)}})},a=function(t,e){n._async.stat(t,!1,function(n,r){n?e(n):r.isDirectory()?o(t,r.mode,e):s(t,r.mode,e)})};o("/",0,i)}},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return this._sync.supportsProps()&&this._async.supportsProps()},e.prototype.renameSync=function(t,e){this.checkInitialized(),this._sync.renameSync(t,e),this.enqueueOp({apiMethod:"rename",arguments:[t,e]})},e.prototype.statSync=function(t,e){return this.checkInitialized(),this._sync.statSync(t,e)},e.prototype.openSync=function(t,e,n){this.checkInitialized();var r=this._sync.openSync(t,e,n);return r.closeSync(),new He(this,t,e,this._sync.statSync(t,!1),this._sync.readFileSync(t,null,Ie.getFileFlag("r")))},e.prototype.unlinkSync=function(t){this.checkInitialized(),this._sync.unlinkSync(t),this.enqueueOp({apiMethod:"unlink",arguments:[t]})},e.prototype.rmdirSync=function(t){this.checkInitialized(),this._sync.rmdirSync(t),this.enqueueOp({apiMethod:"rmdir",arguments:[t]})},e.prototype.mkdirSync=function(t,e){this.checkInitialized(),this._sync.mkdirSync(t,e),this.enqueueOp({apiMethod:"mkdir",arguments:[t,e]})},e.prototype.readdirSync=function(t){return this.checkInitialized(),this._sync.readdirSync(t)},e.prototype.existsSync=function(t){return this.checkInitialized(),this._sync.existsSync(t)},e.prototype.chmodSync=function(t,e,n){this.checkInitialized(),this._sync.chmodSync(t,e,n),this.enqueueOp({apiMethod:"chmod",arguments:[t,e,n]})},e.prototype.chownSync=function(t,e,n,r){this.checkInitialized(),this._sync.chownSync(t,e,n,r),this.enqueueOp({apiMethod:"chown",arguments:[t,e,n,r]})},e.prototype.utimesSync=function(t,e,n){this.checkInitialized(),this._sync.utimesSync(t,e,n),this.enqueueOp({apiMethod:"utimes",arguments:[t,e,n]})},e.prototype.checkInitialized=function(){if(!this._isInitialized)throw new be(ve.EPERM,"AsyncMirrorFS is not initialized. Please initialize AsyncMirrorFS using its initialize() method before using it.")},e.prototype.enqueueOp=function(t){var e=this;if(this._queue.push(t),!this._queueRunning){this._queueRunning=!0;var n=function(t){if(t&&console.error("WARNING: File system has desynchronized. Received following error: "+t+"\n$"),e._queue.length>0){var r=e._queue.shift(),i=r.arguments;i.push(n),e._async[r.apiMethod].apply(e._async,i)}else e._queueRunning=!1};n()}},e}(ze),Ze=Math.max,Xe=function(t){return I(function(e){var n=e.pop();t.call(this,e,n)})},Ke="object"==typeof r&&r&&r.Object===Object&&r,Je="object"==typeof self&&self&&self.Object===Object&&self,Ge=Ke||Je||Function("return this")(),Qe=Ge.Symbol,$e=Object.prototype,tn=$e.hasOwnProperty,en=$e.toString,nn=Qe?Qe.toStringTag:void 0,rn=Object.prototype,on=rn.toString,sn="[object Null]",an="[object Undefined]",cn=Qe?Qe.toStringTag:void 0,un="[object AsyncFunction]",fn="[object Function]",hn="[object GeneratorFunction]",ln="[object Proxy]",pn=9007199254740991,dn={},yn="function"==typeof Symbol&&Symbol.iterator,gn=function(t){return yn&&t[yn]&&t[yn]()},_n="[object Arguments]",vn=Object.prototype,wn=vn.hasOwnProperty,mn=vn.propertyIsEnumerable,Sn=M(function(){return arguments}())?M:function(t){return U(t)&&wn.call(t,"callee")&&!mn.call(t,"callee")},En=Array.isArray,bn="object"==typeof e&&e&&!e.nodeType&&e,kn=bn&&"object"==typeof i&&i&&!i.nodeType&&i,In=kn&&kn.exports===bn,On=In?Ge.Buffer:void 0,Fn=On?On.isBuffer:void 0,Rn=Fn||j,Nn=9007199254740991,Tn=/^(?:0|[1-9]\d*)$/,Ln="[object Arguments]",An="[object Array]",Dn="[object Boolean]",xn="[object Date]",Pn="[object Error]",Cn="[object Function]",Un="[object Map]",Mn="[object Number]",jn="[object Object]",Bn="[object RegExp]",zn="[object Set]",Yn="[object String]",qn="[object WeakMap]",Wn="[object ArrayBuffer]",Hn="[object DataView]",Vn="[object Float32Array]",Zn="[object Float64Array]",Xn="[object Int8Array]",Kn="[object Int16Array]",Jn="[object Int32Array]",Gn="[object Uint8Array]",Qn="[object Uint8ClampedArray]",$n="[object Uint16Array]",tr="[object Uint32Array]",er={};er[Vn]=er[Zn]=er[Xn]=er[Kn]=er[Jn]=er[Gn]=er[Qn]=er[$n]=er[tr]=!0,er[Ln]=er[An]=er[Wn]=er[Dn]=er[Hn]=er[xn]=er[Pn]=er[Cn]=er[Un]=er[Mn]=er[jn]=er[Bn]=er[zn]=er[Yn]=er[qn]=!1;var nr="object"==typeof e&&e&&!e.nodeType&&e,rr=nr&&"object"==typeof i&&i&&!i.nodeType&&i,ir=rr&&rr.exports===nr,or=ir&&Ke.process,sr=function(){try{return or&&or.binding&&or.binding("util")}catch(t){}}(),ar=sr&&sr.isTypedArray,cr=ar?Y(ar):z,ur=Object.prototype,fr=ur.hasOwnProperty,hr=Object.prototype,lr=H(Object.keys,Object),pr=Object.prototype,dr=pr.hasOwnProperty,yr=et(tt,1/0),gr=function(t,e,n){var r=D(t)?nt:yr;r(t,e,n)},_r=rt(it);O(_r);var vr=ot(it),wr=et(vr,1);O(wr),I(function(t,e){return I(function(n){return t.apply(null,e.concat(n))})});var mr,Sr=(at(),"\\ud800-\\udfff"),Er="\\u0300-\\u036f",br="\\ufe20-\\ufe2f",kr="\\u20d0-\\u20ff",Ir=Er+br+kr,Or="\\ufe0e\\ufe0f",Fr="["+Sr+"]",Rr="["+Ir+"]",Nr="\\ud83c[\\udffb-\\udfff]",Tr="(?:"+Rr+"|"+Nr+")",Lr="[^"+Sr+"]",Ar="(?:\\ud83c[\\udde6-\\uddff]){2}",Dr="[\\ud800-\\udbff][\\udc00-\\udfff]",xr="\\u200d",Pr=Tr+"?",Cr="["+Or+"]?",Ur=("(?:"+xr+"(?:"+[Lr,Ar,Dr].join("|")+")"+Cr+Pr+")*","(?:"+[Lr+Rr+"?",Rr,Ar,Dr,Fr].join("|")+")","function"==typeof setImmediate&&setImmediate),Mr="object"==typeof o&&"function"==typeof o.nextTick;mr=Ur?setImmediate:Mr?o.nextTick:ct,ut(mr);var jr=et(tt,1),Br=I(function(t){return I(function(e){var n=this,r=e[e.length-1];"function"==typeof r?e.pop():r=x,ft(t,e,function(t,e,r){e.apply(n,t.concat(I(function(t,e){r(t,e)})))},function(t,e){r.apply(n,[t].concat(e))})})});I(function(t){return Br.apply(null,t.reverse())}),I(function(t){var e=[null].concat(t);return Xe(function(t,n){return n.apply(this,e)})}),ht("dir"),ht("log");var zr;zr=Mr?o.nextTick:Ur?setImmediate:ct,ut(zr);var Yr,qr=(Math.ceil,Math.max,function(t){this._cache={},this._client=t});qr.prototype.readdir=function(t,e){var n=this,r=this.getCachedDirInfo(t);this._wrap(function(e){null!==r&&r.contents?n._client.readdir(t,{contentHash:r.stat.contentHash},e):n._client.readdir(t,e)},function(i,o,s,a){i?i.status===Dropbox.ApiError.NO_CONTENT&&null!==r?e(null,r.contents.slice(0)):e(i):(n.updateCachedDirInfo(t,s,o.slice(0)),a.forEach(function(e){n.updateCachedInfo(me.join(t,e.name),e)}),e(null,o))})},qr.prototype.remove=function(t,e){var n=this;this._wrap(function(e){n._client.remove(t,e)},function(r,i){r||n.updateCachedInfo(t,i),e(r)})},qr.prototype.move=function(t,e,n){var r=this;this._wrap(function(n){r._client.move(t,e,n)},function(i,o){i||(r.deleteCachedInfo(t),r.updateCachedInfo(e,o)),n(i)})},qr.prototype.stat=function(t,e){var n=this;this._wrap(function(e){n._client.stat(t,e)},function(r,i){r||n.updateCachedInfo(t,i),e(r,i)})},qr.prototype.readFile=function(t,e){var n=this,r=this.getCachedFileInfo(t);null!==r&&null!==r.contents?this.stat(t,function(i,o){i?e(i):o.contentHash===r.stat.contentHash?e(i,r.contents.slice(0),r.stat):n.readFile(t,e)}):this._wrap(function(e){n._client.readFile(t,{arrayBuffer:!0},e)},function(r,i,o){r||n.updateCachedInfo(t,o,i.slice(0)),e(r,i,o)})},qr.prototype.writeFile=function(t,e,n){var r=this;this._wrap(function(n){r._client.writeFile(t,e,n)},function(i,o){i||r.updateCachedInfo(t,o,e.slice(0)),n(i,o)})},qr.prototype.mkdir=function(t,e){var n=this;this._wrap(function(e){n._client.mkdir(t,e)},function(r,i){r||n.updateCachedInfo(t,i,[]),e(r)})},qr.prototype._wrap=function(t,e){var n=0,r=function(i){var o=2;if(i&&3>++n)switch(i.status){case Dropbox.ApiError.SERVER_ERROR:case Dropbox.ApiError.NETWORK_ERROR:case Dropbox.ApiError.RATE_LIMITED:setTimeout(function(){t(r)},1e3*o);break;default:e.apply(null,arguments)}else e.apply(null,arguments)};t(r)},qr.prototype.getCachedInfo=function(t){return this._cache[t.toLowerCase()]},qr.prototype.putCachedInfo=function(t,e){this._cache[t.toLowerCase()]=e},qr.prototype.deleteCachedInfo=function(t){delete this._cache[t.toLowerCase()]},qr.prototype.getCachedDirInfo=function(t){var e=this.getCachedInfo(t);return gt(e)?e:null},qr.prototype.getCachedFileInfo=function(t){var e=this.getCachedInfo(t);return yt(e)?e:null},qr.prototype.updateCachedDirInfo=function(t,e,n){void 0===n&&(n=null);var r=this.getCachedInfo(t);null===e.contentHash||void 0!==r&&r.stat.contentHash===e.contentHash||this.putCachedInfo(t,{stat:e,contents:n})},qr.prototype.updateCachedFileInfo=function(t,e,n){void 0===n&&(n=null);var r=this.getCachedInfo(t);null===e.versionTag||void 0!==r&&r.stat.versionTag===e.versionTag||this.putCachedInfo(t,{stat:e,contents:n})},qr.prototype.updateCachedInfo=function(t,e,n){void 0===n&&(n=null),e.isFile&&_t(n)?this.updateCachedFileInfo(t,e,n):e.isFolder&&Array.isArray(n)&&this.updateCachedDirInfo(t,e,n)};var Wr=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;if(this.isDirty()){var n=this.getBuffer(),r=y(n);this._fs._writeFileStrict(this.getPath(),r,function(n){n||e.resetDirty(),t(n)})}else t()},e.prototype.close=function(t){this.sync(t)},e}(qe),Hr=function(t){function e(e,n){void 0===n&&(n=!0),t.call(this),this._client=new qr(e),l(n,"Dropbox",{client:"authenticated dropbox client instance"}),dt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){n(null,new e(t.client,!1))},e.isAvailable=function(){return"undefined"!=typeof Dropbox},e.prototype.getName=function(){return"Dropbox"},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSymlinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!1},e.prototype.empty=function(t){var e=this;this._client.readdir("/",function(n,r){if(n)t(e.convert(n,"/"));else{var i=function(t,n){var r=me.join("/",t);e._client.remove(r,function(t){n(t?e.convert(t,r):null)})},o=function(e){e?t(e):t()};pt(r,i,o)}})},e.prototype.rename=function(t,e,n){var r=this;this._client.move(t,e,function(i){i?r._client.stat(e,function(o,s){if(o||s.isFolder){var a=i.response.error.indexOf(t)>-1?t:e;n(r.convert(i,a))}else r._client.remove(e,function(i){i?n(r.convert(i,e)):r.rename(t,e,n)})}):n()})},e.prototype.stat=function(t,e,n){var r=this;this._client.stat(t,function(e,i){if(e)n(r.convert(e,t));else{if(!i||!i.isRemoved){var o=new Fe(r._statType(i),i.size);return n(null,o)}n(be.FileError(ve.ENOENT,t))}})},e.prototype.open=function(t,e,n,r){var i=this;this._client.readFile(t,function(n,o,s){if(!n){var a;a=null===o?S():w(o);var c=i._makeFile(t,e,s,a);return r(null,c)}if(e.isReadable())r(i.convert(n,t));else switch(n.status){case Dropbox.ApiError.NOT_FOUND:var u=new ArrayBuffer(0);return i._writeFileStrict(t,u,function(n,o){if(n)r(n);else{var s=i._makeFile(t,e,o,w(u));r(null,s)}});default:return r(i.convert(n,t))}})},e.prototype._writeFileStrict=function(t,e,n){var r=this,i=me.dirname(t);this.stat(i,!1,function(o,s){o?n(be.FileError(ve.ENOENT,i)):r._client.writeFile(t,e,function(e,i){e?n(r.convert(e,t)):n(null,i)})})},e.prototype._statType=function(t){return t.isFile?Oe.FILE:Oe.DIRECTORY},e.prototype._makeFile=function(t,e,n,r){var i=this._statType(n),o=new Fe(i,n.size);return new Wr(this,t,e,o,r)},e.prototype._remove=function(t,e,n){var r=this;this._client.stat(t,function(i,o){i?e(r.convert(i,t)):o.isFile&&!n?e(be.FileError(ve.ENOTDIR,t)):!o.isFile&&n?e(be.FileError(ve.EISDIR,t)):r._client.remove(t,function(n){e(n?r.convert(n,t):null)})})},e.prototype.unlink=function(t,e){this._remove(t,e,!0)},e.prototype.rmdir=function(t,e){this._remove(t,e,!1)},e.prototype.mkdir=function(t,e,n){var r=this,i=me.dirname(t);this._client.stat(i,function(e,o){e?n(r.convert(e,i)):r._client.mkdir(t,function(e){n(e?be.FileError(ve.EEXIST,t):null)})})},e.prototype.readdir=function(t,e){var n=this;this._client.readdir(t,function(t,r){return t?e(n.convert(t)):e(null,r)})},e.prototype.convert=function(t,e){void 0===e&&(e=null);var n=Yr[t.status];return void 0===n&&(n=ve.EIO),e?be.FileError(n,e):new be(n)},e}(Be),Vr=function(t){function e(e,n,r,i){t.call(this),this._fs=e,this._FS=n,this._path=r,this._stream=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPos=function(){},e.prototype.close=function(t){
3
var e=null;try{this.closeSync()}catch(t){e=t}finally{t(e)}},e.prototype.closeSync=function(){try{this._FS.close(this._stream)}catch(t){throw vt(t,this._path)}},e.prototype.stat=function(t){try{t(null,this.statSync())}catch(e){t(e)}},e.prototype.statSync=function(){try{return this._fs.statSync(this._path,!1)}catch(t){throw vt(t,this._path)}},e.prototype.truncate=function(t,e){var n=null;try{this.truncateSync(t)}catch(t){n=t}finally{e(n)}},e.prototype.truncateSync=function(t){try{this._FS.ftruncate(this._stream.fd,t)}catch(t){throw vt(t,this._path)}},e.prototype.write=function(t,e,n,r,i){try{i(null,this.writeSync(t,e,n,r),t)}catch(t){i(t)}},e.prototype.writeSync=function(t,e,n,r){try{var i=g(t),o=null===r?void 0:r;return this._FS.write(this._stream,i,e,n,o)}catch(t){throw vt(t,this._path)}},e.prototype.read=function(t,e,n,r,i){try{i(null,this.readSync(t,e,n,r),t)}catch(t){i(t)}},e.prototype.readSync=function(t,e,n,r){try{var i=g(t),o=null===r?void 0:r;return this._FS.read(this._stream,i,e,n,o)}catch(t){throw vt(t,this._path)}},e.prototype.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.chown=function(t,e,n){var r=null;try{this.chownSync(t,e)}catch(t){r=t}finally{n(r)}},e.prototype.chownSync=function(t,e){try{this._FS.fchown(this._stream.fd,t,e)}catch(t){throw vt(t,this._path)}},e.prototype.chmod=function(t,e){var n=null;try{this.chmodSync(t)}catch(t){n=t}finally{e(n)}},e.prototype.chmodSync=function(t){try{this._FS.fchmod(this._stream.fd,t)}catch(t){throw vt(t,this._path)}},e.prototype.utimes=function(t,e,n){var r=null;try{this.utimesSync(t,e)}catch(t){r=t}finally{n(r)}},e.prototype.utimesSync=function(t,e){this._fs.utimesSync(this._path,t,e)},e}(Ye),Zr=function(e){function n(t){e.call(this),this._FS=t}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.Create=function(t,e){e(null,new n(t.FS))},n.isAvailable=function(){return!0},n.prototype.getName=function(){return this._FS.DB_NAME()},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsLinks=function(){return!0},n.prototype.supportsProps=function(){return!0},n.prototype.supportsSynch=function(){return!0},n.prototype.renameSync=function(t,e){try{this._FS.rename(t,e)}catch(n){throw n.errno===ve.ENOENT?vt(n,this.existsSync(t)?e:t):vt(n)}},n.prototype.statSync=function(t,e){try{var n=e?this._FS.lstat(t):this._FS.stat(t),r=this.modeToFileType(n.mode);return new Fe(r,n.size,n.mode,n.atime,n.mtime,n.ctime)}catch(e){throw vt(e,t)}},n.prototype.openSync=function(t,e,n){try{var r=this._FS.open(t,e.getFlagString(),n);if(this._FS.isDir(r.node.mode))throw this._FS.close(r),be.EISDIR(t);return new Vr(this,this._FS,t,r)}catch(e){throw vt(e,t)}},n.prototype.unlinkSync=function(t){try{this._FS.unlink(t)}catch(e){throw vt(e,t)}},n.prototype.rmdirSync=function(t){try{this._FS.rmdir(t)}catch(e){throw vt(e,t)}},n.prototype.mkdirSync=function(t,e){try{this._FS.mkdir(t,e)}catch(e){throw vt(e,t)}},n.prototype.readdirSync=function(t){try{return this._FS.readdir(t).filter(function(t){return"."!==t&&".."!==t})}catch(e){throw vt(e,t)}},n.prototype.truncateSync=function(t,e){try{this._FS.truncate(t,e)}catch(e){throw vt(e,t)}},n.prototype.readFileSync=function(t,e,n){try{var r=this._FS.readFile(t,{flags:n.getFlagString()}),i=v(r);return e?i.toString(e):i}catch(e){throw vt(e,t)}},n.prototype.writeFileSync=function(e,n,r,i,o){try{r&&(n=t.from(n,r));var s=g(n);this._FS.writeFile(e,s,{flags:i.getFlagString(),encoding:"binary"}),this._FS.chmod(e,o)}catch(t){throw vt(t,e)}},n.prototype.chmodSync=function(t,e,n){try{e?this._FS.lchmod(t,n):this._FS.chmod(t,n)}catch(e){throw vt(e,t)}},n.prototype.chownSync=function(t,e,n,r){try{e?this._FS.lchown(t,n,r):this._FS.chown(t,n,r)}catch(e){throw vt(e,t)}},n.prototype.symlinkSync=function(t,e,n){try{this._FS.symlink(t,e)}catch(t){throw vt(t)}},n.prototype.readlinkSync=function(t){try{return this._FS.readlink(t)}catch(e){throw vt(e,t)}},n.prototype.utimesSync=function(t,e,n){try{this._FS.utime(t,e.getTime(),n.getTime())}catch(e){throw vt(e,t)}},n.prototype.modeToFileType=function(t){if(this._FS.isDir(t))return Oe.DIRECTORY;if(this._FS.isFile(t))return Oe.FILE;if(this._FS.isLink(t))return Oe.SYMLINK;throw be.EPERM("Invalid mode: "+t)},n}(ze),Xr=function(t){function e(e,n){t.call(this),this._folder=e,this._wrapped=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){n(null,new e(t.folder,t.wrapped))},e.isAvailable=function(){return!0},e.prototype.initialize=function(t){var e=this;this._wrapped.exists(this._folder,function(n){n?t():e._wrapped.isReadOnly()?t(be.ENOENT(e._folder)):e._wrapped.mkdir(e._folder,511,t)})},e.prototype.getName=function(){return this._wrapped.getName()},e.prototype.isReadOnly=function(){return this._wrapped.isReadOnly()},e.prototype.supportsProps=function(){return this._wrapped.supportsProps()},e.prototype.supportsSynch=function(){return this._wrapped.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e}(Be);["diskSpace","stat","statSync","open","openSync","unlink","unlinkSync","rmdir","rmdirSync","mkdir","mkdirSync","readdir","readdirSync","exists","existsSync","realpath","realpathSync","truncate","truncateSync","readFile","readFileSync","writeFile","writeFileSync","appendFile","appendFileSync","chmod","chmodSync","chown","chownSync","utimes","utimesSync","readlink","readlinkSync"].forEach(function(t){Xr.prototype[t]=St(t,!0,!1)}),["rename","renameSync","link","linkSync","symlink","symlinkSync"].forEach(function(t){Xr.prototype[t]=St(t,!0,!0)});var Kr;Kr="undefined"!=typeof window?window:"undefined"!=typeof self?self:r;var Jr=Kr,Gr=Jr.webkitRequestFileSystem||Jr.requestFileSystem||null,Qr=function(t){function e(e,n,r,i,o,s){t.call(this,e,r,i,o,s),this._entry=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;return this.isDirty()?void this._entry.createWriter(function(n){var r=e.getBuffer(),i=new Blob([y(r)]),o=i.size;n.onwriteend=function(r){n.onwriteend=null,n.onerror=null,n.truncate(o),e.resetDirty(),t()},n.onerror=function(n){t(It(n,e.getPath(),!1))},n.write(i)}):t()},e.prototype.close=function(t){this.sync(t)},e}(qe),$r=function(t){function e(e,n,r){void 0===e&&(e=5),void 0===n&&(n=Jr.PERSISTENT),void 0===r&&(r=!0),t.call(this),this.size=1048576*e,this.type=n,l(r,"HTML5FS",{size:e,type:n})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){var r=new e(t.size,t.type,!1);r.allocate(function(t){return t?n(t):n(null,r)},!1)},e.isAvailable=function(){return!!Gr},e.prototype.getName=function(){return"HTML5 FileSystem"},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSymlinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!1},e.prototype.allocate=function(t,e){var n=this;void 0===t&&(t=function(){}),void 0===e&&(e=!0),e&&console.warn("[HTML5FS] HTML5FS.allocate() is deprecated and will be removed in the next major release. Please use 'HTML5FS.Create({type: "+this.type+", size: "+this.size+"}, cb)' to create and allocate HTML5FS instances.");var r=function(e){n.fs=e,t()},i=function(e){t(It(e,"/",!0))};this.type===Jr.PERSISTENT?bt(this.type,this.size,function(t){Gr(n.type,t,r,i)},i):Gr(this.type,this.size,r,i)},e.prototype.empty=function(t){this._readdir("/",function(e,n){if(e)console.error("Failed to empty FS"),t(e);else{var r=function(n){e?(console.error("Failed to empty FS"),t(e)):t()},i=function(t,e){var n=function(){e()},r=function(n){e(It(n,t.fullPath,!t.isDirectory))};Et(t)?t.removeRecursively(n,r):t.remove(n,r)};pt(n,i,r)}})},e.prototype.rename=function(t,e,n){var r=this,i=2,o=0,s=this.fs.root,a=t,c=function(t){--i<=0&&n(It(t,a,!1))},u=function(i){return 2===++o?n(new be(ve.EINVAL,"Something was identified as both a file and a directory. This should never happen.")):t===e?n():(a=me.dirname(e),void s.getDirectory(a,{},function(o){a=me.basename(e),i.moveTo(o,a,function(t){n()},function(o){i.isDirectory?(a=e,r.unlink(e,function(i){i?c(o):r.rename(t,e,n)})):c(o)})},c))};s.getFile(t,{},u,c),s.getDirectory(t,{},u,c)},e.prototype.stat=function(t,e,n){var r=this,i={create:!1},o=function(t){var e=function(t){var e=new Fe(Oe.FILE,t.size);n(null,e)};t.file(e,a)},s=function(t){var e=4096,r=new Fe(Oe.DIRECTORY,e);n(null,r)},a=function(e){n(It(e,t,!1))},c=function(){r.fs.root.getDirectory(t,i,s,a)};this.fs.root.getFile(t,i,o,c)},e.prototype.open=function(t,e,n,r){var i=this,o=function(n){r("InvalidModificationError"===n.name&&e.isExclusive()?be.EEXIST(t):It(n,t,!1))};this.fs.root.getFile(t,{create:e.pathNotExistsAction()===Ee.CREATE_FILE,exclusive:e.isExclusive()},function(n){n.file(function(s){var a=new FileReader;a.onloadend=function(o){var c=i._makeFile(t,n,e,s,a.result);r(null,c)},a.onerror=function(t){o(a.error)},a.readAsArrayBuffer(s)},o)},o)},e.prototype.unlink=function(t,e){this._remove(t,e,!0)},e.prototype.rmdir=function(t,e){var n=this;this.readdir(t,function(r,i){r?e(r):i.length>0?e(be.ENOTEMPTY(t)):n._remove(t,e,!1)})},e.prototype.mkdir=function(t,e,n){var r={create:!0,exclusive:!0},i=function(t){n()},o=function(e){n(It(e,t,!0))};this.fs.root.getDirectory(t,r,i,o)},e.prototype.readdir=function(t,e){this._readdir(t,function(t,n){if(t)return e(t);for(var r=[],i=0;i<n.length;i++)r.push(n[i].name);e(null,r)})},e.prototype._makeFile=function(t,e,n,r,i){void 0===i&&(i=new ArrayBuffer(0));var o=new Fe(Oe.FILE,r.size),s=w(i);return new Qr(this,e,t,n,o,s)},e.prototype._readdir=function(t,e){var n=function(n){e(It(n,t,!0))};this.fs.root.getDirectory(t,{create:!1},function(t){var r=t.createReader(),i=[],o=function(){r.readEntries(function(t){t.length?(i=i.concat(kt(t)),o()):e(null,i)},n)};o()},n)},e.prototype._remove=function(t,e,n){var r=function(r){var i=function(){e()},o=function(r){e(It(r,t,!n))};r.remove(i,o)},i=function(r){e(It(r,t,!n))},o={create:!1};n?this.fs.root.getFile(t,o,r,i):this.fs.root.getDirectory(t,o,r,i)},e}(Be),ti=function(t,e,n,r,i,o){this.id=t,this.size=e,this.mode=n,this.atime=r,this.mtime=i,this.ctime=o};ti.fromBuffer=function(t){if(void 0===t)throw new Error("NO");return new ti(t.toString("ascii",30),t.readUInt32LE(0),t.readUInt16LE(4),t.readDoubleLE(6),t.readDoubleLE(14),t.readDoubleLE(22))},ti.prototype.toStats=function(){return new Fe((61440&this.mode)===Oe.DIRECTORY?Oe.DIRECTORY:Oe.FILE,this.size,this.mode,new Date(this.atime),new Date(this.mtime),new Date(this.ctime))},ti.prototype.getSize=function(){return 30+this.id.length},ti.prototype.toBuffer=function(e){return void 0===e&&(e=t.alloc(this.getSize())),e.writeUInt32LE(this.size,0),e.writeUInt16LE(this.mode,4),e.writeDoubleLE(this.atime,6),e.writeDoubleLE(this.mtime,14),e.writeDoubleLE(this.ctime,22),e.write(this.id,30,this.id.length,"ascii"),e},ti.prototype.update=function(t){var e=!1;this.size!==t.size&&(this.size=t.size,e=!0),this.mode!==t.mode&&(this.mode=t.mode,e=!0);var n=t.atime.getTime();this.atime!==n&&(this.atime=n,e=!0);var r=t.mtime.getTime();this.mtime!==r&&(this.mtime=r,e=!0);var i=t.ctime.getTime();return this.ctime!==i&&(this.ctime=i,e=!0),e},ti.prototype.isFile=function(){return(61440&this.mode)===Oe.FILE},ti.prototype.isDirectory=function(){return(61440&this.mode)===Oe.DIRECTORY};var ei="/",ni=null,ri=function(t){this.store=t,this.originalData={},this.modifiedKeys=[]};ri.prototype.get=function(t){var e=this.store.get(t);return this.stashOldValue(t,e),e},ri.prototype.put=function(t,e,n){return this.markModified(t),this.store.put(t,e,n)},ri.prototype.del=function(t){this.markModified(t),this.store.del(t)},ri.prototype.commit=function(){},ri.prototype.abort=function(){for(var t=this,e=0;e<this.modifiedKeys.length;e++){var n=t.modifiedKeys[e],r=t.originalData[n];r?t.store.put(n,r,!0):t.store.del(n)}},ri.prototype.stashOldValue=function(t,e){this.originalData.hasOwnProperty(t)||(this.originalData[t]=e)},ri.prototype.markModified=function(t){this.modifiedKeys.indexOf(t)===-1&&(this.modifiedKeys.push(t),this.originalData.hasOwnProperty(t)||(this.originalData[t]=this.store.get(t)))};var ii=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this.getPath(),this.getBuffer(),this.getStats()),this.resetDirty())},e.prototype.closeSync=function(){this.syncSync()},e}(qe),oi=function(e){function n(t){e.call(this),this.store=t.store,this.makeRootDirectory()}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.isAvailable=function(){return!0},n.prototype.getName=function(){return this.store.name()},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsSymlinks=function(){return!1},n.prototype.supportsProps=function(){return!1},n.prototype.supportsSynch=function(){return!0},n.prototype.empty=function(){this.store.clear(),this.makeRootDirectory()},n.prototype.renameSync=function(e,n){var r=this.store.beginTransaction("readwrite"),i=me.dirname(e),o=me.basename(e),s=me.dirname(n),a=me.basename(n),c=this.findINode(r,i),u=this.getDirListing(r,i,c);if(!u[o])throw be.ENOENT(e);var f=u[o];if(delete u[o],0===(s+"/").indexOf(e+"/"))throw new be(ve.EBUSY,i);var h,l;if(s===i?(h=c,l=u):(h=this.findINode(r,s),l=this.getDirListing(r,s,h)),l[a]){var p=this.getINode(r,n,l[a]);if(!p.isFile())throw be.EPERM(n);try{r.del(p.id),r.del(l[a])}catch(t){throw r.abort(),t}}l[a]=f;try{r.put(c.id,t.from(JSON.stringify(u)),!0),r.put(h.id,t.from(JSON.stringify(l)),!0)}catch(t){throw r.abort(),t}r.commit()},n.prototype.statSync=function(t,e){return this.findINode(this.store.beginTransaction("readonly"),t).toStats()},n.prototype.createFileSync=function(t,e,n){var r=this.store.beginTransaction("readwrite"),i=S(),o=this.commitNewFile(r,t,Oe.FILE,n,i);return new ii(this,t,e,o.toStats(),i)},n.prototype.openFileSync=function(t,e){var n=this.store.beginTransaction("readonly"),r=this.findINode(n,t),i=n.get(r.id);if(void 0===i)throw be.ENOENT(t);return new ii(this,t,e,r.toStats(),i)},n.prototype.unlinkSync=function(t){this.removeEntry(t,!1)},n.prototype.rmdirSync=function(t){if(this.readdirSync(t).length>0)throw be.ENOTEMPTY(t);this.removeEntry(t,!0)},n.prototype.mkdirSync=function(e,n){var r=this.store.beginTransaction("readwrite"),i=t.from("{}");this.commitNewFile(r,e,Oe.DIRECTORY,n,i)},n.prototype.readdirSync=function(t){var e=this.store.beginTransaction("readonly");return Object.keys(this.getDirListing(e,t,this.findINode(e,t)))},n.prototype._syncSync=function(t,e,n){var r=this.store.beginTransaction("readwrite"),i=this._findINode(r,me.dirname(t),me.basename(t)),o=this.getINode(r,t,i),s=o.update(n);try{r.put(o.id,e,!0),s&&r.put(i,o.toBuffer(),!0)}catch(t){throw r.abort(),t}r.commit()},n.prototype.makeRootDirectory=function(){var t=this.store.beginTransaction("readwrite");if(void 0===t.get(ei)){var e=(new Date).getTime(),n=new ti(Ft(),4096,511|Oe.DIRECTORY,e,e,e);t.put(n.id,Ot(),!1),t.put(ei,n.toBuffer(),!1),t.commit()}},n.prototype._findINode=function(t,e,n){var r=this,i=function(i){var o=r.getDirListing(t,e,i);if(o[n])return o[n];throw be.ENOENT(me.resolve(e,n))};return"/"===e?""===n?ei:i(this.getINode(t,e,ei)):i(this.getINode(t,e+me.sep+n,this._findINode(t,me.dirname(e),me.basename(e))))},n.prototype.findINode=function(t,e){return this.getINode(t,e,this._findINode(t,me.dirname(e),me.basename(e)))},n.prototype.getINode=function(t,e,n){var r=t.get(n);if(void 0===r)throw be.ENOENT(e);return ti.fromBuffer(r)},n.prototype.getDirListing=function(t,e,n){if(!n.isDirectory())throw be.ENOTDIR(e);var r=t.get(n.id);if(void 0===r)throw be.ENOENT(e);return JSON.parse(r.toString())},n.prototype.addNewNode=function(t,e){for(var n,r=0;r<5;)try{return n=Ft(),t.put(n,e,!1),n}catch(t){}throw new be(ve.EIO,"Unable to commit data to key-value store.")},n.prototype.commitNewFile=function(e,n,r,i,o){var s=me.dirname(n),a=me.basename(n),c=this.findINode(e,s),u=this.getDirListing(e,s,c),f=(new Date).getTime();if("/"===n)throw be.EEXIST(n);if(u[a])throw be.EEXIST(n);var h;try{var l=this.addNewNode(e,o);h=new ti(l,o.length,i|r,f,f,f);var p=this.addNewNode(e,h.toBuffer());u[a]=p,e.put(c.id,t.from(JSON.stringify(u)),!0)}catch(t){throw e.abort(),t}return e.commit(),h},n.prototype.removeEntry=function(e,n){var r=this.store.beginTransaction("readwrite"),i=me.dirname(e),o=this.findINode(r,i),s=this.getDirListing(r,i,o),a=me.basename(e);if(!s[a])throw be.ENOENT(e);var c=s[a];delete s[a];var u=this.getINode(r,e,c);if(!n&&u.isDirectory())throw be.EISDIR(e);if(n&&!u.isDirectory())throw be.ENOTDIR(e);try{r.del(u.id),r.del(c),r.put(o.id,t.from(JSON.stringify(s)),!0)}catch(t){throw r.abort(),t}r.commit()},n}(ze),si=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;this.isDirty()?this._fs._sync(this.getPath(),this.getBuffer(),this.getStats(),function(n){n||e.resetDirty(),t(n)}):t()},e.prototype.close=function(t){this.sync(t)},e}(qe),ai=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.isAvailable=function(){return!0},n.prototype.init=function(t,e){this.store=t,this.makeRootDirectory(e)},n.prototype.getName=function(){return this.store.name()},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsSymlinks=function(){return!1},n.prototype.supportsProps=function(){return!1},n.prototype.supportsSynch=function(){return!1},n.prototype.empty=function(t){var e=this;this.store.clear(function(n){Rt(n,t)&&e.makeRootDirectory(t)})},n.prototype.rename=function(e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=me.dirname(e),a=me.basename(e),c=me.dirname(n),u=me.basename(n),f={},h={},l=!1;if(0===(c+"/").indexOf(e+"/"))return r(new be(ve.EBUSY,s));var p=function(){if(!l&&h.hasOwnProperty(s)&&h.hasOwnProperty(c)){var p=h[s],d=f[s],y=h[c],g=f[c];if(p[a]){var _=p[a];delete p[a];var v=function(){y[u]=_,o.put(d.id,t.from(JSON.stringify(p)),!0,function(e){Nt(e,o,r)&&(s===c?o.commit(r):o.put(g.id,t.from(JSON.stringify(y)),!0,function(t){Nt(t,o,r)&&o.commit(r)}))})};y[u]?i.getINode(o,n,y[u],function(t,e){Nt(t,o,r)&&(e.isFile()?o.del(e.id,function(t){Nt(t,o,r)&&o.del(y[u],function(t){Nt(t,o,r)&&v()})}):o.abort(function(t){r(be.EPERM(n))}))}):v()}else r(be.ENOENT(e))}},d=function(t){i.findINodeAndDirListing(o,t,function(e,n,i){e?l||(l=!0,o.abort(function(){r(e)})):(f[t]=n,h[t]=i,p())})};d(s),s!==c&&d(c)},n.prototype.stat=function(t,e,n){var r=this.store.beginTransaction("readonly");this.findINode(r,t,function(t,e){Rt(t,n)&&n(null,e.toStats())})},n.prototype.createFile=function(t,e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=S();this.commitNewFile(o,t,Oe.FILE,n,s,function(n,o){Rt(n,r)&&r(null,new si(i,t,e,o.toStats(),s))})},n.prototype.openFile=function(t,e,n){var r=this,i=this.store.beginTransaction("readonly");this.findINode(i,t,function(o,s){Rt(o,n)&&i.get(s.id,function(i,o){Rt(i,n)&&(void 0===o?n(be.ENOENT(t)):n(null,new si(r,t,e,s.toStats(),o)))})})},n.prototype.unlink=function(t,e){this.removeEntry(t,!1,e)},n.prototype.rmdir=function(t,e){var n=this;this.readdir(t,function(r,i){r?e(r):i.length>0?e(be.ENOTEMPTY(t)):n.removeEntry(t,!0,e)})},n.prototype.mkdir=function(e,n,r){var i=this.store.beginTransaction("readwrite"),o=t.from("{}");this.commitNewFile(i,e,Oe.DIRECTORY,n,o,r)},n.prototype.readdir=function(t,e){var n=this,r=this.store.beginTransaction("readonly");this.findINode(r,t,function(i,o){Rt(i,e)&&n.getDirListing(r,t,o,function(t,n){Rt(t,e)&&e(null,Object.keys(n))})})},n.prototype._sync=function(t,e,n,r){var i=this,o=this.store.beginTransaction("readwrite");this._findINode(o,me.dirname(t),me.basename(t),function(s,a){Nt(s,o,r)&&i.getINode(o,t,a,function(t,i){if(Nt(t,o,r)){var s=i.update(n);o.put(i.id,e,!0,function(t){Nt(t,o,r)&&(s?o.put(a,i.toBuffer(),!0,function(t){Nt(t,o,r)&&o.commit(r)}):o.commit(r))})}})})},n.prototype.makeRootDirectory=function(t){var e=this.store.beginTransaction("readwrite");e.get(ei,function(n,r){if(n||void 0===r){var i=(new Date).getTime(),o=new ti(Ft(),4096,511|Oe.DIRECTORY,i,i,i);e.put(o.id,Ot(),!1,function(n){Nt(n,e,t)&&e.put(ei,o.toBuffer(),!1,function(n){n?e.abort(function(){t(n)}):e.commit(t)})})}else e.commit(t)})},n.prototype._findINode=function(t,e,n,r){var i=this,o=function(t,i,o){t?r(t):o[n]?r(null,o[n]):r(be.ENOENT(me.resolve(e,n)))};"/"===e?""===n?r(null,ei):this.getINode(t,e,ei,function(n,s){Rt(n,r)&&i.getDirListing(t,e,s,function(t,e){o(t,s,e)})}):this.findINodeAndDirListing(t,e,o)},n.prototype.findINode=function(t,e,n){var r=this;this._findINode(t,me.dirname(e),me.basename(e),function(i,o){Rt(i,n)&&r.getINode(t,e,o,n)})},n.prototype.getINode=function(t,e,n,r){t.get(n,function(t,n){Rt(t,r)&&(void 0===n?r(be.ENOENT(e)):r(null,ti.fromBuffer(n)))})},n.prototype.getDirListing=function(t,e,n,r){n.isDirectory()?t.get(n.id,function(t,n){if(Rt(t,r))try{r(null,JSON.parse(n.toString()))}catch(t){r(be.ENOENT(e))}}):r(be.ENOTDIR(e))},n.prototype.findINodeAndDirListing=function(t,e,n){var r=this;this.findINode(t,e,function(i,o){Rt(i,n)&&r.getDirListing(t,e,o,function(t,e){Rt(t,n)&&n(null,o,e)})})},n.prototype.addNewNode=function(t,e,n){var r,i=0,o=function(){5===++i?n(new be(ve.EIO,"Unable to commit data to key-value store.")):(r=Ft(),t.put(r,e,!1,function(t,e){t||!e?o():n(null,r)}))};o()},n.prototype.commitNewFile=function(e,n,r,i,o,s){var a=this,c=me.dirname(n),u=me.basename(n),f=(new Date).getTime();return"/"===n?s(be.EEXIST(n)):void this.findINodeAndDirListing(e,c,function(c,h,l){Nt(c,e,s)&&(l[u]?e.abort(function(){s(be.EEXIST(n))}):a.addNewNode(e,o,function(n,c){if(Nt(n,e,s)){var p=new ti(c,o.length,i|r,f,f,f);a.addNewNode(e,p.toBuffer(),function(n,r){Nt(n,e,s)&&(l[u]=r,e.put(h.id,t.from(JSON.stringify(l)),!0,function(t){Nt(t,e,s)&&e.commit(function(t){Nt(t,e,s)&&s(null,p)})}))})}}))})},n.prototype.removeEntry=function(e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=me.dirname(e),a=me.basename(e);this.findINodeAndDirListing(o,s,function(s,c,u){if(Nt(s,o,r))if(u[a]){var f=u[a];delete u[a],i.getINode(o,e,f,function(i,s){Nt(i,o,r)&&(!n&&s.isDirectory()?o.abort(function(){r(be.EISDIR(e))}):n&&!s.isDirectory()?o.abort(function(){r(be.ENOTDIR(e))}):o.del(s.id,function(e){Nt(e,o,r)&&o.del(f,function(e){Nt(e,o,r)&&o.put(c.id,t.from(JSON.stringify(u)),!0,function(t){Nt(t,o,r)&&o.commit(r)})})}))})}else o.abort(function(){r(be.ENOENT(e))})})},n}(Be),ci=function(){this.store={}};ci.prototype.name=function(){return"In-memory"},ci.prototype.clear=function(){this.store={}},ci.prototype.beginTransaction=function(t){return new ri(this)},ci.prototype.get=function(t){return this.store[t]},ci.prototype.put=function(t,e,n){return!(!n&&this.store.hasOwnProperty(t))&&(this.store[t]=e,!0)},ci.prototype.del=function(t){delete this.store[t]};var ui=function(t){function e(){t.call(this,{store:new ci})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){var r=n?n:t;r(null,new e)},e}(oi),fi=Jr.indexedDB||Jr.mozIndexedDB||Jr.webkitIndexedDB||Jr.msIndexedDB,hi=function(t,e){this.tx=t,this.store=e};hi.prototype.get=function(t,e){try{var n=this.store.get(t);n.onerror=Lt(e),n.onsuccess=function(t){var n=t.target.result;void 0===n?e(null,n):e(null,w(n))}}catch(t){e(Tt(t))}};var li=function(t){function e(e,n){t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.put=function(t,e,n,r){try{var i,o=y(e);i=n?this.store.put(o,t):this.store.add(o,t),i.onerror=Lt(r),i.onsuccess=function(t){r(null,!0)}}catch(t){r(Tt(t))}},e.prototype.del=function(t,e){try{var n=this.store.delete(t);n.onerror=Lt(e),n.onsuccess=function(t){e()}}catch(t){e(Tt(t))}},e.prototype.commit=function(t){setTimeout(t,0)},e.prototype.abort=function(t){var e=null;try{this.tx.abort()}catch(t){e=Tt(t)}finally{t(e)}},e}(hi),pi=function(t,e){var n=this;void 0===e&&(e="browserfs"),this.storeName=e;var r=fi.open(this.storeName,1);r.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(n.storeName)&&e.deleteObjectStore(n.storeName),e.createObjectStore(n.storeName)},r.onsuccess=function(e){n.db=e.target.result,t(null,n)},r.onerror=Lt(t,ve.EACCES)};pi.prototype.name=function(){return"IndexedDB - "+this.storeName},pi.prototype.clear=function(t){try{var e=this.db.transaction(this.storeName,"readwrite"),n=e.objectStore(this.storeName),r=n.clear();r.onsuccess=function(e){setTimeout(t,0)},r.onerror=Lt(t)}catch(e){t(Tt(e))}},pi.prototype.beginTransaction=function(t){void 0===t&&(t="readonly");var e=this.db.transaction(this.storeName,t),n=e.objectStore(this.storeName);if("readwrite"===t)return new li(e,n);if("readonly"===t)return new hi(e,n);throw new be(ve.EINVAL,"Invalid transaction type.")};var di,yi=function(t){function e(e,n,r){var i=this;void 0===r&&(r=!0),t.call(this),this.store=new pi(function(t){t?e(t):i.init(i.store,function(t){e(t,i)})},n),l(r,"IndexedDB",{storeName:n})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){var r=n?n:t;new e(r,n&&t?t.storeName:void 0,!1)},e.isAvailable=function(){try{return"undefined"!=typeof fi&&null!==fi.open("__browserfs_test__")}catch(t){return!1}},e}(ai),gi=!1;try{Jr.localStorage.setItem("__test__",String.fromCharCode(55296)),gi=Jr.localStorage.getItem("__test__")===String.fromCharCode(55296)}catch(t){gi=!1}di=gi?"binary_string":"binary_string_ie",t.isEncoding(di)||(di="base64");var _i=function(){};_i.prototype.name=function(){return"LocalStorage"},_i.prototype.clear=function(){Jr.localStorage.clear()},_i.prototype.beginTransaction=function(t){return new ri(this)},_i.prototype.get=function(e){try{var n=Jr.localStorage.getItem(e);if(null!==n)return t.from(n,di)}catch(t){}},_i.prototype.put=function(t,e,n){try{return!(!n&&null!==Jr.localStorage.getItem(t))&&(Jr.localStorage.setItem(t,e.toString(di)),!0)}catch(t){throw new be(ve.ENOSPC,"LocalStorage is full.")}},_i.prototype.del=function(t){try{Jr.localStorage.removeItem(t)}catch(e){throw new be(ve.EIO,"Unable to delete key "+t+": "+e)}};for(var vi=function(t){function e(){t.call(this,{store:new _i})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){var r=n?n:t;r(null,new e)},e.isAvailable=function(){return"undefined"!=typeof Jr.localStorage},e}(oi),wi=function(t){function e(){t.call(this),this.mountList=[],this.mntMap={},this.rootFs=new ui}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){var r=new e;Object.keys(t).forEach(function(e){r.mount(e,t[e])}),n(null,r)},e.isAvailable=function(){return!0},e.prototype.mount=function(t,e){if("/"!==t[0]&&(t="/"+t),t=me.resolve(t),this.mntMap[t])throw new be(ve.EINVAL,"Mount point "+t+" is already taken.");d(t,511,this.rootFs),this.mntMap[t]=e,this.mountList.push(t),this.mountList=this.mountList.sort(function(t,e){return e.length-t.length})},e.prototype.umount=function(t){var e=this;if("/"!==t[0]&&(t="/"+t),t=me.resolve(t),!this.mntMap[t])throw new be(ve.EINVAL,"Mount point "+t+" is already unmounted.");for(delete this.mntMap[t],this.mountList.splice(this.mountList.indexOf(t),1);"/"!==t&&0===e.rootFs.readdirSync(t).length;)e.rootFs.rmdirSync(t),t=me.dirname(t)},e.prototype._getFs=function(t){for(var e=this,n=this.mountList,r=n.length,i=0;i<r;i++){var o=n[i];if(o.length<=t.length&&0===t.indexOf(o))return t=t.substr(o.length>1?o.length:0),""===t&&(t="/"),{fs:e.mntMap[o],path:t}}return{fs:this.rootFs,path:t}},e.prototype.getName=function(){return"MountableFileSystem"},e.prototype.diskSpace=function(t,e){e(0,0)},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.standardizeError=function(t,e,n){var r=t.message.indexOf(e);return r!==-1&&(t.message=t.message.substr(0,r)+n+t.message.substr(r+e.length),t.path=n),t},e.prototype.rename=function(t,e,n){var r=this,i=this._getFs(t),o=this._getFs(e);return i.fs===o.fs?i.fs.rename(i.path,o.path,function(s){s&&r.standardizeError(r.standardizeError(s,i.path,t),o.path,e),n(s)}):Le.readFile(t,function(r,i){return r?n(r):void Le.writeFile(e,i,function(e){return e?n(e):void Le.unlink(t,n)})})},e.prototype.renameSync=function(t,e){var n=this._getFs(t),r=this._getFs(e);if(n.fs===r.fs)try{return n.fs.renameSync(n.path,r.path)}catch(i){throw this.standardizeError(this.standardizeError(i,n.path,t),r.path,e),i}var i=Le.readFileSync(t);return Le.writeFileSync(e,i),Le.unlinkSync(t)},e.prototype.readdirSync=function(t){var e=this._getFs(t),n=null;if(e.fs!==this.rootFs)try{n=this.rootFs.readdirSync(t)}catch(t){}try{var r=e.fs.readdirSync(e.path);return null===n?r:r.concat(n.filter(function(t){return r.indexOf(t)===-1}))}catch(r){if(null===n)throw this.standardizeError(r,e.path,t);return n}},e.prototype.readdir=function(t,e){var n=this,r=this._getFs(t);r.fs.readdir(r.path,function(i,o){if(r.fs!==n.rootFs)try{var s=n.rootFs.readdirSync(t);o=o?o.concat(s.filter(function(t){return o.indexOf(t)===-1})):s}catch(o){if(i)return e(n.standardizeError(i,r.path,t))}else if(i)return e(n.standardizeError(i,r.path,t));e(null,o)})},e.prototype.rmdirSync=function(t){var e=this._getFs(t);if(this._containsMountPt(t))throw be.ENOTEMPTY(t);try{e.fs.rmdirSync(e.path)}catch(n){throw this.standardizeError(n,e.path,t)}},e.prototype.rmdir=function(t,e){var n=this,r=this._getFs(t);this._containsMountPt(t)?e(be.ENOTEMPTY(t)):r.fs.rmdir(r.path,function(i){e(i?n.standardizeError(i,r.path,t):null)})},e.prototype._containsMountPt=function(t){for(var e=this.mountList,n=e.length,r=0;r<n;r++){var i=e[r];if(i.length>=t.length&&i.slice(0,t.length)===t)return!0}return!1},e}(Be),mi=[["exists","unlink","readlink"],["stat","mkdir","realpath","truncate"],["open","readFile","chmod","utimes"],["chown"],["writeFile","appendFile"]],Si=0;Si<mi.length;Si++)for(var Ei=mi[Si],bi=0;bi<Ei.length;bi++){var ki=Ei[bi];wi.prototype[ki]=At(ki,!1,Si+1),wi.prototype[ki+"Sync"]=At(ki+"Sync",!0,Si+1)}var Ii;if("undefined"!=typeof setImmediate)Ii=setImmediate;else{var Oi=Jr,Fi=[],Ri="zero-timeout-message",Ni=function(){if("undefined"!=typeof Oi.importScripts||!Oi.postMessage)return!1;var t=!0,e=Oi.onmessage;return Oi.onmessage=function(){t=!1},Oi.postMessage("","*"),Oi.onmessage=e,t};if(Ni()){Ii=function(t){Fi.push(t),Oi.postMessage(Ri,"*")};var Ti=function(t){if(t.source===self&&t.data===Ri&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,Fi.length>0)){var e=Fi.shift();return e()}};Oi.addEventListener?Oi.addEventListener("message",Ti,!0):Oi.attachEvent("onmessage",Ti)}else if(Oi.MessageChannel){var Li=new Oi.MessageChannel;Li.port1.onmessage=function(t){if(Fi.length>0)return Fi.shift()()},Ii=function(t){Fi.push(t),Li.port2.postMessage("")}}else Ii=function(t){return setTimeout(t,0)}}var Ai=Ii,Di=function(){this._locked=!1,this._waiters=[]};Di.prototype.lock=function(t){return this._locked?void this._waiters.push(t):(this._locked=!0,void t())},Di.prototype.unlock=function(){if(!this._locked)throw new Error("unlock of a non-locked mutex");var t=this._waiters.shift();return t?void Ai(t):void(this._locked=!1)},Di.prototype.tryLock=function(){return!this._locked&&(this._locked=!0,!0)},Di.prototype.isLocked=function(){return this._locked};var xi=function(t){this._fs=t,this._mu=new Di};xi.prototype.getName=function(){return"LockedFS<"+this._fs.getName()+">"},xi.prototype.getFSUnlocked=function(){return this._fs},xi.prototype.initialize=function(t){this._fs.initialize(t)},xi.prototype.diskSpace=function(t,e){this._fs.diskSpace(t,e)},xi.prototype.isReadOnly=function(){return this._fs.isReadOnly()},xi.prototype.supportsLinks=function(){
4
return this._fs.supportsLinks()},xi.prototype.supportsProps=function(){return this._fs.supportsProps()},xi.prototype.supportsSynch=function(){return this._fs.supportsSynch()},xi.prototype.rename=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.rename(t,e,function(t){r._mu.unlock(),n(t)})})},xi.prototype.renameSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.renameSync(t,e)},xi.prototype.stat=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.stat(t,e,function(t,e){r._mu.unlock(),n(t,e)})})},xi.prototype.statSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.statSync(t,e)},xi.prototype.open=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.open(t,e,n,function(t,e){i._mu.unlock(),r(t,e)})})},xi.prototype.openSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.openSync(t,e,n)},xi.prototype.unlink=function(t,e){var n=this;this._mu.lock(function(){n._fs.unlink(t,function(t){n._mu.unlock(),e(t)})})},xi.prototype.unlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.unlinkSync(t)},xi.prototype.rmdir=function(t,e){var n=this;this._mu.lock(function(){n._fs.rmdir(t,function(t){n._mu.unlock(),e(t)})})},xi.prototype.rmdirSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.rmdirSync(t)},xi.prototype.mkdir=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.mkdir(t,e,function(t){r._mu.unlock(),n(t)})})},xi.prototype.mkdirSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.mkdirSync(t,e)},xi.prototype.readdir=function(t,e){var n=this;this._mu.lock(function(){n._fs.readdir(t,function(t,r){n._mu.unlock(),e(t,r)})})},xi.prototype.readdirSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readdirSync(t)},xi.prototype.exists=function(t,e){var n=this;this._mu.lock(function(){n._fs.exists(t,function(t){n._mu.unlock(),e(t)})})},xi.prototype.existsSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.existsSync(t)},xi.prototype.realpath=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.realpath(t,e,function(t,e){r._mu.unlock(),n(t,e)})})},xi.prototype.realpathSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.realpathSync(t,e)},xi.prototype.truncate=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.truncate(t,e,function(t){r._mu.unlock(),n(t)})})},xi.prototype.truncateSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.truncateSync(t,e)},xi.prototype.readFile=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.readFile(t,e,n,function(t,e){i._mu.unlock(),r(t,e)})})},xi.prototype.readFileSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readFileSync(t,e,n)},xi.prototype.writeFile=function(t,e,n,r,i,o){var s=this;this._mu.lock(function(){s._fs.writeFile(t,e,n,r,i,function(t){s._mu.unlock(),o(t)})})},xi.prototype.writeFileSync=function(t,e,n,r,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.writeFileSync(t,e,n,r,i)},xi.prototype.appendFile=function(t,e,n,r,i,o){var s=this;this._mu.lock(function(){s._fs.appendFile(t,e,n,r,i,function(t){s._mu.unlock(),o(t)})})},xi.prototype.appendFileSync=function(t,e,n,r,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.appendFileSync(t,e,n,r,i)},xi.prototype.chmod=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.chmod(t,e,n,function(t){i._mu.unlock(),r(t)})})},xi.prototype.chmodSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chmodSync(t,e,n)},xi.prototype.chown=function(t,e,n,r,i){var o=this;this._mu.lock(function(){o._fs.chown(t,e,n,r,function(t){o._mu.unlock(),i(t)})})},xi.prototype.chownSync=function(t,e,n,r){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chownSync(t,e,n,r)},xi.prototype.utimes=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.utimes(t,e,n,function(t){i._mu.unlock(),r(t)})})},xi.prototype.utimesSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.utimesSync(t,e,n)},xi.prototype.link=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.link(t,e,function(t){r._mu.unlock(),n(t)})})},xi.prototype.linkSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.linkSync(t,e)},xi.prototype.symlink=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.symlink(t,e,n,function(t){i._mu.unlock(),r(t)})})},xi.prototype.symlinkSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.symlinkSync(t,e,n)},xi.prototype.readlink=function(t,e){var n=this;this._mu.lock(function(){n._fs.readlink(t,function(t,r){n._mu.unlock(),e(t,r)})})},xi.prototype.readlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readlinkSync(t)};var Pi,Ci="/.deletedFiles.log",Ui=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;return this.isDirty()?void this._fs._syncAsync(this,function(n){e.resetDirty(),t(n)}):void t(null)},e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.close=function(t){this.sync(t)},e.prototype.closeSync=function(){this.syncSync()},e}(qe),Mi=function(t){function e(e,n){if(t.call(this),this._isInitialized=!1,this._initializeCallbacks=[],this._deletedFiles={},this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this._deleteLogError=null,this._writable=e,this._readable=n,this._writable.isReadOnly())throw new be(ve.EINVAL,"Writable file system must be writable.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.isAvailable=function(){return!0},e.prototype.getOverlayedFileSystems=function(){return{readable:this._readable,writable:this._writable}},e.prototype._syncAsync=function(t,e){var n=this;this.createParentDirectoriesAsync(t.getPath(),function(r){return r?e(r):void n._writable.writeFile(t.getPath(),t.getBuffer(),null,xt("w"),t.getStats().mode,e)})},e.prototype._syncSync=function(t){this.createParentDirectories(t.getPath()),this._writable.writeFileSync(t.getPath(),t.getBuffer(),null,xt("w"),t.getStats().mode)},e.prototype.getName=function(){return"OverlayFS"},e.prototype.initialize=function(t){var e=this,n=this._initializeCallbacks,r=function(t){e._isInitialized=!t,e._initializeCallbacks=[],n.forEach(function(e){return e(t)})};return this._isInitialized?t():(n.push(t),void(1===n.length&&this._writable.readFile(Ci,"utf8",xt("r"),function(t,n){if(t){if(t.errno!==ve.ENOENT)return r(t)}else e._deleteLog=n;e._reparseDeletionLog(),r()})))},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSynch=function(){return this._readable.supportsSynch()&&this._writable.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return this._readable.supportsProps()&&this._writable.supportsProps()},e.prototype.getDeletionLog=function(){return this._deleteLog},e.prototype.restoreDeletionLog=function(t){this._deleteLog=t,this._reparseDeletionLog(),this.updateLog("")},e.prototype.rename=function(t,e,n){var r=this;if(this.checkInitAsync(n)&&!this.checkPathAsync(t,n)&&!this.checkPathAsync(e,n))return t===Ci||e===Ci?n(be.EPERM("Cannot rename deletion log.")):t===e?n():void this.stat(t,!1,function(i,o){return i?n(i):r.stat(e,!1,function(i,s){function a(r){var i=r.shift();if(!i)return n();var o=me.resolve(t,i),s=me.resolve(e,i);c.rename(o,s,function(t){return t?n(t):void a(r)})}var c=r,u=511;if(o.isDirectory()){if(i)return i.errno!==ve.ENOENT?n(i):r._writable.exists(t,function(i){return i?r._writable.rename(t,e,n):void r._writable.mkdir(e,u,function(e){return e?n(e):void r._readable.readdir(t,function(t,e){return t?n():void a(e)})})});if(u=s.mode,!s.isDirectory())return n(be.ENOTDIR(e));r.readdir(e,function(i,o){return o&&o.length?n(be.ENOTEMPTY(e)):void r._readable.readdir(t,function(t,e){return t?n():void a(e)})})}return s&&s.isDirectory()?n(be.EISDIR(e)):void r.readFile(t,null,xt("r"),function(i,s){return i?n(i):r.writeFile(e,s,null,xt("w"),o.mode,function(e){return e?n(e):r.unlink(t,n)})})})})},e.prototype.renameSync=function(t,e){var n=this;if(this.checkInitialized(),this.checkPath(t),this.checkPath(e),t===Ci||e===Ci)throw be.EPERM("Cannot rename deletion log.");var r=this.statSync(t,!1);if(r.isDirectory()){if(t===e)return;var i=511;if(this.existsSync(e)){var o=this.statSync(e,!1);if(i=o.mode,!o.isDirectory())throw be.ENOTDIR(e);if(this.readdirSync(e).length>0)throw be.ENOTEMPTY(e)}this._writable.existsSync(t)?this._writable.renameSync(t,e):this._writable.existsSync(e)||this._writable.mkdirSync(e,i),this._readable.existsSync(t)&&this._readable.readdirSync(t).forEach(function(r){n.renameSync(me.resolve(t,r),me.resolve(e,r))})}else{if(this.existsSync(e)&&this.statSync(e,!1).isDirectory())throw be.EISDIR(e);this.writeFileSync(e,this.readFileSync(t,null,xt("r")),null,xt("w"),r.mode)}t!==e&&this.existsSync(t)&&this.unlinkSync(t)},e.prototype.stat=function(t,e,n){var r=this;this.checkInitAsync(n)&&this._writable.stat(t,e,function(i,o){i&&i.errno===ve.ENOENT?(r._deletedFiles[t]&&n(be.ENOENT(t)),r._readable.stat(t,e,function(t,e){e&&(e=e.clone(),e.mode=Dt(e.mode)),n(t,e)})):n(i,o)})},e.prototype.statSync=function(t,e){this.checkInitialized();try{return this._writable.statSync(t,e)}catch(r){if(this._deletedFiles[t])throw be.ENOENT(t);var n=this._readable.statSync(t,e).clone();return n.mode=Dt(n.mode),n}},e.prototype.open=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&!this.checkPathAsync(t,r)&&this.stat(t,!1,function(o,s){if(s)switch(e.pathExistsAction()){case Ee.TRUNCATE_FILE:return i.createParentDirectoriesAsync(t,function(o){return o?r(o):void i._writable.open(t,e,n,r)});case Ee.NOP:return i._writable.exists(t,function(o){o?i._writable.open(t,e,n,r):(s=s.clone(),s.mode=n,i._readable.readFile(t,null,xt("r"),function(n,o){if(n)return r(n);s.size===-1&&(s.size=o.length);var a=new Ui(i,t,e,s,o);r(null,a)}))});default:return r(be.EEXIST(t))}else switch(e.pathNotExistsAction()){case Ee.CREATE_FILE:return i.createParentDirectoriesAsync(t,function(o){return o?r(o):i._writable.open(t,e,n,r)});default:return r(be.ENOENT(t))}})},e.prototype.openSync=function(t,e,n){if(this.checkInitialized(),this.checkPath(t),t===Ci)throw be.EPERM("Cannot open deletion log.");if(this.existsSync(t))switch(e.pathExistsAction()){case Ee.TRUNCATE_FILE:return this.createParentDirectories(t),this._writable.openSync(t,e,n);case Ee.NOP:if(this._writable.existsSync(t))return this._writable.openSync(t,e,n);var r=this._readable.readFileSync(t,null,xt("r")),i=this._readable.statSync(t,!1).clone();return i.mode=n,new Ui(this,t,e,i,r);default:throw be.EEXIST(t)}else switch(e.pathNotExistsAction()){case Ee.CREATE_FILE:return this.createParentDirectories(t),this._writable.openSync(t,e,n);default:throw be.ENOENT(t)}},e.prototype.unlink=function(t,e){var n=this;this.checkInitAsync(e)&&!this.checkPathAsync(t,e)&&this.exists(t,function(r){return r?void n._writable.exists(t,function(r){return r?n._writable.unlink(t,function(r){return r?e(r):void n.exists(t,function(r){r&&n.deletePath(t),e(null)})}):(n.deletePath(t),void e(null))}):e(be.ENOENT(t))})},e.prototype.unlinkSync=function(t){if(this.checkInitialized(),this.checkPath(t),!this.existsSync(t))throw be.ENOENT(t);this._writable.existsSync(t)&&this._writable.unlinkSync(t),this.existsSync(t)&&this.deletePath(t)},e.prototype.rmdir=function(t,e){var n=this;if(this.checkInitAsync(e)){var r=function(){n.readdir(t,function(r,i){return r?e(r):i.length?e(be.ENOTEMPTY(t)):(n.deletePath(t),void e(null))})};this.exists(t,function(i){return i?void n._writable.exists(t,function(i){i?n._writable.rmdir(t,function(i){return i?e(i):void n._readable.exists(t,function(t){t?r():e()})}):r()}):e(be.ENOENT(t))})}},e.prototype.rmdirSync=function(t){if(this.checkInitialized(),!this.existsSync(t))throw be.ENOENT(t);if(this._writable.existsSync(t)&&this._writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length>0)throw be.ENOTEMPTY(t);this.deletePath(t)}},e.prototype.mkdir=function(t,e,n){var r=this;this.checkInitAsync(n)&&this.exists(t,function(i){return i?n(be.EEXIST(t)):void r.createParentDirectoriesAsync(t,function(i){return i?n(i):void r._writable.mkdir(t,e,n)})})},e.prototype.mkdirSync=function(t,e){if(this.checkInitialized(),this.existsSync(t))throw be.EEXIST(t);this.createParentDirectories(t),this._writable.mkdirSync(t,e)},e.prototype.readdir=function(t,e){var n=this;this.checkInitAsync(e)&&this.stat(t,!1,function(r,i){return r?e(r):i.isDirectory()?void n._writable.readdir(t,function(r,i){return r&&"ENOENT"!==r.code?e(r):(!r&&i||(i=[]),void n._readable.readdir(t,function(r,o){!r&&o||(o=[]);var s={},a=i.concat(o.filter(function(e){return!n._deletedFiles[t+"/"+e]})).filter(function(t){var e=!s[t];return s[t]=!0,e});e(null,a)}))}):e(be.ENOTDIR(t))})},e.prototype.readdirSync=function(t){var e=this;this.checkInitialized();var n=this.statSync(t,!1);if(!n.isDirectory())throw be.ENOTDIR(t);var r=[];try{r=r.concat(this._writable.readdirSync(t))}catch(t){}try{r=r.concat(this._readable.readdirSync(t).filter(function(n){return!e._deletedFiles[t+"/"+n]}))}catch(t){}var i={};return r.filter(function(t){var e=!i[t];return i[t]=!0,e})},e.prototype.exists=function(t,e){var n=this;this.checkInitialized(),this._writable.exists(t,function(r){return r?e(!0):void n._readable.exists(t,function(r){e(r&&n._deletedFiles[t]!==!0)})})},e.prototype.existsSync=function(t){return this.checkInitialized(),this._writable.existsSync(t)||this._readable.existsSync(t)&&this._deletedFiles[t]!==!0},e.prototype.chmod=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&this.operateOnWritableAsync(t,function(o){return o?r(o):void i._writable.chmod(t,e,n,r)})},e.prototype.chmodSync=function(t,e,n){var r=this;this.checkInitialized(),this.operateOnWritable(t,function(){r._writable.chmodSync(t,e,n)})},e.prototype.chown=function(t,e,n,r,i){var o=this;this.checkInitAsync(i)&&this.operateOnWritableAsync(t,function(s){return s?i(s):void o._writable.chown(t,e,n,r,i)})},e.prototype.chownSync=function(t,e,n,r){var i=this;this.checkInitialized(),this.operateOnWritable(t,function(){i._writable.chownSync(t,e,n,r)})},e.prototype.utimes=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&this.operateOnWritableAsync(t,function(o){return o?r(o):void i._writable.utimes(t,e,n,r)})},e.prototype.utimesSync=function(t,e,n){var r=this;this.checkInitialized(),this.operateOnWritable(t,function(){r._writable.utimesSync(t,e,n)})},e.prototype.deletePath=function(t){this._deletedFiles[t]=!0,this.updateLog("d"+t+"\n")},e.prototype.updateLog=function(t){var e=this;this._deleteLog+=t,this._deleteLogUpdatePending?this._deleteLogUpdateNeeded=!0:(this._deleteLogUpdatePending=!0,this._writable.writeFile(Ci,this._deleteLog,"utf8",Ie.getFileFlag("w"),420,function(t){e._deleteLogUpdatePending=!1,t?e._deleteLogError=t:e._deleteLogUpdateNeeded&&(e._deleteLogUpdateNeeded=!1,e.updateLog(""))}))},e.prototype._reparseDeletionLog=function(){var t=this;this._deletedFiles={},this._deleteLog.split("\n").forEach(function(e){t._deletedFiles[e.slice(1)]="d"===e.slice(0,1)})},e.prototype.checkInitialized=function(){if(!this._isInitialized)throw new be(ve.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(null!==this._deleteLogError){var t=this._deleteLogError;throw this._deleteLogError=null,t}},e.prototype.checkInitAsync=function(t){if(!this._isInitialized)return t(new be(ve.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.")),!1;if(null!==this._deleteLogError){var e=this._deleteLogError;return this._deleteLogError=null,t(e),!1}return!0},e.prototype.checkPath=function(t){if(t===Ci)throw be.EPERM(t)},e.prototype.checkPathAsync=function(t,e){return t===Ci&&(e(be.EPERM(t)),!0)},e.prototype.createParentDirectoriesAsync=function(t,e){function n(t,e){t?(o.push(i),i=me.dirname(i),s._writable.stat(i,!1,n)):r()}function r(){if(!o.length)return e();var t=o.pop();s._readable.stat(t,!1,function(n,i){return i?void s._writable.mkdir(t,i.mode,function(t){return t?e(t):void r()}):e()})}var i=me.dirname(t),o=[],s=this;this._writable.stat(i,!1,n)},e.prototype.createParentDirectories=function(t){for(var e=this,n=me.dirname(t),r=[];!this._writable.existsSync(n);)r.push(n),n=me.dirname(n);r=r.reverse(),r.forEach(function(t){e._writable.mkdirSync(t,e.statSync(t,!1).mode)})},e.prototype.operateOnWritable=function(t,e){if(!this.existsSync(t))throw be.ENOENT(t);this._writable.existsSync(t)||this.copyToWritable(t),e()},e.prototype.operateOnWritableAsync=function(t,e){var n=this;this.exists(t,function(r){return r?void n._writable.exists(t,function(r){return r?void e():n.copyToWritableAsync(t,e)}):e(be.ENOENT(t))})},e.prototype.copyToWritable=function(t){var e=this.statSync(t,!1);e.isDirectory()?this._writable.mkdirSync(t,e.mode):this.writeFileSync(t,this._readable.readFileSync(t,null,xt("r")),null,xt("w"),this.statSync(t,!1).mode)},e.prototype.copyToWritableAsync=function(t,e){var n=this;this.stat(t,!1,function(r,i){return r?e(r):i.isDirectory()?n._writable.mkdir(t,i.mode,e):void n._readable.readFile(t,null,xt("r"),function(r,o){return r?e(r):void n.writeFile(t,o,null,xt("w"),i.mode,e)})})},e}(Be),ji=function(t){function e(e,n,r){void 0===r&&(r=!0),t.call(this,new Mi(e,n)),l(r,"OverlayFS",{readable:"readable file system",writable:"writable file system"})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{var r=new e(t.writable,t.readable,!1);r.initialize(function(t){n(t,r)},!1)}catch(t){n(t)}},e.isAvailable=function(){return Mi.isAvailable()},e.prototype.initialize=function(e,n){void 0===n&&(n=!0),n&&console.warn("[OverlayFS] OverlayFS.initialize() is deprecated and will be removed in the next major release. Please use 'OverlayFS.Create({readable: readable file system instance, writable: writable file system instance}, cb)' to create and initialize OverlayFS instances."),t.prototype.initialize.call(this,e)},e.prototype.getOverlayedFileSystems=function(){return t.prototype.getFSUnlocked.call(this).getOverlayedFileSystems()},e.prototype.unwrap=function(){return t.prototype.getFSUnlocked.call(this)},e}(xi);!function(t){t[t.CB=0]="CB",t[t.FD=1]="FD",t[t.API_ERROR=2]="API_ERROR",t[t.STATS=3]="STATS",t[t.PROBE=4]="PROBE",t[t.FILEFLAG=5]="FILEFLAG",t[t.BUFFER=6]="BUFFER",t[t.ERROR=7]="ERROR"}(Pi||(Pi={}));var Bi=function(){this._callbacks={},this._nextId=0};Bi.prototype.toRemoteArg=function(t){var e=this._nextId++;return this._callbacks[e]=t,{type:Pi.CB,id:e}},Bi.prototype.toLocalArg=function(t){var e=this._callbacks[t];return delete this._callbacks[t],e};var zi=function(){this._fileDescriptors={},this._nextId=0};zi.prototype.toRemoteArg=function(e,n,r,i){var o,s,a=this._nextId++;this._fileDescriptors[a]=e,e.stat(function(c,u){c?i(c):(s=qt(u.toBuffer()),r.isReadable()?e.read(t.alloc(u.size),0,u.size,0,function(t,e,c){t?i(t):(o=qt(c),i(null,{type:Pi.FD,id:a,data:o,stat:s,path:n,flag:r.getFlagString()}))}):i(null,{type:Pi.FD,id:a,data:new ArrayBuffer(0),stat:s,path:n,flag:r.getFlagString()}))})},zi.prototype.applyFdAPIRequest=function(t,e){var n=this,r=t.args[0];this._applyFdChanges(r,function(i,o){i?e(i):o[t.method](function(i){"close"===t.method&&delete n._fileDescriptors[r.id],e(i)})})},zi.prototype._applyFdChanges=function(t,e){var n=this._fileDescriptors[t.id],r=Wt(t.data),i=Fe.fromBuffer(Wt(t.stat)),o=Ie.getFileFlag(t.flag);o.isWriteable()?n.write(r,0,r.length,o.isAppendable()?n.getPos():0,function(t){function s(){n.stat(function(t,r){t?e(t):r.mode!==i.mode?n.chmod(i.mode,function(t){e(t,n)}):e(t,n)})}t?e(t):o.isAppendable()?s():n.truncate(r.length,function(){s()})}):e(null,n)};var Yi=function(t){function e(e,n,r,i,o,s){t.call(this,e,n,r,i,s),this._remoteFdId=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getRemoteFdId=function(){return this._remoteFdId},e.prototype.toRemoteArg=function(){return{type:Pi.FD,id:this._remoteFdId,data:qt(this.getBuffer()),stat:qt(this.getStats().toBuffer()),path:this.getPath(),flag:this.getFlag().getFlagString()}},e.prototype.sync=function(t){this._syncClose("sync",t)},e.prototype.close=function(t){this._syncClose("close",t)},e.prototype._syncClose=function(t,e){var n=this;this.isDirty()?this._fs.syncClose(t,this,function(t){t||n.resetDirty(),e(t)}):e()},e}(qe),qi=function(e){function n(t,n){var r=this;void 0===n&&(n=!0),e.call(this),this._callbackConverter=new Bi,this._isInitialized=!1,this._isReadOnly=!1,this._supportLinks=!1,this._supportProps=!1,this._worker=t,l(n,"WorkerFS",{worker:"Web Worker instance"}),this._worker.addEventListener("message",function(t){var e=t.data;if(Xt(e)){var n,i=e.args,o=new Array(i.length);for(n=0;n<o.length;n++)o[n]=r._argRemote2Local(i[n]);r._callbackConverter.toLocalArg(e.cbId).apply(null,o)}})}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.Create=function(t,e){var r=new n(t.worker,!1);r.initialize(function(){e(null,r)})},n.isAvailable=function(){return"undefined"!=typeof importScripts||"undefined"!=typeof Worker},n.attachRemoteListener=function(e){function n(e,n,r){switch(typeof e){case"object":e instanceof Fe?r(null,jt(e)):e instanceof be?r(null,Pt(e)):e instanceof Ye?r(null,i.toRemoteArg(e,n[0],n[1],r)):e instanceof Ie?r(null,zt(e)):e instanceof t?r(null,Ht(e)):e instanceof Error?r(null,Ut(e)):r(null,e);break;default:r(null,e)}}function r(t,r){if(!t)return t;switch(typeof t){case"object":if("number"!=typeof t.type)return t;var i=t;switch(i.type){case Pi.CB:var o=t.id;return function(){function t(t){u>0&&(u=-1,s={browserfsMessage:!0,cbId:o,args:[Pt(t)]},e.postMessage(s))}var i,s,a=arguments,c=new Array(arguments.length),u=arguments.length;for(i=0;i<arguments.length;i++)!function(i,a){n(a,r,function(n,r){c[i]=r,n?t(n):0===--u&&(s={browserfsMessage:!0,cbId:o,args:c},e.postMessage(s))})}(i,a[i]);0===arguments.length&&(s={browserfsMessage:!0,cbId:o,args:c},e.postMessage(s))};case Pi.API_ERROR:return Ct(i);case Pi.STATS:return Bt(i);case Pi.FILEFLAG:return Yt(i);case Pi.BUFFER:return Vt(i);case Pi.ERROR:return Mt(i);default:return t}default:return t}}var i=new zi;e.addEventListener("message",function(t){var n=t.data;if(Zt(n)){var o=n.args,s=new Array(o.length);switch(n.method){case"close":case"sync":!function(){var t=o[1];i.applyFdAPIRequest(n,function(n){var r={browserfsMessage:!0,cbId:t.id,args:n?[Pt(n)]:[]};e.postMessage(r)})}();break;case"probe":!function(){var t=Le.getRootFS(),n=o[1],r={type:Pi.PROBE,isReadOnly:t.isReadOnly(),supportsLinks:t.supportsLinks(),supportsProps:t.supportsProps()},i={browserfsMessage:!0,cbId:n.id,args:[r]};e.postMessage(i)}();break;default:for(var a=0;a<o.length;a++)s[a]=r(o[a],s);var c=Le.getRootFS();c[n.method].apply(c,s)}}})},n.prototype.getName=function(){return"WorkerFS"},n.prototype.initialize=function(t){var e=this;if(this._isInitialized)t();else{var n={browserfsMessage:!0,method:"probe",args:[this._argLocal2Remote(S()),this._callbackConverter.toRemoteArg(function(n){e._isInitialized=!0,e._isReadOnly=n.isReadOnly,e._supportLinks=n.supportsLinks,e._supportProps=n.supportsProps,t()})]};this._worker.postMessage(n)}},n.prototype.isReadOnly=function(){return this._isReadOnly},n.prototype.supportsSynch=function(){return!1},n.prototype.supportsLinks=function(){return this._supportLinks},n.prototype.supportsProps=function(){return this._supportProps},n.prototype.rename=function(t,e,n){this._rpc("rename",arguments)},n.prototype.stat=function(t,e,n){this._rpc("stat",arguments)},n.prototype.open=function(t,e,n,r){this._rpc("open",arguments)},n.prototype.unlink=function(t,e){this._rpc("unlink",arguments)},n.prototype.rmdir=function(t,e){this._rpc("rmdir",arguments)},n.prototype.mkdir=function(t,e,n){this._rpc("mkdir",arguments)},n.prototype.readdir=function(t,e){this._rpc("readdir",arguments)},n.prototype.exists=function(t,e){this._rpc("exists",arguments)},n.prototype.realpath=function(t,e,n){this._rpc("realpath",arguments)},n.prototype.truncate=function(t,e,n){this._rpc("truncate",arguments)},n.prototype.readFile=function(t,e,n,r){this._rpc("readFile",arguments)},n.prototype.writeFile=function(t,e,n,r,i,o){this._rpc("writeFile",arguments)},n.prototype.appendFile=function(t,e,n,r,i,o){this._rpc("appendFile",arguments)},n.prototype.chmod=function(t,e,n,r){this._rpc("chmod",arguments)},n.prototype.chown=function(t,e,n,r,i){this._rpc("chown",arguments)},n.prototype.utimes=function(t,e,n,r){this._rpc("utimes",arguments)},n.prototype.link=function(t,e,n){this._rpc("link",arguments)},n.prototype.symlink=function(t,e,n,r){this._rpc("symlink",arguments)},n.prototype.readlink=function(t,e){this._rpc("readlink",arguments)},n.prototype.syncClose=function(t,e,n){this._worker.postMessage({browserfsMessage:!0,method:t,args:[e.toRemoteArg(),this._callbackConverter.toRemoteArg(n)]})},n.prototype._argRemote2Local=function(t){if(!t)return t;switch(typeof t){case"object":if("number"!=typeof t.type)return t;var e=t;switch(e.type){case Pi.API_ERROR:return Ct(e);case Pi.FD:var n=e;return new Yi(this,n.path,Ie.getFileFlag(n.flag),Fe.fromBuffer(Wt(n.stat)),n.id,Wt(n.data));case Pi.STATS:return Bt(e);case Pi.FILEFLAG:return Yt(e);case Pi.BUFFER:return Vt(e);case Pi.ERROR:return Mt(e);default:return t}default:return t}},n.prototype._rpc=function(t,e){for(var n=this,r=new Array(e.length),i=0;i<e.length;i++)r[i]=n._argLocal2Remote(e[i]);var o={browserfsMessage:!0,method:t,args:r};this._worker.postMessage(o)},n.prototype._argLocal2Remote=function(e){if(!e)return e;switch(typeof e){case"object":return e instanceof Fe?jt(e):e instanceof be?Pt(e):e instanceof Yi?e.toRemoteArg():e instanceof Ie?zt(e):e instanceof t?Ht(e):e instanceof Error?Ut(e):"Unknown argument";case"function":return this._callbackConverter.toRemoteArg(e);default:return e}},n}(Be),Wi=Kt,Hi=De&&"undefined"!=typeof Blob?Gt:Jt,Vi=function(){this._index={},this.addPath("/",new Xi)};Vi.fromListing=function(t){var e=new Vi,n=new Xi;e._index["/"]=n;for(var r=[["",t,n]];r.length>0;){var i=void 0,o=r.pop(),s=o[0],a=o[1],c=o[2];for(var u in a)if(a.hasOwnProperty(u)){var f=a[u],h=s+"/"+u;f?(e._index[h]=i=new Xi,r.push([h,f,i])):i=new Zi(new Fe(Oe.FILE,-1,365)),c&&(c._ls[u]=i)}}return e},Vi.prototype.fileIterator=function(t){var e=this;for(var n in e._index)if(e._index.hasOwnProperty(n))for(var r=e._index[n],i=r.getListing(),o=0;o<i.length;o++){var s=r.getItem(i[o]);ee(s)&&t(s.getData())}},Vi.prototype.addPath=function(t,e){if(!e)throw new Error("Inode must be specified");if("/"!==t[0])throw new Error("Path must be absolute, got: "+t);if(this._index.hasOwnProperty(t))return this._index[t]===e;var n=this._split_path(t),r=n[0],i=n[1],o=this._index[r];return!(void 0===o&&"/"!==t&&(o=new Xi,!this.addPath(r,o)))&&(!("/"!==t&&!o.addItem(i,e))&&(ne(e)&&(this._index[t]=e),!0))},Vi.prototype.addPathFast=function(t,e){var n=t.lastIndexOf("/"),r=0===n?"/":t.substring(0,n),i=t.substring(n+1),o=this._index[r];return void 0===o&&(o=new Xi,this.addPathFast(r,o)),!!o.addItem(i,e)&&(e.isDir()&&(this._index[t]=e),!0)},Vi.prototype.removePath=function(t){var e=this,n=this._split_path(t),r=n[0],i=n[1],o=this._index[r];if(void 0===o)return null;var s=o.remItem(i);if(null===s)return null;if(ne(s)){for(var a=s.getListing(),c=0;c<a.length;c++)e.removePath(t+"/"+a[c]);"/"!==t&&delete this._index[t]}return s},Vi.prototype.ls=function(t){var e=this._index[t];return void 0===e?null:e.getListing()},Vi.prototype.getInode=function(t){var e=this._split_path(t),n=e[0],r=e[1],i=this._index[n];return void 0===i?null:n===t?i:i.getItem(r)},Vi.prototype._split_path=function(t){var e=me.dirname(t),n=t.substr(e.length+("/"===e?0:1));return[e,n]};var Zi=function(t){this.data=t};Zi.prototype.isFile=function(){return!0},Zi.prototype.isDir=function(){return!1},Zi.prototype.getData=function(){return this.data},Zi.prototype.setData=function(t){this.data=t};var Xi=function(t){void 0===t&&(t=null),this.data=t,this._ls={}};Xi.prototype.isFile=function(){return!1},Xi.prototype.isDir=function(){return!0},Xi.prototype.getData=function(){return this.data},Xi.prototype.getStats=function(){return new Fe(Oe.DIRECTORY,4096,365)},Xi.prototype.getListing=function(){return Object.keys(this._ls)},Xi.prototype.getItem=function(t){var e=this._ls[t];return e?e:null},Xi.prototype.addItem=function(t,e){return!(t in this._ls)&&(this._ls[t]=e,!0)},Xi.prototype.remItem=function(t){var e=this._ls[t];return void 0===e?null:(delete this._ls[t],e)};var Ki=function(t){function e(e,n,r){void 0===n&&(n=""),void 0===r&&(r=!0),t.call(this),e||(e="index.json"),n.length>0&&"/"!==n.charAt(n.length-1)&&(n+="/"),this.prefixUrl=n;var i=null;if("string"==typeof e){if(i=this._requestFileSync(e,"json"),!i)throw new Error("Unable to find listing at URL: ${listingUrlOrObj}")}else i=e;l(r,"XmlHttpRequest",{index:"string"==typeof e?e:"file index as an object",baseUrl:n}),this._index=Vi.fromListing(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){"string"==typeof t.index?e.FromURL(t.index,n,t.baseUrl,!1):n(null,new e(t.index,t.baseUrl,!1))},e.isAvailable=function(){return"undefined"!=typeof XMLHttpRequest&&null!==XMLHttpRequest},e.FromURL=function(t,n,r,i){void 0===r&&(r=t.slice(0,t.lastIndexOf("/")+1)),void 0===i&&(i=!0),i&&console.warn("[XmlHttpRequest] XmlHttpRequest.FromURL() is deprecated and will be removed in the next major release. Please use 'XmlHttpRequest.Create({ index: \""+t+'", baseUrl: "'+r+"\" }, cb)' instead."),Wi(t,"json",function(t,i){t?n(t):n(null,new e(i,r,!1))})},e.prototype.empty=function(){this._index.fileIterator(function(t){t.fileData=null})},e.prototype.getName=function(){return"XmlHttpRequest"},e.prototype.diskSpace=function(t,e){e(0,0)},e.prototype.isReadOnly=function(){return!0},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.preloadFile=function(t,e){var n=this._index.getInode(t);if(!ee(n))throw be.EISDIR(t);if(null===n)throw be.ENOENT(t);var r=n.getData();r.size=e.length,r.fileData=e},e.prototype.stat=function(t,e,n){var r=this._index.getInode(t);if(null===r)return n(be.ENOENT(t));var i;ee(r)?(i=r.getData(),i.size<0?this._requestFileSizeAsync(t,function(t,e){return t?n(t):(i.size=e,void n(null,i.clone()))}):n(null,i.clone())):ne(r)?(i=r.getStats(),n(null,i)):n(be.FileError(ve.EINVAL,t))},e.prototype.statSync=function(t,e){var n=this._index.getInode(t);if(null===n)throw be.ENOENT(t);var r;if(ee(n))r=n.getData(),r.size<0&&(r.size=this._requestFileSizeSync(t));else{if(!ne(n))throw be.FileError(ve.EINVAL,t);r=n.getStats()}return r},e.prototype.open=function(t,e,n,r){if(e.isWriteable())return r(new be(ve.EPERM,t));var i=this,o=this._index.getInode(t);if(null===o)return r(be.ENOENT(t));if(!ee(o))return r(be.EISDIR(t));var s=o.getData();switch(e.pathExistsAction()){case Ee.THROW_EXCEPTION:case Ee.TRUNCATE_FILE:return r(be.EEXIST(t));case Ee.NOP:if(s.fileData)return r(null,new We(i,t,e,s.clone(),s.fileData));this._requestFileAsync(t,"buffer",function(n,o){return n?r(n):(s.size=o.length,s.fileData=o,r(null,new We(i,t,e,s.clone(),o)))});break;default:return r(new be(ve.EINVAL,"Invalid FileMode object."))}},e.prototype.openSync=function(t,e,n){if(e.isWriteable())throw new be(ve.EPERM,t);var r=this._index.getInode(t);if(null===r)throw be.ENOENT(t);
5
if(!ee(r))throw be.EISDIR(t);var i=r.getData();switch(e.pathExistsAction()){case Ee.THROW_EXCEPTION:case Ee.TRUNCATE_FILE:throw be.EEXIST(t);case Ee.NOP:if(i.fileData)return new We(this,t,e,i.clone(),i.fileData);var o=this._requestFileSync(t,"buffer");return i.size=o.length,i.fileData=o,new We(this,t,e,i.clone(),o);default:throw new be(ve.EINVAL,"Invalid FileMode object.")}},e.prototype.readdir=function(t,e){try{e(null,this.readdirSync(t))}catch(t){e(t)}},e.prototype.readdirSync=function(t){var e=this._index.getInode(t);if(null===e)throw be.ENOENT(t);if(ne(e))return e.getListing();throw be.ENOTDIR(t)},e.prototype.readFile=function(t,e,n,r){var i=r;this.open(t,n,420,function(t,n){if(t)return r(t);r=function(t,e){n.close(function(n){return t||(t=n),i(t,e)})};var o=n,s=o.getBuffer();null===e?r(t,m(s)):re(s,e,r)})},e.prototype.readFileSync=function(t,e,n){var r=this.openSync(t,n,420);try{var i=r,o=i.getBuffer();return null===e?m(o):o.toString(e)}finally{r.closeSync()}},e.prototype.getXhrPath=function(t){return"/"===t.charAt(0)&&(t=t.slice(1)),this.prefixUrl+t},e.prototype._requestFileAsync=function(t,e,n){Wi(this.getXhrPath(t),e,n)},e.prototype._requestFileSync=function(t,e){return Hi(this.getXhrPath(t),e)},e.prototype._requestFileSizeAsync=function(t,e){te(this.getXhrPath(t),e)},e.prototype._requestFileSizeSync=function(t){return $t(this.getXhrPath(t))},e}(Be),Ji=function(){};Ji.str2byte=function(t,e){for(var n=t.length>e.length?e.length:t.length,r=0;r<n;r++){var i=t.charCodeAt(r);if(i>127){var o=Ji.extendedChars.indexOf(t.charAt(r));o>-1&&(i=o+128)}e[i]=r}return n},Ji.byte2str=function(t){for(var e=new Array(t.length),n=0;n<t.length;n++){var r=t[n];r>127?e[n]=Ji.extendedChars[r-128]:e[n]=String.fromCharCode(r)}return e.join("")},Ji.byteLength=function(t){return t.length},Ji.extendedChars=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];var Gi,Qi=n(24).inflateRaw,$i={};!function(t){t[t.MSDOS=0]="MSDOS",t[t.AMIGA=1]="AMIGA",t[t.OPENVMS=2]="OPENVMS",t[t.UNIX=3]="UNIX",t[t.VM_CMS=4]="VM_CMS",t[t.ATARI_ST=5]="ATARI_ST",t[t.OS2_HPFS=6]="OS2_HPFS",t[t.MAC=7]="MAC",t[t.Z_SYSTEM=8]="Z_SYSTEM",t[t.CP_M=9]="CP_M",t[t.NTFS=10]="NTFS",t[t.MVS=11]="MVS",t[t.VSE=12]="VSE",t[t.ACORN_RISC=13]="ACORN_RISC",t[t.VFAT=14]="VFAT",t[t.ALT_MVS=15]="ALT_MVS",t[t.BEOS=16]="BEOS",t[t.TANDEM=17]="TANDEM",t[t.OS_400=18]="OS_400",t[t.OSX=19]="OSX"}(Gi||(Gi={}));var to;!function(t){t[t.STORED=0]="STORED",t[t.SHRUNK=1]="SHRUNK",t[t.REDUCED_1=2]="REDUCED_1",t[t.REDUCED_2=3]="REDUCED_2",t[t.REDUCED_3=4]="REDUCED_3",t[t.REDUCED_4=5]="REDUCED_4",t[t.IMPLODE=6]="IMPLODE",t[t.DEFLATE=8]="DEFLATE",t[t.DEFLATE64=9]="DEFLATE64",t[t.TERSE_OLD=10]="TERSE_OLD",t[t.BZIP2=12]="BZIP2",t[t.LZMA=14]="LZMA",t[t.TERSE_NEW=18]="TERSE_NEW",t[t.LZ77=19]="LZ77",t[t.WAVPACK=97]="WAVPACK",t[t.PPMD=98]="PPMD"}(to||(to={}));var eo=function(t){if(this.data=t,67324752!==t.readUInt32LE(0))throw new be(ve.EINVAL,"Invalid Zip file: Local file header has invalid signature: "+this.data.readUInt32LE(0))};eo.prototype.versionNeeded=function(){return this.data.readUInt16LE(4)},eo.prototype.flags=function(){return this.data.readUInt16LE(6)},eo.prototype.compressionMethod=function(){return this.data.readUInt16LE(8)},eo.prototype.lastModFileTime=function(){return ie(this.data.readUInt16LE(10),this.data.readUInt16LE(12))},eo.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(10)},eo.prototype.crc32=function(){return this.data.readUInt32LE(14)},eo.prototype.fileNameLength=function(){return this.data.readUInt16LE(26)},eo.prototype.extraFieldLength=function(){return this.data.readUInt16LE(28)},eo.prototype.fileName=function(){return oe(this.data,this.useUTF8(),30,this.fileNameLength())},eo.prototype.extraField=function(){var t=30+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},eo.prototype.totalSize=function(){return 30+this.fileNameLength()+this.extraFieldLength()},eo.prototype.useUTF8=function(){return 2048===(2048&this.flags())};var no=function(t,e,n){this.header=t,this.record=e,this.data=n};no.prototype.decompress=function(){var t=this.header.compressionMethod(),e=$i[t];if(e)return e(this.data,this.record.compressedSize(),this.record.uncompressedSize(),this.record.flag());var n=to[t];throw n||(n="Unknown: "+t),new be(ve.EINVAL,"Invalid compression method on file '"+this.header.fileName()+"': "+n)},no.prototype.getHeader=function(){return this.header},no.prototype.getRecord=function(){return this.record},no.prototype.getRawData=function(){return this.data};var ro=function(t){this.data=t};ro.prototype.crc32=function(){return this.data.readUInt32LE(0)},ro.prototype.compressedSize=function(){return this.data.readUInt32LE(4)},ro.prototype.uncompressedSize=function(){return this.data.readUInt32LE(8)};var io=function(t){if(this.data=t,134630224!==this.data.readUInt32LE(0))throw new be(ve.EINVAL,"Invalid archive extra data record signature: "+this.data.readUInt32LE(0))};io.prototype.length=function(){return this.data.readUInt32LE(4)},io.prototype.extraFieldData=function(){return this.data.slice(8,8+this.length())};var oo=function(t){if(this.data=t,84233040!==this.data.readUInt32LE(0))throw new be(ve.EINVAL,"Invalid digital signature signature: "+this.data.readUInt32LE(0))};oo.prototype.size=function(){return this.data.readUInt16LE(4)},oo.prototype.signatureData=function(){return this.data.slice(6,6+this.size())};var so=function(t,e){if(this.zipData=t,this.data=e,33639248!==this.data.readUInt32LE(0))throw new be(ve.EINVAL,"Invalid Zip file: Central directory record has invalid signature: "+this.data.readUInt32LE(0));this._filename=this.produceFilename()};so.prototype.versionMadeBy=function(){return this.data.readUInt16LE(4)},so.prototype.versionNeeded=function(){return this.data.readUInt16LE(6)},so.prototype.flag=function(){return this.data.readUInt16LE(8)},so.prototype.compressionMethod=function(){return this.data.readUInt16LE(10)},so.prototype.lastModFileTime=function(){return ie(this.data.readUInt16LE(12),this.data.readUInt16LE(14))},so.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(12)},so.prototype.crc32=function(){return this.data.readUInt32LE(16)},so.prototype.compressedSize=function(){return this.data.readUInt32LE(20)},so.prototype.uncompressedSize=function(){return this.data.readUInt32LE(24)},so.prototype.fileNameLength=function(){return this.data.readUInt16LE(28)},so.prototype.extraFieldLength=function(){return this.data.readUInt16LE(30)},so.prototype.fileCommentLength=function(){return this.data.readUInt16LE(32)},so.prototype.diskNumberStart=function(){return this.data.readUInt16LE(34)},so.prototype.internalAttributes=function(){return this.data.readUInt16LE(36)},so.prototype.externalAttributes=function(){return this.data.readUInt32LE(38)},so.prototype.headerRelativeOffset=function(){return this.data.readUInt32LE(42)},so.prototype.produceFilename=function(){var t=oe(this.data,this.useUTF8(),46,this.fileNameLength());return t.replace(/\\/g,"/")},so.prototype.fileName=function(){return this._filename},so.prototype.rawFileName=function(){return this.data.slice(46,46+this.fileNameLength())},so.prototype.extraField=function(){var t=44+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},so.prototype.fileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return oe(this.data,this.useUTF8(),t,this.fileCommentLength())},so.prototype.rawFileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return this.data.slice(t,t+this.fileCommentLength())},so.prototype.totalSize=function(){return 46+this.fileNameLength()+this.extraFieldLength()+this.fileCommentLength()},so.prototype.isDirectory=function(){var t=this.fileName();return!!(16&this.externalAttributes())||"/"===t.charAt(t.length-1)},so.prototype.isFile=function(){return!this.isDirectory()},so.prototype.useUTF8=function(){return 2048===(2048&this.flag())},so.prototype.isEncrypted=function(){return 1===(1&this.flag())},so.prototype.getFileData=function(){var t=this.headerRelativeOffset(),e=new eo(this.zipData.slice(t));return new no(e,this,this.zipData.slice(t+e.totalSize()))},so.prototype.getData=function(){return this.getFileData().decompress()},so.prototype.getRawData=function(){return this.getFileData().getRawData()},so.prototype.getStats=function(){return new Fe(Oe.FILE,this.uncompressedSize(),365,new Date,this.lastModFileTime())};var ao=function(t){if(this.data=t,101010256!==this.data.readUInt32LE(0))throw new be(ve.EINVAL,"Invalid Zip file: End of central directory record has invalid signature: "+this.data.readUInt32LE(0))};ao.prototype.diskNumber=function(){return this.data.readUInt16LE(4)},ao.prototype.cdDiskNumber=function(){return this.data.readUInt16LE(6)},ao.prototype.cdDiskEntryCount=function(){return this.data.readUInt16LE(8)},ao.prototype.cdTotalEntryCount=function(){return this.data.readUInt16LE(10)},ao.prototype.cdSize=function(){return this.data.readUInt32LE(12)},ao.prototype.cdOffset=function(){return this.data.readUInt32LE(16)},ao.prototype.cdZipCommentLength=function(){return this.data.readUInt16LE(20)},ao.prototype.cdZipComment=function(){return oe(this.data,!0,22,this.cdZipCommentLength())},ao.prototype.rawCdZipComment=function(){return this.data.slice(22,22+this.cdZipCommentLength())};var co=function(t,e,n,r){this.index=t,this.directoryEntries=e,this.eocd=n,this.data=r},uo=function(t){function e(e,n,r){void 0===n&&(n=""),void 0===r&&(r=!0),t.call(this),this.name=n,this._index=new Vi,this._directoryEntries=[],this._eocd=null,l(r,"ZipFS",{zipData:"zip data as a Buffer",name:n}),e instanceof co?(this._index=e.index,this._directoryEntries=e.directoryEntries,this._eocd=e.eocd,this.data=e.data):(this.data=e,this.populateIndex())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{e.computeIndex(t.zipData,function(r){var i=new e(r,t.name,!1);n(null,i)},!1)}catch(t){n(t)}},e.isAvailable=function(){return!0},e.RegisterDecompressionMethod=function(t,e){$i[t]=e},e.computeIndex=function(t,n,r){void 0===r&&(r=!0),r&&console.warn("[ZipFS] ZipFS.computeIndex is now deprecated, and will be removed in the next major release. Please update your code to use 'ZipFS.Create({ zipData: zip file as a Buffer}, cb)' instead.");var i=new Vi,o=e.getEOCD(t);if(o.diskNumber()!==o.cdDiskNumber())throw new be(ve.EINVAL,"ZipFS does not support spanned zip files.");var s=o.cdOffset();if(4294967295===s)throw new be(ve.EINVAL,"ZipFS does not support Zip64.");var a=s+o.cdSize();e.computeIndexResponsive(t,i,s,a,n,[],o)},e.getEOCD=function(t){for(var e=22,n=Math.min(e+65535,t.length-1),r=e;r<n;r++)if(101010256===t.readUInt32LE(t.length-r))return new ao(t.slice(t.length-r));throw new be(ve.EINVAL,"Invalid ZIP file: Could not locate End of Central Directory signature.")},e.addToIndex=function(t,e){var n=t.fileName();if("/"===n.charAt(0))throw new Error("WHY IS THIS ABSOLUTE");"/"===n.charAt(n.length-1)&&(n=n.substr(0,n.length-1)),t.isDirectory()?e.addPathFast("/"+n,new Xi(t)):e.addPathFast("/"+n,new Zi(t))},e.computeIndexResponsive=function(t,n,r,i,o,s,a){if(r<i){for(var c=0;c++<200&&r<i;){var u=new so(t,t.slice(r));e.addToIndex(u,n),r+=u.totalSize(),s.push(u)}Ai(function(){e.computeIndexResponsive(t,n,r,i,o,s,a)})}else o(new co(n,s,a,t))},e.prototype.getName=function(){return"ZipFS"+(""!==this.name?" "+this.name:"")},e.prototype.getCentralDirectoryEntry=function(t){var e=this._index.getInode(t);if(null===e)throw be.ENOENT(t);if(ee(e))return e.getData();if(ne(e))return e.getData();throw be.EPERM("Invalid inode: "+e)},e.prototype.getCentralDirectoryEntryAt=function(t){var e=this._directoryEntries[t];if(!e)throw new RangeError("Invalid directory index: "+t+".");return e},e.prototype.getNumberOfCentralDirectoryEntries=function(){return this._directoryEntries.length},e.prototype.getEndOfCentralDirectory=function(){return this._eocd},e.prototype.diskSpace=function(t,e){e(this.data.length,0)},e.prototype.isReadOnly=function(){return!0},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.statSync=function(t,e){var n=this._index.getInode(t);if(null===n)throw be.ENOENT(t);var r;if(ee(n))r=n.getData().getStats();else{if(!ne(n))throw new be(ve.EINVAL,"Invalid inode.");r=n.getStats()}return r},e.prototype.openSync=function(t,e,n){if(e.isWriteable())throw new be(ve.EPERM,t);var r=this._index.getInode(t);if(!r)throw be.ENOENT(t);if(!ee(r))throw be.EISDIR(t);var i=r.getData(),o=i.getStats();switch(e.pathExistsAction()){case Ee.THROW_EXCEPTION:case Ee.TRUNCATE_FILE:throw be.EEXIST(t);case Ee.NOP:return new We(this,t,e,o,i.getData());default:throw new be(ve.EINVAL,"Invalid FileMode object.")}},e.prototype.readdirSync=function(t){var e=this._index.getInode(t);if(e){if(ne(e))return e.getListing();throw be.ENOTDIR(t)}throw be.ENOENT(t)},e.prototype.readFileSync=function(t,e,n){var r=this.openSync(t,n,420);try{var i=r,o=i.getBuffer();return null===e?m(o):o.toString(e)}finally{r.closeSync()}},e.prototype.populateIndex=function(){var t=this,n=this._eocd=e.getEOCD(this.data);if(n.diskNumber()!==n.cdDiskNumber())throw new be(ve.EINVAL,"ZipFS does not support spanned zip files.");var r=n.cdOffset();if(4294967295===r)throw new be(ve.EINVAL,"ZipFS does not support Zip64.");for(var i=r+n.cdSize();r<i;){var o=new so(t.data,t.data.slice(r));r+=o.totalSize(),e.addToIndex(o,t._index),t._directoryEntries.push(o)}},e}(ze);uo.CompressionMethod=to,uo.RegisterDecompressionMethod(to.DEFLATE,function(t,e,n){return _(Qi(t.slice(0,e),{chunkSize:n}))}),uo.RegisterDecompressionMethod(to.STORED,function(t,e,n){return m(t,0,n)});var fo="IEEE_P1282",ho=function(t){this._data=t};ho.prototype.type=function(){return this._data[0]},ho.prototype.standardIdentifier=function(){return se(this._data,1,5)},ho.prototype.version=function(){return this._data[6]},ho.prototype.data=function(){return this._data.slice(7,2048)};var lo=function(t){function e(e){t.call(this,e),this._root=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.systemIdentifier=function(){return this._getString32(8)},e.prototype.volumeIdentifier=function(){return this._getString32(40)},e.prototype.volumeSpaceSize=function(){return this._data.readUInt32LE(80)},e.prototype.volumeSetSize=function(){return this._data.readUInt16LE(120)},e.prototype.volumeSequenceNumber=function(){return this._data.readUInt16LE(124)},e.prototype.logicalBlockSize=function(){return this._data.readUInt16LE(128)},e.prototype.pathTableSize=function(){return this._data.readUInt32LE(132)},e.prototype.locationOfTypeLPathTable=function(){return this._data.readUInt32LE(140)},e.prototype.locationOfOptionalTypeLPathTable=function(){return this._data.readUInt32LE(144)},e.prototype.locationOfTypeMPathTable=function(){return this._data.readUInt32BE(148)},e.prototype.locationOfOptionalTypeMPathTable=function(){return this._data.readUInt32BE(152)},e.prototype.rootDirectoryEntry=function(t){return null===this._root&&(this._root=this._constructRootDirectoryRecord(this._data.slice(156)),this._root.rootCheckForRockRidge(t)),this._root},e.prototype.volumeSetIdentifier=function(){return this._getString(190,128)},e.prototype.publisherIdentifier=function(){return this._getString(318,128)},e.prototype.dataPreparerIdentifier=function(){return this._getString(446,128)},e.prototype.applicationIdentifier=function(){return this._getString(574,128)},e.prototype.copyrightFileIdentifier=function(){return this._getString(702,38)},e.prototype.abstractFileIdentifier=function(){return this._getString(740,36)},e.prototype.bibliographicFileIdentifier=function(){return this._getString(776,37)},e.prototype.volumeCreationDate=function(){return ce(this._data,813)},e.prototype.volumeModificationDate=function(){return ce(this._data,830)},e.prototype.volumeExpirationDate=function(){return ce(this._data,847)},e.prototype.volumeEffectiveDate=function(){return ce(this._data,864)},e.prototype.fileStructureVersion=function(){return this._data[881]},e.prototype.applicationUsed=function(){return this._data.slice(883,1395)},e.prototype.reserved=function(){return this._data.slice(1395,2048)},e.prototype._getString32=function(t){return this._getString(t,32)},e}(ho),po=function(t){function e(e){if(t.call(this,e),1!==this.type())throw new be(ve.EIO,"Invalid primary volume descriptor.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.name=function(){return"ISO9660"},e.prototype._constructRootDirectoryRecord=function(t){return new _o(t,-1)},e.prototype._getString=function(t,e){return this._getString(t,e)},e}(lo),yo=function(t){function e(e){if(t.call(this,e),2!==this.type())throw new be(ve.EIO,"Invalid supplementary volume descriptor.");var n=this.escapeSequence(),r=n[2];if(37!==n[0]||47!==n[1]||64!==r&&67!==r&&69!==r)throw new be(ve.EIO,"Unrecognized escape sequence for SupplementaryVolumeDescriptor: "+n.toString())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.name=function(){return"Joliet"},e.prototype.escapeSequence=function(){return this._data.slice(88,120)},e.prototype._constructRootDirectoryRecord=function(t){return new vo(t,-1)},e.prototype._getString=function(t,e){return ae(this._data,t,e)},e}(lo),go=function(t,e){this._suEntries=null,this._fileOrDir=null,this._data=t,this._rockRidgeOffset=e};go.prototype.hasRockRidge=function(){return this._rockRidgeOffset>-1},go.prototype.getRockRidgeOffset=function(){return this._rockRidgeOffset},go.prototype.rootCheckForRockRidge=function(t){var e=this.getDirectory(t);this._rockRidgeOffset=e.getDotEntry(t)._getRockRidgeOffset(t),this._rockRidgeOffset>-1&&(this._fileOrDir=null)},go.prototype.length=function(){return this._data[0]},go.prototype.extendedAttributeRecordLength=function(){return this._data[1]},go.prototype.lba=function(){return 2048*this._data.readUInt32LE(2)},go.prototype.dataLength=function(){return this._data.readUInt32LE(10)},go.prototype.recordingDate=function(){return ue(this._data,18)},go.prototype.fileFlags=function(){return this._data[25]},go.prototype.fileUnitSize=function(){return this._data[26]},go.prototype.interleaveGapSize=function(){return this._data[27]},go.prototype.volumeSequenceNumber=function(){return this._data.readUInt16LE(28)},go.prototype.identifier=function(){return this._getString(33,this._data[32])},go.prototype.fileName=function(t){if(this.hasRockRidge()){var e=this._rockRidgeFilename(t);if(null!==e)return e}var n=this.identifier();if(this.isDirectory(t))return n;var r=n.indexOf(";");return r===-1?n:"."===n[r-1]?n.slice(0,r-1):n.slice(0,r)},go.prototype.isDirectory=function(t){var e=!!(2&this.fileFlags());return!e&&this.hasRockRidge()&&(e=this.getSUEntries(t).filter(function(t){return t instanceof Ao}).length>0),e},go.prototype.isSymlink=function(t){return this.hasRockRidge()&&this.getSUEntries(t).filter(function(t){return t instanceof No}).length>0},go.prototype.getSymlinkPath=function(t){for(var e="",n=this.getSUEntries(t),r=this._getGetString(),i=0;i<n.length;i++){var o=n[i];if(o instanceof No){for(var s=o.componentRecords(),a=0;a<s.length;a++){var c=s[a],u=c.flags();2&u?e+="./":4&u?e+="../":8&u?e+="/":(e+=c.content(r),1&u||(e+="/"))}if(!o.continueFlag())break}}return e.length>1&&"/"===e[e.length-1]?e.slice(0,e.length-1):e},go.prototype.getFile=function(t){if(this.isDirectory(t))throw new Error("Tried to get a File from a directory.");return null===this._fileOrDir&&(this._fileOrDir=t.slice(this.lba(),this.lba()+this.dataLength())),this._fileOrDir},go.prototype.getDirectory=function(t){if(!this.isDirectory(t))throw new Error("Tried to get a Directory from a file.");return null===this._fileOrDir&&(this._fileOrDir=this._constructDirectory(t)),this._fileOrDir},go.prototype.getSUEntries=function(t){return this._suEntries||this._constructSUEntries(t),this._suEntries},go.prototype._rockRidgeFilename=function(t){var e=this.getSUEntries(t).filter(function(t){return t instanceof Lo});if(0===e.length||6&e[0].flags())return null;for(var n="",r=this._getGetString(),i=0;i<e.length;i++){var o=e[i];if(n+=o.name(r),!(1&o.flags()))break}return n},go.prototype._constructSUEntries=function(t){var e=33+this._data[32];e%2===1&&e++,e+=this._rockRidgeOffset,this._suEntries=he(this._data,e,this.length(),t)},go.prototype._getRockRidgeOffset=function(t){this._rockRidgeOffset=0;var e=this.getSUEntries(t);if(e.length>0){var n=e[0];if(n instanceof Eo&&n.checkBytesPass())for(var r=1;r<e.length;r++){var i=e[r];if(i instanceof Oo||i instanceof ko&&i.extensionIdentifier()===fo)return n.bytesSkipped()}}return this._rockRidgeOffset=-1,-1};var _o=function(t){function e(e,n){t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._getString=function(t,e){return se(this._data,t,e)},e.prototype._constructDirectory=function(t){return new Mo(this,t)},e.prototype._getGetString=function(){return se},e}(go),vo=function(t){function e(e,n){t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._getString=function(t,e){return ae(this._data,t,e)},e.prototype._constructDirectory=function(t){return new jo(this,t)},e.prototype._getGetString=function(){return ae},e}(go),wo=function(t){this._data=t};wo.prototype.signatureWord=function(){return this._data.readUInt16BE(0)},wo.prototype.signatureWordString=function(){return se(this._data,0,2)},wo.prototype.length=function(){return this._data[2]},wo.prototype.suVersion=function(){return this._data[3]};var mo=function(t){function e(e){t.call(this,e),this._entries=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.continuationLba=function(){return this._data.readUInt32LE(4)},e.prototype.continuationLbaOffset=function(){return this._data.readUInt32LE(12)},e.prototype.continuationLength=function(){return this._data.readUInt32LE(20)},e.prototype.getEntries=function(t){if(!this._entries){var e=2048*this.continuationLba()+this.continuationLbaOffset();this._entries=he(t,e,this.continuationLength(),t)}return this._entries},e}(wo),So=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(wo),Eo=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.checkBytesPass=function(){return 190===this._data[4]&&239===this._data[5]},e.prototype.bytesSkipped=function(){return this._data[6]},e}(wo),bo=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(wo),ko=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.identifierLength=function(){return this._data[4]},e.prototype.descriptorLength=function(){return this._data[5]},e.prototype.sourceLength=function(){return this._data[6]},e.prototype.extensionVersion=function(){return this._data[7]},e.prototype.extensionIdentifier=function(){return se(this._data,8,this.identifierLength())},e.prototype.extensionDescriptor=function(){return se(this._data,8+this.identifierLength(),this.descriptorLength())},e.prototype.extensionSource=function(){return se(this._data,8+this.identifierLength()+this.descriptorLength(),this.sourceLength())},e}(wo),Io=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.extensionSequence=function(){return this._data[4]},e}(wo),Oo=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(wo),Fo=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.mode=function(){return this._data.readUInt32LE(4)},e.prototype.fileLinks=function(){return this._data.readUInt32LE(12)},e.prototype.uid=function(){return this._data.readUInt32LE(20)},e.prototype.gid=function(){return this._data.readUInt32LE(28)},e.prototype.inode=function(){return this._data.readUInt32LE(36)},e}(wo),Ro=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.devTHigh=function(){return this._data.readUInt32LE(4)},e.prototype.devTLow=function(){return this._data.readUInt32LE(12)},e}(wo),No=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flags=function(){return this._data[4]},e.prototype.continueFlag=function(){return 1&this.flags()},e.prototype.componentRecords=function(){for(var t=this,e=new Array,n=5;n<this.length();){var r=new To(t._data.slice(n));e.push(r),n+=r.length()}return e},e}(wo),To=function(t){this._data=t};To.prototype.flags=function(){return this._data[0]},To.prototype.length=function(){return 2+this.componentLength()},To.prototype.componentLength=function(){return this._data[1]},To.prototype.content=function(t){return t(this._data,2,this.componentLength())};var Lo=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flags=function(){return this._data[4]},e.prototype.name=function(t){return t(this._data,5,this.length()-5)},e}(wo),Ao=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.childDirectoryLba=function(){return this._data.readUInt32LE(4)},e}(wo),Do=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parentDirectoryLba=function(){return this._data.readUInt32LE(4)},e}(wo),xo=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(wo),Po=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flags=function(){return this._data[4]},e.prototype.creation=function(){return 1&this.flags()?this._longFormDates()?ce(this._data,5):ue(this._data,5):null},e.prototype.modify=function(){if(2&this.flags()){var t=1&this.flags()?1:0;return this._longFormDates?ce(this._data,5+17*t):ue(this._data,5+7*t)}return null},e.prototype.access=function(){if(4&this.flags()){var t=1&this.flags()?1:0;return t+=2&this.flags()?1:0,this._longFormDates?ce(this._data,5+17*t):ue(this._data,5+7*t)}return null},e.prototype.backup=function(){if(16&this.flags()){var t=1&this.flags()?1:0;return t+=2&this.flags()?1:0,t+=4&this.flags()?1:0,this._longFormDates?ce(this._data,5+17*t):ue(this._data,5+7*t)}return null},e.prototype.expiration=function(){if(32&this.flags()){var t=1&this.flags()?1:0;return t+=2&this.flags()?1:0,t+=4&this.flags()?1:0,t+=16&this.flags()?1:0,this._longFormDates?ce(this._data,5+17*t):ue(this._data,5+7*t)}return null},e.prototype.effective=function(){if(64&this.flags()){var t=1&this.flags()?1:0;return t+=2&this.flags()?1:0,t+=4&this.flags()?1:0,t+=16&this.flags()?1:0,t+=32&this.flags()?1:0,this._longFormDates?ce(this._data,5+17*t):ue(this._data,5+7*t)}return null},e.prototype._longFormDates=function(){return!!this.flags()},e}(wo),Co=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.virtualSizeHigh=function(){return this._data.readUInt32LE(4)},e.prototype.virtualSizeLow=function(){return this._data.readUInt32LE(12)},e.prototype.tableDepth=function(){return this._data[20]},e}(wo),Uo=function(t,e){var n=this;this._fileList=[],this._fileMap={},this._record=t;var r=t.lba(),i=r+t.dataLength();if(!(2&t.fileFlags())){var o=t.getSUEntries(e).filter(function(t){return t instanceof Ao})[0];r=2048*o.childDirectoryLba(),i=1/0}for(;r<i;){var s=e[r];if(0!==s){var a=n._constructDirectoryRecord(e.slice(r)),c=a.fileName(e);"\0"!==c&&""!==c?a.hasRockRidge()&&0!==a.getSUEntries(e).filter(function(t){return t instanceof xo}).length||(n._fileMap[c]=a,n._fileList.push(c)):i===1/0&&(i=r+a.dataLength()),r+=a.length()}else r++}};Uo.prototype.getRecord=function(t){return this._fileMap[t]},Uo.prototype.getFileList=function(){return this._fileList},Uo.prototype.getDotEntry=function(t){return this._constructDirectoryRecord(t.slice(this._record.lba()))};var Mo=function(t){function e(e,n){t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._constructDirectoryRecord=function(t){return new _o(t,this._record.getRockRidgeOffset())},e}(Uo),jo=function(t){function e(e,n){t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._constructDirectoryRecord=function(t){return new vo(t,this._record.getRockRidgeOffset())},e}(Uo),Bo=function(t){function e(e,n,r){var i=this;void 0===n&&(n=""),void 0===r&&(r=!0),t.call(this),this._data=e,l(r,"IsoFS",{data:"ISO data as a Buffer",name:n});for(var o=!1,s=32768,a=new Array;!o;){var c=e.slice(s),u=new ho(c);switch(u.type()){case 1:a.push(new po(c));break;case 2:a.push(new yo(c));break;case 255:o=!0}s+=2048}if(0===a.length)throw new be(ve.EIO,"Unable to find a suitable volume descriptor.");a.forEach(function(t){i._pvd&&2===i._pvd.type()||(i._pvd=t)}),this._root=this._pvd.rootDirectoryEntry(e),this._name=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){var r,i;try{r=new e(t.data,t.name,!1)}catch(t){t=t}finally{n(i,r)}},e.isAvailable=function(){return!0},e.prototype.getName=function(){var t="IsoFS"+this._name+(this._pvd?"-"+this._pvd.name():"");return this._root&&this._root.hasRockRidge()&&(t+="-RockRidge"),t},e.prototype.diskSpace=function(t,e){e(this._data.length,0)},e.prototype.isReadOnly=function(){return!0},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.statSync=function(t,e){var n=this._getDirectoryRecord(t);if(null===n)throw be.ENOENT(t);return this._getStats(t,n)},e.prototype.openSync=function(t,e,n){if(e.isWriteable())throw new be(ve.EPERM,t);var r=this._getDirectoryRecord(t);if(!r)throw be.ENOENT(t);if(r.isSymlink(this._data))return this.openSync(me.resolve(t,r.getSymlinkPath(this._data)),e,n);if(r.isDirectory(this._data))throw be.EISDIR(t);var i=r.getFile(this._data),o=this._getStats(t,r);switch(e.pathExistsAction()){case Ee.THROW_EXCEPTION:case Ee.TRUNCATE_FILE:throw be.EEXIST(t);case Ee.NOP:return new We(this,t,e,o,i);default:throw new be(ve.EINVAL,"Invalid FileMode object.")}},e.prototype.readdirSync=function(t){var e=this._getDirectoryRecord(t);if(e){if(e.isDirectory(this._data))return e.getDirectory(this._data).getFileList().slice(0);throw be.ENOTDIR(t)}throw be.ENOENT(t)},e.prototype.readFileSync=function(t,e,n){var r=this.openSync(t,n,420);try{var i=r,o=i.getBuffer();return null===e?m(o):o.toString(e)}finally{r.closeSync()}},e.prototype._getDirectoryRecord=function(t){var e=this;if("/"===t)return this._root;for(var n=t.split("/").slice(1),r=this._root,i=0;i<n.length;i++){
6
if(!r.isDirectory(e._data))return null;if(r=r.getDirectory(e._data).getRecord(n[i]),!r)return null}return r},e.prototype._getStats=function(t,e){if(e.isSymlink(this._data)){var n=me.resolve(t,e.getSymlinkPath(this._data)),r=this._getDirectoryRecord(n);return r?this._getStats(n,r):null}var i=e.dataLength(),o=365,s=e.recordingDate(),a=s,c=s,u=s;if(e.hasRockRidge())for(var f=e.getSUEntries(this._data),h=0;h<f.length;h++){var l=f[h];if(l instanceof Fo)o=l.mode();else if(l instanceof Po){var p=l.flags();4&p&&(a=l.access()),2&p&&(c=l.modify()),1&p&&(u=l.creation())}}return o&=365,new Fe(e.isDirectory(this._data)?Oe.DIRECTORY:Oe.FILE,i,o,a,c,u)},e}(ze),zo={AsyncMirror:Ve,Dropbox:Hr,Emscripten:Zr,FolderAdapter:Xr,HTML5FS:$r,InMemory:ui,IndexedDB:yi,IsoFS:Bo,LocalStorage:vi,MountableFileSystem:wi,OverlayFS:ji,WorkerFS:qi,XmlHttpRequest:Ki,ZipFS:uo};o.initializeTTYs&&o.initializeTTYs(),"b"!=="ab".substr(-1)&&(String.prototype.substr=function(t){return function(e,n){return e<0&&(e=this.length+e),t.call(this,e,n)}}(String.prototype.substr)),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&(Uint8Array.prototype.slice||(Uint8Array.prototype.slice=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.length);var n=this;return t<0&&(t=this.length+t,t<0&&(t=0)),e<0&&(e=this.length+e,e<0&&(e=0)),e<t&&(e=t),new Uint8Array(n.buffer,n.byteOffset+t,e-t)})),e.install=le,e.registerFileSystem=pe,e.BFSRequire=de,e.initialize=ye,e.configure=ge,e.getFileSystem=_e,e.EmscriptenFS=je,e.FileSystem=zo,e.Errors=ke,e.setImmediate=Ai}).call(e,n(5),function(){return this}(),n(43)(t),n(3))},function(t,e,n){"use strict";function r(t){return this instanceof r?(u.call(this,t),f.call(this,t),t&&t.readable===!1&&(this.readable=!1),t&&t.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,t&&t.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",i)):new r(t)}function i(){this.allowHalfOpen||this._writableState.ended||s(o,this)}function o(t){t.end()}var s=n(8),a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=r;var c=n(4);c.inherits=n(2);var u=n(15),f=n(11);c.inherits(r,u);for(var h=a(f.prototype),l=0;l<h.length;l++){var p=h[l];r.prototype[p]||(r.prototype[p]=f.prototype[p])}Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),r.prototype._destroy=function(t,e){this.push(null),this.end(),s(e,t)}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";function r(t){s[t]||("function"==typeof o[t]?s[t]=function(){return o[t].apply(o,arguments)}:s[t]=o[t])}var i=n(21),o=new i,s={};for(var a in o)r(a);s.initializeTTYs=function(){null===o.stdin&&(o.initializeTTYs(),s.stdin=o.stdin,s.stdout=o.stdout,s.stderr=o.stderr)},o.nextTick(function(){s.initializeTTYs()}),t.exports=s},function(t,e,n){(function(t){function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===g(t)}function r(t){return"boolean"==typeof t}function i(t){return null===t}function o(t){return null==t}function s(t){return"number"==typeof t}function a(t){return"string"==typeof t}function c(t){return"symbol"==typeof t}function u(t){return void 0===t}function f(t){return"[object RegExp]"===g(t)}function h(t){return"object"==typeof t&&null!==t}function l(t){return"[object Date]"===g(t)}function p(t){return"[object Error]"===g(t)||t instanceof Error}function d(t){return"function"==typeof t}function y(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function g(t){return Object.prototype.toString.call(t)}e.isArray=n,e.isBoolean=r,e.isNull=i,e.isNullOrUndefined=o,e.isNumber=s,e.isString=a,e.isSymbol=c,e.isUndefined=u,e.isRegExp=f,e.isObject=h,e.isDate=l,e.isError=p,e.isFunction=d,e.isPrimitive=y,e.isBuffer=t.isBuffer}).call(e,n(5))},function(t,e,n){t.exports=n(10).Buffer},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,a,c,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var f=new Error('Uncaught, unspecified "error" event. ('+e+")");throw f.context=e,f}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),u=n.slice(),i=u.length,c=0;c<i;c++)u[c].apply(this,a);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(t[i]=r[i])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(n,n+r),i);for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,s;for(r=0,e=0,n=t.length;e<n;e++)r+=t[e].length;for(s=new Uint8Array(r),i=0,e=0,n=t.length;e<n;e++)o=t[e],s.set(o,i),i+=o.length;return s}},o={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,i)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(r)},function(t,e,n){(function(e){"use strict";function n(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick(function(){t.apply(null,o)})}}!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports=n:t.exports=e.nextTick}).call(e,n(3))},function(t,e,n){function r(t,e){for(var n in t)e[n]=t[n]}function i(t,e,n){return s(t,e,n)}var o=n(10),s=o.Buffer;s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=o:(r(o,e),e.Buffer=i),r(s,i),i.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,n)},i.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=s(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},i.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},i.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o.SlowBuffer(t)}},function(t,e,n){(function(t,r){/*!
7
	 * The buffer module from node.js, for the browser.
8
	 *
9
	 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
10
	 * @license  MIT
11
	 */
12
"use strict";function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,n){if(o()<n)throw new RangeError("Invalid typed array length");return t.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(n),e.__proto__=t.prototype):(null===e&&(e=new t(n)),e.length=n),e}function t(e,n,r){if(!(t.TYPED_ARRAY_SUPPORT||this instanceof t))return new t(e,n,r);if("number"==typeof e){if("string"==typeof n)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return a(this,e,n,r)}function a(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?p(t,e,n,r):"string"==typeof e?h(t,e,n):d(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e,n,r){return c(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}function f(e,n){if(c(n),e=s(e,n<0?0:0|y(n)),!t.TYPED_ARRAY_SUPPORT)for(var r=0;r<n;++r)e[r]=0;return e}function h(e,n,r){if("string"==typeof r&&""!==r||(r="utf8"),!t.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|_(n,r);e=s(e,i);var o=e.write(n,r);return o!==i&&(e=e.slice(0,o)),e}function l(t,e){var n=e.length<0?0:0|y(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(e,n,r,i){if(n.byteLength,r<0||n.byteLength<r)throw new RangeError("'offset' is out of bounds");if(n.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");return n=void 0===r&&void 0===i?new Uint8Array(n):void 0===i?new Uint8Array(n,r):new Uint8Array(n,r,i),t.TYPED_ARRAY_SUPPORT?(e=n,e.__proto__=t.prototype):e=l(e,n),e}function d(e,n){if(t.isBuffer(n)){var r=0|y(n.length);return e=s(e,r),0===e.length?e:(n.copy(e,0,0,r),e)}if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||J(n.length)?s(e,0):l(e,n);if("Buffer"===n.type&&$(n.data))return l(e,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function g(e){return+e!=e&&(e=0),t.alloc(+e)}function _(e,n){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(e).length;default:if(i)return H(e).length;n=(""+n).toLowerCase(),i=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return D(this,e,n);case"utf8":case"utf-8":return N(this,e,n);case"ascii":return L(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return R(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function w(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(e,n,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof n&&(n=t.from(n,i)),t.isBuffer(n))return 0===n.length?-1:S(e,n,r,i,o);if("number"==typeof n)return n&=255,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):S(e,[n],r,i,o);throw new TypeError("val must be string, number or Buffer")}function S(t,e,n,r,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,c=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,n/=2}var u;if(i){var f=-1;for(u=n;u<a;u++)if(o(t,u)===o(e,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===c)return f*s}else f!==-1&&(u-=u-f),f=-1}else for(n+c>a&&(n=a-c),u=n;u>=0;u--){for(var h=!0,l=0;l<c;l++)if(o(t,u+l)!==o(e,l)){h=!1;break}if(h)return u}return-1}function E(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function b(t,e,n,r){return K(H(e,t.length-n),t,n,r)}function k(t,e,n,r){return K(V(e),t,n,r)}function I(t,e,n,r){return k(t,e,n,r)}function O(t,e,n,r){return K(X(e),t,n,r)}function F(t,e,n,r){return K(Z(e,t.length-n),t,n,r)}function R(t,e,n){return 0===e&&n===t.length?G.fromByteArray(t):G.fromByteArray(t.slice(e,n))}function N(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var c,u,f,h;switch(a){case 1:o<128&&(s=o);break;case 2:c=t[i+1],128===(192&c)&&(h=(31&o)<<6|63&c,h>127&&(s=h));break;case 3:c=t[i+1],u=t[i+2],128===(192&c)&&128===(192&u)&&(h=(15&o)<<12|(63&c)<<6|63&u,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:c=t[i+1],u=t[i+2],f=t[i+3],128===(192&c)&&128===(192&u)&&128===(192&f)&&(h=(15&o)<<18|(63&c)<<12|(63&u)<<6|63&f,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return T(r)}function T(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=tt));return n}function L(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function A(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function D(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=W(t[o]);return i}function x(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function C(e,n,r,i,o,s){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>o||n<s)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function U(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function j(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(t,e,n,r,i){return i||j(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,n,r,23,4),n+4}function z(t,e,n,r,i){return i||j(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,n,r,52,8),n+8}function Y(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function W(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],s=0;s<r;++s){if(n=t.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function Z(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function X(t){return G.toByteArray(Y(t))}function K(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function J(t){return t!==t}var G=n(20),Q=n(23),$=n(14);e.Buffer=t,e.SlowBuffer=g,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=o(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,n){return a(null,t,e,n)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,n){return u(null,t,e,n)},t.allocUnsafe=function(t){return f(null,t)},t.allocUnsafeSlow=function(t){return f(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,n){if(!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var r=e.length,i=n.length,o=0,s=Math.min(r,i);o<s;++o)if(e[o]!==n[o]){r=e[o],i=n[o];break}return r<i?-1:i<r?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,n){if(!$(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return t.alloc(0);var r;if(void 0===n)for(n=0,r=0;r<e.length;++r)n+=e[r].length;var i=t.allocUnsafe(n),o=0;for(r=0;r<e.length;++r){var s=e[r];if(!t.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i},t.byteLength=_,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)w(this,e,e+1);return this},t.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)w(this,e,e+3),w(this,e+1,e+2);return this},t.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)w(this,e,e+7),w(this,e+1,e+6),w(this,e+2,e+5),w(this,e+3,e+4);return this},t.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?N(this,0,t):v.apply(this,arguments)},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},t.prototype.compare=function(e,n,r,i,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),n<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=r)return 0;if(i>=o)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,a=r-n,c=Math.min(s,a),u=this.slice(i,o),f=e.slice(n,r),h=0;h<c;++h)if(u[h]!==f[h]){s=u[h],a=f[h];break}return s<a?-1:a<s?1:0},t.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1},t.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},t.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},t.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return E(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return k(this,t,e,n);case"latin1":case"binary":return I(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,n){var r=this.length;e=~~e,n=void 0===n?r:~~n,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<e&&(n=e);var i;if(t.TYPED_ARRAY_SUPPORT)i=this.subarray(e,n),i.__proto__=t.prototype;else{var o=n-e;i=new t(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i},t.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},t.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},t.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},t.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),Q.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),Q.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),Q.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),Q.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;C(this,t,e,n,i,0)}var o=1,s=0;for(this[e]=255&t;++s<n&&(o*=256);)this[e+s]=t/o&255;return e+n},t.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;C(this,t,e,n,i,0)}var o=n-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+n},t.prototype.writeUInt8=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=255&e,n+1},t.prototype.writeUInt16LE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):U(this,e,n,!0),n+2},t.prototype.writeUInt16BE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):U(this,e,n,!1),n+2},t.prototype.writeUInt32LE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e):M(this,e,n,!0),n+4},t.prototype.writeUInt32BE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):M(this,e,n,!1),n+4},t.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},t.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},t.prototype.writeInt8=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[n]=255&e,n+1},t.prototype.writeInt16LE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):U(this,e,n,!0),n+2},t.prototype.writeInt16BE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):U(this,e,n,!1),n+2},t.prototype.writeInt32LE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):M(this,e,n,!0),n+4},t.prototype.writeInt32BE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):M(this,e,n,!1),n+4},t.prototype.writeFloatLE=function(t,e,n){return B(this,t,e,!0,n)},t.prototype.writeFloatBE=function(t,e,n){return B(this,t,e,!1,n)},t.prototype.writeDoubleLE=function(t,e,n){return z(this,t,e,!0,n)},t.prototype.writeDoubleBE=function(t,e,n){return z(this,t,e,!1,n)},t.prototype.copy=function(e,n,r,i){if(r||(r=0),i||0===i||(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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),e.length-n<i-r&&(i=e.length-n+r);var o,s=i-r;if(this===e&&r<n&&n<i)for(o=s-1;o>=0;--o)e[o+n]=this[o+r];else if(s<1e3||!t.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+n]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),n);return s},t.prototype.fill=function(e,n,r,i){if("string"==typeof e){if("string"==typeof n?(i=n,n=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=n;s<r;++s)this[s]=e;else{var a=t.isBuffer(e)?e:H(new t(e,i).toString()),c=a.length;for(s=0;s<r-n;++s)this[s+n]=a[s%c]}return this};var et=/[^+\/0-9A-Za-z-_]/g}).call(e,n(5),function(){return this}())},function(t,e,n){(function(e,r){"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){O(e,t)}}function o(t){return D.from(t)}function s(t){return D.isBuffer(t)||t instanceof x}function a(){}function c(t,e){R=R||n(1),t=t||{},this.objectMode=!!t.objectMode,e instanceof R&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,o=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=t.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){_(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function u(t){return R=R||n(1),C.call(u,this)||this instanceof R?(this._writableState=new c(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),void A.call(this)):new u(t)}function f(t,e){var n=new Error("write after end");t.emit("error",n),F(e,n)}function h(t,e,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),F(r,o),i=!1),i}function l(t,e,n){return t.objectMode||t.decodeStrings===!1||"string"!=typeof e||(e=D.from(e,n)),e}function p(t,e,n,r,i,o){if(!n){var s=l(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else d(t,e,!1,a,r,i,o);return c}function d(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function y(t,e,n,r,i){--e.pendingcb,n?(F(i,r),F(k,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),k(t,e))}function g(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function _(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(g(n),e)y(t,n,r,e,i);else{var o=S(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||m(t,n),r?N(v,t,n,o,i):v(t,n,o,i)}}function v(t,e,n,r){n||w(t,e),e.pendingcb--,r(),k(t,e)}function w(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function m(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,o=new Array(r),s=e.corkedRequestsFree;s.entry=n;for(var a=0,c=!0;n;)o[a]=n,n.isBuf||(c=!1),n=n.next,a+=1;o.allBuffers=c,d(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e)}else{for(;n;){var u=n.chunk,f=n.encoding,h=n.callback,l=e.objectMode?1:u.length;if(d(t,e,!1,l,u,f,h),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function b(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,F(E,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function k(t,e){var n=S(e);return n&&(b(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}function I(t,e,n){e.ending=!0,k(t,e),n&&(e.finished?F(n):t.once("finish",n)),e.ended=!0,t.writable=!1}function O(t,e,n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}var F=n(8);t.exports=u;var R,N=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?setImmediate:F;u.WritableState=c;var T=n(4);T.inherits=n(2);var L={deprecate:n(42)},A=n(18),D=n(9).Buffer,x=r.Uint8Array||function(){},P=n(17);T.inherits(u,A),c.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(c.prototype,"buffer",{get:L.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}();var C;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(C=Function.prototype[Symbol.hasInstance],Object.defineProperty(u,Symbol.hasInstance,{value:function(t){return!!C.call(this,t)||t&&t._writableState instanceof c}})):C=function(t){return t instanceof this},u.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},u.prototype.write=function(t,e,n){var r=this._writableState,i=!1,c=s(t)&&!r.objectMode;return c&&!D.isBuffer(t)&&(t=o(t)),"function"==typeof e&&(n=e,e=null),c?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=a),r.ended?f(this,n):(c||h(this,r,t,n))&&(r.pendingcb++,i=p(this,r,c,t,e,n)),i},u.prototype.cork=function(){var t=this._writableState;t.corked++},u.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||m(this,t))},u.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},u.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},u.prototype._writev=null,u.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||I(this,r,n)},Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),u.prototype.destroy=P.destroy,u.prototype._undestroy=P.undestroy,u.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,n(3),function(){return this}())},function(t,e,n){e=t.exports=n(15),e.Stream=e,e.Readable=e,e.Writable=n(11),e.Duplex=n(1),e.Transform=n(16),e.PassThrough=n(36)},function(t,e,n){(function(e){"use strict";function n(t){var e=r.exec(t);return e.shift(),e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(){function t(){}return t.normalize=function(e){""===e&&(e=".");var n=e.charAt(0)===t.sep;e=t._removeDuplicateSeps(e);for(var r=e.split(t.sep),i=[],o=0;o<r.length;o++){var s=r[o];"."!==s&&(".."===s&&(n||!n&&i.length>0&&".."!==i[0])?i.pop():i.push(s))}if(!n&&i.length<2)switch(i.length){case 1:""===i[0]&&i.unshift(".");break;default:i.push(".")}return e=i.join(t.sep),n&&e.charAt(0)!==t.sep&&(e=t.sep+e),e},t.join=function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];for(var r=[],i=0;i<e.length;i++){var o=e[i];if("string"!=typeof o)throw new TypeError("Invalid argument type to path.join: "+typeof o);""!==o&&r.push(o)}return t.normalize(r.join(t.sep))},t.resolve=function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];for(var i=[],o=0;o<n.length;o++){var s=n[o];if("string"!=typeof s)throw new TypeError("Invalid argument type to path.join: "+typeof s);""!==s&&(s.charAt(0)===t.sep&&(i=[]),i.push(s))}var a=t.normalize(i.join(t.sep));if(a.length>1&&a.charAt(a.length-1)===t.sep)return a.substr(0,a.length-1);if(a.charAt(0)!==t.sep){"."!==a.charAt(0)||1!==a.length&&a.charAt(1)!==t.sep||(a=1===a.length?"":a.substr(2));var c=e.cwd();a=""!==a?this.normalize(c+("/"!==c?t.sep:"")+a):c}return a},t.relative=function(e,n){var r;e=t.resolve(e),n=t.resolve(n);var i=e.split(t.sep),o=n.split(t.sep);o.shift(),i.shift();var s=0,a=[];for(r=0;r<i.length;r++){var c=i[r];if(c!==o[r]){s=i.length-r;break}}a=o.slice(r),1===i.length&&""===i[0]&&(s=0),s>i.length&&(s=i.length);var u="";for(r=0;r<s;r++)u+="../";return u+=a.join(t.sep),u.length>1&&u.charAt(u.length-1)===t.sep&&(u=u.substr(0,u.length-1)),u},t.dirname=function(e){e=t._removeDuplicateSeps(e);var n=e.charAt(0)===t.sep,r=e.split(t.sep);return""===r.pop()&&r.length>0&&r.pop(),r.length>1||1===r.length&&!n?r.join(t.sep):n?t.sep:"."},t.basename=function(e,n){if(void 0===n&&(n=""),""===e)return e;e=t.normalize(e);var r=e.split(t.sep),i=r[r.length-1];if(""===i&&r.length>1)return r[r.length-2];if(n.length>0){var o=i.substr(i.length-n.length);if(o===n)return i.substr(0,i.length-n.length)}return i},t.extname=function(e){e=t.normalize(e);var n=e.split(t.sep);if(e=n.pop(),""===e&&n.length>0&&(e=n.pop()),".."===e)return"";var r=e.lastIndexOf(".");return r===-1||0===r?"":e.substr(r)},t.isAbsolute=function(e){return e.length>0&&e.charAt(0)===t.sep},t._makeLong=function(t){return t},t.parse=function(t){var e=n(t);return{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}},t.format=function(e){if(null===e||"object"!=typeof e)throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var n=e.root||"";if("string"!=typeof n)throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);var r=e.dir?e.dir+t.sep:"",i=e.base||"";return r+i},t._removeDuplicateSeps=function(t){return t=t.replace(this._replaceRegex,this.sep)},t.sep="/",t._replaceRegex=new RegExp("//+","g"),t.delimiter=":",t.posix=t,t.win32=t,t}();t.exports=i}).call(e,n(3))},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(e,r){"use strict";function i(t){return U.from(t)}function o(t){return U.isBuffer(t)||t instanceof M}function s(t,e,n){return"function"==typeof t.prependListener?t.prependListener(e,n):void(t._events&&t._events[e]?x(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n))}function a(t,e){D=D||n(1),t=t||{},this.objectMode=!!t.objectMode,e instanceof D&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new q,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Y||(Y=n(19).StringDecoder),this.decoder=new Y(t.encoding),this.encoding=t.encoding)}function c(t){return D=D||n(1),this instanceof c?(this._readableState=new a(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),void C.call(this)):new c(t)}function u(t,e,n,r,o){var s=t._readableState;if(null===e)s.reading=!1,y(t,s);else{var a;o||(a=h(s,e)),a?t.emit("error",a):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===U.prototype||(e=i(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):f(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?f(t,s,e,!1):v(t,s)):f(t,s,e,!1))):r||(s.reading=!1)}return l(s)}function f(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),
13
t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&g(t)),v(t,e)}function h(t,e){var n;return o(e)||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function l(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}function p(t){return t>=V?t=V:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function d(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=p(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function y(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,g(t)}}function g(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(z("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?A(_,t):_(t))}function _(t){z("emit readable"),t.emit("readable"),k(t)}function v(t,e){e.readingMore||(e.readingMore=!0,A(w,t,e))}function w(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(z("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function m(t){return function(){var e=t._readableState;z("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&P(t,"data")&&(e.flowing=!0,k(t))}}function S(t){z("readable nexttick read 0"),t.read(0)}function E(t,e){e.resumeScheduled||(e.resumeScheduled=!0,A(b,t,e))}function b(t,e){e.reading||(z("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),k(t),e.flowing&&!e.reading&&t.read(0)}function k(t){var e=t._readableState;for(z("flow",e.flowing);e.flowing&&null!==t.read(););}function I(t,e){if(0===e.length)return null;var n;return e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=O(t,e.buffer,e.decoder),n}function O(t,e,n){var r;return t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?F(t,e):R(t,e),r}function F(t,e){var n=e.head,r=1,i=n.data;for(t-=i.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(i+=s===o.length?o:o.slice(0,t),t-=s,0===t){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}function R(t,e){var n=U.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),t-=s,0===t){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}function N(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,A(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function L(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}var A=n(8);t.exports=c;var D,x=n(14);c.ReadableState=a;var P=(n(6).EventEmitter,function(t,e){return t.listeners(e).length}),C=n(18),U=n(9).Buffer,M=e.Uint8Array||function(){},j=n(4);j.inherits=n(2);var B=n(44),z=void 0;z=B&&B.debuglog?B.debuglog("stream"):function(){};var Y,q=n(37),W=n(17);j.inherits(c,C);var H=["error","close","destroy","pause","resume"];Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),c.prototype.destroy=W.destroy,c.prototype._undestroy=W.undestroy,c.prototype._destroy=function(t,e){this.push(null),e(t)},c.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=U.from(t,e),e=""),n=!0),u(this,t,e,!1,n)},c.prototype.unshift=function(t){return u(this,t,null,!0,!1)},c.prototype.isPaused=function(){return this._readableState.flowing===!1},c.prototype.setEncoding=function(t){return Y||(Y=n(19).StringDecoder),this._readableState.decoder=new Y(t),this._readableState.encoding=t,this};var V=8388608;c.prototype.read=function(t){z("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return z("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?N(this):g(this),null;if(t=d(t,e),0===t&&e.ended)return 0===e.length&&N(this),null;var r=e.needReadable;z("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&(r=!0,z("length less than watermark",r)),e.ended||e.reading?(r=!1,z("reading or ended",r)):r&&(z("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=d(n,e)));var i;return i=t>0?I(t,e):null,null===i?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&N(this)),null!==i&&this.emit("data",i),i},c.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},c.prototype.pipe=function(t,e){function n(t,e){z("onunpipe"),t===l&&e&&e.hasUnpiped===!1&&(e.hasUnpiped=!0,o())}function i(){z("onend"),t.end()}function o(){z("cleanup"),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("drain",g),t.removeListener("error",c),t.removeListener("unpipe",n),l.removeListener("end",i),l.removeListener("end",h),l.removeListener("data",a),_=!0,!p.awaitDrain||t._writableState&&!t._writableState.needDrain||g()}function a(e){z("ondata"),v=!1;var n=t.write(e);!1!==n||v||((1===p.pipesCount&&p.pipes===t||p.pipesCount>1&&L(p.pipes,t)!==-1)&&!_&&(z("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++,v=!0),l.pause())}function c(e){z("onerror",e),h(),t.removeListener("error",c),0===P(t,"error")&&t.emit("error",e)}function u(){t.removeListener("finish",f),h()}function f(){z("onfinish"),t.removeListener("close",u),h()}function h(){z("unpipe"),l.unpipe(t)}var l=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=t;break;case 1:p.pipes=[p.pipes,t];break;default:p.pipes.push(t)}p.pipesCount+=1,z("pipe count=%d opts=%j",p.pipesCount,e);var d=(!e||e.end!==!1)&&t!==r.stdout&&t!==r.stderr,y=d?i:h;p.endEmitted?A(y):l.once("end",y),t.on("unpipe",n);var g=m(l);t.on("drain",g);var _=!1,v=!1;return l.on("data",a),s(t,"error",c),t.once("close",u),t.once("finish",f),t.emit("pipe",l),p.flowing||(z("pipe resume"),l.resume()),t},c.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var s=L(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},c.prototype.on=function(t,e){var n=C.prototype.on.call(this,t,e);if("data"===t)this._readableState.flowing!==!1&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&g(this):A(S,this))}return n},c.prototype.addListener=c.prototype.on,c.prototype.resume=function(){var t=this._readableState;return t.flowing||(z("resume"),t.flowing=!0,E(this,t)),this},c.prototype.pause=function(){return z("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(z("pause"),this._readableState.flowing=!1,this.emit("pause")),this},c.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;t.on("end",function(){if(z("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)}),t.on("data",function(i){if(z("wrapped data"),e.decoder&&(i=e.decoder.write(i)),(!e.objectMode||null!==i&&void 0!==i)&&(e.objectMode||i&&i.length)){var o=r.push(i);o||(n=!0,t.pause())}});for(var i in t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<H.length;o++)t.on(H[o],r.emit.bind(r,H[o]));return r._read=function(e){z("wrapped _read",e),n&&(n=!1,t.resume())},r},c._fromList=I}).call(e,function(){return this}(),n(3))},function(t,e,n){"use strict";function r(t){this.afterTransform=function(e,n){return i(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&t.push(n),i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}function o(t){if(!(this instanceof o))return new o(t);a.call(this,t),this._transformState=new r(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(t,n){s(e,t,n)}):s(e)})}function s(t,e,n){if(e)return t.emit("error",e);null!==n&&void 0!==n&&t.push(n);var r=t._writableState,i=t._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}t.exports=o;var a=n(1),c=n(4);c.inherits=n(2),c.inherits(o,a),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var n=this;a.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){"use strict";function r(t,e){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?void(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||s(o,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),void this._destroy(t||null,function(t){!e&&t?(s(o,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}))}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(t,e){t.emit("error",e)}var s=n(8);t.exports={destroy:r,undestroy:i}},function(t,e,n){t.exports=n(6).EventEmitter},function(t,e,n){"use strict";function r(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function i(t){var e=r(t);if("string"!=typeof e&&(v.isEncoding===w||!w(t)))throw new Error("Unknown encoding: "+t);return e||t}function o(t){this.encoding=i(t);var e;switch(this.encoding){case"utf16le":this.text=l,this.end=p,e=4;break;case"utf8":this.fillLast=u,e=4;break;case"base64":this.text=d,this.end=y,e=3;break;default:return this.write=g,void(this.end=_)}this.lastNeed=0,this.lastTotal=0,this.lastChar=v.allocUnsafe(e)}function s(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:-1}function a(t,e,n){var r=e.length-1;if(r<n)return 0;var i=s(e[r]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--r<n?0:(i=s(e[r]),i>=0?(i>0&&(t.lastNeed=i-2),i):--r<n?0:(i=s(e[r]),i>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0))}function c(t,e,n){if(128!==(192&e[0]))return t.lastNeed=0,"�".repeat(n);if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"�".repeat(n+1);if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"�".repeat(n+2)}}function u(t){var e=this.lastTotal-this.lastNeed,n=c(this,t,e);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function f(t,e){var n=a(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�".repeat(this.lastTotal-this.lastNeed):e}function l(t,e){if((t.length-e)%2===0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function p(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function d(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function y(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function g(t){return t.toString(this.encoding)}function _(t){return t&&t.length?this.write(t):""}var v=n(9).Buffer,w=v.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(e=this.fillLast(t),void 0===e)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=h,o.prototype.text=f,o.prototype.fillLast=function(t){return this.lastNeed<=t.length?(t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),void(this.lastNeed-=t.length))}},function(t,e){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-n(t)}function i(t){var e,r,i,o,s,a=t.length;o=n(t),s=new f(3*a/4-o),r=o>0?a-4:a;var c=0;for(e=0;e<r;e+=4)i=u[t.charCodeAt(e)]<<18|u[t.charCodeAt(e+1)]<<12|u[t.charCodeAt(e+2)]<<6|u[t.charCodeAt(e+3)],s[c++]=i>>16&255,s[c++]=i>>8&255,s[c++]=255&i;return 2===o?(i=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,s[c++]=255&i):1===o&&(i=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,s[c++]=i>>8&255,s[c++]=255&i),s}function o(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function s(t,e,n){for(var r,i=[],s=e;s<n;s+=3)r=(t[s]<<16)+(t[s+1]<<8)+t[s+2],i.push(o(r));return i.join("")}function a(t){for(var e,n=t.length,r=n%3,i="",o=[],a=16383,u=0,f=n-r;u<f;u+=a)o.push(s(t,u,u+a>f?f:u+a));return 1===r?(e=t[n-1],i+=c[e>>2],i+=c[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=c[e>>10],i+=c[e>>4&63],i+=c[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=r,e.toByteArray=i,e.fromByteArray=a;for(var c=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=h.length;l<p;++l)c[l]=h[l],u[h.charCodeAt(l)]=l;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},function(t,e,n){(function(e){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(6),o=null,s=function(){function t(t,e){this.fun=t,this.array=e}return t.prototype.run=function(){this.fun.apply(null,this.array)},t}(),a=function(){function t(){this._queue=[],this._draining=!1,this._currentQueue=null,this._queueIndex=-1}return t.prototype.push=function(t){var e=this;1!==this._queue.push(t)||this._draining||setTimeout(function(){return e._drainQueue()},0)},t.prototype._cleanUpNextTick=function(){this._draining=!1,this._currentQueue&&this._currentQueue.length?this._queue=this._currentQueue.concat(this._queue):this._queueIndex=-1,this._queue.length&&this._drainQueue()},t.prototype._drainQueue=function(){var t=this;if(!this._draining){var e=setTimeout(function(){return t._cleanUpNextTick()});this._draining=!0;for(var n=this._queue.length;n;){for(this._currentQueue=this._queue,this._queue=[];++this._queueIndex<n;)this._currentQueue&&this._currentQueue[this._queueIndex].run();this._queueIndex=-1,n=this._queue.length}this._currentQueue=null,this._draining=!1,clearTimeout(e)}},t}(),c=function(t){function i(){t.apply(this,arguments),this.startTime=Date.now(),this._cwd="/",this.platform="browser",this.argv=[],this.execArgv=[],this.stdout=null,this.stderr=null,this.stdin=null,this.domain=null,this._queue=new a,this.execPath=e,this.env={},this.exitCode=0,this._gid=1,this._uid=1,this.version="v5.0",this.versions={http_parser:"0.0",node:"5.0",v8:"0.0",uv:"0.0",zlib:"0.0",ares:"0.0",icu:"0.0",modules:"0",openssl:"0.0"},this.config={target_defaults:{cflags:[],default_configuration:"Release",defines:[],include_dirs:[],libraries:[]},variables:{clang:0,host_arch:"x32",node_install_npm:!1,node_install_waf:!1,node_prefix:"",node_shared_cares:!1,node_shared_http_parser:!1,node_shared_libuv:!1,node_shared_zlib:!1,node_shared_v8:!1,node_use_dtrace:!1,node_use_etw:!1,node_use_openssl:!1,node_shared_openssl:!1,strict_aliasing:!1,target_arch:"x32",v8_use_snapshot:!1,v8_no_strict_aliasing:0,visibility:""}},this.pid=1e3*Math.random()|0,this.title="node",this.arch="x32",this._mask=18,this.connected=void 0}return r(i,t),i.prototype.chdir=function(t){null===o&&(o=n(13)),this._cwd=o.resolve(t)},i.prototype.cwd=function(){return this._cwd},i.prototype.uptime=function(){return(Date.now()-this.startTime)/1e3|0},i.prototype.nextTick=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this._queue.push(new s(t,e))},i.prototype.abort=function(){this.emit("abort")},i.prototype.exit=function(t){this.exitCode=t,this.emit("exit",[t])},i.prototype.getgid=function(){return this._gid},i.prototype.setgid=function(t){"number"==typeof t?this._gid=t:this._gid=1},i.prototype.getuid=function(){return this._uid},i.prototype.setuid=function(t){"number"==typeof t?this._uid=t:this._uid=1},i.prototype.kill=function(t,e){this.emit("kill",[t,e])},i.prototype.memoryUsage=function(){return{rss:0,heapTotal:0,heapUsed:0}},i.prototype.umask=function(t){void 0===t&&(t=this._mask);var e=this._mask;return this._mask=t,this.emit("umask",[t]),e},i.prototype.hrtime=function(){var t;t="undefined"!=typeof performance?performance.now():Date.now?Date.now():(new Date).getTime();var e=t/1e3|0;return t-=1e3*e,t=1e6*t|0,[e,t]},i.prototype.initializeTTYs=function(){if(null===this.stdout){var t=n(22);this.stdout=new t,this.stderr=new t,this.stdin=new t}},i.prototype.disconnect=function(){},i}(i.EventEmitter);t.exports=c}).call(e,"/")},function(t,e,n){(function(e){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(41),o=function(t){function n(){t.call(this),this.isRaw=!1,this.columns=80,this.rows=120,this.isTTY=!0,this._bufferedWrites=[],this._waitingForWrites=!1}return r(n,t),n.prototype.setRawMode=function(t){this.isRaw!==t&&(this.isRaw=t,this.emit("modeChange"))},n.prototype.changeColumns=function(t){t!==this.columns&&(this.columns=t,this.emit("resize"))},n.prototype.changeRows=function(t){t!==this.rows&&(this.rows=t,this.emit("resize"))},n.isatty=function(t){return t&&t instanceof n},n.prototype._write=function(t,n,r){var i;try{var o;o="string"==typeof t?new e(t,n):t,this._bufferedWrites.push(o),this._waitingForWrites&&this._read(1024)}catch(t){i=t}finally{r(i)}},n.prototype._read=function(t){if(0===this._bufferedWrites.length)this._waitingForWrites=!0;else for(;this._bufferedWrites.length>0&&(this._waitingForWrites=this.push(this._bufferedWrites.shift()),this._waitingForWrites););},n}(i.Duplex);t.exports=o}).call(e,n(5))},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,f=-7,h=n?i-1:0,l=n?-1:1,p=t[e+h];for(h+=l,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+h],h+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[e+h],h+=l,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:(p?-1:1)*(1/0);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-1,h=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),e+=s+h>=1?l/c:l*Math.pow(2,1-h),e*c>=2&&(s++,c/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+p]=255&s,p+=d,s/=256,u-=8);t[n+p-d]|=128*y}},function(t,e,n){"use strict";function r(t){if(!(this instanceof r))return new r(t);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var n=s.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw new Error(f[n]);this.header=new l,s.inflateGetHeader(this.strm,this.header)}function i(t,e){var n=new r(e);if(n.push(t,!0),n.err)throw n.msg||f[n.err];return n.result}function o(t,e){return e=e||{},e.raw=!0,i(t,e)}var s=n(31),a=n(7),c=n(25),u=n(27),f=n(33),h=n(34),l=n(29),p=Object.prototype.toString;r.prototype.push=function(t,e){var n,r,i,o,f,h,l=this.strm,d=this.options.chunkSize,y=this.options.dictionary,g=!1;if(this.ended)return!1;r=e===~~e?e:e===!0?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof t?l.input=c.binstring2buf(t):"[object ArrayBuffer]"===p.call(t)?l.input=new Uint8Array(t):l.input=t,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new a.Buf8(d),l.next_out=0,l.avail_out=d),n=s.inflate(l,u.Z_NO_FLUSH),n===u.Z_NEED_DICT&&y&&(h="string"==typeof y?c.string2buf(y):"[object ArrayBuffer]"===p.call(y)?new Uint8Array(y):y,n=s.inflateSetDictionary(this.strm,h)),n===u.Z_BUF_ERROR&&g===!0&&(n=u.Z_OK,g=!1),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&n!==u.Z_STREAM_END&&(0!==l.avail_in||r!==u.Z_FINISH&&r!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(i=c.utf8border(l.output,l.next_out),o=l.next_out-i,f=c.buf2string(l.output,i),l.next_out=o,l.avail_out=d-o,o&&a.arraySet(l.output,l.output,i,o,0),this.onData(f)):this.onData(a.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(g=!0)}while((l.avail_in>0||0===l.avail_out)&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(r=u.Z_FINISH),r===u.Z_FINISH?(n=s.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):r!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),l.avail_out=0,!0)},r.prototype.onData=function(t){this.chunks.push(t)},r.prototype.onEnd=function(t){t===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=r,e.inflate=i,e.inflateRaw=o,e.ungzip=i},function(t,e,n){"use strict";function r(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n}var i=n(7),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var a=new i.Buf8(256),c=0;c<256;c++)a[c]=c>=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;a[254]=a[254]=1,e.string2buf=function(t){var e,n,r,o,s,a=t.length,c=0;for(o=0;o<a;o++)n=t.charCodeAt(o),55296===(64512&n)&&o+1<a&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),c+=n<128?1:n<2048?2:n<65536?3:4;for(e=new i.Buf8(c),s=0,o=0;s<c;o++)n=t.charCodeAt(o),55296===(64512&n)&&o+1<a&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},e.buf2binstring=function(t){return r(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},e.buf2string=function(t,e){var n,i,o,s,c=e||t.length,u=new Array(2*c);for(i=0,n=0;n<c;)if(o=t[n++],o<128)u[i++]=o;else if(s=a[o],s>4)u[i++]=65533,n+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&n<c;)o=o<<6|63&t[n++],s--;s>1?u[i++]=65533:o<65536?u[i++]=o:(o-=65536,u[i++]=55296|o>>10&1023,u[i++]=56320|1023&o)}return r(u,i)},e.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return n<0?e:0===n?e:n+a[t[n]]>e?n:e}},function(t,e){"use strict";function n(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){s=n>2e3?2e3:n,n-=s;do i=i+e[r++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}t.exports=n},function(t,e){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e){"use strict";function n(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function r(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a<s;a++)t=t>>>8^o[255&(t^e[a])];return t^-1}var i=n();t.exports=r},function(t,e){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=n},function(t,e){"use strict";var n=30,r=12;t.exports=function(t,e){var i,o,s,a,c,u,f,h,l,p,d,y,g,_,v,w,m,S,E,b,k,I,O,F,R;i=t.state,o=t.next_in,F=t.input,s=o+(t.avail_in-5),a=t.next_out,R=t.output,c=a-(e-t.avail_out),u=a+(t.avail_out-257),f=i.dmax,h=i.wsize,l=i.whave,p=i.wnext,d=i.window,y=i.hold,g=i.bits,_=i.lencode,v=i.distcode,w=(1<<i.lenbits)-1,m=(1<<i.distbits)-1;t:do{g<15&&(y+=F[o++]<<g,g+=8,y+=F[o++]<<g,g+=8),S=_[y&w];e:for(;;){if(E=S>>>24,y>>>=E,g-=E,E=S>>>16&255,0===E)R[a++]=65535&S;else{if(!(16&E)){if(0===(64&E)){S=_[(65535&S)+(y&(1<<E)-1)];continue e}if(32&E){i.mode=r;break t}t.msg="invalid literal/length code",i.mode=n;break t}b=65535&S,E&=15,E&&(g<E&&(y+=F[o++]<<g,g+=8),b+=y&(1<<E)-1,y>>>=E,g-=E),g<15&&(y+=F[o++]<<g,g+=8,y+=F[o++]<<g,g+=8),S=v[y&m];n:for(;;){if(E=S>>>24,y>>>=E,g-=E,E=S>>>16&255,!(16&E)){if(0===(64&E)){S=v[(65535&S)+(y&(1<<E)-1)];continue n}t.msg="invalid distance code",i.mode=n;break t}if(k=65535&S,E&=15,g<E&&(y+=F[o++]<<g,g+=8,g<E&&(y+=F[o++]<<g,g+=8)),k+=y&(1<<E)-1,k>f){t.msg="invalid distance too far back",i.mode=n;break t}if(y>>>=E,g-=E,E=a-c,k>E){if(E=k-E,E>l&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(I=0,O=d,0===p){if(I+=h-E,E<b){b-=E;do R[a++]=d[I++];while(--E);I=a-k,O=R}}else if(p<E){if(I+=h+p-E,E-=p,E<b){b-=E;do R[a++]=d[I++];while(--E);if(I=0,p<b){E=p,b-=E;do R[a++]=d[I++];while(--E);I=a-k,O=R}}}else if(I+=p-E,E<b){b-=E;do R[a++]=d[I++];while(--E);I=a-k,O=R}for(;b>2;)R[a++]=O[I++],R[a++]=O[I++],R[a++]=O[I++],b-=3;b&&(R[a++]=O[I++],b>1&&(R[a++]=O[I++]))}else{I=a-k;do R[a++]=R[I++],R[a++]=R[I++],R[a++]=R[I++],b-=3;while(b>2);b&&(R[a++]=R[I++],b>1&&(R[a++]=R[I++]))}break}}break}}while(o<s&&a<u);b=g>>3,o-=b,g-=b<<3,y&=(1<<g)-1,t.next_in=o,t.next_out=a,t.avail_in=o<s?5+(s-o):5-(o-s),t.avail_out=a<u?257+(u-a):257-(a-u),i.hold=y,i.bits=g}},function(t,e,n){"use strict";function r(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new v.Buf16(320),this.work=new v.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=U,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new v.Buf32(yt),e.distcode=e.distdyn=new v.Buf32(gt),e.sane=1,e.back=-1,N):A}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):A}function a(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?A:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,s(t))):A}function c(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=a(t,e),n!==N&&(t.state=null),n):A}function u(t){return c(t,vt)}function f(t){if(wt){var e;for(g=new v.Buf32(512),_=new v.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(E(k,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;E(I,t.lens,0,32,_,0,t.work,{bits:5}),wt=!1}t.lencode=g,t.lenbits=9,t.distcode=_,t.distbits=5}function h(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new v.Buf8(o.wsize)),r>=o.wsize?(v.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),v.arraySet(o.window,e,n-r,i,o.wnext),r-=i,r?(v.arraySet(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function l(t,e){var n,i,o,s,a,c,u,l,p,d,y,g,_,yt,gt,_t,vt,wt,mt,St,Et,bt,kt,It,Ot=0,Ft=new v.Buf8(4),Rt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return A;n=t.state,n.mode===X&&(n.mode=K),a=t.next_out,o=t.output,u=t.avail_out,s=t.next_in,i=t.input,c=t.avail_in,l=n.hold,p=n.bits,d=c,y=u,bt=N;t:for(;;)switch(n.mode){case U:if(0===n.wrap){n.mode=K;break}for(;p<16;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(2&n.wrap&&35615===l){n.check=0,Ft[0]=255&l,Ft[1]=l>>>8&255,n.check=m(n.check,Ft,2,0),l=0,p=0,n.mode=M;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",n.mode=lt;break}if((15&l)!==C){t.msg="unknown compression method",
14
n.mode=lt;break}if(l>>>=4,p-=4,Et=(15&l)+8,0===n.wbits)n.wbits=Et;else if(Et>n.wbits){t.msg="invalid window size",n.mode=lt;break}n.dmax=1<<Et,t.adler=n.check=1,n.mode=512&l?V:X,l=0,p=0;break;case M:for(;p<16;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(n.flags=l,(255&n.flags)!==C){t.msg="unknown compression method",n.mode=lt;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=lt;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&(Ft[0]=255&l,Ft[1]=l>>>8&255,n.check=m(n.check,Ft,2,0)),l=0,p=0,n.mode=j;case j:for(;p<32;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}n.head&&(n.head.time=l),512&n.flags&&(Ft[0]=255&l,Ft[1]=l>>>8&255,Ft[2]=l>>>16&255,Ft[3]=l>>>24&255,n.check=m(n.check,Ft,4,0)),l=0,p=0,n.mode=B;case B:for(;p<16;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&(Ft[0]=255&l,Ft[1]=l>>>8&255,n.check=m(n.check,Ft,2,0)),l=0,p=0,n.mode=z;case z:if(1024&n.flags){for(;p<16;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&(Ft[0]=255&l,Ft[1]=l>>>8&255,n.check=m(n.check,Ft,2,0)),l=0,p=0}else n.head&&(n.head.extra=null);n.mode=Y;case Y:if(1024&n.flags&&(g=n.length,g>c&&(g=c),g&&(n.head&&(Et=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),v.arraySet(n.head.extra,i,s,g,Et)),512&n.flags&&(n.check=m(n.check,i,g,s)),c-=g,s+=g,n.length-=g),n.length))break t;n.length=0,n.mode=q;case q:if(2048&n.flags){if(0===c)break t;g=0;do Et=i[s+g++],n.head&&Et&&n.length<65536&&(n.head.name+=String.fromCharCode(Et));while(Et&&g<c);if(512&n.flags&&(n.check=m(n.check,i,g,s)),c-=g,s+=g,Et)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=W;case W:if(4096&n.flags){if(0===c)break t;g=0;do Et=i[s+g++],n.head&&Et&&n.length<65536&&(n.head.comment+=String.fromCharCode(Et));while(Et&&g<c);if(512&n.flags&&(n.check=m(n.check,i,g,s)),c-=g,s+=g,Et)break t}else n.head&&(n.head.comment=null);n.mode=H;case H:if(512&n.flags){for(;p<16;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(l!==(65535&n.check)){t.msg="header crc mismatch",n.mode=lt;break}l=0,p=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=X;break;case V:for(;p<32;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}t.adler=n.check=r(l),l=0,p=0,n.mode=Z;case Z:if(0===n.havedict)return t.next_out=a,t.avail_out=u,t.next_in=s,t.avail_in=c,n.hold=l,n.bits=p,L;t.adler=n.check=1,n.mode=X;case X:if(e===F||e===R)break t;case K:if(n.last){l>>>=7&p,p-=7&p,n.mode=ut;break}for(;p<3;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}switch(n.last=1&l,l>>>=1,p-=1,3&l){case 0:n.mode=J;break;case 1:if(f(n),n.mode=nt,e===R){l>>>=2,p-=2;break t}break;case 2:n.mode=$;break;case 3:t.msg="invalid block type",n.mode=lt}l>>>=2,p-=2;break;case J:for(l>>>=7&p,p-=7&p;p<32;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if((65535&l)!==(l>>>16^65535)){t.msg="invalid stored block lengths",n.mode=lt;break}if(n.length=65535&l,l=0,p=0,n.mode=G,e===R)break t;case G:n.mode=Q;case Q:if(g=n.length){if(g>c&&(g=c),g>u&&(g=u),0===g)break t;v.arraySet(o,i,s,g,a),c-=g,s+=g,u-=g,a+=g,n.length-=g;break}n.mode=X;break;case $:for(;p<14;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(n.nlen=(31&l)+257,l>>>=5,p-=5,n.ndist=(31&l)+1,l>>>=5,p-=5,n.ncode=(15&l)+4,l>>>=4,p-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=lt;break}n.have=0,n.mode=tt;case tt:for(;n.have<n.ncode;){for(;p<3;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}n.lens[Rt[n.have++]]=7&l,l>>>=3,p-=3}for(;n.have<19;)n.lens[Rt[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,kt={bits:n.lenbits},bt=E(b,n.lens,0,19,n.lencode,0,n.work,kt),n.lenbits=kt.bits,bt){t.msg="invalid code lengths set",n.mode=lt;break}n.have=0,n.mode=et;case et:for(;n.have<n.nlen+n.ndist;){for(;Ot=n.lencode[l&(1<<n.lenbits)-1],gt=Ot>>>24,_t=Ot>>>16&255,vt=65535&Ot,!(gt<=p);){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(vt<16)l>>>=gt,p-=gt,n.lens[n.have++]=vt;else{if(16===vt){for(It=gt+2;p<It;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(l>>>=gt,p-=gt,0===n.have){t.msg="invalid bit length repeat",n.mode=lt;break}Et=n.lens[n.have-1],g=3+(3&l),l>>>=2,p-=2}else if(17===vt){for(It=gt+3;p<It;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}l>>>=gt,p-=gt,Et=0,g=3+(7&l),l>>>=3,p-=3}else{for(It=gt+7;p<It;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}l>>>=gt,p-=gt,Et=0,g=11+(127&l),l>>>=7,p-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=lt;break}for(;g--;)n.lens[n.have++]=Et}}if(n.mode===lt)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=lt;break}if(n.lenbits=9,kt={bits:n.lenbits},bt=E(k,n.lens,0,n.nlen,n.lencode,0,n.work,kt),n.lenbits=kt.bits,bt){t.msg="invalid literal/lengths set",n.mode=lt;break}if(n.distbits=6,n.distcode=n.distdyn,kt={bits:n.distbits},bt=E(I,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,kt),n.distbits=kt.bits,bt){t.msg="invalid distances set",n.mode=lt;break}if(n.mode=nt,e===R)break t;case nt:n.mode=rt;case rt:if(c>=6&&u>=258){t.next_out=a,t.avail_out=u,t.next_in=s,t.avail_in=c,n.hold=l,n.bits=p,S(t,y),a=t.next_out,o=t.output,u=t.avail_out,s=t.next_in,i=t.input,c=t.avail_in,l=n.hold,p=n.bits,n.mode===X&&(n.back=-1);break}for(n.back=0;Ot=n.lencode[l&(1<<n.lenbits)-1],gt=Ot>>>24,_t=Ot>>>16&255,vt=65535&Ot,!(gt<=p);){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(_t&&0===(240&_t)){for(wt=gt,mt=_t,St=vt;Ot=n.lencode[St+((l&(1<<wt+mt)-1)>>wt)],gt=Ot>>>24,_t=Ot>>>16&255,vt=65535&Ot,!(wt+gt<=p);){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}l>>>=wt,p-=wt,n.back+=wt}if(l>>>=gt,p-=gt,n.back+=gt,n.length=vt,0===_t){n.mode=ct;break}if(32&_t){n.back=-1,n.mode=X;break}if(64&_t){t.msg="invalid literal/length code",n.mode=lt;break}n.extra=15&_t,n.mode=it;case it:if(n.extra){for(It=n.extra;p<It;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,p-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ot;case ot:for(;Ot=n.distcode[l&(1<<n.distbits)-1],gt=Ot>>>24,_t=Ot>>>16&255,vt=65535&Ot,!(gt<=p);){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(0===(240&_t)){for(wt=gt,mt=_t,St=vt;Ot=n.distcode[St+((l&(1<<wt+mt)-1)>>wt)],gt=Ot>>>24,_t=Ot>>>16&255,vt=65535&Ot,!(wt+gt<=p);){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}l>>>=wt,p-=wt,n.back+=wt}if(l>>>=gt,p-=gt,n.back+=gt,64&_t){t.msg="invalid distance code",n.mode=lt;break}n.offset=vt,n.extra=15&_t,n.mode=st;case st:if(n.extra){for(It=n.extra;p<It;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,p-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=lt;break}n.mode=at;case at:if(0===u)break t;if(g=y-u,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=lt;break}g>n.wnext?(g-=n.wnext,_=n.wsize-g):_=n.wnext-g,g>n.length&&(g=n.length),yt=n.window}else yt=o,_=a-n.offset,g=n.length;g>u&&(g=u),u-=g,n.length-=g;do o[a++]=yt[_++];while(--g);0===n.length&&(n.mode=rt);break;case ct:if(0===u)break t;o[a++]=n.length,u--,n.mode=rt;break;case ut:if(n.wrap){for(;p<32;){if(0===c)break t;c--,l|=i[s++]<<p,p+=8}if(y-=u,t.total_out+=y,n.total+=y,y&&(t.adler=n.check=n.flags?m(n.check,o,y,a-y):w(n.check,o,y,a-y)),y=u,(n.flags?l:r(l))!==n.check){t.msg="incorrect data check",n.mode=lt;break}l=0,p=0}n.mode=ft;case ft:if(n.wrap&&n.flags){for(;p<32;){if(0===c)break t;c--,l+=i[s++]<<p,p+=8}if(l!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=lt;break}l=0,p=0}n.mode=ht;case ht:bt=T;break t;case lt:bt=D;break t;case pt:return x;case dt:default:return A}return t.next_out=a,t.avail_out=u,t.next_in=s,t.avail_in=c,n.hold=l,n.bits=p,(n.wsize||y!==t.avail_out&&n.mode<lt&&(n.mode<ut||e!==O))&&h(t,t.output,t.next_out,y-t.avail_out)?(n.mode=pt,x):(d-=t.avail_in,y-=t.avail_out,t.total_in+=d,t.total_out+=y,n.total+=y,n.wrap&&y&&(t.adler=n.check=n.flags?m(n.check,o,y,t.next_out-y):w(n.check,o,y,t.next_out-y)),t.data_type=n.bits+(n.last?64:0)+(n.mode===X?128:0)+(n.mode===nt||n.mode===G?256:0),(0===d&&0===y||e===O)&&bt===N&&(bt=P),bt)}function p(t){if(!t||!t.state)return A;var e=t.state;return e.window&&(e.window=null),t.state=null,N}function d(t,e){var n;return t&&t.state?(n=t.state,0===(2&n.wrap)?A:(n.head=e,e.done=!1,N)):A}function y(t,e){var n,r,i,o=e.length;return t&&t.state?(n=t.state,0!==n.wrap&&n.mode!==Z?A:n.mode===Z&&(r=1,r=w(r,e,o,0),r!==n.check)?D:(i=h(t,e,o,o))?(n.mode=pt,x):(n.havedict=1,N)):A}var g,_,v=n(7),w=n(26),m=n(28),S=n(30),E=n(32),b=0,k=1,I=2,O=4,F=5,R=6,N=0,T=1,L=2,A=-2,D=-3,x=-4,P=-5,C=8,U=1,M=2,j=3,B=4,z=5,Y=6,q=7,W=8,H=9,V=10,Z=11,X=12,K=13,J=14,G=15,Q=16,$=17,tt=18,et=19,nt=20,rt=21,it=22,ot=23,st=24,at=25,ct=26,ut=27,ft=28,ht=29,lt=30,pt=31,dt=32,yt=852,gt=592,_t=15,vt=_t,wt=!0;e.inflateReset=s,e.inflateReset2=a,e.inflateResetKeep=o,e.inflateInit=u,e.inflateInit2=c,e.inflate=l,e.inflateEnd=p,e.inflateGetHeader=d,e.inflateSetDictionary=y,e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,n){"use strict";var r=n(7),i=15,o=852,s=592,a=0,c=1,u=2,f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],h=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],p=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,n,d,y,g,_,v){var w,m,S,E,b,k,I,O,F,R=v.bits,N=0,T=0,L=0,A=0,D=0,x=0,P=0,C=0,U=0,M=0,j=null,B=0,z=new r.Buf16(i+1),Y=new r.Buf16(i+1),q=null,W=0;for(N=0;N<=i;N++)z[N]=0;for(T=0;T<d;T++)z[e[n+T]]++;for(D=R,A=i;A>=1&&0===z[A];A--);if(D>A&&(D=A),0===A)return y[g++]=20971520,y[g++]=20971520,v.bits=1,0;for(L=1;L<A&&0===z[L];L++);for(D<L&&(D=L),C=1,N=1;N<=i;N++)if(C<<=1,C-=z[N],C<0)return-1;if(C>0&&(t===a||1!==A))return-1;for(Y[1]=0,N=1;N<i;N++)Y[N+1]=Y[N]+z[N];for(T=0;T<d;T++)0!==e[n+T]&&(_[Y[e[n+T]]++]=T);if(t===a?(j=q=_,k=19):t===c?(j=f,B-=257,q=h,W-=257,k=256):(j=l,q=p,k=-1),M=0,T=0,N=L,b=g,x=D,P=0,S=-1,U=1<<D,E=U-1,t===c&&U>o||t===u&&U>s)return 1;for(;;){I=N-P,_[T]<k?(O=0,F=_[T]):_[T]>k?(O=q[W+_[T]],F=j[B+_[T]]):(O=96,F=0),w=1<<N-P,m=1<<x,L=m;do m-=w,y[b+(M>>P)+m]=I<<24|O<<16|F|0;while(0!==m);for(w=1<<N-1;M&w;)w>>=1;if(0!==w?(M&=w-1,M+=w):M=0,T++,0===--z[N]){if(N===A)break;N=e[n+_[T]]}if(N>D&&(M&E)!==S){for(0===P&&(P=D),b+=L,x=N-P,C=1<<x;x+P<A&&(C-=z[x+P],!(C<=0));)x++,C<<=1;if(U+=1<<x,t===c&&U>o||t===u&&U>s)return 1;S=M&E,y[S]=D<<24|x<<16|b-g|0}}return 0!==M&&(y[b+M]=N-P<<24|64<<16|0),v.bits=D,0}},function(t,e){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=n},function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function r(t){return this instanceof r?void i.call(this,t):new r(t)}t.exports=r;var i=n(16),o=n(4);o.inherits=n(2),o.inherits(r,i),r.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,n){t.copy(e,n)}var o=n(9).Buffer;t.exports=function(){function t(){r(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var e=o.allocUnsafe(t>>>0),n=this.head,r=0;n;)i(n.data,e,r),r+=n.data.length,n=n.next;return e},t}()},function(t,e,n){t.exports=n(12).PassThrough},function(t,e,n){t.exports=n(12).Transform},function(t,e,n){t.exports=n(11)},function(t,e,n){function r(){i.call(this)}t.exports=r;var i=n(6).EventEmitter,o=n(2);o(r,i),r.Readable=n(12),r.Writable=n(40),r.Duplex=n(35),r.Transform=n(39),r.PassThrough=n(38),r.Stream=r,r.prototype.pipe=function(t,e){function n(e){t.writable&&!1===t.write(e)&&u.pause&&u.pause()}function r(){u.readable&&u.resume&&u.resume()}function o(){f||(f=!0,t.end())}function s(){f||(f=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(c(),0===i.listenerCount(this,"error"))throw t}function c(){u.removeListener("data",n),t.removeListener("drain",r),u.removeListener("end",o),u.removeListener("close",s),u.removeListener("error",a),t.removeListener("error",a),u.removeListener("end",c),u.removeListener("close",c),t.removeListener("close",c)}var u=this;u.on("data",n),t.on("drain",r),t._isStdio||e&&e.end===!1||(u.on("end",o),u.on("close",s));var f=!1;return u.on("error",a),t.on("error",a),u.on("end",c),u.on("close",c),t.on("close",c),t.emit("pipe",u),t}},function(t,e){(function(e){function n(t,e){function n(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}if(r("noDeprecation"))return t;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(e,function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){}])});
15
//# sourceMappingURL=browserfs.min.js.map

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.