>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},w.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(36)(e))},function(e,t,r){"use strict";const Buffer=r(2).Buffer,n=r(89),i=r(15),o=r(184),a=r(5),s=r(30),u=r(222),c=r(10),l=r(185),f=c.OP_RESERVED;function h(e){return s.Buffer(e)||function(e){return s.Number(e)&&(e===c.OP_0||e>=c.OP_1&&e<=c.OP_16||e===c.OP_1NEGATE)}(e)}function d(e){return s.Array(e)&&e.every(h)}function p(e){return 0===e.length?c.OP_0:1===e.length?e[0]>=1&&e[0]<=16?f+e[0]:129===e[0]?c.OP_1NEGATE:void 0:void 0}function m(e){if(Buffer.isBuffer(e))return e;a(s.Array,e);const t=e.reduce(function(e,t){return Buffer.isBuffer(t)?1===t.length&&void 0!==p(t)?e+1:e+o.encodingLength(t.length)+t.length:e+1},0),r=Buffer.allocUnsafe(t);let n=0;if(e.forEach(function(e){if(Buffer.isBuffer(e)){const t=p(e);if(void 0!==t)return r.writeUInt8(t,n),void(n+=1);n+=o.encode(r,e.length,n),e.copy(r,n),n+=e.length}else r.writeUInt8(e,n),n+=1}),n!==r.length)throw new Error("Could not decode chunks");return r}function g(e){if(s.Array(e))return e;a(s.Buffer,e);const t=[];let r=0;for(;rc.OP_0&&n<=c.OP_PUSHDATA4){const n=o.decode(e,r);if(null===n)return null;if((r+=n.size)+n.number>e.length)return null;const i=e.slice(r,r+n.number);r+=n.number;const a=p(i);void 0!==a?t.push(a):t.push(i)}else t.push(n),r+=1}return t}function v(e){const t=-129&e;return t>0&&t<4}e.exports={compile:m,decompile:g,fromASM:function(asm){return a(s.String,asm),m(asm.split(" ").map(function(e){return void 0!==c[e]?c[e]:(a(s.Hex,e),Buffer.from(e,"hex"))}))},toASM:function(e){return Buffer.isBuffer(e)&&(e=g(e)),e.map(function(e){if(Buffer.isBuffer(e)){const t=p(e);if(void 0===t)return e.toString("hex");e=t}return l[e]}).join(" ")},toStack:function(e){return e=g(e),a(d,e),e.map(function(e){return Buffer.isBuffer(e)?e:e===c.OP_0?Buffer.allocUnsafe(0):u.encode(e-f)})},number:r(222),signature:r(500),isCanonicalPubKey:function(e){return i.isPoint(e)},isCanonicalScriptSignature:function(e){return!!Buffer.isBuffer(e)&&!!v(e[e.length-1])&&n.check(e.slice(0,-1))},isPushOnly:d,isDefinedHashType:v}},function(e,t,r){"use strict";var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e){e.exports={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255}},function(e,t,r){"use strict";var n=r(45),i=r(272),o=r(109),a=r(654),s=r(81);function u(e){return e}function c(e,t){for(var r=0;r1;)try{return l.stringifyByChunk(e,n,r)}catch(e){r=Math.floor(r/2)}return l.stringifyByChar(e)}function h(e,t){for(var r=0;ri;t=0<=i?++n:--n)r[t]=e.readUInt8(t);return r},o=function(e){var t,r,n,i;for(r=new Buffer(e.length),t=n=0,i=e.length;0<=i?ni;t=0<=i?++n:--n)r.writeUInt8(e[t],t);return r},i=function(e){return e>>>24&255|(e>>>16&255)<<8|(e>>>8&255)<<16|(255&e)<<24},t.WordArray=e=function(){function e(e,t){this.words=e||[],this.sigBytes=null!=t?t:4*this.words.length}return e.prototype.concat=function(e){var t,r,n,i,o;if(i=e.words,n=e.sigBytes,this.clamp(),this.sigBytes%4)for(t=o=0;0<=n?on;t=0<=n?++o:--o)r=i[t>>>2]>>>24-t%4*8&255,this.words[this.sigBytes+t>>>2]|=r<<24-(this.sigBytes+t)%4*8;else this.words=this.words.concat(i);return this.sigBytes+=n,this},e.prototype.clamp=function(){return this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this},e.prototype.clone=function(){return new e(this.words.slice(0),this.sigBytes)},e.prototype.to_buffer=function(){var e,t,r,n,i,o,s;for(t=new Buffer(this.sigBytes),r=0,i=0,o=(s=this.words).length;i=4&&(n=a.fixup_uint32(n),t.writeUInt32BE(n,r),r+=4);for(;r>>2]>>>24-r%4*8&255,t.writeUInt8(e,r),r++;return t},e.prototype.endian_reverse=function(){var e,t,r,n,o;for(e=r=0,n=(o=this.words).length;r0?ti;r=t+=n)o.push(new e(this.words.slice(r,r+n)));return o}.call(this)},e.prototype.to_utf8=function(){return this.to_buffer().toString("utf8")},e.prototype.to_hex=function(){return this.to_buffer().toString("hex")},e.prototype.to_ui8a=function(){return n(this.to_buffer())},e.alloc=function(t){return Buffer.isBuffer(t)?e.from_buffer(t):"object"==typeof t&&t instanceof e?t:"string"==typeof t?e.from_hex(t):null},e.from_buffer=function(t){var r,n,i;for(i=[],n=0;t.length-n>=4;)i.push(t.readUInt32BE(n)),n+=4;if(n=4;)i.push(t.readUInt32LE(n)),n+=4;if(ni;n=0<=i?++u:--u)s=this.words[r+n]^e.words[o+n],this.words[r+n]=a.fixup_uint32(s);return this},e.prototype.truncate=function(t){var r;if(!(t<=this.sigBytes))throw new Error("Cannot truncate: "+t+" > "+this.sigBytes);return r=Math.ceil(t/4),new e(this.words.slice(0,r),t)},e.prototype.unshift=function(t){var r;return this.words.length>=t?(r=this.words.splice(0,t),this.sigBytes-=4*t,new e(r)):null},e.prototype.is_scrubbed=function(){var e,t,r;for(e=0,t=(r=this.words).length;e=0)return!1;if((2===t||3===t)&&33===e.length){try{E(e)}catch(e){return!1}return!0}const n=e.slice(33);return 0!==n.compare(o)&&(!(n.compare(s)>=0)&&(4===t&&65===e.length))}function _(e){return 4!==e[0]}function w(e){return!!v(e)&&(e.compare(o)>0&&e.compare(a)<0)}function k(e,t){return void 0===e&&void 0!==t?_(t):void 0===e||e}function S(e){return new t(e)}function x(e){return e.toArrayLike(Buffer,"be",32)}function E(e){return n.curve.decodePoint(e)}function A(e,t){return Buffer.from(e._encode(t))}function O(e,t,r){if(!v(e))throw new TypeError(p);if(!w(t))throw new TypeError(f);if(void 0!==r&&!v(r))throw new TypeError(g);const n=S(t),o=S(e);let a,s;i(e,t,function(e){const t=S(e),r=l.mul(t);return!r.isInfinity()&&0!==(a=r.x.umod(u)).isZero()&&0!==(s=t.invm(u).mul(o.add(n.mul(a))).umod(u)).isZero()},w,r),s.cmp(c)>0&&(s=u.sub(s));const h=Buffer.allocUnsafe(64);return x(a).copy(h,0),x(s).copy(h,32),h}e.exports={isPoint:y,isPointCompressed:function(e){return!!y(e)&&_(e)},isPrivate:w,pointAdd:function(e,t,r){if(!y(e))throw new TypeError(h);if(!y(t))throw new TypeError(h);const n=E(e),i=E(t),o=n.add(i);return o.isInfinity()?null:A(o,k(r,e))},pointAddScalar:function(e,t,r){if(!y(e))throw new TypeError(h);if(!b(t))throw new TypeError(d);const n=k(r,e),i=E(e);if(0===t.compare(o))return A(i,n);const a=S(t),s=l.mul(a),u=i.add(s);return u.isInfinity()?null:A(u,n)},pointCompress:function(e,t){if(!y(e))throw new TypeError(h);const r=E(e);if(r.isInfinity())throw new TypeError(h);return A(r,t)},pointFromScalar:function(e,t){if(!w(e))throw new TypeError(f);const r=S(e),n=l.mul(r);return n.isInfinity()?null:A(n,k(t))},pointMultiply:function(e,t,r){if(!y(e))throw new TypeError(h);if(!b(t))throw new TypeError(d);const n=k(r,e),i=E(e),o=S(t),a=i.mul(o);return a.isInfinity()?null:A(a,n)},privateAdd:function(e,t){if(!w(e))throw new TypeError(f);if(!b(t))throw new TypeError(d);const r=S(e),n=S(t),i=x(r.add(n).umod(u));return w(i)?i:null},privateSub:function(e,t){if(!w(e))throw new TypeError(f);if(!b(t))throw new TypeError(d);const r=S(e),n=S(t),i=x(r.sub(n).umod(u));return w(i)?i:null},sign:function(e,t){return O(e,t)},signWithEntropy:function(e,t,r){return O(e,t,r)},verify:function(e,t,r){if(!v(e))throw new TypeError(p);if(!y(t))throw new TypeError(h);if(!function(e){const t=e.slice(0,32),r=e.slice(32,64);return Buffer.isBuffer(e)&&64===e.length&&t.compare(a)<0&&r.compare(a)<0}(r))throw new TypeError(m);const n=E(t),i=S(r.slice(0,32)),o=S(r.slice(32,64));if(i.gtn(0)<=0)return!1;if(o.gtn(0)<=0)return!1;const s=S(e),c=o.invm(u),f=s.mul(c).umod(u),d=i.mul(c).umod(u),g=l.mulAdd(f,n,d);return!g.isInfinity()&&g.x.umod(u).eq(i)}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=n,n.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";(function(){var e,n,i,o,a,s;for(t.const=r(151),a=0,s=(i=[r(259),r(611)]).length;a1)for(var r=1;ro||e<0?(t=Math.abs(e)%o,e<0?o-t:t):e},t.scrub_buffer=function(e){var t,r;for(r=e.length>>2,t=0;ti;t=0<=i?++n:--n)r.writeUInt8(e.readUInt8(t),t);return r},t.scrub_vec=function(e){var t,r,n;for(t=r=0,n=e.length;0<=n?rn;t=0<=n?++r:--r)e[t]=0;return!1},t.default_delay=n=function(t,r,n){var o,a;o=i.findDeferral(arguments),function(t){null!=e?function(t){a=new i.Deferrals(t,{parent:o,filename:"/Users/max/src/keybase/triplesec/src/util.iced"}),e(a.defer({lineno:45})),a._fulfill()}(t):function(e){a=new i.Deferrals(e,{parent:o,filename:"/Users/max/src/keybase/triplesec/src/util.iced"}),setTimeout(a.defer({lineno:47}),1),a._fulfill()}(t)}(function(){return n()})},t.buffer_cmp_ule=function(e,t){var r,n,i,o,a,s;for(i=o=0,r=e.length,n=t.length;in-o)return 1;if(n-o>r-i)return-1;for(;i0))return e();d=Math.min(h,f),v(l,l+d),o(l),_=new i.Deferrals(function(){return r(l+=d)},{parent:y,filename:"/Users/max/src/keybase/triplesec/src/util.iced",funcname:"bulk"}),u(l,g,_.defer({lineno:105})),_._fulfill()})(e)}(function(){return o(g),m=c(),a(m)})}}).call(this)}).call(this,r(0).Buffer,r(66).setImmediate)},function(e,t,r){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},function(e,t,r){"use strict";e.exports={bitcoin:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},regtest:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},testnet:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}}},function(e,t,r){"use strict";(function(Buffer){var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=e(r(529)),i=r(38),o=r(39),a=r(32);t.BLOCKSTACK_HANDLER="blockstack",t.nextYear=function(){return new Date((new Date).setFullYear((new Date).getFullYear()+1))},t.nextMonth=function(){return new Date((new Date).setMonth((new Date).getMonth()+1))},t.nextHour=function(){return new Date((new Date).setHours((new Date).getHours()+1))},t.updateQueryStringParameter=function(e,t,r){const n=new RegExp(`([?&])${t}=.*?(&|$)`,"i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(n)?e.replace(n,`$1${t}=${r}$2`):`${e}${i}${t}=${r}`},t.isLaterVersion=function(e,t){void 0===e&&(e="0.0.0"),void 0===t&&(t="0.0.0");const r=e.split(".").map(e=>parseInt(e,10)),n=t.split(".").map(e=>parseInt(e,10));for(let i=0;i=e.length&&n.push(0),r[i]{const r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)})},t.isSameOriginAbsoluteUrl=function(e,t){const r=n.default.parse(e),i=n.default.parse(t),o=0|parseInt(r.port||"0",10)||("https:"===r.protocol?443:80),a=0|parseInt(i.port||"0",10)||("https:"===i.protocol?443:80),s={scheme:r.protocol===i.protocol,hostname:r.hostname===i.hostname,port:o===a,absolute:(e.includes("http://")||e.includes("https://"))&&(t.includes("http://")||t.includes("https://"))};return s.scheme&&s.hostname&&s.port&&s.absolute},t.checkWindowAPI=function(e,t){if("undefined"==typeof window||!window[t]){const r=`\`${e}\` uses the \`window.${t}\` API which is `+" not available in the current environment.";throw a.Logger.error(r),new Error(r)}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(190));t.default=i,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(190))},function(e,t,r){"use strict";(function(t,n){var i=65536,o=4294967295;var Buffer=r(2).Buffer,a=t.crypto||t.msCrypto;a&&a.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var r=Buffer.allocUnsafe(e);if(e>0)if(e>i)for(var s=0;s=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,f=t;return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";const n=r(5),i=Math.pow(2,31)-1;function o(e){return n.String(e)&&e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}o.toJSON=function(){return"BIP32 derivation path"};const a=21e14;const s=n.quacksLike("Point"),u=n.compile({messagePrefix:n.oneOf(n.Buffer,n.String),bip32:{public:n.UInt32,private:n.UInt32},pubKeyHash:n.UInt8,scriptHash:n.UInt8,wif:n.UInt8}),c={BIP32Path:o,Buffer256bit:n.BufferN(32),ECPoint:s,Hash160bit:n.BufferN(20),Hash256bit:n.BufferN(32),Network:u,Satoshi:function(e){return n.UInt53(e)&&e<=a},UInt31:function(e){return n.UInt32(e)&&e<=i}};for(var l in n)c[l]=n[l];e.exports=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_CODES={MISSING_PARAMETER:"missing_parameter",REMOTE_SERVICE_ERROR:"remote_service_error",INVALID_STATE:"invalid_state",NO_SESSION_DATA:"no_session_data",UNKNOWN:"unknown"},Object.freeze(t.ERROR_CODES);class n extends Error{constructor(e){super(e.message),this.message=e.message,this.code=e.code,this.parameter=e.parameter?e.parameter:null}toString(){return`${super.toString()}\n code: ${this.code} param: ${this.parameter?this.parameter:"n/a"}`}}t.BlockstackError=n;t.FileNotFound=class extends n{constructor(e){super({message:e,code:"file_not_found"}),this.name="FileNotFound"}};t.InvalidParameterError=class extends n{constructor(e,t=""){super({code:"missing_parameter",message:t,parameter:""}),this.name="MissingParametersError"}};t.MissingParameterError=class extends n{constructor(e,r=""){super({code:t.ERROR_CODES.MISSING_PARAMETER,message:r,parameter:e}),this.name="MissingParametersError"}};t.RemoteServiceError=class extends n{constructor(e,r=""){super({code:t.ERROR_CODES.REMOTE_SERVICE_ERROR,message:r}),this.response=e}};t.InvalidDIDError=class extends n{constructor(e=""){super({code:"invalid_did_error",message:e}),this.name="InvalidDIDError"}};t.NotEnoughFundsError=class extends n{constructor(e){const t=`Not enough UTXOs to fund. Left to fund: ${e}`;super({code:"not_enough_error",message:t}),this.leftToFund=e,this.name="NotEnoughFundsError",this.message=t}};t.InvalidAmountError=class extends n{constructor(e,t){const r=`Not enough coin to fund fees transaction fees. Fees would be ${e},`+` specified spend is ${t}`;super({code:"invalid_amount_error",message:r}),this.specifiedAmount=t,this.fees=e,this.name="InvalidAmountError",this.message=r}};t.LoginFailedError=class extends n{constructor(e){const t=`Failed to login: ${e}`;super({code:"login_failed",message:t}),this.message=t,this.name="LoginFailedError"}};t.SignatureVerificationError=class extends n{constructor(e){const t=`Failed to verify signature: ${e}`;super({code:"signature_verification_failure",message:t}),this.message=t,this.name="SignatureVerificationError"}};t.InvalidStateError=class extends n{constructor(e){super({code:t.ERROR_CODES.INVALID_STATE,message:e}),this.message=e,this.name="InvalidStateError"}};t.NoSessionDataError=class extends n{constructor(e){super({code:t.ERROR_CODES.INVALID_STATE,message:e}),this.message=e,this.name="NoSessionDataError"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(39),i=["debug","info","warn","error","none"],o={},a={};for(let e=0;e0?ls;u=l+=f)this._doProcessBlock(n,u);c=n.splice(0,s),t.sigBytes-=o}return new a(c,o)},e.prototype.copy_to=function(e){return e._data=this._data.clone(),e._nDataBytes=this._nDataBytes},e.prototype.clone=function(){var t;return t=new e,this.copy_to(t),t},e}(),i=function(e){function t(){t.__super__.constructor.call(this)}return function(e,t){for(var r in t)u.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,n),t.prototype.reset=function(){return t.__super__.reset.call(this),this._doReset(),this},t.prototype.update=function(e){return this._append(e),this._process(),this},t.prototype.finalize=function(e){return e&&this._append(e),this._doFinalize()},t.prototype.bufhash=function(e){var t,r,n;return r=a.from_buffer(e),t=(n=this.finalize(r)).to_buffer(),r.scrub(),n.scrub(),t},t}(),t.BlockCipher=e=function(){function e(e){}return e.prototype.encryptBlock=function(e,t){},e}(),o=function(){function e(){}return e.prototype.encryptBlock=function(e,t){var r,n;return null==t&&(t=0),n=this.get_pad(),r=Math.min(e.words.length-t,this.bsiw),e.xor(n,{dst_offset:t,n_words:r}),n.scrub(),this.bsiw},e.prototype.encrypt=function(e){var t,r,n,i;for(t=r=0,n=e.words.length,i=this.bsiw;i>0?rn;t=r+=i)this.encryptBlock(e,t);return e},e.prototype.bulk_encrypt=function(e,t){var r,n,i,o,a,u;return n=e.input,i=e.progress_hook,a=e.what,o={update:(u=this,function(e,t){var r,i,o,a;for(a=[],r=i=e,o=u.bsiw;o>0?it;r=i+=o)a.push(u.encryptBlock(n,r));return a}),finalize:function(){return n},default_n:1024*this.bsiw},r={progress_hook:i,cb:t,what:a},s.bulk(n.sigBytes,o,r)},e}(),t.BlockCipher=e,t.Hasher=i,t.BufferedBlockAlgorithm=n,t.StreamCipher=o}).call(this)},function(e,t,r){"use strict";(function(e){r.d(t,"b",function(){return _});var n=("undefined"!=typeof window?window:void 0!==e?e:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function i(e,t){Object.keys(e).forEach(function(r){return t(e[r],r)})}var o=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var r=e.state;this.state=("function"==typeof r?r():r)||{}},a={namespaced:{configurable:!0}};a.namespaced.get=function(){return!!this._rawModule.namespaced},o.prototype.addChild=function(e,t){this._children[e]=t},o.prototype.removeChild=function(e){delete this._children[e]},o.prototype.getChild=function(e){return this._children[e]},o.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},o.prototype.forEachChild=function(e){i(this._children,e)},o.prototype.forEachGetter=function(e){this._rawModule.getters&&i(this._rawModule.getters,e)},o.prototype.forEachAction=function(e){this._rawModule.actions&&i(this._rawModule.actions,e)},o.prototype.forEachMutation=function(e){this._rawModule.mutations&&i(this._rawModule.mutations,e)},Object.defineProperties(o.prototype,a);var s=function(e){this.register([],e,!1)};s.prototype.get=function(e){return e.reduce(function(e,t){return e.getChild(t)},this.root)},s.prototype.getNamespace=function(e){var t=this.root;return e.reduce(function(e,r){return e+((t=t.getChild(r)).namespaced?r+"/":"")},"")},s.prototype.update=function(e){!function e(t,r,n){0;r.update(n);if(n.modules)for(var i in n.modules){if(!r.getChild(i))return void 0;e(t.concat(i),r.getChild(i),n.modules[i])}}([],this.root,e)},s.prototype.register=function(e,t,r){var n=this;void 0===r&&(r=!0);var a=new o(t,r);0===e.length?this.root=a:this.get(e.slice(0,-1)).addChild(e[e.length-1],a);t.modules&&i(t.modules,function(t,i){n.register(e.concat(i),t,r)})},s.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),r=e[e.length-1];t.getChild(r).runtime&&t.removeChild(r)};var u;var c=function(e){var t=this;void 0===e&&(e={}),!u&&"undefined"!=typeof window&&window.Vue&&v(window.Vue);var r=e.plugins;void 0===r&&(r=[]);var i=e.strict;void 0===i&&(i=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new s(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new u;var o=this,a=this.dispatch,c=this.commit;this.dispatch=function(e,t){return a.call(o,e,t)},this.commit=function(e,t,r){return c.call(o,e,t,r)},this.strict=i;var l=this._modules.root.state;p(this,l,[],this._modules.root),d(this,l),r.forEach(function(e){return e(t)}),(void 0!==e.devtools?e.devtools:u.config.devtools)&&function(e){n&&(e._devtoolHook=n,n.emit("vuex:init",e),n.on("vuex:travel-to-state",function(t){e.replaceState(t)}),e.subscribe(function(e,t){n.emit("vuex:mutation",e,t)}))}(this)},l={state:{configurable:!0}};function f(e,t){return t.indexOf(e)<0&&t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function h(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var r=e.state;p(e,r,[],e._modules.root,!0),d(e,r,t)}function d(e,t,r){var n=e._vm;e.getters={};var o=e._wrappedGetters,a={};i(o,function(t,r){a[r]=function(e,t){return function(){return e(t)}}(t,e),Object.defineProperty(e.getters,r,{get:function(){return e._vm[r]},enumerable:!0})});var s=u.config.silent;u.config.silent=!0,e._vm=new u({data:{$$state:t},computed:a}),u.config.silent=s,e.strict&&function(e){e._vm.$watch(function(){return this._data.$$state},function(){0},{deep:!0,sync:!0})}(e),n&&(r&&e._withCommit(function(){n._data.$$state=null}),u.nextTick(function(){return n.$destroy()}))}function p(e,t,r,n,i){var o=!r.length,a=e._modules.getNamespace(r);if(n.namespaced&&(e._modulesNamespaceMap[a]=n),!o&&!i){var s=m(t,r.slice(0,-1)),c=r[r.length-1];e._withCommit(function(){u.set(s,c,n.state)})}var l=n.context=function(e,t,r){var n=""===t,i={dispatch:n?e.dispatch:function(r,n,i){var o=g(r,n,i),a=o.payload,s=o.options,u=o.type;return s&&s.root||(u=t+u),e.dispatch(u,a)},commit:n?e.commit:function(r,n,i){var o=g(r,n,i),a=o.payload,s=o.options,u=o.type;s&&s.root||(u=t+u),e.commit(u,a,s)}};return Object.defineProperties(i,{getters:{get:n?function(){return e.getters}:function(){return function(e,t){var r={},n=t.length;return Object.keys(e.getters).forEach(function(i){if(i.slice(0,n)===t){var o=i.slice(n);Object.defineProperty(r,o,{get:function(){return e.getters[i]},enumerable:!0})}}),r}(e,t)}},state:{get:function(){return m(e.state,r)}}}),i}(e,a,r);n.forEachMutation(function(t,r){!function(e,t,r,n){(e._mutations[t]||(e._mutations[t]=[])).push(function(t){r.call(e,n.state,t)})}(e,a+r,t,l)}),n.forEachAction(function(t,r){var n=t.root?r:a+r,i=t.handler||t;!function(e,t,r,n){(e._actions[t]||(e._actions[t]=[])).push(function(t,i){var o,a=r.call(e,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:e.getters,rootState:e.state},t,i);return(o=a)&&"function"==typeof o.then||(a=Promise.resolve(a)),e._devtoolHook?a.catch(function(t){throw e._devtoolHook.emit("vuex:error",t),t}):a})}(e,n,i,l)}),n.forEachGetter(function(t,r){!function(e,t,r,n){if(e._wrappedGetters[t])return void 0;e._wrappedGetters[t]=function(e){return r(n.state,n.getters,e.state,e.getters)}}(e,a+r,t,l)}),n.forEachChild(function(n,o){p(e,t,r.concat(o),n,i)})}function m(e,t){return t.length?t.reduce(function(e,t){return e[t]},e):e}function g(e,t,r){var n;return null!==(n=e)&&"object"==typeof n&&e.type&&(r=t,t=e,e=e.type),{type:e,payload:t,options:r}}function v(e){u&&e===u||
/**
* vuex v3.1.1
* (c) 2019 Evan You
* @license MIT
*/
-function(e){if(Number(e.version.split(".")[0])>=2)e.mixin({beforeCreate:r});else{var t=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,t.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}(u=e)}l.state.get=function(){return this._vm._data.$$state},l.state.set=function(e){0},c.prototype.commit=function(e,t,r){var n=this,i=g(e,t,r),o=i.type,a=i.payload,s=(i.options,{type:o,payload:a}),u=this._mutations[o];u&&(this._withCommit(function(){u.forEach(function(e){e(a)})}),this._subscribers.forEach(function(e){return e(s,n.state)}))},c.prototype.dispatch=function(e,t){var r=this,n=g(e,t),i=n.type,o=n.payload,a={type:i,payload:o},s=this._actions[i];if(s){try{this._actionSubscribers.filter(function(e){return e.before}).forEach(function(e){return e.before(a,r.state)})}catch(e){0}return(s.length>1?Promise.all(s.map(function(e){return e(o)})):s[0](o)).then(function(e){try{r._actionSubscribers.filter(function(e){return e.after}).forEach(function(e){return e.after(a,r.state)})}catch(e){0}return e})}},c.prototype.subscribe=function(e){return f(e,this._subscribers)},c.prototype.subscribeAction=function(e){return f("function"==typeof e?{before:e}:e,this._actionSubscribers)},c.prototype.watch=function(e,t,r){var n=this;return this._watcherVM.$watch(function(){return e(n.state,n.getters)},t,r)},c.prototype.replaceState=function(e){var t=this;this._withCommit(function(){t._vm._data.$$state=e})},c.prototype.registerModule=function(e,t,r){void 0===r&&(r={}),"string"==typeof e&&(e=[e]),this._modules.register(e,t),p(this,this.state,e,this._modules.get(e),r.preserveState),d(this,this.state)},c.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit(function(){var r=m(t.state,e.slice(0,-1));u.delete(r,e[e.length-1])}),h(this)},c.prototype.hotUpdate=function(e){this._modules.update(e),h(this,!0)},c.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(c.prototype,l);var b=S(function(e,t){var r={};return k(t).forEach(function(t){var n=t.key,i=t.val;r[n]=function(){var t=this.$store.state,r=this.$store.getters;if(e){var n=x(this.$store,"mapState",e);if(!n)return;t=n.context.state,r=n.context.getters}return"function"==typeof i?i.call(this,t,r):t[i]},r[n].vuex=!0}),r}),y=S(function(e,t){var r={};return k(t).forEach(function(t){var n=t.key,i=t.val;r[n]=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var n=this.$store.commit;if(e){var o=x(this.$store,"mapMutations",e);if(!o)return;n=o.context.commit}return"function"==typeof i?i.apply(this,[n].concat(t)):n.apply(this.$store,[i].concat(t))}}),r}),_=S(function(e,t){var r={};return k(t).forEach(function(t){var n=t.key,i=t.val;i=e+i,r[n]=function(){if(!e||x(this.$store,"mapGetters",e))return this.$store.getters[i]},r[n].vuex=!0}),r}),w=S(function(e,t){var r={};return k(t).forEach(function(t){var n=t.key,i=t.val;r[n]=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var n=this.$store.dispatch;if(e){var o=x(this.$store,"mapActions",e);if(!o)return;n=o.context.dispatch}return"function"==typeof i?i.apply(this,[n].concat(t)):n.apply(this.$store,[i].concat(t))}}),r});function k(e){return Array.isArray(e)?e.map(function(e){return{key:e,val:e}}):Object.keys(e).map(function(t){return{key:t,val:e[t]}})}function S(e){return function(t,r){return"string"!=typeof t?(r=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,r)}}function x(e,t,r){return e._modulesNamespaceMap[r]}var E={Store:c,install:v,version:"3.1.1",mapState:b,mapMutations:y,mapGetters:_,mapActions:w,createNamespacedHelpers:function(e){return{mapState:b.bind(null,e),mapGetters:_.bind(null,e),mapMutations:y.bind(null,e),mapActions:w.bind(null,e)}}};t.a=E}).call(this,r(9))},function(e,t,r){"use strict";var n=r(21),i=r(323);e.exports=i(function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()})},function(e,t,r){"use strict";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,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=Math.pow(2,31)-1;function o(e){return n.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return n.UInt32(e)&&e<=i},t.BIP32Path=o,o.toJSON=()=>"BIP32 derivation path";const a=21e14;t.Satoshi=function(e){return n.UInt53(e)&&e<=a},t.ECPoint=n.quacksLike("Point"),t.Network=n.compile({messagePrefix:n.oneOf(n.Buffer,n.String),bip32:{public:n.UInt32,private:n.UInt32},pubKeyHash:n.UInt8,scriptHash:n.UInt8,wif:n.UInt8}),t.Buffer256bit=n.BufferN(32),t.Hash160bit=n.BufferN(20),t.Hash256bit=n.BufferN(32),t.Number=n.Number,t.Array=n.Array,t.Boolean=n.Boolean,t.String=n.String,t.Buffer=n.Buffer,t.Hex=n.Hex,t.maybe=n.maybe,t.tuple=n.tuple,t.UInt8=n.UInt8,t.UInt32=n.UInt32,t.Function=n.Function,t.BufferN=n.BufferN,t.Null=n.Null,t.oneOf=n.oneOf},function(e,t,r){"use strict";const n=r(8);e.exports={Block:r(501),ECPair:r(223),Transaction:r(136),TransactionBuilder:r(503),address:r(224),bip32:r(227),crypto:r(43),networks:r(25),opcodes:r(10),payments:r(137),script:n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={network:r(228).network.defaults.MAINNET_DEFAULT,logLevel:"debug"};t.config=n},function(e,t,r){"use strict";var Buffer=r(2).Buffer,n=r(82).Transform,i=r(85).StringDecoder;function o(e){n.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(3)(o,n),o.prototype.update=function(e,t,r){"string"==typeof e&&(e=Buffer.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},o.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},o.prototype._finalOrDigest=function(e){var t=this.__final()||Buffer.alloc(0);return e&&(t=this._toString(t,e,!0)),t},o.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(21);function i(e){try{return n("rmd160").update(e).digest()}catch(t){return n("ripemd160").update(e).digest()}}function o(e){return n("sha256").update(e).digest()}t.ripemd160=i,t.sha1=function(e){return n("sha1").update(e).digest()},t.sha256=o,t.hash160=function(e){return i(o(e))},t.hash256=function(e){return o(o(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(380);Object.defineProperty(t,"TokenSigner",{enumerable:!0,get:function(){return n.TokenSigner}}),Object.defineProperty(t,"createUnsecuredToken",{enumerable:!0,get:function(){return n.createUnsecuredToken}});var i=r(498);Object.defineProperty(t,"TokenVerifier",{enumerable:!0,get:function(){return i.TokenVerifier}});var o=r(499);Object.defineProperty(t,"decodeToken",{enumerable:!0,get:function(){return o.decodeToken}});var a=r(98);Object.defineProperty(t,"MissingParametersError",{enumerable:!0,get:function(){return a.MissingParametersError}}),Object.defineProperty(t,"InvalidTokenError",{enumerable:!0,get:function(){return a.InvalidTokenError}});var s=r(127);Object.defineProperty(t,"SECP256K1Client",{enumerable:!0,get:function(){return s.SECP256K1Client}}),Object.defineProperty(t,"cryptoClients",{enumerable:!0,get:function(){return s.cryptoClients}})},function(e,t,r){"use strict";const n=r(21);function i(e){try{return n("rmd160").update(e).digest()}catch(t){return n("ripemd160").update(e).digest()}}function o(e){return n("sha256").update(e).digest()}e.exports={hash160:function(e){return i(o(e))},hash256:function(e){return o(o(e))},ripemd160:i,sha1:function(e){return n("sha1").update(e).digest()},sha256:o}},function(e,t,r){"use strict";(function(Buffer){Object.defineProperty(t,"__esModule",{value:!0});const e=r(38),n=r(42),i=r(26);function o(t,r){const o=n.decodeToken(t),a=o.payload;if(!a.hasOwnProperty("subject"))throw new Error("Token doesn't have a subject");if(!a.subject.hasOwnProperty("publicKey"))throw new Error("Token doesn't have a subject public key");if(!a.hasOwnProperty("issuer"))throw new Error("Token doesn't have an issuer");if(!a.issuer.hasOwnProperty("publicKey"))throw new Error("Token doesn't have an issuer public key");if(!a.hasOwnProperty("claim"))throw new Error("Token doesn't have a claim");const s=a.issuer.publicKey,u=Buffer.from(s,"hex"),c=e.ECPair.fromPublicKey(u,{compressed:!0}),l=i.ecPairToAddress(c),f=e.ECPair.fromPublicKey(u,{compressed:!1}),h=i.ecPairToAddress(f);if(r===s);else if(r===l);else if(r!==h)throw new Error("Token issuer public key does not match the verifying value");const d=new n.TokenVerifier(o.header.alg,s);if(!d)throw new Error("Invalid token verifier");if(!d.verify(t))throw new Error("Token verification failed");return o}t.signProfileToken=function(e,t,r,o,a="ES256K",s=new Date,u=i.nextYear()){if("ES256K"!==a)throw new Error("Signing algorithm not supported");const c=n.SECP256K1Client.derivePublicKey(t);r||(r={publicKey:c}),o||(o={publicKey:c});const l=new n.TokenSigner(a,t),f={jti:i.makeUUID4(),iat:s.toISOString(),exp:u.toISOString(),subject:r,issuer:o,claim:e};return l.sign(f)},t.wrapProfileToken=function(e){return{token:e,decodedToken:n.decodeToken(e)}},t.verifyProfileToken=o,t.extractProfile=function(e,t=null){let r,i={};(r=t?o(e,t):n.decodeToken(e)).hasOwnProperty("payload")&&r.payload.hasOwnProperty("claim")&&(i=r.payload.claim);return i}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(Buffer){if(t.base64=!0,t.array=!0,t.string=!0,t.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,t.nodebuffer=void 0!==Buffer,t.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)t.blob=!1;else{var e=new ArrayBuffer(0);try{t.blob=0===new Blob([e],{type:"application/zip"}).size}catch(r){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(e),t.blob=0===n.getBlob("application/zip").size}catch(e){t.blob=!1}}}try{t.nodestream=!!r(271).Readable}catch(e){t.nodestream=!1}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;ovoid 0!==t?t:t=e()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";e.exports={prop:function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){let e=r.call(this);return this[t]=e,e},set:function(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},value:function(e){let t;return function(){return void 0!==t?t:t=e()}}}},function(e,t,r){"use strict";var n=e.exports;[r(551),r(555),r(556),r(557),r(558),r(559)].forEach(function(e){Object.keys(e).forEach(function(t){n[t]=e[t].bind(n)})})},function(e,t,r){"use strict";(function(){var e,n,i,o,a,s,u,c={}.hasOwnProperty;u=r(13),o=u.X64Word,a=u.X64WordArray,n=r(33).Hasher,e=function(){function e(){this.K=this.convert([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]),this.I=new a(this.convert([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])),this.W=function(){var e,t;for(t=[],e=0;e<80;++e)t.push(new o(0,0));return t}()}return e.convert=function(e){var t,r,n,i;for(i=[],t=r=0,n=e.length;r>>1|(te=Q.low)<<31)^(ee>>>8|te<<24)^ee>>>7,J=(te>>>1|ee<<31)^(te>>>8|ee<<24)^(te>>>7|ee<<25),re=((oe=(ie=C[fe-2]).high)>>>19|(ae=ie.low)<<13)^(oe<<3|ae>>>29)^oe>>>6,ne=(ae>>>19|oe<<13)^(ae<<3|oe>>>29)^(ae>>>6|oe<<26),B=(B=(B=X+(D=C[fe-7]).high+((N=J+D.low)>>>0>>0?1:0))+re+((N+=ne)>>>0>>0?1:0))+(I=C[fe-16]).high+((N+=M=I.low)>>>0>>0?1:0),j.high=B,j.low=N),L=W&Z^~W&se,q=G&Y^~G&ue,he=z&F^z&$^F&$,de=R&U^R&H^U&H,pe=(z>>>28|R<<4)^(z<<30|R>>>2)^(z<<25|R>>>7),me=(R>>>28|z<<4)^(R<<30|z>>>2)^(R<<25|z>>>7),ge=ce+((W>>>14|G<<18)^(W>>>18|G<<14)^(W<<23|G>>>9))+((ve=le+((G>>>14|W<<18)^(G>>>18|W<<14)^(G<<23|W>>>9)))>>>0>>0?1:0),ce=se,le=ue,se=Z,ue=Y,Z=W,Y=G,W=V+(ge=(ge=(ge=ge+L+((ve+=q)>>>0>>0?1:0))+(P=s.K[fe]).high+((ve+=T=P.low)>>>0>>0?1:0))+B+((ve+=N)>>>0>>0?1:0))+((G=K+ve|0)>>>0>>0?1:0)|0,V=$,K=H,$=F,H=U,F=z,U=R,z=ge+(pe+he+((be=me+de)>>>0>>0?1:0))+((R=ve+be|0)>>>0>>0?1:0)|0;return o=n.low=o+R,n.high=i+z+(o>>>0>>0?1:0),c=a.low=c+U,a.high=u+F+(c>>>0>>0?1:0),h=l.low=h+H,l.high=f+$+(h>>>0>>0?1:0),m=d.low=m+K,d.high=p+V+(m>>>0>>0?1:0),b=g.low=b+G,g.high=v+W+(b>>>0>>0?1:0),w=y.low=w+Y,y.high=_+Z+(w>>>0>>0?1:0),x=k.low=x+ue,k.high=S+se+(x>>>0>>0?1:0),O=E.low=O+le,E.high=A+ce+(O>>>0>>0?1:0)},t.prototype._doFinalize=function(){var e,t,r;return e=this._data.words,r=8*this._nDataBytes,e[(t=8*this._data.sigBytes)>>>5]|=128<<24-t%32,e[30+(t+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(t+128>>>10<<5)]=r,this._data.sigBytes=4*e.length,this._process(),this._hash.toX32()},t.prototype.copy_to=function(e){return t.__super__.copy_to.call(this,e),e._hash=this._hash.clone()},t.prototype.clone=function(){var e;return e=new t,this.copy_to(e),e},t}(),t.transform=function(e){var t;return t=(new i).finalize(e),e.scrub(),t}}).call(this)},function(e,t,r){"use strict";var Buffer=r(2).Buffer;function n(e,t){this._block=Buffer.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}n.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=Buffer.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},function(e,t,r){"use strict";for(var n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={},o=0;o>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function u(e){for(var t=1,r=0;r126)throw new Error("Invalid prefix ("+e+")");t=s(t)^n>>5}for(t=s(t),r=0;r=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)throw new Error("Excess padding");if(i<t)throw new TypeError("Exceeds length limit");var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)throw new Error("Mixed-case string "+e);var o=(e=r).lastIndexOf("1");if(-1===o)throw new Error("No separator character for "+e);if(0===o)throw new Error("Missing prefix for "+e);var a=e.slice(0,o),c=e.slice(o+1);if(c.length<6)throw new Error("Data too short");for(var l=u(a),f=[],h=0;h=c.length||f.push(p)}if(1!==l)throw new Error("Invalid checksum for "+e);return{prefix:a,words:f}},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");for(var i=u(e=e.toLowerCase()),o=e+"1",a=0;a>5!=0)throw new Error("Non 5-bit word");i=s(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=s(i);for(i^=1,a=0;a<6;++a){var l=i>>5*(5-a)&31;o+=n.charAt(l)}return o},toWords:function(e){return c(e,8,5,!0)},fromWords:function(e){return c(e,5,8,!1)}}},function(e,t,r){"use strict";e.exports=r(381).default,e.exports.default=e.exports},function(e,t,r){"use strict";const n=t;n.bignum=r(7),n.define=r(428).define,n.base=r(75),n.constants=r(210),n.decoders=r(432),n.encoders=r(434)},function(e,t,r){"use strict";(function(Buffer){Object.defineProperty(t,"__esModule",{value:!0});const e=r(14),n=r(38);function i(t){return t||(t=32),e.randomBytes(t)}t.getEntropy=i,t.makeECPrivateKey=function(){return n.ECPair.makeRandom({rng:i}).privateKey.toString("hex")},t.publicKeyToAddress=function(e){const t=Buffer.from(e,"hex"),r=n.crypto.hash160(t);return n.address.toBase58Check(r,0)},t.getPublicKeyFromPrivate=function(e){return n.ECPair.fromPrivateKey(Buffer.from(e,"hex")).publicKey.toString("hex")}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(126);const n=r(252);t.Service=class{static validateProof(e,t,r=null){let i;return Promise.resolve().then(()=>(i=this.getProofUrl(e),fetch(i))).then(e=>{if(200!==e.status)throw new Error(`Proof url ${i} returned unexpected http status ${e.status}.\n Unable to validate proof.`);return e.text()}).then(i=>{if(this.shouldValidateIdentityInBody()&&e.identifier!==this.getProofIdentity(i))return e;const o=this.getProofStatement(i);return e.valid=n.containsValidProofStatement(o,r)||n.containsValidAddressProofStatement(o,t),e}).catch(t=>(console.error(t),e.valid=!1,e))}static getBaseUrls(){return[]}static getProofIdentity(e){return e}static getProofStatement(e){return e}static shouldValidateIdentityInBody(){return!1}static prefixScheme(e){return e.startsWith("https://")||e.startsWith("http://")?e.startsWith("http://")?e.replace("http://","https://"):e:`https://${e}`}static getProofUrl(e){const t=this.getBaseUrls();let r=e.proof_url.toLowerCase();r=this.prefixScheme(r);for(let n=0;nthis.hasherBlockSizeBytes&&(this.key=this.hasher.finalize(this.key)),this.key.clamp(),this._oKey=this.key.clone(),this._iKey=this.key.clone(),r=n=0,o=this.hasherBlockSize;0<=o?no;r=0<=o?++n:--n)this._oKey.words[r]^=1549556828,this._iKey.words[r]^=909522486;this._oKey.sigBytes=this._iKey.sigBytes=this.hasherBlockSizeBytes,this.reset()}return e.outputSize=64,e.prototype.outputSize=e.outputSize,e.prototype.get_output_size=function(){return this.hasher.output_size},e.prototype.reset=function(){return this.hasher.reset().update(this._iKey)},e.prototype.update=function(e){return this.hasher.update(e),this},e.prototype.finalize=function(e){var t,r,n;return t=this.hasher.finalize(e),this.hasher.reset(),r=this._oKey.clone().concat(t),n=this.hasher.finalize(r),t.scrub(),r.scrub(),n},e.prototype.scrub=function(){return this.key.scrub(),this._iKey.scrub(),this._oKey.scrub()},e}(),s=function(t){var r,n,i,o,a;return o=t.key,i=t.input,n=t.hash_class,a=(r=new e(o,n)).finalize(i.clamp()),r.scrub(),a},o=function(t,r){var n,i,o,s,c,l,f,h,d,p;d=a.findDeferral(arguments),o=t.key,i=t.input,c=t.progress_hook,s=t.klass,h=t.what,s||(s=e),h||(h="hmac_sha512"),n=new s(o),i.clamp(),f={update:function(e,t){return n.update(i.slice(e,t))},finalize:function(){return n.finalize()},default_n:1e3*n.hasherBlockSize},function(e){p=new a.Deferrals(e,{parent:d,filename:"/Users/max/src/keybase/triplesec/src/hmac.iced"}),u.bulk(i.sigBytes,f,{what:h,progress_hook:c,cb:p.defer({assign_fn:function(){return l=arguments[0]},lineno:137})}),p._fulfill()}(function(){return n.scrub(),r(l)})},t.HMAC_SHA256=function(t){function r(e){r.__super__.constructor.call(this,e,n)}return function(e,t){for(var r in t)c.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(r,e),r}(),t.HMAC=e,t.sign=s,t.bulk_sign=o}).call(this)},function(e,t,r){"use strict";for(var n=r(11),i=r(45),o=r(109),a=r(23),s=new Array(256),u=0;u<256;u++)s[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;s[254]=s[254]=1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function l(){a.call(this,"utf-8 encode")}t.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,r,n,o,a,s=e.length,u=0;for(o=0;o>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t}(e)},t.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,a=e.length,u=new Array(2*a);for(r=0,t=0;t