>8&1),512&n.flags&&(F[0]=255&g,F[1]=g>>>8&255,n.check=o(n.check,F,2,0)),g=0,p=0,n.mode=3;case 3:for(;p<32;){if(0===d)break e;d--,g+=l[c++]<>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,n.check=o(n.check,F,4,0)),g=0,p=0,n.mode=4;case 4:for(;p<16;){if(0===d)break e;d--,g+=l[c++]<
>8),512&n.flags&&(F[0]=255&g,F[1]=g>>>8&255,n.check=o(n.check,F,2,0)),g=0,p=0,n.mode=5;case 5:if(1024&n.flags){for(;p<16;){if(0===d)break e;d--,g+=l[c++]<
>>8&255,n.check=o(n.check,F,2,0)),g=0,p=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((C=n.length)>d&&(C=d),C&&(n.head&&(D=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,l,c,C,D)),512&n.flags&&(n.check=o(n.check,l,C,c)),d-=C,c+=C,n.length-=C),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===d)break e;C=0;do{D=l[c+C++],n.head&&D&&n.length<65536&&(n.head.name+=String.fromCharCode(D))}while(D&&C>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;p<32;){if(0===d)break e;d--,g+=l[c++]<>>=7&p,p-=7&p,n.mode=27;break}for(;p<3;){if(0===d)break e;d--,g+=l[c++]<
>>=1)){case 0:n.mode=14;break;case 1:if(m(n),n.mode=20,6===t){g>>>=2,p-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}g>>>=2,p-=2;break;case 14:for(g>>>=7&p,p-=7&p;p<32;){if(0===d)break e;d--,g+=l[c++]<
>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&g,g=0,p=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(C=n.length){if(C>d&&(C=d),C>f&&(C=f),0===C)break e;r.arraySet(u,l,c,C,h),d-=C,c+=C,f-=C,h+=C,n.length-=C;break}n.mode=12;break;case 17:for(;p<14;){if(0===d)break e;d--,g+=l[c++]<
>>=5,p-=5,n.ndist=1+(31&g),g>>>=5,p-=5,n.ncode=4+(15&g),g>>>=4,p-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,p-=3}for(;n.have<19;)n.lens[R[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},S=s(0,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,S){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,Q=65535&T,!((v=T>>>24)<=p);){if(0===d)break e;d--,g+=l[c++]<>>=v,p-=v,n.lens[n.have++]=Q;else{if(16===Q){for(M=v+2;p>>=v,p-=v,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}D=n.lens[n.have-1],C=3+(3&g),g>>>=2,p-=2}else if(17===Q){for(M=v+3;p>>=v)),g>>>=3,p-=3}else{for(M=v+7;p>>=v)),g>>>=7,p-=7}if(n.have+C>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;C--;)n.lens[n.have++]=D}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,N={bits:n.lenbits},S=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,S){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},S=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,S){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(d>=6&&f>=258){e.next_out=h,e.avail_out=f,e.next_in=c,e.avail_in=d,n.hold=g,n.bits=p,a(e,B),h=e.next_out,u=e.output,f=e.avail_out,c=e.next_in,l=e.input,d=e.avail_in,g=n.hold,p=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;b=(T=n.lencode[g&(1<>>16&255,Q=65535&T,!((v=T>>>24)<=p);){if(0===d)break e;d--,g+=l[c++]<>k)])>>>16&255,Q=65535&T,!(k+(v=T>>>24)<=p);){if(0===d)break e;d--,g+=l[c++]<
>>=k,p-=k,n.back+=k}if(g>>>=v,p-=v,n.back+=v,n.length=Q,0===b){n.mode=26;break}if(32&b){n.back=-1,n.mode=12;break}if(64&b){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&b,n.mode=22;case 22:if(n.extra){for(M=n.extra;p>>=n.extra,p-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;b=(T=n.distcode[g&(1<>>16&255,Q=65535&T,!((v=T>>>24)<=p);){if(0===d)break e;d--,g+=l[c++]<>k)])>>>16&255,Q=65535&T,!(k+(v=T>>>24)<=p);){if(0===d)break e;d--,g+=l[c++]<
>>=k,p-=k,n.back+=k}if(g>>>=v,p-=v,n.back+=v,64&b){e.msg="invalid distance code",n.mode=30;break}n.offset=Q,n.extra=15&b,n.mode=24;case 24:if(n.extra){for(M=n.extra;p>>=n.extra,p-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===f)break e;if(C=B-f,n.offset>C){if((C=n.offset-C)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}C>n.wnext?(C-=n.wnext,E=n.wsize-C):E=n.wnext-C,C>n.length&&(C=n.length),w=n.window}else w=u,E=h-n.offset,C=n.length;C>f&&(C=f),f-=C,n.length-=C;do{u[h++]=w[E++]}while(--C);0===n.length&&(n.mode=21);break;case 26:if(0===f)break e;u[h++]=n.length,f--,n.mode=21;break;case 27:if(n.wrap){for(;p<32;){if(0===d)break e;d--,g|=l[c++]<>>=B=y>>>24,f-=B,0==(B=y>>>16&255))Q[o++]=65535&y;else{if(!(16&B)){if(0==(64&B)){y=g[(65535&y)+(d&(1<>>=B,f-=B),f<15&&(d+=b[r++]<>>=B=y>>>24,f-=B,!(16&(B=y>>>16&255))){if(0==(64&B)){y=p[(65535&y)+(d&(1<A){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=B,f-=B,E>(B=o-a)){if((B=E-B)>u&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(w=0,v=h,0===c){if(w+=l-B,B2;)Q[o++]=v[w++],Q[o++]=v[w++],Q[o++]=v[w++],C-=3;C&&(Q[o++]=v[w++],C>1&&(Q[o++]=v[w++]))}else{w=o-E;do{Q[o++]=Q[w++],Q[o++]=Q[w++],Q[o++]=Q[w++],C-=3}while(C>2);C&&(Q[o++]=Q[w++],C>1&&(Q[o++]=Q[w++]))}break}}break}}while(r>3,d&=(1<<(f-=C<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r=1&&0===F[Q];Q--);if(k>Q&&(k=Q),0===Q)return l[u++]=20971520,l[u++]=20971520,h.bits=1,0;for(b=1;b0&&(0===e||1!==Q))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+F[w];for(v=0;v852||2===e&&S>592)return 1;for(;;){y=w-_,c[v]I?(B=U[H+c[v]],C=M[T+c[v]]):(B=96,C=0),d=1<>_)+(f-=d)]=y<<24|B<<16|C|0}while(0!==f);for(d=1<>=1;if(0!==d?(N&=d-1,N+=d):N=0,v++,0==--F[w]){if(w===Q)break;w=t[n+c[v]]}if(w>k&&(N&p)!==g){for(0===_&&(_=k),m+=b,D=1<<(x=w-_);x+_852||2===e&&S>592)return 1;l[g=N&p]=k<<24|x<<16|m-u|0}}return 0!==N&&(l[m+N]=w-_<<24|64<<16|0),h.bits=k,0}},function(e,t,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(e,t){e.exports=r},function(e,t,n){"use strict";var r=n(4),i=function(e){this.kdbx=e.kdbx,this.exportXml=e.exportXml||!1};i.prototype.setXmlDate=function(e,t){var n=this.kdbx.header.versionMajor>=4&&!this.exportXml;r.setDate(e,t,n)},e.exports=i},function(e,t){e.exports=i},function(e,t,n){"use strict";var r=n(11),i=n(2),o=n(1),a=n(0),s=n(3);e.exports.decrypt=function(e){return Promise.resolve().then((function(){var t,n=new r(e),A=[],l=0,u=0,c=function(){if(n.getUint32(!0),t=n.readBytes(32),(l=n.getUint32(!0))>0){u+=l;var e=n.readBytes(l);return s.sha256(e).then((function(n){if(a.arrayBufferEquals(n,t))return A.push(e),c();throw new i(o.ErrorCodes.FileCorrupt,"invalid hash block")}))}for(var r=new Uint8Array(u),h=0,d=0;d0){var l=Math.min(1048576,t);t-=l;var u=e.slice(n,n+l);return s.sha256(u).then((function(e){var t=new ArrayBuffer(40),s=new r(t);return s.setUint32(i,!0),s.writeBytes(e),s.setUint32(l,!0),a.push(t),o+=t.byteLength,a.push(u),o+=u.byteLength,i++,n+=l,A()}))}var c=new ArrayBuffer(40);new DataView(c).setUint32(0,i,!0),a.push(c),o+=c.byteLength;for(var h=new Uint8Array(o),d=0,f=0;f0){l+=A;var h=n.readBytes(A);return u(t,s,A,h).then((function(t){if(a.arrayBufferEquals(t,e))return r.push(h),s++,c();throw new i(o.ErrorCodes.FileCorrupt,"invalid hash block")}))}for(var d=new Uint8Array(l),f=0,g=0;g0)return a.push(c),o+=c.byteLength,i++,r+=l,A();for(var u=new Uint8Array(o),h=0,d=0;dthis.nameChanged&&(this._name=e.name,this.nameChanged=e.nameChanged),e.descChanged>this.descChanged&&(this._desc=e.desc,this.descChanged=e.descChanged),e.defaultUserChanged>this.defaultUserChanged&&(this._defaultUser=e.defaultUser,this.defaultUserChanged=e.defaultUserChanged),e.keyChanged>this.keyChanged&&(this.keyChanged=e.keyChanged),e.settingsChanged>this.settingsChanged&&(this.settingsChanged=e.settingsChanged),e.recycleBinChanged>this.recycleBinChanged&&(this._recycleBinEnabled=e.recycleBinEnabled,this._recycleBinUuid=e.recycleBinUuid,this.recycleBinChanged=e.recycleBinChanged),e.entryTemplatesGroupChanged>this.entryTemplatesGroupChanged&&(this._entryTemplatesGroup=e.entryTemplatesGroup,this.entryTemplatesGroupChanged=e.entryTemplatesGroupChanged),Object.keys(e.customData).forEach((function(n){this.customData[n]||t.deleted[n]||(this.customData[n]=e.customData[n])}),this),Object.keys(e.customIcons).forEach((function(n){this.customIcons[n]||t.deleted[n]||(this.customIcons[n]=e.customIcons[n])}),this),this._editState&&this._editState.historyMaxItems||(this.historyMaxItems=e.historyMaxItems),this._editState&&this._editState.historyMaxSize||(this.historyMaxSize=e.historyMaxSize),this._editState&&this._editState.keyChangeRec||(this.keyChangeRec=e.keyChangeRec),this._editState&&this._editState.keyChangeForce||(this.keyChangeForce=e.keyChangeForce),this._editState&&this._editState.mntncHistoryDays||(this.mntncHistoryDays=e.mntncHistoryDays),this._editState&&this._editState.color||(this.color=e.color)},l.create=function(){var e=new Date,t=new l;return t.generator=A.Generator,t.settingsChanged=e,t.mntncHistoryDays=s.Defaults.MntncHistoryDays,t.recycleBinEnabled=!0,t.historyMaxItems=s.Defaults.HistoryMaxItems,t.historyMaxSize=s.Defaults.HistoryMaxSize,t.nameChanged=e,t.descChanged=e,t.defaultUserChanged=e,t.recycleBinChanged=e,t.keyChangeRec=-1,t.keyChangeForce=-1,t.entryTemplatesGroup=new i,t.entryTemplatesGroupChanged=e,t.memoryProtection={title:!1,userName:!1,password:!0,url:!1,notes:!1},t},l.read=function(e,t){for(var n=new l,r=0,i=e.childNodes,o=i.length;rthis.times.lastModTime&&this.copyFrom(t),this.groups=this._mergeCollection(this.groups,t.groups,e),this.entries=this._mergeCollection(this.entries,t.entries,e),this.groups.forEach((function(t){t.merge(e)})),this.entries.forEach((function(t){t.merge(e)})))},u.prototype._mergeCollection=function(e,t,n){var r=[];return e.forEach((function(e){if(!n.deleted[e.uuid]){var t=n.remote[e.uuid];t?t.times.locationChanged<=e.times.locationChanged&&r.push(e):r.push(e)}}),this),t.forEach((function(e,i){if(!n.deleted[e.uuid]){var o=n.objects[e.uuid];if(o&&e.times.locationChanged>o.times.locationChanged)o.parentGroup=this,r.splice(this._findInsertIx(r,t,i),0,o);else if(!o){var a=new e.constructor;a.copyFrom(e),a.parentGroup=this,r.splice(this._findInsertIx(r,t,i),0,a)}}}),this),r},u.prototype._findInsertIx=function(e,t,n){for(var r=e.length,i=-1,o=0;o<=e.length;o++){var a=0,s=n>0?t[n-1].uuid.id:void 0,A=n+10?e[o-1].uuid.id:void 0,u=oi&&(r=o,i=a)}return r},u.prototype.copyFrom=function(e){this.uuid=e.uuid,this.name=e.name,this.notes=e.notes,this.icon=e.icon,this.customIcon=e.customIcon,this.times=e.times.clone(),this.expanded=e.expanded,this.defaultAutoTypeSeq=e.defaultAutoTypeSeq,this.enableAutoType=e.enableAutoType,this.enableSearching=e.enableSearching,this.lastTopVisibleEntry=e.lastTopVisibleEntry},u.create=function(e,t){var n=new u;return n.uuid=A.random(),n.icon=o.Icons.Folder,n.times=s.create(),n.name=e,n.parentGroup=t,n.expanded=!0,n.enableAutoType=null,n.enableSearching=null,n.lastTopVisibleEntry=new A,n},u.read=function(e,t,n){for(var r=new u,i=0,o=e.childNodes,a=o.length;i0&&a.length>i&&!a.warned){a.warned=!0;var A=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");A.name="MaxListenersExceededWarning",A.emitter=e,A.type=t,A.count=a.length,s=A,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var A=i[e];if(void 0===A)return!1;if("function"==typeof A)o(A,this,t);else{var l=A.length,u=p(A,l);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},56:function(e,t,n){"use strict";t.__esModule=!0,t.extend=s,t.indexOf=function(e,t){for(var n=0,r=e.length;n":">",'"':""","'":"'","`":"`","=":"="},i=/[&<>"'`=]/g,o=/[&<>"'`=]/;function a(e){return r[e]}function s(e){for(var t=1;t