!function(t){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=t();elseif("function"==typeofdefine&&define.amd)define([],t);else{varn;"undefined"!=typeofwindow?n=window:"undefined"!=typeofglobal?n=global:"undefined"!=typeofself&&(n=self),n.Filer=t()}}(function(){vart;returnfunctionn(t,e,r){functioni(a,u){if(!e[a]){if(!t[a]){vars="function"==typeofrequire&&require;if(!u&&s)returns(a,!0);if(o)returno(a,!0);throwError("Cannot find module '"+a+"'")}varc=e[a]={exports:{}};t[a][0].call(c.exports,function(n){vare=t[a][1][n];returni(e?e:n)},c,c.exports,n,t,e,r)}returne[a].exports}for(varo="function"==typeofrequire&&require,a=0;r.length>a;a++)i(r[a]);returni}({1:[function(n,e){(function(n){(function(){functionr(t){varn=!1;returnfunction(){if(n)throwError("Callback was already called.");n=!0,t.apply(i,arguments)}}vari,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){returni.async=o,a};varu=function(t,n){if(t.forEach)returnt.forEach(n);for(vare=0;t.length>e;e+=1)n(t[e],e,t)},s=function(t,n){if(t.map)returnt.map(n);vare=[];returnu(t,function(t,r,i){e.push(n(t,r,i))}),e},c=function(t,n,e){returnt.reduce?t.reduce(n,e):(u(t,function(t,r,i){e=n(e,t,r,i)}),e)},f=function(t){if(Object.keys)returnObject.keys(t);varn=[];for(vareint)t.hasOwnProperty(e)&&n.push(e);returnn};void0!==n&&n.nextTick?(a.nextTick=n.nextTick,a.setImmediate="undefined"!=typeofsetImmediate?function(t){setImmediate(t)}:a.nextTick):"function"==typeofsetImmediate?(a.nextTick=function(t){setImmediate(t)},a.setImmediate=a.nextTick):(a.nextTick=function(t){setTimeout(t,0)},a.setImmediate=a.nextTick),a.each=function(t,n,e){if(e=e||function(){},!t.length)returne();vari=0;u(t,function(o){n(o,r(function(n){n?(e(n),e=function(){}):(i+=1,i>=t.length&&e(null))}))})},a.forEach=a.each,a.eachSeries=function(t,n,e){if(e=e||function(){},!t.length)returne();varr=0,i=function(){n(t[r],function(n){n?(e(n),e=function(){}):(r+=1,r>=t.length?e(null):i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,n,e,r){vari=l(n);i.apply(null,[t,e,r])},a.forEachLimit=a.eachLimit;varl=function(t){returnfunction(n,e,r){if(r=r||function(){},!n.length||0>=t)returnr();vari=0,o=0,a=0;(functionu(){if(i>=n.length)returnr();for(;t>a&&n.length>o;)o+=1,a+=1,e(n[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=n.length?r():u())})})()}},d=function(t){returnfunction(){varn=Array.prototype.slice.call(arguments);returnt.apply(null,[a.each].concat(n))}},p=function(t,n){returnfunction(){vare=Array.prototype.slice.call(arguments);returnn.apply(null,[l(t)].concat(e))}},h=function(t){returnfunction(){varn=Array.prototype.slice.call(arguments);returnt.apply(null,[a.eachSeries].concat(n))}},g=function(t,n,e,r){vari=[];n=s(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e,r){i[t.index]=r,n(e)})},function(t){r(t,i)})};a.map=d(g),a.mapSeries=h(g),a.mapLimit=function(t,n,e,r){returnv(n)(t,e,r)};varv=function(t){returnp(t,g)};a.reduce=function(t,n,e,r){a.eachSeries(t,function(t,r){e(n,t,function(t,e){n=e,r(t)})},function(t){r(t,n)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,n,e,r){vari=s(t,function(t){returnt}).reverse();a.reduce(i,n,e,r)},a.foldr=a.reduceRight;varm=function(t,n,e,r){vari=[];n=s(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e){e&&i.push(t),n()})},function(){r(s(i.sort(function(t,n){returnt.index-n.index}),function(t){returnt.value}))})};a.filter=d(m),a.filterSeries=h(m),a.select=a.filter,a.selectSeries=a.filterSeries;vary=function(t,n,e,r){vari=[];n=s(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e){e||i.push(t),n()})},function(){r(s(i.sort(function(t,n){returnt.index-n.index}),function(t){returnt.value}))})};a.reject=d(y),a.rejectSeries=h(y);varE=function(t,n,e,r){t(n,function(t,n){e(t,function(e){e?(r(t),r=function(){}):n()})},function(){r()})};a.detect=d(E),a.detectSeries=h(E),a.some=function(t,n,e){a.each(t,function(t,r){n(t,function(t){t&&(e(!0),e=function(){}),r()})},f
e?(e=Number(e),e>l&&(e=l)):e=l,r=((r||"utf8")+"").toLowerCase();vard;switch(r){case"hex":d=i(this,t,n,e);break;case"utf8":case"utf-8":d=o(this,t,n,e);break;case"ascii":d=a(this,t,n,e);break;case"binary":d=u(this,t,n,e);break;case"base64":d=s(this,t,n,e);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=c(this,t,n,e);break;default:throwError("Unknown encoding")}returnd},r.prototype.toString=function(t,n,e){varr=this;if(t=((t||"utf8")+"").toLowerCase(),n=Number(n)||0,e=void0===e?r.length:Number(e),e===n)return"";vari;switch(t){case"hex":i=h(r,n,e);break;case"utf8":case"utf-8":i=l(r,n,e);break;case"ascii":i=d(r,n,e);break;case"binary":i=p(r,n,e);break;case"base64":i=f(r,n,e);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(r,n,e);break;default:throwError("Unknown encoding")}returni},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.equals=function(t){returnz(r.isBuffer(t),"Argument must be a Buffer"),0===r.compare(this,t)},r.prototype.compare=function(t){returnz(r.isBuffer(t),"Argument must be a Buffer"),r.compare(this,t)},r.prototype.copy=function(t,n,e,i){varo=this;if(e||(e=0),i||0===i||(i=this.length),n||(n=0),i!==e&&0!==t.length&&0!==o.length){z(i>=e,"sourceEnd < sourceStart"),z(n>=0&&t.length>n,"targetStart out of bounds"),z(e>=0&&o.length>e,"sourceStart out of bounds"),z(i>=0&&o.length>=i,"sourceEnd out of bounds"),i>this.length&&(i=this.length),i-e>t.length-n&&(i=t.length-n+e);vara=i-e;if(100>a||!r._useTypedArrays)for(varu=0;a>u;u++)t[u+n]=this[u+e];elset._set(this.subarray(e,e+a),n)}},r.prototype.slice=function(t,n){vare=this.length;if(t=D(t,e,0),n=D(n,e,e),r._useTypedArrays)returnr._augment(this.subarray(t,n));for(vari=n-t,o=newr(i,void0,!0),a=0;i>a;a++)o[a]=this[a+t];returno},r.prototype.get=function(t){returnconsole.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,n){returnconsole.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,n)},r.prototype.readUInt8=function(t,n){returnn||(z(void0!==t&&null!==t,"missing offset"),z(this.length>t,"Trying to read beyond buffer length")),t>=this.length?void0:this[t]},r.prototype.readUInt16LE=function(t,n){returnv(this,t,!0,n)},r.prototype.readUInt16BE=function(t,n){returnv(this,t,!1,n)},r.prototype.readUInt32LE=function(t,n){returnm(this,t,!0,n)},r.prototype.readUInt32BE=function(t,n){returnm(this,t,!1,n)},r.prototype.readInt8=function(t,n){if(n||(z(void0!==t&&null!==t,"missing offset"),z(this.length>t,"Trying to read beyond buffer length")),!(t>=this.length)){vare=128&this[t];returne?-1*(255-this[t]+1):this[t]}},r.prototype.readInt16LE=function(t,n){returny(this,t,!0,n)},r.prototype.readInt16BE=function(t,n){returny(this,t,!1,n)},r.prototype.readInt32LE=function(t,n){returnE(this,t,!0,n)},r.prototype.readInt32BE=function(t,n){returnE(this,t,!1,n)},r.prototype.readFloatLE=function(t,n){returnb(this,t,!0,n)},r.prototype.readFloatBE=function(t,n){returnb(this,t,!1,n)},r.prototype.readDoubleLE=function(t,n){returnw(this,t,!0,n)},r.prototype.readDoubleBE=function(t,n){returnw(this,t,!1,n)},r.prototype.writeUInt8=function(t,n,e){returne||(z(void0!==t&&null!==t,"missing value"),z(void0!==n&&null!==n,"missing offset"),z(this.length>n,"trying to write beyond buffer length"),V(t,255)),n>=this.length?void0:(this[n]=t,n+1)},r.prototype.writeUInt16LE=function(t,n,e){returnI(this,t,n,!0,e)},r.prototype.writeUInt16BE=function(t,n,e){returnI(this,t,n,!1,e)},r.prototype.writeUInt32LE=function(t,n,e){returnO(this,t,n,!0,e)},r.prototype.writeUInt32BE=function(t,n,e){returnO(this,t,n,!1,e)},r.prototype.writeInt8=function(t,n,e){returne||(z(void0!==t&&null!==t,"missing value"),z(void0!==n&&null!==n,"missing offset"),z(this.length>n,"Trying to write beyond buffer length"),Y(t,127,-128)),n>=this.length?void0:(t>=0?this.writeUInt8(t,n,e):this.writeUInt8(255+t+1,n,e),n+1)},r.prototype.writeInt16LE=function(t,n,e){returnA(this,t,n,!0,e)},r.prototype.writeInt16BE=functi
"function"==typeofn&&(e=n,n={}),n=n||{},e=e||a;varr=newm;returnr.start(t,!1,n.recursive),r.on("change",e),r},T.open(function(t){functioni(t){functioni(t){varn=T[t]();returnn.flags=g,n.changes=[],n.guid=r(n),n.close=function(){vart=n.changes;u(t),t.length=0},n}N.provider={openReadWriteContext:function(){returni("getReadWriteContext")},openReadOnlyContext:function(){returni("getReadOnlyContext")}},N.readyState=t?d:f,e(),n(t,N)}if(t)returni(t);varo=T.getReadWriteContext();o.guid=r(o),x?o.clear(function(t){returnt?i(t):(A.ensureRootDirectory(o,i),void0)}):A.ensureRootDirectory(o,i)})}vari=t("../../lib/nodash.js"),o=t("../path.js").isNull,a=t("../shared.js").nop,u=t("../constants.js"),s=u.FILE_SYSTEM_NAME,c=u.FS_FORMAT,f=u.FS_READY,l=u.FS_PENDING,d=u.FS_ERROR,p=u.FS_NODUPEIDCHECK,h=t("../providers/index.js"),g=t("../shell/shell.js"),v=t("../../lib/intercom.js"),m=t("../fs-watcher.js"),y=t("../errors.js"),E=t("../shared.js").guid,b=u.STDIN,w=u.STDOUT,I=u.STDERR,O=u.FIRST_DESCRIPTOR,A=t("./implementation.js");r.providers=h,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(t){r.prototype[t]=function(){varn=this,r=Array.prototype.slice.call(arguments,0),i=r.length-1,o="function"!=typeofr[i],a=e(r[i]),u=n.queueOrRun(function(){functione(){u.close(),a.apply(n,arguments)}varu=n.provider.openReadWriteContext();if(d===n.readyState){vars=newy.EFILESYSTEMERROR("filesystem unavailable, operation canceled");returna.call(n,s)}o?r.push(e):r[i]=e;varc=[n,u].concat(r);A[t].apply(null,c)});u&&a(u)}}),r.prototype.Shell=function(t){returnnewg(this,t)},n.exports=r},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":12,"../errors.js":15,"../fs-watcher.js":18,"../path.js":22,"../providers/index.js":23,"../shared.js":27,"../shell/shell.js":30,"./implementation.js":16}],18:[function(t,n){functione(){functiont(t){(e===t||u&&0===t.indexOf(n))&&a.trigger("change","change",t)}r.call(this);varn,e,a=this,u=!1;a.start=function(r,a,s){if(!e){if(i.isNull(r))throwError("Path must be a string without null bytes.");e=i.normalize(r),u=s===!0,u&&(n="/"===e?"/":e+"/");varc=o.getInstance();c.on("change",t)}},a.close=function(){varn=o.getInstance();n.off("change",t),a.removeAllListeners("change")}}varr=t("../lib/eventemitter.js"),i=t("./path.js"),o=t("../lib/intercom.js");e.prototype=newr,e.prototype.constructor=e,n.exports=e},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":22}],19:[function(t,n){n.exports={FileSystem:t("./filesystem/interface.js"),Buffer:t("./buffer.js"),Path:t("./path.js"),Errors:t("./errors.js")}},{"./buffer.js":11,"./errors.js":15,"./filesystem/interface.js":17,"./path.js":22}],20:[function(t,n){functione(t){varn=Date.now();this.id=t.id,this.mode=t.mode||i,this.size=t.size||0,this.atime=t.atime||n,this.ctime=t.ctime||n,this.mtime=t.mtime||n,this.flags=t.flags||[],this.xattrs=t.xattrs||{},this.nlinks=t.nlinks||0,this.version=t.version||0,this.blksize=void0,this.nblocks=1,this.data=t.data}functionr(t,n,e){t[n]?e(null):t.guid(function(r,i){t[n]=i,e(r)})}vari=t("./constants.js").MODE_FILE;e.create=function(t,n){r(t,"id",function(i){returni?(n(i),void0):(r(t,"data",function(r){returnr?(n(r),void0):(n(null,newe(t)),void0)}),void0)})},n.exports=e},{"./constants.js":12}],21:[function(t,n){n.exports=function(t,n,e,r){this.path=t,this.id=n,this.flags=e,this.position=r}},{}],22:[function(t,n,e){functionr(t,n){for(vare=0,r=t.length-1;r>=0;r--){vari=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),e++):e&&(t.splice(r,1),e--)}if(n)for(;e--;e)t.unshift("..");returnt}functioni(){for(vart="",n=!1,e=arguments.length-1;e>=-1&&!n;e--){vari=e>=0?arguments[e]:"/";"string"==typeofi&&i&&(t=i+"/"+t,n="/"===i.charAt(0))}returnt=r(t.split("/").filter(function(t){return!!t}),!n).join("/"),(n?"/":"")+t||"."}functiono(