From 7d421377826b91f52e35c1807276c06809ba75c0 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 6 Jun 2020 19:58:10 -0400 Subject: [PATCH] Fix bug preventing manual snes reconnect. Update WebUI to automatically connect if only one SNES device is detected. --- MultiClient.py | 11 +++---- data/web/package-lock.json | 31 +++++-------------- data/web/public/assets/index.bundle.js | 2 +- .../js/Monitor/containers/MonitorControls.js | 24 ++++++++------ 4 files changed, 28 insertions(+), 40 deletions(-) diff --git a/MultiClient.py b/MultiClient.py index 7f9e7809..612e7403 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -1209,7 +1209,7 @@ async def websocket_server(websocket: websockets.WebSocketServerProtocol, path, async for incoming_data in websocket: try: data = json.loads(incoming_data) - logging.debug(f"WebUIData:{data}") + logging.info(f"WebUIData:{data}") if ('type' not in data) or ('content' not in data): raise Exception('Invalid data received in websocket') @@ -1229,11 +1229,10 @@ async def websocket_server(websocket: websockets.WebSocketServerProtocol, path, ctx.ui_node.manual_snes = None ctx.snes_reconnect_address = None await snes_disconnect(ctx) - return - - await snes_disconnect(ctx) - ctx.ui_node.manual_snes = data['content']['deviceId'] - await snes_connect(ctx, ctx.snes_address) + else: + await snes_disconnect(ctx) + ctx.ui_node.manual_snes = data['content']['deviceId'] + await snes_connect(ctx, ctx.snes_address) elif data['type'] == 'webControl': if 'disconnect' in data['content']: diff --git a/data/web/package-lock.json b/data/web/package-lock.json index 4ae3a23a..06e94ba8 100644 --- a/data/web/package-lock.json +++ b/data/web/package-lock.json @@ -5044,14 +5044,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5066,20 +5064,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -5196,8 +5191,7 @@ "inherits": { "version": "2.0.4", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -5209,7 +5203,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5224,7 +5217,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5232,14 +5224,12 @@ "minimist": { "version": "1.2.5", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.9.0", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5258,7 +5248,6 @@ "version": "0.5.3", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "^1.2.5" } @@ -5320,8 +5309,7 @@ "npm-normalize-package-bin": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "npm-packlist": { "version": "1.4.8", @@ -5349,8 +5337,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -5362,7 +5349,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -5476,7 +5462,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/data/web/public/assets/index.bundle.js b/data/web/public/assets/index.bundle.js index 163137da..7ab5dc2a 100644 --- a/data/web/public/assets/index.bundle.js +++ b/data/web/public/assets/index.bundle.js @@ -41,4 +41,4 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,f=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case l:case d:case a:case u:case s:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case y:case m:case f:return e;default:return t}}case o:return t}}}function E(e){return S(e)===d}t.AsyncMode=l,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=f,t.Element=i,t.ForwardRef=h,t.Fragment=a,t.Lazy=y,t.Memo=m,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||S(e)===l},t.isConcurrentMode=E,t.isContextConsumer=function(e){return S(e)===c},t.isContextProvider=function(e){return S(e)===f},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return S(e)===h},t.isFragment=function(e){return S(e)===a},t.isLazy=function(e){return S(e)===y},t.isMemo=function(e){return S(e)===m},t.isPortal=function(e){return S(e)===o},t.isProfiler=function(e){return S(e)===u},t.isStrictMode=function(e){return S(e)===s},t.isSuspense=function(e){return S(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===u||e===s||e===p||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===f||e.$$typeof===c||e.$$typeof===h||e.$$typeof===g||e.$$typeof===w||e.$$typeof===_||e.$$typeof===v)},t.typeOf=S},function(e,t,n){var r=n(12),i=n(113);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#header-bar{font-size:3.4em;min-width:1036px}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(115);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#monitor{flex-grow:1;min-width:800px}\n",""]),e.exports=t},function(e,t,n){(function(t){var r;e.exports=(r=r||function(e,r){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==t&&t.crypto&&(i=t.crypto),!i)try{i=n(117)}catch(e){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},u=s.lib={},f=u.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=u.WordArray=f.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=f.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},p=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},b=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,f=e.min(4*u,o);if(u){for(var l=0;l0?a-4:a;for(n=0;n>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,l=n?i-1:0,d=n?-1:1,h=e[t+l];for(l+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+l],l+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+l],l+=d,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=f}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,f=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,f-=8);e[n+h-p]|=128*b}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(3),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(t=e.exports=n(57)).Stream=t,t.Readable=t,t.Writable=n(61),t.Duplex=n(17),t.Transform=n(63),t.PassThrough=n(128),t.finished=n(38),t.pipeline=n(129)},function(e,t){},function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,n,r,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,n=i,r=s,a.prototype.copy.call(t,n,r),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){r||(r=e),e&&a.forEach(f),o||(a.forEach(f),i(r))}))}));return t.reduce(c)}},function(e,t,n){var r=n(1),i=n(18),o=n(2).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<30|e>>>2}function c(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,l=0;l<16;++l)n[l]=e.readInt32BE(4*l);for(;l<80;++l)n[l]=n[l-3]^n[l-8]^n[l-14]^n[l-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=r)<<5|t>>>27)+c(h,i,o,s)+u+n[d]+a[h];u=s,s=o,o=f(i),i=r,r=p}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(1),i=n(18),o=n(2).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)n[d]=e.readInt32BE(4*d);for(;d<80;++d)n[d]=(t=n[d-3]^n[d-8]^n[d-14]^n[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),b=f(r)+l(p,i,o,s)+u+n[h]+a[p]|0;u=s,s=o,o=c(i),i=r,r=b}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(1),i=n(64),o=n(18),a=n(2).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}r(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,n){var r=n(1),i=n(65),o=n(18),a=n(2).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}r(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){},function(e,t,n){"use strict";var r=n(2).Buffer,i=n(137);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i,o=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=o,i=s,t.copy(n,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(139),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(5))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,a,s,u=1,f={},c=!1,l=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var n=this._ipad=i.allocUnsafe(64),r=this._opad=i.allocUnsafe(64),s=0;s<64;s++)n[s]=54^t[s],r[s]=92^t[s];this._hash=[n]}r(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},function(e,t,n){e.exports=n(73)},function(e,t,n){(function(t,r){var i,o=n(75),a=n(76),s=n(77),u=n(2).Buffer,f=t.crypto&&t.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function d(e,t,n,r,i){return f.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return f.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:i}},e,r<<3)})).then((function(e){return u.from(e)}))}e.exports=function(e,n,h,p,b,m){"function"==typeof b&&(m=b,b=void 0);var y=c[(b=b||"sha1").toLowerCase()];if(!y||"function"!=typeof t.Promise)return r.nextTick((function(){var t;try{t=s(e,n,h,p,b)}catch(e){return m(e)}m(null,t)}));if(o(e,n,h,p),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");u.isBuffer(e)||(e=u.from(e,a)),u.isBuffer(n)||(n=u.from(n,a)),function(e,t){e.then((function(e){r.nextTick((function(){t(null,e)}))}),(function(e){r.nextTick((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var n=d(i=i||u.alloc(8),i,10,128,e).then((function(){return!0})).catch((function(){return!1}));return l[e]=n,n}(y).then((function(t){return t?d(e,n,h,p,y):s(e,n,h,p,b)})),m)}}).call(this,n(5),n(6))},function(e,t,n){var r=n(149),i=n(44),o=n(45),a=n(162),s=n(31);function u(e,t,n){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function f(e,t,n){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=s(t,!1,n,r);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=s(t,!1,n,r);return f(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=f,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},function(e,t,n){var r=n(10),i=n(150),o=n(1),a=n(2).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(e){r.call(this);var t,n=e.mode.toLowerCase(),i=s[n];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==n&&"des-ede-cbc"!==n||(o=a.concat([o,o.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=i.create({key:o,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,o(u,r),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},function(e,t,n){"use strict";t.utils=n(78),t.Cipher=n(43),t.DES=n(79),t.CBC=n(151),t.EDE=n(152)},function(e,t,n){"use strict";var r=n(7),i=n(1),o={};function a(e){r.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),n=-1;++n>a%8,e._prev=o(e._prev,n?r:i);return s}function o(e,t){var n=e.length,i=-1,o=r.allocUnsafe(e.length);for(e=r.concat([e,r.from([t])]);++i>7;return o}t.encrypt=function(e,t,n){for(var o=t.length,a=r.allocUnsafe(o),s=-1;++s>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,n&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,n){var r=n(83),i=n(2).Buffer,o=n(45),a=n(84),s=n(10),u=n(30),f=n(31);function c(e,t,n){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(n),this._mode=e,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function d(e,t,n){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof n&&(n=i.from(n)),"GCM"!==s.mode&&n.length!==s.iv)throw new TypeError("invalid iv length "+n.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,n,!0):"auth"===s.type?new r(s.module,t,n,!0):new c(s.module,t,n)}n(1)(c,s),c.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,t),r.push(n);return i.concat(r)},c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var n=-1;for(;++n16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var n=o[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=f(t,!1,n.key,n.iv);return d(e,r.key,r.iv)},t.createDecipheriv=d},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,n){(function(e){var r=n(85),i=n(167),o=n(168);var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var n=new e(i[t].prime,"hex"),r=new e(i[t].gen,"hex");return new o(n,r)},t.createDiffieHellman=t.DiffieHellman=function t(n,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(n,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"==typeof n?new o(r(n,s),s,!0):(e.isBuffer(n)||(n=new e(n,i)),new o(n,s,!0)))}}).call(this,n(3).Buffer)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){},function(e,t){},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,n){(function(t){var r=n(4),i=new(n(86)),o=new r(24),a=new r(11),s=new r(10),u=new r(3),f=new r(7),c=n(85),l=n(15);function d(e,n){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),this._pub=new r(e),this}function h(e,n){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),this._priv=new r(e),this}e.exports=b;var p={};function b(e,t,n){this.setGenerator(t),this.__prime=new r(e),this._prime=r.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,n?(this.setPublicKey=d,this.setPrivateKey=h):this._primeCode=8}function m(e,n){var r=new t(e.toArray());return n?r.toString(n):r}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var n=t.toString("hex"),r=[n,e.toString(16)].join("_");if(r in p)return p[r];var l,d=0;if(e.isEven()||!c.simpleSieve||!c.fermatTest(e)||!i.test(e))return d+=1,d+="02"===n||"05"===n?8:4,p[r]=d,d;switch(i.test(e.shrn(1))||(d+=2),n){case"02":e.mod(o).cmp(a)&&(d+=8);break;case"05":(l=e.mod(s)).cmp(u)&&l.cmp(f)&&(d+=8);break;default:d+=4}return p[r]=d,d}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new r(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(e){var n=(e=(e=new r(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(n.toArray()),o=this.getPrime();if(i.length0&&n.ishrn(r),n}function l(e,n,i){var o,a;do{for(o=new t(0);8*o.length=0&&(a=t,s=n),r.negative&&(r=r.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),f=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(f).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=r.fromRed().isOdd();return(t&&!o||!t&&o)&&(r=r.redNeg()),this.point(e,r)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},f.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),u.prototype.jpoint=function(e,t,n){return new c(this,e,t,n)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),l=r.redMul(f),d=u.redSqr().redIAdd(c).redISub(l).redISub(l),h=u.redMul(l.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=n.redMul(u),l=s.redSqr().redIAdd(f).redISub(c).redISub(c),d=s.redMul(c.redISub(l)).redISub(i.redMul(f)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,n=0;n=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,n){"use strict";var r=n(4),i=n(1),o=n(32),a=n(8);function s(e){o.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,n){o.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,n){"use strict";var r=n(8),i=n(4),o=n(1),a=n(32),s=r.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function f(e,t,n,r,o){a.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(n,16),this.z=r?new i(r,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=r.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=r.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},o(f,a.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,n,r){return new f(this,e,t,n,r)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),s=r.redSub(t),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),l=a.redMul(o);return this.curve.point(u,f,l,c)},f.prototype._projDbl=function(){var e,t,n,r=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=r.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(f.redSub(o)),n=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=r.redSub(i).redISub(o).redMul(u),t=a.redMul(f.redSub(o)),n=a.redMul(u)}}else{var f=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=f.redSub(s).redSub(s);e=this.curve._mulC(r.redISub(f)).redMul(u),t=this.curve._mulC(f).redMul(i.redISub(o)),n=f.redMul(u)}return this.curve.point(e,t,n)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),s=i.redAdd(r),u=n.redAdd(t),f=o.redMul(a),c=s.redMul(u),l=o.redMul(u),d=a.redMul(s);return this.curve.point(f,c,d,l)},f.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=r.redMul(u).redMul(c);return this.curve.twisted?(t=r.redMul(f).redMul(a.redSub(this.curve._mulA(o))),n=u.redMul(f)):(t=r.redMul(f).redMul(a.redSub(o)),n=this.curve._mulC(u).redMul(f)),this.curve.point(l,t,n)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},f.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(e,t,n){"use strict";t.sha1=n(176),t.sha224=n(177),t.sha256=n(90),t.sha384=n(178),t.sha512=n(91)},function(e,t,n){"use strict";var r=n(9),i=n(26),o=n(89),a=r.rotl32,s=r.sum32,u=r.sum32_5,f=o.ft_1,c=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(d,c),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;rthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,n,o){"object"==typeof n&&(o=n,n=null),o||(o={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new r(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),f=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new r(1)),d=0;;d++){var h=o.k?o.k(d):new r(f.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var y=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new c({r:m,s:y,recoveryParam:v})}}}}}},l.prototype.verify=function(e,t,n,i){e=this._truncateToN(new r(e,16)),n=this.keyFromPublic(n,i);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),f=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,n.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(f,n.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,n,i){u((3&n)===n,"The recovery param is more than two bits"),t=new c(t,i);var o=this.n,a=new r(e),s=t.r,f=t.s,l=1&n,d=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),b=f.mul(h).umod(o);return this.g.mulAdd(p,s,b)},l.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new c(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,n){"use strict";var r=n(50),i=n(87),o=n(7);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),n=i.toArray(e.nonce,e.nonceEnc||"hex"),r=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}e.exports=a,a.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},a.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var o=[];o.length"}},function(e,t,n){"use strict";var r=n(4),i=n(8),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var n=e[t.place++];if(!(128&n))return n;for(var r=15&n,i=0,o=0,a=t.place;o>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var n=new s;if(48!==e[n.place++])return!1;if(u(e,n)+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=u(e,n),a=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var f=u(e,n);if(e.length!==f+n.place)return!1;var c=e.slice(n.place,f+n.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new r(a),this.s=new r(c),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=f(t),n=f(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];c(r,t.length),(r=r.concat(t)).push(2),c(r,n.length);var o=r.concat(n),a=[48];return c(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,n){"use strict";var r=n(50),i=n(49),o=n(8),a=o.assert,s=o.parseBytes,u=n(187),f=n(188);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),o=this.encodePoint(i),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),u=r.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(e,t,n){e=s(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=t)throw new Error("invalid sig")}e.exports=function(e,n,u,f,c){var l=o(u);if("ec"===l.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(e,t,n){var r=a[n.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var o=new i(r),s=n.data.subjectPrivateKey.data;return o.verify(t,e,s)}(e,n,l)}if("dsa"===l.type){if("dsa"!==f)throw new Error("wrong public key type");return function(e,t,n){var i=n.data.p,a=n.data.q,u=n.data.g,f=n.data.pub_key,c=o.signature.decode(e,"der"),l=c.s,d=c.r;s(l,a),s(d,a);var h=r.mont(i),p=l.invm(a);return 0===u.toRed(h).redPow(new r(t).mul(p).mod(a)).fromRed().mul(f.toRed(h).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(e,n,l)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");n=t.concat([c,n]);for(var d=l.modulus.byteLength(),h=[1],p=0;n.length+h.length+2n-d-2)throw new Error("message too long");var h=l.alloc(n-r-d-2),p=n-c-1,b=i(c),m=s(l.concat([f,h,l.alloc(1,1),t],p),a(b,p)),y=s(b,a(m,c));return new u(l.concat([l.alloc(1),y,m],n))}(p,t);else if(1===d)h=function(e,t,n){var r,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");r=n?l.alloc(a-o-3,255):function(e){var t,n=l.allocUnsafe(e),r=0,o=i(2*e),a=0;for(;r=0)throw new Error("data too long for modulus")}return n?c(h,p):f(h,p)}},function(e,t,n){var r=n(33),i=n(97),o=n(98),a=n(4),s=n(47),u=n(21),f=n(99),c=n(2).Buffer;e.exports=function(e,t,n){var l;l=e.padding?e.padding:n?1:4;var d,h=r(e),p=h.modulus.byteLength();if(t.length>p||new a(t).cmp(h.modulus)>=0)throw new Error("decryption error");d=n?f(new a(t),h):s(t,h);var b=c.alloc(p-d.length);if(d=c.concat([b,d],p),4===l)return function(e,t){var n=e.modulus.byteLength(),r=u("sha1").update(c.alloc(0)).digest(),a=r.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),f=t.slice(a+1),l=o(s,i(f,a)),d=o(f,i(l,n-a-1));if(function(e,t){e=c.from(e),t=c.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==r.toString("hex")&&!n||"0001"!==r.toString("hex")&&n)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,d,n);if(3===l)return d;throw new Error("unknown padding")}},function(e,t,n){"use strict";(function(e,r){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=n(2),a=n(15),s=o.Buffer,u=o.kMaxLength,f=e.crypto||e.msCrypto,c=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>c||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function d(e,t,n){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>c||e<0)throw new TypeError("size must be a uint32");if(e+t>n||e>u)throw new RangeError("buffer too small")}function h(e,t,n,i){if(r.browser){var o=e.buffer,s=new Uint8Array(o,t,n);return f.getRandomValues(s),i?void r.nextTick((function(){i(null,e)})):e}if(!i)return a(n).copy(e,t),e;a(n,(function(n,r){if(n)return i(n);r.copy(e,t),i(null,e)}))}f&&f.getRandomValues||!r.browser?(t.randomFill=function(t,n,r,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof n)i=n,n=0,r=t.length;else if("function"==typeof r)i=r,r=t.length-n;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(n,t.length),d(r,n,t.length),h(t,n,r,i)},t.randomFillSync=function(t,n,r){void 0===n&&(n=0);if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(n,t.length),void 0===r&&(r=t.length-n);return d(r,n,t.length),h(t,n,r)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,n(5),n(6))},function(e,t,n){var r=n(12),i=n(209);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#monitor-controls{display:flex;flex-direction:row;justify-content:space-between;height:48px;margin-top:0.5em;padding-bottom:0.5em}#monitor-controls #connection-status{display:flex;flex-direction:row}#monitor-controls #connection-status #snes-connection,#monitor-controls #connection-status #server-connection{margin-right:1em}#monitor-controls #connection-status #snes-connection table td,#monitor-controls #connection-status #server-connection table td{padding-right:0.5em}#monitor-controls #connection-status .connected{color:#008000}#monitor-controls #connection-status .not-connected{color:#ff0000}#monitor-controls #connection-status button{border-radius:3px}#monitor-controls #accessibility{display:flex;flex-direction:column;height:48px}#monitor-controls #accessibility button{border-radius:4px;margin:0.5em}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(211);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#monitor-window-wrapper #monitor-window{display:flex;flex-direction:column;justify-content:flex-start;background-color:#414042;color:#dce7df;overflow-y:auto;margin-bottom:10px}#monitor-window-wrapper #monitor-window div{width:calc(100% - 14px);padding:7px;border-bottom:1px solid #000000}#monitor-window-wrapper #monitor-window div.user-command{color:#ffffff;background-color:#575757}#monitor-window-wrapper #monitor-window.relevant-only div:not(.relevant){visibility:collapse}#monitor-window-wrapper #monitor-window .item-span{color:#67e9ff}#monitor-window-wrapper #monitor-window .location-span{color:#f5e63c}#monitor-window-wrapper #monitor-window .entrance-span{color:#73ae38}#monitor-window-wrapper #monitor-window .finder-span{color:#f96cb8}#monitor-window-wrapper #monitor-window .recipient-span{color:#9b8aff}#monitor-window-wrapper #monitor-window .mine{color:#ffa500}#monitor-window-wrapper #command-wrapper{display:flex;flex-direction:row;justify-content:flex-start;height:25px;line-height:25px}#monitor-window-wrapper #command-wrapper input{margin-left:0.5em;flex-grow:1}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(213);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#widget-area{margin-left:0.5em;margin-right:0.5em;padding:0.25em;border:2px solid #6a6a6a}#widget-area:not(.collapsed){width:calc(20% - 1.5em - 4px)}#widget-area #widget-button-row{width:100%;text-align:right}#widget-area #widget-button-row .collapse-button{width:35px}#widget-area #widget-area-contents{display:flex;flex-direction:column}#widget-area #widget-area-contents #notes{display:flex;flex-direction:column}#widget-area #widget-area-contents #notes #notes-title{display:flex;flex-direction:row;justify-content:space-between}#widget-area #widget-area-contents #notes textarea{height:10em}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(215);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#web-ui{width:calc(100% - 1.5em);padding:0.75em}#web-ui #content-middle{display:flex;flex-direction:row}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(217);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){var r=n(13),i=n(218),o=n(219);t=r(!1);var a=i(o);t.push([e.i,'@font-face{font-family:HyliaSerif;src:local("HyliaSerif"),url('+a+")}body{background-color:#131313;color:#eae703;font-family:HyliaSerif, serif;letter-spacing:2px;margin:0}\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e,t){return t||(t={}),"string"!=typeof(e=e&&e.__esModule?e.default:e)?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},function(e,t,n){"use strict";n.r(t),t.default="assets/fonts/HyliaSerif.otf"},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),o=n(34),a=n.n(o),s=(n(108),i.a.createContext(null));var u=function(e){e()},f={notify:function(){}};function c(){var e=u,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var l=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=f,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=c())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=f)},e}();var d=function(e){var t=e.store,n=e.context,o=e.children,a=Object(r.useMemo)((function(){var e=new l(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),u=Object(r.useMemo)((function(){return t.getState()}),[t]);Object(r.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),u!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,u]);var f=n||s;return i.a.createElement(f.Provider,{value:a},o)};function h(){return(h=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}var b=n(52),m=n.n(b),y=n(51),v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,g=[],w=[null,null];function _(e,t){var n=e[1];return[t.payload,n+1]}function S(e,t,n){v((function(){return e.apply(void 0,t)}),n)}function E(e,t,n,r,i,o,a){e.current=r,t.current=i,n.current=!1,o.current&&(o.current=null,a())}function k(e,t,n,r,i,o,a,s,u,f){if(e){var c=!1,l=null,d=function(){if(!c){var e,n,d=t.getState();try{e=r(d,i.current)}catch(e){n=e,l=e}n||(l=null),e===o.current?a.current||u():(o.current=e,s.current=e,a.current=!0,f({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=d,n.trySubscribe(),d();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,l)throw l}}}var x=function(){return[null,0]};function M(e,t){void 0===t&&(t={});var n=t,o=n.getDisplayName,a=void 0===o?function(e){return"ConnectAdvanced("+e+")"}:o,u=n.methodName,f=void 0===u?"connectAdvanced":u,c=n.renderCountProp,d=void 0===c?void 0:c,b=n.shouldHandleStateChanges,v=void 0===b||b,M=n.storeKey,T=void 0===M?"store":M,A=(n.withRef,n.forwardRef),P=void 0!==A&&A,C=n.context,R=void 0===C?s:C,O=p(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),I=R;return function(t){var n=t.displayName||t.name||"Component",o=a(n),s=h({},O,{getDisplayName:a,methodName:f,renderCountProp:d,shouldHandleStateChanges:v,storeKey:T,displayName:o,wrappedComponentName:n,WrappedComponent:t}),u=O.pure;var c=u?r.useMemo:function(e){return e()};function b(n){var o=Object(r.useMemo)((function(){var e=n.forwardedRef,t=p(n,["forwardedRef"]);return[n.context,e,t]}),[n]),a=o[0],u=o[1],f=o[2],d=Object(r.useMemo)((function(){return a&&a.Consumer&&Object(y.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:I}),[a,I]),b=Object(r.useContext)(d),m=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(b)&&Boolean(b.store);var M=m?n.store:b.store,T=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,s)}(M)}),[M]),A=Object(r.useMemo)((function(){if(!v)return w;var e=new l(M,m?null:b.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[M,m,b]),P=A[0],C=A[1],R=Object(r.useMemo)((function(){return m?b:h({},b,{subscription:P})}),[m,b,P]),O=Object(r.useReducer)(_,g,x),j=O[0][0],B=O[1];if(j&&j.error)throw j.error;var N=Object(r.useRef)(),D=Object(r.useRef)(f),L=Object(r.useRef)(),z=Object(r.useRef)(!1),U=c((function(){return L.current&&f===D.current?L.current:T(M.getState(),f)}),[M,j,f]);S(E,[D,N,z,f,U,L,C]),S(k,[v,M,P,T,D,N,z,L,C,B],[M,P,T]);var F=Object(r.useMemo)((function(){return i.a.createElement(t,h({},U,{ref:u}))}),[u,t,U]);return Object(r.useMemo)((function(){return v?i.a.createElement(d.Provider,{value:R},F):F}),[d,F,R])}var M=u?i.a.memo(b):b;if(M.WrappedComponent=t,M.displayName=o,P){var A=i.a.forwardRef((function(e,t){return i.a.createElement(M,h({},e,{forwardedRef:t}))}));return A.displayName=o,A.WrappedComponent=t,m()(A,t)}return m()(M,t)}}function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function A(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function F(e,t){return e===t}function q(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?M:n,i=t.mapStateToPropsFactories,o=void 0===i?j:i,a=t.mapDispatchToPropsFactories,s=void 0===a?I:a,u=t.mergePropsFactories,f=void 0===u?N:u,c=t.selectorFactory,l=void 0===c?z:c;return function(e,t,n,i){void 0===i&&(i={});var a=i,u=a.pure,c=void 0===u||u,d=a.areStatesEqual,b=void 0===d?F:d,m=a.areOwnPropsEqual,y=void 0===m?A:m,v=a.areStatePropsEqual,g=void 0===v?A:v,w=a.areMergedPropsEqual,_=void 0===w?A:w,S=p(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=U(e,o,"mapStateToProps"),k=U(t,s,"mapDispatchToProps"),x=U(n,f,"mergeProps");return r(l,h({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:k,initMergeProps:x,pure:c,areStatesEqual:b,areOwnPropsEqual:y,areStatePropsEqual:g,areMergedPropsEqual:_},S))}}var H=q();var W;W=o.unstable_batchedUpdates,u=W;var K=n(101),V=(n(112),function(){return i.a.createElement("div",{id:"header-bar"},"Multiworld WebUI")});n(114);var $=function(e,t){for(var n=-1,r=null==e?0:e.length;++n-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve["[object Arguments]"]=ve["[object Array]"]=ve["[object ArrayBuffer]"]=ve["[object Boolean]"]=ve["[object DataView]"]=ve["[object Date]"]=ve["[object Error]"]=ve["[object Function]"]=ve["[object Map]"]=ve["[object Number]"]=ve["[object Object]"]=ve["[object RegExp]"]=ve["[object Set]"]=ve["[object String]"]=ve["[object WeakMap]"]=!1;var ge=function(e){return se(e)&&ye(e.length)&&!!ve[ae(e)]};var we=function(e){return function(t){return e(t)}},_e=n(54),Se=_e.a&&_e.a.isTypedArray,Ee=Se?we(Se):ge,ke=Object.prototype.hasOwnProperty;var xe=function(e,t){var n=he(e),r=!n&&de(e),i=!n&&!r&&Object(pe.a)(e),o=!n&&!r&&!i&&Ee(e),a=n||r||i||o,s=a?X(e.length,String):[],u=s.length;for(var f in e)!t&&!ke.call(e,f)||a&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||me(f,u))||s.push(f);return s},Me=Object.prototype;var Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)};var Ae=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Pe=Object.prototype.hasOwnProperty;var Ce=function(e){if(!Te(e))return Ae(e);var t=[];for(var n in Object(e))Pe.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Re=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Oe=function(e){if(!Re(e))return!1;var t=ae(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var Ie=function(e){return null!=e&&ye(e.length)&&!Oe(e)};var je=function(e){return Ie(e)?xe(e):Ce(e)};var Be=function(e,t){return function(n,r){if(null==n)return n;if(!Ie(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.a.createElement("span",{className:"finder-span ".concat(n?"mine":null)},e,t?"'s":null)},He=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.a.createElement("span",{className:"recipient-span ".concat(n?"mine":null)},e,t?"'s":null)},We=function(e){return i.a.createElement("span",{className:"item-span"},e)},Ke=function(e){return i.a.createElement("span",{className:"location-span"},e)},Ve=function(e){return i.a.createElement("span",{className:"entrance-span"},e)},$e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};Fe($e,"createTextDiv",(function(e){return i.a.createElement("div",{key:"".concat(Ue()(e)).concat(Math.floor(1e6*Math.random()))},e)})),Fe($e,"sentItem",(function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return i.a.createElement("div",{key:"".concat(Ue()(e+t+n+r)).concat(Math.floor(1e6*Math.random())),className:o||a?"relevant":null},qe(e,!1,o)," found ",He(t,!0,a)," ",We(n)," at ",Ke(r))})),Fe($e,"receivedItem",(function(e,t,n,r,o){return i.a.createElement("div",{key:"".concat(Ue()(e+t+n)).concat(Math.floor(1e6*Math.random())),className:"relevant"},"(",r,"/",o,") ",qe(e,!1)," found your ",We(t)," at ",Ke(n))})),Fe($e,"foundItem",(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return i.a.createElement("div",{key:"".concat(Ue()(e+t+n)).concat(Math.floor(1e6*Math.random())),className:r?"relevant":null},qe(e,!1,r)," found their own ",We(t)," at ",Ke(n))})),Fe($e,"hintMessage",(function(e,t,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;return i.a.createElement("div",{key:"".concat(Ue()(e+t+n+r)).concat(Math.floor(1e6*Math.random())),className:a||s?"relevant":null},He(t,!0,s)," ",We(n)," can be found in ",qe(e,!0,a)," world at ",Ke(r),u?[", which is at ",Ve(u)]:null,"  (",o?"✔":"❌",")")}));var Ye=$e,Xe=function(e){return{type:"APPEND_MESSAGE",content:e}},Qe=function(e){return{type:"UPDATE_GAME_STATE",gameState:e}},Ge=function(e){return{type:"SET_AVAILABLE_DEVICES",devices:e}};function Je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ze=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};Je(Ze,"formatSocketData",(function(e,t){return JSON.stringify({type:e,content:t})})),Je(Ze,"handleIncomingMessage",(function(e){try{var t=JSON.parse(e.data);switch(t.type){case"connections":return Qe({connections:{snesDevice:t.content.snesDevice?t.content.snesDevice:"",snesConnected:3===parseInt(t.content.snes,10),serverAddress:t.content.serverAddress?t.content.serverAddress.replace(/^.*\/\//,""):null,serverConnected:1===parseInt(t.content.server,10)}});case"availableDevices":return Ge(t.content.devices);case"serverAddress":return Xe(Ye.createTextDiv("Unable to automatically connect to multiworld server. Please enter an address manually."));case"itemSent":return Xe(Ye.sentItem(t.content.finder,t.content.recipient,t.content.item,t.content.location,1===parseInt(t.content.iAmFinder,10),1===parseInt(t.content.iAmRecipient,10)));case"itemReceived":return Xe(Ye.receivedItem(t.content.finder,t.content.item,t.content.location,t.content.itemIndex,t.content.queueLength));case"itemFound":return Xe(Ye.foundItem(t.content.finder,t.content.item,t.content.location,1===parseInt(t.content.iAmFinder,10)));case"hint":return Xe(Ye.hintMessage(t.content.finder,t.content.recipient,t.content.item,t.content.location,1===parseInt(t.content.found,10),1===parseInt(t.content.iAmFinder,10),1===parseInt(t.content.iAmRecipient,10),t.content.entranceLocation));case"critical":case"error":case"warning":case"info":case"chat":return Xe(Ye.createTextDiv("string"==typeof t.content?t.content:JSON.stringify(t.content)));default:return console.warn("Unknown message type received: ".concat(t.type)),console.warn(t.content),{type:"NO_OP"}}}catch(t){return console.error(e),console.error(t),{type:"NO_OP"}}}));var et=Ze,tt=(n(208),function(e){return{type:"SET_MONITOR_FONT_SIZE",fontSize:e}}),nt=function(e){return{type:"SET_SHOW_RELEVANT",showRelevant:e}};function rt(e){return(rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function it(e,t){for(var n=0;n=25||t.props.updateFontSize(t.props.fontSize+1)})),ct(ut(t),"decreaseTextSize",(function(){t.props.fontSize<=10||t.props.updateFontSize(t.props.fontSize-1)})),ct(ut(t),"generateSnesOptions",(function(){var e=[];return 0===t.props.availableDevices.length?(e.push(i.a.createElement("option",{key:"0",value:"-1"},"Waiting for devices...")),e):(e.push(i.a.createElement("option",{key:"-1",value:"-1"},"Select a device")),Le(t.props.availableDevices,(function(t){e.push(i.a.createElement("option",{key:t,value:t},t))})),e)})),ct(ut(t),"updateDeviceId",(function(e){return t.setState({deviceId:e.target.value},t.connectToSnes)})),ct(ut(t),"pollSnesDevices",(function(){t.props.webSocket&&t.props.webSocket.send(et.formatSocketData("webStatus","devices"))})),ct(ut(t),"connectToSnes",(function(){t.props.webSocket&&t.props.webSocket.send(et.formatSocketData("webConfig",{deviceId:t.state.deviceId}))})),ct(ut(t),"updateServerAddress",(function(e){return t.setState({serverAddress:e.target.value?e.target.value:null})})),ct(ut(t),"connectToServer",(function(e){"Enter"===e.key&&(e.target.value?t.props.webSocket.send(et.formatSocketData("webConfig",{serverAddress:t.state.serverAddress})):t.props.webSocket.send(et.formatSocketData("webControl","disconnect")))})),ct(ut(t),"toggleRelevance",(function(e){t.props.doToggleRelevance(e.target.checked)})),t.state={deviceId:null,serverAddress:t.props.serverAddress},t}return t=a,(n=[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.props.webSocket&&(e.pollSnesDevices(),setTimeout((function(){1===e.props.availableDevices.length&&e.setState({deviceId:e.props.availableDevices[0]},(function(){e.props.snesConnected||e.connectToSnes()}))}),500))}),500)}},{key:"render",value:function(){return i.a.createElement("div",{id:"monitor-controls"},i.a.createElement("div",{id:"connection-status"},i.a.createElement("div",{id:"snes-connection"},i.a.createElement("table",null,i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("td",null,"SNES Device:"),i.a.createElement("td",null,i.a.createElement("select",{onChange:this.updateDeviceId,disabled:0===this.props.availableDevices.length,value:this.state.deviceId},this.generateSnesOptions()))),i.a.createElement("tr",null,i.a.createElement("td",null,"Status:"),i.a.createElement("td",null,i.a.createElement("span",{className:this.props.snesConnected?"connected":"not-connected"},this.props.snesConnected?"Connected":"Not Connected")))))),i.a.createElement("div",{id:"server-connection"},i.a.createElement("table",null,i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("td",null,"Server:"),i.a.createElement("td",null,i.a.createElement("input",{defaultValue:this.props.serverAddress,onKeyUp:this.updateServerAddress,onKeyDown:this.connectToServer}))),i.a.createElement("tr",null,i.a.createElement("td",null,"Status:"),i.a.createElement("td",null,i.a.createElement("span",{className:this.props.serverConnected?"connected":"not-connected"},this.props.serverConnected?"Connected":"Not Connected"))))))),i.a.createElement("div",{id:"accessibility"},i.a.createElement("div",null,"Text Size:",i.a.createElement("button",{disabled:this.props.fontSize<=10,onClick:this.decreaseTextSize},"-"),this.props.fontSize,i.a.createElement("button",{disabled:this.props.fontSize>=25,onClick:this.increaseTextSize},"+")),i.a.createElement("div",null,"Only show my items ",i.a.createElement("input",{type:"checkbox",onChange:this.toggleRelevance}))))}}])&&it(t.prototype,n),r&&it(t,r),a}(r.Component),dt=H((function(e){return{fontSize:e.monitor.fontSize,webSocket:e.webUI.webSocket,availableDevices:e.webUI.availableDevices,snesDevice:e.gameState.connections.snesDevice,snesConnected:e.gameState.connections.snesConnected,serverAddress:e.gameState.connections.serverAddress,serverConnected:e.gameState.connections.serverConnected}}),(function(e){return{updateFontSize:function(t){e(tt(t))},doToggleRelevance:function(t){e(nt(t))}}}))(lt);n(210);function ht(e){return(ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pt(e,t){for(var n=0;n=20)t.props.appendMonitorMessage(Ye.createTextDiv("Unable to connect to MultiClient. Maximum of 20 attempts exceeded."));else{var e=new URLSearchParams(document.location.search.substring(1)).get("port");if(!e)throw new Error("Unable to determine socket port from GET parameters");var n="ws://localhost:".concat(e);try{t.props.webSocket.close(),t.props.doSetWebSocket(null)}catch(e){}var r=new WebSocket(n);r.onerror=function(){t.props.doUpdateGameState({connections:{snesDevice:t.props.connections.snesDevice,snesConnected:!1,serverAddress:t.props.connections.serverAddress,serverConnected:!1}}),t.state.connectionAttempts0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(mn);var gn=function(e,t){return vn(pn(e,t,Ne),e+"")};var wn=function(e,t,n){if(!Re(n))return!1;var r=typeof t;return!!("number"==r?Ie(n)&&me(t,n.length):"string"==r&&t in n)&&un(n[t],e)};var _n=function(e){return gn((function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&wn(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r0&&void 0!==arguments[0]?arguments[0]:kn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_WEBSOCKET":return En({},e,{webSocket:t.webSocket});case"SET_AVAILABLE_DEVICES":return En({},e,{availableDevices:t.devices});default:return e}},Mn={connections:{snesDevice:"",snesConnected:!1,serverAddress:null,serverConnected:!1},hints:{hintCost:null,checkPoints:null,playerPoints:0}},Tn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_GAME_STATE":return En({},e,t.gameState);default:return e}},An={fontSize:18,showRelevantOnly:!1,messageLog:[]},Pn=function(e,t){var n=e.slice(-349);return n.push(t),n},Cn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:An,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_MONITOR_FONT_SIZE":return En({},e,{fontSize:t.fontSize});case"SET_SHOW_RELEVANT":return En({},e,{showRelevantOnly:t.showRelevant});case"APPEND_MESSAGE":return En({},e,{messageLog:Pn(e.messageLog,t.content)});default:return e}},Rn=Object(P.createStore)(Object(P.combineReducers)({webUI:xn,gameState:Tn,monitor:Cn}),Object(K.composeWithDevTools)()),On=function(){return i.a.createElement(d,{store:Rn},i.a.createElement(Wt,null))};window.onload=function(){a.a.render(i.a.createElement(On,null),document.getElementById("app"))}}]); \ No newline at end of file + */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,f=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case l:case d:case a:case u:case s:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case y:case m:case f:return e;default:return t}}case o:return t}}}function E(e){return S(e)===d}t.AsyncMode=l,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=f,t.Element=i,t.ForwardRef=h,t.Fragment=a,t.Lazy=y,t.Memo=m,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||S(e)===l},t.isConcurrentMode=E,t.isContextConsumer=function(e){return S(e)===c},t.isContextProvider=function(e){return S(e)===f},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return S(e)===h},t.isFragment=function(e){return S(e)===a},t.isLazy=function(e){return S(e)===y},t.isMemo=function(e){return S(e)===m},t.isPortal=function(e){return S(e)===o},t.isProfiler=function(e){return S(e)===u},t.isStrictMode=function(e){return S(e)===s},t.isSuspense=function(e){return S(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===u||e===s||e===p||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===f||e.$$typeof===c||e.$$typeof===h||e.$$typeof===g||e.$$typeof===w||e.$$typeof===_||e.$$typeof===v)},t.typeOf=S},function(e,t,n){var r=n(12),i=n(113);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#header-bar{font-size:3.4em;min-width:1036px}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(115);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#monitor{flex-grow:1;min-width:800px}\n",""]),e.exports=t},function(e,t,n){(function(t){var r;e.exports=(r=r||function(e,r){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==t&&t.crypto&&(i=t.crypto),!i)try{i=n(117)}catch(e){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},u=s.lib={},f=u.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=u.WordArray=f.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=f.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},p=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},b=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,f=e.min(4*u,o);if(u){for(var l=0;l0?a-4:a;for(n=0;n>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,l=n?i-1:0,d=n?-1:1,h=e[t+l];for(l+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+l],l+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+l],l+=d,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=f}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,f=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,f-=8);e[n+h-p]|=128*b}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(3),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(t=e.exports=n(57)).Stream=t,t.Readable=t,t.Writable=n(61),t.Duplex=n(17),t.Transform=n(63),t.PassThrough=n(128),t.finished=n(38),t.pipeline=n(129)},function(e,t){},function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,n,r,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,n=i,r=s,a.prototype.copy.call(t,n,r),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){r||(r=e),e&&a.forEach(f),o||(a.forEach(f),i(r))}))}));return t.reduce(c)}},function(e,t,n){var r=n(1),i=n(18),o=n(2).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<30|e>>>2}function c(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,l=0;l<16;++l)n[l]=e.readInt32BE(4*l);for(;l<80;++l)n[l]=n[l-3]^n[l-8]^n[l-14]^n[l-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=r)<<5|t>>>27)+c(h,i,o,s)+u+n[d]+a[h];u=s,s=o,o=f(i),i=r,r=p}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(1),i=n(18),o=n(2).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)n[d]=e.readInt32BE(4*d);for(;d<80;++d)n[d]=(t=n[d-3]^n[d-8]^n[d-14]^n[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),b=f(r)+l(p,i,o,s)+u+n[h]+a[p]|0;u=s,s=o,o=c(i),i=r,r=b}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(1),i=n(64),o=n(18),a=n(2).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}r(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,n){var r=n(1),i=n(65),o=n(18),a=n(2).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}r(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){},function(e,t,n){"use strict";var r=n(2).Buffer,i=n(137);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i,o=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=o,i=s,t.copy(n,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(139),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(5))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,a,s,u=1,f={},c=!1,l=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var n=this._ipad=i.allocUnsafe(64),r=this._opad=i.allocUnsafe(64),s=0;s<64;s++)n[s]=54^t[s],r[s]=92^t[s];this._hash=[n]}r(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},function(e,t,n){e.exports=n(73)},function(e,t,n){(function(t,r){var i,o=n(75),a=n(76),s=n(77),u=n(2).Buffer,f=t.crypto&&t.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function d(e,t,n,r,i){return f.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return f.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:i}},e,r<<3)})).then((function(e){return u.from(e)}))}e.exports=function(e,n,h,p,b,m){"function"==typeof b&&(m=b,b=void 0);var y=c[(b=b||"sha1").toLowerCase()];if(!y||"function"!=typeof t.Promise)return r.nextTick((function(){var t;try{t=s(e,n,h,p,b)}catch(e){return m(e)}m(null,t)}));if(o(e,n,h,p),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");u.isBuffer(e)||(e=u.from(e,a)),u.isBuffer(n)||(n=u.from(n,a)),function(e,t){e.then((function(e){r.nextTick((function(){t(null,e)}))}),(function(e){r.nextTick((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var n=d(i=i||u.alloc(8),i,10,128,e).then((function(){return!0})).catch((function(){return!1}));return l[e]=n,n}(y).then((function(t){return t?d(e,n,h,p,y):s(e,n,h,p,b)})),m)}}).call(this,n(5),n(6))},function(e,t,n){var r=n(149),i=n(44),o=n(45),a=n(162),s=n(31);function u(e,t,n){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function f(e,t,n){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=s(t,!1,n,r);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=s(t,!1,n,r);return f(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=f,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},function(e,t,n){var r=n(10),i=n(150),o=n(1),a=n(2).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(e){r.call(this);var t,n=e.mode.toLowerCase(),i=s[n];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==n&&"des-ede-cbc"!==n||(o=a.concat([o,o.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=i.create({key:o,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,o(u,r),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},function(e,t,n){"use strict";t.utils=n(78),t.Cipher=n(43),t.DES=n(79),t.CBC=n(151),t.EDE=n(152)},function(e,t,n){"use strict";var r=n(7),i=n(1),o={};function a(e){r.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),n=-1;++n>a%8,e._prev=o(e._prev,n?r:i);return s}function o(e,t){var n=e.length,i=-1,o=r.allocUnsafe(e.length);for(e=r.concat([e,r.from([t])]);++i>7;return o}t.encrypt=function(e,t,n){for(var o=t.length,a=r.allocUnsafe(o),s=-1;++s>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,n&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,n){var r=n(83),i=n(2).Buffer,o=n(45),a=n(84),s=n(10),u=n(30),f=n(31);function c(e,t,n){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(n),this._mode=e,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function d(e,t,n){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof n&&(n=i.from(n)),"GCM"!==s.mode&&n.length!==s.iv)throw new TypeError("invalid iv length "+n.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,n,!0):"auth"===s.type?new r(s.module,t,n,!0):new c(s.module,t,n)}n(1)(c,s),c.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,t),r.push(n);return i.concat(r)},c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var n=-1;for(;++n16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var n=o[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=f(t,!1,n.key,n.iv);return d(e,r.key,r.iv)},t.createDecipheriv=d},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,n){(function(e){var r=n(85),i=n(167),o=n(168);var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var n=new e(i[t].prime,"hex"),r=new e(i[t].gen,"hex");return new o(n,r)},t.createDiffieHellman=t.DiffieHellman=function t(n,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(n,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"==typeof n?new o(r(n,s),s,!0):(e.isBuffer(n)||(n=new e(n,i)),new o(n,s,!0)))}}).call(this,n(3).Buffer)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){},function(e,t){},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,n){(function(t){var r=n(4),i=new(n(86)),o=new r(24),a=new r(11),s=new r(10),u=new r(3),f=new r(7),c=n(85),l=n(15);function d(e,n){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),this._pub=new r(e),this}function h(e,n){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),this._priv=new r(e),this}e.exports=b;var p={};function b(e,t,n){this.setGenerator(t),this.__prime=new r(e),this._prime=r.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,n?(this.setPublicKey=d,this.setPrivateKey=h):this._primeCode=8}function m(e,n){var r=new t(e.toArray());return n?r.toString(n):r}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var n=t.toString("hex"),r=[n,e.toString(16)].join("_");if(r in p)return p[r];var l,d=0;if(e.isEven()||!c.simpleSieve||!c.fermatTest(e)||!i.test(e))return d+=1,d+="02"===n||"05"===n?8:4,p[r]=d,d;switch(i.test(e.shrn(1))||(d+=2),n){case"02":e.mod(o).cmp(a)&&(d+=8);break;case"05":(l=e.mod(s)).cmp(u)&&l.cmp(f)&&(d+=8);break;default:d+=4}return p[r]=d,d}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new r(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(e){var n=(e=(e=new r(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(n.toArray()),o=this.getPrime();if(i.length0&&n.ishrn(r),n}function l(e,n,i){var o,a;do{for(o=new t(0);8*o.length=0&&(a=t,s=n),r.negative&&(r=r.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),f=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(f).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=r.fromRed().isOdd();return(t&&!o||!t&&o)&&(r=r.redNeg()),this.point(e,r)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},f.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),u.prototype.jpoint=function(e,t,n){return new c(this,e,t,n)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),l=r.redMul(f),d=u.redSqr().redIAdd(c).redISub(l).redISub(l),h=u.redMul(l.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=n.redMul(u),l=s.redSqr().redIAdd(f).redISub(c).redISub(c),d=s.redMul(c.redISub(l)).redISub(i.redMul(f)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,n=0;n=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,n){"use strict";var r=n(4),i=n(1),o=n(32),a=n(8);function s(e){o.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,n){o.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,n){"use strict";var r=n(8),i=n(4),o=n(1),a=n(32),s=r.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function f(e,t,n,r,o){a.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(n,16),this.z=r?new i(r,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=r.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=r.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},o(f,a.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,n,r){return new f(this,e,t,n,r)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),s=r.redSub(t),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),l=a.redMul(o);return this.curve.point(u,f,l,c)},f.prototype._projDbl=function(){var e,t,n,r=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=r.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(f.redSub(o)),n=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=r.redSub(i).redISub(o).redMul(u),t=a.redMul(f.redSub(o)),n=a.redMul(u)}}else{var f=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=f.redSub(s).redSub(s);e=this.curve._mulC(r.redISub(f)).redMul(u),t=this.curve._mulC(f).redMul(i.redISub(o)),n=f.redMul(u)}return this.curve.point(e,t,n)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),s=i.redAdd(r),u=n.redAdd(t),f=o.redMul(a),c=s.redMul(u),l=o.redMul(u),d=a.redMul(s);return this.curve.point(f,c,d,l)},f.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=r.redMul(u).redMul(c);return this.curve.twisted?(t=r.redMul(f).redMul(a.redSub(this.curve._mulA(o))),n=u.redMul(f)):(t=r.redMul(f).redMul(a.redSub(o)),n=this.curve._mulC(u).redMul(f)),this.curve.point(l,t,n)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},f.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(e,t,n){"use strict";t.sha1=n(176),t.sha224=n(177),t.sha256=n(90),t.sha384=n(178),t.sha512=n(91)},function(e,t,n){"use strict";var r=n(9),i=n(26),o=n(89),a=r.rotl32,s=r.sum32,u=r.sum32_5,f=o.ft_1,c=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(d,c),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;rthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,n,o){"object"==typeof n&&(o=n,n=null),o||(o={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new r(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),f=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new r(1)),d=0;;d++){var h=o.k?o.k(d):new r(f.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var y=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new c({r:m,s:y,recoveryParam:v})}}}}}},l.prototype.verify=function(e,t,n,i){e=this._truncateToN(new r(e,16)),n=this.keyFromPublic(n,i);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),f=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,n.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(f,n.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,n,i){u((3&n)===n,"The recovery param is more than two bits"),t=new c(t,i);var o=this.n,a=new r(e),s=t.r,f=t.s,l=1&n,d=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),b=f.mul(h).umod(o);return this.g.mulAdd(p,s,b)},l.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new c(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,n){"use strict";var r=n(50),i=n(87),o=n(7);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),n=i.toArray(e.nonce,e.nonceEnc||"hex"),r=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}e.exports=a,a.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},a.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var o=[];o.length"}},function(e,t,n){"use strict";var r=n(4),i=n(8),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var n=e[t.place++];if(!(128&n))return n;for(var r=15&n,i=0,o=0,a=t.place;o>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var n=new s;if(48!==e[n.place++])return!1;if(u(e,n)+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=u(e,n),a=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var f=u(e,n);if(e.length!==f+n.place)return!1;var c=e.slice(n.place,f+n.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new r(a),this.s=new r(c),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=f(t),n=f(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];c(r,t.length),(r=r.concat(t)).push(2),c(r,n.length);var o=r.concat(n),a=[48];return c(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,n){"use strict";var r=n(50),i=n(49),o=n(8),a=o.assert,s=o.parseBytes,u=n(187),f=n(188);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),o=this.encodePoint(i),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),u=r.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(e,t,n){e=s(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=t)throw new Error("invalid sig")}e.exports=function(e,n,u,f,c){var l=o(u);if("ec"===l.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(e,t,n){var r=a[n.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var o=new i(r),s=n.data.subjectPrivateKey.data;return o.verify(t,e,s)}(e,n,l)}if("dsa"===l.type){if("dsa"!==f)throw new Error("wrong public key type");return function(e,t,n){var i=n.data.p,a=n.data.q,u=n.data.g,f=n.data.pub_key,c=o.signature.decode(e,"der"),l=c.s,d=c.r;s(l,a),s(d,a);var h=r.mont(i),p=l.invm(a);return 0===u.toRed(h).redPow(new r(t).mul(p).mod(a)).fromRed().mul(f.toRed(h).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(e,n,l)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");n=t.concat([c,n]);for(var d=l.modulus.byteLength(),h=[1],p=0;n.length+h.length+2n-d-2)throw new Error("message too long");var h=l.alloc(n-r-d-2),p=n-c-1,b=i(c),m=s(l.concat([f,h,l.alloc(1,1),t],p),a(b,p)),y=s(b,a(m,c));return new u(l.concat([l.alloc(1),y,m],n))}(p,t);else if(1===d)h=function(e,t,n){var r,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");r=n?l.alloc(a-o-3,255):function(e){var t,n=l.allocUnsafe(e),r=0,o=i(2*e),a=0;for(;r=0)throw new Error("data too long for modulus")}return n?c(h,p):f(h,p)}},function(e,t,n){var r=n(33),i=n(97),o=n(98),a=n(4),s=n(47),u=n(21),f=n(99),c=n(2).Buffer;e.exports=function(e,t,n){var l;l=e.padding?e.padding:n?1:4;var d,h=r(e),p=h.modulus.byteLength();if(t.length>p||new a(t).cmp(h.modulus)>=0)throw new Error("decryption error");d=n?f(new a(t),h):s(t,h);var b=c.alloc(p-d.length);if(d=c.concat([b,d],p),4===l)return function(e,t){var n=e.modulus.byteLength(),r=u("sha1").update(c.alloc(0)).digest(),a=r.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),f=t.slice(a+1),l=o(s,i(f,a)),d=o(f,i(l,n-a-1));if(function(e,t){e=c.from(e),t=c.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==r.toString("hex")&&!n||"0001"!==r.toString("hex")&&n)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,d,n);if(3===l)return d;throw new Error("unknown padding")}},function(e,t,n){"use strict";(function(e,r){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=n(2),a=n(15),s=o.Buffer,u=o.kMaxLength,f=e.crypto||e.msCrypto,c=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>c||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function d(e,t,n){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>c||e<0)throw new TypeError("size must be a uint32");if(e+t>n||e>u)throw new RangeError("buffer too small")}function h(e,t,n,i){if(r.browser){var o=e.buffer,s=new Uint8Array(o,t,n);return f.getRandomValues(s),i?void r.nextTick((function(){i(null,e)})):e}if(!i)return a(n).copy(e,t),e;a(n,(function(n,r){if(n)return i(n);r.copy(e,t),i(null,e)}))}f&&f.getRandomValues||!r.browser?(t.randomFill=function(t,n,r,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof n)i=n,n=0,r=t.length;else if("function"==typeof r)i=r,r=t.length-n;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(n,t.length),d(r,n,t.length),h(t,n,r,i)},t.randomFillSync=function(t,n,r){void 0===n&&(n=0);if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(n,t.length),void 0===r&&(r=t.length-n);return d(r,n,t.length),h(t,n,r)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,n(5),n(6))},function(e,t,n){var r=n(12),i=n(209);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#monitor-controls{display:flex;flex-direction:row;justify-content:space-between;height:48px;margin-top:0.5em;padding-bottom:0.5em}#monitor-controls #connection-status{display:flex;flex-direction:row}#monitor-controls #connection-status #snes-connection,#monitor-controls #connection-status #server-connection{margin-right:1em}#monitor-controls #connection-status #snes-connection table td,#monitor-controls #connection-status #server-connection table td{padding-right:0.5em}#monitor-controls #connection-status .connected{color:#008000}#monitor-controls #connection-status .not-connected{color:#ff0000}#monitor-controls #connection-status button{border-radius:3px}#monitor-controls #accessibility{display:flex;flex-direction:column;height:48px}#monitor-controls #accessibility button{border-radius:4px;margin:0.5em}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(211);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#monitor-window-wrapper #monitor-window{display:flex;flex-direction:column;justify-content:flex-start;background-color:#414042;color:#dce7df;overflow-y:auto;margin-bottom:10px}#monitor-window-wrapper #monitor-window div{width:calc(100% - 14px);padding:7px;border-bottom:1px solid #000000}#monitor-window-wrapper #monitor-window div.user-command{color:#ffffff;background-color:#575757}#monitor-window-wrapper #monitor-window.relevant-only div:not(.relevant){visibility:collapse}#monitor-window-wrapper #monitor-window .item-span{color:#67e9ff}#monitor-window-wrapper #monitor-window .location-span{color:#f5e63c}#monitor-window-wrapper #monitor-window .entrance-span{color:#73ae38}#monitor-window-wrapper #monitor-window .finder-span{color:#f96cb8}#monitor-window-wrapper #monitor-window .recipient-span{color:#9b8aff}#monitor-window-wrapper #monitor-window .mine{color:#ffa500}#monitor-window-wrapper #command-wrapper{display:flex;flex-direction:row;justify-content:flex-start;height:25px;line-height:25px}#monitor-window-wrapper #command-wrapper input{margin-left:0.5em;flex-grow:1}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(213);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#widget-area{margin-left:0.5em;margin-right:0.5em;padding:0.25em;border:2px solid #6a6a6a}#widget-area:not(.collapsed){width:calc(20% - 1.5em - 4px)}#widget-area #widget-button-row{width:100%;text-align:right}#widget-area #widget-button-row .collapse-button{width:35px}#widget-area #widget-area-contents{display:flex;flex-direction:column}#widget-area #widget-area-contents #notes{display:flex;flex-direction:column}#widget-area #widget-area-contents #notes #notes-title{display:flex;flex-direction:row;justify-content:space-between}#widget-area #widget-area-contents #notes textarea{height:10em}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(215);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(13)(!1)).push([e.i,"#web-ui{width:calc(100% - 1.5em);padding:0.75em}#web-ui #content-middle{display:flex;flex-direction:row}\n",""]),e.exports=t},function(e,t,n){var r=n(12),i=n(217);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){var r=n(13),i=n(218),o=n(219);t=r(!1);var a=i(o);t.push([e.i,'@font-face{font-family:HyliaSerif;src:local("HyliaSerif"),url('+a+")}body{background-color:#131313;color:#eae703;font-family:HyliaSerif, serif;letter-spacing:2px;margin:0}\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e,t){return t||(t={}),"string"!=typeof(e=e&&e.__esModule?e.default:e)?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},function(e,t,n){"use strict";n.r(t),t.default="assets/fonts/HyliaSerif.otf"},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),o=n(34),a=n.n(o),s=(n(108),i.a.createContext(null));var u=function(e){e()},f={notify:function(){}};function c(){var e=u,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var l=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=f,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=c())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=f)},e}();var d=function(e){var t=e.store,n=e.context,o=e.children,a=Object(r.useMemo)((function(){var e=new l(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),u=Object(r.useMemo)((function(){return t.getState()}),[t]);Object(r.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),u!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,u]);var f=n||s;return i.a.createElement(f.Provider,{value:a},o)};function h(){return(h=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}var b=n(52),m=n.n(b),y=n(51),v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,g=[],w=[null,null];function _(e,t){var n=e[1];return[t.payload,n+1]}function S(e,t,n){v((function(){return e.apply(void 0,t)}),n)}function E(e,t,n,r,i,o,a){e.current=r,t.current=i,n.current=!1,o.current&&(o.current=null,a())}function k(e,t,n,r,i,o,a,s,u,f){if(e){var c=!1,l=null,d=function(){if(!c){var e,n,d=t.getState();try{e=r(d,i.current)}catch(e){n=e,l=e}n||(l=null),e===o.current?a.current||u():(o.current=e,s.current=e,a.current=!0,f({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=d,n.trySubscribe(),d();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,l)throw l}}}var x=function(){return[null,0]};function M(e,t){void 0===t&&(t={});var n=t,o=n.getDisplayName,a=void 0===o?function(e){return"ConnectAdvanced("+e+")"}:o,u=n.methodName,f=void 0===u?"connectAdvanced":u,c=n.renderCountProp,d=void 0===c?void 0:c,b=n.shouldHandleStateChanges,v=void 0===b||b,M=n.storeKey,T=void 0===M?"store":M,A=(n.withRef,n.forwardRef),P=void 0!==A&&A,C=n.context,R=void 0===C?s:C,O=p(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),I=R;return function(t){var n=t.displayName||t.name||"Component",o=a(n),s=h({},O,{getDisplayName:a,methodName:f,renderCountProp:d,shouldHandleStateChanges:v,storeKey:T,displayName:o,wrappedComponentName:n,WrappedComponent:t}),u=O.pure;var c=u?r.useMemo:function(e){return e()};function b(n){var o=Object(r.useMemo)((function(){var e=n.forwardedRef,t=p(n,["forwardedRef"]);return[n.context,e,t]}),[n]),a=o[0],u=o[1],f=o[2],d=Object(r.useMemo)((function(){return a&&a.Consumer&&Object(y.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:I}),[a,I]),b=Object(r.useContext)(d),m=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(b)&&Boolean(b.store);var M=m?n.store:b.store,T=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,s)}(M)}),[M]),A=Object(r.useMemo)((function(){if(!v)return w;var e=new l(M,m?null:b.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[M,m,b]),P=A[0],C=A[1],R=Object(r.useMemo)((function(){return m?b:h({},b,{subscription:P})}),[m,b,P]),O=Object(r.useReducer)(_,g,x),j=O[0][0],B=O[1];if(j&&j.error)throw j.error;var N=Object(r.useRef)(),D=Object(r.useRef)(f),L=Object(r.useRef)(),z=Object(r.useRef)(!1),U=c((function(){return L.current&&f===D.current?L.current:T(M.getState(),f)}),[M,j,f]);S(E,[D,N,z,f,U,L,C]),S(k,[v,M,P,T,D,N,z,L,C,B],[M,P,T]);var F=Object(r.useMemo)((function(){return i.a.createElement(t,h({},U,{ref:u}))}),[u,t,U]);return Object(r.useMemo)((function(){return v?i.a.createElement(d.Provider,{value:R},F):F}),[d,F,R])}var M=u?i.a.memo(b):b;if(M.WrappedComponent=t,M.displayName=o,P){var A=i.a.forwardRef((function(e,t){return i.a.createElement(M,h({},e,{forwardedRef:t}))}));return A.displayName=o,A.WrappedComponent=t,m()(A,t)}return m()(M,t)}}function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function A(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function F(e,t){return e===t}function q(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?M:n,i=t.mapStateToPropsFactories,o=void 0===i?j:i,a=t.mapDispatchToPropsFactories,s=void 0===a?I:a,u=t.mergePropsFactories,f=void 0===u?N:u,c=t.selectorFactory,l=void 0===c?z:c;return function(e,t,n,i){void 0===i&&(i={});var a=i,u=a.pure,c=void 0===u||u,d=a.areStatesEqual,b=void 0===d?F:d,m=a.areOwnPropsEqual,y=void 0===m?A:m,v=a.areStatePropsEqual,g=void 0===v?A:v,w=a.areMergedPropsEqual,_=void 0===w?A:w,S=p(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=U(e,o,"mapStateToProps"),k=U(t,s,"mapDispatchToProps"),x=U(n,f,"mergeProps");return r(l,h({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:k,initMergeProps:x,pure:c,areStatesEqual:b,areOwnPropsEqual:y,areStatePropsEqual:g,areMergedPropsEqual:_},S))}}var H=q();var W;W=o.unstable_batchedUpdates,u=W;var K=n(101),V=(n(112),function(){return i.a.createElement("div",{id:"header-bar"},"Multiworld WebUI")});n(114);var $=function(e,t){for(var n=-1,r=null==e?0:e.length;++n-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve["[object Arguments]"]=ve["[object Array]"]=ve["[object ArrayBuffer]"]=ve["[object Boolean]"]=ve["[object DataView]"]=ve["[object Date]"]=ve["[object Error]"]=ve["[object Function]"]=ve["[object Map]"]=ve["[object Number]"]=ve["[object Object]"]=ve["[object RegExp]"]=ve["[object Set]"]=ve["[object String]"]=ve["[object WeakMap]"]=!1;var ge=function(e){return se(e)&&ye(e.length)&&!!ve[ae(e)]};var we=function(e){return function(t){return e(t)}},_e=n(54),Se=_e.a&&_e.a.isTypedArray,Ee=Se?we(Se):ge,ke=Object.prototype.hasOwnProperty;var xe=function(e,t){var n=he(e),r=!n&&de(e),i=!n&&!r&&Object(pe.a)(e),o=!n&&!r&&!i&&Ee(e),a=n||r||i||o,s=a?X(e.length,String):[],u=s.length;for(var f in e)!t&&!ke.call(e,f)||a&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||me(f,u))||s.push(f);return s},Me=Object.prototype;var Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)};var Ae=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Pe=Object.prototype.hasOwnProperty;var Ce=function(e){if(!Te(e))return Ae(e);var t=[];for(var n in Object(e))Pe.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Re=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Oe=function(e){if(!Re(e))return!1;var t=ae(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var Ie=function(e){return null!=e&&ye(e.length)&&!Oe(e)};var je=function(e){return Ie(e)?xe(e):Ce(e)};var Be=function(e,t){return function(n,r){if(null==n)return n;if(!Ie(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.a.createElement("span",{className:"finder-span ".concat(n?"mine":null)},e,t?"'s":null)},He=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.a.createElement("span",{className:"recipient-span ".concat(n?"mine":null)},e,t?"'s":null)},We=function(e){return i.a.createElement("span",{className:"item-span"},e)},Ke=function(e){return i.a.createElement("span",{className:"location-span"},e)},Ve=function(e){return i.a.createElement("span",{className:"entrance-span"},e)},$e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};Fe($e,"createTextDiv",(function(e){return i.a.createElement("div",{key:"".concat(Ue()(e)).concat(Math.floor(1e6*Math.random()))},e)})),Fe($e,"sentItem",(function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return i.a.createElement("div",{key:"".concat(Ue()(e+t+n+r)).concat(Math.floor(1e6*Math.random())),className:o||a?"relevant":null},qe(e,!1,o)," found ",He(t,!0,a)," ",We(n)," at ",Ke(r))})),Fe($e,"receivedItem",(function(e,t,n,r,o){return i.a.createElement("div",{key:"".concat(Ue()(e+t+n)).concat(Math.floor(1e6*Math.random())),className:"relevant"},"(",r,"/",o,") ",qe(e,!1)," found your ",We(t)," at ",Ke(n))})),Fe($e,"foundItem",(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return i.a.createElement("div",{key:"".concat(Ue()(e+t+n)).concat(Math.floor(1e6*Math.random())),className:r?"relevant":null},qe(e,!1,r)," found their own ",We(t)," at ",Ke(n))})),Fe($e,"hintMessage",(function(e,t,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;return i.a.createElement("div",{key:"".concat(Ue()(e+t+n+r)).concat(Math.floor(1e6*Math.random())),className:a||s?"relevant":null},He(t,!0,s)," ",We(n)," can be found in ",qe(e,!0,a)," world at ",Ke(r),u?[", which is at ",Ve(u)]:null,"  (",o?"✔":"❌",")")}));var Ye=$e,Xe=function(e){return{type:"APPEND_MESSAGE",content:e}},Qe=function(e){return{type:"UPDATE_GAME_STATE",gameState:e}},Ge=function(e){return{type:"SET_AVAILABLE_DEVICES",devices:e}};function Je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ze=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};Je(Ze,"formatSocketData",(function(e,t){return JSON.stringify({type:e,content:t})})),Je(Ze,"handleIncomingMessage",(function(e){try{var t=JSON.parse(e.data);switch(t.type){case"connections":return Qe({connections:{snesDevice:t.content.snesDevice?t.content.snesDevice:"",snesConnected:3===parseInt(t.content.snes,10),serverAddress:t.content.serverAddress?t.content.serverAddress.replace(/^.*\/\//,""):null,serverConnected:1===parseInt(t.content.server,10)}});case"availableDevices":return Ge(t.content.devices);case"serverAddress":return Xe(Ye.createTextDiv("Unable to automatically connect to multiworld server. Please enter an address manually."));case"itemSent":return Xe(Ye.sentItem(t.content.finder,t.content.recipient,t.content.item,t.content.location,1===parseInt(t.content.iAmFinder,10),1===parseInt(t.content.iAmRecipient,10)));case"itemReceived":return Xe(Ye.receivedItem(t.content.finder,t.content.item,t.content.location,t.content.itemIndex,t.content.queueLength));case"itemFound":return Xe(Ye.foundItem(t.content.finder,t.content.item,t.content.location,1===parseInt(t.content.iAmFinder,10)));case"hint":return Xe(Ye.hintMessage(t.content.finder,t.content.recipient,t.content.item,t.content.location,1===parseInt(t.content.found,10),1===parseInt(t.content.iAmFinder,10),1===parseInt(t.content.iAmRecipient,10),t.content.entranceLocation));case"critical":case"error":case"warning":case"info":case"chat":return Xe(Ye.createTextDiv("string"==typeof t.content?t.content:JSON.stringify(t.content)));default:return console.warn("Unknown message type received: ".concat(t.type)),console.warn(t.content),{type:"NO_OP"}}}catch(t){return console.error(e),console.error(t),{type:"NO_OP"}}}));var et=Ze,tt=(n(208),function(e){return{type:"SET_MONITOR_FONT_SIZE",fontSize:e}}),nt=function(e){return{type:"SET_SHOW_RELEVANT",showRelevant:e}};function rt(e){return(rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function it(e,t){for(var n=0;n=25||t.props.updateFontSize(t.props.fontSize+1)})),ct(ut(t),"decreaseTextSize",(function(){t.props.fontSize<=10||t.props.updateFontSize(t.props.fontSize-1)})),ct(ut(t),"generateSnesOptions",(function(){var e=[];return 0===t.props.availableDevices.length?(e.push(i.a.createElement("option",{key:"0",value:"-1"},"Waiting for devices...")),e):(e.push(i.a.createElement("option",{key:"-1",value:"-1"},"Select a device")),Le(t.props.availableDevices,(function(t){e.push(i.a.createElement("option",{key:t,value:t},t))})),e)})),ct(ut(t),"updateDeviceId",(function(e){return t.setState({deviceId:e.target.value},t.connectToSnes)})),ct(ut(t),"pollSnesDevices",(function(){t.props.webSocket&&t.props.webSocket.send(et.formatSocketData("webStatus","devices"))})),ct(ut(t),"connectToSnes",(function(){t.props.webSocket&&t.props.webSocket.send(et.formatSocketData("webConfig",{deviceId:t.state.deviceId}))})),ct(ut(t),"updateServerAddress",(function(e){return t.setState({serverAddress:e.target.value?e.target.value:null})})),ct(ut(t),"connectToServer",(function(e){"Enter"===e.key&&(e.target.value?t.props.webSocket.send(et.formatSocketData("webConfig",{serverAddress:t.state.serverAddress})):t.props.webSocket.send(et.formatSocketData("webControl","disconnect")))})),ct(ut(t),"toggleRelevance",(function(e){t.props.doToggleRelevance(e.target.checked)})),t.state={deviceId:null,serverAddress:t.props.serverAddress},t}return t=a,(n=[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.props.webSocket&&e.pollSnesDevices()}),500)}},{key:"componentDidUpdate",value:function(e){var t=this;e.availableDevices.length!==this.props.availableDevices.length&&1===this.props.availableDevices.length&&this.setState({deviceId:this.props.availableDevices[0]},(function(){t.props.snesConnected||t.connectToSnes()}))}},{key:"render",value:function(){return i.a.createElement("div",{id:"monitor-controls"},i.a.createElement("div",{id:"connection-status"},i.a.createElement("div",{id:"snes-connection"},i.a.createElement("table",null,i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("td",null,"SNES Device:"),i.a.createElement("td",null,i.a.createElement("select",{onChange:this.updateDeviceId,disabled:0===this.props.availableDevices.length,value:this.state.deviceId},this.generateSnesOptions()))),i.a.createElement("tr",null,i.a.createElement("td",null,"Status:"),i.a.createElement("td",null,i.a.createElement("span",{className:this.props.snesConnected?"connected":"not-connected"},this.props.snesConnected?"Connected":"Not Connected")))))),i.a.createElement("div",{id:"server-connection"},i.a.createElement("table",null,i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("td",null,"Server:"),i.a.createElement("td",null,i.a.createElement("input",{defaultValue:this.props.serverAddress,onKeyUp:this.updateServerAddress,onKeyDown:this.connectToServer}))),i.a.createElement("tr",null,i.a.createElement("td",null,"Status:"),i.a.createElement("td",null,i.a.createElement("span",{className:this.props.serverConnected?"connected":"not-connected"},this.props.serverConnected?"Connected":"Not Connected"))))))),i.a.createElement("div",{id:"accessibility"},i.a.createElement("div",null,"Text Size:",i.a.createElement("button",{disabled:this.props.fontSize<=10,onClick:this.decreaseTextSize},"-"),this.props.fontSize,i.a.createElement("button",{disabled:this.props.fontSize>=25,onClick:this.increaseTextSize},"+")),i.a.createElement("div",null,"Only show my items ",i.a.createElement("input",{type:"checkbox",onChange:this.toggleRelevance}))))}}])&&it(t.prototype,n),r&&it(t,r),a}(r.Component),dt=H((function(e){return{fontSize:e.monitor.fontSize,webSocket:e.webUI.webSocket,availableDevices:e.webUI.availableDevices,snesDevice:e.gameState.connections.snesDevice,snesConnected:e.gameState.connections.snesConnected,serverAddress:e.gameState.connections.serverAddress,serverConnected:e.gameState.connections.serverConnected}}),(function(e){return{updateFontSize:function(t){e(tt(t))},doToggleRelevance:function(t){e(nt(t))}}}))(lt);n(210);function ht(e){return(ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pt(e,t){for(var n=0;n=20)t.props.appendMonitorMessage(Ye.createTextDiv("Unable to connect to MultiClient. Maximum of 20 attempts exceeded."));else{var e=new URLSearchParams(document.location.search.substring(1)).get("port");if(!e)throw new Error("Unable to determine socket port from GET parameters");var n="ws://localhost:".concat(e);try{t.props.webSocket.close(),t.props.doSetWebSocket(null)}catch(e){}var r=new WebSocket(n);r.onerror=function(){t.props.doUpdateGameState({connections:{snesDevice:t.props.connections.snesDevice,snesConnected:!1,serverAddress:t.props.connections.serverAddress,serverConnected:!1}}),t.state.connectionAttempts0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(mn);var gn=function(e,t){return vn(pn(e,t,Ne),e+"")};var wn=function(e,t,n){if(!Re(n))return!1;var r=typeof t;return!!("number"==r?Ie(n)&&me(t,n.length):"string"==r&&t in n)&&un(n[t],e)};var _n=function(e){return gn((function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&wn(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r0&&void 0!==arguments[0]?arguments[0]:kn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_WEBSOCKET":return En({},e,{webSocket:t.webSocket});case"SET_AVAILABLE_DEVICES":return En({},e,{availableDevices:t.devices});default:return e}},Mn={connections:{snesDevice:"",snesConnected:!1,serverAddress:null,serverConnected:!1},hints:{hintCost:null,checkPoints:null,playerPoints:0}},Tn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_GAME_STATE":return En({},e,t.gameState);default:return e}},An={fontSize:18,showRelevantOnly:!1,messageLog:[]},Pn=function(e,t){var n=e.slice(-349);return n.push(t),n},Cn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:An,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_MONITOR_FONT_SIZE":return En({},e,{fontSize:t.fontSize});case"SET_SHOW_RELEVANT":return En({},e,{showRelevantOnly:t.showRelevant});case"APPEND_MESSAGE":return En({},e,{messageLog:Pn(e.messageLog,t.content)});default:return e}},Rn=Object(P.createStore)(Object(P.combineReducers)({webUI:xn,gameState:Tn,monitor:Cn}),Object(K.composeWithDevTools)()),On=function(){return i.a.createElement(d,{store:Rn},i.a.createElement(Wt,null))};window.onload=function(){a.a.render(i.a.createElement(On,null),document.getElementById("app"))}}]); \ No newline at end of file diff --git a/data/web/src/js/Monitor/containers/MonitorControls.js b/data/web/src/js/Monitor/containers/MonitorControls.js index 9ca65564..6ad4b2d5 100644 --- a/data/web/src/js/Monitor/containers/MonitorControls.js +++ b/data/web/src/js/Monitor/containers/MonitorControls.js @@ -41,20 +41,24 @@ class MonitorControls extends Component { if (this.props.webSocket) { // Poll for available devices this.pollSnesDevices(); - - setTimeout(() => { - if (this.props.availableDevices.length === 1) { - this.setState({ deviceId: this.props.availableDevices[0] }, () => { - if (!this.props.snesConnected) { - this.connectToSnes(); - } - }); - } - }, 500); } }, 500); } + componentDidUpdate(prevProps) { + if ( + prevProps.availableDevices.length !== this.props.availableDevices.length && + this.props.availableDevices.length === 1 + ) { + // eslint-disable-next-line react/no-did-update-set-state + this.setState({ deviceId: this.props.availableDevices[0] }, () => { + if (!this.props.snesConnected) { + this.connectToSnes(); + } + }); + } + } + increaseTextSize = () => { if (this.props.fontSize >= 25) return; this.props.updateFontSize(this.props.fontSize + 1);