}functionu(l,n){returnMath.floor(l/n)}functione(l){varn=0;this.get=function(){returnn>=l.length?P:Number(l[n])},this.offset=function(u){if(n+=u,0>n)throwError("Seeking past start of the buffer");if(n>l.length)throwError("Seeking past EOF")},this.match=function(u){if(u.length>n+l.length)return!1;vare;for(e=0;u.length>e;e+=1)if(Number(l[n+e])!==u[e])return!1;return!0}}functiont(l){varn=0;this.emit=function(){varu,e=P;for(u=0;arguments.length>u;++u)e=Number(arguments[u]),l[n++]=e;returne}}functionr(l){functionu(l){for(varu=[],e=0,t=l.length;l.length>e;){varr=l.charCodeAt(e);if(n(r,55296,57343))if(n(r,56320,57343))u.push(65533);elseif(e===t-1)u.push(65533);else{vari=l.charCodeAt(e+1);if(n(i,56320,57343)){varo=1023&r,a=1023&i;e+=1,u.push(65536+(o<<10)+a)}elseu.push(65533)}elseu.push(r);e+=1}returnu}vare=0,t=u(l);this.offset=function(l){if(e+=l,0>e)throwError("Seeking past start of the buffer");if(e>t.length)throwError("Seeking past EOF")},this.get=function(){returne>=t.length?M:t[e]}}functioni(){varl="";this.string=function(){returnl},this.emit=function(n){65535>=n?l+=String.fromCharCode(n):(n-=65536,l+=String.fromCharCode(55296+(1023&n>>10)),l+=String.fromCharCode(56320+(1023&n)))}}functiono(l){this.name="EncodingError",this.message=l,this.code=0}functiona(l,n){if(l)thrownewo("Decoder error");returnn||65533}functions(l){thrownewo("The code point "+l+" could not be encoded.")}functionc(l){returnl=(l+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(H,l)?H[l]:null}functionf(l,n){return(n||[])[l]||null}functionp(l,n){varu=n.indexOf(l);return-1===u?null:u}functiond(n){if(!("encoding-indexes"inl))throwError("Indexes missing. Did you forget to include encoding-indexes.js?");returnl["encoding-indexes"][n]}functionh(l){if(l>39419&&189e3>l||l>1237575)returnnull;varn,u=0,e=0,t=d("gb18030");for(n=0;t.length>n;++n){varr=t[n];if(!(l>=r[0]))break;u=r[0],e=r[1]}returne+l-u}functiong(l){varn,u=0,e=0,t=d("gb18030");for(n=0;t.length>n;++n){varr=t[n];if(!(l>=r[1]))break;u=r[1],e=r[0]}returne+l-u}functionv(l){varu=l.fatal,e=0,t=0,r=0,i=0;this.decode=function(l){varo=l.get();if(o===P)return0!==t?a(u):M;if(l.offset(1),0===t){if(n(o,0,127))returno;if(n(o,194,223))t=1,i=128,e=o-192;elseif(n(o,224,239))t=2,i=2048,e=o-224;else{if(!n(o,240,244))returna(u);t=3,i=65536,e=o-240}returne*=Math.pow(64,t),null}if(!n(o,128,191))returne=0,t=0,r=0,i=0,l.offset(-1),a(u);if(r+=1,e+=(o-128)*Math.pow(64,t-r),r!==t)returnnull;vars=e,c=i;returne=0,t=0,r=0,i=0,n(s,c,1114111)&&!n(s,55296,57343)?s:a(u)}}functionm(l){l.fatal,this.encode=function(l,e){vart=e.get();if(t===M)returnP;if(e.offset(1),n(t,55296,57343))returns(t);if(n(t,0,127))returnl.emit(t);varr,i;n(t,128,2047)?(r=1,i=192):n(t,2048,65535)?(r=2,i=224):n(t,65536,1114111)&&(r=3,i=240);for(varo=l.emit(u(t,Math.pow(64,r))+i);r>0;){vara=u(t,Math.pow(64,r-1));o=l.emit(128+a%64),r-=1}returno}}functiony(l,u){vare=u.fatal;this.decode=function(u){vart=u.get();if(t===P)returnM;if(u.offset(1),n(t,0,127))returnt;varr=l[t-128];returnnull===r?a(e):r}}function_(l,u){u.fatal,this.encode=function(u,e){vart=e.get();if(t===M)returnP;if(e.offset(1),n(t,0,127))returnu.emit(t);varr=p(t,l);returnnull===r&&s(t),u.emit(r+128)}}functionb(l,u){vare=u.fatal,t=0,r=0,i=0;this.decode=function(u){varo=u.get();if(o===P&&0===t&&0===r&&0===i)returnM;o!==P||0===t&&0===r&&0===i||(t=0,r=0,i=0,a(e)),u.offset(1);vars;if(0!==i)returns=null,n(o,48,57)&&(s=h(10*(126*(10*(t-129)+(r-48))+(i-129))+o-48)),t=0,r=0,i=0,null===s?(u.offset(-3),a(e)):s;if(0!==r)returnn(o,129,254)?(i=o,null):(u.offset(-2),t=0,r=0,a(e));if(0!==t){if(n(o,48,57)&&l)returnr=o,null;varc=t,p=null;t=0;varg=127>o?64:65;return(n(o,64,126)||n(o,128,254))&&(p=190*(c-129)+(o-g)),s=null===p?null:f(p,d("gbk")),null===p&&u.offset(-1),null===s?a(e):s}returnn(o,0,127)?o:128===o?8364:n(o,129,254)?(t=o,null):a(e)}}functionw(l,e){e.fatal,this.encode=function(e,t){varr=t.get();if(r===M)returnP;if(t.offset(1),n(r,0,127))returne.emit(r);vari=p(r,d("gbk"));if(null!==i){varo=u(i,190)+129,
if(u){vara=i.clear();a.onsuccess=function(){s(o,n)},a.onerror=function(l){n(l)}}elsen()},t.onerror=function(l){this.readyState=Z,this.error=l};varr=1,i={};this.readyState=J,this.db=null,this.nextDescriptor=r,this.openFiles=i,this.name=l,this.error=null,this.queue=[]}functionk(l){this.transaction=l}functionj(){}varO=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,A=l("lodash");l("encoding-indexes"),l("encoding");varS=l("src/path").normalize,I=l("src/path").dirname,B=l("src/path").basename,D=l("src/shared").guid,L=l("src/shared").hash;l("src/shared").nop;varR=l("src/error").EExists,C=l("src/error").EIsDirectory,F=l("src/error").ENoEntry,N=l("src/error").EBusy,T=l("src/error").ENotEmpty,P=l("src/error").ENotDirectory,M=l("src/error").EBadFileDescriptor;l("src/error").ENotImplemented,l("src/error").ENotMounted;varq=l("src/error").EInvalid,z=l("src/error").EIO,H=l("src/error").EFileSystemError,U=l("src/constants").FS_FORMAT,$=l("src/constants").MODE_FILE,K=l("src/constants").MODE_DIRECTORY,Y=l("src/constants").ROOT_DIRECTORY_NAME,W=l("src/constants").ROOT_NODE_ID,V=l("src/constants").IDB_RW;l("src/constants").IDB_RO;varG=l("src/constants").FILE_STORE_NAME,X=l("src/constants").METADATA_STORE_NAME,Q=l("src/constants").FS_READY,J=l("src/constants").FS_PENDING,Z=l("src/constants").FS_ERROR,ln=l("src/constants").O_READ,nn=l("src/constants").O_WRITE,un=l("src/constants").O_CREATE,en=l("src/constants").O_EXCLUSIVE;l("src/constants").O_TRUNCATE;vartn=l("src/constants").O_APPEND,rn=l("src/constants").O_FLAGS;returnw.prototype._allocate_descriptor=function(l){varn=this.nextDescriptor++;returnthis.openFiles[n]=l,n},w.prototype._release_descriptor=function(l){deletethis.openFiles[l]},w.prototype._queueOrRun=function(l){varn=void0;returnQ==this.readyState?l.call(this):Z==this.readyState?n=newH("unknown error"):this.queue.push(l),n},w.prototype._runQueued=function(){this.queue.forEach(function(l){l.call(this)}.bind(this)),this.queue=null},w.prototype._open=function(l,n,e,t){functionr(l,n){if(l)t(l);else{varr;r=A(e).contains(tn)?n.size:0;varo=newu(n.id,e,r),a=i._allocate_descriptor(o);t(void0,a)}}vari=this;e=b(e),e||t(newq("flags is not valid")),p(i,l,n,e,r)},w.prototype._close=function(l,n){A(this.openFiles).has(l)?(this._release_descriptor(l),n(void0)):n(newM("invalid file descriptor"))},w.prototype._mkdir=function(l,n,u){functione(l){l?u(l):u(void0)}c(l,n,e)},w.prototype._rmdir=function(l,n,u){functione(l){l?u(l):u(void0)}f(l,n,e)},w.prototype._stat=function(l,n,u){functione(l,n){if(l)u(l);else{vare=newt(n,r.name);u(void0,e)}}varr=this;g(l,n,e)},w.prototype._fstat=function(l,n,u){functione(l,n){if(l)u(l);else{vare=newt(n,r.name);u(void0,e)}}varr=this,i=r.openFiles[n];i?v(l,i,e):u(newM("invalid file descriptor"))},w.prototype._link=function(l,n,u,e){functiont(l){l?e(l):e(void0)}m(l,n,u,t)},w.prototype._unlink=function(l,n,u){functione(l){l?u(l):u(void0)}y(l,n,e)},w.prototype._read=function(l,n,u,e,t,r,i){functiono(l,n){l?i(l):i(void0,n)}vara=this;e=void0===e?0:e,t=void0===t?u.length-e:t;vars=a.openFiles[n];s?A(s.flags).contains(ln)?h(l,s,u,e,t,r,o):i(newM("descriptor does not permit reading")):i(newM("invalid file descriptor"))},w.prototype._readFile=function(l,n,e,r){vari=this;e?"function"==typeofe?(r=e,e={encoding:null,flag:"r"}):"string"==typeofe&&(e={encoding:e,flag:"r"}):e={encoding:null,flag:"r"};varo=b(e.flag||"r");o||r(newq("flags is not valid")),p(i,l,n,o,function(n,a){if(n)returnr(n);vars=newu(a.id,o,0),c=i._allocate_descriptor(s);v(l,s,function(n,u){if(n)returnr(n);varo=newt(u,i.name),a=o.size,f=newUint8Array(a);h(l,s,f,0,a,0,function(l){if(l)returnr(l);i._release_descriptor(c);varn;n="utf8"===e.encoding?newTextDecoder("utf-8").decode(f):f,r(void0,n)})})})},w.prototype._write=function(l,n,u,e,t,r,i){functiono(l,n){l?i(l):i(void0,n)}vara=this;e=void0===e?0:e,t=void0===t?u.length-e:t;vars=a.openFiles[n];s?A(s.flags).contains(nn)?t>u.length-e?i(newz("intput buffer is too small")):d(l,s,u,e,t,r,o):i(newM("descriptordoe