returnn.prototype.clear=function(t){try{varn=this.objectStore.clear();n.onsuccess=function(){t()},n.onerror=function(n){t(n)}}catch(e){t(e)}},n.prototype.get=function(t,n){try{vare=this.objectStore.get(t);e.onsuccess=function(t){vare=t.target.result;n(null,e)},e.onerror=function(t){n(t)}}catch(r){n(r)}},n.prototype.put=function(t,n,e){try{varr=this.objectStore.put(n,t);r.onsuccess=function(t){varn=t.target.result;e(null,n)},r.onerror=function(t){e(t)}}catch(i){e(i)}},n.prototype.delete=function(t,n){try{vare=this.objectStore.delete(t);e.onsuccess=function(t){vare=t.target.result;n(null,e)},e.onerror=function(t){n(t)}}catch(r){n(r)}},e.isSupported=function(){return!!o},e.prototype.open=function(t){varn=this;if(n.db)returnt(null,!1),void0;vare=!1,r=o.open(n.name);r.onupgradeneeded=function(t){varn=t.target.result;n.objectStoreNames.contains(i)&&n.deleteObjectStore(i),n.createObjectStore(i),e=!0},r.onsuccess=function(r){n.db=r.target.result,t(null,e)},r.onerror=function(n){t(n)}},e.prototype.getReadOnlyContext=function(){returnnewn(this.db,a)},e.prototype.getReadWriteContext=function(){returnnewn(this.db,s)},e}),e("src/providers/websql",["require","src/constants","src/constants","src/constants","src/constants","src/constants"],function(t){functionn(t,n){vare=this;this.getTransaction=function(r){returne.transaction?(r(e.transaction),void0):(t[n?"readTransaction":"transaction"](function(t){e.transaction=t,r(t)}),void0)}}functione(t){this.name=t||r,this.db=null}varr=t("src/constants").FILE_SYSTEM_NAME,i=t("src/constants").FILE_STORE_NAME,o=t("src/constants").WSQL_VERSION,s=t("src/constants").WSQL_SIZE,a=t("src/constants").WSQL_DESC;returnn.prototype.clear=function(t){functionn(n,e){t(e)}functione(){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+i,[],e,n)})},n.prototype.get=function(t,n){functione(t,e){varr=0===e.rows.length?null:e.rows.item(0).data;n(null,r)}functionr(t,e){n(e)}this.getTransaction(function(n){n.executeSql("SELECT data FROM "+i+" WHERE id = ?",[t],e,r)})},n.prototype.put=function(t,n,e){functionr(){e(null)}functiono(t,n){e(n)}this.getTransaction(function(e){e.executeSql("INSERT OR REPLACE INTO "+i+" (id, data) VALUES (?, ?)",[t,n],r,o)})},n.prototype.delete=function(t,n){functione(){n(null)}functionr(t,e){n(e)}this.getTransaction(function(n){n.executeSql("DELETE FROM "+i+" WHERE id = ?",[t],e,r)})},e.isSupported=function(){return!!window.openDatabase},e.prototype.open=function(t){functionn(n,e){t(e)}functione(n){functione(n,e){varr=0===e.rows.item(0).count;t(null,r)}functiono(n,e){t(e)}r.db=c,n.executeSql("SELECT COUNT(id) AS count FROM "+i+";",[],e,o)}varr=this;if(r.db)returnt(null,!1),void0;varc=window.openDatabase(r.name,o,a,s);returnc?(c.transaction(function(t){t.executeSql("CREATE TABLE IF NOT EXISTS "+i+" (id unique, data)",[],e,n)}),void0):(t("[WebSQL] Unable to open database."),void0)},e.prototype.getReadOnlyContext=function(){returnnewn(this.db,!0)},e.prototype.getReadWriteContext=function(){returnnewn(this.db,!1)},e}),function(){functiont(t){vare=!1;returnfunction(){if(e)throwError("Callback was already called.");e=!0,t.apply(n,arguments)}}varn,r,i={};n=this,null!=n&&(r=n.async),i.noConflict=function(){returnn.async=r,i};varo=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=[];returno(t,function(t,r,i){e.push(n(t,r,i))}),e},a=function(t,n,e){returnt.reduce?t.reduce(n,e):(o(t,function(t,r,i){e=n(e,t,r,i)}),e)},c=function(t){if(Object.keys)returnObject.keys(t);varn=[];for(vareint)t.hasOwnProperty(e)&&n.push(e);returnn};"undefined"!=typeofprocess&&process.nextTick?(i.nextTick=process.nextTick,i.setImmediate="undefined"!=typeofsetImmediate?function(t){setImmediate(t)}:i.nextTick):"function"==typeofsetImmediate?(i.nextTick=function(t){setImmediate(t)},i.setImmediate=i.nextTick):(i.nextTick=function(t){setTimeout(t,0)},i.setImmediate=i.nextTick),i.each=function(n,e,r){if(r=r||function(){},!n.length)returnr();vari=0;o(n,function(o){e
}functiontn(t,n,e,r,i,o,s){functiona(t){t?s(t):s(null)}varc=t.openFiles[e];c?dn(c.flags).contains(Yn)?R(n,c,r,i,o,a):s(newSn("descriptor does not permit writing")):s(newSn("invalid file descriptor"))}functionnn(t,n,e,r){functioni(t){t?r(t):r(null)}j(n,r)&&D(t,n,e,i)}functionen(t,n,e,r,i){functiono(t){t?i(t):i(null)}vars=t.openFiles[e];s?dn(s.flags).contains(Yn)?T(n,s,r,o):i(newSn("descriptor does not permit writing")):i(newSn("invalid file descriptor"))}functionrn(t,n,e,r,i,o){functions(t,n){t?o(t):0>n.size+r?o(newOn("resulting file offset would be negative")):(a.position=n.size+r,o(null,a.position))}vara=t.openFiles[e];a||o(newSn("invalid file descriptor")),"SET"===i?0>r?o(newOn("resulting file offset would be negative")):(a.position=r,o(null,a.position)):"CUR"===i?0>a.position+r?o(newOn("resulting file offset would be negative")):(a.position+=r,o(null,a.position)):"END"===i?v(n,a,s):o(newOn("whence argument is not a proper value"))}functionon(t,n,e){functionr(t,n){t?e(t):e(null,n)}j(n,e)&&w(t,n,r)}functionsn(t,n,e,r,i){functiono(t){t?i(t):i(null)}if(j(n,i)){vars=Date.now();e=e?e:s,r=r?r:s,A(t,n,e,r,o)}}functionan(t,n,e,r,i,o){functions(t){t?o(t):o(null)}vara=Date.now();r=r?r:a,i=i?i:a;varc=t.openFiles[e];c?dn(c.flags).contains(Yn)?S(n,c,r,i,s):o(newSn("descriptor does not permit writing")):o(newSn("invalid file descriptor"))}functioncn(t,n,e,r){functioni(t){t?r(t):r(null)}functiono(e){e?r(e):b(t,n,i)}j(n,r)&&j(e,r)&&m(t,n,e,o)}functionun(t,n,e,r){functioni(t){t?r(t):r(null)}j(n,r)&&j(e,r)&&E(t,n,e,i)}functionfn(t,n,e){functionr(t,n){t?e(t):e(null,n)}j(n,e)&&x(t,n,r)}functionln(t,n,e,r){functioni(n,e){if(n)r(n);else{vari=newo(e,t.name);r(null,i)}}j(e,r)&&y(n,e,i)}functionpn(t,n,e,r){functioni(t){t?r(t):r(null)}j(n,r)&&_(t,n,e,i)}functionhn(t,n,e,r,i){functiono(t){t?i(t):i(null)}vars=t.openFiles[e];s?dn(s.flags).contains(Yn)?k(n,s,r,o):i(newSn("descriptor does not permit writing")):i(newSn("invalid file descriptor"))}vardn=t("nodash");t("encoding");vargn=t("src/path").normalize,vn=t("src/path").dirname,yn=t("src/path").basename,mn=t("src/shared").guid;t("src/shared").hash;varbn=t("src/shared").nop,wn=t("src/error").EExists,En=t("src/error").EIsDirectory,xn=t("src/error").ENoEntry,_n=t("src/error").EBusy,kn=t("src/error").ENotEmpty,An=t("src/error").ENotDirectory,Sn=t("src/error").EBadFileDescriptor;t("src/error").ENotImplemented,t("src/error").ENotMounted;varOn=t("src/error").EInvalid,Rn=t("src/error").EIO,Cn=t("src/error").ELoop,In=t("src/error").EFileSystemError,Dn=t("src/error").ENoAttr,Tn=t("src/constants").FILE_SYSTEM_NAME,Bn=t("src/constants").FS_FORMAT,Mn=t("src/constants").MODE_FILE,jn=t("src/constants").MODE_DIRECTORY,zn=t("src/constants").MODE_SYMBOLIC_LINK,Nn=t("src/constants").MODE_META,Fn=t("src/constants").ROOT_DIRECTORY_NAME,Un=t("src/constants").SUPER_NODE_ID,Ln=t("src/constants").SYMLOOP_MAX,Pn=t("src/constants").FS_READY,Wn=t("src/constants").FS_PENDING,qn=t("src/constants").FS_ERROR,Hn=t("src/constants").O_READ,Yn=t("src/constants").O_WRITE,Xn=t("src/constants").O_CREATE,Kn=t("src/constants").O_EXCLUSIVE;t("src/constants").O_TRUNCATE;varVn=t("src/constants").O_APPEND,Zn=t("src/constants").O_FLAGS,Qn=t("src/constants").XATTR_CREATE,Gn=t("src/constants").XATTR_REPLACE,$n=t("src/providers/providers"),Jn=t("src/adapters/adapters"),te=t("src/shell");returnN.providers=$n,N.adapters=Jn,N.prototype.open=function(t,n,e,r){r=z(arguments[arguments.length-1]);vari=this,o=i.queueOrRun(function(){vare=i.provider.getReadWriteContext();F(i,e,t,n,r)});o&&r(o)},N.prototype.close=function(t,n){U(this,t,z(n))},N.prototype.mkdir=function(t,n,e){"function"==typeofn&&(e=n),e=z(e);varr=this,i=r.queueOrRun(function(){varn=r.provider.getReadWriteContext();L(n,t,e)});i&&e(i)},N.prototype.rmdir=function(t,n){n=z(n);vare=this,r=e.queueOrRun(function(){varr=e.provider.getReadWriteContext();P(r,t,n)});r&&n(r)},N.prototype.stat=function(t,n){n=z(n);vare=this,r=e.queueOrRun(function(){varr=e.provider.getReadWriteContext();W(r,e.name,t,n)});r&&n(r)},N.prototype.fstat=func