}varr=t("src/constants").FILE_SYSTEM_NAME,i=t("src/constants").FILE_STORE_NAME,o=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,s=t("src/constants").IDB_RW,a=t("src/constants").IDB_RO;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.nex
}j(n,r)&&C(t,n,e,i)}functionJ(t,n,e,r,i){functiono(t,n){t?i(t):i(null,n)}vars=t.openFiles[e];s?I(n,s,r,o):i(newCn("invalid file descriptor"))}functiontn(t,n,e,r,i,o){functions(t){t?o(t):o(null)}j(n,o)&&O(t,n,e,r,i,s)}functionnn(t,n,e,r,i,o,s){functiona(t){t?s(t):s(null)}varc=t.openFiles[e];c?gn(c.flags).contains(Vn)?R(n,c,r,i,o,a):s(newCn("descriptor does not permit writing")):s(newCn("invalid file descriptor"))}functionen(t,n,e,r){functioni(t){t?r(t):r(null)}j(n,r)&&D(t,n,e,i)}functionrn(t,n,e,r,i){functiono(t){t?i(t):i(null)}vars=t.openFiles[e];s?gn(s.flags).contains(Vn)?T(n,s,r,o):i(newCn("descriptor does not permit writing")):i(newCn("invalid file descriptor"))}functionon(t,n,e,r,i,o){functions(t,n){t?o(t):0>n.size+r?o(newIn("resulting file offset would be negative")):(a.position=n.size+r,o(null,a.position))}vara=t.openFiles[e];a||o(newCn("invalid file descriptor")),"SET"===i?0>r?o(newIn("resulting file offset would be negative")):(a.position=r,o(null,a.position)):"CUR"===i?0>a.position+r?o(newIn("resulting file offset would be negative")):(a.position+=r,o(null,a.position)):"END"===i?v(n,a,s):o(newIn("whence argument is not a proper value"))}functionsn(t,n,e){functionr(t,n){t?e(t):e(null,n)}j(n,e)&&w(t,n,r)}functionan(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)}}functioncn(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?gn(c.flags).contains(Vn)?S(n,c,r,i,s):o(newCn("descriptor does not permit writing")):o(newCn("invalid file descriptor"))}functionun(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)}functionfn(t,n,e,r){functioni(t){t?r(t):r(null)}j(n,r)&&j(e,r)&&E(t,n,e,i)}functionln(t,n,e){functionr(t,n){t?e(t):e(null,n)}j(n,e)&&x(t,n,r)}functionhn(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)}functiondn(t,n,e,r,i){functiono(t){t?i(t):i(null)}vars=t.openFiles[e];s?gn(s.flags).contains(Vn)?k(n,s,r,o):i(newCn("descriptor does not permit writing")):i(newCn("invalid file descriptor"))}vargn=t("nodash");t("encoding");varvn=t("src/path").normalize,yn=t("src/path").dirname,mn=t("src/path").basename,bn=t("src/path").isAbsolute,wn=t("src/path").isNull,En=t("src/shared").guid;t("src/shared").hash;varxn=t("src/shared").nop,_n=t("src/error").EExists,kn=t("src/error").EIsDirectory,An=t("src/error").ENoEntry,Sn=t("src/error").EBusy,On=t("src/error").ENotEmpty,Rn=t("src/error").ENotDirectory,Cn=t("src/error").EBadFileDescriptor;t("src/error").ENotImplemented,t("src/error").ENotMounted;varIn=t("src/error").EInvalid,Dn=t("src/error").EIO,Tn=t("src/error").ELoop,Bn=t("src/error").EFileSystemError,Mn=t("src/error").ENoAttr,jn=t("src/constants").FILE_SYSTEM_NAME,zn=t("src/constants").FS_FORMAT,Nn=t("src/constants").MODE_FILE,Fn=t("src/constants").MODE_DIRECTORY,Un=t("src/constants").MODE_SYMBOLIC_LINK,Ln=t("src/constants").MODE_META,Pn=t("src/constants").ROOT_DIRECTORY_NAME,Wn=t("src/constants").SUPER_NODE_ID,qn=t("src/constants").SYMLOOP_MAX,Hn=t("src/constants").FS_READY,Yn=t("src/constants").FS_PENDING,Xn=t("src/constants").FS_ERROR,Kn=t("src/constants").O_READ,Vn=t("src/constants").O_WRITE,Zn=t("src/constants").O_CREATE,Qn=t("src/constants").O_EXCLUSIVE;t("src/constants").O_TRUNCATE;varGn=t("src/constants").O_APPEND,$n=t("src/constants").O_FLAGS,Jn=t("src/constants").XATTR_CREATE,te=t("src/constants").XATTR_REPLACE,ne=t("src/providers/providers"),ee=t("src/adapters/adapters"),re=t("src/shell");returnN.providers=ne,N.adapters=ee,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=functi