4 lines
86 KiB
JavaScript
4 lines
86 KiB
JavaScript
/*! filer 0.0.44 2018-05-29 */
|
|
!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=!1,h=a.flags;wa(h).contains(Va)&&delete d.ctime,wa(h).contains(Ua)&&delete d.mtime,d.ctime&&(c.ctime=d.ctime,c.atime=d.ctime,g=!0),d.atime&&(c.atime=d.atime,g=!0),d.mtime&&(c.mtime=d.mtime,g=!0),g?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.name=b.name,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)}); |