filer/dist/filer.min.js

83 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"}],"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};
},{}],"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 global = arguments[3];
var Buffer = require("buffer").Buffer;
var t=arguments[3],e=require("buffer").Buffer,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,c=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB;function i(t,e){this.db=t,this.mode=e}function s(t){this.name=t||r,this.db=null}i.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},i.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)}},i.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)}},i.prototype.getObject=function(t,e){this._get(t,e)},i.prototype.getBuffer=function(t,r){this._get(t,function(t,n){if(t)return r(t);r(null,e.from(n))})},i.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)}},i.prototype.putObject=function(t,e,r){this._put(t,e,r)},i.prototype.putBuffer=function(t,e,r){var n=e.buffer;this._put(t,n,r)},i.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)}},s.isSupported=function(){return!!c},s.prototype.open=function(t){var e=this;if(e.db)return t();try{var r=c.open(e.name);r.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(n)&&e.deleteObjectStore(n),e.createObjectStore(n)},r.onsuccess=function(r){e.db=r.target.result,t()},r.onerror=function(e){e.preventDefault(),t(e.error)}}catch(o){t(o)}},s.prototype.getReadOnlyContext=function(){return new i(this.db,u)},s.prototype.getReadWriteContext=function(){return new i(this.db,o)},module.exports=s;
},{"../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) {
var t=require("../constants.js").ENVIRONMENT;module.exports=function(n){(n=n||{}).TMP=n.TMP||t.TMP,n.PATH=n.PATH||t.PATH,this.get=function(t){return n[t]},this.set=function(t,e){n[t]=e}};
},{"../constants.js":"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;
},{}],"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"}],"u0zp":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer;module.exports={encode:function(r){return e.from(r)},decode:function(e){return e.toString("utf8")}};
},{"buffer":"dskh"}],"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) {
var t=require("./constants.js"),i=require("./path.js");function e(t){return new Date(1e3*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,o=e.dirname,u=e.basename,f=e.isAbsolute,s=require("../shared.js"),r=require("../constants.js"),a=r.NODE_TYPE_FILE,c=r.NODE_TYPE_DIRECTORY,d=r.NODE_TYPE_SYMBOLIC_LINK,p=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("../encoding.js"),b=require("../errors.js"),L=require("../directory-entry.js"),R=require("../open-files.js"),F=require("../open-file-description.js"),V=require("../super-node.js"),B=require("../node.js"),P=require("../stats.js");function S(n,t,e,i,o){var u=n.flags;u.includes(T)&&delete i.ctime,u.includes(j)&&delete i.mtime;var f=!1;function s(e){n.changes.push({event:"change",path:t}),o(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 _(n,t,e,f){if(e!==c&&e!==a)return f(new b.EINVAL("type must be a directory or file",t));t=i(t);var s,r,d,p=u(t),m=o(t);function E(e,i){!e&&i?f(new b.EEXIST("path name already exists",t)):!e||e instanceof b.ENOENT?n.getObject(s.data,w):f(e)}function w(t,i){t?f(t):(r=i,B.create({guid:n.guid,type:e},function(t,e){t?f(t):((d=e).nlinks+=1,n.putObject(d.id,d,l))}))}function O(t){if(t)f(t);else{var e=Date.now();S(n,m,d,{mtime:e,ctime:e},f)}}function l(t){t?f(t):(r[p]=new L(d.id,e),n.putObject(s.data,r,O))}x(n,m,function(e,i){e?f(e):i.type!==c?f(new b.ENOTDIR("a component of the path prefix is not a directory",t)):(s=i,x(n,t,E))})}function x(n,t,e){if(!(t=i(t)))return e(new b.ENOENT("path is an empty string"));var f=u(t),s=o(t),r=0;function a(t,i){if(t)return e(t);var o=new V(i);o&&o.type===p&&o.rnode?n.getObject(o.rnode,m):e(new b.EFILESYSTEMERROR)}function m(n,t){n?e(n):t?B.create(t,e):e(new b.ENOENT)}function l(i,o){i?e(i):o.type===c&&o.data?n.getObject(o.data,g):e(new b.ENOTDIR("a component of the path prefix is not a directory",t))}function g(i,o){if(i)e(i);else if(o.hasOwnProperty(f)){var u=o[f].id;n.getObject(u,v)}else e(new b.ENOENT(null,t))}function v(n,t){if(n)return e(n);B.create(t,y)}function y(c,p){var m;c?e(c):p.type===d?++r>O?e(new b.ELOOP(null,t)):(m=p.data,m=i(m),s=o(m),f=u(m),E===f?n.getObject(w,a):x(n,s,l)):e(null,p)}E===f?n.getObject(w,a):x(n,s,l)}function C(n,t,e,i,o,u,f){var s=e.xattrs;u===D&&s.hasOwnProperty(i)?f(new b.EEXIST("attribute already exists",t)):u!==I||s.hasOwnProperty(i)?(s[i]=o,n.putObject(e.id,e,function(i){i?f(i):S(n,t,e,{ctime:Date.now()},f)})):f(new b.ENOATTR(null,t))}function X(n,t){var e,i,o;function u(o){o?t(o):B.create({guid:n.guid,id:e.rnode,type:c},function(e,o){e?t(e):((i=o).nlinks+=1,n.putObject(i.id,i,f))})}function f(e){e?t(e):(o={},n.putObject(i.data,o,t))}n.getObject(w,function(i,o){!i&&o?t():!i||i instanceof b.ENOENT?V.create({guid:n.guid},function(i,o){i?t(i):(e=o,n.putObject(e.id,e,u))}):t(i)})}function q(n,t,e){t=i(t);var f,s,r,a,d=u(t),p=o(t);function m(t,i){t?e(t):(r=i,n.getObject(r.data,E))}function E(t,i){t?e(t):(a=i,B.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();S(n,p,r,{mtime:i,ctime:i},e)}}function l(t){t?e(t):(a[d]=new L(f.id,c),n.putObject(r.data,a,O))}x(n,t,function(i,o){!i&&o?e(new b.EEXIST(null,t)):!i||i instanceof b.ENOENT?x(n,p,m):e(i)})}function M(n,t,e,o){var u=r.fsConstants,f=u.F_OK,s=u.R_OK,a=u.W_OK,c=u.X_OK,d=u.S_IXUSR,p=u.S_IXGRP,m=u.S_IXOTH;x(n,t=i(t),function(n,i){if(n)return o(n);if(e===f)return o(null);var u=Sn(i.mode,o);return u?e&(s|a)?o(null):e&c&&u&(d|p|m)?o(null):void o(new b.EACCES("permission denied",t)):void 0})}function z(n,t,e){t=i(t);var f,s,r,a,d=u(t),p=o(t);function m(i,o){i?e(i):E===d?e(new b.EBUSY(null,t)):o.hasOwnProperty(d)?(f=(a=o)[d].id,n.getObject(f,w)):e(new b.ENOENT(null,t))}function w(i,o){i?e(i):o.type!==c?e(new b.ENOTDIR(null,t)):(f=o,n.getObject(f.data,O))}function O(i,o){i?e(i):(s=o,Object.keys(s).length>0?e(new b.ENOTEMPTY(null,t)):(delete a[d],n.putObject(r.data,a,l)))}function l(t){if(t)e(t);else{var i=Date.now();S(n,p,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)}x(n,p,function(t,i){t?e(t):(r=i,n.getObject(r.data,m))})}function Y(t,e,f,s,r){"function"==typeof s&&(r=s,s=null),e=i(e);var p,m,w,l,N,A=u(e),D=o(e),I=0;function j(n,i){n?r(n):i.type!==c?r(new b.ENOENT(null,e)):(p=i,t.getObject(p.data,T))}function T(n,i){n?r(n):(m=i).hasOwnProperty(A)?f.includes(y)?r(new b.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",e)):(w=m[A]).type===c&&f.includes(g)?r(new b.EISDIR("the named file is a directory and O_WRITE is set",e)):t.getObject(w.id,h):f.includes(v)?B.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 b.ENOENT("O_CREATE is not set and the named file does not exist",e))}function h(n,s){if(n)r(n);else{var a=s;a.type===d?++I>O?r(new b.ELOOP(null,e)):function(n){n=i(n),D=o(n),A=u(n),E===A&&(f.includes(g)?r(new b.EISDIR("the named file is a directory and O_WRITE is set",e)):x(t,e,R));x(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,P))}function V(n){if(n)r(n);else{var e=Date.now();S(t,D,p,{mtime:e,ctime:e},_)}}function P(n){n?r(n):(m[A]=new L(l.id,a),t.putObject(p.data,m,V))}function _(n){n?r(n):r(null,l)}E===A?f.includes(g)?r(new b.EISDIR("the named file is a directory and O_WRITE is set",e)):x(t,e,R):x(t,D,j)}function K(t,e,i,o,u,f){var s;function r(n){n?f(n):f(null,u)}function a(n){if(n)f(n);else{var i=Date.now();S(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 d=n.alloc(u);i.copy(d,0,o,o+u),e.position=u,s.size=u,s.version+=1,t.putBuffer(s.data,d,c)}})}function U(t,e,i,o,u,f,s){var r,a;function c(n){n?s(n):s(null,u)}function d(n){if(n)s(n);else{var i=Date.now();S(t,e.path,r,{mtime:i,ctime:i},c)}}function p(n){n?s(n):t.putObject(r.id,r,d)}function m(c,d){if(c)s(c);else{if(!(a=d))return s(new b.EIO("Expected Buffer"));var m=null!=f?f:e.position,E=Math.max(a.length,m+u),w=n.alloc(E);a&&a.copy(w),i.copy(w,m,o,o+u),void 0===f&&(e.position+=u),r.size=E,r.version+=1,t.putBuffer(r.data,w,p)}}t.getObject(e.id,function(n,e){n?s(n):(r=e,t.getBuffer(r.data,m))})}function G(n,t,e,i,o,u,f){var s,r;function a(n,s){if(n)f(n);else{if(!(r=s))return f(new b.EIO("Expected Buffer"));var a=null!=u?u:t.position;o=a+o>e.length?o-a:o,r.copy(e,i,a,a+o),void 0===u&&(t.position+=o),f(null,o)}}n.getObject(t.id,function(e,i){e?f(e):i.type===c?f(new b.EISDIR("the named file is a directory",t.path)):(s=i,n.getBuffer(s.data,a))})}function W(n,t,e){x(n,t=i(t),e)}function H(n,t,e){t.getNode(n,e)}function $(n,t,e){t=i(t);var f,s,r=u(t),a=o(t);function c(i,o){i?e(i):(s=o).hasOwnProperty(r)?n.getObject(s[r].id,e):e(new b.ENOENT("a component of the path does not name an existing file",t))}E===r?x(n,t,e):x(n,a,function(t,i){t?e(t):(f=i,n.getObject(f.data,c))})}function J(n,t,e,f){t=i(t);var s=u(t),r=o(t);e=i(e);var a,d,p,m,E,w,O=u(e),l=o(e),g=Date.now();function v(t){t?f(t):S(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 b.EEXIST("newpath resolves to an existing file",O)):(m[O]=d[s],E=m[O].id,n.putObject(p.data,m,N))}function D(t,e){t?f(t):(p=e,n.getObject(p.data,A))}function I(t,e){t?f(t):(d=e).hasOwnProperty(s)?d[s].type===c?f(new b.EPERM("oldpath refers to a directory")):x(n,l,D):f(new b.ENOENT("a component of either path prefix does not exist",s))}x(n,r,function(t,e){t?f(t):(a=e,n.getObject(a.data,I))})}function Q(n,t,e){t=i(t);var f,s,r,a=u(t),d=o(t);function p(t){t?e(t):(delete s[a],n.putObject(f.data,s,function(t){if(t)e(t);else{var i=Date.now();S(n,d,f,{mtime:i,ctime:i},e)}}))}function m(t){t?e(t):n.delete(r.data,p)}function E(i,o){i?e(i):o.type===c?e(new b.EPERM("unlink not permitted on directories",a)):function(i,o){i?e(i):((r=o).nlinks-=1,r.nlinks<1?n.delete(r.id,m):n.putObject(r.id,r,function(i){i?e(i):S(n,t,r,{ctime:Date.now()},p)}))}(null,o)}function w(t,i){t?e(t):(s=i).hasOwnProperty(a)?n.getObject(s[a].id,E):e(new b.ENOENT("a component of the path does not name an existing file",a))}x(n,d,function(t,i){t?e(t):(f=i,n.getObject(f.data,w))})}function Z(n,t,e){var o,u;function f(n,t){if(n)e(n);else{u=t;var i=Object.keys(u);e(null,i)}}t=i(t),x(n,t,function(i,u){i?e(i):u.type!==c?e(new b.ENOTDIR(null,t)):(o=u,n.getObject(o.data,f))})}function k(n,t,s,r){s=i(s);var a,c,p,m=u(s),w=o(s);function O(i,o){i?r(i):(c=o).hasOwnProperty(m)?r(new b.EEXIST(null,m)):B.create({guid:n.guid,type:d},function(i,o){i?r(i):((p=o).nlinks+=1,f(t)||(p.symlink_relpath=t,t=e.resolve(w,t)),p.size=t.length,p.data=t,n.putObject(p.id,p,g))})}function l(t){if(t)r(t);else{var e=Date.now();S(n,w,a,{mtime:e,ctime:e},r)}}function g(t){t?r(t):(c[m]=new L(p.id,d),n.putObject(a.data,c,l))}E===m?r(new b.EEXIST(null,m)):x(n,w,function(t,e){t?r(t):(a=e,n.getObject(a.data,O))})}function nn(n,t,e){t=i(t);var f,s,r=u(t),a=o(t);function c(t,i){t?e(t):(s=i).hasOwnProperty(r)?n.getObject(s[r].id,p):e(new b.ENOENT("a component of the path does not name an existing file",r))}function p(n,i){if(n)e(n);else if(i.type!==d)e(new b.EINVAL("path not a symbolic link",t));else{var o=i.symlink_relpath?i.symlink_relpath:i.data;e(null,o)}}x(n,a,function(t,i){t?e(t):(f=i,n.getObject(f.data,c))})}function tn(t,e,o,u){var f;function s(e,i){if(e)u(e);else{if(!i)return u(new b.EIO("Expected Buffer"));var s=n.alloc(o);i&&i.copy(s),t.putBuffer(f.data,s,a)}}function r(n){if(n)u(n);else{var i=Date.now();S(t,e,f,{mtime:i,ctime:i},u)}}function a(n){n?u(n):(f.size=o,f.version+=1,t.putObject(f.id,f,r))}e=i(e),o<0?u(new b.EINVAL("length cannot be negative")):x(t,e,function(n,i){n?u(n):i.type===c?u(new b.EISDIR(null,e)):(f=i,t.getBuffer(f.data,s))})}function en(t,e,i,o){var u;function f(e,f){if(e)o(e);else{var s;if(!f)return o(new b.EIO("Expected Buffer"));s=f?f.slice(0,i):n.alloc(i),t.putBuffer(u.data,s,r)}}function s(n){if(n)o(n);else{var i=Date.now();S(t,e.path,u,{mtime:i,ctime:i},o)}}function r(n){n?o(n):(u.size=i,u.version+=1,t.putObject(u.id,u,s))}i<0?o(new b.EINVAL("length cannot be negative")):e.getNode(t,function(n,e){n?o(n):e.type===c?o(new b.EISDIR):(u=e,t.getBuffer(u.data,f))})}function on(n,t,e,o,u){t=i(t),"number"!=typeof e||"number"!=typeof o?u(new b.EINVAL("atime and mtime must be number",t)):e<0||o<0?u(new b.EINVAL("atime and mtime must be positive integers",t)):x(n,t,function(i,f){i?u(i):S(n,t,f,{atime:e,ctime:o,mtime:o},u)})}function un(n,t,e,i,o){"number"!=typeof e||"number"!=typeof i?o(new b.EINVAL("atime and mtime must be a number")):e<0||i<0?o(new b.EINVAL("atime and mtime must be positive integers")):t.getNode(n,function(u,f){u?o(u):S(n,t.path,f,{atime:e,ctime:i,mtime:i},o)})}function fn(n,t,e,o,u,f){t=i(t),"string"!=typeof e?f(new b.EINVAL("attribute name must be a string",t)):e?null!==u&&u!==D&&u!==I?f(new b.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",t)):x(n,t,function(i,s){if(i)return f(i);C(n,t,s,e,o,u,f)}):f(new b.EINVAL("attribute name cannot be an empty string",t))}function sn(n,t,e,i,o,u){"string"!=typeof e?u(new b.EINVAL("attribute name must be a string")):e?null!==o&&o!==D&&o!==I?u(new b.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):t.getNode(n,function(f,s){if(f)return u(f);C(n,t.path,s,e,i,o,u)}):u(new b.EINVAL("attribute name cannot be an empty string"))}function rn(n,t,e,o){t=i(t),"string"!=typeof e?o(new b.EINVAL("attribute name must be a string",t)):e?x(n,t,function(n,i){if(n)return o(n);var u=i.xattrs;u.hasOwnProperty(e)?o(null,u[e]):o(new b.ENOATTR(null,t))}):o(new b.EINVAL("attribute name cannot be an empty string",t))}function an(n,t,e,i){"string"!=typeof e?i(new b.EINVAL):e?t.getNode(n,function(n,t){if(n)return i(n);var o=t.xattrs;o.hasOwnProperty(e)?i(null,o[e]):i(new b.ENOATTR)}):i(new b.EINVAL("attribute name cannot be an empty string"))}function cn(n,t,e,o){t=i(t),"string"!=typeof e?o(new b.EINVAL("attribute name must be a string",t)):e?x(n,t,function(i,u){if(i)return o(i);var f=u.xattrs;f.hasOwnProperty(e)?(delete f[e],n.putObject(u.id,u,function(e){e?o(e):S(n,t,u,{ctime:Date.now()},o)})):o(new b.ENOATTR(null,t))}):o(new b.EINVAL("attribute name cannot be an empty string",t))}function dn(n,t,e,i){"string"!=typeof e?i(new b.EINVAL("attribute name must be a string")):e?t.getNode(n,function(o,u){if(o)return i(o);var f=u.xattrs;f.hasOwnProperty(e)?(delete f[e],n.putObject(u.id,u,function(e){e?i(e):S(n,t.path,u,{ctime:Date.now()},i)})):i(new b.ENOATTR)}):i(new b.EINVAL("attribute name cannot be an empty string"))}function pn(n){return A.hasOwnProperty(n)?A[n]:null}function mn(n,t,e){return n?"function"==typeof n?n={encoding:t,flag:e}:"string"==typeof n&&(n={encoding:n,flag:e}):n={encoding:t,flag:e},n}function En(n,t,e,i,o){if(arguments.length<5?(o=arguments[arguments.length-1],i=420):i=Sn(i,m,o),!(e=pn(e)))return o(new b.EINVAL("flags is not valid"),t);Y(n,t,e,i,function(n,i){if(n)o(n);else{var u;u=e.includes(N)?i.size:0;var f=new F(t,i.id,e,u),s=R.allocDescriptor(f);o(null,s)}})}function wn(n,t,e){R.getOpenFileDescription(t)?(R.releaseDescriptor(t),e(null)):e(new b.EBADF)}function On(n,t,e,i){_(n,t,e,i)}function ln(n,t,e,i){if(arguments.length<4)i=e,e=m;else if(!(e=Sn(e,m,i)))return;q(n,t,i)}function gn(n,t,e,i){"function"==typeof e&&(i=e,e=r.fsConstants.F_OK),M(n,t,e|=r.fsConstants.F_OK,i)}function vn(n,t,e,i){if(i=arguments[arguments.length-1],!t)return i(new Error("filename prefix is required"));var o=t+"-"+s.randomChars(6);q(n,o,function(n){i(n,o)})}function yn(n,t,e){z(n,t,e)}function Nn(n,t,e){W(n,t,function(i,o){if(i)e(i);else{var u=new P(t,o,n.name);e(null,u)}})}function An(n,t,e){var i=R.getOpenFileDescription(t);i?H(n,i,function(t,o){if(t)e(t);else{var u=new P(i.path,o,n.name);e(null,u)}}):e(new b.EBADF)}function Dn(n,t,e,i){J(n,t,e,i)}function In(n,t,e){Q(n,t,e)}function jn(n,t,e,i,o,u,f){i=void 0===i?0:i,o=void 0===o?e.length-i:o,f=arguments[arguments.length-1];var s=R.getOpenFileDescription(t);s?s.flags.includes(l)?G(n,s,e,i,o,u,function(n,t){f(n,t||0,e)}):f(new b.EBADF("descriptor does not permit reading")):f(new b.EBADF)}function Tn(n,t,e){Vn(t,e)===t&&(R.getOpenFileDescription(t)?e():e(new b.EBADF))}function hn(t,e,i,o){o=arguments[arguments.length-1];var u=pn((i=mn(i,null,"r")).flag||"r");if(!u)return o(new b.EINVAL("flags is not valid",e));Y(t,e,u,function(f,s){if(f)return o(f);var r=new F(e,s.id,u,0),a=R.allocDescriptor(r);function c(){R.releaseDescriptor(a)}H(t,r,function(u,f){if(u)return c(),o(u);var s=new P(r.path,f,t.name);if(s.isDirectory())return c(),o(new b.EISDIR("illegal operation on directory",e));var a=s.size,d=n.alloc(a);G(t,r,d,0,a,0,function(n){if(c(),n)return o(n);var t;t="utf8"===i.encoding?h.decode(d):d,o(null,t)})})})}function bn(n,t,e,i,o,u,f){f=arguments[arguments.length-1],i=void 0===i?0:i,o=void 0===o?e.length-i:o;var s=R.getOpenFileDescription(t);s?s.flags.includes(g)?e.length-i<o?f(new b.EIO("input buffer is too small")):U(n,s,e,i,o,u,f):f(new b.EBADF("descriptor does not permit writing")):f(new b.EBADF)}function Ln(n,t,e,i,o){o=arguments[arguments.length-1];var u=pn((i=mn(i,"utf8","w")).flag||"w");if(!u)return o(new b.EINVAL("flags is not valid",t));"number"==typeof(e=e||"")&&(e=""+e),"string"==typeof e&&"utf8"===i.encoding&&(e=h.encode(e)),Y(n,t,u,function(i,f){if(i)return o(i);var s=new F(t,f.id,u,0),r=R.allocDescriptor(s);K(n,s,e,0,e.length,function(n){if(R.releaseDescriptor(r),n)return o(n);o(null)})})}function Rn(n,t,e,i,o){o=arguments[arguments.length-1];var u=pn((i=mn(i,"utf8","a")).flag||"a");if(!u)return o(new b.EINVAL("flags is not valid",t));"number"==typeof(e=e||"")&&(e=""+e),"string"==typeof e&&"utf8"===i.encoding&&(e=h.encode(e)),Y(n,t,u,function(i,f){if(i)return o(i);var s=new F(t,f.id,u,f.size),r=R.allocDescriptor(s);U(n,s,e,0,e.length,s.position,function(n){if(R.releaseDescriptor(r),n)return o(n);o(null)})})}function Fn(n,t,e){Nn(n,t,function(n){e(!n)})}function Vn(n,t){if("number"==typeof n)return n;t(new b.EINVAL("Expected integer",n))}var Bn=/^[0-7]+$/;function Pn(n){return n===n>>>0}function Sn(n,t,e){return"function"==typeof t&&(e=t,t=void 0),Pn(n)?n&m:"number"==typeof n?(Number.isInteger(n),e(new b.EINVAL("mode not a valid an integer value",n)),!1):"string"==typeof n?Bn.test(n)?parseInt(n,8)&m:(e(new b.EINVAL("mode not a valid octal string",n)),!1):void 0!==t?t:(e(new b.EINVAL("mode not valid",n)),!1)}function _n(n,t,e,o){t=i(t),"number"!=typeof e?o(new b.EINVAL("mode must be number",t)):x(n,t,function(i,u){i?o(i):(u.mode=e,S(n,t,u,{mtime:Date.now()},o))})}function xn(n,t,e,i){"number"!=typeof e?i(new b.EINVAL("mode must be a number")):t.getNode(n,function(o,u){o?i(o):(u.mode=e,S(n,t.path,u,{mtime:Date.now()},i))})}function Cn(n,t,e,o,u){t=i(t),x(n,t,function(i,f){i?u(i):(f.uid=e,f.gid=o,S(n,t,f,{mtime:Date.now()},u))})}function Xn(n,t,e,i,o){t.getNode(n,function(u,f){u?o(u):(f.uid=e,f.gid=i,S(n,t.path,f,{mtime:Date.now()},o))})}function qn(n,t,e,i){rn(n,t,e,i)}function Mn(n,t,e,i){var o=R.getOpenFileDescription(t);o?an(n,o,e,i):i(new b.EBADF)}function zn(n,t,e,i,o,u){"function"==typeof o&&(u=o,o=null),fn(n,t,e,i,o,u)}function Yn(n,t,e,i,o,u){"function"==typeof o&&(u=o,o=null);var f=R.getOpenFileDescription(t);f?f.flags.includes(g)?sn(n,f,e,i,o,u):u(new b.EBADF("descriptor does not permit writing")):u(new b.EBADF)}function Kn(n,t,e,i){cn(n,t,e,i)}function Un(n,t,e,i){var o=R.getOpenFileDescription(t);o?o.flags.includes(g)?dn(n,o,e,i):i(new b.EBADF("descriptor does not permit writing")):i(new b.EBADF)}function Gn(n,t,e,i,o){var u=R.getOpenFileDescription(t);u||o(new b.EBADF),"SET"===i?e<0?o(new b.EINVAL("resulting file offset would be negative")):(u.position=e,o(null,u.position)):"CUR"===i?u.position+e<0?o(new b.EINVAL("resulting file offset would be negative")):(u.position+=e,o(null,u.position)):"END"===i?H(n,u,function(n,t){n?o(n):t.size+e<0?o(new b.EINVAL("resulting file offset would be negative")):(u.position=t.size+e,o(null,u.position))}):o(new b.EINVAL("whence argument is not a proper value"))}function Wn(n,t,e){Z(n,t,e)}function Hn(n){return"number"==typeof n?n:"object"===t(n)&&"function"==typeof n.getTime?n.getTime()/1e3:void 0}function $n(n,t,e,i,o){var u=Date.now();on(n,t,e=Hn(e||u),i=Hn(i||u),o)}function Jn(n,t,e,i,o){var u=Date.now();e=Hn(e||u),i=Hn(i||u);var f=R.getOpenFileDescription(t);f?f.flags.includes(g)?un(n,f,e,i,o):o(new b.EBADF("descriptor does not permit writing")):o(new b.EBADF)}function Qn(n,t,e,i){(e=Sn(e,i))&&_n(n,t,e,i)}function Zn(n,t,e,i){if(e=Sn(e,i)){var o=R.getOpenFileDescription(t);o?o.flags.includes(g)?xn(n,o,e,i):i(new b.EBADF("descriptor does not permit writing")):i(new b.EBADF)}}function kn(n,t,e,i,o){return Pn(e)?Pn(i)?void Cn(n,t,e,i,o):o(new b.EINVAL("gid must be a valid integer",i)):o(new b.EINVAL("uid must be a valid integer",e))}function nt(n,t,e,i,o){if(!Pn(e))return o(new b.EINVAL("uid must be a valid integer",e));if(!Pn(i))return o(new b.EINVAL("gid must be a valid integer",i));var u=R.getOpenFileDescription(t);u?u.flags.includes(g)?Xn(n,u,e,i,o):o(new b.EBADF("descriptor does not permit writing")):o(new b.EBADF)}function tt(n,t,o,u){t=i(t),o=i(o);var f,s,r,a,d=e.dirname(t),p=e.dirname(t),m=e.basename(t),E=e.basename(o),w=Date.now();function O(t,e){t?u(t):S(n,o,e,{ctime:w},u)}function l(t){t?u(t):n.getObject(a[E].id,O)}function g(t){t?u(t):(f.id===r.id&&(s=a),delete s[m],n.putObject(f.data,s,l))}function v(t){t?u(t):(a[E]=s[m],n.putObject(r.data,a,g))}function y(t,e){t?u(t):(a=e).hasOwnProperty(E)?z(n,o,v):v()}function N(t,e){t?u(t):(r=e,n.getObject(r.data,y))}function A(t,e){t?u(t):(s=e,x(n,p,N))}function D(t,e){t?u(t):(f=e,n.getObject(e.data,A))}function I(e){e?u(e):Q(n,t,u)}x(n,t,function(e,i){e?u(e):i.type===c?x(n,d,D):J(n,t,o,I)})}function et(n,t,e,i,o){k(n,t,e,o=arguments[arguments.length-1])}function it(n,t,e){nn(n,t,e)}function ot(n,t,e){$(n,t,function(i,o){if(i)e(i);else{var u=new P(t,o,n.name);e(null,u)}})}function ut(n,t,e,i){Vn(e=e||0,i=arguments[arguments.length-1])===e&&tn(n,t,e,i)}function ft(n,t,e,i){i=arguments[arguments.length-1],e=e||0;var o=R.getOpenFileDescription(t);if(o)if(o.flags.includes(g)){if(Vn(e,i)!==e)return;en(n,o,e,i)}else i(new b.EBADF("descriptor does not permit writing"));else i(new b.EBADF)}module.exports={appendFile:Rn,access:gn,chown:kn,chmod:Qn,close:wn,ensureRootDirectory:X,exists:Fn,fchown:nt,fchmod:Zn,fgetxattr:Mn,fremovexattr:Un,fsetxattr:Yn,fstat:An,fsync:Tn,ftruncate:ft,futimes:Jn,getxattr:qn,link:Dn,lseek:Gn,lstat:ot,mkdir:ln,mkdtemp:vn,mknod:On,open:En,readdir:Wn,read:jn,readFile:hn,readlink:it,removexattr:Kn,rename:tt,rmdir:yn,setxattr:zn,stat:Nn,symlink:et,truncate:ut,unlink:In,utimes:$n,writeFile:Ln,write:bn};
},{"../path.js":"8thZ","../shared.js":"zFPO","../constants.js":"gCho","../encoding.js":"u0zp","../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"),s=require("../shared.js").nop,a=require("../constants.js"),o=a.FILE_SYSTEM_NAME,i=a.FS_FORMAT,u=a.FS_READY,m=a.FS_PENDING,c=a.FS_ERROR,f=a.FS_NODUPEIDCHECK,l=require("../providers/index.js"),h=require("../shell/shell.js"),p=require("../../lib/intercom.js"),d=require("../fs-watcher.js"),g=require("../errors.js"),b=require("../shared.js").guid,A=a.STDIN,P=a.STDOUT,v=a.STDERR,y=require("./implementation.js");function E(e){return"function"==typeof e?e:function(e){if(e)throw e}}function R(e){e&&console.error("Filer error: ",e)}function w(e){if(!(e&&e.protocol&&e.pathname))return e;if("file:"!==e.protocol)throw new g.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 g.EINVAL("file: URLs must not include encoded / characters",e)}return decodeURIComponent(r)}function S(r){return e.isBuffer(r)?r.toString():r}function O(e,r){return e?n.isNull(e)?new g.EINVAL("Path must be a string without null bytes.",e):r||n.isAbsolute(e)?void 0:new g.EINVAL("Path must be absolute.",e):new g.EINVAL("Path must be a string",e)}function x(e,r,t){var n=e[r],s=O(n=S(n=w(n)),t);if(s)throw s;e[r]=n}function F(e,r){r=r||R;var w=(e=e||{}).flags||[],S=e.guid?e.guid:b,O=e.provider||new l.Default(e.name||o),_=e.name||O.name,q=w.includes(i),C=this;C.readyState=m,C.name=_,C.error=null,C.stdin=A,C.stdout=P,C.stderr=v,C.constants=a.fsConstants,C.F_OK=a.fsConstants.F_OK,C.R_OK=a.fsConstants.R_OK,C.W_OK=a.fsConstants.W_OK,C.X_OK=a.fsConstants.X_OK,this.Shell=h.bind(void 0,this);var I=[];function N(e){return function(r){w.includes(f)?r(null,S()):function r(t){var n=S();e.getObject(n,function(e,s){e?t(e):s?r(t):t(null,n)})}(r)}}this.queueOrRun=function(e){var r;return u===C.readyState?e.call(C):c===C.readyState?r=new g.EFILESYSTEMERROR("unknown error"):I.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||s;var a=new d;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=_,r.flags=w,r.changes=[],r.guid=N(r),r.close=function(){var e=r.changes;!function(e){if(e.length){var r=p.getInstance();e.forEach(function(e){r.emit(e.event,e.path)})}}(e),e.length=0},r}C.provider={openReadWriteContext:function(){return t("getReadWriteContext")},openReadOnlyContext:function(){return t("getReadOnlyContext")}},C.readyState=e?c:u,I.forEach(function(e){e.call(this)}.bind(C)),I=null,r(e,C)}if(e)return t(e);var n=O.getReadWriteContext();n.guid=N(n),q?n.clear(function(e){if(e)return t(e);y.ensureRootDirectory(n,t)}):y.ensureRootDirectory(n,t)}),F.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;F.prototype[r]=function(){var t=this,n=Array.prototype.slice.call(arguments,0),s=n.length-1,a="function"!=typeof n[s],o=E(n[s]);e.absPathArgs&&e.absPathArgs.forEach(function(e){return x(n,e,!1)}),e.relPathArgs&&e.relPathArgs.forEach(function(e){return x(n,e,!0)});var i=t.queueOrRun(function(){var e=t.provider.openReadWriteContext();if(c===t.readyState){var i=new g.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return o.call(t,i)}function u(){e.close(),o.apply(t,arguments)}a?n.push(u):n[s]=u;var m=[e].concat(n);y[r].apply(null,m)});i&&o(i)},n&&(F.prototype.promises[r]=t(F.prototype[r].bind(C)))})}F.providers=l,module.exports=F;
},{"es6-promisify":"0c0E","../path.js":"8thZ","../shared.js":"zFPO","../constants.js":"gCho","../providers/index.js":"UCG6","../shell/shell.js":"Kf0M","../../lib/intercom.js":"u7Jv","../fs-watcher.js":"p3D+","../errors.js":"Hmaa","./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")