filer/dist/filer.min.js

90 lines
239 KiB
JavaScript

<<<<<<< HEAD
/*! filer 0.0.44 2018-06-25 */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Filer=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(b,c,d){!function(){var b={};"undefined"!=typeof process&&process.nextTick?(b.nextTick=process.nextTick,"undefined"!=typeof setImmediate?b.setImmediate=function(a){setImmediate(a)}:b.setImmediate=b.nextTick):"function"==typeof setImmediate?(b.nextTick=function(a){setImmediate(a)},b.setImmediate=b.nextTick):(b.nextTick=function(a){setTimeout(a,0)},b.setImmediate=b.nextTick),b.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},b.forEachSeries=b.eachSeries,void 0!==a&&a.amd?a([],function(){return b}):void 0!==c&&c.exports?c.exports=b:root.async=b}()},{}],2:[function(a,b,c){function d(a,b){for(var c=b.length-1;c>=0;c--)b[c]===a&&b.splice(c,1);return b}var e=function(){};e.createInterface=function(a){var b={};return b.on=function(b,c){void 0===this[a]&&(this[a]={}),this[a].hasOwnProperty(b)||(this[a][b]=[]),this[a][b].push(c)},b.off=function(b,c){void 0!==this[a]&&this[a].hasOwnProperty(b)&&d(c,this[a][b])},b.trigger=function(b){if(void 0!==this[a]&&this[a].hasOwnProperty(b))for(var c=Array.prototype.slice.call(arguments,1),d=0;d<this[a][b].length;d++)this[a][b][d].apply(this[a][b][d],c)},b.removeAllListeners=function(b){if(void 0!==this[a]){var c=this;c[a][b].forEach(function(a){c.off(b,a)})}},b};var f=e.createInterface("_handlers");e.prototype._on=f.on,e.prototype._off=f.off,e.prototype._trigger=f.trigger;var g=e.createInterface("handlers");e.prototype.on=function(){g.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},e.prototype.off=g.off,e.prototype.trigger=g.trigger,e.prototype.removeAllListeners=g.removeAllListeners,b.exports=e},{}],3:[function(a,b,c){(function(c){function d(a,b){var c=0;return function(){var d=Date.now();d-c>a&&(c=d,b.apply(this,arguments))}}function e(a,b){if(void 0!==a&&a||(a={}),"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function f(){var a=this,b=Date.now();this.origin=h(),this.lastMessage=b,this.receivedIDs={},this.previousValues={};var d=function(){a._onStorageEvent.apply(a,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",d):c.addEventListener("storage",d,!1))}var g=a("./eventemitter.js"),h=a("../src/shared.js").guid,i=function(a){return void 0===a||void 0===a.localStorage?{getItem:function(){},setItem:function(){},removeItem:function(){}}:a.localStorage}(c);f.prototype._transaction=function(a){function b(){if(!g){var k=Date.now(),m=0|i.getItem(l);if(m&&k-m<d)return h||(f._on("storage",b),h=!0),void(j=setTimeout(b,e));g=!0,i.setItem(l,k),a(),c()}}function c(){h&&f._off("storage",b),j&&clearTimeout(j),i.removeItem(l)}var d=1e3,e=20,f=this,g=!1,h=!1,j=null;b()},f.prototype._cleanup_emit=d(100,function(){this._transaction(function(){var a,b=Date.now(),c=b-m,d=0;try{a=JSON.parse(i.getItem(j)||"[]")}catch(f){a=[]}for(var e=a.length-1;e>=0;e--)a[e].timestamp<c&&(a.splice(e,1),d++);d>0&&i.setItem(j,JSON.stringify(a))})}),f.prototype._cleanup_once=d(100,function(){var a=this;a._transaction(function(){var b,c,d=(Date.now(),0);try{c=JSON.parse(i.getItem(k)||"{}")}catch(e){c={}}for(b in c)a._once_expired(b,c)&&(delete c[b],d++);d>0&&i.setItem(k,JSON.stringify(c))})}),f.prototype._once_expired=function(a,b){if(!b)return!0;if(!b.hasOwnProperty(a))return!0;if("object"!=typeof b[a])return!0;var c=b[a].ttl||n,d=Date.now();return b[a].timestamp<d-c},f.prototype._localStorageChanged=function(a,b){if(a&&a.key)return a.key===b;var c=i.getItem(b);return c!==this.previousValues[b]&&(this.previousValues[b]=c,!0)},f.prototype._onStorageEvent=function(a){a=a||c.event;var b=this;this._localStorageChanged(a,j)&&this._transaction(function(){var a,c=Date.now(),d=i.getItem(j);try{a=JSON.parse(d||"[]")}catch(f){a=[]}for(var e=0;e<a.length;e++)if(a[e].origin!==b.origin&&!(a[e].timestamp<b.lastMessage)){if(a[e].id){if(b.receivedIDs.hasOwnProperty(a[e].id))continue;b.receivedIDs[a[e].id]=!0}b.trigger(a[e].name,a[e].payload)}b.lastMessage=c}),this._trigger("storage",a)},f.prototype._emit=function(a,b,c){if((c="string"==typeof c||"number"==typeof c?String(c):null)&&c.length){if(this.receivedIDs.hasOwnProperty(c))return;this.receivedIDs[c]=!0}var d={id:c,name:a,origin:this.origin,timestamp:Date.now(),payload:b},e=this;this._transaction(function(){var c=i.getItem(j)||"[]",f="[]"===c?"":",";c=[c.substring(0,c.length-1),f,JSON.stringify(d),"]"].join(""),i.setItem(j,c),e.trigger(a,b),setTimeout(function(){e._cleanup_emit()},50)})},f.prototype.emit=function(a,b){this._emit.apply(this,arguments),this._trigger("emit",a,b)},f.prototype.once=function(a,b,c){if(f.supported){var d=this;this._transaction(function(){var e;try{e=JSON.parse(i.getItem(k)||"{}")}catch(f){e={}}d._once_expired(a,e)&&(e[a]={},e[a].timestamp=Date.now(),"number"==typeof c&&(e[a].ttl=1e3*c),i.setItem(k,JSON.stringify(e)),b(),setTimeout(function(){d._cleanup_once()},50))})}},e(f.prototype,g.prototype),f.supported=void 0!==i;var j="intercom",k="intercom_once",l="intercom_lock",m=5e4,n=36e5;f.destroy=function(){i.removeItem(l),i.removeItem(j),i.removeItem(k)},f.getInstance=function(){var a;return function(){return a||(a=new f),a}}(),b.exports=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../src/shared.js":30,"./eventemitter.js":2}],4:[function(a,b,c){function d(a,b){return q.call(a,b)}function e(a){return null==a?0:a.length===+a.length?a.length:t(a).length}function f(a){return a}function g(a,b,c){var d,e;if(null!=a)if(m&&a.forEach===m)a.forEach(b,c);else if(a.length===+a.length){for(d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a)===s)return}else{var f=f(a);for(d=0,e=f.length;d<e;d++)if(b.call(c,a[f[d]],f[d],a)===s)return}}function h(a,b,c){b||(b=f);var d=!1;return null==a?d:o&&a.some===o?a.some(b,c):(g(a,function(a,e,f){if(d||(d=b.call(c,a,e,f)))return s}),!!d)}function i(a,b){return null!=a&&(n&&a.indexOf===n?-1!=a.indexOf(b):h(a,function(a){return a===b}))}function j(a){this.value=a}function k(a){return a&&"object"==typeof a&&!Array.isArray(a)&&q.call(a,"__wrapped__")?a:new j(a)}var l=Array.prototype,m=l.forEach,n=l.indexOf,o=l.some,p=Object.prototype,q=p.hasOwnProperty,r=Object.keys,s={},t=r||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)d(a,c)&&b.push(c);return b};j.prototype.has=function(a){return d(this.value,a)},j.prototype.contains=function(a){return i(this.value,a)},j.prototype.size=function(){return e(this.value)},b.exports=k},{}],5:[function(a,b,c){!function(){"use strict";for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=new Uint8Array(256),d=0;d<a.length;d++)b[a.charCodeAt(d)]=d;c.encode=function(b){var c,d=new Uint8Array(b),e=d.length,f="";for(c=0;c<e;c+=3)f+=a[d[c]>>2],f+=a[(3&d[c])<<4|d[c+1]>>4],f+=a[(15&d[c+1])<<2|d[c+2]>>6],f+=a[63&d[c+2]];return e%3==2?f=f.substring(0,f.length-1)+"=":e%3==1&&(f=f.substring(0,f.length-2)+"=="),f},c.decode=function(a){var c,d,e,f,g,h=.75*a.length,i=a.length,j=0;"="===a[a.length-1]&&(h--,"="===a[a.length-2]&&h--);var k=new ArrayBuffer(h),l=new Uint8Array(k);for(c=0;c<i;c+=4)d=b[a.charCodeAt(c)],e=b[a.charCodeAt(c+1)],f=b[a.charCodeAt(c+2)],g=b[a.charCodeAt(c+3)],l[j++]=d<<2|e>>4,l[j++]=(15&e)<<4|f>>2,l[j++]=(3&f)<<6|63&g;return k}}()},{}],6:[function(a,b,c){!function(a){"use strict";function b(a){var b=a.charCodeAt(0);return b===f||b===k?62:b===g||b===l?63:b<h?-1:b<h+10?b-h+26+26:b<j+26?b-j:b<i+26?b-i+26:void 0}function c(a){function c(a){j[l++]=a}var d,f,g,h,i,j;if(a.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new e(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,f=0;d<g;d+=4,f+=3)h=b(a.charAt(d))<<18|b(a.charAt(d+1))<<12|b(a.charAt(d+2))<<6|b(a.charAt(d+3)),c((16711680&h)>>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function d(a){function b(a){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var d,e,f,g=a.length%3,h="";for(d=0,f=a.length-g;d<f;d+=3)e=(a[d]<<16)+(a[d+1]<<8)+a[d+2],h+=c(e);switch(g){case 1:e=a[a.length-1],h+=b(e>>2),h+=b(e<<4&63),h+="==";break;case 2:e=(a[a.length-2]<<8)+a[a.length-1],h+=b(e>>10),h+=b(e>>4&63),h+=b(e<<2&63),h+="="}return h}var e="undefined"!=typeof Uint8Array?Uint8Array:Array,f="+".charCodeAt(0),g="/".charCodeAt(0),h="0".charCodeAt(0),i="a".charCodeAt(0),j="A".charCodeAt(0),k="-".charCodeAt(0),l="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=d}(void 0===c?this.base64js={}:c)},{}],7:[function(a,b,c){(function(b){"use strict";function d(){function a(){}try{var b=new Uint8Array(1);return b.foo=function(){return 42},b.constructor=a,42===b.foo()&&b.constructor===a&&"function"==typeof b.subarray&&0===b.subarray(1,1).byteLength}catch(c){return!1}}function e(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(a){return this instanceof f?(f.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof a?g(this,a):"string"==typeof a?h(this,a,arguments.length>1?arguments[1]:"utf8"):i(this,a)):arguments.length>1?new f(a,arguments[1]):new f(a)}function g(a,b){if(a=p(a,b<0?0:0|q(b)),!f.TYPED_ARRAY_SUPPORT)for(var c=0;c<b;c++)a[c]=0;return a}function h(a,b,c){return"string"==typeof c&&""!==c||(c="utf8"),a=p(a,0|s(b,c)),a.write(b,c),a}function i(a,b){if(f.isBuffer(b))return j(a,b);if(Y(b))return k(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(b.buffer instanceof ArrayBuffer)return l(a,b);if(b instanceof ArrayBuffer)return m(a,b)}return b.length?n(a,b):o(a,b)}function j(a,b){var c=0|q(b.length);return a=p(a,c),b.copy(a,0,0,c),a}function k(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function l(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function m(a,b){return f.TYPED_ARRAY_SUPPORT?(b.byteLength,a=f._augment(new Uint8Array(b))):a=l(a,new Uint8Array(b)),a}function n(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function o(a,b){var c,d=0;"Buffer"===b.type&&Y(b.data)&&(c=b.data,d=0|q(c.length)),a=p(a,d);for(var e=0;e<d;e+=1)a[e]=255&c[e];return a}function p(a,b){return f.TYPED_ARRAY_SUPPORT?(a=f._augment(new Uint8Array(b)),a.__proto__=f.prototype):(a.length=b,a._isBuffer=!0),0!==b&&b<=f.poolSize>>>1&&(a.parent=Z),a}function q(a){if(a>=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|a}function r(a,b){if(!(this instanceof r))return new r(a,b);var c=new f(a,b);return delete c.parent,c}function s(a,b){"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"binary":case"raw":case"raws":return c;case"utf8":case"utf-8":return R(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return U(a).length;default:if(d)return R(a).length;b=(""+b).toLowerCase(),d=!0}}function t(a,b,c){var d=!1;if(b|=0,c=void 0===c||c===1/0?this.length:0|c,a||(a="utf8"),b<0&&(b=0),c>this.length&&(c=this.length),c<=b)return"";for(;;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function u(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d))>e&&(d=e):d=e;var f=b.length;if(f%2!=0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g<d;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function v(a,b,c,d){return V(R(b,a.length-c),a,c,d)}function w(a,b,c,d){return V(S(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return V(U(b),a,c,d)}function z(a,b,c,d){return V(T(b,a.length-c),a,c,d)}function A(a,b,c){return 0===b&&c===a.length?W.fromByteArray(a):W.fromByteArray(a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;e<c;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128==(192&i)&&(l=(31&f)<<6|63&i)>127&&(g=l);break;case 3:i=a[e+1],j=a[e+2],128==(192&i)&&128==(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j)>2047&&(l<55296||l>57343)&&(g=l);break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128==(192&i)&&128==(192&j)&&128==(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k)>65535&&l<1114112&&(g=l)}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if(b<=$)return String.fromCharCode.apply(String,a);for(var c="",d=0;d<b;)c+=String.fromCharCode.apply(String,a.slice(d,d+=$));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;e++)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;e++)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||b<0)&&(b=0),(!c||c<0||c>d)&&(c=d);for(var e="",f=b;f<c;f++)e+=Q(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function H(a,b,c){if(a%1!=0||a<0)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,g){if(!f.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>e||b<g)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range")}function J(a,b,c,d){b<0&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);e<f;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function K(a,b,c,d){b<0&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);e<f;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function L(a,b,c,d,e,f){if(b>e||b<f)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range");if(c<0)throw new RangeError("index out of range")}function M(a,b,c,d,e){return e||L(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function N(a,b,c,d,e){return e||L(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function O(a){if(a=P(a).replace(aa,""),a.length<2)return"";for(;a.length%4!=0;)a+="=";return a}function P(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Q(a){return a<16?"0"+a.toString(16):a.toString(16)}function R(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g<d;g++){if((c=a.charCodeAt(g))>55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(c<56320){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=65536+(e-55296<<10|c-56320)}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}else if(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function S(a){for(var b=[],c=0;c<a.length;c++)b.push(255&a.charCodeAt(c));return b}function T(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);g++)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);return f}function U(a){return W.toByteArray(O(a))}function V(a,b,c,d){for(var e=0;e<d&&!(e+c>=b.length||e>=a.length);e++)b[e+c]=a[e];return e}var W=a("base64-js"),X=a("ieee754"),Y=a("isarray");c.Buffer=f,c.SlowBuffer=r,c.INSPECT_MAX_BYTES=50,f.poolSize=8192;var Z={};f.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d(),f.TYPED_ARRAY_SUPPORT?(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array):(f.prototype.length=void 0,f.prototype.parent=void 0),f.isBuffer=function(a){return!(null==a||!a._isBuffer)},f.compare=function(a,b){if(!f.isBuffer(a)||!f.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,g=Math.min(c,d);e<g&&a[e]===b[e];)++e;return e!==g&&(c=a[e],d=b[e]),c<d?-1:d<c?1:0},f.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(a,b){if(!Y(a))throw new TypeError("list argument must be an Array of Buffers.");if(0===a.length)return new f(0);var c;if(void 0===b)for(b=0,c=0;c<a.length;c++)b+=a[c].length;var d=new f(b),e=0;for(c=0;c<a.length;c++){var g=a[c];g.copy(d,e),e+=g.length}return d},f.byteLength=s,f.prototype.toString=function(){var a=0|this.length;return 0===a?"":0===arguments.length?B(this,0,a):t.apply(this,arguments)},f.prototype.equals=function(a){if(!f.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a||0===f.compare(this,a)},f.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},f.prototype.compare=function(a){if(!f.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?0:f.compare(this,a)},f.prototype.indexOf=function(a,b){function c(a,b,c){for(var d=-1,e=0;c+e<a.length;e++)if(a[c+e]===b[-1===d?0:e-d]){if(-1===d&&(d=e),e-d+1===b.length)return c+d}else d=-1;return-1}if(b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b>>=0,0===this.length)return-1;if(b>=this.length)return-1;if(b<0&&(b=Math.max(this.length+b,0)),"string"==typeof a)return 0===a.length?-1:String.prototype.indexOf.call(this,a,b);if(f.isBuffer(a))return c(this,a,b);if("number"==typeof a)return f.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):c(this,[a],b);throw new TypeError("val must be string, number or Buffer")},f.prototype.get=function(a){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(a)},f.prototype.set=function(a,b){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(a,b)},f.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else if(isFinite(b))b|=0,isFinite(c)?(c|=0,void 0===d&&(d="utf8")):(d=c,c=void 0);else{var e=d;d=b,b=0|c,c=e}var f=this.length-b;if((void 0===c||c>f)&&(c=f),a.length>0&&(c<0||b<0)||b>this.length)throw new RangeError("attempt to write outside buffer bounds");d||(d="utf8");for(var g=!1;;)switch(d){case"hex":return u(this,a,b,c);case"utf8":case"utf-8":return v(this,a,b,c);case"ascii":return w(this,a,b,c);case"binary":return x(this,a,b,c);case"base64":return y(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,a,b,c);default:if(g)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),g=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;f.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,a<0?(a+=c)<0&&(a=0):a>c&&(a=c),b<0?(b+=c)<0&&(b=0):b>c&&(b=c),b<a&&(b=a);var d;if(f.TYPED_ARRAY_SUPPORT)d=f._augment(this.subarray(a,b));else{var e=b-a;d=new f(e,void 0);for(var g=0;g<e;g++)d[g]=this[g+a]}return d.length&&(d.parent=this.parent||this),d},f.prototype.readUIntLE=function(a,b,c){a|=0,b|=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},f.prototype.readUIntBE=function(a,b,c){a|=0,b|=0,c||H(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},f.prototype.readUInt8=function(a,b){return b||H(a,1,this.length),this[a]},f.prototype.readUInt16LE=function(a,b){return b||H(a,2,this.length),this[a]|this[a+1]<<8},f.prototype.readUInt16BE=function(a,b){return b||H(a,2,this.length),this[a]<<8|this[a+1]},f.prototype.readUInt32LE=function(a,b){return b||H(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},f.prototype.readUInt32BE=function(a,b){return b||H(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},f.prototype.readIntLE=function(a,b,c){a|=0,b|=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},f.prototype.readIntBE=function(a,b,c){a|=0,b|=0,c||H(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},f.prototype.readInt8=function(a,b){return b||H(a,1,this.length),128&this[a]?-1*(255-this[a]+1):this[a]},f.prototype.readInt16LE=function(a,b){b||H(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},f.prototype.readInt16BE=function(a,b){b||H(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},f.prototype.readInt32LE=function(a,b){return b||H(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},f.prototype.readInt32BE=function(a,b){return b||H(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},f.prototype.readFloatLE=function(a,b){return b||H(a,4,this.length),X.read(this,a,!0,23,4)},f.prototype.readFloatBE=function(a,b){return b||H(a,4,this.length),X.read(this,a,!1,23,4)},f.prototype.readDoubleLE=function(a,b){return b||H(a,8,this.length),X.read(this,a,!0,52,8)},f.prototype.readDoubleBE=function(a,b){return b||H(a,8,this.length),X.read(this,a,!1,52,8)},f.prototype.writeUIntLE=function(a,b,c,d){a=+a,b|=0,c|=0,d||I(this,a,b,c,Math.pow(2,8*c),0);var e=1,f=0;for(this[b]=255&a;++f<c&&(e*=256);)this[b+f]=a/e&255;return b+c},f.prototype.writeUIntBE=function(a,b,c,d){a=+a,b|=0,c|=0,d||I(this,a,b,c,Math.pow(2,8*c),0);var e=c-1,f=1;for(this[b+e]=255&a;--e>=0&&(f*=256);)this[b+e]=a/f&255;return b+c},f.prototype.writeUInt8=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,1,255,0),f.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=255&a,b+1},f.prototype.writeUInt16LE=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):J(this,a,b,!0),b+2},f.prototype.writeUInt16BE=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):J(this,a,b,!1),b+2},f.prototype.writeUInt32LE=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a):K(this,a,b,!0),b+4},f.prototype.writeUInt32BE=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):K(this,a,b,!1),b+4},f.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b|=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=0,g=1,h=a<0?1:0;for(this[b]=255&a;++f<c&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},f.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b|=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=a<0?1:0;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},f.prototype.writeInt8=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,1,127,-128),f.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),a<0&&(a=255+a+1),this[b]=255&a,b+1},f.prototype.writeInt16LE=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):J(this,a,b,!0),b+2},f.prototype.writeInt16BE=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):J(this,a,b,!1),b+2},f.prototype.writeInt32LE=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):K(this,a,b,!0),b+4},f.prototype.writeInt32BE=function(a,b,c){return a=+a,b|=0,c||I(this,a,b,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):K(this,a,b,!1),b+4},f.prototype.writeFloatLE=function(a,b,c){return M(this,a,b,!0,c)},f.prototype.writeFloatBE=function(a,b,c){return M(this,a,b,!1,c)},f.prototype.writeDoubleLE=function(a,b,c){return N(this,a,b,!0,c)},f.prototype.writeDoubleBE=function(a,b,c){return N(this,a,b,!1,c)},f.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&d<c&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);var e,g=d-c;if(this===a&&c<b&&b<d)for(e=g-1;e>=0;e--)a[e+b]=this[e+c];else if(g<1e3||!f.TYPED_ARRAY_SUPPORT)for(e=0;e<g;e++)a[e+b]=this[e+c];else a._set(this.subarray(c,c+g),b);return g},f.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),c<b)throw new RangeError("end < start");if(c!==b&&0!==this.length){if(b<0||b>=this.length)throw new RangeError("start out of bounds");if(c<0||c>this.length)throw new RangeError("end out of bounds");var d;if("number"==typeof a)for(d=b;d<c;d++)this[d]=a;else{var e=R(a.toString()),f=e.length;for(d=b;d<c;d++)this[d]=e[d%f]}return this}},f.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(f.TYPED_ARRAY_SUPPORT)return new f(this).buffer;for(var a=new Uint8Array(this.length),b=0,c=a.length;b<c;b+=1)a[b]=this[b];return a.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var _=f.prototype;f._augment=function(a){return a.constructor=f,a._isBuffer=!0,a._set=a.set,a.get=_.get,a.set=_.set,a.write=_.write,a.toString=_.toString,a.toLocaleString=_.toString,a.toJSON=_.toJSON,a.equals=_.equals,a.compare=_.compare,a.indexOf=_.indexOf,a.copy=_.copy,a.slice=_.slice,a.readUIntLE=_.readUIntLE,a.readUIntBE=_.readUIntBE,a.readUInt8=_.readUInt8,a.readUInt16LE=_.readUInt16LE,a.readUInt16BE=_.readUInt16BE,a.readUInt32LE=_.readUInt32LE,a.readUInt32BE=_.readUInt32BE,a.readIntLE=_.readIntLE,a.readIntBE=_.readIntBE,a.readInt8=_.readInt8,a.readInt16LE=_.readInt16LE,a.readInt16BE=_.readInt16BE,a.readInt32LE=_.readInt32LE,a.readInt32BE=_.readInt32BE,a.readFloatLE=_.readFloatLE,a.readFloatBE=_.readFloatBE,a.readDoubleLE=_.readDoubleLE,a.readDoubleBE=_.readDoubleBE,a.writeUInt8=_.writeUInt8,a.writeUIntLE=_.writeUIntLE,a.writeUIntBE=_.writeUIntBE,a.writeUInt16LE=_.writeUInt16LE,a.writeUInt16BE=_.writeUInt16BE,a.writeUInt32LE=_.writeUInt32LE,a.writeUInt32BE=_.writeUInt32BE,a.writeIntLE=_.writeIntLE,a.writeIntBE=_.writeIntBE,a.writeInt8=_.writeInt8,a.writeInt16LE=_.writeInt16LE,a.writeInt16BE=_.writeInt16BE,a.writeInt32LE=_.writeInt32LE,a.writeInt32BE=_.writeInt32BE,a.writeFloatLE=_.writeFloatLE,a.writeFloatBE=_.writeFloatBE,a.writeDoubleLE=_.writeDoubleLE,a.writeDoubleBE=_.writeDoubleBE,a.fill=_.fill,a.inspect=_.inspect,a.toArrayBuffer=_.toArrayBuffer,a};var aa=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":6,ieee754:9,isarray:8}],8:[function(a,b,c){var d={}.toString;b.exports=Array.isArray||function(a){return"[object Array]"==d.call(a)}},{}],9:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=b<0||0===b&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],10:[function(a,b,c){!function(){function a(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function c(){return 1}function d(a){if(!(this instanceof d))return new d(a);"number"==typeof a&&(a={max:a}),a||(a={}),this._max=a.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=a.length||c,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=c),this._allowStale=a.stale||!1,this._maxAge=a.maxAge||null,this._dispose=a.dispose,this.reset()}function e(a,b,c){var d=a._cache[b];return d&&(a._maxAge&&Date.now()-d.now>a._maxAge?(i(a,d),a._allowStale||(d=void 0)):c&&f(a,d),d&&(d=d.value)),d}function f(a,b){h(a,b),b.lu=a._mru++,a._maxAge&&(b.now=Date.now()),a._lruList[b.lu]=b}function g(a){for(;a._lru<a._mru&&a._length>a._max;)i(a,a._lruList[a._lru])}function h(a,b){for(delete a._lruList[b.lu];a._lru<a._mru&&!a._lruList[a._lru];)a._lru++}function i(a,b){b&&(a._dispose&&a._dispose(b.key,b.value),a._length-=b.length,a._itemCount--,delete a._cache[b.key],h(a,b))}function j(a,b,c,d,e){this.key=a,this.value=b,this.lu=c,this.length=d,this.now=e}"object"==typeof b&&b.exports?b.exports=d:this.LRUCache=d,Object.defineProperty(d.prototype,"max",{set:function(a){(!a||"number"!=typeof a||a<=0)&&(a=1/0),this._max=a,this._length>this._max&&g(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(d.prototype,"lengthCalculator",{set:function(a){if("function"!=typeof a){this._lengthCalculator=c,this._length=this._itemCount;for(var b in this._cache)this._cache[b].length=1}else{this._lengthCalculator=a,this._length=0;for(var b in this._cache)this._cache[b].length=this._lengthCalculator(this._cache[b].value),this._length+=this._cache[b].length}this._length>this._max&&g(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(d.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(d.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),d.prototype.forEach=function(a,b){b=b||this;for(var c=0,d=this._mru-1;d>=0&&c<this._itemCount;d--)if(this._lruList[d]){c++;var e=this._lruList[d];this._maxAge&&Date.now()-e.now>this._maxAge&&(i(this,e),this._allowStale||(e=void 0)),e&&a.call(b,e.value,e.key,this)}},d.prototype.keys=function(){for(var a=new Array(this._itemCount),b=0,c=this._mru-1;c>=0&&b<this._itemCount;c--)if(this._lruList[c]){var d=this._lruList[c];a[b++]=d.key}return a},d.prototype.values=function(){for(var a=new Array(this._itemCount),b=0,c=this._mru-1;c>=0&&b<this._itemCount;c--)if(this._lruList[c]){var d=this._lruList[c];a[b++]=d.value}return a},d.prototype.reset=function(){if(this._dispose&&this._cache)for(var a in this._cache)this._dispose(a,this._cache[a].value)
;this._cache=Object.create(null),this._lruList=Object.create(null),this._mru=0,this._lru=0,this._length=0,this._itemCount=0},d.prototype.dump=function(){return this._cache},d.prototype.dumpLru=function(){return this._lruList},d.prototype.set=function(b,c){if(a(this._cache,b))return this._dispose&&this._dispose(b,this._cache[b].value),this._maxAge&&(this._cache[b].now=Date.now()),this._cache[b].value=c,this.get(b),!0;var d=this._lengthCalculator(c),e=this._maxAge?Date.now():0,f=new j(b,c,this._mru++,d,e);return f.length>this._max?(this._dispose&&this._dispose(b,c),!1):(this._length+=f.length,this._lruList[f.lu]=this._cache[b]=f,this._itemCount++,this._length>this._max&&g(this),!0)},d.prototype.has=function(b){if(!a(this._cache,b))return!1;var c=this._cache[b];return!(this._maxAge&&Date.now()-c.now>this._maxAge)},d.prototype.get=function(a){return e(this,a,!0)},d.prototype.peek=function(a){return e(this,a,!1)},d.prototype.pop=function(){var a=this._lruList[this._lru];return i(this,a),a||null},d.prototype.del=function(a){i(this,this._cache[a])}}()},{}],11:[function(a,b,c){!function(a,b,c,d){function e(a){return a.split("").reduce(function(a,b){return a[b]=!0,a},{})}function f(a,b){return b=b||{},function(c,d,e){return h(c,a,b)}}function g(a,b){a=a||{},b=b||{};var c={};return Object.keys(b).forEach(function(a){c[a]=b[a]}),Object.keys(a).forEach(function(b){c[b]=a[b]}),c}function h(a,b,c){if("string"!=typeof b)throw new TypeError("glob pattern string required");return c||(c={}),!(!c.nocomment&&"#"===b.charAt(0))&&(""===b.trim()?""===a:new i(b,c).match(a))}function i(a,b){if(!(this instanceof i))return new i(a,b,t);if("string"!=typeof a)throw new TypeError("glob pattern string required");b||(b={}),a=a.trim(),"win32"===d&&(a=a.split("\\").join("/"));var c=a+"\n"+v(b),e=h.cache.get(c);if(e)return e;h.cache.set(c,this),this.options=b,this.set=[],this.pattern=a,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function j(){if(!this._made){var a=this.pattern,b=this.options;if(!b.nocomment&&"#"===a.charAt(0))return void(this.comment=!0);if(!a)return void(this.empty=!0);this.parseNegate();var c=this.globSet=this.braceExpand();b.debug&&(this.debug=console.error),this.debug(this.pattern,c),c=this.globParts=c.map(function(a){return a.split(B)}),this.debug(this.pattern,c),c=c.map(function(a,b,c){return a.map(this.parse,this)},this),this.debug(this.pattern,c),c=c.filter(function(a){return-1===a.indexOf(!1)}),this.debug(this.pattern,c),this.set=c}}function k(){var a=this.pattern,b=!1,c=this.options,d=0;if(!c.nonegate){for(var e=0,f=a.length;e<f&&"!"===a.charAt(e);e++)b=!b,d++;d&&(this.pattern=a.substr(d)),this.negate=b}}function l(a,b,c){return c=c||"0",a+="",a.length>=b?a:new Array(b-a.length+1).join(c)+a}function m(a,b){function c(){s.push(w),w=""}if(b=b||this.options,void 0===(a=void 0===a?this.pattern:a))throw new Error("undefined pattern");if(b.nobrace||!a.match(/\{.*\}/))return[a];var d=!1;if("{"!==a.charAt(0)){this.debug(a);for(var e=null,f=0,g=a.length;f<g;f++){var h=a.charAt(f);if(this.debug(f,h),"\\"===h)d=!d;else if("{"===h&&!d){e=a.substr(0,f);break}}if(null===e)return this.debug("no sets"),[a];return m.call(this,a.substr(f),b).map(function(a){return e+a})}var i=a.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(i){this.debug("numset",i[1],i[2]);for(var j,k=m.call(this,a.substr(i[0].length),b),n=+i[1],o="0"===i[1][0],p=i[1].length,q=+i[2],r=n>q?-1:1,s=[],f=n;f!=q+r;f+=r){j=o?l(f,p):f+"";for(var t=0,u=k.length;t<u;t++)s.push(j+k[t])}return s}var f=1,v=1,s=[],w="",d=!1;this.debug("Entering for");a:for(f=1,g=a.length;f<g;f++){var h=a.charAt(f);if(this.debug("",f,h),d)d=!1,w+="\\"+h;else switch(h){case"\\":d=!0;continue;case"{":v++,w+="{";continue;case"}":if(0===--v){c(),f++;break a}w+=h;continue;case",":1===v?c():w+=h;continue;default:w+=h;continue}}if(0!==v)return this.debug("didn't close",a),m.call(this,"\\"+a,b);this.debug("set",s),this.debug("suffix",a.substr(f));var k=m.call(this,a.substr(f),b),x=1===s.length;this.debug("set pre-expanded",s),s=s.map(function(a){return m.call(this,a,b)},this),this.debug("set expanded",s),s=s.reduce(function(a,b){return a.concat(b)}),x&&(s=s.map(function(a){return"{"+a+"}"}));for(var y=[],f=0,g=s.length;f<g;f++)for(var t=0,u=k.length;t<u;t++)y.push(s[f]+k[t]);return y}function n(a,b){function c(){if(f){switch(f){case"*":h+=x,i=!0;break;case"?":h+=w,i=!0;break;default:h+="\\"+f}p.debug("clearStateChar %j %j",f,h),f=!1}}var d=this.options;if(!d.noglobstar&&"**"===a)return u;if(""===a)return"";for(var e,f,g,h="",i=!!d.nocase,j=!1,k=[],l=!1,m=-1,n=-1,o="."===a.charAt(0)?"":d.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",p=this,r=0,s=a.length;r<s&&(g=a.charAt(r));r++)if(this.debug("%s\t%s %s %j",a,r,h,g),j&&A[g])h+="\\"+g,j=!1;else switch(g){case"/":return!1;case"\\":c(),j=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",a,r,h,g),l){this.debug(" in class"),"!"===g&&r===n+1&&(g="^"),h+=g;continue}p.debug("call clearStateChar %j",f),c(),f=g,d.noext&&c();continue;case"(":if(l){h+="(";continue}if(!f){h+="\\(";continue}e=f,k.push({type:e,start:r-1,reStart:h.length}),h+="!"===f?"(?:(?!":"(?:",this.debug("plType %j %j",f,h),f=!1;continue;case")":if(l||!k.length){h+="\\)";continue}switch(c(),i=!0,h+=")",e=k.pop().type){case"!":h+="[^/]*?)";break;case"?":case"+":case"*":h+=e}continue;case"|":if(l||!k.length||j){h+="\\|",j=!1;continue}c(),h+="|";continue;case"[":if(c(),l){h+="\\"+g;continue}l=!0,n=r,m=h.length,h+=g;continue;case"]":if(r===n+1||!l){h+="\\"+g,j=!1;continue}i=!0,l=!1,h+=g;continue;default:c(),j?j=!1:!A[g]||"^"===g&&l||(h+="\\"),h+=g}if(l){var t=a.substr(n+1),v=this.parse(t,C);h=h.substr(0,m)+"\\["+v[0],i=i||v[1]}for(var y;y=k.pop();){var z=h.slice(y.reStart+3);z=z.replace(/((?:\\{2})*)(\\?)\|/g,function(a,b,c){return c||(c="\\"),b+b+c+"|"}),this.debug("tail=%j\n %s",z,z);var B="*"===y.type?x:"?"===y.type?w:"\\"+y.type;i=!0,h=h.slice(0,y.reStart)+B+"\\("+z}c(),j&&(h+="\\\\");var D=!1;switch(h.charAt(0)){case".":case"[":case"(":D=!0}if(""!==h&&i&&(h="(?=.)"+h),D&&(h=o+h),b===C)return[h,i];if(!i)return q(a);var E=d.nocase?"i":"",F=new RegExp("^"+h+"$",E);return F._glob=a,F._src=h,F}function o(){if(this.regexp||!1===this.regexp)return this.regexp;var a=this.set;if(!a.length)return this.regexp=!1;var b=this.options,c=b.noglobstar?x:b.dot?y:z,d=b.nocase?"i":"",e=a.map(function(a){return a.map(function(a){return a===u?c:"string"==typeof a?r(a):a._src}).join("\\/")}).join("|");e="^(?:"+e+")$",this.negate&&(e="^(?!"+e+").*$");try{return this.regexp=new RegExp(e,d)}catch(f){return this.regexp=!1}}function p(a,b){if(this.debug("match",a,this.pattern),this.comment)return!1;if(this.empty)return""===a;if("/"===a&&b)return!0;var c=this.options;"win32"===d&&(a=a.split("\\").join("/")),a=a.split(B),this.debug(this.pattern,"split",a);var e=this.set;this.debug(this.pattern,"set",e);for(var f,g=a.length-1;g>=0&&!(f=a[g]);g--);for(var g=0,h=e.length;g<h;g++){var i=e[g],j=a;c.matchBase&&1===i.length&&(j=[f]);if(this.matchOne(j,i,b))return!!c.flipNegate||!this.negate}return!c.flipNegate&&this.negate}function q(a){return a.replace(/\\(.)/g,"$1")}function r(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}c?c.exports=h:b.minimatch=h,a||(a=function(a){switch(a){case"sigmund":return function(a){return JSON.stringify(a)};case"path":return{basename:function(a){a=a.split(/[\/\\]/);var b=a.pop();return b||(b=a.pop()),b}};case"lru-cache":return function(){var a={},b=0;this.set=function(c,d){b++,b>=100&&(a={}),a[c]=d},this.get=function(b){return a[b]}}}}),h.Minimatch=i;var s=a("lru-cache"),t=h.cache=new s({max:100}),u=h.GLOBSTAR=i.GLOBSTAR={},v=a("sigmund"),w=(a("path"),"[^/]"),x=w+"*?",y="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",z="(?:(?!(?:\\/|^)\\.).)*?",A=e("().*{}+?[]^$\\!"),B=/\/+/;h.filter=f,h.defaults=function(a){if(!a||!Object.keys(a).length)return h;var b=h,c=function(c,d,e){return b.minimatch(c,d,g(a,e))};return c.Minimatch=function(c,d){return new b.Minimatch(c,g(a,d))},c},i.defaults=function(a){return a&&Object.keys(a).length?h.defaults(a).Minimatch:i},i.prototype.debug=function(){},i.prototype.make=j,i.prototype.parseNegate=k,h.braceExpand=function(a,b){return new i(a,b).braceExpand()},i.prototype.braceExpand=m,i.prototype.parse=n;var C={};h.makeRe=function(a,b){return new i(a,b||{}).makeRe()},i.prototype.makeRe=o,h.match=function(a,b,c){c=c||{};var d=new i(b,c);return a=a.filter(function(a){return d.match(a)}),d.options.nonull&&!a.length&&a.push(b),a},i.prototype.match=p,i.prototype.matchOne=function(a,b,c){var d=this.options;this.debug("matchOne",{this:this,file:a,pattern:b}),this.debug("matchOne",a.length,b.length);for(var e=0,f=0,g=a.length,h=b.length;e<g&&f<h;e++,f++){this.debug("matchOne loop");var i=b[f],j=a[e];if(this.debug(b,i,j),!1===i)return!1;if(i===u){this.debug("GLOBSTAR",[b,i,j]);var k=e,l=f+1;if(l===h){for(this.debug("** at the end");e<g;e++)if("."===a[e]||".."===a[e]||!d.dot&&"."===a[e].charAt(0))return!1;return!0}a:for(;k<g;){var m=a[k];if(this.debug("\nglobstar while",a,k,b,l,m),this.matchOne(a.slice(k),b.slice(l),c))return this.debug("globstar found match!",k,g,m),!0;if("."===m||".."===m||!d.dot&&"."===m.charAt(0)){this.debug("dot detected!",a,k,b,l);break a}this.debug("globstar swallow a segment, and continue"),k++}return!(!c||(this.debug("\n>>> no match, partial?",a,k,b,l),k!==g))}var n;if("string"==typeof i?(n=d.nocase?j.toLowerCase()===i.toLowerCase():j===i,this.debug("string match",i,j,n)):(n=j.match(i),this.debug("pattern match",i,j,n)),!n)return!1}if(e===g&&f===h)return!0;if(e===g)return c;if(f===h){return e===g-1&&""===a[e]}throw new Error("wtf?")}}("function"==typeof a?a:null,this,"object"==typeof b?b:null,"object"==typeof process?process.platform:"win32")},{"lru-cache":10,path:12,sigmund:13}],12:[function(a,b,c){function d(a,b){for(var c=0,d=a.length-1;d>=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function e(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d<a.length;d++)b(a[d],d,a)&&c.push(a[d]);return c}var f=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,g=function(a){return f.exec(a).slice(1)};c.resolve=function(){for(var a="",b=!1,c=arguments.length-1;c>=-1&&!b;c--){var f=c>=0?arguments[c]:process.cwd();if("string"!=typeof f)throw new TypeError("Arguments to path.resolve must be strings");f&&(a=f+"/"+a,b="/"===f.charAt(0))}return a=d(e(a.split("/"),function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."},c.normalize=function(a){var b=c.isAbsolute(a),f="/"===h(a,-1);return a=d(e(a.split("/"),function(a){return!!a}),!b).join("/"),a||b||(a="."),a&&f&&(a+="/"),(b?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(e(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;c>=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;i<g;i++)if(e[i]!==f[i]){h=i;break}for(var j=[],i=h;i<e.length;i++)j.push("..");return j=j.concat(f.slice(h)),j.join("/")},c.sep="/",c.delimiter=":",c.dirname=function(a){var b=g(a),c=b[0],d=b[1];return c||d?(d&&(d=d.substr(0,d.length-1)),c+d):"."},c.basename=function(a,b){var c=g(a)[2];return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return g(a)[3]};var h="b"==="ab".substr(-1)?function(a,b,c){return a.substr(b,c)}:function(a,b,c){return b<0&&(b=a.length+b),a.substr(b,c)}},{}],13:[function(a,b,c){function d(a,b){function c(a,g){if(!(g>b)&&"function"!=typeof a&&void 0!==a)return"object"!=typeof a||!a||a instanceof f?void(e+=a):void(-1===d.indexOf(a)&&g!==b&&(d.push(a),e+="{",Object.keys(a).forEach(function(b,d,f){if("_"!==b.charAt(0)){var h=typeof a[b];"function"!==h&&"undefined"!==h&&(e+=b,c(a[b],g+1))}})))}b=b||10;var d=[],e="",f=RegExp;return c(a,0),e}b.exports=d},{}],14:[function(a,b,c){(function(a){function c(b,c,d){return b instanceof ArrayBuffer&&(b=new Uint8Array(b)),new a(b,c,d)}c.prototype=Object.create(a.prototype),c.prototype.constructor=c,Object.keys(a).forEach(function(b){a.hasOwnProperty(b)&&(c[b]=a[b])}),b.exports=c}).call(this,a("buffer").Buffer)},{buffer:7}],15:[function(a,b,c){var d="READ",e="WRITE",f="CREATE",g="EXCLUSIVE",h="TRUNCATE",i="APPEND";b.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",NODE_TYPE_FILE:"FILE",NODE_TYPE_DIRECTORY:"DIRECTORY",NODE_TYPE_SYMBOLIC_LINK:"SYMLINK",NODE_TYPE_META:"META",S_IFREG:32768,S_IFDIR:16384,S_IFLNK:40960,DEFAULT_DIR_PERMISSIONS:493,DEFAULT_FILE_PERMISSIONS:420,FULL_READ_WRITE_EXEC_PERMISSIONS:511,READ_WRITE_PERMISSIONS:438,SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",FS_NODUPEIDCHECK:"FS_NODUPEIDCHECK",O_READ:d,O_WRITE:e,O_CREATE:f,O_EXCLUSIVE:g,O_TRUNCATE:h,O_APPEND:i,O_FLAGS:{r:[d],"r+":[d,e],w:[e,f,h],"w+":[e,d,f,h],wx:[e,f,g,h],"wx+":[e,d,f,g,h],a:[e,f,i],"a+":[e,d,f,i],ax:[e,f,g,i],"ax+":[e,d,f,g,i]},XATTR_CREATE:"CREATE",XATTR_REPLACE:"REPLACE",FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""},fsConstants:{O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_DSYNC:4194304,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_COPYFILE_EXCL:1,COPYFILE_EXCL:1}}},{}],16:[function(a,b,c){var d=a("./constants.js").NODE_TYPE_FILE;b.exports=function(a,b){this.id=a,this.type=b||d}},{"./constants.js":15}],17:[function(a,b,c){(function(a){function c(a){return a.toString("utf8")}function d(b){return new a(b,"utf8")}b.exports={encode:d,decode:c}}).call(this,a("buffer").Buffer)},{buffer:7}],18:[function(a,b,c){var d={};["9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","18:EINVAL:invalid argument","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","34:ENOENT:no such file or directory","47:EEXIST:file already exists","50:EPERM:operation not permitted","51:ELOOP:too many symbolic links encountered","53:ENOTEMPTY:directory not empty","55:EIO:i/o error","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(a){function b(a,b){Error.call(this),this.name=e,this.code=e,this.errno=c,this.message=a||f,b&&(this.path=b),this.stack=new Error(this.message).stack}a=a.split(":");var c=+a[0],e=a[1],f=a[2];b.prototype=Object.create(Error.prototype),b.prototype.constructor=b,b.prototype.toString=function(){var a=this.path?", '"+this.path+"'":"";return this.name+": "+this.message+a},d[e]=d[c]=b}),b.exports=d},{}],19:[function(a,b,c){function d(a,b,c,d,e){function f(c){a.changes.push({event:"change",path:b}),e(c)}var g=a.flags;wa(g).contains(Va)&&delete d.ctime,wa(g).contains(Ua)&&delete d.mtime;var h=!1;d.ctime&&(c.ctime=d.ctime,c.atime=d.ctime,h=!0),d.atime&&(c.atime=d.atime,h=!0),d.mtime&&(c.mtime=d.mtime,h=!0),h?a.putObject(c.id,c,f):f()}function e(a,b,c,e){function g(c,d){c?e(c):d.type!==Fa?e(new Xa.ENOTDIR("a component of the path prefix is not a directory",b)):(l=d,f(a,b,h))}function h(c,d){!c&&d?e(new Xa.EEXIST("path name already exists",b)):!c||c instanceof Xa.ENOENT?a.getObject(l.data,i):e(c)}function i(b,d){b?e(b):(m=d,_a.create({guid:a.guid,type:c},function(b,c){if(b)return void e(b);n=c,n.nlinks+=1,a.putObject(n.id,n,k)}))}function j(b){if(b)e(b);else{var c=Date.now();d(a,p,n,{mtime:c,ctime:c},e)}}function k(b){b?e(b):(m[o]=new Ya(n.id,c),a.putObject(l.data,m,j))}if(c!==Fa&&c!==Ea)return e(new Xa.EINVAL("type must be a directory or file",b));b=ya(b);var l,m,n,o=Aa(b),p=za(b);f(a,p,g)}function f(a,b,c){function d(b,d){b?c(b):d&&d.type===Ha&&d.rnode?a.getObject(d.rnode,e):c(new Xa.EFILESYSTEMERROR)}function e(a,b){a?c(a):b?c(null,b):c(new Xa.ENOENT)}function g(d,e){d?c(d):e.type===Fa&&e.data?a.getObject(e.data,h):c(new Xa.ENOTDIR("a component of the path prefix is not a directory",b))}function h(d,e){if(d)c(d);else if(wa(e).has(k)){var f=e[k].id;a.getObject(f,i)}else c(new Xa.ENOENT(null,b))}function i(a,d){a?c(a):d.type===Ga?(m++,m>La?c(new Xa.ELOOP(null,b)):j(d.data)):c(null,d)}function j(b){b=ya(b),l=za(b),k=Aa(b),Ja===k?a.getObject(Ka,d):f(a,l,g)}if(!(b=ya(b)))return c(new Xa.ENOENT("path is an empty string"));var k=Aa(b),l=za(b),m=0;Ja===k?a.getObject(Ka,d):f(a,l,g)}function g(a,b,c,e,f,g,h){function i(e){e?h(e):d(a,b,c,{ctime:Date.now()},h)}var j=c.xattrs;g===Sa&&j.hasOwnProperty(e)?h(new Xa.EEXIST("attribute already exists",b)):g!==Ta||j.hasOwnProperty(e)?(j[e]=f,a.putObject(c.id,c,i)):h(new Xa.ENOATTR(null,b))}function h(a,b){function c(c,e){!c&&e?b():!c||c instanceof Xa.ENOENT?$a.create({guid:a.guid},function(c,e){if(c)return void b(c);f=e,a.putObject(f.id,f,d)}):b(c)}function d(c){c?b(c):_a.create({guid:a.guid,id:f.rnode,type:Fa},function(c,d){if(c)return void b(c);g=d,g.nlinks+=1,a.putObject(g.id,g,e)})}function e(c){c?b(c):(h={},a.putObject(g.data,h,b))}var f,g,h;a.getObject(Ka,c)}function i(a,b,c){function e(d,e){!d&&e?c(new Xa.EEXIST(null,b)):!d||d instanceof Xa.ENOENT?f(a,q,g):c(d)}function g(b,d){b?c(b):(n=d,a.getObject(n.data,h))}function h(b,d){b?c(b):(o=d,_a.create({guid:a.guid,type:Fa},function(b,d){if(b)return void c(b);l=d,l.nlinks+=1,a.putObject(l.id,l,i)}))}function i(b){b?c(b):(m={},a.putObject(l.data,m,k))}function j(b){if(b)c(b);else{var e=Date.now();d(a,q,n,{mtime:e,ctime:e},c)}}function k(b){b?c(b):(o[p]=new Ya(l.id,Fa),a.putObject(n.data,o,j))}b=ya(b);var l,m,n,o,p=Aa(b),q=za(b);f(a,b,e)}function j(a,b,c){function e(b,d){b?c(b):(p=d,a.getObject(p.data,g))}function g(d,e){d?c(d):Ja===r?c(new Xa.EBUSY(null,b)):wa(e).has(r)?(q=e,n=q[r].id,a.getObject(n,h)):c(new Xa.ENOENT(null,b))}function h(d,e){d?c(d):e.type!==Fa?c(new Xa.ENOTDIR(null,b)):(n=e,a.getObject(n.data,i))}function i(a,d){a?c(a):(o=d,wa(o).size()>0?c(new Xa.ENOTEMPTY(null,b)):k())}function j(b){if(b)c(b);else{var e=Date.now();d(a,s,p,{mtime:e,ctime:e},l)}}function k(){delete q[r],a.putObject(p.data,q,j)}function l(b){b?c(b):a.delete(n.id,m)}function m(b){b?c(b):a.delete(n.data,c)}b=ya(b);var n,o,p,q,r=Aa(b),s=za(b);f(a,s,e)}function k(a,b,c,e){function g(c,d){c?e(c):d.type!==Fa?e(new Xa.ENOENT(null,b)):(q=d,a.getObject(q.data,h))}function h(d,f){d?e(d):(r=f,wa(r).has(v)?wa(c).contains(Pa)?e(new Xa.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",b)):(s=r[v],s.type===Fa&&wa(c).contains(Na)?e(new Xa.EISDIR("the named file is a directory and O_WRITE is set",b)):a.getObject(s.id,i)):wa(c).contains(Oa)?l():e(new Xa.ENOENT("O_CREATE is not set and the named file does not exist",b)))}function i(a,c){if(a)e(a);else{var d=c;d.type===Ga?(x++,x>La?e(new Xa.ELOOP(null,b)):j(d.data)):k(void 0,d)}}function j(d){d=ya(d),w=za(d),v=Aa(d),Ja===v&&(wa(c).contains(Na)?e(new Xa.EISDIR("the named file is a directory and O_WRITE is set",b)):f(a,b,k)),f(a,w,g)}function k(a,b){a?e(a):(t=b,e(null,t))}function l(){_a.create({guid:a.guid,type:Ea},function(b,c){if(b)return void e(b);t=c,t.nlinks+=1,a.putObject(t.id,t,m)})}function m(b){b?e(b):(u=new bb(0),u.fill(0),a.putBuffer(t.data,u,o))}function n(b){if(b)e(b);else{var c=Date.now();d(a,w,q,{mtime:c,ctime:c},p)}}function o(b){b?e(b):(r[v]=new Ya(t.id,Ea),a.putObject(q.data,r,n))}function p(a){a?e(a):e(null,t)}b=ya(b);var q,r,s,t,u,v=Aa(b),w=za(b),x=0;Ja===v?wa(c).contains(Na)?e(new Xa.EISDIR("the named file is a directory and O_WRITE is set",b)):f(a,b,k):f(a,w,g)}function l(a,b,c,e,f,g){function h(a){a?g(a):g(null,f)}function i(c){if(c)g(c);else{var e=Date.now();d(a,b.path,l,{mtime:e,ctime:e},h)}}function j(b){b?g(b):a.putObject(l.id,l,i)}function k(d,h){if(d)g(d);else{l=h;var i=new bb(f);i.fill(0),c.copy(i,0,e,e+f),b.position=f,l.size=f,l.version+=1,a.putBuffer(l.data,i,j)}}var l;a.getObject(b.id,k)}function m(a,b,c,e,f,g,h){function i(a){a?h(a):h(null,f)}function j(c){if(c)h(c);else{var e=Date.now();d(a,b.path,n,{mtime:e,ctime:e},i)}}function k(b){b?h(b):a.putObject(n.id,n,j)}function l(d,i){if(d)h(d);else{if(!(o=i))return h(new Xa.EIO("Expected Buffer"));var j=void 0!==g&&null!==g?g:b.position,l=Math.max(o.length,j+f),m=new bb(l);m.fill(0),o&&o.copy(m),c.copy(m,j,e,e+f),void 0===g&&(b.position+=f),n.size=l,n.version+=1,a.putBuffer(n.data,m,k)}}function m(b,c){b?h(b):(n=c,a.getBuffer(n.data,l))}var n,o;a.getObject(b.id,m)}function n(a,b,c,d,e,f,g){function h(a,h){if(a)g(a);else{if(!(k=h))return g(new Xa.EIO("Expected Buffer"));var i=void 0!==f&&null!==f?f:b.position;e=i+e>c.length?e-i:e,k.copy(c,d,i,i+e),void 0===f&&(b.position+=e),g(null,e)}}function i(c,d){c?g(c):d.type===Fa?g(new Xa.EISDIR("the named file is a directory",b.path)):(j=d,a.getBuffer(j.data,h))}var j,k;a.getObject(b.id,i)}function o(a,b,c){b=ya(b);Aa(b);f(a,b,c)}function p(a,b,c){b.getNode(a,c)}function q(a,b,c){function d(b,d){b?c(b):(g=d,a.getObject(g.data,e))}function e(d,e){d?c(d):(h=e,wa(h).has(i)?a.getObject(h[i].id,c):c(new Xa.ENOENT("a component of the path does not name an existing file",b)))}b=ya(b);var g,h,i=Aa(b),j=za(b);Ja===i?f(a,b,c):f(a,j,d)}function r(a,b,c,e){function g(b){b?e(b):d(a,c,u,{ctime:x},e)}function h(b,c){b?e(b):(u=c,u.nlinks+=1,a.putObject(u.id,u,g))}function i(b,c){b?e(b):a.getObject(t,h)}function j(b,c){b?e(b):(s=c,wa(s).has(v)?e(new Xa.EEXIST("newpath resolves to an existing file",v)):(s[v]=q[n],t=s[v].id,a.putObject(r.data,s,i)))}function k(b,c){b?e(b):(r=c,a.getObject(r.data,j))}function l(b,c){b?e(b):(q=c,wa(q).has(n)?q[n].type===Fa?e(new Xa.EPERM("oldpath refers to a directory")):f(a,w,k):e(new Xa.ENOENT("a component of either path prefix does not exist",n)))}function m(b,c){b?e(b):(p=c,a.getObject(p.data,l))}b=ya(b);var n=Aa(b),o=za(b);c=ya(c);var p,q,r,s,t,u,v=Aa(c),w=za(c),x=Date.now();f(a,o,m)}function s(a,b,c){function e(b){b?c(b):(delete m[o],a.putObject(l.data,m,function(b){var e=Date.now();d(a,p,l,{mtime:e,ctime:e},c)}))}function g(b){b?c(b):a.delete(n.data,e)}function h(f,h){f?c(f):(n=h,n.nlinks-=1,n.nlinks<1?a.delete(n.id,g):a.putObject(n.id,n,function(c){d(a,b,n,{ctime:Date.now()},e)}))}function i(a,b){a?c(a):b.type===Fa?c(new Xa.EPERM("unlink not permitted on directories",o)):h(null,b)}function j(b,d){b?c(b):(m=d,wa(m).has(o)?a.getObject(m[o].id,i):c(new Xa.ENOENT("a component of the path does not name an existing file",o)))}function k(b,d){b?c(b):(l=d,a.getObject(l.data,j))}b=ya(b);var l,m,n,o=Aa(b),p=za(b);f(a,p,k)}function t(a,b,c){function d(a,b){if(a)c(a);else{h=b;var d=Object.keys(h);c(null,d)}}function e(e,f){e?c(e):f.type!==Fa?c(new Xa.ENOTDIR(null,b)):(g=f,a.getObject(g.data,d))}b=ya(b);var g,h;Aa(b);f(a,b,e)}function u(a,b,c,e){function g(b,c){b?e(b):(l=c,a.getObject(l.data,h))}function h(a,b){a?e(a):(m=b,wa(m).has(o)?e(new Xa.EEXIST(null,o)):i())}function i(){_a.create({guid:a.guid,type:Ga},function(c,d){if(c)return void e(c);n=d,n.nlinks+=1,Ba(b)||(n.symlink_relpath=b,b=xa.resolve(p,b)),n.size=b.length,n.data=b,a.putObject(n.id,n,k)})}function j(b){if(b)e(b);else{var c=Date.now();d(a,p,l,{mtime:c,ctime:c},e)}}function k(b){b?e(b):(m[o]=new Ya(n.id,Ga),a.putObject(l.data,m,j))}c=ya(c);var l,m,n,o=Aa(c),p=za(c);Ja===o?e(new Xa.EEXIST(null,o)):f(a,p,g)}function v(a,b,c){function d(b,d){b?c(b):(h=d,a.getObject(h.data,e))}function e(b,d){b?c(b):(i=d,wa(i).has(j)?a.getObject(i[j].id,g):c(new Xa.ENOENT("a component of the path does not name an existing file",j)))}function g(a,d){if(a)c(a);else if(d.type!==Ga)c(new Xa.EINVAL("path not a symbolic link",b));else{var e=d.symlink_relpath?d.symlink_relpath:d.data;c(null,e)}}b=ya(b);var h,i,j=Aa(b),k=za(b);f(a,k,d)}function w(a,b,c,e){function g(c,d){c?e(c):d.type===Fa?e(new Xa.EISDIR(null,b)):(k=d,a.getBuffer(k.data,h))}function h(b,d){if(b)e(b);else{if(!d)return e(new Xa.EIO("Expected Buffer"));var f=new bb(c);f.fill(0),d&&d.copy(f),a.putBuffer(k.data,f,j)}}function i(c){if(c)e(c);else{var f=Date.now();d(a,b,k,{mtime:f,ctime:f},e)}}function j(b){b?e(b):(k.size=c,k.version+=1,a.putObject(k.id,k,i))}b=ya(b);var k;c<0?e(new Xa.EINVAL("length cannot be negative")):f(a,b,g)}function x(a,b,c,e){function f(b,c){b?e(b):c.type===Fa?e(new Xa.EISDIR):(j=c,a.getBuffer(j.data,g))}function g(b,d){if(b)e(b);else{var f;if(!d)return e(new Xa.EIO("Expected Buffer"));d?f=d.slice(0,c):(f=new bb(c),f.fill(0)),a.putBuffer(j.data,f,i)}}function h(c){if(c)e(c);else{var f=Date.now();d(a,b.path,j,{mtime:f,ctime:f},e)}}function i(b){b?e(b):(j.size=c,j.version+=1,a.putObject(j.id,j,h))}var j;c<0?e(new Xa.EINVAL("length cannot be negative")):b.getNode(a,f)}function y(a,b,c,e,g){function h(f,h){f?g(f):d(a,b,h,{atime:c,ctime:e,mtime:e},g)}b=ya(b),"number"!=typeof c||"number"!=typeof e?g(new Xa.EINVAL("atime and mtime must be number",b)):c<0||e<0?g(new Xa.EINVAL("atime and mtime must be positive integers",b)):f(a,b,h)}function z(a,b,c,e,f){function g(g,h){g?f(g):d(a,b.path,h,{atime:c,ctime:e,mtime:e},f)}"number"!=typeof c||"number"!=typeof e?f(new Xa.EINVAL("atime and mtime must be a number")):c<0||e<0?f(new Xa.EINVAL("atime and mtime must be positive integers")):b.getNode(a,g)}function A(a,b,c,d,e,h){function i(f,i){if(f)return h(f);g(a,b,i,c,d,e,h)}b=ya(b),"string"!=typeof c?h(new Xa.EINVAL("attribute name must be a string",b)):c?null!==e&&e!==Sa&&e!==Ta?h(new Xa.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",b)):f(a,b,i):h(new Xa.EINVAL("attribute name cannot be an empty string",b))}function B(a,b,c,d,e,f){function h(h,i){if(h)return f(h);g(a,b.path,i,c,d,e,f)}"string"!=typeof c?f(new Xa.EINVAL("attribute name must be a string")):c?null!==e&&e!==Sa&&e!==Ta?f(new Xa.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):b.getNode(a,h):f(new Xa.EINVAL("attribute name cannot be an empty string"))}function C(a,b,c,d){function e(a,e){if(a)return d(a);var f=e.xattrs;f.hasOwnProperty(c)?d(null,f[c]):d(new Xa.ENOATTR(null,b))}b=ya(b),"string"!=typeof c?d(new Xa.EINVAL("attribute name must be a string",b)):c?f(a,b,e):d(new Xa.EINVAL("attribute name cannot be an empty string",b))}function D(a,b,c,d){function e(a,b){if(a)return d(a);var e=b.xattrs;e.hasOwnProperty(c)?d(null,e[c]):d(new Xa.ENOATTR)}"string"!=typeof c?d(new Xa.EINVAL):c?b.getNode(a,e):d(new Xa.EINVAL("attribute name cannot be an empty string"))}function E(a,b,c,e){function g(f,g){function h(c){c?e(c):d(a,b,g,{ctime:Date.now()},e)}if(f)return e(f);var i=g.xattrs;i.hasOwnProperty(c)?(delete i[c],a.putObject(g.id,g,h)):e(new Xa.ENOATTR(null,b))}b=ya(b),"string"!=typeof c?e(new Xa.EINVAL("attribute name must be a string",b)):c?f(a,b,g):e(new Xa.EINVAL("attribute name cannot be an empty string",b))}function F(a,b,c,e){function f(f,g){function h(c){c?e(c):d(a,b.path,g,{ctime:Date.now()},e)}if(f)return e(f);var i=g.xattrs;i.hasOwnProperty(c)?(delete i[c],a.putObject(g.id,g,h)):e(new Xa.ENOATTR)}"string"!=typeof c?e(new Xa.EINVAL("attribute name must be a string")):c?b.getNode(a,f):e(new Xa.EINVAL("attribute name cannot be an empty string"))}function G(a){return wa(Ra).has(a)?Ra[a]:null}function H(a,b,c){return a?"function"==typeof a?a={encoding:b,flag:c}:"string"==typeof a&&(a={encoding:a,flag:c}):a={encoding:b,flag:c},a}function I(a,b,c){var d;return"function"==typeof b&&(c=b,b=!1),a?Ca(a)?d=new Xa.EINVAL("Path must be a string without null bytes.",a):b||Ba(a)||(d=new Xa.EINVAL("Path must be absolute.",a)):d=new Xa.EINVAL("Path must be a string",a),!d||(c(d),!1)}function J(a,b,c,d,e,f){function g(b,e){if(b)f(b);else{var g;g=wa(d).contains(Qa)?e.size:0;var h=new Za(c,e.id,d,g),i=a.allocDescriptor(h);f(null,i)}}f=arguments[arguments.length-1],I(c,f)&&(d=G(d),d||f(new Xa.EINVAL("flags is not valid"),c),k(b,c,d,g))}function K(a,b,c,d){wa(a.openFiles).has(c)?(a.releaseDescriptor(c),d(null)):d(new Xa.EBADF)}function L(a,b,c,d,f){I(c,f)&&e(b,c,d,f)}function M(a,b,c,d,e){if(arguments.length<5)e=d,d=Ia;else if(!(d=Z(d,Ia,e)))return;I(c,e)&&i(b,c,e)}function N(a,b,c,d){I(c,d)&&j(b,c,d)}function O(a,b,c,d){function e(b,e){if(b)d(b);else{var f=new ab(c,e,a.name);d(null,f)}}I(c,d)&&o(b,c,e)}function P(a,b,c,d){function e(b,c){if(b)d(b);else{var e=new ab(f.path,c,a.name);d(null,e)}}var f=a.openFiles[c];f?p(b,f,e):d(new Xa.EBADF)}function Q(a,b,c,d,e){I(c,e)&&I(d,e)&&r(b,c,d,e)}function R(a,b,c,d){I(c,d)&&s(b,c,d)}function S(a,b,c,d,e,f,g,h){function i(a,b){h(a,b||0,d)}e=void 0===e?0:e,f=void 0===f?d.length-e:f,h=arguments[arguments.length-1];var j=a.openFiles[c];j?wa(j.flags).contains(Ma)?n(b,j,d,e,f,g,i):h(new Xa.EBADF("descriptor does not permit reading")):h(new Xa.EBADF)}function T(a,b,c,d,e){if(e=arguments[arguments.length-1],d=H(d,null,"r"),I(c,e)){var f=G(d.flag||"r");if(!f)return e(new Xa.EINVAL("flags is not valid",c));k(b,c,f,function(g,h){function i(){a.releaseDescriptor(k)}if(g)return e(g);var j=new Za(c,h.id,f,0),k=a.allocDescriptor(j);p(b,j,function(f,g){if(f)return i(),e(f);var h=new ab(j.path,g,a.name);if(h.isDirectory())return i(),e(new Xa.EISDIR("illegal operation on directory",c));var k=h.size,l=new bb(k);l.fill(0),n(b,j,l,0,k,0,function(a,b){if(i(),a)return e(a);var c;c="utf8"===d.encoding?Wa.decode(l):l,e(null,c)})})})}}function U(a,b,c,d,e,f,g,h){h=arguments[arguments.length-1],e=void 0===e?0:e,f=void 0===f?d.length-e:f;var i=a.openFiles[c];i?wa(i.flags).contains(Na)?d.length-e<f?h(new Xa.EIO("intput buffer is too small")):m(b,i,d,e,f,g,h):h(new Xa.EBADF("descriptor does not permit writing")):h(new Xa.EBADF)}function V(a,b,c,d,e,f){if(f=arguments[arguments.length-1],e=H(e,"utf8","w"),I(c,f)){var g=G(e.flag||"w");if(!g)return f(new Xa.EINVAL("flags is not valid",c));d=d||"","number"==typeof d&&(d=""+d),"string"==typeof d&&"utf8"===e.encoding&&(d=Wa.encode(d)),k(b,c,g,function(e,h){if(e)return f(e);var i=new Za(c,h.id,g,0),j=a.allocDescriptor(i);l(b,i,d,0,d.length,function(b,c){if(a.releaseDescriptor(j),b)return f(b);f(null)})})}}function W(a,b,c,d,e,f){if(f=arguments[arguments.length-1],e=H(e,"utf8","a"),I(c,f)){var g=G(e.flag||"a");if(!g)return f(new Xa.EINVAL("flags is not valid",c));d=d||"","number"==typeof d&&(d=""+d),"string"==typeof d&&"utf8"===e.encoding&&(d=Wa.encode(d)),k(b,c,g,function(e,h){if(e)return f(e);var i=new Za(c,h.id,g,h.size),j=a.allocDescriptor(i);m(b,i,d,0,d.length,i.position,function(b,c){if(a.releaseDescriptor(j),b)return f(b);f(null)})})}}function X(a,b,c,d){function e(a,b){d(!a)}O(a,b,c,e)}function Y(a){return a===a>>>0}function Z(a,b,c){if("function"==typeof b&&(c=b,b=void 0),Y(a))return a&Ia;if("number"==typeof a)return Number.isInteger(a),c(new Xa.EINVAL("mode not a valid an integer value",a)),!1;if("string"==typeof a){if(!cb.test(a))return c(new Xa.EINVAL("mode not a valid octal string",a)),!1;return parseInt(a,8)&Ia}return void 0!==b?b:(c(new Xa.EINVAL("mode not valid",a)),!1)}function $(a,b,c,e){function g(f,g){f?e(f):(_a.setMode(c,g),d(a,b,g,{mtime:Date.now()},e))}b=ya(b),"number"!=typeof c?e(new Xa.EINVAL("mode must be number",b)):f(a,b,g)}function _(a,b,c,e){function f(f,g){f?e(f):(g.mode=c,d(a,b.path,g,{mtime:Date.now()},e))}"number"!=typeof c?e(new Xa.EINVAL("mode must be a number")):b.getNode(a,f)}function aa(a,b,c,e,g){function h(f,h){f?g(f):(h.uid=c,h.gid=e,d(a,b,h,{mtime:Date.now()},g))}b=ya(b),f(a,b,h)}function ba(a,b,c,e,f){function g(g,h){g?f(g):(h.uid=c,h.gid=e,d(a,b.path,h,{mtime:Date.now()},f))}
b.getNode(a,g)}function ca(a,b,c,d,e){I(c,e)&&C(b,c,d,e)}function da(a,b,c,d,e){var f=a.openFiles[c];f?D(b,f,d,e):e(new Xa.EBADF)}function ea(a,b,c,d,e,f,g){"function"==typeof f&&(g=f,f=null),I(c,g)&&A(b,c,d,e,f,g)}function fa(a,b,c,d,e,f,g){"function"==typeof f&&(g=f,f=null);var h=a.openFiles[c];h?wa(h.flags).contains(Na)?B(b,h,d,e,f,g):g(new Xa.EBADF("descriptor does not permit writing")):g(new Xa.EBADF)}function ga(a,b,c,d,e){I(c,e)&&E(b,c,d,e)}function ha(a,b,c,d,e){var f=a.openFiles[c];f?wa(f.flags).contains(Na)?F(b,f,d,e):e(new Xa.EBADF("descriptor does not permit writing")):e(new Xa.EBADF)}function ia(a,b,c,d,e,f){function g(a,b){a?f(a):b.size+d<0?f(new Xa.EINVAL("resulting file offset would be negative")):(h.position=b.size+d,f(null,h.position))}var h=a.openFiles[c];h||f(new Xa.EBADF),"SET"===e?d<0?f(new Xa.EINVAL("resulting file offset would be negative")):(h.position=d,f(null,h.position)):"CUR"===e?h.position+d<0?f(new Xa.EINVAL("resulting file offset would be negative")):(h.position+=d,f(null,h.position)):"END"===e?p(b,h,g):f(new Xa.EINVAL("whence argument is not a proper value"))}function ja(a,b,c,d){I(c,d)&&t(b,c,d)}function ka(a,b,c,d,e,f){if(I(c,f)){var g=Date.now();d=d||g,e=e||g,y(b,c,d,e,f)}}function la(a,b,c,d,e,f){var g=Date.now();d=d||g,e=e||g;var h=a.openFiles[c];h?wa(h.flags).contains(Na)?z(b,h,d,e,f):f(new Xa.EBADF("descriptor does not permit writing")):f(new Xa.EBADF)}function ma(a,b,c,d,e){I(c,e)&&(d=Z(d,"mode"))&&$(b,c,d,e)}function na(a,b,c,d,e){if(d=Z(d,"mode")){var f=a.openFiles[c];f?wa(f.flags).contains(Na)?_(b,f,d,e):e(new Xa.EBADF("descriptor does not permit writing")):e(new Xa.EBADF)}}function oa(a,b,c,d,e,f){if(I(c,f))return Y(d)?Y(e)?void aa(b,c,d,e,f):f(new Xa.EINVAL("gid must be a valid integer",e)):f(new Xa.EINVAL("uid must be a valid integer",d))}function pa(a,b,c,d,e,f){if(!Y(d))return f(new Xa.EINVAL("uid must be a valid integer",d));if(!Y(e))return f(new Xa.EINVAL("gid must be a valid integer",e));var g=a.openFiles[c];g?wa(g.flags).contains(Na)?ba(b,g,d,e,f):f(new Xa.EBADF("descriptor does not permit writing")):f(new Xa.EBADF)}function qa(a,b,c,e,g){function h(a,c){a?g(a):(y=c,d(b,e,y,{ctime:D},g))}function i(a){a?g(a):b.getObject(x[C].id,h)}function k(a){a?g(a):(u.id===w.id&&(v=x),delete v[B],b.putObject(u.data,v,i))}function l(a){a?g(a):(x[C]=v[B],b.putObject(w.data,x,k))}function m(a,c){a?g(a):(x=c,wa(x).has(C)?j(b,e,l):l())}function n(a,c){a?g(a):(w=c,b.getObject(w.data,m))}function o(a,c){a?g(a):(v=c,f(b,A,n))}function p(a,c){a?g(a):(u=c,b.getObject(c.data,o))}function q(a){a?g(a):s(b,c,g)}function t(a,d){a?g(a):d.type===Fa?f(b,z,p):r(b,c,e,q)}if(I(c,g)&&I(e,g)){c=ya(c),e=ya(e);var u,v,w,x,y,z=xa.dirname(c),A=xa.dirname(c),B=xa.basename(c),C=xa.basename(e),D=Date.now();f(b,c,t)}}function ra(a,b,c,d,e,f){f=arguments[arguments.length-1],I(c,!0,f)&&I(d,f)&&u(b,c,d,f)}function sa(a,b,c,d){I(c,d)&&v(b,c,d)}function ta(a,b,c,d){function e(b,e){if(b)d(b);else{var f=new ab(c,e,a.name);d(null,f)}}I(c,d)&&q(b,c,e)}function ua(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0,I(c,e)&&w(b,c,d,e)}function va(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0;var f=a.openFiles[c];f?wa(f.flags).contains(Na)?x(b,f,d,e):e(new Xa.EBADF("descriptor does not permit writing")):e(new Xa.EBADF)}var wa=a("../../lib/nodash.js"),xa=a("../path.js"),ya=xa.normalize,za=xa.dirname,Aa=xa.basename,Ba=xa.isAbsolute,Ca=xa.isNull,Da=a("../constants.js"),Ea=Da.NODE_TYPE_FILE,Fa=Da.NODE_TYPE_DIRECTORY,Ga=Da.NODE_TYPE_SYMBOLIC_LINK,Ha=Da.NODE_TYPE_META,Ia=(Da.DEFAULT_FILE_PERMISSIONS,Da.DEFAULT_DIR_PERMISSIONS,Da.FULL_READ_WRITE_EXEC_PERMISSIONS),Ja=Da.ROOT_DIRECTORY_NAME,Ka=Da.SUPER_NODE_ID,La=Da.SYMLOOP_MAX,Ma=Da.O_READ,Na=Da.O_WRITE,Oa=Da.O_CREATE,Pa=Da.O_EXCLUSIVE,Qa=(Da.O_TRUNCATE,Da.O_APPEND),Ra=Da.O_FLAGS,Sa=Da.XATTR_CREATE,Ta=Da.XATTR_REPLACE,Ua=Da.FS_NOMTIME,Va=Da.FS_NOCTIME,Wa=a("../encoding.js"),Xa=a("../errors.js"),Ya=a("../directory-entry.js"),Za=a("../open-file-description.js"),$a=a("../super-node.js"),_a=a("../node.js"),ab=a("../stats.js"),bb=a("../buffer.js"),cb=/^[0-7]+$/;b.exports={ensureRootDirectory:h,open:J,chmod:ma,fchmod:na,chown:oa,fchown:pa,close:K,mknod:L,mkdir:M,rmdir:N,unlink:R,stat:O,fstat:P,link:Q,read:S,readFile:T,write:U,writeFile:V,appendFile:W,exists:X,getxattr:ca,fgetxattr:da,setxattr:ea,fsetxattr:fa,removexattr:ga,fremovexattr:ha,lseek:ia,readdir:ja,utimes:ka,futimes:la,rename:qa,symlink:ra,readlink:sa,lstat:ta,truncate:ua,ftruncate:va}},{"../../lib/nodash.js":4,"../buffer.js":14,"../constants.js":15,"../directory-entry.js":16,"../encoding.js":17,"../errors.js":18,"../node.js":23,"../open-file-description.js":24,"../path.js":25,"../stats.js":33,"../super-node.js":34}],20:[function(a,b,c){function d(a){return"function"==typeof a?a:function(a){if(a)throw a}}function e(a){a&&console.error("Filer error: ",a)}function f(a,b){function c(){J.forEach(function(a){a.call(this)}.bind(G)),J=null}function d(a){return function(b){function c(b){var d=C();a.getObject(d,function(a,e){if(a)return void b(a);e?c(b):b(null,d)})}if(g(B).contains(p))return void b(null,C());c(b)}}function f(a){if(a.length){var b=s.getInstance();a.forEach(function(a){b.emit(a.event,a.path)})}}a=a||{},b=b||e;var B=a.flags,C=a.guid?a.guid:v,D=a.provider||new q.Default(a.name||k),E=a.name||D.name,F=g(B).contains(l),G=this;G.readyState=n,G.name=E,G.error=null,G.stdin=w,G.stdout=x,G.stderr=y,G.constants=j.fsConstants,this.Shell=r.bind(void 0,this);var H={},I=z;Object.defineProperty(this,"openFiles",{get:function(){return H}}),this.allocDescriptor=function(a){var b=I++;return H[b]=a,b},this.releaseDescriptor=function(a){delete H[a]};var J=[];this.queueOrRun=function(a){var b;return m==G.readyState?a.call(G):o==G.readyState?b=new u.EFILESYSTEMERROR("unknown error"):J.push(a),b},this.watch=function(a,b,c){if(h(a))throw new Error("Path must be a string without null bytes.");"function"==typeof b&&(c=b,b={}),b=b||{},c=c||i;var d=new t;return d.start(a,!1,b.recursive),d.on("change",c),d},D.open(function(a){function e(a){function e(a){var b=D[a]();return b.flags=B,b.changes=[],b.guid=d(b),b.close=function(){var a=b.changes;f(a),a.length=0},b}G.provider={openReadWriteContext:function(){return e("getReadWriteContext")},openReadOnlyContext:function(){return e("getReadOnlyContext")}},G.readyState=a?o:m,c(),b(a,G)}if(a)return e(a);var g=D.getReadWriteContext();g.guid=d(g),F?g.clear(function(a){if(a)return e(a);A.ensureRootDirectory(g,e)}):A.ensureRootDirectory(g,e)})}var g=a("../../lib/nodash.js"),h=a("../path.js").isNull,i=a("../shared.js").nop,j=a("../constants.js"),k=j.FILE_SYSTEM_NAME,l=j.FS_FORMAT,m=j.FS_READY,n=j.FS_PENDING,o=j.FS_ERROR,p=j.FS_NODUPEIDCHECK,q=a("../providers/index.js"),r=a("../shell/shell.js"),s=a("../../lib/intercom.js"),t=a("../fs-watcher.js"),u=a("../errors.js"),v=a("../shared.js").guid,w=j.STDIN,x=j.STDOUT,y=j.STDERR,z=j.FIRST_DESCRIPTOR,A=a("./implementation.js");f.providers=q,["open","chmod","fchmod","chown","fchown","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(a){f.prototype[a]=function(){var b=this,c=Array.prototype.slice.call(arguments,0),e=c.length-1,f="function"!=typeof c[e],g=d(c[e]),h=b.queueOrRun(function(){function d(){h.close(),g.apply(b,arguments)}var h=b.provider.openReadWriteContext();if(o===b.readyState){var i=new u.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return g.call(b,i)}f?c.push(d):c[e]=d;var j=[b,h].concat(c);A[a].apply(null,j)});h&&g(h)}}),b.exports=f},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":15,"../errors.js":18,"../fs-watcher.js":21,"../path.js":25,"../providers/index.js":26,"../shared.js":30,"../shell/shell.js":32,"./implementation.js":19}],21:[function(a,b,c){function d(){function a(a){(c===a||h&&0===a.indexOf(b))&&d.trigger("change","change",a)}e.call(this);var b,c,d=this,h=!1;d.start=function(d,e,i){if(!c){if(f.isNull(d))throw new Error("Path must be a string without null bytes.");c=f.normalize(d),h=!0===i,h&&(b="/"===c?"/":c+"/");g.getInstance().on("change",a)}},d.close=function(){g.getInstance().off("change",a),d.removeAllListeners("change")}}var e=a("../lib/eventemitter.js"),f=a("./path.js"),g=a("../lib/intercom.js");d.prototype=new e,d.prototype.constructor=d,b.exports=d},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":25}],22:[function(a,b,c){b.exports={FileSystem:a("./filesystem/interface.js"),Buffer:a("./buffer.js"),Path:a("./path.js"),Errors:a("./errors.js"),Shell:a("./shell/shell.js")}},{"./buffer.js":14,"./errors.js":18,"./filesystem/interface.js":20,"./path.js":25,"./shell/shell.js":32}],23:[function(a,b,c){function d(a,b){switch(a){case h:return(b||n)|k;case i:return(b||m)|l;case g:default:return(b||m)|j}}function e(a){var b=Date.now();this.id=a.id,this.type=a.type||g,this.size=a.size||0,this.atime=a.atime||b,this.ctime=a.ctime||b,this.mtime=a.mtime||b,this.flags=a.flags||[],this.xattrs=a.xattrs||{},this.nlinks=a.nlinks||0,this.data=a.data,this.version=a.version||1,this.mode=a.mode||d(this.type),this.uid=a.uid||0,this.gid=a.gid||0}function f(a,b,c){a[b]?c(null):a.guid(function(d,e){a[b]=e,c(d)})}var g=a("./constants.js").NODE_TYPE_FILE,h=a("./constants.js").NODE_TYPE_DIRECTORY,i=a("./constants.js").NODE_TYPE_SYMBOLIC_LINK,j=(a("./constants.js").NODE_TYPE_META,a("./constants.js").ROOT_DIRECTORY_NAME,a("./constants.js").S_IFREG),k=a("./constants.js").S_IFDIR,l=a("./constants.js").S_IFLNK,m=a("./constants.js").DEFAULT_FILE_PERMISSIONS,n=a("./constants.js").DEFAULT_DIR_PERMISSIONS;e.create=function(a,b){f(a,"id",function(c){if(c)return void b(c);f(a,"data",function(c){if(c)return void b(c);b(null,new e(a))})})},e.setMode=function(a,b){b.mode=d(b.type,a)},b.exports=e},{"./constants.js":15}],24:[function(a,b,c){function d(a,b,c,d){this.path=a,this.id=b,this.flags=c,this.position=d}var e=a("./errors.js");d.prototype.getNode=function(a,b){function c(a,c){return a?b(a):c?void b(null,c):b(new e.EBADF("file descriptor refers to unknown node",f))}var d=this.id,f=this.path;a.getObject(d,c)},b.exports=d},{"./errors.js":18}],25:[function(a,b,c){function d(a,b){for(var c=0,d=a.length-1;d>=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function e(){for(var a="",b=!1,c=arguments.length-1;c>=-1&&!b;c--){var e=c>=0?arguments[c]:"/";"string"==typeof e&&e&&(a=e+"/"+a,b="/"===e.charAt(0))}return a=d(a.split("/").filter(function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."}function f(a){var b="/"===a.charAt(0);a.substr(-1);return a=d(a.split("/").filter(function(a){return!!a}),!b).join("/"),a||b||(a="."),(b?"/":"")+a}function g(){return f(Array.prototype.slice.call(arguments,0).filter(function(a,b){return a&&"string"==typeof a}).join("/"))}function h(a,b){function c(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;c>=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=e(a).substr(1),b=e(b).substr(1);for(var d=c(a.split("/")),f=c(b.split("/")),g=Math.min(d.length,f.length),h=g,i=0;i<g;i++)if(d[i]!==f[i]){h=i;break}for(var j=[],i=h;i<d.length;i++)j.push("..");return j=j.concat(f.slice(h)),j.join("/")}function i(a){var b=q(a),c=b[0],d=b[1];return c||d?(d&&(d=d.substr(0,d.length-1)),c+d):"."}function j(a,b){var c=q(a)[2];return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),""===c?"/":c}function k(a){return q(a)[3]}function l(a){return"/"===a.charAt(0)}function m(a){return-1!==(""+a).indexOf("\0")}function n(a){return a.replace(/\/*$/,"/")}function o(a){return a=a.replace(/\/*$/,""),""===a?"/":a}var p=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,q=function(a){var b=p.exec(a);return[b[1]||"",b[2]||"",b[3]||"",b[4]||""]};b.exports={normalize:f,resolve:e,join:g,relative:h,sep:"/",delimiter:":",dirname:i,basename:j,extname:k,isAbsolute:l,isNull:m,addTrailing:n,removeTrailing:o}},{}],26:[function(a,b,c){var d=a("./indexeddb.js"),e=a("./websql.js"),f=a("./memory.js");b.exports={IndexedDB:d,WebSQL:e,Memory:f,Default:d,Fallback:function(){function a(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return d.isSupported()?d:e.isSupported()?e:(a.isSupported=function(){return!1},a)}()}},{"./indexeddb.js":27,"./memory.js":28,"./websql.js":29}],27:[function(a,b,c){(function(c){function d(a,b){this.db=a,this.mode=b}function e(a){this.name=a||f,this.db=null}var f=a("../constants.js").FILE_SYSTEM_NAME,g=a("../constants.js").FILE_STORE_NAME,h=a("../constants.js").IDB_RW,i=a("../constants.js").IDB_RO,j=(a("../errors.js"),a("../buffer.js")),k=c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB;d.prototype._getObjectStore=function(){if(this.objectStore)return this.objectStore;var a=this.db.transaction(g,this.mode);return this.objectStore=a.objectStore(g),this.objectStore},d.prototype.clear=function(a){try{var b=this._getObjectStore(),c=b.clear();c.onsuccess=function(){a()},c.onerror=function(b){b.preventDefault(),a(b.error)}}catch(d){a(d)}},d.prototype._get=function(a,b){try{var c=this._getObjectStore(),d=c.get(a);d.onsuccess=function(a){var c=a.target.result;b(null,c)},d.onerror=function(a){a.preventDefault(),b(a.error)}}catch(e){b(e)}},d.prototype.getObject=function(a,b){this._get(a,b)},d.prototype.getBuffer=function(a,b){this._get(a,function(a,c){if(a)return b(a);b(null,new j(c))})},d.prototype._put=function(a,b,c){try{var d=this._getObjectStore(),e=d.put(b,a);e.onsuccess=function(a){var b=a.target.result;c(null,b)},e.onerror=function(a){a.preventDefault(),c(a.error)}}catch(f){c(f)}},d.prototype.putObject=function(a,b,c){this._put(a,b,c)},d.prototype.putBuffer=function(a,b,c){var d=b.buffer;this._put(a,d,c)},d.prototype.delete=function(a,b){try{var c=this._getObjectStore(),d=c.delete(a);d.onsuccess=function(a){var c=a.target.result;b(null,c)},d.onerror=function(a){a.preventDefault(),b(a.error)}}catch(e){b(e)}},e.isSupported=function(){return!!k},e.prototype.open=function(a){var b=this;if(b.db)return a();try{var c=k.open(b.name);c.onupgradeneeded=function(a){var b=a.target.result;b.objectStoreNames.contains(g)&&b.deleteObjectStore(g),b.createObjectStore(g)},c.onsuccess=function(c){b.db=c.target.result,a()},c.onerror=function(b){b.preventDefault(),a(b.error)}}catch(d){a(d)}},e.prototype.getReadOnlyContext=function(){return new d(this.db,i)},e.prototype.getReadWriteContext=function(){return new d(this.db,h)},b.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../buffer.js":14,"../constants.js":15,"../errors.js":18}],28:[function(a,b,c){function d(a,b){this.readOnly=b,this.objectStore=a}function e(a){this.name=a||f}var f=a("../constants.js").FILE_SYSTEM_NAME,g=a("../../lib/async.js").setImmediate,h=function(){var a={};return function(b){return a.hasOwnProperty(b)||(a[b]={}),a[b]}}();d.prototype.clear=function(a){if(this.readOnly)return void g(function(){a("[MemoryContext] Error: write operation on read only context")});var b=this.objectStore;Object.keys(b).forEach(function(a){delete b[a]}),g(a)},d.prototype.getObject=d.prototype.getBuffer=function(a,b){var c=this;g(function(){b(null,c.objectStore[a])})},d.prototype.putObject=d.prototype.putBuffer=function(a,b,c){if(this.readOnly)return void g(function(){c("[MemoryContext] Error: write operation on read only context")});this.objectStore[a]=b,g(c)},d.prototype.delete=function(a,b){if(this.readOnly)return void g(function(){b("[MemoryContext] Error: write operation on read only context")});delete this.objectStore[a],g(b)},e.isSupported=function(){return!0},e.prototype.open=function(a){this.db=h(this.name),g(a)},e.prototype.getReadOnlyContext=function(){return new d(this.db,!0)},e.prototype.getReadWriteContext=function(){return new d(this.db,!1)},b.exports=e},{"../../lib/async.js":1,"../constants.js":15}],29:[function(a,b,c){(function(c){function d(a,b){var c=this;this.getTransaction=function(d){if(c.transaction)return void d(c.transaction);a[b?"readTransaction":"transaction"](function(a){c.transaction=a,d(a)})}}function e(a,b,c){function d(a,b){var d=0===b.rows.length?null:b.rows.item(0).data;c(null,d)}function e(a,b){c(b)}a(function(a){a.executeSql("SELECT data FROM "+i+" WHERE id = ? LIMIT 1;",[b],d,e)})}function f(a,b,c,d){function e(a,b){d(null)}function f(a,b){d(b)}a(function(a){a.executeSql("INSERT OR REPLACE INTO "+i+" (id, data) VALUES (?, ?);",[b,c],e,f)})}function g(a){this.name=a||h,this.db=null}var h=a("../constants.js").FILE_SYSTEM_NAME,i=a("../constants.js").FILE_STORE_NAME,j=a("../constants.js").WSQL_VERSION,k=a("../constants.js").WSQL_SIZE,l=a("../constants.js").WSQL_DESC,m=a("../errors.js"),n=a("../buffer.js"),o=a("base64-arraybuffer");d.prototype.clear=function(a){function b(b,c){a(c)}function c(b,c){a(null)}this.getTransaction(function(a){a.executeSql("DELETE FROM "+i+";",[],c,b)})},d.prototype.getObject=function(a,b){e(this.getTransaction,a,function(a,c){if(a)return b(a);try{c&&(c=JSON.parse(c))}catch(d){return b(d)}b(null,c)})},d.prototype.getBuffer=function(a,b){e(this.getTransaction,a,function(a,c){if(a)return b(a);if(c||""===c){var d=o.decode(c);c=new n(d)}b(null,c)})},d.prototype.putObject=function(a,b,c){var d=JSON.stringify(b);f(this.getTransaction,a,d,c)},d.prototype.putBuffer=function(a,b,c){var d=o.encode(b.buffer);f(this.getTransaction,a,d,c)},d.prototype.delete=function(a,b){function c(a,c){b(null)}function d(a,c){b(c)}this.getTransaction(function(b){b.executeSql("DELETE FROM "+i+" WHERE id = ?;",[a],c,d)})},g.isSupported=function(){return!!c.openDatabase},g.prototype.open=function(a){function b(b,c){5===c.code&&a(new m.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),a(c)}function d(b,c){e.db=f,a()}var e=this;if(e.db)return a();var f=c.openDatabase(e.name,j,l,k);if(!f)return void a("[WebSQL] Unable to open database.");f.transaction(function(a){function c(a){a.executeSql("CREATE INDEX IF NOT EXISTS idx_"+i+"_id on "+i+" (id);",[],d,b)}a.executeSql("CREATE TABLE IF NOT EXISTS "+i+" (id unique, data TEXT);",[],c,b)})},g.prototype.getReadOnlyContext=function(){return new d(this.db,!0)},g.prototype.getReadWriteContext=function(){return new d(this.db,!1)},b.exports=g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../buffer.js":14,"../constants.js":15,"../errors.js":18,"base64-arraybuffer":5}],30:[function(a,b,c){function d(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:3&b|8).toString(16)}).toUpperCase()}function e(){}function f(a){for(var b=[],c=a.length,d=0;d<c;d++)b[d]=a[d];return b}b.exports={guid:d,u8toArray:f,nop:e}},{}],31:[function(a,b,c){var d=a("../constants.js").ENVIRONMENT;b.exports=function(a){a=a||{},a.TMP=a.TMP||d.TMP,a.PATH=a.PATH||d.PATH,this.get=function(b){return a[b]},this.set=function(b,c){a[b]=c}}},{"../constants.js":15}],32:[function(a,b,c){function d(a,b){b=b||{};var c=new g(b.env),d="/";Object.defineProperty(this,"fs",{get:function(){return a},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return c},enumerable:!0}),this.cd=function(b,c){b=e.resolve(d,b),a.stat(b,function(a,e){if(a)return void c(new f.ENOTDIR(null,b));"DIRECTORY"===e.type?(d=b,c()):c(new f.ENOTDIR(null,b))})},this.pwd=function(){return d}}var e=a("../path.js"),f=a("../errors.js"),g=a("./environment.js"),h=a("../../lib/async.js"),i=(a("../encoding.js"),a("minimatch"));d.prototype.exec=function(a,b,c){var d=this,f=d.fs;"function"==typeof b&&(c=b,b=[]),b=b||[],c=c||function(){},a=e.resolve(d.pwd(),a),f.readFile(a,"utf8",function(a,d){if(a)return void c(a);try{new Function("fs","args","callback",d)(f,b,c)}catch(e){c(e)}})},d.prototype.touch=function(a,b,c){function d(a){h.writeFile(a,"",c)}function f(a){var d=Date.now(),e=b.date||d,f=b.date||d;h.utimes(a,e,f,c)}var g=this,h=g.fs;"function"==typeof b&&(c=b,b={}),b=b||{},c=c||function(){},a=e.resolve(g.pwd(),a),h.stat(a,function(e,g){e?!0===b.updateOnly?c():d(a):f(a)})},d.prototype.cat=function(a,b){function c(a,b){var c=e.resolve(d.pwd(),a);g.readFile(c,"utf8",function(a,c){if(a)return void b(a);i+=c+"\n",b()})}var d=this,g=d.fs,i="";if(b=b||function(){},!a)return void b(new f.EINVAL("Missing files argument"));a="string"==typeof a?[a]:a,h.eachSeries(a,c,function(a){a?b(a):b(null,i.replace(/\n$/,""))})},d.prototype.ls=function(a,b,c){function d(a,c){var f=e.resolve(g.pwd(),a),j=[];i.readdir(f,function(a,g){function k(a,c){a=e.join(f,a),i.stat(a,function(a,g){if(a)return void c(a);var h=g;b.recursive&&"DIRECTORY"===g.type?d(e.join(f,h.name),function(a,b){if(a)return void c(a);h.contents=b,j.push(h),c()}):(j.push(h),c())})}if(a)return void c(a);h.eachSeries(g,k,function(a){c(a,j)})})}var g=this,i=g.fs;if("function"==typeof b&&(c=b,b={}),b=b||{},c=c||function(){},!a)return void c(new f.EINVAL("Missing dir argument"));d(a,c)},d.prototype.rm=function(a,b,c){function d(a,c){a=e.resolve(g.pwd(),a),i.stat(a,function(g,j){return g?void c(g):"FILE"===j.type?void i.unlink(a,c):void i.readdir(a,function(g,j){return g?void c(g):0===j.length?void i.rmdir(a,c):b.recursive?(j=j.map(function(b){return e.join(a,b)}),void h.eachSeries(j,d,function(b){if(b)return void c(b);i.rmdir(a,c)})):void c(new f.ENOTEMPTY(null,a))})})}var g=this,i=g.fs;if("function"==typeof b&&(c=b,b={}),b=b||{},c=c||function(){},!a)return void c(new f.EINVAL("Missing path argument"));d(a,c)},d.prototype.tempDir=function(a){var b=this,c=b.fs,d=b.env.get("TMP");a=a||function(){},c.mkdir(d,function(b){a(null,d)})},d.prototype.mkdirp=function(a,b){function c(a,b){g.stat(a,function(d,h){if(h){if(h.isDirectory())return void b();if(h.isFile())return void b(new f.ENOTDIR(null,a))}else{if(d&&"ENOENT"!==d.code)return void b(d);var i=e.dirname(a);"/"===i?g.mkdir(a,function(a){if(a&&"EEXIST"!=a.code)return void b(a);b()}):c(i,function(c){if(c)return b(c);g.mkdir(a,function(a){if(a&&"EEXIST"!=a.code)return void b(a);b()})})}})}var d=this,g=d.fs;return b=b||function(){},a?"/"===a?void b():void c(a,b):void b(new f.EINVAL("Missing path argument"))},d.prototype.find=function(a,b,c){function d(a,b){m(a,function(c){if(c)return void b(c);n.push(a),b()})}function g(a,c){var f=e.removeTrailing(a);return b.regex&&!b.regex.test(f)?void c():b.name&&!i(e.basename(f),b.name)?void c():b.path&&!i(e.dirname(f),b.path)?void c():void d(a,c)}function j(a,b){a=e.resolve(k.pwd(),a),l.readdir(a,function(c,d){if(c)return void("ENOTDIR"===c.code?g(a,b):b(c));g(e.addTrailing(a),function(c){if(c)return void b(c);d=d.map(function(b){return e.join(a,b)}),h.eachSeries(d,j,function(a){b(a,n)})})})}var k=this,l=k.fs;"function"==typeof b&&(c=b,b={}),b=b||{},c=c||function(){};var m=b.exec||function(a,b){b()},n=[];if(!a)return void c(new f.EINVAL("Missing path argument"));l.stat(a,function(b,d){return b?void c(b):d.isDirectory()?void j(a,c):void c(new f.ENOTDIR(null,a))})},b.exports=d},{"../../lib/async.js":1,"../encoding.js":17,"../errors.js":18,"../path.js":25,"./environment.js":31,minimatch:11}],33:[function(a,b,c){function d(a,b,c){this.dev=c,this.node=b.id,this.type=b.type,this.size=b.size,this.nlinks=b.nlinks,this.atime=b.atime,this.mtime=b.mtime,this.ctime=b.ctime,this.version=b.version,this.mode=b.mode,this.uid=b.uid,this.gid=b.gid,this.name=f.basename(a)}var e=a("./constants.js"),f=a("./path.js");d.prototype.isFile=function(){return this.type===e.NODE_TYPE_FILE},d.prototype.isDirectory=function(){return this.type===e.NODE_TYPE_DIRECTORY},d.prototype.isSymbolicLink=function(){return this.type===e.NODE_TYPE_SYMBOLIC_LINK},d.prototype.isSocket=d.prototype.isFIFO=d.prototype.isCharacterDevice=d.prototype.isBlockDevice=function(){return!1},b.exports=d},{"./constants.js":15,"./path.js":25}],34:[function(a,b,c){function d(a){var b=Date.now();this.id=e.SUPER_NODE_ID,this.type=e.NODE_TYPE_META,this.atime=a.atime||b,this.ctime=a.ctime||b,this.mtime=a.mtime||b,this.rnode=a.rnode}var e=a("./constants.js");d.create=function(a,b){a.guid(function(c,e){if(c)return void b(c);a.rnode=a.rnode||e,b(null,new d(a))})},b.exports=d},{"./constants.js":15}]},{},[22])(22)});
=======
<<<<<<< HEAD
/*! filer 0.0.44 2017-05-25 */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Filer=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(b,c,d){!function(){var b={};"undefined"!=typeof process&&process.nextTick?(b.nextTick=process.nextTick,"undefined"!=typeof setImmediate?b.setImmediate=function(a){setImmediate(a)}:b.setImmediate=b.nextTick):"function"==typeof setImmediate?(b.nextTick=function(a){setImmediate(a)},b.setImmediate=b.nextTick):(b.nextTick=function(a){setTimeout(a,0)},b.setImmediate=b.nextTick),b.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},b.forEachSeries=b.eachSeries,"undefined"!=typeof a&&a.amd?a([],function(){return b}):"undefined"!=typeof c&&c.exports?c.exports=b:root.async=b}()},{}],2:[function(a,b,c){function d(a,b){for(var c=b.length-1;c>=0;c--)b[c]===a&&b.splice(c,1);return b}var e=function(){};e.createInterface=function(a){var b={};return b.on=function(b,c){"undefined"==typeof this[a]&&(this[a]={}),this[a].hasOwnProperty(b)||(this[a][b]=[]),this[a][b].push(c)},b.off=function(b,c){"undefined"!=typeof this[a]&&this[a].hasOwnProperty(b)&&d(c,this[a][b])},b.trigger=function(b){if("undefined"!=typeof this[a]&&this[a].hasOwnProperty(b))for(var c=Array.prototype.slice.call(arguments,1),d=0;d<this[a][b].length;d++)this[a][b][d].apply(this[a][b][d],c)},b.removeAllListeners=function(b){if("undefined"!=typeof this[a]){var c=this;c[a][b].forEach(function(a){c.off(b,a)})}},b};var f=e.createInterface("_handlers");e.prototype._on=f.on,e.prototype._off=f.off,e.prototype._trigger=f.trigger;var g=e.createInterface("handlers");e.prototype.on=function(){g.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},e.prototype.off=g.off,e.prototype.trigger=g.trigger,e.prototype.removeAllListeners=g.removeAllListeners,b.exports=e},{}],3:[function(a,b,c){(function(c){function d(a,b){var c=0;return function(){var d=Date.now();d-c>a&&(c=d,b.apply(this,arguments))}}function e(a,b){if("undefined"!=typeof a&&a||(a={}),"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function f(){var a=this,b=Date.now();this.origin=h(),this.lastMessage=b,this.receivedIDs={},this.previousValues={};var d=function(){a._onStorageEvent.apply(a,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",d):c.addEventListener("storage",d,!1))}var g=a("./eventemitter.js"),h=a("../src/shared.js").guid,i=function(a){return"undefined"==typeof a||"undefined"==typeof a.localStorage?{getItem:function(){},setItem:function(){},removeItem:function(){}}:a.localStorage}(c);f.prototype._transaction=function(a){function b(){if(!g){var k=Date.now(),m=0|i.getItem(l);if(m&&d>k-m)return h||(f._on("storage",b),h=!0),void(j=setTimeout(b,e));g=!0,i.setItem(l,k),a(),c()}}function c(){h&&f._off("storage",b),j&&clearTimeout(j),i.removeItem(l)}var d=1e3,e=20,f=this,g=!1,h=!1,j=null;b()},f.prototype._cleanup_emit=d(100,function(){var a=this;a._transaction(function(){var a,b=Date.now(),c=b-m,d=0;try{a=JSON.parse(i.getItem(j)||"[]")}catch(e){a=[]}for(var f=a.length-1;f>=0;f--)a[f].timestamp<c&&(a.splice(f,1),d++);d>0&&i.setItem(j,JSON.stringify(a))})}),f.prototype._cleanup_once=d(100,function(){var a=this;a._transaction(function(){var b,c,d=(Date.now(),0);try{c=JSON.parse(i.getItem(k)||"{}")}catch(e){c={}}for(b in c)a._once_expired(b,c)&&(delete c[b],d++);d>0&&i.setItem(k,JSON.stringify(c))})}),f.prototype._once_expired=function(a,b){if(!b)return!0;if(!b.hasOwnProperty(a))return!0;if("object"!=typeof b[a])return!0;var c=b[a].ttl||n,d=Date.now(),e=b[a].timestamp;return d-c>e},f.prototype._localStorageChanged=function(a,b){if(a&&a.key)return a.key===b;var c=i.getItem(b);return c===this.previousValues[b]?!1:(this.previousValues[b]=c,!0)},f.prototype._onStorageEvent=function(a){a=a||c.event;var b=this;this._localStorageChanged(a,j)&&this._transaction(function(){var a,c=Date.now(),d=i.getItem(j);try{a=JSON.parse(d||"[]")}catch(e){a=[]}for(var f=0;f<a.length;f++)if(a[f].origin!==b.origin&&!(a[f].timestamp<b.lastMessage)){if(a[f].id){if(b.receivedIDs.hasOwnProperty(a[f].id))continue;b.receivedIDs[a[f].id]=!0}b.trigger(a[f].name,a[f].payload)}b.lastMessage=c}),this._trigger("storage",a)},f.prototype._emit=function(a,b,c){if(c="string"==typeof c||"number"==typeof c?String(c):null,c&&c.length){if(this.receivedIDs.hasOwnProperty(c))return;this.receivedIDs[c]=!0}var d={id:c,name:a,origin:this.origin,timestamp:Date.now(),payload:b},e=this;this._transaction(function(){var c=i.getItem(j)||"[]",f="[]"===c?"":",";c=[c.substring(0,c.length-1),f,JSON.stringify(d),"]"].join(""),i.setItem(j,c),e.trigger(a,b),setTimeout(function(){e._cleanup_emit()},50)})},f.prototype.emit=function(a,b){this._emit.apply(this,arguments),this._trigger("emit",a,b)},f.prototype.once=function(a,b,c){if(f.supported){var d=this;this._transaction(function(){var e;try{e=JSON.parse(i.getItem(k)||"{}")}catch(f){e={}}d._once_expired(a,e)&&(e[a]={},e[a].timestamp=Date.now(),"number"==typeof c&&(e[a].ttl=1e3*c),i.setItem(k,JSON.stringify(e)),b(),setTimeout(function(){d._cleanup_once()},50))})}},e(f.prototype,g.prototype),f.supported="undefined"!=typeof i;var j="intercom",k="intercom_once",l="intercom_lock",m=5e4,n=36e5;f.destroy=function(){i.removeItem(l),i.removeItem(j),i.removeItem(k)},f.getInstance=function(){var a;return function(){return a||(a=new f),a}}(),b.exports=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../src/shared.js":30,"./eventemitter.js":2}],4:[function(a,b,c){function d(a,b){return q.call(a,b)}function e(a){return null==a?0:a.length===+a.length?a.length:t(a).length}function f(a){return a}function g(a,b,c){var d,e;if(null!=a)if(m&&a.forEach===m)a.forEach(b,c);else if(a.length===+a.length){for(d=0,e=a.length;e>d;d++)if(b.call(c,a[d],d,a)===s)return}else{var f=f(a);for(d=0,e=f.length;e>d;d++)if(b.call(c,a[f[d]],f[d],a)===s)return}}function h(a,b,c){b||(b=f);var d=!1;return null==a?d:o&&a.some===o?a.some(b,c):(g(a,function(a,e,f){return d||(d=b.call(c,a,e,f))?s:void 0}),!!d)}function i(a,b){return null==a?!1:n&&a.indexOf===n?-1!=a.indexOf(b):h(a,function(a){return a===b})}function j(a){this.value=a}function k(a){return a&&"object"==typeof a&&!Array.isArray(a)&&q.call(a,"__wrapped__")?a:new j(a)}var l=Array.prototype,m=l.forEach,n=l.indexOf,o=l.some,p=Object.prototype,q=p.hasOwnProperty,r=Object.keys,s={},t=r||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)d(a,c)&&b.push(c);return b};j.prototype.has=function(a){return d(this.value,a)},j.prototype.contains=function(a){return i(this.value,a)},j.prototype.size=function(){return e(this.value)},b.exports=k},{}],5:[function(a,b,c){!function(a){"use strict";c.encode=function(b){var c,d=new Uint8Array(b),e=d.length,f="";for(c=0;e>c;c+=3)f+=a[d[c]>>2],f+=a[(3&d[c])<<4|d[c+1]>>4],f+=a[(15&d[c+1])<<2|d[c+2]>>6],f+=a[63&d[c+2]];return e%3===2?f=f.substring(0,f.length-1)+"=":e%3===1&&(f=f.substring(0,f.length-2)+"=="),f},c.decode=function(b){var c,d,e,f,g,h=.75*b.length,i=b.length,j=0;"="===b[b.length-1]&&(h--,"="===b[b.length-2]&&h--);var k=new ArrayBuffer(h),l=new Uint8Array(k);for(c=0;i>c;c+=4)d=a.indexOf(b[c]),e=a.indexOf(b[c+1]),f=a.indexOf(b[c+2]),g=a.indexOf(b[c+3]),l[j++]=d<<2|e>>4,l[j++]=(15&e)<<4|f>>2,l[j++]=(3&f)<<6|63&g;return k}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],6:[function(a,b,c){function d(a){return this instanceof d?(this.length=0,this.parent=void 0,"number"==typeof a?e(this,a):"string"==typeof a?f(this,a,arguments.length>1?arguments[1]:"utf8"):g(this,a)):arguments.length>1?new d(a,arguments[1]):new d(a)}function e(a,b){if(a=m(a,0>b?0:0|n(b)),!d.TYPED_ARRAY_SUPPORT)for(var c=0;b>c;c++)a[c]=0;return a}function f(a,b,c){("string"!=typeof c||""===c)&&(c="utf8");var d=0|p(b,c);return a=m(a,d),a.write(b,c),a}function g(a,b){if(d.isBuffer(b))return h(a,b);if(U(b))return i(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");return"undefined"!=typeof ArrayBuffer&&b.buffer instanceof ArrayBuffer?j(a,b):b.length?k(a,b):l(a,b)}function h(a,b){var c=0|n(b.length);return a=m(a,c),b.copy(a,0,0,c),a}function i(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function j(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function k(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function l(a,b){var c,d=0;"Buffer"===b.type&&U(b.data)&&(c=b.data,d=0|n(c.length)),a=m(a,d);for(var e=0;d>e;e+=1)a[e]=255&c[e];return a}function m(a,b){d.TYPED_ARRAY_SUPPORT?a=d._augment(new Uint8Array(b)):(a.length=b,a._isBuffer=!0);var c=0!==b&&b<=d.poolSize>>>1;return c&&(a.parent=W),a}function n(a){if(a>=V)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V.toString(16)+" bytes");return 0|a}function o(a,b){if(!(this instanceof o))return new o(a,b);var c=new d(a,b);return delete c.parent,c}function p(a,b){if("string"!=typeof a&&(a=String(a)),0===a.length)return 0;switch(b||"utf8"){case"ascii":case"binary":case"raw":return a.length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a.length;case"hex":return a.length>>>1;case"utf8":case"utf-8":return M(a).length;case"base64":return P(a).length;default:return a.length}}function q(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function r(a,b,c,d){return Q(M(b,a.length-c),a,c,d)}function s(a,b,c,d){return Q(N(b),a,c,d)}function t(a,b,c,d){return s(a,b,c,d)}function u(a,b,c,d){return Q(P(b),a,c,d)}function v(a,b,c,d){return Q(O(b,a.length-c),a,c,d)}function w(a,b,c){return 0===b&&c===a.length?S.fromByteArray(a):S.fromByteArray(a.slice(b,c))}function x(a,b,c){var d="",e="";c=Math.min(a.length,c);for(var f=b;c>f;f++)a[f]<=127?(d+=R(e)+String.fromCharCode(a[f]),e=""):e+="%"+a[f].toString(16);return d+R(e)}function y(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(127&a[e]);return d}function z(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(a[e]);return d}function A(a,b,c){var d=a.length;(!b||0>b)&&(b=0),(!c||0>c||c>d)&&(c=d);for(var e="",f=b;c>f;f++)e+=L(a[f]);return e}function B(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function C(a,b,c){if(a%1!==0||0>a)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function D(a,b,c,e,f,g){if(!d.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>f||g>b)throw new RangeError("value is out of bounds");if(c+e>a.length)throw new RangeError("index out of range")}function E(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);f>e;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function F(a,b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);f>e;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function G(a,b,c,d,e,f){if(b>e||f>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range");if(0>c)throw new RangeError("index out of range")}function H(a,b,c,d,e){return e||G(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),T.write(a,b,c,d,23,4),c+4}function I(a,b,c,d,e){return e||G(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),T.write(a,b,c,d,52,8),c+8}function J(a){if(a=K(a).replace(Y,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function K(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function L(a){return 16>a?"0"+a.toString(16):a.toString(16)}function M(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;d>g;g++){if(c=a.charCodeAt(g),c>55295&&57344>c){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(56320>c){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=e-55296<<10|c-56320|65536,e=null}else e&&((b-=3)>-1&&f.push(239,191,189),e=null);if(128>c){if((b-=1)<0)break;f.push(c)}else if(2048>c){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(65536>c){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(2097152>c))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function N(a){for(var b=[],c=0;c<a.length;c++)b.push(255&a.charCodeAt(c));return b}function O(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);g++)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);return f}function P(a){return S.toByteArray(J(a))}function Q(a,b,c,d){for(var e=0;d>e&&!(e+c>=b.length||e>=a.length);e++)b[e+c]=a[e];return e}function R(a){try{return decodeURIComponent(a)}catch(b){return String.fromCharCode(65533)}}var S=a("base64-js"),T=a("ieee754"),U=a("is-array");c.Buffer=d,c.SlowBuffer=o,c.INSPECT_MAX_BYTES=50,d.poolSize=8192;var V=1073741823,W={};d.TYPED_ARRAY_SUPPORT=function(){try{var a=new ArrayBuffer(0),b=new Uint8Array(a);return b.foo=function(){return 42},42===b.foo()&&"function"==typeof b.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(c){return!1}}(),d.isBuffer=function(a){return!(null==a||!a._isBuffer)},d.compare=function(a,b){if(!d.isBuffer(a)||!d.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,e=b.length,f=0,g=Math.min(c,e);g>f&&a[f]===b[f];)++f;return f!==g&&(c=a[f],e=b[f]),e>c?-1:c>e?1:0},d.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(a,b){if(!U(a))throw new TypeError("list argument must be an Array of Buffers.");if(0===a.length)return new d(0);if(1===a.length)return a[0];var c;if(void 0===b)for(b=0,c=0;c<a.length;c++)b+=a[c].length;var e=new d(b),f=0;for(c=0;c<a.length;c++){var g=a[c];g.copy(e,f),f+=g.length}return e},d.byteLength=p,d.prototype.length=void 0,d.prototype.parent=void 0,d.prototype.toString=function(a,b,c){var d=!1;if(b=0|b,c=void 0===c||c===1/0?this.length:0|c,a||(a="utf8"),0>b&&(b=0),c>this.length&&(c=this.length),b>=c)return"";for(;;)switch(a){case"hex":return A(this,b,c);case"utf8":case"utf-8":return x(this,b,c);case"ascii":return y(this,b,c);case"binary":return z(this,b,c);case"base64":return w(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}},d.prototype.equals=function(a){if(!d.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===d.compare(this,a)},d.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},d.prototype.compare=function(a){if(!d.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?0:d.compare(this,a)},d.prototype.indexOf=function(a,b){function c(a,b,c){for(var d=-1,e=0;c+e<a.length;e++)if(a[c+e]===b[-1===d?0:e-d]){if(-1===d&&(d=e),e-d+1===b.length)return c+d}else d=-1;return-1}if(b>2147483647?b=2147483647:-2147483648>b&&(b=-2147483648),b>>=0,0===this.length)return-1;if(b>=this.length)return-1;if(0>b&&(b=Math.max(this.length+b,0)),"string"==typeof a)return 0===a.length?-1:String.prototype.indexOf.call(this,a,b);if(d.isBuffer(a))return c(this,a,b);if("number"==typeof a)return d.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):c(this,[a],b);throw new TypeError("val must be string, number or Buffer")},d.prototype.get=function(a){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(a)},d.prototype.set=function(a,b){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(a,b)},d.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else if(isFinite(b))b=0|b,isFinite(c)?(c=0|c,void 0===d&&(d="utf8")):(d=c,c=void 0);else{var e=d;d=b,b=0|c,c=e}var f=this.length-b;if((void 0===c||c>f)&&(c=f),a.length>0&&(0>c||0>b)||b>this.length)throw new RangeError("attempt to write outside buffer bounds");d||(d="utf8");for(var g=!1;;)switch(d){case"hex":return q(this,a,b,c);case"utf8":case"utf-8":return r(this,a,b,c);case"ascii":return s(this,a,b,c);case"binary":return t(this,a,b,c);case"base64":return u(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,a,b,c);default:if(g)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),g=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},d.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c),0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c),a>b&&(b=a);var e;if(d.TYPED_ARRAY_SUPPORT)e=d._augment(this.subarray(a,b));else{var f=b-a;e=new d(f,void 0);for(var g=0;f>g;g++)e[g]=this[g+a]}return e.length&&(e.parent=this.parent||this),e},d.prototype.readUIntLE=function(a,b,c){a=0|a,b=0|b,c||C(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},d.prototype.readUIntBE=function(a,b,c){a=0|a,b=0|b,c||C(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},d.prototype.readUInt8=function(a,b){return b||C(a,1,this.length),this[a]},d.prototype.readUInt16LE=function(a,b){return b||C(a,2,this.length),this[a]|this[a+1]<<8},d.prototype.readUInt16BE=function(a,b){return b||C(a,2,this.length),this[a]<<8|this[a+1]},d.prototype.readUInt32LE=function(a,b){return b||C(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},d.prototype.readUInt32BE=function(a,b){return b||C(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},d.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||C(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},d.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||C(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},d.prototype.readInt8=function(a,b){return b||C(a,1,this.length),128&this[a]?-1*(255-this[a]+1):this[a]},d.prototype.readInt16LE=function(a,b){b||C(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},d.prototype.readInt16BE=function(a,b){b||C(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},d.prototype.readInt32LE=function(a,b){return b||C(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},d.prototype.readInt32BE=function(a,b){return b||C(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},d.prototype.readFloatLE=function(a,b){return b||C(a,4,this.length),T.read(this,a,!0,23,4)},d.prototype.readFloatBE=function(a,b){return b||C(a,4,this.length),T.read(this,a,!1,23,4)},d.prototype.readDoubleLE=function(a,b){return b||C(a,8,this.length),T.read(this,a,!0,52,8)},d.prototype.readDoubleBE=function(a,b){return b||C(a,8,this.length),T.read(this,a,!1,52,8)},d.prototype.writeUIntLE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||D(this,a,b,c,Math.pow(2,8*c),0);var e=1,f=0;for(this[b]=255&a;++f<c&&(e*=256);)this[b+f]=a/e&255;return b+c},d.prototype.writeUIntBE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||D(this,a,b,c,Math.pow(2,8*c),0);var e=c-1,f=1;for(this[b+e]=255&a;--e>=0&&(f*=256);)this[b+e]=a/f&255;return b+c},d.prototype.writeUInt8=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,1,255,0),d.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=a,b+1},d.prototype.writeUInt16LE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8):E(this,a,b,!0),b+2},d.prototype.writeUInt16BE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a):E(this,a,b,!1),b+2},d.prototype.writeUInt32LE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a):F(this,a,b,!0),b+4},d.prototype.writeUInt32BE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a):F(this,a,b,!1),b+4},d.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);D(this,a,b,c,e-1,-e)}var f=0,g=1,h=0>a?1:0;for(this[b]=255&a;++f<c&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},d.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);D(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0>a?1:0;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},d.prototype.writeInt8=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,1,127,-128),d.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),0>a&&(a=255+a+1),this[b]=a,b+1},d.prototype.writeInt16LE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8):E(this,a,b,!0),b+2},d.prototype.writeInt16BE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a):E(this,a,b,!1),b+2},d.prototype.writeInt32LE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):F(this,a,b,!0),b+4},d.prototype.writeInt32BE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,4,2147483647,-2147483648),0>a&&(a=4294967295+a+1),d.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a):F(this,a,b,!1),b+4},d.prototype.writeFloatLE=function(a,b,c){return H(this,a,b,!0,c)},d.prototype.writeFloatBE=function(a,b,c){return H(this,a,b,!1,c)},d.prototype.writeDoubleLE=function(a,b,c){return I(this,a,b,!0,c)},d.prototype.writeDoubleBE=function(a,b,c){return I(this,a,b,!1,c)},d.prototype.copy=function(a,b,c,e){if(c||(c=0),e||0===e||(e=this.length),b>=a.length&&(b=a.length),b||(b=0),e>0&&c>e&&(e=c),e===c)return 0;if(0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),a.length-b<e-c&&(e=a.length-b+c);var f=e-c;if(1e3>f||!d.TYPED_ARRAY_SUPPORT)for(var g=0;f>g;g++)a[g+b]=this[g+c];else a._set(this.subarray(c,c+f),b);return f},d.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),b>c)throw new RangeError("end < start");if(c!==b&&0!==this.length){if(0>b||b>=this.length)throw new RangeError("start out of bounds");if(0>c||c>this.length)throw new RangeError("end out of bounds");var d;if("number"==typeof a)for(d=b;c>d;d++)this[d]=a;else{var e=M(a.toString()),f=e.length;for(d=b;c>d;d++)this[d]=e[d%f]}return this}},d.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(d.TYPED_ARRAY_SUPPORT)return new d(this).buffer;for(var a=new Uint8Array(this.length),b=0,c=a.length;c>b;b+=1)a[b]=this[b];return a.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var X=d.prototype;d._augment=function(a){return a.constructor=d,a._isBuffer=!0,a._set=a.set,a.get=X.get,a.set=X.set,a.write=X.write,a.toString=X.toString,a.toLocaleString=X.toString,a.toJSON=X.toJSON,a.equals=X.equals,a.compare=X.compare,a.indexOf=X.indexOf,a.copy=X.copy,a.slice=X.slice,a.readUIntLE=X.readUIntLE,a.readUIntBE=X.readUIntBE,a.readUInt8=X.readUInt8,a.readUInt16LE=X.readUInt16LE,a.readUInt16BE=X.readUInt16BE,a.readUInt32LE=X.readUInt32LE,a.readUInt32BE=X.readUInt32BE,a.readIntLE=X.readIntLE,a.readIntBE=X.readIntBE,a.readInt8=X.readInt8,a.readInt16LE=X.readInt16LE,a.readInt16BE=X.readInt16BE,a.readInt32LE=X.readInt32LE,a.readInt32BE=X.readInt32BE,a.readFloatLE=X.readFloatLE,a.readFloatBE=X.readFloatBE,a.readDoubleLE=X.readDoubleLE,a.readDoubleBE=X.readDoubleBE,a.writeUInt8=X.writeUInt8,a.writeUIntLE=X.writeUIntLE,a.writeUIntBE=X.writeUIntBE,a.writeUInt16LE=X.writeUInt16LE,a.writeUInt16BE=X.writeUInt16BE,a.writeUInt32LE=X.writeUInt32LE,a.writeUInt32BE=X.writeUInt32BE,a.writeIntLE=X.writeIntLE,a.writeIntBE=X.writeIntBE,a.writeInt8=X.writeInt8,a.writeInt16LE=X.writeInt16LE,a.writeInt16BE=X.writeInt16BE,a.writeInt32LE=X.writeInt32LE,a.writeInt32BE=X.writeInt32BE,a.writeFloatLE=X.writeFloatLE,a.writeFloatBE=X.writeFloatBE,a.writeDoubleLE=X.writeDoubleLE,a.writeDoubleBE=X.writeDoubleBE,a.fill=X.fill,a.inspect=X.inspect,a.toArrayBuffer=X.toArrayBuffer,a};var Y=/[^+\/0-9A-z\-]/g},{"base64-js":7,ieee754:8,"is-array":9}],7:[function(a,b,c){var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(a){"use strict";function b(a){var b=a.charCodeAt(0);return b===g||b===l?62:b===h||b===m?63:i>b?-1:i+10>b?b-i+26+26:k+26>b?b-k:j+26>b?b-j+26:void 0}function c(a){function c(a){j[l++]=a}var d,e,g,h,i,j;if(a.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new f(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,e=0;g>d;d+=4,e+=3)h=b(a.charAt(d))<<18|b(a.charAt(d+1))<<12|b(a.charAt(d+2))<<6|b(a.charAt(d+3)),c((16711680&h)>>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function e(a){function b(a){return d.charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var e,f,g,h=a.length%3,i="";for(e=0,g=a.length-h;g>e;e+=3)f=(a[e]<<16)+(a[e+1]<<8)+a[e+2],i+=c(f);switch(h){case 1:f=a[a.length-1],i+=b(f>>2),i+=b(f<<4&63),i+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],i+=b(f>>10),i+=b(f>>4&63),i+=b(f<<2&63),i+="="}return i}var f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="+".charCodeAt(0),h="/".charCodeAt(0),i="0".charCodeAt(0),j="a".charCodeAt(0),k="A".charCodeAt(0),l="-".charCodeAt(0),m="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=e}("undefined"==typeof c?this.base64js={}:c)},{}],8:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],9:[function(a,b,c){var d=Array.isArray,e=Object.prototype.toString;b.exports=d||function(a){return!!a&&"[object Array]"==e.call(a)}},{}],10:[function(a,b,c){function d(a,b){for(var c=0,d=a.length-1;d>=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function e(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d<a.length;d++)b(a[d],d,a)&&c.push(a[d]);return c}var f=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,g=function(a){return f.exec(a).slice(1)};c.resolve=function(){for(var a="",b=!1,c=arguments.length-1;c>=-1&&!b;c--){var f=c>=0?arguments[c]:process.cwd();if("string"!=typeof f)throw new TypeError("Arguments to path.resolve must be strings");f&&(a=f+"/"+a,b="/"===f.charAt(0))}return a=d(e(a.split("/"),function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."},c.normalize=function(a){var b=c.isAbsolute(a),f="/"===h(a,-1);return a=d(e(a.split("/"),function(a){return!!a}),!b).join("/"),a||b||(a="."),a&&f&&(a+="/"),(b?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(e(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;c>=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;g>i;i++)if(e[i]!==f[i]){h=i;break}for(var j=[],i=h;i<e.length;i++)j.push("..");return j=j.concat(f.slice(h)),j.join("/")},c.sep="/",c.delimiter=":",c.dirname=function(a){var b=g(a),c=b[0],d=b[1];return c||d?(d&&(d=d.substr(0,d.length-1)),c+d):"."},c.basename=function(a,b){var c=g(a)[2];return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return g(a)[3]};var h="b"==="ab".substr(-1)?function(a,b,c){return a.substr(b,c)}:function(a,b,c){return 0>b&&(b=a.length+b),a.substr(b,c)}},{}],11:[function(a,b,c){!function(a,b,c,d){function e(a){return a.split("").reduce(function(a,b){return a[b]=!0,a},{})}function f(a,b){return b=b||{},function(c,d,e){return h(c,a,b)}}function g(a,b){a=a||{},b=b||{};var c={};return Object.keys(b).forEach(function(a){c[a]=b[a]}),Object.keys(a).forEach(function(b){c[b]=a[b]}),c}function h(a,b,c){if("string"!=typeof b)throw new TypeError("glob pattern string required");return c||(c={}),c.nocomment||"#"!==b.charAt(0)?""===b.trim()?""===a:new i(b,c).match(a):!1}function i(a,b){if(!(this instanceof i))return new i(a,b,t);if("string"!=typeof a)throw new TypeError("glob pattern string required");b||(b={}),a=a.trim(),"win32"===d&&(a=a.split("\\").join("/"));var c=a+"\n"+v(b),e=h.cache.get(c);return e?e:(h.cache.set(c,this),this.options=b,this.set=[],this.pattern=a,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,void this.make())}function j(){if(!this._made){var a=this.pattern,b=this.options;if(!b.nocomment&&"#"===a.charAt(0))return void(this.comment=!0);if(!a)return void(this.empty=!0);this.parseNegate();var c=this.globSet=this.braceExpand();b.debug&&(this.debug=console.error),this.debug(this.pattern,c),c=this.globParts=c.map(function(a){return a.split(B)}),this.debug(this.pattern,c),c=c.map(function(a,b,c){return a.map(this.parse,this)},this),this.debug(this.pattern,c),c=c.filter(function(a){return-1===a.indexOf(!1)}),this.debug(this.pattern,c),this.set=c}}function k(){var a=this.pattern,b=!1,c=this.options,d=0;if(!c.nonegate){for(var e=0,f=a.length;f>e&&"!"===a.charAt(e);e++)b=!b,d++;d&&(this.pattern=a.substr(d)),this.negate=b}}function l(a,b,c){return c=c||"0",a+="",a.length>=b?a:new Array(b-a.length+1).join(c)+a}function m(a,b){function c(){t.push(x),x=""}if(b=b||this.options,a="undefined"==typeof a?this.pattern:a,"undefined"==typeof a)throw new Error("undefined pattern");if(b.nobrace||!a.match(/\{.*\}/))return[a];var d=!1;if("{"!==a.charAt(0)){this.debug(a);for(var e=null,f=0,g=a.length;g>f;f++){
var h=a.charAt(f);if(this.debug(f,h),"\\"===h)d=!d;else if("{"===h&&!d){e=a.substr(0,f);break}}if(null===e)return this.debug("no sets"),[a];var i=m.call(this,a.substr(f),b);return i.map(function(a){return e+a})}var j=a.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(j){this.debug("numset",j[1],j[2]);for(var k,n=m.call(this,a.substr(j[0].length),b),o=+j[1],p="0"===j[1][0],q=j[1].length,r=+j[2],s=o>r?-1:1,t=[],f=o;f!=r+s;f+=s){k=p?l(f,q):f+"";for(var u=0,v=n.length;v>u;u++)t.push(k+n[u])}return t}var f=1,w=1,t=[],x="",d=!1;this.debug("Entering for");a:for(f=1,g=a.length;g>f;f++){var h=a.charAt(f);if(this.debug("",f,h),d)d=!1,x+="\\"+h;else switch(h){case"\\":d=!0;continue;case"{":w++,x+="{";continue;case"}":if(w--,0===w){c(),f++;break a}x+=h;continue;case",":1===w?c():x+=h;continue;default:x+=h;continue}}if(0!==w)return this.debug("didn't close",a),m.call(this,"\\"+a,b);this.debug("set",t),this.debug("suffix",a.substr(f));var n=m.call(this,a.substr(f),b),y=1===t.length;this.debug("set pre-expanded",t),t=t.map(function(a){return m.call(this,a,b)},this),this.debug("set expanded",t),t=t.reduce(function(a,b){return a.concat(b)}),y&&(t=t.map(function(a){return"{"+a+"}"}));for(var z=[],f=0,g=t.length;g>f;f++)for(var u=0,v=n.length;v>u;u++)z.push(t[f]+n[u]);return z}function n(a,b){function c(){if(f){switch(f){case"*":h+=x,i=!0;break;case"?":h+=w,i=!0;break;default:h+="\\"+f}p.debug("clearStateChar %j %j",f,h),f=!1}}var d=this.options;if(!d.noglobstar&&"**"===a)return u;if(""===a)return"";for(var e,f,g,h="",i=!!d.nocase,j=!1,k=[],l=!1,m=-1,n=-1,o="."===a.charAt(0)?"":d.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",p=this,r=0,s=a.length;s>r&&(g=a.charAt(r));r++)if(this.debug("%s %s %s %j",a,r,h,g),j&&A[g])h+="\\"+g,j=!1;else switch(g){case"/":return!1;case"\\":c(),j=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",a,r,h,g),l){this.debug(" in class"),"!"===g&&r===n+1&&(g="^"),h+=g;continue}p.debug("call clearStateChar %j",f),c(),f=g,d.noext&&c();continue;case"(":if(l){h+="(";continue}if(!f){h+="\\(";continue}e=f,k.push({type:e,start:r-1,reStart:h.length}),h+="!"===f?"(?:(?!":"(?:",this.debug("plType %j %j",f,h),f=!1;continue;case")":if(l||!k.length){h+="\\)";continue}switch(c(),i=!0,h+=")",e=k.pop().type){case"!":h+="[^/]*?)";break;case"?":case"+":case"*":h+=e;case"@":}continue;case"|":if(l||!k.length||j){h+="\\|",j=!1;continue}c(),h+="|";continue;case"[":if(c(),l){h+="\\"+g;continue}l=!0,n=r,m=h.length,h+=g;continue;case"]":if(r===n+1||!l){h+="\\"+g,j=!1;continue}i=!0,l=!1,h+=g;continue;default:c(),j?j=!1:!A[g]||"^"===g&&l||(h+="\\"),h+=g}if(l){var t=a.substr(n+1),v=this.parse(t,C);h=h.substr(0,m)+"\\["+v[0],i=i||v[1]}for(var y;y=k.pop();){var z=h.slice(y.reStart+3);z=z.replace(/((?:\\{2})*)(\\?)\|/g,function(a,b,c){return c||(c="\\"),b+b+c+"|"}),this.debug("tail=%j\n %s",z,z);var B="*"===y.type?x:"?"===y.type?w:"\\"+y.type;i=!0,h=h.slice(0,y.reStart)+B+"\\("+z}c(),j&&(h+="\\\\");var D=!1;switch(h.charAt(0)){case".":case"[":case"(":D=!0}if(""!==h&&i&&(h="(?=.)"+h),D&&(h=o+h),b===C)return[h,i];if(!i)return q(a);var E=d.nocase?"i":"",F=new RegExp("^"+h+"$",E);return F._glob=a,F._src=h,F}function o(){if(this.regexp||this.regexp===!1)return this.regexp;var a=this.set;if(!a.length)return this.regexp=!1;var b=this.options,c=b.noglobstar?x:b.dot?y:z,d=b.nocase?"i":"",e=a.map(function(a){return a.map(function(a){return a===u?c:"string"==typeof a?r(a):a._src}).join("\\/")}).join("|");e="^(?:"+e+")$",this.negate&&(e="^(?!"+e+").*$");try{return this.regexp=new RegExp(e,d)}catch(f){return this.regexp=!1}}function p(a,b){if(this.debug("match",a,this.pattern),this.comment)return!1;if(this.empty)return""===a;if("/"===a&&b)return!0;var c=this.options;"win32"===d&&(a=a.split("\\").join("/")),a=a.split(B),this.debug(this.pattern,"split",a);var e=this.set;this.debug(this.pattern,"set",e);for(var f,g=a.length-1;g>=0&&!(f=a[g]);g--);for(var g=0,h=e.length;h>g;g++){var i=e[g],j=a;c.matchBase&&1===i.length&&(j=[f]);var k=this.matchOne(j,i,b);if(k)return c.flipNegate?!0:!this.negate}return c.flipNegate?!1:this.negate}function q(a){return a.replace(/\\(.)/g,"$1")}function r(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}c?c.exports=h:b.minimatch=h,a||(a=function(a){switch(a){case"sigmund":return function(a){return JSON.stringify(a)};case"path":return{basename:function(a){a=a.split(/[\/\\]/);var b=a.pop();return b||(b=a.pop()),b}};case"lru-cache":return function(){var a={},b=0;this.set=function(c,d){b++,b>=100&&(a={}),a[c]=d},this.get=function(b){return a[b]}}}}),h.Minimatch=i;var s=a("lru-cache"),t=h.cache=new s({max:100}),u=h.GLOBSTAR=i.GLOBSTAR={},v=a("sigmund"),w=(a("path"),"[^/]"),x=w+"*?",y="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",z="(?:(?!(?:\\/|^)\\.).)*?",A=e("().*{}+?[]^$\\!"),B=/\/+/;h.filter=f,h.defaults=function(a){if(!a||!Object.keys(a).length)return h;var b=h,c=function(c,d,e){return b.minimatch(c,d,g(a,e))};return c.Minimatch=function(c,d){return new b.Minimatch(c,g(a,d))},c},i.defaults=function(a){return a&&Object.keys(a).length?h.defaults(a).Minimatch:i},i.prototype.debug=function(){},i.prototype.make=j,i.prototype.parseNegate=k,h.braceExpand=function(a,b){return new i(a,b).braceExpand()},i.prototype.braceExpand=m,i.prototype.parse=n;var C={};h.makeRe=function(a,b){return new i(a,b||{}).makeRe()},i.prototype.makeRe=o,h.match=function(a,b,c){c=c||{};var d=new i(b,c);return a=a.filter(function(a){return d.match(a)}),d.options.nonull&&!a.length&&a.push(b),a},i.prototype.match=p,i.prototype.matchOne=function(a,b,c){var d=this.options;this.debug("matchOne",{"this":this,file:a,pattern:b}),this.debug("matchOne",a.length,b.length);for(var e=0,f=0,g=a.length,h=b.length;g>e&&h>f;e++,f++){this.debug("matchOne loop");var i=b[f],j=a[e];if(this.debug(b,i,j),i===!1)return!1;if(i===u){this.debug("GLOBSTAR",[b,i,j]);var k=e,l=f+1;if(l===h){for(this.debug("** at the end");g>e;e++)if("."===a[e]||".."===a[e]||!d.dot&&"."===a[e].charAt(0))return!1;return!0}a:for(;g>k;){var m=a[k];if(this.debug("\nglobstar while",a,k,b,l,m),this.matchOne(a.slice(k),b.slice(l),c))return this.debug("globstar found match!",k,g,m),!0;if("."===m||".."===m||!d.dot&&"."===m.charAt(0)){this.debug("dot detected!",a,k,b,l);break a}this.debug("globstar swallow a segment, and continue"),k++}return c&&(this.debug("\n>>> no match, partial?",a,k,b,l),k===g)?!0:!1}var n;if("string"==typeof i?(n=d.nocase?j.toLowerCase()===i.toLowerCase():j===i,this.debug("string match",i,j,n)):(n=j.match(i),this.debug("pattern match",i,j,n)),!n)return!1}if(e===g&&f===h)return!0;if(e===g)return c;if(f===h){var o=e===g-1&&""===a[e];return o}throw new Error("wtf?")}}("function"==typeof a?a:null,this,"object"==typeof b?b:null,"object"==typeof process?process.platform:"win32")},{"lru-cache":12,path:10,sigmund:13}],12:[function(a,b,c){!function(){function a(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function c(){return 1}function d(a){return this instanceof d?("number"==typeof a&&(a={max:a}),a||(a={}),this._max=a.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=a.length||c,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=c),this._allowStale=a.stale||!1,this._maxAge=a.maxAge||null,this._dispose=a.dispose,void this.reset()):new d(a)}function e(a,b,c){var d=a._cache[b];return d&&(f(a,d)?(j(a,d),a._allowStale||(d=void 0)):c&&g(a,d),d&&(d=d.value)),d}function f(a,b){if(!b||!b.maxAge&&!a._maxAge)return!1;var c=!1,d=Date.now()-b.now;return c=b.maxAge?d>b.maxAge:a._maxAge&&d>a._maxAge}function g(a,b){i(a,b),b.lu=a._mru++,a._lruList[b.lu]=b}function h(a){for(;a._lru<a._mru&&a._length>a._max;)j(a,a._lruList[a._lru])}function i(a,b){for(delete a._lruList[b.lu];a._lru<a._mru&&!a._lruList[a._lru];)a._lru++}function j(a,b){b&&(a._dispose&&a._dispose(b.key,b.value),a._length-=b.length,a._itemCount--,delete a._cache[b.key],i(a,b))}function k(a,b,c,d,e,f){this.key=a,this.value=b,this.lu=c,this.length=d,this.now=e,f&&(this.maxAge=f)}"object"==typeof b&&b.exports?b.exports=d:this.LRUCache=d,Object.defineProperty(d.prototype,"max",{set:function(a){(!a||"number"!=typeof a||0>=a)&&(a=1/0),this._max=a,this._length>this._max&&h(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(d.prototype,"lengthCalculator",{set:function(a){if("function"!=typeof a){this._lengthCalculator=c,this._length=this._itemCount;for(var b in this._cache)this._cache[b].length=1}else{this._lengthCalculator=a,this._length=0;for(var b in this._cache)this._cache[b].length=this._lengthCalculator(this._cache[b].value),this._length+=this._cache[b].length}this._length>this._max&&h(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(d.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(d.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),d.prototype.forEach=function(a,b){b=b||this;for(var c=0,d=this._itemCount,e=this._mru-1;e>=0&&d>c;e--)if(this._lruList[e]){c++;var g=this._lruList[e];f(this,g)&&(j(this,g),this._allowStale||(g=void 0)),g&&a.call(b,g.value,g.key,this)}},d.prototype.keys=function(){for(var a=new Array(this._itemCount),b=0,c=this._mru-1;c>=0&&b<this._itemCount;c--)if(this._lruList[c]){var d=this._lruList[c];a[b++]=d.key}return a},d.prototype.values=function(){for(var a=new Array(this._itemCount),b=0,c=this._mru-1;c>=0&&b<this._itemCount;c--)if(this._lruList[c]){var d=this._lruList[c];a[b++]=d.value}return a},d.prototype.reset=function(){if(this._dispose&&this._cache)for(var a in this._cache)this._dispose(a,this._cache[a].value);this._cache=Object.create(null),this._lruList=Object.create(null),this._mru=0,this._lru=0,this._length=0,this._itemCount=0},d.prototype.dump=function(){return this._cache},d.prototype.dumpLru=function(){return this._lruList},d.prototype.set=function(b,c,d){d=d||this._maxAge;var e=d?Date.now():0;if(a(this._cache,b))return this._dispose&&this._dispose(b,this._cache[b].value),this._cache[b].now=e,this._cache[b].maxAge=d,this._cache[b].value=c,this.get(b),!0;var f=this._lengthCalculator(c),g=new k(b,c,this._mru++,f,e,d);return g.length>this._max?(this._dispose&&this._dispose(b,c),!1):(this._length+=g.length,this._lruList[g.lu]=this._cache[b]=g,this._itemCount++,this._length>this._max&&h(this),!0)},d.prototype.has=function(b){if(!a(this._cache,b))return!1;var c=this._cache[b];return f(this,c)?!1:!0},d.prototype.get=function(a){return e(this,a,!0)},d.prototype.peek=function(a){return e(this,a,!1)},d.prototype.pop=function(){var a=this._lruList[this._lru];return j(this,a),a||null},d.prototype.del=function(a){j(this,this._cache[a])}}()},{}],13:[function(a,b,c){function d(a,b){function c(a,g){return g>b||"function"==typeof a||"undefined"==typeof a?void 0:"object"!=typeof a||!a||a instanceof f?void(e+=a):void(-1===d.indexOf(a)&&g!==b&&(d.push(a),e+="{",Object.keys(a).forEach(function(b,d,f){if("_"!==b.charAt(0)){var h=typeof a[b];"function"!==h&&"undefined"!==h&&(e+=b,c(a[b],g+1))}})))}b=b||10;var d=[],e="",f=RegExp;return c(a,0),e}b.exports=d},{}],14:[function(a,b,c){(function(a){function c(b,c,d){return b instanceof ArrayBuffer&&(b=new Uint8Array(b)),new a(b,c,d)}c.prototype=Object.create(a.prototype),c.prototype.constructor=c,Object.keys(a).forEach(function(b){a.hasOwnProperty(b)&&(c[b]=a[b])}),b.exports=c}).call(this,a("buffer").Buffer)},{buffer:6}],15:[function(a,b,c){var d="READ",e="WRITE",f="CREATE",g="EXCLUSIVE",h="TRUNCATE",i="APPEND",j="CREATE",k="REPLACE";b.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",MODE_FILE:"FILE",MODE_DIRECTORY:"DIRECTORY",MODE_SYMBOLIC_LINK:"SYMLINK",MODE_META:"META",SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",FS_NODUPEIDCHECK:"FS_NODUPEIDCHECK",O_READ:d,O_WRITE:e,O_CREATE:f,O_EXCLUSIVE:g,O_TRUNCATE:h,O_APPEND:i,O_FLAGS:{r:[d],"r+":[d,e],w:[e,f,h],"w+":[e,d,f,h],wx:[e,f,g,h],"wx+":[e,d,f,g,h],a:[e,f,i],"a+":[e,d,f,i],ax:[e,f,g,i],"ax+":[e,d,f,g,i]},XATTR_CREATE:j,XATTR_REPLACE:k,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""}}},{}],16:[function(a,b,c){var d=a("./constants.js").MODE_FILE;b.exports=function(a,b){this.id=a,this.type=b||d}},{"./constants.js":15}],17:[function(a,b,c){(function(a){function c(a){return a.toString("utf8")}function d(b){return new a(b,"utf8")}b.exports={encode:d,decode:c}}).call(this,a("buffer").Buffer)},{buffer:6}],18:[function(a,b,c){var d={};["9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","18:EINVAL:invalid argument","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","34:ENOENT:no such file or directory","47:EEXIST:file already exists","50:EPERM:operation not permitted","51:ELOOP:too many symbolic links encountered","53:ENOTEMPTY:directory not empty","55:EIO:i/o error","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(a){function b(a,b){Error.call(this),this.name=e,this.code=e,this.errno=c,this.message=a||f,b&&(this.path=b),this.stack=new Error(this.message).stack}a=a.split(":");var c=+a[0],e=a[1],f=a[2];b.prototype=Object.create(Error.prototype),b.prototype.constructor=b,b.prototype.toString=function(){var a=this.path?", '"+this.path+"'":"";return this.name+": "+this.message+a},d[e]=d[c]=b}),b.exports=d},{}],19:[function(a,b,c){function d(a,b,c,d,e){function f(c){a.changes.push({event:"change",path:b}),e(c)}var g=a.flags;ma(g).contains(Ka)&&delete d.ctime,ma(g).contains(Ja)&&delete d.mtime;var h=!1;d.ctime&&(c.ctime=d.ctime,c.atime=d.ctime,h=!0),d.atime&&(c.atime=d.atime,h=!0),d.mtime&&(c.mtime=d.mtime,h=!0),h?a.putObject(c.id,c,f):f()}function e(a,b,c,e){function g(c,d){c?e(c):d.mode!==va?e(new Ma.ENOTDIR("a component of the path prefix is not a directory",b)):(l=d,f(a,b,h))}function h(c,d){!c&&d?e(new Ma.EEXIST("path name already exists",b)):!c||c instanceof Ma.ENOENT?a.getObject(l.data,i):e(c)}function i(b,d){b?e(b):(m=d,Qa.create({guid:a.guid,mode:c},function(b,c){return b?void e(b):(n=c,n.nlinks+=1,void a.putObject(n.id,n,k))}))}function j(b){if(b)e(b);else{var c=Date.now();d(a,p,n,{mtime:c,ctime:c},e)}}function k(b){b?e(b):(m[o]=new Na(n.id,c),a.putObject(l.data,m,j))}if(c!==va&&c!==ua)return e(new Ma.EINVAL("mode must be a directory or file",b));b=oa(b);var l,m,n,o=qa(b),p=pa(b);f(a,p,g)}function f(a,b,c){function d(b,d){b?c(b):d&&d.mode===xa&&d.rnode?a.getObject(d.rnode,e):c(new Ma.EFILESYSTEMERROR)}function e(a,b){a?c(a):b?c(null,b):c(new Ma.ENOENT)}function g(d,e){d?c(d):e.mode===va&&e.data?a.getObject(e.data,h):c(new Ma.ENOTDIR("a component of the path prefix is not a directory",b))}function h(d,e){if(d)c(d);else if(ma(e).has(k)){var f=e[k].id;a.getObject(f,i)}else c(new Ma.ENOENT(null,b))}function i(a,d){a?c(a):d.mode==wa?(m++,m>Aa?c(new Ma.ELOOP(null,b)):j(d.data)):c(null,d)}function j(b){b=oa(b),l=pa(b),k=qa(b),ya==k?a.getObject(za,d):f(a,l,g)}if(b=oa(b),!b)return c(new Ma.ENOENT("path is an empty string"));var k=qa(b),l=pa(b),m=0;ya==k?a.getObject(za,d):f(a,l,g)}function g(a,b,c,e,f,g,h){function i(e){e?h(e):d(a,b,c,{ctime:Date.now()},h)}var j=c.xattrs;g===Ha&&j.hasOwnProperty(e)?h(new Ma.EEXIST("attribute already exists",b)):g!==Ia||j.hasOwnProperty(e)?(j[e]=f,a.putObject(c.id,c,i)):h(new Ma.ENOATTR(null,b))}function h(a,b){function c(c,e){!c&&e?b():!c||c instanceof Ma.ENOENT?Pa.create({guid:a.guid},function(c,e){return c?void b(c):(f=e,void a.putObject(f.id,f,d))}):b(c)}function d(c){c?b(c):Qa.create({guid:a.guid,id:f.rnode,mode:va},function(c,d){return c?void b(c):(g=d,g.nlinks+=1,void a.putObject(g.id,g,e))})}function e(c){c?b(c):(h={},a.putObject(g.data,h,b))}var f,g,h;a.getObject(za,c)}function i(a,b,c){function e(d,e){!d&&e?c(new Ma.EEXIST(null,b)):!d||d instanceof Ma.ENOENT?f(a,q,g):c(d)}function g(b,d){b?c(b):(n=d,a.getObject(n.data,h))}function h(b,d){b?c(b):(o=d,Qa.create({guid:a.guid,mode:va},function(b,d){return b?void c(b):(l=d,l.nlinks+=1,void a.putObject(l.id,l,i))}))}function i(b){b?c(b):(m={},a.putObject(l.data,m,k))}function j(b){if(b)c(b);else{var e=Date.now();d(a,q,n,{mtime:e,ctime:e},c)}}function k(b){b?c(b):(o[p]=new Na(l.id,va),a.putObject(n.data,o,j))}b=oa(b);var l,m,n,o,p=qa(b),q=pa(b);f(a,b,e)}function j(a,b,c){function e(b,d){b?c(b):(p=d,a.getObject(p.data,g))}function g(d,e){d?c(d):ya==r?c(new Ma.EBUSY(null,b)):ma(e).has(r)?(q=e,n=q[r].id,a.getObject(n,h)):c(new Ma.ENOENT(null,b))}function h(d,e){d?c(d):e.mode!=va?c(new Ma.ENOTDIR(null,b)):(n=e,a.getObject(n.data,i))}function i(a,d){a?c(a):(o=d,ma(o).size()>0?c(new Ma.ENOTEMPTY(null,b)):k())}function j(b){if(b)c(b);else{var e=Date.now();d(a,s,p,{mtime:e,ctime:e},l)}}function k(){delete q[r],a.putObject(p.data,q,j)}function l(b){b?c(b):a["delete"](n.id,m)}function m(b){b?c(b):a["delete"](n.data,c)}b=oa(b);var n,o,p,q,r=qa(b),s=pa(b);f(a,s,e)}function k(a,b,c,e){function g(c,d){c?e(c):d.mode!==va?e(new Ma.ENOENT(null,b)):(q=d,a.getObject(q.data,h))}function h(d,f){d?e(d):(r=f,ma(r).has(v)?ma(c).contains(Ea)?e(new Ma.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",b)):(s=r[v],s.type==va&&ma(c).contains(Ca)?e(new Ma.EISDIR("the named file is a directory and O_WRITE is set",b)):a.getObject(s.id,i)):ma(c).contains(Da)?l():e(new Ma.ENOENT("O_CREATE is not set and the named file does not exist",b)))}function i(a,c){if(a)e(a);else{var d=c;d.mode==wa?(x++,x>Aa?e(new Ma.ELOOP(null,b)):j(d.data)):k(void 0,d)}}function j(d){d=oa(d),w=pa(d),v=qa(d),ya==v&&(ma(c).contains(Ca)?e(new Ma.EISDIR("the named file is a directory and O_WRITE is set",b)):f(a,b,k)),f(a,w,g)}function k(a,b){a?e(a):(t=b,e(null,t))}function l(){Qa.create({guid:a.guid,mode:ua},function(b,c){return b?void e(b):(t=c,t.nlinks+=1,void a.putObject(t.id,t,m))})}function m(b){b?e(b):(u=new Sa(0),u.fill(0),a.putBuffer(t.data,u,o))}function n(b){if(b)e(b);else{var c=Date.now();d(a,w,q,{mtime:c,ctime:c},p)}}function o(b){b?e(b):(r[v]=new Na(t.id,ua),a.putObject(q.data,r,n))}function p(a){a?e(a):e(null,t)}b=oa(b);var q,r,s,t,u,v=qa(b),w=pa(b),x=0;ya==v?ma(c).contains(Ca)?e(new Ma.EISDIR("the named file is a directory and O_WRITE is set",b)):f(a,b,k):f(a,w,g)}function l(a,b,c,e,f,g){function h(a){a?g(a):g(null,f)}function i(c){if(c)g(c);else{var e=Date.now();d(a,b.path,l,{mtime:e,ctime:e},h)}}function j(b){b?g(b):a.putObject(l.id,l,i)}function k(d,h){if(d)g(d);else{l=h;var i=new Sa(f);i.fill(0),c.copy(i,0,e,e+f),b.position=f,l.size=f,l.version+=1,a.putBuffer(l.data,i,j)}}var l;a.getObject(b.id,k)}function m(a,b,c,e,f,g,h){function i(a){a?h(a):h(null,f)}function j(c){if(c)h(c);else{var e=Date.now();d(a,b.path,n,{mtime:e,ctime:e},i)}}function k(b){b?h(b):a.putObject(n.id,n,j)}function l(d,i){if(d)h(d);else{if(o=i,!o)return h(new Ma.EIO("Expected Buffer"));var j=void 0!==g&&null!==g?g:b.position,l=Math.max(o.length,j+f),m=new Sa(l);m.fill(0),o&&o.copy(m),c.copy(m,j,e,e+f),void 0===g&&(b.position+=f),n.size=l,n.version+=1,a.putBuffer(n.data,m,k)}}function m(b,c){b?h(b):(n=c,a.getBuffer(n.data,l))}var n,o;a.getObject(b.id,m)}function n(a,b,c,d,e,f,g){function h(a,h){if(a)g(a);else{if(k=h,!k)return g(new Ma.EIO("Expected Buffer"));var i=void 0!==f&&null!==f?f:b.position;e=i+e>c.length?e-i:e,k.copy(c,d,i,i+e),void 0===f&&(b.position+=e),g(null,e)}}function i(c,d){c?g(c):"DIRECTORY"===d.mode?g(new Ma.EISDIR("the named file is a directory",b.path)):(j=d,a.getBuffer(j.data,h))}var j,k;a.getObject(b.id,i)}function o(a,b,c){b=oa(b);qa(b);f(a,b,c)}function p(a,b,c){b.getNode(a,c)}function q(a,b,c){function d(b,d){b?c(b):(g=d,a.getObject(g.data,e))}function e(d,e){d?c(d):(h=e,ma(h).has(i)?a.getObject(h[i].id,c):c(new Ma.ENOENT("a component of the path does not name an existing file",b)))}b=oa(b);var g,h,i=qa(b),j=pa(b);ya==i?f(a,b,c):f(a,j,d)}function r(a,b,c,e){function g(b){b?e(b):d(a,c,t,{ctime:Date.now()},e)}function h(b,c){b?e(b):(t=c,t.nlinks+=1,a.putObject(t.id,t,g))}function i(b,c){b?e(b):a.getObject(s[u].id,h)}function j(b,c){b?e(b):(s=c,ma(s).has(u)?e(new Ma.EEXIST("newpath resolves to an existing file",u)):(s[u]=q[n],a.putObject(r.data,s,i)))}function k(b,c){b?e(b):(r=c,a.getObject(r.data,j))}function l(b,c){b?e(b):(q=c,ma(q).has(n)?"DIRECTORY"===q[n].type?e(new Ma.EPERM("oldpath refers to a directory")):f(a,v,k):e(new Ma.ENOENT("a component of either path prefix does not exist",n)))}function m(b,c){b?e(b):(p=c,a.getObject(p.data,l))}b=oa(b);var n=qa(b),o=pa(b);c=oa(c);var p,q,r,s,t,u=qa(c),v=pa(c);f(a,o,m)}function s(a,b,c){function e(b){b?c(b):(delete m[o],a.putObject(l.data,m,function(b){var e=Date.now();d(a,p,l,{mtime:e,ctime:e},c)}))}function g(b){b?c(b):a["delete"](n.data,e)}function h(f,h){f?c(f):(n=h,n.nlinks-=1,n.nlinks<1?a["delete"](n.id,g):a.putObject(n.id,n,function(c){d(a,b,n,{ctime:Date.now()},e)}))}function i(a,b){a?c(a):"DIRECTORY"===b.mode?c(new Ma.EPERM("unlink not permitted on directories",o)):h(null,b)}function j(b,d){b?c(b):(m=d,ma(m).has(o)?a.getObject(m[o].id,i):c(new Ma.ENOENT("a component of the path does not name an existing file",o)))}function k(b,d){b?c(b):(l=d,a.getObject(l.data,j))}b=oa(b);var l,m,n,o=qa(b),p=pa(b);f(a,p,k)}function t(a,b,c){function d(a,b){if(a)c(a);else{h=b;var d=Object.keys(h);c(null,d)}}function e(e,f){e?c(e):f.mode!==va?c(new Ma.ENOTDIR(null,b)):(g=f,a.getObject(g.data,d))}b=oa(b);var g,h;qa(b);f(a,b,e)}function u(a,b,c,e){function g(b,c){b?e(b):(l=c,a.getObject(l.data,h))}function h(a,b){a?e(a):(m=b,ma(m).has(o)?e(new Ma.EEXIST(null,o)):i())}function i(){Qa.create({guid:a.guid,mode:wa},function(c,d){return c?void e(c):(n=d,n.nlinks+=1,n.size=b.length,n.data=b,void a.putObject(n.id,n,k))})}function j(b){if(b)e(b);else{var c=Date.now();d(a,p,l,{mtime:c,ctime:c},e)}}function k(b){b?e(b):(m[o]=new Na(n.id,wa),a.putObject(l.data,m,j))}c=oa(c);var l,m,n,o=qa(c),p=pa(c);ya==o?e(new Ma.EEXIST(null,o)):f(a,p,g)}function v(a,b,c){function d(b,d){b?c(b):(h=d,a.getObject(h.data,e))}function e(b,d){b?c(b):(i=d,ma(i).has(j)?a.getObject(i[j].id,g):c(new Ma.ENOENT("a component of the path does not name an existing file",j)))}function g(a,d){a?c(a):d.mode!=wa?c(new Ma.EINVAL("path not a symbolic link",b)):c(null,d.data)}b=oa(b);var h,i,j=qa(b),k=pa(b);f(a,k,d)}function w(a,b,c,e){function g(c,d){c?e(c):d.mode==va?e(new Ma.EISDIR(null,b)):(k=d,a.getBuffer(k.data,h))}function h(b,d){if(b)e(b);else{if(!d)return e(new Ma.EIO("Expected Buffer"));var f=new Sa(c);f.fill(0),d&&d.copy(f),a.putBuffer(k.data,f,j)}}function i(c){if(c)e(c);else{var f=Date.now();d(a,b,k,{mtime:f,ctime:f},e)}}function j(b){b?e(b):(k.size=c,k.version+=1,a.putObject(k.id,k,i))}b=oa(b);var k;0>c?e(new Ma.EINVAL("length cannot be negative")):f(a,b,g)}function x(a,b,c,e){function f(b,c){b?e(b):c.mode==va?e(new Ma.EISDIR):(j=c,a.getBuffer(j.data,g))}function g(b,d){if(b)e(b);else{var f;if(!d)return e(new Ma.EIO("Expected Buffer"));d?f=d.slice(0,c):(f=new Sa(c),f.fill(0)),a.putBuffer(j.data,f,i)}}function h(c){if(c)e(c);else{var f=Date.now();d(a,b.path,j,{mtime:f,ctime:f},e)}}function i(b){b?e(b):(j.size=c,j.version+=1,a.putObject(j.id,j,h))}var j;0>c?e(new Ma.EINVAL("length cannot be negative")):b.getNode(a,f)}function y(a,b,c,e,g){function h(f,h){f?g(f):d(a,b,h,{atime:c,ctime:e,mtime:e},g)}b=oa(b),"number"!=typeof c||"number"!=typeof e?g(new Ma.EINVAL("atime and mtime must be number",b)):0>c||0>e?g(new Ma.EINVAL("atime and mtime must be positive integers",b)):f(a,b,h)}function z(a,b,c,e,f){function g(g,h){g?f(g):d(a,b.path,h,{atime:c,ctime:e,mtime:e},f)}"number"!=typeof c||"number"!=typeof e?f(new Ma.EINVAL("atime and mtime must be a number")):0>c||0>e?f(new Ma.EINVAL("atime and mtime must be positive integers")):b.getNode(a,g)}function A(a,b,c,d,e,h){function i(f,i){return f?h(f):void g(a,b,i,c,d,e,h)}b=oa(b),"string"!=typeof c?h(new Ma.EINVAL("attribute name must be a string",b)):c?null!==e&&e!==Ha&&e!==Ia?h(new Ma.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",b)):f(a,b,i):h(new Ma.EINVAL("attribute name cannot be an empty string",b))}function B(a,b,c,d,e,f){function h(h,i){return h?f(h):void g(a,b.path,i,c,d,e,f)}"string"!=typeof c?f(new Ma.EINVAL("attribute name must be a string")):c?null!==e&&e!==Ha&&e!==Ia?f(new Ma.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):b.getNode(a,h):f(new Ma.EINVAL("attribute name cannot be an empty string"))}function C(a,b,c,d){function e(a,e){if(a)return d(a);var f=e.xattrs;f.hasOwnProperty(c)?d(null,f[c]):d(new Ma.ENOATTR(null,b))}b=oa(b),"string"!=typeof c?d(new Ma.EINVAL("attribute name must be a string",b)):c?f(a,b,e):d(new Ma.EINVAL("attribute name cannot be an empty string",b))}function D(a,b,c,d){function e(a,b){if(a)return d(a);var e=b.xattrs;e.hasOwnProperty(c)?d(null,e[c]):d(new Ma.ENOATTR)}"string"!=typeof c?d(new Ma.EINVAL):c?b.getNode(a,e):d(new Ma.EINVAL("attribute name cannot be an empty string"))}function E(a,b,c,e){function g(f,g){function h(c){c?e(c):d(a,b,g,{ctime:Date.now()},e)}if(f)return e(f);var i=g.xattrs;i.hasOwnProperty(c)?(delete i[c],a.putObject(g.id,g,h)):e(new Ma.ENOATTR(null,b))}b=oa(b),"string"!=typeof c?e(new Ma.EINVAL("attribute name must be a string",b)):c?f(a,b,g):e(new Ma.EINVAL("attribute name cannot be an empty string",b))}function F(a,b,c,e){function f(f,g){function h(c){c?e(c):d(a,b.path,g,{ctime:Date.now()},e)}if(f)return e(f);var i=g.xattrs;i.hasOwnProperty(c)?(delete i[c],a.putObject(g.id,g,h)):e(new Ma.ENOATTR)}"string"!=typeof c?e(new Ma.EINVAL("attribute name must be a string")):c?b.getNode(a,f):e(new Ma.EINVAL("attribute name cannot be an empty string"))}function G(a){return ma(Ga).has(a)?Ga[a]:null}function H(a,b,c){return a?"function"==typeof a?a={encoding:b,flag:c}:"string"==typeof a&&(a={encoding:a,flag:c}):a={encoding:b,flag:c},a}function I(a,b){var c;return a?sa(a)?c=new Ma.EINVAL("Path must be a string without null bytes.",a):ra(a)||(c=new Ma.EINVAL("Path must be absolute.",a)):c=new Ma.EINVAL("Path must be a string",a),c?(b(c),!1):!0}function J(a,b,c,d,e,f){function g(b,e){if(b)f(b);else{var g;g=ma(d).contains(Fa)?e.size:0;var h=new Oa(c,e.id,d,g),i=a.allocDescriptor(h);f(null,i)}}f=arguments[arguments.length-1],I(c,f)&&(d=G(d),d||f(new Ma.EINVAL("flags is not valid"),c),k(b,c,d,g))}function K(a,b,c,d){ma(a.openFiles).has(c)?(a.releaseDescriptor(c),d(null)):d(new Ma.EBADF)}function L(a,b,c,d,f){I(c,f)&&e(b,c,d,f)}function M(a,b,c,d,e){e=arguments[arguments.length-1],I(c,e)&&i(b,c,e)}function N(a,b,c,d){I(c,d)&&j(b,c,d)}function O(a,b,c,d){function e(b,c){if(b)d(b);else{var e=new Ra(c,a.name);d(null,e)}}I(c,d)&&o(b,c,e)}function P(a,b,c,d){function e(b,c){if(b)d(b);else{var e=new Ra(c,a.name);d(null,e)}}var f=a.openFiles[c];f?p(b,f,e):d(new Ma.EBADF)}function Q(a,b,c,d,e){I(c,e)&&I(d,e)&&r(b,c,d,e)}function R(a,b,c,d){I(c,d)&&s(b,c,d)}function S(a,b,c,d,e,f,g,h){function i(a,b){h(a,b||0,d)}e=void 0===e?0:e,f=void 0===f?d.length-e:f,h=arguments[arguments.length-1];var j=a.openFiles[c];j?ma(j.flags).contains(Ba)?n(b,j,d,e,f,g,i):h(new Ma.EBADF("descriptor does not permit reading")):h(new Ma.EBADF)}function T(a,b,c,d,e){if(e=arguments[arguments.length-1],d=H(d,null,"r"),I(c,e)){var f=G(d.flag||"r");return f?void k(b,c,f,function(g,h){function i(){a.releaseDescriptor(k)}if(g)return e(g);var j=new Oa(c,h.id,f,0),k=a.allocDescriptor(j);p(b,j,function(f,g){if(f)return i(),e(f);var h=new Ra(g,a.name);if(h.isDirectory())return i(),e(new Ma.EISDIR("illegal operation on directory",c));var k=h.size,l=new Sa(k);l.fill(0),n(b,j,l,0,k,0,function(a,b){if(i(),a)return e(a);var c;c="utf8"===d.encoding?La.decode(l):l,e(null,c)})})}):e(new Ma.EINVAL("flags is not valid",c))}}function U(a,b,c,d,e,f,g,h){h=arguments[arguments.length-1],e=void 0===e?0:e,f=void 0===f?d.length-e:f;var i=a.openFiles[c];i?ma(i.flags).contains(Ca)?d.length-e<f?h(new Ma.EIO("intput buffer is too small")):m(b,i,d,e,f,g,h):h(new Ma.EBADF("descriptor does not permit writing")):h(new Ma.EBADF)}function V(a,b,c,d,e,f){if(f=arguments[arguments.length-1],e=H(e,"utf8","w"),I(c,f)){var g=G(e.flag||"w");if(!g)return f(new Ma.EINVAL("flags is not valid",c));d=d||"","number"==typeof d&&(d=""+d),"string"==typeof d&&"utf8"===e.encoding&&(d=La.encode(d)),k(b,c,g,function(e,h){if(e)return f(e);var i=new Oa(c,h.id,g,0),j=a.allocDescriptor(i);l(b,i,d,0,d.length,function(b,c){return a.releaseDescriptor(j),b?f(b):void f(null)})})}}function W(a,b,c,d,e,f){if(f=arguments[arguments.length-1],e=H(e,"utf8","a"),I(c,f)){var g=G(e.flag||"a");if(!g)return f(new Ma.EINVAL("flags is not valid",c));d=d||"","number"==typeof d&&(d=""+d),"string"==typeof d&&"utf8"===e.encoding&&(d=La.encode(d)),k(b,c,g,function(e,h){if(e)return f(e);var i=new Oa(c,h.id,g,h.size),j=a.allocDescriptor(i);m(b,i,d,0,d.length,i.position,function(b,c){return a.releaseDescriptor(j),b?f(b):void f(null)})})}}function X(a,b,c,d){function e(a,b){d(a?!1:!0)}O(a,b,c,e)}function Y(a,b,c,d,e){I(c,e)&&C(b,c,d,e)}function Z(a,b,c,d,e){var f=a.openFiles[c];f?D(b,f,d,e):e(new Ma.EBADF)}function $(a,b,c,d,e,f,g){"function"==typeof f&&(g=f,f=null),I(c,g)&&A(b,c,d,e,f,g)}function _(a,b,c,d,e,f,g){"function"==typeof f&&(g=f,f=null);var h=a.openFiles[c];h?ma(h.flags).contains(Ca)?B(b,h,d,e,f,g):g(new Ma.EBADF("descriptor does not permit writing")):g(new Ma.EBADF)}function aa(a,b,c,d,e){I(c,e)&&E(b,c,d,e)}function ba(a,b,c,d,e){var f=a.openFiles[c];f?ma(f.flags).contains(Ca)?F(b,f,d,e):e(new Ma.EBADF("descriptor does not permit writing")):e(new Ma.EBADF)}function ca(a,b,c,d,e,f){function g(a,b){a?f(a):b.size+d<0?f(new Ma.EINVAL("resulting file offset would be negative")):(h.position=b.size+d,f(null,h.position))}var h=a.openFiles[c];h||f(new Ma.EBADF),"SET"===e?0>d?f(new Ma.EINVAL("resulting file offset would be negative")):(h.position=d,f(null,h.position)):"CUR"===e?h.position+d<0?f(new Ma.EINVAL("resulting file offset would be negative")):(h.position+=d,f(null,h.position)):"END"===e?p(b,h,g):f(new Ma.EINVAL("whence argument is not a proper value"))}function da(a,b,c,d){I(c,d)&&t(b,c,d)}function ea(a,b,c,d,e,f){if(I(c,f)){var g=Date.now();d=d?d:g,e=e?e:g,y(b,c,d,e,f)}}function fa(a,b,c,d,e,f){var g=Date.now();d=d?d:g,e=e?e:g;var h=a.openFiles[c];h?ma(h.flags).contains(Ca)?z(b,h,d,e,f):f(new Ma.EBADF("descriptor does not permit writing")):f(new Ma.EBADF)}function ga(a,b,c,e,g){function h(a,c){a?g(a):d(b,e,c,{ctime:Date.now()},g)}function i(a){a?g(a):b.getObject(x[B].id,h)}function k(a){a?g(a):(u.id===w.id&&(v=x),delete v[A],b.putObject(u.data,v,i))}function l(a){a?g(a):(x[B]=v[A],b.putObject(w.data,x,k))}function m(a,c){a?g(a):(x=c,ma(x).has(B)?j(b,e,l):l())}function n(a,c){a?g(a):(w=c,b.getObject(w.data,m))}function o(a,c){a?g(a):(v=c,f(b,z,n))}function p(a,c){a?g(a):(u=c,b.getObject(c.data,o))}function q(a){a?g(a):s(b,c,g)}function t(a,d){a?g(a):"DIRECTORY"===d.mode?f(b,y,p):r(b,c,e,q)}if(I(c,g)&&I(e,g)){c=oa(c),e=oa(e);var u,v,w,x,y=na.dirname(c),z=na.dirname(c),A=na.basename(c),B=na.basename(e);f(b,c,t)}}function ha(a,b,c,d,e,f){f=arguments[arguments.length-1],I(c,f)&&I(d,f)&&u(b,c,d,f)}function ia(a,b,c,d){I(c,d)&&v(b,c,d)}function ja(a,b,c,d){function e(b,c){if(b)d(b);else{var e=new Ra(c,a.name);d(null,e)}}I(c,d)&&q(b,c,e)}function ka(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0,I(c,e)&&w(b,c,d,e)}function la(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0;var f=a.openFiles[c];f?ma(f.flags).contains(Ca)?x(b,f,d,e):e(new Ma.EBADF("descriptor does not permit writing")):e(new Ma.EBADF)}var ma=a("../../lib/nodash.js"),na=a("../path.js"),oa=na.normalize,pa=na.dirname,qa=na.basename,ra=na.isAbsolute,sa=na.isNull,ta=a("../constants.js"),ua=ta.MODE_FILE,va=ta.MODE_DIRECTORY,wa=ta.MODE_SYMBOLIC_LINK,xa=ta.MODE_META,ya=ta.ROOT_DIRECTORY_NAME,za=ta.SUPER_NODE_ID,Aa=ta.SYMLOOP_MAX,Ba=ta.O_READ,Ca=ta.O_WRITE,Da=ta.O_CREATE,Ea=ta.O_EXCLUSIVE,Fa=(ta.O_TRUNCATE,
ta.O_APPEND),Ga=ta.O_FLAGS,Ha=ta.XATTR_CREATE,Ia=ta.XATTR_REPLACE,Ja=ta.FS_NOMTIME,Ka=ta.FS_NOCTIME,La=a("../encoding.js"),Ma=a("../errors.js"),Na=a("../directory-entry.js"),Oa=a("../open-file-description.js"),Pa=a("../super-node.js"),Qa=a("../node.js"),Ra=a("../stats.js"),Sa=a("../buffer.js");b.exports={ensureRootDirectory:h,open:J,close:K,mknod:L,mkdir:M,rmdir:N,unlink:R,stat:O,fstat:P,link:Q,read:S,readFile:T,write:U,writeFile:V,appendFile:W,exists:X,getxattr:Y,fgetxattr:Z,setxattr:$,fsetxattr:_,removexattr:aa,fremovexattr:ba,lseek:ca,readdir:da,utimes:ea,futimes:fa,rename:ga,symlink:ha,readlink:ia,lstat:ja,truncate:ka,ftruncate:la}},{"../../lib/nodash.js":4,"../buffer.js":14,"../constants.js":15,"../directory-entry.js":16,"../encoding.js":17,"../errors.js":18,"../node.js":23,"../open-file-description.js":24,"../path.js":25,"../stats.js":33,"../super-node.js":34}],20:[function(a,b,c){function d(a){return"function"==typeof a?a:function(a){if(a)throw a}}function e(a){a&&console.error("Filer error: ",a)}function f(a,b){function c(){I.forEach(function(a){a.call(this)}.bind(F)),I=null}function d(a){return function(b){function c(b){var d=B();a.getObject(d,function(a,e){return a?void b(a):void(e?c(b):b(null,d))})}return g(j).contains(p)?void b(null,B()):void c(b)}}function f(a){if(a.length){var b=s.getInstance();a.forEach(function(a){b.emit(a.event,a.path)})}}a=a||{},b=b||e;var j=a.flags,B=a.guid?a.guid:v,C=a.provider||new q.Default(a.name||k),D=a.name||C.name,E=g(j).contains(l),F=this;F.readyState=n,F.name=D,F.error=null,F.stdin=w,F.stdout=x,F.stderr=y,this.Shell=r.bind(void 0,this);var G={},H=z;Object.defineProperty(this,"openFiles",{get:function(){return G}}),this.allocDescriptor=function(a){var b=H++;return G[b]=a,b},this.releaseDescriptor=function(a){delete G[a]};var I=[];this.queueOrRun=function(a){var b;return m==F.readyState?a.call(F):o==F.readyState?b=new u.EFILESYSTEMERROR("unknown error"):I.push(a),b},this.watch=function(a,b,c){if(h(a))throw new Error("Path must be a string without null bytes.");"function"==typeof b&&(c=b,b={}),b=b||{},c=c||i;var d=new t;return d.start(a,!1,b.recursive),d.on("change",c),d},C.open(function(a){function e(a){function e(a){var b=C[a]();return b.flags=j,b.changes=[],b.guid=d(b),b.close=function(){var a=b.changes;f(a),a.length=0},b}F.provider={openReadWriteContext:function(){return e("getReadWriteContext")},openReadOnlyContext:function(){return e("getReadOnlyContext")}},a?F.readyState=o:F.readyState=m,c(),b(a,F)}if(a)return e(a);var g=C.getReadWriteContext();g.guid=d(g),E?g.clear(function(a){return a?e(a):void A.ensureRootDirectory(g,e)}):A.ensureRootDirectory(g,e)})}var g=a("../../lib/nodash.js"),h=a("../path.js").isNull,i=a("../shared.js").nop,j=a("../constants.js"),k=j.FILE_SYSTEM_NAME,l=j.FS_FORMAT,m=j.FS_READY,n=j.FS_PENDING,o=j.FS_ERROR,p=j.FS_NODUPEIDCHECK,q=a("../providers/index.js"),r=a("../shell/shell.js"),s=a("../../lib/intercom.js"),t=a("../fs-watcher.js"),u=a("../errors.js"),v=a("../shared.js").guid,w=j.STDIN,x=j.STDOUT,y=j.STDERR,z=j.FIRST_DESCRIPTOR,A=a("./implementation.js");f.providers=q,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(a){f.prototype[a]=function(){var b=this,c=Array.prototype.slice.call(arguments,0),e=c.length-1,f="function"!=typeof c[e],g=d(c[e]),h=b.queueOrRun(function(){function d(){h.close(),g.apply(b,arguments)}var h=b.provider.openReadWriteContext();if(o===b.readyState){var i=new u.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return g.call(b,i)}f?c.push(d):c[e]=d;var j=[b,h].concat(c);A[a].apply(null,j)});h&&g(h)}}),b.exports=f},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":15,"../errors.js":18,"../fs-watcher.js":21,"../path.js":25,"../providers/index.js":26,"../shared.js":30,"../shell/shell.js":32,"./implementation.js":19}],21:[function(a,b,c){function d(){function a(a){(c===a||h&&0===a.indexOf(b))&&d.trigger("change","change",a)}e.call(this);var b,c,d=this,h=!1;d.start=function(d,e,i){if(!c){if(f.isNull(d))throw new Error("Path must be a string without null bytes.");c=f.normalize(d),h=i===!0,h&&(b="/"===c?"/":c+"/");var j=g.getInstance();j.on("change",a)}},d.close=function(){var b=g.getInstance();b.off("change",a),d.removeAllListeners("change")}}var e=a("../lib/eventemitter.js"),f=a("./path.js"),g=a("../lib/intercom.js");d.prototype=new e,d.prototype.constructor=d,b.exports=d},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":25}],22:[function(a,b,c){b.exports={FileSystem:a("./filesystem/interface.js"),Buffer:a("./buffer.js"),Path:a("./path.js"),Errors:a("./errors.js"),Shell:a("./shell/shell.js")}},{"./buffer.js":14,"./errors.js":18,"./filesystem/interface.js":20,"./path.js":25,"./shell/shell.js":32}],23:[function(a,b,c){function d(a){var b=Date.now();this.id=a.id,this.mode=a.mode||f,this.size=a.size||0,this.atime=a.atime||b,this.ctime=a.ctime||b,this.mtime=a.mtime||b,this.flags=a.flags||[],this.xattrs=a.xattrs||{},this.nlinks=a.nlinks||0,this.version=a.version||0,this.blksize=void 0,this.nblocks=1,this.data=a.data}function e(a,b,c){a[b]?c(null):a.guid(function(d,e){a[b]=e,c(d)})}var f=a("./constants.js").MODE_FILE;d.create=function(a,b){e(a,"id",function(c){return c?void b(c):void e(a,"data",function(c){return c?void b(c):void b(null,new d(a))})})},b.exports=d},{"./constants.js":15}],24:[function(a,b,c){function d(a,b,c,d){this.path=a,this.id=b,this.flags=c,this.position=d}var e=a("./errors.js");d.prototype.getNode=function(a,b){function c(a,c){return a?b(a):c?void b(null,c):b(new e.EBADF("file descriptor refers to unknown node",f))}var d=this.id,f=this.path;a.getObject(d,c)},b.exports=d},{"./errors.js":18}],25:[function(a,b,c){function d(a,b){for(var c=0,d=a.length-1;d>=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function e(){for(var a="",b=!1,c=arguments.length-1;c>=-1&&!b;c--){var e=c>=0?arguments[c]:"/";"string"==typeof e&&e&&(a=e+"/"+a,b="/"===e.charAt(0))}return a=d(a.split("/").filter(function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."}function f(a){var b="/"===a.charAt(0);"/"===a.substr(-1);return a=d(a.split("/").filter(function(a){return!!a}),!b).join("/"),a||b||(a="."),(b?"/":"")+a}function g(){var a=Array.prototype.slice.call(arguments,0);return f(a.filter(function(a,b){return a&&"string"==typeof a}).join("/"))}function h(a,b){function c(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;c>=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=e(a).substr(1),b=e(b).substr(1);for(var d=c(a.split("/")),f=c(b.split("/")),g=Math.min(d.length,f.length),h=g,i=0;g>i;i++)if(d[i]!==f[i]){h=i;break}for(var j=[],i=h;i<d.length;i++)j.push("..");return j=j.concat(f.slice(h)),j.join("/")}function i(a){var b=q(a),c=b[0],d=b[1];return c||d?(d&&(d=d.substr(0,d.length-1)),c+d):"."}function j(a,b){var c=q(a)[2];return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),""===c?"/":c}function k(a){return q(a)[3]}function l(a){return"/"===a.charAt(0)?!0:!1}function m(a){return-1!==(""+a).indexOf("\x00")?!0:!1}function n(a){return a.replace(/\/*$/,"/")}function o(a){return a=a.replace(/\/*$/,""),""===a?"/":a}var p=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,q=function(a){var b=p.exec(a);return[b[1]||"",b[2]||"",b[3]||"",b[4]||""]};b.exports={normalize:f,resolve:e,join:g,relative:h,sep:"/",delimiter:":",dirname:i,basename:j,extname:k,isAbsolute:l,isNull:m,addTrailing:n,removeTrailing:o}},{}],26:[function(a,b,c){var d=a("./indexeddb.js"),e=a("./websql.js"),f=a("./memory.js");b.exports={IndexedDB:d,WebSQL:e,Memory:f,Default:d,Fallback:function(){function a(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return d.isSupported()?d:e.isSupported()?e:(a.isSupported=function(){return!1},a)}()}},{"./indexeddb.js":27,"./memory.js":28,"./websql.js":29}],27:[function(a,b,c){(function(c,d){function e(a,b){this.db=a,this.mode=b}function f(a){this.name=a||g,this.db=null}var g=a("../constants.js").FILE_SYSTEM_NAME,h=a("../constants.js").FILE_STORE_NAME,i=a("../constants.js").IDB_RW,j=a("../constants.js").IDB_RO,k=(a("../errors.js"),a("../buffer.js")),l=c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB;e.prototype._getObjectStore=function(){if(this.objectStore)return this.objectStore;var a=this.db.transaction(h,this.mode);return this.objectStore=a.objectStore(h),this.objectStore},e.prototype.clear=function(a){try{var b=this._getObjectStore(),c=b.clear();c.onsuccess=function(){a()},c.onerror=function(b){b.preventDefault(),a(b.error)}}catch(d){a(d)}},e.prototype._get=function(a,b){try{var c=this._getObjectStore(),d=c.get(a);d.onsuccess=function(a){var c=a.target.result;b(null,c)},d.onerror=function(a){a.preventDefault(),b(a.error)}}catch(e){b(e)}},e.prototype.getObject=function(a,b){this._get(a,b)},e.prototype.getBuffer=function(a,b){this._get(a,function(a,c){return a?b(a):void b(null,new k(c))})},e.prototype._put=function(a,b,c){try{var d=this._getObjectStore(),e=d.put(b,a);e.onsuccess=function(a){var b=a.target.result;c(null,b)},e.onerror=function(a){a.preventDefault(),c(a.error)}}catch(f){c(f)}},e.prototype.putObject=function(a,b,c){this._put(a,b,c)},e.prototype.putBuffer=function(a,b,c){var e;e=d._useTypedArrays?b.buffer:b.toArrayBuffer(),this._put(a,e,c)},e.prototype["delete"]=function(a,b){try{var c=this._getObjectStore(),d=c["delete"](a);d.onsuccess=function(a){var c=a.target.result;b(null,c)},d.onerror=function(a){a.preventDefault(),b(a.error)}}catch(e){b(e)}},f.isSupported=function(){return!!l},f.prototype.open=function(a){var b=this;if(b.db)return a();try{var c=l.open(b.name);c.onupgradeneeded=function(a){var b=a.target.result;b.objectStoreNames.contains(h)&&b.deleteObjectStore(h),b.createObjectStore(h)},c.onsuccess=function(c){b.db=c.target.result,a()},c.onerror=function(b){b.preventDefault(),a(b.error)}}catch(d){a(d)}},f.prototype.getReadOnlyContext=function(){return new e(this.db,j)},f.prototype.getReadWriteContext=function(){return new e(this.db,i)},b.exports=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"../buffer.js":14,"../constants.js":15,"../errors.js":18,buffer:6}],28:[function(a,b,c){function d(a,b){this.readOnly=b,this.objectStore=a}function e(a){this.name=a||f}var f=a("../constants.js").FILE_SYSTEM_NAME,g=a("../../lib/async.js").setImmediate,h=function(){var a={};return function(b){return a.hasOwnProperty(b)||(a[b]={}),a[b]}}();d.prototype.clear=function(a){if(this.readOnly)return void g(function(){a("[MemoryContext] Error: write operation on read only context")});var b=this.objectStore;Object.keys(b).forEach(function(a){delete b[a]}),g(a)},d.prototype.getObject=d.prototype.getBuffer=function(a,b){var c=this;g(function(){b(null,c.objectStore[a])})},d.prototype.putObject=d.prototype.putBuffer=function(a,b,c){return this.readOnly?void g(function(){c("[MemoryContext] Error: write operation on read only context")}):(this.objectStore[a]=b,void g(c))},d.prototype["delete"]=function(a,b){return this.readOnly?void g(function(){b("[MemoryContext] Error: write operation on read only context")}):(delete this.objectStore[a],void g(b))},e.isSupported=function(){return!0},e.prototype.open=function(a){this.db=h(this.name),g(a)},e.prototype.getReadOnlyContext=function(){return new d(this.db,!0)},e.prototype.getReadWriteContext=function(){return new d(this.db,!1)},b.exports=e},{"../../lib/async.js":1,"../constants.js":15}],29:[function(a,b,c){(function(c){function d(a,b){var c=this;this.getTransaction=function(d){return c.transaction?void d(c.transaction):void a[b?"readTransaction":"transaction"](function(a){c.transaction=a,d(a)})}}function e(a,b,c){function d(a,b){var d=0===b.rows.length?null:b.rows.item(0).data;c(null,d)}function e(a,b){c(b)}a(function(a){a.executeSql("SELECT data FROM "+i+" WHERE id = ? LIMIT 1;",[b],d,e)})}function f(a,b,c,d){function e(a,b){d(null)}function f(a,b){d(b)}a(function(a){a.executeSql("INSERT OR REPLACE INTO "+i+" (id, data) VALUES (?, ?);",[b,c],e,f)})}function g(a){this.name=a||h,this.db=null}var h=a("../constants.js").FILE_SYSTEM_NAME,i=a("../constants.js").FILE_STORE_NAME,j=a("../constants.js").WSQL_VERSION,k=a("../constants.js").WSQL_SIZE,l=a("../constants.js").WSQL_DESC,m=a("../errors.js"),n=a("../buffer.js"),o=a("base64-arraybuffer");d.prototype.clear=function(a){function b(b,c){a(c)}function c(b,c){a(null)}this.getTransaction(function(a){a.executeSql("DELETE FROM "+i+";",[],c,b)})},d.prototype.getObject=function(a,b){e(this.getTransaction,a,function(a,c){if(a)return b(a);try{c&&(c=JSON.parse(c))}catch(d){return b(d)}b(null,c)})},d.prototype.getBuffer=function(a,b){e(this.getTransaction,a,function(a,c){if(a)return b(a);if(c||""===c){var d=o.decode(c);c=new n(d)}b(null,c)})},d.prototype.putObject=function(a,b,c){var d=JSON.stringify(b);f(this.getTransaction,a,d,c)},d.prototype.putBuffer=function(a,b,c){var d=o.encode(b.buffer);f(this.getTransaction,a,d,c)},d.prototype["delete"]=function(a,b){function c(a,c){b(null)}function d(a,c){b(c)}this.getTransaction(function(b){b.executeSql("DELETE FROM "+i+" WHERE id = ?;",[a],c,d)})},g.isSupported=function(){return!!c.openDatabase},g.prototype.open=function(a){function b(b,c){5===c.code&&a(new m.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),a(c)}function d(b,c){e.db=f,a()}var e=this;if(e.db)return a();var f=c.openDatabase(e.name,j,l,k);return f?void f.transaction(function(a){function c(a){a.executeSql("CREATE INDEX IF NOT EXISTS idx_"+i+"_id on "+i+" (id);",[],d,b)}a.executeSql("CREATE TABLE IF NOT EXISTS "+i+" (id unique, data TEXT);",[],c,b)}):void a("[WebSQL] Unable to open database.")},g.prototype.getReadOnlyContext=function(){return new d(this.db,!0)},g.prototype.getReadWriteContext=function(){return new d(this.db,!1)},b.exports=g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../buffer.js":14,"../constants.js":15,"../errors.js":18,"base64-arraybuffer":5}],30:[function(a,b,c){function d(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}).toUpperCase()}function e(){}function f(a){for(var b=[],c=a.length,d=0;c>d;d++)b[d]=a[d];return b}b.exports={guid:d,u8toArray:f,nop:e}},{}],31:[function(a,b,c){var d=a("../constants.js").ENVIRONMENT;b.exports=function(a){a=a||{},a.TMP=a.TMP||d.TMP,a.PATH=a.PATH||d.PATH,this.get=function(b){return a[b]},this.set=function(b,c){a[b]=c}}},{"../constants.js":15}],32:[function(a,b,c){function d(a,b){b=b||{};var c=new g(b.env),d="/";Object.defineProperty(this,"fs",{get:function(){return a},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return c},enumerable:!0}),this.cd=function(b,c){b=e.resolve(d,b),a.stat(b,function(a,e){return a?void c(new f.ENOTDIR(null,b)):void("DIRECTORY"===e.type?(d=b,c()):c(new f.ENOTDIR(null,b)))})},this.pwd=function(){return d}}var e=a("../path.js"),f=a("../errors.js"),g=a("./environment.js"),h=a("../../lib/async.js"),i=(a("../encoding.js"),a("minimatch"));d.prototype.exec=function(a,b,c){var d=this,f=d.fs;"function"==typeof b&&(c=b,b=[]),b=b||[],c=c||function(){},a=e.resolve(d.pwd(),a),f.readFile(a,"utf8",function(a,d){if(a)return void c(a);try{var e=new Function("fs","args","callback",d);e(f,b,c)}catch(g){c(g)}})},d.prototype.touch=function(a,b,c){function d(a){h.writeFile(a,"",c)}function f(a){var d=Date.now(),e=b.date||d,f=b.date||d;h.utimes(a,e,f,c)}var g=this,h=g.fs;"function"==typeof b&&(c=b,b={}),b=b||{},c=c||function(){},a=e.resolve(g.pwd(),a),h.stat(a,function(e,g){e?b.updateOnly===!0?c():d(a):f(a)})},d.prototype.cat=function(a,b){function c(a,b){var c=e.resolve(d.pwd(),a);g.readFile(c,"utf8",function(a,c){return a?void b(a):(i+=c+"\n",void b())})}var d=this,g=d.fs,i="";return b=b||function(){},a?(a="string"==typeof a?[a]:a,void h.eachSeries(a,c,function(a){a?b(a):b(null,i.replace(/\n$/,""))})):void b(new f.EINVAL("Missing files argument"))},d.prototype.ls=function(a,b,c){function d(a,c){var f=e.resolve(g.pwd(),a),j=[];i.readdir(f,function(a,g){function k(a,c){a=e.join(f,a),i.stat(a,function(g,h){if(g)return void c(g);var i={path:e.basename(a),links:h.nlinks,size:h.size,modified:h.mtime,type:h.type};b.recursive&&"DIRECTORY"===h.type?d(e.join(f,i.path),function(a,b){return a?void c(a):(i.contents=b,j.push(i),void c())}):(j.push(i),c())})}return a?void c(a):void h.eachSeries(g,k,function(a){c(a,j)})})}var g=this,i=g.fs;return"function"==typeof b&&(c=b,b={}),b=b||{},c=c||function(){},a?void d(a,c):void c(new f.EINVAL("Missing dir argument"))},d.prototype.rm=function(a,b,c){function d(a,c){a=e.resolve(g.pwd(),a),i.stat(a,function(g,j){return g?void c(g):"FILE"===j.type?void i.unlink(a,c):void i.readdir(a,function(g,j){return g?void c(g):0===j.length?void i.rmdir(a,c):b.recursive?(j=j.map(function(b){return e.join(a,b)}),void h.eachSeries(j,d,function(b){return b?void c(b):void i.rmdir(a,c)})):void c(new f.ENOTEMPTY(null,a))})})}var g=this,i=g.fs;return"function"==typeof b&&(c=b,b={}),b=b||{},c=c||function(){},a?void d(a,c):void c(new f.EINVAL("Missing path argument"))},d.prototype.tempDir=function(a){var b=this,c=b.fs,d=b.env.get("TMP");a=a||function(){},c.mkdir(d,function(b){a(null,d)})},d.prototype.mkdirp=function(a,b){function c(a,b){g.stat(a,function(d,h){if(h){if(h.isDirectory())return void b();if(h.isFile())return void b(new f.ENOTDIR(null,a))}else{if(d&&"ENOENT"!==d.code)return void b(d);var i=e.dirname(a);"/"===i?g.mkdir(a,function(a){return a&&"EEXIST"!=a.code?void b(a):void b()}):c(i,function(c){return c?b(c):void g.mkdir(a,function(a){return a&&"EEXIST"!=a.code?void b(a):void b()})})}})}var d=this,g=d.fs;return b=b||function(){},a?"/"===a?void b():void c(a,b):void b(new f.EINVAL("Missing path argument"))},d.prototype.find=function(a,b,c){function d(a,b){m(a,function(c){return c?void b(c):(n.push(a),void b())})}function g(a,c){var f=e.removeTrailing(a);return b.regex&&!b.regex.test(f)?void c():b.name&&!i(e.basename(f),b.name)?void c():b.path&&!i(e.dirname(f),b.path)?void c():void d(a,c)}function j(a,b){a=e.resolve(k.pwd(),a),l.readdir(a,function(c,d){return c?void("ENOTDIR"===c.code?g(a,b):b(c)):void g(e.addTrailing(a),function(c){return c?void b(c):(d=d.map(function(b){return e.join(a,b)}),void h.eachSeries(d,j,function(a){b(a,n)}))})})}var k=this,l=k.fs;"function"==typeof b&&(c=b,b={}),b=b||{},c=c||function(){};var m=b.exec||function(a,b){b()},n=[];return a?void l.stat(a,function(b,d){return b?void c(b):d.isDirectory()?void j(a,c):void c(new f.ENOTDIR(null,a))}):void c(new f.EINVAL("Missing path argument"))},b.exports=d},{"../../lib/async.js":1,"../encoding.js":17,"../errors.js":18,"../path.js":25,"./environment.js":31,minimatch:11}],33:[function(a,b,c){function d(a,b){this.node=a.id,this.dev=b,this.size=a.size,this.nlinks=a.nlinks,this.atime=a.atime,this.mtime=a.mtime,this.ctime=a.ctime,this.type=a.mode}var e=a("./constants.js");d.prototype.isFile=function(){return this.type===e.MODE_FILE},d.prototype.isDirectory=function(){return this.type===e.MODE_DIRECTORY},d.prototype.isSymbolicLink=function(){return this.type===e.MODE_SYMBOLIC_LINK},d.prototype.isSocket=d.prototype.isFIFO=d.prototype.isCharacterDevice=d.prototype.isBlockDevice=function(){return!1},b.exports=d},{"./constants.js":15}],34:[function(a,b,c){function d(a){var b=Date.now();this.id=e.SUPER_NODE_ID,this.mode=e.MODE_META,this.atime=a.atime||b,this.ctime=a.ctime||b,this.mtime=a.mtime||b,this.rnode=a.rnode}var e=a("./constants.js");d.create=function(a,b){a.guid(function(c,e){return c?void b(c):(a.rnode=a.rnode||e,void b(null,new d(a)))})},b.exports=d},{"./constants.js":15}]},{},[22])(22)});
=======
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({13:[function(require,module,exports) {
var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t=Array.prototype,r=t.forEach,e=t.indexOf,o=t.some,u=Object.prototype,l=u.hasOwnProperty,f=Object.keys,i={};function c(n,t){return l.call(n,t)}var a=f||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)c(n,r)&&t.push(r);return t};function y(n){return null==n?0:n.length===+n.length?n.length:a(n).length}function p(n){return n}function s(n,t,e){var o,u;if(null!=n)if(r&&n.forEach===r)n.forEach(t,e);else if(n.length===+n.length){for(o=0,u=n.length;o<u;o++)if(t.call(e,n[o],o,n)===i)return}else{var l=l(n);for(o=0,u=l.length;o<u;o++)if(t.call(e,n[l[o]],l[o],n)===i)return}}function h(n,t,r){t||(t=p);var e=!1;return null==n?e:o&&n.some===o?n.some(t,r):(s(n,function(n,o,u){if(e||(e=t.call(r,n,o,u)))return i}),!!e)}function v(n,t){return null!=n&&(e&&n.indexOf===e?-1!=n.indexOf(t):h(n,function(n){return n===t}))}function b(n){this.value=n}function m(t){return t&&"object"==(void 0===t?"undefined":n(t))&&!Array.isArray(t)&&l.call(t,"__wrapped__")?t:new b(t)}b.prototype.has=function(n){return c(this.value,n)},b.prototype.contains=function(n){return v(this.value,n)},b.prototype.size=function(){return y(this.value)},module.exports=m;
},{}],4:[function(require,module,exports) {
function r(r,t){for(var n=0,e=r.length-1;e>=0;e--){var i=r[e];"."===i?r.splice(e,1):".."===i?(r.splice(e,1),n++):n&&(r.splice(e,1),n--)}if(t)for(;n--;n)r.unshift("..");return r}var t=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,n=function(r){var n=t.exec(r);return[n[1]||"",n[2]||"",n[3]||"",n[4]||""]};function e(){for(var t="",n=!1,e=arguments.length-1;e>=-1&&!n;e--){var i=e>=0?arguments[e]:"/";"string"==typeof i&&i&&(t=i+"/"+t,n="/"===i.charAt(0))}return(n?"/":"")+(t=r(t.split("/").filter(function(r){return!!r}),!n).join("/"))||"."}function i(t){var n="/"===t.charAt(0);t.substr(-1);return(t=r(t.split("/").filter(function(r){return!!r}),!n).join("/"))||n||(t="."),(n?"/":"")+t}function o(){return i(Array.prototype.slice.call(arguments,0).filter(function(r,t){return r&&"string"==typeof r}).join("/"))}function u(r,t){function n(r){for(var t=0;t<r.length&&""===r[t];t++);for(var n=r.length-1;n>=0&&""===r[n];n--);return t>n?[]:r.slice(t,n-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var e=n(r.split("/")),i=n(t.split("/")),o=Math.min(e.length,i.length),u=o,s=0;s<o;s++)if(e[s]!==i[s]){u=s;break}var l=[];for(s=u;s<e.length;s++)l.push("..");return(l=l.concat(i.slice(u))).join("/")}function s(r){var t=n(r),e=t[0],i=t[1];return e||i?(i&&(i=i.substr(0,i.length-1)),e+i):"."}function l(r,t){var e=n(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),""===e?"/":e}function f(r){return n(r)[3]}function c(r){return"/"===r.charAt(0)}function a(r){return-1!==(""+r).indexOf("\0")}module.exports={normalize:i,resolve:e,join:o,relative:u,sep:"/",delimiter:":",dirname:s,basename:l,extname:f,isAbsolute:c,isNull:a};
},{}],14:[function(require,module,exports) {
function x(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(x){var r=16*Math.random()|0;return("x"==x?r:3&r|8).toString(16)}).toUpperCase()}function r(){}function n(x){for(var r=[],n=x.length,t=0;t<n;t++)r[t]=x[t];return r}module.exports={guid:x,u8toArray:n,nop:r};
},{}],15:[function(require,module,exports) {
var E="READ",R="WRITE",_="CREATE",T="EXCLUSIVE",O="TRUNCATE",I="APPEND",S="CREATE",D="REPLACE";module.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",MODE_FILE:"FILE",MODE_DIRECTORY:"DIRECTORY",MODE_SYMBOLIC_LINK:"SYMLINK",MODE_META:"META",SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",FS_NODUPEIDCHECK:"FS_NODUPEIDCHECK",O_READ:E,O_WRITE:R,O_CREATE:_,O_EXCLUSIVE:T,O_TRUNCATE:O,O_APPEND:I,O_FLAGS:{r:[E],"r+":[E,R],w:[R,_,O],"w+":[R,E,_,O],wx:[R,_,T,O],"wx+":[R,E,_,T,O],a:[R,_,I],"a+":[R,E,_,I],ax:[R,_,T,I],"ax+":[R,E,_,T,I]},XATTR_CREATE:S,XATTR_REPLACE:D,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""}};
},{}],5:[function(require,module,exports) {
var t={};["9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","18:EINVAL:invalid argument","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","34:ENOENT:no such file or directory","47:EEXIST:file already exists","51:ELOOP:too many symbolic links encountered","53:ENOTEMPTY:directory not empty","55:EIO:i/o error","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(e){var o=+(e=e.split(":"))[0],r=e[1],s=e[2];function i(t,e){Error.call(this),this.name=r,this.code=r,this.errno=o,this.message=t||s,e&&(this.path=e),this.stack=new Error(this.message).stack}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(){var t=this.path?", '"+this.path+"'":"";return this.name+": "+this.message+t},t[r]=t[o]=i}),module.exports=t;
},{}],29:[function(require,module,exports) {
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){for(var n,o=h(r),a=o[0],u=o[1],i=new e(c(r,a,u)),f=0,A=u>0?a-4:a,d=0;d<A;d+=4)n=t[r.charCodeAt(d)]<<18|t[r.charCodeAt(d+1)]<<12|t[r.charCodeAt(d+2)]<<6|t[r.charCodeAt(d+3)],i[f++]=n>>16&255,i[f++]=n>>8&255,i[f++]=255&n;return 2===u&&(n=t[r.charCodeAt(d)]<<2|t[r.charCodeAt(d+1)]>>4,i[f++]=255&n),1===u&&(n=t[r.charCodeAt(d)]<<10|t[r.charCodeAt(d+1)]<<4|t[r.charCodeAt(d+2)]>>2,i[f++]=n>>8&255,i[f++]=255&n),i}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
},{}],30:[function(require,module,exports) {
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],31:[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],11:[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");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 f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(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 a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.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}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.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 r=0;r<t;r+=2)b(this,r,r+1);return this},f.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 r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.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 r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
},{"base64-js":29,"ieee754":30,"isarray":31,"buffer":11}],3:[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var r=require("buffer").Buffer;function e(e,t,o){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),new r(e,t,o)}e.prototype=Object.create(r.prototype),e.prototype.constructor=e,Object.keys(r).forEach(function(t){r.hasOwnProperty(t)&&(e[t]=r[t])}),module.exports=e;
},{"buffer":11}],44:[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],e=require("../constants.js").FILE_SYSTEM_NAME,n=require("../constants.js").FILE_STORE_NAME,r=require("../constants.js").IDB_RW,o=require("../constants.js").IDB_RO,c=require("../errors.js"),u=require("../buffer.js"),s=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB;function i(t,e){var r=t.transaction(n,e);this.objectStore=r.objectStore(n)}function a(t,e,n){try{var r=t.get(e);r.onsuccess=function(t){var e=t.target.result;n(null,e)},r.onerror=function(t){n(t)}}catch(t){n(t)}}function f(t,e,n,r){try{var o=t.put(n,e);o.onsuccess=function(t){var e=t.target.result;r(null,e)},o.onerror=function(t){r(t)}}catch(t){r(t)}}function d(t){this.name=t||e,this.db=null}i.prototype.clear=function(t){try{var e=this.objectStore.clear();e.onsuccess=function(e){t()},e.onerror=function(e){t(e)}}catch(e){t(e)}},i.prototype.getObject=function(t,e){a(this.objectStore,t,e)},i.prototype.getBuffer=function(t,e){a(this.objectStore,t,function(t,n){if(t)return e(t);e(null,new u(n))})},i.prototype.putObject=function(t,e,n){f(this.objectStore,t,e,n)},i.prototype.putBuffer=function(t,e,n){f(this.objectStore,t,e.buffer,n)},i.prototype.delete=function(t,e){try{var n=this.objectStore.delete(t);n.onsuccess=function(t){var n=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(t){e(t)}},d.isSupported=function(){return!!s},d.prototype.open=function(t){var e=this;if(e.db)return t();var r=s.open(e.name);r.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(n)&&e.deleteObjectStore(n),e.createObjectStore(n)},r.onsuccess=function(n){e.db=n.target.result,t()},r.onerror=function(e){t(new c.EINVAL("IndexedDB cannot be accessed. If private browsing is enabled, disable it."))}},d.prototype.getReadOnlyContext=function(){return new i(this.db,r)},d.prototype.getReadWriteContext=function(){return new i(this.db,r)},module.exports=d;
},{"../constants.js":15,"../errors.js":5,"../buffer.js":3}],49:[function(require,module,exports) {
!function(){"use strict";for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256),t=0;t<r.length;t++)e[r.charCodeAt(t)]=t;exports.encode=function(e){var t,n=new Uint8Array(e),o=n.length,a="";for(t=0;t<o;t+=3)a+=r[n[t]>>2],a+=r[(3&n[t])<<4|n[t+1]>>4],a+=r[(15&n[t+1])<<2|n[t+2]>>6],a+=r[63&n[t+2]];return o%3==2?a=a.substring(0,a.length-1)+"=":o%3==1&&(a=a.substring(0,a.length-2)+"=="),a},exports.decode=function(r){var t,n,o,a,h,c=.75*r.length,g=r.length,i=0;"="===r[r.length-1]&&(c--,"="===r[r.length-2]&&c--);var u=new ArrayBuffer(c),A=new Uint8Array(u);for(t=0;t<g;t+=4)n=e[r.charCodeAt(t)],o=e[r.charCodeAt(t+1)],a=e[r.charCodeAt(t+2)],h=e[r.charCodeAt(t+3)],A[i++]=n<<2|o>>4,A[i++]=(15&o)<<4|a>>2,A[i++]=(3&a)<<6|63&h;return u}}();
},{}],45:[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],n=require("../constants.js").FILE_SYSTEM_NAME,e=require("../constants.js").FILE_STORE_NAME,i=require("../constants.js").WSQL_VERSION,o=require("../constants.js").WSQL_SIZE,r=require("../constants.js").WSQL_DESC,u=require("../errors.js"),a=require("../buffer.js"),c=require("base64-arraybuffer");function s(t,n){var e=this;this.getTransaction=function(i){e.transaction?i(e.transaction):t[n?"readTransaction":"transaction"](function(t){e.transaction=t,i(t)})}}function f(t,n,i){function o(t,n){var e=0===n.rows.length?null:n.rows.item(0).data;i(null,e)}function r(t,n){i(n)}t(function(t){t.executeSql("SELECT data FROM "+e+" WHERE id = ? LIMIT 1;",[n],o,r)})}function E(t,n,i,o){function r(t,n){o(null)}function u(t,n){o(n)}t(function(t){t.executeSql("INSERT OR REPLACE INTO "+e+" (id, data) VALUES (?, ?);",[n,i],r,u)})}function d(t){this.name=t||n,this.db=null}s.prototype.clear=function(t){function n(n,e){t(e)}function i(n,e){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+e+";",[],i,n)})},s.prototype.getObject=function(t,n){f(this.getTransaction,t,function(t,e){if(t)return n(t);try{e&&(e=JSON.parse(e))}catch(t){return n(t)}n(null,e)})},s.prototype.getBuffer=function(t,n){f(this.getTransaction,t,function(t,e){if(t)return n(t);if(e||""===e){var i=c.decode(e);e=new a(i)}n(null,e)})},s.prototype.putObject=function(t,n,e){var i=JSON.stringify(n);E(this.getTransaction,t,i,e)},s.prototype.putBuffer=function(t,n,e){var i=c.encode(n.buffer);E(this.getTransaction,t,i,e)},s.prototype.delete=function(t,n){function i(t,e){n(null)}function o(t,e){n(e)}this.getTransaction(function(n){n.executeSql("DELETE FROM "+e+" WHERE id = ?;",[t],i,o)})},d.isSupported=function(){return!!t.openDatabase},d.prototype.open=function(n){var a=this;if(a.db)return n();var c=t.openDatabase(a.name,i,r,o);function s(t,e){5===e.code&&n(new u.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),n(e)}function f(t,e){a.db=c,n()}c?c.transaction(function(t){t.executeSql("CREATE TABLE IF NOT EXISTS "+e+" (id unique, data TEXT);",[],function(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+e+"_id on "+e+" (id);",[],f,s)},s)}):n("[WebSQL] Unable to open database.")},d.prototype.getReadOnlyContext=function(){return new s(this.db,!0)},d.prototype.getReadWriteContext=function(){return new s(this.db,!1)},module.exports=d;
},{"../constants.js":15,"../errors.js":5,"../buffer.js":3,"base64-arraybuffer":49}],48:[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],43:[function(require,module,exports) {
var process = require("process");
var define;
var e,t=require("process");!function(){var n={};void 0!==t&&t.nextTick?(n.nextTick=t.nextTick,"undefined"!=typeof setImmediate?n.setImmediate=function(e){setImmediate(e)}:n.setImmediate=n.nextTick):"function"==typeof setImmediate?(n.nextTick=function(e){setImmediate(e)},n.setImmediate=n.nextTick):(n.nextTick=function(e){setTimeout(e,0)},n.setImmediate=n.nextTick),n.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var i=0;!function o(){t(e[i],function(t){t?(n(t),n=function(){}):(i+=1)>=e.length?n():o()})}()},n.forEachSeries=n.eachSeries,void 0!==e&&e.amd?e([],function(){return n}):"undefined"!=typeof module&&module.exports?module.exports=n:root.async=n}();
},{"process":48}],46:[function(require,module,exports) {
var t=require("../constants.js").FILE_SYSTEM_NAME,e=require("../../lib/async.js").setImmediate,o=function(){var t={};return function(e){return t.hasOwnProperty(e)||(t[e]={}),t[e]}}();function n(t,e){this.readOnly=e,this.objectStore=t}function r(e){this.name=e||t}n.prototype.clear=function(t){if(this.readOnly)e(function(){t("[MemoryContext] Error: write operation on read only context")});else{var o=this.objectStore;Object.keys(o).forEach(function(t){delete o[t]}),e(t)}},n.prototype.getObject=n.prototype.getBuffer=function(t,o){var n=this;e(function(){o(null,n.objectStore[t])})},n.prototype.putObject=n.prototype.putBuffer=function(t,o,n){this.readOnly?e(function(){n("[MemoryContext] Error: write operation on read only context")}):(this.objectStore[t]=o,e(n))},n.prototype.delete=function(t,o){this.readOnly?e(function(){o("[MemoryContext] Error: write operation on read only context")}):(delete this.objectStore[t],e(o))},r.isSupported=function(){return!0},r.prototype.open=function(t){this.db=o(this.name),e(t)},r.prototype.getReadOnlyContext=function(){return new n(this.db,!0)},r.prototype.getReadWriteContext=function(){return new n(this.db,!1)},module.exports=r;
},{"../constants.js":15,"../../lib/async.js":43}],18:[function(require,module,exports) {
var r=require("./indexeddb.js"),e=require("./websql.js"),o=require("./memory.js");module.exports={IndexedDB:r,WebSQL:e,Memory:o,Default:r,Fallback:function(){if(r.isSupported())return r;if(e.isSupported())return e;function o(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return o.isSupported=function(){return!1},o}()};
},{"./indexeddb.js":44,"./websql.js":45,"./memory.js":46}],47:[function(require,module,exports) {
var t=require("../constants.js").ENVIRONMENT;module.exports=function(n){(n=n||{}).TMP=n.TMP||t.TMP,n.PATH=n.PATH||t.PATH,this.get=function(t){return n[t]},this.set=function(t,e){n[t]=e}};
},{"../constants.js":15}],37:[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer;function r(e){return e.toString("utf8")}function u(r){return new e(r,"utf8")}module.exports={encode:u,decode:r};
},{"buffer":11}],19:[function(require,module,exports) {
var n=require("../path.js"),t=require("../errors.js"),e=require("./environment.js"),i=require("../../lib/async.js"),r=require("../encoding.js");function o(i,r){var o=new e((r=r||{}).env),u="/";Object.defineProperty(this,"fs",{get:function(){return i},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return o},enumerable:!0}),this.cd=function(e,r){e=n.resolve(u,e),i.stat(e,function(n,i){n?r(new t.ENOTDIR(null,e)):"DIRECTORY"===i.type?(u=e,r()):r(new t.ENOTDIR(null,e))})},this.pwd=function(){return u}}o.prototype.exec=function(t,e,i){var r=this.fs;"function"==typeof e&&(i=e,e=[]),e=e||[],i=i||function(){},t=n.resolve(this.pwd(),t),r.readFile(t,"utf8",function(n,t){if(n)i(n);else try{new Function("fs","args","callback",t)(r,e,i)}catch(n){i(n)}})},o.prototype.touch=function(t,e,i){var r=this.fs;"function"==typeof e&&(i=e,e={}),e=e||{},i=i||function(){},t=n.resolve(this.pwd(),t),r.stat(t,function(n,o){n?!0===e.updateOnly?i():function(n){r.writeFile(n,"",i)}(t):function(n){var t=Date.now(),o=e.date||t,u=e.date||t;r.utimes(n,o,u,i)}(t)})},o.prototype.cat=function(e,r){var o=this,u=o.fs,f="";r=r||function(){},e?(e="string"==typeof e?[e]:e,i.eachSeries(e,function(t,e){var i=n.resolve(o.pwd(),t);u.readFile(i,"utf8",function(n,t){n?e(n):(f+=t+"\n",e())})},function(n){n?r(n):r(null,f.replace(/\n$/,""))})):r(new t.EINVAL("Missing files argument"))},o.prototype.ls=function(e,r,o){var u=this,f=u.fs;"function"==typeof r&&(o=r,r={}),r=r||{},o=o||function(){},e?function t(e,o){var s=n.resolve(u.pwd(),e),c=[];f.readdir(s,function(e,u){e?o(e):i.eachSeries(u,function(e,i){e=n.join(s,e),f.stat(e,function(o,u){if(o)i(o);else{var f={path:n.basename(e),links:u.nlinks,size:u.size,modified:u.mtime,type:u.type};r.recursive&&"DIRECTORY"===u.type?t(n.join(s,f.path),function(n,t){n?i(n):(f.contents=t,c.push(f),i())}):(c.push(f),i())}})},function(n){o(n,c)})})}(e,o):o(new t.EINVAL("Missing dir argument"))},o.prototype.rm=function(e,r,o){var u=this,f=u.fs;"function"==typeof r&&(o=r,r={}),r=r||{},o=o||function(){},e?function e(o,s){o=n.resolve(u.pwd(),o),f.stat(o,function(u,c){u?s(u):"FILE"!==c.type?f.readdir(o,function(u,c){u?s(u):0!==c.length?r.recursive?(c=c.map(function(t){return n.join(o,t)}),i.eachSeries(c,e,function(n){n?s(n):f.rmdir(o,s)})):s(new t.ENOTEMPTY(null,o)):f.rmdir(o,s)}):f.unlink(o,s)})}(e,o):o(new t.EINVAL("Missing path argument"))},o.prototype.tempDir=function(n){var t=this.fs,e=this.env.get("TMP");n=n||function(){},t.mkdir(e,function(t){n(null,e)})},o.prototype.mkdirp=function(e,i){var r=this.fs;i=i||function(){},e?"/"!==e?function e(i,o){r.stat(i,function(u,f){if(f){if(f.isDirectory())return void o();if(f.isFile())return void o(new t.ENOTDIR(null,i))}else{if(u&&"ENOENT"!==u.code)return void o(u);var s=n.dirname(i);"/"===s?r.mkdir(i,function(n){n&&"EEXIST"!=n.code?o(n):o()}):e(s,function(n){if(n)return o(n);r.mkdir(i,function(n){n&&"EEXIST"!=n.code?o(n):o()})})}})}(e,i):i():i(new t.EINVAL("Missing path argument"))},module.exports=o;
},{"../path.js":4,"../errors.js":5,"./environment.js":47,"../../lib/async.js":43,"../encoding.js":37}],35:[function(require,module,exports) {
function t(t,r){for(var o=r.length-1;o>=0;o--)r[o]===t&&r.splice(o,1);return r}var r=function(){};r.createInterface=function(r){var o={on:function(t,o){void 0===this[r]&&(this[r]={}),this[r].hasOwnProperty(t)||(this[r][t]=[]),this[r][t].push(o)},off:function(o,e){void 0!==this[r]&&this[r].hasOwnProperty(o)&&t(e,this[r][o])},trigger:function(t){if(void 0!==this[r]&&this[r].hasOwnProperty(t))for(var o=Array.prototype.slice.call(arguments,1),e=0;e<this[r][t].length;e++)this[r][t][e].apply(this[r][t][e],o)},removeAllListeners:function(t){if(void 0!==this[r]){var o=this;o[r][t].forEach(function(r){o.off(t,r)})}}};return o};var o=r.createInterface("_handlers");r.prototype._on=o.on,r.prototype._off=o.off,r.prototype._trigger=o.trigger;var e=r.createInterface("handlers");r.prototype.on=function(){e.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},r.prototype.off=e.off,r.prototype.trigger=e.trigger,r.prototype.removeAllListeners=e.removeAllListeners,module.exports=r;
},{}],16:[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=require("./eventemitter.js"),o=require("../src/shared.js").guid;function r(t,e){var n=0;return function(){var o=Date.now();o-n>t&&(n=o,e.apply(this,arguments))}}function i(t,n){if(void 0!==t&&t||(t={}),"object"===(void 0===n?"undefined":e(n)))for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);return t}var a=function(t){return void 0===t||void 0===t.localStorage?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(t);function s(){var e=this,n=Date.now();this.origin=o(),this.lastMessage=n,this.receivedIDs={},this.previousValues={};var r=function(){e._onStorageEvent.apply(e,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",r):t.addEventListener("storage",r,!1))}s.prototype._transaction=function(t){var e=1e3,n=20,o=this,r=!1,i=!1,s=null;function c(){if(!r){var u=Date.now(),f=0|a.getItem(p);if(f&&u-f<e)return i||(o._on("storage",c),i=!0),void(s=setTimeout(c,n));r=!0,a.setItem(p,u),t(),function(){i&&o._off("storage",c);s&&clearTimeout(s);a.removeItem(p)}()}}c()},s.prototype._cleanup_emit=r(100,function(){this._transaction(function(){var t,e=Date.now()-f,n=0;try{t=JSON.parse(a.getItem(c)||"[]")}catch(e){t=[]}for(var o=t.length-1;o>=0;o--)t[o].timestamp<e&&(t.splice(o,1),n++);n>0&&a.setItem(c,JSON.stringify(t))})}),s.prototype._cleanup_once=r(100,function(){var t=this;t._transaction(function(){Date.now();var e,n,o=0;try{n=JSON.parse(a.getItem(u)||"{}")}catch(t){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],o++);o>0&&a.setItem(u,JSON.stringify(n))})}),s.prototype._once_expired=function(t,n){if(!n)return!0;if(!n.hasOwnProperty(t))return!0;if("object"!==e(n[t]))return!0;var o=n[t].ttl||m,r=Date.now();return n[t].timestamp<r-o},s.prototype._localStorageChanged=function(t,e){if(t&&t.key)return t.key===e;var n=a.getItem(e);return n!==this.previousValues[e]&&(this.previousValues[e]=n,!0)},s.prototype._onStorageEvent=function(e){e=e||t.event;var n=this;this._localStorageChanged(e,c)&&this._transaction(function(){var t,e=Date.now(),o=a.getItem(c);try{t=JSON.parse(o||"[]")}catch(e){t=[]}for(var r=0;r<t.length;r++)if(t[r].origin!==n.origin&&!(t[r].timestamp<n.lastMessage)){if(t[r].id){if(n.receivedIDs.hasOwnProperty(t[r].id))continue;n.receivedIDs[t[r].id]=!0}n.trigger(t[r].name,t[r].payload)}n.lastMessage=e}),this._trigger("storage",e)},s.prototype._emit=function(t,e,n){if((n="string"==typeof n||"number"==typeof n?String(n):null)&&n.length){if(this.receivedIDs.hasOwnProperty(n))return;this.receivedIDs[n]=!0}var o={id:n,name:t,origin:this.origin,timestamp:Date.now(),payload:e},r=this;this._transaction(function(){var n=a.getItem(c)||"[]",i="[]"===n?"":",";n=[n.substring(0,n.length-1),i,JSON.stringify(o),"]"].join(""),a.setItem(c,n),r.trigger(t,e),setTimeout(function(){r._cleanup_emit()},50)})},s.prototype.emit=function(t,e){this._emit.apply(this,arguments),this._trigger("emit",t,e)},s.prototype.once=function(t,e,n){if(s.supported){var o=this;this._transaction(function(){var r;try{r=JSON.parse(a.getItem(u)||"{}")}catch(t){r={}}o._once_expired(t,r)&&(r[t]={},r[t].timestamp=Date.now(),"number"==typeof n&&(r[t].ttl=1e3*n),a.setItem(u,JSON.stringify(r)),e(),setTimeout(function(){o._cleanup_once()},50))})}},i(s.prototype,n.prototype),s.supported=void 0!==a;var c="intercom",u="intercom_once",p="intercom_lock",f=5e4,m=36e5;s.destroy=function(){a.removeItem(p),a.removeItem(c),a.removeItem(u)},s.getInstance=function(){var t;return function(){return t||(t=new s),t}}(),module.exports=s;
},{"./eventemitter.js":35,"../src/shared.js":14}],17:[function(require,module,exports) {
var e=require("../lib/eventemitter.js"),t=require("./path.js"),n=require("../lib/intercom.js");function r(){e.call(this);var r,i,o=this,s=!1;function c(e){(i===e||s&&0===e.indexOf(r))&&o.trigger("change","change",e)}o.start=function(e,o,a){if(!i){if(t.isNull(e))throw new Error("Path must be a string without null bytes.");i=t.normalize(e),(s=!0===a)&&(r="/"===i?"/":i+"/"),n.getInstance().on("change",c)}},o.close=function(){n.getInstance().off("change",c),o.removeAllListeners("change")}}r.prototype=new e,r.prototype.constructor=r,module.exports=r;
},{"../lib/eventemitter.js":35,"./path.js":4,"../lib/intercom.js":16}],38:[function(require,module,exports) {
var t=require("./constants.js").MODE_FILE;module.exports=function(s,e){this.id=s,this.type=e||t};
},{"./constants.js":15}],39:[function(require,module,exports) {
module.exports=function(i,t,s,h){this.path=i,this.id=t,this.flags=s,this.position=h};
},{}],40:[function(require,module,exports) {
var t=require("./constants.js");function e(e){var i=Date.now();this.id=t.SUPER_NODE_ID,this.mode=t.MODE_META,this.atime=e.atime||i,this.ctime=e.ctime||i,this.mtime=e.mtime||i,this.rnode=e.rnode}e.create=function(t,i){t.guid(function(n,o){n?i(n):(t.rnode=t.rnode||o,i(null,new e(t)))})},module.exports=e;
},{"./constants.js":15}],41:[function(require,module,exports) {
var i=require("./constants.js").MODE_FILE;function t(t){var s=Date.now();this.id=t.id,this.mode=t.mode||i,this.size=t.size||0,this.atime=t.atime||s,this.ctime=t.ctime||s,this.mtime=t.mtime||s,this.flags=t.flags||[],this.xattrs=t.xattrs||{},this.nlinks=t.nlinks||0,this.version=t.version||0,this.blksize=void 0,this.nblocks=1,this.data=t.data}function s(i,t,s){i[t]?s(null):i.guid(function(n,e){i[t]=e,s(n)})}t.create=function(i,n){s(i,"id",function(e){e?n(e):s(i,"data",function(s){s?n(s):n(null,new t(i))})})},module.exports=t;
},{"./constants.js":15}],42:[function(require,module,exports) {
var t=require("./constants.js");function i(t,i){this.node=t.id,this.dev=i,this.size=t.size,this.nlinks=t.nlinks,this.atime=t.atime,this.mtime=t.mtime,this.ctime=t.ctime,this.type=t.mode}i.prototype.isFile=function(){return this.type===t.MODE_FILE},i.prototype.isDirectory=function(){return this.type===t.MODE_DIRECTORY},i.prototype.isSymbolicLink=function(){return this.type===t.MODE_SYMBOLIC_LINK},i.prototype.isSocket=i.prototype.isFIFO=i.prototype.isCharacterDevice=i.prototype.isBlockDevice=function(){return!1},module.exports=i;
},{"./constants.js":15}],20:[function(require,module,exports) {
var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t=require("../../lib/nodash.js"),e=require("../path.js"),i=e.normalize,o=e.dirname,a=e.basename,u=e.isAbsolute,c=e.isNull,r=require("../constants.js"),f=r.MODE_FILE,s=r.MODE_DIRECTORY,l=r.MODE_SYMBOLIC_LINK,d=r.MODE_META,m=r.ROOT_DIRECTORY_NAME,p=r.SUPER_NODE_ID,E=r.SYMLOOP_MAX,w=r.O_READ,g=r.O_WRITE,O=r.O_CREATE,b=r.O_EXCLUSIVE,v=r.O_TRUNCATE,N=r.O_APPEND,A=r.O_FLAGS,h=r.XATTR_CREATE,I=r.XATTR_REPLACE,j=r.FS_NOMTIME,y=r.FS_NOCTIME,T=require("../encoding.js"),D=require("../errors.js"),L=require("../directory-entry.js"),R=require("../open-file-description.js"),x=require("../super-node.js"),V=require("../node.js"),F=require("../stats.js"),B=require("../buffer.js");function _(n){return function(t,e){t?n(t):n(null,e)}}function S(n,e,i,o,a){var u=n.flags;t(u).contains(y)&&delete o.ctime,t(u).contains(j)&&delete o.mtime;var c=!1;function r(t){n.changes.push({event:"change",path:e}),a(t)}o.ctime&&(i.ctime=o.ctime,i.atime=o.ctime,c=!0),o.atime&&(i.atime=o.atime,c=!0),o.mtime&&(i.mtime=o.mtime,c=!0),c?n.putObject(i.id,i,r):r()}function P(n,t,e,u){if(e!==s&&e!==f)return u(new D.EINVAL("mode must be a directory or file",t));t=i(t);var c,r,l,d=a(t),m=o(t);function p(e,i){!e&&i?u(new D.EEXIST("path name already exists",t)):!e||e instanceof D.ENOENT?n.getObject(c.data,E):u(e)}function E(t,i){t?u(t):(r=i,V.create({guid:n.guid,mode:e},function(t,e){t?u(t):((l=e).nlinks+=1,n.putObject(l.id,l,g))}))}function w(t){if(t)u(t);else{var e=Date.now();S(n,m,l,{mtime:e,ctime:e},u)}}function g(t){t?u(t):(r[d]=new L(l.id,e),n.putObject(c.data,r,w))}k(n,m,function(e,i){e?u(e):i.mode!==s?u(new D.ENOTDIR("a component of the path prefix is not a directory",t)):(c=i,k(n,t,p))})}function k(n,e,u){if(!(e=i(e)))return u(new D.ENOENT("path is an empty string"));var c=a(e),r=o(e),f=0;function w(t,e){t?u(t):e&&e.mode===d&&e.rnode?n.getObject(e.rnode,g):u(new D.EFILESYSTEMERROR)}function g(n,t){n?u(n):t?u(null,t):u(new D.ENOENT)}function O(t,i){t?u(t):i.mode===s&&i.data?n.getObject(i.data,b):u(new D.ENOTDIR("a component of the path prefix is not a directory",e))}function b(i,o){if(i)u(i);else if(t(o).has(c)){var a=o[c].id;n.getObject(a,v)}else u(new D.ENOENT(null,e))}function v(t,s){var d;t?u(t):s.mode==l?++f>E?u(new D.ELOOP(null,e)):(d=s.data,d=i(d),r=o(d),c=a(d),m==c?n.getObject(p,w):k(n,r,O)):u(null,s)}m==c?n.getObject(p,w):k(n,r,O)}function C(t,e,i,o,a,u){var c;function r(n,r){r&&r.xattrs[i];n?u(n):a===h&&r.xattrs.hasOwnProperty(i)?u(new D.EEXIST("attribute already exists",e)):a!==I||r.xattrs.hasOwnProperty(i)?(r.xattrs[i]=o,t.putObject(r.id,r,function(n){n?u(n):S(t,c,r,{ctime:Date.now()},u)})):u(new D.ENOATTR(null,e))}"string"==typeof e?(c=e,k(t,e,r)):"object"==(void 0===e?"undefined":n(e))&&"string"==typeof e.id?(c=e.path,t.getObject(e.id,r)):u(new D.EINVAL("path or file descriptor of wrong type",e))}function M(n,t){var e,i,o;function a(o){o?t(o):V.create({guid:n.guid,id:e.rnode,mode:s},function(e,o){e?t(e):((i=o).nlinks+=1,n.putObject(i.id,i,u))})}function u(e){e?t(e):(o={},n.putObject(i.data,o,t))}n.getObject(p,function(i,o){!i&&o?t():!i||i instanceof D.ENOENT?x.create({guid:n.guid},function(i,o){i?t(i):(e=o,n.putObject(e.id,e,a))}):t(i)})}function X(n,t,e){t=i(t);var u,c,r,f,l=a(t),d=o(t);function m(t,i){t?e(t):(r=i,n.getObject(r.data,p))}function p(t,i){t?e(t):(f=i,V.create({guid:n.guid,mode:s},function(t,i){t?e(t):((u=i).nlinks+=1,n.putObject(u.id,u,E))}))}function E(t){t?e(t):(c={},n.putObject(u.data,c,g))}function w(t){if(t)e(t);else{var i=Date.now();S(n,d,r,{mtime:i,ctime:i},e)}}function g(t){t?e(t):(f[l]=new L(u.id,s),n.putObject(r.data,f,w))}k(n,t,function(i,o){!i&&o?e(new D.EEXIST(null,t)):!i||i instanceof D.ENOENT?k(n,d,m):e(i)})}function z(n,e,u){e=i(e);var c,r,f,l=a(e),d=o(e);function p(i,o){i?u(i):m==l?u(new D.EBUSY(null,e)):t(o).has(l)?(c=(f=o)[l].id,n.getObject(c,E)):u(new D.ENOENT(null,e))}function E(t,i){t?u(t):i.mode!=s?u(new D.ENOTDIR(null,e)):(c=i,n.getObject(c.data,w))}function w(i,o){i?u(i):t(o).size()>0?u(new D.ENOTEMPTY(null,e)):(delete f[l],n.putObject(r.data,f,g))}function g(t){if(t)u(t);else{var e=Date.now();S(n,d,r,{mtime:e,ctime:e},O)}}function O(t){t?u(t):n.delete(c.id,b)}function b(t){t?u(t):n.delete(c.data,u)}k(n,d,function(t,e){t?u(t):(r=e,n.getObject(r.data,p))})}function q(n,e,u,c){e=i(e);var r,d,p,w,v,N=a(e),A=o(e),h=0;function I(t,i){t?c(t):i.mode!==s?c(new D.ENOENT(null,e)):(r=i,n.getObject(r.data,j))}function j(i,o){i?c(i):t(d=o).has(N)?t(u).contains(b)?c(new D.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",e)):(p=d[N]).type==s&&t(u).contains(g)?c(new D.EISDIR("the named file is a directory and O_WRITE is set",e)):n.getObject(p.id,y):t(u).contains(O)?V.create({guid:n.guid,mode:f},function(t,e){t?c(t):((w=e).nlinks+=1,n.putObject(w.id,w,R))}):c(new D.ENOENT("O_CREATE is not set and the named file does not exist",e))}function y(r,f){if(r)c(r);else{var s=f;s.mode==l?++h>E?c(new D.ELOOP(null,e)):function(r){r=i(r),A=o(r),N=a(r),m==N&&(t(u).contains(g)?c(new D.EISDIR("the named file is a directory and O_WRITE is set",e)):k(n,e,T));k(n,A,I)}(s.data):T(void 0,s)}}function T(n,t){n?c(n):c(null,w=t)}function R(t){t?c(t):((v=new B(0)).fill(0),n.putBuffer(w.data,v,F))}function x(t){if(t)c(t);else{var e=Date.now();S(n,A,r,{mtime:e,ctime:e},_)}}function F(t){t?c(t):(d[N]=new L(w.id,f),n.putObject(r.data,d,x))}function _(n){n?c(n):c(null,w)}m==N?t(u).contains(g)?c(new D.EISDIR("the named file is a directory and O_WRITE is set",e)):k(n,e,T):k(n,A,I)}function Y(n,t,e,i,o,a){var u;function c(n){n?a(n):a(null,o)}function r(e){if(e)a(e);else{var i=Date.now();S(n,t.path,u,{mtime:i,ctime:i},c)}}function f(t){t?a(t):n.putObject(u.id,u,r)}n.getObject(t.id,function(c,r){if(c)a(c);else{u=r;var s=new B(o);s.fill(0),e.copy(s,0,i,i+o),t.position=o,u.size=o,u.version+=1,n.putBuffer(u.data,s,f)}})}function U(n,t,e,i,o,a,u){var c,r;function f(n){n?u(n):u(null,o)}function s(e){if(e)u(e);else{var i=Date.now();S(n,t.path,c,{mtime:i,ctime:i},f)}}function l(t){t?u(t):n.putObject(c.id,c,s)}function d(f,s){if(f)u(f);else{if(!(r=s))return u(new D.EIO("Expected Buffer"));var d=null!=a?a:t.position,m=Math.max(r.length,d+o),p=new B(m);p.fill(0),r&&r.copy(p),e.copy(p,d,i,i+o),void 0===a&&(t.position+=o),c.size=m,c.version+=1,n.putBuffer(c.data,p,l)}}n.getObject(t.id,function(t,e){t?u(t):(c=e,n.getBuffer(c.data,d))})}function W(n,t,e,i,o,a,u){var c,r;function f(n,c){if(n)u(n);else{if(!(r=c))return u(new D.EIO("Expected Buffer"));var f=null!=a?a:t.position;o=f+o>e.length?o-f:o,r.copy(e,i,f,f+o),void 0===a&&(t.position+=o),u(null,o)}}n.getObject(t.id,function(t,e){t?u(t):(c=e,n.getBuffer(c.data,f))})}function G(n,t,e){t=i(t);a(t);k(n,t,_(e))}function K(n,t,e){n.getObject(t.id,_(e))}function H(n,e,u){e=i(e);var c,r,f=a(e),s=o(e);function l(i,o){i?u(i):t(r=o).has(f)?n.getObject(r[f].id,_(u)):u(new D.ENOENT("a component of the path does not name an existing file",e))}m==f?k(n,e,_(u)):k(n,s,function(t,e){t?u(t):(c=e,n.getObject(c.data,l))})}function J(n,e,u,c){e=i(e);var r=a(e),f=o(e);u=i(u);var s,l,d,m,p,E=a(u),w=o(u);function g(t){t?c(t):S(n,u,p,{ctime:Date.now()},c)}function O(t,e){t?c(t):((p=e).nlinks+=1,n.putObject(p.id,p,g))}function b(t,e){t?c(t):n.getObject(m[E].id,O)}function v(e,i){e?c(e):t(m=i).has(E)?c(new D.EEXIST("newpath resolves to an existing file",E)):(m[E]=l[r],n.putObject(d.data,m,b))}function N(t,e){t?c(t):(d=e,n.getObject(d.data,v))}function A(e,i){e?c(e):t(l=i).has(r)?k(n,w,N):c(new D.ENOENT("a component of either path prefix does not exist",r))}k(n,f,function(t,e){t?c(t):(s=e,n.getObject(s.data,A))})}function Q(n,e,u){e=i(e);var c,r,f,s=a(e),l=o(e);function d(t){t?u(t):(delete r[s],n.putObject(c.data,r,function(t){var e=Date.now();S(n,l,c,{mtime:e,ctime:e},u)}))}function m(t){t?u(t):n.delete(f.data,d)}function p(t,i){t?u(t):((f=i).nlinks-=1,f.nlinks<1?n.delete(f.id,m):n.putObject(f.id,f,function(t){S(n,e,f,{ctime:Date.now()},d)}))}function E(e,i){e?u(e):t(r=i).has(s)?n.getObject(r[s].id,p):u(new D.ENOENT("a component of the path does not name an existing file",s))}k(n,l,function(t,e){t?u(t):(c=e,n.getObject(c.data,E))})}function Z(n,t,e){t=i(t);var o,u;a(t);function c(n,t){if(n)e(n);else{u=t;var i=Object.keys(u);e(null,i)}}k(n,t,function(i,a){i?e(i):a.mode!==s?e(new D.ENOTDIR(null,t)):(o=a,n.getObject(o.data,c))})}function $(n,e,u,c){u=i(u);var r,f,s,d=a(u),p=o(u);function E(i,o){i?c(i):t(f=o).has(d)?c(new D.EEXIST(null,d)):V.create({guid:n.guid,mode:l},function(t,i){t?c(t):((s=i).nlinks+=1,s.size=e.length,s.data=e,n.putObject(s.id,s,g))})}function w(t){if(t)c(t);else{var e=Date.now();S(n,p,r,{mtime:e,ctime:e},c)}}function g(t){t?c(t):(f[d]=new L(s.id,l),n.putObject(r.data,f,w))}m==d?c(new D.EEXIST(null,d)):k(n,p,function(t,e){t?c(t):(r=e,n.getObject(r.data,E))})}function nn(n,e,u){e=i(e);var c,r,f=a(e),s=o(e);function d(e,i){e?u(e):t(r=i).has(f)?n.getObject(r[f].id,m):u(new D.ENOENT("a component of the path does not name an existing file",f))}function m(n,t){n?u(n):t.mode!=l?u(new D.EINVAL("path not a symbolic link",e)):u(null,t.data)}k(n,s,function(t,e){t?u(t):(c=e,n.getObject(c.data,d))})}function tn(n,t,e,o){var a;function u(t,i){if(t)o(t);else{if(!i)return o(new D.EIO("Expected Buffer"));var u=new B(e);u.fill(0),i&&i.copy(u),n.putBuffer(a.data,u,r)}}function c(e){if(e)o(e);else{var i=Date.now();S(n,t,a,{mtime:i,ctime:i},o)}}function r(t){t?o(t):(a.size=e,a.version+=1,n.putObject(a.id,a,c))}t=i(t),e<0?o(new D.EINVAL("length cannot be negative")):k(n,t,function(e,i){e?o(e):i.mode==s?o(new D.EISDIR(null,t)):(a=i,n.getBuffer(a.data,u))})}function en(n,t,e,i){var o;function a(t,a){if(t)i(t);else{var u;if(!a)return i(new D.EIO("Expected Buffer"));a?u=a.slice(0,e):(u=new B(e)).fill(0),n.putBuffer(o.data,u,c)}}function u(e){if(e)i(e);else{var a=Date.now();S(n,t.path,o,{mtime:a,ctime:a},i)}}function c(t){t?i(t):(o.size=e,o.version+=1,n.putObject(o.id,o,u))}e<0?i(new D.EINVAL("length cannot be negative")):n.getObject(t.id,function(t,e){t?i(t):e.mode==s?i(new D.EISDIR):(o=e,n.getBuffer(o.data,a))})}function on(n,t,e,o,a){t=i(t),"number"!=typeof e||"number"!=typeof o?a(new D.EINVAL("atime and mtime must be number",t)):e<0||o<0?a(new D.EINVAL("atime and mtime must be positive integers",t)):k(n,t,function(i,u){i?a(i):S(n,t,u,{atime:e,ctime:o,mtime:o},a)})}function an(n,t,e,i,o){"number"!=typeof e||"number"!=typeof i?o(new D.EINVAL("atime and mtime must be a number")):e<0||i<0?o(new D.EINVAL("atime and mtime must be positive integers")):n.getObject(t.id,function(a,u){a?o(a):S(n,t.path,u,{atime:e,ctime:i,mtime:i},o)})}function un(n,t,e,o,a,u){t=i(t),"string"!=typeof e?u(new D.EINVAL("attribute name must be a string",t)):e?null!==a&&a!==h&&a!==I?u(new D.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",t)):C(n,t,e,o,a,u):u(new D.EINVAL("attribute name cannot be an empty string",t))}function cn(n,t,e,i,o,a){"string"!=typeof e?a(new D.EINVAL("attribute name must be a string")):e?null!==o&&o!==h&&o!==I?a(new D.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):C(n,t,e,i,o,a):a(new D.EINVAL("attribute name cannot be an empty string"))}function rn(n,t,e,o){t=i(t),"string"!=typeof e?o(new D.EINVAL("attribute name must be a string",t)):e?k(n,t,function(n,i){i&&i.xattrs[e],n?o(n):i.xattrs.hasOwnProperty(e)?o(null,i.xattrs[e]):o(new D.ENOATTR(null,t))}):o(new D.EINVAL("attribute name cannot be an empty string",t))}function fn(n,t,e,i){"string"!=typeof e?i(new D.EINVAL):e?n.getObject(t.id,function(n,t){t&&t.xattrs[e],n?i(n):t.xattrs.hasOwnProperty(e)?i(null,t.xattrs[e]):i(new D.ENOATTR)}):i(new D.EINVAL("attribute name cannot be an empty string"))}function sn(n,t,e,o){t=i(t),"string"!=typeof e?o(new D.EINVAL("attribute name must be a string",t)):e?k(n,t,function(i,a){var u=a?a.xattrs:null;i?o(i):u.hasOwnProperty(e)?(delete a.xattrs[e],n.putObject(a.id,a,function(e){e?o(e):S(n,t,a,{ctime:Date.now()},o)})):o(new D.ENOATTR(null,t))}):o(new D.EINVAL("attribute name cannot be an empty string",t))}function ln(n,t,e,i){"string"!=typeof e?i(new D.EINVAL("attribute name must be a string")):e?n.getObject(t.id,function(o,a){o?i(o):a.xattrs.hasOwnProperty(e)?(delete a.xattrs[e],n.putObject(a.id,a,function(e){e?i(e):S(n,t.path,a,{ctime:Date.now()},i)})):i(new D.ENOATTR)}):i(new D.EINVAL("attribute name cannot be an empty string"))}function dn(n){return t(A).has(n)?A[n]:null}function mn(n,t,e){return n?"function"==typeof n?n={encoding:t,flag:e}:"string"==typeof n&&(n={encoding:n,flag:e}):n={encoding:t,flag:e},n}function pn(n,t){var e;return n?c(n)?e=new D.EINVAL("Path must be a string without null bytes.",n):u(n)||(e=new D.EINVAL("Path must be absolute.",n)):e=new D.EINVAL("Path must be a string",n),!e||(t(e),!1)}function En(n,e,i,o,a,u){u=arguments[arguments.length-1],pn(i,u)&&((o=dn(o))||u(new D.EINVAL("flags is not valid"),i),q(e,i,o,function(e,a){if(e)u(e);else{var c;c=t(o).contains(N)?a.size:0;var r=new R(i,a.id,o,c),f=n.allocDescriptor(r);u(null,f)}}))}function wn(n,e,i,o){t(n.openFiles).has(i)?(n.releaseDescriptor(i),o(null)):o(new D.EBADF)}function gn(n,t,e,i,o){pn(e,o)&&P(t,e,i,o)}function On(n,t,e,i,o){pn(e,o=arguments[arguments.length-1])&&X(t,e,_(o))}function bn(n,t,e,i){pn(e,i)&&z(t,e,_(i))}function vn(n,t,e,i){pn(e,i)&&G(t,e,function(t,e){if(t)i(t);else{var o=new F(e,n.name);i(null,o)}})}function Nn(n,t,e,i){var o=n.openFiles[e];o?K(t,o,function(t,e){if(t)i(t);else{var o=new F(e,n.name);i(null,o)}}):i(new D.EBADF)}function An(n,t,e,i,o){pn(e,o)&&pn(i,o)&&J(t,e,i,_(o))}function hn(n,t,e,i){pn(e,i)&&Q(t,e,_(i))}function In(n,e,i,o,a,u,c,r){a=void 0===a?0:a,u=void 0===u?o.length-a:u,r=arguments[arguments.length-1];var f=n.openFiles[i];f?t(f.flags).contains(w)?W(e,f,o,a,u,c,_(function(n,t){r(n,t||0,o)})):r(new D.EBADF("descriptor does not permit reading")):r(new D.EBADF)}function jn(n,t,e,i,o){if(o=arguments[arguments.length-1],i=mn(i,null,"r"),pn(e,o)){var a=dn(i.flag||"r");if(!a)return o(new D.EINVAL("flags is not valid",e));q(t,e,a,function(u,c){if(u)return o(u);var r=new R(e,c.id,a,0),f=n.allocDescriptor(r);function s(){n.releaseDescriptor(f)}K(t,r,function(a,u){if(a)return s(),o(a);var c=new F(u,n.name);if(c.isDirectory())return s(),o(new D.EISDIR("illegal operation on directory",e));var f=c.size,l=new B(f);l.fill(0),W(t,r,l,0,f,0,function(n,t){if(s(),n)return o(n);var e;e="utf8"===i.encoding?T.decode(l):l,o(null,e)})})})}}function yn(n,e,i,o,a,u,c,r){r=arguments[arguments.length-1],a=void 0===a?0:a,u=void 0===u?o.length-a:u;var f=n.openFiles[i];f?t(f.flags).contains(g)?o.length-a<u?r(new D.EIO("intput buffer is too small")):U(e,f,o,a,u,c,_(r)):r(new D.EBADF("descriptor does not permit writing")):r(new D.EBADF)}function Tn(n,t,e,i,o,a){if(a=arguments[arguments.length-1],o=mn(o,"utf8","w"),pn(e,a)){var u=dn(o.flag||"w");if(!u)return a(new D.EINVAL("flags is not valid",e));"number"==typeof(i=i||"")&&(i=""+i),"string"==typeof i&&"utf8"===o.encoding&&(i=T.encode(i)),q(t,e,u,function(o,c){if(o)return a(o);var r=new R(e,c.id,u,0),f=n.allocDescriptor(r);Y(t,r,i,0,i.length,function(t,e){if(n.releaseDescriptor(f),t)return a(t);a(null)})})}}function Dn(n,t,e,i,o,a){if(a=arguments[arguments.length-1],o=mn(o,"utf8","a"),pn(e,a)){var u=dn(o.flag||"a");if(!u)return a(new D.EINVAL("flags is not valid",e));"number"==typeof(i=i||"")&&(i=""+i),"string"==typeof i&&"utf8"===o.encoding&&(i=T.encode(i)),q(t,e,u,function(o,c){if(o)return a(o);var r=new R(e,c.id,u,c.size),f=n.allocDescriptor(r);U(t,r,i,0,i.length,r.position,function(t,e){if(n.releaseDescriptor(f),t)return a(t);a(null)})})}}function Ln(n,t,e,i){vn(n,t,e,function(n,t){i(!n)})}function Rn(n,t,e,i,o){pn(e,o)&&rn(t,e,i,_(o))}function xn(n,t,e,i,o){var a=n.openFiles[e];a?fn(t,a,i,_(o)):o(new D.EBADF)}function Vn(n,t,e,i,o,a,u){"function"==typeof a&&(u=a,a=null),pn(e,u)&&un(t,e,i,o,a,_(u))}function Fn(n,e,i,o,a,u,c){"function"==typeof u&&(c=u,u=null);var r=n.openFiles[i];r?t(r.flags).contains(g)?cn(e,r,o,a,u,_(c)):c(new D.EBADF("descriptor does not permit writing")):c(new D.EBADF)}function Bn(n,t,e,i,o){pn(e,o)&&sn(t,e,i,_(o))}function _n(n,e,i,o,a){var u=n.openFiles[i];u?t(u.flags).contains(g)?ln(e,u,o,_(a)):a(new D.EBADF("descriptor does not permit writing")):a(new D.EBADF)}function Sn(n,t,e,i,o,a){var u=n.openFiles[e];u||a(new D.EBADF),"SET"===o?i<0?a(new D.EINVAL("resulting file offset would be negative")):(u.position=i,a(null,u.position)):"CUR"===o?u.position+i<0?a(new D.EINVAL("resulting file offset would be negative")):(u.position+=i,a(null,u.position)):"END"===o?K(t,u,function(n,t){n?a(n):t.size+i<0?a(new D.EINVAL("resulting file offset would be negative")):(u.position=t.size+i,a(null,u.position))}):a(new D.EINVAL("whence argument is not a proper value"))}function Pn(n,t,e,i){pn(e,i)&&Z(t,e,_(i))}function kn(n,t,e,i,o,a){if(pn(e,a)){var u=Date.now();on(t,e,i=i||u,o=o||u,_(a))}}function Cn(n,e,i,o,a,u){var c=Date.now();o=o||c,a=a||c;var r=n.openFiles[i];r?t(r.flags).contains(g)?an(e,r,o,a,_(u)):u(new D.EBADF("descriptor does not permit writing")):u(new D.EBADF)}function Mn(n,t,e,i,o){pn(e,o)&&pn(i,o)&&J(t,e,i,function(n){n?o(n):Q(t,e,_(o))})}function Xn(n,t,e,i,o,a){pn(e,a=arguments[arguments.length-1])&&pn(i,a)&&$(t,e,i,_(a))}function zn(n,t,e,i){pn(e,i)&&nn(t,e,_(i))}function qn(n,t,e,i){pn(e,i)&&H(t,e,function(t,e){if(t)i(t);else{var o=new F(e,n.name);i(null,o)}})}function Yn(n,t,e,i,o){i=i||0,pn(e,o=arguments[arguments.length-1])&&tn(t,e,i,_(o))}function Un(n,e,i,o,a){a=arguments[arguments.length-1],o=o||0;var u=n.openFiles[i];u?t(u.flags).contains(g)?en(e,u,o,_(a)):a(new D.EBADF("descriptor does not permit writing")):a(new D.EBADF)}module.exports={ensureRootDirectory:M,open:En,close:wn,mknod:gn,mkdir:On,rmdir:bn,unlink:hn,stat:vn,fstat:Nn,link:An,read:In,readFile:jn,write:yn,writeFile:Tn,appendFile:Dn,exists:Ln,getxattr:Rn,fgetxattr:xn,setxattr:Vn,fsetxattr:Fn,removexattr:Bn,fremovexattr:_n,lseek:Sn,readdir:Pn,utimes:kn,futimes:Cn,rename:Mn,symlink:Xn,readlink:zn,lstat:qn,truncate:Yn,ftruncate:Un};
},{"../../lib/nodash.js":13,"../path.js":4,"../constants.js":15,"../encoding.js":37,"../errors.js":5,"../directory-entry.js":38,"../open-file-description.js":39,"../super-node.js":40,"../node.js":41,"../stats.js":42,"../buffer.js":3}],6:[function(require,module,exports) {
var e=require("../../lib/nodash.js"),t=require("../path.js").isNull,r=require("../shared.js").nop,n=require("../constants.js"),i=n.FILE_SYSTEM_NAME,o=n.FS_FORMAT,a=n.FS_READY,u=n.FS_PENDING,s=n.FS_ERROR,c=n.FS_NODUPEIDCHECK,l=require("../providers/index.js"),f=require("../shell/shell.js"),d=require("../../lib/intercom.js"),p=require("../fs-watcher.js"),h=require("../errors.js"),v=require("../shared.js").guid,R=n.STDIN,g=n.STDOUT,y=n.STDERR,E=n.FIRST_DESCRIPTOR,S=require("./implementation.js");function m(e){return"function"==typeof e?e:function(e){if(e)throw e}}function x(n,f){f=f||r;var m=(n=n||{}).flags,x=n.guid?n.guid:v,w=n.provider||new l.Default(n.name||i),F=n.name||w.name,j=e(m).contains(o),q=this;q.readyState=u,q.name=F,q.error=null,q.stdin=R,q.stdout=g,q.stderr=y;var D={},O=E;Object.defineProperty(this,"openFiles",{get:function(){return D}}),this.allocDescriptor=function(e){var t=O++;return D[t]=e,t},this.releaseDescriptor=function(e){delete D[e]};var T=[];function C(t){return function(r){e(m).contains(c)?r(null,x()):function e(r){var n=x();t.getObject(n,function(t,i){t?r(t):i?e(r):r(null,n)})}(r)}}this.queueOrRun=function(e){var t;return a==q.readyState?e.call(q):s==q.readyState?t=new h.EFILESYSTEMERROR("unknown error"):T.push(e),t},this.watch=function(e,n,i){if(t(e))throw new Error("Path must be a string without null bytes.");"function"==typeof n&&(i=n,n={}),n=n||{},i=i||r;var o=new p;return o.start(e,!1,n.recursive),o.on("change",i),o},w.open(function(e){function t(e){function t(e){var t=w[e]();return t.flags=m,t.changes=[],t.guid=C(t),t.close=function(){var e=t.changes;!function(e){if(e.length){var t=d.getInstance();e.forEach(function(e){t.emit(e.event,e.path)})}}(e),e.length=0},t}q.provider={openReadWriteContext:function(){return t("getReadWriteContext")},openReadOnlyContext:function(){return t("getReadOnlyContext")}},q.readyState=e?s:a,T.forEach(function(e){e.call(this)}.bind(q)),T=null,f(e,q)}if(e)return t(e);var r=w.getReadWriteContext();r.guid=C(r),j?r.clear(function(e){if(e)return t(e);S.ensureRootDirectory(r,t)}):S.ensureRootDirectory(r,t)})}x.providers=l,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(e){x.prototype[e]=function(){var t=this,r=Array.prototype.slice.call(arguments,0),n=r.length-1,i="function"!=typeof r[n],o=m(r[n]),a=t.queueOrRun(function(){var a=t.provider.openReadWriteContext();if(s===t.readyState){var u=new h.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return o.call(t,u)}function c(){a.close(),o.apply(t,arguments)}i?r.push(c):r[n]=c;var l=[t,a].concat(r);S[e].apply(null,l)});a&&o(a)}}),x.prototype.Shell=function(e){return new f(this,e)},module.exports=x;
},{"../../lib/nodash.js":13,"../path.js":4,"../shared.js":14,"../constants.js":15,"../providers/index.js":18,"../shell/shell.js":19,"../../lib/intercom.js":16,"../fs-watcher.js":17,"../errors.js":5,"./implementation.js":20}],1:[function(require,module,exports) {
module.exports={FileSystem:require("./filesystem/interface.js"),Buffer:require("./buffer.js"),Path:require("./path.js"),Errors:require("./errors.js")};
},{"./filesystem/interface.js":6,"./buffer.js":3,"./path.js":4,"./errors.js":5}]},{},[1], "Filer")
//# sourceMappingURL=/filer.min.map
>>>>>>> Switch to parceljs for bundling, eslint for linting, drop grunt
>>>>>>> Switch to parceljs for bundling, eslint for linting, drop grunt