UNPKG

238 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("bitcore-lib"),require("bitcore-mnemonic"),require("bitcore-ecies"),require("bitcore-message")):"function"==typeof define&&define.amd?define("dbb-client-js",["bitcore-lib","bitcore-mnemonic","bitcore-ecies","bitcore-message"],e):"object"==typeof exports?exports["dbb-client-common-js"]=e(require("bitcore-lib"),require("bitcore-mnemonic"),require("bitcore-ecies"),require("bitcore-message")):t.DbbClient=e(t["bitcore-lib"],t["bitcore-mnemonic"],t["bitcore-ecies"],t["bitcore-message"])}(window,function(t,e,r,n){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.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 i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));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=47)}([function(t,e,r){var n;t.exports=(n=n||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;e[n+o>>>2]|=s<<24-(n+o)%4*8}else for(var o=0;o<i;o+=4)e[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],i=function(e){var e=e,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o<e;o+=4){var a=i(4294967296*(r||t.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,e)}}),a=n.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},h=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,a=4*o,u=i/a,c=(u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0))*o,h=t.min(4*c,i);if(c){for(var f=0;f<c;f+=o)this._doProcessBlock(n,f);var l=n.splice(0,c);r.sigBytes-=h}return new s.init(l,h)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),l=(i.Hasher=f.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new l.HMAC.init(t,r).finalize(e)}}}),n.algo={});return n}(Math),n)},function(t,e,r){var n;t.exports=(n=r(0),r(7),void(n.lib.Cipher||function(t){var e=n,r=e.lib,i=r.Base,o=r.WordArray,s=r.BufferedBlockAlgorithm,a=e.enc,u=(a.Utf8,a.Base64),c=e.algo,h=c.EvpKDF,f=r.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?E:w}return function(e){return{encrypt:function(r,n,i){return t(n).encrypt(e,r,n,i)},decrypt:function(r,n,i){return t(n).decrypt(e,r,n,i)}}}}()}),l=(r.StreamCipher=f.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),e.mode={}),p=r.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),d=l.CBC=function(){var e=p.extend();function r(e,r,n){var i=this._iv;if(i){var o=i;this._iv=t}else var o=this._prevBlock;for(var s=0;s<n;s++)e[r+s]^=o[s]}return e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize;r.call(this,t,e,i),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+i)}}),e.Decryptor=e.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize,o=t.slice(e,e+i);n.decryptBlock(t,e),r.call(this,t,e,i),this._prevBlock=o}}),e}(),y=e.pad={},v=y.Pkcs7={pad:function(t,e){for(var r=4*e,n=r-t.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var u=o.create(s,n);t.concat(u)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},b=(r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:d,padding:v}),reset:function(){f.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,e&&e.words):(this._mode=n.call(r,this,e&&e.words),this._mode.__creator=n)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),r.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),g=e.format={},m=g.OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var n=o.create([1398893684,1701076831]).concat(r).concat(e);else var n=e;return n.toString(u)},parse:function(t){var e=u.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var n=o.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return b.create({ciphertext:e,salt:n})}},w=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),s=i.cfg;return b.create({ciphertext:o,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),_=e.kdf={},S=_.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=h.create({keySize:e+r}).compute(t,n),s=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,b.create({key:i,iv:s,salt:n})}},E=r.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:S}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=w.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=w.decrypt.call(this,t,e,i.key,n);return 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){},function(t,e){var r,n,i=t.exports={};function o(){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===o||!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:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],h=!1,f=-1;function l(){h&&u&&(h=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!h){var t=a(l);h=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,h=!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 y(){}i.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||h||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";(function(t){
2/*!
3 * The buffer module from node.js, for the browser.
4 *
5 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
6 * @license MIT
7 */
8var n=r(50),i=r(51),o=r(29);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 f(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=l(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),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));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?t:(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):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(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 f(t,e){if(h(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 l(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 q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){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=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,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(i){var h=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,l=0;l<u;l++)if(c(t,o+l)!==c(e,l)){f=!1;break}if(f)return o}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/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 m(t,e,r,n){return F(q(e,t.length-r),t,r,n)}function w(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function _(t,e,r,n){return w(t,e,r,n)}function S(t,e,r,n){return F(U(e),t,r,n)}function E(t,e,r,n){return F(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,c=t[i],h=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(h=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,f=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=f}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=A));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 h(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 f(null,t)},u.allocUnsafeSlow=function(t){return f(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,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];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(!o(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),i=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,i),i+=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?k(this,0,t):function(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 k(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.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,i){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===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),h=t.slice(e,r),f=0;f<a;++f)if(c[f]!==h[f]){o=c[f],s=h[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return v(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 i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);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 i="",o=e;o<r;++o)i+=L(t[o]);return i}function P(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function O(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 M(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function j(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function I(t,e,r,n,i,o){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,o){return o||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return o||I(t,0,r,8),i.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 i=e-t;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||O(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||O(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||O(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||O(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||O(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||O(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||O(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||O(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||O(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||O(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||O(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||O(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||O(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||O(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||M(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||M(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||M(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):j(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||M(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):j(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||M(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||M(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||M(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):j(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||M(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):j(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 D(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return D(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 i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},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 i=t.charCodeAt(0);i<256&&(t=i)}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 o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:q(new u(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.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;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(2))},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){var n,i,o,s,a,u,c,h;t.exports=(n=r(0),r(20),r(21),o=(i=n).lib,s=o.Base,a=o.WordArray,u=i.algo,c=u.MD5,h=u.EvpKDF=s.extend({cfg:s.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,n=r.hasher.create(),i=a.create(),o=i.words,s=r.keySize,u=r.iterations;o.length<s;){c&&n.update(c);var c=n.update(t).finalize(e);n.reset();for(var h=1;h<u;h++)c=n.finalize(c),n.reset();i.concat(c)}return i.sigBytes=4*s,i}}),i.EvpKDF=function(t,e,r){return h.create(r).compute(t,e)},n.EvpKDF)},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)}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)}}function o(t,e){return!e||"object"!==n(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 s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0});var u=r(49),c=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=o(this,s(e).call(this,r,n))).message="",t.sig="",t}var r,n,c;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&&a(t,e)}(e,u.SimpleAccount),r=e,(n=[{key:"toSimpleAccount",value:function(){return new u.SimpleAccount(this.publicKey,this.nonce)}}])&&i(r.prototype,n),c&&i(r,c),e}();e.Account=c},function(t,e,r){"use strict";var n=r(15),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(13);o.inherits=r(6);var s=r(33),a=r(37);o.inherits(f,s);for(var u=i(a.prototype),c=0;c<u.length;c++){var h=u[c];f.prototype[h]||(f.prototype[h]=a.prototype[h])}function f(t){if(!(this instanceof f))return new f(t);s.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||n.nextTick(p,this)}function p(t){t.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),f.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},function(t,e,r){var n,i,o;t.exports=(n=r(0),o=(i=n).lib.WordArray,i.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o<r;o+=3)for(var s=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<r;a++)i.push(n.charAt(s>>>6*(3-a)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i<r.length;i++)n[r.charCodeAt(i)]=i}var s=r.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(e=a)}return function(t,e,r){for(var n=[],i=0,s=0;s<e;s++)if(s%4){var a=r[t.charCodeAt(s-1)]<<s%4*2,u=r[t.charCodeAt(s)]>>>6-s%4*2;n[i>>>2]|=(a|u)<<24-i%4*8,i++}return o.create(n,i)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)},function(t,e,r){var n;t.exports=(n=r(0),function(t){var e=n,r=e.lib,i=r.WordArray,o=r.Hasher,s=e.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=t[e+0],u=t[e+1],p=t[e+2],d=t[e+3],y=t[e+4],v=t[e+5],b=t[e+6],g=t[e+7],m=t[e+8],w=t[e+9],_=t[e+10],S=t[e+11],E=t[e+12],x=t[e+13],k=t[e+14],A=t[e+15],T=o[0],R=o[1],C=o[2],P=o[3];T=c(T,R,C,P,s,7,a[0]),P=c(P,T,R,C,u,12,a[1]),C=c(C,P,T,R,p,17,a[2]),R=c(R,C,P,T,d,22,a[3]),T=c(T,R,C,P,y,7,a[4]),P=c(P,T,R,C,v,12,a[5]),C=c(C,P,T,R,b,17,a[6]),R=c(R,C,P,T,g,22,a[7]),T=c(T,R,C,P,m,7,a[8]),P=c(P,T,R,C,w,12,a[9]),C=c(C,P,T,R,_,17,a[10]),R=c(R,C,P,T,S,22,a[11]),T=c(T,R,C,P,E,7,a[12]),P=c(P,T,R,C,x,12,a[13]),C=c(C,P,T,R,k,17,a[14]),T=h(T,R=c(R,C,P,T,A,22,a[15]),C,P,u,5,a[16]),P=h(P,T,R,C,b,9,a[17]),C=h(C,P,T,R,S,14,a[18]),R=h(R,C,P,T,s,20,a[19]),T=h(T,R,C,P,v,5,a[20]),P=h(P,T,R,C,_,9,a[21]),C=h(C,P,T,R,A,14,a[22]),R=h(R,C,P,T,y,20,a[23]),T=h(T,R,C,P,w,5,a[24]),P=h(P,T,R,C,k,9,a[25]),C=h(C,P,T,R,d,14,a[26]),R=h(R,C,P,T,m,20,a[27]),T=h(T,R,C,P,x,5,a[28]),P=h(P,T,R,C,p,9,a[29]),C=h(C,P,T,R,g,14,a[30]),T=f(T,R=h(R,C,P,T,E,20,a[31]),C,P,v,4,a[32]),P=f(P,T,R,C,m,11,a[33]),C=f(C,P,T,R,S,16,a[34]),R=f(R,C,P,T,k,23,a[35]),T=f(T,R,C,P,u,4,a[36]),P=f(P,T,R,C,y,11,a[37]),C=f(C,P,T,R,g,16,a[38]),R=f(R,C,P,T,_,23,a[39]),T=f(T,R,C,P,x,4,a[40]),P=f(P,T,R,C,s,11,a[41]),C=f(C,P,T,R,d,16,a[42]),R=f(R,C,P,T,b,23,a[43]),T=f(T,R,C,P,w,4,a[44]),P=f(P,T,R,C,E,11,a[45]),C=f(C,P,T,R,A,16,a[46]),T=l(T,R=f(R,C,P,T,p,23,a[47]),C,P,s,6,a[48]),P=l(P,T,R,C,g,10,a[49]),C=l(C,P,T,R,k,15,a[50]),R=l(R,C,P,T,v,21,a[51]),T=l(T,R,C,P,E,6,a[52]),P=l(P,T,R,C,d,10,a[53]),C=l(C,P,T,R,_,15,a[54]),R=l(R,C,P,T,u,21,a[55]),T=l(T,R,C,P,m,6,a[56]),P=l(P,T,R,C,A,10,a[57]),C=l(C,P,T,R,b,15,a[58]),R=l(R,C,P,T,x,21,a[59]),T=l(T,R,C,P,y,6,a[60]),P=l(P,T,R,C,S,10,a[61]),C=l(C,P,T,R,p,15,a[62]),R=l(R,C,P,T,w,21,a[63]),o[0]=o[0]+T|0,o[1]=o[1]+R|0,o[2]=o[2]+C|0,o[3]=o[3]+P|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,u=a.words,c=0;c<4;c++){var h=u[c];u[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,r,n,i,o,s){var a=t+(e&r|~e&n)+i+s;return(a<<o|a>>>32-o)+e}function h(t,e,r,n,i,o,s){var a=t+(e&n|r&~n)+i+s;return(a<<o|a>>>32-o)+e}function f(t,e,r,n,i,o,s){var a=t+(e^r^n)+i+s;return(a<<o|a>>>32-o)+e}function l(t,e,r,n,i,o,s){var a=t+(r^(e|~n))+i+s;return(a<<o|a>>>32-o)+e}e.MD5=o._createHelper(u),e.HmacMD5=o._createHmacHelper(u)}(Math),n.MD5)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.Get="GET",t.Post="POST",t.Put="PUT",t.Delete="DELETE",t.Head="HEAD",t.Options="Options",t.Patch="PATCH"}(e.HttpMethod||(e.HttpMethod={}))},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(5).Buffer)},function(t,e,r){"use strict";var n=r(63),i=r(65);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=m,e.resolve=function(t,e){return m(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?m(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=m(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(c),f=["%","/","?",";","#"].concat(h),l=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=r(66);function m(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o<t.indexOf("#")?"?":"#",c=t.split(a);c[0]=c[0].replace(/\\/g,"/");var m=t=c.join(a);if(m=m.trim(),!r&&1===t.split("#").length){var w=u.exec(m);if(w)return this.path=m,this.href=m,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?g.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var _=s.exec(m);if(_){var S=(_=_[0]).toLowerCase();this.protocol=S,m=m.substr(_.length)}if(r||_||m.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===m.substr(0,2);!E||_&&v[_]||(m=m.substr(2),this.slashes=!0)}if(!v[_]&&(E||_&&!b[_])){for(var x,k,A=-1,T=0;T<l.length;T++){-1!==(R=m.indexOf(l[T]))&&(-1===A||R<A)&&(A=R)}-1!==(k=-1===A?m.lastIndexOf("@"):m.lastIndexOf("@",A))&&(x=m.slice(0,k),m=m.slice(k+1),this.auth=decodeURIComponent(x)),A=-1;for(T=0;T<f.length;T++){var R;-1!==(R=m.indexOf(f[T]))&&(-1===A||R<A)&&(A=R)}-1===A&&(A=m.length),this.host=m.slice(0,A),m=m.slice(A),this.parseHost(),this.hostname=this.hostname||"";var C="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!C)for(var P=this.hostname.split(/\./),O=(T=0,P.length);T<O;T++){var M=P[T];if(M&&!M.match(p)){for(var B="",j=0,I=M.length;j<I;j++)M.charCodeAt(j)>127?B+="x":B+=M[j];if(!B.match(p)){var N=P.slice(0,T),D=P.slice(T+1),H=M.match(d);H&&(N.push(H[1]),D.unshift(H[2])),D.length&&(m="/"+D.join(".")+m),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=n.toASCII(this.hostname));var L=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+L,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!y[S])for(T=0,O=h.length;T<O;T++){var U=h[T];if(-1!==m.indexOf(U)){var F=encodeURIComponent(U);F===U&&(F=escape(U)),m=m.split(U).join(F)}}var z=m.indexOf("#");-1!==z&&(this.hash=m.substr(z),m=m.slice(0,z));var K=m.indexOf("?");if(-1!==K?(this.search=m.substr(K),this.query=m.substr(K+1),e&&(this.query=g.parse(this.query)),m=m.slice(0,K)):e&&(this.search="",this.query={}),m&&(this.pathname=m),b[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var W=this.search||"";this.path=L+W}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=g.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||b[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),e+o+(r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(m(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];r[a]=this[a]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var u=Object.keys(t),c=0;c<u.length;c++){var h=u[c];"protocol"!==h&&(r[h]=t[h])}return b[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!b[t.protocol]){for(var f=Object.keys(t),l=0;l<f.length;l++){var p=f[l];r[p]=t[p]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||v[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",g=r.search||"";r.path=y+g}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var m=r.pathname&&"/"===r.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),_=w||m||r.host&&t.pathname,S=_,E=r.pathname&&r.pathname.split("/")||[],x=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!b[r.protocol]);if(x&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),_=_&&(""===d[0]||""===E[0])),w)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,E=d;else if(d.length)E||(E=[]),E.pop(),E=E.concat(d),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(x)r.hostname=r.host=E.shift(),(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=E.slice(-1)[0],A=(r.host||t.host||E.length>1)&&("."===k||".."===k)||""===k,T=0,R=E.length;R>=0;R--)"."===(k=E[R])?E.splice(R,1):".."===k?(E.splice(R,1),T++):T&&(E.splice(R,1),T--);if(!_&&!S)for(;T--;T)E.unshift("..");!_||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),A&&"/"!==E.join("/").substr(-1)&&E.push("");var C,P=""===E[0]||E[0]&&"/"===E[0].charAt(0);x&&(r.hostname=r.host=P?"":E.length?E.shift():"",(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift()));return(_=_||r.host&&E.length)&&!P&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick(function(){t.apply(null,o)})}}}:t.exports=e}).call(this,r(4))},function(t,e,r){var n=r(5),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(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 i(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){var n,i,o,s,a,u;t.exports=(n=r(0),o=(i=n).lib,s=o.Base,a=o.WordArray,(u=i.x64={}).Word=s.extend({init:function(t,e){this.high=t,this.low=e}}),u.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n<e;n++){var i=t[n];r.push(i.high),r.push(i.low)}return a.create(r,this.sigBytes)},clone:function(){for(var t=s.clone.call(this),e=t.words=this.words.slice(0),r=e.length,n=0;n<r;n++)e[n]=e[n].clone();return t}}),n)},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,i;return e=t,i=[{key:"jsonToMap",value:function(t){var e=new Map;return Object.keys(t).forEach(function(r){return e.set(r,t[r])}),e}},{key:"mapToJson",value:function(t){var e={};return t.forEach(function(t,r){e[r]=t}),e}}],(r=null)&&n(e.prototype,r),i&&n(e,i),t}();e.JsonUtils=i},function(t,e,r){(function(t){var n=r(52),i=r(31),o=r(61),s=r(62),a=r(14),u=e;u.request=function(e,r){e="string"==typeof e?a.parse(e):o(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||i,u=e.hostname||e.host,c=e.port,h=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?s+"//"+u:"")+(c?":"+c:"")+h,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var f=new n(e);return r&&f.on("response",r),f},u.get=function(t,e){var r=u.request(t,e);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=s,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(2))},function(t,e,r){var n,i,o,s,a,u,c,h;t.exports=(n=r(0),o=(i=n).lib,s=o.WordArray,a=o.Hasher,u=i.algo,c=[],h=u.SHA1=a.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],u=0;u<80;u++){if(u<16)c[u]=0|t[e+u];else{var h=c[u-3]^c[u-8]^c[u-14]^c[u-16];c[u]=h<<1|h>>>31}var f=(n<<5|n>>>27)+a+c[u];f+=u<20?1518500249+(i&o|~i&s):u<40?1859775393+(i^o^s):u<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,a=s,s=o,o=i<<30|i>>>2,i=n,n=f}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),i.SHA1=a._createHelper(h),i.HmacSHA1=a._createHmacHelper(h),n.SHA1)},function(t,e,r){var n,i,o,s,a,u,c;t.exports=(n=r(0),o=(i=n).lib,s=o.Base,a=i.enc,u=a.Utf8,c=i.algo,void(c.HMAC=s.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=u.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),o=this._iKey=e.clone(),s=i.words,a=o.words,c=0;c<r;c++)s[c]^=1549556828,a[c]^=909522486;i.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);e.reset();var n=e.finalize(this._oKey.clone().concat(r));return n}})))},function(t,e,r){var n=r(19),i=r(14),o=t.exports;for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);function a(t){if("string"==typeof t&&(t=i.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}o.request=function(t,e){return t=a(t),n.request.call(this,t,e)},o.get=function(t,e){return t=a(t),n.get.call(this,t,e)}},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},function(t,e,r){(function(t){function r(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return n.exec(t).slice(1)};function o(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}e.resolve=function(){for(var e="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,n="/"===s.charAt(0))}return(n?"/":"")+(e=r(o(e.split("/"),function(t){return!!t}),!n).join("/"))||"."},e.normalize=function(t){var n=e.isAbsolute(t),i="/"===s(t,-1);return(t=r(o(t.split("/"),function(t){return!!t}),!n).join("/"))||n||(t="."),t&&i&&(t+="/"),(n?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(o(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,r){function n(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-e+1)}t=e.resolve(t).substr(1),r=e.resolve(r).substr(1);for(var i=n(t.split("/")),o=n(r.split("/")),s=Math.min(i.length,o.length),a=s,u=0;u<s;u++)if(i[u]!==o[u]){a=u;break}var c=[];for(u=a;u<i.length;u++)c.push("..");return(c=c.concat(o.slice(a))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){var e=i(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},e.basename=function(t,e){var r=i(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},e.extname=function(t){return i(t)[3]};var s="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,r(4))},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(26),o=r(27),s=r(28),a=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.interceptors=[],this.headers=new Map([["Accept","application/json"],["Content-Type","application/json"]]),this.host=e}var e,r,a;return e=t,(r=[{key:"getHost",value:function(){return this.host}},{key:"sendRequest",value:function(t,e,r){var n=this;return this.acceptInterceptor(new i.InterceptorCortege(t,e,this.headers,r)).then(function(t){return new Promise(function(r,i){try{var a=t.path?n.getHost()+t.path:n.getHost(),u=new s.XMLHttpRequest;u.open(e,a),t.headers.forEach(function(t,e){u.setRequestHeader(e,t)}),u.onload=function(){var t=new o.Response(u.responseText,u.status);u.status>=200&&u.status<300?r(t):i(t)},u.onerror=function(){var t=new o.Response(u.responseText,u.status);i(t)},u.send(JSON.stringify(t.data?t.data:{}))}catch(t){i(t)}})})}},{key:"addInterceptor",value:function(t){return-1===this.interceptors.indexOf(t)&&this.interceptors.push(t),this}},{key:"acceptInterceptor",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return r>=this.interceptors.length?Promise.resolve(t):this.interceptors[r].onInterceptor(t).then(function(t){return e.acceptInterceptor(t,++r)})}}])&&n(e.prototype,r),a&&n(e,a),t}();e.HttpTransportImpl=a},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(12),o=function(){function t(e,r,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.path=e,this.method=r,this.headers=n,this.data=i}var e,r,o;return e=t,(r=[{key:"isTransaction",value:function(){return this.method==i.HttpMethod.Delete||this.method==i.HttpMethod.Put||this.method==i.HttpMethod.Patch||this.method==i.HttpMethod.Post}}])&&n(e.prototype,r),o&&n(e,o),t}();e.InterceptorCortege=o},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);try{this._json=JSON.parse(e)}catch(t){this._json=e}this._status=r}var e,r,i;return e=t,(r=[{key:"json",get:function(){return this._json}},{key:"status",get:function(){return this._status}}])&&n(e.prototype,r),i&&n(e,i),t}();e.Response=i},function(t,e,r){"use strict";r.r(e),function(t,n){r.d(e,"XMLHttpRequest",function(){return h});var i=r(3),o=r(19),s=r(22),a=r(14),u=r(23),c=r(24),h=function(){function e(){this.UNSENT=e.UNSENT,this.OPENED=e.OPENED,this.HEADERS_RECEIVED=e.HEADERS_RECEIVED,this.LOADING=e.LOADING,this.DONE=e.DONE,this.disableHeaderCheck=!1,this.readyState=e.UNSENT,this.responseText="",this.responseXML=null,this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this.defaultHeaders={"User-Agent":"ts-XMLHttpRequest",Accept:"*/*"},this.errorFlag=!1,this.forbiddenRequestHeaders=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],this.forbiddenRequestMethods=["TRACE","TRACK","CONNECT"],this.headers={},this.headersLowerCase={},this.listeners={},this.sendFlag=!1}return e.prototype.open=function(t,e,r,n,i){if(void 0===r&&(r=!0),this.abort(),this.errorFlag=!1,!this.isAllowedHttpMethod(t))throw new Error("SecurityError: Request method not allowed");this.settings={method:t,url:e,async:"boolean"!=typeof r||r,user:n,password:i},this.setState(this.OPENED)},e.prototype.setDisableHeaderCheck=function(t){this.disableHeaderCheck=t},e.prototype.setRequestHeader=function(t,e){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(this.isAllowedHttpHeader(t)){if(this.sendFlag)throw new Error("INVALID_STATE_ERR: send flag is true");t=this.headersLowerCase[t.toLowerCase()]||t,this.headersLowerCase[t.toLowerCase()]=t,this.headers[t]=this.headers[t]?this.headers[t]+", "+e:e}else console.warn('Refused to set unsafe header "'+t+'"')},e.prototype.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||this.errorFlag)return null;var t="";if(this.response)for(var e in this.response.headers)if("set-cookie"!==e&&"set-cookie2"!==e){var r=this.response.headers[e];"string"==typeof r?t+=e+": "+r+"\r\n":Array.isArray(r)?t+=e+": "+r.join(", ")+"\r\n":t+=e+":\r\n"}return t.substr(0,t.length-2)},e.prototype.getResponseHeader=function(t){if("string"==typeof t&&this.readyState>this.OPENED&&this.response&&this.response.headers&&this.response.headers[t.toLowerCase()]&&!this.errorFlag){var e=this.response.headers[t.toLowerCase()];if("string"==typeof e)return e;if(Array.isArray(e))return e.join(", ")}return null},e.prototype.getRequestHeader=function(t){if("string"==typeof t&&this.headersLowerCase[t.toLowerCase()])return this.headers[this.headersLowerCase[t.toLowerCase()]]},e.prototype.send=function(e){var r=this,h=this;if(void 0===this.settings)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(this.sendFlag)throw new Error("INVALID_STATE_ERR: send has already been called");var f,l=!1,p=!1,d=Object(a.parse)(this.settings.url);switch(d.protocol){case"https:":l=!0;case"http:":f=d.hostname;break;case"file:":p=!0;break;case void 0:case null:case"":f="localhost";break;default:throw new Error("Protocol not supported.")}if(p){if("GET"!==this.settings.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(this.settings.async)Object(i.readFile)(unescape(d.pathname||"/"),"utf8",function(t,e){t?h.handleError(t):(h.status=200,h.responseText=e,h.setState(h.DONE))});else try{this.responseText=Object(i.readFileSync)(unescape(d.pathname||"/"),"utf8"),this.status=200,this.setState(h.DONE)}catch(t){this.handleError(t)}}else{var y=d.port||(l?443:80),v=d.pathname+(d.search?d.search:"");for(var b in this.defaultHeaders)this.headersLowerCase[b.toLowerCase()]||(this.headers[b]=this.defaultHeaders[b]);if(f&&(this.headers.Host=f),d.host&&"["===d.host[0]&&(this.headers.Host="["+this.headers.Host+"]"),l&&443===y||80===y||(this.headers.Host+=":"+d.port),this.settings.user){void 0===this.settings.password&&(this.settings.password="");var g=t.from(this.settings.user+":"+this.settings.password);this.headers.Authorization="Basic "+g.toString("base64")}"GET"===this.settings.method||"HEAD"===this.settings.method?e=null:e?(this.headers["Content-Length"]=""+(t.isBuffer(e)?e.length:t.byteLength(e)),this.getRequestHeader("Content-Type")||(this.headers["Content-Type"]="text/plain;charset=UTF-8")):"POST"===this.settings.method&&(this.headers["Content-Length"]="0");var m={host:f,port:y,path:v,method:this.settings.method,headers:this.headers,agent:!1,withCredentials:this.withCredentials};if(this.errorFlag=!1,this.settings.async){this.timeout>=1&&(this.timeoutTimer=setTimeout(function(){r.readyState!==r.DONE&&h.handleTimeout(new Error("request timed out after "+r.timeout+"ms"))},this.timeout));var w=l?s.request:o.request;this.sendFlag=!0,h.dispatchEvent("readystatechange");var _=function(t){h.handleError(t)},S=0,E=function(t){if(h.response=t,void 0===h.settings)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(h.response.headers.location&&(301===h.response.statusCode||302===h.response.statusCode||303===h.response.statusCode||307===h.response.statusCode)){if(++S>=10)throw new Error("XMLHttpRequest: Request failed - too many redirects");h.settings.url=h.response.headers.location;var e=Object(a.parse)(h.settings.url);(f=e.hostname)&&(h.headers.Host=f);var r={hostname:e.hostname,port:e.port,path:e.path,method:303===h.response.statusCode?"GET":h.settings.method,headers:h.headers,withCredentials:h.withCredentials};return l="https:"===d.protocol,w=l?s.request:o.request,h.request=w(r,E).on("error",_),void h.request.end()}h.response.setEncoding("utf8"),h.setState(h.HEADERS_RECEIVED),h.status=h.response.statusCode||0,h.response.on("data",function(t){t&&(h.responseText+=t),h.sendFlag&&h.setState(h.LOADING)}),h.response.on("end",function(){h.sendFlag&&(h.setState(h.DONE),h.sendFlag=!1)}),h.response.on("error",function(t){h.handleError(t)})};h.request=w(m,E).on("error",_),e&&h.request.write(e),h.request.end(),h.dispatchEvent("loadstart")}else{var x=(new Date).getTime(),k=Object(u.tmpdir)()+c.sep+"ts-xmlhttprequest-content-"+n.pid,A=Object(u.tmpdir)()+c.sep+"ts-xmlhttprequest-sync-"+n.pid;Object(i.writeFileSync)(A,"","utf8");var T="let http = require('http'), https = require('https'), fs = require('fs');let doRequest = http"+(l?"s":"")+".request;let options = "+JSON.stringify(m)+";let responseText = '';let req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync( '"+k+"', JSON.stringify({ err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText} }), 'utf8');fs.unlinkSync('"+A+"');});response.on('error', function(error) {fs.writeFileSync('"+k+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+A+"');});}).on('error', function(error) {fs.writeFileSync('"+k+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+A+"');});"+(e?"req.write('"+JSON.stringify(e).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();";h.dispatchEvent("loadstart"),this.setState(h.LOADING);var R=Object(i.spawn)(n.argv[0],["-e",T]);for(R.on("exit",function(t,e){try{Object(i.unlinkSync)(A)}catch(t){}try{Object(i.unlinkSync)(k)}catch(t){}});Object(i.existsSync)(A);)if(0!==this.timeout&&(new Date).getTime()>=x+this.timeout)return R.stdin.end(),R.kill(),h.handleTimeout(new Error("request timed out after "+this.timeout+"ms"));R.stdin.end(),R.kill();var C=JSON.parse(Object(i.readFileSync)(k,"utf8"));Object(i.unlinkSync)(k),C.err?h.handleError(C.err):(h.response=C.data,h.status=C.data.statusCode,h.responseText=C.data.text,h.setState(h.DONE))}}},e.prototype.abort=function(){this.request&&(this.request.abort(),this.request=void 0),this.headers={},this.status=0,this.responseText="",this.responseXML=null,this.errorFlag=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!this.sendFlag||this.readyState===this.DONE||(this.sendFlag=!1,this.setState(this.DONE)),this.readyState=this.UNSENT,this.dispatchEvent("abort")},e.prototype.addEventListener=function(t,e){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push(e)},e.prototype.removeEventListener=function(t,e){t in this.listeners&&(this.listeners[t]=this.listeners[t].filter(function(t){return t!==e}))},e.prototype.dispatchEvent=function(t,e){var r="on"+t;if("function"==typeof this[r]&&this[r](e),t in this.listeners)for(var n=0,i=this.listeners[t].length;n<i;n++)this.listeners[t][n].call(this,e)},e.prototype.setState=function(t){t!==this.LOADING&&this.readyState===t||(this.readyState=t,(this.settings&&this.settings.async||this.readyState<this.OPENED||this.readyState===this.DONE)&&this.dispatchEvent("readystatechange"),this.readyState===this.DONE&&(this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0),this.errorFlag||this.dispatchEvent("load"),this.dispatchEvent("loadend")))},e.prototype.handleTimeout=function(t){this.request&&(this.request.abort(),this.request=void 0),this.status=0,this.statusText=t.toString(),this.responseText=t.stack||"",this.errorFlag=!0,this.dispatchEvent("timeout",t),this.setState(this.DONE)},e.prototype.handleError=function(t){this.status=0,this.statusText=t.toString(),this.responseText=t.stack||"",this.errorFlag=!0,this.dispatchEvent("error",t),this.setState(this.DONE)},e.prototype.isAllowedHttpHeader=function(t){return!0===(this.disableHeaderCheck||t&&-1===this.forbiddenRequestHeaders.indexOf(t.toLowerCase()))},e.prototype.isAllowedHttpMethod=function(t){return!0===(t&&-1===this.forbiddenRequestMethods.indexOf(t))},e.UNSENT=0,e.OPENED=1,e.HEADERS_RECEIVED=2,e.LOADING=3,e.DONE=4,e}()}.call(this,r(5).Buffer,r(4))},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(t){e.fetch=a(t.fetch)&&a(t.ReadableStream),e.writableStream=a(t.WritableStream),e.abortController=a(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(t){}var r;function n(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function i(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var o=void 0!==t.ArrayBuffer,s=o&&a(t.ArrayBuffer.prototype.slice);function a(t){return"function"==typeof t}e.arraybuffer=e.fetch||o&&i("arraybuffer"),e.msstream=!e.fetch&&s&&i("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o&&i("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!n()&&a(n().overrideMimeType),e.vbArray=a(t.VBArray),r=null}).call(this,r(2))},function(t,e,r){(function(t,n,i){var o=r(30),s=r(6),a=r(32),u=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=e.IncomingMessage=function(e,r,s,u){var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){t.nextTick(function(){c.emit("close")})}),"fetch"===s){if(c._fetchResponse=r,c.url=r.url,c.statusCode=r.status,c.statusMessage=r.statusText,r.headers.forEach(function(t,e){c.headers[e.toLowerCase()]=t,c.rawHeaders.push(e,t)}),o.writableStream){var h=new WritableStream({write:function(t){return new Promise(function(e,r){c._destroyed?r():c.push(new n(t))?e():c._resumeFetch=e})},close:function(){i.clearTimeout(u),c._destroyed||c.push(null)},abort:function(t){c._destroyed||c.emit("error",t)}});try{return void r.body.pipeTo(h).catch(function(t){i.clearTimeout(u),c._destroyed||c.emit("error",t)})}catch(t){}}var f=r.body.getReader();!function t(){f.read().then(function(e){if(!c._destroyed){if(e.done)return i.clearTimeout(u),void c.push(null);c.push(new n(e.value)),t()}}).catch(function(t){i.clearTimeout(u),c._destroyed||c.emit("error",t)})}()}else{if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(e[2])):void 0!==c.headers[r]?c.headers[r]+=", "+e[2]:c.headers[r]=e[2],c.rawHeaders.push(e[1],e[2])}}),c._charset="x-user-defined",!o.overrideMimeType){var l=c.rawHeaders["mime-type"];if(l){var p=l.match(/;\s*charset=([^;])(;|$)/);p&&(c._charset=p[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};s(c,a.Readable),c.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},c.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==u.DONE)break;try{r=new i.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new n(r));break}case"text":try{r=e.responseText}catch(e){t._mode="text:vbarray";break}if(r.length>t._pos){var o=r.substr(t._pos);if("x-user-defined"===t._charset){for(var s=new n(o.length),a=0;a<o.length;a++)s[a]=255&o.charCodeAt(a);t.push(s)}else t.push(o,t._charset);t._pos=r.length}break;case"arraybuffer":if(e.readyState!==u.DONE||!e.response)break;r=e.response,t.push(new n(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=e.response,e.readyState!==u.LOADING||!r)break;t.push(new n(new Uint8Array(r)));break;case"ms-stream":if(r=e.response,e.readyState!==u.LOADING)break;var c=new i.MSStreamReader;c.onprogress=function(){c.result.byteLength>t._pos&&(t.push(new n(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){t.push(null)},c.readAsArrayBuffer(r)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r(4),r(5).Buffer,r(2))},function(t,e,r){(e=t.exports=r(33)).Stream=e,e.Readable=e,e.Writable=r(37),e.Duplex=r(9),e.Transform=r(39),e.PassThrough=r(59)},function(t,e,r){"use strict";(function(e,n){var i=r(15);t.exports=m;var o,s=r(29);m.ReadableState=g;r(34).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=r(35),c=r(16).Buffer,h=e.Uint8Array||function(){};var f=r(13);f.inherits=r(6);var l=r(53),p=void 0;p=l&&l.debuglog?l.debuglog("stream"):function(){};var d,y=r(54),v=r(36);f.inherits(m,u);var b=["error","close","destroy","pause","resume"];function g(t,e){t=t||{};var n=e instanceof(o=o||r(9));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=r(38).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function m(t){if(o=o||r(9),!(this instanceof m))return new m(t);this._readableState=new g(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,r,n,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,x(t)}(t,s)):(i||(o=function(t,e){var r;n=e,c.isBuffer(n)||n instanceof h||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),n?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?_(t,s,e,!1):A(t,s)):_(t,s,e,!1))):n||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(s)}function _(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&x(t)),A(t,e)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),m.prototype.destroy=v.destroy,m.prototype._undestroy=v.undestroy,m.prototype._destroy=function(t,e){this.push(null),e(t)},m.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=c.from(t,e),e=""),r=!0),w(this,t,e,!1,r)},m.prototype.unshift=function(t){return w(this,t,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(t){return d||(d=r(38).StringDecoder),this._readableState.decoder=new d(t),this._readableState.encoding=t,this};var S=8388608;function E(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=S?t=S:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function x(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(k,t):k(t))}function k(t){p("emit readable"),t.emit("readable"),P(t)}function A(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(T,t,e))}function T(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(p("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function R(t){p("readable nexttick read 0"),t.read(0)}function C(t,e){e.reading||(p("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),P(t),e.flowing&&!e.reading&&t.read(0)}function P(t){var e=t._readableState;for(p("flow",e.flowing);e.flowing&&null!==t.read(););}function O(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;t-=i.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function M(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function j(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}m.prototype.read=function(t){p("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?M(this):x(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&M(this),null;var n,i=e.needReadable;return p("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&p("length less than watermark",i=!0),e.ended||e.reading?p("reading or ended",i=!1):i&&(p("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=E(r,e))),null===(n=t>0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&M(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?h:m;function c(e,n){p("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,p("cleanup"),t.removeListener("close",b),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",v),t.removeListener("unpipe",c),r.removeListener("end",h),r.removeListener("end",m),r.removeListener("data",y),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function h(){p("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",c);var f=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,P(t))}}(r);t.on("drain",f);var l=!1;var d=!1;function y(e){p("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!l&&(p("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,d=!0),r.pause())}function v(e){p("onerror",e),m(),t.removeListener("error",v),0===a(t,"error")&&t.emit("error",e)}function b(){t.removeListener("finish",g),m()}function g(){p("onfinish"),t.removeListener("close",b),m()}function m(){p("unpipe"),r.unpipe(t)}return r.on("data",y),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",v),t.once("close",b),t.once("finish",g),t.emit("pipe",r),o.flowing||(p("pipe resume"),r.resume()),t},m.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var s=j(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)},m.prototype.on=function(t,e){var r=u.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&x(this):i.nextTick(R,this))}return r},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var t=this._readableState;return t.flowing||(p("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(C,t,e))}(this,t)),this},m.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(p("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(p("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<b.length;o++)t.on(b[o],this.emit.bind(this,b[o]));return this._read=function(e){p("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=O}).call(this,r(2),r(4))},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,s,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var h=new Error('Uncaught, unspecified "error" event. ('+e+")");throw h.context=e,h}if(o(r=this._events[t]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(i(r))for(a=Array.prototype.slice.call(arguments,1),s=(c=r.slice()).length,u=0;u<s;u++)c[u].apply(this,a);return!0},r.prototype.addListener=function(t,e){var s;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(s=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){if(!n(e))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,e.apply(this,arguments))}return i.listener=e,this.on(t,i),this},r.prototype.removeListener=function(t,e){var r,o,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(s=(r=this._events[t]).length,o=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(a=s;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){o=a;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){t.exports=r(34).EventEmitter},function(t,e,r){"use strict";var n=r(15);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){"use strict";(function(e,n,i){var o=r(15);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=g;var a,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;g.WritableState=b;var c=r(13);c.inherits=r(6);var h={deprecate:r(58)},f=r(35),l=r(16).Buffer,p=i.Uint8Array||function(){};var d,y=r(36);function v(){}function b(t,e){a=a||r(9),t=t||{};var n=e instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,h=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:h,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===t.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),x(t,e))}(t,r,n,e,i);else{var s=S(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),n?u(w,t,r,s,i):w(t,r,s,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function g(t){if(a=a||r(9),!(d.call(g,this)||this instanceof a))return new g(t);this._writableState=new b(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),f.call(this)}function m(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),x(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,m(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,h=r.encoding,f=r.callback;if(m(t,e,!1,e.objectMode?1:c.length,c,h,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)})}function x(t,e){var r=S(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(E,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}c.inherits(g,f),b.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(b.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===g&&(t&&t._writableState instanceof b)}})):d=function(t){return t instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(t,e,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=t,l.isBuffer(n)||n instanceof p);return a&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=v),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(n,s),i=!1),i}(this,i,t,r))&&(i.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else m(t,e,!1,a,n,i,o);return u}(this,i,a,t,e,r)),s},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||_(this,t))},g.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(4),r(56).setImmediate,r(2))},function(t,e,r){"use strict";var n=r(16).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=h,this.end=f,e=3;break;default:return this.write=l,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){"use strict";t.exports=s;var n=r(9),i=r(13);function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(t){if(!(this instanceof s))return new s(t);n.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",a)}function a(){var t=this;"function"==typeof this._flush?this._flush(function(e,r){u(t,e,r)}):u(this,null,null)}function u(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=r(6),i.inherits(s,n),s.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},s.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},s.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,function(t){e(t),r.emit("close")})}},function(t,e,r){"use strict";(function(t){function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=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){i=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}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 o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var s=r(71),a=r(41),u=r(96),c=r(97),h=r(18),f=r(98),l=r(99),p=r(100),d=r(101),y=function(){function e(t,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.isConfidential=!1,this.permissions=new u.Permissions,this.permissionsSource=t,this.siteDataSource=r,this.origin=n}var r,y,v;return r=e,(y=[{key:"createKeyPair",value:function(t){var e=this;return new Promise(function(r){var n=a.CryptoUtils.PBKDF2(t,256),i=f.crypto.Hash.sha256(new f.deps.Buffer(n)),o=f.crypto.BN.fromBuffer(i);e.privateKey=new f.PrivateKey(o),e.publicKey=e.privateKey.toPublicKey(),e.address=e.privateKey.toAddress();var u=e.privateKey.toString(16),c=e.publicKey.toString(16);r(new s.KeyPair(u,c))})}},{key:"generateMnemonicPhrase",value:function(){return new Promise(function(t){t(new l(l.Words.ENGLISH).toString())})}},{key:"signMessage",value:function(t){var e=this;return new Promise(function(r){r(new d(t).sign(e.privateKey))})}},{key:"checkSig",value:function(t,e){var r=this;return new Promise(function(n){var i;try{i=d(t).verify(r.privateKey.toAddress(),e)}catch(t){i=!1}n(i)})}},{key:"getPublicKey",value:function(){return this.publicKey.toString(16)}},{key:"getAddress",value:function(){return this.address}},{key:"decryptMessage",value:function(e,r){var n=this;return new Promise(function(i){i(new p({noKey:!0}).privateKey(n.privateKey).publicKey(f.PublicKey.fromString(e)).decrypt(new t(r,"base64")).toString())})}},{key:"decryptFields",value:function(t){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.prepareData(t,!1));case 1:case"end":return e.stop()}},e,this)}))}},{key:"encryptMessage",value:function(t,e){var r=this;return new Promise(function(n){n(new p({noKey:!0}).privateKey(r.privateKey).publicKey(f.PublicKey.fromString(t)).encrypt(e).toString("base64"))})}},{key:"encryptFields",value:function(t){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("whlee21 encryptFields",t),e.abrupt("return",this.prepareData(t,!0));case 2:case"end":return e.stop()}},e,this)}))}},{key:"encryptPermissionsFields",value:function(t,e){return o(this,void 0,void 0,regeneratorRuntime.mark(function r(){var i,o,s,a,u,f,l,p,d,y,v;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(i=new Map,!(null!=e&&e.size>0)){r.next=34;break}return r.next=4,this.syncPermissions();case 4:s=!0,a=!1,u=void 0,r.prev=7,f=e.entries()[Symbol.iterator]();case 9:if(s=(l=f.next()).done){r.next=20;break}if(p=n(l.value,2),d=p[0],y=p[1],this.hasPermissions(d,!1)){r.next=13;break}return r.abrupt("continue",17);case 13:return r.next=15,this.generatePasswordForFIeld(d.toLowerCase());case 15:o=r.sent,i.set(d,new c.AcceptedField(o,y));case 17:s=!0,r.next=9;break;case 20:r.next=26;break;case 22:r.prev=22,r.t0=r.catch(7),a=!0,u=r.t0;case 26:r.prev=26,r.prev=27,s||null==f.return||f.return();case 29:if(r.prev=29,!a){r.next=32;break}throw u;case 32:return r.finish(29);case 33:return r.finish(26);case 34:return v=h.JsonUtils.mapToJson(i),r.abrupt("return",this.encryptMessage(t,JSON.stringify(v)));case 36:case"end":return r.stop()}},r,this,[[7,22,26,34],[27,,29,33]])}))}},{key:"prepareData",value:function(t,e){return o(this,void 0,void 0,regeneratorRuntime.mark(function r(){var i,o,s,u,c,h,f,l,p,d,y;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i=new Map,console.log("whlee21 prepareData",t),r.next=4,this.syncPermissions();case 4:u=!0,c=!1,h=void 0,r.prev=7,f=t.entries()[Symbol.iterator]();case 9:if(u=(l=f.next()).done){r.next=20;break}if(p=n(l.value,2),d=p[0],y=p[1],this.hasPermissions(d,!e)){r.next=13;break}return r.abrupt("continue",17);case 13:return r.next=15,this.generatePasswordForFIeld(d);case 15:null!=(o=r.sent)&&void 0!==o&&o.length>0&&(s=e?a.CryptoUtils.encryptAes256(y,o):a.CryptoUtils.decryptAes256(y,o),i.set(d.toLowerCase(),s));case 17:u=!0,r.next=9;break;case 20:r.next=26;break;case 22:r.prev=22,r.t0=r.catch(7),c=!0,h=r.t0;case 26:r.prev=26,r.prev=27,u||null==f.return||f.return();case 29:if(r.prev=29,!c){r.next=32;break}throw h;case 32:return r.finish(29);case 33:return r.finish(26);case 34:return r.abrupt("return",i);case 35:case"end":return r.stop()}},r,this,[[7,22,26,34],[27,,29,33]])}))}},{key:"hasPermissions",value:function(t,e){if(this.isConfidential)return!0;var r=this.permissions.fields.get(t);return e&&r===u.AccessRight.R||r===u.AccessRight.RW}},{key:"syncPermissions",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){var e,r,n,i,o,s,a,u,c=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log("whlee21 syncPermission"),this.isConfidential||0!==this.permissions.fields.size){t.next=38;break}return t.next=4,this.siteDataSource.getSiteData(this.origin);case 4:if(e=t.sent,this.isConfidential=e.confidential,console.log("whlee21 site.confidential",e.confidential),e.confidential){t.next=38;break}return console.log("whlee21 after getSiteData"),t.next=11,this.permissionsSource.getGrantAccessRecords(e.publicKey,this.getPublicKey());case 11:r=t.sent,console.log("whlee21 after getGrantAccessRecords"),n=!0,i=!1,o=void 0,t.prev=16,s=regeneratorRuntime.mark(function t(){var r,n,i,o,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.value,t.next=3,c.decryptMessage(e.publicKey,r.responseData);case 3:n=t.sent,console.log("whlee21 after decryptMessage"),i=JSON.parse(n),o=h.JsonUtils.jsonToMap(i),c.permissions.fields.clear(),s=c,o.forEach(function(t,e){s.permissions.fields.set(e,t.access)});case 10:case"end":return t.stop()}},t,this)}),a=r[Symbol.iterator]();case 19:if(n=(u=a.next()).done){t.next=24;break}return t.delegateYield(s(),"t0",21);case 21:n=!0,t.next=19;break;case 24:t.next=30;break;case 26:t.prev=26,t.t1=t.catch(16),i=!0,o=t.t1;case 30:t.prev=30,t.prev=31,n||null==a.return||a.return();case 33:if(t.prev=33,!i){t.next=36;break}throw o;case 36:return t.finish(33);case 37:return t.finish(30);case 38:case"end":return t.stop()}},t,this,[[16,26,30,38],[31,,33,37]])}))}},{key:"generatePasswordForFIeld",value:function(t){var e=this;return new Promise(function(r){r(a.CryptoUtils.PBKDF2(a.CryptoUtils.keccak256(e.privateKey.toString(16))+t.toLowerCase(),384))})}}])&&i(r.prototype,y),v&&i(r,v),e}();e.BitKeyPair=y}).call(this,r(5).Buffer)},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(72),o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,o;return e=t,o=[{key:"keccak256",value:function(t){return i.SHA3(t,{outputLength:256}).toString(i.enc.Hex)}},{key:"sha384",value:function(t){return i.SHA384(t).toString(i.enc.Hex)}},{key:"encryptAes256",value:function(t,e){return i.AES.encrypt(t,e,{outputLength:256}).toString()}},{key:"decryptAes256",value:function(t,e){return i.AES.decrypt(t,e,{outputLength:256}).toString(i.enc.Utf8)}},{key:"PBKDF2",value:function(e,r){return i.PBKDF2(e,t.sha384(t.sha384(e)),{keySize:r/32,iterations:100}).toString(i.enc.Hex)}}],(r=null)&&n(e.prototype,r),o&&n(e,o),t}();e.CryptoUtils=o},function(t,e,r){var n;t.exports=(n=r(0),function(t){var e=n,r=e.lib,i=r.WordArray,o=r.Hasher,s=e.algo,a=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(a[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var c=[],h=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],h=r[5],f=r[6],l=r[7],p=0;p<64;p++){if(p<16)c[p]=0|t[e+p];else{var d=c[p-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,v=c[p-2],b=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[p]=y+c[p-7]+b+c[p-16]}var g=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&h^~a&f)+u[p]+c[p];l=f,f=h,h=a,a=s+w|0,s=o,o=i,i=n,n=w+(m+g)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+h|0,r[6]=r[6]+f|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(h),e.HmacSHA256=o._createHmacHelper(h)}(Math),n.SHA256)},function(t,e,r){var n;t.exports=(n=r(0),r(17),function(){var t=n,e=t.lib.Hasher,r=t.x64,i=r.Word,o=r.WordArray,s=t.algo;function a(){return i.create.apply(i,arguments)}var u=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=a()}();var h=s.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],h=r[5],f=r[6],l=r[7],p=n.high,d=n.low,y=i.high,v=i.low,b=o.high,g=o.low,m=s.high,w=s.low,_=a.high,S=a.low,E=h.high,x=h.low,k=f.high,A=f.low,T=l.high,R=l.low,C=p,P=d,O=y,M=v,B=b,j=g,I=m,N=w,D=_,H=S,L=E,q=x,U=k,F=A,z=T,K=R,W=0;W<80;W++){var Y=c[W];if(W<16)var V=Y.high=0|t[e+2*W],G=Y.low=0|t[e+2*W+1];else{var X=c[W-15],J=X.high,$=X.low,Z=(J>>>1|$<<31)^(J>>>8|$<<24)^J>>>7,Q=($>>>1|J<<31)^($>>>8|J<<24)^($>>>7|J<<25),tt=c[W-2],et=tt.high,rt=tt.low,nt=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,it=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=c[W-7],st=ot.high,at=ot.low,ut=c[W-16],ct=ut.high,ht=ut.low;V=(V=(V=Z+st+((G=Q+at)>>>0<Q>>>0?1:0))+nt+((G+=it)>>>0<it>>>0?1:0))+ct+((G+=ht)>>>0<ht>>>0?1:0),Y.high=V,Y.low=G}var ft,lt=D&L^~D&U,pt=H&q^~H&F,dt=C&O^C&B^O&B,yt=P&M^P&j^M&j,vt=(C>>>28|P<<4)^(C<<30|P>>>2)^(C<<25|P>>>7),bt=(P>>>28|C<<4)^(P<<30|C>>>2)^(P<<25|C>>>7),gt=(D>>>14|H<<18)^(D>>>18|H<<14)^(D<<23|H>>>9),mt=(H>>>14|D<<18)^(H>>>18|D<<14)^(H<<23|D>>>9),wt=u[W],_t=wt.high,St=wt.low,Et=z+gt+((ft=K+mt)>>>0<K>>>0?1:0),xt=bt+yt;z=U,K=F,U=L,F=q,L=D,q=H,D=I+(Et=(Et=(Et=Et+lt+((ft+=pt)>>>0<pt>>>0?1:0))+_t+((ft+=St)>>>0<St>>>0?1:0))+V+((ft+=G)>>>0<G>>>0?1:0))+((H=N+ft|0)>>>0<N>>>0?1:0)|0,I=B,N=j,B=O,j=M,O=C,M=P,C=Et+(vt+dt+(xt>>>0<bt>>>0?1:0))+((P=ft+xt|0)>>>0<ft>>>0?1:0)|0}d=n.low=d+P,n.high=p+C+(d>>>0<P>>>0?1:0),v=i.low=v+M,i.high=y+O+(v>>>0<M>>>0?1:0),g=o.low=g+j,o.high=b+B+(g>>>0<j>>>0?1:0),w=s.low=w+N,s.high=m+I+(w>>>0<N>>>0?1:0),S=a.low=S+H,a.high=_+D+(S>>>0<H>>>0?1:0),x=h.low=x+q,h.high=E+L+(x>>>0<q>>>0?1:0),A=f.low=A+F,f.high=k+U+(A>>>0<F>>>0?1:0),R=l.low=R+K,l.high=T+z+(R>>>0<K>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(n+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(h),t.HmacSHA512=e._createHmacHelper(h)}(),n.SHA512)},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(8),o=r(12),s=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.SIGN_UP="/v1/registration",this.SIGN_IN="/v1/exist",this.DELETE="/v1/delete",this.GET_NONCE="/v1/nonce/",this.transport=e}var e,r,s;return e=t,(r=[{key:"registration",value:function(t){return this.transport.sendRequest(this.SIGN_UP,o.HttpMethod.Post,t.toSimpleAccount()).then(function(t){return Object.assign(new i.Account,t.json)})}},{key:"checkAccount",value:function(t){return this.transport.sendRequest(this.SIGN_IN,o.HttpMethod.Post,t.toSimpleAccount()).then(function(t){return Object.assign(new i.Account,t.json)})}},{key:"unsubscribe",value:function(t){return this.transport.sendRequest(this.DELETE,o.HttpMethod.Delete,t.toSimpleAccount()).then(function(t){return Object.assign(new i.Account,t.json)})}},{key:"getNonce",value:function(t){return this.transport.sendRequest(this.GET_NONCE+t.publicKey,o.HttpMethod.Get,t.toSimpleAccount()).then(function(t){return parseInt(t.json.toString(),10)})}}])&&n(e.prototype,r),s&&n(e,s),t}();e.AccountRepositoryImpl=s},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.transport=e}var e,r,i;return e=t,(r=[{key:"requestPermissions",value:function(t,e){throw new Error("Method not implemented.")}},{key:"grantAccessForClient",value:function(t,e,r){throw new Error("Method not implemented.")}},{key:"getRequests",value:function(t,e){throw new Error("Method not implemented.")}},{key:"grantAccessForOffer",value:function(t,e,r,n){throw new Error("Method not implemented.")}}])&&n(e.prototype,r),i&&n(e,i),t}();e.DataRequestRepositoryImpl=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SignedRequest=function t(e,r,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.pk=r,this.sig=n,this.nonce=i}},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(48),o=r(25);e.HttpTransportImpl=o.HttpTransportImpl;var s=r(8),a=r(114),u=r(69),c=r(102),h=r(106),f=r(44),l=r(109),p=r(110),d=r(111),y=r(112),v=r(113),b=r(45),g=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._authAccountBehavior=new a.BehaviorSubject(new s.Account);var u=new o.HttpTransportImpl(e),h=this.createNodeAssistant(u),g=this.createKeyPairHelper(n,h,h,r),m=g,w=g,_=g,S=c.TransportFactory.createHttpTransport(e).addInterceptor(new l.SignInterceptor(m)).addInterceptor(new p.NonceInterceptor(m,h)),E=new f.AccountRepositoryImpl(S),x=new y.ClientDataRepositoryImpl(S),k=new b.DataRequestRepositoryImpl(S);this._accountManager=new i.AccountManagerImpl(E,g,m,this._authAccountBehavior),this._profileManager=new d.ProfileManagerImpl(x,this._authAccountBehavior.asObservable(),w,_,m),this._dataRequestManager=new v.DataRequestManagerImpl(k,this._authAccountBehavior.asObservable(),w,_)}var e,r,g;return e=t,(r=[{key:"createKeyPairHelper",value:function(t,e,r,n){return 0===t.length?u.KeyPairFactory.createDefaultKeyPair(e,r,n):u.KeyPairFactory.createRpcKeyPair(c.TransportFactory.createJsonRpcHttpTransport(t))}},{key:"createNodeAssistant",value:function(t){return new h.AssistantNodeRepositoryImpl(t)}},{key:"accountManager",get:function(){return this._accountManager}},{key:"profileManager",get:function(){return this._profileManager}},{key:"dataRequestManager",get:function(){return this._dataRequestManager}}])&&n(e.prototype,r),g&&n(e,g),t}();e.DbbClient=g},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(8),o=function(){function t(e,r,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.accountRepository=e,this.keyPairCreator=r,this.messageSigner=n,this.authAccountBehavior=i}var e,r,o;return e=t,(r=[{key:"authenticationByPassPhrase",value:function(t,e){throw new Error("Method not implemented.")}},{key:"authenticationByAccessToken",value:function(t,e){throw new Error("Method not implemented.")}},{key:"registration",value:function(t,e){var r=this;return this.checkSigMessage(e),this.keyPairCreator.createKeyPair(t).then(this.generateAccount).then(function(t){return r.accountRepository.registration(t)}).then(function(t){return r.onGetAccount(t,e)})}},{key:"checkAccount",value:function(t,e){var r=this;return console.log("mnemonicPhrase:",t),this.checkSigMessage(e),this.keyPairCreator.createKeyPair(t).then(this.generateAccount).then(function(t){return r.syncAccount(t,e)})}},{key:"unsubscribe",value:function(){return this.accountRepository.unsubscribe(this.authAccountBehavior.getValue())}},{key:"getNewMnemonic",value:function(){return this.keyPairCreator.generateMnemonicPhrase()}},{key:"getAccount",value:function(){return this.authAccountBehavior.getValue()}},{key:"syncAccount",value:function(t,e){var r=this;return this.accountRepository.checkAccount(t).then(function(t){return r.onGetAccount(t,e)})}},{key:"generateAccount",value:function(t){return new Promise(function(e){e(new i.Account(t.publicKey))})}},{key:"checkSigMessage",value:function(t){if(null==t||void 0===t||t.length<10)throw"message for signature should be have min 10 symbols."}},{key:"onGetAccount",value:function(t,e){var r=this;return this.messageSigner.signMessage(e).then(function(n){return new Promise(function(i){t.message=e,t.sig=n,r.authAccountBehavior.next(t),i(t)})})}}])&&n(e.prototype,r),o&&n(e,o),t}();e.AccountManagerImpl=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SimpleAccount=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.publicKey="",this.nonce=0,this.publicKey=e,this.nonce=r}},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){for(var e,r=c(t),n=r[0],s=r[1],a=new o(function(t,e,r){return 3*(e+r)/4-r}(0,n,s)),u=0,h=s>0?n-4:n,f=0;f<h;f+=4)e=i[t.charCodeAt(f)]<<18|i[t.charCodeAt(f+1)]<<12|i[t.charCodeAt(f+2)]<<6|i[t.charCodeAt(f+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(h(t,s,s+16383>a?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[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 h(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,f=r?i-1:0,l=r?-1:1,p=t[e+f];for(f+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+f],f+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+f],f+=l,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,f=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=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=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},function(t,e,r){(function(e,n,i){var o=r(30),s=r(6),a=r(31),u=r(32),c=r(60),h=a.IncomingMessage,f=a.readyStates;var l=t.exports=function(t){var r,n=this;u.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+new e(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){n.setHeader(e,t.headers[e])});var i=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!o.abortController)i=!1,r=!0;else if("prefer-streaming"===t.mode)r=!1;else if("allow-wrong-content-type"===t.mode)r=!o.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");r=!0}n._mode=function(t,e){return o.fetch&&e?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&t?"arraybuffer":o.vbArray&&t?"text:vbarray":"text"}(r,i),n._fetchTimer=null,n.on("finish",function(){n._onFinish()})};s(l,u.Writable),l.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===p.indexOf(r)&&(this._headers[r]={name:t,value:e})},l.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},l.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},l.prototype._onFinish=function(){var t=this;if(!t._destroyed){var r=t._opts,s=t._headers,a=null;"GET"!==r.method&&"HEAD"!==r.method&&(a=o.arraybuffer?c(e.concat(t._body)):o.blobConstructor?new n.Blob(t._body.map(function(t){return c(t)}),{type:(s["content-type"]||{}).value||""}):e.concat(t._body).toString());var u=[];if(Object.keys(s).forEach(function(t){var e=s[t].name,r=s[t].value;Array.isArray(r)?r.forEach(function(t){u.push([e,t])}):u.push([e,r])}),"fetch"===t._mode){var h=null;if(o.abortController){var l=new AbortController;h=l.signal,t._fetchAbortController=l,"requestTimeout"in r&&0!==r.requestTimeout&&(t._fetchTimer=n.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},r.requestTimeout))}n.fetch(t._opts.url,{method:t._opts.method,headers:u,body:a||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:h}).then(function(e){t._fetchResponse=e,t._connect()},function(e){n.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",e)})}else{var p=t._xhr=new n.XMLHttpRequest;try{p.open(t._opts.method,t._opts.url,!0)}catch(e){return void i.nextTick(function(){t.emit("error",e)})}"responseType"in p&&(p.responseType=t._mode.split(":")[0]),"withCredentials"in p&&(p.withCredentials=!!r.withCredentials),"text"===t._mode&&"overrideMimeType"in p&&p.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(p.timeout=r.requestTimeout,p.ontimeout=function(){t.emit("requestTimeout")}),u.forEach(function(t){p.setRequestHeader(t[0],t[1])}),t._response=null,p.onreadystatechange=function(){switch(p.readyState){case f.LOADING:case f.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(p.onprogress=function(){t._onXHRProgress()}),p.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{p.send(a)}catch(e){return void i.nextTick(function(){t.emit("error",e)})}}}},l.prototype._onXHRProgress=function(){(function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},l.prototype._connect=function(){var t=this;t._destroyed||(t._response=new h(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},l.prototype._write=function(t,e,r){this._body.push(t),r()},l.prototype.abort=l.prototype.destroy=function(){this._destroyed=!0,n.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},l.prototype.end=function(t,e,r){"function"==typeof t&&(r=t,t=void 0),u.Writable.prototype.end.call(this,t,e,r)},l.prototype.flushHeaders=function(){},l.prototype.setTimeout=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var p=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,r(5).Buffer,r(2),r(4))},function(t,e){},function(t,e,r){"use strict";var n=r(16).Buffer,i=r(55);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=o,i=a,e.copy(r,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r(57),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(2))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,s,a,u=1,c={},h=!1,f=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},n=function(t){o.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(t){var e=f.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&d(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(s+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return c[u]=i,n(u),u++},l.clearImmediate=p}function p(t){delete c[t]}function d(t){if(h)setTimeout(d,0,t);else{var e=c[t];if(e){h=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(r,n)}}(e)}finally{p(t),h=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(2),r(4))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,r(2))},function(t,e,r){"use strict";t.exports=o;var n=r(39),i=r(13);function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r(6),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){var n=r(5).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(n.isBuffer(t)){for(var e=new Uint8Array(t.length),r=t.length,i=0;i<r;i++)e[i]=t[i];return e.buffer}throw new Error("Argument must be a Buffer")}},function(t,e){t.exports=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},function(t,e){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",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",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 Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"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 Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,c=36,h=1,f=26,l=38,p=700,d=72,y=128,v="-",b=/^xn--/,g=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=c-h,S=Math.floor,E=String.fromCharCode;function x(t){throw new RangeError(w[t])}function k(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function A(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+k((t=t.replace(m,".")).split("."),e).join(".")}function T(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function R(t){return k(t,function(t){var e="";return t>65535&&(e+=E((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=E(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function P(t,e,r){var n=0;for(t=r?S(t/p):t>>1,t+=S(t/e);t>_*f>>1;n+=c)t=S(t/_);return S(n+(_+1)*t/(t+l))}function O(t){var e,r,n,i,o,s,a,l,p,b,g,m=[],w=t.length,_=0,E=y,k=d;for((r=t.lastIndexOf(v))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&x("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<w;){for(o=_,s=1,a=c;i>=w&&x("invalid-input"),((l=(g=t.charCodeAt(i++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:c)>=c||l>S((u-_)/s))&&x("overflow"),_+=l*s,!(l<(p=a<=k?h:a>=k+f?f:a-k));a+=c)s>S(u/(b=c-p))&&x("overflow"),s*=b;k=P(_-o,e=m.length+1,0==o),S(_/e)>u-E&&x("overflow"),E+=S(_/e),_%=e,m.splice(_++,0,E)}return R(m)}function M(t){var e,r,n,i,o,s,a,l,p,b,g,m,w,_,k,A=[];for(m=(t=T(t)).length,e=y,r=0,o=d,s=0;s<m;++s)(g=t[s])<128&&A.push(E(g));for(n=i=A.length,i&&A.push(v);n<m;){for(a=u,s=0;s<m;++s)(g=t[s])>=e&&g<a&&(a=g);for(a-e>S((u-r)/(w=n+1))&&x("overflow"),r+=(a-e)*w,e=a,s=0;s<m;++s)if((g=t[s])<e&&++r>u&&x("overflow"),g==e){for(l=r,p=c;!(l<(b=p<=o?h:p>=o+f?f:p-o));p+=c)k=l-b,_=c-b,A.push(E(C(b+k%_,0))),l=S(k/_);A.push(E(C(l,0))),o=P(r,w,n==i),r=0,++n}++r,++e}return A.join("")}a={version:"1.4.1",ucs2:{decode:T,encode:R},decode:O,encode:M,toASCII:function(t){return A(t,function(t){return g.test(t)?"xn--"+M(t):t})},toUnicode:function(t){return A(t,function(t){return b.test(t)?O(t.slice(4).toLowerCase()):t})}},void 0===(i=function(){return a}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(64)(t),r(2))},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){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(67),e.encode=e.stringify=r(68)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=t.length;u>0&&c>u&&(c=u);for(var h=0;h<c;++h){var f,l,p,d,y=t[h].replace(a,"%20"),v=y.indexOf(r);v>=0?(f=y.substr(0,v),l=y.substr(v+1)):(f=y,l=""),p=decodeURIComponent(f),d=decodeURIComponent(l),n(s,p)?i(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),function(s){var a=encodeURIComponent(n(s))+r;return i(t[s])?o(t[s],function(t){return a+encodeURIComponent(n(t))}).join(e):a+encodeURIComponent(n(t[s]))}).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(70),o=r(40),s=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,s;return e=t,s=[{key:"createDefaultKeyPair",value:function(t,e,r){return new o.BitKeyPair(t,e,r)}},{key:"createRpcKeyPair",value:function(t){return new i.RpcKeyPair(t)}}],(r=null)&&n(e.prototype,r),s&&n(e,s),t}();e.KeyPairFactory=s},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rpcTransport=e}var e,r,i;return e=t,(r=[{key:"setAccessToken",value:function(t){throw new Error("Method not implemented.")}},{key:"getAccessToken",value:function(){throw new Error("Method not implemented.")}},{key:"createKeyPair",value:function(t){throw new Error("Method not implemented.")}},{key:"generateMnemonicPhrase",value:function(){throw new Error("Method not implemented.")}},{key:"signMessage",value:function(t){throw new Error("Method not implemented.")}},{key:"checkSig",value:function(t,e){throw new Error("Method not implemented.")}},{key:"getPublicKey",value:function(){throw new Error("Method not implemented.")}},{key:"decryptMessage",value:function(t,e){throw new Error("Method not implemented.")}},{key:"decryptFields",value:function(t){throw new Error("Method not implemented.")}},{key:"encryptMessage",value:function(t,e){throw new Error("Method not implemented.")}},{key:"encryptFields",value:function(t){throw new Error("Method not implemented.")}},{key:"encryptPermissionsFields",value:function(t,e){throw new Error("Method not implemented.")}}])&&n(e.prototype,r),i&&n(e,i),t}();e.RpcKeyPair=i},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._privateKey=e,this._publicKey=r}var e,r,i;return e=t,(r=[{key:"privateKey",get:function(){return this._privateKey}},{key:"publicKey",get:function(){return this._publicKey}}])&&n(e.prototype,r),i&&n(e,i),t}();e.KeyPair=i},function(t,e,r){var n;t.exports=(n=r(0),r(17),r(73),r(74),r(10),r(11),r(20),r(42),r(75),r(43),r(76),r(77),r(78),r(21),r(79),r(7),r(1),r(80),r(81),r(82),r(83),r(84),r(85),r(86),r(87),r(88),r(89),r(90),r(91),r(92),r(93),r(94),r(95),n)},function(t,e,r){var n;t.exports=(n=r(0),function(){if("function"==typeof ArrayBuffer){var t=n.lib.WordArray,e=t.init;(t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var r=t.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=t[i]<<24-i%4*8;e.call(this,n,r)}else e.apply(this,arguments)}).prototype=t}}(),n.lib.WordArray)},function(t,e,r){var n;t.exports=(n=r(0),function(){var t=n,e=t.lib.WordArray,r=t.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i+=2){var o=e[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var r=t.length,n=[],i=0;i<r;i++)n[i>>>1]|=t.charCodeAt(i)<<16-i%2*16;return e.create(n,2*r)}},r.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o+=2){var s=i(e[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var r=t.length,n=[],o=0;o<r;o++)n[o>>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return e.create(n,2*r)}}}(),n.enc.Utf16)},function(t,e,r){var n,i,o,s,a,u;t.exports=(n=r(0),r(42),o=(i=n).lib.WordArray,s=i.algo,a=s.SHA256,u=s.SHA224=a.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=4,t}}),i.SHA224=a._createHelper(u),i.HmacSHA224=a._createHmacHelper(u),n.SHA224)},function(t,e,r){var n,i,o,s,a,u,c,h;t.exports=(n=r(0),r(17),r(43),o=(i=n).x64,s=o.Word,a=o.WordArray,u=i.algo,c=u.SHA512,h=u.SHA384=c.extend({_doReset:function(){this._hash=new a.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var t=c._doFinalize.call(this);return t.sigBytes-=16,t}}),i.SHA384=c._createHelper(h),i.HmacSHA384=c._createHmacHelper(h),n.SHA384)},function(t,e,r){var n;t.exports=(n=r(0),r(17),function(t){var e=n,r=e.lib,i=r.WordArray,o=r.Hasher,s=e.x64.Word,a=e.algo,u=[],c=[],h=[];!function(){for(var t=1,e=0,r=0;r<24;r++){u[t+5*e]=(r+1)*(r+2)/2%64;var n=(2*t+3*e)%5;t=e%5,e=n}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var a=0,f=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?f^=1<<p:a^=1<<p-32}128&i?i=i<<1^113:i<<=1}h[o]=s.create(a,f)}}();var f=[];!function(){for(var t=0;t<25;t++)f[t]=s.create()}();var l=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var o=t[e+2*i],s=t[e+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(R=r[i]).high^=s,R.low^=o}for(var a=0;a<24;a++){for(var l=0;l<5;l++){for(var p=0,d=0,y=0;y<5;y++)p^=(R=r[l+5*y]).high,d^=R.low;var v=f[l];v.high=p,v.low=d}for(l=0;l<5;l++){var b=f[(l+4)%5],g=f[(l+1)%5],m=g.high,w=g.low;for(p=b.high^(m<<1|w>>>31),d=b.low^(w<<1|m>>>31),y=0;y<5;y++)(R=r[l+5*y]).high^=p,R.low^=d}for(var _=1;_<25;_++){var S=(R=r[_]).high,E=R.low,x=u[_];x<32?(p=S<<x|E>>>32-x,d=E<<x|S>>>32-x):(p=E<<x-32|S>>>64-x,d=S<<x-32|E>>>64-x);var k=f[c[_]];k.high=p,k.low=d}var A=f[0],T=r[0];for(A.high=T.high,A.low=T.low,l=0;l<5;l++)for(y=0;y<5;y++){var R=r[_=l+5*y],C=f[_],P=f[(l+1)%5+5*y],O=f[(l+2)%5+5*y];R.high=C.high^~P.high&O.high,R.low=C.low^~P.low&O.low}R=r[0];var M=h[a];R.high^=M.high,R.low^=M.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,u=a/8,c=[],h=0;h<u;h++){var f=s[h],l=f.high,p=f.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(l)}return new i.init(c,a)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=o._createHelper(l),e.HmacSHA3=o._createHmacHelper(l)}(Math),n.SHA3)},function(t,e,r){var n;t.exports=(n=r(0),
9/** @preserve
10 (c) 2012 by Cédric Mesnil. All rights reserved.
11
12 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
13
14 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
15 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18 */
19function(t){var e=n,r=e.lib,i=r.WordArray,o=r.Hasher,s=e.algo,a=i.create([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]),u=i.create([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]),c=i.create([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]),h=i.create([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]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),l=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,p,w,_,S,E,x,k,A,T,R=this._hash.words,C=f.words,P=l.words,O=a.words,M=u.words,B=c.words,j=h.words;for(S=o=R[0],E=s=R[1],x=p=R[2],k=w=R[3],A=_=R[4],r=0;r<80;r+=1)T=o+t[e+O[r]]|0,T+=r<16?d(s,p,w)+C[0]:r<32?y(s,p,w)+C[1]:r<48?v(s,p,w)+C[2]:r<64?b(s,p,w)+C[3]:g(s,p,w)+C[4],T=(T=m(T|=0,B[r]))+_|0,o=_,_=w,w=m(p,10),p=s,s=T,T=S+t[e+M[r]]|0,T+=r<16?g(E,x,k)+P[0]:r<32?b(E,x,k)+P[1]:r<48?v(E,x,k)+P[2]:r<64?y(E,x,k)+P[3]:d(E,x,k)+P[4],T=(T=m(T|=0,j[r]))+A|0,S=A,A=k,k=m(x,10),x=E,E=T;T=R[1]+p+k|0,R[1]=R[2]+w+A|0,R[2]=R[3]+_+S|0,R[3]=R[4]+o+E|0,R[4]=R[0]+s+x|0,R[0]=T},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,r){return t^e^r}function y(t,e,r){return t&e|~t&r}function v(t,e,r){return(t|~e)^r}function b(t,e,r){return t&r|e&~r}function g(t,e,r){return t^(e|~r)}function m(t,e){return t<<e|t>>>32-e}e.RIPEMD160=o._createHelper(p),e.HmacRIPEMD160=o._createHmacHelper(p)}(Math),n.RIPEMD160)},function(t,e,r){var n,i,o,s,a,u,c,h,f;t.exports=(n=r(0),r(20),r(21),o=(i=n).lib,s=o.Base,a=o.WordArray,u=i.algo,c=u.SHA1,h=u.HMAC,f=u.PBKDF2=s.extend({cfg:s.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,n=h.create(r.hasher,t),i=a.create(),o=a.create([1]),s=i.words,u=o.words,c=r.keySize,f=r.iterations;s.length<c;){var l=n.update(e).finalize(o);n.reset();for(var p=l.words,d=p.length,y=l,v=1;v<f;v++){y=n.finalize(y),n.reset();for(var b=y.words,g=0;g<d;g++)p[g]^=b[g]}i.concat(l),u[0]++}return i.sigBytes=4*c,i}}),i.PBKDF2=function(t,e,r){return f.create(r).compute(t,e)},n.PBKDF2)},function(t,e,r){var n;t.exports=(n=r(0),r(1),n.mode.CFB=function(){var t=n.lib.BlockCipherMode.extend();function e(t,e,r,n){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;n.encryptBlock(o,0);for(var s=0;s<r;s++)t[e+s]^=o[s]}return t.Encryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize;e.call(this,t,r,i,n),this._prevBlock=t.slice(r,r+i)}}),t.Decryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize,o=t.slice(r,r+i);e.call(this,t,r,i,n),this._prevBlock=o}}),t}(),n.mode.CFB)},function(t,e,r){var n,i,o;t.exports=(n=r(0),r(1),n.mode.CTR=(i=n.lib.BlockCipherMode.extend(),o=i.Encryptor=i.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[n-1]=o[n-1]+1|0;for(var a=0;a<n;a++)t[e+a]^=s[a]}}),i.Decryptor=o,i),n.mode.CTR)},function(t,e,r){var n;t.exports=(n=r(0),r(1),
20/** @preserve
21 * Counter block mode compatible with Dr Brian Gladman fileenc.c
22 * derived from CryptoJS.mode.CTR
23 * Jan Hruby jhruby.web@gmail.com
24 */
25n.mode.CTRGladman=function(){var t=n.lib.BlockCipherMode.extend();function e(t){if(255==(t>>24&255)){var e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}else t+=1<<24;return t}var r=t.Encryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(s);var a=s.slice(0);n.encryptBlock(a,0);for(var u=0;u<i;u++)t[r+u]^=a[u]}});return t.Decryptor=r,t}(),n.mode.CTRGladman)},function(t,e,r){var n,i,o;t.exports=(n=r(0),r(1),n.mode.OFB=(i=n.lib.BlockCipherMode.extend(),o=i.Encryptor=i.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s<n;s++)t[e+s]^=o[s]}}),i.Decryptor=o,i),n.mode.OFB)},function(t,e,r){var n,i;t.exports=(n=r(0),r(1),n.mode.ECB=((i=n.lib.BlockCipherMode.extend()).Encryptor=i.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),i.Decryptor=i.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),i),n.mode.ECB)},function(t,e,r){var n;t.exports=(n=r(0),r(1),n.pad.AnsiX923={pad:function(t,e){var r=t.sigBytes,n=4*e,i=n-r%n,o=r+i-1;t.clamp(),t.words[o>>>2]|=i<<24-o%4*8,t.sigBytes+=i},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},n.pad.Ansix923)},function(t,e,r){var n;t.exports=(n=r(0),r(1),n.pad.Iso10126={pad:function(t,e){var r=4*e,i=r-t.sigBytes%r;t.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},n.pad.Iso10126)},function(t,e,r){var n;t.exports=(n=r(0),r(1),n.pad.Iso97971={pad:function(t,e){t.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(t,e)},unpad:function(t){n.pad.ZeroPadding.unpad(t),t.sigBytes--}},n.pad.Iso97971)},function(t,e,r){var n;t.exports=(n=r(0),r(1),n.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1;!(e[r>>>2]>>>24-r%4*8&255);)r--;t.sigBytes=r+1}},n.pad.ZeroPadding)},function(t,e,r){var n;t.exports=(n=r(0),r(1),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},function(t,e,r){var n,i,o,s;t.exports=(n=r(0),r(1),o=(i=n).lib.CipherParams,s=i.enc.Hex,i.format.Hex={stringify:function(t){return t.ciphertext.toString(s)},parse:function(t){var e=s.parse(t);return o.create({ciphertext:e})}},n.format.Hex)},function(t,e,r){var n;t.exports=(n=r(0),r(10),r(11),r(7),r(1),function(){var t=n,e=t.lib.BlockCipher,r=t.algo,i=[],o=[],s=[],a=[],u=[],c=[],h=[],f=[],l=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,n=0;for(e=0;e<256;e++){var d=n^n<<1^n<<2^n<<3^n<<4;d=d>>>8^255&d^99,i[r]=d,o[d]=r;var y=t[r],v=t[y],b=t[v],g=257*t[d]^16843008*d;s[r]=g<<24|g>>>8,a[r]=g<<16|g>>>16,u[r]=g<<8|g>>>24,c[r]=g,g=16843009*b^65537*v^257*y^16843008*r,h[d]=g<<24|g>>>8,f[d]=g<<16|g>>>16,l[d]=g<<8|g>>>24,p[d]=g,r?(r=y^t[t[t[b^y]]],n^=t[t[n]]):r=n=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],y=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s<n;s++)if(s<r)o[s]=e[s];else{var a=o[s-1];s%r?r>6&&s%r==4&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a]):(a=i[(a=a<<8|a>>>24)>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a],a^=d[s/r|0]<<24),o[s]=o[s-r]^a}for(var u=this._invKeySchedule=[],c=0;c<n;c++)s=n-c,a=c%4?o[s]:o[s-4],u[c]=c<4||s<=4?a:h[i[a>>>24]]^f[i[a>>>16&255]]^l[i[a>>>8&255]]^p[i[255&a]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,u,c,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,f,l,p,o),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,s,a){for(var u=this._nRounds,c=t[e]^r[0],h=t[e+1]^r[1],f=t[e+2]^r[2],l=t[e+3]^r[3],p=4,d=1;d<u;d++){var y=n[c>>>24]^i[h>>>16&255]^o[f>>>8&255]^s[255&l]^r[p++],v=n[h>>>24]^i[f>>>16&255]^o[l>>>8&255]^s[255&c]^r[p++],b=n[f>>>24]^i[l>>>16&255]^o[c>>>8&255]^s[255&h]^r[p++],g=n[l>>>24]^i[c>>>16&255]^o[h>>>8&255]^s[255&f]^r[p++];c=y,h=v,f=b,l=g}y=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&l])^r[p++],v=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[p++],b=(a[f>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[p++],g=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[p++],t[e]=y,t[e+1]=v,t[e+2]=b,t[e+3]=g},keySize:8});t.AES=e._createHelper(y)}(),n.AES)},function(t,e,r){var n;t.exports=(n=r(0),r(10),r(11),r(7),r(1),function(){var t=n,e=t.lib,r=e.WordArray,i=e.BlockCipher,o=t.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var n=s[r]-1;e[r]=t[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var c=i[o]=[],h=u[o];for(r=0;r<24;r++)c[r/6|0]|=e[(a[r]-1+h)%28]<<31-r%6,c[4+(r/6|0)]|=e[28+(a[r+24]-1+h)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var f=this._invSubKeys=[];for(r=0;r<16;r++)f[r]=i[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],l.call(this,4,252645135),l.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),l.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,s=this._rBlock,a=0,u=0;u<8;u++)a|=c[u][((s^i[u])&h[u])>>>0];this._lBlock=s,this._rBlock=o^a}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,l.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<<t}function p(t,e){var r=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<<t}t.DES=i._createHelper(f);var d=o.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=f.createEncryptor(r.create(t.slice(0,2))),this._des2=f.createEncryptor(r.create(t.slice(2,4))),this._des3=f.createEncryptor(r.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(d)}(),n.TripleDES)},function(t,e,r){var n;t.exports=(n=r(0),r(10),r(11),r(7),r(1),function(){var t=n,e=t.lib.StreamCipher,r=t.algo,i=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var s=i%r,a=e[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var u=n[i];n[i]=n[o],n[o]=u}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[r],t[r]=o,n|=t[(t[e]+t[r])%256]<<24-8*i}return this._i=e,this._j=r,n}t.RC4=e._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(s)}(),n.RC4)},function(t,e,r){var n;t.exports=(n=r(0),r(10),r(11),r(7),r(1),function(){var t=n,e=t.lib.StreamCipher,r=t.algo,i=[],o=[],s=[],a=r.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var n=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)u.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(e){var o=e.words,s=o[0],a=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=c>>>16|4294901760&h,l=h<<16|65535&c;for(i[0]^=c,i[1]^=f,i[2]^=h,i[3]^=l,i[4]^=c,i[5]^=f,i[6]^=h,i[7]^=l,r=0;r<4;r++)u.call(this)}},_doProcessBlock:function(t,e){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var t=this._X,e=this._C,r=0;r<8;r++)o[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<o[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<o[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<o[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<o[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<o[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<o[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<o[6]>>>0?1:0)|0,this._b=e[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=t[r]+e[r],i=65535&n,a=n>>>16,u=((i*i>>>17)+i*a>>>15)+a*a,c=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=u^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=e._createHelper(a)}(),n.Rabbit)},function(t,e,r){var n;t.exports=(n=r(0),r(10),r(11),r(7),r(1),function(){var t=n,e=t.lib.StreamCipher,r=t.algo,i=[],o=[],s=[],a=r.RabbitLegacy=e.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)u.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(e){var o=e.words,s=o[0],a=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=c>>>16|4294901760&h,l=h<<16|65535&c;for(n[0]^=c,n[1]^=f,n[2]^=h,n[3]^=l,n[4]^=c,n[5]^=f,n[6]^=h,n[7]^=l,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(t,e){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var t=this._X,e=this._C,r=0;r<8;r++)o[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<o[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<o[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<o[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<o[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<o[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<o[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<o[6]>>>0?1:0)|0,this._b=e[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=t[r]+e[r],i=65535&n,a=n>>>16,u=((i*i>>>17)+i*a>>>15)+a*a,c=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=u^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=e._createHelper(a)}(),n.RabbitLegacy)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Permissions=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.fields=e},function(t){t[t.R=0]="R",t[t.RW=1]="RW"}(e.AccessRight||(e.AccessRight={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AcceptedField=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pass=e,this.access=r}},function(e,r){e.exports=t},function(t,r){t.exports=e},function(t,e){t.exports=r},function(t,e){t.exports=n},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(103),o=r(25),s=r(104),a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,a;return e=t,a=[{key:"createHttpTransport",value:function(t){return new s.HttpTransportSyncedImpl(t)}},{key:"createJsonRpcHttpTransport",value:function(t){return new i.JsonRpcHttpTransport(new o.HttpTransportImpl(t))}}],(r=null)&&n(e.prototype,r),a&&n(e,a),t}();e.TransportFactory=a},function(t,e,r){"use strict";function n(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 i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var o=r(12),s=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=0,this.transport=e}var e,r,s;return e=t,(r=[{key:"request",value:function(t,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.id++,n={jsonrpc:"2.0",method:t,params:[e],id:this.id},r.abrupt("return",this.transport.sendRequest("/",o.HttpMethod.Post,n).then(function(t){return t.json.result}));case 3:case"end":return r.stop()}},r,this)}))}},{key:"disconnect",value:function(){}}])&&n(e.prototype,r),s&&n(e,s),t}();e.JsonRpcHttpTransport=s},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(105),o=r(26),s=r(28),a=r(27),u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.interceptors=[],this.transactions=[],this.headers=new Map([["Accept","application/json"],["Content-Type","application/json"]]),this.host=e}var e,r,u;return e=t,(r=[{key:"getHost",value:function(){return this.host}},{key:"sendRequest",value:function(t,e,r){var n=this;return new Promise(function(s,a){var u=new o.InterceptorCortege(t,e,n.headers,r);n.transactions.push(new i.Transaction(s,a,u)),1===n.transactions.length&&n.runTransaction(n.transactions[0])})}},{key:"addInterceptor",value:function(t){return-1===this.interceptors.indexOf(t)&&this.interceptors.push(t),this}},{key:"runTransaction",value:function(t){var e=this;this.acceptInterceptor(t.cortege).then(function(r){return new Promise(function(r,n){try{var i=t.cortege,o=i.path?e.getHost()+i.path:e.getHost(),u=new s.XMLHttpRequest;u.open(i.method,o),i.headers.forEach(function(t,e){u.setRequestHeader(e,t)}),u.onload=function(){var i=new a.Response(u.responseText,u.status);u.status>=200&&u.status<300?(r(),t.resolve(i),e.callNextRequest()):(n(),t.reject(i),e.callNextRequest())},u.onerror=function(){var r=new a.Response(u.responseText,u.status);n(),t.reject(r),e.callNextRequest()},u.send(JSON.stringify(i.data?i.data:{}))}catch(t){n(t)}})})}},{key:"acceptInterceptor",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return r>=this.interceptors.length?Promise.resolve(t):this.interceptors[r].onInterceptor(t).then(function(t){return e.acceptInterceptor(t,++r)})}},{key:"callNextRequest",value:function(){this.transactions.shift(),this.transactions.length>0&&this.runTransaction(this.transactions[0])}}])&&n(e.prototype,r),u&&n(e,u),t}();e.HttpTransportSyncedImpl=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Transaction=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.resolve=e,this.reject=r,this.cortege=n}},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(44),o=r(45),s=r(8),a=r(107),u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.accountRepository=new i.AccountRepositoryImpl(e),this.dataRequestRepository=new o.DataRequestRepositoryImpl(e),this.siteRepository=new a.SiteRepositoryImpl(e)}var e,r,u;return e=t,(r=[{key:"getSiteData",value:function(t){return this.siteRepository.getSiteData(t)}},{key:"getNonce",value:function(t){return this.accountRepository.getNonce(new s.Account(t))}},{key:"getGrantAccessRecords",value:function(t,e){return this.dataRequestRepository.getRequests(t,e)}}])&&n(e.prototype,r),u&&n(e,u),t}();e.AssistantNodeRepositoryImpl=u},function(t,e,r){"use strict";function n(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 i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var o=r(12),s=r(108),a=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.GET_SITE_DATA="/v1/site/{origin}",this.transport=e}var e,r,a;return e=t,(r=[{key:"getSiteData",value:function(t){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.transport.sendRequest(this.GET_SITE_DATA.replace("{origin}",t),o.HttpMethod.Get);case 2:return r=e.sent,e.abrupt("return",Object.assign(new s.Site,r.json));case 4:case"end":return e.stop()}},e,this)}))}}])&&n(e.prototype,r),a&&n(e,a),t}();e.SiteRepositoryImpl=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Site=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e,this.origin=r,this.publicKey=n,this.confidential=i}},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(46),o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.messageSigner=e}var e,r,o;return e=t,(r=[{key:"onInterceptor",value:function(t){var e=this;return null===t.data||void 0===t.data?Promise.resolve(t):this.messageSigner.signMessage(JSON.stringify(t.data)).then(function(r){return new Promise(function(n){t.data=new i.SignedRequest(t.data,e.messageSigner.getPublicKey(),r,0),n(t)})})}}])&&n(e.prototype,r),o&&n(e,o),t}();e.SignInterceptor=o},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(46),o=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.messageSigner=e,this.nonceSource=r}var e,r,o;return e=t,(r=[{key:"onInterceptor",value:function(t){return t.data instanceof i.SignedRequest||t.isTransaction()?this.nonceSource.getNonce(this.messageSigner.getPublicKey()).then(function(e){return t.data.nonce=++e,t}):Promise.resolve(t)}}])&&n(e.prototype,r),o&&n(e,o),t}();e.NonceInterceptor=o},function(t,e,r){"use strict";function n(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 i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var o=r(8),s=r(18),a=r(41),u=r(40),c=function(){function t(e,r,n,i,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.account=new o.Account,this.clientDataRepository=e,r.subscribe(this.onChangeAccount.bind(this)),this.encrypt=n,this.decrypt=i,this.signer=s}var e,r,c;return e=t,(r=[{key:"signMessage",value:function(t){return this.signer.signMessage(t)}},{key:"getData",value:function(){var t=this;return this.getRawData(this.account.publicKey).then(function(e){return t.decrypt.decryptFields(e)})}},{key:"getRawData",value:function(t){return this.clientDataRepository.getData(t)}},{key:"getAuthorizedData",value:function(t,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,o,u,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.decrypt.decryptMessage(t,e);case 2:return n=r.sent,i=JSON.parse(n),o=s.JsonUtils.jsonToMap(i),u=new Map,r.next=8,this.getRawData(t);case 8:if(r.t0=r.sent,r.t0){r.next=11;break}r.t0=new Map;case 11:return c=r.t0,o.forEach(function(t,e){if(c.has(e))try{var r=c.get(e),n=a.CryptoUtils.decryptAes256(r,t.pass);u.set(e,n)}catch(t){console.log("decryption error: ",e," => ",c.get(e),t)}}),r.abrupt("return",u);case 14:case"end":return r.stop()}},r,this)}))}},{key:"getAuthorizedEncryptionKeys",value:function(t,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,o,a,u;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.decrypt.decryptMessage(t,e);case 2:return n=r.sent,i=JSON.parse(n),o=s.JsonUtils.jsonToMap(i),a=new Map,r.next=8,this.getRawData(t);case 8:return u=r.sent,o.forEach(function(t,e){u.has(e)&&a.set(e,t.pass)}),r.abrupt("return",a);case 11:case"end":return r.stop()}},r,this)}))}},{key:"updateData",value:function(t){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("whlee21 updateData",t),console.log("whlee21 encrypt",this.encrypt instanceof u.BitKeyPair),e.next=4,this.encrypt.encryptFields(t);case 4:return r=e.sent,e.abrupt("return",this.clientDataRepository.updateData(this.account.publicKey,r));case 6:case"end":return e.stop()}},e,this)}))}},{key:"onChangeAccount",value:function(t){console.log("whlee21 ProfileManagerImpl onChangeAccount",t),this.account=t}}])&&n(e.prototype,r),c&&n(e,c),t}();e.ProfileManagerImpl=c},function(t,e,r){"use strict";function n(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)}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(12),o=r(18),s=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.CLIENT_GET_DATA="/v1/client/{pk}/",this.CLIENT_SET_DATA="/v1/client/",this.transport=e}var e,r,s;return e=t,(r=[{key:"getData",value:function(t){return this.transport.sendRequest(this.CLIENT_GET_DATA.replace("{pk}",t),i.HttpMethod.Get).then(function(t){return o.JsonUtils.jsonToMap(t.json)})}},{key:"updateData",value:function(t,e){return this.transport.sendRequest(this.CLIENT_SET_DATA,i.HttpMethod.Patch,o.JsonUtils.mapToJson(e)).then(function(t){return o.JsonUtils.jsonToMap(t.json)})}}])&&n(e.prototype,r),s&&n(e,s),t}();e.ClientDataRepositoryImpl=s},function(t,e,r){"use strict";function n(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 i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var o=r(18),s=r(8),a=function(){function t(e,r,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.account=new s.Account,this.dataRequestRepository=e,this.encrypt=n,this.decrypt=i,r.subscribe(this.onChangeAccount.bind(this))}var e,r,a;return e=t,(r=[{key:"requestPermissions",value:function(t,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.encrypt.encryptMessage(t,JSON.stringify(e).toLowerCase());case 2:return n=r.sent,r.abrupt("return",this.dataRequestRepository.requestPermissions(t,n));case 4:case"end":return r.stop()}},r,this)}))}},{key:"getRequests",value:function(t,e){return this.dataRequestRepository.getRequests(t,e)}},{key:"grantAccessForClient",value:function(t,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.encrypt.encryptPermissionsFields(t,e);case 2:return n=r.sent,r.abrupt("return",this.dataRequestRepository.grantAccessForClient(t,this.account.publicKey,n));case 4:case"end":return r.stop()}},r,this)}))}},{key:"getRequestedPermissions",value:function(t){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRequests(this.account.publicKey,t);case 2:return r=e.sent,e.abrupt("return",this.decodeRequestedPermissions(r,t));case 4:case"end":return e.stop()}},e,this)}))}},{key:"getRequestedPermissionsToMe",value:function(t){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRequests(t,this.account.publicKey);case 2:return r=e.sent,e.abrupt("return",this.decodeRequestedPermissions(r,t));case 4:case"end":return e.stop()}},e,this)}))}},{key:"getGrantedPermissions",value:function(t){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRequests(this.account.publicKey,t);case 2:return r=e.sent,e.abrupt("return",this.getDecodedGrantPermissions(r,t));case 4:case"end":return e.stop()}},e,this)}))}},{key:"getGrantedPermissionsToMe",value:function(t){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRequests(t,this.account.publicKey);case 2:return r=e.sent,e.abrupt("return",this.getDecodedGrantPermissions(r,t));case 4:case"end":return e.stop()}},e,this)}))}},{key:"decryptMessage",value:function(t,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.decrypt.decryptMessage(t,e);case 3:return n=r.sent,r.prev=4,r.abrupt("return",JSON.parse(n));case 8:return r.prev=8,r.t0=r.catch(4),r.abrupt("return",n);case 11:r.next=16;break;case 13:return r.prev=13,r.t1=r.catch(0),r.abrupt("return",e);case 16:case"end":return r.stop()}},r,this,[[0,13],[4,8]])}))}},{key:"decodeRequestedPermissions",value:function(t,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(t.length>0&&t[0].requestData.trim().length>0)){r.next=13;break}return r.prev=1,r.next=4,this.decrypt.decryptMessage(e,t[0].requestData);case 4:return n=r.sent,r.abrupt("return",JSON.parse(n));case 8:return r.prev=8,r.t0=r.catch(1),r.abrupt("return",[]);case 11:r.next=14;break;case 13:return r.abrupt("return",[]);case 14:case"end":return r.stop()}},r,this,[[1,8]])}))}},{key:"getDecodedGrantPermissions",value:function(t,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(t.length>0&&t[0].responseData.trim().length>0)){r.next=9;break}return r.next=3,this.decrypt.decryptMessage(e,t[0].responseData);case 3:return n=r.sent,i=JSON.parse(n),s=o.JsonUtils.jsonToMap(i),r.abrupt("return",Array.from(s.keys()));case 9:return r.abrupt("return",[]);case 10:case"end":return r.stop()}},r,this)}))}},{key:"onChangeAccount",value:function(t){this.account=t}}])&&n(e.prototype,r),a&&n(e,a),t}();e.DataRequestManagerImpl=a},function(t,e,r){"use strict";r.r(e);
26/*! *****************************************************************************
27Copyright (c) Microsoft Corporation. All rights reserved.
28Licensed under the Apache License, Version 2.0 (the "License"); you may not use
29this file except in compliance with the License. You may obtain a copy of the
30License at http://www.apache.org/licenses/LICENSE-2.0
31
32THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
33KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
34WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
35MERCHANTABLITY OR NON-INFRINGEMENT.
36
37See the Apache Version 2.0 License for specific language governing permissions
38and limitations under the License.
39***************************************************************************** */
40var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function o(t){return"function"==typeof t}var s=!1,a={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;s=t},get useDeprecatedSynchronousErrorHandling(){return s}};function u(t){setTimeout(function(){throw t})}var c={closed:!0,next:function(t){},error:function(t){if(a.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete:function(){}},h=Array.isArray||function(t){return t&&"number"==typeof t.length};function f(t){return null!=t&&"object"==typeof t}var l,p={e:{}};function d(){try{return l.apply(this,arguments)}catch(t){return p.e=t,p}}function y(t){return l=t,d}function v(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}v.prototype=Object.create(Error.prototype);var b=v,g=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var r=this._parent,n=this._parents,i=this._unsubscribe,s=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var a=-1,u=n?n.length:0;r;)r.remove(this),r=++a<u&&n[a]||null;if(o(i))y(i).call(this)===p&&(e=!0,t=t||(p.e instanceof b?m(p.e.errors):[p.e]));if(h(s))for(a=-1,u=s.length;++a<u;){var c=s[a];if(f(c))if(y(c.unsubscribe).call(c)===p){e=!0,t=t||[];var l=p.e;l instanceof b?t=t.concat(m(l.errors)):t.push(l)}}if(e)throw new b(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var r=e;switch(typeof e){case"function":r=new t(e);case"object":if(r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if("function"!=typeof r._addParent){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(r),r._addParent(this),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.prototype._addParent=function(t){var e=this._parent,r=this._parents;e&&e!==t?r?-1===r.indexOf(t)&&r.push(t):this._parents=[t]:this._parent=t},t.EMPTY=((e=new t).closed=!0,e),t}();function m(t){return t.reduce(function(t,e){return t.concat(e instanceof b?e.errors:e)},[])}var w="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),_=function(t){function e(r,n,i){var o=t.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,o._parentSubscription=null,arguments.length){case 0:o.destination=c;break;case 1:if(!r){o.destination=c;break}if("object"==typeof r){r instanceof e?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new S(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new S(o,r,n,i)}return o}return i(e,t),e.prototype[w]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this._parentSubscription=null,this},e}(g),S=function(t){function e(e,r,n,i){var s,a=t.call(this)||this;a._parentSubscriber=e;var u=a;return o(r)?s=r:r&&(s=r.next,n=r.error,i=r.complete,r!==c&&(o((u=Object.create(r)).unsubscribe)&&a.add(u.unsubscribe.bind(u)),u.unsubscribe=a.unsubscribe.bind(a))),a._context=u,a._next=s,a._error=n,a._complete=i,a}return i(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=a.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;u(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),a.useDeprecatedSynchronousErrorHandling)throw t;u(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(u(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(_);function E(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;if(r||i)return!1;t=n&&n instanceof _?n:null}return!0}var x="function"==typeof Symbol&&Symbol.observable||"@@observable";function k(){}function A(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return T(t)}function T(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:k}var R=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,i=function(t,e,r){if(t){if(t instanceof _)return t;if(t[w])return t[w]()}return t||e||r?new _(t,e,r):new _(c)}(t,e,r);if(n?n.call(i,this.source):i.add(this.source||a.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),a.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),E(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=C(e))(function(e,n){var i;i=r.subscribe(function(e){try{t(e)}catch(t){n(t),i&&i.unsubscribe()}},n,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[x]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:T(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=C(t))(function(t,r){var n;e.subscribe(function(t){return n=t},function(t){return r(t)},function(){return t(n)})})},t.create=function(e){return new t(e)},t}();function C(t){if(t||(t=a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}function P(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}P.prototype=Object.create(Error.prototype);var O=P,M=function(t){function e(e,r){var n=t.call(this)||this;return n.subject=e,n.subscriber=r,n.closed=!1,n}return i(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(g),B=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return i(e,t),e}(_),j=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return i(e,t),e.prototype[w]=function(){return new B(this)},e.prototype.lift=function(t){var e=new I(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new O;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new O;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new O;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new O;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new O;return this.hasError?(t.error(this.thrownError),g.EMPTY):this.isStopped?(t.complete(),g.EMPTY):(this.observers.push(t),new M(this,t))},e.prototype.asObservable=function(){var t=new R;return t.source=this,t},e.create=function(t,e){return new I(t,e)},e}(R),I=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return i(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):g.EMPTY},e}(j);var N=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var n=new D(t,r),i=e.subscribe(n);return n.closed||(n.connection=r.connect()),i},t}(),D=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return i(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},e}(_),H=function(t){function e(e,r){var n=t.call(this)||this;return n.source=e,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return i(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new g).add(this.source.subscribe(new q(this.getSubject(),this))),t.closed?(this._connection=null,t=g.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return(t=this).lift(new N(t));var t},e}(R),L=H.prototype,q=(L._subscribe,L._isComplete,L.getSubject,L.connect,L.refCount,function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return i(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(B));var U=function(t){function e(e,r,n){var i=t.call(this)||this;return i.key=e,i.groupSubject=r,i.refCountSubscription=n,i}return i(e,t),e.prototype._subscribe=function(t){var e=new g,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&e.add(new F(r)),e.add(n.subscribe(t)),e},e}(R),F=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,e.count++,r}return i(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(g),z=function(t){function e(e){var r=t.call(this)||this;return r._value=e,r}return i(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return r&&!r.closed&&e.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new O;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(j),K=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.pending=!1,n}return i(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return i(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(g)),W=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return i(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,n):e.flush(this)},e}(K),Y=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}(),V=function(t){function e(r,n){void 0===n&&(n=Y.now);var i=t.call(this,r,function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return i(e,t),e.prototype.schedule=function(r,n,i){return void 0===n&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(Y),G=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(V))(W),X=new R(function(t){return t.complete()});function J(t){return t?function(t){return new R(function(e){return t.schedule(function(){return e.complete()})})}(t):X}function $(t){return t&&"function"==typeof t.schedule}var Z=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.closed||e.complete()}};function Q(t,e){return new R(e?function(r){var n=new g,i=0;return n.add(e.schedule(function(){i!==t.length?(r.next(t[i++]),r.closed||n.add(this.schedule())):r.complete()})),n}:Z(t))}function tt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r,n,i=t[t.length-1];switch($(i)?t.pop():i=void 0,t.length){case 0:return J(i);case 1:return i?Q(t,i):(r=t[0],(n=new R(function(t){t.next(r),t.complete()}))._isScalar=!0,n.value=r,n);default:return Q(t,i)}}function et(t,e){return new R(e?function(r){return e.schedule(rt,0,{error:t,subscriber:r})}:function(e){return e.error(t)})}function rt(t){var e=t.error;t.subscriber.error(e)}var nt=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return tt(this.value);case"E":return et(this.error);case"C":return J()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var it=function(t){function e(e,r,n){void 0===n&&(n=0);var i=t.call(this,e)||this;return i.scheduler=r,i.delay=n,i}return i(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new ot(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(nt.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(nt.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(nt.createComplete()),this.unsubscribe()},e}(_),ot=function(){return function(t,e){this.notification=t,this.destination=e}}(),st=function(t){function e(e,r,n){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return i(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new at(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=n.length;if(this.closed)throw new O;if(this.isStopped||this.hasError?e=g.EMPTY:(this.observers.push(t),e=new M(this,t)),i&&t.add(t=new it(t,i)),r)for(var s=0;s<o&&!t.closed;s++)t.next(n[s]);else for(s=0;s<o&&!t.closed;s++)t.next(n[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||G).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(t-n[o].time<r);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&n.splice(0,o),n},e}(j),at=function(){return function(t,e){this.time=t,this.value=e}}(),ut=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return i(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),g.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),g.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(j),ct=1,ht={};var ft=function(t){var e=ct++;return ht[e]=t,Promise.resolve().then(function(){return function(t){var e=ht[t];e&&e()}(e)}),e},lt=function(t){delete ht[t]},pt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return i(e,t),e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e.scheduled||(e.scheduled=ft(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);0===e.actions.length&&(lt(r),e.scheduled=void 0)},e}(K),dt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,i=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n<i&&(t=r.shift()));if(this.active=!1,e){for(;++n<i&&(t=r.shift());)t.unsubscribe();throw e}},e}(V))(pt),yt=new V(K),vt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return i(e,t),e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(function(){return e.flush(null)})))},e.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},e}(K),bt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,i=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n<i&&(t=r.shift()));if(this.active=!1,e){for(;++n<i&&(t=r.shift());)t.unsubscribe();throw e}},e}(V))(vt),gt=function(t){function e(e,r){void 0===e&&(e=mt),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=t.call(this,e,function(){return n.frame})||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(e,t),e.prototype.flush=function(){for(var t,e,r=this.actions,n=this.maxFrames;(e=r.shift())&&(this.frame=e.delay)<=n&&!(t=e.execute(e.state,e.delay)););if(t){for(;e=r.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(V),mt=function(t){function e(e,r,n){void 0===n&&(n=e.index+=1);var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i.index=n,i.active=!0,i.index=e.index=n,i}return i(e,t),e.prototype.schedule=function(r,n){if(void 0===n&&(n=0),!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},e.prototype.requestAsyncId=function(t,r,n){void 0===n&&(n=0),this.delay=t.frame+n;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,r){void 0===r&&(r=0)},e.prototype._execute=function(e,r){if(!0===this.active)return t.prototype._execute.call(this,e,r)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(K);function wt(t){return t}function _t(t){return!!t&&(t instanceof R||"function"==typeof t.lift&&"function"==typeof t.subscribe)}function St(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}St.prototype=Object.create(Error.prototype);var Et=St;function xt(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}xt.prototype=Object.create(Error.prototype);var kt=xt;function At(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}At.prototype=Object.create(Error.prototype);var Tt=At;function Rt(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new Ct(t,e))}}var Ct=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Pt(t,this.project,this.thisArg))},t}(),Pt=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return i(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(_);function Ot(t,e,r){if(e){if(!$(e))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Ot(t,r).apply(void 0,n).pipe(Rt(function(t){return h(t)?e.apply(void 0,t):e(t)}))};r=e}return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i,o=this,s={context:o,subject:i,callbackFunc:t,scheduler:r};return new R(function(n){if(r){var a={args:e,subscriber:n,params:s};return r.schedule(Mt,0,a)}if(!i){i=new ut;try{t.apply(o,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.next(t.length<=1?t[0]:t),i.complete()}]))}catch(t){E(i)?i.error(t):console.warn(t)}}return i.subscribe(n)})}}function Mt(t){var e=this,r=t.args,n=t.subscriber,i=t.params,o=i.callbackFunc,s=i.context,a=i.scheduler,u=i.subject;if(!u){u=i.subject=new ut;try{o.apply(s,r.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.length<=1?t[0]:t;e.add(a.schedule(Bt,0,{value:n,subject:u}))}]))}catch(t){u.error(t)}}this.add(u.subscribe(n))}function Bt(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function jt(t,e,r){if(e){if(!$(e))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return jt(t,r).apply(void 0,n).pipe(Rt(function(t){return h(t)?e.apply(void 0,t):e(t)}))};r=e}return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i={subject:void 0,args:e,callbackFunc:t,scheduler:r,context:this};return new R(function(n){var o=i.context,s=i.subject;if(r)return r.schedule(It,0,{params:i,subscriber:n,context:o});if(!s){s=i.subject=new ut;try{t.apply(o,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.shift();r?s.error(r):(s.next(t.length<=1?t[0]:t),s.complete())}]))}catch(t){E(s)?s.error(t):console.warn(t)}}return s.subscribe(n)})}}function It(t){var e=this,r=t.params,n=t.subscriber,i=t.context,o=r.callbackFunc,s=r.args,a=r.scheduler,u=r.subject;if(!u){u=r.subject=new ut;try{o.apply(i,s.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.shift();if(n)e.add(a.schedule(Dt,0,{err:n,subject:u}));else{var i=t.length<=1?t[0]:t;e.add(a.schedule(Nt,0,{value:i,subject:u}))}}]))}catch(t){this.add(a.schedule(Dt,0,{err:t,subject:u}))}}this.add(u.subscribe(n))}function Nt(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function Dt(t){var e=t.err;t.subject.error(e)}var Ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(_),Lt=function(t){function e(e,r,n){var i=t.call(this)||this;return i.parent=e,i.outerValue=r,i.outerIndex=n,i.index=0,i}return i(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(_),qt=function(t){return function(e){return t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,u),e}};function Ut(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Ft=Ut(),zt=function(t){return function(e){for(var r=t[Ft]();;){var n=r.next();if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}return"function"==typeof r.return&&e.add(function(){r.return&&r.return()}),e}},Kt=function(t){return function(e){var r=t[x]();if("function"!=typeof r.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(e)}},Wt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Yt(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var Vt=function(t){if(t instanceof R)return function(e){return t._isScalar?(e.next(t.value),void e.complete()):t.subscribe(e)};if(t&&"function"==typeof t[x])return Kt(t);if(Wt(t))return Z(t);if(Yt(t))return qt(t);if(t&&"function"==typeof t[Ft])return zt(t);var e=f(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function Gt(t,e,r,n,i){if(void 0===i&&(i=new Lt(t,r,n)),!i.closed)return Vt(e)(i)}var Xt={};function Jt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null,n=null;return $(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&h(t[0])&&(t=t[0]),Q(t,n).lift(new $t(r))}var $t=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Zt(t,this.resultSelector))},t}(),Zt=function(t){function e(e,r){var n=t.call(this,e)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return i(e,t),e.prototype._next=function(t){this.values.push(Xt),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var n=t[r];this.add(Gt(this,n,n,r))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,r,n,i){var o=this.values,s=o[r],a=this.toRespond?s===Xt?--this.toRespond:this.toRespond:0;o[r]=e,0===a&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Ht);function Qt(t,e){if(!e)return t instanceof R?t:new R(Vt(t));if(null!=t){if(function(t){return t&&"function"==typeof t[x]}(t))return function(t,e){return new R(e?function(r){var n=new g;return n.add(e.schedule(function(){var i=t[x]();n.add(i.subscribe({next:function(t){n.add(e.schedule(function(){return r.next(t)}))},error:function(t){n.add(e.schedule(function(){return r.error(t)}))},complete:function(){n.add(e.schedule(function(){return r.complete()}))}}))})),n}:Kt(t))}(t,e);if(Yt(t))return function(t,e){return new R(e?function(r){var n=new g;return n.add(e.schedule(function(){return t.then(function(t){n.add(e.schedule(function(){r.next(t),n.add(e.schedule(function(){return r.complete()}))}))},function(t){n.add(e.schedule(function(){return r.error(t)}))})})),n}:qt(t))}(t,e);if(Wt(t))return Q(t,e);if(function(t){return t&&"function"==typeof t[Ft]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new R(e?function(r){var n,i=new g;return i.add(function(){n&&"function"==typeof n.return&&n.return()}),i.add(e.schedule(function(){n=t[Ft](),i.add(e.schedule(function(){if(!r.closed){var t,e;try{var i=n.next();t=i.value,e=i.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}}))})),i}:zt(t))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}var te=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new ee(t,this.project,this.concurrent))},t}(),ee=function(t){function e(e,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return i(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){var n=new Lt(this,void 0,void 0);this.destination.add(n),Gt(this,t,e,r,n)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(Ht);function re(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),function t(e,r,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof r?function(i){return i.pipe(t(function(t,n){return Qt(e(t,n)).pipe(Rt(function(e,i){return r(t,e,n,i)}))},n))}:("number"==typeof r&&(n=r),function(t){return t.lift(new te(e,n))})}(wt,t)}function ne(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length||2===t.length&&$(t[1])?Qt(t[0]):re(1)(tt.apply(void 0,t))}function ie(t){return new R(function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?Qt(r):J()).subscribe(e)})}function oe(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&h(e[0])&&(e=e[0]),0===e.length?X:t?oe(e).pipe(Rt(function(e){return t.apply(void 0,e)})):new R(function(t){return new se(t,e)})}var se=function(t){function e(e,r){var n=t.call(this,e)||this;n.sources=r,n.completed=0,n.haveValues=0;var i=r.length;n.values=new Array(i);for(var o=0;o<i;o++){var s=Gt(n,r[o],null,o);s&&n.add(s)}return n}return i(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.values[r]=e,i._hasValue||(i._hasValue=!0,this.haveValues++)},e.prototype.notifyComplete=function(t){var e=this.destination,r=this.haveValues,n=this.values,i=n.length;t._hasValue?(this.completed++,this.completed===i&&(r===i&&e.next(n),e.complete())):e.complete()},e}(Ht);Object.prototype.toString;function ae(t,e,r,n){return o(r)&&(n=r,r=void 0),n?ae(t,e,r).pipe(Rt(function(t){return h(t)?n.apply(void 0,t):n(t)})):new R(function(n){!function t(e,r,n,i,o){var s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var a=e;e.addEventListener(r,n,o),s=function(){return a.removeEventListener(r,n,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var u=e;e.on(r,n),s=function(){return u.off(r,n)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var c=e;e.addListener(r,n),s=function(){return c.removeListener(r,n)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var h=0,f=e.length;h<f;h++)t(e[h],r,n,i,o)}i.add(s)}(t,e,function(t){arguments.length>1?n.next(Array.prototype.slice.call(arguments)):n.next(t)},n,r)})}function ue(t,e,r){return r?ue(t,e).pipe(Rt(function(t){return h(t)?r.apply(void 0,t):r(t)})):new R(function(r){var n,i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.next(1===t.length?t[0]:t)};try{n=t(i)}catch(t){return void r.error(t)}if(o(e))return function(){return e(i,n)}})}function ce(t,e,r,n,i){var o,s;if(1==arguments.length){var a=t;s=a.initialState,e=a.condition,r=a.iterate,o=a.resultSelector||wt,i=a.scheduler}else void 0===n||$(n)?(s=t,o=wt,i=n):(s=t,o=n);return new R(function(t){var n=s;if(i)return i.schedule(he,0,{subscriber:t,iterate:r,condition:e,resultSelector:o,state:n});for(;;){if(e){var a=void 0;try{a=e(n)}catch(e){return void t.error(e)}if(!a){t.complete();break}}var u=void 0;try{u=o(n)}catch(e){return void t.error(e)}if(t.next(u),t.closed)break;try{n=r(n)}catch(e){return void t.error(e)}}})}function he(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(t){return void e.error(t)}if(!n)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function fe(t,e,r){return void 0===e&&(e=X),void 0===r&&(r=X),ie(function(){return t()?e:r})}function le(t){return!h(t)&&t-parseFloat(t)+1>=0}function pe(t,e){return void 0===t&&(t=0),void 0===e&&(e=yt),(!le(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=yt),new R(function(r){return r.add(e.schedule(de,t,{subscriber:r,counter:0,period:t})),r})}function de(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function ye(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return $(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof i&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof R?t[0]:re(r)(Q(t,n))}var ve=new R(k);function be(){return ve}function ge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return X;var r=t[0],n=t.slice(1);return 1===t.length&&h(r)?ge.apply(void 0,r):new R(function(t){var e=function(){return t.add(ge.apply(void 0,n).subscribe(t))};return Qt(r).subscribe({next:function(e){t.next(e)},error:e,complete:e})})}function me(t,e){return new R(e?function(r){var n=Object.keys(t),i=new g;return i.add(e.schedule(we,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}:function(e){for(var r=Object.keys(t),n=0;n<r.length&&!e.closed;n++){var i=r[n];t.hasOwnProperty(i)&&e.next([i,t[i]])}e.complete()})}function we(t){var e=t.keys,r=t.index,n=t.subscriber,i=t.subscription,o=t.obj;if(!n.closed)if(r<e.length){var s=e[r];n.next([s,o[s]]),i.add(this.schedule({keys:e,index:r+1,subscriber:n,subscription:i,obj:o}))}else n.complete()}function _e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!h(t[0]))return t[0];t=t[0]}return Q(t,void 0).lift(new Se)}var Se=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Ee(t))},t}(),Ee=function(t){function e(e){var r=t.call(this,e)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return i(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var r=0;r<e&&!this.hasFirst;r++){var n=t[r],i=Gt(this,n,n,r);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},e.prototype.notifyNext=function(t,e,r,n,i){if(!this.hasFirst){this.hasFirst=!0;for(var o=0;o<this.subscriptions.length;o++)if(o!==r){var s=this.subscriptions[o];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(e)},e}(Ht);function xe(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),new R(function(n){var i=0,o=t;if(r)return r.schedule(ke,0,{index:i,count:e,start:t,subscriber:n});for(;;){if(i++>=e){n.complete();break}if(n.next(o++),n.closed)break}})}function ke(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;r>=n?i.complete():(i.next(e),i.closed||(t.index=r+1,t.start=e+1,this.schedule(t)))}function Ae(t,e,r){void 0===t&&(t=0);var n=-1;return le(e)?n=Number(e)<1?1:Number(e):$(e)&&(r=e),$(r)||(r=yt),new R(function(e){var i=le(t)?t:+t-r.now();return r.schedule(Te,i,{index:0,period:n,subscriber:e})})}function Te(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(-1===r)return n.complete();t.index=e+1,this.schedule(t,r)}}function Re(t,e){return new R(function(r){var n,i;try{n=t()}catch(t){return void r.error(t)}try{i=e(n)}catch(t){return void r.error(t)}var o=(i?Qt(i):X).subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}})}function Ce(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),Q(t,void 0).lift(new Pe(r))}var Pe=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Oe(t,this.resultSelector))},t}(),Oe=function(t){function e(e,r,n){void 0===n&&(n=Object.create(null));var i=t.call(this,e)||this;return i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:null,i.values=n,i}return i(e,t),e.prototype._next=function(t){var e=this.iterators;h(t)?e.push(new Be(t)):"function"==typeof t[Ft]?e.push(new Me(t[Ft]())):e.push(new je(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var r=0;r<e;r++){var n=t[r];if(n.stillUnsubscribed)this.destination.add(n.subscribe(n,r));else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,n=0;n<e;n++){if("function"==typeof(s=t[n]).hasValue&&!s.hasValue())return}var i=!1,o=[];for(n=0;n<e;n++){var s,a=(s=t[n]).next();if(s.hasCompleted()&&(i=!0),a.done)return void r.complete();o.push(a.value)}this.resultSelector?this._tryresultSelector(o):r.next(o),i&&r.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(_),Me=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return t&&t.done},t}(),Be=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[Ft]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),je=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return i(e,t),e.prototype[Ft]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,r,n,i){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return Gt(this,this.observable,this,e)},e}(Ht);r.d(e,"Observable",function(){return R}),r.d(e,"ConnectableObservable",function(){return H}),r.d(e,"GroupedObservable",function(){return U}),r.d(e,"observable",function(){return x}),r.d(e,"Subject",function(){return j}),r.d(e,"BehaviorSubject",function(){return z}),r.d(e,"ReplaySubject",function(){return st}),r.d(e,"AsyncSubject",function(){return ut}),r.d(e,"asapScheduler",function(){return dt}),r.d(e,"asyncScheduler",function(){return yt}),r.d(e,"queueScheduler",function(){return G}),r.d(e,"animationFrameScheduler",function(){return bt}),r.d(e,"VirtualTimeScheduler",function(){return gt}),r.d(e,"VirtualAction",function(){return mt}),r.d(e,"Scheduler",function(){return Y}),r.d(e,"Subscription",function(){return g}),r.d(e,"Subscriber",function(){return _}),r.d(e,"Notification",function(){return nt}),r.d(e,"pipe",function(){return A}),r.d(e,"noop",function(){return k}),r.d(e,"identity",function(){return wt}),r.d(e,"isObservable",function(){return _t}),r.d(e,"ArgumentOutOfRangeError",function(){return Et}),r.d(e,"EmptyError",function(){return kt}),r.d(e,"ObjectUnsubscribedError",function(){return O}),r.d(e,"UnsubscriptionError",function(){return b}),r.d(e,"TimeoutError",function(){return Tt}),r.d(e,"bindCallback",function(){return Ot}),r.d(e,"bindNodeCallback",function(){return jt}),r.d(e,"combineLatest",function(){return Jt}),r.d(e,"concat",function(){return ne}),r.d(e,"defer",function(){return ie}),r.d(e,"empty",function(){return J}),r.d(e,"forkJoin",function(){return oe}),r.d(e,"from",function(){return Qt}),r.d(e,"fromEvent",function(){return ae}),r.d(e,"fromEventPattern",function(){return ue}),r.d(e,"generate",function(){return ce}),r.d(e,"iif",function(){return fe}),r.d(e,"interval",function(){return pe}),r.d(e,"merge",function(){return ye}),r.d(e,"never",function(){return be}),r.d(e,"of",function(){return tt}),r.d(e,"onErrorResumeNext",function(){return ge}),r.d(e,"pairs",function(){return me}),r.d(e,"race",function(){return _e}),r.d(e,"range",function(){return xe}),r.d(e,"throwError",function(){return et}),r.d(e,"timer",function(){return Ae}),r.d(e,"using",function(){return Re}),r.d(e,"zip",function(){return Ce}),r.d(e,"EMPTY",function(){return X}),r.d(e,"NEVER",function(){return ve}),r.d(e,"config",function(){return a})}])});
41//# sourceMappingURL=DbbClient.js.map
\No newline at end of file