UNPKG

326 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Buttercup=e():t.Buttercup=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=65)}([function(t,e){const r={};function n(t){return r[t]||null}t.exports={credentialsAllowsPurpose:function(t,e){const{purposes:r}=n(t);return r.includes(e)},getCredentials:n,removeCredentials:function(t){r[t]=null,delete r[t]},setCredentials:function(t,e){r[t]=e}}},function(t,e,r){"use strict";var n=r(12),o=r(103);function i(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=o,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),o=0;o<t.length;o+=2)r.push(parseInt(t[o]+t[o+1],16))}else for(var n=0,o=0;o<t.length;o++){var s=t.charCodeAt(o);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):i(t,o)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++o)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(o=0;o<t.length;o++)r[o]=0|t[o];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var o=t[n];"little"===e&&(o=s(o)),r+=u(o.toString(16))}return r},e.zero2=a,e.zero8=u,e.join32=function(t,e,r,o){var i=r-e;n(i%4==0);for(var s=new Array(i/4),a=0,u=e;a<s.length;a++,u+=4){var c;c="big"===o?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=c>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,o=0;n<t.length;n++,o+=4){var i=t[n];"big"===e?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,o){return t+e+r+n+o>>>0},e.sum64=function(t,e,r,n){var o=t[e],i=n+t[e+1]>>>0,s=(i<n?1:0)+r+o;t[e]=s>>>0,t[e+1]=i},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,o,i,s,a){var u=0,c=e;return u+=(c=c+n>>>0)<e?1:0,u+=(c=c+i>>>0)<i?1:0,t+r+o+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,o,i,s,a){return e+n+i+a>>>0},e.sum64_5_hi=function(t,e,r,n,o,i,s,a,u,c){var f=0,l=e;return f+=(l=l+n>>>0)<e?1:0,f+=(l=l+i>>>0)<i?1:0,f+=(l=l+a>>>0)<a?1:0,t+r+o+s+u+(f+=(l=l+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,o,i,s,a,u,c){return e+n+i+a+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){const{getCredentials:n}=r(0),o={},i=[];t.exports={credentialsToDatasource:function(t){const{datasource:e}=n(t.id).data;if(!e)throw new Error("No datasource configuration in credentials");const{type:r}=e;if(!r)throw new Error("No datasource type specified in datasource configuration");const i=o[r];if(!i)throw new Error("No datasource found for type: "+r);return new i(t)},fireInstantiationHandlers:function(t,e){i.forEach(r=>{try{r(t,e)}catch(t){console.error("Failed executing a datasource instantiation handler for a datasource"),console.error(t)}})},registerDatasource:function(t,e){o[t]=e},registerDatasourcePostProcessor:function(t){return i.push(t),{remove:()=>{const e=i.indexOf(t);e>=0&&i.splice(e,1)}}}}},function(t,e,r){var n=r(84),o=r(16),i=r(91),s=r(92).isError,a=i.sprintf;function u(t){var e,r,o,i;if(n.object(t,"args"),n.bool(t.strict,"args.strict"),n.array(t.argv,"args.argv"),0===(e=t.argv).length)r={},o=[];else if(s(e[0]))r={cause:e[0]},o=e.slice(1);else if("object"==typeof e[0]){for(i in r={},e[0])r[i]=e[0][i];o=e.slice(1)}else n.string(e[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},o=e;return n.object(r),r.strict||t.strict||(o=o.map((function(t){return null===t?"null":void 0===t?"undefined":t}))),{options:r,shortmessage:0===o.length?"":a.apply(null,o)}}function c(){var t,e,r,o,i,a,f;if(t=Array.prototype.slice.call(arguments,0),!(this instanceof c))return e=Object.create(c.prototype),c.apply(e,arguments),e;if((r=u({argv:t,strict:!1})).options.name&&(n.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(o=r.options.cause)&&(n.ok(s(o),"cause is not an Error"),this.jse_cause=o,r.options.skipCauseMessage||(a+=": "+o.message)),this.jse_info={},r.options.info)for(f in r.options.info)this.jse_info[f]=r.options.info[f];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(i=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,i)),this}function f(){var t,e,r,n;return t=Array.prototype.slice.call(arguments,0),this instanceof f?(n=(r=u({argv:t,strict:!0})).options,c.call(this,n,"%s",r.shortmessage),this):(e=Object.create(f.prototype),f.apply(e,arguments),e)}function l(t){n.array(t,"list of errors"),n.ok(t.length>0,"must be at least one error"),this.ase_errors=t,c.call(this,{cause:t[0]},"first of %d error%s",t.length,1==t.length?"":"s")}function h(){var t,e,r,n;return t=Array.prototype.slice.call(arguments,0),this instanceof h?((n=(r=u({argv:t,strict:!1})).options).skipCauseMessage=!0,c.call(this,n,"%s",r.shortmessage),this):(e=Object.create(h.prototype),h.apply(e,t),e)}t.exports=c,c.VError=c,c.SError=f,c.WError=h,c.MultiError=l,o.inherits(c,Error),c.prototype.name="VError",c.prototype.toString=function(){var t=this.hasOwnProperty("name")&&this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t+=": "+this.message),t},c.prototype.cause=function(){var t=c.cause(this);return null===t?void 0:t},c.cause=function(t){return n.ok(s(t),"err must be an Error"),s(t.jse_cause)?t.jse_cause:null},c.info=function(t){var e,r,o;if(n.ok(s(t),"err must be an Error"),e=null!==(r=c.cause(t))?c.info(r):{},"object"==typeof t.jse_info&&null!==t.jse_info)for(o in t.jse_info)e[o]=t.jse_info[o];return e},c.findCauseByName=function(t,e){var r;for(n.ok(s(t),"err must be an Error"),n.string(e,"name"),n.ok(e.length>0,"name cannot be empty"),r=t;null!==r;r=c.cause(r))if(n.ok(s(r)),r.name==e)return r;return null},c.hasCauseWithName=function(t,e){return null!==c.findCauseByName(t,e)},c.fullStack=function(t){n.ok(s(t),"err must be an Error");var e=c.cause(t);return e?t.stack+"\ncaused by: "+c.fullStack(e):t.stack},c.errorFromList=function(t){return n.arrayOfObject(t,"errors"),0===t.length?null:(t.forEach((function(t){n.ok(s(t))})),1==t.length?t[0]:new l(t))},c.errorForEach=function(t,e){n.ok(s(t),"err must be an Error"),n.func(e,"func"),t instanceof l?t.errors().forEach((function(t){e(t)})):e(t)},o.inherits(f,c),o.inherits(l,c),l.prototype.name="MultiError",l.prototype.errors=function(){return this.ase_errors.slice(0)},o.inherits(h,c),h.prototype.name="WError",h.prototype.toString=function(){var t=this.hasOwnProperty("name")&&this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t+=": "+this.message),this.jse_cause&&this.jse_cause.message&&(t+="; caused by "+this.jse_cause.toString()),t},h.prototype.cause=function(t){return s(t)&&(this.jse_cause=t),this.jse_cause}},function(t,e,r){const{v4:n}=r(32);t.exports={generateUUID:function(){return n()}}},function(t,e,r){const n=r(48),{generateUUID:o}=r(4),{getEntryURLs:i}=r(49),{findEntryByID:s,findGroupContainingEntryID:a}=r(22);class u extends n{static createNew(t,e){const r=t.findGroupByID(e);if(!r)throw new Error("Failed creating entry: no group found for ID: "+e);if(r.isTrash()||r.isInTrash())throw new Error("Failed creating entry: cannot create within Trash group");const n=o();return t.format.createEntry(e,n),t.findEntryByID(n)}get type(){return"Entry"}delete(t=!1){const e=this.vault.getTrashGroup(),r=this.getGroup();return!e||!r||r.isTrash()||r.isInTrash()||t?(this.vault.format.deleteEntry(this.id),this._cleanUp(),!0):(this.moveToGroup(e),!1)}deleteAttribute(t){return this.vault.format.deleteEntryAttribute(this.id,t),this}deleteProperty(t){return this.vault.format.deleteEntryProperty(this.id,t),this}getAttribute(t){const e=this._source.attributes||{};return void 0===t?Object.assign({},e):e.hasOwnProperty(t)?e[t]:void 0}getChanges(){return this._source.history||[]}getGroup(){const t=a(this.vault.format.source.groups||[],this.id);if(!t||!t.group)throw new Error("No parent group found for entry: "+this.id);return new(r(25))(this.vault,t.group)}getProperty(t){const e=this._source.properties;return void 0===t?Object.assign({},e):e.hasOwnProperty(t)?e[t]:void 0}getProperties(t){if(void 0===t)return this.getProperty();const e=this._source.properties,r=t instanceof RegExp;return Object.keys(e).reduce((n,o)=>(r?t.test(o):t===o)?Object.assign(n,{[o]:e[o]}):n,{})}getURLs(t){return i(this.getProperty(),t)}isInTrash(){return this.getGroup().isInTrash()||this.getGroup().isTrash()}moveToGroup(t){return this.vault.format.moveEntry(this.id,t.id),this}setAttribute(t,e){return this.vault.format.setEntryAttribute(this.id,t,e),this}setProperty(t,e){return this.vault.format.setEntryProperty(this.id,t,e),this}}var c,f,l;c=u,f="Attributes",l=Object.freeze({FacadeType:"BC_ENTRY_FACADE_TYPE",FieldTypePrefix:"BC_ENTRY_FIELD_TYPE:"}),f in c?Object.defineProperty(c,f,{value:l,enumerable:!0,configurable:!0,writable:!0}):c[f]=l,t.exports=u},function(t,e,r){const n=r(59),o=r(51),i=r(11),{credentialsAllowsPurpose:s}=r(0),{detectFormat:a,getDefaultFormat:u}=r(17),{fireInstantiationHandlers:c,registerDatasource:f}=r(2);class l extends n{constructor(t){super(),this._credentials=t,this._credentials.restrictPurposes([i.PURPOSE_SECURE_EXPORT]),this._content="",this.type="text",c("text",this)}get credentials(){return this._credentials}get hasContent(){return this._content&&this._content.length>0}getID(){const t="text"===this.toObject().type?this._content:this.toString();if(!t)throw new Error("Failed getting ID: Datasource requires content for ID generation");return o.sha256().update(t).digest("hex")}load(t){if(!this._content)return Promise.reject(new Error("Failed to load vault: Content is empty"));if(!0!==s(t.id,i.PURPOSE_DECRYPT_VAULT))return Promise.reject(new Error("Provided credentials don't allow vault decryption"));const e=a(this._content);return e.parseEncrypted(this._content,t).then(t=>({Format:e,history:t}))}save(t,e){return!0!==s(e.id,i.PURPOSE_ENCRYPT_VAULT)?Promise.reject(new Error("Provided credentials don't allow vault encryption")):u().encodeRaw(t,e)}setContent(t){return this._content=t||"",this}supportsPasswordChange(){return!1}supportsRemoteBypass(){return!1}}f("text",l),t.exports=l},function(t,e,r){"use strict";r.r(e),r.d(e,"isBrowser",(function(){return o}));var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o="object"===("undefined"==typeof window?"undefined":n(window))&&"object"===("undefined"==typeof document?"undefined":n(document))&&9===document.nodeType;e.default=o},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function i(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new s(r,n||t,i),u=o?o+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function c(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),c.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)n.call(t,e)&&r.push(o?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},c.prototype.listeners=function(t){var e=o?o+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,s=new Array(i);n<i;n++)s[n]=r[n].fn;return s},c.prototype.listenerCount=function(t){var e=o?o+t:t,r=this._events[e];return r?r.fn?1:r.length:0},c.prototype.emit=function(t,e,r,n,i,s){var a=o?o+t:t;if(!this._events[a])return!1;var u,c,f=this._events[a],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,r),!0;case 4:return f.fn.call(f.context,e,r,n),!0;case 5:return f.fn.call(f.context,e,r,n,i),!0;case 6:return f.fn.call(f.context,e,r,n,i,s),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var h,p=f.length;for(c=0;c<p;c++)switch(f[c].once&&this.removeListener(t,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,e);break;case 3:f[c].fn.call(f[c].context,e,r);break;case 4:f[c].fn.call(f[c].context,e,r,n);break;default:if(!u)for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];f[c].fn.apply(f[c].context,u)}}return!0},c.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},c.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},c.prototype.removeListener=function(t,e,r,n){var i=o?o+t:t;if(!this._events[i])return this;if(!e)return u(this,i),this;var s=this._events[i];if(s.fn)s.fn!==e||n&&!s.once||r&&s.context!==r||u(this,i);else{for(var a=0,c=[],f=s.length;a<f;a++)(s[a].fn!==e||n&&!s[a].once||r&&s[a].context!==r)&&c.push(s[a]);c.length?this._events[i]=1===c.length?c[0]:c:u(this,i)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=o?o+t:t,this._events[e]&&u(this,e)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=o,c.EventEmitter=c,t.exports=c},function(t,e,r){const{getSharedAppEnv:n}=r(33);t.exports={getSharedAppEnv:n}},function(t,e,r){function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const{generateUUID:o}=r(4),{credentialsAllowsPurpose:i,getCredentials:s,removeCredentials:a,setCredentials:u}=r(0),{getSharedAppEnv:c}=r(10);function f(t){return"bc~3>"+t}class l{static allPurposes(){return[l.PURPOSE_DECRYPT_VAULT,l.PURPOSE_ENCRYPT_VAULT,l.PURPOSE_SECURE_EXPORT]}static fromCredentials(t,e){if(!e)throw new Error("Master password is required for credentials cloning");const r=s(t.id);if(r.masterPassword!==e)throw new Error("Master password does not match that of the credentials to be cloned");const n=JSON.parse(JSON.stringify(r.data));return new l(n,e)}static fromDatasource(t,e=null){return new l({datasource:t},e)}static fromPassword(t,e=null){return new l({password:t},e||t)}static fromSecureString(t,e){return c().getProperty("crypto/v1/decryptText")(function(t){const e=t.indexOf("bc~3>"),r=t.indexOf("b~>buttercup/acreds.v2.");if(-1===e&&-1===r)throw new Error("Invalid credentials content (unknown signature)");return 0===e?t.substr("bc~3>".length):t.substr("b~>buttercup/acreds.v2.".length)}(t),e).then(t=>JSON.parse(t)).then(t=>(t.datasource&&("string"==typeof t.datasource&&(t.datasource=JSON.parse(t.datasource)),t.username&&(t.datasource.username=t.username,delete t.username),t.password&&(t.datasource.password=t.password,delete t.password)),new l(t,e)))}static isCredentials(t){return!!t&&"object"==typeof t&&"function"==typeof t.toSecureString&&!!t.id}constructor(t={},e=null){const r=o();Object.defineProperty(this,"id",{writable:!1,configurable:!1,enumerable:!0,value:r}),u(r,{data:t,masterPassword:e,purposes:l.allPurposes()})}restrictPurposes(t){const e=s(this.id),{purposes:r}=e,n=t.filter(t=>r.includes(t));return u(this.id,Object.assign(e,{purposes:n})),this}toSecureString(){if(!0!==i(this.id,l.PURPOSE_SECURE_EXPORT))return Promise.reject(new Error("Credential purposes don't allow for secure exports"));const t=c().getProperty("crypto/v1/encryptText"),{data:e,masterPassword:r}=s(this.id);return"string"!=typeof r?Promise.reject(new Error("Cannot convert Credentials to string: master password was not set or is invalid")):t(JSON.stringify(e),r).then(f)}}n(l,"PURPOSE_DECRYPT_VAULT","vault-decrypt"),n(l,"PURPOSE_ENCRYPT_VAULT","vault-encrypt"),n(l,"PURPOSE_SECURE_EXPORT","secure-export"),t.exports=l},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n=r(1),o=r(12);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var o=0;o<t.length;o+=this._delta32)this._update(t,o,o+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),o(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t>>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=255&t}else for(n[o++]=255&t,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n}},function(t,e){const r={credit_card:{title:"Credit Card",slug:"credit_card"},login:{title:"Login",slug:"login"},note:{title:"Note",slug:"note"},ssh_key:{title:"SSH Key Pair",slug:"ssh_key"},website:{title:"Website Login",slug:"website"}},n={note:{title:"Note",slug:"note"},otp:{title:"OTP (One Time Password)",slug:"otp"},password:{title:"Password (secret)",slug:"password"},text:{title:"Text (default)",slug:"text"}};t.exports={DEFAULT_ENTRY_TYPE:"login",DEFAULT_FIELD_TYPE:"text",ENTRY_TYPE_CREDITCARD:"credit_card",ENTRY_TYPE_LOGIN:"login",ENTRY_TYPE_NOTE:"note",ENTRY_TYPE_SSHKEY:"ssh_key",ENTRY_TYPE_WEBSITE:"website",ENTRY_TYPES:r,FACADE_VERSION:2,FIELD_VALUE_TYPE_NOTE:"note",FIELD_VALUE_TYPE_OTP:"otp",FIELD_VALUE_TYPE_PASSWORD:"password",FIELD_VALUE_TYPE_TEXT:"text",FIELD_VALUE_TYPES:n}},function(t,e,r){"use strict";(function(t){
2/*!
3 * The buffer module from node.js, for the browser.
4 *
5 * @author Feross Aboukhadijeh <http://feross.org>
6 * @license MIT
7 */
8var n=r(85),o=r(86),i=r(87);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=a(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return M(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===u)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var l=!0,h=0;h<u;h++)if(c(t,i+h)!==c(e,h)){l=!1;break}if(l)return i}return-1}function b(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function w(t,e,r,n){return G(M(e,t.length-r),t,r,n)}function _(t,e,r,n){return G(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return _(t,e,r,n)}function A(t,e,r,n){return G(q(e),t,r,n)}function x(t,e,r,n){return G(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return c(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return l(null,t)},u.allocUnsafeSlow=function(t){return l(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),l=0;l<a;++l)if(c[l]!==f[l]){i=c[l],s=f[l];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return E(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function P(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function C(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=B(t[i]);return o}function R(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function j(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function D(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function k(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function F(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,i){return i||F(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||F(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;r=new u(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||j(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||j(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||j(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||j(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||j(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||j(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||j(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||j(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||j(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||j(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||j(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||j(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||j(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);I(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);I(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=u.isBuffer(t)?t:M(new u(t,n).toString()),a=s.length;for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function M(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function q(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(8))},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r<i;u=n[++r])g(u)||!w(u)?s+=" "+u:s+=" "+a(u);return s},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),o=!0}return r.apply(this,arguments)}};var i,s={};function a(t,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function c(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return m(o)||(o=f(t,o,n)),o}var i=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(y(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,r);if(i)return i;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),E(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(b(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return l(r)}var c,w="",x=!1,T=["{","}"];(p(r)&&(x=!0,T=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),_(r)&&(w=" "+Date.prototype.toUTCString.call(r)),E(r)&&(w=" "+l(r)),0!==s.length||x&&0!=r.length?n<0?b(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=x?function(t,e,r,n,o){for(var i=[],s=0,a=e.length;s<a;++s)P(e,String(s))?i.push(h(t,e,r,n,String(s),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(h(t,e,r,n,o,!0))})),i}(t,r,n,a,s):s.map((function(e){return h(t,r,n,a,e,x)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,w,T)):T[0]+w+T[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,o,i){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),P(n,o)||(s="["+o+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),v(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function y(t){return"number"==typeof t}function m(t){return"string"==typeof t}function v(t){return void 0===t}function b(t){return w(t)&&"[object RegExp]"===x(t)}function w(t){return"object"==typeof t&&null!==t}function _(t){return w(t)&&"[object Date]"===x(t)}function E(t){return w(t)&&("[object Error]"===x(t)||t instanceof Error)}function A(t){return"function"==typeof t}function x(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(v(i)&&(i=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var n=t.pid;s[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else s[r]=function(){};return s[r]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=d,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=y,e.isString=m,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=b,e.isObject=w,e.isDate=_,e.isError=E,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(89);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(){var t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",O(),e.format.apply(e,arguments))},e.inherits=r(90),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(C&&t[C]){var e;if("function"!=typeof(e=t[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,C,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),C&&Object.defineProperty(e,C,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=C,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var o=r.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,s=function(){return o.apply(i,arguments)};e.apply(this,r).then((function(e){t.nextTick(s,null,e)}),(function(e){t.nextTick(R,e,s)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(21))},function(t,e,r){const n=r(43);function o(){return n}t.exports={detectFormat:function(t){return o()},getDefaultFormat:o}},function(t,e,r){const{v4:n}=r(32),{isOTPURI:o}=r(58),{FIELD_VALUE_TYPE_NOTE:i,FIELD_VALUE_TYPE_OTP:s,FIELD_VALUE_TYPE_PASSWORD:a,FIELD_VALUE_TYPE_TEXT:u}=r(14),c=[i,s,a,u];function f(t,e,r){switch(e){case"property":return t.getProperty(r);case"attribute":return t.getAttribute(r);default:throw new Error("Cannot retrieve value: Unknown property type: "+e)}}function l(t,e){if(!t)return u;const n=r(5),o=t.getAttribute(`${n.Attributes.FieldTypePrefix}${e}`);return c.indexOf(o)>=0?o:u}t.exports={createFieldDescriptor:function(t,e,r,o,{formatting:i=!1,removeable:s=!1,valueType:a=null}={}){const u=t?f(t,r,o):"";return{id:n(),title:e,propertyType:r,property:o,value:u,valueType:a||("attribute"===r?null:l(t,o)),formatting:i,removeable:s}},getEntryValue:f,getEntryValueType:l,idSignifiesNew:function(t){if(!1===/^\d+$/.test(t))return!1;const e=parseInt(t,10);return!isNaN(e)&&e>0&&e<=999999},setEntryValueType:function(t,e,n){const o=r(5);t.setAttribute(`${o.Attributes.FieldTypePrefix}${e}`,n)}}},function(t,e,r){const n=r(36),o=r(37),{TASK_TYPE_HIGH_PRIORITY:i,TASK_TYPE_NORMAL:s,TASK_TYPE_TAIL:a}=o;function u(t,e){const{type:r,created:n}=t,{type:o,created:s}=e;return r===i&&o!==i?-1:o===i&&r!==i?1:o===a&&r!==a?-1:r===a&&o!==a?1:n<s?-1:s<n?1:0}t.exports=class extends n{constructor(t){if(super(),"string"!=typeof t||t.length<=0)throw new Error("Failed creating Channel: Invalid or empty name");this._name=t,this._tasks=[],this._running=!1,this._autostart=!0}get autostart(){return this._autostart}get isEmpty(){return!this.isRunning&&0===this.tasks.length}get isRunning(){return this._running}get tasks(){return this._tasks}set autostart(t){this._autostart=!!t}set isRunning(t){this._running=t}clear(t){if(t)for(let e=this.tasks.length-1;e>=0;e-=1)this.tasks[e].type===t&&this.tasks.splice(e,1);else this.tasks.splice(0,1/0)}enqueue(t,e,r=null){if(r){const t=this.getStackedItems(r);if(t.length>0)return t[t.length-1].queuedPromise}const n=new o(t,e,r);return this.tasks.push(n),this.sort(),this.autostart&&this.start(),n.queuedPromise}getStackedItems(t){return this.tasks.filter(e=>e.stack&&e.stack===t)}retrieveNextItem(){return this.tasks.shift()}sort(){this.tasks.sort(u)}start(){return!this.isRunning&&(this.emit("started"),this.isRunning=!0,setTimeout(()=>this._runNextItem(),0),!0)}_runNextItem(){const t=this.retrieveNextItem();t?t.execute().then(()=>this._runNextItem()):(this.isRunning=!1,this.emit("stopped"))}}},function(t,e){t.exports=class{getAllKeys(){return Promise.resolve([])}getValue(){return Promise.resolve(null)}removeKey(){return Promise.resolve()}setValue(){return Promise.resolve()}}},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&p())}function p(){if(!f){var t=a(h);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l<e;)u&&u[l].run();l=-1,e=c.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||f||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){function r(t,e){for(let n=0,o=t.length;n<o;n+=1){if(!0===e(t[n]))return t[n];if(t[n].groups){const o=r(t[n].groups,e);if(o)return o}}return null}t.exports={findEntryByID:function t(e,r){for(let n=0,o=e.length;n<o;n+=1){const o=e[n];if(o.entries)for(let t=0,e=o.entries.length;t<e;t+=1)if(o.entries[t].id===r)return o.entries[t];if(o.groups){const e=t(o.groups,r);if(e)return e}}return null},findGroupByCheck:r,findGroupByID:function(t,e){return r(t,(function(t){return t.id===e}))},findGroupByTitle:function(t,e){return r(t,(function(t){return t.title===e}))},findGroupContainingEntryID:function t(e,r){for(let i=0,s=e.length;i<s;i+=1){const s=e[i];if(s.entries)for(var n=0,o=s.entries.length;n<o;n+=1)if(s.entries[n].id===r)return{group:s,index:n};if(s.groups){const e=t(s.groups,r);if(e.group)return e}}return{group:null,index:null}},findGroupContainingGroupID:function t(e,r){const n=e.groups||[];for(let o=0,i=n.length;o<i;o+=1){if(n[o].id===r)return{group:e,index:o};const i=t(n[o],r);if(i.group)return i}return{group:null,index:null}}}},function(t,e,r){const{encodeStringValue:n}=r(24),{generateUUID:o}=r(4),i={ItemID:{test:/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i,wrap:function(t){return t},encode:!1},ItemIDOrRoot:{test:/^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|0)$/i,wrap:function(t){return t},encode:!1},StringKey:{test:/\S+/,wrap:function(t){return n(t)},encode:!0},StringValue:{test:/(^[\s\S]+$|^$)/,wrap:function(t){return n(t)},encode:!0}},s={ArchiveID:{s:"aid",d:!1,args:[i.ItemID]},Comment:{s:"cmm",d:!1,args:[i.StringValue]},CreateEntry:{s:"cen",d:!1,args:[i.ItemID,i.ItemID]},CreateGroup:{s:"cgr",d:!1,args:[i.ItemIDOrRoot,i.ItemID]},DeleteArchiveAttribute:{s:"daa",d:!0,args:[i.StringValue]},DeleteEntry:{s:"den",d:!0,args:[i.ItemID]},DeleteEntryAttribute:{s:"dea",d:!0,args:[i.ItemID,i.StringValue]},DeleteEntryMeta:{s:"dem",d:!0,args:[i.ItemID,i.StringValue]},DeleteEntryProperty:{s:"dep",d:!0,args:[i.ItemID,i.StringValue]},DeleteGroup:{s:"dgr",d:!0,args:[i.ItemID]},DeleteGroupAttribute:{s:"dga",d:!0,args:[i.ItemID,i.StringValue]},Format:{s:"fmt",d:!1,args:[i.StringValue]},MoveEntry:{s:"men",d:!1,args:[i.ItemID,i.ItemID]},MoveGroup:{s:"mgr",d:!1,args:[i.ItemID,i.ItemIDOrRoot]},Pad:{s:"pad",d:!1,args:[i.ItemID]},SetArchiveAttribute:{s:"saa",d:!1,args:[i.StringValue,i.StringValue]},SetEntryAttribute:{s:"sea",d:!1,args:[i.ItemID,i.StringValue,i.StringValue]},SetEntryMeta:{s:"sem",d:!1,args:[i.ItemID,i.StringValue,i.StringValue]},SetEntryProperty:{s:"sep",d:!1,args:[i.ItemID,i.StringKey,i.StringValue]},SetGroupAttribute:{s:"sga",d:!1,args:[i.ItemID,i.StringValue,i.StringValue]},SetGroupTitle:{s:"tgr",d:!1,args:[i.ItemID,i.StringValue]}};class a{static create(t){return new a(t)}static generatePaddingCommand(){return a.create(s.Pad).addArgument(o()).generateCommand()}constructor(t){this._commandKey=t,this._commandArgs=[]}addArgument(t){const e=this._commandArgs.length,r=this._commandKey.args,n=!(r.length<=e)&&r[e];if(!1===n)throw new Error(`Failed adding argument for command "${this._commandKey.s}": too many arguments`);if(!n.test.test(t))throw new Error(`Failed adding argument for command "${this._commandKey.s}": argument ${e} is of invalid format`);return this._commandArgs.push(n.wrap(t)),this}generateCommand(){return[this._commandKey.s].concat(this._commandArgs).join(" ")}}var u,c,f;f=s,(c="Command")in(u=a)?Object.defineProperty(u,c,{value:f,enumerable:!0,configurable:!0,writable:!0}):u[c]=f,t.exports={COMMAND_ARGUMENT:i,COMMAND_MANIFEST:s,InigoCommand:a,extractCommandComponents:function(t){const e=/("[^"]*")/,r=[];let n,o=t.replace(/\\\"/g,"__ESCAPED_QUOTE__");for(;n=e.exec(o);){const[t]=n;o=o.substr(0,n.index)+"__QUOTEDSTR__"+o.substr(n.index+t.length),r.push(t.substring(1,t.length-1))}return o.split(" ").map(t=>{let e=t.trim();return"__QUOTEDSTR__"===e&&(e=r.shift()),e=e.replace(new RegExp("__ESCAPED_QUOTE__","g"),'"'),e})},generateEntryHistoryItem:function(t,e,r=null,n=null){return Object.freeze({property:t,propertyType:e,originalValue:r,newValue:n})},historyArrayToString:function(t){return t.join("\n")},historyStringToArray:function(t){return t.split("\n")},stripDestructiveCommands:function(t){const e=Object.keys(s).map(t=>s[t]).filter(t=>t.d).map(t=>t.s);return t.filter(t=>{return e.indexOf((r=t)&&r.length>=3?r.substr(0,3):"")<0;var r})}}},function(t,e,r){const{Base64:n}=r(44),{generateUUID:o}=r(4),i=/^utf8\+base64:(|[a-zA-Z0-9+\/=]+)$/;function s(t){return i.test(t)}t.exports={ENCODED_STRING_PREFIX:"utf8+base64:",decodeStringValue:function(t){if(!0!==s(t))throw new Error("Cannot decode: provided value is not encoded");const e=t.substr("utf8+base64:".length);return n.decode(e)},encodeStringValue:function(t){return"utf8+base64:"+n.encode(t)},getUniqueID:function(){return o()},isEncoded:s}},function(t,e,r){const n=r(48),o=r(5),{generateUUID:i}=r(4),{moveGroupBetweenVaults:s}=r(50),{findGroupByID:a,findGroupsByTitle:u}=r(46),{findEntriesByProperty:c,findEntryByID:f}=r(47),{findGroupContainingGroupID:l}=r(22);class h extends n{static createNew(t,e="0"){if("0"!==e){const r=t.findGroupByID(e);if(!r)throw new Error("Failed creating group: no group found for ID: "+e);if(r.isTrash()||r.isInTrash())throw new Error("Failed creating group: cannot create within Trash group")}const r=i();return t.format.createGroup(e,r),t.findGroupByID(r)}get type(){return"Group"}createEntry(t){const e=o.createNew(this.vault,this.id);return t&&e.setProperty("title",t),e}createGroup(t){const e=h.createNew(this.vault,this.id);return t&&e.setTitle(t),e}delete(t=!1){if(this.isTrash())throw new Error("Trash group cannot be deleted");const e=this.vault.getTrashGroup(),r=null!==e;return this.isInTrash()||!r||t?(this.vault.format.deleteGroup(this.id),this._cleanUp(),!0):(this.moveTo(e),!1)}deleteAttribute(t){return this.vault.format.deleteGroupAttribute(this.id,t),this}findEntryByID(t){return f([this],t)}findEntriesByProperty(t,e){return c([this],t,e)}findGroupByID(t){return a([this],t)}findGroupsByTitle(t){return u([this],t)}getAttribute(t){const e=this._source.attributes||{};return void 0===t?Object.assign({},e):e.hasOwnProperty(t)?e[t]:void 0}getEntries(){return(this._source.entries||[]).map(t=>new o(this.vault,t))}getGroups(){return(this._source.groups||[]).map(t=>new h(this.vault,t))}getParentGroup(){if(this.vault.getGroups().map(t=>t.id).indexOf(this.id)>=0)return null;const t=l(this.vault.format.source,this.id);if(t&&t.group)return new h(this.vault,t.group);throw new Error("No parent group: group is detacted")}getTitle(){return this._source.title||""}isInTrash(){const t=this.vault.getTrashGroup();if(t){return null!==t.findGroupByID(this.id)}return!1}isTrash(){return"trash"===this.getAttribute(h.Attribute.Role)}moveTo(t){if(this.isTrash())throw new Error("Trash group cannot be moved");let e,r;if("Group"===t.type)e=t.vault,r=t.id;else{if("Vault"!==t.type)throw new Error("Unknown remote type: "+t.type);e=t,r="0"}if(this.vault.readOnly)throw new Error("Cannot move group: origin archive is read-only");if(e.readOnly)throw new Error("Cannot move group: target archive is read-only");return this.vault.id===e.id?this.vault.format.moveGroup(this.id,r):s(this,t),this}setAttribute(t,e){return this.vault.format.setGroupAttribute(this.id,t,e),this}setTitle(t){return this.vault.format.setGroupTitle(this.id,t),this}}var p,d,g;p=h,d="Attribute",g=Object.freeze({Role:"bc_group_role"}),d in p?Object.defineProperty(p,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):p[d]=g,t.exports=h},function(t,e){function r(t){this.dict=t||{}}r.prototype.set=function(t,e,r){if("object"!=typeof t){void 0===r&&(r=!0);var n=this.has(t);return!r&&n?this.dict[n]=this.dict[n]+","+e:this.dict[n||t]=e,n}for(var o in t)this.set(o,t[o],e)},r.prototype.has=function(t){for(var e=Object.keys(this.dict),r=(t=t.toLowerCase(),0);r<e.length;r++)if(e[r].toLowerCase()===t)return e[r];return!1},r.prototype.get=function(t){var e,r;t=t.toLowerCase();var n=this.dict;return Object.keys(n).forEach((function(o){r=o.toLowerCase(),t===r&&(e=n[o])})),e},r.prototype.swap=function(t){var e=this.has(t);if(e!==t){if(!e)throw new Error('There is no header than matches "'+t+'"');this.dict[t]=this.dict[e],delete this.dict[e]}},r.prototype.del=function(t){var e=this.has(t);return delete this.dict[e||t]},t.exports=function(t){return new r(t)},t.exports.httpify=function(t,e){var n=new r(e);return t.setHeader=function(t,e,r){if(void 0!==e)return n.set(t,e,r)},t.hasHeader=function(t){return n.has(t)},t.getHeader=function(t){return n.get(t)},t.removeHeader=function(t){return n.del(t)},t.headers=n.dict,n}},function(t,e,r){"use strict";function n(t){for(var e={},r={},n=0;n<t.length;n+=2){var o=t[n],i=o.toLowerCase(),s=e[i],a=t[n+1];r.hasOwnProperty(s)?(o!==s&&(r[o]=r[s],delete r[s]),"string"==typeof r[o]?r[o]=[r[o],a]:r[o].push(a)):r[o]=a,e[i]=o}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.parse=function(t){for(var e=[],r=t.replace(/\r?\n$/,"").split(/\r?\n/),o=0;o<r.length;o++){var i=r[o],s=i.indexOf(":"),a=i.substr(0,s).trim(),u=i.substr(s+1).trim();e.push(a,u)}return n(e)},e.http=function(t){if(t.rawHeaders)return n(t.rawHeaders);var e={};return Object.keys(t.headers).forEach((function(r){var n=t.headers[r];1===n.length?e[r]=n[0]:e[r]=n})),e},e.array=n},function(t,e,r){"use strict";const n=r(120),o=r(121),i=r(122);function s(t,e){return e.encode?e.strict?n(t):encodeURIComponent(t):t}function a(t,e){return e.decode?o(t):t}function u(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function c(t){const e=(t=u(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function f(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function l(t,e){const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=r):n[t]=r};case"bracket":return(t,r,n)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==n[t]?n[t]=[].concat(n[t],r):n[t]=[r]:n[t]=r};case"comma":return(t,e,r)=>{const n="string"==typeof e&&e.split("").indexOf(",")>-1?e.split(","):e;r[t]=n};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",parseNumbers:!1,parseBooleans:!1},e)),n=Object.create(null);if("string"!=typeof t)return n;if(!(t=t.trim().replace(/^[?#&]/,"")))return n;for(const o of t.split("&")){let[t,s]=i(e.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:a(s,e),r(a(t,e),s,n)}for(const t of Object.keys(n)){const r=n[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=f(r[t],e);else n[t]=f(r,e)}return!1===e.sort?n:(!0===e.sort?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((t,e)=>{const r=n[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(r):t[e]=r,t},Object.create(null))}e.extract=c,e.parse=l,e.stringify=(t,e)=>{if(!t)return"";const r=function(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const o=r.length;return void 0===n||t.skipNull&&null===n?r:null===n?[...r,[s(e,t),"[",o,"]"].join("")]:[...r,[s(e,t),"[",s(o,t),"]=",s(n,t)].join("")]};case"bracket":return e=>(r,n)=>void 0===n||t.skipNull&&null===n?r:null===n?[...r,[s(e,t),"[]"].join("")]:[...r,[s(e,t),"[]=",s(n,t)].join("")];case"comma":return e=>(r,n)=>null==n||0===n.length?r:0===r.length?[[s(e,t),"=",s(n,t)].join("")]:[[r,s(n,t)].join(",")];default:return e=>(r,n)=>void 0===n||t.skipNull&&null===n?r:null===n?[...r,s(e,t)]:[...r,[s(e,t),"=",s(n,t)].join("")]}}(e=Object.assign({encode:!0,strict:!0,arrayFormat:"none"},e)),n=Object.assign({},t);if(e.skipNull)for(const t of Object.keys(n))void 0!==n[t]&&null!==n[t]||delete n[t];const o=Object.keys(n);return!1!==e.sort&&o.sort(e.sort),o.map(n=>{const o=t[n];return void 0===o?"":null===o?s(n,e):Array.isArray(o)?o.reduce(r(n),[]).join("&"):s(n,e)+"="+s(o,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>({url:u(t).split("?")[0]||"",query:l(c(t),e)})},function(t,e,r){"use strict";
9/*!
10 * isArrayBuffer v1.0.1
11 * https://github.com/fengyuanchen/is-array-buffer
12 *
13 * Copyright (c) 2015-2018 Chen Fengyuan
14 * Released under the MIT license
15 *
16 * Date: 2018-04-01T07:19:08.136Z
17 */var n="function"==typeof ArrayBuffer,o=Object.prototype.toString;t.exports=function(t){return n&&(t instanceof ArrayBuffer||"[object ArrayBuffer]"===o.call(t))}},function(t,e){t.exports=XMLHttpRequest},function(t,e,r){(function(r){var n;n=1===r.from(new Uint8Array([1]).buffer)[0]?function(t){return r.from(t)}:function(t){for(var e=r.alloc(t.byteLength),n=new Uint8Array(t),o=0;o<e.length;++o)e[o]=n[o];return e},t.exports&&(e=t.exports=n),e.arrayBufferToBuffer=n}).call(this,r(15).Buffer)},function(t,e,r){"use strict";r.r(e),r.d(e,"v1",(function(){return p})),r.d(e,"v3",(function(){return E})),r.d(e,"v4",(function(){return A})),r.d(e,"v5",(function(){return S}));var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),o=new Uint8Array(16);function i(){if(!n)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(o)}for(var s=[],a=0;a<256;++a)s.push((a+256).toString(16).substr(1));var u,c,f=function(t,e){var r=e||0,n=s;return(n[t[r+0]]+n[t[r+1]]+n[t[r+2]]+n[t[r+3]]+"-"+n[t[r+4]]+n[t[r+5]]+"-"+n[t[r+6]]+n[t[r+7]]+"-"+n[t[r+8]]+n[t[r+9]]+"-"+n[t[r+10]]+n[t[r+11]]+n[t[r+12]]+n[t[r+13]]+n[t[r+14]]+n[t[r+15]]).toLowerCase()},l=0,h=0;var p=function(t,e,r){var n=e&&r||0,o=e||[],s=(t=t||{}).node||u,a=void 0!==t.clockseq?t.clockseq:c;if(null==s||null==a){var p=t.random||(t.rng||i)();null==s&&(s=u=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==a&&(a=c=16383&(p[6]<<8|p[7]))}var d=void 0!==t.msecs?t.msecs:Date.now(),g=void 0!==t.nsecs?t.nsecs:h+1,y=d-l+(g-h)/1e4;if(y<0&&void 0===t.clockseq&&(a=a+1&16383),(y<0||d>l)&&void 0===t.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=d,h=g,c=a;var m=(1e4*(268435455&(d+=122192928e5))+g)%4294967296;o[n++]=m>>>24&255,o[n++]=m>>>16&255,o[n++]=m>>>8&255,o[n++]=255&m;var v=d/4294967296*1e4&268435455;o[n++]=v>>>8&255,o[n++]=255&v,o[n++]=v>>>24&15|16,o[n++]=v>>>16&255,o[n++]=a>>>8|128,o[n++]=255&a;for(var b=0;b<6;++b)o[n+b]=s[b];return e||f(o)};var d=function(t,e,r){function n(t,n,o,i){var s=o&&i||0;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"==typeof n&&(n=function(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,(function(t){e.push(parseInt(t,16))})),e}(n)),!Array.isArray(t))throw TypeError("value must be an array of bytes");if(!Array.isArray(n)||16!==n.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var a=r(n.concat(t));if(a[6]=15&a[6]|e,a[8]=63&a[8]|128,o)for(var u=0;u<16;++u)o[s+u]=a[u];return o||f(a)}try{n.name=t}catch(t){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n};function g(t){return 14+(t+64>>>9<<4)+1}function y(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function m(t,e,r,n,o,i){return y((s=y(y(e,t),y(n,i)))<<(a=o)|s>>>32-a,r);var s,a}function v(t,e,r,n,o,i,s){return m(e&r|~e&n,t,e,o,i,s)}function b(t,e,r,n,o,i,s){return m(e&n|r&~n,t,e,o,i,s)}function w(t,e,r,n,o,i,s){return m(e^r^n,t,e,o,i,s)}function _(t,e,r,n,o,i,s){return m(r^(e|~n),t,e,o,i,s)}var E=d("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){for(var e=[],r=32*t.length,n=0;n<r;n+=8){var o=t[n>>5]>>>n%32&255,i=parseInt("0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[g(e)-1]=e;for(var r=1732584193,n=-271733879,o=-1732584194,i=271733878,s=0;s<t.length;s+=16){var a=r,u=n,c=o,f=i;r=v(r,n,o,i,t[s],7,-680876936),i=v(i,r,n,o,t[s+1],12,-389564586),o=v(o,i,r,n,t[s+2],17,606105819),n=v(n,o,i,r,t[s+3],22,-1044525330),r=v(r,n,o,i,t[s+4],7,-176418897),i=v(i,r,n,o,t[s+5],12,1200080426),o=v(o,i,r,n,t[s+6],17,-1473231341),n=v(n,o,i,r,t[s+7],22,-45705983),r=v(r,n,o,i,t[s+8],7,1770035416),i=v(i,r,n,o,t[s+9],12,-1958414417),o=v(o,i,r,n,t[s+10],17,-42063),n=v(n,o,i,r,t[s+11],22,-1990404162),r=v(r,n,o,i,t[s+12],7,1804603682),i=v(i,r,n,o,t[s+13],12,-40341101),o=v(o,i,r,n,t[s+14],17,-1502002290),n=v(n,o,i,r,t[s+15],22,1236535329),r=b(r,n,o,i,t[s+1],5,-165796510),i=b(i,r,n,o,t[s+6],9,-1069501632),o=b(o,i,r,n,t[s+11],14,643717713),n=b(n,o,i,r,t[s],20,-373897302),r=b(r,n,o,i,t[s+5],5,-701558691),i=b(i,r,n,o,t[s+10],9,38016083),o=b(o,i,r,n,t[s+15],14,-660478335),n=b(n,o,i,r,t[s+4],20,-405537848),r=b(r,n,o,i,t[s+9],5,568446438),i=b(i,r,n,o,t[s+14],9,-1019803690),o=b(o,i,r,n,t[s+3],14,-187363961),n=b(n,o,i,r,t[s+8],20,1163531501),r=b(r,n,o,i,t[s+13],5,-1444681467),i=b(i,r,n,o,t[s+2],9,-51403784),o=b(o,i,r,n,t[s+7],14,1735328473),n=b(n,o,i,r,t[s+12],20,-1926607734),r=w(r,n,o,i,t[s+5],4,-378558),i=w(i,r,n,o,t[s+8],11,-2022574463),o=w(o,i,r,n,t[s+11],16,1839030562),n=w(n,o,i,r,t[s+14],23,-35309556),r=w(r,n,o,i,t[s+1],4,-1530992060),i=w(i,r,n,o,t[s+4],11,1272893353),o=w(o,i,r,n,t[s+7],16,-155497632),n=w(n,o,i,r,t[s+10],23,-1094730640),r=w(r,n,o,i,t[s+13],4,681279174),i=w(i,r,n,o,t[s],11,-358537222),o=w(o,i,r,n,t[s+3],16,-722521979),n=w(n,o,i,r,t[s+6],23,76029189),r=w(r,n,o,i,t[s+9],4,-640364487),i=w(i,r,n,o,t[s+12],11,-421815835),o=w(o,i,r,n,t[s+15],16,530742520),n=w(n,o,i,r,t[s+2],23,-995338651),r=_(r,n,o,i,t[s],6,-198630844),i=_(i,r,n,o,t[s+7],10,1126891415),o=_(o,i,r,n,t[s+14],15,-1416354905),n=_(n,o,i,r,t[s+5],21,-57434055),r=_(r,n,o,i,t[s+12],6,1700485571),i=_(i,r,n,o,t[s+3],10,-1894986606),o=_(o,i,r,n,t[s+10],15,-1051523),n=_(n,o,i,r,t[s+1],21,-2054922799),r=_(r,n,o,i,t[s+8],6,1873313359),i=_(i,r,n,o,t[s+15],10,-30611744),o=_(o,i,r,n,t[s+6],15,-1560198380),n=_(n,o,i,r,t[s+13],21,1309151649),r=_(r,n,o,i,t[s+4],6,-145523070),i=_(i,r,n,o,t[s+11],10,-1120210379),o=_(o,i,r,n,t[s+2],15,718787259),n=_(n,o,i,r,t[s+9],21,-343485551),r=y(r,a),n=y(n,u),o=y(o,c),i=y(i,f)}return[r,n,o,i]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(g(e)),n=0;n<e;n+=8)r[n>>5]|=(255&t[n/8])<<n%32;return r}(t),8*t.length))}));var A=function(t,e,r){"string"==typeof t&&(e="binary"===t?new Uint8Array(16):null,t=null);var n=(t=t||{}).random||(t.rng||i)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){for(var o=r||0,s=0;s<16;++s)e[o+s]=n[s];return e}return f(n)};function x(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:return e^r^n;case 2:return e&r^e&n^r&n;case 3:return e^r^n}}function T(t,e){return t<<e|t>>>32-e}var S=d("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var o=0;o<n.length;++o)t.push(n.charCodeAt(o))}t.push(128);for(var i=t.length/4+2,s=Math.ceil(i/16),a=new Array(s),u=0;u<s;++u){for(var c=new Uint32Array(16),f=0;f<16;++f)c[f]=t[64*u+4*f]<<24|t[64*u+4*f+1]<<16|t[64*u+4*f+2]<<8|t[64*u+4*f+3];a[u]=c}a[s-1][14]=8*(t.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(t.length-1)&4294967295;for(var l=0;l<s;++l){for(var h=new Uint32Array(80),p=0;p<16;++p)h[p]=a[l][p];for(var d=16;d<80;++d)h[d]=T(h[d-3]^h[d-8]^h[d-14]^h[d-16],1);for(var g=r[0],y=r[1],m=r[2],v=r[3],b=r[4],w=0;w<80;++w){var _=Math.floor(w/20),E=T(g,5)+x(_,y,m,v)+b+e[_]+h[w]>>>0;b=v,v=m,m=T(y,30)>>>0,y=g,g=E}r[0]=r[0]+g>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}))},function(t,e,r){const{createAppEnv:n}=r(66),{assignObjImmutableProp:o}=r(34),{getGlobal:i}=r(67);t.exports={getSharedAppEnv:function(){const t=i();if(!t["@@__ButtercupAppEnv"]){const e=n();o(t,"@@__ButtercupAppEnv",e)}return t["@@__ButtercupAppEnv"]}}},function(t,e){t.exports={assignObjImmutableProp:function(t,e,r){Object.defineProperty(t,e,{value:r,writable:!1,configurable:!1,enumerable:!1})}}},function(t,e,r){const n=r(82),o=r(19),i=r(37);Object.assign(n,{Channel:o,Task:i}),t.exports=n},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function i(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new s(r,n||t,i),u=o?o+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function c(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),c.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)n.call(t,e)&&r.push(o?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},c.prototype.listeners=function(t){var e=o?o+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,s=new Array(i);n<i;n++)s[n]=r[n].fn;return s},c.prototype.listenerCount=function(t){var e=o?o+t:t,r=this._events[e];return r?r.fn?1:r.length:0},c.prototype.emit=function(t,e,r,n,i,s){var a=o?o+t:t;if(!this._events[a])return!1;var u,c,f=this._events[a],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,r),!0;case 4:return f.fn.call(f.context,e,r,n),!0;case 5:return f.fn.call(f.context,e,r,n,i),!0;case 6:return f.fn.call(f.context,e,r,n,i,s),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var h,p=f.length;for(c=0;c<p;c++)switch(f[c].once&&this.removeListener(t,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,e);break;case 3:f[c].fn.call(f[c].context,e,r);break;case 4:f[c].fn.call(f[c].context,e,r,n);break;default:if(!u)for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];f[c].fn.apply(f[c].context,u)}}return!0},c.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},c.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},c.prototype.removeListener=function(t,e,r,n){var i=o?o+t:t;if(!this._events[i])return this;if(!e)return u(this,i),this;var s=this._events[i];if(s.fn)s.fn!==e||n&&!s.once||r&&s.context!==r||u(this,i);else{for(var a=0,c=[],f=s.length;a<f;a++)(s[a].fn!==e||n&&!s[a].once||r&&s[a].context!==r)&&c.push(s[a]);c.length?this._events[i]=1===c.length?c[0]:c:u(this,i)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=o?o+t:t,this._events[e]&&u(this,e)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=o,c.EventEmitter=c,t.exports=c},function(t,e){class r{constructor(t,e="normal",r=null){if(t instanceof Promise!=!0&&"function"!=typeof t)throw new Error("Invalid task item: Expected a Promise or Function");this._target="function"==typeof t?t:()=>t,this._stack=r,this._type=e,this._resolveFn=null,this._rejectFn=null,this._queuedPromise=new Promise((t,e)=>{this._resolveFn=t,this._rejectFn=e});const n=new Date;this._created=n.getTime()}get created(){return this._created}get queuedPromise(){return this._queuedPromise}get stack(){return this._stack}get target(){return this._target}get type(){return this._type}execute(){const t=this.target;let e;try{e=t()}catch(t){return this._rejectFn(t),Promise.resolve()}return(e instanceof Promise?e:Promise.resolve(e)).then(t=>{this._resolveFn(t)}).catch(t=>{this._rejectFn(t)})}}Object.assign(r,{TASK_TYPE_NORMAL:"normal",TASK_TYPE_HIGH_PRIORITY:"high-priority",TASK_TYPE_TAIL:"tail"}),t.exports=r},function(t,e,r){const n=r(20);t.exports=class extends n{constructor(){super(),this._store={}}getAllKeys(){return Promise.resolve(Object.keys(this._store))}getValue(t){const e=this._store.hasOwnProperty(t)?this._store[t]:null;return Promise.resolve(e)}removeKey(t){return this._store[t]=void 0,delete this._store[t],Promise.resolve()}setValue(t,e){return this._store[t]=e,Promise.resolve()}}},function(t,e,r){function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const i=r(9),s=r(35),a=r(3),u=r(42),c=r(11),{getCredentials:f}=r(0),{getUniqueID:l}=r(24),{getSourceOfflineArchive:h,sourceHasOfflineCopy:p,storeSourceOfflineCopy:d}=r(99),{credentialsToDatasource:g}=r(2),{initialiseShares:y}=r(100),m=r(55),{generateVaultInsights:v}=r(111),b="#000000",w=1e3;class _ extends i{static rehydrate(t){const e=JSON.parse(t);let r=e.credentials;if(2!==e.v){const{sourceCredentials:t,archiveCredentials:n}=e;if(!t||!n)throw new Error("Invalid legacy vault state: missing credentials");r=`v1\n${t}\n${n}`}const{id:n,name:o,type:i,colour:s=b,order:a=w,meta:u={}}=e;return new _(o,i,r,{id:n,colour:s,order:a,meta:u})}constructor(t,e,r,n={}){super();const{colour:o=b,id:i=l(),order:a=w,meta:u={}}=n;this._queue=new s,this._credentials=r,this._status=_.STATUS_LOCKED,this._datasource=null,this._vault=null,this._shares=[],this._id=i,this._name=t,this._type=e,this._colour=o,this._order=a,this._meta=u,this._vaultManager=null}get colour(){return this._colour}get id(){return this._id}get meta(){return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},this._meta)}get name(){return this._name}get status(){return this._status}get type(){return this._type}get vault(){return this._vault}set colour(t){if(!0!==COLOUR_TEST.test(t))throw new a("Failed setting colour: Invalid format (expected hex): "+t);this._colour=t,this.emit("updated")}async changeMasterPassword(t,e,r={}){if(t===e)throw new Error("New password cannot be the same as the previous one");if(!e)throw new Error("New password must be specified");const n=this._datasource.supportsChangePassword(),o=new c(r,e);let i=!1;if(this.status!==_.STATUS_UNLOCKED)i=!0,await this.unlock(c.fromPassword(t));else{if(f(this._credentials.id).masterPassword!==t)throw new Error("Old password does not match current unlocked instance value");await this.update()}if(n){if(!await this._datasource.changePassword(o,!0))throw new Error("Datasource not capable of changing password at this time")}await d(this._vaultManager._cacheStorage,this.id,null);const s=c.fromCredentials(this._credentials,t);f(s.id).masterPassword=e,await this._updateVaultCredentials(s),i&&await this.lock(),n&&await this._datasource.changePassword(o,!1)}canBeUpdated(){return this.status===_.STATUS_UNLOCKED&&!1===this._vault.format.dirty}checkOfflineCopy(){return p(this._vaultManager._cacheStorage,this.id)}async dehydrate(){if(this.status===_.STATUS_PENDING)throw new a("Failed dehydrating source: Source in pending state: "+this.id);const t={v:2,id:this.id,name:this.name,type:this.type,status:_.STATUS_LOCKED,colour:this.colour,order:this.order,meta:this.meta};return Promise.resolve().then(()=>this.status===_.STATUS_LOCKED?(t.credentials=this._credentials,t):this._credentials.toSecureString().then(e=>(t.credentials=e,t))).then(t=>JSON.stringify(t)).catch(t=>{throw new a(t,"Failed dehydrating source: "+this.id)})}getOfflineContent(){return this.checkOfflineCopy().then(t=>t?h(this._vaultManager._cacheStorage,this.id):null)}localDiffersFromRemote(){return this.status!==_.STATUS_UNLOCKED?Promise.reject(new a(`Failed diffing source: Source not unlocked (${this.status}): ${this.id}`)):"function"==typeof this._datasource.localDiffersFromRemote?this._datasource.localDiffersFromRemote(this._credentials,this._vault.format.history):("text"!==this._datasource.type&&this._datasource.setContent(""),this._datasource.load(this._credentials).then(({Format:t,history:e})=>u.createFromHistory(e,t)).then(t=>new m(this._vault,t).vaultsDiffer()))}async lock(){if(this.status!==_.STATUS_UNLOCKED)throw new a(`Failed locking source: Source in invalid state (${this.status}): ${this.id}`);this._status=_.STATUS_PENDING;const t=this._credentials,e=this._vault,r=this._datasource;await this._enqueueStateChange(async()=>{try{const t=await this._credentials.toSecureString();this._credentials=t,this._datasource=null,this._vault=null,this._status=_.STATUS_LOCKED;const e=await this.dehydrate();return this.emit("locked"),e}catch(n){throw this._credentials=t,this._datasource=r,this._vault=e,this._status=_.STATUS_UNLOCKED,new a(n,"Failed locking source")}})}async mergeFromRemote(){"text"!==this._datasource.type&&this._datasource.setContent("");const{Format:t,history:e}=await this._datasource.load(this._credentials),r=u.createFromHistory(e,t),n=new m(this._vault,r).calculateDifferences(),o=n.secondary.length>0,i=o?t.prepareHistoryForMerge(n.original):n.original,s=o?t.prepareHistoryForMerge(n.secondary):n.secondary,a=n.common,c=new u(t);return c.format.clear(),a.concat(s).concat(i).forEach(t=>{c.format.execute(t)}),c.format.dirty=!1,this._vault=c,c}async save(){await this._enqueueStateChange(async()=>{await this.localDiffersFromRemote()&&await this.mergeFromRemote(),await this._datasource.save(this._vault.format.history,this._credentials),this._vault.format.dirty=!1,await this._updateInsights()},"saving")}async unlock(t,e={}){if(!c.isCredentials(t))throw new a("Failed unlocking source: Invalid credentials passed to source: "+this.id);const{initialiseRemote:r=!1,loadOfflineCopy:n=!1,storeOfflineCopy:o=!0}=e;if(this.status!==_.STATUS_LOCKED)throw new a(`Failed unlocking source: Source in invalid state (${this.status}): ${this.id}`);const{masterPassword:i}=f(t.id),s=this._credentials;return this._status=_.STATUS_PENDING,this._enqueueStateChange(()=>{let t=null;return this.getOfflineContent().then(e=>(e&&n&&(t=e),function(t,e){if(/^v1\n/.test(t)){const[,r]=t.split("\n");return c.fromSecureString(r,e)}return c.fromSecureString(t,e)}(this._credentials,i))).then(e=>{const s=this._credentials=e,a=this._datasource=g(c.fromCredentials(s,i));"string"==typeof t&&a.setContent(t),a.on("updated",()=>{this._waitNonPending().then(async()=>{this.status===_.STATUS_UNLOCKED&&await this._updateCredentialsFromDatasource(),this.emit("updated")}).catch(t=>{console.error("Error updating datasource credentials for vault: "+this.id,t)})});const f=u.createWithDefaults();return(r?a.save(f.format.history,s).then(()=>{this._vault=f}):a.load(s).then(({Format:t,history:e})=>{this._vault=u.createFromHistory(e,t)})).then(()=>{if(o)return d(this._vaultManager._cacheStorage,this.id,a._content);n&&(this.vault.format._readOnly=!0)}).then(()=>{this._status=_.STATUS_UNLOCKED,this.emit("unlocked")})}).catch(t=>{throw this._status=_.STATUS_LOCKED,this._vault=null,this._datasource=null,this._credentials=s,new a(t,"Failed unlocking source")})})}update({skipDiff:t=!1}={}){return this._enqueueStateChange(()=>(t?Promise.resolve():this.localDiffersFromRemote()).then(t=>{if(t)return this.mergeFromRemote()}),"updating")}async write(){await this._enqueueStateChange(async()=>{await this._datasource.save(this._vault.format.history,this._credentials),this._vault.format.dirty=!1,await this._updateInsights()},"saving")}_applyShares(){}_enqueueStateChange(t,e){const r=e?[t,void 0,e]:[t];return this._queue.channel("state").enqueue(...r)}_unloadShares(){const t=this.vault.format.getFormat().extractSharesFromHistory(this.vault.format.history),{base:e}=t;delete t.base,this.vault.format.clear(),this.vault.format.execute(e),Object.keys(t).forEach(e=>{const r=this._shares.find(t=>t.id===e);if(!r)throw new Error("Failed updating extracted share: No share found in workspace for ID: "+e);r.updateHistory(t[e])})}async _updateCredentialsFromDatasource(){if(this.status!==_.STATUS_UNLOCKED)throw new a("Failed updating source credentials: Source is not unlocked: "+this.id);const{masterPassword:t}=f(this._credentials.id);this._credentials=c.fromCredentials(this._datasource.credentials,t)}async _updateInsights(){if(this.status!==_.STATUS_UNLOCKED)throw new a("Failed updating vault insights: Source is not unlocked: "+this.id);if(!this._datasource.updateInsights)return;const t=v(this.vault);await this._datasource.updateInsights(t)}async _updateVaultCredentials(t){if(this.status!==_.STATUS_UNLOCKED)throw new a("Failed updating vault credentials: Source is not unlocked: "+this.id);this._credentials=t,await this.write()}_waitNonPending(){return new Promise(t=>{if(this.status!==_.STATUS_PENDING)return t();const e=()=>{this.removeListener("unlocked",e),this.removeListener("locked",e),t()};this.on("unlocked",e),this.on("locked",e)})}}o(_,"STATUS_LOCKED","locked"),o(_,"STATUS_PENDING","pending"),o(_,"STATUS_UNLOCKED","unlocked"),t.exports=_},function(t,e,r){"use strict";(function(e){var n=r(88);
18/*!
19 * The buffer module from node.js, for the browser.
20 *
21 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
22 * @license MIT
23 */function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}function i(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var s=r(16),a=Object.prototype.hasOwnProperty,u=Array.prototype.slice,c="foo"===function(){}.name;function f(t){return Object.prototype.toString.call(t)}function l(t){return!i(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var h=t.exports=v,p=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(s.isFunction(t)){if(c)return t.name;var e=t.toString().match(p);return e&&e[1]}}function g(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function y(t){if(c||!s.isFunction(t))return s.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function m(t,e,r,n,o){throw new h.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:o})}function v(t,e){t||m(t,!0,e,"==",h.ok)}function b(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===o(t,e);if(s.isDate(t)&&s.isDate(e))return t.getTime()===e.getTime();if(s.isRegExp(t)&&s.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(l(t)&&l(e)&&f(t)===f(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===o(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var a=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==a&&a===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(s.isPrimitive(t)||s.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var o=w(t),i=w(e);if(o&&!i||!o&&i)return!1;if(o)return t=u.call(t),e=u.call(e),b(t,e,r);var a,c,f=A(t),l=A(e);if(f.length!==l.length)return!1;for(f.sort(),l.sort(),c=f.length-1;c>=0;c--)if(f[c]!==l[c])return!1;for(c=f.length-1;c>=0;c--)if(a=f[c],!b(t[a],e[a],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function w(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function E(t,e,r,n){var o;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),o=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!o&&m(o,r,"Missing expected exception"+n);var i="string"==typeof n,a=!t&&o&&!r;if((!t&&s.isError(o)&&i&&_(o,r)||a)&&m(o,r,"Got unwanted exception"+n),t&&o&&r&&!_(o,r)||!t&&o)throw o}h.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(y(t.actual),128)+" "+t.operator+" "+g(y(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,o=d(e),i=n.indexOf("\n"+o);if(i>=0){var s=n.indexOf("\n",i+1);n=n.substring(s+1)}this.stack=n}}},s.inherits(h.AssertionError,Error),h.fail=m,h.ok=v,h.equal=function(t,e,r){t!=e&&m(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){b(t,e,!1)||m(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){b(t,e,!0)||m(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){b(t,e,!1)&&m(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){b(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){E(!0,t,e,r)},h.doesNotThrow=function(t,e,r){E(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||m(e,!0,r,"==",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var A=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,r(8))},function(t,e){},function(t,e,r){const n=r(9),{getDefaultFormat:o}=r(17),{findGroupByID:i,findGroupsByTitle:s}=r(46),{findEntriesByProperty:a,findEntryByID:u}=r(47),c=r(25);class f extends n{static createFromHistory(t,e=o()){const r=new f(e);return r.format.erase(),r.format.execute(t),r.format.dirty=!1,r.id||r.format.generateID(),r}static createWithDefaults(){const t=new f;return t.createGroup("General"),t.createGroup("Trash").setAttribute(c.Attribute.Role,"trash"),t}get id(){return this._dataset.id}get readOnly(){return this.format.readOnly}get type(){return"Vault"}constructor(t=o()){var e,r,n;super(),n={},(r="_dataset")in(e=this)?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,this.format=new t(this._dataset),this.format.on("commandsExecuted",()=>{this.emit("vaultUpdated")}),this.format.initialise()}createGroup(t){const e=c.createNew(this);return t&&e.setTitle(t),e}deleteAttribute(t){return this.format.deleteVaultAttribute(t),this}emptyTrash(){const t=this.getTrashGroup();if(t)return t.getGroups().forEach(t=>{t.delete(!0)}),t.getEntries().forEach(t=>{t.delete(!0)}),this}findEntryByID(t){return u(this.getGroups(),t)}findEntriesByProperty(t,e){return a(this.getGroups(),t,e)}findGroupByID(t){return i(this.getGroups(),t)}findGroupsByTitle(t){return s(this.getGroups(),t)}getAttribute(t){const e=this._dataset;return t?e.attributes&&e.attributes.hasOwnProperty(t)?e.attributes[t]:void 0:Object.assign({},e.attributes||{})}getGroups(){return(this._dataset.groups||[]).map(t=>new c(this,t))}getTrashGroup(){return this.getGroups().find(t=>t.isTrash())||null}setAttribute(t,e){return this.format.setVaultAttribute(t,e),this}}t.exports=f},function(t,e,r){const n=r(3),o=r(93),{executeArchiveID:i,executeComment:s,executeCreateEntry:a,executeCreateGroup:u,executeDeleteArchiveAttribute:c,executeDeleteEntry:f,executeDeleteEntryAttribute:l,executeDeleteEntryProperty:h,executeDeleteGroup:p,executeDeleteGroupAttribute:d,executeFormat:g,executeMoveEntry:y,executeMoveGroup:m,executePad:v,executeSetArchiveAttribute:b,executeSetEntryAttribute:w,executeSetEntryProperty:_,executeSetGroupAttribute:E,executeTitleGroup:A}=r(94),{COMMAND_MANIFEST:x,InigoCommand:T,extractCommandComponents:S,stripDestructiveCommands:O}=r(23),P=r(95),{getFormat:C,hasValidSignature:R,sign:j,stripSignature:I,vaultContentsEncrypted:D}=r(96),{describeVaultDataset:k}=r(45),{getSharedAppEnv:F}=r(10),{decodeStringValue:N,isEncoded:U}=r(24),{generateUUID:L}=r(4),{getCredentials:B}=r(0),M={aid:i,cen:a,cgr:u,cmm:s,daa:c,dea:l,dem:h,den:f,dep:h,dga:d,dgr:p,fmt:g,men:y,mgr:m,pad:v,saa:b,sea:w,sem:_,sep:_,sga:E,tgr:A},q=/^\$[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\s/,G=/^[a-z]{3}\s.+$/;class V extends o{static encodeRaw(t,e){const r=F().getProperty("compression/v1/compressText"),n=F().getProperty("crypto/v1/encryptText"),{masterPassword:o}=B(e.id);return Promise.resolve().then(()=>t.join("\n")).then(t=>r(t)).then(t=>n(t,o)).then(j)}static extractSharesFromHistory(t){return t.reduce((t,e)=>{if(q.test(e)){const r=e.substring(1,37),n=e.replace(q,"");t[r]=t[r]||[],t[r].push(n)}else t.base.push(e);return t},{base:[]})}static isEncrypted(t){return D(t)}static parseEncrypted(t,e){const r=F().getProperty("compression/v1/decompressText"),n=F().getProperty("crypto/v1/decryptText"),{masterPassword:o}=B(e.id);return Promise.resolve().then(()=>{if(!R(t))throw new Error("No valid signature in vault");return I(t)}).then(t=>n(t,o)).then(t=>{if(t&&t.length>0){const e=r(t);if(e)return e.split("\n")}throw new Error("Failed reconstructing history: Decryption failed")})}static prepareHistoryForMerge(t){return O(t)}cloneEntry(t,e){}cloneGroup(t,e){const r=k(t._source,e);this.execute(r)}createEntry(t,e){this.execute(T.create(T.Command.CreateEntry).addArgument(t).addArgument(e).generateCommand())}createGroup(t,e){this.execute(T.create(T.Command.CreateGroup).addArgument(t).addArgument(e).generateCommand())}deleteEntry(t){this.execute(T.create(T.Command.DeleteEntry).addArgument(t).generateCommand())}deleteEntryAttribute(t,e){this.execute(T.create(T.Command.DeleteEntryAttribute).addArgument(t).addArgument(e).generateCommand())}deleteEntryProperty(t,e){this.execute(T.create(T.Command.DeleteEntryProperty).addArgument(t).addArgument(e).generateCommand())}deleteGroup(t){this.execute(T.create(T.Command.DeleteGroup).addArgument(t).generateCommand())}deleteGroupAttribute(t,e){this.execute(T.create(T.Command.DeleteGroupAttribute).addArgument(t).addArgument(e).generateCommand())}deleteVaultAttribute(t){this.execute(T.create(T.Command.DeleteArchiveAttribute).addArgument(t).generateCommand())}execute(t){if(this.readOnly)throw new Error("Format is in read-only mode");const e=Array.isArray(t)?t:[t];e.forEach(t=>this._executeCommand(t));const r=e[e.length-1];!1===/^pad\s/i.test(r)&&this._pad(),this.dirty=!0,this.emit("commandsExecuted")}generateID(){this.execute(T.create(T.Command.ArchiveID).addArgument(L()).generateCommand())}getFormat(){return V}initialise(){this.execute(T.create(T.Command.Format).addArgument(C()).generateCommand()),this.generateID()}moveEntry(t,e){this.execute(T.create(T.Command.MoveEntry).addArgument(t).addArgument(e).generateCommand())}moveGroup(t,e){this.execute(T.create(T.Command.MoveGroup).addArgument(t).addArgument(e).generateCommand())}optimise(){const t=new P(this);t.canBeFlattened()&&t.flatten()}setEntryAttribute(t,e,r){this.execute(T.create(T.Command.SetEntryAttribute).addArgument(t).addArgument(e).addArgument(r).generateCommand())}setEntryProperty(t,e,r){this.execute(T.create(T.Command.SetEntryProperty).addArgument(t).addArgument(e).addArgument(r).generateCommand())}setGroupAttribute(t,e,r){this.execute(T.create(T.Command.SetGroupAttribute).addArgument(t).addArgument(e).addArgument(r).generateCommand())}setGroupTitle(t,e){this.execute(T.create(T.Command.SetGroupTitle).addArgument(t).addArgument(e).generateCommand())}setVaultAttribute(t,e){this.execute(T.create(T.Command.SetArchiveAttribute).addArgument(t).addArgument(e).generateCommand())}_executeCommand(t){let e=t,r=null;if(q.test(e)){r=/^\$([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/.exec(e)[1],e=e.replace(q,"")}if(!G.test(e))throw new Error("Invalid command: "+t);const o=S(e),i=o.shift().toLowerCase(),s=M[i];try{s.apply(null,[this.source,Object.assign({shareID:r},this.executionOptions),...this._processCommandParameters(i,o)]),this.history.push(t)}catch(t){throw new n(t,"Failed executing vault command: "+i)}}_pad(){this._executeCommand(T.generatePaddingCommand())}_processCommandParameters(t,e){const r=Object.keys(x).find(e=>x[e].s===t),n=x[r];if(!n)throw new Error("Cannot process command parameters: no command found for key: "+t);return e.map((t,e)=>!0===n.args[e].encode&&U(t)?N(t):t)}}t.exports=V},function(module,exports,__webpack_require__){(function(global){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;!function(t,e){module.exports=e(t)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==global?global:this,(function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.2",buffer;if(module.exports)try{buffer=eval("require('buffer').Buffer")}catch(t){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(t){for(var e={},r=0,n=t.length;r<n;r++)e[t.charAt(r)]=r;return e}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(t){if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?fromCharCode(192|e>>>6)+fromCharCode(128|63&e):fromCharCode(224|e>>>12&15)+fromCharCode(128|e>>>6&63)+fromCharCode(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return fromCharCode(240|e>>>18&7)+fromCharCode(128|e>>>12&63)+fromCharCode(128|e>>>6&63)+fromCharCode(128|63&e)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(t){return t.replace(re_utob,cb_utob)},cb_encode=function(t){var e=[0,2,1][t.length%3],r=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[b64chars.charAt(r>>>18),b64chars.charAt(r>>>12&63),e>=2?"=":b64chars.charAt(r>>>6&63),e>=1?"=":b64chars.charAt(63&r)].join("")},btoa=global.btoa?function(t){return global.btoa(t)}:function(t){return t.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)?t.toString("base64"):btoa(utob(String(t)))},encode=function(t,e){return e?_encode(String(t)).replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"})).replace(/=/g,""):_encode(t)},encodeURI=function(t){return encode(t,!0)},re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return fromCharCode(55296+(e>>>10))+fromCharCode(56320+(1023&e));case 3:return fromCharCode((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return fromCharCode((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},btou=function(t){return t.replace(re_btou,cb_btou)},cb_decode=function(t){var e=t.length,r=e%4,n=(e>0?b64tab[t.charAt(0)]<<18:0)|(e>1?b64tab[t.charAt(1)]<<12:0)|(e>2?b64tab[t.charAt(2)]<<6:0)|(e>3?b64tab[t.charAt(3)]:0),o=[fromCharCode(n>>>16),fromCharCode(n>>>8&255),fromCharCode(255&n)];return o.length-=[0,0,2,1][r],o.join("")},_atob=global.atob?function(t){return global.atob(t)}:function(t){return t.replace(/\S{1,4}/g,cb_decode)},atob=function(t){return _atob(String(t).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(t){return(t.constructor===buffer.constructor?t:buffer.from(t,"base64")).toString()}:function(t){return(t.constructor===buffer.constructor?t:new buffer(t,"base64")).toString()}:function(t){return btou(_atob(t))},decode=function(t){return _decode(String(t).replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var t=global.Base64;return global.Base64=_Base64,t};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"==typeof Object.defineProperty){var noEnum=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum((function(){return decode(this)}))),Object.defineProperty(String.prototype,"toBase64",noEnum((function(t){return encode(this,t)}))),Object.defineProperty(String.prototype,"toBase64URI",noEnum((function(){return encode(this,!0)})))}}return global.Meteor&&(Base64=global.Base64),module.exports?module.exports.Base64=global.Base64:(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return global.Base64}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)),{Base64:global.Base64}}))}).call(this,__webpack_require__(8))},function(t,e,r){const{InigoCommand:n}=r(23),{Command:o}=n;t.exports={describeVaultDataset:function t(e,r){var i=e.format?"0":e.id,s="0"===i?[]:e.entries||[],a=[];if("0"===i&&(e.format&&a.push(n.create(o.Format).addArgument(e.format).generateCommand()),e.id&&a.push(n.create(o.ArchiveID).addArgument(e.id).generateCommand()),e.attributes&&Object.keys(e.attributes).forEach((function(t){a.push(n.create(o.SetArchiveAttribute).addArgument(t).addArgument(e.attributes[t]).generateCommand())}))),"0"!==i){if(!r)throw new Error("No parent group ID specified");if(a.push(n.create(o.CreateGroup).addArgument(r).addArgument(i).generateCommand()),e.title&&a.push(n.create(o.SetGroupTitle).addArgument(i).addArgument(e.title).generateCommand()),e.attributes)for(var u in e.attributes)e.attributes.hasOwnProperty(u)&&a.push(n.create(o.SetGroupAttribute).addArgument(i).addArgument(u).addArgument(e.attributes[u]).generateCommand());a.push(n.generatePaddingCommand())}return s.forEach((function(t){if(a.push(n.create(o.CreateEntry).addArgument(i).addArgument(t.id).generateCommand()),t.properties&&Object.keys(t.properties).forEach(e=>{a.push(n.create(o.SetEntryProperty).addArgument(t.id).addArgument(e).addArgument(t.properties[e]).generateCommand())}),t.attributes)for(var e in t.attributes)t.attributes.hasOwnProperty(e)&&a.push(n.create(o.SetEntryAttribute).addArgument(t.id).addArgument(e).addArgument(t.attributes[e]).generateCommand());a.push(n.generatePaddingCommand())})),(e.groups||[]).forEach((function(e){a=a.concat(t(e,i))})),a}}},function(t,e){function r(t,e){const n=t.filter(e);return t.forEach(t=>{const o=r(t.getGroups(),e);o.length>0&&n.push(...o)}),n}t.exports={findGroupByID:function(t,e){const n=r(t,t=>t.id===e);return n&&n.length>=1?n[0]:null},findGroupsByTitle:function(t,e){return r(t,t=>e instanceof RegExp?e.test(t.getTitle()):t.getTitle().indexOf(e)>=0)}}},function(t,e){function r(t,e){var n,o=[];return t.forEach((function(t){(n=t.getEntries().filter(e)).length>0&&(o=o.concat(n)),(n=r(t.getGroups(),e)).length>0&&(o=o.concat(n))})),o}t.exports={findEntriesByProperty:function(t,e,n){return r(t,t=>{const r=t.getProperties(e),o=Object.keys(r);return o.length>0&&o.some(t=>{const e=r[t];return n instanceof RegExp?n.test(e):e.indexOf(n)>=0})})},findEntryByID:function(t,e){const n=r(t,t=>t.id===e);return n&&n.length>=1?n[0]:null}}},function(t,e,r){const{PERM_MANAGE:n,PERM_READ:o,PERM_WRITE:i}=r(97);t.exports=class{constructor(t,e){var r,s,a;a=null,(s="_vault")in(r=this)?Object.defineProperty(r,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[s]=a,this._vault=t,this._source=e,this._source.permissions=this._source.permissions||[n,o,i]}get id(){return this._source.id}get permissions(){return[...this._source.permissions]}get vault(){return this._vault}grantPermission(t){this.hasPermission(t)||this._source.permissions.push(t)}hasPermission(t){return this._source.permissions.includes(t)}revokeAllPermissions(){this._source.permissions=[]}revokePermission(t){this._source.permissions=this._source.permissions.filter(e=>e!==t)}_cleanUp(){this._vault=null,this._source=null}}},function(t,e,r){const{objectValues:n}=r(98),o=/(^|[a-zA-Z0-9_-]|\b)(ur[li]|UR[LI]|Ur[li])(\b|$|[_-])/,i=/icon[\s_-]*ur[li]/i;t.exports={ENTRY_URL_TYPE_ANY:"any",ENTRY_URL_TYPE_GENERAL:"general",ENTRY_URL_TYPE_ICON:"icon",ENTRY_URL_TYPE_LOGIN:"login",getEntryURLs:function(t,e="any"){const r=Object.keys(t).filter(t=>o.test(t)).reduce((e,r)=>Object.assign(e,{[r]:t[r]}),{});if("general"===e||"login"===e)return Object.keys(r).sort((t,r)=>{if("general"===e){const e=/^ur[li]$/i,n=e.test(t)?1:0;return(e.test(r)?1:0)-n}if("login"===e){const e=/login/i,n=e.test(t)?1:0;return(e.test(r)?1:0)-n}return 0}).map(t=>r[t]);if("icon"===e){const t=Object.keys(r).find(t=>i.test(t));return t?[r[t]]:[]}return n(r)},isValidProperty:function(t){for(var e in EntryProperty)if(EntryProperty.hasOwnProperty(e)&&EntryProperty[e]===t)return!0;return!1}}},function(t,e){const r=/^\$[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\s/;t.exports={mergeHistories:function(t,e){},moveGroupBetweenVaults:function(t,e){("Vault"===e.type?e:e.vault).format.cloneGroup(t,"Vault"===e.type?"0":e.id),t.delete(!0)},prependSharePrefix:function(t,e){return t.map(t=>r.test(t)?t:`$${e} ${t}`)},removeSharePrefix:function(t){return t.map(t=>r.test(t)?t.replace(r,""):t)}}},function(t,e,r){var n=e;n.utils=r(1),n.common=r(13),n.sha=r(104),n.ripemd=r(108),n.hmac=r(109),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e,r){"use strict";var n=r(1).rotr32;function o(t,e,r){return t&e^~t&r}function i(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?o(e,r,n):1===t||3===t?s(e,r,n):2===t?i(e,r,n):void 0},e.ch32=o,e.maj32=i,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(1),o=r(13),i=r(52),s=r(12),a=n.sum32,u=n.sum32_4,c=n.sum32_5,f=i.ch32,l=i.maj32,h=i.s0_256,p=i.s1_256,d=i.g0_256,g=i.g1_256,y=o.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(v,y),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(g(r[n-2]),r[n-7],d(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],y=this.h[2],m=this.h[3],v=this.h[4],b=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=c(_,p(v),f(v,b,w),this.k[n],r[n]),A=a(h(o),l(o,i,y));_=w,w=b,b=v,v=a(m,E),m=y,y=i,i=o,o=a(E,A)}this.h[0]=a(this.h[0],o),this.h[1]=a(this.h[1],i),this.h[2]=a(this.h[2],y),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(1),o=r(13),i=r(12),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,h=n.sum64_lo,p=n.sum64_4_hi,d=n.sum64_4_lo,g=n.sum64_5_hi,y=n.sum64_5_lo,m=o.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,r,n,o){var i=t&r^~t&o;return i<0&&(i+=4294967296),i}function _(t,e,r,n,o,i){var s=e&n^~e&i;return s<0&&(s+=4294967296),s}function E(t,e,r,n,o){var i=t&r^t&o^r&o;return i<0&&(i+=4294967296),i}function A(t,e,r,n,o,i){var s=e&n^e&i^n&i;return s<0&&(s+=4294967296),s}function x(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function S(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function P(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function C(t,e){var r=a(t,e,1)^a(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function j(t,e){var r=a(t,e,19)^a(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(b,m),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var o=R(r[n-4],r[n-3]),i=j(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=P(r[n-30],r[n-29]),c=C(r[n-30],r[n-29]),f=r[n-32],l=r[n-31];r[n]=p(o,i,s,a,u,c,f,l),r[n+1]=d(o,i,s,a,u,c,f,l)}},b.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],p=this.h[6],d=this.h[7],m=this.h[8],v=this.h[9],b=this.h[10],P=this.h[11],C=this.h[12],R=this.h[13],j=this.h[14],I=this.h[15];i(this.k.length===r.length);for(var D=0;D<r.length;D+=2){var k=j,F=I,N=S(m,v),U=O(m,v),L=w(m,v,b,P,C),B=_(m,v,b,P,C,R),M=this.k[D],q=this.k[D+1],G=r[D],V=r[D+1],H=g(k,F,N,U,L,B,M,q,G,V),Y=y(k,F,N,U,L,B,M,q,G,V);k=x(n,o),F=T(n,o),N=E(n,o,s,a,u),U=A(n,o,s,a,u,c);var z=l(k,F,N,U),$=h(k,F,N,U);j=C,I=R,C=b,R=P,b=m,P=v,m=l(p,d,H,Y),v=h(d,d,H,Y),p=u,d=c,u=s,c=a,s=n,a=o,n=l(H,Y,z,$),o=h(H,Y,z,$)}f(this.h,0,n,o),f(this.h,2,s,a),f(this.h,4,u,c),f(this.h,6,p,d),f(this.h,8,m,v),f(this.h,10,b,P),f(this.h,12,C,R),f(this.h,14,j,I)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){const{createVaultFacade:n}=r(56),o=["string","number","boolean","undefined"];class i{static calculateHistoryDifferences(t,e){return function(t,e){const r=[...t],n=[...e],o=function(t,e){const r=t=>t&&t.length>=3?t.substr(0,3):"",n=t=>t.split(" ")[1];for(let o=t.length-1;o>=9;o-=1)if("pad"===r(t[o])){const i=n(t[o]);for(let t=e.length-1;t>=0;t-=1)if("pad"===r(e[t])&&n(e[t])===i)return{a:o,b:t}}return null}(r,n);return null===o?null:{original:r.splice(o.a+1,r.length),secondary:n.splice(o.b+1,n.length),common:r}}(t,e)}constructor(t,e){this._vaultA=t,this._vaultB=e}calculateDifferences(){return i.calculateHistoryDifferences(this._vaultA.format.history,this._vaultB.format.history)}vaultsDiffer(){const t=n(this._vaultA),e=n(this._vaultB);return delete t.id,delete e.id,delete t._tag,delete e._tag,function t(e,r){if(Array.isArray(e)&&Array.isArray(r)){if(!e.some((function(e){return!r.some((function(r){return!1===t(e,r)}))})))return r.some((function(r){return!e.some((function(e){return!1===t(r,e)}))}))}else if("object"==typeof e&&"object"==typeof r){if(null===e&&null===r)return!1;let o=(n=[...Object.keys(e),...Object.keys(r)]).filter((function(t,e){return n.indexOf(t)===e}));if(!o.some((function(t){return!(e.hasOwnProperty(t)&&r.hasOwnProperty(t))})))return o.some((function(n){return t(e[n],r[n])}))}else if(o.indexOf(typeof e)===o.indexOf(typeof r))return e!==r;var n;return!0}(t,e)}}t.exports=i},function(t,e,r){const{v4:n}=r(32),{consumeEntryFacade:o,createEntryFacade:i}=r(57),s=r(5),{idSignifiesNew:a}=r(18),{FACADE_VERSION:u}=r(14),{FacadeType:c}=s.Attributes;function f(t,e){const{id:r,title:n,type:o,attributes:i}=e,s=t.getAttribute();if("group"!==o)throw new Error("Failed consuming group facade: Invalid facade type: "+o);if(r!==t.id)throw new Error(`Failed consuming group facade: Provided facade ID (${r}) does not match target group's ID: ${t.id}`);if(!n||n.trim().length<=0)throw new Error("Failed consuming group facade: Title must not be empty");t.getTitle()!==n&&t.setTitle(n),Object.keys(s).filter(t=>!i.hasOwnProperty(t)).forEach(e=>{t.deleteAttribute(e)}),Object.keys(i).forEach(e=>{s[e]&&s[e]===i[e]||t.setAttribute(e,i[e])})}function l(t){return{_tag:n(),_ver:u,type:"vault",id:t.id,attributes:t.getAttribute(),groups:g(t),entries:p(t)}}function h(t,e="0"){return{type:"group",id:t?t.id:null,title:t?t.getTitle():"",attributes:t?t.getAttribute():{},parentID:e}}function p(t){return t.getGroups().reduce((t,e)=>[...t,...d(e)],[])}function d(t,e){const r=t.getEntries().map(t=>Object.assign({},i(t)));return t.getGroups().forEach(t=>{r.push(...d(t,t.id))}),r}function g(t,e="0"){const r=t.getGroups().map(t=>h(t,e));return t.getGroups().forEach(t=>{r.push(...g(t,t.id))}),r}t.exports={consumeGroupFacade:f,consumeVaultFacade:function(t,e){if(e._ver!==u)throw new Error("Invalid vault facade version");if(!t||t&&"Vault"!==t.type)throw new Error("Failed consuming vault facade: First parameter expected to be an Vault instance");if(!e||e&&"vault"!==e.type)throw new Error("Failed consuming vault facade: Second parameter expected to be a vault facade, got: "+e.type);const{id:r,type:n,attributes:i,groups:s,entries:h}=e;if("vault"!==n)throw new Error("Failed consuming vault facade: Invalid facade type: "+n);if(r!==t.id)throw new Error(`Failed consuming vault facade: Provided facade ID (${r}) does not match target vault ID: ${t.id}`);const d={};let{groups:y,entries:m,attributes:v}=l(t);y.forEach(e=>{if(!s.find(t=>t.id===e.id)){const r=t.findGroupByID(e.id);r&&r.delete()}}),y=g(t);let b=[...s];for(;b.length>0;){let e=b.length;if(b=b.filter(e=>{const r=Object.assign({},e),n=a(r.id);if(!r.id||n){let e=r.parentID;if(a(e)){if(!d[e])return!0;e=d[e]}const o=("0"===e?t:t.findGroupByID(e)).createGroup(r.title);n&&(d[""+r.id]=o.id),r.id=o.id}else{if(!y.find(t=>t.id===r.id))return;const{id:e,parentID:n}=r,o=t.findGroupByID(e),i=o.getParentGroup();(null===i&&"0"!==n||null!==i&&i.id!==n)&&o.moveTo("0"===n?t:t.findGroupByID(n))}return f(t.findGroupByID(r.id),r),!1}),e===b.length){const t=b.map(t=>t.id);throw new Error("Processing facade stalled: groups not resolveable: "+t.join(", "))}}m.forEach(e=>{if(!h.find(t=>t.id===e.id)){const r=t.findEntryByID(e.id);r&&r.delete()}}),m=p(t);let w=[...h];w=w.filter(e=>{const r=Object.assign({},e),n=a(r.id);if(!r.id||n){let e=r.parentID;if(a(e)){if(!d[e])return!0;e=d[e]}const o=t.findGroupByID(e).createEntry();n&&(d[""+r.id]=o.id),r.id=o.id,r.type&&o.setAttribute(c,r.type)}else{if(!m.find(t=>t.id===e.id))return;const n=t.findEntryByID(r.id);n.getGroup().id!==r.parentID&&n.moveToGroup(t.findGroupByID(r.parentID))}const i=t.findEntryByID(r.id);return o(i,r),!1}),Object.keys(v).filter(t=>!i.hasOwnProperty(t)).forEach(e=>{t.deleteAttribute(e)}),Object.keys(i).forEach(e=>{v[e]&&v[e]===i[e]||t.setAttribute(e,i[e])})},createGroupFacade:h,createVaultFacade:l}},function(t,e,r){const n=r(110),{createFieldDescriptor:o,getEntryValueType:i,setEntryValueType:s}=r(18),{ENTRY_TYPE_LOGIN:a}=r(14),u=r(5),{FacadeType:c}=u.Attributes;function f(t,e){!function(t,e,r,n,o){switch(e){case"property":t.getProperty(r)!==n&&t.setProperty(r,n);break;case"attribute":t.getAttribute(r)!==n&&t.setAttribute(r,n);break;default:throw new Error("Cannot set value: Unknown property type: "+e)}o&&i(t)!==o&&s(t,r,o)}(t,e.propertyType,e.property,e.value,e.valueType)}function l(t){return t&&t.getAttribute(c)||"login"}t.exports={consumeEntryFacade:function(t,e){const r=l(t);if(e&&e.type){const n=t.getProperty(),o=t.getAttribute();if(e.type!==r)throw new Error(`Failed consuming entry data: Expected type "${r}" but received "${e.type}"`);return(e.fields||[]).forEach(e=>f(t,e)),Object.keys(n).forEach(r=>{void 0===e.fields.find(({propertyType:t,property:e})=>"property"===t&&e===r)&&t.deleteProperty(r)}),void Object.keys(o).forEach(r=>{void 0===e.fields.find(({propertyType:t,property:e})=>"attribute"===t&&e===r)&&t.deleteAttribute(r)})}throw new Error("Failed consuming entry data: Invalid item passed as a facade")},createEntryFacade:function(t,{type:e}={}){if(t&&"Entry"!==t.type)throw new Error("Failed creating entry facade: Provided item is not an Entry");const r=e||l(t),i=n[r];if(!i)throw new Error(`Failed creating entry facade: No factory found for type "${r}"`);const s=t?function(t,e){const r=(t,r)=>e.find(e=>e.propertyType===r&&e.property===t),{properties:n={},attributes:i={}}=t._source;return[...e,...Object.keys(n).filter(t=>!r(t,"property")).map(e=>o(t,"","property",e,{removeable:!0})),...Object.keys(i).filter(t=>!r(t,"attribute")).map(e=>o(t,"","attribute",e))]}(t,i(t)):i(t);if(!s.find(t=>"attribute"===t.propertyType&&t.property===c)){const e=o(t,"","attribute",c);e.value=r,s.push(e)}return{id:t?t.id:null,type:r,fields:s,parentID:t?t.getGroup().id:null,_history:t?t.getChanges():[]}}}},function(t,e){const r=/^otpauth:\/\/[ht]otp\/[^\s]+$/i;t.exports={isOTPURI:function(t){return r.test(t)},isVaultFacade:function(t){return!(!t||"object"!=typeof t)&&("vault"===t.type&&"string"==typeof t.id&&Array.isArray(t.entries)&&Array.isArray(t.groups))}}},function(t,e,r){"use strict";var n,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var o,i,s,a;if(c(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),s=i[e]),void 0===s)s=i[e]=r,++t._eventsCount;else if("function"==typeof s?s=i[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=f(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}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 p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=h.bind(n);return o.listener=r,n.wrapFn=o,o}function d(t,e,r){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):y(o,o.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var c=u.length,f=y(u,c);for(r=0;r<c;++r)i(f[r],this,e)}return!0},a.prototype.addListener=function(t,e){return l(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return l(this,t,e,!0)},a.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},a.prototype.removeListener=function(t,e){var r,n,o,i,s;if(c(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){const{sequence:n}=r(117),o=()=>{};function i(t){return{original:t,methods:[t],final:!1}}t.exports=class{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__="@@HOTPATCHER"}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t,e=!1){if(!t||"@@HOTPATCHER"!==t.__type__)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach(r=>{this.configuration.registry.hasOwnProperty(r)?e&&(this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])):this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])}),t._configuration=this.configuration,this}execute(t,...e){return(this.get(t)||o)(...e)}get(t){const e=this.configuration.registry[t];if(!e)switch(this.getEmptyAction){case"null":return null;case"throw":throw new Error("Failed handling method request: No method provided for override: "+t);default:throw new Error("Failed handling request which resulted in an empty method: Invalid empty-action specified: "+this.getEmptyAction)}return n(...e.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,e,{chain:r=!1}={}){if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if("function"!=typeof e)throw new Error(`Failed patching '${t}': Provided method is not a function`);if(r)this.configuration.registry[t]?this.configuration.registry[t].methods.push(e):this.configuration.registry[t]=i(e);else if(this.isPatched(t)){const{original:r}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(i(e),{original:r})}else this.configuration.registry[t]=i(e);return this}patchInline(t,e,...r){return this.isPatched(t)||this.patch(t,e),this.execute(t,...r)}plugin(t,...e){return e.forEach(e=>{this.patch(t,e,{chain:!0})}),this}restore(t){if(!this.isPatched(t))throw new Error("Failed restoring method: No method present for key: "+t);if("function"!=typeof this.configuration.registry[t].original)throw new Error("Failed restoring method: Original method not found or of invalid type for key: "+t);this.configuration.registry[t].methods=[this.configuration.registry[t].original]}setFinal(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error(`Failed marking '${t}' as final: No method found for key`);return this.configuration.registry[t].final=!0,this}}},function(t,e,r){const n=r(3);t.exports={handleError:function(t){if(t.responseHeaders&&t.responseHeaders["www-authenticate"])throw new n({cause:t,info:{authFailure:/error=invalid_token/.test(t.responseHeaders["www-authenticate"])}},"Request failed");throw new n(t,"Request failed")}}},function(t,e,r){const n=r(59),{forEachAsync:o}=r(140),i=r(142);let s;class a extends n{static getSharedManager(){return s||(s=new a,void 0!==i._bcupAuthMgr&&console.warn("Detected multiple Buttercup authentication managers for datasources: Multiple copies of the same library may have been bundled together"),i._bcupAuthMgr=!0),s}constructor(){super(),this._handlers={}}executeAuthHandlers(t,e){const r=this._handlers[t];return Array.isArray(r)?Promise.resolve().then(()=>o(r,t=>t(e))).then(()=>{this.emit("authHandlersExecuted",{datasource:e,datasourceType:t})}):Promise.reject(new Error("Failed executing auth handlers: No handlers registered for datasource type: "+t))}registerHandler(t,e){if("function"!=typeof e)throw new Error("Failed registering handler: Argument was not a function");this._handlers[t]=this._handlers[t]||[],this._handlers[t].push(e)}}t.exports=a},function(t,e,r){const n=r(3),{request:o}=r(144),i=r(9),{Base64:s}=r(44),{API_INSIGHTS:a,API_ORG_USERS:u,API_OWN_ARCHIVE:c,API_OWN_ARCHIVE_DETAILS:f,API_OWN_DIGEST:l,API_OWN_PASS_CHANGE:h,API_OWN_PASS_CHANGE_VERIFY:p,API_SHARES:d,OAUTH_AUTHORISE_URI:g,OAUTH_REDIRECT_URI:y,OAUTH_TOKEN_URI:m}=r(149),{detectFormat:v}=r(17);t.exports=class extends i{static exchangeAuthCodeForTokens(t,e,r,i){const a=s.encode(`${e}:${r}`),u=encodeURIComponent(i);return o({url:m,method:"POST",headers:{Authorization:"Basic "+a,"Content-Type":"application/x-www-form-urlencoded"},body:`grant_type=authorization_code&code=${t}&redirect_uri=${u}`}).then(t=>{const{data:{access_token:e,refresh_token:r,token_type:n}}=t;if(!/^[Bb]earer$/.test(n))throw new Error("Invalid token type: "+n);if(!e||!r)throw new Error("Not all expected tokens were returned by the server");return{accessToken:e,refreshToken:r}}).catch(t=>{throw new n(t,"Failed exchanging auth code for tokens")})}static generateAuthorisationURL(t){const e=encodeURIComponent(y);return`${g}?response_type=code&client_id=${t}&redirect_uri=${e}`}constructor(t,e,r,n){super(),this._accessToken=r,this._refreshToken=n,this._lastDigest=null,this._clientID=t,this._clientSecret=e,this.request=o}get accessToken(){return this._accessToken}get digest(){return this._lastDigest}get refreshToken(){return this._refreshToken}async changePassword(t,e){const r={url:h,method:"PUT",headers:{Authorization:"Bearer "+this.accessToken,"Content-Type":"application/json"},body:JSON.stringify({password:t,passwordToken:e})};return this.request(r).then(t=>{const{data:e}=t;if("ok"!==e.status)throw new Error("Invalid password change status")}).catch(r=>this._handleRequestFailure(r).then(()=>this.changePassword(t,e))).catch(t=>{throw new n(t,"Failed changing password")})}fetchShares(t){if(t.length<=0)return Promise.resolve({});const e={url:`${d}?ids=${t.join(",")}`,method:"GET",headers:{Authorization:"Bearer "+this.accessToken},responseType:"text"};return this.request(e).then(t=>function(t){const e={},r=t.split("\n");for(;r.length>0;){const t=r.shift();if(!/^\<--\(/.test(t))continue;let o;try{o=JSON.parse(t.replace(/^\<--\(/,"").replace(/\)--\>$/,""))}catch(t){throw new n(t,"Invalid share metadata")}if(!o.id)throw new Error("Multiplexed share definition invalid:\n\t"+t);e[o.id]=Object.assign(o,{contents:r.shift()})}return e}(t.data)).catch(e=>this._handleRequestFailure(e).then(()=>this.fetchShares(t))).catch(t=>{throw new n(t,"Failed retrieving shares")})}fetchUserVault(){const t={url:c,method:"GET",headers:{Authorization:"Bearer "+this.accessToken},responseType:"text"};return this.request(t).then(t=>{const{data:e,headers:r}=t,n=parseInt(r["x-mb-updateid"],10);if(!n)throw new Error("Invalid vault response: Invalid update ID header");return{archive:e,updateID:n}}).catch(t=>this._handleRequestFailure(t).then(()=>this.fetchUserVault())).catch(t=>{throw new n(t,"Could not retrieve vault")})}fetchUserVaultDetails(){const t={url:f,method:"GET",headers:{Authorization:"Bearer "+this.accessToken}};return this.request(t).then(t=>{const{data:{details:{id:e,updateID:r,created:n,lastUpdate:o}}}=t;return{id:e,updateID:r,created:n,lastUpdate:o}}).catch(t=>this._handleRequestFailure(t).then(()=>this.fetchUserVaultDetails())).catch(t=>{throw new n(t,"Could not retrieve vault details")})}retrieveDigest(){const t={url:l,method:"GET",headers:{Authorization:"Bearer "+this.accessToken}};return this.request(t).then(t=>{const{data:e}=t;if("ok"!==e.status)throw new Error("Invalid digest response");return this._lastDigest=e,e}).catch(t=>this._handleRequestFailure(t).then(()=>this.retrieveDigest())).catch(t=>{throw new n(t,"Failed retrieving digest information")})}async retrieveUsersList(){this.digest||await this.retrieveDigest();const t=this.digest.organisations.map(t=>t.id);return t.length<=0?[]:Promise.all(t.map(t=>this.retrieveUsersListForOrganisation(t))).then(t=>t.reduce((t,e)=>[...t,...e],[])).catch(t=>{throw new n(t,"Failed retrieving users list")})}retrieveUsersListForOrganisation(t){const e={url:u.replace("[ORG_ID]",t),method:"GET",headers:{Authorization:"Bearer "+this.accessToken}};return this.request(e).then(t=>{const{data:e}=t;if("ok"!==e.status||!e.users)throw new Error("Invalid users list response");return e.users}).catch(e=>this._handleRequestFailure(e).then(()=>this.retrieveUsersListForOrganisation(t))).catch(t=>{throw new n(t,"Failed retrieving organisation users")})}async testPasswordChange(t){const e={url:p,method:"POST",headers:{Authorization:"Bearer "+this.accessToken,"Content-Type":"application/json"},body:JSON.stringify({passwordToken:t})};return this.request(e).then(t=>{const{data:e}=t;if("ok"!==e.status)throw new Error("Password change not possible: Potentially invalid account state or token")}).catch(e=>this._handleRequestFailure(e).then(()=>this.testPasswordChange(t))).catch(t=>{throw new n(t,"Failed checking password-change availability")})}async writeInsights(t){this.digest||await this.retrieveDigest();const{avgPassLen:e=null,entries:r=null,groups:o=null,longPassLen:i=null,shortPassLen:s=null,trashEntries:u=null,trashGroups:c=null}=t,f={url:a,method:"PUT",headers:{Authorization:"Bearer "+this.accessToken,"Content-Type":"application/json"},body:JSON.stringify({insights:{avgPassLen:e,entries:r,groups:o,longPassLen:i,shortPassLen:s,trashEntries:u,trashGroups:c},vaultID:this.digest.archive_id})};return this.request(f).then(t=>{const{data:e}=t;if("ok"!==e.status)throw new Error("Invalid insights update response")}).catch(e=>this._handleRequestFailure(e).then(()=>this.writeInsights(t))).catch(t=>{throw new n(t,"Failed updating vault/account insights")})}async writeUserArchive(t,e,r){const o={url:c,method:"PUT",headers:{Authorization:"Bearer "+this.accessToken,"Content-Type":"text/plain","x-mb-updateid":""+e,"x-mb-newupdateid":""+r},body:t},i=v(t);if(!i||!i.isEncrypted(t))throw new Error("Vault contents not in expected encrypted form");return this.request(o).then(t=>{const{data:e}=t;if("ok"!==e.status)throw new Error("Invalid vault update response: Changes may not have been saved")}).catch(n=>this._handleRequestFailure(n).then(()=>this.writeUserArchive(t,e,r))).catch(t=>{throw new n(t,"Failed uploading updated vault contents")})}async _handleRequestFailure(t){if(t.responseHeaders&&"object"==typeof t.responseHeaders&&t.responseHeaders["x-mb-oauth"])switch(t.responseHeaders["x-mb-oauth"]){case"token_expired":return this._performTokenRefresh();default:throw new n({cause:t,info:{"x-mb-oauth":t.responseHeaders["x-mb-oauth"]}},"Unrecognised authorisation failure type: "+t.responseHeaders["x-mb-oauth"])}throw t}_performTokenRefresh(){const t=s.encode(`${this._clientID}:${this._clientSecret}`),e={url:m,method:"POST",headers:{Authorization:"Basic "+t,"Content-Type":"application/x-www-form-urlencoded"},body:"grant_type=refresh_token&refresh_token="+this.refreshToken};return this.request(e).then(t=>{const{data:{access_token:e,token_type:r}}=t;if(!/^[Bb]earer$/.test(r))throw new Error("Invalid token type: "+r);if(!e)throw new Error("Access token was not returned by the server");this._accessToken=e,this.emit("tokensUpdated")}).catch(t=>{throw new n(t,"Failed exchanging refresh token for new access token")})}}},function(t,e){t.exports={ERR_ABORTED:50,ERR_REQUEST_FAILED:51,ERR_STATUS_INVALID:52}},function(t,e,r){const{getSharedAppEnv:n}=r(33),{applyWebConfiguration:o}=r(68);let i=!1;t.exports=Object.assign({},r(79),r(155),{init:function(){if(i)return;i=!0;const t=n();o(t)}})},function(t,e,r){const{assignObjImmutableProp:n}=r(34);function o(t,e={}){const{defaultValue:r=null,failIfNotExist:n=!0}=e;if(void 0!==this.properties[t])return this.properties[t];if(n)throw new Error(`Unable to get application environment property: '${t}' does not exist`);return r}function i(t){return void 0!==this.properties[t]}function s(t){const e=a.bind(this);for(const r in t)e(r,t[r])}function a(t,e){if(void 0!==this.properties[t])throw new Error(`Unable to set application environment property: '${t}' already exists`);n(this.properties,t,e)}t.exports={createAppEnv:function(){const t={},e={properties:{}};return n(t,"getProperty",o.bind(e)),n(t,"hasProperty",i.bind(e)),n(t,"setProperties",s.bind(e)),n(t,"setProperty",a.bind(e)),t}}},function(t,e,r){(function(e){t.exports={getGlobal:function(){if("undefined"!=typeof window)return window;if(void 0!==e)return e;if("undefined"!=typeof self)return self;throw new Error("Unable to detect any global variable/context")}}}).call(this,r(8))},function(t,e,r){const{getCryptoResources:n}=r(69),{getCompressionResources:o}=r(71),{getNetResources:i}=r(77);t.exports={applyWebConfiguration:function(t){t.setProperties(n()),t.setProperties(o()),t.setProperties(i())}}},function(t,e,r){const{createSession:n}=r(70);let o=null;function i(t,e){return n().decrypt(t,e)}function s(t,e){const r=n();return o>0&&r.setDerivationRounds(o),r.encrypt(t,e)}function a(t=null){o=t}t.exports={getCryptoResources:function(){return{"crypto/v1/decryptBuffer":i,"crypto/v1/encryptBuffer":s,"crypto/v1/decryptText":i,"crypto/v1/encryptText":s,"crypto/v1/setDerivationRounds":a}}}},function(t,e,r){window,t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var n;r.r(e),function(t){t.CBC="cbc",t.GCM="gcm"}(n||(n={}));var o=n.CBC,i=25e4;function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=[n.CBC,n.GCM];function u(t){if(-1===a.indexOf(t))throw new Error("Invalid encryption/decryption method: ".concat(t))}function c(t,e,r){return r?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var d=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,h(e).apply(this,arguments))}var r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(e,t),r=e,(o=[{key:"decrypt",value:function(t,e){try{var r="string"==typeof t?this.options.unpack_text(t):this.options.unpack_data(t),n=r.salt,o=r.rounds,i=r.method,s=this.options["decryption_".concat(i)];return c(this._deriveKey(e,n,o,i),(function(t){return s(r,t)}))}catch(t){return Promise.reject(t)}}},{key:"encrypt",value:function(t,e){try{var r=this,n=r.options,o=n.generateIV,i=n.method,s=r.options["encryption_".concat(i)];return c(Promise.all([r._deriveNewKey(e),o()]),(function(e){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e,2),o=n[0],i=n[1];return c(s(t,o,i),(function(e){return"string"==typeof t?r.options.pack_text(e):r.options.pack_data(e)}))}))}catch(t){return Promise.reject(t)}}},{key:"_deriveKey",value:function(t,e,r,o){var i=this.options,s=i.derivationRounds,a=i.method,u=i.pbkdf2,c=o||a,f=this.options.deriveKey;return(c===n.GCM?function(){return f(u,t,e,r||s,!1)}:function(){return f(u,t,e,r||s)})()}},{key:"_deriveNewKey",value:function(t){try{var e=this,r=e.options;return c((0,r.generateSalt)(r.saltLength),(function(r){return e._deriveKey(t,r)}))}catch(t){return Promise.reject(t)}}}])&&f(r.prototype,o),e}(function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._baseOptions=Object.assign({},e),this._options=e}var e,r;return e=t,(r=[{key:"overrideDecryption",value:function(t,e){return u(t),this._options["decryption_".concat(t)]=e||this._baseOptions["decryption_".concat(t)],this}},{key:"overrideEncryption",value:function(t,e){return u(t),this._options["encryption_".concat(t)]=e||this._baseOptions["encryption_".concat(t)],this}},{key:"overrideIVGeneration",value:function(t){return this._options.generateIV=t||this._baseOptions.generateIV,this}},{key:"overrideKeyDerivation",value:function(t){return this._options.deriveKey=t||this._baseOptions.deriveKey,this}},{key:"overridePBKDF2",value:function(t){return this._options.pbkdf2=t||this._baseOptions.pbkdf2,this}},{key:"overrideSaltGeneration",value:function(t){return this._options.generateSalt=t||this._baseOptions.generateSalt,this}},{key:"reset",value:function(){return this._options=this._baseOptions,this}},{key:"setDerivationRounds",value:function(t){return void 0===t?this._options.derivationRounds=i:"number"==typeof t&&(this._options.derivationRounds=t),this}},{key:"use",value:function(t){return u(t),this._options.method=t,this}},{key:"options",get:function(){return Object.assign({},this._options)}}])&&s(e.prototype,r),t}());function g(t){var e=Array.from(new Uint8Array(t)).map((function(t){return String.fromCharCode(t)})).join("");return btoa(e)}function y(t){for(var e,r=new Uint8Array(t),n="",o=0;o<r.byteLength;o+=1)(e=r[o].toString(16)).length<2&&(e="0"+e),n+=e;return n}function m(t){return(new TextDecoder).decode(t)}function v(t){for(var e=atob(t),r=new Uint8Array(new ArrayBuffer(e.length)),n=0;n<e.length;n+=1)r[n]=e.charCodeAt(n);return r.buffer}function b(t){if(t.length<=0)throw new Error("Failed concatenating array buffers: At least one must be passed");var e=t.reduce((function(t,e){return t+e.byteLength}),0),r=new Uint8Array(e),n=0;return t.forEach((function(t){r.set(new Uint8Array(t),n),n+=t.byteLength})),r.buffer}function w(t){var e=t.match(/[\da-f]{2}/gi).map((function(t){return parseInt(t,16)}));return new Uint8Array(e).buffer}function _(t){return(new TextEncoder).encode(t)}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function A(t,e,r){return r?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}function x(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{return Promise.resolve(t.apply(this,e))}catch(t){return Promise.reject(t)}}}var T=x((function(t,e,r,n){!function(){if(!window.TextEncoder||!window.TextDecoder)throw new Error("TextEncoder is not available")}();var o=window.crypto.subtle,i={name:"PBKDF2",hash:"SHA-256",salt:_(e),iterations:r},s=n/8/2;return A(o.importKey("raw",_(t),{name:"PBKDF2"},!1,["deriveBits"]),(function(t){return A(o.deriveBits(i,t,n),(function(t){return A(Promise.all([o.importKey("raw",t.slice(0,s),"AES-CBC",!0,["encrypt","decrypt"]),o.importKey("raw",t.slice(s,2*s),"AES-CBC",!0,["encrypt","decrypt"])]),(function(t){var e=E(t,2),r=e[0],n=e[1];return A(Promise.all([o.exportKey("raw",r),o.exportKey("raw",n)]),(function(t){var e,r,n=E(t,2),o=n[0],i=n[1];return e=b([o,i]),r=e.toString||function(){},e.toString=function(t){return"hex"===t?y(e):r.call(e,t)},e}))}))}))}))})),S=x((function(t,e,r,n){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!e)throw new Error("Failed deriving key: Password must be provided");if(!r)throw new Error("Failed deriving key: Salt must be provided");if(!n||n<=0)throw new Error("Failed deriving key: Rounds must be greater than 0");var i=o?8*(P+O):8*P;return A(t(e,r,n,i),(function(t){var e=t.toString("hex"),i=e.length,s=w(o?e.substr(0,i/2):e);return{salt:r,key:s,rounds:n,hmac:o?w(e.substr(i/2,i/2)):null}}))})),O=32,P=32;function C(t,e,r){return r?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}function R(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{return Promise.resolve(t.apply(this,e))}catch(t){return Promise.reject(t)}}}var j=R((function(t){if(t<=0)throw new Error("Failed generating salt: Invalid length supplied: ".concat(t));for(var e=G(),r="";r.length<t;){var n=new Uint8Array(3);e.getRandomValues(n);var o=n.reduce((function(t,e){return t+String.fromCharCode(e)}),"");(r+=btoa(o)).length>t&&(r=r.substr(0,t))}return r})),I=R((function(){var t=new Uint8Array(16);return G().getRandomValues(t),t.buffer})),D=R((function(t,e,r){var o=G(),i=e.rounds,s=new Uint8Array(r),a=y(r),u="string"==typeof t,c=u?_(t):t;return C(o.subtle.importKey("raw",e.key,{name:L},!1,["encrypt"]),(function(t){return C(o.subtle.encrypt({name:L,iv:s,additionalData:_("".concat(a).concat(e.salt))},t,c),(function(t){var r,o,s=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}((o=B/8,[(r=t).slice(0,r.byteLength-o),r.slice(r.byteLength-o)]),2),c=s[0],f=y(s[1]),l=u?g(c):c;return{method:n.GCM,iv:a,salt:e.salt,rounds:i,content:l,auth:f}}))}))})),k=R((function(t,e,r){var o=G(),i=e.rounds,s=e.salt,a=new Uint16Array(r),u=y(r),c="string"==typeof t,f=c?_(t):t;return C(o.subtle.importKey("raw",e.key,{name:U},!1,["encrypt"]),(function(t){return C(o.subtle.importKey("raw",e.hmac,{name:q,hash:M},!1,["sign"]),(function(e){return C(o.subtle.encrypt({name:U,iv:a},t,f),(function(t){var r=c?g(t):t,o=c?_("".concat(r).concat(u).concat(s)):b([r,_(u),_(s)]);return C(window.crypto.subtle.sign(q,e,o),(function(t){var e=y(t);return{method:n.CBC,auth:e,iv:u,salt:s,rounds:i,content:r}}))}))}))}))})),F=R((function(t,e){var r=G(),n=t.auth,o=t.content,i=t.iv,s=t.salt,a=w(i),u=w(n),c="string"==typeof o,f=b(c?[v(o),u]:[o,u]);return C(r.subtle.importKey("raw",e.key,{name:L},!1,["decrypt"]),(function(t){return C(r.subtle.decrypt({name:L,iv:a,additionalData:_("".concat(i).concat(s))},t,f),(function(t){return c?m(t):t}))}))})),N=R((function(t,e){var r=G(),n=t.auth,o=t.content,i=t.iv,s=t.salt,a=w(i),u=_(i),c=_(s),f=w(n),l="string"==typeof o,h=l?v(o):o;return C(r.subtle.importKey("raw",e.key,{name:U},!1,["decrypt"]),(function(t){return C(r.subtle.importKey("raw",e.hmac,{name:q,hash:M},!1,["verify"]),(function(e){var n=l?_("".concat(o).concat(i).concat(s)):b([h,u,c]);return C(r.subtle.verify(q,e,f,n),(function(e){if(!e)throw new Error("Authentication failed while decrypting content");return C(r.subtle.decrypt({name:U,iv:a},t,h),(function(t){return l?m(t):t}))}))}))}))})),U="AES-CBC",L="AES-GCM",B=128,M="SHA-256",q="HMAC";function G(){return window.crypto||window.msCrypto}function V(){return"iocane/1".split("").map((function(t){return t.charCodeAt(0)}))}function H(t){return[t.content,t.iv,t.salt,t.auth,t.rounds,t.method].join("$")}function Y(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t.split("$"),6),r=e[0],n=e[1],i=e[2],s=e[3],a=e[4],u=e[5];return{content:r,iv:n,salt:i,auth:s,rounds:a?parseInt(a,10):1e3,method:u||o}}function z(t){var e=new Uint8Array(V()).buffer,r=t.content,n=t.iv,o=t.salt,i=t.auth,s=t.rounds,a=t.method;return b([e].concat(function(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}([r,n,o,i,s,a].reduce((function(t,e){var r,n,o;if("string"==typeof e||"number"==typeof e)r=_("".concat(e));else{if(!(e instanceof ArrayBuffer))throw new Error("Failed packing data: Invalid component type: ".concat(typeof e));r=e}return t.push((n=r.byteLength,o=new ArrayBuffer(4),new DataView(o).setUint32(0,n,!1),o)),t.push(r),t}),[]))))}function $(t){var e=new Uint8Array(V()).buffer,r=e.byteLength;if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=new Uint8Array(t),n=new Uint8Array(e),o=0;o<t.byteLength;o+=1)if(r[o]!==n[o])return!1;return!0}(t.slice(0,r),e))throw new Error("Failed unpacking data: Signature mismatch");for(var n=r,o=[],i=new DataView(t);n<t.byteLength;){var s=i.getUint32(n);n+=4;var a=t.slice(n,n+s);n+=s,o.push(a)}var u=o[0],c=o[1],f=o[2],l=o[3],h=o[4],p=o[5];return{content:u,iv:m(c),salt:m(f),auth:m(l),rounds:parseInt(m(h),10),method:m(p)}}function K(){return new d({decryption_cbc:N,decryption_gcm:F,derivationRounds:i,deriveKey:S,encryption_cbc:k,encryption_gcm:D,generateIV:I,generateSalt:j,method:o,pack_data:z,pack_text:H,pbkdf2:T,saltLength:12,unpack_data:$,unpack_text:Y})}r.d(e,"createSession",(function(){return K}))}])},function(t,e,r){const n=r(72);function o(t){const e=n.zip(t,{level:9,timestamp:parseInt(Date.now()/1e3,10)}),r=e.length;let o="";for(let t=0;t<r;t+=1)o+=String.fromCharCode(e[t]);return o}function i(t){for(var e=[],r=t.length,o=0;o<r;o+=1)e.push(t.charCodeAt(o));const i=n.unzip(e),s=i.length;let a="";for(let t=0;t<s;t+=1)a+=String.fromCharCode(i[t]);return a}t.exports={getCompressionResources:function(){return{"compression/v1/compressText":o,"compression/v1/decompressText":i}}}},function(t,e,r){!function(){"use strict";var e=r(73),n=r(74),o={deflate:8},i=1,s=2,a=4,u=8,c=16,f={fat:0,amiga:1,vmz:2,unix:3,"vm/cms":4,atari:5,hpfs:6,macintosh:7,"z-system":8,cplm:9,"tops-20":10,ntfs:11,qdos:12,acorn:13,vfat:14,vms:15,beos:16,tandem:17,theos:18};function l(t,e){e.push(255&t)}function h(t,e){e.push(255&t),e.push(t>>>8)}function p(t,e){h(65535&t,e),h(t>>>16,e)}function d(t){return t.shift()}function g(t){return t.shift()|t.shift()<<8}function y(t){var e=g(t),r=g(t);return r>32768?((r-=32768)<<16|e)+32768*Math.pow(2,16):r<<16|e}function m(t){for(var e=[];0!==t[0];)e.push(String.fromCharCode(t.shift()));return t.shift(),e.join("")}t.exports={zip:function(t,r){var i,s=0,a=[];return r||(r={}),i=r.level||6,"string"==typeof t&&(t=Array.prototype.map.call(t,(function(t){return t.charCodeAt(0)}))),l(31,a),l(139,a),l(o.deflate,a),r.name&&(s|=u),l(s,a),p(r.timestamp||parseInt(Date.now()/1e3,10),a),l(1===i?4:9===i?2:0,a),l(f.unix,a),r.name&&(!function(t,e){var r,n=t.length;for(r=0;r<n;r+=1)l(t.charCodeAt(r),e)}(r.name.substring(r.name.lastIndexOf("/")+1),a),l(0,a)),n.deflate(t,i).forEach((function(t){l(t,a)})),p(parseInt(e(t),16),a),p(t.length,a),a},unzip:function(t,r){var l,h,p,v,b=Array.prototype.slice.call(t,0);if(31!==d(b)||139!==d(b))throw"Not a GZIP file";if(l=d(b),!(l=Object.keys(o).some((function(t){return h=t,o[t]===l}))))throw"Unsupported compression method";if(p=d(b),y(b),d(b),l=d(b),Object.keys(f).some((function(t){if(f[t]===l)return t,!0})),p&a&&function(t,e){var r,n=[];for(r=0;r<e;r+=1)n.push(t.shift())}(b,l=g(b)),p&u&&m(b),p&c&&m(b),p&s&&g(b),"deflate"===h&&(v=n.inflate(b.splice(0,b.length-8))),p&i&&(v=Array.prototype.map.call(v,(function(t){return String.fromCharCode(t)})).join("")),y(b)!==parseInt(e(v),16))throw"Checksum does not match";if(y(b)!==v.length)throw"Size of decompressed file not correct";return v},get DEFAULT_LEVEL(){return 6}}}()},function(t,e){!function(){"use strict";var e=[];function r(t){var e,r,n,o,i=-1;for(e=0,n=t.length;e<n;e+=1){for(o=255&(i^t[e]),r=0;r<8;r+=1)1==(1&o)?o=o>>>1^3988292384:o>>>=1;i=i>>>8^o}return-1^i}function n(t,r){var o,i,s;if(void 0!==n.crc&&r&&t||(n.crc=-1,t)){for(o=n.crc,i=0,s=t.length;i<s;i+=1)o=o>>>8^e[255&(o^t[i])];return n.crc=o,-1^o}}!function(){var t,r,n;for(r=0;r<256;r+=1){for(t=r,n=0;n<8;n+=1)1&t?t=3988292384^t>>>1:t>>>=1;e[r]=t>>>0}}(),t.exports=function(t,e){var o;t="string"==typeof t?(o=t,Array.prototype.map.call(o,(function(t){return t.charCodeAt(0)}))):t;return((e?r(t):n(t))>>>0).toString(16)},t.exports.direct=r,t.exports.table=n}()},function(t,e,r){!function(){"use strict";t.exports={inflate:r(75),deflate:r(76)}}()},function(t,e){!function(){var e,r,n,o,i,s,a,u,c,f,l,h,p,d,g,y,m,v=null,b=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],w=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],E=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function T(){this.next=null,this.list=null}function S(){this.e=0,this.b=0,this.n=0,this.t=null}function O(t,e,r,n,o,i){var s;this.BMAX=16,this.N_MAX=288,this.status=0,this.root=null,this.m=0;var a,u,c,f,l,h,p,d,g,y,m,v,b,w,_,E,A=[],x=[],O=new S,P=[],C=[],R=[];for(E=this.root=null,l=0;l<this.BMAX+1;l++)A[l]=0;for(l=0;l<this.BMAX+1;l++)x[l]=0;for(l=0;l<this.BMAX;l++)P[l]=null;for(l=0;l<this.N_MAX;l++)C[l]=0;for(l=0;l<this.BMAX+1;l++)R[l]=0;a=e>256?t[256]:this.BMAX,d=t,g=0,l=e;do{A[d[g]]++,g++}while(--l>0);if(A[0]===e)return this.root=null,this.m=0,void(this.status=0);for(h=1;h<=this.BMAX&&0===A[h];h++);for(p=h,i<h&&(i=h),l=this.BMAX;0!==l&&0===A[l];l--);for(c=l,i>l&&(i=l),b=1<<h;h<l;h++,b<<=1)if((b-=A[h])<0)return this.status=2,void(this.m=i);if((b-=A[l])<0)return this.status=2,void(this.m=i);for(A[l]+=b,R[1]=h=0,d=A,g=1,v=2;--l>0;)R[v++]=h+=d[g++];d=t,g=0,l=0;do{0!==(h=d[g++])&&(C[R[h]++]=l)}while(++l<e);for(e=R[c],R[0]=l=0,d=C,g=0,f=-1,m=x[0]=0,y=null,w=0;p<=c;p++)for(s=A[p];s-- >0;){for(;p>m+x[1+f];){if(m+=x[1+f],f++,w=(w=c-m)>i?i:w,(u=1<<(h=p-m))>s+1)for(u-=s+1,v=p;++h<w&&!((u<<=1)<=A[++v]);)u-=A[v];for(m+h>a&&m<a&&(h=a-m),w=1<<h,x[1+f]=h,y=[],_=0;_<w;_++)y[_]=new S;(E=E?E.next=new T:this.root=new T).next=null,E.list=y,P[f]=y,f>0&&(R[f]=l,O.b=x[f],O.e=16+h,O.t=y,h=(l&(1<<m)-1)>>m-x[f],P[f-1][h].e=O.e,P[f-1][h].b=O.b,P[f-1][h].n=O.n,P[f-1][h].t=O.t)}for(O.b=p-m,g>=e?O.e=99:d[g]<r?(O.e=d[g]<256?16:15,O.n=d[g++]):(O.e=o[d[g]-r],O.n=n[d[g++]-r]),u=1<<p-m,h=l>>m;h<w;h+=u)y[h].e=O.e,y[h].b=O.b,y[h].n=O.n,y[h].t=O.t;for(h=1<<p-1;0!=(l&h);h>>=1)l^=h;for(l^=h;(l&(1<<m)-1)!==R[f];)m-=x[f],f--}this.m=x[1],this.status=0!==b&&1!==c?1:0}function P(t){for(;a<t;)s|=(y.length===m?-1:255&y[m++])<<a,a+=8}function C(t){return s&b[t]}function R(t){s>>=t,a-=t}function j(t,n,o){var i,s,a;if(0===o)return 0;for(a=0;;){for(P(d),i=(s=h.list[C(d)]).e;i>16;){if(99===i)return-1;R(s.b),P(i-=16),i=(s=s.t[C(i)]).e}if(R(s.b),16!==i){if(15===i)break;for(P(i),f=s.n+C(i),R(i),P(g),i=(s=p.list[C(g)]).e;i>16;){if(99===i)return-1;R(s.b),P(i-=16),i=(s=s.t[C(i)]).e}for(R(s.b),P(i),l=r-s.n-C(i),R(i);f>0&&a<o;)f--,l&=32767,r&=32767,t[n+a++]=e[r++]=e[l++];if(a===o)return o}else if(r&=32767,t[n+a++]=e[r++]=s.n,a===o)return o}return u=-1,a}function I(t,n,o){var i;if(R(i=7&a),P(16),i=C(16),R(16),P(16),i!==(65535&~s))return-1;for(R(16),f=i,i=0;f>0&&i<o;)f--,r&=32767,P(8),t[n+i++]=e[r++]=C(8),R(8);return 0===f&&(u=-1),i}function D(t,e,r){if(!v){var s,a,u=[];for(s=0;s<144;s++)u[s]=8;for(;s<256;s++)u[s]=9;for(;s<280;s++)u[s]=7;for(;s<288;s++)u[s]=8;if(0!==(a=new O(u,288,257,w,_,o=7)).status)return console.error("HufBuild error: "+a.status),-1;for(v=a.root,o=a.m,s=0;s<30;s++)u[s]=5;if((a=new O(u,30,0,E,A,i=5)).status>1)return v=null,console.error("HufBuild error: "+a.status),-1;n=a.root,i=a.m}return h=v,p=n,d=o,g=i,j(t,e,r)}function k(t,e,r){var n,o,i,s,a,u,c,f,l,y=[];for(n=0;n<316;n++)y[n]=0;if(P(5),c=257+C(5),R(5),P(5),f=1+C(5),R(5),P(4),u=4+C(4),R(4),c>286||f>30)return-1;for(o=0;o<u;o++)P(3),y[x[o]]=C(3),R(3);for(;o<19;o++)y[x[o]]=0;if(0!==(l=new O(y,19,19,null,null,d=7)).status)return-1;for(h=l.root,d=l.m,s=c+f,n=i=0;n<s;)if(P(d),R(o=(a=h.list[C(d)]).b),(o=a.n)<16)y[n++]=i=o;else if(16===o){if(P(2),o=3+C(2),R(2),n+o>s)return-1;for(;o-- >0;)y[n++]=i}else if(17===o){if(P(3),o=3+C(3),R(3),n+o>s)return-1;for(;o-- >0;)y[n++]=0;i=0}else{if(P(7),o=11+C(7),R(7),n+o>s)return-1;for(;o-- >0;)y[n++]=0;i=0}if(l=new O(y,c,257,w,_,d=9),0===d&&(l.status=1),0!==l.status&&1!==l.status)return-1;for(h=l.root,d=l.m,n=0;n<f;n++)y[n]=y[n+c];return l=new O(y,f,0,E,A,g=6),p=l.root,0===(g=l.m)&&c>257||0!==l.status?-1:j(t,e,r)}function F(t,n,o){var i,s;for(i=0;i<o;){if(c&&-1===u)return i;if(f>0){if(0!==u)for(;f>0&&i<o;)f--,l&=32767,r&=32767,t[n+i++]=e[r++]=e[l++];else{for(;f>0&&i<o;)f--,r&=32767,P(8),t[n+i++]=e[r++]=C(8),R(8);0===f&&(u=-1)}if(i===o)return i}if(-1===u){if(c)break;P(1),0!==C(1)&&(c=!0),R(1),P(2),u=C(2),R(2),h=null,f=0}switch(u){case 0:s=I(t,n+i,o-i);break;case 1:s=h?j(t,n+i,o-i):D(t,n+i,o-i);break;case 2:s=h?j(t,n+i,o-i):k(t,n+i,o-i);break;default:s=-1}if(-1===s)return c?0:-1;i+=s}return i}t.exports=function(t){var n,o=[];e||(e=[]),r=0,s=0,a=0,u=-1,c=!1,f=l=0,h=null,y=t,m=0;do{n=F(o,o.length,1024)}while(n>0);return y=null,o}}()},function(t,e){!function(){var e,r,n,o,i,s,a,u,c,f,l,h,p,d,g,y,m,v,b,w,_,E,A,x,T,S,O,P,C,R,j,I,D,k,F,N,U,L,B,M,q,G,V,H,Y,z,$,K,W,J,X,Z,Q,tt,et,rt,nt=parseInt(17/3,10),ot=null;function it(){this.fc=0,this.dl=0}function st(){this.dyn_tree=null,this.static_tree=null,this.extra_bits=null,this.extra_base=0,this.elems=0,this.max_length=0,this.max_code=0}function at(t,e,r,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n}function ut(){this.next=null,this.len=0,this.ptr=[],this.off=0}var ct=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ft=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],lt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ht=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],pt=[new at(0,0,0,0),new at(4,4,8,4),new at(4,5,16,8),new at(4,6,32,32),new at(4,4,16,16),new at(8,16,32,32),new at(8,16,128,128),new at(8,32,128,256),new at(32,128,258,1024),new at(32,258,258,4096)];function dt(t){t.next=e,e=t}function gt(t){return l[32768+t]}function yt(t,e){return l[32768+t]=e}function mt(t){ot[s+i++]=t,s+i===8192&&function(){var t,o;if(0!==i){for(null!==e?(a=e,e=e.next):a=new ut,a.next=null,a.len=a.off=0,t=a,null===r?r=n=t:n=n.next=t,t.len=i-s,o=0;o<t.len;o++)t.ptr[o]=ot[s+o];i=s=0}var a}()}function vt(t){t&=65535,s+i<8190?(ot[s+i++]=255&t,ot[s+i++]=t>>>8):(mt(255&t),mt(t>>>8))}function bt(){g=32767&(g<<nt^255&u[_+3-1]),y=gt(g),l[32767&_]=y,yt(g,_)}function wt(t,e){Lt(e[t].fc,e[t].dl)}function _t(t){return 255&(t<256?H[t]:H[256+(t>>7)])}function Et(t,e,r){return t[e].fc<t[r].fc||t[e].fc===t[r].fc&&G[e]<=G[r]}function At(t,e,r){var n;for(n=0;n<r&&rt<et.length;n++)t[e+n]=255&et[rt++];return n}function xt(t){var e,r,n,o,i=T,s=_,a=w,c=_>32506?_-32506:0,f=_+258,h=u[s+a-1],p=u[s+a];w>=P&&(i>>=2);do{if(u[(e=t)+a]===p&&u[e+a-1]===h&&u[e]===u[s]&&u[++e]===u[s+1]){for(s+=2,e++;s<f;){for(o=!1,n=0;n<8;n+=1)if(e+=1,u[s+=1]!==u[e]){o=!0;break}if(o)break}if(r=258-(f-s),s=f-258,r>a){if(E=t,a=r,r>=C)break;h=u[s+a-1],p=u[s+a]}}}while((t=l[32767&t])>c&&0!=--i);return a}function Tt(){var t,e,r=65536-x-_;if(-1===r)r--;else if(_>=65274){for(t=0;t<32768;t++)u[t]=u[t+32768];for(E-=32768,_-=32768,d-=32768,t=0;t<32768;t++)yt(t,(e=gt(t))>=32768?e-32768:0);for(t=0;t<32768;t++)e=l[t],l[t]=e>=32768?e-32768:0;r+=32768}A||((t=At(u,_+x,r))<=0?A=!0:x+=t)}function St(){A||(h=0,p=0,function(){var t,e,r,n,o;if(0!==D[0].dl)return;for(F.dyn_tree=R,F.static_tree=I,F.extra_bits=ct,F.extra_base=257,F.elems=286,F.max_length=15,F.max_code=0,N.dyn_tree=j,N.static_tree=D,N.extra_bits=ft,N.extra_base=0,N.elems=30,N.max_length=15,N.max_code=0,U.dyn_tree=k,U.static_tree=null,U.extra_bits=lt,U.extra_base=0,U.elems=19,U.max_length=7,U.max_code=0,r=0,n=0;n<28;n++)for(Y[n]=r,t=0;t<1<<ct[n];t++)V[r++]=n;for(V[r-1]=n,o=0,n=0;n<16;n++)for(z[n]=o,t=0;t<1<<ft[n];t++)H[o++]=n;for(o>>=7;n<30;n++)for(z[n]=o<<7,t=0;t<1<<ft[n]-7;t++)H[256+o++]=n;for(e=0;e<=15;e++)L[e]=0;t=0;for(;t<=143;)I[t++].dl=8,L[8]++;for(;t<=255;)I[t++].dl=9,L[9]++;for(;t<=279;)I[t++].dl=7,L[7]++;for(;t<=287;)I[t++].dl=8,L[8]++;for(jt(I,287),t=0;t<30;t++)D[t].dl=5,D[t].fc=Bt(t,5);Ct()}(),function(){var t;for(t=0;t<32768;t++)l[32768+t]=0;if(S=pt[O].max_lazy,P=pt[O].good_length,C=pt[O].nice_length,T=pt[O].max_chain,_=0,d=0,(x=At(u,0,65536))<=0)return A=!0,void(x=0);for(A=!1;x<262&&!A;)Tt();for(g=0,t=0;t<2;t++)g=32767&(g<<nt^255&u[t])}(),r=null,i=0,s=0,O<=3?(w=2,b=0):(b=2,v=!1),a=!1)}function Ot(t,e,n){var i;return o||(St(),o=!0,0!==x)?(i=Pt(t,e,n))===n?n:a?i:(O<=3?function(){for(;0!==x&&null===r;){var t;if(bt(),0!==y&&_-y<=32506&&(b=xt(y))>x&&(b=x),b>=3)if(t=Nt(_-E,b-3),x-=b,b<=S){b--;do{_++,bt()}while(0!=--b);_++}else _+=b,b=0,g=32767&((g=255&u[_])<<nt^255&u[_+1]);else t=Nt(0,255&u[_]),x--,_++;for(t&&(Ft(0),d=_);x<262&&!A;)Tt()}}():function(){for(;0!==x&&null===r;){if(bt(),w=b,m=E,b=2,0!==y&&w<S&&_-y<=32506&&((b=xt(y))>x&&(b=x),3===b&&_-E>4096&&b--),w>=3&&b<=w){var t;t=Nt(_-1-m,w-3),x-=w-1,w-=2;do{_++,bt()}while(0!=--w);v=!1,b=2,_++,t&&(Ft(0),d=_)}else v?(Nt(0,255&u[_-1])&&(Ft(0),d=_),_++,x--):(v=!0,_++,x--);for(;x<262&&!A;)Tt()}}(),0===x&&(v&&Nt(0,255&u[_-1]),Ft(1),a=!0),i+Pt(t,i+e,n-i)):(a=!0,0)}function Pt(t,e,n){var o,a,u;for(o=0;null!==r&&o<n;){for((a=n-o)>r.len&&(a=r.len),u=0;u<a;u++)t[e+o+u]=r.ptr[r.off+u];var c;if(r.off+=a,r.len-=a,o+=a,0===r.len)c=r,r=r.next,dt(c)}if(o===n)return o;if(s<i){for((a=n-o)>i-s&&(a=i-s),u=0;u<a;u++)t[e+o+u]=ot[s+u];o+=a,i===(s+=a)&&(i=s=0)}return o}function Ct(){var t;for(t=0;t<286;t++)R[t].fc=0;for(t=0;t<30;t++)j[t].fc=0;for(t=0;t<19;t++)k[t].fc=0;R[256].fc=1,Q=tt=0,K=W=J=0,X=0,Z=1}function Rt(t,e){for(var r=B[e],n=e<<1;n<=M&&(n<M&&Et(t,B[n+1],B[n])&&n++,!Et(t,r,B[n]));)B[e]=B[n],e=n,n<<=1;B[e]=r}function jt(t,e){var r,n,o=[],i=0;for(r=1;r<=15;r++)i=i+L[r-1]<<1,o[r]=i;for(n=0;n<=e;n++){var s=t[n].dl;0!==s&&(t[n].fc=Bt(o[s]++,s))}}function It(t){var e,r,n=t.dyn_tree,o=t.static_tree,i=t.elems,s=-1,a=i;for(M=0,q=573,e=0;e<i;e++)0!==n[e].fc?(B[++M]=s=e,G[e]=0):n[e].dl=0;for(;M<2;){var u=B[++M]=s<2?++s:0;n[u].fc=1,G[u]=0,Q--,null!==o&&(tt-=o[u].dl)}for(t.max_code=s,e=M>>1;e>=1;e--)Rt(n,e);do{e=B[1],B[1]=B[M--],Rt(n,1),r=B[1],B[--q]=e,B[--q]=r,n[a].fc=n[e].fc+n[r].fc,G[e]>G[r]+1?G[a]=G[e]:G[a]=G[r]+1,n[e].dl=n[r].dl=a,B[1]=a++,Rt(n,1)}while(M>=2);B[--q]=B[1],function(t){var e,r,n,o,i,s,a=t.dyn_tree,u=t.extra_bits,c=t.extra_base,f=t.max_code,l=t.max_length,h=t.static_tree,p=0;for(o=0;o<=15;o++)L[o]=0;for(a[B[q]].dl=0,e=q+1;e<573;e++)(o=a[a[r=B[e]].dl].dl+1)>l&&(o=l,p++),a[r].dl=o,r>f||(L[o]++,i=0,r>=c&&(i=u[r-c]),s=a[r].fc,Q+=s*(o+i),null!==h&&(tt+=s*(h[r].dl+i)));if(0!==p){do{for(o=l-1;0===L[o];)o--;L[o]--,L[o+1]+=2,L[l]--,p-=2}while(p>0);for(o=l;0!==o;o--)for(r=L[o];0!==r;)(n=B[--e])>f||(a[n].dl!==o&&(Q+=(o-a[n].dl)*a[n].fc,a[n].fc=o),r--)}}(t),jt(n,s)}function Dt(t,e){var r,n,o=-1,i=t[0].dl,s=0,a=7,u=4;for(0===i&&(a=138,u=3),t[e+1].dl=65535,r=0;r<=e;r++)n=i,i=t[r+1].dl,++s<a&&n===i||(s<u?k[n].fc+=s:0!==n?(n!==o&&k[n].fc++,k[16].fc++):s<=10?k[17].fc++:k[18].fc++,s=0,o=n,0===i?(a=138,u=3):n===i?(a=6,u=3):(a=7,u=4))}function kt(t,e){var r,n,o=-1,i=t[0].dl,s=0,a=7,u=4;for(0===i&&(a=138,u=3),r=0;r<=e;r++)if(n=i,i=t[r+1].dl,!(++s<a&&n===i)){if(s<u)do{wt(n,k)}while(0!=--s);else 0!==n?(n!==o&&(wt(n,k),s--),wt(16,k),Lt(s-3,2)):s<=10?(wt(17,k),Lt(s-3,3)):(wt(18,k),Lt(s-11,7));s=0,o=n,0===i?(a=138,u=3):n===i?(a=6,u=3):(a=7,u=4)}}function Ft(t){var e,r,n,o,i;if(o=_-d,$[J]=X,It(F),It(N),n=function(){var t;for(Dt(R,F.max_code),Dt(j,N.max_code),It(U),t=18;t>=3&&0===k[ht[t]].dl;t--);return Q+=3*(t+1)+5+5+4,t}(),(r=tt+3+7>>3)<=(e=Q+3+7>>3)&&(e=r),o+4<=e&&d>=0)for(Lt(0+t,3),Mt(),vt(o),vt(~o),i=0;i<o;i++)mt(u[d+i]);else r===e?(Lt(2+t,3),Ut(I,D)):(Lt(4+t,3),function(t,e,r){var n;for(Lt(t-257,5),Lt(e-1,5),Lt(r-4,4),n=0;n<r;n++)Lt(k[ht[n]].dl,3);kt(R,t-1),kt(j,e-1)}(F.max_code+1,N.max_code+1,n+1),Ut(R,j));Ct(),0!==t&&Mt()}function Nt(t,e){if(f[K++]=e,0===t?R[e].fc++:(t--,R[V[e]+256+1].fc++,j[_t(t)].fc++,c[W++]=t,X|=Z),Z<<=1,0==(7&K)&&($[J++]=X,X=0,Z=1),O>2&&0==(4095&K)){var r,n=8*K,o=_-d;for(r=0;r<30;r++)n+=j[r].fc*(5+ft[r]);if(n>>=3,W<parseInt(K/2,10)&&n<parseInt(o/2,10))return!0}return 8191===K||8192===W}function Ut(t,e){var r,n,o,i,s=0,a=0,u=0,l=0;if(0!==K)do{0==(7&s)&&(l=$[u++]),n=255&f[s++],0==(1&l)?wt(n,t):(wt((o=V[n])+256+1,t),0!==(i=ct[o])&&Lt(n-=Y[o],i),wt(o=_t(r=c[a++]),e),0!==(i=ft[o])&&Lt(r-=z[o],i)),l>>=1}while(s<K);wt(256,t)}function Lt(t,e){p>16-e?(vt(h|=t<<p),h=t>>16-p,p+=e-16):(h|=t<<p,p+=e)}function Bt(t,e){var r=0;do{r|=1&t,t>>=1,r<<=1}while(--e>0);return r>>1}function Mt(){p>8?vt(h):p>0&&mt(h),h=0,p=0}t.exports=function(t,i){var s,a;et=t,rt=0,void 0===i&&(i=6),function(t){var i;if(t?t<1?t=1:t>9&&(t=9):t=6,O=t,o=!1,A=!1,null===ot){for(e=r=n=null,ot=[],u=[],c=[],f=[],l=[],R=[],i=0;i<573;i++)R[i]=new it;for(j=[],i=0;i<61;i++)j[i]=new it;for(I=[],i=0;i<288;i++)I[i]=new it;for(D=[],i=0;i<30;i++)D[i]=new it;for(k=[],i=0;i<39;i++)k[i]=new it;F=new st,N=new st,U=new st,L=[],B=[],G=[],V=[],H=[],Y=[],z=[],$=[]}}(i),a=[];do{s=Ot(a,a.length,1024)}while(s>0);return et=null,a},t.exports.DEFAULT_LEVEL=6}()},function(t,e,r){const{createClient:n}=r(78);t.exports={getNetResources:function(){return{"net/webdav/v1/newClient":n}}}},function(t,e,r){window,t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=26)}([function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(11),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return void 0===t}function u(t){return null!==t&&"object"===n(t)}function c(t){return"[object Function]"===i.call(t)}function f(t,e){if(null!=t)if("object"!==n(t)&&(t=[t]),s(t))for(var r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:u,isUndefined:a,isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:c,isStream:function(t){return u(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function t(){var e={};function r(r,o){"object"===n(e[o])&&"object"===n(r)?e[o]=t(e[o],r):e[o]=r}for(var o=0,i=arguments.length;o<i;o++)f(arguments[o],r);return e},deepMerge:function t(){var e={};function r(r,o){"object"===n(e[o])&&"object"===n(r)?e[o]=t(e[o],r):"object"===n(r)?e[o]=t({},r):e[o]=r}for(var o=0,i=arguments.length;o<i;o++)f(arguments[o],r);return e},extend:function(t,e,r){return f(e,(function(e,n){t[n]=r&&"function"==typeof e?o(e,r):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(10),i=r(43),s=r(44),a=r(4).merge;t.exports={axios:o,encodePath:function(t){var e=t.replace(/\//g,"__PATH_SEPARATOR_POSIX__").replace(/\\\\/g,"__PATH_SEPARATOR_WINDOWS__");return encodeURIComponent(e).split("__PATH_SEPARATOR_WINDOWS__").join("\\\\").split("__PATH_SEPARATOR_POSIX__").join("/")},joinURL:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return i(e.reduce((function(t,e,r){return(0===r||"/"!==e||"/"===e&&"/"!==t[t.length-1])&&t.push(e),t}),[]))},prepareRequestOptions:function(t,e){e.httpAgent&&(t.httpAgent=e.httpAgent),e.httpsAgent&&(t.httpsAgent=e.httpsAgent),e.data&&(t.data=e.data),e.headers&&"object"===n(e.headers)&&(t.headers=a(t.headers||{},e.headers)),"boolean"==typeof e.withCredentials&&(t.withCredentials=e.withCredentials),e.maxContentLength&&(t.maxContentLength=e.maxContentLength),e.onUploadProgress&&"function"==typeof e.onUploadProgress&&(t.onUploadProgress=e.onUploadProgress),e._digest&&(t._digest=e._digest,t.validateStatus=function(t){return t>=200&&t<300||401==t})},request:function(t){return s(t)}}},function(t,e,r){var n=r(58);t.exports={handleResponseCode:function(t){var e,r=parseInt(t.status,10);if(r>=400)throw(e=new Error("Invalid response: "+r+" "+t.statusText)).status=r,e;return t},processGlobFilter:function(t,e){return t.filter((function(t){return n(t.filename,e,{matchBase:!0})}))},processResponsePayload:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return r?{data:e,headers:t.headers||{}}:e}}},function(t,e,r){"use strict";var n="[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,r){if(e)for(var n=Object.keys(e),o=n.length,i=0;i<o;i++)t[n[i]]="strict"===r?[e[n[i]]]:e[n[i]]},e.getValue=function(t){return e.isExist(t)?t:""},e.buildOptions=function(t,e,r){var n={};if(!t)return e;for(var o=0;o<r.length;o++)void 0!==t[r[o]]?n[r[o]]=t[r[o]]:n[r[o]]=e[r[o]];return n},e.isName=function(t){return!(null==o.exec(t))},e.getAllMatches=function(t,e){for(var r=[],n=e.exec(t);n;){for(var o=[],i=n.length,s=0;s<i;s++)o.push(n[s]);r.push(o),n=e.exec(t)}return r},e.nameRegexp=n},function(t,e){function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t){return function(t){if("object"!==o(t)||null===t||"[object Object]"!=Object.prototype.toString.call(t))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t)?Object.assign({},t):Object.setPrototypeOf(Object.assign({},t),Object.getPrototypeOf(t))}function s(t,e){var n=i(t);return Object.keys(e).forEach((function(t){n.hasOwnProperty(t)?Array.isArray(e[t])?n[t]=Array.isArray(n[t])?[].concat(r(n[t]),r(e[t])):r(e[t]):"object"===o(e[t])&&e[t]?n[t]="object"===o(n[t])&&n[t]?s(n[t],e[t]):i(e[t]):n[t]=e[t]:n[t]=e[t]})),n}t.exports={merge:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=null,o=[].concat(e);o.length>0;){var a=o.shift();n=n?s(n,a):i(a)}return n}}},function(t,e,r){var n=r(47),o=n.decode,i=n.encode;t.exports={decodeHTMLEntities:function(t){var e=document.createElement("textarea");return e.innerHTML=t,e.value},fromBase64:function(t){return o(t)},toBase64:function(t){return i(t)}}},function(t,e,r){"use strict";var n=r(3),o=r(3).buildOptions,i=r(64),s="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,n.nameRegexp);!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var a={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(t,e){return t},attrValueProcessor:function(t,e){return t},stopNodes:[]};e.defaultOptions=a;var u=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];function c(t,e,r){var n=t[7]||r,o=t[12];return o&&(e.trimValues&&(o=o.trim()),o=h(o=e.tagValueProcessor(o,n),e.parseNodeValue,e.parseTrueNumberOnly)),o}function f(t){return"]]>"===t[4]?4:"/"===t[10]?2:void 0!==t[8]&&"/"===t[8].substr(t[8].length-1)?3:1}function l(t,e){if(e.ignoreNameSpace){var r=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===r[0])return"";2===r.length&&(t=n+r[1])}return t}function h(t,e,r){var o;return e&&"string"==typeof t?(""===t.trim()||isNaN(t)?o="true"===t||"false"!==t&&t:(-1!==t.indexOf("0x")?o=Number.parseInt(t,16):-1!==t.indexOf(".")?(o=Number.parseFloat(t),t=t.replace(/0+$/,"")):o=Number.parseInt(t,10),r&&(o=String(o)===t?o:t)),o):n.isExist(t)?t:""}e.props=u;var p=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function d(t,e){if(!e.ignoreAttributes&&"string"==typeof t){t=t.replace(/\r?\n/g," ");for(var r=n.getAllMatches(t,p),o=r.length,i={},s=0;s<o;s++){var a=l(r[s][1],e);a.length&&(void 0!==r[s][4]?(e.trimValues&&(r[s][4]=r[s][4].trim()),r[s][4]=e.attrValueProcessor(r[s][4],a),i[e.attributeNamePrefix+a]=h(r[s][4],e.parseAttributeValue,e.parseTrueNumberOnly)):e.allowBooleanAttributes&&(i[e.attributeNamePrefix+a]=!0))}if(!Object.keys(i).length)return;if(e.attrNodeName){var u={};return u[e.attrNodeName]=i,u}return i}}e.getTraversalObj=function(t,e){e=o(e,a,u),t=t.replace(/<!--[\s\S]*?-->/g,"");for(var r=new i("!xml"),l=r,h=new RegExp(s,"g"),p=h.exec(t),g=h.exec(t);p;){var y=f(p);if(2===y)l.parent&&p[12]&&(l.parent.val=n.getValue(l.parent.val)+""+c(p,e,l.parent.tagname)),e.stopNodes.length&&e.stopNodes.includes(l.tagname)&&(l.child=[],null==l.attrsMap&&(l.attrsMap={}),l.val=t.substr(l.startIndex+1,p.index-l.startIndex-1)),l=l.parent;else if(4===y)if(e.cdataTagName){var m=new i(e.cdataTagName,l,p[3]);m.attrsMap=d(p[8],e),l.addChild(m),l.val=n.getValue(l.val)+e.cdataPositionChar,p[12]&&(l.val+=c(p,e))}else l.val=(l.val||"")+(p[3]||"")+c(p,e);else if(3===y){l&&p[12]&&(l.val=n.getValue(l.val)+""+c(p,e));var v=new i(e.ignoreNameSpace?p[7]:p[5],l,"");p[8]&&p[8].length>0&&(p[8]=p[8].substr(0,p[8].length-1)),v.attrsMap=d(p[8],e),l.addChild(v)}else{var b=new i(e.ignoreNameSpace?p[7]:p[5],l,c(p,e));e.stopNodes.length&&e.stopNodes.includes(b.tagname)&&(b.startIndex=p.index+p[1].length),b.attrsMap=d(p[8],e),l.addChild(b),l=b}p=g,g=h.exec(t)}return r}},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&p())}function p(){if(!f){var t=a(h);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l<e;)u&&u[l].run();l=-1,e=c.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||f||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){var n=r(51);function o(t){var e=t;return"/"!==e[0]&&(e="/"+e),/^.+\/$/.test(e)&&(e=e.substr(0,e.length-1)),decodeURIComponent(e)}t.exports={extractURLPath:function(t){var e=new n(t).pathname;return e.length<=0&&(e="/"),o(e)},normaliseHREF:function(t){return t.replace(/^https?:\/\/[^\/]+/,"")},normalisePath:o}},function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(62),i=r(69),s=r(5).decodeHTMLEntities;function a(t,e,r){var n=i.get(t,e);return"array"===r&&!1===Array.isArray(n)?[n]:"object"===r&&Array.isArray(n)?n[0]:n}t.exports={parseXML:function(t){return new Promise((function(e){e(function(t){var e=t.multistatus;if(!e)throw new Error("Invalid response: No root multistatus found");var r={};return r.multistatus=Array.isArray(e)?e[0]:e,i.set(r,"multistatus.response",a(r,"multistatus.response","array")),i.set(r,"multistatus.response",i.get(r,"multistatus.response").map((function(t){return function(t){var e=Object.assign({},t);return i.set(e,"propstat",a(e,"propstat","object")),i.set(e,"propstat.prop",a(e,"propstat.prop","object")),e}(t)}))),r}(o.parse(t,{arrayMode:!1,ignoreNameSpace:!0})))}))},prepareFileFromProps:function(t,e){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r(24),a=t.getlastmodified,u=void 0===a?null:a,c=t.getcontentlength,f=void 0===c?"0":c,l=t.resourcetype,h=void 0===l?null:l,p=t.getcontenttype,d=void 0===p?null:p,g=t.getetag,y=void 0===g?null:g,m=h&&"object"===n(h)&&void 0!==h.collection?"directory":"file",v=s(e),b={filename:v,basename:i.basename(v),lastmod:u,size:parseInt(f,10),type:m,etag:"string"==typeof y?y.replace(/"/g,""):null};return"file"===m&&(b.mime=d&&"string"==typeof d?d.split(";")[0]:""),o&&(b.props=t),b},translateDiskSpace:function(t){switch(t.toString()){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(t,10)}}}},function(t,e,r){t.exports=r(27)},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},function(t,e,r){"use strict";var n=r(0);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var i;if(r)i=r(e);else if(n.isURLSearchParams(e))i=e.toString();else{var s=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))})))})),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,r){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,r){"use strict";(function(e){var n=r(0),o=r(32),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,u={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(a=r(15)),a),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){u.headers[t]=n.merge(i)})),t.exports=u}).call(this,r(7))},function(t,e,r){"use strict";var n=r(0),o=r(33),i=r(12),s=r(35),a=r(38),u=r(39),c=r(16);t.exports=function(t){return new Promise((function(e,f){var l=t.data,h=t.headers;n.isFormData(l)&&delete h["Content-Type"];var p=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",g=t.auth.password||"";h.Authorization="Basic "+btoa(d+":"+g)}var y=s(t.baseURL,t.url);if(p.open(t.method.toUpperCase(),i(y,t.params,t.paramsSerializer),!0),p.timeout=t.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,n={data:t.responseType&&"text"!==t.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:t,request:p};o(e,f,n),p=null}},p.onabort=function(){p&&(f(c("Request aborted",t,"ECONNABORTED",p)),p=null)},p.onerror=function(){f(c("Network Error",t,null,p)),p=null},p.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),f(c(e,t,"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var m=r(40),v=(t.withCredentials||u(y))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;v&&(h[t.xsrfHeaderName]=v)}if("setRequestHeader"in p&&n.forEach(h,(function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete h[e]:p.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),t.responseType)try{p.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&p.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){p&&(p.abort(),f(t),p=null)})),void 0===l&&(l=null),p.send(l)}))}},function(t,e,r){"use strict";var n=r(34);t.exports=function(t,e,r,o,i){var s=new Error(t);return n(s,e,r,o,i)}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e){e=e||{};var r={},o=["url","method","params","data"],i=["headers","auth","proxy"],s=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];n.forEach(o,(function(t){void 0!==e[t]&&(r[t]=e[t])})),n.forEach(i,(function(o){n.isObject(e[o])?r[o]=n.deepMerge(t[o],e[o]):void 0!==e[o]?r[o]=e[o]:n.isObject(t[o])?r[o]=n.deepMerge(t[o]):void 0!==t[o]&&(r[o]=t[o])})),n.forEach(s,(function(n){void 0!==e[n]?r[n]=e[n]:void 0!==t[n]&&(r[n]=t[n])}));var a=o.concat(i).concat(s),u=Object.keys(e).filter((function(t){return-1===a.indexOf(t)}));return n.forEach(u,(function(n){void 0!==e[n]?r[n]=e[n]:void 0!==t[n]&&(r[n]=t[n])})),r}},function(t,e,r){"use strict";function n(t){this.message=t}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},function(t,e,r){var n=r(45),o=null;t.exports={getPatcher:function(){return o||(o=new n),o}}},function(t,e,r){var n=r(5).toBase64,o=r(49),i=o.md5,s=o.ha1Compute;t.exports={generateBasicAuthHeader:function(t,e){var r=n("".concat(t,":").concat(e));return"Basic ".concat(r)},generateTokenAuthHeader:function(t){return"".concat(t.token_type," ").concat(t.access_token)},generateDigestAuthHeader:function(t,e){var r=t.url.replace("//",""),n=-1==r.indexOf("/")?"/":r.slice(r.indexOf("/")),o=t.method?t.method.toUpperCase():"GET",a=!!/(^|,)\s*auth\s*($|,)/.test(e.qop)&&"auth",u="00000000".concat(e.nc).slice(-8),c=(e.cnonce,s(e.algorithm,e.username,e.realm,e.password,e.nonce,e.cnonce)),f=i("".concat(o,":").concat(n)),l=i(a?"".concat(c,":").concat(e.nonce,":").concat(u,":").concat(e.cnonce,":").concat(a,":").concat(f):"".concat(c,":").concat(e.nonce,":").concat(f)),h={username:e.username,realm:e.realm,nonce:e.nonce,uri:n,qop:a,response:l,nc:u,cnonce:e.cnonce,algorithm:e.algorithm,opaque:e.opaque},p=[];for(var d in h)h[d]&&("qop"===d||"nc"===d||"algorithm"===d?p.push("".concat(d,"=").concat(h[d])):p.push("".concat(d,'="').concat(h[d],'"')));return"Digest ".concat(p.join(", "))}}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e){},function(t,e,r){"use strict";(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(55),i=function(t){return"string"==typeof t};function s(t,e){for(var r=[],n=0;n<t.length;n++){var o=t[n];o&&"."!==o&&(".."===o?r.length&&".."!==r[r.length-1]?r.pop():e&&r.push(".."):r.push(o))}return r}var a=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,u={};function c(t){return a.exec(t).slice(1)}u.resolve=function(){for(var t="",r=!1,n=arguments.length-1;n>=-1&&!r;n--){var o=n>=0?arguments[n]:e.cwd();if(!i(o))throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,r="/"===o.charAt(0))}return(r?"/":"")+(t=s(t.split("/"),!r).join("/"))||"."},u.normalize=function(t){var e=u.isAbsolute(t),r="/"===t.substr(-1);return(t=s(t.split("/"),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},u.isAbsolute=function(t){return"/"===t.charAt(0)},u.join=function(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];if(!i(r))throw new TypeError("Arguments to path.join must be strings");r&&(t+=t?"/"+r:r)}return u.normalize(t)},u.relative=function(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r+1)}t=u.resolve(t).substr(1),e=u.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),s=i,a=0;a<i;a++)if(n[a]!==o[a]){s=a;break}var c=[];for(a=s;a<n.length;a++)c.push("..");return(c=c.concat(o.slice(s))).join("/")},u._makeLong=function(t){return t},u.dirname=function(t){var e=c(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},u.basename=function(t,e){var r=c(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},u.extname=function(t){return c(t)[3]},u.format=function(t){if(!o.isObject(t))throw new TypeError("Parameter 'pathObject' must be an object, not "+n(t));var e=t.root||"";if(!i(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+n(t.root));return(t.dir?t.dir+u.sep:"")+(t.base||"")},u.parse=function(t){if(!i(t))throw new TypeError("Parameter 'pathString' must be a string, not "+n(t));var e=c(t);if(!e||4!==e.length)throw new TypeError("Invalid path '"+t+"'");return e[1]=e[1]||"",e[2]=e[2]||"",e[3]=e[3]||"",{root:e[0],dir:e[0]+e[1].slice(0,e[1].length-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}},u.sep="/",u.delimiter=":",t.exports=u}).call(this,r(7))},function(t,e,r){r(4).merge;var n=r(2),o=n.handleResponseCode,i=n.processResponsePayload,s=r(9),a=s.parseXML,u=s.prepareFileFromProps,c=r(8),f=r(1),l=f.encodePath,h=f.joinURL,p=f.prepareRequestOptions,d=f.request;function g(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=null;try{n=t.multistatus.response[0]}catch(t){}if(!n)throw new Error("Failed getting item stat: bad response");var o=n,i=o.propstat.prop,s=c.normalisePath(e);return u(i,s,r)}t.exports={getStat:function(t,e){var r={url:h(e.remoteURL,l(t)),method:"PROPFIND",headers:{Accept:"text/plain",Depth:0},responseType:"text"},n=null;return p(r,e),d(r).then(o).then((function(t){return n=t,t.data})).then(a).then((function(r){return g(r,t,e.details)})).then((function(t){return i(n,t,e.details)}))},parseStat:g}},function(t,e,r){var n=r(1).axios,o=r(50).createClient,i=r(19).getPatcher;t.exports={axios:n,createClient:o,getPatcher:i}},function(t,e,r){"use strict";var n=r(0),o=r(11),i=r(28),s=r(17);function a(t){var e=new i(t),r=o(i.prototype.request,e);return n.extend(r,i.prototype,e),n.extend(r,e),r}var u=a(r(14));u.Axios=i,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=r(18),u.CancelToken=r(41),u.isCancel=r(13),u.all=function(t){return Promise.all(t)},u.spread=r(42),t.exports=u,t.exports.default=u},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(29),s=r(30),a=r(17);function u(t){this.defaults=t,this.interceptors={request:new i,response:new i}}u.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[s,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)r=r.then(e.shift(),e.shift());return r},u.prototype.getUri=function(t){return t=a(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(t){u.prototype[t]=function(e,r){return this.request(n.merge(r||{},{method:t,url:e}))}})),n.forEach(["post","put","patch"],(function(t){u.prototype[t]=function(e,r,o){return this.request(n.merge(o||{},{method:t,url:e,data:r}))}})),t.exports=u},function(t,e,r){"use strict";var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=o},function(t,e,r){"use strict";var n=r(0),o=r(31),i=r(13),s=r(14);function a(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return a(t),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return a(t),e.data=o(e.data,e.headers,t.transformResponse),e}),(function(e){return i(e)||(a(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e,r){return n.forEach(r,(function(r){t=r(t,e)})),t}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e){n.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}},function(t,e,r){"use strict";var n=r(16);t.exports=function(t,e,r){var o=r.config.validateStatus;!o||o(r.status)?t(r):e(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(t,e,r){"use strict";t.exports=function(t,e,r,n,o){return t.config=e,r&&(t.code=r),t.request=n,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,r){"use strict";var n=r(36),o=r(37);t.exports=function(t,e){return t&&!n(e)?o(t,e):e}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var n=r(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,i,s={};return t?(n.forEach(t.split("\n"),(function(t){if(i=t.indexOf(":"),e=n.trim(t.substr(0,i)).toLowerCase(),r=n.trim(t.substr(i+1)),e){if(s[e]&&o.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s}},function(t,e,r){"use strict";var n=r(0);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=o(window.location.href),function(e){var r=n.isString(e)?o(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n=r(0);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,o,i,s){var a=[];a.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,r){"use strict";var n=r(18);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o((function(e){t=e})),cancel:t}},t.exports=o},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){var n,o,i;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var i=e.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return s.shift()+(s.length>0?"?":"")+s.join("&")}return function(){return t("object"===s(arguments[0])?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=i():void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o)},function(t,e,r){var n=r(10),o=r(4).merge,i=r(19).getPatcher,s=r(20).generateDigestAuthHeader;function a(t){return i().patchInline("request",(function(t){return n(t)}),t)}t.exports=function(t){if(!t._digest)return a(t);var e=t._digest;return delete t._digest,e.hasDigestAuth&&(t=o(t,{headers:{Authorization:s(t,e)}})),a(t).then((function(r){if(401==r.status){if(e.hasDigestAuth=function(t,e){var r=t.headers["www-authenticate"]||"";if("digest"!==r.split(/\s/)[0].toLowerCase())return!1;for(var n=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;;){var o=n.exec(r);if(!o)break;e[o[1]]=o[2]||o[3]}return e.nc++,e.cnonce=function(){for(var t="",e=0;e<32;++e)t+="abcdef0123456789"[Math.floor(Math.random()*"abcdef0123456789".length)];return t}(),!0}(r,e),e.hasDigestAuth)return a(t=o(t,{headers:{Authorization:s(t,e)}})).then((function(t){return 401==t.status?e.hasDigestAuth=!1:e.nc++,t}))}else e.nc++;return r}))}},function(t,e,r){function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=r(46).sequence,a=function(){};function u(t){return{original:t,methods:[t],final:!1}}var c=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._configuration={registry:{},getEmptyAction:"null"},this.__type__="@@HOTPATCHER"}var e,r;return e=t,(r=[{key:"control",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||"@@HOTPATCHER"!==t.__type__)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach((function(n){e.configuration.registry.hasOwnProperty(n)?r&&(e.configuration.registry[n]=Object.assign({},t.configuration.registry[n])):e.configuration.registry[n]=Object.assign({},t.configuration.registry[n])})),t._configuration=this.configuration,this}},{key:"execute",value:function(t){for(var e=this.get(t)||a,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return e.apply(void 0,n)}},{key:"get",value:function(t){var e=this.configuration.registry[t];if(!e)switch(this.getEmptyAction){case"null":return null;case"throw":throw new Error("Failed handling method request: No method provided for override: ".concat(t));default:throw new Error("Failed handling request which resulted in an empty method: Invalid empty-action specified: ".concat(this.getEmptyAction))}return s.apply(void 0,n(e.methods))}},{key:"isPatched",value:function(t){return!!this.configuration.registry[t]}},{key:"patch",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.chain,o=void 0!==n&&n;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error("Failed patching '".concat(t,"': Method marked as being final"));if("function"!=typeof e)throw new Error("Failed patching '".concat(t,"': Provided method is not a function"));if(o)this.configuration.registry[t]?this.configuration.registry[t].methods.push(e):this.configuration.registry[t]=u(e);else if(this.isPatched(t)){var i=this.configuration.registry[t].original;this.configuration.registry[t]=Object.assign(u(e),{original:i})}else this.configuration.registry[t]=u(e);return this}},{key:"patchInline",value:function(t,e){this.isPatched(t)||this.patch(t,e);for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return this.execute.apply(this,[t].concat(n))}},{key:"plugin",value:function(t){for(var e=this,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.forEach((function(r){e.patch(t,r,{chain:!0})})),this}},{key:"restore",value:function(t){if(!this.isPatched(t))throw new Error("Failed restoring method: No method present for key: ".concat(t));if("function"!=typeof this.configuration.registry[t].original)throw new Error("Failed restoring method: Original method not found or of invalid type for key: ".concat(t));this.configuration.registry[t].methods=[this.configuration.registry[t].original]}},{key:"setFinal",value:function(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error("Failed marking '".concat(t,"' as final: No method found for key"));return this.configuration.registry[t].final=!0,this}},{key:"configuration",get:function(){return this._configuration}},{key:"getEmptyAction",get:function(){return this.configuration.getEmptyAction},set:function(t){this.configuration.getEmptyAction=t}}])&&i(e.prototype,r),t}();t.exports=c},function(t,e){t.exports={sequence:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(0===e.length)throw new Error("Failed creating sequence: No functions provided");return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var o=r,i=this;e.length>0;){var s=e.shift();o=[s.apply(i,o)]}return o[0]}}}},function(t,e,r){(function(t,n){var o;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
24/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */!function(s){var a="object"==i(e)&&e,u="object"==i(t)&&t&&t.exports==a&&t,c="object"==(void 0===n?"undefined":i(n))&&n;c.global!==c&&c.window!==c||(s=c);var f=function(t){this.message=t};(f.prototype=new Error).name="InvalidCharacterError";var l=function(t){throw new f(t)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=/[\t\n\f\r ]/g,d={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&l("The string to be encoded contains characters outside of the Latin1 range.");for(var e,r,n,o,i=t.length%3,s="",a=-1,u=t.length-i;++a<u;)e=t.charCodeAt(a)<<16,r=t.charCodeAt(++a)<<8,n=t.charCodeAt(++a),s+=h.charAt((o=e+r+n)>>18&63)+h.charAt(o>>12&63)+h.charAt(o>>6&63)+h.charAt(63&o);return 2==i?(e=t.charCodeAt(a)<<8,r=t.charCodeAt(++a),s+=h.charAt((o=e+r)>>10)+h.charAt(o>>4&63)+h.charAt(o<<2&63)+"="):1==i&&(o=t.charCodeAt(a),s+=h.charAt(o>>2)+h.charAt(o<<4&63)+"=="),s},decode:function(t){var e=(t=String(t).replace(p,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&l("Invalid character: the string to be decoded is not correctly encoded.");for(var r,n,o=0,i="",s=-1;++s<e;)n=h.indexOf(t.charAt(s)),r=o%4?64*r+n:n,o++%4&&(i+=String.fromCharCode(255&r>>(-2*o&6)));return i},version:"0.1.0"};if("object"==i(r(22))&&r(22))void 0===(o=function(){return d}.call(e,r,e,t))||(t.exports=o);else if(a&&!a.nodeType)if(u)u.exports=d;else for(var g in d)d.hasOwnProperty(g)&&(a[g]=d[g]);else s.base64=d}(this)}).call(this,r(48)(t),r(21))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){var n=r(23).createHash;function o(t){return n("md5").update(t).digest("hex")}t.exports={md5:o,ha1Compute:function(t,e,r,n,i,s){var a=o("".concat(e,":").concat(r,":").concat(n));return t&&"md5-sess"===t.toLowerCase()?o("".concat(a,":").concat(i,":").concat(s)):a}}},function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(20),i=r(8),s=r(4).merge,a=r(54),u=r(70),c=r(71),f=r(72),l=r(73),h=r(74),p=r(75),d=r(76),g=r(77),y=r(78),m=r(25);t.exports={createClient:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"object"!==n(e))throw new Error("Options must be an object, if specified");var r=e.username,v=e.password,b=e.httpAgent,w=e.httpsAgent,_=e.token,E=void 0===_?null:_,A=e.digest,x=void 0!==A&&A,T={headers:{},remotePath:i.extractURLPath(t),remoteURL:t,httpAgent:b,httpsAgent:w};return x?T._digest={username:r,password:v,nc:0,algorithm:"md5",hasDigestAuth:!1}:r?T.headers.Authorization=o.generateBasicAuthHeader(r,v):E&&"object"===n(E)&&(T.headers.Authorization=o.generateTokenAuthHeader(E)),{copyFile:function(t,e,r){var n=s(T,r||{});return g.copyFile(t,e,n)},createDirectory:function(t,e){var r=s(T,e||{});return u.createDirectory(t,r)},createReadStream:function(t,e){throw new Error("createReadStream not implemented in web environment")},createWriteStream:function(t,e){throw new Error("createWriteStream not implemented in web environment")},customRequest:function(t,e,r){var n=s(T,r||{});return c.customRequest(t,e,n)},deleteFile:function(t,e){var r=s(T,e||{});return f.deleteFile(t,r)},exists:function(t,e){var r=s(T,e||{});return l.pathExists(t,r)},getDirectoryContents:function(t,e){var r=s(T,e||{});return a.getDirectoryContents(t,r)},getFileContents:function(t,e){var r=s(T,e||{});if(r.format=r.format||"binary",["binary","text"].indexOf(r.format)<0)throw new Error("Unknown format: "+r.format);return"text"===r.format?h.getFileContentsString(t,r):h.getFileContentsBuffer(t,r)},getFileDownloadLink:function(t,e){var r=s(T,e||{});return h.getFileLink(t,r)},getFileUploadLink:function(t,e){var r=s(T,e||{});return y.getFileUploadLink(t,r)},getQuota:function(t){var e=s(T,t||{});return p.getQuota(e)},moveFile:function(t,e,r){var n=s(T,r||{});return d.moveFile(t,e,n)},putFileContents:function(t,e,r){var n=s(T,r||{});return y.putFileContents(t,e,n)},stat:function(t,e){var r=s(T,e||{});return m.getStat(t,r)}}}}},function(t,e,r){"use strict";(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(52),i=r(53),s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,u=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function c(t){return(t||"").toString().replace(u,"")}var f=[["#","hash"],["?","query"],function(t){return t.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function h(t){var r,o=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).location||{},i={},a=n(t=t||o);if("blob:"===t.protocol)i=new d(unescape(t.pathname),{});else if("string"===a)for(r in i=new d(t,{}),l)delete i[r];else if("object"===a){for(r in t)r in l||(i[r]=t[r]);void 0===i.slashes&&(i.slashes=s.test(t.href))}return i}function p(t){t=c(t);var e=a.exec(t);return{protocol:e[1]?e[1].toLowerCase():"",slashes:!!e[2],rest:e[3]}}function d(t,e,r){if(t=c(t),!(this instanceof d))return new d(t,e,r);var s,a,u,l,g,y,m=f.slice(),v=n(e),b=this,w=0;for("object"!==v&&"string"!==v&&(r=e,e=null),r&&"function"!=typeof r&&(r=i.parse),e=h(e),s=!(a=p(t||"")).protocol&&!a.slashes,b.slashes=a.slashes||s&&e.slashes,b.protocol=a.protocol||e.protocol||"",t=a.rest,a.slashes||(m[3]=[/(.*)/,"pathname"]);w<m.length;w++)"function"!=typeof(l=m[w])?(u=l[0],y=l[1],u!=u?b[y]=t:"string"==typeof u?~(g=t.indexOf(u))&&("number"==typeof l[2]?(b[y]=t.slice(0,g),t=t.slice(g+l[2])):(b[y]=t.slice(g),t=t.slice(0,g))):(g=u.exec(t))&&(b[y]=g[1],t=t.slice(0,g.index)),b[y]=b[y]||s&&l[3]&&e[y]||"",l[4]&&(b[y]=b[y].toLowerCase())):t=l(t);r&&(b.query=r(b.query)),s&&e.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==e.pathname)&&(b.pathname=function(t,e){if(""===t)return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,o=r[n-1],i=!1,s=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),s++):s&&(0===n&&(i=!0),r.splice(n,1),s--);return i&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}(b.pathname,e.pathname)),o(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(l=b.auth.split(":"),b.username=l[0]||"",b.password=l[1]||""),b.origin=b.protocol&&b.host&&"file:"!==b.protocol?b.protocol+"//"+b.host:"null",b.href=b.toString()}d.prototype={set:function(t,e,r){var n=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(r||i.parse)(e)),n[t]=e;break;case"port":n[t]=e,o(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,/:\d+$/.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var s="pathname"===t?"/":"#";n[t]=e.charAt(0)!==s?s+e:e}else n[t]=e;break;default:n[t]=e}for(var a=0;a<f.length;a++){var u=f[a];u[4]&&(n[u[1]]=n[u[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n},toString:function(t){t&&"function"==typeof t||(t=i.stringify);var e,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var s=o+(r.slashes?"//":"");return r.username&&(s+=r.username,r.password&&(s+=":"+r.password),s+="@"),s+=r.host+r.pathname,(e="object"===n(r.query)?t(r.query):r.query)&&(s+="?"!==e.charAt(0)?"?"+e:e),r.hash&&(s+=r.hash),s}},d.extractProtocol=p,d.location=h,d.trimLeft=c,d.qs=i,t.exports=d}).call(this,r(21))},function(t,e,r){"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty;function o(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}e.stringify=function(t,e){e=e||"";var r,o,i=[];for(o in"string"!=typeof e&&(e="?"),t)if(n.call(t,o)){if((r=t[o])||null!=r&&!isNaN(r)||(r=""),o=encodeURIComponent(o),r=encodeURIComponent(r),null===o||null===r)continue;i.push(o+"="+r)}return i.length?e+i.join("&"):""},e.parse=function(t){for(var e,r=/([^=?&]+)=?([^&]*)/g,n={};e=r.exec(t);){var i=o(e[1]),s=o(e[2]);null===i||null===s||i in n||(n[i]=s)}return n}},function(t,e,r){var n=r(24),o=(r(4).merge,r(2)),i=o.handleResponseCode,s=o.processGlobFilter,a=o.processResponsePayload,u=r(8),c=u.normaliseHREF,f=u.normalisePath,l=r(9),h=l.parseXML,p=l.prepareFileFromProps,d=r(1),g=d.encodePath,y=d.joinURL,m=d.prepareRequestOptions,v=d.request;t.exports={getDirectoryContents:function(t,e){var r={url:y(e.remoteURL,g(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain",Depth:e.deep?"infinity":1},responseType:"text"},o=null;return m(r,e),v(r).then(i).then((function(t){return o=t,t.data})).then(h).then((function(r){return function(t,e,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=n.join(e,r,"/"),s=n.join(e,"/"),a=t.multistatus.response;return a.filter((function(t){var e=t.href;return(e=n.join(f(c(e)),"/"))!==s&&e!==i})).map((function(t){var e=c(t.href),r=t.propstat.prop,i=f("/"===s?e:n.relative(s,e));return p(r,i,o)}))}(r,e.remotePath,t,e.details)})).then((function(t){return a(o,t,e.details)})).then((function(t){return e.glob?s(t,e.glob):t}))}}},function(t,e,r){(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r<o;a=n[++r])y(a)||!_(a)?s+=" "+a:s+=" "+u(a);return s},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),o=!0}return r.apply(this,arguments)}};var s,a={};function u(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),l(n,t,n.depth)}function c(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function f(t,e){return t}function l(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return v(o)||(o=l(t,o,n)),o}var i=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}(t,r);if(i)return i;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(r);if(0===s.length){if(x(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return h(r)}var c,f="",_=!1,T=["{","}"];return d(r)&&(_=!0,T=["[","]"]),x(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(f=" "+RegExp.prototype.toString.call(r)),E(r)&&(f=" "+Date.prototype.toUTCString.call(r)),A(r)&&(f=" "+h(r)),0!==s.length||_&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=_?function(t,e,r,n,o){for(var i=[],s=0,a=e.length;s<a;++s)C(e,String(s))?i.push(p(t,e,r,n,String(s),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(p(t,e,r,n,o,!0))})),i}(t,r,n,a,s):s.map((function(e){return p(t,r,n,a,e,_)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,f,T)):T[0]+f+T[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,o,i){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),C(n,o)||(s="["+o+"]"),a||(t.seen.indexOf(u.value)<0?(a=y(r)?l(t,u.value,null):l(t,u.value,r-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),b(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function y(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function b(t){return void 0===t}function w(t){return _(t)&&"[object RegExp]"===T(t)}function _(t){return"object"===n(t)&&null!==t}function E(t){return _(t)&&"[object Date]"===T(t)}function A(t){return _(t)&&("[object Error]"===T(t)||t instanceof Error)}function x(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function S(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(b(s)&&(s=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(s)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=g,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=b,e.isRegExp=w,e.isObject=_,e.isDate=E,e.isError=A,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===n(t)||void 0===t},e.isBuffer=r(56);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date,e=[S(t.getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=r(57),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function j(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!=typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),R&&Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,o(t))},e.promisify.custom=R,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var o=r.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,s=function(){return o.apply(i,arguments)};e.apply(this,r).then((function(e){t.nextTick(s,null,e)}),(function(e){t.nextTick(j,e,s)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,o(e)),r}}).call(this,r(7))},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return t&&"object"===r(t)&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){t.exports=f,f.Minimatch=l;var n={sep:"/"};try{n=r(23)}catch(t){}var o=f.GLOBSTAR=l.GLOBSTAR={},i=r(59),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="().*{}+?[]^$\\!".split("").reduce((function(t,e){return t[e]=!0,t}),{}),u=/\/+/;function c(t,e){t=t||{},e=e||{};var r={};return Object.keys(e).forEach((function(t){r[t]=e[t]})),Object.keys(t).forEach((function(e){r[e]=t[e]})),r}function f(t,e,r){if("string"!=typeof e)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===e.charAt(0))&&(""===e.trim()?""===t:new l(e,r).match(t))}function l(t,e){if(!(this instanceof l))return new l(t,e);if("string"!=typeof t)throw new TypeError("glob pattern string required");e||(e={}),t=t.trim(),"/"!==n.sep&&(t=t.split(n.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function h(t,e){if(e||(e=this instanceof l?this.options:{}),void 0===(t=void 0===t?this.pattern:t))throw new TypeError("undefined pattern");return e.nobrace||!t.match(/\{.*\}/)?[t]:i(t)}f.filter=function(t,e){return e=e||{},function(r,n,o){return f(r,t,e)}},f.defaults=function(t){if(!t||!Object.keys(t).length)return f;var e=f,r=function(r,n,o){return e.minimatch(r,n,c(t,o))};return r.Minimatch=function(r,n){return new e.Minimatch(r,c(t,n))},r},l.defaults=function(t){return t&&Object.keys(t).length?f.defaults(t).Minimatch:l},l.prototype.debug=function(){},l.prototype.make=function(){if(!this._made){var t=this.pattern,e=this.options;if(e.nocomment||"#"!==t.charAt(0))if(t){this.parseNegate();var r=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,r),r=this.globParts=r.map((function(t){return t.split(u)})),this.debug(this.pattern,r),r=r.map((function(t,e,r){return t.map(this.parse,this)}),this),this.debug(this.pattern,r),r=r.filter((function(t){return-1===t.indexOf(!1)})),this.debug(this.pattern,r),this.set=r}else this.empty=!0;else this.comment=!0}},l.prototype.parseNegate=function(){var t=this.pattern,e=!1,r=0;if(!this.options.nonegate){for(var n=0,o=t.length;n<o&&"!"===t.charAt(n);n++)e=!e,r++;r&&(this.pattern=t.substr(r)),this.negate=e}},f.braceExpand=function(t,e){return h(t,e)},l.prototype.braceExpand=h,l.prototype.parse=function(t,e){if(t.length>65536)throw new TypeError("pattern is too long");var r=this.options;if(!r.noglobstar&&"**"===t)return o;if(""===t)return"";var n,i="",u=!!r.nocase,c=!1,f=[],l=[],h=!1,d=-1,g=-1,y="."===t.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=this;function v(){if(n){switch(n){case"*":i+="[^/]*?",u=!0;break;case"?":i+="[^/]",u=!0;break;default:i+="\\"+n}m.debug("clearStateChar %j %j",n,i),n=!1}}for(var b,w=0,_=t.length;w<_&&(b=t.charAt(w));w++)if(this.debug("%s\t%s %s %j",t,w,i,b),c&&a[b])i+="\\"+b,c=!1;else switch(b){case"/":return!1;case"\\":v(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,w,i,b),h){this.debug(" in class"),"!"===b&&w===g+1&&(b="^"),i+=b;continue}m.debug("call clearStateChar %j",n),v(),n=b,r.noext&&v();continue;case"(":if(h){i+="(";continue}if(!n){i+="\\(";continue}f.push({type:n,start:w-1,reStart:i.length,open:s[n].open,close:s[n].close}),i+="!"===n?"(?:(?!(?:":"(?:",this.debug("plType %j %j",n,i),n=!1;continue;case")":if(h||!f.length){i+="\\)";continue}v(),u=!0;var E=f.pop();i+=E.close,"!"===E.type&&l.push(E),E.reEnd=i.length;continue;case"|":if(h||!f.length||c){i+="\\|",c=!1;continue}v(),i+="|";continue;case"[":if(v(),h){i+="\\"+b;continue}h=!0,g=w,d=i.length,i+=b;continue;case"]":if(w===g+1||!h){i+="\\"+b,c=!1;continue}if(h){var A=t.substring(g+1,w);try{RegExp("["+A+"]")}catch(t){var x=this.parse(A,p);i=i.substr(0,d)+"\\["+x[0]+"\\]",u=u||x[1],h=!1;continue}}u=!0,h=!1,i+=b;continue;default:v(),c?c=!1:!a[b]||"^"===b&&h||(i+="\\"),i+=b}for(h&&(A=t.substr(g+1),x=this.parse(A,p),i=i.substr(0,d)+"\\["+x[0],u=u||x[1]),E=f.pop();E;E=f.pop()){var T=i.slice(E.reStart+E.open.length);this.debug("setting tail",i,E),T=T.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(t,e,r){return r||(r="\\"),e+e+r+"|"})),this.debug("tail=%j\n %s",T,T,E,i);var S="*"===E.type?"[^/]*?":"?"===E.type?"[^/]":"\\"+E.type;u=!0,i=i.slice(0,E.reStart)+S+"\\("+T}v(),c&&(i+="\\\\");var O=!1;switch(i.charAt(0)){case".":case"[":case"(":O=!0}for(var P=l.length-1;P>-1;P--){var C=l[P],R=i.slice(0,C.reStart),j=i.slice(C.reStart,C.reEnd-8),I=i.slice(C.reEnd-8,C.reEnd),D=i.slice(C.reEnd);I+=D;var k=R.split("(").length-1,F=D;for(w=0;w<k;w++)F=F.replace(/\)[+*?]?/,"");var N="";""===(D=F)&&e!==p&&(N="$"),i=R+j+D+N+I}if(""!==i&&u&&(i="(?=.)"+i),O&&(i=y+i),e===p)return[i,u];if(!u)return function(t){return t.replace(/\\(.)/g,"$1")}(t);var U=r.nocase?"i":"";try{var L=new RegExp("^"+i+"$",U)}catch(t){return new RegExp("$.")}return L._glob=t,L._src=i,L};var p={};f.makeRe=function(t,e){return new l(t,e||{}).makeRe()},l.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,r=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",n=e.nocase?"i":"",i=t.map((function(t){return t.map((function(t){return t===o?r:"string"==typeof t?function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(t):t._src})).join("\\/")})).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,n)}catch(t){this.regexp=!1}return this.regexp},f.match=function(t,e,r){var n=new l(e,r=r||{});return t=t.filter((function(t){return n.match(t)})),n.options.nonull&&!t.length&&t.push(e),t},l.prototype.match=function(t,e){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var r=this.options;"/"!==n.sep&&(t=t.split(n.sep).join("/")),t=t.split(u),this.debug(this.pattern,"split",t);var o,i,s=this.set;for(this.debug(this.pattern,"set",s),i=t.length-1;i>=0&&!(o=t[i]);i--);for(i=0;i<s.length;i++){var a=s[i],c=t;if(r.matchBase&&1===a.length&&(c=[o]),this.matchOne(c,a,e))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate},l.prototype.matchOne=function(t,e,r){var n=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var i=0,s=0,a=t.length,u=e.length;i<a&&s<u;i++,s++){this.debug("matchOne loop");var c,f=e[s],l=t[i];if(this.debug(e,f,l),!1===f)return!1;if(f===o){this.debug("GLOBSTAR",[e,f,l]);var h=i,p=s+1;if(p===u){for(this.debug("** at the end");i<a;i++)if("."===t[i]||".."===t[i]||!n.dot&&"."===t[i].charAt(0))return!1;return!0}for(;h<a;){var d=t[h];if(this.debug("\nglobstar while",t,h,e,p,d),this.matchOne(t.slice(h),e.slice(p),r))return this.debug("globstar found match!",h,a,d),!0;if("."===d||".."===d||!n.dot&&"."===d.charAt(0)){this.debug("dot detected!",t,h,e,p);break}this.debug("globstar swallow a segment, and continue"),h++}return!(!r||(this.debug("\n>>> no match, partial?",t,h,e,p),h!==a))}if("string"==typeof f?(c=n.nocase?l.toLowerCase()===f.toLowerCase():l===f,this.debug("string match",f,l,c)):(c=l.match(f),this.debug("pattern match",f,l,c)),!c)return!1}if(i===a&&s===u)return!0;if(i===a)return r;if(s===u)return i===a-1&&""===t[i];throw new Error("wtf?")}},function(t,e,r){var n=r(60),o=r(61);t.exports=function(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),function t(e,r){var i=[],s=o("{","}",e);if(!s||/\$$/.test(s.pre))return[e];var u,c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=c||l,m=s.body.indexOf(",")>=0;if(!y&&!m)return s.post.match(/,.*\}/)?(e=s.pre+"{"+s.body+a+s.post,t(e)):[e];if(y)u=s.body.split(/\.\./);else if(1===(u=function t(e){if(!e)return[""];var r=[],n=o("{","}",e);if(!n)return e.split(",");var i=n.pre,s=n.body,a=n.post,u=i.split(",");u[u.length-1]+="{"+s+"}";var c=t(a);return a.length&&(u[u.length-1]+=c.shift(),u.push.apply(u,c)),r.push.apply(r,u),r}(s.body)).length&&1===(u=t(u[0],!1).map(h)).length)return(w=s.post.length?t(s.post,!1):[""]).map((function(t){return s.pre+u[0]+t}));var v,b=s.pre,w=s.post.length?t(s.post,!1):[""];if(y){var _=f(u[0]),E=f(u[1]),A=Math.max(u[0].length,u[1].length),x=3==u.length?Math.abs(f(u[2])):1,T=d;E<_&&(x*=-1,T=g);var S=u.some(p);v=[];for(var O=_;T(O,E);O+=x){var P;if(l)"\\"===(P=String.fromCharCode(O))&&(P="");else if(P=String(O),S){var C=A-P.length;if(C>0){var R=new Array(C+1).join("0");P=O<0?"-"+R+P.slice(1):R+P}}v.push(P)}}else v=n(u,(function(e){return t(e,!1)}));for(var j=0;j<v.length;j++)for(var I=0;I<w.length;I++){var D=b+v[j]+w[I];(!r||y||D)&&i.push(D)}return i}(function(t){return t.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(a).split("\\,").join(u).split("\\.").join(c)}(t),!0).map(l)):[]};var i="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",u="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function f(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function l(t){return t.split(i).join("\\").split(s).join("{").split(a).join("}").split(u).join(",").split(c).join(".")}function h(t){return"{"+t+"}"}function p(t){return/^-?0\d/.test(t)}function d(t,e){return t<=e}function g(t,e){return t>=e}},function(t,e){t.exports=function(t,e){for(var n=[],o=0;o<t.length;o++){var i=e(t[o],o);r(i)?n.push.apply(n,i):n.push(i)}return n};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";function n(t,e,r){t instanceof RegExp&&(t=o(t,r)),e instanceof RegExp&&(e=o(e,r));var n=i(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function o(t,e){var r=e.match(t);return r?r[0]:null}function i(t,e,r){var n,o,i,s,a,u=r.indexOf(t),c=r.indexOf(e,u+1),f=u;if(u>=0&&c>0){for(n=[],i=r.length;f>=0&&!a;)f==u?(n.push(f),u=r.indexOf(t,f+1)):1==n.length?a=[n.pop(),c]:((o=n.pop())<i&&(i=o,s=c),c=r.indexOf(e,f+1)),f=u<c&&u>=0?u:c;n.length&&(a=[i,s])}return a}t.exports=n,n.range=i},function(t,e,r){"use strict";var n=r(63),o=r(6),i=r(6),s=r(3).buildOptions,a=r(65);e.parse=function(t,e,r){if(r){!0===r&&(r={});var u=a.validate(t,r);if(!0!==u)throw Error(u.err.msg)}return e=s(e,i.defaultOptions,i.props),n.convertToJson(o.getTraversalObj(t,e),e)},e.convertTonimn=r(66).convert2nimn,e.getTraversalObj=o.getTraversalObj,e.convertToJson=n.convertToJson,e.convertToJsonString=r(67).convertToJsonString,e.validate=a.validate,e.j2xParser=r(68),e.parseToNimn=function(t,r,n){return e.convertTonimn(e.getTraversalObj(t,n),r,n)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(3);e.convertToJson=function t(e,r){var i={};if(!(e.child&&!o.isEmptyObject(e.child)||e.attrsMap&&!o.isEmptyObject(e.attrsMap)))return o.isExist(e.val)?e.val:"";o.isExist(e.val)&&("string"!=typeof e.val||""!==e.val&&e.val!==r.cdataPositionChar)&&("strict"===r.arrayMode?i[r.textNodeName]=[e.val]:i[r.textNodeName]=e.val),o.merge(i,e.attrsMap,r.arrayMode);for(var s=Object.keys(e.child),a=0;a<s.length;a++){var u=s[a];if(e.child[u]&&e.child[u].length>1)for(var c in i[u]=[],e.child[u])i[u].push(t(e.child[u][c],r));else if(!0===r.arrayMode){var f=t(e.child[u][0],r);"object"===n(f)?i[u]=[f]:i[u]=f}else"strict"===r.arrayMode?i[u]=[t(e.child[u][0],r)]:i[u]=t(e.child[u][0],r)}return i}},function(t,e,r){"use strict";t.exports=function(t,e,r){this.tagname=t,this.parent=e,this.child={},this.attrsMap={},this.val=r,this.addChild=function(t){Array.isArray(this.child[t.tagname])?this.child[t.tagname].push(t):this.child[t.tagname]=[t]}}},function(t,e,r){"use strict";var n=r(3),o={allowBooleanAttributes:!1},i=["allowBooleanAttributes"];function s(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var n=t.substr(r,e-r);if(e>5&&"xml"===n)return h("InvalidXml","XML declaration allowed only at the start of the document.",d(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function a(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0==--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function u(t,e){for(var r="",n="",o=!1;e<t.length;e++){if('"'===t[e]||"'"===t[e])if(""===n)n=t[e];else{if(n!==t[e])continue;n=""}else if(">"===t[e]&&""===n){o=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:o}}e.validate=function(t,e){e=n.buildOptions(e,o,i);var r,c=[],p=!1,g=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var y=0;y<t.length;y++){if("<"!==t[y]){if(" "===t[y]||"\t"===t[y]||"\n"===t[y]||"\r"===t[y])continue;return h("InvalidChar","char '".concat(t[y],"' is not expected."),d(t,y))}if("?"===t[++y]){if((y=s(t,++y)).err)return y}else{if("!"===t[y]){y=a(t,y);continue}var m=!1;"/"===t[y]&&(m=!0,y++);for(var v="";y<t.length&&">"!==t[y]&&" "!==t[y]&&"\t"!==t[y]&&"\n"!==t[y]&&"\r"!==t[y];y++)v+=t[y];if("/"===(v=v.trim())[v.length-1]&&(v=v.substring(0,v.length-1),y--),r=v,!n.isName(r))return h("InvalidTag",0===v.trim().length?"There is an unnecessary space between tag name and backward slash '</ ..'.":"Tag '".concat(v,"' is an invalid name."),d(t,y));var b=u(t,y);if(!1===b)return h("InvalidAttr","Attributes for '".concat(v,"' have open quote."),d(t,y));var w=b.value;if(y=b.index,"/"===w[w.length-1]){var _=f(w=w.substring(0,w.length-1),e);if(!0!==_)return h(_.err.code,_.err.msg,d(t,y-w.length+_.err.line));p=!0}else if(m){if(!b.tagClosed)return h("InvalidTag","Closing tag '".concat(v,"' doesn't have proper closing."),d(t,y));if(w.trim().length>0)return h("InvalidTag","Closing tag '".concat(v,"' can't have attributes or invalid starting."),d(t,y));var E=c.pop();if(v!==E)return h("InvalidTag","Closing tag '".concat(E,"' is expected inplace of '").concat(v,"'."),d(t,y));0==c.length&&(g=!0)}else{var A=f(w,e);if(!0!==A)return h(A.err.code,A.err.msg,d(t,y-w.length+A.err.line));if(!0===g)return h("InvalidXml","Multiple possible root nodes found.",d(t,y));c.push(v),p=!0}for(y++;y<t.length;y++){if("<"===t[y]){if("!"===t[y+1]){y=a(t,++y);continue}break}if("&"===t[y]){var x=l(t,y);if(-1==x)return h("InvalidChar","char '&' is not expected.",d(t,y));y=x}}"<"===t[y]&&y--}}return p?!(c.length>0)||h("InvalidXml","Invalid '".concat(JSON.stringify(c,null,4).replace(/\r?\n/g,""),"' found."),1):h("InvalidXml","Start tag expected.",1)};var c=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function f(t,e){for(var r=n.getAllMatches(t,c),o={},i=0;i<r.length;i++){if(0===r[i][1].length)return h("InvalidAttr","Attribute '".concat(r[i][2],"' has no space in starting."),g(t,r[i][0]));if(void 0===r[i][3]&&!e.allowBooleanAttributes)return h("InvalidAttr","boolean attribute '".concat(r[i][2],"' is not allowed."),g(t,r[i][0]));var s=r[i][2];if(!p(s))return h("InvalidAttr","Attribute '".concat(s,"' is an invalid name."),g(t,r[i][0]));if(o.hasOwnProperty(s))return h("InvalidAttr","Attribute '".concat(s,"' is repeated."),g(t,r[i][0]));o[s]=1}return!0}function l(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function h(t,e,r){return{err:{code:t,msg:e,line:r}}}function p(t){return n.isName(t)}function d(t,e){return t.substring(0,e).split(/\r?\n/).length}function g(t,e){return t.indexOf(e)+e.length}},function(t,e,r){"use strict";var n=function(t){return String.fromCharCode(t)},o={nilChar:n(176),missingChar:n(201),nilPremitive:n(175),missingPremitive:n(200),emptyChar:n(178),emptyValue:n(177),boundryChar:n(179),objStart:n(198),arrStart:n(204),arrayEnd:n(185)},i=[o.nilChar,o.nilPremitive,o.missingChar,o.missingPremitive,o.boundryChar,o.emptyChar,o.emptyValue,o.arrayEnd,o.objStart,o.arrStart],s=function(t){switch(t){case void 0:return o.missingPremitive;case null:return o.nilPremitive;case"":return o.emptyValue;default:return t}},a=function(t,e){return u(e[0])||u(t[t.length-1])||(t+=o.boundryChar),t+e},u=function(t){return-1!==i.indexOf(t)},c=r(6),f=r(3).buildOptions;e.convert2nimn=function(t,e,r){return function t(e,r,n){if("string"==typeof r)return e&&e[0]&&void 0!==e[0].val?s(e[0].val,r):s(e,r);var i,u=void 0===(i=e)?o.missingChar:null===i?o.nilChar:!(i.child&&0===Object.keys(i.child).length&&(!i.attrsMap||0===Object.keys(i.attrsMap).length))||o.emptyChar;if(!0===u){var c="";if(Array.isArray(r)){c+=o.arrStart;var f=r[0],l=e.length;if("string"==typeof f)for(var h=0;h<l;h++){var p=s(e[h].val,f);c=a(c,p)}else for(var d=0;d<l;d++){var g=t(e[d],f,n);c=a(c,g)}c+=o.arrayEnd}else{c+=o.objStart;var y=Object.keys(r);for(var m in Array.isArray(e)&&(e=e[0]),y){var v,b=y[m];v=!n.ignoreAttributes&&e.attrsMap&&e.attrsMap[b]?t(e.attrsMap[b],r[b],n):b===n.textNodeName?t(e.val,r[b],n):t(e.child[b],r[b],n),c=a(c,v)}}return c}return u}(t,e,r=f(r,c.defaultOptions,c.props))}},function(t,e,r){"use strict";var n=r(3),o=r(3).buildOptions,i=r(6);e.convertToJsonString=function(t,e){return(e=o(e,i.defaultOptions,i.props)).indentBy=e.indentBy||"",function t(e,r,o){for(var i,s="{",a=Object.keys(e.child),u=0;u<a.length;u++){var c=a[u];if(e.child[c]&&e.child[c].length>1){for(var f in s+='"'+c+'" : [ ',e.child[c])s+=t(e.child[c][f],r)+" , ";s=s.substr(0,s.length-1)+" ] "}else s+='"'+c+'" : '+t(e.child[c][0],r)+" ,"}return n.merge(s,e.attrsMap),n.isEmptyObject(s)?n.isExist(e.val)?e.val:"":(n.isExist(e.val)&&("string"!=typeof e.val||""!==e.val&&e.val!==r.cdataPositionChar)&&(s+='"'+r.textNodeName+'" : '+(!0!==(i=e.val)&&!1!==i&&isNaN(i)?'"'+i+'"':i)),","===s[s.length-1]&&(s=s.substr(0,s.length-2)),s+"}")}(t,e)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(3).buildOptions,i={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:" ",supressEmptyNode:!1,tagValueProcessor:function(t){return t},attrValueProcessor:function(t){return t}},s=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function a(t){this.options=o(t,i,s),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=g),this.options.cdataTagName?this.isCDATA=y:this.isCDATA=function(){return!1},this.replaceCDATAstr=u,this.replaceCDATAarr=c,this.options.format?(this.indentate=d,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=p,this.buildObjNode=l):(this.buildTextNode=h,this.buildObjNode=f),this.buildTextValNode=h,this.buildObjectNode=f}function u(t,e){return t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t?t+"<![CDATA["+e+"]]"+this.tagEndChar:t.replace(this.options.cdataPositionChar,"<![CDATA["+e+"]]"+this.tagEndChar)}function c(t,e){if(t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t)return t+"<![CDATA["+e.join("]]><![CDATA[")+"]]"+this.tagEndChar;for(var r in e)t=t.replace(this.options.cdataPositionChar,"<![CDATA["+e[r]+"]]>");return t+this.newLine}function f(t,e,r,n){return r&&!t.includes("<")?this.indentate(n)+"<"+e+r+">"+t+"</"+e+this.tagEndChar:this.indentate(n)+"<"+e+r+this.tagEndChar+t+this.indentate(n)+"</"+e+this.tagEndChar}function l(t,e,r,n){return""!==t?this.buildObjectNode(t,e,r,n):this.indentate(n)+"<"+e+r+"/"+this.tagEndChar}function h(t,e,r,n){return this.indentate(n)+"<"+e+r+">"+this.options.tagValueProcessor(t)+"</"+e+this.tagEndChar}function p(t,e,r,n){return""!==t?this.buildTextValNode(t,e,r,n):this.indentate(n)+"<"+e+r+"/"+this.tagEndChar}function d(t){return this.options.indentBy.repeat(t)}function g(t){return!!t.startsWith(this.options.attributeNamePrefix)&&t.substr(this.attrPrefixLen)}function y(t){return t===this.options.cdataTagName}a.prototype.parse=function(t){return this.j2x(t,0).val},a.prototype.j2x=function(t,e){for(var r="",o="",i=Object.keys(t),s=i.length,a=0;a<s;a++){var u=i[a];if(void 0===t[u]);else if(null===t[u])o+=this.indentate(e)+"<"+u+"/"+this.tagEndChar;else if(t[u]instanceof Date)o+=this.buildTextNode(t[u],u,"",e);else if("object"!==n(t[u])){var c=this.isAttribute(u);c?r+=" "+c+'="'+this.options.attrValueProcessor(""+t[u])+'"':this.isCDATA(u)?t[this.options.textNodeName]?o+=this.replaceCDATAstr(t[this.options.textNodeName],t[u]):o+=this.replaceCDATAstr("",t[u]):u===this.options.textNodeName?t[this.options.cdataTagName]||(o+=this.options.tagValueProcessor(""+t[u])):o+=this.buildTextNode(t[u],u,"",e)}else if(Array.isArray(t[u]))if(this.isCDATA(u))o+=this.indentate(e),t[this.options.textNodeName]?o+=this.replaceCDATAarr(t[this.options.textNodeName],t[u]):o+=this.replaceCDATAarr("",t[u]);else for(var f=t[u].length,l=0;l<f;l++){var h=t[u][l];if(void 0===h);else if(null===h)o+=this.indentate(e)+"<"+u+"/"+this.tagEndChar;else if("object"===n(h)){var p=this.j2x(h,e+1);o+=this.buildObjNode(p.val,u,p.attrStr,e)}else o+=this.buildTextNode(h,u,"",e)}else if(this.options.attrNodeName&&u===this.options.attrNodeName)for(var d=Object.keys(t[u]),g=d.length,y=0;y<g;y++)r+=" "+d[y]+'="'+this.options.attrValueProcessor(""+t[u][d[y]])+'"';else{var m=this.j2x(t[u],e+1);o+=this.buildObjNode(m.val,u,m.attrStr,e)}}return{attrStr:r,val:o}},t.exports=a},function(t,e,r){"use strict";
25/**
26* @license nested-property https://github.com/cosmosio/nested-property
27*
28* The MIT License (MIT)
29*
30* Copyright (c) 2014-2020 Olivier Scherrer <pode.fr@gmail.com>
31*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports={set:function(t,e,r){if(t&&"object"==n(t)){if("string"==typeof e&&""!==e){var o=e.split(".");return o.reduce((function(t,e,n){var i=Number.isInteger(Number(o[n+1]));return t[e]=t[e]||(i?[]:{}),o.length==n+1&&(t[e]=r),t[e]}),t)}return"number"==typeof e?(t[e]=r,t[e]):t}return t},get:function(t,e){return t&&"object"==n(t)?"string"==typeof e&&""!==e?e.split(".").reduce((function(t,e){return t&&t[e]}),t):"number"==typeof e?t[e]:t:t},has:function(t,e,r){return r=r||{},!(!t||"object"!=n(t))&&("string"==typeof e&&""!==e?e.split(".").reduce((function(t,e,o,i){return o==i.length-1?r.own?!(!t||!t.hasOwnProperty(e)):!(null===t||"object"!=n(t)||!(e in t)):t&&t[e]}),t):"number"==typeof e&&e in t)},hasOwn:function(t,e,r){return this.has(t,e,r||{own:!0})},isIn:function(t,e,r,o){if(o=o||{},t&&"object"==n(t)){if("string"==typeof e&&""!==e){var i,s=e.split("."),a=!1;return i=!!s.reduce((function(t,e){return a=a||t===r||!!t&&t[e]===r,t&&t[e]}),t),o.validPath?a&&i:a}return!1}return!1}}},function(t,e,r){var n=r(2),o=r(1),i=o.encodePath,s=o.joinURL,a=o.prepareRequestOptions,u=o.request;t.exports={createDirectory:function(t,e){var r={url:s(e.remoteURL,i(t)),method:"MKCOL"};return a(r,e),u(r).then(n.handleResponseCode)}}},function(t,e,r){var n=r(2).handleResponseCode,o=r(1),i=o.encodePath,s=o.joinURL,a=o.prepareRequestOptions,u=o.request;t.exports={customRequest:function(t,e,r){return e.url||(e.url=s(r.remoteURL,i(t),"/")),a(e,r),u(e).then(n)}}},function(t,e,r){var n=r(2),o=r(1),i=o.encodePath,s=o.joinURL,a=o.prepareRequestOptions,u=o.request;t.exports={deleteFile:function(t,e){var r={url:s(e.remoteURL,i(t)),method:"DELETE"};return a(r,e),u(r).then(n.handleResponseCode)}}},function(t,e,r){var n=r(25).getStat;t.exports={pathExists:function(t,e){return n(t,e).then((function(){return!0})).catch((function(t){if(t.response&&404===t.response.status)return!1;throw t}))}}},function(t,e,r){var n=r(2),o=n.handleResponseCode,i=n.processResponsePayload,s=r(1),a=s.encodePath,u=s.joinURL,c=s.prepareRequestOptions,f=s.request,l=r(5).fromBase64;t.exports={getFileContentsBuffer:function(t,e){var r={url:u(e.remoteURL,a(t)),method:"GET",responseType:"arraybuffer"};return c(r,e),f(r).then(o).then((function(t){return i(t,t.data,e.details)}))},getFileContentsString:function(t,e){var r={url:u(e.remoteURL,a(t)),method:"GET",responseType:"text"};return c(r,e),f(r).then(o).then((function(t){return i(t,t.data,e.details)}))},getFileLink:function(t,e){var r=u(e.remoteURL,a(t)),n=/^https:/i.test(r)?"https":"http";if(e.headers&&e.headers.Authorization){if(!1===/^Basic /i.test(e.headers.Authorization))throw new Error("Failed retrieving download link: Invalid authorisation method");var o=e.headers.Authorization.replace(/^Basic /i,"").trim(),i=l(o);r=r.replace(/^https?:\/\//,"".concat(n,"://").concat(i,"@"))}return r}}},function(t,e,r){function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var i=r(2),s=i.handleResponseCode,a=i.processResponsePayload,u=r(1),c=(u.encodePath,u.joinURL),f=u.prepareRequestOptions,l=u.request,h=r(9),p=h.parseXML,d=h.translateDiskSpace;function g(t){try{var e=n(t.multistatus.response,1)[0].propstat.prop,r=e["quota-used-bytes"],o=e["quota-available-bytes"];return void 0!==r&&void 0!==o?{used:parseInt(r,10),available:d(o)}:null}catch(t){}return null}t.exports={getQuota:function(t){var e={url:c(t.remoteURL,"/"),method:"PROPFIND",headers:{Accept:"text/plain",Depth:0},responseType:"text"},r=null;return f(e,t),l(e).then(s).then((function(t){return r=t,t.data})).then(p).then(g).then((function(e){return a(r,e,t.details)}))}}},function(t,e,r){var n=r(2),o=r(1),i=o.encodePath,s=o.joinURL,a=o.prepareRequestOptions,u=o.request;t.exports={moveFile:function(t,e,r){var o={url:s(r.remoteURL,i(t)),method:"MOVE",headers:{Destination:s(r.remoteURL,i(e))}};return a(o,r),u(o).then(n.handleResponseCode)}}},function(t,e,r){var n=r(2),o=r(1),i=o.encodePath,s=o.joinURL,a=o.prepareRequestOptions,u=o.request;t.exports={copyFile:function(t,e,r){var o={url:s(r.remoteURL,i(t)),method:"COPY",headers:{Destination:s(r.remoteURL,i(e))}};return a(o,r),u(o).then(n.handleResponseCode)}}},function(t,e,r){var n=r(4).merge,o=r(2),i=r(1),s=i.encodePath,a=i.joinURL,u=i.prepareRequestOptions,c=i.request,f=r(5).fromBase64;t.exports={getFileUploadLink:function(t,e){var r=a(e.remoteURL,s(t)),n=/^https:/i.test(r+="?Content-Type=application/octet-stream")?"https":"http";if(e.headers&&e.headers.Authorization){if(!1===/^Basic /i.test(e.headers.Authorization))throw new Error("Failed retrieving download link: Invalid authorisation method");var o=e.headers.Authorization.replace(/^Basic /i,"").trim(),i=f(o);r=r.replace(/^https?:\/\//,"".concat(n,"://").concat(i,"@"))}return r},putFileContents:function(t,e,r){var i={"Content-Length":e.length},f=n({headers:{"Content-Type":"application/octet-stream"},overwrite:!0},{headers:i},r||{});!1===f.overwrite&&(f.headers["If-None-Match"]="*");var l={url:a(r.remoteURL,s(t)),method:"PUT",headers:f.headers,data:e};return u(l,r),c(l).then(o.handleResponseCode)}}}])},function(t,e,r){const n=r(80),o=r(39),i=r(42),s=r(25),a=r(5),u=r(6),c=r(112),f=r(114),l=r(115),h=r(129),p=r(143),d=r(63),g=r(62),{registerDatasource:y}=r(2),{consumeGroupFacade:m,consumeVaultFacade:v,createGroupFacade:b,createVaultFacade:w}=r(56),{isOTPURI:_,isVaultFacade:E}=r(58),{consumeEntryFacade:A,createEntryFacade:x}=r(57),{createFieldDescriptor:T}=r(18),{DEFAULT_ENTRY_TYPE:S,DEFAULT_FIELD_TYPE:O,ENTRY_TYPE_CREDITCARD:P,ENTRY_TYPE_LOGIN:C,ENTRY_TYPE_NOTE:R,ENTRY_TYPE_SSHKEY:j,ENTRY_TYPE_WEBSITE:I,ENTRY_TYPES:D,FIELD_VALUE_TYPE_NOTE:k,FIELD_VALUE_TYPE_OTP:F,FIELD_VALUE_TYPE_PASSWORD:N,FIELD_VALUE_TYPE_TEXT:U,FIELD_VALUE_TYPES:L}=r(14),B=r(11),M=r(20),q=r(38),G=r(152),{getSharedAppEnv:V}=r(10),{ENTRY_URL_TYPE_ANY:H,ENTRY_URL_TYPE_GENERAL:Y,ENTRY_URL_TYPE_ICON:z,ENTRY_URL_TYPE_LOGIN:$,getEntryURLs:K}=r(49);t.exports={DEFAULT_ENTRY_TYPE:S,DEFAULT_FIELD_TYPE:O,ENTRY_TYPE_CREDITCARD:P,ENTRY_TYPE_LOGIN:C,ENTRY_TYPE_NOTE:R,ENTRY_TYPE_SSHKEY:j,ENTRY_TYPE_WEBSITE:I,ENTRY_TYPES:D,ENTRY_URL_TYPE_ANY:H,ENTRY_URL_TYPE_GENERAL:Y,ENTRY_URL_TYPE_ICON:z,ENTRY_URL_TYPE_LOGIN:$,FIELD_VALUE_TYPE_NOTE:k,FIELD_VALUE_TYPE_OTP:F,FIELD_VALUE_TYPE_PASSWORD:N,FIELD_VALUE_TYPE_TEXT:U,FIELD_VALUE_TYPES:L,VaultManager:n,VaultSource:o,Vault:i,Group:s,Entry:a,Credentials:B,TextDatasource:u,FileDatasource:c,WebDAVDatasource:f,DropboxDatasource:l,GoogleDriveDatasource:h,MyButtercupDatasource:p,DatasourceAuthManager:g,registerDatasource:y,MyButtercupClient:d,StorageInterface:M,MemoryStorageInterface:q,EntryFinder:G,consumeEntryFacade:A,consumeGroupFacade:m,consumeVaultFacade:v,createEntryFacade:x,createFieldDescriptor:T,createGroupFacade:b,createVaultFacade:w,isOTPURI:_,isVaultFacade:E,getSharedAppEnv:V,getEntryURLs:K}},function(t,e,r){const n=r(9),o=r(81),i=r(35),s=r(38),a=r(39),u=15e4,c=()=>{},f=/^bcup_vaultmgr_[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;t.exports=class extends n{constructor(t={}){super();const{autoUpdate:e=!0,autoUpdateDelay:r=u,cacheStorage:n=new s,sourceStorage:o=new s}=t;this._sources=[],this._cacheStorage=n,this._sourceStorage=o,this._queue=new i,this._autoUpdateEnabled=e,this._autoUpdateDelay=r,this._autoUpdateTimer=null,this._initialised=!1}get sources(){return[...this._sources]}get unlockedSources(){return this._sources.filter(t=>t.status===a.STATUS_UNLOCKED)}async addSource(t,e={}){const{order:r}=e;this._sources.find(e=>e.id===t.id)||await this.enqueueStateChange(async()=>{t._vaultManager=this,this._sources.push(t),t._order="number"==typeof r?r:this.getNextOrder();const e=t=>{this.emit("source:"+t),this.emit("sourcesUpdated")};t.on("locked",()=>e("locked")),t.on("unlocked",()=>e("unlocked")),t.on("updated",()=>this.dehydrate());const n=await t.dehydrate();await this._storeDehydratedSource(t.id,n),this.emit("sourcesUpdated")})}dehydrate(){return this.enqueueStateChange(()=>Promise.all(this._sources.map(t=>this.dehydrateSource(t))))}async dehydrateSource(t){const e="string"==typeof t?this.getSourceForID(t):t,r=await e.dehydrate();await this._storeDehydratedSource(e.id,r)}enqueueStateChange(t){return this._queue.channel("state").enqueue(t)}getNextOrder(){return Math.max(...this._sources.map(t=>t._order))+1}getSourceForID(t){return this._sources.find(e=>e.id&&e.id===t)||null}getUpdateableSources(){return this._sources.filter(t=>t.canBeUpdated())}initialise(){this._initialised||(this._startAutoUpdateTimer(),this._initialised=!0)}interruptAutoUpdate(t){return this.enqueueStateChange(c).then(()=>this._queue.channel("autoUpdateInterrupt").enqueue(()=>{const e=this._autoUpdateEnabled,r=this._autoUpdateDelay;this.toggleAutoUpdating(!1);const n=()=>{this.toggleAutoUpdating(e,r)};let i;try{i=t()}catch(t){throw n(),t}return o(i)?i.then(t=>(n(),t)).catch(t=>{throw n(),t}):(n(),i)}))}async rehydrate(){const t=await this._sourceStorage.getAllKeys();await Promise.all(t.filter(t=>f.test(t)).map(async t=>{const e=await this._sourceStorage.getValue(t),r=a.rehydrate(e);await this.addSource(r,{order:r.order})})),this.reorderSources(),this.emit("sourcesUpdated")}removeSource(t){return this.enqueueStateChange(async()=>{const e=this._sources.findIndex(e=>e.id===t);if(-1===e)throw new VError("Failed removing source: No source found for ID: "+t);this.sources[e].removeAllListeners(),this._sources.splice(e,1),this.emit("sourcesUpdated"),await this._sourceStorage.removeKey("bcup_vaultmgr_"+t)})}reorderSource(t,e){const r=this.getSourceForID(t);if(!r)throw new VError("Failed reordering source: No source found for ID: "+t);if(e===r.order)return;const n=r.order;r.order=e;const o=e<n;this.sources.forEach(r=>{r.id!==t&&(o&&r.order>=e?r.order+=1:!o&&r.order<=e&&(r.order-=1))}),this.reorderSources()}reorderSources(){this.sources.sort((t,e)=>t.order>e.order?1:e.order>t.order?-1:0),this.sources.forEach((t,e)=>{t.order=e}),this.emit("sourcesUpdated")}toggleAutoUpdating(t=!this._autoUpdateEnabled,e=u){t?(this._autoUpdateDelay=e,this._startAutoUpdateTimer()):(this._autoUpdateDelay=null,clearTimeout(this._autoUpdateTimer),this._autoUpdateTimer=null)}_autoUpdateSources(){return this.emit("autoUpdateStart"),this.enqueueStateChange(async()=>{const t=this.getUpdateableSources();t.length<=0||(await Promise.all(t.map(t=>t.update().catch(e=>{console.error("Failed auto-updating source: "+t.id),this.emit("autoUpdateFailed",{source:t})}))),this.emit("autoUpdateStop"))})}_startAutoUpdateTimer(){clearTimeout(this._autoUpdateTimer),this._autoUpdateTimer=setTimeout(()=>{this._autoUpdateSources().then(()=>{this._autoUpdateEnabled&&this._startAutoUpdateTimer()})},this._autoUpdateDelay)}_storeDehydratedSource(t,e){return this._sourceStorage.setValue("bcup_vaultmgr_"+t,e)}}},function(t,e){function r(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}t.exports=r,t.exports.default=r},function(t,e,r){const n=r(36),o=r(19),i=r(83);t.exports=class extends n{constructor(){super(),this._channels={}}get channels(){return this._channels}createChannel(t){if(this.channelExists(t))throw new Error("Cannot create channel: channel already exists: "+t);return this.channels[t]=new o(t),this.channels[t]}createParallelChannel(t,e){if(this.channelExists(t))throw new Error("Cannot create channel: channel already exists: "+t);const r=this.channels[t]=new i(t);return e&&(r.parallelism=e),r}channel(t){return!0!==this.channelExists(t)?this.createChannel(t):this.channels[t]}channelExists(t){return this.channels.hasOwnProperty(t)}}},function(t,e,r){const n=r(19);t.exports=class extends n{constructor(...t){super(...t),this._parallelism=2,this._runningTasks=[],this.canRunAcrossTaskTypes=!1}get isEmpty(){return super.isEmpty&&this._runningTasks.length<=0}get parallelism(){return this._parallelism}get runningTasks(){return this._runningTasks}set parallelism(t){const e=Math.max(t,1);this._parallelism=e}_runNextItem(){const t=()=>{this.isRunning=!1,this.emit("stopped")};let e=this.parallelism-this.runningTasks.length;if(!(e<=0))if(0!==this.runningTasks.length||0!==this.tasks.length)for(;e>0;){if(!this.canRunAcrossTaskTypes&&this.runningTasks.length>0&&this.tasks.length>0){if(this.runningTasks[0].type!==this.tasks[0].type)return}e-=1;const r=this.retrieveNextItem();if(!r)return void t();this.runningTasks.push(r),r.execute().then(()=>{this.runningTasks.splice(this.runningTasks.indexOf(r),1),this._runNextItem()})}else t()}}},function(t,e,r){(function(e,n){var o=r(40),i=r(41).Stream,s=r(16),a=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;function u(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,r,n,i){throw new o.AssertionError({message:s.format("%s (%s) is required",t,e),actual:void 0===i?typeof n:i(n),expected:e,operator:r||"===",stackStartFunction:c.caller})}function f(t){return Object.prototype.toString.call(t).slice(8,-1)}function l(){}var h={bool:{check:function(t){return"boolean"==typeof t}},func:{check:function(t){return"function"==typeof t}},string:{check:function(t){return"string"==typeof t}},object:{check:function(t){return"object"==typeof t&&null!==t}},number:{check:function(t){return"number"==typeof t&&!isNaN(t)}},finite:{check:function(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}},buffer:{check:function(t){return e.isBuffer(t)},operator:"Buffer.isBuffer"},array:{check:function(t){return Array.isArray(t)},operator:"Array.isArray"},stream:{check:function(t){return t instanceof i},operator:"instanceof",actual:f},date:{check:function(t){return t instanceof Date},operator:"instanceof",actual:f},regexp:{check:function(t){return t instanceof RegExp},operator:"instanceof",actual:f},uuid:{check:function(t){return"string"==typeof t&&a.test(t)},operator:"isUUID"}};t.exports=function t(e){var r,i=Object.keys(h);return r=n.env.NODE_NDEBUG?l:function(t,e){t||c(e,"true",t)},i.forEach((function(t){if(e)r[t]=l;else{var n=h[t];r[t]=function(e,r){n.check(e)||c(r,t,n.operator,e,n.actual)}}})),i.forEach((function(t){var n="optional"+u(t);if(e)r[n]=l;else{var o=h[t];r[n]=function(e,r){null!=e&&(o.check(e)||c(r,t,o.operator,e,o.actual))}}})),i.forEach((function(t){var n="arrayOf"+u(t);if(e)r[n]=l;else{var o=h[t],i="["+t+"]";r[n]=function(t,e){var r;for(Array.isArray(t)||c(e,i,o.operator,t,o.actual),r=0;r<t.length;r++)o.check(t[r])||c(e,i,o.operator,t,o.actual)}}})),i.forEach((function(t){var n="optionalArrayOf"+u(t);if(e)r[n]=l;else{var o=h[t],i="["+t+"]";r[n]=function(t,e){var r;if(null!=t)for(Array.isArray(t)||c(e,i,o.operator,t,o.actual),r=0;r<t.length;r++)o.check(t[r])||c(e,i,o.operator,t,o.actual)}}})),Object.keys(o).forEach((function(t){r[t]="AssertionError"!==t&&e?l:o[t]})),r._setExports=t,r}(n.env.NODE_NDEBUG)}).call(this,r(15).Buffer,r(21))},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),s=n[0],a=n[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,u[f++]=255&e);1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],s=0,a=r-o;s<a;s+=16383)i.push(f(t,s,s+16383>a?a:s+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,s=[],a=e;a<r;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";
32/*
33object-assign
34(c) Sindre Sorhus
35@license MIT
36*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,a,u=s(t),c=1;c<arguments.length;c++){for(var f in r=Object(arguments[c]))o.call(r,f)&&(u[f]=r[f]);if(n){a=n(r);for(var l=0;l<a.length;l++)i.call(r,a[l])&&(u[a[l]]=r[a[l]])}}return u}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){(function(t){var n=r(40),o=r(16);function i(t){var e,r,i,a,f,l,h,p,d,g,y,m=["([^%]*)","%","(['\\-+ #0]*?)","([1-9]\\d*)?","(\\.([1-9]\\d*))?","[lhjztL]*?","([diouxXfFeEgGaAcCsSp%jr])"].join(""),v=new RegExp(m),b=Array.prototype.slice.call(arguments,1),w=t,_="",E=1,A=0;for(n.equal("string",typeof w,"first argument must be a format string");null!==(d=v.exec(w));)if(_+=d[1],w=w.substring(d[0].length),y=d[0].substring(d[1].length),g=A+d[1].length+1,A+=d[0].length,e=d[2]||"",r=d[3]||0,i=d[4]||"",f=!1,h=!1,l=" ","%"!=(a=d[6])){if(0===b.length)throw s(t,g,y,"has no matching argument (too few arguments passed)");if(p=b.shift(),E++,e.match(/[\' #]/))throw s(t,g,y,"uses unsupported flags");if(i.length>0)throw s(t,g,y,"uses non-zero precision (not supported)");switch(e.match(/-/)&&(f=!0),e.match(/0/)&&(l="0"),e.match(/\+/)&&(h=!0),a){case"s":if(null==p)throw s(t,g,y,"attempted to print undefined or null as a string (argument "+E+" to sprintf)");_+=u(l,r,f,p.toString());break;case"d":p=Math.floor(p);case"f":_+=(h=h&&p>0?"+":"")+u(l,r,f,p.toString());break;case"x":_+=u(l,r,f,p.toString(16));break;case"j":0===r&&(r=10),_+=o.inspect(p,!1,r);break;case"r":_+=c(p);break;default:throw s(t,g,y,"is not supported")}}else _+="%";return _+=w}function s(t,e,r,o){return n.equal(typeof t,"string"),n.equal(typeof r,"string"),n.equal(typeof e,"number"),n.equal(typeof o,"string"),new Error('format string "'+t+'": conversion specifier "'+r+'" at character '+e+" "+o)}function a(t){var e=Array.prototype.slice.call(arguments,1);return t.write(i.apply(this,e))}function u(t,e,r,n){for(var o=n;o.length<e;)r?o+=t:o=t+o;return o}function c(t){var e;if(!(t instanceof Error))throw new Error(i("invalid type for %%r: %j",t));if(e="EXCEPTION: "+t.constructor.name+": "+t.stack,t.cause&&"function"==typeof t.cause){var r=t.cause();r&&(e+="\nCaused by: "+c(r))}return e}e.sprintf=i,e.printf=function(){var e=Array.prototype.slice.call(arguments);e.unshift(t.stdout),a.apply(null,e)},e.fprintf=a}).call(this,r(21))},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(15).Buffer)},function(t,e,r){function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const o=r(9),{getSharedAppEnv:i}=r(10);function s(){throw new Error("Not implemented")}class a extends o{static encodeRaw(){s()}static extractSharesFromHistory(){s()}static isEncrypted(){s()}static parseEncrypted(){s()}static prepareHistoryForMerge(){s()}get readOnly(){return this._readOnly}constructor(t={}){super(),n(this,"dirty",!1),n(this,"history",[]),n(this,"_readOnly",!1),n(this,"source",null),this.source=t}clear(){if(this.history=[],this.source)for(const t in this.source)delete this.source[t]}cloneEntry(){s()}cloneGroup(){s()}createEntry(){s()}createGroup(){s()}deleteEntry(){s()}deleteEntryAttribute(){s()}deleteEntryProperty(){s()}deleteGroup(){s()}deleteGroupAttribute(){s()}deleteVaultAttribute(){s()}erase(){Object.keys(this.source).forEach(t=>{this.source[t]=void 0,delete this.source[t]}),this.history.splice(0,1/0)}execute(){s()}generateID(){s()}getFormat(){return a}initialise(){s()}moveEntry(){s()}moveGroup(){s()}optimise(){s()}setEntryAttribute(){s()}setEntryProperty(){s()}setGroupAttribute(){s()}setGroupTitle(){s()}setVaultAttribute(){s()}}t.exports=a},function(t,e,r){const{findEntryByID:n,findGroupByID:o,findGroupContainingEntryID:i,findGroupContainingGroupID:s}=r(22),{generateEntryHistoryItem:a}=r(23);t.exports={executeArchiveID:function(t,e,r){if(!e.shareID){if(t.id)throw new Error("Vault ID already set");t.id=r}},executeComment:function(){},executeCreateEntry:function(t,e,r,n){t.groups=t.groups||[];const i={id:n,properties:{title:""},shareID:e.shareID};e.permissions&&(i.permissions=e.permissions);const s=o(t.groups,r);if(!s)throw new Error("Invalid group ID: "+r);s.entries=s.entries||[],s.entries.push(i)},executeCreateGroup:function(t,e,r,n){t.groups=t.groups||[];const i={id:n,title:"New group",shareID:e.shareID};if(e.permissions&&(i.permissions=e.permissions),"0"===r)t.groups.push(i);else{const e=o(t.groups,r);if(!e)throw new Error("Invalid parent group ID: "+r);e.groups=e.groups||[],e.groups.push(i)}},executeDeleteArchiveAttribute:function(t,e,r){const n=t.attributes||{};if(!0!==n.hasOwnProperty(r))throw new Error("Vault contains no such attribute: "+r);if(!delete n[r])throw new Error("Failed deleting attribute: "+r)},executeDeleteEntry:function(t,e,r){t.groups=t.groups||[];const{group:n,index:o}=i(t.groups,r);if(!n)throw new Error("Failed deleting entry: Invalid entry ID: "+r);n.entries.splice(o,1)},executeDeleteEntryAttribute:function(t,e,r,o){t.groups=t.groups||[];const i=n(t.groups,r);if(!i)throw new Error("Entry not found for ID");i.attributes=i.attributes||{};const s=i.attributes[o];if(!delete i.attributes[o])throw new Error("Failed deleting attribute");i.history=i.history||[],i.history.push(a(o,"attribute",s,null))},executeDeleteEntryProperty:function(t,e,r,o){t.groups=t.groups||[];const i=n(t.groups,r);if(!i)throw new Error("Entry not found for ID: "+r);i.properties=i.properties||{};const s=i.properties[o];if(!delete i.properties[o])throw new Error("Failed deleting property: "+o);i.history=i.history||[],i.history.push(a(o,"property",s,null))},executeDeleteGroup:function(t,e,r){t.groups=t.groups||[];const{group:n,index:o}=s(t,r);if(!n)throw new Error("Invalid group ID: "+r);n.groups.splice(o,1)},executeDeleteGroupAttribute:function(t,e,r,n){t.groups=t.groups||[];const i=o(t.groups,r);if(!i)throw new Error("Group not found for ID: "+r);if(i.attributes=i.attributes||{},!delete i.attributes[n])throw new Error("Failed deleting attribute: "+n)},executeFormat:function(t,e,r){if(!e.shareID){if(t.format)throw new Error("Format already set");t.format=r}},executeMoveEntry:function(t,e,r,n){t.groups=t.groups||[];const{group:s,index:a}=i(t.groups,r);if(!s)throw new Error("Invalid entry ID: "+r);const u=o(t.groups,n);if(!u)throw new Error("Invalid group ID");const[c]=s.entries.splice(a,1);u.entries=u.entries||[],u.entries.push(c)},executeMoveGroup:function(t,e,r,n){t.groups=t.groups||[];const{group:i,index:a}=s(t,r);if(!i)throw new Error("Invalid group ID: "+r);const u=1===n.length&&0===parseInt(n,10)?t:o(t.groups,n);if(!u)throw new Error("Invalid target group ID: "+n);const[c]=i.groups.splice(a,1);u.groups=u.groups||[],u.groups.push(c)},executePad:function(){},executeSetArchiveAttribute:function(t,e,r,n){t.attributes=t.attributes||{},t.attributes[r]=n},executeSetEntryAttribute:function(t,e,r,o,i){t.groups=t.groups||[];const s=n(t.groups,r);if(!s)throw new Error("Entry not found for ID: "+r);s.attributes=s.attributes||{};const u="string"==typeof s.attributes[o]?s.attributes[o]:null;s.attributes[o]=i,s.history=s.history||[],s.history.push(a(o,"attribute",u,i))},executeSetEntryProperty:function(t,e,r,o,i){t.groups=t.groups||[];const s=n(t.groups,r);if(!s)throw new Error("Entry not found for ID: "+r);s.properties=s.properties||{};const u="string"==typeof s.properties[o]?s.properties[o]:null;s.properties[o]=i,s.history=s.history||[],s.history.push(a(o,"property",u,i))},executeSetGroupAttribute:function(t,e,r,n,i){t.groups=t.groups||[];const s=o(t.groups,r);if(!s)throw new Error("Group not found for ID: "+r);s.attributes=s.attributes||{},s.attributes[n]=i},executeTitleGroup:function(t,e,r,n){t.groups=t.groups||[];const i=o(t.groups,r);if(!i)throw new Error("Group not found for ID: "+r);i.title=n}}},function(t,e,r){function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const{describeVaultDataset:o}=r(45),i=r(43);function s(t){const e=t.substr(0,3);return["cmm"].indexOf(e)>=0}class a{constructor(t){this.format=t}canBeFlattened(){return this.format.history.length>=FLATTENING_MIN_LINES}flatten(t=!1){const e=this.format.history,r=[],n=new i;let a,u=e.length-PRESERVE_LINES;if(u<=0||!this.canBeFlattened()){if(!t)return!1;u=e.length}for(let t=0;t<u;t+=1)a=e[t],s(a)&&r.push(a),n.execute(a);const c=o(n.source),f=[...r,...c,...e.slice(u)];return this.format.clear(),this.format.execute(f),!0}}n(a,"FLATTENING_MIN_LINES",6e3),n(a,"PRESERVE_LINES",5e3),t.exports=a},function(t,e){function r(t){return 0===t.indexOf("b~>buttercup/a")}function n(t){const e="b~>buttercup/a".length;return t.substr(e,t.length-e)}t.exports={getFormat:function(){return"buttercup/a"},getSignature:function(){return"b~>buttercup/a"},hasValidSignature:r,sign:function(t){return r(t)?t:"b~>buttercup/a"+t},stripSignature:n,vaultContentsEncrypted:function(t){if("string"==typeof t&&r(t)){const e=n(t);return!1===/["\s\t\n~]/.test(e)}return!1}}},function(t,e){t.exports={PERM_MANAGE:"archive/member/manage",PERM_READ:"archive/member/read",PERM_WRITE:"archive/member/write"}},function(t,e){t.exports={objectValues:function(t){return Object.keys(t).map(e=>t[e])}}},function(t,e){function r(t,e){const r="bcup_archivecache_"+e;return t.getValue(r)}t.exports={getSourceOfflineArchive:r,sourceHasOfflineCopy:function(t,e){return r(t,e).then(t=>!!t&&t.length>0)},storeSourceOfflineCopy:function(t,e,r){const n="bcup_archivecache_"+e;return t.setValue(n,r)}}},function(t,e,r){const{detectFormat:n}=r(17),o=r(11),i=r(101);t.exports={initialiseShares:function(t){const{archive:e,datasource:r}=t;if("mybuttercup"!==r.toObject().type)return Promise.resolve();const{client:s}=r,a=e.getAttribute(),u=Object.keys(a).filter(t=>0===t.indexOf("BC_SHARE:")).reduce((t,e)=>[...t,{id:e.replace("BC_SHARE:",""),password:a[e]}],[]).filter(e=>!t.shares.find(t=>t.id===e.id));return u.length<=0?Promise.resolve():s.fetchShares(u.map(t=>t.id)).then(t=>t.map(t=>Object.assign(t,{password:u.find(e=>e.id===t.id).password}))).then(t=>Promise.all(t.map(t=>{return(e=t.contents,r=t.password,n(e).parseEncrypted(e,o.fromPassword(r))).then(e=>Object.assign(t,{history:e})).then(t=>{delete t.contents;const e=["perm_read","perm_write","perm_manage"].filter(e=>!0===t[e]);return new i(t.id,t.history,e)});var e,r})))}}},function(t,e,r){const{mergeHistories:n,prependSharePrefix:o,removeSharePrefix:i}=r(50),{hashHistory:s}=r(102);t.exports=class{constructor(t,e,r=[]){this._id=t,this._history=i(e),this._lastHash=s(this._history),this._dirty=!1,this._permissions=r}get id(){return this._id}get permissions(){return[...this._permissions]}applyToArchive(t){if(this.archiveHasAppliedShare(t))throw new Error("Target archive has already had share applied");const e=t._getWestley();e.executionOptions={permissions:this.permissions},this.getPrefixedHistory().forEach(t=>e.execute(t)),e.executionOptions={}}archiveHasAppliedShare(t){return!!t._getWestley().history.find(t=>0===t.indexOf("$"+this.id))}getPrefixedHistory(){return o(this._history,this.id)}updateHistory(t){const e=i(t);return s(e)!==this._lastHash&&(this._history=n(this._history,e),this._lastHash=s(this._history),this._dirty=!0,!0)}}},function(t,e,r){r(51)},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";e.sha1=r(105),e.sha224=r(106),e.sha256=r(53),e.sha384=r(107),e.sha512=r(54)},function(t,e,r){"use strict";var n=r(1),o=r(13),i=r(52),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=i.ft_1,f=o.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,f),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],f=this.h[2],h=this.h[3],p=this.h[4];for(n=0;n<r.length;n++){var d=~~(n/20),g=u(s(o,5),c(d,i,f,h),p,r[n],l[d]);p=h,h=f,f=s(i,30),i=o,o=g}this.h[0]=a(this.h[0],o),this.h[1]=a(this.h[1],i),this.h[2]=a(this.h[2],f),this.h[3]=a(this.h[3],h),this.h[4]=a(this.h[4],p)},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(1),o=r(53);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,o),t.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var n=r(1),o=r(54);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,o),t.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var n=r(1),o=r(13),i=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=o.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function p(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(f,c),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],o=this.h[2],c=this.h[3],f=this.h[4],v=r,b=n,w=o,_=c,E=f,A=0;A<80;A++){var x=s(i(u(r,l(A,n,o,c),t[d[A]+e],h(A)),y[A]),f);r=f,f=c,c=i(o,10),o=n,n=x,x=s(i(u(v,l(79-A,b,w,_),t[g[A]+e],p(A)),m[A]),E),v=E,E=_,_=i(w,10),w=b,b=x}x=a(this.h[1],o,_),this.h[1]=a(this.h[2],c,E),this.h[2]=a(this.h[3],f,v),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],n,w),this.h[0]=x},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var n=r(1),o=r(12);function i(t,e,r){if(!(this instanceof i))return new i(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=i,i.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),o(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},i.prototype.update=function(t,e){return this.inner.update(t,e),this},i.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e,r){const{createFieldDescriptor:n,getEntryValue:o}=r(18),{ENTRY_TYPE_CREDITCARD:i,ENTRY_TYPE_LOGIN:s,ENTRY_TYPE_NOTE:a,ENTRY_TYPE_SSHKEY:u,ENTRY_TYPE_WEBSITE:c,FIELD_VALUE_TYPE_NOTE:f,FIELD_VALUE_TYPE_PASSWORD:l}=r(14);function h(t){return[n(t,"Title","property","title")]}function p(t){return[...h(t),n(t,"Username","property","username"),n(t,"Password","property","password",{valueType:l})]}t.exports={[i]:function(t){return[...h(t),n(t,"Card Holder","property","username"),n(t,"Card Number","property","password",{formatting:{format:[{char:"\\d",repeat:4},{exactly:"-"},{char:"\\d",repeat:4},{exactly:"-"},{char:"\\d",repeat:4},{exactly:"-"},{char:"\\d",repeat:4}],placeholder:"DDDD-DDDD-DDDD-DDDD"}}),n(t,"Card Type","property","type",{formatting:{options:{visa:"Visa",mastercard:"Mastercard",amex:"American Express",discover:"Discover",generic:"Generic"},defaultOption:"generic"}}),n(t,"CVV","property","cvv",{formatting:{format:[{char:"\\d",repeat:4}],placeholder:"DDD or DDDD"},valueType:l}),n(t,"Valid From","property","valid_from",{formatting:{format:[{char:"[01]",repeat:1},{char:"\\d",repeat:1},{exactly:"/"},{char:"2",repeat:1},{char:"\\d",repeat:3}],placeholder:"MM/YYYY"},valueType:l}),n(t,"Expiry","property","expiry",{formatting:{format:[{char:"[01]",repeat:1},{char:"\\d",repeat:1},{exactly:"/"},{char:"2",repeat:1},{char:"\\d",repeat:3}],placeholder:"MM/YYYY"},valueType:l})]},[s]:p,[a]:function(t){return[...h(t),n(t,"Note","property","note",{valueType:f})]},[u]:function(t){return[...h(t),n(t,"Public key","property","publicKey"),n(t,"Private key","property","privateKey",{valueType:f})]},[c]:function(t){return[...p(t),n(t,"URL","property","url")]}}},function(t,e){t.exports={generateVaultInsights:function(t){let e=0,r=0,n=0,o=0,i=null,s=null;const a=[],u=t=>{const n=t.getEntries();e+=1,r+=n.length,n.forEach(t=>{const e=t.getProperty("password");"string"==typeof e&&(a.push(e.length),(null===i||e.length>i)&&(i=e.length),(null===s||e.length<s)&&(s=e.length))}),t.getGroups().forEach(t=>u(t))};t.getGroups().forEach(t=>u(t));const c=a.reduce((t,e)=>t+e,0)/a.length,f=t.getTrashGroup();if(f){const t=e=>{const r=e.getGroups();o+=r.length,r.forEach(e=>t(e)),n+=e.getEntries().length};t(f)}return{avgPassLen:c,entries:r,groups:e,longPassLen:i,shortPassLen:s,trashEntries:n,trashGroups:o}}}},function(t,e,r){const n=r(41),o=r(113),i=r(6),{fireInstantiationHandlers:s,registerDatasource:a}=r(2),{getCredentials:u}=r(0);class c extends i{constructor(t){super(t);const{data:e}=u(t.id),{datasource:r}=e,{path:i}=r;this._filename=i,this.readFile=o(n.readFile),this.writeFile=o(n.writeFile),this.type="file",s("file",this)}get path(){return this._filename}load(t){return this.hasContent?super.load(t):this.readFile(this.path,"utf8").then(e=>(this.setContent(e),super.load(t)))}save(t,e){return super.save(t,e).then(t=>this.writeFile(this.path,t))}supportsRemoteBypass(){return!0}}a("file",c),t.exports=c},function(t,e,r){"use strict";const n=(t,e)=>function(...r){return new(0,e.promiseModule)((n,o)=>{e.multiArgs?r.push((...t)=>{e.errorFirst?t[0]?o(t):(t.shift(),n(t)):n(t)}):e.errorFirst?r.push((t,e)=>{t?o(t):n(e)}):r.push(n),t.apply(this,r)})};t.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=typeof t;if(null===t||"object"!==r&&"function"!==r)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":r}\``);const o=t=>{const r=e=>"string"==typeof e?t===e:e.test(t);return e.include?e.include.some(r):!e.exclude.some(r)};let i;i="function"===r?function(...r){return e.excludeMain?t(...r):n(t,e).apply(this,r)}:Object.create(Object.getPrototypeOf(t));for(const r in t){const s=t[r];i[r]="function"==typeof s&&o(r)?n(s,e):s}return i}},function(t,e,r){const n=r(6),{fireInstantiationHandlers:o,registerDatasource:i}=r(2),{getSharedAppEnv:s}=r(10),{getCredentials:a}=r(0);class u extends n{constructor(t){super(t);const{data:e}=a(t.id),{datasource:r}=e,{endpoint:n,password:i,path:u,username:c}=r;this._path=u;const f=s().getProperty("net/webdav/v1/newClient");this._client="string"==typeof c&&"string"==typeof i?f(n,{username:c,password:i}):f(n),this.type="webdav",o("webdav",this)}get client(){return this._client}get path(){return this._path}load(t){return this.hasContent?super.load(t):this.client.getFileContents(this.path,{format:"text"}).then(e=>(this.setContent(e),super.load(t)))}save(t,e){return super.save(t,e).then(t=>this.client.putFileContents(this.path,t))}supportsRemoteBypass(){return!0}}i("webdav",u),t.exports=u},function(t,e,r){const{createClient:n}=r(116),o=r(6),{fireInstantiationHandlers:i,registerDatasource:s}=r(2),{getCredentials:a}=r(0);class u extends o{constructor(t){super(t);const{data:e}=a(t.id),{datasource:r}=e,{token:o,path:s}=r;this.path=s,this.token=o,this.client=n(o),this.type="dropbox",i("dropbox",this)}load(t){return this.hasContent?super.load(t):this.client.getFileContents(this.path).then(e=>(this.setContent(e),super.load(t)))}save(t,e){return super.save(t,e).then(t=>this.client.putFileContents(this.path,t))}supportsRemoteBypass(){return!0}}s("dropbox",u),t.exports=u},function(t,e,r){const n=r(60),{request:o}=r(118),{deleteFile:i,getDirectoryContents:s,getFileContents:a,putFileContents:u}=r(126),{createFsInterface:c}=r(128);t.exports={createClient:function(t){const e=new n;return e.patch("request",o),{request:o,patcher:e,deleteFile:r=>i(r,t,e),getDirectoryContents:r=>s(r,t,e),getFileContents:r=>a(r,t,e),putFileContents:(r,n)=>u(r,n,t,e)}},createFsInterface:c}},function(t,e){t.exports={sequence:function(...t){if(0===t.length)throw new Error("Failed creating sequence: No functions provided");return function(...e){let r=e;const n=this;for(;t.length>0;){r=[t.shift().apply(n,r)]}return r[0]}}}},function(t,e,r){const{request:n}=r(119);t.exports={request:n}},function(t,e,r){const n=r(26),{parse:o}=r(27),i=r(28),s=r(7).default,a=r(29),{createNewRequest:u}=r(123),{ERR_ABORTED:c,ERR_REQUEST_FAILED:f}=r(124),{STATUSES:l}=r(125),h=/^application\/octet/,p=/^application\/json/,d={body:null,factory:u,headers:{},method:"GET",query:null,responseType:"auto",url:null},g=/application\/json/;function y(t,e){const{responseType:i}=e;return Promise.resolve().then((function e(u=i){switch(u.toLowerCase()){case"auto":return e(function(t){const e=n(o(t.getAllResponseHeaders())).get("content-type");return h.test(e)?s?"arraybuffer":"buffer":p.test(e)?"json":"text"}(t));case"arraybuffer":case"buffer":return t.response&&a(t.response)?(c=t.response,r(31)(c)):t.response;case"json":return t.response&&"object"==typeof t.response?t.response:JSON.parse(t.responseText);case"text":default:return t.responseText}var c})).then(r=>({url:t.responseURL,method:e.method,headers:o(t.getAllResponseHeaders()),data:r,status:t.status,statusText:l[t.status]}))}t.exports={request:function(t){const e="string"==typeof t?{url:t}:t,r=Object.assign({},d,"object"==typeof e?e:{}),{body:a,factory:u,headers:l,method:h,query:m,responseType:v,url:b,withCredentials:w}=r,_=function(t,e){if(e){const r=i.stringify(e);return r?`${t}?${r}`:t}return t}(b,m),E={},A=n(E);Object.keys(l).forEach(t=>{A.set(t,l[t])}),function(t,e){const{body:r}=t;r&&"object"==typeof r&&!e.get("content-type")&&e.set("Content-Type","application/json")}(r,A);const x=u();return new Promise((function(t,e){const n=()=>{const t=x.response&&!g.test(x.getResponseHeader("Content-Type"))?`Request failed: ${x.status} ${x.statusText}: ${x.response}`:`Request failed: ${x.status} ${x.statusText}`,r=new Error(t);r.status=x.status,r.statusText=x.statusText,r.code=f,r.responseHeaders=o(x.getAllResponseHeaders()),r.responseBody=x.response,e(r)};switch(x.addEventListener("load",()=>{if(x.status<200||x.status>=400)return n();t(y(x,r))}),x.addEventListener("error",()=>{n()}),x.addEventListener("abort",()=>{const t=new Error("Request failed: The request was aborted");t.status="",t.statusCode=0,t.code=c,e(t)}),x.open(h,_),"boolean"==typeof w&&(x.withCredentials=w),Object.keys(E).forEach(t=>{x.setRequestHeader(t,E[t])}),v){case"auto":break;case"buffer":x.responseType=s?"arraybuffer":"buffer";break;default:v&&(x.responseType=v)}null!==a?x.send(function(t,e){return"string"==typeof t?t:p.test(e.get("content-type"))?JSON.stringify(t||{}):t&&"object"==typeof t&&!e.get("content-type")?JSON.stringify(t):t}(a,A)):x.send()}))}}},function(t,e,r){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())},function(t,e,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],i(r),i(n))}function s(t){try{return decodeURIComponent(t)}catch(o){for(var e=t.match(n),r=1;r<e.length;r++)e=(t=i(e,r).join("")).match(n);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=s(r[0]);n!==r[0]&&(e[r[0]]=n)}r=o.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),a=0;a<i.length;a++){var u=i[a];t=t.replace(new RegExp(u,"g"),e[u])}return t}(t)}}},function(t,e,r){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},function(t,e,r){const n=r(7).default;t.exports={createNewRequest:function(){if(!n){return new(r(30))}return new XMLHttpRequest}}},function(t,e){t.exports={ERR_ABORTED:50,ERR_REQUEST_FAILED:51}},function(t,e){const r={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range not Satisfiable",417:"Expectation Failed",418:'I"m a teapot',421:"Misdirected Request",422:"Unprocessable Entity",426:"Locked",428:"Failed Dependency",423:"Upgrade Required",424:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};t.exports={STATUSES:r}},function(t,e,r){const{convertDirectoryResult:n,urlSafeJSONStringify:o}=r(127);t.exports={deleteFile:function(t,e,r){const n={method:"POST",url:"https://api.dropboxapi.com/2/files/delete_v2",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:{path:t}};return r.execute("request",n).then(()=>{})},getDirectoryContents:function(t,e,r){const o={method:"POST",url:"https://api.dropboxapi.com/2/files/list_folder",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:{path:"/"===t?"":t,recursive:!1,limit:2e3,include_media_info:!1,include_deleted:!1,include_has_explicit_shared_members:!1,include_mounted_folders:!0}};return r.execute("request",o).then(t=>{const{entries:e}=t.data;return e.map(n)})},getFileContents:function(t,e,r){const n={method:"POST",url:"https://content.dropboxapi.com/2/files/download",headers:{Authorization:"Bearer "+e,"Content-Type":"text/plain","Dropbox-API-Arg":o({path:t})}};return r.execute("request",n).then(t=>t.data)},putFileContents:function(t,e,r,n){const o={method:"POST",url:"https://content.dropboxapi.com/2/files/upload",query:{arg:JSON.stringify({path:t,mode:"overwrite"}),authorization:"Bearer "+r,reject_cors_preflight:"true"},headers:{"Content-Type":"application/octet-stream"},body:e};return n.execute("request",o).then(()=>{})}}},function(t,e){t.exports={convertDirectoryResult:function(t){const e=t[".tag"];if(!0!==/^(file|folder)$/.test(e))throw new Error("Unrecognised item type: "+e);const r="folder"===e?"directory":"file";return{name:t.name,path:t.path_display,type:r,id:t.id,size:t.size||0}},urlSafeJSONStringify:function(t){return JSON.stringify(t).replace(/[\u007f-\uffff]/g,t=>"\\u"+("000"+t.charCodeAt(0).toString(16)).slice(-4))}}},function(t,e){t.exports={createFsInterface:function(t){return{readdir:(e,r={},n)=>{let o=n,i=r;"function"==typeof r&&(o=r,i={});const s=i.mode||"node";t.getDirectoryContents(e).then(t=>{if(!1===/^(node|stat)$/.test(s))throw new Error("Invalid mode: "+s);o(null,t.map(t=>"node"===s?t.name:Object.assign(t,{isFile:()=>"file"===t.type,isDirectory:()=>"directory"===t.type})))}).catch(o)},readFile:(e,r={},n)=>{let o=n;"function"==typeof r&&(o=r),t.getFileContents(e).then(t=>o(null,t)).catch(o)},writeFile:(e,r,n={},o)=>{let i=o;"function"==typeof n&&(i=n),t.putFileContents(e,r).then(()=>i()).catch(i)},unlink:(e,r)=>{t.deleteFile(e).then(r,r)}}}}},function(t,e,r){const{createClient:n}=r(130),o=r(3),i=r(62),s=r(6),{fireInstantiationHandlers:a,registerDatasource:u}=r(2),{getCredentials:c,setCredentials:f}=r(0);class l extends s{constructor(t){super(t);const{data:e}=c(t.id),{datasource:r}=e,{token:n,refreshToken:o,fileID:s}=r;this.fileID=s,this.updateTokens(n,o),this.authManager=i.getSharedManager(),this.type="googledrive",a("googledrive",this)}load(t,e=!1){return this.hasContent?super.load(t):this.client.getFileContents(this.fileID).then(e=>(this.setContent(e),super.load(t))).catch(r=>{const{authFailure:n=!1}=o.info(r);if(!n)throw new o(r,"Failed fetching Google Drive vault");if(e)throw new o(r,"Re-authentication failed");return this.authManager.executeAuthHandlers("googledrive",this).then(()=>this.load(t,!0)).catch(t=>{throw new o(t,"Failed fetching Google Drive vault")})})}save(t,e,r=!1){return super.save(t,e).then(t=>this.client.putFileContents({id:this.fileID,contents:t})).catch(n=>{const{authFailure:i=!1}=o.info(n);if(!i)throw new o(n,"Failed saving Google Drive vault");if(r)throw new o(n,"Re-authentication failed");return this.authManager.executeAuthHandlers("googledrive",this).then(()=>this.save(t,e,!0)).catch(t=>{throw new o(t,"Failed saving Google Drive vault")})})}supportsRemoteBypass(){return!0}updateTokens(t,e){this.token=t,this.refreshToken=e,this.client=n(t);const r=c(this._credentials.id);Object.assign(r.datasource,{token:t,refreshToken:e}),f(this._credentials.id,r),this.emit("updated")}}u("googledrive",l),t.exports=l},function(t,e,r){const n=r(60),{request:o}=r(131),{getDirectoryContents:i,mapDirectoryContents:s}=r(137),{deleteFile:a,getFileContents:u,putFileContents:c}=r(138);t.exports={createClient:function(t){const e=new n;e.patch("request",o);const r={request:o,patcher:e,deleteFile:r=>a(t,e,r),getDirectoryContents:({tree:r=!0}={})=>i(t,e,{formTree:r}),getFileContents:r=>u(t,e,r),mapDirectoryContents:n=>s(t,e,r,n),putFileContents:({id:r,name:n,parent:o,contents:i}={})=>c(t,e,{id:r,contents:i,name:n,parentID:o})};return r}}},function(t,e,r){const{request:n}=r(132);t.exports={request:n}},function(t,e,r){const n=r(26),o=r(28),i=r(7).default,s=r(29),{createNewRequest:a}=r(133),{parseHeaders:u}=r(134),{ERR_ABORTED:c,ERR_REQUEST_FAILED:f}=r(135),{STATUSES:l}=r(136),h=/^application\/octet/,p=/^application\/json/,d={body:null,factory:a,headers:{},method:"GET",query:null,responseType:"auto",url:null},g=/application\/json/;function y(t,e){const{responseType:o}=e;return Promise.resolve().then((function e(a=o){switch(a.toLowerCase()){case"auto":return e(function(t){const e=n(u(t.getAllResponseHeaders())).get("content-type");return h.test(e)?i?"arraybuffer":"buffer":p.test(e)?"json":"text"}(t));case"arraybuffer":case"buffer":return t.response&&s(t.response)?(c=t.response,r(31)(c)):t.response;case"json":return t.response&&"object"==typeof t.response?t.response:JSON.parse(t.responseText);case"text":default:return t.responseText}var c})).then(r=>({url:t.responseURL,method:e.method,headers:u(t.getAllResponseHeaders()),data:r,status:t.status,statusText:l[t.status]}))}t.exports={request:function(t){const e="string"==typeof t?{url:t}:t,r=Object.assign({},d,"object"==typeof e?e:{}),{body:s,factory:a,headers:l,method:h,query:m,responseType:v,url:b,withCredentials:w}=r,_=function(t,e){if(e){const r=o.stringify(e);return r?`${t}?${r}`:t}return t}(b,m),E={},A=n(E);Object.keys(l).forEach(t=>{A.set(t,l[t])}),function(t,e){const{body:r}=t;r&&"object"==typeof r&&!e.get("content-type")&&e.set("Content-Type","application/json")}(r,A);const x=a();return new Promise((function(t,e){const n=()=>{const t=x.response&&!g.test(x.getResponseHeader("Content-Type"))?`Request failed: ${x.status} ${x.statusText}: ${x.response}`:`Request failed: ${x.status} ${x.statusText}`,r=new Error(t);r.status=x.status,r.statusText=x.statusText,r.code=f,r.responseHeaders=u(x.getAllResponseHeaders()),r.responseBody=x.response,e(r)};switch(x.addEventListener("load",()=>{if(x.status<200||x.status>=400)return n();t(y(x,r))}),x.addEventListener("error",()=>{n()}),x.addEventListener("abort",()=>{const t=new Error("Request failed: The request was aborted");t.status="",t.statusCode=0,t.code=c,e(t)}),x.open(h,_),"boolean"==typeof w&&(x.withCredentials=w),Object.keys(E).forEach(t=>{x.setRequestHeader(t,E[t])}),v){case"auto":break;case"buffer":x.responseType=i?"arraybuffer":"buffer";break;default:v&&(x.responseType=v)}null!==s?x.send(function(t,e){return"string"==typeof t?t:p.test(e.get("content-type"))?JSON.stringify(t||{}):t&&"object"==typeof t&&!e.get("content-type")?JSON.stringify(t):t}(s,A)):x.send()}))}}},function(t,e,r){const n=r(7).default;t.exports={createNewRequest:function(){if(!n){return new(r(30))}return new XMLHttpRequest}}},function(t,e,r){const{parse:n}=r(27);t.exports={parseHeaders:function(t){const e=n(t);return r=e,Object.keys(r).reduce((t,e)=>Object.assign(t,{[e.toLowerCase()]:r[e]}),{});var r}}},function(t,e){t.exports={ERR_ABORTED:50,ERR_REQUEST_FAILED:51}},function(t,e){const r={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range not Satisfiable",417:"Expectation Failed",418:'I"m a teapot',421:"Misdirected Request",422:"Unprocessable Entity",426:"Locked",428:"Failed Dependency",423:"Upgrade Required",424:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};t.exports={STATUSES:r}},function(t,e,r){const{handleError:n,handleResponse:o}=r(61);function i(t,e,{currentFiles:r=[],nextPageToken:o,formTree:s=!1}={}){const a={url:"https://www.googleapis.com/drive/v3/files",method:"GET",query:{corpora:"user",pageSize:1e3,spaces:"drive",fields:"files(id,name,mimeType,createdTime,modifiedTime,shared,size,parents,trashed),nextPageToken"},headers:{Authorization:"Bearer "+t}};return o&&(a.query.pageToken=o),e.execute("request",a).then(n=>{const o=n.data,a=[...r,...o.files.filter(t=>!t.trashed).map(t=>({id:t.id,filename:t.name,parents:[...t.parents||[]],mime:t.mimeType,type:"application/vnd.google-apps.folder"===t.mimeType?"directory":"file",created:t.createdTime,modified:t.modifiedTime,shared:t.shared,size:t.size?parseInt(t.size,10):0}))];return o.nextPageToken?i(t,e,{currentFiles:a,nextPageToken:o.nextPageToken,formTree:s}):s?function(t){const e=t.map(t=>t.id),r=[];t.forEach(t=>{t.parents.forEach(t=>{-1===e.indexOf(t)&&-1===r.indexOf(t)&&r.push(t)})});const n=e=>({id:e?e.id:null,filename:e?e.filename:null,files:e?t.filter(t=>"file"===t.type&&t.parents.indexOf(e.id)>=0):t.filter(t=>"file"===t.type&&(0===t.parents.length||t.parents.some(t=>r.indexOf(t)>=0))),children:(e?t.filter(t=>"directory"===t.type&&t.parents.indexOf(e.id)>=0):t.filter(t=>"directory"===t.type&&(0===t.parents.length||t.parents.some(t=>r.indexOf(t)>=0)))).map(t=>n(t,e?e.id:null))});return n()}(a):a}).catch(n)}t.exports={getDirectoryContents:i,mapDirectoryContents:function(t,e,r,n){let o;o=!r["@@dirresults"]||Date.now()-r["@@dirresults"].updated>1e4?i(t,e,{formTree:!1}).then(t=>(r["@@dirresults"]?Object.assign(r["@@dirresults"],{cachedContents:t,updated:Date.now()}):Object.defineProperty(r,"@@dirresults",{enumerable:!1,writable:!1,configurable:!1,value:{cachedContents:t,updated:Date.now()}}),t)):Promise.resolve(r["@@dirresults"].cachedContents);const s=(t,e,r=[])=>{const n=t.find(t=>t.id===e),[o]=n.parents,i=t.find(t=>t.id===o);return i?s(t,o,[i.filename,...r]):r};return o.then(t=>t.map(e=>Object.assign(e,{dirPath:"/"+s(t,e.id).join("/")})).filter(t=>{return e=t.dirPath,r=n,e.replace(/\/+$/,"")===r.replace(/\/+$/,"");var e,r}))}}},function(t,e,r){const{handleError:n,handleResponse:o}=r(61),i="--",s="Content-Type: application/json; charset=UTF-8",a="Content-Type: text/plain; charset=UTF-8",u="\r\n";t.exports={deleteFile:function(t,e,r){const o={url:"https://www.googleapis.com/drive/v3/files/"+r,method:"DELETE",headers:{Authorization:"Bearer "+t}};return e.execute("request",o).then(()=>{}).catch(n)},getFileContents:function(t,e,r){const o={url:"https://www.googleapis.com/drive/v3/files/"+r,method:"GET",query:{alt:"media"},headers:{Authorization:"Bearer "+t}};return e.execute("request",o).then(t=>t.data).catch(n)},putFileContents:function(t,e,{parentID:o,id:c,contents:f="",name:l}={}){const h=r(139).Buffer,p="BCUP_DRV_UPL_"+Math.floor(1e6*Math.random()),d=c?"https://www.googleapis.com/upload/drive/v3/files/"+c:"https://www.googleapis.com/upload/drive/v3/files",g=c?"PATCH":"POST",y={};o&&(y.parents=[o]),l&&(y.name=l);const m=JSON.stringify(y),v=[u,i,p,u,s,u,u].join(""),b=[u,i,p,u,a,u,u].join(""),w=[u,i,p,i,u].join(""),_=v.length+m.length+b.length+f.length+w.length,E=[];[v,m,b,f,w].forEach(t=>{for(let e=0;e<t.length;e+=1)E.push(255&t.charCodeAt(e))});const A=h.from(E),x={url:d,method:g,query:{uploadType:"multipart"},headers:{Authorization:"Bearer "+t,"Content-Type":"multipart/related; boundary="+p,"Content-Length":_.toString()},body:A};return e.execute("request",x).then(t=>t.data.id).catch(n)}}},function(t,e,r){var n=r(15),o=n.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return o(t,e,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=s),s.prototype=Object.create(o.prototype),i(o,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=o(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){!function(t){"use strict";var e={},n={};function o(t){function r(e,n,o){var i=t.resolve();return e.forEach((function(s,a){i=i.then((function(){var u;return(u=o?n.call(o,s,a,e):i=n(s,a,e))&&u.then||(u=t.resolve(u)),u.then((function(e){return e===r.__BREAK?t.reject(new Error("break")):e}))}))})),i.catch((function(t){if("break"!==t.message)throw t})),i}return t=t.Promise||t,r.__BREAK=e,r}if("undefined"!=typeof Promise)n.forEachAsync=o(Promise);else try{n.forEachAsync=o(r(141))}catch(t){console.warn("This version of node doesn't support promises. Please `npm install --save bluebird` in your project.")}t.forEachAsync=n.forEachAsync.forEachAsync=n.forEachAsync||function(){throw new Error("You did not supply a Promises/A+ implementation. See the warning above.")},t.forEachAsync.create=o}(e||window)},function(t,e){},function(t,e,r){(function(e){var r;r="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=r}).call(this,r(8))},function(t,e,r){const n=r(3),{fireInstantiationHandlers:o,registerDatasource:i}=r(2),s=r(6),a=(r(11),r(55)),u=r(63),{generateNewUpdateID:c}=r(151),{getCredentials:f}=r(0);class l extends s{constructor(t){super(t);const{data:e}=f(t.id),{datasource:r}=e,{accessToken:n,clientID:i,clientSecret:s,refreshToken:a,vaultID:u}=r;this.accessToken=n,this.refreshToken=a,this._clientID=i,this._clientSecret=s,this._client=null,this._vaultID=u,this._updateID=null,this._createNewClient(),o("mybuttercup",this)}get client(){return this._client}async changePassword(t,e){const{data:{passwordToken:r},masterPassword:n}=f(t.id);if(e)return await this._client.testPasswordChange(r),!0;await this._client.changePassword(n,r)}load(t){return this._client.fetchUserVault().then(({archive:t,updateID:e})=>{this._updateID=e,this.setContent(t)}).catch(t=>{throw new n(t,"Failed retrieving vault contents")}).then(()=>super.load(t))}localDiffersFromRemote(t,e){return this.client.fetchUserVaultDetails().then(({updateID:r})=>r!==this._updateID||(this.setContent(""),this.load(t).then(({Format:t,history:r})=>{const n=a.calculateHistoryDifferences(e,r);return!n||(n.original.length>0||n.secondary.length>0)}))).catch(t=>{throw new n(t,"Failed comparing remote/local vault status")})}save(t,e){const r=c();return super.save(t,e).then(t=>this.client.writeUserArchive(t,this._updateID,r)).then(()=>{this._updateID=r}).catch(t=>{throw new n(t,"Failed uploading new vault contents")})}supportsChangePassword(){return!0}async updateInsights(t){Object.keys(t).length<=0||await this._client.writeInsights(t)}updateTokens(t,e,r=!0){const{data:n}=f(this.credentials.id);n.datasource.accessToken=t,n.datasource.refreshToken=e,this.accessToken=t,this.refreshToken=e,r&&(this._client._accessToken=t,this._client._refreshToken=e),this.emit("updated")}_createNewClient(){this.client&&this.client.off("tokensUpdated",this._onTokensUpdated),this._onTokensUpdated=()=>{this.updateTokens(this.client.accessToken,this.client.refreshToken,!1)},this._client=new u(this._clientID,this._clientSecret,this.accessToken,this.refreshToken),this._client.on("tokensUpdated",this._onTokensUpdated),this.emit("updatedClient",this._client)}}i("mybuttercup",l),t.exports=l},function(t,e,r){const{request:n}=r(145),o=r(64);t.exports={Symbols:o,request:n}},function(t,e,r){const n=r(26),o=r(28),i=r(7).default,s=r(29),{createNewRequest:a}=r(146),{parseHeaders:u}=r(147),{ERR_ABORTED:c,ERR_REQUEST_FAILED:f,ERR_STATUS_INVALID:l}=r(64),{STATUSES:h}=r(148),p=/^application\/octet/,d=/^application\/json/,g={body:null,factory:a,headers:{},method:"GET",query:null,responseType:"auto",url:null},y=/application\/json/;function m(t,e){const{responseType:o}=e;return Promise.resolve().then((function e(a=o){switch(a.toLowerCase()){case"auto":return e(function(t){const e=n(u(t.getAllResponseHeaders())).get("content-type");return p.test(e)?i?"arraybuffer":"buffer":d.test(e)?"json":"text"}(t));case"arraybuffer":case"buffer":return t.response&&s(t.response)?(c=t.response,r(31)(c)):t.response;case"json":return t.response&&"object"==typeof t.response?t.response:JSON.parse(t.responseText);case"text":default:return t.responseText}var c})).then(r=>({url:t.responseURL,method:e.method,headers:u(t.getAllResponseHeaders()),data:r,status:t.status,statusText:h[t.status]}))}function v(t){return t>=200&&t<400}t.exports={request:function(t){const e="string"==typeof t?{url:t}:t,r=Object.assign({},g,"object"==typeof e?e:{}),{body:s,factory:a,headers:h,method:p,nodeJsOptions:b=null,query:w,responseType:_,url:E,validateStatus:A=v,withCredentials:x}=r,T=function(t,e){if(e){const r=o.stringify(e);return r?`${t}?${r}`:t}return t}(E,w),S={},O=n(S);Object.keys(h).forEach(t=>{O.set(t,h[t])}),function(t,e){const{body:r}=t;r&&"object"==typeof r&&!e.get("content-type")&&e.set("Content-Type","application/json")}(r,O);const P=a();return P.nodejsSet&&b&&"object"==typeof b&&P.nodejsSet(b),new Promise((function(t,e){const n=(t=f)=>{const r=P.response&&!y.test(P.getResponseHeader("Content-Type"))?`Request failed: ${P.status} ${P.statusText}: ${P.response}`:`Request failed: ${P.status} ${P.statusText}`,n=new Error(r);n.status=P.status,n.statusText=P.statusText,n.code=t,n.responseHeaders=u(P.getAllResponseHeaders()),n.responseBody=P.response,e(n)};switch(P.addEventListener("load",()=>{if(!A(P.status))return n(l);t(m(P,r))}),P.addEventListener("error",()=>{n()}),P.addEventListener("abort",()=>{const t=new Error("Request failed: The request was aborted");t.status="",t.statusCode=0,t.code=c,e(t)}),P.open(p,T),"boolean"==typeof x&&(P.withCredentials=x),Object.keys(S).forEach(t=>{P.setRequestHeader(t,S[t])}),_){case"auto":break;case"buffer":P.responseType=i?"arraybuffer":"buffer";break;default:_&&(P.responseType=_)}null!==s?P.send(function(t,e){return"string"==typeof t?t:d.test(e.get("content-type"))?JSON.stringify(t||{}):t&&"object"==typeof t&&!e.get("content-type")?JSON.stringify(t):t}(s,O)):P.send()}))}}},function(t,e,r){const n=r(7).default;t.exports={createNewRequest:function(){if(!n){return new(r(30))}return new XMLHttpRequest}}},function(t,e,r){const{parse:n}=r(27);t.exports={parseHeaders:function(t){const e=n(t);return r=e,Object.keys(r).reduce((t,e)=>Object.assign(t,{[e.toLowerCase()]:r[e]}),{});var r}}},function(t,e){const r={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range not Satisfiable",417:"Expectation Failed",418:'I"m a teapot',421:"Misdirected Request",422:"Unprocessable Entity",426:"Locked",428:"Failed Dependency",423:"Upgrade Required",424:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};t.exports={STATUSES:r}},function(t,e,r){const n=r(150),o="http://localhost:8000",i=n(o,"/api/core/v1"),s=n(i,"/insights"),a=n(i,"/organisation/[ORG_ID]/users"),u=n(i,"/own/archive"),c=n(i,"/own/archive/details"),f=n(i,"/own/digest"),l=n(i,"/own/orgs"),h=n(i,"/own/password"),p=n(i,"/own/password/preflight"),d=n(i,"/shares");t.exports={API_INSIGHTS:s,API_ORG_USERS:a,API_OWN_ARCHIVE:u,API_OWN_ARCHIVE_DETAILS:c,API_OWN_DIGEST:f,API_OWN_ORGS:l,API_OWN_PASS_CHANGE:h,API_OWN_PASS_CHANGE_VERIFY:p,API_SHARES:d,OAUTH_AUTHORISE_URI:"http://localhost:8000/oauth/authorize",OAUTH_REDIRECT_URI:"http://localhost:8000/oauth/authorized/",OAUTH_TOKEN_URI:"http://localhost:8000/oauth/token"}},function(t,e,r){var n,o,i;i=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var i=e.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=s.shift()+(s.length>0?"?":"")+s.join("&")}return function(){return t("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=i():void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o)},function(t,e){t.exports={generateNewUpdateID:function(){return Math.floor(2147483647*Math.random())}}},function(t,e,r){const n=r(153),{getAllEntries:o}=r(154);t.exports=class{constructor(t){const e=Array.isArray(t)?t:[t];this._items=function(t){return t.reduce((function(t,e){return[...t,...o(e.getGroups()).map((function(t){return{entry:t,archive:e}}))]}),[])}(e),this._fuse=null,this._lastResult=[],this.initSearcher()}get items(){return this._items}get lastResult(){return this._lastResult}initSearcher(){this._fuse=new n(this.items,{keys:["title","username","url","uri"],getFn:function(t,e){return t.entry.getProperty(e)},shouldSort:!0,threshold:.5,tokenSeparator:/\s+/g})}search(t){return this._lastResult=this._fuse.search(t),this.lastResult}}},function(t,e,r){!function(e){"use strict";function r(){console.log.apply(console,arguments)}var n={id:null,caseSensitive:!1,include:[],shouldSort:!0,searchFn:s,sortFn:function(t,e){return t.score-e.score},getFn:function t(e,r,n){var o,s,a,u,c,f;if(r){if(-1!==(a=r.indexOf("."))?(o=r.slice(0,a),s=r.slice(a+1)):o=r,null!=(u=e[o]))if(s||"string"!=typeof u&&"number"!=typeof u)if(i(u))for(c=0,f=u.length;c<f;c++)t(u[c],s,n);else s&&t(u,s,n);else n.push(u)}else n.push(e);return n},keys:[],verbose:!1,tokenize:!1,matchAllTokens:!1,tokenSeparator:/ +/g,minMatchCharLength:1,findAllMatches:!1};function o(t,e){var r;for(r in this.list=t,this.options=e=e||{},n)n.hasOwnProperty(r)&&("boolean"==typeof n[r]?this.options[r]=r in e?e[r]:n[r]:this.options[r]=e[r]||n[r])}function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function s(t,e){e=e||{},this.options=e,this.options.location=e.location||s.defaultOptions.location,this.options.distance="distance"in e?e.distance:s.defaultOptions.distance,this.options.threshold="threshold"in e?e.threshold:s.defaultOptions.threshold,this.options.maxPatternLength=e.maxPatternLength||s.defaultOptions.maxPatternLength,this.pattern=e.caseSensitive?t:t.toLowerCase(),this.patternLen=t.length,this.patternLen<=this.options.maxPatternLength&&(this.matchmask=1<<this.patternLen-1,this.patternAlphabet=this._calculatePatternAlphabet())}o.VERSION="2.7.3",o.prototype.set=function(t){return this.list=t,t},o.prototype.search=function(t){return this.options.verbose&&r("\nSearch term:",t,"\n"),this.pattern=t,this.results=[],this.resultMap={},this._keyMap=null,this._prepareSearchers(),this._startSearch(),this._computeScore(),this._sort(),this._format()},o.prototype._prepareSearchers=function(){var t=this.options,e=this.pattern,r=t.searchFn,n=e.split(t.tokenSeparator),o=0,i=n.length;if(this.options.tokenize)for(this.tokenSearchers=[];o<i;o++)this.tokenSearchers.push(new r(n[o],t));this.fullSeacher=new r(e,t)},o.prototype._startSearch=function(){var t,e,r,n,o=this.options.getFn,i=this.list,s=i.length,a=this.options.keys,u=a.length,c=null;if("string"==typeof i[0])for(r=0;r<s;r++)this._analyze("",i[r],r,r);else for(this._keyMap={},r=0;r<s;r++)for(c=i[r],n=0;n<u;n++){if("string"!=typeof(t=a[n])){if(e=1-t.weight||1,this._keyMap[t.name]={weight:e},t.weight<=0||t.weight>1)throw new Error("Key weight has to be > 0 and <= 1");t=t.name}else this._keyMap[t]={weight:1};this._analyze(t,o(c,t,[]),c,r)}},o.prototype._analyze=function(t,e,n,o){var s,a,u,c,f,l,h,p,d,g,y,m,v,b,w,_=this.options,E=!1;if(null!=e){a=[];var A=0;if("string"==typeof e){if(s=e.split(_.tokenSeparator),_.verbose&&r("---------\nKey:",t),this.options.tokenize){for(b=0;b<this.tokenSearchers.length;b++){for(p=this.tokenSearchers[b],_.verbose&&r("Pattern:",p.pattern),d=[],m=!1,w=0;w<s.length;w++){g=s[w];var x={};(y=p.search(g)).isMatch?(x[g]=y.score,E=!0,m=!0,a.push(y.score)):(x[g]=1,this.options.matchAllTokens||a.push(1)),d.push(x)}m&&A++,_.verbose&&r("Token scores:",d)}for(c=a[0],l=a.length,b=1;b<l;b++)c+=a[b];c/=l,_.verbose&&r("Token score average:",c)}h=this.fullSeacher.search(e),_.verbose&&r("Full text score:",h.score),f=h.score,void 0!==c&&(f=(f+c)/2),_.verbose&&r("Score average:",f),v=!this.options.tokenize||!this.options.matchAllTokens||A>=this.tokenSearchers.length,_.verbose&&r("Check Matches",v),(E||h.isMatch)&&v&&((u=this.resultMap[o])?u.output.push({key:t,score:f,matchedIndices:h.matchedIndices}):(this.resultMap[o]={item:n,output:[{key:t,score:f,matchedIndices:h.matchedIndices}]},this.results.push(this.resultMap[o])))}else if(i(e))for(b=0;b<e.length;b++)this._analyze(t,e[b],n,o)}},o.prototype._computeScore=function(){var t,e,n,o,i,s,a,u,c=this._keyMap,f=this.results;for(this.options.verbose&&r("\n\nComputing score:\n"),t=0;t<f.length;t++){for(n=0,i=(o=f[t].output).length,a=1,e=0;e<i;e++)u=o[e].score*(s=c?c[o[e].key].weight:1),1!==s?a=Math.min(a,u):(n+=u,o[e].nScore=u);f[t].score=1===a?n/i:a,this.options.verbose&&r(f[t])}},o.prototype._sort=function(){var t=this.options;t.shouldSort&&(t.verbose&&r("\n\nSorting...."),this.results.sort(t.sortFn))},o.prototype._format=function(){var t,e,n,o,i=this.options,s=i.getFn,a=[],u=this.results,c=i.include;for(i.verbose&&r("\n\nOutput:\n\n",u),n=i.id?function(t){u[t].item=s(u[t].item,i.id,[])[0]}:function(){},o=function(t){var e,r,n,o,i,s=u[t];if(c.length>0){if(e={item:s.item},-1!==c.indexOf("matches"))for(n=s.output,e.matches=[],r=0;r<n.length;r++)i={indices:(o=n[r]).matchedIndices},o.key&&(i.key=o.key),e.matches.push(i);-1!==c.indexOf("score")&&(e.score=u[t].score)}else e=s.item;return e},t=0,e=u.length;t<e;t++)n(t),a.push(o(t));return a},s.defaultOptions={location:0,distance:100,threshold:.6,maxPatternLength:32},s.prototype._calculatePatternAlphabet=function(){var t={},e=0;for(e=0;e<this.patternLen;e++)t[this.pattern.charAt(e)]=0;for(e=0;e<this.patternLen;e++)t[this.pattern.charAt(e)]|=1<<this.pattern.length-e-1;return t},s.prototype._bitapScore=function(t,e){var r=t/this.patternLen,n=Math.abs(this.options.location-e);return this.options.distance?r+n/this.options.distance:n?1:r},s.prototype.search=function(t){var e,r,n,o,i,s,a,u,c,f,l,h,p,d,g,y,m,v,b,w,_,E,A,x=this.options;if(t=x.caseSensitive?t:t.toLowerCase(),this.pattern===t)return{isMatch:!0,score:0,matchedIndices:[[0,t.length-1]]};if(this.patternLen>x.maxPatternLength){if(b=!!(v=t.match(new RegExp(this.pattern.replace(x.tokenSeparator,"|")))))for(_=[],e=0,E=v.length;e<E;e++)A=v[e],_.push([t.indexOf(A),A.length-1]);return{isMatch:b,score:b?.5:1,matchedIndices:_}}for(o=x.findAllMatches,i=x.location,n=t.length,s=x.threshold,a=t.indexOf(this.pattern,i),w=[],e=0;e<n;e++)w[e]=0;for(-1!=a&&(s=Math.min(this._bitapScore(0,a),s),-1!=(a=t.lastIndexOf(this.pattern,i+this.patternLen))&&(s=Math.min(this._bitapScore(0,a),s))),a=-1,y=1,m=[],f=this.patternLen+n,e=0;e<this.patternLen;e++){for(u=0,c=f;u<c;)this._bitapScore(e,i+c)<=s?u=c:f=c,c=Math.floor((f-u)/2+u);for(f=c,l=Math.max(1,i-c+1),h=o?n:Math.min(i+c,n)+this.patternLen,(p=Array(h+2))[h+1]=(1<<e)-1,r=h;r>=l;r--)if((g=this.patternAlphabet[t.charAt(r-1)])&&(w[r-1]=1),p[r]=(p[r+1]<<1|1)&g,0!==e&&(p[r]|=(d[r+1]|d[r])<<1|1|d[r+1]),p[r]&this.matchmask&&(y=this._bitapScore(e,r-1))<=s){if(s=y,a=r-1,m.push(a),a<=i)break;l=Math.max(1,2*i-a)}if(this._bitapScore(e+1,i)>s)break;d=p}return{isMatch:a>=0,score:0===y?.001:y,matchedIndices:_=this._getMatchedIndices(w)}},s.prototype._getMatchedIndices=function(t){for(var e,r=[],n=-1,o=-1,i=0,s=t.length;i<s;i++)(e=t[i])&&-1===n?n=i:e||-1===n||((o=i-1)-n+1>=this.options.minMatchCharLength&&r.push([n,o]),n=-1);return t[i-1]&&i-1-n+1>=this.options.minMatchCharLength&&r.push([n,i-1]),r},t.exports=o}()},function(t,e){t.exports={findEntriesByCheck:function t(e,r){var n,o=[];return e.forEach((function(e){(n=e.getEntries().filter(r)).length>0&&(o=o.concat(n)),(n=t(e.getGroups(),r)).length>0&&(o=o.concat(n))})),o},findGroupsByCheck:function t(e,r){var n=e.filter(r);return e.forEach((function(e){var o=t(e.getGroups(),r);o.length>0&&(n=n.concat(o))})),n},getAllEntries:function t(e){return e.reduce((function(e,r){const n=r.getEntries(),o=t(r.getGroups());return n.length>0&&(e=e.concat(n)),o.length>0&&(e=e.concat(o)),e}),[])}}},function(t,e,r){const n=r(156);t.exports={LocalStorageInterface:n}},function(t,e,r){const n=r(20);t.exports=class extends n{constructor(){super(),this._storage=window.localStorage}get storage(){return this._storage}getAllKeys(){return Promise.resolve(Object.keys(this.storage))}getValue(t){const e=this.storage.getItem(t);return Promise.resolve(e)}removeKey(t){return this.storage.removeItem(t),Promise.resolve()}setValue(t,e){return this.storage.setItem(t,e),Promise.resolve()}}}])}));
\No newline at end of file