filer/dist/filer.min.js

80 lines
86 KiB
JavaScript

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},p.cache={};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}({"0c0E":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__";function o(e){if("function"!=typeof e)throw new TypeError("Argument to promisify must be a function");var n=e[r],t=o.Promise||Promise;if("function"!=typeof t)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var r=this,o=arguments.length,i=Array(o),f=0;f<o;f++)i[f]=arguments[f];return new t(function(o,t){i.push(function(r){if(r)return t(r);for(var e=arguments.length,i=Array(e>1?e-1:0),f=1;f<e;f++)i[f-1]=arguments[f];if(1===i.length||!n)return o(i[0]);var u={};i.forEach(function(r,o){var e=n[o];e&&(u[e]=r)}),o(u)}),e.call.apply(e,[r].concat(i))})}}o.argumentNames=r,o.Promise=void 0,exports.promisify=o;
},{}],"pBGv":[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(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){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};
},{}],"UUq2":[function(require,module,exports) {
var process = require("process");
var r=require("process");function t(r,t){for(var e=0,n=r.length-1;n>=0;n--){var s=r[n];"."===s?r.splice(n,1):".."===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,n=function(r){return e.exec(r).slice(1)};function s(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n<r.length;n++)t(r[n],n,r)&&e.push(r[n]);return e}exports.resolve=function(){for(var e="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var i=o>=0?arguments[o]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,n="/"===i.charAt(0))}return(n?"/":"")+(e=t(s(e.split("/"),function(r){return!!r}),!n).join("/"))||"."},exports.normalize=function(r){var e=exports.isAbsolute(r),n="/"===o(r,-1);return(r=t(s(r.split("/"),function(r){return!!r}),!e).join("/"))||e||(r="."),r&&n&&(r+="/"),(e?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(s(r,function(r,t){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split("/")),s=e(t.split("/")),o=Math.min(n.length,s.length),i=o,u=0;u<o;u++)if(n[u]!==s[u]){i=u;break}var l=[];for(u=i;u<n.length;u++)l.push("..");return(l=l.concat(s.slice(i))).join("/")},exports.sep="/",exports.delimiter=":",exports.dirname=function(r){var t=n(r),e=t[0],s=t[1];return e||s?(s&&(s=s.substr(0,s.length-1)),e+s):"."},exports.basename=function(r,t){var e=n(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},exports.extname=function(r){return n(r)[3]};var o="b"==="ab".substr(-1)?function(r,t,e){return r.substr(t,e)}:function(r,t,e){return t<0&&(t=r.length+t),r.substr(t,e)};
},{"process":"pBGv"}],"8thZ":[function(require,module,exports) {
var process = require("process");
var e=require("process");e.cwd=function(){return"/"};var r=require("path"),n=Object.create(r);n.basename=function(e,n){var i=r.basename(e,n);return""===i?"/":i},n.normalize=function(e){return"/"===(e=r.normalize(e))?e:n.removeTrailing(e)},n.isNull=function(e){return-1!==(""+e).indexOf("\0")},n.addTrailing=function(e){return e.replace(/\/*$/,"/")},n.removeTrailing=function(e){return""===(e=e.replace(/\/*$/,""))?"/":e},module.exports=n;
},{"path":"UUq2","process":"pBGv"}],"gCho":[function(require,module,exports) {
var _="READ",E="WRITE",O="CREATE",R="EXCLUSIVE",I="TRUNCATE",S="APPEND",T="CREATE",N="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",NODE_TYPE_FILE:"FILE",NODE_TYPE_DIRECTORY:"DIRECTORY",NODE_TYPE_SYMBOLIC_LINK:"SYMLINK",NODE_TYPE_META:"META",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:_,O_WRITE:E,O_CREATE:O,O_EXCLUSIVE:R,O_TRUNCATE:I,O_APPEND:S,O_FLAGS:{r:[_],"r+":[_,E],w:[E,O,I],"w+":[E,_,O,I],wx:[E,O,R,I],"wx+":[E,_,O,R,I],a:[E,O,S],"a+":[E,_,O,S],ax:[E,O,R,S],"ax+":[E,_,O,R,S]},XATTR_CREATE:T,XATTR_REPLACE:N,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}};
},{}],"yh9p":[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;
},{}],"JgNJ":[function(require,module,exports) {
exports.read=function(o,t,a,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,N=f>>1,n=-7,i=a?h-1:0,e=a?-1:1,s=o[t+i];for(i+=e,M=s&(1<<-n)-1,s>>=-n,n+=w;n>0;M=256*M+o[t+i],i+=e,n-=8);for(p=M&(1<<-n)-1,M>>=-n,n+=r;n>0;p=256*p+o[t+i],i+=e,n-=8);if(0===M)M=1-N;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=N}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(o,t,a,r,h,M){var p,w,f,N=8*M-h-1,n=(1<<N)-1,i=n>>1,e=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(w=isNaN(t)?1:0,p=n):(p=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-p))<1&&(p--,f*=2),(t+=p+i>=1?e/f:e*Math.pow(2,1-i))*f>=2&&(p++,f/=2),p+i>=n?(w=0,p=n):p+i>=1?(w=(t*f-1)*Math.pow(2,h),p+=i):(w=t*Math.pow(2,i-1)*Math.pow(2,h),p=0));h>=8;o[a+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,N+=h;N>0;o[a+s]=255&p,s+=u,p/=256,N-=8);o[a+s-u]|=128*l};
},{}],"REa7":[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],"dskh":[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(r){return!1}}function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=u.prototype:(null===t&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(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 p(this,t)}return h(this,t,r,e)}function h(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 f(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 f(r),r<=0?s(t,r):void 0!==e?"string"==typeof n?s(t,r).fill(e,n):s(t,r).fill(e):s(t,r)}function p(t,r){if(f(r),t=s(t,r<0?0:0|w(r)),!u.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"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=s(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function c(t,r){var e=r.length<0?0:0|w(r.length);t=s(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),u.TYPED_ARRAY_SUPPORT?(t=r).__proto__=u.prototype:t=c(t,r),t}function y(t,r){if(u.isBuffer(r)){var e=0|w(r.length);return 0===(t=s(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||d(r.length)?s(t,0):c(t,r);if("Buffer"===r.type&&n(r.data))return c(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 E(t){return+t!=t&&(t=0),u.alloc(+t)}function v(t,r){if(u.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 K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return I(t).length;default:if(n)return K(t).length;r=(""+r).toLowerCase(),n=!0}}function R(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 k(this,r,e);case"utf8":case"utf-8":return O(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return M(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function A(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=u.from(r,n)),u.isBuffer(r))return 0===r.length?-1:m(t,r,e,n,i);if("number"==typeof r)return r&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):m(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,r,e,n,i){var o,s=1,u=t.length,h=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;s=2,u/=2,h/=2,e/=2}function f(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(i){var a=-1;for(o=e;o<u;o++)if(f(t,o)===f(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===h)return a*s}else-1!==a&&(o-=o-a),a=-1}else for(e+h>u&&(e=u-h),o=e;o>=0;o--){for(var p=!0,l=0;l<h;l++)if(f(t,o+l)!==f(r,l)){p=!1;break}if(p)return o}return-1}function b(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 s=0;s<n;++s){var u=parseInt(r.substr(2*s,2),16);if(isNaN(u))return s;t[e+s]=u}return s}function T(t,r,e,n){return x(K(r,t.length-e),t,e,n)}function B(t,r,e,n){return x(Q(r),t,e,n)}function U(t,r,e,n){return B(t,r,e,n)}function Y(t,r,e,n){return x(I(r),t,e,n)}function P(t,r,e,n){return x(W(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 O(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,s,u,h,f=t[i],a=null,p=f>239?4:f>223?3:f>191?2:1;if(i+p<=e)switch(p){case 1:f<128&&(a=f);break;case 2:128==(192&(o=t[i+1]))&&(h=(31&f)<<6|63&o)>127&&(a=h);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(h=(15&f)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(a=h);break;case 4:o=t[i+1],s=t[i+2],u=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(h=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&h<1114112&&(a=h)}null===a?(a=65533,p=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=p}return C(n)}exports.Buffer=u,exports.SlowBuffer=E,exports.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,r,e){return h(null,t,r,e)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,r,e){return a(null,t,r,e)},u.allocUnsafe=function(t){return p(null,t)},u.allocUnsafeSlow=function(t){return p(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,r){if(!u.isBuffer(t)||!u.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},u.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}},u.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=u.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var s=t[e];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i},u.byteLength=v,u.prototype._isBuffer=!0,u.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)_(this,r,r+1);return this},u.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)_(this,r,r+3),_(this,r+1,r+2);return this},u.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)_(this,r,r+7),_(this,r+1,r+6),_(this,r+2,r+5),_(this,r+3,r+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?O(this,0,t):R.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.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+">"},u.prototype.compare=function(t,r,e,n,i){if(!u.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),s=(e>>>=0)-(r>>>=0),h=Math.min(o,s),f=this.slice(n,i),a=t.slice(r,e),p=0;p<h;++p)if(f[p]!==a[p]){o=f[p],s=a[p];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},u.prototype.indexOf=function(t,r,e){return A(this,t,r,e,!0)},u.prototype.lastIndexOf=function(t,r,e){return A(this,t,r,e,!1)},u.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 b(this,t,r,e);case"utf8":case"utf-8":return T(this,t,r,e);case"ascii":return B(this,t,r,e);case"latin1":case"binary":return U(this,t,r,e);case"base64":return Y(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function C(t){var r=t.length;if(r<=D)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=D));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 M(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 k(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+=H(t[o]);return i}function N(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 F(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 j(t,r,e,n,i,o){if(!u.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 q(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 V(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 X(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||X(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function Z(t,r,n,i,o){return o||X(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}u.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),u.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=u.prototype;else{var i=r-t;e=new u(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},u.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},u.prototype.readUInt8=function(t,r){return r||F(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,r){return r||F(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,r){return r||F(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,r){return r||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,r){return r||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||F(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},u.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||F(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},u.prototype.readInt8=function(t,r){return r||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,r){r||F(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(t,r){r||F(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(t,r){return r||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,r){return r||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,r){return r||F(t,4,this.length),e.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,r){return r||F(t,4,this.length),e.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,r){return r||F(t,8,this.length),e.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,r){return r||F(t,8,this.length),e.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(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},u.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(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},u.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},u.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):q(this,t,r,!0),r+2},u.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):q(this,t,r,!1),r+2},u.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):V(this,t,r,!0),r+4},u.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},u.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=0,s=1,u=0;for(this[r]=255&t;++o<e&&(s*=256);)t<0&&0===u&&0!==this[r+o-1]&&(u=1),this[r+o]=(t/s>>0)-u&255;return r+e},u.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=e-1,s=1,u=0;for(this[r+o]=255&t;--o>=0&&(s*=256);)t<0&&0===u&&0!==this[r+o+1]&&(u=1),this[r+o]=(t/s>>0)-u&255;return r+e},u.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},u.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):q(this,t,r,!0),r+2},u.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):q(this,t,r,!1),r+2},u.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):V(this,t,r,!0),r+4},u.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},u.prototype.writeFloatLE=function(t,r,e){return J(this,t,r,!0,e)},u.prototype.writeFloatBE=function(t,r,e){return J(this,t,r,!1,e)},u.prototype.writeDoubleLE=function(t,r,e){return Z(this,t,r,!0,e)},u.prototype.writeDoubleBE=function(t,r,e){return Z(this,t,r,!1,e)},u.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||!u.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},u.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&&!u.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 s=u.isBuffer(t)?t:K(new u(t,n).toString()),h=s.length;for(o=0;o<e-r;++o)this[o+r]=s[o%h]}return this};var $=/[^+\/0-9A-Za-z-_]/g;function z(t){if((t=G(t).replace($,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function G(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((e=t.charCodeAt(s))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(s+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 Q(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function W(t,r){for(var e,n,i,o=[],s=0;s<t.length&&!((r-=2)<0);++s)n=(e=t.charCodeAt(s))>>8,i=e%256,o.push(i),o.push(n);return o}function I(t){return r.toByteArray(z(t))}function x(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 d(t){return t!=t}
},{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"REa7","buffer":"dskh"}],"aSGf":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var global = arguments[3];
var t=require("buffer").Buffer,e=arguments[3],r=require("../constants.js").FILE_SYSTEM_NAME,n=require("../constants.js").FILE_STORE_NAME,o=require("../constants.js").IDB_RW,u=require("../constants.js").IDB_RO;function c(t,e){this.db=t,this.mode=e}function i(t){this.name=t||r,this.db=null}c.prototype._getObjectStore=function(){if(this.objectStore)return this.objectStore;var t=this.db.transaction(n,this.mode);return this.objectStore=t.objectStore(n),this.objectStore},c.prototype.clear=function(t){try{var e=this._getObjectStore().clear();e.onsuccess=function(){t()},e.onerror=function(e){e.preventDefault(),t(e.error)}}catch(r){t(r)}},c.prototype._get=function(t,e){try{var r=this._getObjectStore().get(t);r.onsuccess=function(t){var r=t.target.result;e(null,r)},r.onerror=function(t){t.preventDefault(),e(t.error)}}catch(n){e(n)}},c.prototype.getObject=function(t,e){this._get(t,e)},c.prototype.getBuffer=function(e,r){this._get(e,function(e,n){if(e)return r(e);r(null,t.from(n))})},c.prototype._put=function(t,e,r){try{var n=this._getObjectStore().put(e,t);n.onsuccess=function(t){var e=t.target.result;r(null,e)},n.onerror=function(t){t.preventDefault(),r(t.error)}}catch(o){r(o)}},c.prototype.putObject=function(t,e,r){this._put(t,e,r)},c.prototype.putBuffer=function(t,e,r){var n=e.buffer;this._put(t,n,r)},c.prototype.delete=function(t,e){try{var r=this._getObjectStore().delete(t);r.onsuccess=function(t){var r=t.target.result;e(null,r)},r.onerror=function(t){t.preventDefault(),e(t.error)}}catch(n){e(n)}},i.isSupported=function(){return!!(e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB)},i.prototype.open=function(t){var r=this;if(r.db)return t();try{var o=(e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB).open(r.name);o.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(n)&&e.deleteObjectStore(n),e.createObjectStore(n)},o.onsuccess=function(e){r.db=e.target.result,t()},o.onerror=function(e){e.preventDefault(),t(e.error)}}catch(u){t(u)}},i.prototype.getReadOnlyContext=function(){return new c(this.db,u)},i.prototype.getReadWriteContext=function(){return new c(this.db,o)},module.exports=i;
},{"../constants.js":"gCho","buffer":"dskh"}],"u4Zs":[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":"pBGv"}],"Xhog":[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":"gCho","../../lib/async.js":"u4Zs"}],"UCG6":[function(require,module,exports) {
var e=require("./indexeddb.js"),r=require("./memory.js");module.exports={IndexedDB:e,Default:e,Memory:r};
},{"./indexeddb.js":"aSGf","./memory.js":"Xhog"}],"Hmaa":[function(require,module,exports) {
var t={};["3:EACCES:permission denied","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(e){var o=+(e=e.split(":"))[0],r=e[1],i=e[2];function s(t,e){Error.call(this),this.name=r,this.code=r,this.errno=o,this.message=t||i,e&&(this.path=e),this.stack=new Error(this.message).stack}s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s.prototype.toString=function(){var t=this.path?", '"+this.path+"'":"";return this.name+": "+this.message+t},t[r]=t[o]=s}),module.exports=t;
},{}],"lsut":[function(require,module,exports) {
"use strict";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,s){n[t]=s}};
},{"../constants.js":"gCho"}],"bQx9":[function(require,module,exports) {
module.exports=function(t,o){for(var a=[],e=0;e<t.length;e++){var n=o(t[e],e);r(n)?a.push.apply(a,n):a.push(n)}return a};var r=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};
},{}],"6D9y":[function(require,module,exports) {
"use strict";function e(e,r,i){e instanceof RegExp&&(e=n(e,i)),r instanceof RegExp&&(r=n(r,i));var o=t(e,r,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+e.length,o[1]),post:i.slice(o[1]+r.length)}}function n(e,n){var t=n.match(e);return t?t[0]:null}function t(e,n,t){var r,i,o,f,l,s=t.indexOf(e),c=t.indexOf(n,s+1),p=s;if(s>=0&&c>0){for(r=[],o=t.length;p>=0&&!l;)p==s?(r.push(p),s=t.indexOf(e,p+1)):1==r.length?l=[r.pop(),c]:((i=r.pop())<o&&(o=i,f=c),c=t.indexOf(n,p+1)),p=s<c&&s>=0?s:c;r.length&&(l=[o,f])}return l}module.exports=e,e.range=t;
},{}],"dwX/":[function(require,module,exports) {
var t=require("concat-map"),r=require("balanced-match");module.exports=h;var o="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",p="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function u(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function l(t){return t.split("\\\\").join(o).split("\\{").join(n).split("\\}").join(a).split("\\,").join(p).split("\\.").join(s)}function f(t){return t.split(o).join("\\").split(n).join("{").split(a).join("}").split(p).join(",").split(s).join(".")}function e(t){if(!t)return[""];var o=[],n=r("{","}",t);if(!n)return t.split(",");var a=n.pre,p=n.body,s=n.post,u=a.split(",");u[u.length-1]+="{"+p+"}";var l=e(s);return s.length&&(u[u.length-1]+=l.shift(),u.push.apply(u,l)),o.push.apply(o,u),o}function h(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),M(l(t),!0).map(f)):[]}function v(t){return t}function i(t){return"{"+t+"}"}function g(t){return/^-?0\d/.test(t)}function b(t,r){return t<=r}function j(t,r){return t>=r}function M(o,n){var p=[],s=r("{","}",o);if(!s||/\$$/.test(s.pre))return[o];var l,f=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),v=f||h,m=s.body.indexOf(",")>=0;if(!v&&!m)return s.post.match(/,.*\}/)?M(o=s.pre+"{"+s.body+a+s.post):[o];if(v)l=s.body.split(/\.\./);else if(1===(l=e(s.body)).length&&1===(l=M(l[0],!1).map(i)).length)return(y=s.post.length?M(s.post,!1):[""]).map(function(t){return s.pre+l[0]+t});var C,O=s.pre,y=s.post.length?M(s.post,!1):[""];if(v){var A=u(l[0]),$=u(l[1]),E=Math.max(l[0].length,l[1].length),I=3==l.length?Math.abs(u(l[2])):1,S=b;$<A&&(I*=-1,S=j);var d=l.some(g);C=[];for(var L=A;S(L,$);L+=I){var Z;if(h)"\\"===(Z=String.fromCharCode(L))&&(Z="");else if(Z=String(L),d){var D=E-Z.length;if(D>0){var H=new Array(D+1).join("0");Z=L<0?"-"+H+Z.slice(1):H+Z}}C.push(Z)}}else C=t(l,function(t){return M(t,!1)});for(var R=0;R<C.length;R++)for(var k=0;k<y.length;k++){var q=O+C[R]+y[k];(!n||v||q)&&p.push(q)}return p}
},{"concat-map":"bQx9","balanced-match":"6D9y"}],"Nt/K":[function(require,module,exports) {
module.exports=l,l.Minimatch=d;var t={sep:"/"};try{t=require("path")}catch(O){}var r=l.GLOBSTAR=d.GLOBSTAR={},n=require("brace-expansion"),e={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},i="[^/]",a=i+"*?",o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",h="(?:(?!(?:\\/|^)\\.).)*?",c=u("().*{}+?[]^$\\!");function u(t){return t.split("").reduce(function(t,r){return t[r]=!0,t},{})}var p=/\/+/;function f(t,r){return r=r||{},function(n,e,i){return l(n,t,r)}}function g(t,r){t=t||{},r=r||{};var n={};return Object.keys(r).forEach(function(t){n[t]=r[t]}),Object.keys(t).forEach(function(r){n[r]=t[r]}),n}function l(t,r,n){if("string"!=typeof r)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===r.charAt(0))&&(""===r.trim()?""===t:new d(r,n).match(t))}function d(r,n){if(!(this instanceof d))return new d(r,n);if("string"!=typeof r)throw new TypeError("glob pattern string required");n||(n={}),r=r.trim(),"/"!==t.sep&&(r=r.split(t.sep).join("/")),this.options=n,this.set=[],this.pattern=r,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function b(){if(!this._made){var t=this.pattern,r=this.options;if(r.nocomment||"#"!==t.charAt(0))if(t){this.parseNegate();var n=this.globSet=this.braceExpand();r.debug&&(this.debug=console.error),this.debug(this.pattern,n),n=this.globParts=n.map(function(t){return t.split(p)}),this.debug(this.pattern,n),n=n.map(function(t,r,n){return t.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(t){return-1===t.indexOf(!1)}),this.debug(this.pattern,n),this.set=n}else this.empty=!0;else this.comment=!0}}function m(){var t=this.pattern,r=!1,n=0;if(!this.options.nonegate){for(var e=0,i=t.length;e<i&&"!"===t.charAt(e);e++)r=!r,n++;n&&(this.pattern=t.substr(n)),this.negate=r}}function v(t,r){if(r||(r=this instanceof d?this.options:{}),void 0===(t=void 0===t?this.pattern:t))throw new TypeError("undefined pattern");return r.nobrace||!t.match(/\{.*\}/)?[t]:n(t)}l.filter=f,l.defaults=function(t){if(!t||!Object.keys(t).length)return l;var r=l,n=function(n,e,i){return r.minimatch(n,e,g(t,i))};return n.Minimatch=function(n,e){return new r.Minimatch(n,g(t,e))},n},d.defaults=function(t){return t&&Object.keys(t).length?l.defaults(t).Minimatch:d},d.prototype.debug=function(){},d.prototype.make=b,d.prototype.parseNegate=m,l.braceExpand=function(t,r){return v(t,r)},d.prototype.braceExpand=v,d.prototype.parse=y;var s={};function y(t,n){if(t.length>65536)throw new TypeError("pattern is too long");var o=this.options;if(!o.noglobstar&&"**"===t)return r;if(""===t)return"";var h,u="",p=!!o.nocase,f=!1,g=[],l=[],d=!1,b=-1,m=-1,v="."===t.charAt(0)?"":o.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=this;function w(){if(h){switch(h){case"*":u+=a,p=!0;break;case"?":u+=i,p=!0;break;default:u+="\\"+h}y.debug("clearStateChar %j %j",h,u),h=!1}}for(var x,j=0,k=t.length;j<k&&(x=t.charAt(j));j++)if(this.debug("%s\t%s %s %j",t,j,u,x),f&&c[x])u+="\\"+x,f=!1;else switch(x){case"/":return!1;case"\\":w(),f=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,j,u,x),d){this.debug(" in class"),"!"===x&&j===m+1&&(x="^"),u+=x;continue}y.debug("call clearStateChar %j",h),w(),h=x,o.noext&&w();continue;case"(":if(d){u+="(";continue}if(!h){u+="\\(";continue}g.push({type:h,start:j-1,reStart:u.length,open:e[h].open,close:e[h].close}),u+="!"===h?"(?:(?!(?:":"(?:",this.debug("plType %j %j",h,u),h=!1;continue;case")":if(d||!g.length){u+="\\)";continue}w(),p=!0;var A=g.pop();u+=A.close,"!"===A.type&&l.push(A),A.reEnd=u.length;continue;case"|":if(d||!g.length||f){u+="\\|",f=!1;continue}w(),u+="|";continue;case"[":if(w(),d){u+="\\"+x;continue}d=!0,m=j,b=u.length,u+=x;continue;case"]":if(j===m+1||!d){u+="\\"+x,f=!1;continue}if(d){var $=t.substring(m+1,j);try{RegExp("["+$+"]")}catch(O){var R=this.parse($,s);u=u.substr(0,b)+"\\["+R[0]+"\\]",p=p||R[1],d=!1;continue}}p=!0,d=!1,u+=x;continue;default:w(),f?f=!1:!c[x]||"^"===x&&d||(u+="\\"),u+=x}for(d&&($=t.substr(m+1),R=this.parse($,s),u=u.substr(0,b)+"\\["+R[0],p=p||R[1]),A=g.pop();A;A=g.pop()){var T=u.slice(A.reStart+A.open.length);this.debug("setting tail",u,A),T=T.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(t,r,n){return n||(n="\\"),r+r+n+"|"}),this.debug("tail=%j\n %s",T,T,A,u);var C="*"===A.type?a:"?"===A.type?i:"\\"+A.type;p=!0,u=u.slice(0,A.reStart)+C+"\\("+T}w(),f&&(u+="\\\\");var L=!1;switch(u.charAt(0)){case".":case"[":case"(":L=!0}for(var q=l.length-1;q>-1;q--){var B=l[q],M=u.slice(0,B.reStart),N=u.slice(B.reStart,B.reEnd-8),_=u.slice(B.reEnd-8,B.reEnd),G=u.slice(B.reEnd);_+=G;var S=M.split("(").length-1,P=G;for(j=0;j<S;j++)P=P.replace(/\)[+*?]?/,"");var z="";""===(G=P)&&n!==s&&(z="$"),u=M+N+G+z+_}if(""!==u&&p&&(u="(?=.)"+u),L&&(u=v+u),n===s)return[u,p];if(!p)return E(t);var D=o.nocase?"i":"";try{var F=new RegExp("^"+u+"$",D)}catch(O){return new RegExp("$.")}return F._glob=t,F._src=u,F}function w(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var n=this.options,e=n.noglobstar?a:n.dot?o:h,i=n.nocase?"i":"",c=t.map(function(t){return t.map(function(t){return t===r?e:"string"==typeof t?j(t):t._src}).join("\\/")}).join("|");c="^(?:"+c+")$",this.negate&&(c="^(?!"+c+").*$");try{this.regexp=new RegExp(c,i)}catch(u){this.regexp=!1}return this.regexp}function x(r,n){if(this.debug("match",r,this.pattern),this.comment)return!1;if(this.empty)return""===r;if("/"===r&&n)return!0;var e=this.options;"/"!==t.sep&&(r=r.split(t.sep).join("/")),r=r.split(p),this.debug(this.pattern,"split",r);var i,a,o=this.set;for(this.debug(this.pattern,"set",o),a=r.length-1;a>=0&&!(i=r[a]);a--);for(a=0;a<o.length;a++){var h=o[a],c=r;if(e.matchBase&&1===h.length&&(c=[i]),this.matchOne(c,h,n))return!!e.flipNegate||!this.negate}return!e.flipNegate&&this.negate}function E(t){return t.replace(/\\(.)/g,"$1")}function j(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}l.makeRe=function(t,r){return new d(t,r||{}).makeRe()},d.prototype.makeRe=w,l.match=function(t,r,n){var e=new d(r,n=n||{});return t=t.filter(function(t){return e.match(t)}),e.options.nonull&&!t.length&&t.push(r),t},d.prototype.match=x,d.prototype.matchOne=function(t,n,e){var i=this.options;this.debug("matchOne",{this:this,file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var a=0,o=0,h=t.length,c=n.length;a<h&&o<c;a++,o++){this.debug("matchOne loop");var u,p=n[o],f=t[a];if(this.debug(n,p,f),!1===p)return!1;if(p===r){this.debug("GLOBSTAR",[n,p,f]);var g=a,l=o+1;if(l===c){for(this.debug("** at the end");a<h;a++)if("."===t[a]||".."===t[a]||!i.dot&&"."===t[a].charAt(0))return!1;return!0}for(;g<h;){var d=t[g];if(this.debug("\nglobstar while",t,g,n,l,d),this.matchOne(t.slice(g),n.slice(l),e))return this.debug("globstar found match!",g,h,d),!0;if("."===d||".."===d||!i.dot&&"."===d.charAt(0)){this.debug("dot detected!",t,g,n,l);break}this.debug("globstar swallow a segment, and continue"),g++}return!(!e||(this.debug("\n>>> no match, partial?",t,g,n,l),g!==h))}if("string"==typeof p?(u=i.nocase?f.toLowerCase()===p.toLowerCase():f===p,this.debug("string match",p,f,u)):(u=f.match(p),this.debug("pattern match",p,f,u)),!u)return!1}if(a===h&&o===c)return!0;if(a===h)return e;if(o===c)return a===h-1&&""===t[a];throw new Error("wtf?")};
},{"path":"UUq2","brace-expansion":"dwX/"}],"Kf0M":[function(require,module,exports) {
var n=require("es6-promisify"),i=n.promisify,e=require("../path.js"),t=require("../errors.js"),o=require("./environment.js"),r=require("../../lib/async.js"),u=require("minimatch");function f(n,r){var u=this,f=new o((r=r||{}).env),s="/";Object.defineProperty(this,"fs",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return f},enumerable:!0}),this.cd=function(i,o){i=e.resolve(s,i),n.stat(i,function(n,e){n?o(new t.ENOTDIR(null,i)):"DIRECTORY"===e.type?(s=i,o()):o(new t.ENOTDIR(null,i))})},this.pwd=function(){return s},this.promises={},["cd","exec","touch","cat","ls","rm","tempDir","mkdirp","find"].forEach(function(n){u.promises[n]=i(u[n].bind(u))})}f.prototype.exec=function(n,i,t){var o=this.fs;"function"==typeof i&&(t=i,i=[]),i=i||[],t=t||function(){},n=e.resolve(this.pwd(),n),o.readFile(n,"utf8",function(n,e){if(n)t(n);else try{new Function("fs","args","callback",e)(o,i,t)}catch(r){t(r)}})},f.prototype.touch=function(n,i,t){var o=this.fs;"function"==typeof i&&(t=i,i={}),i=i||{},t=t||function(){},n=e.resolve(this.pwd(),n),o.stat(n,function(e){e?!0===i.updateOnly?t():function(n){o.writeFile(n,"",t)}(n):function(n){var e=Date.now(),r=i.date||e,u=i.date||e;o.utimes(n,r,u,t)}(n)})},f.prototype.cat=function(n,i){var o=this,u=o.fs,f="";i=i||function(){},n?(n="string"==typeof n?[n]:n,r.eachSeries(n,function(n,i){var t=e.resolve(o.pwd(),n);u.readFile(t,"utf8",function(n,e){n?i(n):(f+=e+"\n",i())})},function(n){n?i(n):i(null,f.replace(/\n$/,""))})):i(new t.EINVAL("Missing files argument"))},f.prototype.ls=function(n,i,o){var u=this,f=u.fs;"function"==typeof i&&(o=i,i={}),i=i||{},o=o||function(){},n?function n(t,o){var s=e.resolve(u.pwd(),t),c=[];f.readdir(s,function(t,u){t?o(t):r.eachSeries(u,function(t,o){t=e.join(s,t),f.stat(t,function(t,r){if(t)o(t);else{var u=r;i.recursive&&"DIRECTORY"===r.type?n(e.join(s,u.name),function(n,i){n?o(n):(u.contents=i,c.push(u),o())}):(c.push(u),o())}})},function(n){o(n,c)})})}(n,o):o(new t.EINVAL("Missing dir argument"))},f.prototype.rm=function(n,i,o){var u=this,f=u.fs;"function"==typeof i&&(o=i,i={}),i=i||{},o=o||function(){},n?function n(o,s){o=e.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?i.recursive?(c=c.map(function(n){return e.join(o,n)}),r.eachSeries(c,n,function(n){n?s(n):f.rmdir(o,s)})):s(new t.ENOTEMPTY(null,o)):f.rmdir(o,s)}):f.unlink(o,s)})}(n,o):o(new t.EINVAL("Missing path argument"))},f.prototype.tempDir=function(n){var i=this.fs,e=this.env.get("TMP");n=n||function(){},i.mkdir(e,function(){n(null,e)})},f.prototype.mkdirp=function(n,i){var o=this.fs;i=i||function(){},n?"/"!==n?function n(i,r){o.stat(i,function(u,f){if(f){if(f.isDirectory())return void r();if(f.isFile())return void r(new t.ENOTDIR(null,i))}else{if(u&&"ENOENT"!==u.code)return void r(u);var s=e.dirname(i);"/"===s?o.mkdir(i,function(n){n&&"EEXIST"!==n.code?r(n):r()}):n(s,function(n){if(n)return r(n);o.mkdir(i,function(n){n&&"EEXIST"!==n.code?r(n):r()})})}})}(n,i):i():i(new t.EINVAL("Missing path argument"))},f.prototype.find=function(n,i,o){var f=this,s=f.fs;"function"==typeof i&&(o=i,i={}),o=o||function(){};var c=(i=i||{}).exec||function(n,i){i()},p=[];function a(n,t){var o=e.removeTrailing(n);!i.regex||i.regex.test(o)?i.name&&!u(e.basename(o),i.name)||i.path&&!u(e.dirname(o),i.path)?t():function(n,i){c(n,function(e){e?i(e):(p.push(n),i())})}(n,t):t()}function d(n,i){n=e.resolve(f.pwd(),n),s.readdir(n,function(t,o){t?"ENOTDIR"===t.code?a(n,i):i(t):a(e.addTrailing(n),function(t){t?i(t):(o=o.map(function(i){return e.join(n,i)}),r.eachSeries(o,d,function(n){i(n,p)}))})})}n?s.stat(n,function(i,e){i?o(i):e.isDirectory()?d(n,o):o(new t.ENOTDIR(null,n))}):o(new t.EINVAL("Missing path argument"))},module.exports=f;
},{"es6-promisify":"0c0E","../path.js":"8thZ","../errors.js":"Hmaa","./environment.js":"lsut","../../lib/async.js":"u4Zs","minimatch":"Nt/K"}],"J4Qg":[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;
},{}],"zFPO":[function(require,module,exports) {
function x(x){return x.replace(/[xy]/g,function(x){var n=16*Math.random()|0;return("x"===x?n:3&n|8).toString(16)})}function n(){return x("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").toUpperCase()}function r(n){return x("x".repeat(n=n||6))}function t(){}module.exports={guid:n,nop:t,randomChars:r};
},{}],"u7Jv":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3];function e(t){return(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})(t)}var 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"===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(r){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(r){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(i){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(i){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":"J4Qg","../src/shared.js":"zFPO"}],"p3D+":[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":"J4Qg","./path.js":"8thZ","../lib/intercom.js":"u7Jv"}],"RlAD":[function(require,module,exports) {
var t=require("./constants.js").NODE_TYPE_FILE;module.exports=function(s,e){this.id=s,this.type=e||t};
},{"./constants.js":"gCho"}],"U1jA":[function(require,module,exports) {
var r=require("./constants"),e=r.FIRST_DESCRIPTOR,n={},t=function(){for(var r=e;o(r);)r++;return r},o=function(r){return n[r]},i=function(r){var e=t();return n[e]=r,e},u=function(r){return delete n[r]};module.exports={allocDescriptor:i,releaseDescriptor:u,getOpenFileDescription:o};
},{"./constants":"gCho"}],"epsH":[function(require,module,exports) {
function t(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function i(t,i){for(var s=0;s<i.length;s++){var e=i[s];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function s(t,s,e){return s&&i(t.prototype,s),e&&i(t,e),t}var e=require("./constants"),n=e.NODE_TYPE_FILE,r=e.NODE_TYPE_DIRECTORY,a=e.NODE_TYPE_SYMBOLIC_LINK,o=e.DEFAULT_FILE_PERMISSIONS,u=e.DEFAULT_DIR_PERMISSIONS,h=require("./constants").fsConstants,c=h.S_IFREG,f=h.S_IFDIR,m=h.S_IFLNK;function d(t,i,s){if(t[i])return s();t.guid(function(e,n){if(e)return s(e);t[i]=n,s()})}function l(t,i){switch(t){case r:return(i||u)|f;case a:return(i||o)|m;case n:default:return(i||o)|c}}var p=function(){function i(s){t(this,i);var e=Date.now();this.id=s.id,this.data=s.data,this.size=s.size||0,this.atime=s.atime||e,this.ctime=s.ctime||e,this.mtime=s.mtime||e,this.flags=s.flags||[],this.xattrs=s.xattrs||{},this.nlinks=s.nlinks||0,"string"==typeof s.type?this.type=s.type:"string"==typeof s.mode?this.type=s.mode:this.type=n,this.permissions=s.permissions||l(this.type),this.uid=s.uid||0,this.gid=s.gid||0}return s(i,[{key:"toJSON",value:function(){return{id:this.id,data:this.data,size:this.size,atime:this.atime,ctime:this.ctime,mtime:this.ctime,flags:this.flags,xattrs:this.xattrs,nlinks:this.nlinks,mode:this.type,permissions:this.permissions,uid:this.uid,gid:this.gid}}},{key:"mode",get:function(){return l(this.type,this.permissions)},set:function(t){this.permissions=t}}]),i}();module.exports.create=function(t,i){d(t,"id",function(s){if(s)return i(s);d(t,"data",function(s){if(s)return i(s);i(null,new p(t))})})};
},{"./constants":"gCho"}],"E+68":[function(require,module,exports) {
var e=require("./errors.js"),t=require("./node");function i(e,t,i,r){this.path=e,this.id=t,this.flags=i,this.position=r}i.prototype.getNode=function(i,r){var o=this.id,n=this.path;i.getObject(o,function(i,o){return i?r(i):o?void t.create(o,r):r(new e.EBADF("file descriptor refers to unknown node",n))})},module.exports=i;
},{"./errors.js":"Hmaa","./node":"epsH"}],"3YM/":[function(require,module,exports) {
var t=require("./constants.js");function e(e){var i=Date.now();this.id=t.SUPER_NODE_ID,this.type=t.NODE_TYPE_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":"gCho"}],"OfGU":[function(require,module,exports) {
"use strict";var t=require("./constants.js"),i=require("./path.js");function e(t){return new Date(Number(t))}function s(t,s,o){this.dev=o,this.node=s.id,this.type=s.type,this.size=s.size,this.nlinks=s.nlinks,this.atime=e(s.atime),this.mtime=e(s.mtime),this.ctime=e(s.ctime),this.atimeMs=s.atime,this.mtimeMs=s.mtime,this.ctimeMs=s.ctime,this.version=s.version,this.mode=s.mode,this.uid=s.uid,this.gid=s.gid,this.name=i.basename(t)}s.prototype.isFile=function(){return this.type===t.NODE_TYPE_FILE},s.prototype.isDirectory=function(){return this.type===t.NODE_TYPE_DIRECTORY},s.prototype.isSymbolicLink=function(){return this.type===t.NODE_TYPE_SYMBOLIC_LINK},s.prototype.isSocket=s.prototype.isFIFO=s.prototype.isCharacterDevice=s.prototype.isBlockDevice=function(){return!1},module.exports=s;
},{"./constants.js":"gCho","./path.js":"8thZ"}],"HvxC":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var n=require("buffer").Buffer;function t(n){return(t="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})(n)}var e=require("../path.js"),i=e.normalize,u=e.dirname,o=e.basename,f=e.isAbsolute,s=require("../shared.js"),r=require("../constants.js"),a=r.NODE_TYPE_FILE,c=r.NODE_TYPE_DIRECTORY,p=r.NODE_TYPE_SYMBOLIC_LINK,d=r.NODE_TYPE_META,m=r.FULL_READ_WRITE_EXEC_PERMISSIONS,E=r.ROOT_DIRECTORY_NAME,w=r.SUPER_NODE_ID,O=r.SYMLOOP_MAX,l=r.O_READ,g=r.O_WRITE,v=r.O_CREATE,y=r.O_EXCLUSIVE,N=r.O_APPEND,A=r.O_FLAGS,D=r.XATTR_CREATE,I=r.XATTR_REPLACE,j=r.FS_NOMTIME,T=r.FS_NOCTIME,h=require("../errors.js"),b=require("../directory-entry.js"),L=require("../open-files.js"),R=require("../open-file-description.js"),F=require("../super-node.js"),V=require("../node.js"),B=require("../stats.js");function P(n,t,e,i,u){var o=n.flags;o.includes(T)&&delete i.ctime,o.includes(j)&&delete i.mtime;var f=!1;function s(e){n.changes.push({event:"change",path:t}),u(e)}i.ctime&&(e.ctime=i.ctime,e.atime=i.ctime,f=!0),i.atime&&(e.atime=i.atime,f=!0),i.mtime&&(e.mtime=i.mtime,f=!0),f?n.putObject(e.id,e,s):s()}function S(n,t,e,f){if(e!==c&&e!==a)return f(new h.EINVAL("type must be a directory or file",t));t=i(t);var s,r,p,d=o(t),m=u(t);function E(e,i){!e&&i?f(new h.EEXIST("path name already exists",t)):!e||e instanceof h.ENOENT?n.getObject(s.data,w):f(e)}function w(t,i){t?f(t):(r=i,V.create({guid:n.guid,type:e},function(t,e){t?f(t):((p=e).nlinks+=1,n.putObject(p.id,p,l))}))}function O(t){if(t)f(t);else{var e=Date.now();P(n,m,p,{mtime:e,ctime:e},f)}}function l(t){t?f(t):(r[d]=new b(p.id,e),n.putObject(s.data,r,O))}_(n,m,function(e,i){e?f(e):i.type!==c?f(new h.ENOTDIR("a component of the path prefix is not a directory",t)):(s=i,_(n,t,E))})}function _(n,t,e){if(!(t=i(t)))return e(new h.ENOENT("path is an empty string"));var f=o(t),s=u(t),r=0;function a(t,i){if(t)return e(t);var u=new F(i);u&&u.type===d&&u.rnode?n.getObject(u.rnode,m):e(new h.EFILESYSTEMERROR)}function m(n,t){n?e(n):t?V.create(t,e):e(new h.ENOENT)}function l(i,u){i?e(i):u.type===c&&u.data?n.getObject(u.data,g):e(new h.ENOTDIR("a component of the path prefix is not a directory",t))}function g(i,u){if(i)e(i);else if(u.hasOwnProperty(f)){var o=u[f].id;n.getObject(o,v)}else e(new h.ENOENT(null,t))}function v(n,t){if(n)return e(n);V.create(t,y)}function y(c,d){var m;c?e(c):d.type===p?++r>O?e(new h.ELOOP(null,t)):(m=d.data,m=i(m),s=u(m),f=o(m),E===f?n.getObject(w,a):_(n,s,l)):e(null,d)}E===f?n.getObject(w,a):_(n,s,l)}function x(n,t,e,i,u,o,f){var s=e.xattrs;o===D&&s.hasOwnProperty(i)?f(new h.EEXIST("attribute already exists",t)):o!==I||s.hasOwnProperty(i)?(s[i]=u,n.putObject(e.id,e,function(i){i?f(i):P(n,t,e,{ctime:Date.now()},f)})):f(new h.ENOATTR(null,t))}function C(n,t){var e,i,u;function o(u){u?t(u):V.create({guid:n.guid,id:e.rnode,type:c},function(e,u){e?t(e):((i=u).nlinks+=1,n.putObject(i.id,i,f))})}function f(e){e?t(e):(u={},n.putObject(i.data,u,t))}n.getObject(w,function(i,u){!i&&u?t():!i||i instanceof h.ENOENT?F.create({guid:n.guid},function(i,u){i?t(i):(e=u,n.putObject(e.id,e,o))}):t(i)})}function X(n,t,e){t=i(t);var f,s,r,a,p=o(t),d=u(t);function m(t,i){t?e(t):(r=i,n.getObject(r.data,E))}function E(t,i){t?e(t):(a=i,V.create({guid:n.guid,type:c},function(t,i){t?e(t):((f=i).nlinks+=1,n.putObject(f.id,f,w))}))}function w(t){t?e(t):(s={},n.putObject(f.data,s,l))}function O(t){if(t)e(t);else{var i=Date.now();P(n,d,r,{mtime:i,ctime:i},e)}}function l(t){t?e(t):(a[p]=new b(f.id,c),n.putObject(r.data,a,O))}_(n,t,function(i,u){!i&&u?e(new h.EEXIST(null,t)):!i||i instanceof h.ENOENT?_(n,d,m):e(i)})}function q(n,t,e,u){var o=r.fsConstants,f=o.F_OK,s=o.R_OK,a=o.W_OK,c=o.X_OK,p=o.S_IXUSR,d=o.S_IXGRP,m=o.S_IXOTH;_(n,t=i(t),function(n,i){if(n)return u(n);if(e===f)return u(null);var o=Pn(i.mode,u);return o?e&(s|a)?u(null):e&c&&o&(p|d|m)?u(null):void u(new h.EACCES("permission denied",t)):void 0})}function M(n,t,e){t=i(t);var f,s,r,a,p=o(t),d=u(t);function m(i,u){i?e(i):E===p?e(new h.EBUSY(null,t)):u.hasOwnProperty(p)?(f=(a=u)[p].id,n.getObject(f,w)):e(new h.ENOENT(null,t))}function w(i,u){i?e(i):u.type!==c?e(new h.ENOTDIR(null,t)):(f=u,n.getObject(f.data,O))}function O(i,u){i?e(i):(s=u,Object.keys(s).length>0?e(new h.ENOTEMPTY(null,t)):(delete a[p],n.putObject(r.data,a,l)))}function l(t){if(t)e(t);else{var i=Date.now();P(n,d,r,{mtime:i,ctime:i},g)}}function g(t){t?e(t):n.delete(f.id,v)}function v(t){t?e(t):n.delete(f.data,e)}_(n,d,function(t,i){t?e(t):(r=i,n.getObject(r.data,m))})}function z(t,e,f,s,r){"function"==typeof s&&(r=s,s=null),e=i(e);var d,m,w,l,N,A=o(e),D=u(e),I=0;function j(n,i){n?r(n):i.type!==c?r(new h.ENOENT(null,e)):(d=i,t.getObject(d.data,T))}function T(n,i){n?r(n):(m=i).hasOwnProperty(A)?f.includes(y)?r(new h.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",e)):(w=m[A]).type===c&&f.includes(g)?r(new h.EISDIR("the named file is a directory and O_WRITE is set",e)):t.getObject(w.id,L):f.includes(v)?V.create({guid:t.guid,type:a},function(n,e){n?r(n):((l=e).nlinks+=1,s&&(l.mode=s),t.putObject(l.id,l,F))}):r(new h.ENOENT("O_CREATE is not set and the named file does not exist",e))}function L(n,s){if(n)r(n);else{var a=s;a.type===p?++I>O?r(new h.ELOOP(null,e)):function(n){n=i(n),D=u(n),A=o(n),E===A&&(f.includes(g)?r(new h.EISDIR("the named file is a directory and O_WRITE is set",e)):_(t,e,R));_(t,D,j)}(a.data):R(void 0,a)}}function R(n,t){n?r(n):r(null,l=t)}function F(e){e?r(e):(N=n.alloc(0),t.putBuffer(l.data,N,S))}function B(n){if(n)r(n);else{var e=Date.now();P(t,D,d,{mtime:e,ctime:e},x)}}function S(n){n?r(n):(m[A]=new b(l.id,a),t.putObject(d.data,m,B))}function x(n){n?r(n):r(null,l)}E===A?f.includes(g)?r(new h.EISDIR("the named file is a directory and O_WRITE is set",e)):_(t,e,R):_(t,D,j)}function Y(t,e,i,u,o,f){var s;function r(n){n?f(n):f(null,o)}function a(n){if(n)f(n);else{var i=Date.now();P(t,e.path,s,{mtime:i,ctime:i},r)}}function c(n){n?f(n):t.putObject(s.id,s,a)}t.getObject(e.id,function(r,a){if(r)f(r);else{s=a;var p=n.alloc(o);i.copy(p,0,u,u+o),e.position=o,s.size=o,s.version+=1,t.putBuffer(s.data,p,c)}})}function K(t,e,i,u,o,f,s){var r,a;function c(n){n?s(n):s(null,o)}function p(n){if(n)s(n);else{var i=Date.now();P(t,e.path,r,{mtime:i,ctime:i},c)}}function d(n){n?s(n):t.putObject(r.id,r,p)}function m(c,p){if(c)s(c);else{if(!(a=p))return s(new h.EIO("Expected Buffer"));var m=null!=f?f:e.position,E=Math.max(a.length,m+o),w=n.alloc(E);a&&a.copy(w),i.copy(w,m,u,u+o),void 0===f&&(e.position+=o),r.size=E,r.version+=1,t.putBuffer(r.data,w,d)}}t.getObject(e.id,function(n,e){n?s(n):(r=e,t.getBuffer(r.data,m))})}function U(n,t,e,i,u,o,f){var s,r;function a(n,s){if(n)f(n);else{if(!(r=s))return f(new h.EIO("Expected Buffer"));var a=null!=o?o:t.position;u=a+u>e.length?u-a:u,r.copy(e,i,a,a+u),void 0===o&&(t.position+=u),f(null,u)}}n.getObject(t.id,function(e,i){e?f(e):i.type===c?f(new h.EISDIR("the named file is a directory",t.path)):(s=i,n.getBuffer(s.data,a))})}function G(n,t,e){_(n,t=i(t),e)}function W(n,t,e){t.getNode(n,e)}function H(n,t,e){t=i(t);var f,s,r=o(t),a=u(t);function c(i,u){i?e(i):(s=u).hasOwnProperty(r)?n.getObject(s[r].id,e):e(new h.ENOENT("a component of the path does not name an existing file",t))}E===r?_(n,t,e):_(n,a,function(t,i){t?e(t):(f=i,n.getObject(f.data,c))})}function $(n,t,e,f){t=i(t);var s=o(t),r=u(t);e=i(e);var a,p,d,m,E,w,O=o(e),l=u(e),g=Date.now();function v(t){t?f(t):P(n,e,w,{ctime:g},f)}function y(t,e){t?f(t):((w=e).nlinks+=1,n.putObject(w.id,w,v))}function N(t){t?f(t):n.getObject(E,y)}function A(t,e){t?f(t):(m=e).hasOwnProperty(O)?f(new h.EEXIST("newpath resolves to an existing file",O)):(m[O]=p[s],E=m[O].id,n.putObject(d.data,m,N))}function D(t,e){t?f(t):(d=e,n.getObject(d.data,A))}function I(t,e){t?f(t):(p=e).hasOwnProperty(s)?p[s].type===c?f(new h.EPERM("oldpath refers to a directory")):_(n,l,D):f(new h.ENOENT("a component of either path prefix does not exist",s))}_(n,r,function(t,e){t?f(t):(a=e,n.getObject(a.data,I))})}function J(n,t,e){t=i(t);var f,s,r,a=o(t),p=u(t);function d(t){t?e(t):(delete s[a],n.putObject(f.data,s,function(t){if(t)e(t);else{var i=Date.now();P(n,p,f,{mtime:i,ctime:i},e)}}))}function m(t){t?e(t):n.delete(r.data,d)}function E(i,u){i?e(i):u.type===c?e(new h.EPERM("unlink not permitted on directories",a)):function(i,u){i?e(i):((r=u).nlinks-=1,r.nlinks<1?n.delete(r.id,m):n.putObject(r.id,r,function(i){i?e(i):P(n,t,r,{ctime:Date.now()},d)}))}(null,u)}function w(t,i){t?e(t):(s=i).hasOwnProperty(a)?n.getObject(s[a].id,E):e(new h.ENOENT("a component of the path does not name an existing file",a))}_(n,p,function(t,i){t?e(t):(f=i,n.getObject(f.data,w))})}function Q(n,t,e){var u,o;function f(n,t){if(n)e(n);else{o=t;var i=Object.keys(o);e(null,i)}}t=i(t),_(n,t,function(i,o){i?e(i):o.type!==c?e(new h.ENOTDIR(null,t)):(u=o,n.getObject(u.data,f))})}function Z(n,t,s,r){s=i(s);var a,c,d,m=o(s),w=u(s);function O(i,u){i?r(i):(c=u).hasOwnProperty(m)?r(new h.EEXIST(null,m)):V.create({guid:n.guid,type:p},function(i,u){i?r(i):((d=u).nlinks+=1,f(t)||(d.symlink_relpath=t,t=e.resolve(w,t)),d.size=t.length,d.data=t,n.putObject(d.id,d,g))})}function l(t){if(t)r(t);else{var e=Date.now();P(n,w,a,{mtime:e,ctime:e},r)}}function g(t){t?r(t):(c[m]=new b(d.id,p),n.putObject(a.data,c,l))}E===m?r(new h.EEXIST(null,m)):_(n,w,function(t,e){t?r(t):(a=e,n.getObject(a.data,O))})}function k(n,t,e){t=i(t);var f,s,r=o(t),a=u(t);function c(t,i){t?e(t):(s=i).hasOwnProperty(r)?n.getObject(s[r].id,d):e(new h.ENOENT("a component of the path does not name an existing file",r))}function d(n,i){if(n)e(n);else if(i.type!==p)e(new h.EINVAL("path not a symbolic link",t));else{var u=i.symlink_relpath?i.symlink_relpath:i.data;e(null,u)}}_(n,a,function(t,i){t?e(t):(f=i,n.getObject(f.data,c))})}function nn(t,e,u,o){var f;function s(e,i){if(e)o(e);else{if(!i)return o(new h.EIO("Expected Buffer"));var s=n.alloc(u);i&&i.copy(s),t.putBuffer(f.data,s,a)}}function r(n){if(n)o(n);else{var i=Date.now();P(t,e,f,{mtime:i,ctime:i},o)}}function a(n){n?o(n):(f.size=u,f.version+=1,t.putObject(f.id,f,r))}e=i(e),u<0?o(new h.EINVAL("length cannot be negative")):_(t,e,function(n,i){n?o(n):i.type===c?o(new h.EISDIR(null,e)):(f=i,t.getBuffer(f.data,s))})}function tn(t,e,i,u){var o;function f(e,f){if(e)u(e);else{var s;if(!f)return u(new h.EIO("Expected Buffer"));s=f?f.slice(0,i):n.alloc(i),t.putBuffer(o.data,s,r)}}function s(n){if(n)u(n);else{var i=Date.now();P(t,e.path,o,{mtime:i,ctime:i},u)}}function r(n){n?u(n):(o.size=i,o.version+=1,t.putObject(o.id,o,s))}i<0?u(new h.EINVAL("length cannot be negative")):e.getNode(t,function(n,e){n?u(n):e.type===c?u(new h.EISDIR):(o=e,t.getBuffer(o.data,f))})}function en(n,t,e,u,o){t=i(t),"number"!=typeof e||"number"!=typeof u?o(new h.EINVAL("atime and mtime must be number",t)):e<0||u<0?o(new h.EINVAL("atime and mtime must be positive integers",t)):_(n,t,function(i,f){i?o(i):P(n,t,f,{atime:e,ctime:u,mtime:u},o)})}function un(n,t,e,i,u){"number"!=typeof e||"number"!=typeof i?u(new h.EINVAL("atime and mtime must be a number")):e<0||i<0?u(new h.EINVAL("atime and mtime must be positive integers")):t.getNode(n,function(o,f){o?u(o):P(n,t.path,f,{atime:e,ctime:i,mtime:i},u)})}function on(n,t,e,u,o,f){t=i(t),"string"!=typeof e?f(new h.EINVAL("attribute name must be a string",t)):e?null!==o&&o!==D&&o!==I?f(new h.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",t)):_(n,t,function(i,s){if(i)return f(i);x(n,t,s,e,u,o,f)}):f(new h.EINVAL("attribute name cannot be an empty string",t))}function fn(n,t,e,i,u,o){"string"!=typeof e?o(new h.EINVAL("attribute name must be a string")):e?null!==u&&u!==D&&u!==I?o(new h.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):t.getNode(n,function(f,s){if(f)return o(f);x(n,t.path,s,e,i,u,o)}):o(new h.EINVAL("attribute name cannot be an empty string"))}function sn(n,t,e,u){t=i(t),"string"!=typeof e?u(new h.EINVAL("attribute name must be a string",t)):e?_(n,t,function(n,i){if(n)return u(n);var o=i.xattrs;o.hasOwnProperty(e)?u(null,o[e]):u(new h.ENOATTR(null,t))}):u(new h.EINVAL("attribute name cannot be an empty string",t))}function rn(n,t,e,i){"string"!=typeof e?i(new h.EINVAL):e?t.getNode(n,function(n,t){if(n)return i(n);var u=t.xattrs;u.hasOwnProperty(e)?i(null,u[e]):i(new h.ENOATTR)}):i(new h.EINVAL("attribute name cannot be an empty string"))}function an(n,t,e,u){t=i(t),"string"!=typeof e?u(new h.EINVAL("attribute name must be a string",t)):e?_(n,t,function(i,o){if(i)return u(i);var f=o.xattrs;f.hasOwnProperty(e)?(delete f[e],n.putObject(o.id,o,function(e){e?u(e):P(n,t,o,{ctime:Date.now()},u)})):u(new h.ENOATTR(null,t))}):u(new h.EINVAL("attribute name cannot be an empty string",t))}function cn(n,t,e,i){"string"!=typeof e?i(new h.EINVAL("attribute name must be a string")):e?t.getNode(n,function(u,o){if(u)return i(u);var f=o.xattrs;f.hasOwnProperty(e)?(delete f[e],n.putObject(o.id,o,function(e){e?i(e):P(n,t.path,o,{ctime:Date.now()},i)})):i(new h.ENOATTR)}):i(new h.EINVAL("attribute name cannot be an empty string"))}function pn(n){return A.hasOwnProperty(n)?A[n]:null}function dn(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 mn(n,t,e,i,u){if(arguments.length<5?(u=arguments[arguments.length-1],i=420):i=Pn(i,m,u),!(e=pn(e)))return u(new h.EINVAL("flags is not valid"),t);z(n,t,e,i,function(n,i){if(n)u(n);else{var o;o=e.includes(N)?i.size:0;var f=new R(t,i.id,e,o),s=L.allocDescriptor(f);u(null,s)}})}function En(n,t,e){L.getOpenFileDescription(t)?(L.releaseDescriptor(t),e(null)):e(new h.EBADF)}function wn(n,t,e,i){S(n,t,e,i)}function On(n,t,e,i){if(arguments.length<4)i=e,e=m;else if(!(e=Pn(e,m,i)))return;X(n,t,i)}function ln(n,t,e,i){"function"==typeof e&&(i=e,e=r.fsConstants.F_OK),q(n,t,e|=r.fsConstants.F_OK,i)}function gn(n,t,e,i){if(i=arguments[arguments.length-1],!t)return i(new Error("filename prefix is required"));var u=t+"-"+s.randomChars(6);X(n,u,function(n){i(n,u)})}function vn(n,t,e){M(n,t,e)}function yn(n,t,e){G(n,t,function(i,u){if(i)e(i);else{var o=new B(t,u,n.name);e(null,o)}})}function Nn(n,t,e){var i=L.getOpenFileDescription(t);i?W(n,i,function(t,u){if(t)e(t);else{var o=new B(i.path,u,n.name);e(null,o)}}):e(new h.EBADF)}function An(n,t,e,i){$(n,t,e,i)}function Dn(n,t,e){J(n,t,e)}function In(n,t,e,i,u,o,f){i=void 0===i?0:i,u=void 0===u?e.length-i:u,f=arguments[arguments.length-1];var s=L.getOpenFileDescription(t);s?s.flags.includes(l)?U(n,s,e,i,u,o,function(n,t){f(n,t||0,e)}):f(new h.EBADF("descriptor does not permit reading")):f(new h.EBADF)}function jn(n,t,e){Fn(t,e)===t&&(L.getOpenFileDescription(t)?e():e(new h.EBADF))}function Tn(t,e,i,u){u=arguments[arguments.length-1];var o=pn((i=dn(i,null,"r")).flag||"r");if(!o)return u(new h.EINVAL("flags is not valid",e));z(t,e,o,function(f,s){if(f)return u(f);var r=new R(e,s.id,o,0),a=L.allocDescriptor(r);function c(){L.releaseDescriptor(a)}W(t,r,function(o,f){if(o)return c(),u(o);var s=new B(r.path,f,t.name);if(s.isDirectory())return c(),u(new h.EISDIR("illegal operation on directory",e));var a=s.size,p=n.alloc(a);U(t,r,p,0,a,0,function(n){if(c(),n)return u(n);var t;t="utf8"===i.encoding?p.toString("utf8"):p,u(null,t)})})})}function hn(n,t,e,i,u,o,f){f=arguments[arguments.length-1],i=void 0===i?0:i,u=void 0===u?e.length-i:u;var s=L.getOpenFileDescription(t);s?s.flags.includes(g)?e.length-i<u?f(new h.EIO("input buffer is too small")):K(n,s,e,i,u,o,f):f(new h.EBADF("descriptor does not permit writing")):f(new h.EBADF)}function bn(t,e,i,u,o){o=arguments[arguments.length-1];var f=pn((u=dn(u,"utf8","w")).flag||"w");if(!f)return o(new h.EINVAL("flags is not valid",e));"number"==typeof(i=i||"")&&(i=""+i),"string"==typeof i&&"utf8"===u.encoding&&(i=n.from(i)),z(t,e,f,function(n,u){if(n)return o(n);var s=new R(e,u.id,f,0),r=L.allocDescriptor(s);Y(t,s,i,0,i.length,function(n){if(L.releaseDescriptor(r),n)return o(n);o(null)})})}function Ln(t,e,i,u,o){o=arguments[arguments.length-1];var f=pn((u=dn(u,"utf8","a")).flag||"a");if(!f)return o(new h.EINVAL("flags is not valid",e));"number"==typeof(i=i||"")&&(i=""+i),"string"==typeof i&&"utf8"===u.encoding&&(i=n.from(i)),z(t,e,f,function(n,u){if(n)return o(n);var s=new R(e,u.id,f,u.size),r=L.allocDescriptor(s);K(t,s,i,0,i.length,s.position,function(n){if(L.releaseDescriptor(r),n)return o(n);o(null)})})}function Rn(n,t,e){yn(n,t,function(n){e(!n)})}function Fn(n,t){if("number"==typeof n)return n;t(new h.EINVAL("Expected integer",n))}var Vn=/^[0-7]+$/;function Bn(n){return n===n>>>0}function Pn(n,t,e){return"function"==typeof t&&(e=t,t=void 0),Bn(n)?n&m:"number"==typeof n?(Number.isInteger(n),e(new h.EINVAL("mode not a valid an integer value",n)),!1):"string"==typeof n?Vn.test(n)?parseInt(n,8)&m:(e(new h.EINVAL("mode not a valid octal string",n)),!1):void 0!==t?t:(e(new h.EINVAL("mode not valid",n)),!1)}function Sn(n,t,e,u){t=i(t),"number"!=typeof e?u(new h.EINVAL("mode must be number",t)):_(n,t,function(i,o){i?u(i):(o.mode=e,P(n,t,o,{mtime:Date.now()},u))})}function _n(n,t,e,i){"number"!=typeof e?i(new h.EINVAL("mode must be a number")):t.getNode(n,function(u,o){u?i(u):(o.mode=e,P(n,t.path,o,{mtime:Date.now()},i))})}function xn(n,t,e,u,o){t=i(t),_(n,t,function(i,f){i?o(i):(f.uid=e,f.gid=u,P(n,t,f,{mtime:Date.now()},o))})}function Cn(n,t,e,i,u){t.getNode(n,function(o,f){o?u(o):(f.uid=e,f.gid=i,P(n,t.path,f,{mtime:Date.now()},u))})}function Xn(n,t,e,i){sn(n,t,e,i)}function qn(n,t,e,i){var u=L.getOpenFileDescription(t);u?rn(n,u,e,i):i(new h.EBADF)}function Mn(n,t,e,i,u,o){"function"==typeof u&&(o=u,u=null),on(n,t,e,i,u,o)}function zn(n,t,e,i,u,o){"function"==typeof u&&(o=u,u=null);var f=L.getOpenFileDescription(t);f?f.flags.includes(g)?fn(n,f,e,i,u,o):o(new h.EBADF("descriptor does not permit writing")):o(new h.EBADF)}function Yn(n,t,e,i){an(n,t,e,i)}function Kn(n,t,e,i){var u=L.getOpenFileDescription(t);u?u.flags.includes(g)?cn(n,u,e,i):i(new h.EBADF("descriptor does not permit writing")):i(new h.EBADF)}function Un(n,t,e,i,u){var o=L.getOpenFileDescription(t);o||u(new h.EBADF),"SET"===i?e<0?u(new h.EINVAL("resulting file offset would be negative")):(o.position=e,u(null,o.position)):"CUR"===i?o.position+e<0?u(new h.EINVAL("resulting file offset would be negative")):(o.position+=e,u(null,o.position)):"END"===i?W(n,o,function(n,t){n?u(n):t.size+e<0?u(new h.EINVAL("resulting file offset would be negative")):(o.position=t.size+e,u(null,o.position))}):u(new h.EINVAL("whence argument is not a proper value"))}function Gn(n,t,e){Q(n,t,e)}function Wn(n){return"number"==typeof n?n:"object"===t(n)&&"function"==typeof n.getTime?n.getTime():void 0}function Hn(n,t,e,i,u){var o=Date.now();en(n,t,e=Wn(e||o),i=Wn(i||o),u)}function $n(n,t,e,i,u){var o=Date.now();e=Wn(e||o),i=Wn(i||o);var f=L.getOpenFileDescription(t);f?f.flags.includes(g)?un(n,f,e,i,u):u(new h.EBADF("descriptor does not permit writing")):u(new h.EBADF)}function Jn(n,t,e,i){(e=Pn(e,i))&&Sn(n,t,e,i)}function Qn(n,t,e,i){if(e=Pn(e,i)){var u=L.getOpenFileDescription(t);u?u.flags.includes(g)?_n(n,u,e,i):i(new h.EBADF("descriptor does not permit writing")):i(new h.EBADF)}}function Zn(n,t,e,i,u){return Bn(e)?Bn(i)?void xn(n,t,e,i,u):u(new h.EINVAL("gid must be a valid integer",i)):u(new h.EINVAL("uid must be a valid integer",e))}function kn(n,t,e,i,u){if(!Bn(e))return u(new h.EINVAL("uid must be a valid integer",e));if(!Bn(i))return u(new h.EINVAL("gid must be a valid integer",i));var o=L.getOpenFileDescription(t);o?o.flags.includes(g)?Cn(n,o,e,i,u):u(new h.EBADF("descriptor does not permit writing")):u(new h.EBADF)}function nt(n,t,u,o){t=i(t),u=i(u);var f,s,r,a,p=e.dirname(t),d=e.dirname(t),m=e.basename(t),E=e.basename(u),w=Date.now();function O(t,e){t?o(t):P(n,u,e,{ctime:w},o)}function l(t){t?o(t):n.getObject(a[E].id,O)}function g(t){t?o(t):(f.id===r.id&&(s=a),delete s[m],n.putObject(f.data,s,l))}function v(t){t?o(t):(a[E]=s[m],n.putObject(r.data,a,g))}function y(t,e){t?o(t):(a=e).hasOwnProperty(E)?M(n,u,v):v()}function N(t,e){t?o(t):(r=e,n.getObject(r.data,y))}function A(t,e){t?o(t):(s=e,_(n,d,N))}function D(t,e){t?o(t):(f=e,n.getObject(e.data,A))}function I(e){e?o(e):J(n,t,o)}_(n,t,function(e,i){e?o(e):i.type===c?_(n,p,D):$(n,t,u,I)})}function tt(n,t,e,i,u){Z(n,t,e,u=arguments[arguments.length-1])}function et(n,t,e){k(n,t,e)}function it(n,t,e){H(n,t,function(i,u){if(i)e(i);else{var o=new B(t,u,n.name);e(null,o)}})}function ut(n,t,e,i){Fn(e=e||0,i=arguments[arguments.length-1])===e&&nn(n,t,e,i)}function ot(n,t,e,i){i=arguments[arguments.length-1],e=e||0;var u=L.getOpenFileDescription(t);if(u)if(u.flags.includes(g)){if(Fn(e,i)!==e)return;tn(n,u,e,i)}else i(new h.EBADF("descriptor does not permit writing"));else i(new h.EBADF)}module.exports={appendFile:Ln,access:ln,chown:Zn,chmod:Jn,close:En,ensureRootDirectory:C,exists:Rn,fchown:kn,fchmod:Qn,fgetxattr:qn,fremovexattr:Kn,fsetxattr:zn,fstat:Nn,fsync:jn,ftruncate:ot,futimes:$n,getxattr:Xn,link:An,lseek:Un,lstat:it,mkdir:On,mkdtemp:gn,mknod:wn,open:mn,readdir:Gn,read:In,readFile:Tn,readlink:et,removexattr:Yn,rename:nt,rmdir:vn,setxattr:Mn,stat:yn,symlink:tt,truncate:ut,unlink:Dn,utimes:Hn,writeFile:bn,write:hn};
},{"../path.js":"8thZ","../shared.js":"zFPO","../constants.js":"gCho","../errors.js":"Hmaa","../directory-entry.js":"RlAD","../open-files.js":"U1jA","../open-file-description.js":"E+68","../super-node.js":"3YM/","../node.js":"epsH","../stats.js":"OfGU","buffer":"dskh"}],"Q4+W":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer,r=require("es6-promisify"),t=r.promisify,n=require("../path.js"),a=require("../providers/index.js"),s=require("../shell/shell.js"),o=require("../../lib/intercom.js"),i=require("../fs-watcher.js"),u=require("../errors.js"),m=require("../shared.js"),c=m.nop,f=m.guid,l=require("../constants.js"),h=l.fsConstants,p=l.FILE_SYSTEM_NAME,d=l.FS_FORMAT,g=l.FS_READY,b=l.FS_PENDING,A=l.FS_ERROR,P=l.FS_NODUPEIDCHECK,v=l.STDIN,y=l.STDOUT,E=l.STDERR,R=require("./implementation.js");function w(e){return"function"==typeof e?e:function(e){if(e)throw e}}function S(e){e&&console.error("Filer error: ",e)}function O(e){if(!(e&&e.protocol&&e.pathname))return e;if("file:"!==e.protocol)throw new u.EINVAL("only file: URLs are supported for paths",e);for(var r=e.pathname,t=0;t<r.length;t++)if("%"===r[t]){var n=32|r.codePointAt(t+2);if("2"===r[t+1]&&102===n)throw new u.EINVAL("file: URLs must not include encoded / characters",e)}return decodeURIComponent(r)}function x(r){return e.isBuffer(r)?r.toString():r}function F(e,r){return e?n.isNull(e)?new u.EINVAL("Path must be a string without null bytes.",e):r||n.isAbsolute(e)?void 0:new u.EINVAL("Path must be absolute.",e):new u.EINVAL("Path must be a string",e)}function _(e,r,t){var n=e[r],a=F(n=x(n=O(n)),t);if(a)throw a;e[r]=n}function q(e,r){r=r||S;var m=(e=e||{}).flags||[],l=e.guid?e.guid:f,O=e.provider||new a.Default(e.name||p),x=e.name||O.name,F=m.includes(d),I=this;I.readyState=b,I.name=x,I.error=null,I.stdin=v,I.stdout=y,I.stderr=E,I.constants=h,I.F_OK=h.F_OK,I.R_OK=h.R_OK,I.W_OK=h.W_OK,I.X_OK=h.X_OK,this.Shell=s.bind(void 0,this);var N=[];function j(e){return function(r){m.includes(P)?r(null,l()):function r(t){var n=l();e.getObject(n,function(e,a){e?t(e):a?r(t):t(null,n)})}(r)}}this.queueOrRun=function(e){var r;return g===I.readyState?e.call(I):A===I.readyState?r=new u.EFILESYSTEMERROR("unknown error"):N.push(e),r},this.watch=function(e,r,t){if(n.isNull(e))throw new Error("Path must be a string without null bytes.");"function"==typeof r&&(t=r,r={}),r=r||{},t=t||c;var a=new i;return a.start(e,!1,r.recursive),a.on("change",t),a},O.open(function(e){function t(e){function t(e){var r=O[e]();return r.name=x,r.flags=m,r.changes=[],r.guid=j(r),r.close=function(){var e=r.changes;!function(e){if(e.length){var r=o.getInstance();e.forEach(function(e){r.emit(e.event,e.path)})}}(e),e.length=0},r}I.provider={openReadWriteContext:function(){return t("getReadWriteContext")},openReadOnlyContext:function(){return t("getReadOnlyContext")}},I.readyState=e?A:g,N.forEach(function(e){e.call(this)}.bind(I)),N=null,r(e,I)}if(e)return t(e);var n=O.getReadWriteContext();n.guid=j(n),F?n.clear(function(e){if(e)return t(e);R.ensureRootDirectory(n,t)}):R.ensureRootDirectory(n,t)}),q.prototype.promises={},[{name:"appendFile",promises:!0,absPathArgs:[0]},{name:"access",promises:!0,absPathArgs:[0]},{name:"chown",promises:!0,absPathArgs:[0]},{name:"chmod",promises:!0,absPathArgs:[0]},{name:"close"},{name:"exists",absPathArgs:[0]},{name:"fchown"},{name:"fchmod"},{name:"fgetxattr"},{name:"fremovexattr"},{name:"fsetxattr"},{name:"fstat"},{name:"fsync"},{name:"ftruncate"},{name:"futimes"},{name:"getxattr",promises:!0,absPathArgs:[0]},{name:"link",promises:!0,absPathArgs:[0,1]},{name:"lseek"},{name:"lstat",promises:!0},{name:"mkdir",promises:!0,absPathArgs:[0]},{name:"mkdtemp",promises:!0},{name:"mknod",promises:!0,absPathArgs:[0]},{name:"open",promises:!0,absPathArgs:[0]},{name:"readdir",promises:!0,absPathArgs:[0]},{name:"read"},{name:"readFile",promises:!0,absPathArgs:[0]},{name:"readlink",promises:!0,absPathArgs:[0]},{name:"removexattr",promises:!0,absPathArgs:[0]},{name:"rename",promises:!0,absPathArgs:[0,1]},{name:"rmdir",promises:!0,absPathArgs:[0]},{name:"setxattr",promises:!0,absPathArgs:[0]},{name:"stat",promises:!0,absPathArgs:[0]},{name:"symlink",promises:!0,relPathArgs:[0],absPathArgs:[1]},{name:"truncate",promises:!0,absPathArgs:[0]},{name:"unlink",promises:!0,absPathArgs:[0]},{name:"utimes",promises:!0,absPathArgs:[0]},{name:"writeFile",promises:!0,absPathArgs:[0]},{name:"write"}].forEach(function(e){var r=e.name,n=!0===e.promises;q.prototype[r]=function(){var t=this,n=Array.prototype.slice.call(arguments,0),a=n.length-1,s="function"!=typeof n[a],o=w(n[a]);e.absPathArgs&&e.absPathArgs.forEach(function(e){return _(n,e,!1)}),e.relPathArgs&&e.relPathArgs.forEach(function(e){return _(n,e,!0)});var i=t.queueOrRun(function(){var e=t.provider.openReadWriteContext();if(A===t.readyState){var i=new u.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return o.call(t,i)}function m(){e.close(),o.apply(t,arguments)}s?n.push(m):n[a]=m;var c=[e].concat(n);R[r].apply(null,c)});i&&o(i)},n&&(q.prototype.promises[r]=t(q.prototype[r].bind(I)))})}q.providers=a,module.exports=q;
},{"es6-promisify":"0c0E","../path.js":"8thZ","../providers/index.js":"UCG6","../shell/shell.js":"Kf0M","../../lib/intercom.js":"u7Jv","../fs-watcher.js":"p3D+","../errors.js":"Hmaa","../shared.js":"zFPO","../constants.js":"gCho","./implementation.js":"HvxC","buffer":"dskh"}],"2u/B":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer,r=null,l=null;module.exports=l={FileSystem:require("./filesystem/interface.js"),Buffer:e,Path:require("./path.js"),path:require("./path.js"),Errors:require("./errors.js"),Shell:require("./shell/shell.js")},Object.defineProperty(l,"fs",{enumerable:!0,get:function(){return r||(r=new l.FileSystem),r}});
},{"./filesystem/interface.js":"Q4+W","./path.js":"8thZ","./errors.js":"Hmaa","./shell/shell.js":"Kf0M","buffer":"dskh"}]},{},["2u/B"], "Filer")