X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=.config%2Fchromium%2FDefault%2FExtensions%2Fdmkamcknogkgcdfhhbddcghachkejeap%2F0.9.10_0%2Fbackground.bundle.js;fp=.config%2Fchromium%2FDefault%2FExtensions%2Fdmkamcknogkgcdfhhbddcghachkejeap%2F0.9.10_0%2Fbackground.bundle.js;h=2982cdfb5e702fbd28c6dbb375c89bc7a95628fb;hb=3be0a9efc698a9570a44456009afc6014812625a;hp=0000000000000000000000000000000000000000;hpb=d2f432cc757f42f0318fdddcab8c00b240d47088;p=dotfiles%2F.git diff --git a/.config/chromium/Default/Extensions/dmkamcknogkgcdfhhbddcghachkejeap/0.9.10_0/background.bundle.js b/.config/chromium/Default/Extensions/dmkamcknogkgcdfhhbddcghachkejeap/0.9.10_0/background.bundle.js new file mode 100644 index 00000000..2982cdfb --- /dev/null +++ b/.config/chromium/Default/Extensions/dmkamcknogkgcdfhhbddcghachkejeap/0.9.10_0/background.bundle.js @@ -0,0 +1,75 @@ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1760)}([,,function(e,t,r){"use strict";(function(e){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var n=r(112),i=r(237),o=r(188);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(n)return L(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){for(var f=!0,d=0;di&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return k(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function T(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function B(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return o||B(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return o||B(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(15))},,,,function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s=r(673).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,f=67108863&c,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?u[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],h=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?m+r:u[d-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,h=0|s[1],p=8191&h,m=h>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,k=0|s[4],S=8191&k,E=k>>>13,O=0|s[5],M=8191&O,x=O>>>13,A=0|s[6],j=8191&A,P=A>>>13,I=0|s[7],R=8191&I,T=I>>>13,C=0|s[8],B=8191&C,D=C>>>13,N=0|s[9],U=8191&N,z=N>>>13,L=0|a[0],q=8191&L,K=L>>>13,F=0|a[1],$=8191&F,H=F>>>13,J=0|a[2],W=8191&J,G=J>>>13,V=0|a[3],Z=8191&V,Y=V>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],fe=8191&le,de=le>>>13,he=0|a[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(f,q))|0)+((8191&(i=(i=Math.imul(f,K))+Math.imul(d,q)|0))<<13)|0;u=((o=Math.imul(d,K))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,K))+Math.imul(m,q)|0,o=Math.imul(m,K);var ye=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,H)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,K))+Math.imul(b,q)|0,o=Math.imul(b,K),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,K))+Math.imul(_,q)|0,o=Math.imul(_,K),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,Z)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,K))+Math.imul(E,q)|0,o=Math.imul(E,K),n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var we=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(M,q),i=(i=Math.imul(M,K))+Math.imul(x,q)|0,o=Math.imul(x,K),n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var _e=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,K))+Math.imul(P,q)|0,o=Math.imul(P,K),n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var ke=(u+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,K))+Math.imul(T,q)|0,o=Math.imul(T,K),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(u+(n=n+Math.imul(f,ce)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(D,q)|0,o=Math.imul(D,K),n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Ee=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,K))+Math.imul(z,q)|0,o=Math.imul(z,K),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var Oe=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,H))+Math.imul(z,$)|0,o=Math.imul(z,H),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Me=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,G))+Math.imul(z,W)|0,o=Math.imul(z,G),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,de)|0;var xe=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,Z),i=(i=Math.imul(U,Y))+Math.imul(z,Z)|0,o=Math.imul(z,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Ae=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(z,Q)|0,o=Math.imul(z,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var je=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;u=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(z,re)|0,o=Math.imul(z,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,se)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,de)|0;var Pe=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(z,oe)|0,o=Math.imul(z,se),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,de)|0;var Ie=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(z,ce)|0,o=Math.imul(z,ue),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,de)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,fe),i=(i=Math.imul(U,de))+Math.imul(z,fe)|0,o=Math.imul(z,de);var Te=(u+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Ce=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,me))+Math.imul(z,pe)|0))<<13)|0;return u=((o=Math.imul(z,me))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=_e,c[6]=ke,c[7]=Se,c[8]=Ee,c[9]=Oe,c[10]=Me,c[11]=xe,c[12]=Ae,c[13]=je,c[14]=Pe,c[15]=Ie,c[16]=Re,c[17]=Te,c[18]=Ce,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=d),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new k(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.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")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.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)},k.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},k.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)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.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),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var m=h,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,k),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.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)},S.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),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(71)(e))},,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(595),t),i(r(359),t),i(r(596),t),i(r(360),t),i(r(598),t),i(r(371),t)},,,function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},,function(e,t,r){ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +var n=r(2),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},,function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},,function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c,u=[],l=!1,f=-1;function d(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f1)for(var r=1;r>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new l.init(r,t/2)}},h=f.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new l.init(r,t)}},p=f.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)))}},m=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.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 r,n=this._data,i=n.words,o=n.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*c,o);if(c){for(var f=0;f=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i={},o={},s=function(e,t){o[e]=t},a=function(e){var t=function(t,r){Object.assign(this,r),this.name=e,this.message=t||e,this.stack=(new Error).stack};return t.prototype=new Error,i[e]=t,t},c=function(e){if("object"==typeof e&&e){try{var t=JSON.parse(e.message);t.message&&t.name&&(e=t)}catch(e){}var r=void 0;if("string"==typeof e.name){var n=e.name,s=o[n];if(s)r=s(e);else{var u="Error"===n?Error:i[n];u||(console.warn("deserializing an unknown class '"+n+"'"),u=a(n)),r=Object.create(u.prototype);try{for(var l in e)e.hasOwnProperty(l)&&(r[l]=e[l])}catch(e){}}}else r=new Error(e.message);return!r.stack&&Error.captureStackTrace&&Error.captureStackTrace(r,c),r}return new Error(String(e))},u=function(e){return e?"object"==typeof e?function e(t,r){var i,o,s={};r.push(t);try{for(var a=n(Object.keys(t)),c=a.next();!c.done;c=a.next()){var u=c.value,l=t[u];"function"!=typeof l&&(l&&"object"==typeof l?-1!==r.indexOf(t[u])?s[u]="[Circular]":s[u]=e(t[u],r.slice(0)):s[u]=l)}}catch(e){i={error:e}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}"string"==typeof t.name&&(s.name=t.name);"string"==typeof t.message&&(s.message=t.message);"string"==typeof t.stack&&(s.stack=t.stack);return s}(e,[]):"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e:e};var l=a("AccountNameRequired"),f=a("AccountNotSupported"),d=a("AmountRequired"),h=a("BluetoothRequired"),p=a("BtcUnmatchedApp"),m=a("CantOpenDevice"),g=a("CashAddrNotSupported"),y=a("CurrencyNotSupported"),b=a("DeviceAppVerifyNotSupported"),v=a("DeviceGenuineSocketEarlyClose"),w=a("DeviceNotGenuine"),_=a("DeviceOnDashboardExpected"),k=a("DeviceOnDashboardUnexpected"),S=a("DeviceInOSUExpected"),E=a("DeviceHalted"),O=a("DeviceNameInvalid"),M=a("DeviceSocketFail"),x=a("DeviceSocketNoBulkStatus"),A=a("DisconnectedDevice"),j=a("DisconnectedDeviceDuringOperation"),P=a("EnpointConfig"),I=a("EthAppPleaseEnableContractData"),R=a("FeeEstimationFailed"),T=a("FirmwareNotRecognized"),C=a("HardResetFail"),B=a("InvalidXRPTag"),D=a("InvalidAddress"),N=a("InvalidAddressBecauseDestinationIsAlsoSource"),U=a("LatestMCUInstalledError"),z=a("UnknownMCU"),L=a("LedgerAPIError"),q=a("LedgerAPIErrorWithMessage"),K=a("LedgerAPINotAvailable"),F=a("ManagerAppAlreadyInstalled"),$=a("ManagerAppRelyOnBTC"),H=a("ManagerAppDepInstallRequired"),J=a("ManagerAppDepUninstallRequired"),W=a("ManagerDeviceLocked"),G=a("ManagerFirmwareNotEnoughSpace"),V=a("ManagerNotEnoughSpace"),Z=a("ManagerUninstallBTCDep"),Y=a("NetworkDown"),X=a("NoAddressesFound"),Q=a("NotEnoughBalance"),ee=a("NotEnoughBalanceToDelegate"),te=a("NotEnoughBalanceInParentAccount"),re=a("NotEnoughSpendableBalance"),ne=a("NotEnoughBalanceBecauseDestinationNotCreated"),ie=a("NoAccessToCamera"),oe=a("NotEnoughGas"),se=a("NotSupportedLegacyAddress"),ae=a("GasLessThanEstimate"),ce=a("PasswordsDontMatch"),ue=a("PasswordIncorrect"),le=a("RecommendSubAccountsToEmpty"),fe=a("RecommendUndelegation"),de=a("TimeoutTagged"),he=a("UnexpectedBootloader"),pe=a("MCUNotGenuineToDashboard"),me=a("RecipientRequired"),ge=a("UnavailableTezosOriginatedAccountReceive"),ye=a("UnavailableTezosOriginatedAccountSend"),be=a("UpdateFetchFileFail"),ve=a("UpdateIncorrectHash"),we=a("UpdateIncorrectSig"),_e=a("UpdateYourApp"),ke=a("UserRefusedDeviceNameChange"),Se=a("UserRefusedAddress"),Ee=a("UserRefusedFirmwareUpdate"),Oe=a("UserRefusedAllowManager"),Me=a("UserRefusedOnDevice"),xe=a("TransportOpenUserCancelled"),Ae=a("TransportInterfaceNotAvailable"),je=a("TransportRaceCondition"),Pe=a("TransportWebUSBGestureRequired"),Ie=a("DeviceShouldStayInApp"),Re=a("WebsocketConnectionError"),Te=a("WebsocketConnectionFailed"),Ce=a("WrongDeviceForAccount"),Be=a("WrongAppForCurrency"),De=a("ETHAddressNonEIP"),Ne=a("CantScanQRCode"),Ue=a("FeeNotLoaded"),ze=a("FeeRequired"),Le=a("FeeTooHigh"),qe=a("SyncError"),Ke=a("PairingFailed"),Fe=a("GenuineCheckFailed"),$e=a("LedgerAPI4xx"),He=a("LedgerAPI5xx"),Je=a("FirmwareOrAppUpdateRequired"),We=a("NoDBPathGiven"),Ge=a("DBWrongPassword"),Ve=a("DBNotReset");function Ze(e,t){this.name="TransportError",this.message=e,this.stack=(new Error).stack,this.id=t}Ze.prototype=new Error,s("TransportError",(function(e){return new Ze(e.message,e.id)}));var Ye={PIN_REMAINING_ATTEMPTS:25536,INCORRECT_LENGTH:26368,MISSING_CRITICAL_PARAMETER:26624,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,SECURITY_STATUS_NOT_SATISFIED:27010,CONDITIONS_OF_USE_NOT_SATISFIED:27013,INCORRECT_DATA:27264,NOT_ENOUGH_MEMORY_SPACE:27268,REFERENCED_DATA_NOT_FOUND:27272,FILE_ALREADY_EXISTS:27273,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,CLA_NOT_SUPPORTED:28160,TECHNICAL_PROBLEM:28416,OK:36864,MEMORY_PROBLEM:37440,NO_EF_SELECTED:37888,INVALID_OFFSET:37890,FILE_NOT_FOUND:37892,INCONSISTENT_FILE:37896,ALGORITHM_NOT_SUPPORTED:38020,INVALID_KCV:38021,CODE_NOT_INITIALIZED:38914,ACCESS_CONDITION_NOT_FULFILLED:38916,CONTRADICTION_SECRET_CODE_STATUS:38920,CONTRADICTION_INVALIDATION:38928,CODE_BLOCKED:38976,MAX_VALUE_REACHED:38992,GP_AUTH_FAILED:25344,LICENSING:28482,HALTED:28586};function Xe(e){switch(e){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received"}if(28416<=e&&e<=28671)return"Internal error, please report"}function Qe(e){this.name="TransportStatusError";var t=Object.keys(Ye).find((function(t){return Ye[t]===e}))||"UNKNOWN_ERROR",r=Xe(e)||t,n=e.toString(16);this.message="Ledger device: "+r+" (0x"+n+")",this.stack=(new Error).stack,this.statusCode=e,this.statusText=t}Qe.prototype=new Error,s("TransportStatusError",(function(e){return new Qe(e.statusCode)}))},,,,,,,,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(819),t),i(r(825),t),i(r(826),t),i(r(827),t)},,,,,function(e,t,r){var n,i,o,s,a,c,u,l,f,d,h,p,m,g,y,b,v,w,_;e.exports=(n=r(19),r(105),void(n.lib.Cipher||(i=n,o=i.lib,s=o.Base,a=o.WordArray,c=o.BufferedBlockAlgorithm,u=i.enc,u.Utf8,l=u.Base64,f=i.algo.EvpKDF,d=o.Cipher=c.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?_:v}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),o.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),h=i.mode={},p=o.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=h.CBC=function(){var e=p.extend();function t(e,t,r){var n,i=this._iv;i?(n=i,this._iv=void 0):n=this._prevBlock;for(var o=0;o>>2];e.sigBytes-=t}},o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:m,padding:g}),reset:function(){var e;d.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),y=o.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),b=(i.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?a.create([1398893684,1701076831]).concat(r).concat(t):t).toString(l)},parse:function(e){var t,r=l.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=a.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),y.create({ciphertext:r,salt:t})}},v=o.SerializableCipher=s.extend({cfg:s.extend({format:b}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),s=i.cfg;return y.create({ciphertext:o,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),w=(i.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=f.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,y.create({key:i,iv:o,salt:n})}},_=o.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:w}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=v.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,v.decrypt.call(this,e,t,i.key,n)}}))))},function(e,t,r){"use strict";var n,i,o=e.exports=r(79),s=r(513);o.codegen=r(974),o.fetch=r(975),o.path=r(976),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(307)))}})},,,function(e,t,r){const n=r(203),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(202),{re:s,t:a}=r(124),c=r(204),{compareIdentifiers:u}=r(279);class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this}}e.exports=l},,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0,r(832);const a=r(65),c=r(75),u=o(r(833)),l=o(r(836)),f=o(r(845)),d=o(r(882)),h=o(r(898)),p=o(r(986)),m=o(r(989)),g=o(r(992)),y=o(r(995)),b=o(r(998));s(r(1001),t),s(r(92),t),s(r(484),t),s(r(166),t),s(r(1002),t),s(r(1003),t),s(r(465),t),s(r(1005),t),s(r(123),t),s(r(165),t),t.init=function(e,t,r,n,i,o,s,v,w={}){a.container.register(c.TYPES.ChainsEmbedChainInfos,{useValue:n}),a.container.register(c.TYPES.EventMsgRequester,{useValue:r}),a.container.register(c.TYPES.RNG,{useValue:o}),a.container.register(c.TYPES.CommonCrypto,{useValue:s}),a.container.register(c.TYPES.Notification,{useValue:v}),a.container.register(c.TYPES.ChainsStore,{useValue:t("chains")}),a.container.register(c.TYPES.InteractionStore,{useValue:t("interaction")}),a.container.register(c.TYPES.KeyRingStore,{useValue:t("keyring")}),a.container.register(c.TYPES.LedgerStore,{useValue:t("ledger")}),a.container.register(c.TYPES.LedgerOptions,{useValue:w}),a.container.register(c.TYPES.PermissionStore,{useValue:t("permission")}),a.container.register(c.TYPES.PermissionServicePrivilegedOrigins,{useValue:i}),a.container.register(c.TYPES.PersistentMemoryStore,{useValue:t("persistent-memory")}),a.container.register(c.TYPES.SecretWasmStore,{useValue:t("secretwasm")}),a.container.register(c.TYPES.TokensStore,{useValue:t("tokens")}),a.container.register(c.TYPES.TxStore,{useValue:t("background-tx")}),a.container.register(c.TYPES.UpdaterStore,{useValue:t("updator")});const _=a.container.resolve(y.InteractionService);y.init(e,_);const k=a.container.resolve(u.PersistentMemoryService);u.init(e,k);const S=a.container.resolve(b.PermissionService);b.init(e,S);const E=a.container.resolve(m.ChainUpdaterService);m.init(e,E);const O=a.container.resolve(g.TokensService);g.init(e,O);const M=a.container.resolve(l.ChainsService);l.init(e,M);const x=a.container.resolve(f.LedgerService);f.init(e,x);const A=a.container.resolve(d.KeyRingService);d.init(e,A);const j=a.container.resolve(h.SecretWasmService);h.init(e,j);const P=a.container.resolve(p.BackgroundTxService);p.init(e,P)}},,,function(e,t,r){"use strict";var n=r(431),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,s,a,c=e.andln(3)+n&3,u=t.andln(3)+i&3;if(3===c&&(c=-1),3===u&&(u=-1),0==(1&c))o=0;else o=3!==(a=e.andln(7)+n&7)&&5!==a||2!==u?c:-c;if(r[0].push(o),0==(1&u))s=0;else s=3!==(a=t.andln(7)+i&7)&&5!==a||2!==c?u:-u;r[1].push(s),2*n===o+1&&(n=1-n),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUtf8=t.fromUtf8=t.toRfc3339=t.fromRfc3339=t.toHex=t.fromHex=t.Bech32=t.toBase64=t.fromBase64=t.toAscii=t.fromAscii=void 0;var n=r(614);Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return n.toAscii}});var i=r(615);Object.defineProperty(t,"fromBase64",{enumerable:!0,get:function(){return i.fromBase64}}),Object.defineProperty(t,"toBase64",{enumerable:!0,get:function(){return i.toBase64}});var o=r(616);Object.defineProperty(t,"Bech32",{enumerable:!0,get:function(){return o.Bech32}});var s=r(617);Object.defineProperty(t,"fromHex",{enumerable:!0,get:function(){return s.fromHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return s.toHex}});var a=r(618);Object.defineProperty(t,"fromRfc3339",{enumerable:!0,get:function(){return a.fromRfc3339}}),Object.defineProperty(t,"toRfc3339",{enumerable:!0,get:function(){return a.toRfc3339}});var c=r(619);Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return c.fromUtf8}}),Object.defineProperty(t,"toUtf8",{enumerable:!0,get:function(){return c.toUtf8}})},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(531),t),i(r(226),t),i(r(535),t),i(r(538),t)},,function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},s={};function a(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=s[e])?n:(r=u(e,(0|e)<0?-1:0,!0),i&&(s[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=u(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=p)return S}else{if(e<=-m)return E;if(e+1>=m)return k}return e<0?c(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,r){return new n(e,t,r)}n.fromInt=a,n.fromNumber=c,n.fromBits=u;var l=Math.pow;function f(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return y;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return f(e.substring(1),t,r).neg();for(var i=c(l(r,8)),o=y,s=0;s>>0:this.low},O.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},O.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=a).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},O.getHighBits=function(){return this.high},O.getHighBitsUnsigned=function(){return this.high>>>0},O.getLowBits=function(){return this.low},O.getLowBitsUnsigned=function(){return this.low>>>0},O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},O.isOdd=function(){return 1==(1&this.low)},O.isEven=function(){return 0==(1&this.low)},O.equals=function(e){return i(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},O.eq=O.equals,O.notEquals=function(e){return!this.eq(e)},O.neq=O.notEquals,O.ne=O.notEquals,O.lessThan=function(e){return this.comp(e)<0},O.lt=O.lessThan,O.lessThanOrEqual=function(e){return this.comp(e)<=0},O.lte=O.lessThanOrEqual,O.le=O.lessThanOrEqual,O.greaterThan=function(e){return this.comp(e)>0},O.gt=O.greaterThan,O.greaterThanOrEqual=function(e){return this.comp(e)>=0},O.gte=O.greaterThanOrEqual,O.ge=O.greaterThanOrEqual,O.compare=function(e){if(i(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},O.comp=O.compare,O.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(v)},O.neg=O.negate,O.add=function(e){i(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,l=0,f=0,h=0,p=0;return h+=(p+=o+(65535&e.low))>>>16,f+=(h+=n+c)>>>16,l+=(f+=r+a)>>>16,l+=t+s,u((h&=65535)<<16|(p&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},O.subtract=function(e){return i(e)||(e=d(e)),this.add(e.neg())},O.sub=O.subtract,O.multiply=function(e){if(this.isZero())return y;if(i(e)||(e=d(e)),r)return u(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return c(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,a=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,p=0,m=0,b=0,v=0;return b+=(v+=s*h)>>>16,m+=(b+=o*h)>>>16,b&=65535,m+=(b+=s*f)>>>16,p+=(m+=n*h)>>>16,m&=65535,p+=(m+=o*f)>>>16,m&=65535,p+=(m+=s*l)>>>16,p+=t*h+n*f+o*l+s*a,u((b&=65535)<<16|(v&=65535),(p&=65535)<<16|(m&=65535),this.unsigned)},O.mul=O.multiply,O.divide=function(e){if(i(e)||(e=d(e)),e.isZero())throw Error("division by zero");var t,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:y;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return w;o=b}else{if(this.eq(E))return e.eq(v)||e.eq(_)?E:e.eq(E)?v:(t=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?v:_:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=y}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),a=s<=48?1:l(2,s-48),f=c(t),h=f.mul(e);h.isNegative()||h.gt(n);)h=(f=c(t-=a,this.unsigned)).mul(e);f.isZero()&&(f=v),o=o.add(f),n=n.sub(h)}return o},O.div=O.divide,O.modulo=function(e){return i(e)||(e=d(e)),r?u((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},O.mod=O.modulo,O.rem=O.modulo,O.not=function(){return u(~this.low,~this.high,this.unsigned)},O.and=function(e){return i(e)||(e=d(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},O.or=function(e){return i(e)||(e=d(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},O.xor=function(e){return i(e)||(e=d(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},O.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<>>32-e,this.unsigned):u(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},O.shr=O.shiftRight,O.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},O.shru=O.shiftRightUnsigned,O.shr_u=O.shiftRightUnsigned,O.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},O.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},O.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},O.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},O.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){"use strict";var n=t;n.version=r(689).version,n.utils=r(56),n.rand=r(250),n.curve=r(412),n.curves=r(253),n.ec=r(700),n.eddsa=r(704)},function(e,t,r){const n=r(44);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},function(e,t,r){class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!p(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(o,x(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],f),a("comparator trim",e,u[l.COMPARATORTRIM]),e=(e=(e=e.replace(u[l.TILDETRIM],d)).replace(u[l.CARETTRIM],h)).split(/\s+/).join(" ");const c=n?u[l.COMPARATORLOOSE]:u[l.COMPARATOR],m=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>M(e,this.options)).filter(this.options.loose?e=>!!e.match(c):()=>!0).map(e=>new s(e,this.options)),g=(m.length,new Map);for(const e of m){if(p(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const b=[...g.values()];return i.set(t,b),b}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some(r=>g(r,t)&&e.set.some(e=>g(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},y=(e,t)=>(a("comp",e,t),e=_(e,t),a("caret",e),e=v(e,t),a("tildes",e),e=S(e,t),a("xrange",e),e=O(e,t),a("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const r=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(r,(t,r,n,i,o)=>{let s;return a("tilde",e,t,r,n,i,o),b(r)?s="":b(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:b(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",s),s})},_=(e,t)=>e.trim().split(/\s+/).map(e=>k(e,t)).join(" "),k=(e,t)=>{a("caret",e,t);const r=t.loose?u[l.CARETLOOSE]:u[l.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,s)=>{let c;return a("caret",e,t,r,i,o,s),b(r)?c="":b(i)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:b(o)?c="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),c="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(a("no pr"),c="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),a("caret return",c),c})},S=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map(e=>E(e,t)).join(" ")),E=(e,t)=>{e=e.trim();const r=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(r,(r,n,i,o,s,c)=>{a("xRange",e,r,n,i,o,s,c);const u=b(i),l=u||b(o),f=l||b(s),d=f;return"="===n&&d&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(l&&(o=0),s=0,">"===n?(n=">=",l?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",l?i=+i+1:o=+o+1),"<"===n&&(c="-0"),r=`${n+i}.${o}.${s}${c}`):l?r=`>=${i}.0.0${c} <${+i+1}.0.0-0`:f&&(r=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),a("xRange return",r),r})},O=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[l.STAR],"")),M=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),x=e=>(t,r,n,i,o,s,a,c,u,l,f,d,h)=>`${r=b(n)?"":b(i)?`>=${n}.0.0${e?"-0":""}`:b(o)?`>=${n}.${i}.0${e?"-0":""}`:s?">="+r:`>=${r}${e?"-0":""}`} ${c=b(u)?"":b(l)?`<${+u+1}.0.0-0`:b(f)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${f}-${d}`:e?`<${u}.${l}.${+f+1}-0`:"<="+c}`.trim(),A=(e,t,r)=>{for(let r=0;r0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(900);t.Bech32=n.Bech32;var i=r(901);t.Decimal=i.Decimal;var o=r(494);t.Encoding=o.Encoding;var s=r(902);t.Int53=s.Int53,t.Uint32=s.Uint32,t.Uint53=s.Uint53,t.Uint64=s.Uint64;var a=r(903);t.isJsonCompatibleValue=a.isJsonCompatibleValue,t.isJsonCompatibleDictionary=a.isJsonCompatibleDictionary,t.isJsonCompatibleArray=a.isJsonCompatibleArray;var c=r(904);t.TransactionEncoder=c.TransactionEncoder;var u=r(496);t.isNonNullObject=u.isNonNullObject,t.isUint8Array=u.isUint8Array},function(e,t,r){"use strict";var n;r.r(t),r.d(t,"Lifecycle",(function(){return i})),r.d(t,"autoInjectable",(function(){return P})),r.d(t,"inject",(function(){return I})),r.d(t,"injectable",(function(){return R})),r.d(t,"registry",(function(){return T})),r.d(t,"singleton",(function(){return C})),r.d(t,"injectAll",(function(){return B})),r.d(t,"injectAllWithTransform",(function(){return D})),r.d(t,"injectWithTransform",(function(){return N})),r.d(t,"scoped",(function(){return U})),r.d(t,"instanceCachingFactory",(function(){return z})),r.d(t,"predicateAwareClassFactory",(function(){return L})),r.d(t,"isClassProvider",(function(){return d})),r.d(t,"isFactoryProvider",(function(){return h})),r.d(t,"isNormalToken",(function(){return g})),r.d(t,"isTokenProvider",(function(){return v})),r.d(t,"isValueProvider",(function(){return w})),r.d(t,"delay",(function(){return m})),r.d(t,"container",(function(){return j})),function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"}(n||(n={}));var i=n,o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)}; +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */function s(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function u(){for(var e=[],t=0;t0},e.prototype.clear=function(){this._registryMap.clear()},e.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},e}(),k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(_),S=function(){this.scopedResolutions=new Map};function E(e,t,r){var n,i,o=c(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2)[1],s=function(e,t){return null===e?"at position #"+t:'"'+e.split(",")[t].trim()+'" at position #'+t}(void 0===o?null:o,t);return n="Cannot inject the dependency "+s+' of "'+e.name+'" constructor. Reason:',void 0===i&&(i=" "),u([n],r.message.split("\n").map((function(e){return i+e}))).join("\n")}var O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(_),M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(_),x=function(){this.preResolution=new O,this.postResolution=new M},A=new Map,j=new(function(){function e(e){this.parent=e,this._registry=new k,this.interceptors=new x}return e.prototype.register=function(e,t,r){var n;if(void 0===r&&(r={lifecycle:i.Transient}),n=function(e){return d(e)||w(e)||v(e)||h(e)}(t)?t:{useClass:t},v(n))for(var o=[e],s=n;null!=s;){var a=s.useToken;if(o.includes(a))throw new Error("Token registration cycle detected! "+u(o,[a]).join(" -> "));o.push(a);var c=this._registry.get(a);s=c&&v(c.provider)?c.provider:null}if((r.lifecycle===i.Singleton||r.lifecycle==i.ContainerScoped||r.lifecycle==i.ResolutionScoped)&&(w(n)||h(n)))throw new Error('Cannot use lifecycle "'+i[r.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:r}),this},e.prototype.registerType=function(e,t){return g(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},e.prototype.registerInstance=function(e,t){return this.register(e,{useValue:t})},e.prototype.registerSingleton=function(e,t){if(g(e)){if(g(t))return this.register(e,{useToken:t},{lifecycle:i.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:i.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var r=e;return t&&!g(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:i.Singleton})},e.prototype.resolve=function(e,t){void 0===t&&(t=new S);var r=this.getRegistration(e);if(!r&&g(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),r){var n=this.resolveRegistration(r,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}if(function(e){return"function"==typeof e||e instanceof p}(e)){n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(e,t){var r,n;if(this.interceptors.preResolution.has(e)){var i=[];try{for(var o=a(this.interceptors.preResolution.getAll(e)),s=o.next();!s.done;s=o.next()){var c=s.value;"Once"!=c.options.frequency&&i.push(c),c.callback(e,t)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}this.interceptors.preResolution.setAll(e,i)}},e.prototype.executePostResolutionInterceptor=function(e,t,r){var n,i;if(this.interceptors.postResolution.has(e)){var o=[];try{for(var s=a(this.interceptors.postResolution.getAll(e)),c=s.next();!c.done;c=s.next()){var u=c.value;"Once"!=u.options.frequency&&o.push(u),u.callback(e,t,r)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,o)}},e.prototype.resolveRegistration=function(e,t){if(e.options.lifecycle===i.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var r,n=e.options.lifecycle===i.Singleton,o=e.options.lifecycle===i.ContainerScoped,s=n||o;return r=w(e.provider)?e.provider.useValue:v(e.provider)?s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):d(e.provider)?s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):h(e.provider)?e.provider.useFactory(this):this.construct(e.provider,t),e.options.lifecycle===i.ResolutionScoped&&t.scopedResolutions.set(e,r),r},e.prototype.resolveAll=function(e,t){var r=this;void 0===t&&(t=new S);var n=this.getAllRegistrations(e);if(!n&&g(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),n){var i=n.map((function(e){return r.resolveRegistration(e,t)}));return this.executePostResolutionInterceptor(e,i,"All"),i}var o=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,o,"All"),o},e.prototype.isRegistered=function(e,t){return void 0===t&&(t=!1),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},e.prototype.reset=function(){this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var e,t;try{for(var r=a(this._registry.entries()),n=r.next();!n.done;n=r.next()){var i=c(n.value,2),o=i[0],s=i[1];this._registry.setAll(o,s.filter((function(e){return!w(e.provider)})).map((function(e){return e.instance=void 0,e})))}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.createChildContainer=function(){var t,r,n=new e(this);try{for(var o=a(this._registry.entries()),s=o.next();!s.done;s=o.next()){var u=c(s.value,2),l=u[0],f=u[1];f.some((function(e){return e.options.lifecycle===i.ContainerScoped}))&&n._registry.setAll(l,f.map((function(e){return e.options.lifecycle===i.ContainerScoped?{provider:e.provider,options:e.options}:e})))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},e.prototype.beforeResolution=function(e,t,r){void 0===r&&(r={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:r})},e.prototype.afterResolution=function(e,t,r){void 0===r&&(r={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:r})},e.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},e.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},e.prototype.construct=function(e,t){var r=this;if(e instanceof p)return e.createProxy((function(e){return r.resolve(e,t)}));var n=A.get(e);if(!n||0===n.length){if(0===e.length)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var i=n.map(this.resolveParams(t,e));return new(e.bind.apply(e,u([void 0],i)))},e.prototype.resolveParams=function(e,t){var r=this;return function(n,i){var o,s,a;try{return y(n)?b(n)?n.multiple?(o=r.resolve(n.transform)).transform.apply(o,u([r.resolveAll(n.token)],n.transformArgs)):(s=r.resolve(n.transform)).transform.apply(s,u([r.resolve(n.token,e)],n.transformArgs)):n.multiple?r.resolveAll(n.token):r.resolve(n.token,e):b(n)?(a=r.resolve(n.transform,e)).transform.apply(a,u([r.resolve(n.token,e)],n.transformArgs)):r.resolve(n,e)}catch(e){throw new Error(E(t,i,e))}}},e}());var P=function(){return function(e){var t=l(e);return function(r){function n(){for(var n=[],i=0;i0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var u=c.length,l=g(c,u);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return f}));var n,i,o=r(317),s=r.n(o),a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r>8;return u.find((function(e){return e.productIdMM===r}))},d=[],h={};for(var p in c){var m=c[p],g=m.bluetoothSpec;if(g)for(var y=0;y=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(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&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i>>0}return s},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,s=(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,s,a){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){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,s,a,c,u){return t+n+o+a+u>>>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";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES=void 0,t.TYPES={ChainsStore:Symbol("ChainsStore"),ChainsEmbedChainInfos:Symbol("ChainsEmbededChainInfos"),InteractionStore:Symbol("InteractionStore"),KeyRingStore:Symbol("KeyRingStore"),LedgerStore:Symbol("LedgerStore"),LedgerOptions:Symbol("LedgerOptions"),PermissionStore:Symbol("PermissionStore"),PermissionServicePrivilegedOrigins:Symbol("PermissionServicePrivilegedOrigins"),PersistentMemoryStore:Symbol("PersistentMemoryStore"),SecretWasmStore:Symbol("SecretWasmStore"),TokensStore:Symbol("TokensStore"),TxStore:Symbol("TxStore"),UpdaterStore:Symbol("UpdaterStore"),EventMsgRequester:Symbol("EventMsgRequester"),RNG:Symbol("RandomNumberGenerator"),CommonCrypto:Symbol("CommonCrypto"),Notification:Symbol("Notification")}},function(e,t,r){"use strict";e.exports=s;var n=r(126);((s.prototype=Object.create(n.prototype)).constructor=s).className="Enum";var i=r(170),o=r(41);function s(e,t,r,i,o){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){e.exports=r(737)},,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(761),t),i(r(772),t),i(r(797),t)},,function(e,t,r){var n=r(13).Buffer,i=r(327).Transform,o=r(83).StringDecoder;function s(e){i.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(11)(s,i),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.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)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(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=s},function(e,t,r){"use strict";(function(t,n){var i=r(13).Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>65536)for(var s=0;s0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;rl(e.toString(2),"0",8)).join("")}function h(e){const t=8*e.length/32,r=n("sha256").update(e).digest();return d(Array.from(r)).slice(0,t)}function p(e){return"mnemonic"+(e||"")}function m(t,r){if(!(r=r||a))throw new Error(c);const n=u(t).split(" ");if(n.length%3!=0)throw new Error("Invalid mnemonic");const i=n.map(e=>{const t=r.indexOf(e);if(-1===t)throw new Error("Invalid mnemonic");return l(t.toString(2),"0",11)}).join(""),o=32*Math.floor(i.length/33),s=i.slice(0,o),d=i.slice(o),p=s.match(/(.{1,8})/g).map(f);if(p.length<16)throw new Error("Invalid entropy");if(p.length>32)throw new Error("Invalid entropy");if(p.length%4!=0)throw new Error("Invalid entropy");const m=e.from(p);if(h(m)!==d)throw new Error("Invalid mnemonic checksum");return m.toString("hex")}function g(t,r){if(e.isBuffer(t)||(t=e.from(t,"hex")),!(r=r||a))throw new Error(c);if(t.length<16)throw new TypeError("Invalid entropy");if(t.length>32)throw new TypeError("Invalid entropy");if(t.length%4!=0)throw new TypeError("Invalid entropy");const n=(d(Array.from(t))+h(t)).match(/(.{1,11})/g).map(e=>{const t=f(e);return r[t]});return"あいこくしん"===r[0]?n.join(" "):n.join(" ")}t.mnemonicToSeedSync=function(t,r){const n=e.from(u(t),"utf8"),o=e.from(p(u(r)),"utf8");return i.pbkdf2Sync(n,o,2048,64,"sha512")},t.mnemonicToSeed=function(t,r){return Promise.resolve().then(()=>function(e,t,r,n,o){return Promise.resolve().then(()=>new Promise((s,a)=>{i.pbkdf2(e,t,r,n,o,(e,t)=>e?a(e):s(t))}))}(e.from(u(t),"utf8"),e.from(p(u(r)),"utf8"),2048,64,"sha512"))},t.mnemonicToEntropy=m,t.entropyToMnemonic=g,t.generateMnemonic=function(e,t,r){if((e=e||128)%32!=0)throw new TypeError("Invalid entropy");return g((t=t||o)(e/8),r)},t.validateMnemonic=function(e,t){try{m(e,t)}catch(e){return!1}return!0},t.setDefaultWordlist=function(e){const t=s.wordlists[e];if(!t)throw new Error('Could not find wordlist for language "'+e+'"');a=t},t.getDefaultWordlist=function(){if(!a)throw new Error("No Default Wordlist set");return Object.keys(s.wordlists).filter(e=>"JA"!==e&&"EN"!==e&&s.wordlists[e].every((e,t)=>e===a[t]))[0]};var y=r(390);t.wordlists=y.wordlists}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(11),o=r(373),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function m(e,t,r,n,i,o,s,a){return p(e+(t^r^n)+o+s|0,a)+i|0}function g(e,t,r,n,i,o,s,a){return p(e+(t&r|~t&n)+o+s|0,a)+i|0}function y(e,t,r,n,i,o,s,a){return p(e+((t|~r)^n)+o+s|0,a)+i|0}function b(e,t,r,n,i,o,s,a){return p(e+(t&n|r&~n)+o+s|0,a)+i|0}function v(e,t,r,n,i,o,s,a){return p(e+(t^(r|~n))+o+s|0,a)+i|0}i(h,o),h.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,w=0|this._a,_=0|this._b,k=0|this._c,S=0|this._d,E=0|this._e,O=0;O<80;O+=1){var M,x;O<16?(M=m(r,n,i,o,h,e[a[O]],f[0],u[O]),x=v(w,_,k,S,E,e[c[O]],d[0],l[O])):O<32?(M=g(r,n,i,o,h,e[a[O]],f[1],u[O]),x=b(w,_,k,S,E,e[c[O]],d[1],l[O])):O<48?(M=y(r,n,i,o,h,e[a[O]],f[2],u[O]),x=y(w,_,k,S,E,e[c[O]],d[2],l[O])):O<64?(M=b(r,n,i,o,h,e[a[O]],f[3],u[O]),x=g(w,_,k,S,E,e[c[O]],d[3],l[O])):(M=v(r,n,i,o,h,e[a[O]],f[4],u[O]),x=m(w,_,k,S,E,e[c[O]],d[4],l[O])),r=h,h=o,o=p(i,10),i=n,n=M,w=E,E=S,S=p(k,10),k=_,_=x}var A=this._b+i+S|0;this._b=this._c+o+E|0,this._c=this._d+h+w|0,this._d=this._e+r+_|0,this._e=this._a+n+k|0,this._a=A},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},function(e,t,r){"use strict";var n=r(190),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var o=Object.create(r(157));o.inherits=r(11);var s=r(382),a=r(245);o.inherits(f,s);for(var c=i(a.prototype),u=0;u=0&&(t=e.length-e.indexOf(".")-1,e=e.replace(".","")),this.int=i.default(e)}else"number"==typeof e?this.int=i.default(e):e instanceof o.Int?this.int=i.default(e.toString()):this.int=i.default(e);this.int=this.int.multiply(a.calcPrecisionMultiplier(i.default(t)))}static calcPrecisionMultiplier(e){if(e.lt(i.default(0)))throw new Error("Invalid prec");if(e.gt(a.precision))throw new Error("Too much precision");if(a.precisionMultipliers[e.toString()])return a.precisionMultipliers[e.toString()];const t=a.precision.minus(e),r=i.default(10).pow(t);return a.precisionMultipliers[e.toString()]=r,r}isZero(){return this.int.eq(i.default(0))}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}equals(e){return this.int.eq(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.geq(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.leq(e.int)}neg(){return new a(this.int.negate(),a.precision.toJSNumber())}abs(){return new a(this.int.abs(),a.precision.toJSNumber())}add(e){return new a(this.int.add(e.int),a.precision.toJSNumber())}sub(e){return new a(this.int.subtract(e.int),a.precision.toJSNumber())}mul(e){return new a(this.mulRaw(e).chopPrecisionAndRound(),a.precision.toJSNumber())}mulTruncate(e){return new a(this.mulRaw(e).chopPrecisionAndTruncate(),a.precision.toJSNumber())}mulRaw(e){return new a(this.int.multiply(e.int),a.precision.toJSNumber())}quo(e){return new a(this.quoRaw(e).chopPrecisionAndRound(),a.precision.toJSNumber())}quoTruncate(e){return new a(this.quoRaw(e).chopPrecisionAndTruncate(),a.precision.toJSNumber())}quoRoundUp(e){return new a(this.quoRaw(e).chopPrecisionAndRoundUp(),a.precision.toJSNumber())}quoRaw(e){const t=a.calcPrecisionMultiplier(i.default(0)),r=this.int.multiply(t).multiply(t);return new a(r.divide(e.int),a.precision.toJSNumber())}isInteger(){const e=a.calcPrecisionMultiplier(i.default(0));return this.int.remainder(e).equals(i.default(0))}chopPrecisionAndRound(){if(this.isNegative()){return this.abs().chopPrecisionAndRound().negate()}const e=a.calcPrecisionMultiplier(i.default(0)),t=e.divide(i.default(2)),{quotient:r,remainder:n}=this.int.divmod(e);return n.equals(i.default(0))||n.lt(t)?r:n.gt(t)?r.add(i.default(1)):r.divide(i.default(2)).equals(i.default(0))?r:r.add(i.default(1))}chopPrecisionAndRoundUp(){if(this.isNegative()){return this.abs().chopPrecisionAndTruncate().negate()}const e=a.calcPrecisionMultiplier(i.default(0)),{quotient:t,remainder:r}=this.int.divmod(e);return r.equals(i.default(0))?t:t.add(i.default(1))}chopPrecisionAndTruncate(){const e=a.calcPrecisionMultiplier(i.default(0));return this.int.divide(e)}toString(e=a.precision.toJSNumber(),t=!1){const r=a.calcPrecisionMultiplier(i.default(0)),n=this.int.abs(),{quotient:o,remainder:c}=n.divmod(r);let u=c.toString(10);for(let e=0,t=u.length;e0?"."+u:""}`}round(){return new o.Int(this.chopPrecisionAndRound())}roundUp(){return new o.Int(this.chopPrecisionAndRoundUp())}truncate(){return new o.Int(this.chopPrecisionAndTruncate())}}t.Dec=a,a.precision=i.default(18),a.precisionMultipliers={}},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),s=n[0],a=n[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=0,a=r-i;sa?a:s+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i,o,s=[],a=t;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,s,a;if("string"==typeof t&&(i="not ",t.substr(!s||s<0?0:+s,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(o(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=r(374),o=r(378);r(11)(u,i);for(var s=n(o.prototype),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},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,s,a;if("string"==typeof t&&(i="not ",t.substr(!s||s<0?0:+s,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(o(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=r(405),o=r(409);r(11)(u,i);for(var s=n(o.prototype),a=0;a>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-s%4*2,u=a|c;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)},function(e,t,r){var n;e.exports=(n=r(19),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],c=e[t+1],h=e[t+2],p=e[t+3],m=e[t+4],g=e[t+5],y=e[t+6],b=e[t+7],v=e[t+8],w=e[t+9],_=e[t+10],k=e[t+11],S=e[t+12],E=e[t+13],O=e[t+14],M=e[t+15],x=o[0],A=o[1],j=o[2],P=o[3];x=u(x,A,j,P,s,7,a[0]),P=u(P,x,A,j,c,12,a[1]),j=u(j,P,x,A,h,17,a[2]),A=u(A,j,P,x,p,22,a[3]),x=u(x,A,j,P,m,7,a[4]),P=u(P,x,A,j,g,12,a[5]),j=u(j,P,x,A,y,17,a[6]),A=u(A,j,P,x,b,22,a[7]),x=u(x,A,j,P,v,7,a[8]),P=u(P,x,A,j,w,12,a[9]),j=u(j,P,x,A,_,17,a[10]),A=u(A,j,P,x,k,22,a[11]),x=u(x,A,j,P,S,7,a[12]),P=u(P,x,A,j,E,12,a[13]),j=u(j,P,x,A,O,17,a[14]),x=l(x,A=u(A,j,P,x,M,22,a[15]),j,P,c,5,a[16]),P=l(P,x,A,j,y,9,a[17]),j=l(j,P,x,A,k,14,a[18]),A=l(A,j,P,x,s,20,a[19]),x=l(x,A,j,P,g,5,a[20]),P=l(P,x,A,j,_,9,a[21]),j=l(j,P,x,A,M,14,a[22]),A=l(A,j,P,x,m,20,a[23]),x=l(x,A,j,P,w,5,a[24]),P=l(P,x,A,j,O,9,a[25]),j=l(j,P,x,A,p,14,a[26]),A=l(A,j,P,x,v,20,a[27]),x=l(x,A,j,P,E,5,a[28]),P=l(P,x,A,j,h,9,a[29]),j=l(j,P,x,A,b,14,a[30]),x=f(x,A=l(A,j,P,x,S,20,a[31]),j,P,g,4,a[32]),P=f(P,x,A,j,v,11,a[33]),j=f(j,P,x,A,k,16,a[34]),A=f(A,j,P,x,O,23,a[35]),x=f(x,A,j,P,c,4,a[36]),P=f(P,x,A,j,m,11,a[37]),j=f(j,P,x,A,b,16,a[38]),A=f(A,j,P,x,_,23,a[39]),x=f(x,A,j,P,E,4,a[40]),P=f(P,x,A,j,s,11,a[41]),j=f(j,P,x,A,p,16,a[42]),A=f(A,j,P,x,y,23,a[43]),x=f(x,A,j,P,w,4,a[44]),P=f(P,x,A,j,S,11,a[45]),j=f(j,P,x,A,M,16,a[46]),x=d(x,A=f(A,j,P,x,h,23,a[47]),j,P,s,6,a[48]),P=d(P,x,A,j,b,10,a[49]),j=d(j,P,x,A,O,15,a[50]),A=d(A,j,P,x,g,21,a[51]),x=d(x,A,j,P,S,6,a[52]),P=d(P,x,A,j,p,10,a[53]),j=d(j,P,x,A,_,15,a[54]),A=d(A,j,P,x,c,21,a[55]),x=d(x,A,j,P,v,6,a[56]),P=d(P,x,A,j,M,10,a[57]),j=d(j,P,x,A,y,15,a[58]),A=d(A,j,P,x,E,21,a[59]),x=d(x,A,j,P,m,6,a[60]),P=d(P,x,A,j,k,10,a[61]),j=d(j,P,x,A,h,15,a[62]),A=d(A,j,P,x,w,21,a[63]),o[0]=o[0]+x|0,o[1]=o[1]+A|0,o[2]=o[2]+j|0,o[3]=o[3]+P|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+i+s;return(a<>>32-o)+t}function l(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+i+s;return(a<>>32-o)+t}function f(e,t,r,n,i,o,s){var a=e+(t^r^n)+i+s;return(a<>>32-o)+t}function d(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+i+s;return(a<>>32-o)+t}t.MD5=o._createHelper(c),t.HmacMD5=o._createHmacHelper(c)}(Math),n.MD5)},,,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(469),t),i(r(277),t),i(r(842),t),i(r(470),t)},function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n}=r(202),i=r(203),o=(t=e.exports={}).re=[],s=t.src=[],a=t.t={};let c=0;const u=(e,t,r)=>{const n=c++;i(n,t),a[e]=n,s[n]=t,o[n]=new RegExp(t,r?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[a.NUMERICIDENTIFIER]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[a.NUMERICIDENTIFIERLOOSE]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[a.PRERELEASEIDENTIFIER]}(?:\\.${s[a.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[a.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[a.BUILDIDENTIFIER]}(?:\\.${s[a.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[a.MAINVERSION]}${s[a.PRERELEASE]}?${s[a.BUILD]}?`),u("FULL",`^${s[a.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[a.MAINVERSIONLOOSE]}${s[a.PRERELEASELOOSE]}?${s[a.BUILD]}?`),u("LOOSE",`^${s[a.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",s[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),u("XRANGEIDENTIFIER",s[a.NUMERICIDENTIFIER]+"|x|X|\\*"),u("XRANGEPLAIN",`[v=\\s]*(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:${s[a.PRERELEASE]})?${s[a.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:${s[a.PRERELEASELOOSE]})?${s[a.BUILD]}?)?)?`),u("XRANGE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),u("COERCERTL",s[a.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${s[a.LONECARET]}${s[a.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[a.LONECARET]}${s[a.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[a.GTLT]}\\s*(${s[a.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]}|${s[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[a.XRANGEPLAIN]})\\s+-\\s+(${s[a.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[a.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0.0.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},function(e,t,r){const{MAX_LENGTH:n}=r(202),{re:i,t:o}=r(124),s=r(44),a=r(204);e.exports=(e,t)=>{if(t=a(t),e instanceof s)return e;if("string"!=typeof e)return null;if(e.length>n)return null;if(!(t.loose?i[o.LOOSE]:i[o.FULL]).test(e))return null;try{return new s(e,t)}catch(e){return null}}},function(e,t,r){"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(41);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var s=o[e];i.setProperty(s,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var a={};a[e]=t,n.push(a)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?[2,e[0]]:[2,a()]}}))}))}var l=function(){return Promise.resolve(!!navigator&&!!navigator.usb&&"function"==typeof navigator.usb.getDevices)}},,,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Secp256k1Wallet=t.Secp256k1HdWallet=t.extractKdfConfiguration=t.executeKdf=t.pubkeyType=t.makeStdTx=t.isWrappedStdTx=t.isStdTx=t.SigningCosmosClient=t.decodeSignature=t.encodeSecp256k1Signature=t.findSequenceForSignedTx=t.encodeSecp256k1Pubkey=t.encodeBech32Pubkey=t.encodeAminoPubkey=t.decodeBech32Pubkey=t.decodeAminoPubkey=t.makeCosmoshubPath=t.isMsgWithdrawValidatorCommission=t.isMsgWithdrawDelegatorReward=t.isMsgUndelegate=t.isMsgSetWithdrawAddress=t.isMsgSend=t.isMsgMultiSend=t.isMsgFundCommunityPool=t.isMsgEditValidator=t.isMsgDelegate=t.isMsgCreateValidator=t.isMsgBeginRedelegate=t.uint64ToString=t.uint64ToNumber=t.setupSupplyExtension=t.setupStakingExtension=t.setupSlashingExtension=t.setupMintExtension=t.setupGovExtension=t.setupDistributionExtension=t.setupBankExtension=t.setupAuthExtension=t.normalizePubkey=t.normalizeLcdApiArray=t.LcdClient=t.BroadcastMode=t.GasPrice=t.buildFeeTable=t.serializeSignDoc=t.makeSignDoc=t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByHeightQuery=t.isBroadcastTxSuccess=t.isBroadcastTxFailure=t.CosmosClient=t.assertIsBroadcastTxSuccess=t.parseCoins=t.coins=t.coin=t.rawSecp256k1PubkeyToAddress=t.pubkeyToAddress=t.logs=void 0;const s=o(r(372));t.logs=s;var a=r(240);Object.defineProperty(t,"pubkeyToAddress",{enumerable:!0,get:function(){return a.pubkeyToAddress}}),Object.defineProperty(t,"rawSecp256k1PubkeyToAddress",{enumerable:!0,get:function(){return a.rawSecp256k1PubkeyToAddress}});var c=r(428);Object.defineProperty(t,"coin",{enumerable:!0,get:function(){return c.coin}}),Object.defineProperty(t,"coins",{enumerable:!0,get:function(){return c.coins}}),Object.defineProperty(t,"parseCoins",{enumerable:!0,get:function(){return c.parseCoins}});var u=r(429);Object.defineProperty(t,"assertIsBroadcastTxSuccess",{enumerable:!0,get:function(){return u.assertIsBroadcastTxSuccess}}),Object.defineProperty(t,"CosmosClient",{enumerable:!0,get:function(){return u.CosmosClient}}),Object.defineProperty(t,"isBroadcastTxFailure",{enumerable:!0,get:function(){return u.isBroadcastTxFailure}}),Object.defineProperty(t,"isBroadcastTxSuccess",{enumerable:!0,get:function(){return u.isBroadcastTxSuccess}}),Object.defineProperty(t,"isSearchByHeightQuery",{enumerable:!0,get:function(){return u.isSearchByHeightQuery}}),Object.defineProperty(t,"isSearchBySentFromOrToQuery",{enumerable:!0,get:function(){return u.isSearchBySentFromOrToQuery}}),Object.defineProperty(t,"isSearchByTagsQuery",{enumerable:!0,get:function(){return u.isSearchByTagsQuery}});var l=r(162);Object.defineProperty(t,"makeSignDoc",{enumerable:!0,get:function(){return l.makeSignDoc}}),Object.defineProperty(t,"serializeSignDoc",{enumerable:!0,get:function(){return l.serializeSignDoc}});var f=r(439);Object.defineProperty(t,"buildFeeTable",{enumerable:!0,get:function(){return f.buildFeeTable}}),Object.defineProperty(t,"GasPrice",{enumerable:!0,get:function(){return f.GasPrice}});var d=r(258);Object.defineProperty(t,"BroadcastMode",{enumerable:!0,get:function(){return d.BroadcastMode}}),Object.defineProperty(t,"LcdClient",{enumerable:!0,get:function(){return d.LcdClient}}),Object.defineProperty(t,"normalizeLcdApiArray",{enumerable:!0,get:function(){return d.normalizeLcdApiArray}}),Object.defineProperty(t,"normalizePubkey",{enumerable:!0,get:function(){return d.normalizePubkey}}),Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return d.setupAuthExtension}}),Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return d.setupBankExtension}}),Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return d.setupDistributionExtension}}),Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return d.setupGovExtension}}),Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return d.setupMintExtension}}),Object.defineProperty(t,"setupSlashingExtension",{enumerable:!0,get:function(){return d.setupSlashingExtension}}),Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return d.setupStakingExtension}}),Object.defineProperty(t,"setupSupplyExtension",{enumerable:!0,get:function(){return d.setupSupplyExtension}}),Object.defineProperty(t,"uint64ToNumber",{enumerable:!0,get:function(){return d.uint64ToNumber}}),Object.defineProperty(t,"uint64ToString",{enumerable:!0,get:function(){return d.uint64ToString}});var h=r(755);Object.defineProperty(t,"isMsgBeginRedelegate",{enumerable:!0,get:function(){return h.isMsgBeginRedelegate}}),Object.defineProperty(t,"isMsgCreateValidator",{enumerable:!0,get:function(){return h.isMsgCreateValidator}}),Object.defineProperty(t,"isMsgDelegate",{enumerable:!0,get:function(){return h.isMsgDelegate}}),Object.defineProperty(t,"isMsgEditValidator",{enumerable:!0,get:function(){return h.isMsgEditValidator}}),Object.defineProperty(t,"isMsgFundCommunityPool",{enumerable:!0,get:function(){return h.isMsgFundCommunityPool}}),Object.defineProperty(t,"isMsgMultiSend",{enumerable:!0,get:function(){return h.isMsgMultiSend}}),Object.defineProperty(t,"isMsgSend",{enumerable:!0,get:function(){return h.isMsgSend}}),Object.defineProperty(t,"isMsgSetWithdrawAddress",{enumerable:!0,get:function(){return h.isMsgSetWithdrawAddress}}),Object.defineProperty(t,"isMsgUndelegate",{enumerable:!0,get:function(){return h.isMsgUndelegate}}),Object.defineProperty(t,"isMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return h.isMsgWithdrawDelegatorReward}}),Object.defineProperty(t,"isMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return h.isMsgWithdrawValidatorCommission}});var p=r(440);Object.defineProperty(t,"makeCosmoshubPath",{enumerable:!0,get:function(){return p.makeCosmoshubPath}});var m=r(259);Object.defineProperty(t,"decodeAminoPubkey",{enumerable:!0,get:function(){return m.decodeAminoPubkey}}),Object.defineProperty(t,"decodeBech32Pubkey",{enumerable:!0,get:function(){return m.decodeBech32Pubkey}}),Object.defineProperty(t,"encodeAminoPubkey",{enumerable:!0,get:function(){return m.encodeAminoPubkey}}),Object.defineProperty(t,"encodeBech32Pubkey",{enumerable:!0,get:function(){return m.encodeBech32Pubkey}}),Object.defineProperty(t,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return m.encodeSecp256k1Pubkey}});var g=r(756);Object.defineProperty(t,"findSequenceForSignedTx",{enumerable:!0,get:function(){return g.findSequenceForSignedTx}});var y=r(197);Object.defineProperty(t,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return y.encodeSecp256k1Signature}}),Object.defineProperty(t,"decodeSignature",{enumerable:!0,get:function(){return y.decodeSignature}});var b=r(757);Object.defineProperty(t,"SigningCosmosClient",{enumerable:!0,get:function(){return b.SigningCosmosClient}});var v=r(441);Object.defineProperty(t,"isStdTx",{enumerable:!0,get:function(){return v.isStdTx}}),Object.defineProperty(t,"isWrappedStdTx",{enumerable:!0,get:function(){return v.isWrappedStdTx}}),Object.defineProperty(t,"makeStdTx",{enumerable:!0,get:function(){return v.makeStdTx}});var w=r(196);Object.defineProperty(t,"pubkeyType",{enumerable:!0,get:function(){return w.pubkeyType}});var _=r(442);Object.defineProperty(t,"executeKdf",{enumerable:!0,get:function(){return _.executeKdf}});var k=r(759);Object.defineProperty(t,"extractKdfConfiguration",{enumerable:!0,get:function(){return k.extractKdfConfiguration}}),Object.defineProperty(t,"Secp256k1HdWallet",{enumerable:!0,get:function(){return k.Secp256k1HdWallet}});var S=r(760);Object.defineProperty(t,"Secp256k1Wallet",{enumerable:!0,get:function(){return S.Secp256k1Wallet}})},,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uint=t.Int=void 0;const i=n(r(357)),o=r(111);class s{constructor(e,t,r,n){this.int="string"==typeof e?i.default(e,t,r,n):i.default(e)}toString(){return this.int.toString(10)}equals(e){return this.int.equals(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.greaterOrEquals(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.lesserOrEquals(e.int)}add(e){return new s(this.int.add(e.int))}sub(e){return new s(this.int.subtract(e.int))}mul(e){return new s(this.int.multiply(e.int))}div(e){return new s(this.int.divide(e.int))}mod(e){return new s(this.int.mod(e.int))}neg(){return new s(this.int.negate())}toDec(){return new o.Dec(this)}}t.Int=s;class a{constructor(e,t,r,n){if(this.uint="string"==typeof e?i.default(e,t,r,n):i.default(e),this.uint.isNegative())throw new TypeError("Uint should not be negative")}toString(){return this.uint.toString(10)}equals(e){return this.uint.equals(e.uint)}gt(e){return this.uint.gt(e.uint)}gte(e){return this.uint.greaterOrEquals(e.uint)}lt(e){return this.uint.lt(e.uint)}lte(e){return this.uint.lesserOrEquals(e.uint)}add(e){return new a(this.uint.add(e.uint))}sub(e){return new a(this.uint.subtract(e.uint))}mul(e){return new a(this.uint.multiply(e.uint))}div(e){return new a(this.uint.divide(e.uint))}mod(e){return new a(this.uint.mod(e.uint))}toDec(){return new o.Dec(new s(this.toString()))}}t.Uint=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecUtils=void 0;const n=r(111);class i{static trim(e){let t="string"==typeof e?e:e.toString();if(t.indexOf(".")<0)return t;for(let e=t.length-1;e>=0&&"0"===t[e];e--)t=t.slice(0,e);return t.length>0&&"."===t[t.length-1]&&(t=t.slice(0,t.length-1)),t}static getPrecisionDec(e){if(e<-18)throw new Error("Too little precision");if(e>18)throw new Error("Too much precision");if(i.precisions[e.toString()])return i.precisions[e.toString()];let t=new n.Dec(1);if(e>0)for(let r=0;r>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 c(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=a(t)^n>>5}for(t=a(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var s=e.slice(0,o),u=e.slice(o+1);if(u.length<6)return"Data too short";var l=c(s);if("string"==typeof l)return l;for(var f=[],d=0;d=u.length||f.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:s,words:f}}function l(e,t,r,n){for(var i=0,o=0,s=(1<=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=c(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=e+"1",s=0;s>5!=0)throw new Error("Non 5-bit word");i=a(i)^u,o+=n.charAt(u)}for(s=0;s<6;++s)i=a(i);for(i^=1,s=0;s<6;++s){o+=n.charAt(i>>5*(5-s)&31)}return o},toWordsUnsafe:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r(60)),a=o(r(72));a.default.util.Long=s.default,a.default.configure(),i(r(606),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=t.isNonNullObject=t.sleep=t.assertDefinedAndNotNull=t.assertDefined=t.assert=t.arrayContentEquals=void 0;var n=r(609);Object.defineProperty(t,"arrayContentEquals",{enumerable:!0,get:function(){return n.arrayContentEquals}});var i=r(610);Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return i.assert}}),Object.defineProperty(t,"assertDefined",{enumerable:!0,get:function(){return i.assertDefined}}),Object.defineProperty(t,"assertDefinedAndNotNull",{enumerable:!0,get:function(){return i.assertDefinedAndNotNull}});var o=r(611);Object.defineProperty(t,"sleep",{enumerable:!0,get:function(){return o.sleep}});var s=r(612);Object.defineProperty(t,"isNonNullObject",{enumerable:!0,get:function(){return s.isNonNullObject}}),Object.defineProperty(t,"isUint8Array",{enumerable:!0,get:function(){return s.isUint8Array}})},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(2).Buffer)},function(e,t,r){t.pbkdf2=r(642),t.pbkdf2Sync=r(388)},function(e,t,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),o=0;o=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o{r[t]=o(e[t])}),r}function s(e){return JSON.stringify(o(e))}t.sortedJsonStringify=s,t.makeSignDoc=function(e,t,r,n,o,s){return{chain_id:r,account_number:i.Uint53.fromString(o.toString()).toString(),sequence:i.Uint53.fromString(s.toString()).toString(),fee:t,msgs:e,memo:n||""}},t.serializeSignDoc=function(e){return n.toUtf8(s(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageRegistry=void 0;t.MessageRegistry=class{constructor(){this.registeredMsgType=new Map}registerMessage(e){if(this.registeredMsgType.has(e.type()))throw new Error("Already registered type "+e.type());this.registeredMsgType.set(e.type(),e)}parseMessage(e){if(!e.type)throw new Error("Null type");const t=this.registeredMsgType.get(e.type);if(!t)throw new Error("Unregistered msg type "+e.type);return Object.setPrototypeOf(e.msg,t.prototype)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONUint8Array=void 0;const n=r(268);class i{static parse(e){return JSON.parse(e,(e,t)=>t&&"string"==typeof t&&t.startsWith("__uint8array__")?n.fromHex(t.replace("__uint8array__","")):t)}static stringify(e){return JSON.stringify(e,(e,t)=>{if(t&&(t instanceof Uint8Array||"object"==typeof t&&"type"in t&&"data"in t&&"Buffer"===t.type&&Array.isArray(t.data))){const e=t instanceof Uint8Array?t:new Uint8Array(t.data);return"__uint8array__"+n.toHex(e)}return t})}static wrap(e){if(void 0!==e)return JSON.parse(i.stringify(e))}static unwrap(e){if(void 0!==e)return i.parse(JSON.stringify(e))}}t.JSONUint8Array=i},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(485),t),i(r(486),t),i(r(289),t)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(479),t),i(r(288),t),i(r(886),t),i(r(287),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(64),{fromBase64:i,fromHex:o}=n.Encoding;t.isStdTx=function(e){const{memo:t,msg:r,fee:n,signatures:i}=e;return"string"==typeof t&&Array.isArray(r)&&"object"==typeof n&&Array.isArray(i)},t.isMsgSend=function(e){return"cosmos-sdk/MsgSend"===e.type},t.isMsgStoreCode=function(e){return"wasm/MsgStoreCode"===e.type},t.isMsgInstantiateContract=function(e){return"wasm/MsgInstantiateContract"===e.type},t.isMsgExecuteContract=function(e){return"wasm/MsgExecuteContract"===e.type},t.extractContractMsg=function(e){return"wasm/MsgExecuteContract"===e.type?n.Encoding.fromBase64(e.value.msg):n.Encoding.fromBase64(e.value.init_msg)},t.pubkeyType={secp256k1:"tendermint/PubKeySecp256k1",ed25519:"tendermint/PubKeyEd25519",sr25519:"tendermint/PubKeySr25519"},t.pubkeyTypes=[t.pubkeyType.secp256k1,t.pubkeyType.ed25519,t.pubkeyType.sr25519],t.parseWasmData=function({key:e,val:t}){return{key:o(e),val:i(t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(906);t.Bip39=n.Bip39;var i=r(498);t.EnglishMnemonic=i.EnglishMnemonic;var o=r(499);t.Hmac=o.Hmac;var s=r(922);t.Keccak256=s.Keccak256;var a=r(923);t.Xchacha20poly1305Ietf=a.Xchacha20poly1305Ietf,t.Argon2id=a.Argon2id,t.Ed25519=a.Ed25519,t.Ed25519Keypair=a.Ed25519Keypair;var c=r(924);t.Random=c.Random;var u=r(925);t.Ripemd160=u.Ripemd160;var l=r(926);t.Secp256k1=l.Secp256k1;var f=r(500);t.ExtendedSecp256k1Signature=f.ExtendedSecp256k1Signature,t.Secp256k1Signature=f.Secp256k1Signature;var d=r(501);t.Sha1=d.Sha1,t.Sha256=d.Sha256,t.Sha512=d.Sha512;var h=r(927);t.Slip10=h.Slip10,t.Slip10Curve=h.Slip10Curve,t.Slip10RawIndex=h.Slip10RawIndex,t.slip10CurveFromString=h.slip10CurveFromString},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(296),i=r(297);class o{constructor(){this.data=new Uint8Array(o.SIZE)}clear(){i.wipe(this.data)}clone(){const e=new o;return e.copy(this),e}copy(e){this.data.set(e.data)}dbl(){let e=0;for(let t=o.SIZE-1;t>=0;t--){const r=this.data[t]>>>7&255;this.data[t]=this.data[t]<<1|e,e=r}this.data[o.SIZE-1]^=n.select(e,o.R,0),e=0}}o.SIZE=16,o.R=135,t.default=o},function(e,t,r){"use strict";e.exports=f;var n=r(126);((f.prototype=Object.create(n.prototype)).constructor=f).className="Namespace";var i,o,s,a=r(106),c=r(171),u=r(41);function l(e,t){if(e&&e.length){for(var r={},n=0;nt)return!0;return!1},f.isReservedName=function(e,t){if(e)for(var r=0;r0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof f))throw Error("path conflicts with non-namespace objects")}else r.add(r=new f(n))}return t&&r.addJSON(t),r},f.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return n}else if(n instanceof f&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t{n(this,void 0,void 0,(function*(){const t=i[e];t&&(yield browser.windows.remove(t))}))})()},t.fitPopupWindow=function(){const e=window.outerWidth-window.innerWidth,r=window.outerHeight-window.innerHeight;browser.windows?browser.windows.getCurrent().then(n=>{null!=(null==n?void 0:n.id)&&browser.windows.update(n.id,{width:t.PopupSize.width+e,height:t.PopupSize.height+r})}):window.resizeTo(t.PopupSize.width+e,t.PopupSize.height+r)},t.disableScroll=function(){document.getElementsByTagName("html")[0].style.overflow="hidden"},t.enableScroll=function(){document.getElementsByTagName("html")[0].style.overflow=""}},,,,,,function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(t=e.exports=r(382)).Stream=t,t.Readable=t,t.Writable=r(245),t.Duplex=r(104),t.Transform=r(385),t.PassThrough=r(637)},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(a-1),s=0;sr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>24]^l[p>>>16&255]^f[m>>>8&255]^d[255&g]^t[y++],s=u[p>>>24]^l[m>>>16&255]^f[g>>>8&255]^d[255&h]^t[y++],a=u[m>>>24]^l[g>>>16&255]^f[h>>>8&255]^d[255&p]^t[y++],c=u[g>>>24]^l[h>>>16&255]^f[p>>>8&255]^d[255&m]^t[y++],h=o,p=s,m=a,g=c;return o=(n[h>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&g])^t[y++],s=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[g>>>8&255]<<8|n[255&h])^t[y++],a=(n[m>>>24]<<24|n[g>>>16&255]<<16|n[h>>>8&255]<<8|n[255&p])^t[y++],c=(n[g>>>24]<<24|n[h>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^t[y++],[o>>>=0,s>>>=0,a>>>=0,c>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,c=0;c<256;++c){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,r[s]=u,n[u]=s;var l=e[s],f=e[l],d=e[f],h=257*e[u]^16843008*u;i[0][s]=h<<24|h>>>8,i[1][s]=h<<16|h>>>16,i[2][s]=h<<8|h>>>24,i[3][s]=h,h=16843009*d^65537*f^257*l^16843008*s,o[0][u]=h<<24|h>>>8,o[1][u]=h<<16|h>>>16,o[2][u]=h<<8|h>>>24,o[3][u]=h,0===s?s=a=1:(s=l^e[e[e[d^l]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function u(e){this._key=i(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o>>24,s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s],s^=a[o/t|0]<<24):t>6&&o%t==4&&(s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s]),i[o]=i[o-t]^s}for(var u=[],l=0;l>>24]]^c.INV_SUB_MIX[1][c.SBOX[d>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[d>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},u.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=s(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=u},function(e,t,r){var n=r(13).Buffer,i=r(241);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),c=n.alloc(o||0),u=n.alloc(0);s>0||o>0;){var l=new i;l.update(u),l.update(e),t&&l.update(t),u=l.digest();var f=0;if(s>0){var d=a.length-s;f=Math.min(s,u.length),u.copy(a,d,0,f),s-=f}if(f0){var h=c.length-o,p=Math.min(o,u.length-f);u.copy(c,h,f,f+p),o-=p}}return u.fill(0),{key:a,iv:c}}},function(e,t,r){"use strict";var n=r(6),i=r(56),o=i.getNAF,s=i.getJSF,a=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<=c;t--)u=(u<<1)+n[t];s.push(u)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(c=0;c=0;u--){for(t=0;u>=0&&0===s[u];u--)t++;if(u>=0&&t++,c=c.dblp(t),u<0)break;var l=s[u];a(0!==l),c="affine"===e.type?l>0?c.mixedAdd(i[l-1>>1]):c.mixedAdd(i[-l-1>>1].neg()):l>0?c.add(i[l-1>>1]):c.add(i[-l-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){for(var a=this._wnafT1,c=this._wnafT2,u=this._wnafT3,l=0,f=0;f=1;f-=2){var h=f-1,p=f;if(1===a[h]&&1===a[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=s(r[h],r[p]);l=Math.max(y[0].length,l),u[h]=new Array(l),u[p]=new Array(l);for(var b=0;b=0;f--){for(var S=0;f>=0;){var E=!0;for(b=0;b=0&&S++,_=_.dblp(S),f<0)break;for(b=0;b0?O=c[b][M-1>>1]:M<0&&(O=c[b][-M-1>>1].neg()),_="affine"===O.type?_.mixedAdd(O):_.add(O))}}for(f=0;f=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;iconsole.error("SEMVER",...e):()=>{};e.exports=r}).call(this,r(17))},function(e,t){const r=["includePrerelease","loose","rtl"];e.exports=e=>e?"object"!=typeof e?{loose:!0}:r.filter(t=>e[t]).reduce((e,t)=>(e[t]=!0,e),{}):{}},function(e,t,r){const n=r(62);e.exports=(e,t,r)=>n(e,t,r)>0},function(e,t,r){const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new f(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new f(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=c(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=c(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||o&&s||a||u}}e.exports=i;const o=r(204),{re:s,t:a}=r(124),c=r(477),u=r(203),l=r(44),f=r(63)},function(e,t,r){const n=r(63);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DecProto=t.IntProto=t.DecCoin=t.Coin=t.protobufPackage=void 0;const i=n(r(72));t.protobufPackage="cosmos.base.v1beta1";const o={denom:"",amount:""};t.Coin={encode:(e,t=i.default.Writer.create())=>(t.uint32(10).string(e.denom),t.uint32(18).string(e.amount),t),decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const s=Object.assign({},o);for(;r.pos>>3){case 1:s.denom=r.string();break;case 2:s.amount=r.string();break;default:r.skipType(7&e)}}return s},fromJSON(e){const t=Object.assign({},o);return void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.amount&&null!==e.amount?t.amount=String(e.amount):t.amount="",t},fromPartial(e){const t=Object.assign({},o);return void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.amount&&null!==e.amount?t.amount=e.amount:t.amount="",t},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.amount&&(t.amount=e.amount),t}};const s={denom:"",amount:""};t.DecCoin={encode:(e,t=i.default.Writer.create())=>(t.uint32(10).string(e.denom),t.uint32(18).string(e.amount),t),decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const o=Object.assign({},s);for(;r.pos>>3){case 1:o.denom=r.string();break;case 2:o.amount=r.string();break;default:r.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.amount&&null!==e.amount?t.amount=String(e.amount):t.amount="",t},fromPartial(e){const t=Object.assign({},s);return void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.amount&&null!==e.amount?t.amount=e.amount:t.amount="",t},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.amount&&(t.amount=e.amount),t}};const a={int:""};t.IntProto={encode:(e,t=i.default.Writer.create())=>(t.uint32(10).string(e.int),t),decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const o=Object.assign({},a);for(;r.pos>>3){case 1:o.int=r.string();break;default:r.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return void 0!==e.int&&null!==e.int?t.int=String(e.int):t.int="",t},fromPartial(e){const t=Object.assign({},a);return void 0!==e.int&&null!==e.int?t.int=e.int:t.int="",t},toJSON(e){const t={};return void 0!==e.int&&(t.int=e.int),t}};const c={dec:""};t.DecProto={encode:(e,t=i.default.Writer.create())=>(t.uint32(10).string(e.dec),t),decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const o=Object.assign({},c);for(;r.pos>>3){case 1:o.dec=r.string();break;default:r.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return void 0!==e.dec&&null!==e.dec?t.dec=String(e.dec):t.dec="",t},fromPartial(e){const t=Object.assign({},c);return void 0!==e.dec&&null!==e.dec?t.dec=e.dec:t.dec="",t},toJSON(e){const t={};return void 0!==e.dec&&(t.dec=e.dec),t}}},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Any=t.protobufPackage=void 0;const i=n(r(72));t.protobufPackage="google.protobuf";const o={typeUrl:""};t.Any={encode:(e,t=i.default.Writer.create())=>(t.uint32(10).string(e.typeUrl),t.uint32(18).bytes(e.value),t),decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const s=Object.assign({},o);for(;r.pos>>3){case 1:s.typeUrl=r.string();break;case 2:s.value=r.bytes();break;default:r.skipType(7&e)}}return s},fromJSON(e){const t=Object.assign({},o);return void 0!==e.typeUrl&&null!==e.typeUrl?t.typeUrl=String(e.typeUrl):t.typeUrl="",void 0!==e.value&&null!==e.value&&(t.value=function(e){const t=a(e),r=new Uint8Array(t.length);for(let e=0;e{if(void 0!==s)return s;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object")})();const a=s.atob||(e=>s.Buffer.from(e,"base64").toString("binary"));const c=s.btoa||(e=>s.Buffer.from(e,"binary").toString("base64"))}).call(this,r(15))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(907);t.Int53=n.Int53,t.Uint32=n.Uint32,t.Uint53=n.Uint53,t.Uint64=n.Uint64,t.Decimal=n.Decimal;var i=r(292);t.fromHex=i.fromHex,t.toHex=i.toHex,t.fromAscii=i.fromAscii,t.toAscii=i.toAscii,t.fromBase64=i.fromBase64,t.toBase64=i.toBase64,t.fromRfc3339=i.fromRfc3339,t.toRfc3339=i.toRfc3339,t.fromUtf8=i.fromUtf8,t.toUtf8=i.toUtf8,t.Bech32=i.Bech32;var o=r(497);t.isNonNullObject=o.isNonNullObject,t.isUint8Array=o.isUint8Array;var s=r(919);t.isJsonCompatibleValue=s.isJsonCompatibleValue,t.isJsonCompatibleDictionary=s.isJsonCompatibleDictionary,t.isJsonCompatibleArray=s.isJsonCompatibleArray;var a=r(920);t.TransactionEncoder=a.TransactionEncoder;var c=r(921);t.Encoding=c.Encoding},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(295),o=r(930),s=r(931);t.WebCryptoProvider=class{constructor(e=window.crypto){this.crypto=e}importBlockCipherKey(e){return n(this,void 0,void 0,(function*(){return o.default.importKey(this.crypto,e)}))}importCTRKey(e){return n(this,void 0,void 0,(function*(){try{return yield s.default.importKey(this.crypto,e)}catch(e){throw e.message.includes("unsupported")?new i.NotImplementedError("WebCryptoProvider: AES-CTR unsupported. Use PolyfillCryptoProvider."):e}}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return"undefined"!=typeof window?void 0:r(96)};t.getNodeCrypto=n;var i=function(){if("undefined"!=typeof window&&window.crypto)return window.crypto.subtle};t.getWebCrypto=i;var o=function(){if("undefined"!=typeof window){if(window.msCrypto)return window.msCrypto.subtle;if(window.crypto)return window.crypto.subtle}};t.getWebCryptoAll=o;var s=function(){if("undefined"!=typeof window){if(window.msCrypto)return window.msCrypto;if(window.crypto)return window.crypto}};t.getRootWebCryptoAll=s;var a=function(){if("undefined"!=typeof window&&window.msCrypto)return window.msCrypto.subtle};t.getMsCrypto=a;var c=function(){var e=i(),t=n(),r=a();return void 0!==t?{name:"nodeCrypto",crypto:t}:void 0!==e&&void 0===r?{name:"webCrypto",crypto:e}:void 0!==r?{name:"msCrypto",crypto:r}:{name:void 0}};t.getCrypto=c,t.default={getNodeCrypto:n,getWebCrypto:i,getMsCrypto:a,getWebCryptoAll:o,getRootWebCryptoAll:s,getCrypto:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetSecret20ViewingKey=t.RemoveTokenMsg=t.AddTokenMsg=t.SuggestTokenMsg=t.GetTokensMsg=void 0;const n=r(18),i=r(526);class o extends n.Message{constructor(e){super(),this.chainId=e}static type(){return"get-tokens"}validateBasic(){if(!this.chainId)throw new Error("Chain id is empty")}route(){return i.ROUTE}type(){return o.type()}}t.GetTokensMsg=o;class s extends n.Message{constructor(e,t,r){super(),this.chainId=e,this.contractAddress=t,this.viewingKey=r}static type(){return"suggest-token"}approveExternal(){return!0}validateBasic(){if(!this.chainId)throw new Error("Chain id is empty");if(!this.contractAddress)throw new Error("Contract address is empty")}route(){return i.ROUTE}type(){return s.type()}}t.SuggestTokenMsg=s;class a extends n.Message{constructor(e,t){super(),this.chainId=e,this.currency=t}static type(){return"add-token"}validateBasic(){if(!this.chainId)throw new Error("Chain id is empty")}route(){return i.ROUTE}type(){return a.type()}}t.AddTokenMsg=a;class c extends n.Message{constructor(e,t){super(),this.chainId=e,this.currency=t}static type(){return"remove-token"}validateBasic(){if(!this.chainId)throw new Error("Chain id is empty")}route(){return i.ROUTE}type(){return c.type()}}t.RemoveTokenMsg=c;class u extends n.Message{constructor(e,t){super(),this.chainId=e,this.contractAddress=t}static type(){return"get-secret20-viewing-key"}validateBasic(){if(!this.chainId)throw new Error("Chain id is empty");if(!this.contractAddress)throw new Error("Contract address is empty")}approveExternal(){return!0}route(){return i.ROUTE}type(){return u.type()}}t.GetSecret20ViewingKey=u},,,function(e,t,r){"use strict";(function(e){var n=r(66),i=r.n(n),o=r(27),s=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},a=function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=function(e,t){for(var r=0,n=t.length,i=e.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},f=function(){function t(){var t=this;this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new i.a,this.send=function(r,n,i,c,u,l){return void 0===u&&(u=e.alloc(0)),void 0===l&&(l=[o.StatusCodes.OK]),s(t,void 0,void 0,(function(){var t,s;return a(this,(function(a){switch(a.label){case 0:if(u.length>=256)throw new o.TransportError("data.length exceed 256 bytes limit. Got: "+u.length,"DataLengthTooBig");return[4,this.exchange(e.concat([e.from([r,n,i,c]),e.from([u.length]),u]))];case 1:if(t=a.sent(),s=t.readUInt16BE(t.length-2),!l.some((function(e){return e===s})))throw new o.TransportStatusError(s);return[2,t]}}))}))},this.exchangeAtomicImpl=function(e){return s(t,void 0,void 0,(function(){var t,r,n,i,s,c=this;return a(this,(function(a){switch(a.label){case 0:if(this.exchangeBusyPromise)throw new o.TransportRaceCondition("An action was already pending on the Ledger device. Please deny or reconnect.");r=new Promise((function(e){t=e})),this.exchangeBusyPromise=r,n=!1,i=setTimeout((function(){n=!0,c.emit("unresponsive")}),this.unresponsiveTimeout),a.label=1;case 1:return a.trys.push([1,,3,4]),[4,e()];case 2:return s=a.sent(),n&&this.emit("responsive"),[2,s];case 3:return clearTimeout(i),t&&t(),this.exchangeBusyPromise=null,[7];case 4:return[2]}}))}))},this._appAPIlock=null}return t.prototype.exchange=function(e){throw new Error("exchange not implemented")},t.prototype.setScrambleKey=function(e){},t.prototype.close=function(){return Promise.resolve()},t.prototype.on=function(e,t){this._events.on(e,t)},t.prototype.off=function(e,t){this._events.removeListener(e,t)},t.prototype.emit=function(e){for(var t,r=[],n=1;nc&&(a=a.slice(0,c)),{data:a,dataLength:c,sequence:u}},getReducedResult:function(e){if(e&&e.dataLength===e.data.length)return e.data}}}}).call(this,r(2).Buffer)},,,,,,,,,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(533),t),i(r(534),t)},function(e,t,r){(function(n,i){var o; +/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.8.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + */!function(){"use strict";var s="input is invalid type",a="object"==typeof window,c=a?window:{};c.JS_SHA3_NO_WINDOW&&(a=!1);var u=!a&&"object"==typeof self;!c.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?c=i:u&&(c=self);var l=!c.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,f=r(559),d=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],g=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],y=[224,256,384,512],b=[128,256],v=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var _=function(e,t,r){return function(n){return new D(e,t,e).update(n)[r]()}},k=function(e,t,r){return function(n,i){return new D(e,t,i).update(n)[r]()}},S=function(e,t,r){return function(t,n,i,o){return A["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return A["kmac"+e].update(t,n,i,o)[r]()}},O=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(e,t,r){D.call(this,e,t,r)}D.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}for(var n,i,o=this.blocks,a=this.byteCount,c=e.length,u=this.blockCount,l=0,f=this.s;l>2]|=e[l]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=o[u],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},D.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}var n=0,i=e.length;if(t)n=i;else for(var o=0;o=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},D.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+h[15&e]+h[e>>12&15]+h[e>>8&15]+h[e>>20&15]+h[e>>16&15]+h[e>>28&15]+h[e>>24&15];s%t==0&&(U(r),o=0)}return i&&(e=r[o],a+=h[e>>4&15]+h[15&e],i>1&&(a+=h[e>>12&15]+h[e>>8&15]),i>2&&(a+=h[e>>20&15]+h[e>>16&15])),a},D.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%r==0&&U(n)}return o&&(e=a<<2,t=n[s],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},N.prototype=new D,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var U=function(e){var t,r,n,i,o,s,a,c,u,l,f,d,h,p,m,y,b,v,w,_,k,S,E,O,M,x,A,j,P,I,R,T,C,B,D,N,U,z,L,q,K,F,$,H,J,W,G,V,Z,Y,X,Q,ee,te,re,ne,ie,oe,se,ae,ce,ue,le;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(l<<1|f>>>31),r=a^(f<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(d<<1|h>>>31),r=u^(h<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],m=e[1],W=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,j=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,F=e[40]<<18|e[41]>>>14,$=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,N=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,T=e[45]<<29|e[44]>>>3,C=e[44]<<29|e[45]>>>3,O=e[6]<<28|e[7]>>>4,M=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,z=e[26]<<25|e[27]>>>7,L=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,J=e[9]<<27|e[8]>>>5,x=e[18]<<20|e[19]>>>12,A=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=p^~y&v,e[1]=m^~b&w,e[10]=O^~x&j,e[11]=M^~A&P,e[20]=B^~N&z,e[21]=D^~U&L,e[30]=H^~W&V,e[31]=J^~G&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=y^~v&_,e[3]=b^~w&k,e[12]=x^~j&I,e[13]=A^~P&R,e[22]=N^~z&q,e[23]=U^~L&K,e[32]=W^~V&Y,e[33]=G^~Z&X,e[42]=ne^~oe&ae,e[43]=ie^~se&ce,e[4]=v^~_&S,e[5]=w^~k&E,e[14]=j^~I&T,e[15]=P^~R&C,e[24]=z^~q&F,e[25]=L^~K&$,e[34]=V^~Y&Q,e[35]=Z^~X&ee,e[44]=oe^~ae&ue,e[45]=se^~ce&le,e[6]=_^~S&p,e[7]=k^~E&m,e[16]=I^~T&O,e[17]=R^~C&M,e[26]=q^~F&B,e[27]=K^~$&D,e[36]=Y^~Q&H,e[37]=X^~ee&J,e[46]=ae^~ue&te,e[47]=ce^~le&re,e[8]=S^~p&y,e[9]=E^~m&b,e[18]=T^~O&x,e[19]=C^~M&A,e[28]=F^~B&N,e[29]=$^~D&U,e[38]=Q^~H&W,e[39]=ee^~J&G,e[48]=ue^~te&ne,e[49]=le^~re&ie,e[0]^=g[n],e[1]^=g[n+1]};if(l)e.exports=A;else{for(P=0;P18)throw new Error("Too much precision");const t=this.clone();return t._options.precision=e,t}increasePrecision(e){return this.precision(this._options.precision+e)}decreasePrecision(e){return this.precision(this._options.precision-e)}maxDecimals(e){const t=this.clone();return t._options.maxDecimals=e,t}trim(e){const t=this.clone();return t._options.trim=e,t}shrink(e){const t=this.clone();return t._options.shrink=e,t}locale(e){const t=this.clone();return t._options.locale=e,t}ready(e){const t=this.clone();return t._options.ready=e,t}get isReady(){return this._options.ready}add(e){e instanceof i.Dec||(e=e.toDec());const t=new a(this.toDec().add(e));return t._options=Object.assign(Object.assign({},this._options),{precision:t._options.precision}),t}sub(e){e instanceof i.Dec||(e=e.toDec());const t=new a(this.toDec().sub(e));return t._options=Object.assign(Object.assign({},this._options),{precision:t._options.precision}),t}mul(e){e instanceof i.Dec||(e=e.toDec());const t=new a(this.toDec().mul(e));return t._options=Object.assign(Object.assign({},this._options),{precision:t._options.precision}),t}quo(e){e instanceof i.Dec||(e=e.toDec());const t=new a(this.toDec().quo(e));return t._options=Object.assign(Object.assign({},this._options),{precision:t._options.precision}),t}toDec(){let e=this.dec;const t=this.decPrecision-this._options.precision;return 0!==t&&(e=e.mulTruncate(o.DecUtils.getPrecisionDec(t))),e}toString(){const e=this.toDec();let t="";return t=this._options.shrink?s.CoinUtils.shrinkDecimals(e,0,this._options.maxDecimals,this._options.locale):e.toString(this._options.maxDecimals,this._options.locale),this._options.trim&&(t=o.DecUtils.trim(t)),t}clone(){const e=new a(this.dec);return e.dec=this.dec,e.decPrecision=this.decPrecision,e._options=Object.assign({},this._options),e}}t.IntPretty=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinUtils=void 0;const n=r(358),i=r(152),o=r(111),s=r(153);class a{static createCoinsFromPrimitives(e){return e.map(e=>new n.Coin(e.denom,e.amount))}static amountOf(e,t){const r=e.find(e=>e.denom===t);return r?r.amount:new i.Int(0)}static exclude(e,t){return e.filter(e=>0===t.indexOf(e.denom))}static concat(...e){if(0===e.length)return[];return e.slice().reduce((e,t)=>{const r=e.find(e=>e.denom===t.denom);if(r){const i=new n.Coin(r.denom,r.amount.add(t.amount));e.push(i)}else{const r=new n.Coin(t.denom,t.amount);e.push(r)}return e},[])}static getCoinFromDecimals(e,t,r){const i=e.find(e=>e.coinDenom===r);if(!i)throw new Error("Invalid currency");let s=new o.Dec(1);for(let e=0;ee.coinMinimalDenom===t.denom);r||(r={coinDecimals:0,coinDenom:t.denom,coinMinimalDenom:t.denom});let n=new o.Dec(1);for(let e=0;e0?".":"")+u}static integerStringToUSLocaleString(e){if(e.indexOf(".")>=0)throw new Error(e+" is not integer");if("undefined"!=typeof BigInt)return BigInt(e).toLocaleString("en-US");const t=e,r=[];for(let e=t.length;e>0;e-=3)r.push(t.slice(Math.max(0,e-3),e));return r.reverse().join(",")}static coinToTrimmedString(e,t,r=" "){const n=new o.Dec(e.amount).quoTruncate(s.DecUtils.getPrecisionDec(t.coinDecimals));return`${s.DecUtils.trim(n)}${r}${t.coinDenom}`}}t.CoinUtils=a},function(e,t){ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=d,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?d/c:d*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*m}},function(e,t,r){"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,o=!0;for(;i>>32-t}function u(e,t,r,n,i,o,s){return c(e+(t&r|~t&n)+i+o|0,s)+t|0}function l(e,t,r,n,i,o,s){return c(e+(t&n|r&~n)+i+o|0,s)+t|0}function f(e,t,r,n,i,o,s){return c(e+(t^r^n)+i+o|0,s)+t|0}function d(e,t,r,n,i,o,s){return c(e+(r^(t|~n))+i+o|0,s)+t|0}n(a,i),a.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,e[0],3614090360,7),o=u(o,r,n,i,e[1],3905402710,12),i=u(i,o,r,n,e[2],606105819,17),n=u(n,i,o,r,e[3],3250441966,22),r=u(r,n,i,o,e[4],4118548399,7),o=u(o,r,n,i,e[5],1200080426,12),i=u(i,o,r,n,e[6],2821735955,17),n=u(n,i,o,r,e[7],4249261313,22),r=u(r,n,i,o,e[8],1770035416,7),o=u(o,r,n,i,e[9],2336552879,12),i=u(i,o,r,n,e[10],4294925233,17),n=u(n,i,o,r,e[11],2304563134,22),r=u(r,n,i,o,e[12],1804603682,7),o=u(o,r,n,i,e[13],4254626195,12),i=u(i,o,r,n,e[14],2792965006,17),r=l(r,n=u(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=l(o,r,n,i,e[6],3225465664,9),i=l(i,o,r,n,e[11],643717713,14),n=l(n,i,o,r,e[0],3921069994,20),r=l(r,n,i,o,e[5],3593408605,5),o=l(o,r,n,i,e[10],38016083,9),i=l(i,o,r,n,e[15],3634488961,14),n=l(n,i,o,r,e[4],3889429448,20),r=l(r,n,i,o,e[9],568446438,5),o=l(o,r,n,i,e[14],3275163606,9),i=l(i,o,r,n,e[3],4107603335,14),n=l(n,i,o,r,e[8],1163531501,20),r=l(r,n,i,o,e[13],2850285829,5),o=l(o,r,n,i,e[2],4243563512,9),i=l(i,o,r,n,e[7],1735328473,14),r=f(r,n=l(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=f(o,r,n,i,e[8],2272392833,11),i=f(i,o,r,n,e[11],1839030562,16),n=f(n,i,o,r,e[14],4259657740,23),r=f(r,n,i,o,e[1],2763975236,4),o=f(o,r,n,i,e[4],1272893353,11),i=f(i,o,r,n,e[7],4139469664,16),n=f(n,i,o,r,e[10],3200236656,23),r=f(r,n,i,o,e[13],681279174,4),o=f(o,r,n,i,e[0],3936430074,11),i=f(i,o,r,n,e[3],3572445317,16),n=f(n,i,o,r,e[6],76029189,23),r=f(r,n,i,o,e[9],3654602809,4),o=f(o,r,n,i,e[12],3873151461,11),i=f(i,o,r,n,e[15],530742520,16),r=d(r,n=f(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=a},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(15))},function(e,t,r){"use strict";var n=r(113).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i-1?n:o.nextTick;b.WritableState=y;var u=Object.create(r(157));u.inherits=r(11);var l={deprecate:r(242)},f=r(383),d=r(244).Buffer,h=i.Uint8Array||function(){};var p,m=r(384);function g(){}function y(e,t){a=a||r(104),e=e||{};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),E(e,t))}(e,r,n,t,i);else{var s=k(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?c(w,e,r,s,i):w(e,r,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function b(e){if(a=a||r(104),!(p.call(b,this)||this instanceof a))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function v(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),E(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,v(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback;if(v(e,t,!1,t.objectMode?1:u.length,u,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=k(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(b,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===b&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return a&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),o.nextTick(n,s),i=!1),i}(this,i,e,r))&&(i.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=m.destroy,b.prototype._undestroy=m.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(17),r(328).setImmediate,r(15))},function(e,t,r){var n=r(241);e.exports=function(e){return(new n).update(e).digest()}},function(e,t,r){"use strict";var n=r(55);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,r){var i=function(e){var t=o(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),s=r.modulus.byteLength(),a=new n(e).mul(i.blinder).umod(r.modulus),c=a.toRed(n.mont(r.prime1)),u=a.toRed(n.mont(r.prime2)),l=r.coefficient,f=r.prime1,d=r.prime2,h=c.redPow(r.exponent1).fromRed(),p=u.redPow(r.exponent2).fromRed(),m=h.isub(p).imul(l).umod(f).imul(d);return p.iadd(m).imul(i.unblinder).umod(r.modulus).toArrayLike(t,"be",s)}s.getr=o,e.exports=s}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n,i=t,o=r(80),s=r(412),a=r(56).assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(699)}catch(e){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){"use strict";(function(t){var n,i=r(2),o=i.Buffer,s={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(s[n]=i[n]);var a=s.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(a[n]=o[n]);if(s.Buffer.prototype=o.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,r)}),a.alloc||(a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!s.kStringMaxLength)try{s.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(e){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),e.exports=s}).call(this,r(17))},function(e,t,r){"use strict";const n=r(256).Reporter,i=r(161).EncoderBuffer,o=r(161).DecoderBuffer,s=r(55),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function u(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=u;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){const e=this._baseState,t={};l.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},u.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},u.prototype._init=function(e){const t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),s.equal(t.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(e){const t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);const n=e[r];t[n]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){u.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),a.forEach((function(e){u.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}})),u.prototype.use=function(e){s(e);const t=this._baseState;return s(null===t.use),t.use=e,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(e){const t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},u.prototype.explicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},u.prototype.implicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},u.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},u.prototype.key=function(e){const t=this._baseState;return s(null===t.key),t.key=e,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(e){const t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},u.prototype.contains=function(e){const t=this._baseState;return s(null===t.use),t.contains=e,this},u.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let n,i=r.default,s=!0,a=null;if(null!==r.key&&(a=e.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(s=this._peekTag(e,n,r.any),e.isError(s))return s}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(n)}}if(r.obj&&s&&(n=e.enterObject()),s){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const n=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(n))return n;r.any?i=e.raw(t):e=n}if(t&&t.track&&null!==r.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}return r.obj&&s&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&e.exitKey(a):e.leaveKey(a,r.key,i),i},u.prototype._decodeGeneric=function(e,t,r){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},u.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const s=e.save(),a=r.choice[o];try{const r=a._decode(e,t);if(e.isError(r))return!1;n={type:o,value:r},i=!0}catch(t){return e.restore(s),!1}return!0}),this),i?n:e.error("Choice not matched")},u.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},u.prototype._encode=function(e,t,r){const n=this._baseState;if(null!==n.default&&n.default===e)return;const i=this._encodeValue(e,t,r);return void 0===i||this._skipDefault(i,t,r)?void 0:i},u.prototype._encodeValue=function(e,t,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);let o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let s=null,a=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)s=this._getUse(i.contains,r)._encode(e,t),a=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i}),this).filter((function(e){return e})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(e.map((function(r){const n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(e,t):(s=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(e,a,r,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},u.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},u.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},u.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},u.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(e,t,r){"use strict";const n=r(11);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,r){"use strict";function n(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n(t.tag)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint64ToString=t.uint64ToNumber=t.normalizePubkey=t.normalizeLcdApiArray=t.LcdClient=t.BroadcastMode=t.setupSupplyExtension=t.setupStakingExtension=t.setupSlashingExtension=t.setupMintExtension=t.setupGovExtension=t.setupDistributionExtension=t.setupBankExtension=t.setupAuthExtension=void 0;var n=r(728);Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return n.setupAuthExtension}});var i=r(729);Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return i.setupBankExtension}});var o=r(730);Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return o.setupDistributionExtension}});var s=r(731);Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return s.setupGovExtension}});var a=r(732);Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return a.setupMintExtension}});var c=r(733);Object.defineProperty(t,"setupSlashingExtension",{enumerable:!0,get:function(){return c.setupSlashingExtension}});var u=r(734);Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return u.setupStakingExtension}});var l=r(735);Object.defineProperty(t,"setupSupplyExtension",{enumerable:!0,get:function(){return l.setupSupplyExtension}});var f=r(430);Object.defineProperty(t,"BroadcastMode",{enumerable:!0,get:function(){return f.BroadcastMode}});var d=r(736);Object.defineProperty(t,"LcdClient",{enumerable:!0,get:function(){return d.LcdClient}}),Object.defineProperty(t,"normalizeLcdApiArray",{enumerable:!0,get:function(){return d.normalizeLcdApiArray}});var h=r(754);Object.defineProperty(t,"normalizePubkey",{enumerable:!0,get:function(){return h.normalizePubkey}}),Object.defineProperty(t,"uint64ToNumber",{enumerable:!0,get:function(){return h.uint64ToNumber}}),Object.defineProperty(t,"uint64ToString",{enumerable:!0,get:function(){return h.uint64ToString}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBech32Pubkey=t.encodeAminoPubkey=t.decodeBech32Pubkey=t.decodeAminoPubkey=t.encodeSecp256k1Pubkey=void 0;const n=r(57),i=r(156),o=r(196);t.encodeSecp256k1Pubkey=function(e){if(33!==e.length||2!==e[0]&&3!==e[0])throw new Error("Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03");return{type:o.pubkeyType.secp256k1,value:n.toBase64(e)}};const s=n.fromHex("eb5ae98721"),a=n.fromHex("1624de6420"),c=n.fromHex("0dfb1005"),u=s.length;function l(e){const t=e.slice(0,u),r=e.slice(u);if(i.arrayContentEquals(t,s)){if(33!==r.length)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:o.pubkeyType.secp256k1,value:n.toBase64(r)}}if(i.arrayContentEquals(t,a)){if(32!==r.length)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:o.pubkeyType.ed25519,value:n.toBase64(r)}}if(i.arrayContentEquals(t,c)){if(32!==r.length)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:o.pubkeyType.sr25519,value:n.toBase64(r)}}throw new Error("Unsupported Pubkey type. Amino prefix: "+n.toHex(t))}function f(e){let t;switch(e.type){case o.pubkeyType.secp256k1:t=s;break;case o.pubkeyType.ed25519:t=a;break;default:throw new Error("Unsupported pubkey type")}return new Uint8Array([...t,...n.fromBase64(e.value)])}t.decodeAminoPubkey=l,t.decodeBech32Pubkey=function(e){const{data:t}=n.Bech32.decode(e);return l(t)},t.encodeAminoPubkey=f,t.encodeBech32Pubkey=function(e,t){return n.Bech32.encode(t,f(e))}},function(e,t){var r={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var n in r.Null=r.Nil,r)r[n].toJSON=function(e){return e}.bind(null,n);e.exports=r},function(e,t,r){var n,i,o,s,a,c,u,l;e.exports=(l=r(19),i=(n=l).lib,o=i.WordArray,s=i.Hasher,a=n.algo,c=[],u=a.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],u=0;u<80;u++){if(u<16)c[u]=0|e[t+u];else{var l=c[u-3]^c[u-8]^c[u-14]^c[u-16];c[u]=l<<1|l>>>31}var f=(n<<5|n>>>27)+a+c[u];f+=u<20?1518500249+(i&o|~i&s):u<40?1859775393+(i^o^s):u<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,a=s,s=o,o=i<<30|i>>>2,i=n,n=f}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=s._createHelper(u),n.HmacSHA1=s._createHmacHelper(u),l.SHA1)},function(e,t,r){var n,i,o,s;e.exports=(n=r(19),o=(i=n).lib.Base,s=i.enc.Utf8,void(i.algo.HMAC=o.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,c=o.words,u=0;u=9&&(n=(e[5]<<24)+(e[6]<<16)+(e[7]<<8)+(e[8]<<0)),{return_code:r,error_message:u(r),test_mode:0!==e[0],major:e[1],minor:e[2],patch:e[3],device_locked:1===e[4],target_id:n.toString(16)}}),l));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},function(e,t){const r=/^[0-9]+$/,n=(e,t)=>{const n=r.test(e),i=r.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:en(t,e)}},function(e,t,r){const n=r(62);e.exports=(e,t,r)=>0===n(e,t,r)},function(e,t,r){const n=r(44);e.exports=(e,t,r)=>{const i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},function(e,t,r){const n=r(62);e.exports=(e,t,r)=>n(e,t,r)<0},function(e,t,r){const n=r(62);e.exports=(e,t,r)=>n(e,t,r)>=0},function(e,t,r){const n=r(62);e.exports=(e,t,r)=>n(e,t,r)<=0},function(e,t,r){const n=r(44),i=r(206),{ANY:o}=i,s=r(63),a=r(207),c=r(205),u=r(282),l=r(284),f=r(283);e.exports=(e,t,r,d)=>{let h,p,m,g,y;switch(e=new n(e,d),t=new s(t,d),r){case">":h=c,p=l,m=u,g=">",y=">=";break;case"<":h=u,p=f,m=c,g="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,d))return!1;for(let r=0;r{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,h(e.semver,s.semver,d)?s=e:m(e.semver,a.semver,d)&&(a=e)}),s.operator===g||s.operator===y)return!1;if((!a.operator||a.operator===g)&&p(e,a.semver))return!1;if(a.operator===y&&m(e,a.semver))return!1}return!0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LedgerSetWebHIDFlagMsg=t.LedgerGetWebHIDFlagMsg=void 0;const n=r(18),i=r(478);class o extends n.Message{static type(){return"ledger-get-webhid-flag"}constructor(){super()}validateBasic(){}route(){return i.ROUTE}type(){return o.type()}}t.LedgerGetWebHIDFlagMsg=o;class s extends n.Message{constructor(e){super(),this.flag=e}static type(){return"ledger-set-webhid-flag"}validateBasic(){if(null==this.flag)throw new Error("Flag is null")}route(){return i.ROUTE}type(){return s.type()}}t.LedgerSetWebHIDFlagMsg=s},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyRing=t.KeyRingStatus=void 0;const i=r(883),o=r(86),s=r(2),a=r(8);var c;!function(e){e[e.NOTLOADED=0]="NOTLOADED",e[e.EMPTY=1]="EMPTY",e[e.LOCKED=2]="LOCKED",e[e.UNLOCKED=3]="UNLOCKED"}(c=t.KeyRingStatus||(t.KeyRingStatus={}));class u{constructor(e,t,r,n,i){this.embedChainInfos=e,this.kvStore=t,this.ledgerKeeper=r,this.rng=n,this.crypto=i,this.cached=new Map,this.password="",this.loaded=!1,this.keyStore=null,this.multiKeyStore=[]}static getTypeOfKeyStore(e){const t=e.type;if(null==t)return"mnemonic";if("mnemonic"!==t&&"privateKey"!==t&&"ledger"!==t)throw new Error("Invalid type of key store");return t}get type(){return this.keyStore?u.getTypeOfKeyStore(this.keyStore):"none"}isLocked(){return null==this.privateKey&&null==this.mnemonic&&null==this.ledgerPublicKey}get privateKey(){return this._privateKey}set privateKey(e){this._privateKey=e,this._mnemonic=void 0,this._ledgerPublicKey=void 0,this.cached=new Map}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic=e,this._privateKey=void 0,this._ledgerPublicKey=void 0,this.cached=new Map}get ledgerPublicKey(){return this._ledgerPublicKey}set ledgerPublicKey(e){this._mnemonic=void 0,this._privateKey=void 0,this._ledgerPublicKey=e,this.cached=new Map}get status(){return this.loaded?this.keyStore?this.isLocked()?c.LOCKED:c.UNLOCKED:c.EMPTY:c.NOTLOADED}getKeyStoreCoinType(e){if(this.keyStore&&this.keyStore.coinTypeForChain)return this.keyStore.coinTypeForChain[a.ChainIdHelper.parse(e).identifier]}getKey(e,t){return this.loadKey(this.computeKeyStoreCoinType(e,t))}getKeyStoreMeta(e){var t;return this.keyStore&&null!=this.keyStore.meta&&null!==(t=this.keyStore.meta[e])&&void 0!==t?t:""}computeKeyStoreCoinType(e,t){var r;if(!this.keyStore)throw new Error("Key Store is empty");return this.keyStore.coinTypeForChain&&null!==(r=this.keyStore.coinTypeForChain[a.ChainIdHelper.parse(e).identifier])&&void 0!==r?r:t}getKeyFromCoinType(e){return this.loadKey(e)}createMnemonicKey(e,t,r,i,o){return n(this,void 0,void 0,(function*(){if(this.status!==c.EMPTY)throw new Error("Key ring is not loaded or not empty");return this.mnemonic=t,this.keyStore=yield u.CreateMnemonicKeyStore(this.rng,this.crypto,e,t,r,yield this.assignKeyStoreIdMeta(i),o),this.password=r,this.multiKeyStore.push(this.keyStore),yield this.save(),{status:this.status,multiKeyStoreInfo:yield this.getMultiKeyStoreInfo()}}))}createPrivateKey(e,t,r,i){return n(this,void 0,void 0,(function*(){if(this.status!==c.EMPTY)throw new Error("Key ring is not loaded or not empty");return this.privateKey=t,this.keyStore=yield u.CreatePrivateKeyStore(this.rng,this.crypto,e,t,r,yield this.assignKeyStoreIdMeta(i)),this.password=r,this.multiKeyStore.push(this.keyStore),yield this.save(),{status:this.status,multiKeyStoreInfo:yield this.getMultiKeyStoreInfo()}}))}createLedgerKey(e,t,r,i,o){return n(this,void 0,void 0,(function*(){if(this.status!==c.EMPTY)throw new Error("Key ring is not loaded or not empty");this.ledgerPublicKey=yield this.ledgerKeeper.getPublicKey(e,o);const n=yield u.CreateLedgerKeyStore(this.rng,this.crypto,t,this.ledgerPublicKey,r,yield this.assignKeyStoreIdMeta(i),o);return this.password=r,this.keyStore=n,this.multiKeyStore.push(this.keyStore),yield this.save(),{status:this.status,multiKeyStoreInfo:yield this.getMultiKeyStoreInfo()}}))}lock(){if(this.status!==c.UNLOCKED)throw new Error("Key ring is not unlocked");this.mnemonic=void 0,this.privateKey=void 0,this.ledgerPublicKey=void 0,this.password=""}unlock(e){return n(this,void 0,void 0,(function*(){if(!this.keyStore||"none"===this.type)throw new Error("Key ring not initialized");if("mnemonic"===this.type)this.mnemonic=s.Buffer.from(yield i.Crypto.decrypt(this.crypto,this.keyStore,e)).toString();else if("privateKey"===this.type)this.privateKey=s.Buffer.from(s.Buffer.from(yield i.Crypto.decrypt(this.crypto,this.keyStore,e)).toString(),"hex");else{if("ledger"!==this.type)throw new Error("Unexpected type of keyring");this.ledgerPublicKey=s.Buffer.from(s.Buffer.from(yield i.Crypto.decrypt(this.crypto,this.keyStore,e)).toString(),"hex")}this.password=e}))}save(){return n(this,void 0,void 0,(function*(){yield this.kvStore.set("key-store",this.keyStore),yield this.kvStore.set("key-multi-store",this.multiKeyStore)}))}restore(){return n(this,void 0,void 0,(function*(){const e=yield this.kvStore.get("key-store");this.keyStore=e||null;const t=yield this.kvStore.get("key-multi-store");t?this.multiKeyStore=t:(e?(e.meta=yield this.assignKeyStoreIdMeta({}),this.multiKeyStore=[e]):this.multiKeyStore=[],yield this.save());let r=!1;this.keyStore&&("1"!==this.keyStore.version&&"1.1"!==this.keyStore.version||(r=!0,this.updateLegacyKeyStore(this.keyStore)));for(const e of this.multiKeyStore)"1"!==e.version&&"1.1"!==e.version||(r=!0,this.updateLegacyKeyStore(e));r&&(yield this.save()),this.loaded=!0}))}updateLegacyKeyStore(e){e.version="1.2";for(const t of this.embedChainInfos){const r=t.alternativeBIP44s&&t.alternativeBIP44s.length>0?t.alternativeBIP44s[0].coinType:t.bip44.coinType;e.coinTypeForChain=Object.assign(Object.assign({},e.coinTypeForChain),{[a.ChainIdHelper.parse(t.chainId).identifier]:r})}}isKeyStoreCoinTypeSet(e){if(!this.keyStore)throw new Error("Empty key store");return this.keyStore.coinTypeForChain&&void 0!==this.keyStore.coinTypeForChain[a.ChainIdHelper.parse(e).identifier]}setKeyStoreCoinType(e,t){return n(this,void 0,void 0,(function*(){if(!this.keyStore)throw new Error("Empty key store");if(this.keyStore.coinTypeForChain&&void 0!==this.keyStore.coinTypeForChain[a.ChainIdHelper.parse(e).identifier])throw new Error("Coin type already set");this.keyStore.coinTypeForChain=Object.assign(Object.assign({},this.keyStore.coinTypeForChain),{[a.ChainIdHelper.parse(e).identifier]:t});const r=this.multiKeyStore.find(e=>u.getKeyStoreId(e)===u.getKeyStoreId(this.keyStore));r&&(r.coinTypeForChain=Object.assign({},this.keyStore.coinTypeForChain)),yield this.save()}))}deleteKeyRing(e,t){return n(this,void 0,void 0,(function*(){if(this.status!==c.UNLOCKED)throw new Error("Key ring is not unlocked");if(this.password!==t)throw new Error("Invalid password");const r=this.multiKeyStore[e];if(!r)throw new Error("Empty key store");const n=this.multiKeyStore.slice(0,e).concat(this.multiKeyStore.slice(e+1));yield i.Crypto.decrypt(this.crypto,r,t);let o=!1;return this.keyStore&&u.getKeyStoreId(r)===u.getKeyStoreId(this.keyStore)&&(n.length>0?(yield this.lock(),this.keyStore=n[0],yield this.unlock(t)):(this.keyStore=null,this.mnemonic=void 0,this.privateKey=void 0),o=!0),this.multiKeyStore=n,yield this.save(),{multiKeyStoreInfo:this.getMultiKeyStoreInfo(),keyStoreChanged:o}}))}updateNameKeyRing(e,t){return n(this,void 0,void 0,(function*(){if(this.status!==c.UNLOCKED)throw new Error("Key ring is not unlocked");const r=this.multiKeyStore[e];if(!r)throw new Error("Empty key store");return r.meta=Object.assign(Object.assign({},r.meta),{name:t}),this.keyStore&&u.getKeyStoreId(this.keyStore)===u.getKeyStoreId(r)&&(this.keyStore=r),yield this.save(),this.getMultiKeyStoreInfo()}))}loadKey(e){if(this.status!==c.UNLOCKED)throw new Error("Key ring is not unlocked");if(!this.keyStore)throw new Error("Key Store is empty");if("ledger"===this.keyStore.type){if(!this.ledgerPublicKey)throw new Error("Ledger public key not set");const e=new o.PubKeySecp256k1(this.ledgerPublicKey);return{algo:"secp256k1",pubKey:e.toBytes(),address:e.getAddress(),isNanoLedger:!0}}{const t=this.loadPrivKey(e).getPubKey();return{algo:"secp256k1",pubKey:t.toBytes(),address:t.getAddress(),isNanoLedger:!1}}}loadPrivKey(e){if(this.status!==c.UNLOCKED||"none"===this.type||!this.keyStore)throw new Error("Key ring is not unlocked");const t=u.getKeyStoreBIP44Path(this.keyStore);if("mnemonic"===this.type){const r=`m/44'/${e}'/${t.account}'/${t.change}/${t.addressIndex}`,n=this.cached.get(r);if(n)return new o.PrivKeySecp256k1(n);if(!this.mnemonic)throw new Error("Key store type is mnemonic and it is unlocked. But, mnemonic is not loaded unexpectedly");const i=o.Mnemonic.generateWalletFromMnemonic(this.mnemonic,r);return this.cached.set(r,i),new o.PrivKeySecp256k1(i)}if("privateKey"===this.type){if(!this.privateKey)throw new Error("Key store type is private key and it is unlocked. But, private key is not loaded unexpectedly");return new o.PrivKeySecp256k1(this.privateKey)}throw new Error("Unexpected type of keyring")}sign(e,t,r,i){return n(this,void 0,void 0,(function*(){if(this.status!==c.UNLOCKED)throw new Error("Key ring is not unlocked");if(!this.keyStore)throw new Error("Key Store is empty");if("ledger"===this.keyStore.type){const t=this.ledgerPublicKey;if(!t)throw new Error("Ledger public key is not initialized");return yield this.ledgerKeeper.sign(e,u.getKeyStoreBIP44Path(this.keyStore),t,i)}{const e=this.computeKeyStoreCoinType(t,r);return this.loadPrivKey(e).sign(i)}}))}showKeyRing(e,t){return n(this,void 0,void 0,(function*(){if(this.status!==c.UNLOCKED)throw new Error("Key ring is not unlocked");if(this.password!==t)throw new Error("Invalid password");const r=this.multiKeyStore[e];if(!r)throw new Error("Empty key store");return r.type,s.Buffer.from(yield i.Crypto.decrypt(this.crypto,r,t)).toString()}))}get canSetPath(){return"mnemonic"===this.type||"ledger"===this.type}addMnemonicKey(e,t,r,i){return n(this,void 0,void 0,(function*(){if(this.status!==c.UNLOCKED||""==this.password)throw new Error("Key ring is locked or not initialized");const n=yield u.CreateMnemonicKeyStore(this.rng,this.crypto,e,t,this.password,yield this.assignKeyStoreIdMeta(r),i);return this.multiKeyStore.push(n),yield this.save(),{multiKeyStoreInfo:this.getMultiKeyStoreInfo()}}))}addPrivateKey(e,t,r){return n(this,void 0,void 0,(function*(){if(this.status!==c.UNLOCKED||""==this.password)throw new Error("Key ring is locked or not initialized");const n=yield u.CreatePrivateKeyStore(this.rng,this.crypto,e,t,this.password,yield this.assignKeyStoreIdMeta(r));return this.multiKeyStore.push(n),yield this.save(),{multiKeyStoreInfo:this.getMultiKeyStoreInfo()}}))}addLedgerKey(e,t,r,i){return n(this,void 0,void 0,(function*(){if(this.status!==c.UNLOCKED||""==this.password)throw new Error("Key ring is locked or not initialized");const n=yield this.ledgerKeeper.getPublicKey(e,i),o=yield u.CreateLedgerKeyStore(this.rng,this.crypto,t,n,this.password,yield this.assignKeyStoreIdMeta(r),i);return this.multiKeyStore.push(o),yield this.save(),{multiKeyStoreInfo:this.getMultiKeyStoreInfo()}}))}changeKeyStoreFromMultiKeyStore(e){return n(this,void 0,void 0,(function*(){if(this.status!==c.UNLOCKED||""==this.password)throw new Error("Key ring is locked or not initialized");const t=this.multiKeyStore[e];if(!t)throw new Error("Invalid keystore");return this.keyStore=t,yield this.unlock(this.password),yield this.save(),{multiKeyStoreInfo:this.getMultiKeyStoreInfo()}}))}getMultiKeyStoreInfo(){const e=[];for(const t of this.multiKeyStore)e.push({version:t.version,type:t.type,meta:t.meta,coinTypeForChain:t.coinTypeForChain,bip44HDPath:t.bip44HDPath,selected:!!this.keyStore&&u.getKeyStoreId(t)===u.getKeyStoreId(this.keyStore)});return e}checkPassword(e){if(!this.password)throw new Error("Keyring is locked");return this.password===e}exportKeyRingDatas(e){var t,r,o,a,c;return n(this,void 0,void 0,(function*(){if(!this.password)throw new Error("Keyring is locked");if(this.password!==e)throw new Error("Invalid password");const n=[];for(const u of this.multiKeyStore){switch(null!==(t=u.type)&&void 0!==t?t:"mnemonic"){case"mnemonic":{const t=s.Buffer.from(yield i.Crypto.decrypt(this.crypto,u,e)).toString();n.push({bip44HDPath:null!==(r=u.bip44HDPath)&&void 0!==r?r:{account:0,change:0,addressIndex:0},coinTypeForChain:u.coinTypeForChain,key:t,meta:null!==(o=u.meta)&&void 0!==o?o:{},type:"mnemonic"});break}case"privateKey":{const t=s.Buffer.from(yield i.Crypto.decrypt(this.crypto,u,e)).toString();n.push({bip44HDPath:null!==(a=u.bip44HDPath)&&void 0!==a?a:{account:0,change:0,addressIndex:0},coinTypeForChain:u.coinTypeForChain,key:t,meta:null!==(c=u.meta)&&void 0!==c?c:{},type:"privateKey"});break}}}return n}))}static CreateMnemonicKeyStore(e,t,r,o,s,a,c){return n(this,void 0,void 0,(function*(){return yield i.Crypto.encrypt(e,t,r,"mnemonic",o,s,a,c)}))}static CreatePrivateKeyStore(e,t,r,o,a,c){return n(this,void 0,void 0,(function*(){return yield i.Crypto.encrypt(e,t,r,"privateKey",s.Buffer.from(o).toString("hex"),a,c)}))}static CreateLedgerKeyStore(e,t,r,o,a,c,u){return n(this,void 0,void 0,(function*(){return yield i.Crypto.encrypt(e,t,r,"ledger",s.Buffer.from(o).toString("hex"),a,c,u)}))}assignKeyStoreIdMeta(e){return n(this,void 0,void 0,(function*(){return Object.assign({},e,{__id__:(yield this.getIncrementalNumber()).toString()})}))}static getKeyStoreId(e){var t;const r=null===(t=e.meta)||void 0===t?void 0:t.__id__;if(!r)throw new Error("Key store's id is empty");return r}static getKeyStoreBIP44Path(e){return e.bip44HDPath?(u.validateBIP44Path(e.bip44HDPath),e.bip44HDPath):{account:0,change:0,addressIndex:0}}static validateBIP44Path(e){if(!Number.isInteger(e.account)||e.account<0)throw new Error("Invalid account in hd path");if(!Number.isInteger(e.change)||0!==e.change&&1!==e.change)throw new Error("Invalid change in hd path");if(!Number.isInteger(e.addressIndex)||e.addressIndex<0)throw new Error("Invalid address index in hd path")}getIncrementalNumber(){return n(this,void 0,void 0,(function*(){let e=yield this.kvStore.get("incrementalNumber");return void 0===e&&(e=0),e++,yield this.kvStore.set("incrementalNumber",e),e}))}}t.KeyRing=u},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExportKeyRingDatasMsg=t.CheckPasswordMsg=t.SetKeyStoreCoinTypeMsg=t.GetIsKeyStoreCoinTypeSetMsg=t.ChangeKeyRingMsg=t.GetMultiKeyStoreInfoMsg=t.RequestSignDirectMsg=t.RequestVerifyADR36AminoSignDoc=t.RequestSignAminoMsg=t.GetKeyMsg=t.UnlockKeyRingMsg=t.LockKeyRingMsg=t.AddLedgerKeyMsg=t.AddPrivateKeyMsg=t.CreateLedgerKeyMsg=t.CreatePrivateKeyMsg=t.AddMnemonicKeyMsg=t.CreateMnemonicKeyMsg=t.ShowKeyRingMsg=t.UpdateNameKeyRingMsg=t.DeleteKeyRingMsg=t.RestoreKeyRingMsg=void 0;const i=r(18),o=r(487),s=r(287),a=r(8),c=r(102),u=r(8),l=n(r(60));class f extends i.Message{static type(){return"restore-keyring"}constructor(){super()}validateBasic(){}route(){return o.ROUTE}type(){return f.type()}}t.RestoreKeyRingMsg=f;class d extends i.Message{constructor(e,t){super(),this.index=e,this.password=t}static type(){return"delete-keyring"}validateBasic(){if(!Number.isInteger(this.index))throw new Error("Invalid index");if(!this.password)throw new Error("password not set")}route(){return o.ROUTE}type(){return d.type()}}t.DeleteKeyRingMsg=d;class h extends i.Message{constructor(e,t){super(),this.index=e,this.name=t}static type(){return"update-name-keyring"}validateBasic(){if(!Number.isInteger(this.index))throw new Error("Invalid index");if(!this.name)throw new Error("name not set")}route(){return o.ROUTE}type(){return h.type()}}t.UpdateNameKeyRingMsg=h;class p extends i.Message{constructor(e,t){super(),this.index=e,this.password=t}static type(){return"show-keyring"}validateBasic(){if(!Number.isInteger(this.index))throw new Error("Invalid index");if(!this.password)throw new Error("password not set")}route(){return o.ROUTE}type(){return p.type()}}t.ShowKeyRingMsg=p;class m extends i.Message{constructor(e,t,r,n,i){super(),this.kdf=e,this.mnemonic=t,this.password=r,this.meta=n,this.bip44HDPath=i}static type(){return"create-mnemonic-key"}validateBasic(){if("scrypt"!==this.kdf&&"sha256"!==this.kdf&&"pbkdf2"!==this.kdf)throw new Error("Invalid kdf");if(!this.mnemonic)throw new Error("mnemonic not set");if(!this.password)throw new Error("password not set");try{c.mnemonicToEntropy(this.mnemonic)}catch(e){if("Invalid mnemonic checksum"!==e.message)throw e}s.KeyRing.validateBIP44Path(this.bip44HDPath)}route(){return o.ROUTE}type(){return m.type()}}t.CreateMnemonicKeyMsg=m;class g extends i.Message{constructor(e,t,r,n){super(),this.kdf=e,this.mnemonic=t,this.meta=r,this.bip44HDPath=n}static type(){return"add-mnemonic-key"}validateBasic(){if("scrypt"!==this.kdf&&"sha256"!==this.kdf&&"pbkdf2"!==this.kdf)throw new Error("Invalid kdf");if(!this.mnemonic)throw new Error("mnemonic not set");try{c.mnemonicToEntropy(this.mnemonic)}catch(e){if("Invalid mnemonic checksum"!==e.message)throw e}s.KeyRing.validateBIP44Path(this.bip44HDPath)}route(){return o.ROUTE}type(){return g.type()}}t.AddMnemonicKeyMsg=g;class y extends i.Message{constructor(e,t,r,n){super(),this.kdf=e,this.privateKey=t,this.password=r,this.meta=n}static type(){return"create-private-key"}validateBasic(){if("scrypt"!==this.kdf&&"sha256"!==this.kdf&&"pbkdf2"!==this.kdf)throw new Error("Invalid kdf");if(!this.privateKey||0===this.privateKey.length)throw new Error("private key not set");if(32!==this.privateKey.length)throw new Error("invalid length of private key");if(!this.password)throw new Error("password not set")}route(){return o.ROUTE}type(){return y.type()}}t.CreatePrivateKeyMsg=y;class b extends i.Message{constructor(e,t,r,n){super(),this.kdf=e,this.password=t,this.meta=r,this.bip44HDPath=n}static type(){return"create-ledger-key"}validateBasic(){if("scrypt"!==this.kdf&&"sha256"!==this.kdf&&"pbkdf2"!==this.kdf)throw new Error("Invalid kdf");if(!this.password)throw new Error("password not set");s.KeyRing.validateBIP44Path(this.bip44HDPath)}route(){return o.ROUTE}type(){return b.type()}}t.CreateLedgerKeyMsg=b;class v extends i.Message{constructor(e,t,r){super(),this.kdf=e,this.privateKey=t,this.meta=r}static type(){return"add-private-key"}validateBasic(){if("scrypt"!==this.kdf&&"sha256"!==this.kdf&&"pbkdf2"!==this.kdf)throw new Error("Invalid kdf");if(!this.privateKey||0===this.privateKey.length)throw new Error("private key not set");if(32!==this.privateKey.length)throw new Error("invalid length of private key")}route(){return o.ROUTE}type(){return v.type()}}t.AddPrivateKeyMsg=v;class w extends i.Message{constructor(e,t,r){super(),this.kdf=e,this.meta=t,this.bip44HDPath=r}static type(){return"add-ledger-key"}validateBasic(){if("scrypt"!==this.kdf&&"sha256"!==this.kdf&&"pbkdf2"!==this.kdf)throw new Error("Invalid kdf");s.KeyRing.validateBIP44Path(this.bip44HDPath)}route(){return o.ROUTE}type(){return w.type()}}t.AddLedgerKeyMsg=w;class _ extends i.Message{static type(){return"lock-keyring"}constructor(){super()}validateBasic(){}route(){return o.ROUTE}type(){return _.type()}}t.LockKeyRingMsg=_;class k extends i.Message{constructor(e=""){super(),this.password=e}static type(){return"unlock-keyring"}validateBasic(){if(!this.password)throw new Error("password not set")}route(){return o.ROUTE}type(){return k.type()}}t.UnlockKeyRingMsg=k;class S extends i.Message{constructor(e){super(),this.chainId=e}static type(){return"get-key"}validateBasic(){if(!this.chainId)throw new Error("chain id not set")}approveExternal(){return!0}route(){return o.ROUTE}type(){return S.type()}}t.GetKeyMsg=S;class E extends i.Message{constructor(e,t,r,n={}){super(),this.chainId=e,this.signer=t,this.signDoc=r,this.signOptions=n}static type(){return"request-sign-amino"}validateBasic(){if(!this.chainId)throw new Error("chain id not set");if(!this.signer)throw new Error("signer not set");if(a.Bech32Address.validate(this.signer),a.checkAndValidateADR36AminoSignDoc(this.signDoc)){if(this.signDoc.msgs[0].value.signer!==this.signer)throw new Error("Unmatched signer in sign doc")}else if(this.signDoc.chain_id!==this.chainId)throw new Error("Chain id in the message is not matched with the requested chain id");if(!this.signOptions)throw new Error("Sign options are null")}approveExternal(){return!0}route(){return o.ROUTE}type(){return E.type()}}t.RequestSignAminoMsg=E;class O extends i.Message{constructor(e,t,r,n){super(),this.chainId=e,this.signer=t,this.data=r,this.signature=n}static type(){return"request-verify-adr-36-amino-doc"}validateBasic(){if(!this.chainId)throw new Error("chain id not set");if(!this.signer)throw new Error("signer not set");if(!this.signature)throw new Error("Signature not set");a.Bech32Address.validate(this.signer)}approveExternal(){return!0}route(){return o.ROUTE}type(){return O.type()}}t.RequestVerifyADR36AminoSignDoc=O;class M extends i.Message{constructor(e,t,r,n={}){super(),this.chainId=e,this.signer=t,this.signDoc=r,this.signOptions=n}static type(){return"request-sign-direct"}validateBasic(){if(!this.chainId)throw new Error("chain id not set");if(!this.signer)throw new Error("signer not set");a.Bech32Address.validate(this.signer);if(u.cosmos.tx.v1beta1.SignDoc.create({bodyBytes:this.signDoc.bodyBytes,authInfoBytes:this.signDoc.authInfoBytes,chainId:this.signDoc.chainId,accountNumber:this.signDoc.accountNumber?l.default.fromString(this.signDoc.accountNumber):void 0}).chainId!==this.chainId)throw new Error("Chain id in the message is not matched with the requested chain id");if(!this.signOptions)throw new Error("Sign options are null")}approveExternal(){return!0}route(){return o.ROUTE}type(){return M.type()}}t.RequestSignDirectMsg=M;class x extends i.Message{static type(){return"get-multi-key-store-info"}constructor(){super()}validateBasic(){}route(){return o.ROUTE}type(){return x.type()}}t.GetMultiKeyStoreInfoMsg=x;class A extends i.Message{constructor(e){super(),this.index=e}static type(){return"change-keyring"}validateBasic(){if(this.index<0)throw new Error("Index is negative");if(!Number.isInteger(this.index))throw new Error("Invalid index")}route(){return o.ROUTE}type(){return A.type()}}t.ChangeKeyRingMsg=A;class j extends i.Message{constructor(e,t){super(),this.chainId=e,this.paths=t}static type(){return"get-is-keystore-coin-type-set"}validateBasic(){if(!this.chainId)throw new Error("chain id not set");if(0===this.paths.length)throw new Error("empty bip44 path list")}route(){return o.ROUTE}type(){return j.type()}}t.GetIsKeyStoreCoinTypeSetMsg=j;class P extends i.Message{constructor(e,t){super(),this.chainId=e,this.coinType=t}static type(){return"set-keystore-coin-type"}validateBasic(){if(!this.chainId)throw new Error("chain id not set");if(this.coinType<0)throw new Error("coin type can not be negative");if(!Number.isInteger(this.coinType))throw new Error("coin type should be integer")}route(){return o.ROUTE}type(){return P.type()}}t.SetKeyStoreCoinTypeMsg=P;class I extends i.Message{constructor(e){super(),this.password=e}static type(){return"check-keyring-password"}validateBasic(){if(!this.password)throw new Error("password not set")}route(){return o.ROUTE}type(){return I.type()}}t.CheckPasswordMsg=I;class R extends i.Message{constructor(e){super(),this.password=e}static type(){return"export-keyring-datas"}validateBasic(){if(!this.password)throw new Error("password not set")}route(){return o.ROUTE}type(){return R.type()}}t.ExportKeyRingDatasMsg=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemovePermissionOrigin=t.AddPermissionOrigin=t.GetOriginPermittedChainsMsg=t.GetPermissionOriginsMsg=t.EnableAccessMsg=void 0;const n=r(18),i=r(488);class o extends n.Message{constructor(e){super(),this.chainIds=e}static type(){return"enable-access"}validateBasic(){if(!this.chainIds||0===this.chainIds.length)throw new Error("chain id not set")}route(){return i.ROUTE}approveExternal(){return!0}type(){return o.type()}}t.EnableAccessMsg=o;class s extends n.Message{constructor(e,t){super(),this.chainId=e,this.permissionType=t}static type(){return"get-permission-origins"}validateBasic(){if(!this.chainId)throw new Error("chain id not set");if(!this.permissionType)throw new Error("empty permission type")}route(){return i.ROUTE}type(){return s.type()}}t.GetPermissionOriginsMsg=s;class a extends n.Message{constructor(e,t){super(),this.permissionOrigin=e,this.permissionType=t}static type(){return"get-origin-permitted-chains"}validateBasic(){if(!this.permissionOrigin)throw new Error("origin not set");if(!this.permissionType)throw new Error("empty permission type")}route(){return i.ROUTE}type(){return a.type()}}t.GetOriginPermittedChainsMsg=a;class c extends n.Message{constructor(e,t,r){super(),this.chainId=e,this.permissionType=t,this.permissionOrigin=r}static type(){return"add-permission-origin"}validateBasic(){if(!this.chainId)throw new Error("chain id not set");if(!this.permissionType)throw new Error("empty permission type");if(!this.permissionOrigin)throw new Error("empty permission origin")}route(){return i.ROUTE}type(){return c.type()}}t.AddPermissionOrigin=c;class u extends n.Message{constructor(e,t,r){super(),this.chainId=e,this.permissionType=t,this.permissionOrigin=r}static type(){return"remove-permission-origin"}validateBasic(){if(!this.chainId)throw new Error("chain id not set");if(!this.permissionType)throw new Error("empty permission type");if(!this.permissionOrigin)throw new Error("empty permission origin")}route(){return i.ROUTE}type(){return u.type()}}t.RemovePermissionOrigin=u},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.makeSignBytes=t.makeSignDoc=t.makeAuthInfoBytes=void 0;const i=n(r(60)),o=r(490),s=r(489);t.makeAuthInfoBytes=function(e,t,r,n,a=o.SignMode.SIGN_MODE_DIRECT){const c={signerInfos:e.map(e=>({publicKey:e,modeInfo:{single:{mode:a}},sequence:i.default.fromNumber(n)})),fee:{amount:[...t],gasLimit:i.default.fromNumber(r)}};return s.AuthInfo.encode(s.AuthInfo.fromPartial(c)).finish()},t.makeSignDoc=function(e,t,r,n){return{bodyBytes:e,authInfoBytes:t,chainId:r,accountNumber:i.default.fromNumber(n)}},t.makeSignBytes=function({accountNumber:e,authInfoBytes:t,bodyBytes:r,chainId:n}){const i=s.SignDoc.fromPartial({accountNumber:e,authInfoBytes:t,bodyBytes:r,chainId:n});return s.SignDoc.encode(i).finish()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(64);function i(e){if(!n.isNonNullObject(e))throw new Error("Attribute must be a non-null object");const{key:t,value:r}=e;if("string"!=typeof t||!t)throw new Error("Attribute's key must be a non-empty string");if("string"!=typeof r&&void 0!==r)throw new Error("Attribute's value must be a string or unset");return{key:t,value:r||""}}function o(e){if(!n.isNonNullObject(e))throw new Error("Event must be a non-null object");const{type:t,attributes:r}=e;if("string"!=typeof t||""===t)throw new Error("Event type must be a non-empty string");if(!Array.isArray(r))throw new Error("Event's attributes must be an array");return{type:t,attributes:r.map(i)}}function s(e){if(!n.isNonNullObject(e))throw new Error("Log must be a non-null object");const{msg_index:t,log:r,events:i}=e;if(!Array.isArray(i))throw new Error("Log's events must be an array");return{msg_index:0,log:"",events:i.map(o)}}t.parseAttribute=i,t.parseEvent=o,t.parseLog=s,t.parseLogs=function(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(s)},t.findAttribute=function(e,t,r){var n,i;const o=null===(i=null===(n=e.find(()=>!0))||void 0===n?void 0:n.events.find(e=>e.type===t))||void 0===i?void 0:i.attributes.find(e=>e.key===r);if(!o)throw new Error(`Could not find attribute '${r}' in first event of type '${t}' in first log.`);return o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(910);Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return n.toAscii}});var i=r(911);Object.defineProperty(t,"fromBase64",{enumerable:!0,get:function(){return i.fromBase64}}),Object.defineProperty(t,"toBase64",{enumerable:!0,get:function(){return i.toBase64}});var o=r(912);Object.defineProperty(t,"Bech32",{enumerable:!0,get:function(){return o.Bech32}});var s=r(913);Object.defineProperty(t,"fromHex",{enumerable:!0,get:function(){return s.fromHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return s.toHex}});var a=r(914);Object.defineProperty(t,"fromRfc3339",{enumerable:!0,get:function(){return a.fromRfc3339}}),Object.defineProperty(t,"toRfc3339",{enumerable:!0,get:function(){return a.toRfc3339}});var c=r(915);Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return c.fromUtf8}}),Object.defineProperty(t,"toUtf8",{enumerable:!0,get:function(){return c.toUtf8}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(64),{toUtf8:i}=n.Encoding;function o(e){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return e.map(o);return Object.keys(e).sort().reduce((t,r)=>Object.assign(Object.assign({},t),{[r]:o(e[r])}),{})}t.marshalTx=function(e){const t=JSON.stringify(e);return n.Encoding.toUtf8(t)},t.makeSignBytes=function(e,t,r,n,s,a){const c=o({account_number:s.toString(),chain_id:r,fee:t,memo:n,msgs:e,sequence:a.toString()});return i(JSON.stringify(c))}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(64),o=n(r(84)),s=n(r(502)),a=r(511);function c(e){return e||[]}var u;function l(e){return void 0!==e.error}function f(e){if(l(e))throw new Error(e.error);return e.result}function d(e){var t;if(null===(t=e.response)||void 0===t?void 0:t.data){let t;const r=e.response.data;throw t=r.error&&"string"==typeof r.error?r.error:"string"==typeof r?r:JSON.stringify(r),new Error(`${t} (HTTP ${e.response.status})`)}throw e}!function(e){e.Block="block",e.Sync="sync",e.Async="async"}(u=t.BroadcastMode||(t.BroadcastMode={}));t.RestClient=class{constructor(e,t=u.Block,r){this.client=o.default.create({baseURL:e,headers:{post:{"Content-Type":"application/json"}}}),this.broadcastMode=t,this.enigmautils=new s.default(e,r),this.codeHashCache=new Map}async get(e){const{data:t}=await this.client.get(e).catch(d);if(null===t)throw new Error("Received null response from server");return t}async post(e,t){if(!i.isNonNullObject(t))throw new Error("Got unexpected type of params. Expected object.");const{data:r}=await this.client.post(e,t).catch(d);if(null===r)throw new Error("Received null response from server");return r}async authAccounts(e){const[t,r]=await Promise.all([this.get("/auth/accounts/"+e),this.get("/bank/balances/"+e)]);return{height:r.height,result:{type:"cosmos-sdk/Account",value:{address:t.result.value.address,coins:r.result,public_key:JSON.stringify(t.result.value.public_key),account_number:Number(t.result.value.account_number||0),sequence:Number(t.result.value.sequence||0)}}}}async blocksLatest(){const e=await this.get("/blocks/latest");if(!e.block)throw new Error("Unexpected response data format");return e}async blocks(e){const t=await this.get("/blocks/"+e);if(!t.block)throw new Error("Unexpected response data format");return t}async nodeInfo(){const e=await this.get("/node_info");if(!e.node_info)throw new Error("Unexpected response data format");return e}async txById(e,t=!0){const r=await this.get("/txs/"+e);if(!r.tx)throw new Error("Unexpected response data format");return t?this.decryptTxsResponse(r):r}async txsQuery(e,t=!0){const r=await this.get("/txs?"+e);if(!r.txs)throw new Error("Unexpected response data format");const n=r;if(t)for(let e=0;e>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.compare=n,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==n(e,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(let t=0;t>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}f.create=d(),f.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(f.alloc=i.pool(f.alloc,i.Array.prototype.subarray)),f.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},p.prototype=Object.create(c.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},f.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},f.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},f.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},f.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},f.prototype.bool=function(e){return this._push(h,1,e?1:0)},f.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=o.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},f.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var y=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(h,1,0);if(i.isString(e)){var r=f.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(y,t,e)},f.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},f.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},f.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},f.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},f._configure=function(e){n=e,f.create=d(),n._configure()}},function(e,t,r){"use strict";e.exports=c;var n,i=r(79),o=i.LongBits,s=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},f=function(){return i.Buffer?function(e){return(c.create=function(e){return i.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function d(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=f(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},function(e,t,r){"use strict";e.exports=b;var n=r(170);((b.prototype=Object.create(n.prototype)).constructor=b).className="Type";var i=r(76),o=r(171),s=r(106),a=r(303),c=r(304),u=r(306),l=r(301),f=r(300),d=r(41),h=r(514),p=r(515),m=r(516),g=r(517),y=r(518);function b(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t-1){var r=e.substring(t);if(r in s)return r}return null}function f(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){o.filename=e;var n,s=o(t,i,r),f=0;if(s.imports)for(;f-1))if(i.files.push(e),e in s)a?f(e,s[e]):(++p,setTimeout((function(){--p,f(e,s[e])})));else if(a){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}f(e,r)}else++p,i.fetch(e,(function(r,o){--p,n&&(r?t?p||c(null,i):c(r):f(e,o))}))}var p=0;l.isString(t)&&(t=[t]);for(var m,g=0;g-1&&this.deferred.splice(t,1)}}else if(e instanceof c)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r{const e=new Error("Delay aborted");return e.name="AbortError",e},i=({clearTimeout:e,setTimeout:t,willResolve:r})=>(i,{value:o,signal:s}={})=>{if(s&&s.aborted)return Promise.reject(n());let a,c,u;const l=e||clearTimeout,f=()=>{l(a),u(n())},d=new Promise((e,n)=>{c=()=>{s&&s.removeEventListener("abort",f),r?e(o):n(o)},u=n,a=(t||setTimeout)(c,i)});return s&&s.addEventListener("abort",f,{once:!0}),d.clear=()=>{l(a),a=null,c()},d},o=i({willResolve:!0});o.reject=i({willResolve:!1}),o.range=(e,t,r)=>o(((e,t)=>Math.floor(Math.random()*(t-e+1)+e))(e,t),r),o.createWithTimers=({clearTimeout:e,setTimeout:t})=>{const r=i({clearTimeout:e,setTimeout:t,willResolve:!0});return r.reject=i({clearTimeout:e,setTimeout:t,willResolve:!1}),r},e.exports=o,e.exports.default=o},function(e,t,r){const n=r(124);e.exports={re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r(202).SEMVER_SPEC_VERSION,SemVer:r(44),compareIdentifiers:r(279).compareIdentifiers,rcompareIdentifiers:r(279).rcompareIdentifiers,parse:r(125),valid:r(853),clean:r(854),inc:r(855),diff:r(856),major:r(857),minor:r(858),patch:r(859),prerelease:r(860),compare:r(62),rcompare:r(861),compareLoose:r(862),compareBuild:r(281),sort:r(863),rsort:r(864),gt:r(205),lt:r(282),eq:r(280),neq:r(476),gte:r(283),lte:r(284),cmp:r(477),coerce:r(865),Comparator:r(206),Range:r(63),satisfies:r(207),toComparators:r(869),maxSatisfying:r(870),minSatisfying:r(871),minVersion:r(872),validRange:r(873),outside:r(285),gtr:r(874),ltr:r(875),intersects:r(876),simplifyRange:r(877),subset:r(878)}},,,,,,,,,,function(e,t,r){e.exports=i;var n=r(66).EventEmitter;function i(){n.call(this)}r(632)(i,n),i.Readable=r(189),i.Writable=r(638),i.Duplex=r(639),i.Transform=r(640),i.PassThrough=r(641),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",c));var s=!1;function a(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},function(e,t,r){(function(e){var n=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,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,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(n,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))},r(636),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,r(15))},,,,,,,,function(e,t,r){ +/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ +!function(t){"use strict";function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function s(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var a,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(a="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+a[15&n])}return t.join("")}}),l={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],O=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function M(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var s,a=0,c=i;c>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^f[a]<<24,a+=1,8!=i)for(t=1;t>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24;for(t=i/2+1;t>2,h=c%4,this._Ke[u][h]=o[t],this._Kd[e-u][h]=o[t++],c++}for(var u=1;u>24&255]^S[s>>16&255]^E[s>>8&255]^O[255&s]},x.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=M(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s>24&255]^m[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Ke[t][i],c[4*i]=255&(d[n[i]>>24&255]^a>>24),c[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^a>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(d[255&n[(i+3)%4]]^a);return c},x.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=M(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^_[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^a>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^a>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^a);return c};var A=function(e){if(!(this instanceof A))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new x(e)};A.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;nNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},R.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var T=function(e,t){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof R||(t=new R(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new x(e)};T.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n0?Math.floor(e):Math.ceil(e)}function g(e,r){var n,i,o=e.length,s=r.length,a=new Array(o),c=0,u=t;for(i=0;i=u?1:0,a[i]=n-c*u;for(;i0&&a.push(c),a}function y(e,t){return e.length>=t.length?g(e,t):g(t,e)}function b(e,r){var n,i,o=e.length,s=new Array(o),a=t;for(i=0;i0;)s[i++]=r%a,r=Math.floor(r/a);return s}function v(e,t){var r,n,i=e.length,o=t.length,s=new Array(i),a=0;for(r=0;r0;)s[i++]=c%a,c=Math.floor(c/a);return s}function S(e,t){for(var r=[];t-- >0;)r.push(0);return r.concat(e)}function E(e,r,n){return new a(e=0;--r)i=(o=1e7*i+e[r])-(n=m(o/t))*t,a[r]=0|n;return[a,0|i]}function x(e,r){var n,i=H(r);if(o)return[new u(e.value/i.value),new u(e.value%i.value)];var l,g=e.value,y=i.value;if(0===y)throw new Error("Cannot divide by zero");if(e.isSmall)return i.isSmall?[new c(m(g/y)),new c(g%y)]:[s[0],e];if(i.isSmall){if(1===y)return[e,s[0]];if(-1==y)return[e.negate(),s[0]];var b=Math.abs(y);if(b=0;i--){for(n=h-1,b[i+f]!==g&&(n=Math.floor((b[i+f]*h+b[i+f-1])/g)),o=0,s=0,c=v.length,a=0;ac&&(i=1e7*(i+1)),r=Math.ceil(i/o);do{if(A(s=k(t,r),l)<=0)break;r--}while(r);u.push(r),l=v(l,s)}return u.reverse(),[d(u),d(l)]}(g,y))[0];var S=e.sign!==i.sign,E=n[1],O=e.sign;return"number"==typeof l?(S&&(l=-l),l=new c(l)):l=new a(l,S),"number"==typeof E?(O&&(E=-E),E=new c(E)):E=new a(E,O),[l,E]}function A(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var r=e.length-1;r>=0;r--)if(e[r]!==t[r])return e[r]>t[r]?1:-1;return 0}function j(e){var t=e.abs();return!t.isUnit()&&(!!(t.equals(2)||t.equals(3)||t.equals(5))||!(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))&&(!!t.lesser(49)||void 0))}function P(e,t){for(var r,n,o,s=e.prev(),a=s,c=0;a.isEven();)a=a.divide(2),c++;e:for(n=0;n=0?n=v(e,t):(n=v(t,e),r=!r),"number"==typeof(n=d(n))?(r&&(n=-n),new c(n)):new a(n,r)}(r,n,this.sign)},a.prototype.minus=a.prototype.subtract,c.prototype.subtract=function(e){var t=H(e),r=this.value;if(r<0!==t.sign)return this.add(t.negate());var n=t.value;return t.isSmall?new c(r-n):w(n,Math.abs(r),r>=0)},c.prototype.minus=c.prototype.subtract,u.prototype.subtract=function(e){return new u(this.value-H(e).value)},u.prototype.minus=u.prototype.subtract,a.prototype.negate=function(){return new a(this.value,!this.sign)},c.prototype.negate=function(){var e=this.sign,t=new c(-this.value);return t.sign=!e,t},u.prototype.negate=function(){return new u(-this.value)},a.prototype.abs=function(){return new a(this.value,!1)},c.prototype.abs=function(){return new c(Math.abs(this.value))},u.prototype.abs=function(){return new u(this.value>=0?this.value:-this.value)},a.prototype.multiply=function(e){var r,n,i,o=H(e),c=this.value,u=o.value,l=this.sign!==o.sign;if(o.isSmall){if(0===u)return s[0];if(1===u)return this;if(-1===u)return this.negate();if((r=Math.abs(u))0?function e(t,r){var n=Math.max(t.length,r.length);if(n<=30)return _(t,r);n=Math.ceil(n/2);var i=t.slice(n),o=t.slice(0,n),s=r.slice(n),a=r.slice(0,n),c=e(o,a),u=e(i,s),l=e(y(o,i),y(a,s)),f=y(y(c,S(v(v(l,c),u),n)),S(u,2*n));return h(f),f}(c,u):_(c,u),l)},a.prototype.times=a.prototype.multiply,c.prototype._multiplyBySmall=function(e){return l(e.value*this.value)?new c(e.value*this.value):E(Math.abs(e.value),f(Math.abs(this.value)),this.sign!==e.sign)},a.prototype._multiplyBySmall=function(e){return 0===e.value?s[0]:1===e.value?this:-1===e.value?this.negate():E(Math.abs(e.value),this.value,this.sign!==e.sign)},c.prototype.multiply=function(e){return H(e)._multiplyBySmall(this)},c.prototype.times=c.prototype.multiply,u.prototype.multiply=function(e){return new u(this.value*H(e).value)},u.prototype.times=u.prototype.multiply,a.prototype.square=function(){return new a(O(this.value),!1)},c.prototype.square=function(){var e=this.value*this.value;return l(e)?new c(e):new a(O(f(Math.abs(this.value))),!1)},u.prototype.square=function(e){return new u(this.value*this.value)},a.prototype.divmod=function(e){var t=x(this,e);return{quotient:t[0],remainder:t[1]}},u.prototype.divmod=c.prototype.divmod=a.prototype.divmod,a.prototype.divide=function(e){return x(this,e)[0]},u.prototype.over=u.prototype.divide=function(e){return new u(this.value/H(e).value)},c.prototype.over=c.prototype.divide=a.prototype.over=a.prototype.divide,a.prototype.mod=function(e){return x(this,e)[1]},u.prototype.mod=u.prototype.remainder=function(e){return new u(this.value%H(e).value)},c.prototype.remainder=c.prototype.mod=a.prototype.remainder=a.prototype.mod,a.prototype.pow=function(e){var t,r,n,i=H(e),o=this.value,a=i.value;if(0===a)return s[1];if(0===o)return s[0];if(1===o)return s[1];if(-1===o)return i.isEven()?s[1]:s[-1];if(i.sign)return s[0];if(!i.isSmall)throw new Error("The exponent "+i.toString()+" is too large.");if(this.isSmall&&l(t=Math.pow(o,a)))return new c(m(t));for(r=this,n=s[1];!0&a&&(n=n.times(r),--a),0!==a;)a/=2,r=r.square();return n},c.prototype.pow=a.prototype.pow,u.prototype.pow=function(e){var t=H(e),r=this.value,n=t.value,i=BigInt(0),o=BigInt(1),a=BigInt(2);if(n===i)return s[1];if(r===i)return s[0];if(r===o)return s[1];if(r===BigInt(-1))return t.isEven()?s[1]:s[-1];if(t.isNegative())return new u(i);for(var c=this,l=s[1];(n&o)===o&&(l=l.times(c),--n),n!==i;)n/=a,c=c.square();return l},a.prototype.modPow=function(e,t){if(e=H(e),(t=H(t)).isZero())throw new Error("Cannot take modPow with modulus 0");var r=s[1],n=this.mod(t);for(e.isNegative()&&(e=e.multiply(s[-1]),n=n.modInv(t));e.isPositive();){if(n.isZero())return s[0];e.isOdd()&&(r=r.multiply(n).mod(t)),e=e.divide(2),n=n.square().mod(t)}return r},u.prototype.modPow=c.prototype.modPow=a.prototype.modPow,a.prototype.compareAbs=function(e){var t=H(e),r=this.value,n=t.value;return t.isSmall?1:A(r,n)},c.prototype.compareAbs=function(e){var t=H(e),r=Math.abs(this.value),n=t.value;return t.isSmall?r===(n=Math.abs(n))?0:r>n?1:-1:-1},u.prototype.compareAbs=function(e){var t=this.value,r=H(e).value;return(t=t>=0?t:-t)===(r=r>=0?r:-r)?0:t>r?1:-1},a.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=H(e),r=this.value,n=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:A(r,n)*(this.sign?-1:1)},a.prototype.compareTo=a.prototype.compare,c.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=H(e),r=this.value,n=t.value;return t.isSmall?r==n?0:r>n?1:-1:r<0!==t.sign?r<0?-1:1:r<0?1:-1},c.prototype.compareTo=c.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,r=H(e).value;return t===r?0:t>r?1:-1},u.prototype.compareTo=u.prototype.compare,a.prototype.equals=function(e){return 0===this.compare(e)},u.prototype.eq=u.prototype.equals=c.prototype.eq=c.prototype.equals=a.prototype.eq=a.prototype.equals,a.prototype.notEquals=function(e){return 0!==this.compare(e)},u.prototype.neq=u.prototype.notEquals=c.prototype.neq=c.prototype.notEquals=a.prototype.neq=a.prototype.notEquals,a.prototype.greater=function(e){return this.compare(e)>0},u.prototype.gt=u.prototype.greater=c.prototype.gt=c.prototype.greater=a.prototype.gt=a.prototype.greater,a.prototype.lesser=function(e){return this.compare(e)<0},u.prototype.lt=u.prototype.lesser=c.prototype.lt=c.prototype.lesser=a.prototype.lt=a.prototype.lesser,a.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},u.prototype.geq=u.prototype.greaterOrEquals=c.prototype.geq=c.prototype.greaterOrEquals=a.prototype.geq=a.prototype.greaterOrEquals,a.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},u.prototype.leq=u.prototype.lesserOrEquals=c.prototype.leq=c.prototype.lesserOrEquals=a.prototype.leq=a.prototype.lesserOrEquals,a.prototype.isEven=function(){return 0==(1&this.value[0])},c.prototype.isEven=function(){return 0==(1&this.value)},u.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},a.prototype.isOdd=function(){return 1==(1&this.value[0])},c.prototype.isOdd=function(){return 1==(1&this.value)},u.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},a.prototype.isPositive=function(){return!this.sign},c.prototype.isPositive=function(){return this.value>0},u.prototype.isPositive=c.prototype.isPositive,a.prototype.isNegative=function(){return this.sign},c.prototype.isNegative=function(){return this.value<0},u.prototype.isNegative=c.prototype.isNegative,a.prototype.isUnit=function(){return!1},c.prototype.isUnit=function(){return 1===Math.abs(this.value)},u.prototype.isUnit=function(){return this.abs().value===BigInt(1)},a.prototype.isZero=function(){return!1},c.prototype.isZero=function(){return 0===this.value},u.prototype.isZero=function(){return this.value===BigInt(0)},a.prototype.isDivisibleBy=function(e){var t=H(e);return!t.isZero()&&(!!t.isUnit()||(0===t.compareAbs(2)?this.isEven():this.mod(t).isZero()))},u.prototype.isDivisibleBy=c.prototype.isDivisibleBy=a.prototype.isDivisibleBy,a.prototype.isPrime=function(e){var t=j(this);if(void 0!==t)return t;var r=this.abs(),n=r.bitLength();if(n<=64)return P(r,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var o=Math.log(2)*n.toJSNumber(),s=Math.ceil(!0===e?2*Math.pow(o,2):o),a=[],c=0;c-r?new c(e-1):new a(n,!0)},u.prototype.prev=function(){return new u(this.value-BigInt(1))};for(var I=[1];2*I[I.length-1]<=t;)I.push(2*I[I.length-1]);var R=I.length,T=I[R-1];function C(e){return Math.abs(e)<=t}function B(e,t,r){t=H(t);for(var n=e.isNegative(),o=t.isNegative(),s=n?e.not():e,a=o?t.not():t,c=0,u=0,l=null,f=null,d=[];!s.isZero()||!a.isZero();)c=(l=x(s,T))[1].toJSNumber(),n&&(c=T-1-c),u=(f=x(a,T))[1].toJSNumber(),o&&(u=T-1-u),s=l[0],a=f[0],d.push(r(c,u));for(var h=0!==r(n?1:0,o?1:0)?i(-1):i(0),p=d.length-1;p>=0;p-=1)h=h.multiply(T).add(i(d[p]));return h}a.prototype.shiftLeft=function(e){var t=H(e).toJSNumber();if(!C(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftRight(-t);var r=this;if(r.isZero())return r;for(;t>=R;)r=r.multiply(T),t-=R-1;return r.multiply(I[t])},u.prototype.shiftLeft=c.prototype.shiftLeft=a.prototype.shiftLeft,a.prototype.shiftRight=function(e){var t,r=H(e).toJSNumber();if(!C(r))throw new Error(String(r)+" is too large for shifting.");if(r<0)return this.shiftLeft(-r);for(var n=this;r>=R;){if(n.isZero()||n.isNegative()&&n.isUnit())return n;n=(t=x(n,T))[1].isNegative()?t[0].prev():t[0],r-=R-1}return(t=x(n,I[r]))[1].isNegative()?t[0].prev():t[0]},u.prototype.shiftRight=c.prototype.shiftRight=a.prototype.shiftRight,a.prototype.not=function(){return this.negate().prev()},u.prototype.not=c.prototype.not=a.prototype.not,a.prototype.and=function(e){return B(this,e,(function(e,t){return e&t}))},u.prototype.and=c.prototype.and=a.prototype.and,a.prototype.or=function(e){return B(this,e,(function(e,t){return e|t}))},u.prototype.or=c.prototype.or=a.prototype.or,a.prototype.xor=function(e){return B(this,e,(function(e,t){return e^t}))},u.prototype.xor=c.prototype.xor=a.prototype.xor;function D(e){var r=e.value,n="number"==typeof r?r|1<<30:"bigint"==typeof r?r|BigInt(1<<30):r[0]+r[1]*t|1073758208;return n&-n}function N(e,t){return e=H(e),t=H(t),e.greater(t)?e:t}function U(e,t){return e=H(e),t=H(t),e.lesser(t)?e:t}function z(e,t){if(e=H(e).abs(),t=H(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var r,n,i=s[1];e.isEven()&&t.isEven();)r=U(D(e),D(t)),e=e.divide(r),t=t.divide(r),i=i.multiply(r);for(;e.isEven();)e=e.divide(D(e));do{for(;t.isEven();)t=t.divide(D(t));e.greater(t)&&(n=t,t=e,e=n),t=t.subtract(e)}while(!t.isZero());return i.isUnit()?e:e.multiply(i)}a.prototype.bitLength=function(){var e=this;return e.compareTo(i(0))<0&&(e=e.negate().subtract(i(1))),0===e.compareTo(i(0))?i(0):i(function e(t,r){if(r.compareTo(t)<=0){var n=e(t,r.square(r)),o=n.p,s=n.e,a=o.multiply(r);return a.compareTo(t)<=0?{p:a,e:2*s+1}:{p:o,e:2*s}}return{p:i(1),e:0}}(e,i(2)).e).add(i(1))},u.prototype.bitLength=c.prototype.bitLength=a.prototype.bitLength;var L=function(e,t,r,n){r=r||"0123456789abcdefghijklmnopqrstuvwxyz",e=String(e),n||(e=e.toLowerCase(),r=r.toLowerCase());var i,o=e.length,s=Math.abs(t),a={};for(i=0;i=s)){if("1"===l&&1===s)continue;throw new Error(l+" is not a valid digit in base "+t+".")}}t=H(t);var c=[],u="-"===e[0];for(i=u?1:0;i"!==e[i]&&i=0;n--)i=i.add(e[n].times(o)),o=o.times(t);return r?i.negate():i}function K(e,t){if((t=i(t)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var n=!1;if(e.isNegative()&&t.isPositive()&&(n=!0,e=e.abs()),t.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:n};for(var o,s=[],a=e;a.isNegative()||a.compareAbs(t)>=0;){o=a.divmod(t),a=o.quotient;var c=o.remainder;c.isNegative()&&(c=t.minus(c).abs(),a=a.next()),s.push(c.toJSNumber())}return s.push(a.toJSNumber()),{value:s.reverse(),isNegative:n}}function F(e,t,r){var n=K(e,t);return(n.isNegative?"-":"")+n.value.map((function(e){return function(e,t){return e<(t=t||"0123456789abcdefghijklmnopqrstuvwxyz").length?t[e]:"<"+e+">"}(e,r)})).join("")}function $(e){if(l(+e)){var t=+e;if(t===m(t))return o?new u(BigInt(t)):new c(t);throw new Error("Invalid integer: "+e)}var r="-"===e[0];r&&(e=e.slice(1));var n=e.split(/e/i);if(n.length>2)throw new Error("Invalid integer: "+n.join("e"));if(2===n.length){var i=n[1];if("+"===i[0]&&(i=i.slice(1)),(i=+i)!==m(i)||!l(i))throw new Error("Invalid integer: "+i+" is not a valid exponent.");var s=n[0],f=s.indexOf(".");if(f>=0&&(i-=s.length-f-1,s=s.slice(0,f)+s.slice(f+1)),i<0)throw new Error("Cannot include negative exponent part for integers");e=s+=new Array(i+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(o)return new u(BigInt(r?"-"+e:e));for(var d=[],p=e.length,g=p-7;p>0;)d.push(+e.slice(g,p)),(g-=7)<0&&(g=0),p-=7;return h(d),new a(d,r)}function H(e){return"number"==typeof e?function(e){if(o)return new u(BigInt(e));if(l(e)){if(e!==m(e))throw new Error(e+" is not an integer.");return new c(e)}return $(e.toString())}(e):"string"==typeof e?$(e):"bigint"==typeof e?new u(e):e}a.prototype.toArray=function(e){return K(this,e)},c.prototype.toArray=function(e){return K(this,e)},u.prototype.toArray=function(e){return K(this,e)},a.prototype.toString=function(e,t){if(void 0===e&&(e=10),10!==e)return F(this,e,t);for(var r,n=this.value,i=n.length,o=String(n[--i]);--i>=0;)r=String(n[i]),o+="0000000".slice(r.length)+r;return(this.sign?"-":"")+o},c.prototype.toString=function(e,t){return void 0===e&&(e=10),10!=e?F(this,e,t):String(this.value)},u.prototype.toString=c.prototype.toString,u.prototype.toJSON=a.prototype.toJSON=c.prototype.toJSON=function(){return this.toString()},a.prototype.valueOf=function(){return parseInt(this.toString(),10)},a.prototype.toJSNumber=a.prototype.valueOf,c.prototype.valueOf=function(){return this.value},c.prototype.toJSNumber=c.prototype.valueOf,u.prototype.valueOf=u.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)s[J]=H(J),J>0&&(s[-J]=H(-J));return s.one=s[1],s.zero=s[0],s.minusOne=s[-1],s.max=N,s.min=U,s.gcd=z,s.lcm=function(e,t){return e=H(e).abs(),t=H(t).abs(),e.divide(z(e,t)).multiply(t)},s.isInstance=function(e){return e instanceof a||e instanceof c||e instanceof u},s.randBetween=function(e,r,n){e=H(e),r=H(r);var i=n||Math.random,o=U(e,r),a=N(e,r).subtract(o).add(1);if(a.isSmall)return o.add(Math.floor(i()*a));for(var c=K(a,t).value,u=[],l=!0,f=0;f=e.length)return e;const r=e.indexOf("1"),n=e.slice(0,r),i=e.slice(r+1);if(t-=n.length,t-=3,(t-=1)<=0)return"";const o=Math.floor(i.length/2);let s=i.slice(0,o),a=i.slice(o);for(;t0?s=s.slice(0,s.length-1):a=a.slice(1);return n+"1"+s+"..."+a}static fromBech32(e,t){const r=s.default.decode(e);if(t&&r.prefix!==t)throw new Error("Unmatched prefix");return new a(new Uint8Array(s.fromWords(r.words)))}static validate(e,t){const{prefix:r}=s.default.decode(e);if(t&&t!==r)throw new Error(`Unexpected prefix (expected: ${t}, actual: ${r})`)}static defaultBech32Config(e,t="val",r="cons",n="pub",i="oper"){return{bech32PrefixAccAddr:e,bech32PrefixAccPub:e+n,bech32PrefixValAddr:e+t+i,bech32PrefixValPub:e+t+i+n,bech32PrefixConsAddr:e+t+r,bech32PrefixConsPub:e+t+r+n}}toBech32(e){const t=s.default.toWords(this.address);return s.default.encode(e,t)}}t.Bech32Address=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TendermintTxTracer=void 0;const n=r(597),i=r(2);t.TendermintTxTracer=class{constructor(e,t,r={}){this.url=e,this.wsEndpoint=t,this.options=r,this.newBlockSubscribes=[],this.txSubscribes=new Map,this.pendingQueries=new Map,this.listeners={},this.onOpen=e=>{var t;this.newBlockSubscribes.length>0&&this.sendSubscribeBlockRpc();for(const[e,t]of this.txSubscribes)this.sendSubscribeTxRpc(e,t.hash);for(const[e,t]of this.pendingQueries)this.sendQueryRpc(e,t.method,t.params);for(const r of null!==(t=this.listeners.open)&&void 0!==t?t:[])r(e)},this.onMessage=e=>{var t,r,n,i,o,s;for(const r of null!==(t=this.listeners.message)&&void 0!==t?t:[])r(e);if(e.data)try{const t=JSON.parse(e.data);if((null==t?void 0:t.id)&&this.pendingQueries.has(t.id)&&(t.error?this.pendingQueries.get(t.id).rejector(new Error(t.error.data||t.error.message)):(null===(r=t.result)||void 0===r?void 0:r.tx_result)?this.pendingQueries.get(t.id).resolver(t.result.tx_result):this.pendingQueries.get(t.id).resolver(t.result),this.pendingQueries.delete(t.id)),"tendermint/event/NewBlock"===(null===(i=null===(n=null==t?void 0:t.result)||void 0===n?void 0:n.data)||void 0===i?void 0:i.type))for(const e of this.newBlockSubscribes)e.handler(t.result.data.value);"tendermint/event/Tx"===(null===(s=null===(o=null==t?void 0:t.result)||void 0===o?void 0:o.data)||void 0===s?void 0:s.type)&&(null==t?void 0:t.id)&&this.txSubscribes.has(t.id)&&(t.error?this.txSubscribes.get(t.id).rejector(new Error(t.error.data||t.error.message)):this.txSubscribes.get(t.id).resolver(t.result.data.value.TxResult.result),this.txSubscribes.delete(t.id))}catch(e){console.log("Tendermint websocket jsonrpc response is not JSON: "+(e.message||e.toString()))}},this.onClose=e=>{var t;for(const r of null!==(t=this.listeners.close)&&void 0!==t?t:[])r(e)},this.ws=this.options.wsObject?new this.options.wsObject(this.getWsEndpoint()):new WebSocket(this.getWsEndpoint()),this.ws.onopen=this.onOpen,this.ws.onmessage=this.onMessage,this.ws.onclose=this.onClose}getWsEndpoint(){let e=this.url;if(e.startsWith("http")&&(e=e.replace("http","ws")),!e.endsWith(this.wsEndpoint)){const t=this.wsEndpoint.startsWith("/")?this.wsEndpoint:"/"+this.wsEndpoint;e=e.endsWith("/")?e+t.slice(1):e+t}return e}close(){this.ws.close()}get readyState(){switch(this.ws.readyState){case 0:return n.WsReadyState.CONNECTING;case 1:return n.WsReadyState.OPEN;case 2:return n.WsReadyState.CLOSING;case 3:return n.WsReadyState.CLOSED;default:return n.WsReadyState.NONE}}addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}subscribeBlock(e){this.newBlockSubscribes.push({handler:e}),1===this.newBlockSubscribes.length&&this.sendSubscribeBlockRpc()}sendSubscribeBlockRpc(){this.readyState===n.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:"2.0",method:"subscribe",params:["tm.event='NewBlock'"],id:1}))}traceTx(e){return new Promise(t=>{this.queryTx(e).then(t).catch(()=>{}),this.subscribeTx(e).then(t)})}subscribeTx(e){const t=this.createRandomId();return new Promise((r,n)=>{this.txSubscribes.set(t,{hash:e,resolver:r,rejector:n}),this.sendSubscribeTxRpc(t,e)})}sendSubscribeTxRpc(e,t){this.readyState===n.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:"2.0",method:"subscribe",params:[`tm.event='Tx' AND tx.hash='${i.Buffer.from(t).toString("hex").toUpperCase()}'`],id:e}))}queryTx(e){return this.query("tx",[i.Buffer.from(e).toString("base64"),!1])}query(e,t){const r=this.createRandomId();return new Promise((n,i)=>{this.pendingQueries.set(r,{method:e,params:t,resolver:n,rejector:i}),this.sendQueryRpc(r,e,t)})}sendQueryRpc(e,t,r){this.readyState===n.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:"2.0",method:t,params:r,id:e}))}createRandomId(){return parseInt(Array.from({length:6}).map(()=>Math.floor(100*Math.random())).join(""))}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultProtoCodec=t.ProtoCodec=void 0;const o=r(155),s=r(155),a=r(369);i(r(369),t);class c{constructor(){this.typeUrlMap=new Map}unpackAny(e){const t=new o.google.protobuf.Any(e);return this.typeUrlMap.has(t.type_url)?this.typeUrlMap.get(t.type_url).decode(t.value):new a.UnknownMessage(t.type_url,t.value)}registerAny(e,t){this.typeUrlMap.set(e,t)}}t.ProtoCodec=c,t.defaultProtoCodec=new c,t.defaultProtoCodec.registerAny("/cosmos.bank.v1beta1.MsgSend",s.cosmos.bank.v1beta1.MsgSend),t.defaultProtoCodec.registerAny("/cosmos.staking.v1beta1.MsgDelegate",s.cosmos.staking.v1beta1.MsgDelegate),t.defaultProtoCodec.registerAny("/cosmos.staking.v1beta1.MsgUndelegate",s.cosmos.staking.v1beta1.MsgUndelegate),t.defaultProtoCodec.registerAny("/cosmos.staking.v1beta1.MsgBeginRedelegate",s.cosmos.staking.v1beta1.MsgBeginRedelegate),t.defaultProtoCodec.registerAny("/cosmwasm.wasm.v1.MsgExecuteContract",s.cosmwasm.wasm.v1.MsgExecuteContract)},function(e,t,r){"use strict";e.exports=f;var n,i=r(101),o=i.LongBits,s=i.base64,a=i.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function f(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var d=function(){return i.Buffer?function(){return(f.create=function(){return new n})()}:function(){return new f}};function h(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}f.create=d(),f.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(f.alloc=i.pool(f.alloc,i.Array.prototype.subarray)),f.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},p.prototype=Object.create(c.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},f.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},f.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},f.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},f.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},f.prototype.bool=function(e){return this._push(h,1,e?1:0)},f.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=o.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},f.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var y=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(h,1,0);if(i.isString(e)){var r=f.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(y,t,e)},f.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},f.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},f.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},f.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},f._configure=function(e){n=e,f.create=d(),n._configure()}},function(e,t,r){"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),o=new Array(123),s=0;s<64;)o[i[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;n.encode=function(e,t,r){for(var n,o=null,s=[],a=0,c=0;t>2],n=(3&u)<<4,c=1;break;case 1:s[a++]=i[n|u>>4],n=(15&u)<<2,c=2;break;case 2:s[a++]=i[n|u>>6],s[a++]=i[63&u],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=i[n],s[a++]=61,1===c&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};n.decode=function(e,t,r){for(var n,i=r,s=0,a=0;a1)break;if(void 0===(c=o[c]))throw Error("invalid encoding");switch(s){case 0:n=c,s=1;break;case 1:t[r++]=n<<2|(48&c)>>4,n=c,s=2;break;case 2:t[r++]=(15&n)<<4|(60&c)>>2,n=c,s=3;break;case 3:t[r++]=(3&n)<<6|c,s=0}}if(1===s)throw Error("invalid encoding");return r-i},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,r){"use strict";function n(){this._listeners={}}e.exports=n,n.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},n.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function r(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,s=8388607&n;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,o),e.readFloatLE=r.bind(null,s),e.readFloatBE=r.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?s:a,e.readDoubleBE=n?a:s}():function(){function t(e,t,r,n,i,o){var s=n<0?1:0;if(s&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((s<<31|2146435072)>>>0,i,o+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,i,o+t),e((s<<31|a/4294967296)>>>0,i,o+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,i,o+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,i,o+r)}}}function r(e,t,r,n,i){var o=e(n,i+t),s=e(n,i+r),a=2*(s>>31)+1,c=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=r.bind(null,s,0,4),e.readDoubleBE=r.bind(null,a,4,0)}(),e}function i(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=n(n)},function(e,t,r){"use strict";var n=t;n.length=function(e){for(var t=0,r=0,n=0;n191&&n<224?o[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(n>>10),o[s++]=56320+(1023&n)):o[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},n.write=function(e,t,r){for(var n,i,o=r,s=0;s>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&i),++s,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(r){if(r<1||r>i)return e(r);s+r>n&&(o=e(n),s=0);var a=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},function(e,t,r){"use strict";e.exports=c;var n,i=r(101),o=i.LongBits,s=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},f=function(){return i.Buffer?function(e){return(c.create=function(e){return i.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function d(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=f(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnknownMessage=void 0;const n=r(2);t.UnknownMessage=class{constructor(e,t){this._typeUrl=e,this._value=t}get typeUrl(){return this._typeUrl}get value(){return this._value}toJSON(){return{type_url:this._typeUrl,value:n.Buffer.from(this._value).toString("base64")}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProtoSignDocDecoder=void 0;const n=r(155),i=r(361);class o{constructor(e,t=i.defaultProtoCodec){this.signDoc=e,this.protoCodec=t}static decode(e){return new o(n.cosmos.tx.v1beta1.SignDoc.decode(e))}get txBody(){return this._txBody||(this._txBody=n.cosmos.tx.v1beta1.TxBody.decode(this.signDoc.bodyBytes)),this._txBody}get txMsgs(){const e=[];for(const t of this.txBody.messages)e.push(this.protoCodec.unpackAny(t));return e}get authInfo(){return this._authInfo||(this._authInfo=n.cosmos.tx.v1beta1.AuthInfo.decode(this.signDoc.authInfoBytes)),this._authInfo}get chainId(){return this.signDoc.chainId}get accountNumber(){return this.signDoc.accountNumber.toString()}toBytes(){return n.cosmos.tx.v1beta1.SignDoc.encode(this.signDoc).finish()}toJSON(){return{txBody:Object.assign(Object.assign({},this.txBody.toJSON()),{messages:this.txMsgs.map(e=>e&&e.toJSON?e.toJSON():e)}),authInfo:this.authInfo.toJSON(),chainId:this.chainId,accountNumber:this.accountNumber}}}t.ProtoSignDocDecoder=o},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(608),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAttribute=t.parseLogs=t.parseLog=t.parseEvent=t.parseAttribute=void 0;const n=r(156);function i(e){if(!n.isNonNullObject(e))throw new Error("Attribute must be a non-null object");const{key:t,value:r}=e;if("string"!=typeof t||!t)throw new Error("Attribute's key must be a non-empty string");if("string"!=typeof r&&void 0!==r)throw new Error("Attribute's value must be a string or unset");return{key:t,value:r||""}}function o(e){if(!n.isNonNullObject(e))throw new Error("Event must be a non-null object");const{type:t,attributes:r}=e;if("string"!=typeof t||""===t)throw new Error("Event type must be a non-empty string");if(!Array.isArray(r))throw new Error("Event's attributes must be an array");return{type:t,attributes:r.map(i)}}function s(e){if(!n.isNonNullObject(e))throw new Error("Log must be a non-null object");const{msg_index:t,log:r,events:i}=e;if("number"!=typeof t)throw new Error("Log's msg_index must be a number");if("string"!=typeof r)throw new Error("Log's log must be a string");if(!Array.isArray(i))throw new Error("Log's events must be an array");return{msg_index:t,log:r,events:i.map(o)}}t.parseAttribute=i,t.parseEvent=o,t.parseLog=s,t.parseLogs=function(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(s)},t.findAttribute=function(e,t,r){var n;const i=e.find(()=>!0),o=null===(n=null==i?void 0:i.events.find(e=>e.type===t))||void 0===n?void 0:n.attributes.find(e=>e.key===r);if(!o)throw new Error(`Could not find attribute '${r}' in first event of type '${t}' in first log.`);return o}},function(e,t,r){"use strict";var n=r(13).Buffer,i=r(620).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(11)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i;e.exports=O,O.ReadableState=E;r(66).EventEmitter;var o=function(e,t){return e.listeners(t).length},s=r(375),a=r(2).Buffer,c=t.Uint8Array||function(){};var u,l=r(621);u=l&&l.debuglog?l.debuglog("stream"):function(){};var f,d,h,p=r(622),m=r(376),g=r(377).getHighWaterMark,y=r(113).codes,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,_=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(11)(O,s);var k=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(e,t,n){i=i||r(114),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(83).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function O(e){if(i=i||r(114),!(this instanceof O))return new O(e);var t=this instanceof i;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function M(e,t,r,n,i){u("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?j(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}(e,s);else if(i||(o=function(e,t){var r;n=t,a.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(s,t)),o)k(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)s.endEmitted?k(e,new _):x(e,s,t,!0);else if(s.ended)k(e,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?x(e,s,t,!1):I(e,s)):x(e,s,t,!1)}else n||(s.reading=!1,I(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function j(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(P,e))}function P(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function I(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){u("readable nexttick read 0"),e.read(0)}function B(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(z,t,e))}function z(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function L(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):j(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return u("need readable",i),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},O.prototype._read=function(e){k(this,new w("_read()"))},O.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,u("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?c:g;function a(t,n){u("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",g),r.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){u("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",l);var f=!1;function d(t){u("ondata");var n=e.write(t);u("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==L(i.pipes,e))&&!f&&(u("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===o(e,"error")&&k(e,t)}function p(){e.removeListener("finish",m),g()}function m(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",r),i.flowing||(u("pipe resume"),r.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,u("on readable",i.length,i.reading),i.length?j(this):i.reading||n.nextTick(C,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(T,this),r},O.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(T,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(B,e,t))}(this,e)),e.paused=!1,this},O.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(u("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new m("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.prototype._destroy=function(e,t){t(e)}}).call(this,r(15),r(17))},function(e,t,r){"use strict";e.exports=l;var n=r(113).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(114);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+h(r[y-15])+r[y-16];for(var b=0;b<64;++b){var v=g+d(c)+u(c,p,m)+s[b]+r[b]|0,w=f(n)+l(n,i,o)|0;g=m,m=p,p=c,c=a+v|0,a=o,o=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);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.writeInt32BE(this._h,28),e},e.exports=c},function(e,t,r){var n=r(11),i=r(115),o=r(13).Buffer,s=[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],a=new Array(160);function c(){this.init(),this._w=a,i.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function y(e,t){return e>>>0>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,c=0|this._fh,b=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,k=0|this._cl,S=0|this._dl,E=0|this._el,O=0|this._fl,M=0|this._gl,x=0|this._hl,A=0;A<32;A+=2)t[A]=e.readInt32BE(4*A),t[A+1]=e.readInt32BE(4*A+4);for(;A<160;A+=2){var j=t[A-30],P=t[A-30+1],I=h(j,P),R=p(P,j),T=m(j=t[A-4],P=t[A-4+1]),C=g(P,j),B=t[A-14],D=t[A-14+1],N=t[A-32],U=t[A-32+1],z=R+D|0,L=I+B+y(z,R)|0;L=(L=L+T+y(z=z+C|0,C)|0)+N+y(z=z+U|0,U)|0,t[A]=L,t[A+1]=z}for(var q=0;q<160;q+=2){L=t[q],z=t[q+1];var K=l(r,n,i),F=l(w,_,k),$=f(r,w),H=f(w,r),J=d(a,E),W=d(E,a),G=s[q],V=s[q+1],Z=u(a,c,b),Y=u(E,O,M),X=x+W|0,Q=v+J+y(X,x)|0;Q=(Q=(Q=Q+Z+y(X=X+Y|0,Y)|0)+G+y(X=X+V|0,V)|0)+L+y(X=X+z|0,z)|0;var ee=H+F|0,te=$+K+y(ee,H)|0;v=b,x=M,b=c,M=O,c=a,O=E,a=o+Q+y(E=S+X|0,S)|0,o=i,S=k,i=n,k=_,n=r,_=w,r=Q+te+y(w=X+ee|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+k|0,this._dl=this._dl+S|0,this._el=this._el+E|0,this._fl=this._fl+O|0,this._gl=this._gl+M|0,this._hl=this._hl+x|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,_)|0,this._ch=this._ch+i+y(this._cl,k)|0,this._dh=this._dh+o+y(this._dl,S)|0,this._eh=this._eh+a+y(this._el,E)|0,this._fh=this._fh+c+y(this._fl,O)|0,this._gh=this._gh+b+y(this._gl,M)|0,this._hh=this._hh+v+y(this._hl,x)|0},c.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+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),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},function(e,t,r){"use strict";(function(t,n){var i=r(190);e.exports=v;var o,s=r(188);v.ReadableState=b;r(66).EventEmitter;var a=function(e,t){return e.listeners(t).length},c=r(383),u=r(244).Buffer,l=t.Uint8Array||function(){};var f=Object.create(r(157));f.inherits=r(11);var d=r(633),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,m=r(634),g=r(384);f.inherits(v,c);var y=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var n=t instanceof(o=o||r(104));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(83).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(104),!(this instanceof v))return new v(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function w(e,t,r,n,i){var o,s=e._readableState;null===t?(s.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,S(e)}(e,s)):(i||(o=function(e,t){var r;n=t,u.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(s,t)),o?e.emit("error",o):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?_(e,s,t,!1):O(e,s)):_(e,s,t,!1))):n||(s.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(E,e):E(e))}function E(e){h("emit readable"),e.emit("readable"),j(e)}function O(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(M,e,t))}function M(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=u.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0===(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(s));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function T(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):S(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&I(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&I(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,t);var c=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?l:v;function u(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",f),e.removeListener("error",g),e.removeListener("unpipe",u),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",m),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){h("onend"),e.end()}o.endEmitted?i.nextTick(c):r.once("end",c),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",f);var d=!1;var p=!1;function m(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==T(o.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function g(t){h("onerror",t),v(),e.removeListener("error",g),0===a(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),v()}function b(){h("onfinish"),e.removeListener("close",y),v()}function v(){h("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",y),e.once("finish",b),e.emit("pipe",r),o.flowing||(h("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;or||t!=t)throw new TypeError("Bad key length")}},function(e,t,r){(function(t){var r;if(t.browser)r="utf-8";else if(t.version){r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";e.exports=r}).call(this,r(17))},function(e,t,r){var n=r(246),i=r(103),o=r(93),s=r(13).Buffer,a=r(386),c=r(387),u=r(389),l=s.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,r){var a=function(e){function t(t){return o(e).update(t).digest()}return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:t}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=a(t):t.length>8&255]>10&&(i[t]=n),n},function(e,t,r){return r?e(t,r):new n(t,null)},function(e,t,r){var i;if(t<4352||4371<=t&&t<44032||55204=55296&&e<=56319},n.isLowSurrogate=function(e){return e>=56320&&e<=57343},n.prototype.prepFeature=function(){this.feature||(this.feature=n.fromCharCode(this.codepoint,!0).feature)},n.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var e=this.codepoint-65536;return String.fromCharCode(Math.floor(e/1024)+55296,e%1024+56320)},n.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},n.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},n.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},n.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},n.prototype.getComposite=function(e){if(this.prepFeature(),!this.feature[2])return null;var t=this.feature[2][e.codepoint];return t?n.fromCharCode(t):null};var c=function(e){this.str=e,this.cursor=0};c.prototype.next=function(){if(this.str&&this.cursor0;--r){if(this.resBuf[r-1].getCanonicalClass()<=e)break}this.resBuf.splice(r,0,t)}while(0!==e);return this.resBuf.shift()};var f=function(e){this.it=e,this.procBuf=[],this.resBuf=[],this.lastClass=null};f.prototype.next=function(){for(;0===this.resBuf.length;){var e=this.it.next();if(!e){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=e.getCanonicalClass(),this.procBuf.push(e);else{var t=this.procBuf[0].getComposite(e),r=e.getCanonicalClass();t&&(this.lastClass(new e).update(t).digest();let n=t;if(n.length>r&&(n=this.hash(n)),n.length92^e),this.iKeyPad=n.map(e=>54^e),this.messageHasher=new e,this.blockSize=r,this.update(this.iKeyPad)}update(e){return this.messageHasher.update(e),this}digest(){const e=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...e]))}}},function(e,t){e.exports={}},function(e){e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},function(e,t,r){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=t>>>a+s&1,i<<=1,i|=e>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=t>>>a+s&1,o<<=1,o|=e>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var o=0,s=0,a=n.length>>>1,c=0;c>>n[c]&1;for(c=a;c>>n[c]&1;r[i+0]=o>>>0,r[i+1]=s>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,e.keys,s)}},c.prototype._update=function(e,t,r,n){var i=this._desState,s=o.readUInt32BE(e,t),a=o.readUInt32BE(e,t+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,s=d}o.rip(a,s,n,i)},c.prototype._decrypt=function(e,t,r,n,i){for(var s=r,a=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],l=e.keys[c+1];o.expand(s,e.tmp,0),u^=e.tmp[0],l^=e.tmp[1];var f=o.substitute(u,l),d=s;s=(a^o.permute(f))>>>0,a=d}o.rip(s,a,n,i)}},function(e,t,r){var n=r(159),i=r(13).Buffer,o=r(399);function s(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),o=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var a=0;ae;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;r.mod(l).cmp(f);)r.iadd(h)}else for(;r.mod(o).cmp(d);)r.iadd(h);if(g(p=r.shrn(1))&&g(r)&&y(p)&&y(r)&&s.test(p)&&s.test(r))return r}}},function(e,t,r){var n=r(6),i=r(250);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),s=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var a=e.subn(1),c=0;!a.testn(c);c++);for(var u=e.shrn(c),l=a.toRed(o);t>0;t--){var f=this._randrange(new n(2),a);r&&r(f);var d=f.toRed(o).redPow(u);if(0!==d.cmp(s)&&0!==d.cmp(l)){for(var h=1;h0;t--){var l=this._randrange(new n(2),s),f=e.gcd(l);if(0!==f.cmpn(1))return f;var d=l.toRed(i).redPow(c);if(0!==d.cmp(o)&&0!==d.cmp(u)){for(var h=1;h0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)s.endEmitted?k(e,new _):x(e,s,t,!0);else if(s.ended)k(e,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?x(e,s,t,!1):I(e,s)):x(e,s,t,!1)}else n||(s.reading=!1,I(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function j(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(P,e))}function P(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function I(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){u("readable nexttick read 0"),e.read(0)}function B(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(z,t,e))}function z(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function L(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):j(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return u("need readable",i),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},O.prototype._read=function(e){k(this,new w("_read()"))},O.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,u("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?c:g;function a(t,n){u("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",g),r.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){u("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",l);var f=!1;function d(t){u("ondata");var n=e.write(t);u("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==L(i.pipes,e))&&!f&&(u("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===o(e,"error")&&k(e,t)}function p(){e.removeListener("finish",m),g()}function m(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",r),i.flowing||(u("pipe resume"),r.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,u("on readable",i.length,i.reading),i.length?j(this):i.reading||n.nextTick(C,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(T,this),r},O.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(T,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(B,e,t))}(this,e)),e.paused=!1,this},O.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(u("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new m("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.prototype._destroy=function(e,t){t(e)}}).call(this,r(15),r(17))},function(e,t,r){"use strict";e.exports=l;var n=r(116).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(117);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n=t;n.base=r(194),n.short=r(690),n.mont=r(691),n.edwards=r(692)},function(e,t,r){"use strict";var n=r(74).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(74),i=r(160),o=r(413),s=r(55),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,f=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,m=o.g1_256,g=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,s|=c}return n(!(240&s),"Invalid character in "+e),i}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),c=t;c=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&s0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?f[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(e);r=(p=p.idivn(l)).isZero()?m+r:f[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,f=67108863&c,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,h=0|s[1],p=8191&h,m=h>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,k=0|s[4],S=8191&k,E=k>>>13,O=0|s[5],M=8191&O,x=O>>>13,A=0|s[6],j=8191&A,P=A>>>13,I=0|s[7],R=8191&I,T=I>>>13,C=0|s[8],B=8191&C,D=C>>>13,N=0|s[9],U=8191&N,z=N>>>13,L=0|a[0],q=8191&L,K=L>>>13,F=0|a[1],$=8191&F,H=F>>>13,J=0|a[2],W=8191&J,G=J>>>13,V=0|a[3],Z=8191&V,Y=V>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],fe=8191&le,de=le>>>13,he=0|a[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(f,q))|0)+((8191&(i=(i=Math.imul(f,K))+Math.imul(d,q)|0))<<13)|0;u=((o=Math.imul(d,K))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,K))+Math.imul(m,q)|0,o=Math.imul(m,K);var ye=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,H)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,K))+Math.imul(b,q)|0,o=Math.imul(b,K),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,K))+Math.imul(_,q)|0,o=Math.imul(_,K),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,Z)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,K))+Math.imul(E,q)|0,o=Math.imul(E,K),n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var we=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(M,q),i=(i=Math.imul(M,K))+Math.imul(x,q)|0,o=Math.imul(x,K),n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var _e=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,K))+Math.imul(P,q)|0,o=Math.imul(P,K),n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var ke=(u+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,K))+Math.imul(T,q)|0,o=Math.imul(T,K),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(u+(n=n+Math.imul(f,ce)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(D,q)|0,o=Math.imul(D,K),n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Ee=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,K))+Math.imul(z,q)|0,o=Math.imul(z,K),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var Oe=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,H))+Math.imul(z,$)|0,o=Math.imul(z,H),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Me=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,G))+Math.imul(z,W)|0,o=Math.imul(z,G),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,de)|0;var xe=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,Z),i=(i=Math.imul(U,Y))+Math.imul(z,Z)|0,o=Math.imul(z,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Ae=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(z,Q)|0,o=Math.imul(z,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var je=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;u=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(z,re)|0,o=Math.imul(z,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,se)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,de)|0;var Pe=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(z,oe)|0,o=Math.imul(z,se),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,de)|0;var Ie=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(z,ce)|0,o=Math.imul(z,ue),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,de)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,fe),i=(i=Math.imul(U,de))+Math.imul(z,fe)|0,o=Math.imul(z,de);var Te=(u+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Ce=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,me))+Math.imul(z,pe)|0))<<13)|0;return u=((o=Math.imul(z,me))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=_e,c[6]=ke,c[7]=Se,c[8]=Ee,c[9]=Oe,c[10]=Me,c[11]=xe,c[12]=Ae,c[13]=je,c[14]=Pe,c[15]=Ie,c[16]=Re,c[17]=Te,c[18]=Ce,0!==u&&(c[19]=u,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.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")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.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)},O.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},O.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)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.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),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var m=h,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,O),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.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)},M.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),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(71)(e))},function(e,t,r){"use strict";const n=t;n.bignum=r(6),n.define=r(709).define,n.base=r(712),n.constants=r(713),n.decoders=r(420),n.encoders=r(418)},function(e,t,r){"use strict";const n=t;n.der=r(419),n.pem=r(710)},function(e,t,r){"use strict";const n=r(11),i=r(254).Buffer,o=r(255),s=r(257);function a(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){o.call(this,"der",e)}function u(e){return e<10?"0"+e:e}e.exports=a,a.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(c,o),c.prototype._encodeComposite=function(e,t,r,n){const o=function(e,t,r,n){let i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(s.tagByName.hasOwnProperty(e))i=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6,i}(e,t,r,this.reporter);if(n.length<128){const e=i.alloc(2);return e[0]=o,e[1]=n.length,this._createEncoderBuffer([e,n])}let a=1;for(let e=n.length;e>=256;e>>=8)a++;const c=i.alloc(2+a);c[0]=o,c[1]=128|a;for(let e=1+a,t=n.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=i.alloc(2*e.length);for(let r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t=128;r>>=7)n++}const o=i.alloc(n);let s=o.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(o[s--]=127&r;(r>>=7)>0;)o[s--]=128|127&r}return this._createEncoderBuffer(o)},c.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[u(n.getUTCFullYear()),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(n.getUTCFullYear()%100),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=i.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const n=new Array(r);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function f(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let t=0;t32||0===e.length||0===e[0])throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||0===t.length||0===t[0])throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:e,s:t}}static fromFixedLength(e){if(64!==e.length)throw new Error(`Got invalid data length: ${e.length}. Expected 2x 32 bytes for the pair (r, s)`);return new i(n(e.slice(0,32)),n(e.slice(32,64)))}static fromDer(e){let t=0;if(48!==e[t++])throw new Error("Prefix 0x30 expected");const r=e[t++];if(e.length-t!==r)throw new Error("Data length mismatch detected");if(2!==e[t++])throw new Error("INTEGER tag expected");const o=e[t++];if(o>=128)throw new Error("Decoding length values above 127 not supported");const s=e.slice(t,t+o);t+=o;if(2!==e[t++])throw new Error("INTEGER tag expected");const a=e[t++];if(a>=128)throw new Error("Decoding length values above 127 not supported");const c=e.slice(t,t+a);return t+=a,new i(n(s),n(c))}r(e){if(void 0===e)return this.data.r;{const t=e-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const r=new Uint8Array(t);return new Uint8Array([...r,...this.data.r])}}s(e){if(void 0===e)return this.data.s;{const t=e-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const r=new Uint8Array(t);return new Uint8Array([...r,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const e=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,r=e.length,n=t.length,i=new Uint8Array([2,r,...e,2,n,...t]);return new Uint8Array([48,i.length,...i])}}t.Secp256k1Signature=i;class o extends i{constructor(e,t,r){if(super(e,t),!Number.isInteger(r))throw new Error("The recovery parameter must be an integer.");if(r<0||r>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=r}static fromFixedLength(e){if(65!==e.length)throw new Error(`Got invalid data length ${e.length}. Expected 32 + 32 + 1`);return new o(n(e.slice(0,32)),n(e.slice(32,64)),e[64])}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}t.ExtendedSecp256k1Signature=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.Sha512=t.sha256=t.Sha256=t.sha1=t.Sha1=void 0;const i=n(r(93));class o{constructor(e){this.blockSize=64,this.impl=i.default("sha1"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha1=o,t.sha1=function(e){return new o(e).digest()};class s{constructor(e){this.blockSize=64,this.impl=i.default("sha256"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha256=s,t.sha256=function(e){return new s(e).digest()};class a{constructor(e){this.blockSize=128,this.impl=i.default("sha512"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha512=a,t.sha512=function(e){return new a(e).digest()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCoins=t.coins=t.coin=void 0;const n=r(118);function i(e,t){return{amount:new n.Uint53(e).toString(),denom:t}}t.coin=i,t.coins=function(e,t){return[i(e,t)]},t.parseCoins=function(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(e=>{const t=e.match(/^([0-9]+)([a-zA-Z]+)/);if(!t)throw new Error("Got an invalid coin string");return{amount:n.Uint64.fromString(t[1]).toString(),denom:t[2]}})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CosmosClient=t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByHeightQuery=t.assertIsBroadcastTxSuccess=t.isBroadcastTxSuccess=t.isBroadcastTxFailure=void 0;const n=r(73),i=r(57),o=r(118),s=r(258),a=r(372);function c(e){return!!e.code}function u(e){return void 0!==e.height}function l(e){return void 0!==e.sentFromOrTo}function f(e){return void 0!==e.tags}t.isBroadcastTxFailure=c,t.isBroadcastTxSuccess=function(e){return!c(e)},t.assertIsBroadcastTxSuccess=function(e){if(c(e))throw new Error(`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)},t.isSearchByHeightQuery=u,t.isSearchBySentFromOrToQuery=l,t.isSearchByTagsQuery=f;t.CosmosClient=class{constructor(e,t=s.BroadcastMode.Block){this.lcdClient=s.LcdClient.withExtensions({apiUrl:e,broadcastMode:t},s.setupAuthExtension)}async getChainId(){if(!this.chainId){const e=(await this.lcdClient.nodeInfo()).node_info.network;if(!e)throw new Error("Chain ID must not be empty");this.chainId=e}return this.chainId}async getHeight(){if(this.anyValidAddress){const{height:e}=await this.lcdClient.auth.account(this.anyValidAddress);return parseInt(e,10)}{const e=await this.lcdClient.blocksLatest();return parseInt(e.block.header.height,10)}}async getIdentifier(e){const t=await this.lcdClient.encodeTx(e),r=n.sha256(i.fromBase64(t.tx));return i.toHex(r).toUpperCase()}async getSequence(e){const t=await this.getAccount(e);if(!t)throw new Error("Account does not exist on chain. Send some tokens there before trying to query sequence.");return{accountNumber:t.accountNumber,sequence:t.sequence}}async getAccount(e){const t=(await this.lcdClient.auth.account(e)).result.value;return""===t.address?void 0:(this.anyValidAddress=t.address,{address:t.address,balance:t.coins,pubkey:s.normalizePubkey(t.public_key)||void 0,accountNumber:s.uint64ToNumber(t.account_number),sequence:s.uint64ToNumber(t.sequence)})}async getBlock(e){const t=void 0!==e?await this.lcdClient.blocks(e):await this.lcdClient.blocksLatest();return{id:t.block_id.hash,header:{version:t.block.header.version,time:t.block.header.time,height:parseInt(t.block.header.height,10),chainId:t.block.header.chain_id},txs:(t.block.data.txs||[]).map(i.fromBase64)}}async getTx(e){var t;return null!==(t=(await this.txsQuery("tx.hash="+e))[0])&&void 0!==t?t:null}async searchTx(e,t={}){const r=t.minHeight||0,n=t.maxHeight||Number.MAX_SAFE_INTEGER;if(nn?[]:await this.txsQuery("tx.height="+e.height);else if(l(e)){const t=i("message.module=bank&message.sender="+e.sentFromOrTo),r=i("message.module=bank&transfer.recipient="+e.sentFromOrTo),n=await this.txsQuery(t),s=await this.txsQuery(r),a=n.map(e=>e.hash);o=[...n,...s.filter(e=>!a.includes(e.hash))]}else{if(!f(e))throw new Error("Unknown query type");{const t=i(e.tags.map(e=>`${e.key}=${e.value}`).join("&"));o=await this.txsQuery(t)}}return o.filter(e=>e.height>=r&&e.height<=n)}async broadcastTx(e){const t=await this.lcdClient.broadcastTx(e);if(!t.txhash.match(/^([0-9A-F][0-9A-F])+$/))throw new Error("Received ill-formatted txhash. Must be non-empty upper-case hex");return void 0!==t.code?{height:o.Uint53.fromString(t.height).toNumber(),transactionHash:t.txhash,code:t.code,rawLog:t.raw_log||""}:{logs:t.logs?a.parseLogs(t.logs):[],rawLog:t.raw_log||"",transactionHash:t.txhash,data:t.data?i.fromHex(t.data):void 0}}async txsQuery(e){const t=await this.lcdClient.txsQuery(e+"&limit=100");if(parseInt(t.page_total,10)>1)throw new Error(`Found more results on the backend than we can process currently. Results: ${t.total_count}, supported: 100`);return t.txs.map(e=>({height:parseInt(e.height,10),hash:e.txhash,code:e.code||0,rawLog:e.raw_log,logs:a.parseLogs(e.logs||[]),tx:e.tx,timestamp:e.timestamp}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastMode=void 0,function(e){e.Block="block",e.Sync="sync",e.Async="async"}(t.BroadcastMode||(t.BroadcastMode={}))},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(o)})),e.exports=c}).call(this,r(17))},function(e,t,r){"use strict";var n=r(49),i=r(743),o=r(745),s=r(432),a=r(746),c=r(749),u=r(750),l=r(436);e.exports=function(e){return new Promise((function(t,r){var f=e.data,d=e.headers;n.isFormData(f)&&delete d["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(p+":"+m)}var g=a(e.baseURL,e.url);if(h.open(e.method.toUpperCase(),s(g,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?c(h.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h};i(t,r,o),h=null}},h.onabort=function(){h&&(r(l("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){r(l("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var y=(e.withCredentials||u(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in h&&n.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:h.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),r(e),h=null)})),f||(f=null),h.send(f)}))}},function(e,t,r){"use strict";var n=r(744);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},function(e,t,r){"use strict";var n=r(49);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function u(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=c(void 0,e[i])):r[i]=c(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=c(void 0,t[e]))})),n.forEach(o,u),n.forEach(s,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=c(void 0,e[i])):r[i]=c(void 0,t[i])})),n.forEach(a,(function(n){n in t?r[n]=c(e[n],t[n]):n in e&&(r[n]=c(void 0,e[n]))}));var l=i.concat(o).concat(s).concat(a),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return n.forEach(f,u),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildFeeTable=t.GasPrice=void 0;const n=r(118),i=r(428);class o{constructor(e,t){this.amount=e,this.denom=t}static fromString(e){const t=e.match(/^(?.+?)(?[a-z]+)$/);if(!t)throw new Error("Invalid gas price string");const{amount:r,denom:i}=t.groups;if(i.length<3||i.length>127)throw new Error("Gas price denomination must be between 3 and 127 characters");const s=n.Decimal.fromUserInput(r,18);return new o(s,i)}}function s(e,{denom:t,amount:r}){const o=Math.ceil(r.multiply(new n.Uint53(e)).toFloatApproximation());return{amount:i.coins(o,t),gas:e.toString()}}t.GasPrice=o,t.buildFeeTable=function(e,t,r){return Object.entries(t).reduce((t,[n,i])=>Object.assign(Object.assign({},t),{[n]:s(r[n]||i,e)}),{})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeCosmoshubPath=void 0;const n=r(73);t.makeCosmoshubPath=function(e){return[n.Slip10RawIndex.hardened(44),n.Slip10RawIndex.hardened(118),n.Slip10RawIndex.hardened(0),n.Slip10RawIndex.normal(0),n.Slip10RawIndex.normal(e)]}},function(e,t,r){"use strict";function n(e){const{memo:t,msg:r,fee:n,signatures:i}=e;return"string"==typeof t&&Array.isArray(r)&&"object"==typeof n&&Array.isArray(i)}Object.defineProperty(t,"__esModule",{value:!0}),t.isWrappedStdTx=t.makeStdTx=t.isStdTx=void 0,t.isStdTx=n,t.makeStdTx=function(e,t){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(t)?t:[t]}},t.isWrappedStdTx=function(e){return"cosmos-sdk/StdTx"===e.type&&n(e.value)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=t.supportedAlgorithms=t.executeKdf=t.cosmjsSalt=void 0;const n=r(73),i=r(57);t.cosmjsSalt=i.toAscii("The CosmJS salt."),t.executeKdf=async function(e,r){switch(r.algorithm){case"argon2id":{const i=r.params;if(!n.isArgon2idOptions(i))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(e,t.cosmjsSalt,i)}default:throw new Error("Unsupported KDF algorithm")}},t.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"},t.encrypt=async function(e,r,i){switch(i.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...t,...await n.Xchacha20poly1305Ietf.encrypt(e,r,t)])}default:throw new Error(`Unsupported encryption algorithm: '${i.algorithm}'`)}},t.decrypt=async function(e,r,i){switch(i.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=e.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(e.slice(n.xchacha20NonceLength),r,t)}default:throw new Error(`Unsupported encryption algorithm: '${i.algorithm}'`)}}},function(e,t,r){"use strict";var n=r(82),i=r(765);e.exports=i((function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()}))},function(e,t,r){"use strict";var n=r(13).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,l=new Uint8Array(s);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var d=0,h=s-1;(0!==f||d>>0,l[h]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=d,r++}if(" "!==e[r]){for(var p=s-o;p!==s&&0===l[p];)p++;var m=n.allocUnsafe(i+(s-p));m.fill(0,0,i);for(var g=i;p!==s;)m[g++]=l[p++];return m}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var u=(s-o)*l+1>>>0,f=new Uint8Array(u);o!==s;){for(var d=t[o],h=0,p=u-1;(0!==d||h>>0,f[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");i=h,o++}for(var m=u-i;m!==u&&0===f[m];)m++;for(var g=c.repeat(r);m>>7)^(p<<14|p>>>18)^p>>>3,g=u[h-2],y=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[h]=m+u[h-7]+y+u[h-16]}var b=n&i^n&o^i&o,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&f)+c[h]+u[h];d=f,f=l,l=a,a=s+w|0,s=o,o=i,i=n,n=w+(v+b)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+f|0,r[7]=r[7]+d|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(l),t.HmacSHA256=o._createHmacHelper(l)}(Math),n.SHA256)},function(e,t,r){var n;e.exports=(n=r(19),r(198),function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,s=e.algo;function a(){return i.create.apply(i,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=a()}();var l=s.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],f=r[6],d=r[7],h=n.high,p=n.low,m=i.high,g=i.low,y=o.high,b=o.low,v=s.high,w=s.low,_=a.high,k=a.low,S=l.high,E=l.low,O=f.high,M=f.low,x=d.high,A=d.low,j=h,P=p,I=m,R=g,T=y,C=b,B=v,D=w,N=_,U=k,z=S,L=E,q=O,K=M,F=x,$=A,H=0;H<80;H++){var J,W,G=u[H];if(H<16)W=G.high=0|e[t+2*H],J=G.low=0|e[t+2*H+1];else{var V=u[H-15],Z=V.high,Y=V.low,X=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^Z>>>7,Q=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^(Y>>>7|Z<<25),ee=u[H-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=u[H-7],se=oe.high,ae=oe.low,ce=u[H-16],ue=ce.high,le=ce.low;W=(W=(W=X+se+((J=Q+ae)>>>0>>0?1:0))+ne+((J+=ie)>>>0>>0?1:0))+ue+((J+=le)>>>0>>0?1:0),G.high=W,G.low=J}var fe,de=N&z^~N&q,he=U&L^~U&K,pe=j&I^j&T^I&T,me=P&R^P&C^R&C,ge=(j>>>28|P<<4)^(j<<30|P>>>2)^(j<<25|P>>>7),ye=(P>>>28|j<<4)^(P<<30|j>>>2)^(P<<25|j>>>7),be=(N>>>14|U<<18)^(N>>>18|U<<14)^(N<<23|U>>>9),ve=(U>>>14|N<<18)^(U>>>18|N<<14)^(U<<23|N>>>9),we=c[H],_e=we.high,ke=we.low,Se=F+be+((fe=$+ve)>>>0<$>>>0?1:0),Ee=ye+me;F=q,$=K,q=z,K=L,z=N,L=U,N=B+(Se=(Se=(Se=Se+de+((fe+=he)>>>0>>0?1:0))+_e+((fe+=ke)>>>0>>0?1:0))+W+((fe+=J)>>>0>>0?1:0))+((U=D+fe|0)>>>0>>0?1:0)|0,B=T,D=C,T=I,C=R,I=j,R=P,j=Se+(ge+pe+(Ee>>>0>>0?1:0))+((P=fe+Ee|0)>>>0>>0?1:0)|0}p=n.low=p+P,n.high=h+j+(p>>>0

>>0?1:0),g=i.low=g+R,i.high=m+I+(g>>>0>>0?1:0),b=o.low=b+C,o.high=y+T+(b>>>0>>0?1:0),w=s.low=w+D,s.high=v+B+(w>>>0>>0?1:0),k=a.low=k+U,a.high=_+N+(k>>>0>>0?1:0),E=l.low=E+L,l.high=S+z+(E>>>0>>0?1:0),M=f.low=M+K,f.high=O+q+(M>>>0>>0?1:0),A=d.low=A+$,d.high=x+F+(A>>>0<$>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),n.SHA512)},,,,function(e,t,r){e.exports=r(805)(r(806))},,,,function(e,t,r){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}},function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,i){var o=n,s=i+r;e^=-1;for(var a=i;a>>8^o[255&(e^t[a])];return-1^e}},function(e,t,r){"use strict";var n=r(91),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function c(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},t.buf2binstring=function(e){return c(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4)u[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r1?u[n++]=65533:i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return c(u,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},function(e,t,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},,function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.PersistentMemoryService=void 0;const i=r(65);let o=class{constructor(){this.data={}}set(e){this.data=Object.assign(Object.assign({},this.data),e)}get(){return this.data}};o=n([i.singleton()],o),t.PersistentMemoryService=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="persistent-memory"},function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ChainsService=void 0;const a=r(65),c=r(75),u=r(464),l=r(35),f=r(465),d=r(123),h=r(199),p=r(8);let m=class{constructor(e,t,r,n){this.kvStore=e,this.embedChainInfos=t,this.chainUpdaterKeeper=r,this.interactionKeeper=n,this.onChainRemovedHandlers=[],this.getChainInfos=l.Debouncer.promise(()=>s(this,void 0,void 0,(function*(){var e;if(this.cachedChainInfos)return this.cachedChainInfos;const t=this.embedChainInfos.map(e=>Object.assign(Object.assign({},e),{embeded:!0})),r=new Map;for(const e of t)r.set(p.ChainIdHelper.parse(e.chainId).identifier,!0);const n=(null!==(e=yield this.kvStore.get("chain-infos"))&&void 0!==e?e:[]).filter(e=>!r.get(p.ChainIdHelper.parse(e.chainId).identifier)).map(e=>Object.assign(Object.assign({},e),{embeded:!1}));let i=t.concat(n);return i=yield Promise.all(i.map(e=>s(this,void 0,void 0,(function*(){const t=yield this.chainUpdaterKeeper.putUpdatedPropertyToChainInfo(e);return Object.assign(Object.assign({},t),{embeded:e.embeded})})))),this.cachedChainInfos=i,i})))}clearCachedChainInfos(){this.cachedChainInfos=void 0}getChainInfo(e){return s(this,void 0,void 0,(function*(){const t=(yield this.getChainInfos()).find(t=>p.ChainIdHelper.parse(t.chainId).identifier===p.ChainIdHelper.parse(e).identifier);if(!t)throw new Error("There is no chain info for "+e);return t}))}getChainCoinType(e){return s(this,void 0,void 0,(function*(){const t=yield this.getChainInfo(e);if(!t)throw new Error("There is no chain info for "+e);return t.bip44.coinType}))}hasChainInfo(e){return s(this,void 0,void 0,(function*(){return null!=(yield this.getChainInfos()).find(t=>p.ChainIdHelper.parse(t.chainId).identifier===p.ChainIdHelper.parse(e).identifier)}))}suggestChainInfo(e,t,r){return s(this,void 0,void 0,(function*(){t=yield u.ChainInfoSchema.validateAsync(t,{stripUnknown:!0}),yield this.interactionKeeper.waitApprove(e,"/suggest-chain",h.SuggestChainInfoMsg.type(),Object.assign(Object.assign({},t),{origin:r})),yield this.addChainInfo(t)}))}addChainInfo(e){var t;return s(this,void 0,void 0,(function*(){if(yield this.hasChainInfo(e.chainId))throw new Error("Same chain is already registered");const r=null!==(t=yield this.kvStore.get("chain-infos"))&&void 0!==t?t:[];r.push(e),yield this.kvStore.set("chain-infos",r),this.clearCachedChainInfos()}))}removeChainInfo(e){var t;return s(this,void 0,void 0,(function*(){if(!(yield this.hasChainInfo(e)))throw new Error("Chain is not registered");if((yield this.getChainInfo(e)).embeded)throw new Error("Can't remove the embedded chain");const r=(null!==(t=yield this.kvStore.get("chain-infos"))&&void 0!==t?t:[]).filter(t=>p.ChainIdHelper.parse(t.chainId).identifier!==p.ChainIdHelper.parse(e).identifier);yield this.kvStore.set("chain-infos",r),yield this.chainUpdaterKeeper.clearUpdatedProperty(e);for(const t of this.onChainRemovedHandlers)t(e,p.ChainIdHelper.parse(e).identifier);this.clearCachedChainInfos()}))}addChainRemovedHandler(e){this.onChainRemovedHandlers.push(e)}};m=n([a.singleton(),o(0,a.inject(c.TYPES.ChainsStore)),o(1,a.inject(c.TYPES.ChainsEmbedChainInfos)),o(2,a.inject(a.delay(()=>f.ChainUpdaterService))),o(3,a.inject(a.delay(()=>d.InteractionService))),i("design:paramtypes",[Object,Array,f.ChainUpdaterService,d.InteractionService])],m),t.ChainsService=m},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ChainInfoSchema=t.SuggestingBIP44Schema=t.Bech32ConfigSchema=t.Secret20CurrencyShema=t.CW20CurrencyShema=t.CurrencySchema=void 0;const i=n(r(837));t.CurrencySchema=i.default.object({coinDenom:i.default.string().required(),coinMinimalDenom:i.default.string().required(),coinDecimals:i.default.number().integer().min(0).max(18).required(),coinGeckoId:i.default.string(),coinImageUrl:i.default.string().uri()}),t.CW20CurrencyShema=t.CurrencySchema.keys({type:i.default.string().equal("cw20").required(),contractAddress:i.default.string().required()}).custom(e=>e.coinMinimalDenom.startsWith(`${e.type}:${e.contractAddress}:`)?e:Object.assign(Object.assign({},e),{coinMinimalDenom:`${e.type}:${e.contractAddress}:`+e.coinMinimalDenom})),t.Secret20CurrencyShema=t.CurrencySchema.keys({type:i.default.string().equal("secret20").required(),contractAddress:i.default.string().required(),viewingKey:i.default.string().required()}).custom(e=>e.coinMinimalDenom.startsWith(`${e.type}:${e.contractAddress}:`)?e:Object.assign(Object.assign({},e),{coinMinimalDenom:`${e.type}:${e.contractAddress}:`+e.coinMinimalDenom})),t.Bech32ConfigSchema=i.default.object({bech32PrefixAccAddr:i.default.string().required(),bech32PrefixAccPub:i.default.string().required(),bech32PrefixValAddr:i.default.string().required(),bech32PrefixValPub:i.default.string().required(),bech32PrefixConsAddr:i.default.string().required(),bech32PrefixConsPub:i.default.string().required()}),t.SuggestingBIP44Schema=i.default.object({coinType:i.default.number().integer().min(0).required()}).unknown(!0),t.ChainInfoSchema=i.default.object({rpc:i.default.string().required().uri(),rest:i.default.string().required().uri(),chainId:i.default.string().required().min(1).max(30),chainName:i.default.string().required().min(1).max(30),stakeCurrency:t.CurrencySchema.required(),walletUrl:i.default.string().uri(),walletUrlForStaking:i.default.string().uri(),bip44:t.SuggestingBIP44Schema.required(),bech32Config:t.Bech32ConfigSchema.required(),currencies:i.default.array().min(1).items(t.CurrencySchema,t.CW20CurrencyShema,t.Secret20CurrencyShema).required(),feeCurrencies:i.default.array().min(1).items(t.CurrencySchema).required(),coinType:i.default.number().integer(),beta:i.default.boolean(),gasPriceStep:i.default.object({low:i.default.number().required(),average:i.default.number().required(),high:i.default.number().required()}),features:i.default.array().items(i.default.string().valid("stargate","cosmwasm","secretwasm","ibc-transfer","no-legacy-stdTx","ibc-go")).unique().custom(e=>{if(e.indexOf("cosmwasm")>=0&&e.indexOf("secretwasm")>=0)throw new Error("cosmwasm and secretwasm are not compatible");return e})})},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(466),t),i(r(275),t)},function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ChainUpdaterService=void 0;const u=r(65),l=r(75),f=c(r(84)),d=r(8),h=r(92);let p=n=class{constructor(e,t){this.kvStore=e,this.chainsService=t}putUpdatedPropertyToChainInfo(e){var t,r;return a(this,void 0,void 0,(function*(){const n=yield this.getUpdatedChainProperty(e.chainId),i=d.ChainIdHelper.parse(e.chainId);if(d.ChainIdHelper.parse(n.chainId||e.chainId).version0){const n=yield this.getUpdatedChainProperty(r.chainId),o=null!==(t=n.features)&&void 0!==t?t:[];for(const e of i.features)o.includes(e)||o.push(e);yield this.saveChainProperty(e.identifier,{features:o})}}}))}getUpdatedChainProperty(e){return a(this,void 0,void 0,(function*(){const t=d.ChainIdHelper.parse(e);return yield this.loadChainProperty(t.identifier)}))}saveChainProperty(e,t){return a(this,void 0,void 0,(function*(){const r=yield this.loadChainProperty(e);yield this.kvStore.set(e,Object.assign(Object.assign({},r),t)),this.chainsService.clearCachedChainInfos()}))}loadChainProperty(e){return a(this,void 0,void 0,(function*(){const t=yield this.kvStore.get(e);return t||{}}))}static checkChainUpdate(e){return a(this,void 0,void 0,(function*(){const t=e.chainId;if(!d.ChainIdHelper.hasChainVersion(t))return{explicit:!1,slient:!1};const r=f.default.create({baseURL:e.rpc}),n=(yield r.get("/status")).data.result.node_info.network,i=d.ChainIdHelper.parse(t),o=d.ChainIdHelper.parse(n);if(i.identifier!==o.identifier)return{explicit:!1,slient:!1};const s=f.default.create({baseURL:e.rest});let a=!1;try{e.features&&e.features.includes("stargate")||(yield s.get("/cosmos/base/tendermint/v1beta1/node_info"),a=!0)}catch(e){}let c=!1;try{if((!e.features||!e.features.includes("ibc-go"))&&(a||e.features&&e.features.includes("stargate"))){200===(yield s.get("/ibc/apps/transfer/v1/params")).status&&(c=!0)}}catch(e){}let u=!1;try{if((!e.features||!e.features.includes("ibc-transfer"))&&(a||e.features&&e.features.includes("stargate"))){const t=c||e.features&&e.features.includes("ibc-go"),r=yield s.get(t?"/ibc/apps/transfer/v1/params":"/ibc/applications/transfer/v1beta1/params");r.data.params.receive_enabled&&r.data.params.send_enabled&&(u=!0)}}catch(e){}let l=!1;try{if((!e.features||!e.features.includes("no-legacy-stdTx"))&&(a||e.features&&e.features.includes("stargate"))){const e=yield s.post("/txs",void 0,{validateStatus:e=>e>=200&&e<300||501===e});501===e.status&&12===e.data.code&&"Not Implemented"===e.data.message&&(l=!0)}}catch(e){}const h=[];return a&&h.push("stargate"),c&&h.push("ibc-go"),u&&h.push("ibc-transfer"),l&&h.push("no-legacy-stdTx"),{explicit:i.versionh.ChainsService))),o("design:paramtypes",[Object,h.ChainsService])],p),t.ChainUpdaterService=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="chains"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="chain-updator"},function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.InteractionService=void 0;const a=r(65),c=r(75),u=r(470);let l=class{constructor(e,t){this.eventMsgRequester=e,this.rng=t,this.waitingMap=new Map,this.resolverMap=new Map}dispatchEvent(e,t,r){if(!t)throw new Error("Type should not be empty");const n=new u.PushEventDataMsg({type:t,data:r});this.eventMsgRequester.sendMessage(e,n).catch(t=>{console.log(`Failed to send the event to ${e}: ${t.message}`)})}waitApprove(e,t,r,n,i){return s(this,void 0,void 0,(function*(){if(!r)throw new Error("Type should not be empty");const o=yield this.addDataToMap(r,e.isInternalMsg,n),s=new u.PushInteractionDataMsg(o);return yield this.wait(s.data.id,()=>{e.requestInteraction(t,s,i)})}))}wait(e,t){return s(this,void 0,void 0,(function*(){if(this.resolverMap.has(e))throw new Error("Id is aleady in use");return new Promise((r,n)=>{this.resolverMap.set(e,{onApprove:r,onReject:n}),t()})}))}approve(e,t){this.resolverMap.has(e)&&(this.resolverMap.get(e).onApprove(t),this.resolverMap.delete(e)),this.removeDataFromMap(e)}reject(e){this.resolverMap.has(e)&&(this.resolverMap.get(e).onReject(new Error("Request rejected")),this.resolverMap.delete(e)),this.removeDataFromMap(e)}addDataToMap(e,t,r){return s(this,void 0,void 0,(function*(){const n=new Uint8Array(8),i=Array.from(yield this.rng(n)).map(e=>e.toString(16)).join(""),o={id:i,type:e,isInternal:t,data:r};if(this.waitingMap.has(i))throw new Error("Id is aleady in use");return this.waitingMap.set(i,o),o}))}removeDataFromMap(e){this.waitingMap.delete(e)}};l=n([a.singleton(),o(0,a.inject(c.TYPES.EventMsgRequester)),o(1,a.inject(c.TYPES.RNG)),i("design:paramtypes",[Object,Function])],l),t.InteractionService=l},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(838),t),i(r(276),t),i(r(839),t),i(r(840),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="interaction-foreground"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="interaction"},function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LedgerService=void 0;const c=r(65),u=r(75),l=r(474),f=a(r(316)),d=r(18),h=r(123),p=r(2);let m=class{constructor(e,t,r){var n;this.kvStore=e,this.interactionService=t,this.options={defaultMode:r.defaultMode||"webusb",transportIniters:null!==(n=r.transportIniters)&&void 0!==n?n:{}},this.options.transportIniters.webusb||(this.options.transportIniters.webusb=l.LedgerWebUSBIniter),this.options.transportIniters.webhid||(this.options.transportIniters.webhid=l.LedgerWebHIDIniter)}getPublicKey(e,t){return s(this,void 0,void 0,(function*(){return yield this.useLedger(e,(e,r)=>s(this,void 0,void 0,(function*(){try{return yield e.getPublicKey([44,118,t.account,t.change,t.addressIndex])}finally{r>0&&this.interactionService.dispatchEvent(d.APP_PORT,"ledger-init",{event:"get-pubkey",success:!0})}})))}))}sign(e,t,r,n){return s(this,void 0,void 0,(function*(){return yield this.useLedger(e,(e,i)=>s(this,void 0,void 0,(function*(){try{const o=yield e.getPublicKey([44,118,t.account,t.change,t.addressIndex]);if(p.Buffer.from(r).toString("hex")!==p.Buffer.from(o).toString("hex"))throw new Error("Unmatched public key");const s=yield e.sign([44,118,t.account,t.change,t.addressIndex],n);return i>0&&this.interactionService.dispatchEvent(d.APP_PORT,"ledger-init",{event:"sign",success:!0}),s}catch(e){throw i>0&&this.interactionService.dispatchEvent(d.APP_PORT,"ledger-init",{event:"sign",success:!1}),e}})))}))}useLedger(e,t){return s(this,void 0,void 0,(function*(){let r;try{return r=yield this.initLedger(e),yield t(r.ledger,r.retryCount)}finally{r&&(yield r.ledger.close())}}))}initLedger(e){return s(this,void 0,void 0,(function*(){this.previousInitAborter&&this.previousInitAborter(new Error("New ledger request occurred before the ledger was initialized"));const t=(()=>{let e;return{wait:()=>new Promise((t,r)=>{e=r}),abort:t=>{e&&e(t)}}})();this.previousInitAborter=t.abort;let r=0,n=[];for(;;){const i=yield this.getMode();try{const e=this.options.transportIniters[i];if(!e)throw new Error("Unknown mode: "+i);const t=yield l.Ledger.init(e,n);return this.previousInitAborter=void 0,{ledger:t,retryCount:r}}catch(r){console.log(r);const o=new AbortController;try{const r=[(()=>s(this,void 0,void 0,(function*(){const t=yield this.interactionService.waitApprove(e,"/ledger-grant","ledger-init",{event:"init-failed",mode:i},{forceOpenWindow:!0,channel:"ledger"});if(null==t?void 0:t.abort)throw new Error("Ledger init aborted");(null==t?void 0:t.initArgs)&&(n=t.initArgs)})))()];r.push((()=>s(this,void 0,void 0,(function*(){let e=!1;try{yield f.default(3e5,{signal:o.signal})}catch(t){if("AbortError"!==t.name)throw t;e=!0}if(!e)throw this.interactionService.dispatchEvent(d.APP_PORT,"ledger-init",{event:"init-aborted",mode:i}),new Error("Ledger init timeout")})))()),r.push(t.wait()),"undefined"!=typeof browser&&r.push(this.testLedgerGrantUIOpened()),yield Promise.race(r)}finally{o.abort()}}r++}}))}testLedgerGrantUIOpened(){return s(this,void 0,void 0,(function*(){for(yield f.default(1e3);;){const e=browser.extension.getViews();let t=!1;for(const r of e)if(r.location.href.includes(browser.runtime.getURL("popup.html#/ledger-grant"))){t=!0;break}if(!t)throw new Error("Ledger init aborted");yield f.default(1e3)}}))}getMode(){return s(this,void 0,void 0,(function*(){return(yield this.getWebHIDFlag())?"webhid":this.options.defaultMode}))}getWebHIDFlag(){return s(this,void 0,void 0,(function*(){return!!(yield this.kvStore.get("webhid"))}))}setWebHIDFlag(e){return s(this,void 0,void 0,(function*(){yield this.kvStore.set("webhid",e)}))}};m=n([c.singleton(),o(0,c.inject(u.TYPES.LedgerStore)),o(1,c.inject(c.delay(()=>h.InteractionService))),o(2,c.inject(u.TYPES.LedgerOptions)),i("design:paramtypes",[Object,h.InteractionService,Object])],m),t.LedgerService=m},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Ledger=t.LedgerInitError=t.LedgerWebHIDIniter=t.LedgerWebUSBIniter=t.LedgerInitErrorOn=void 0;const o=r(846).default,s=i(r(852)),a=i(r(879)),c=r(451);var u;!function(e){e[e.Transport=0]="Transport",e[e.App=1]="App",e[e.Unknown=2]="Unknown"}(u=t.LedgerInitErrorOn||(t.LedgerInitErrorOn={}));t.LedgerWebUSBIniter=()=>n(void 0,void 0,void 0,(function*(){return yield a.default.create()}));t.LedgerWebHIDIniter=()=>n(void 0,void 0,void 0,(function*(){return yield s.default.create()}));class l extends Error{constructor(e,t){super(t),this.errorOn=e,Object.setPrototypeOf(this,l.prototype)}}t.LedgerInitError=l;class f{constructor(e){this.cosmosApp=e}static init(e,t=[]){return n(this,void 0,void 0,(function*(){const r=yield e(...t);try{const e=new o(r),t=new f(e);if((yield t.getVersion()).deviceLocked)throw new Error("Device is on screen saver");return t}catch(e){if(r&&(yield r.close()),"Device is on screen saver"===e.message)throw new l(u.Transport,e.message);throw new l(u.App,e.message)}}))}getVersion(){return n(this,void 0,void 0,(function*(){if(!this.cosmosApp)throw new Error("Comsos App not initialized");const e=yield this.cosmosApp.getVersion();if("No errors"!==e.error_message)throw new Error(e.error_message);return{deviceLocked:e.device_locked,major:e.major,minor:e.minor,patch:e.patch,targetId:e.target_id,testMode:e.test_mode}}))}getPublicKey(e){return n(this,void 0,void 0,(function*(){if(!this.cosmosApp)throw new Error("Comsos App not initialized");const t=yield this.cosmosApp.publicKey(e);if("No errors"!==t.error_message)throw new Error(t.error_message);return t.compressed_pk}))}sign(e,t){return n(this,void 0,void 0,(function*(){if(!this.cosmosApp)throw new Error("Comsos App not initialized");const r=yield this.cosmosApp.sign(e,t);if("No errors"!==r.error_message)throw new Error(r.error_message);return c.signatureImport(r.signature)}))}close(){return n(this,void 0,void 0,(function*(){return yield this.cosmosApp.transport.close()}))}static isWebHIDSupported(){return n(this,void 0,void 0,(function*(){return yield s.default.isSupported()}))}}t.Ledger=f},function(e,t,r){"use strict";(function(e){var n=r(180);Object.defineProperty(t,"__esModule",{value:!0}),t.serializePathv1=function(t){if(null==t||t.length<3)throw new Error("Invalid path.");if(t.length>10)throw new Error("Invalid path. Length should be <= 10");var r=e.alloc(1+4*t.length);r.writeUInt8(t.length,0);for(var n=0;n2&&(i=e.slice(0,e.length-2)),{signature:i,return_code:r,error_message:n}}),s.processErrorResponse));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(t){if(65!==t.length)throw new Error("decompressed public key length should be 65 bytes");var r=t.slice(33,65),n=e.from([2+(1&r[r.length-1])]);return e.concat([n,t.slice(1,33)])}function u(){return(u=(0,o.default)(i.default.mark((function t(r,n){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.transport.send(s.CLA,s.INS.INS_PUBLIC_KEY_SECP256K1,0,0,n,[s.ERROR_CODE.NoError]).then((function(t){var r=t.slice(-2),n=256*r[0]+r[1],i=e.from(t.slice(0,65));return{pk:i,compressed_pk:c(i),return_code:n,error_message:(0,s.errorCodeToString)(n)}}),s.processErrorResponse));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}).call(this,r(2).Buffer)},function(e,t,r){const n=r(62);e.exports=(e,t,r)=>0!==n(e,t,r)},function(e,t,r){const n=r(280),i=r(476),o=r(205),s=r(283),a=r(282),c=r(284);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return i(e,r,u);case">":return o(e,r,u);case">=":return s(e,r,u);case"<":return a(e,r,u);case"<=":return c(e,r,u);default:throw new TypeError("Invalid operator: "+t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="ledger"},function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyRingService=void 0;const a=r(65),c=r(75),u=r(287),l=r(8),f=r(92),d=r(484),h=r(18),p=r(123),m=r(165),g=r(137),y=r(887),b=r(8),v=r(2);let w=class{constructor(e,t,r,n,i,o,s,a){this.interactionService=r,this.chainsService=n,this.permissionService=i,this.rng=s,this.crypto=a,this.keyRing=new u.KeyRing(t,e,o,s,a)}restore(){return s(this,void 0,void 0,(function*(){return yield this.keyRing.restore(),{status:this.keyRing.status,multiKeyStoreInfo:this.keyRing.getMultiKeyStoreInfo()}}))}enable(e){return s(this,void 0,void 0,(function*(){if(this.keyRing.status===u.KeyRingStatus.EMPTY)throw new Error("key doesn't exist");return this.keyRing.status===u.KeyRingStatus.NOTLOADED&&(yield this.keyRing.restore()),this.keyRing.status===u.KeyRingStatus.LOCKED?(yield this.interactionService.waitApprove(e,"/unlock","unlock",{}),this.keyRing.status):this.keyRing.status}))}get keyRingStatus(){return this.keyRing.status}deleteKeyRing(e,t){return s(this,void 0,void 0,(function*(){let r=!1;try{const n=yield this.keyRing.deleteKeyRing(e,t);return r=n.keyStoreChanged,{multiKeyStoreInfo:n.multiKeyStoreInfo,status:this.keyRing.status}}finally{r&&this.interactionService.dispatchEvent(h.WEBPAGE_PORT,"keystore-changed",{})}}))}updateNameKeyRing(e,t){return s(this,void 0,void 0,(function*(){return{multiKeyStoreInfo:yield this.keyRing.updateNameKeyRing(e,t)}}))}showKeyRing(e,t){return s(this,void 0,void 0,(function*(){return yield this.keyRing.showKeyRing(e,t)}))}createMnemonicKey(e,t,r,n,i){return s(this,void 0,void 0,(function*(){return yield this.keyRing.createMnemonicKey(e,t,r,n,i)}))}createPrivateKey(e,t,r,n){return s(this,void 0,void 0,(function*(){return yield this.keyRing.createPrivateKey(e,t,r,n)}))}createLedgerKey(e,t,r,n,i){return s(this,void 0,void 0,(function*(){return yield this.keyRing.createLedgerKey(e,t,r,n,i)}))}lock(){return this.keyRing.lock(),this.keyRing.status}unlock(e){return s(this,void 0,void 0,(function*(){return yield this.keyRing.unlock(e),this.keyRing.status}))}getKey(e){return s(this,void 0,void 0,(function*(){return this.keyRing.getKey(e,yield this.chainsService.getChainCoinType(e))}))}getKeyStoreMeta(e){return this.keyRing.getKeyStoreMeta(e)}getKeyRingType(){return this.keyRing.type}requestSignAmino(e,t,r,n,i,o){return s(this,void 0,void 0,(function*(){const s=yield this.chainsService.getChainCoinType(r),a=yield this.keyRing.getKey(r,s),c=(yield this.chainsService.getChainInfo(r)).bech32Config.bech32PrefixAccAddr,u=new l.Bech32Address(a.address).toBech32(c);if(n!==u)throw new Error("Signer mismatched");const f=l.checkAndValidateADR36AminoSignDoc(i,c);if(f&&i.msgs[0].value.signer!==n)throw new Error("Unmatched signer in sign doc");if(null!=o.isADR36WithString&&!f)throw new Error('Sign doc is not for ADR-36. But, "isADR36WithString" option is defined');const d=yield this.interactionService.waitApprove(e,"/sign","request-sign",{msgOrigin:t,chainId:r,mode:"amino",signDoc:i,signer:n,signOptions:o,isADR36SignDoc:f,isADR36WithString:o.isADR36WithString});if(f){if(!l.checkAndValidateADR36AminoSignDoc(i,c))throw new Error("Signing request was for ADR-36. But, accidentally, new sign doc is not for ADR-36");if(i.msgs[0].value.signer!==n)throw new Error("Unmatched signer in new sign doc")}try{const t=yield this.keyRing.sign(e,r,s,g.serializeSignDoc(d));return{signed:d,signature:g.encodeSecp256k1Signature(a.pubKey,t)}}finally{this.interactionService.dispatchEvent(h.APP_PORT,"request-sign-end",{})}}))}requestSignDirect(e,t,r,n,i,o){return s(this,void 0,void 0,(function*(){const s=yield this.chainsService.getChainCoinType(r),a=yield this.keyRing.getKey(r,s),c=new l.Bech32Address(a.address).toBech32((yield this.chainsService.getChainInfo(r)).bech32Config.bech32PrefixAccAddr);if(n!==c)throw new Error("Signer mismatched");const u=yield this.interactionService.waitApprove(e,"/sign","request-sign",{msgOrigin:t,chainId:r,mode:"direct",signDocBytes:b.cosmos.tx.v1beta1.SignDoc.encode(i).finish(),signer:n,signOptions:o}),f=b.cosmos.tx.v1beta1.SignDoc.decode(u);try{const t=yield this.keyRing.sign(e,r,s,y.makeSignBytes(f));return{signed:f,signature:g.encodeSecp256k1Signature(a.pubKey,t)}}finally{this.interactionService.dispatchEvent(h.APP_PORT,"request-sign-end",{})}}))}verifyADR36AminoSignDoc(e,t,r,n){return s(this,void 0,void 0,(function*(){const i=yield this.chainsService.getChainCoinType(e),o=yield this.keyRing.getKey(e,i),s=(yield this.chainsService.getChainInfo(e)).bech32Config.bech32PrefixAccAddr,a=new l.Bech32Address(o.address).toBech32(s);if(t!==a)throw new Error("Signer mismatched");if("tendermint/PubKeySecp256k1"!==n.pub_key.type)throw new Error("Unsupported type of pub key: "+n.pub_key.type);if(v.Buffer.from(o.pubKey).toString("base64")!==n.pub_key.value)throw new Error("Pub key unmatched");const c=l.makeADR36AminoSignDoc(t,r);return l.verifyADR36AminoSignDoc(s,c,v.Buffer.from(n.pub_key.value,"base64"),v.Buffer.from(n.signature,"base64"))}))}sign(e,t,r){return s(this,void 0,void 0,(function*(){return this.keyRing.sign(e,t,yield this.chainsService.getChainCoinType(t),r)}))}addMnemonicKey(e,t,r,n){return s(this,void 0,void 0,(function*(){return this.keyRing.addMnemonicKey(e,t,r,n)}))}addPrivateKey(e,t,r){return s(this,void 0,void 0,(function*(){return this.keyRing.addPrivateKey(e,t,r)}))}addLedgerKey(e,t,r,n){return s(this,void 0,void 0,(function*(){return this.keyRing.addLedgerKey(e,t,r,n)}))}changeKeyStoreFromMultiKeyStore(e){return s(this,void 0,void 0,(function*(){try{return yield this.keyRing.changeKeyStoreFromMultiKeyStore(e)}finally{this.interactionService.dispatchEvent(h.WEBPAGE_PORT,"keystore-changed",{})}}))}checkPassword(e){return this.keyRing.checkPassword(e)}getMultiKeyStoreInfo(){return this.keyRing.getMultiKeyStoreInfo()}isKeyStoreCoinTypeSet(e){return this.keyRing.isKeyStoreCoinTypeSet(e)}setKeyStoreCoinType(e,t){return s(this,void 0,void 0,(function*(){const r=this.keyRing.computeKeyStoreCoinType(e,yield this.chainsService.getChainCoinType(e));yield this.keyRing.setKeyStoreCoinType(e,t),r!==t&&this.interactionService.dispatchEvent(h.WEBPAGE_PORT,"keystore-changed",{})}))}getKeyStoreBIP44Selectables(e,t){return s(this,void 0,void 0,(function*(){if(this.isKeyStoreCoinTypeSet(e))return[];const r=[],n=yield this.chainsService.getChainInfo(e);for(const e of t){const t=yield this.keyRing.getKeyFromCoinType(e.coinType),i=new l.Bech32Address(t.address).toBech32(n.bech32Config.bech32PrefixAccAddr);r.push({path:e,bech32Address:i})}return r}))}exportKeyRingDatas(e){return s(this,void 0,void 0,(function*(){return yield this.keyRing.exportKeyRingDatas(e)}))}};w=n([a.singleton(),o(0,a.inject(c.TYPES.KeyRingStore)),o(1,a.inject(c.TYPES.ChainsEmbedChainInfos)),o(2,a.inject(a.delay(()=>p.InteractionService))),o(3,a.inject(a.delay(()=>f.ChainsService))),o(4,a.inject(a.delay(()=>m.PermissionService))),o(5,a.inject(d.LedgerService)),o(6,a.inject(c.TYPES.RNG)),o(7,a.inject(c.TYPES.CommonCrypto)),i("design:paramtypes",[Object,Array,p.InteractionService,f.ChainsService,m.PermissionService,d.LedgerService,Function,Object])],w),t.KeyRingService=w},function(e,t){var r=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>r||t!=t)throw new TypeError("Bad key length")}},function(e,t,r){(function(t,r){var n;if(t.process&&t.process.browser)n="utf-8";else if(t.process&&t.process.version){n=parseInt(r.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";e.exports=n}).call(this,r(15),r(17))},function(e,t,r){var n=r(246),i=r(103),o=r(93),s=r(13).Buffer,a=r(480),c=r(481),u=r(483),l=s.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,r){var a=function(e){function t(t){return o(e).update(t).digest()}return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:t}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=a(t):t.length=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionService=void 0;const a=r(65),c=r(75),u=r(123),l=r(486),f=r(92),d=r(166),h=r(8);let p=class{constructor(e,t,r,n,i){this.kvStore=e,this.interactionService=t,this.chainsService=r,this.keyRingService=n,this.permissionMap={},this.privilegedOrigins=new Map,this.onChainRemoved=e=>{this.removeAllPermissions(e)};for(const e of i)this.privilegedOrigins.set(e,!0);this.restore(),this.chainsService.addChainRemovedHandler(this.onChainRemoved)}checkOrGrantBasicAccessPermission(e,t,r){return s(this,void 0,void 0,(function*(){yield this.keyRingService.enable(e),"string"==typeof t&&(t=[t]);const n=[];for(const e of t)this.hasPermisson(e,l.getBasicAccessPermissionType(),r)||n.push(e);n.length>0&&(yield this.grantBasicAccessPermission(e,n,[r])),yield this.checkBasicAccessPermission(e,t,r)}))}grantPermission(e,t,r,n,i){return s(this,void 0,void 0,(function*(){if(e.isInternalMsg)return;const o={chainIds:r,type:n,origins:i};yield this.interactionService.waitApprove(e,t,l.INTERACTION_TYPE_PERMISSION,o),yield this.addPermission(r,n,i)}))}grantBasicAccessPermission(e,t,r){return s(this,void 0,void 0,(function*(){for(const e of t)yield this.chainsService.getChainInfo(e);yield this.grantPermission(e,"/access",t,l.getBasicAccessPermissionType(),r)}))}checkPermission(e,t,r,n){if(!e.isInternalMsg&&!this.hasPermisson(t,r,n))throw new Error(n+" is not permitted")}checkBasicAccessPermission(e,t,r){return s(this,void 0,void 0,(function*(){for(const n of t)yield this.chainsService.getChainInfo(n),this.checkPermission(e,n,l.getBasicAccessPermissionType(),r)}))}hasPermisson(e,t,r){if(this.privilegedOrigins.get(r))return!0;const n=this.permissionMap[h.ChainIdHelper.parse(e).identifier];if(!n)return!1;const i=n[t];return!(!i||!i[r])}getPermissionOrigins(e,t){const r=[],n=this.permissionMap[h.ChainIdHelper.parse(e).identifier];if(!n)return[];const i=n[t];if(!i)return[];for(const e of Object.keys(i))i[e]&&r.push(e);return r}getOriginPermittedChains(e,t){var r;const n=[];for(const i of Object.keys(this.permissionMap)){const o=this.permissionMap[i],s=null!==(r=o?o[t]:void 0)&&void 0!==r?r:{};for(const t of Object.keys(s))t===e&&s[t]&&n.push(i)}return n}addPermission(e,t,r){return s(this,void 0,void 0,(function*(){for(const n of e){let e=this.permissionMap[h.ChainIdHelper.parse(n).identifier];e||(e={},this.permissionMap[h.ChainIdHelper.parse(n).identifier]=e);let i=e[t];i||(i={},e[t]=i);for(const e of r)i[e]=!0}yield this.save()}))}removePermission(e,t,r){return s(this,void 0,void 0,(function*(){const n=this.permissionMap[h.ChainIdHelper.parse(e).identifier];if(!n)return;const i=n[t];if(i){for(const e of r)delete i[e];yield this.save()}}))}removeAllPermissions(e){return s(this,void 0,void 0,(function*(){this.permissionMap[h.ChainIdHelper.parse(e).identifier]=void 0,yield this.save()}))}restore(){return s(this,void 0,void 0,(function*(){const e=yield this.kvStore.get("permissionMap");e&&(this.permissionMap=e)}))}save(){return s(this,void 0,void 0,(function*(){yield this.kvStore.set("permissionMap",this.permissionMap)}))}};p=n([a.singleton(),o(0,a.inject(c.TYPES.PermissionStore)),o(1,a.inject(a.delay(()=>u.InteractionService))),o(2,a.inject(f.ChainsService)),o(3,a.inject(a.delay(()=>d.KeyRingService))),o(4,a.inject(c.TYPES.PermissionServicePrivilegedOrigins)),i("design:paramtypes",[Object,u.InteractionService,f.ChainsService,d.KeyRingService,Array])],p),t.PermissionService=p},function(e,t,r){"use strict";function n(){return"basic-access"}Object.defineProperty(t,"__esModule",{value:!0}),t.isBasicAccessPermissionType=t.getBasicAccessPermissionType=t.INTERACTION_TYPE_PERMISSION=void 0,t.INTERACTION_TYPE_PERMISSION="permission",t.getBasicAccessPermissionType=n,t.isBasicAccessPermissionType=function(e){return"basic-access"===e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="keyring"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="permission"},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fee=t.ModeInfo_Multi=t.ModeInfo_Single=t.ModeInfo=t.SignerInfo=t.AuthInfo=t.TxBody=t.SignDoc=t.TxRaw=t.Tx=t.protobufPackage=void 0;const i=n(r(60)),o=r(209),s=r(490),a=r(491),c=r(208),u=n(r(72));t.protobufPackage="cosmos.tx.v1beta1";const l={};t.Tx={encode(e,r=u.default.Writer.create()){void 0!==e.body&&void 0!==e.body&&t.TxBody.encode(e.body,r.uint32(10).fork()).ldelim(),void 0!==e.authInfo&&void 0!==e.authInfo&&t.AuthInfo.encode(e.authInfo,r.uint32(18).fork()).ldelim();for(const t of e.signatures)r.uint32(26).bytes(t);return r},decode(e,r){const n=e instanceof Uint8Array?new u.default.Reader(e):e;let i=void 0===r?n.len:n.pos+r;const o=Object.assign({},l);for(o.signatures=[];n.pos>>3){case 1:o.body=t.TxBody.decode(n,n.uint32());break;case 2:o.authInfo=t.AuthInfo.decode(n,n.uint32());break;case 3:o.signatures.push(n.bytes());break;default:n.skipType(7&e)}}return o},fromJSON(e){const r=Object.assign({},l);if(r.signatures=[],void 0!==e.body&&null!==e.body?r.body=t.TxBody.fromJSON(e.body):r.body=void 0,void 0!==e.authInfo&&null!==e.authInfo?r.authInfo=t.AuthInfo.fromJSON(e.authInfo):r.authInfo=void 0,void 0!==e.signatures&&null!==e.signatures)for(const t of e.signatures)r.signatures.push(k(t));return r},fromPartial(e){const r=Object.assign({},l);if(r.signatures=[],void 0!==e.body&&null!==e.body?r.body=t.TxBody.fromPartial(e.body):r.body=void 0,void 0!==e.authInfo&&null!==e.authInfo?r.authInfo=t.AuthInfo.fromPartial(e.authInfo):r.authInfo=void 0,void 0!==e.signatures&&null!==e.signatures)for(const t of e.signatures)r.signatures.push(t);return r},toJSON(e){const r={};return void 0!==e.body&&(r.body=e.body?t.TxBody.toJSON(e.body):void 0),void 0!==e.authInfo&&(r.authInfo=e.authInfo?t.AuthInfo.toJSON(e.authInfo):void 0),e.signatures?r.signatures=e.signatures.map(e=>E(void 0!==e?e:new Uint8Array)):r.signatures=[],r}};const f={};t.TxRaw={encode(e,t=u.default.Writer.create()){t.uint32(10).bytes(e.bodyBytes),t.uint32(18).bytes(e.authInfoBytes);for(const r of e.signatures)t.uint32(26).bytes(r);return t},decode(e,t){const r=e instanceof Uint8Array?new u.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},f);for(i.signatures=[];r.pos>>3){case 1:i.bodyBytes=r.bytes();break;case 2:i.authInfoBytes=r.bytes();break;case 3:i.signatures.push(r.bytes());break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},f);if(t.signatures=[],void 0!==e.bodyBytes&&null!==e.bodyBytes&&(t.bodyBytes=k(e.bodyBytes)),void 0!==e.authInfoBytes&&null!==e.authInfoBytes&&(t.authInfoBytes=k(e.authInfoBytes)),void 0!==e.signatures&&null!==e.signatures)for(const r of e.signatures)t.signatures.push(k(r));return t},fromPartial(e){const t=Object.assign({},f);if(t.signatures=[],void 0!==e.bodyBytes&&null!==e.bodyBytes?t.bodyBytes=e.bodyBytes:t.bodyBytes=new Uint8Array,void 0!==e.authInfoBytes&&null!==e.authInfoBytes?t.authInfoBytes=e.authInfoBytes:t.authInfoBytes=new Uint8Array,void 0!==e.signatures&&null!==e.signatures)for(const r of e.signatures)t.signatures.push(r);return t},toJSON(e){const t={};return void 0!==e.bodyBytes&&(t.bodyBytes=E(void 0!==e.bodyBytes?e.bodyBytes:new Uint8Array)),void 0!==e.authInfoBytes&&(t.authInfoBytes=E(void 0!==e.authInfoBytes?e.authInfoBytes:new Uint8Array)),e.signatures?t.signatures=e.signatures.map(e=>E(void 0!==e?e:new Uint8Array)):t.signatures=[],t}};const d={chainId:"",accountNumber:i.default.UZERO};t.SignDoc={encode:(e,t=u.default.Writer.create())=>(t.uint32(10).bytes(e.bodyBytes),t.uint32(18).bytes(e.authInfoBytes),t.uint32(26).string(e.chainId),t.uint32(32).uint64(e.accountNumber),t),decode(e,t){const r=e instanceof Uint8Array?new u.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},d);for(;r.pos>>3){case 1:i.bodyBytes=r.bytes();break;case 2:i.authInfoBytes=r.bytes();break;case 3:i.chainId=r.string();break;case 4:i.accountNumber=r.uint64();break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},d);return void 0!==e.bodyBytes&&null!==e.bodyBytes&&(t.bodyBytes=k(e.bodyBytes)),void 0!==e.authInfoBytes&&null!==e.authInfoBytes&&(t.authInfoBytes=k(e.authInfoBytes)),void 0!==e.chainId&&null!==e.chainId?t.chainId=String(e.chainId):t.chainId="",void 0!==e.accountNumber&&null!==e.accountNumber?t.accountNumber=i.default.fromString(e.accountNumber):t.accountNumber=i.default.UZERO,t},fromPartial(e){const t=Object.assign({},d);return void 0!==e.bodyBytes&&null!==e.bodyBytes?t.bodyBytes=e.bodyBytes:t.bodyBytes=new Uint8Array,void 0!==e.authInfoBytes&&null!==e.authInfoBytes?t.authInfoBytes=e.authInfoBytes:t.authInfoBytes=new Uint8Array,void 0!==e.chainId&&null!==e.chainId?t.chainId=e.chainId:t.chainId="",void 0!==e.accountNumber&&null!==e.accountNumber?t.accountNumber=e.accountNumber:t.accountNumber=i.default.UZERO,t},toJSON(e){const t={};return void 0!==e.bodyBytes&&(t.bodyBytes=E(void 0!==e.bodyBytes?e.bodyBytes:new Uint8Array)),void 0!==e.authInfoBytes&&(t.authInfoBytes=E(void 0!==e.authInfoBytes?e.authInfoBytes:new Uint8Array)),void 0!==e.chainId&&(t.chainId=e.chainId),void 0!==e.accountNumber&&(t.accountNumber=(e.accountNumber||i.default.UZERO).toString()),t}};const h={memo:"",timeoutHeight:i.default.UZERO};t.TxBody={encode(e,t=u.default.Writer.create()){for(const r of e.messages)o.Any.encode(r,t.uint32(10).fork()).ldelim();t.uint32(18).string(e.memo),t.uint32(24).uint64(e.timeoutHeight);for(const r of e.extensionOptions)o.Any.encode(r,t.uint32(8186).fork()).ldelim();for(const r of e.nonCriticalExtensionOptions)o.Any.encode(r,t.uint32(16378).fork()).ldelim();return t},decode(e,t){const r=e instanceof Uint8Array?new u.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},h);for(i.messages=[],i.extensionOptions=[],i.nonCriticalExtensionOptions=[];r.pos>>3){case 1:i.messages.push(o.Any.decode(r,r.uint32()));break;case 2:i.memo=r.string();break;case 3:i.timeoutHeight=r.uint64();break;case 1023:i.extensionOptions.push(o.Any.decode(r,r.uint32()));break;case 2047:i.nonCriticalExtensionOptions.push(o.Any.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},h);if(t.messages=[],t.extensionOptions=[],t.nonCriticalExtensionOptions=[],void 0!==e.messages&&null!==e.messages)for(const r of e.messages)t.messages.push(o.Any.fromJSON(r));if(void 0!==e.memo&&null!==e.memo?t.memo=String(e.memo):t.memo="",void 0!==e.timeoutHeight&&null!==e.timeoutHeight?t.timeoutHeight=i.default.fromString(e.timeoutHeight):t.timeoutHeight=i.default.UZERO,void 0!==e.extensionOptions&&null!==e.extensionOptions)for(const r of e.extensionOptions)t.extensionOptions.push(o.Any.fromJSON(r));if(void 0!==e.nonCriticalExtensionOptions&&null!==e.nonCriticalExtensionOptions)for(const r of e.nonCriticalExtensionOptions)t.nonCriticalExtensionOptions.push(o.Any.fromJSON(r));return t},fromPartial(e){const t=Object.assign({},h);if(t.messages=[],t.extensionOptions=[],t.nonCriticalExtensionOptions=[],void 0!==e.messages&&null!==e.messages)for(const r of e.messages)t.messages.push(o.Any.fromPartial(r));if(void 0!==e.memo&&null!==e.memo?t.memo=e.memo:t.memo="",void 0!==e.timeoutHeight&&null!==e.timeoutHeight?t.timeoutHeight=e.timeoutHeight:t.timeoutHeight=i.default.UZERO,void 0!==e.extensionOptions&&null!==e.extensionOptions)for(const r of e.extensionOptions)t.extensionOptions.push(o.Any.fromPartial(r));if(void 0!==e.nonCriticalExtensionOptions&&null!==e.nonCriticalExtensionOptions)for(const r of e.nonCriticalExtensionOptions)t.nonCriticalExtensionOptions.push(o.Any.fromPartial(r));return t},toJSON(e){const t={};return e.messages?t.messages=e.messages.map(e=>e?o.Any.toJSON(e):void 0):t.messages=[],void 0!==e.memo&&(t.memo=e.memo),void 0!==e.timeoutHeight&&(t.timeoutHeight=(e.timeoutHeight||i.default.UZERO).toString()),e.extensionOptions?t.extensionOptions=e.extensionOptions.map(e=>e?o.Any.toJSON(e):void 0):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?o.Any.toJSON(e):void 0):t.nonCriticalExtensionOptions=[],t}};const p={};t.AuthInfo={encode(e,r=u.default.Writer.create()){for(const n of e.signerInfos)t.SignerInfo.encode(n,r.uint32(10).fork()).ldelim();return void 0!==e.fee&&void 0!==e.fee&&t.Fee.encode(e.fee,r.uint32(18).fork()).ldelim(),r},decode(e,r){const n=e instanceof Uint8Array?new u.default.Reader(e):e;let i=void 0===r?n.len:n.pos+r;const o=Object.assign({},p);for(o.signerInfos=[];n.pos>>3){case 1:o.signerInfos.push(t.SignerInfo.decode(n,n.uint32()));break;case 2:o.fee=t.Fee.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const r=Object.assign({},p);if(r.signerInfos=[],void 0!==e.signerInfos&&null!==e.signerInfos)for(const n of e.signerInfos)r.signerInfos.push(t.SignerInfo.fromJSON(n));return void 0!==e.fee&&null!==e.fee?r.fee=t.Fee.fromJSON(e.fee):r.fee=void 0,r},fromPartial(e){const r=Object.assign({},p);if(r.signerInfos=[],void 0!==e.signerInfos&&null!==e.signerInfos)for(const n of e.signerInfos)r.signerInfos.push(t.SignerInfo.fromPartial(n));return void 0!==e.fee&&null!==e.fee?r.fee=t.Fee.fromPartial(e.fee):r.fee=void 0,r},toJSON(e){const r={};return e.signerInfos?r.signerInfos=e.signerInfos.map(e=>e?t.SignerInfo.toJSON(e):void 0):r.signerInfos=[],void 0!==e.fee&&(r.fee=e.fee?t.Fee.toJSON(e.fee):void 0),r}};const m={sequence:i.default.UZERO};t.SignerInfo={encode:(e,r=u.default.Writer.create())=>(void 0!==e.publicKey&&void 0!==e.publicKey&&o.Any.encode(e.publicKey,r.uint32(10).fork()).ldelim(),void 0!==e.modeInfo&&void 0!==e.modeInfo&&t.ModeInfo.encode(e.modeInfo,r.uint32(18).fork()).ldelim(),r.uint32(24).uint64(e.sequence),r),decode(e,r){const n=e instanceof Uint8Array?new u.default.Reader(e):e;let i=void 0===r?n.len:n.pos+r;const s=Object.assign({},m);for(;n.pos>>3){case 1:s.publicKey=o.Any.decode(n,n.uint32());break;case 2:s.modeInfo=t.ModeInfo.decode(n,n.uint32());break;case 3:s.sequence=n.uint64();break;default:n.skipType(7&e)}}return s},fromJSON(e){const r=Object.assign({},m);return void 0!==e.publicKey&&null!==e.publicKey?r.publicKey=o.Any.fromJSON(e.publicKey):r.publicKey=void 0,void 0!==e.modeInfo&&null!==e.modeInfo?r.modeInfo=t.ModeInfo.fromJSON(e.modeInfo):r.modeInfo=void 0,void 0!==e.sequence&&null!==e.sequence?r.sequence=i.default.fromString(e.sequence):r.sequence=i.default.UZERO,r},fromPartial(e){const r=Object.assign({},m);return void 0!==e.publicKey&&null!==e.publicKey?r.publicKey=o.Any.fromPartial(e.publicKey):r.publicKey=void 0,void 0!==e.modeInfo&&null!==e.modeInfo?r.modeInfo=t.ModeInfo.fromPartial(e.modeInfo):r.modeInfo=void 0,void 0!==e.sequence&&null!==e.sequence?r.sequence=e.sequence:r.sequence=i.default.UZERO,r},toJSON(e){const r={};return void 0!==e.publicKey&&(r.publicKey=e.publicKey?o.Any.toJSON(e.publicKey):void 0),void 0!==e.modeInfo&&(r.modeInfo=e.modeInfo?t.ModeInfo.toJSON(e.modeInfo):void 0),void 0!==e.sequence&&(r.sequence=(e.sequence||i.default.UZERO).toString()),r}};const g={};t.ModeInfo={encode:(e,r=u.default.Writer.create())=>(void 0!==e.single&&t.ModeInfo_Single.encode(e.single,r.uint32(10).fork()).ldelim(),void 0!==e.multi&&t.ModeInfo_Multi.encode(e.multi,r.uint32(18).fork()).ldelim(),r),decode(e,r){const n=e instanceof Uint8Array?new u.default.Reader(e):e;let i=void 0===r?n.len:n.pos+r;const o=Object.assign({},g);for(;n.pos>>3){case 1:o.single=t.ModeInfo_Single.decode(n,n.uint32());break;case 2:o.multi=t.ModeInfo_Multi.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const r=Object.assign({},g);return void 0!==e.single&&null!==e.single?r.single=t.ModeInfo_Single.fromJSON(e.single):r.single=void 0,void 0!==e.multi&&null!==e.multi?r.multi=t.ModeInfo_Multi.fromJSON(e.multi):r.multi=void 0,r},fromPartial(e){const r=Object.assign({},g);return void 0!==e.single&&null!==e.single?r.single=t.ModeInfo_Single.fromPartial(e.single):r.single=void 0,void 0!==e.multi&&null!==e.multi?r.multi=t.ModeInfo_Multi.fromPartial(e.multi):r.multi=void 0,r},toJSON(e){const r={};return void 0!==e.single&&(r.single=e.single?t.ModeInfo_Single.toJSON(e.single):void 0),void 0!==e.multi&&(r.multi=e.multi?t.ModeInfo_Multi.toJSON(e.multi):void 0),r}};const y={mode:0};t.ModeInfo_Single={encode:(e,t=u.default.Writer.create())=>(t.uint32(8).int32(e.mode),t),decode(e,t){const r=e instanceof Uint8Array?new u.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},y);for(;r.pos>>3){case 1:i.mode=r.int32();break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},y);return void 0!==e.mode&&null!==e.mode?t.mode=s.signModeFromJSON(e.mode):t.mode=0,t},fromPartial(e){const t=Object.assign({},y);return void 0!==e.mode&&null!==e.mode?t.mode=e.mode:t.mode=0,t},toJSON(e){const t={};return void 0!==e.mode&&(t.mode=s.signModeToJSON(e.mode)),t}};const b={};t.ModeInfo_Multi={encode(e,r=u.default.Writer.create()){void 0!==e.bitarray&&void 0!==e.bitarray&&a.CompactBitArray.encode(e.bitarray,r.uint32(10).fork()).ldelim();for(const n of e.modeInfos)t.ModeInfo.encode(n,r.uint32(18).fork()).ldelim();return r},decode(e,r){const n=e instanceof Uint8Array?new u.default.Reader(e):e;let i=void 0===r?n.len:n.pos+r;const o=Object.assign({},b);for(o.modeInfos=[];n.pos>>3){case 1:o.bitarray=a.CompactBitArray.decode(n,n.uint32());break;case 2:o.modeInfos.push(t.ModeInfo.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){const r=Object.assign({},b);if(r.modeInfos=[],void 0!==e.bitarray&&null!==e.bitarray?r.bitarray=a.CompactBitArray.fromJSON(e.bitarray):r.bitarray=void 0,void 0!==e.modeInfos&&null!==e.modeInfos)for(const n of e.modeInfos)r.modeInfos.push(t.ModeInfo.fromJSON(n));return r},fromPartial(e){const r=Object.assign({},b);if(r.modeInfos=[],void 0!==e.bitarray&&null!==e.bitarray?r.bitarray=a.CompactBitArray.fromPartial(e.bitarray):r.bitarray=void 0,void 0!==e.modeInfos&&null!==e.modeInfos)for(const n of e.modeInfos)r.modeInfos.push(t.ModeInfo.fromPartial(n));return r},toJSON(e){const r={};return void 0!==e.bitarray&&(r.bitarray=e.bitarray?a.CompactBitArray.toJSON(e.bitarray):void 0),e.modeInfos?r.modeInfos=e.modeInfos.map(e=>e?t.ModeInfo.toJSON(e):void 0):r.modeInfos=[],r}};const v={gasLimit:i.default.UZERO,payer:"",granter:""};t.Fee={encode(e,t=u.default.Writer.create()){for(const r of e.amount)c.Coin.encode(r,t.uint32(10).fork()).ldelim();return t.uint32(16).uint64(e.gasLimit),t.uint32(26).string(e.payer),t.uint32(34).string(e.granter),t},decode(e,t){const r=e instanceof Uint8Array?new u.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},v);for(i.amount=[];r.pos>>3){case 1:i.amount.push(c.Coin.decode(r,r.uint32()));break;case 2:i.gasLimit=r.uint64();break;case 3:i.payer=r.string();break;case 4:i.granter=r.string();break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},v);if(t.amount=[],void 0!==e.amount&&null!==e.amount)for(const r of e.amount)t.amount.push(c.Coin.fromJSON(r));return void 0!==e.gasLimit&&null!==e.gasLimit?t.gasLimit=i.default.fromString(e.gasLimit):t.gasLimit=i.default.UZERO,void 0!==e.payer&&null!==e.payer?t.payer=String(e.payer):t.payer="",void 0!==e.granter&&null!==e.granter?t.granter=String(e.granter):t.granter="",t},fromPartial(e){const t=Object.assign({},v);if(t.amount=[],void 0!==e.amount&&null!==e.amount)for(const r of e.amount)t.amount.push(c.Coin.fromPartial(r));return void 0!==e.gasLimit&&null!==e.gasLimit?t.gasLimit=e.gasLimit:t.gasLimit=i.default.UZERO,void 0!==e.payer&&null!==e.payer?t.payer=e.payer:t.payer="",void 0!==e.granter&&null!==e.granter?t.granter=e.granter:t.granter="",t},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(e=>e?c.Coin.toJSON(e):void 0):t.amount=[],void 0!==e.gasLimit&&(t.gasLimit=(e.gasLimit||i.default.UZERO).toString()),void 0!==e.payer&&(t.payer=e.payer),void 0!==e.granter&&(t.granter=e.granter),t}};var w=(()=>{if(void 0!==w)return w;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object")})();const _=w.atob||(e=>w.Buffer.from(e,"base64").toString("binary"));function k(e){const t=_(e),r=new Uint8Array(t.length);for(let e=0;ew.Buffer.from(e,"binary").toString("base64"));function E(e){const t=[];for(let r=0;r>>3){case 1:o.signatures.push(t.SignatureDescriptor.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){const r=Object.assign({},f);if(r.signatures=[],void 0!==e.signatures&&null!==e.signatures)for(const n of e.signatures)r.signatures.push(t.SignatureDescriptor.fromJSON(n));return r},fromPartial(e){const r=Object.assign({},f);if(r.signatures=[],void 0!==e.signatures&&null!==e.signatures)for(const n of e.signatures)r.signatures.push(t.SignatureDescriptor.fromPartial(n));return r},toJSON(e){const r={};return e.signatures?r.signatures=e.signatures.map(e=>e?t.SignatureDescriptor.toJSON(e):void 0):r.signatures=[],r}};const d={sequence:o.default.UZERO};t.SignatureDescriptor={encode:(e,r=a.default.Writer.create())=>(void 0!==e.publicKey&&void 0!==e.publicKey&&i.Any.encode(e.publicKey,r.uint32(10).fork()).ldelim(),void 0!==e.data&&void 0!==e.data&&t.SignatureDescriptor_Data.encode(e.data,r.uint32(18).fork()).ldelim(),r.uint32(24).uint64(e.sequence),r),decode(e,r){const n=e instanceof Uint8Array?new a.default.Reader(e):e;let o=void 0===r?n.len:n.pos+r;const s=Object.assign({},d);for(;n.pos>>3){case 1:s.publicKey=i.Any.decode(n,n.uint32());break;case 2:s.data=t.SignatureDescriptor_Data.decode(n,n.uint32());break;case 3:s.sequence=n.uint64();break;default:n.skipType(7&e)}}return s},fromJSON(e){const r=Object.assign({},d);return void 0!==e.publicKey&&null!==e.publicKey?r.publicKey=i.Any.fromPartial(e.publicKey):r.publicKey=void 0,void 0!==e.data&&null!==e.data?r.data=t.SignatureDescriptor_Data.fromJSON(e.data):r.data=void 0,void 0!==e.sequence&&null!==e.sequence?r.sequence=o.default.fromString(e.sequence):r.sequence=o.default.UZERO,r},fromPartial(e){const r=Object.assign({},d);return void 0!==e.publicKey&&null!==e.publicKey?r.publicKey=i.Any.fromPartial(e.publicKey):r.publicKey=void 0,void 0!==e.data&&null!==e.data?r.data=t.SignatureDescriptor_Data.fromPartial(e.data):r.data=void 0,void 0!==e.sequence&&null!==e.sequence?r.sequence=e.sequence:r.sequence=o.default.UZERO,r},toJSON(e){const r={};return void 0!==e.publicKey&&(r.publicKey=e.publicKey?i.Any.toJSON(e.publicKey):void 0),void 0!==e.data&&(r.data=e.data?t.SignatureDescriptor_Data.toJSON(e.data):void 0),void 0!==e.sequence&&(r.sequence=(e.sequence||o.default.UZERO).toString()),r}};const h={};t.SignatureDescriptor_Data={encode:(e,r=a.default.Writer.create())=>(void 0!==e.single&&t.SignatureDescriptor_Data_Single.encode(e.single,r.uint32(10).fork()).ldelim(),void 0!==e.multi&&t.SignatureDescriptor_Data_Multi.encode(e.multi,r.uint32(18).fork()).ldelim(),r),decode(e,r){const n=e instanceof Uint8Array?new a.default.Reader(e):e;let i=void 0===r?n.len:n.pos+r;const o=Object.assign({},h);for(;n.pos>>3){case 1:o.single=t.SignatureDescriptor_Data_Single.decode(n,n.uint32());break;case 2:o.multi=t.SignatureDescriptor_Data_Multi.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const r=Object.assign({},h);return void 0!==e.single&&null!==e.single?r.single=t.SignatureDescriptor_Data_Single.fromJSON(e.single):r.single=void 0,void 0!==e.multi&&null!==e.multi?r.multi=t.SignatureDescriptor_Data_Multi.fromJSON(e.multi):r.multi=void 0,r},fromPartial(e){const r=Object.assign({},h);return void 0!==e.single&&null!==e.single?r.single=t.SignatureDescriptor_Data_Single.fromPartial(e.single):r.single=void 0,void 0!==e.multi&&null!==e.multi?r.multi=t.SignatureDescriptor_Data_Multi.fromPartial(e.multi):r.multi=void 0,r},toJSON(e){const r={};return void 0!==e.single&&(r.single=e.single?t.SignatureDescriptor_Data_Single.toJSON(e.single):void 0),void 0!==e.multi&&(r.multi=e.multi?t.SignatureDescriptor_Data_Multi.toJSON(e.multi):void 0),r}};const p={mode:0};t.SignatureDescriptor_Data_Single={encode:(e,t=a.default.Writer.create())=>(t.uint32(8).int32(e.mode),t.uint32(18).bytes(e.signature),t),decode(e,t){const r=e instanceof Uint8Array?new a.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},p);for(;r.pos>>3){case 1:i.mode=r.int32();break;case 2:i.signature=r.bytes();break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},p);return void 0!==e.mode&&null!==e.mode?t.mode=u(e.mode):t.mode=0,void 0!==e.signature&&null!==e.signature&&(t.signature=function(e){const t=y(e),r=new Uint8Array(t.length);for(let e=0;e>>3){case 1:o.bitarray=s.CompactBitArray.decode(n,n.uint32());break;case 2:o.signatures.push(t.SignatureDescriptor_Data.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){const r=Object.assign({},m);if(r.signatures=[],void 0!==e.bitarray&&null!==e.bitarray?r.bitarray=s.CompactBitArray.fromJSON(e.bitarray):r.bitarray=void 0,void 0!==e.signatures&&null!==e.signatures)for(const n of e.signatures)r.signatures.push(t.SignatureDescriptor_Data.fromJSON(n));return r},fromPartial(e){const r=Object.assign({},m);if(r.signatures=[],void 0!==e.bitarray&&null!==e.bitarray?r.bitarray=s.CompactBitArray.fromPartial(e.bitarray):r.bitarray=void 0,void 0!==e.signatures&&null!==e.signatures)for(const n of e.signatures)r.signatures.push(t.SignatureDescriptor_Data.fromPartial(n));return r},toJSON(e){const r={};return void 0!==e.bitarray&&(r.bitarray=e.bitarray?s.CompactBitArray.toJSON(e.bitarray):void 0),e.signatures?r.signatures=e.signatures.map(e=>e?t.SignatureDescriptor_Data.toJSON(e):void 0):r.signatures=[],r}};var g=(()=>{if(void 0!==g)return g;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object")})();const y=g.atob||(e=>g.Buffer.from(e,"base64").toString("binary"));const b=g.btoa||(e=>g.Buffer.from(e,"binary").toString("base64"))}).call(this,r(15))},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompactBitArray=t.MultiSignature=t.protobufPackage=void 0;const i=n(r(72));t.protobufPackage="cosmos.crypto.multisig.v1beta1";const o={};t.MultiSignature={encode(e,t=i.default.Writer.create()){for(const r of e.signatures)t.uint32(10).bytes(r);return t},decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const s=Object.assign({},o);for(s.signatures=[];r.pos>>3){case 1:s.signatures.push(r.bytes());break;default:r.skipType(7&e)}}return s},fromJSON(e){const t=Object.assign({},o);if(t.signatures=[],void 0!==e.signatures&&null!==e.signatures)for(const r of e.signatures)t.signatures.push(u(r));return t},fromPartial(e){const t=Object.assign({},o);if(t.signatures=[],void 0!==e.signatures&&null!==e.signatures)for(const r of e.signatures)t.signatures.push(r);return t},toJSON(e){const t={};return e.signatures?t.signatures=e.signatures.map(e=>f(void 0!==e?e:new Uint8Array)):t.signatures=[],t}};const s={extraBitsStored:0};t.CompactBitArray={encode:(e,t=i.default.Writer.create())=>(t.uint32(8).uint32(e.extraBitsStored),t.uint32(18).bytes(e.elems),t),decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const o=Object.assign({},s);for(;r.pos>>3){case 1:o.extraBitsStored=r.uint32();break;case 2:o.elems=r.bytes();break;default:r.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return void 0!==e.extraBitsStored&&null!==e.extraBitsStored?t.extraBitsStored=Number(e.extraBitsStored):t.extraBitsStored=0,void 0!==e.elems&&null!==e.elems&&(t.elems=u(e.elems)),t},fromPartial(e){const t=Object.assign({},s);return void 0!==e.extraBitsStored&&null!==e.extraBitsStored?t.extraBitsStored=e.extraBitsStored:t.extraBitsStored=0,void 0!==e.elems&&null!==e.elems?t.elems=e.elems:t.elems=new Uint8Array,t},toJSON(e){const t={};return void 0!==e.extraBitsStored&&(t.extraBitsStored=e.extraBitsStored),void 0!==e.elems&&(t.elems=f(void 0!==e.elems?e.elems:new Uint8Array)),t}};var a=(()=>{if(void 0!==a)return a;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object")})();const c=a.atob||(e=>a.Buffer.from(e,"base64").toString("binary"));function u(e){const t=c(e),r=new Uint8Array(t.length);for(let e=0;ea.Buffer.from(e,"binary").toString("base64"));function f(e){const t=[];for(let r=0;r=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SecretWasmService=void 0;const a=r(65),c=r(75),u=r(899),l=r(166),f=r(92),d=r(165),h=r(86),p=r(35),m=r(8),g=r(2);let y=class{constructor(e,t,r,n){this.kvStore=e,this.chainsService=t,this.keyRingService=r,this.permissionService=n,this.debouncerMap=new Map,this.cacheEnigmaUtils=new Map,this.onChainRemoved=()=>{this.cacheEnigmaUtils=new Map},this.chainsService.addChainRemovedHandler(this.onChainRemoved)}getPubkey(e,t){return s(this,void 0,void 0,(function*(){const r=yield this.chainsService.getChainInfo(t);if("none"===(yield this.keyRingService.getKeyRingType()))throw new Error("Key ring is not initialized");const n=yield this.getSeed(e,r);return this.getEnigmaUtils(r,n).pubkey}))}getTxEncryptionKey(e,t,r){return s(this,void 0,void 0,(function*(){const n=yield this.chainsService.getChainInfo(t);if("none"===(yield this.keyRingService.getKeyRingType()))throw new Error("Key ring is not initialized");const i=yield this.getSeed(e,n);return this.getEnigmaUtils(n,i).getTxEncryptionKey(r)}))}encrypt(e,t,r,n){return s(this,void 0,void 0,(function*(){const i=yield this.chainsService.getChainInfo(t);if("none"===(yield this.keyRingService.getKeyRingType()))throw new Error("Key ring is not initialized");const o=yield this.getSeed(e,i),s=this.getEnigmaUtils(i,o);return yield s.encrypt(r,n)}))}decrypt(e,t,r,n){return s(this,void 0,void 0,(function*(){const i=yield this.chainsService.getChainInfo(t);if("none"===(yield this.keyRingService.getKeyRingType()))throw new Error("Key ring is not initialized");const o=yield this.getSeed(e,i),s=this.getEnigmaUtils(i,o);return yield s.decrypt(r,n)}))}getEnigmaUtils(e,t){const r=`${e.chainId}-${g.Buffer.from(t).toString("hex")}`;if(this.cacheEnigmaUtils.has(r))return this.cacheEnigmaUtils.get(r);const n=new u.EnigmaUtils(e.rest,t);return this.cacheEnigmaUtils.set(r,n),n}getSeed(e,t){return s(this,void 0,void 0,(function*(){const r=yield this.keyRingService.getKey(t.chainId),n=new m.Bech32Address(r.address).toBech32(t.bech32Config.bech32PrefixAccAddr),i=`${e.isInternalMsg}/${t.chainId}/${n}`;this.debouncerMap.has(i)||this.debouncerMap.set(i,p.Debouncer.promise(this.getSeedInner.bind(this)));const o=this.debouncerMap.get(i);return yield o(e,t,n)}))}getSeedInner(e,t,r){return s(this,void 0,void 0,(function*(){const n=`seed-${t.chainId}-${r}`,i=yield this.kvStore.get(n);if(i)return g.Buffer.from(i,"hex");const o=h.Hash.sha256(g.Buffer.from(yield this.keyRingService.sign(e,t.chainId,g.Buffer.from(JSON.stringify({account_number:0,chain_id:t.chainId,fee:[],memo:"Create Keplr Secret encryption key. Only approve requests by Keplr.",msgs:[],sequence:0})))));return yield this.kvStore.set(n,g.Buffer.from(o).toString("hex")),o}))}};y=n([a.singleton(),o(0,a.inject(c.TYPES.SecretWasmStore)),o(1,a.inject(f.ChainsService)),o(2,a.inject(a.delay(()=>l.KeyRingService))),o(3,a.inject(a.delay(()=>d.PermissionService))),i("design:paramtypes",[Object,f.ChainsService,l.KeyRingService,d.PermissionService])],y),t.SecretWasmService=y},function(e,t,r){"use strict";(function(e){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(112)),o=r(495);class s{static toHex(e){let t="";for(const r of e)t+=("0"+r.toString(16)).slice(-2);return t}static fromHex(e){if(e.length%2!=0)throw new Error("hex string length must be a multiple of 2");const t=[];for(let r=0;r{const t=e.charCodeAt(0);if(t<32||t>126)throw new Error("Cannot encode character that is out of printable ASCII range: "+t);return t}))}static fromAscii(e){return(t=Array.from(e),t.map(e=>{if(e<32||e>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+e);return String.fromCharCode(e)})).join("");var t}static toUtf8(t){return"undefined"!=typeof TextEncoder?(new TextEncoder).encode(t):new Uint8Array(e.from(t,"utf8"))}static fromUtf8(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(t);if(!s.isValidUtf8(t))throw new Error("Invalid UTF8 data");return e.from(t).toString("utf8")}static fromRfc3339(e){const t=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/.exec(e);if(!t)throw new Error("Date string is not in RFC3339 format");const r=+t[1],n=+t[2],i=+t[3],s=+t[4],a=+t[5],c=+t[6],u=t[7]?Math.floor(1e3*+t[7]):0;let l,f,d;"Z"===t[8]?(l=1,f=0,d=0):(l="-"===t[8].substring(0,1)?-1:1,f=+t[8].substring(1,3),d=+t[8].substring(4,6));const h=l*(60*f+d)*60;return new o.ReadonlyDate(o.ReadonlyDate.UTC(r,n-1,i,s,a,c,u)-1e3*h)}static toRfc3339(e){function t(e,t=2){const r="00000"+e.toString();return r.substring(r.length-t)}return`${e.getUTCFullYear()}-${t(e.getUTCMonth()+1)}-${t(e.getUTCDate())}T${t(e.getUTCHours())}:${t(e.getUTCMinutes())}:${t(e.getUTCSeconds())}.${t(e.getUTCMilliseconds(),3)}Z`}static isValidUtf8(t){const r=e.from(e.from(t).toString("utf8"),"utf8");return 0===e.compare(e.from(t),r)}}t.Encoding=s}).call(this,r(2).Buffer)},function(e,t){e.exports={ReadonlyDate:Date}},function(e,t,r){"use strict";(function(e){function r(e){return"object"==typeof e&&null!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.isNonNullObject=r,t.isUint8Array=function(t){return!!r(t)&&("[object Uint8Array]"===Object.prototype.toString.call(t)&&(void 0===e||void 0===e.isBuffer||!e.isBuffer(t)))}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(916);Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return n.assert}});var i=r(917);Object.defineProperty(t,"sleep",{enumerable:!0,get:function(){return i.sleep}});var o=r(918);Object.defineProperty(t,"isNonNullObject",{enumerable:!0,get:function(){return o.isNonNullObject}}),Object.defineProperty(t,"isUint8Array",{enumerable:!0,get:function(){return o.isUint8Array}})},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(102));class o{constructor(e){if(!o.mnemonicMatcher.test(e))throw new Error("Invalid mnemonic format");const t=e.split(" "),r=[12,15,18,21,24];if(-1===r.indexOf(t.length))throw new Error(`Invalid word count in mnemonic (allowed: ${r} got: ${t.length})`);for(const e of t)if(-1===o.wordlist.indexOf(e))throw new Error("Mnemonic contains invalid word");i.mnemonicToEntropy(e),this.data=e}toString(){return this.data}}t.EnglishMnemonic=o,o.wordlist=i.wordlists.english,o.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Hmac=class{constructor(e,t){const r=(new e).blockSize;this.hash=t=>(new e).update(t).digest();let n=t;if(n.length>r&&(n=this.hash(n)),n.length92^e),this.iKeyPad=n.map(e=>54^e),this.messageHasher=new e,this.blockSize=r,this.update(this.iKeyPad)}update(e){return this.messageHasher.update(e),this}digest(){const e=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...e]))}}},function(e,t,r){"use strict";function n(e){let t=0;for(const r of e){if(0!==r)break;t++}return e.slice(t)}Object.defineProperty(t,"__esModule",{value:!0});class i{constructor(e,t){if(e.length>32||0===e.length||0===e[0])throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||0===t.length||0===t[0])throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:e,s:t}}static fromFixedLength(e){if(64!==e.length)throw new Error(`Got invalid data length: ${e.length}. Expected 2x 32 bytes for the pair (r, s)`);return new i(n(e.slice(0,32)),n(e.slice(32,64)))}static fromDer(e){let t=0;if(48!==e[t++])throw new Error("Prefix 0x30 expected");const r=e[t++];if(e.length-t!==r)throw new Error("Data length mismatch detected");if(2!==e[t++])throw new Error("INTEGER tag expected");const o=e[t++];if(o>=128)throw new Error("Decoding length values above 127 not supported");const s=e.slice(t,t+o);t+=o;if(2!==e[t++])throw new Error("INTEGER tag expected");const a=e[t++];if(a>=128)throw new Error("Decoding length values above 127 not supported");const c=e.slice(t,t+a);return t+=a,new i(n(s),n(c))}r(e){if(void 0===e)return this.data.r;{const t=e-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const r=new Uint8Array(t);return new Uint8Array([...r,...this.data.r])}}s(e){if(void 0===e)return this.data.s;{const t=e-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const r=new Uint8Array(t);return new Uint8Array([...r,...this.data.s])}}toDer(){const e=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,r=e.length,n=t.length,i=new Uint8Array([2,r,...e,2,n,...t]);return new Uint8Array([48,i.length,...i])}}t.Secp256k1Signature=i;class o extends i{constructor(e,t,r){if(super(e,t),!Number.isInteger(r))throw new Error("The recovery parameter must be an integer.");if(r<0||r>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=r}static fromFixedLength(e){if(65!==e.length)throw new Error(`Got invalid data length ${e.length}. Expected 32 + 32 + 1`);return new o(n(e.slice(0,32)),n(e.slice(32,64)),e[64])}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}t.ExtendedSecp256k1Signature=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(93));t.Sha1=class{constructor(e){this.blockSize=64,this.impl=i.default("sha1"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}};t.Sha256=class{constructor(e){this.blockSize=64,this.impl=i.default("sha256"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}};t.Sha512=class{constructor(e){this.blockSize=128,this.impl=i.default("sha512"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(929),o=r(64),s=r(937),a=r(938),c=n(r(84)),u=r(940),l=new i.PolyfillCryptoProvider,f=Uint8Array.from([0,0,0,0,0,0,0,0,0,2,75,234,216,223,105,153,8,82,194,2,219,14,0,151,193,161,46,166,55,215,233,109]);class d{constructor(e,t){this.consensusIoPubKey=new Uint8Array,this.apiUrl=e,this.seed=t||d.GenerateNewSeed();const{privkey:r,pubkey:n}=d.GenerateNewKeyPairFromSeed(this.seed);this.privkey=r,this.pubkey=n}static GenerateNewKeyPair(){return d.GenerateNewKeyPairFromSeed(d.GenerateNewSeed())}static GenerateNewSeed(){return a(32,{type:"Uint8Array"})}static GenerateNewKeyPairFromSeed(e){const{private:t,public:r}=s.generateKeyPair(e);return{privkey:t,pubkey:r}}async getConsensusIoPubKey(){if(32===this.consensusIoPubKey.length)return this.consensusIoPubKey;const{data:{result:{TxKey:e}}}=await c.default.get(this.apiUrl+"/reg/tx-key",{headers:{"Content-Type":"application/json"}});return this.consensusIoPubKey=o.Encoding.fromBase64(e),this.consensusIoPubKey}async getTxEncryptionKey(e){const t=await this.getConsensusIoPubKey(),r=s.sharedKey(this.privkey,t),{key:n}=await u.compute(Uint8Array.from([...r,...e]),"SHA-256",32,"",f);return n}async encrypt(e,t){const r=a(32,{type:"Uint8Array"}),n=await this.getTxEncryptionKey(r),s=await i.SIV.importKey(n,"AES-SIV",l),c=o.Encoding.toUtf8(e+JSON.stringify(t)),u=await s.seal(c,[new Uint8Array]);return Uint8Array.from([...r,...this.pubkey,...u])}async decrypt(e,t){var r;if(!(null===(r=e)||void 0===r?void 0:r.length))return new Uint8Array;const n=await this.getTxEncryptionKey(t),o=await i.SIV.importKey(n,"AES-SIV",l);return await o.open(e,[new Uint8Array])}getPubkey(){return Promise.resolve(this.pubkey)}}t.default=d,e.exports=d},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(211),o=r(504);class s{static importKey(e,t,r=new i.WebCryptoProvider){return n(this,void 0,void 0,(function*(){return new s(yield o.SIV.importKey(e,t,r))}))}constructor(e){this._siv=e}seal(e,t,r=new Uint8Array(0)){return n(this,void 0,void 0,(function*(){return this._siv.seal(e,[r,t])}))}open(e,t,r=new Uint8Array(0)){return n(this,void 0,void 0,(function*(){return this._siv.open(e,[r,t])}))}clear(){return this._siv.clear(),this}}t.AEAD=s},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(296),o=r(297),s=r(298),a=r(295),c=r(169),u=r(505),l=r(506),f=r(211);t.MAX_ASSOCIATED_DATA=126;class d{static importKey(e,t,r=new f.WebCryptoProvider){return n(this,void 0,void 0,(function*(){if(32!==e.length&&64!==e.length)throw new Error("AES-SIV: key must be 32 or 64-bytes (got "+e.length);const n=e.subarray(0,e.length/2|0),i=e.subarray(e.length/2|0);let o;switch(t){case"AES-SIV":case"AES-CMAC-SIV":o=yield u.CMAC.importKey(r,n);break;case"AES-PMAC-SIV":o=yield l.PMAC.importKey(r,n);break;default:throw new a.NotImplementedError("Miscreant: algorithm not supported: "+t)}const s=yield r.importCTRKey(i);return new d(o,s)}))}constructor(e,t){this._mac=e,this._ctr=t,this._tmp1=new c.default,this._tmp2=new c.default}seal(e,r){return n(this,void 0,void 0,(function*(){if(r.length>t.MAX_ASSOCIATED_DATA)throw new Error("AES-SIV: too many associated data items");const n=c.default.SIZE+e.length,i=new Uint8Array(n),o=yield this._s2v(r,e);return i.set(o),h(o),i.set(yield this._ctr.encryptCtr(o,e),o.length),i}))}open(e,r){return n(this,void 0,void 0,(function*(){if(r.length>t.MAX_ASSOCIATED_DATA)throw new Error("AES-SIV: too many associated data items");if(e.length=c.default.SIZE){const e=t.length-c.default.SIZE;this._tmp1.data.set(t.subarray(e)),yield this._mac.update(t.subarray(0,e))}else this._tmp1.data.set(t),this._tmp1.data[t.length]=128,this._tmp2.dbl();return s.xor(this._tmp1.data,this._tmp2.data),yield this._mac.update(this._tmp1.data),this._mac.finish()}))}}function h(e){e[e.length-8]&=127,e[e.length-4]&=127}t.SIV=d},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(169),o=r(298);class s{constructor(e,t,r){this._cipher=e,this._subkey1=t,this._subkey2=r,this._bufferPos=0,this._finished=!1,this._buffer=new i.default}static importKey(e,t){return n(this,void 0,void 0,(function*(){const r=yield e.importBlockCipherKey(t),n=new i.default;yield r.encryptBlock(n),n.dbl();const o=n.clone();return o.dbl(),new s(r,n,o)}))}reset(){return this._buffer.clear(),this._bufferPos=0,this._finished=!1,this}clear(){this.reset(),this._subkey1.clear(),this._subkey2.clear()}update(e){return n(this,void 0,void 0,(function*(){const t=i.default.SIZE-this._bufferPos;let r=0,n=e.length;if(n>t){for(let r=0;ri.default.SIZE;){for(let t=0;t0;e--){const t=o.select(1&a.data[e-1],128,0);a.data[e]=a.data[e]>>>1|t}return a.data[0]>>>=1,a.data[0]^=o.select(u,128,0),a.data[i.default.SIZE-1]^=o.select(u,i.default.R>>>1,0),new c(r,s,a)}))}reset(){return this._buffer.clear(),this._bufferPos=0,this._counter=0,this._offset.clear(),this._tag.clear(),this._finished=!1,this}clear(){this.reset(),this._cipher.clear()}update(e){return n(this,void 0,void 0,(function*(){if(this._finished)throw new Error("pmac: already finished");const t=i.default.SIZE-this._bufferPos;let r=0,n=e.length;for(n>t&&(this._buffer.data.set(e.slice(0,t),this._bufferPos),r+=t,n-=t,yield this._processBuffer());n>i.default.SIZE;)this._buffer.data.set(e.slice(r,r+i.default.SIZE)),r+=i.default.SIZE,n-=i.default.SIZE,yield this._processBuffer();return n>0&&(this._buffer.data.set(e.slice(r,r+n),this._bufferPos),this._bufferPos+=n),this}))}finish(){return n(this,void 0,void 0,(function*(){if(this._finished)throw new Error("pmac: already finished");return this._bufferPos===i.default.SIZE?(a.xor(this._tag.data,this._buffer.data),a.xor(this._tag.data,this._LInv.data)):(a.xor(this._tag.data,this._buffer.data.slice(0,this._bufferPos)),this._tag.data[this._bufferPos]^=128),yield this._cipher.encryptBlock(this._tag),this._finished=!0,this._tag.clone().data}))}_processBuffer(){return n(this,void 0,void 0,(function*(){a.xor(this._offset.data,this._L[s.ctz(this._counter+1)].data),a.xor(this._buffer.data,this._offset.data),this._counter++,yield this._cipher.encryptBlock(this._buffer),a.xor(this._tag.data,this._buffer.data),this._bufferPos=0}))}}t.PMAC=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={hashes:{"SHA3-512":{nodeName:"sha3-512",hashSize:64},"SHA3-384":{nodeName:"sha3-384",hashSize:48},"SHA3-256":{nodeName:"sha3-256",hashSize:32},"SHA3-224":{nodeName:"sha3-224",hashSize:28},"SHA-256":{nodeName:"sha256",hashSize:32},"SHA-384":{nodeName:"sha384",hashSize:48},"SHA-512":{nodeName:"sha512",hashSize:64},"SHA-1":{nodeName:"sha1",hashSize:20},MD5:{nodeName:"md5",hashSize:16}}}},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});var i=n(r(947));t.compute=i.compute,t.default={compute:t.compute}},function(e,t){var r={utf8:{stringToBytes:function(e){return r.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(r.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r126||e[r]<32&&13!==e[r]&&10!==e[r]){t=!1;break}var n=null;if(t){n="";for(r=0;r{var t;return new o(e.msgType,null===(t=e)||void 0===t?void 0:t.data)})}},function(e,t,r){"use strict";t.Service=r(973)},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(o.compareFieldsById),c=0;c>>0,8|i.mapKey[u.keyType],u.keyType),void 0===d?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,f,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==i.packed[f]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",f,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===d?s(r,u,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|d)>>>0,f,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===d?s(r,u,l,t):r("w.uint32(%i).%s(%s)",(u.id<<3|d)>>>0,f,t))}return r("return w")};var n=r(76),i=r(127),o=r(41);function s(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},function(e,t,r){"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos>>3){");for(var r=0;r>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===i.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==i.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function a(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n]/g,i=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,o=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,s=/^ *[*/]+ */,a=/^\s*\*?\/*/,c=/\n/g,u=/\s/,l=/\\(.?)/g,f={0:"\0",r:"\r",n:"\n",t:"\t"};function d(e){return e.replace(l,(function(e,t){switch(t){case"\\":case"":return t;default:return f[t]||""}}))}function h(e,t){e=e.toString();var r=0,l=e.length,f=1,h=null,p=null,m=0,g=!1,y=!1,b=[],v=null;function w(e){return Error("illegal "+e+" (line "+f+")")}function _(t){return e.charAt(t)}function k(r,n,i){h=e.charAt(r++),m=f,g=!1,y=i;var o,u=r-(t?2:3);do{if(--u<0||"\n"===(o=e.charAt(u))){g=!0;break}}while(" "===o||"\t"===o);for(var l=e.substring(r,n).split(c),d=0;d0)return b.shift();if(v)return function(){var t="'"===v?o:i;t.lastIndex=r-1;var n=t.exec(e);if(!n)throw w("string");return r=t.lastIndex,M(v),v=null,d(n[1])}();var s,a,c,h,p,m=0===r;do{if(r===l)return null;for(s=!1;u.test(c=_(r));)if("\n"===c&&(m=!0,++f),++r===l)return null;if("/"===_(r)){if(++r===l)throw w("comment");if("/"===_(r))if(t){if(h=r,p=!1,S(r)){p=!0;do{if((r=E(r))===l)break;r++}while(S(r))}else r=Math.min(l,E(r)+1);p&&k(h,r,m),f++,s=!0}else{for(p="/"===_(h=r+1);"\n"!==_(++r);)if(r===l)return null;++r,p&&k(h,r-1,m),++f,s=!0}else{if("*"!==(c=_(r)))return"/";h=r+1,p=t||"*"===_(h);do{if("\n"===c&&++f,++r===l)throw w("comment");a=c,c=_(r)}while("*"!==a||"/"!==c);++r,p&&k(h,r-2,m),s=!0}}}while(s);var g=r;if(n.lastIndex=0,!n.test(_(g++)))for(;gi.Encoding.fromBase64(e))}}async searchTx(e,t={}){const r=t.minHeight||0,n=t.maxHeight||Number.MAX_SAFE_INTEGER;if(ne.hash);o=[...n,...s.filter(e=>!a.includes(e.hash))]}else{if(!function(e){return void 0!==e.tags}(e))throw new Error("Unknown query type");{const t=i(e.tags.map(e=>`${e.key}=${e.value}`).join("&"));o=await this.txsQuery(t)}}return o.filter(e=>e.height>=r&&e.height<=n)}async postTx(e){const t=await this.restClient.postTx(e);if(!t.txhash.match(/^([0-9A-F][0-9A-F])+$/))throw new Error("Received ill-formatted txhash. Must be non-empty upper-case hex");if(t.code)throw new Error(`Error when posting tx ${t.txhash}. Code: ${t.code}; Raw log: ${t.raw_log}`);return{logs:t.logs?o.parseLogs(t.logs):[],rawLog:t.raw_log||"",transactionHash:t.txhash,data:t.data||""}}async getCodes(){return(await this.restClient.listCodeInfo()).map(e=>(this.anyValidAddress=e.creator,{id:e.id,creator:e.creator,checksum:i.Encoding.toHex(i.Encoding.fromHex(e.data_hash)),source:e.source||void 0,builder:e.builder||void 0}))}async getCodeDetails(e){const t=this.codesCache.get(e);if(t)return t;const r=await this.restClient.getCode(e),n={id:r.id,creator:r.creator,checksum:i.Encoding.toHex(i.Encoding.fromHex(r.data_hash)),source:r.source||void 0,builder:r.builder||void 0,data:i.Encoding.fromBase64(r.data)};return this.codesCache.set(e,n),n}async getContracts(e){return(await this.restClient.listContractsByCodeId(e)).map(e=>({address:e.address,codeId:e.code_id,creator:e.creator,label:e.label}))}async getContract(e){const t=await this.restClient.getContractInfo(e);if(!t)throw new Error(`No contract found at address "${e}"`);return{address:t.address,codeId:t.code_id,creator:t.creator,label:t.label,initMsg:t.init_msg}}async queryContractSmart(e,t,r,n){try{return await this.restClient.queryContractSmart(e,t,r,n)}catch(t){throw t instanceof Error&&t.message.startsWith("not found: contract")?new Error(`No contract found at address "${e}"`):t}}async txsQuery(e){const t=await this.restClient.txsQuery(e+"&limit=100");if(parseInt(t.page_total,10)>1)throw new Error(`Found more results on the backend than we can process currently. Results: ${t.total_count}, supported: 100`);return t.txs.map(e=>({height:parseInt(e.height,10),hash:e.txhash,code:e.code||0,rawLog:e.raw_log,logs:o.parseLogs(e.logs||[]),tx:e.tx,timestamp:e.timestamp}))}getCodeHashByCodeId(e){return this.restClient.getCodeHashByCodeId(e)}getCodeHashByContractAddr(e){return this.restClient.getCodeHashByContractAddr(e)}async getNonceByTxId(e){const t=(await this.restClient.txById(e,!1)).tx.value.msg,r=[];for(const e of t){let t;t="wasm/MsgExecuteContract"===e.type?i.Encoding.fromBase64(e.value.msg).slice(0,32):"wasm/MsgInstantiateContract"===e.type?i.Encoding.fromBase64(e.value.init_msg).slice(0,32):null,r.push(t)}return r}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(64),o=n(r(980)),s=r(167);t.encodeSecp256k1Pubkey=function(e){if(33!==e.length||2!==e[0]&&3!==e[0])throw new Error("Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03");return{type:s.pubkeyType.secp256k1,value:i.Encoding.toBase64(e)}};const a=i.Encoding.fromHex("eb5ae98721"),c=i.Encoding.fromHex("1624de6420"),u=i.Encoding.fromHex("0dfb1005"),l=a.length;t.decodeBech32Pubkey=function(e){const{data:t}=i.Bech32.decode(e),r=t.slice(0,l),n=t.slice(l);if(o.default(r,a)){if(33!==n.length)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:s.pubkeyType.secp256k1,value:i.Encoding.toBase64(n)}}if(o.default(r,c)){if(32!==n.length)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:s.pubkeyType.ed25519,value:i.Encoding.toBase64(n)}}if(o.default(r,u)){if(32!==n.length)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:s.pubkeyType.sr25519,value:i.Encoding.toBase64(n)}}throw new Error("Unsupported Pubkey type. Amino prefix: "+i.Encoding.toHex(r))},t.encodeBech32Pubkey=function(e,t){let r;switch(e.type){case s.pubkeyType.secp256k1:r=a;break;default:throw new Error("Unsupported pubkey type")}const n=new Uint8Array([...r,...i.Encoding.fromBase64(e.value)]);return i.Bech32.encode(t,n)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="secret-wasm"},function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundTxService=void 0;const u=r(65),l=r(75),f=c(r(84)),d=r(92),h=r(165),p=r(360),m=r(2);let g=n=class{constructor(e,t,r){this.chainsService=e,this.permissionService=t,this.notification=r}sendTx(e,t,r){return a(this,void 0,void 0,(function*(){const i=yield this.chainsService.getChainInfo(e),o=f.default.create(Object.assign({baseURL:i.rest},i.restConfig));this.notification.create({iconRelativeUrl:"assets/temp-icon.svg",title:"Tx is pending...",message:"Wait a second"});const s=m.Buffer.isBuffer(t)||t instanceof Uint8Array,a=s?{tx_bytes:m.Buffer.from(t).toString("base64"),mode:(()=>{switch(r){case"async":return"BROADCAST_MODE_ASYNC";case"block":return"BROADCAST_MODE_BLOCK";case"sync":return"BROADCAST_MODE_SYNC";default:return"BROADCAST_MODE_UNSPECIFIED"}})()}:{tx:t,mode:r};try{const e=yield o.post(s?"/cosmos/tx/v1beta1/txs":"/txs",a),t=s?e.data.tx_response:e.data;if(null!=t.code&&0!==t.code)throw new Error(t.raw_log);const r=m.Buffer.from(t.txhash,"hex"),c=new p.TendermintTxTracer(i.rpc,"/websocket");return c.traceTx(r).then(e=>{c.close(),n.processTxResultNotification(this.notification,e)}),r}catch(e){throw console.log(e),n.processTxErrorNotification(this.notification,e),e}}))}static processTxResultNotification(e,t){var r;try{if("commit"===t.mode){if(void 0!==t.checkTx.code&&0!==t.checkTx.code)throw new Error(t.checkTx.log);if(void 0!==t.deliverTx.code&&0!==t.deliverTx.code)throw new Error(t.deliverTx.log)}else if(null!=t.code&&0!==t.code){const e=null!==(r=t.log)&&void 0!==r?r:t.raw_log;throw new Error(e)}e.create({iconRelativeUrl:"assets/temp-icon.svg",title:"Tx succeeds",message:"Congratulations!"})}catch(t){n.processTxErrorNotification(e,t)}}static processTxErrorNotification(e,t){console.log(t);let r=t.message;const n=/code:\s*(-?\d+),\s*message:\s*(.+),\sdata:\s(.+)/g.exec(t.message);n&&4===n.length&&(r=n[3]);try{const e=JSON.parse(t.message);(null==e?void 0:e.message)&&(r=e.message)}catch(e){}try{const e=JSON.parse(t.message);if(e&&e.length>0)for(const t of e)if(!t.success){const e=JSON.parse(t.log);if(null==e?void 0:e.message){r=e.message;break}}}catch(e){}e.create({iconRelativeUrl:"assets/temp-icon.svg",title:"Tx failed",message:r})}};g=n=i([u.singleton(),s(0,u.inject(u.delay(()=>d.ChainsService))),s(1,u.inject(u.delay(()=>h.PermissionService))),s(2,u.inject(l.TYPES.Notification)),o("design:paramtypes",[d.ChainsService,h.PermissionService,Object])],g),t.BackgroundTxService=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="background-tx"},function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TokensService=void 0;const c=r(65),u=r(75),l=r(92),f=r(8),d=r(92),h=r(166),p=r(166),m=r(123),g=r(165),y=r(2),b=r(213),v=r(527);let w=n=class{constructor(e,t,r,n,i){this.kvStore=e,this.interactionService=t,this.permissionService=r,this.chainsService=n,this.keyRingService=i,this.onChainRemoved=e=>{this.clearTokens(e)},this.chainsService.addChainRemovedHandler(this.onChainRemoved)}suggestToken(e,t,r,n){return a(this,void 0,void 0,(function*(){const i=yield this.chainsService.getChainInfo(t),o=(yield this.getTokens(t)).find(e=>"contractAddress"in e&&e.contractAddress===r);if(o)return n?void("type"in o&&"secret20"===o.type&&(yield this.addToken(t,Object.assign(Object.assign({},o),{viewingKey:n})))):void 0;f.Bech32Address.validate(r,i.bech32Config.bech32PrefixAccAddr);const s={chainId:t,contractAddress:r,viewingKey:n},a=yield this.interactionService.waitApprove(e,"/setting/token/add",b.SuggestTokenMsg.type(),s);yield this.addToken(t,a)}))}addToken(e,t){return a(this,void 0,void 0,(function*(){const r=yield this.chainsService.getChainInfo(e);t=yield n.validateCurrency(r,t);const i=yield this.getTokens(e),o="type"in t&&"secret20"===t.type;let s=!1;for(const e of i)if(t.coinMinimalDenom===e.coinMinimalDenom){if(!o)return;s=!0}if(o){const r=yield this.getTokensFromChainAndAccount(e);if(s){const n=r.findIndex(e=>e.coinMinimalDenom===t.coinMinimalDenom);n>=0&&(r[n]=t,yield this.saveTokensToChainAndAccount(e,r))}else r.push(t),yield this.saveTokensToChainAndAccount(e,r)}else{const r=yield this.getTokensFromChain(e);r.push(t),yield this.saveTokensToChain(e,r)}}))}removeToken(e,t){return a(this,void 0,void 0,(function*(){const r=yield this.chainsService.getChainInfo(e);t=yield n.validateCurrency(r,t);const i=yield this.getTokens(e),o="type"in t&&"secret20"===t.type;let s=!1;for(const e of i)if(t.coinMinimalDenom===e.coinMinimalDenom){s=!0;break}if(s)if(o){const r=(yield this.getTokensFromChainAndAccount(e)).filter(e=>e.coinMinimalDenom!==t.coinMinimalDenom);yield this.saveTokensToChainAndAccount(e,r)}else{const r=(yield this.getTokensFromChain(e)).filter(e=>e.coinMinimalDenom!==t.coinMinimalDenom);yield this.saveTokensToChain(e,r)}}))}getTokens(e){var t,r;return a(this,void 0,void 0,(function*(){const n=f.ChainIdHelper.parse(e),i=null!==(t=yield this.kvStore.get(n.identifier))&&void 0!==t?t:[];let o=[];if(this.keyRingService.keyRingStatus===p.KeyRingStatus.UNLOCKED){const t=yield this.keyRingService.getKey(e);o=null!==(r=yield this.kvStore.get(`${n.identifier}-${y.Buffer.from(t.address).toString("hex")}`))&&void 0!==r?r:[]}return i.concat(o)}))}clearTokens(e){return a(this,void 0,void 0,(function*(){const t=f.ChainIdHelper.parse(e);yield this.kvStore.set(t.identifier,null);const r=yield this.getTokensToAccountReverse(e);for(const e of r)yield this.kvStore.set(`${t.identifier}-${e}`,null);yield this.setTokensToAccountReverse(e,[])}))}getTokensFromChain(e){var t;return a(this,void 0,void 0,(function*(){const r=f.ChainIdHelper.parse(e);return null!==(t=yield this.kvStore.get(r.identifier))&&void 0!==t?t:[]}))}saveTokensToChain(e,t){return a(this,void 0,void 0,(function*(){const r=f.ChainIdHelper.parse(e);yield this.kvStore.set(r.identifier,t)}))}getTokensFromChainAndAccount(e){var t;return a(this,void 0,void 0,(function*(){const r=f.ChainIdHelper.parse(e),n=yield this.keyRingService.getKey(e);return null!==(t=yield this.kvStore.get(`${r.identifier}-${y.Buffer.from(n.address).toString("hex")}`))&&void 0!==t?t:[]}))}saveTokensToChainAndAccount(e,t){return a(this,void 0,void 0,(function*(){const r=f.ChainIdHelper.parse(e),n=yield this.keyRingService.getKey(e),i=y.Buffer.from(n.address).toString("hex");yield this.kvStore.set(`${r.identifier}-${i}`,t),yield this.insertTokensToAccountReverse(e,i)}))}getTokensToAccountReverse(e){var t;return a(this,void 0,void 0,(function*(){const r=f.ChainIdHelper.parse(e);return null!==(t=yield this.kvStore.get(r.identifier+"-addresses"))&&void 0!==t?t:[]}))}setTokensToAccountReverse(e,t){return a(this,void 0,void 0,(function*(){const r=f.ChainIdHelper.parse(e);yield this.kvStore.set(r.identifier+"-addresses",t)}))}insertTokensToAccountReverse(e,t){return a(this,void 0,void 0,(function*(){const r=yield this.getTokensToAccountReverse(e);r.indexOf(t)<0&&(r.push(t),yield this.setTokensToAccountReverse(e,r))}))}getSecret20ViewingKey(e,t){return a(this,void 0,void 0,(function*(){const r=yield this.getTokens(e);for(const e of r)if("type"in e&&"secret20"===e.type&&e.contractAddress===t)return e.viewingKey;throw new Error("There is no matched secret20")}))}checkOrGrantSecret20ViewingKeyPermission(e,t,r,n){return a(this,void 0,void 0,(function*(){yield this.getSecret20ViewingKey(t,r);const i=v.getSecret20ViewingKeyPermissionType(r);this.permissionService.hasPermisson(t,i,n)||(yield this.permissionService.grantPermission(e,"/access/viewing-key",[t],i,[n])),this.permissionService.checkPermission(e,t,i,n)}))}static validateCurrency(e,t){return a(this,void 0,void 0,(function*(){if("type"in t)switch(t.type){case"cw20":t=yield n.validateCW20Currency(e,t);break;case"secret20":t=yield n.validateSecret20Currency(e,t);break;default:throw new Error("Unknown type of currency")}else t=yield l.CurrencySchema.validateAsync(t);return t}))}static validateCW20Currency(e,t){return a(this,void 0,void 0,(function*(){return t=yield l.CW20CurrencyShema.validateAsync(t),f.Bech32Address.validate(t.contractAddress,e.bech32Config.bech32PrefixAccAddr),t}))}static validateSecret20Currency(e,t){return a(this,void 0,void 0,(function*(){return t=yield l.Secret20CurrencyShema.validateAsync(t),f.Bech32Address.validate(t.contractAddress,e.bech32Config.bech32PrefixAccAddr),t}))}};w=n=i([c.singleton(),s(0,c.inject(u.TYPES.TokensStore)),s(1,c.inject(c.delay(()=>m.InteractionService))),s(2,c.inject(c.delay(()=>g.PermissionService))),s(3,c.inject(d.ChainsService)),s(4,c.inject(c.delay(()=>h.KeyRingService))),o("design:paramtypes",[Object,m.InteractionService,g.PermissionService,d.ChainsService,h.KeyRingService])],w),t.TokensService=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ROUTE=void 0,t.ROUTE="tokens"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitSecret20ViewingKeyPermissionType=t.isSecret20ViewingKeyPermissionType=t.getSecret20ViewingKeyPermissionType=void 0,t.getSecret20ViewingKeyPermissionType=function(e){return"viewing-key/"+e},t.isSecret20ViewingKeyPermissionType=function(e){return e.startsWith("viewing-key/")},t.splitSecret20ViewingKeyPermissionType=function(e){return e.replace("viewing-key/","")}},,,,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(532),t)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionRouter=void 0;const i=r(18),o=r(173);class s extends i.Router{constructor(e){super(e),this.onMessage=(e,t)=>{var r,n;if(e.port===this.port&&(!(null===(n=null===(r=e.msg)||void 0===r?void 0:r.routerMeta)||void 0===n?void 0:n.receiverRouterId)||e.msg.routerMeta.receiverRouterId===o.getKeplrExtensionRouterId()))return this.onMessageHandler(e,t)}}listen(e){if(!e)throw new Error("Empty port");this.port=e,browser.runtime.onMessage.addListener(this.onMessage)}unlisten(){this.port="",browser.runtime.onMessage.removeListener(this.onMessage)}onMessageHandler(e,t){return n(this,void 0,void 0,(function*(){try{return{return:yield this.handleMessage(e,t)}}catch(t){return console.log(`Failed to process msg ${e.type}: ${(null==t?void 0:t.message)||(null==t?void 0:t.toString())}`),t?Promise.resolve({error:t.message||t.toString()}):Promise.resolve({error:"Unknown error, and error is null"})}}))}}t.ExtensionRouter=s},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.InExtensionMessageRequester=void 0;const i=r(18),o=r(173);t.InExtensionMessageRequester=class{sendMessage(e,t){return n(this,void 0,void 0,(function*(){t.validateBasic(),t.origin=window.location.origin,t.routerMeta=Object.assign(Object.assign({},t.routerMeta),{routerId:o.getKeplrExtensionRouterId()});const r=i.JSONUint8Array.unwrap(yield browser.runtime.sendMessage({port:e,type:t.type(),msg:i.JSONUint8Array.wrap(t)}));if(!r)throw new Error("Null result");if(r.error)throw new Error(r.error);return r.return}))}static sendMessageToTab(e,t,r){return n(this,void 0,void 0,(function*(){r.validateBasic(),r.origin=window.location.origin,r.routerMeta=Object.assign(Object.assign({},r.routerMeta),{routerId:o.getKeplrExtensionRouterId()});const n=i.JSONUint8Array.unwrap(yield browser.tabs.sendMessage(e,{port:t,type:r.type(),msg:i.JSONUint8Array.wrap(r)}));if(!n)throw new Error("Null result");if(n.error)throw new Error(n.error);return n.return}))}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentScriptMessageRequester=void 0;const i=r(18),o=r(173);t.ContentScriptMessageRequester=class{sendMessage(e,t){return n(this,void 0,void 0,(function*(){t.validateBasic(),t.origin=window.location.origin,t.routerMeta=Object.assign(Object.assign({},t.routerMeta),{routerId:o.getKeplrExtensionRouterId()});const r=i.JSONUint8Array.wrap(t),n=yield browser.tabs.query({discarded:!1,status:"complete"});for(let i=0;i{if(!r.url)throw new Error("url is empty");if(!t.origin)throw new Error("origin is empty");if(new URL(r.url).origin!==t.origin)throw new Error("Invalid origin");return Promise.resolve()},n.checkMessageIsInternal=(e,t,r)=>{if(!e.isInternalMsg&&!t.approveExternal(e,r))throw new Error("Permission rejected");return Promise.resolve()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentScriptGuards=void 0;class n{}t.ContentScriptGuards=n,n.checkMessageIsInternal=(e,t,r)=>{if(!e.isInternalMsg||t.approveExternal(e,r))throw new Error("Content script can't handle the message that is able to be sent from external");return Promise.resolve()}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(539),t),i(r(540),t)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionEnv=void 0;const i=r(18),o=r(182),s=r(226);const a=new class{constructor(){this.workingOnPromise=!1,this.queue=[]}enqueue(e){return new Promise((t,r)=>{this.queue.push({fn:e,resolve:t,reject:r}),this.dequeue()})}dequeue(){if(this.workingOnPromise)return;const e=this.queue.shift();e&&(this.workingOnPromise=!0,e.fn().then(t=>{e.resolve(t)}).catch(t=>{e.reject(t)}).finally(()=>{this.workingOnPromise=!1,this.dequeue()}))}};class c{}t.ExtensionEnv=c,c.produceEnv=(e,t)=>{const r=c.checkIsInternalMessage(e,browser.runtime.id,browser.runtime.getURL("/")),u="interaction=true&interactionInternal="+r,l=(e,t,r)=>n(void 0,void 0,void 0,(function*(){e.startsWith("/")&&(e=e.slice(1)),(e=browser.runtime.getURL("/popup.html#/"+e)).includes("?")?e+="&"+u:e+="?"+u;const c=yield function(e,t="default"){return n(this,void 0,void 0,(function*(){return yield a.enqueue(()=>o.openPopupWindow(e,t))}))}(e,null==r?void 0:r.channel),l=(yield browser.windows.get(c,{populate:!0})).tabs[0].id;return yield n(void 0,void 0,void 0,(function*(){if("complete"!==(yield browser.tabs.get(l)).status)return new Promise(e=>{browser.tabs.onUpdated.addListener((t,r)=>{l===t&&"complete"===r.status&&e()})})})),yield s.InExtensionMessageRequester.sendMessageToTab(l,i.APP_PORT,t)}));if(r){return{isInternalMsg:r,requestInteraction:(r,o,a)=>n(void 0,void 0,void 0,(function*(){var n;if(null==a?void 0:a.forceOpenWindow)return yield l(r,o,a);r.startsWith("/")&&(r=r.slice(1)),(r=browser.runtime.getURL("/popup.html#/"+r)).includes("?")?r+="&"+u:r+="?"+u;const c=yield browser.runtime.getBackgroundPage(),f=browser.extension.getViews({tabId:null===(n=e.tab)||void 0===n?void 0:n.id}).filter(e=>e.location.href!==c.location.href&&(null==t.routerId||t.routerId===e.keplrExtensionRouterId));if(f.length>0)for(const e of f)e.location.href=r;return o.routerMeta=Object.assign(Object.assign({},o.routerMeta),{receiverRouterId:t.routerId}),yield(new s.InExtensionMessageRequester).sendMessage(i.APP_PORT,o)}))}}return{isInternalMsg:r,requestInteraction:l}},c.checkIsInternalMessage=(e,t,r)=>{if(!e.url)throw new Error("Empty sender url");const n=new URL(e.url);if(!n.origin||"null"===n.origin)throw new Error("Invalid sender url");const i=new URL(r);if(!i.origin||"null"===i.origin)throw new Error("Invalid browser url");return n.origin===i.origin&&e.id===t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentScriptEnv=void 0;class n{}t.ContentScriptEnv=n,n.produceEnv=e=>({isInternalMsg:e.id===browser.runtime.id,requestInteraction:()=>{throw new Error("ContentScriptEnv doesn't support `requestInteraction`")}})},,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PricePretty=void 0;const n=r(235),i=r(111),o=r(153);class s{constructor(e,t){this._fiatCurrency=e,this.amount=t,this._options={separator:"",upperCase:!1,lowerCase:!1,locale:"en-US"},this.intPretty="toDec"in t?new n.IntPretty(t.toDec()):new n.IntPretty(t),this.intPretty=this.intPretty.maxDecimals(e.maxDecimals).shrink(!0).trim(!0).locale(!1),this._options.locale=e.locale}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}get symbol(){return this._fiatCurrency.symbol}get fiatCurrency(){return this._fiatCurrency}separator(e){const t=this.clone();return t._options.separator=e,t}upperCase(e){const t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){const t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}precision(e){const t=this.clone();return t.intPretty=t.intPretty.precision(e),t}increasePrecision(e){const t=this.clone();return t.intPretty=t.intPretty.increasePrecision(e),t}decreasePrecision(e){const t=this.clone();return t.intPretty=t.intPretty.decreasePrecision(e),t}maxDecimals(e){const t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}trim(e){const t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){const t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){const t=this.clone();return t._options.locale=e,t}ready(e){const t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){const t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){const t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){const t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){const t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){let e=this.symbol;this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());const t=this.toDec(),r=this.options;if(t.gt(new i.Dec(0))){const n=new i.Dec(1).quo(o.DecUtils.getPrecisionDec(this.options.maxDecimals));if(t.lt(n)){const t=parseFloat(n.toString(r.maxDecimals)).toLocaleString(r.locale,{maximumFractionDigits:r.maxDecimals});return`< ${e}${this._options.separator}${t}`}}const n=parseFloat(this.intPretty.toString()).toLocaleString(r.locale,{maximumFractionDigits:r.maxDecimals});return`${e}${this._options.separator}${n}`}clone(){const e=new s(this._fiatCurrency,this.amount);return e._options=Object.assign({},this._options),e.intPretty=this.intPretty.clone(),e}}t.PricePretty=s},function(e,t){(function(t){e.exports=t}).call(this,{})},,,,,,,function(e,t,r){"use strict";var n={};(0,r(91).assign)(n,r(810),r(813),r(459)),e.exports=n},,,,,,,,,function(e,t,r){"use strict";(function(t){!function(r){function n(e){const t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);let r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,c=528734635,u=1541459225;const l=new Uint32Array(64);function f(e){let f=0,d=e.length;for(;d>=64;){let h,p,m,g,y,b=r,v=n,w=i,_=o,k=s,S=a,E=c,O=u;for(p=0;p<16;p++)m=f+4*p,l[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)h=l[p-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=l[p-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,l[p]=(g+l[p-7]|0)+(y+l[p-16]|0)|0;for(p=0;p<64;p++)g=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&S^~k&E)|0)+(O+(t[p]+l[p]|0)|0)|0,y=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,O=E,E=S,S=k,k=_+g|0,_=w,w=v,v=b,b=g+y|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+_|0,s=s+k|0,a=a+S|0,c=c+E|0,u=u+O|0,f+=64,d-=64}}f(e);let d,h=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),d=h+1;d>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),f(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),s=new Array(64);let a,c=[];for(a=0;a<64;a++)o[a]=54;for(a=0;a=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)u(),c=c.concat(n(s.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(s.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(u(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),a(i,n),u(i,0,e,t+16*o,16);for(o=0;o>>32-t}function a(e,t){u(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i=256)return!1}return!0}function f(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function d(e,r,n,s,a,d,h){if(n=f(n,"N"),s=f(s,"r"),a=f(a,"p"),d=f(d,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>2147483647/128/s)throw new Error("N too large");if(s>2147483647/128/a)throw new Error("r too large");if(!l(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!l(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);let p=i(e,r,128*a*s);const m=new Uint32Array(32*a*s);for(let e=0;ej&&(t=j);for(let e=0;ej&&(t=j);for(let e=0;e>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,d);return h&&h(null,1,r),r}h&&P(I)};if(!h)for(;;){const e=I();if(null!=e)return e}I()}const h={scrypt:function(e,t,r,n,i,o,s){return new Promise((function(a,c){let u=0;s&&s(0),d(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)s&&1!==u&&s(1),a(new Uint8Array(r));else if(s&&t!==u)return u=t,s(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(d(e,t,r,n,i,o))}};e.exports=h}()}).call(this,r(328).setImmediate)},,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinPretty=void 0;const n=r(235),i=r(153);class o{constructor(e,t){this._currency=e,this.amount=t,this._options={separator:" ",upperCase:!1,lowerCase:!1,hideDenom:!1},"toDec"in this.amount&&(this.amount=this.amount.toDec()),this.intPretty=new n.IntPretty(this.amount),0===this.intPretty.options.precision?this.intPretty=this.intPretty.maxDecimals(e.coinDecimals).precision(e.coinDecimals):this.intPretty=this.intPretty.maxDecimals(e.coinDecimals).mul(i.DecUtils.getPrecisionDec(-e.coinDecimals))}get options(){return Object.assign(Object.assign({},this._options),this.intPretty.options)}get denom(){return this.currency.coinDenom}get currency(){return this._currency}setCurrency(e){const t=new o(e,this.amount);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}separator(e){const t=this.clone();return t._options.separator=e,t}upperCase(e){const t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){const t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}hideDenom(e){const t=this.clone();return t._options.hideDenom=e,t}precision(e){const t=this.clone();return t.intPretty=t.intPretty.precision(e),t}increasePrecision(e){const t=this.clone();return t.intPretty=t.intPretty.increasePrecision(e),t}decreasePrecision(e){const t=this.clone();return t.intPretty=t.intPretty.decreasePrecision(e),t}maxDecimals(e){const t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}trim(e){const t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){const t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){const t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){const t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){const t=e instanceof o;if(t&&"currency"in e&&this.currency.coinMinimalDenom!==e.currency.coinMinimalDenom)return this.clone();"toDec"in e&&(e=e.toDec());const r=this.clone();return r.intPretty=r.intPretty.add(t?e:e.mul(i.DecUtils.getPrecisionDec(-this._currency.coinDecimals))),r}sub(e){const t=e instanceof o;if(t&&"currency"in e&&this.currency.coinMinimalDenom!==e.currency.coinMinimalDenom)return this.clone();"toDec"in e&&(e=e.toDec());const r=this.clone();return r.intPretty=r.intPretty.sub(t?e:e.mul(i.DecUtils.getPrecisionDec(-this._currency.coinDecimals))),r}mul(e){const t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){const t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toCoin(){const e=this.toDec().mul(i.DecUtils.getPrecisionDec(this.currency.coinDecimals)).truncate();return{denom:this.currency.coinMinimalDenom,amount:e.toString()}}toString(){let e=this.denom;this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this._options.separator;return this._options.hideDenom&&(e="",t=""),`${this.intPretty.toString()}${t}${e}`}clone(){const e=new o(this._currency,this.amount);return e._options=Object.assign({},this._options),e.intPretty=this.intPretty.clone(),e}}t.CoinPretty=o},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseAccount=void 0;const i=r(21);class o{constructor(e,t,r,n){this.type=e,this.address=t,this.accountNumber=r,this.sequence=n}static fetchFromRest(e,t,r=!1){return n(this,void 0,void 0,(function*(){const n=yield e.get("auth/accounts/"+t);return o.fromAminoJSON(n.data,r?t:"")}))}static fromAminoJSON(e,t=""){"height"in e&&(e=e.result);const r=e.type||"";let n="value"in e?e.value:e;const s=n.BaseAccount||n.baseAccount||n.base_account;s&&(n=s);const a=n.BaseVestingAccount||n.baseVestingAccount||n.base_vesting_account;a&&(n=a.BaseAccount||a.baseAccount||a.base_account);let c=n.address;if(!c){if(!t)throw new Error("Account's address is unknown: "+JSON.stringify(e));c=t}const u=n.account_number,l=n.sequence;return new o(r,c,new i.Int(null!=u?u:"0"),new i.Int(null!=l?l:"0"))}getType(){return this.type}getAddress(){return this.address}getAccountNumber(){return this.accountNumber}getSequence(){return this.sequence}}t.BaseAccount=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChainIdHelper=void 0;class n{static parse(e){const t=e.split(n.VersionFormatRegExp).filter(Boolean);return 2!==t.length?{identifier:e,version:0}:{identifier:t[0],version:parseInt(t[1])}}static hasChainVersion(e){return n.parse(e).identifier!==e}}t.ChainIdHelper=n,n.VersionFormatRegExp=/(.+)-([\d]+)/},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WsReadyState=void 0,function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED",e[e.NONE=4]="NONE"}(t.WsReadyState||(t.WsReadyState={}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(361),t),i(r(155),t),i(r(370),t),i(r(607),t)},function(e,t,r){"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(362),n.BufferWriter=r(601),n.Reader=r(368),n.BufferReader=r(602),n.util=r(101),n.rpc=r(603),n.roots=r(605),n.configure=i,i()},function(e,t,r){"use strict";e.exports=i;var n=r(101);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},function(e,t,r){"use strict";e.exports=o;var n=r(362);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(101);function o(){n.call(this)}function s(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},function(e,t,r){"use strict";e.exports=o;var n=r(368);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(101);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},function(e,t,r){"use strict";t.Service=r(604)},function(e,t,r){"use strict";e.exports=i;var n=r(101);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tendermint=t.cosmwasm=t.ibc=t.google=t.cosmos=void 0;var n=r(72);const i=n.Reader,o=n.Writer,s=n.util,a={};t.cosmos=a.cosmos=(()=>{const e={};return e.bank=function(){const e={};return e.v1beta1=function(){const e={};return e.Params=function(){function e(e){if(this.sendEnabled=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.sendEnabled&&n.sendEnabled.length||(n.sendEnabled=[]),n.sendEnabled.push(a.cosmos.bank.v1beta1.SendEnabled.decode(e,e.uint32()));break;case 2:n.defaultSendEnabled=e.bool();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.Params)return e;var t=new a.cosmos.bank.v1beta1.Params;if(e.sendEnabled){if(!Array.isArray(e.sendEnabled))throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: array expected");t.sendEnabled=[];for(var r=0;r>>3){case 1:n.denom=e.string();break;case 2:n.enabled=e.bool();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.SendEnabled)return e;var t=new a.cosmos.bank.v1beta1.SendEnabled;return null!=e.denom&&(t.denom=String(e.denom)),null!=e.enabled&&(t.enabled=Boolean(e.enabled)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.denom="",r.enabled=!1),null!=e.denom&&e.hasOwnProperty("denom")&&(r.denom=e.denom),null!=e.enabled&&e.hasOwnProperty("enabled")&&(r.enabled=e.enabled),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.Input=function(){function e(e){if(this.coins=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.string();break;case 2:n.coins&&n.coins.length||(n.coins=[]),n.coins.push(a.cosmos.base.v1beta1.Coin.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.Input)return e;var t=new a.cosmos.bank.v1beta1.Input;if(null!=e.address&&(t.address=String(e.address)),e.coins){if(!Array.isArray(e.coins))throw TypeError(".cosmos.bank.v1beta1.Input.coins: array expected");t.coins=[];for(var r=0;r>>3){case 1:n.address=e.string();break;case 2:n.coins&&n.coins.length||(n.coins=[]),n.coins.push(a.cosmos.base.v1beta1.Coin.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.Output)return e;var t=new a.cosmos.bank.v1beta1.Output;if(null!=e.address&&(t.address=String(e.address)),e.coins){if(!Array.isArray(e.coins))throw TypeError(".cosmos.bank.v1beta1.Output.coins: array expected");t.coins=[];for(var r=0;r>>3){case 1:n.total&&n.total.length||(n.total=[]),n.total.push(a.cosmos.base.v1beta1.Coin.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.Supply)return e;var t=new a.cosmos.bank.v1beta1.Supply;if(e.total){if(!Array.isArray(e.total))throw TypeError(".cosmos.bank.v1beta1.Supply.total: array expected");t.total=[];for(var r=0;r>>3){case 1:n.denom=e.string();break;case 2:n.exponent=e.uint32();break;case 3:n.aliases&&n.aliases.length||(n.aliases=[]),n.aliases.push(e.string());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.DenomUnit)return e;var t=new a.cosmos.bank.v1beta1.DenomUnit;if(null!=e.denom&&(t.denom=String(e.denom)),null!=e.exponent&&(t.exponent=e.exponent>>>0),e.aliases){if(!Array.isArray(e.aliases))throw TypeError(".cosmos.bank.v1beta1.DenomUnit.aliases: array expected");t.aliases=[];for(var r=0;r>>3){case 1:n.description=e.string();break;case 2:n.denomUnits&&n.denomUnits.length||(n.denomUnits=[]),n.denomUnits.push(a.cosmos.bank.v1beta1.DenomUnit.decode(e,e.uint32()));break;case 3:n.base=e.string();break;case 4:n.display=e.string();break;case 5:n.name=e.string();break;case 6:n.symbol=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.Metadata)return e;var t=new a.cosmos.bank.v1beta1.Metadata;if(null!=e.description&&(t.description=String(e.description)),e.denomUnits){if(!Array.isArray(e.denomUnits))throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: array expected");t.denomUnits=[];for(var r=0;r>>3){case 1:n.fromAddress=e.string();break;case 2:n.toAddress=e.string();break;case 3:n.amount&&n.amount.length||(n.amount=[]),n.amount.push(a.cosmos.base.v1beta1.Coin.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.MsgSend)return e;var t=new a.cosmos.bank.v1beta1.MsgSend;if(null!=e.fromAddress&&(t.fromAddress=String(e.fromAddress)),null!=e.toAddress&&(t.toAddress=String(e.toAddress)),e.amount){if(!Array.isArray(e.amount))throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: array expected");t.amount=[];for(var r=0;r>>3){case 1:n.inputs&&n.inputs.length||(n.inputs=[]),n.inputs.push(a.cosmos.bank.v1beta1.Input.decode(e,e.uint32()));break;case 2:n.outputs&&n.outputs.length||(n.outputs=[]),n.outputs.push(a.cosmos.bank.v1beta1.Output.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.bank.v1beta1.MsgMultiSend)return e;var t=new a.cosmos.bank.v1beta1.MsgMultiSend;if(e.inputs){if(!Array.isArray(e.inputs))throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: array expected");t.inputs=[];for(var r=0;r>>3){case 1:n.delegatorAddress=e.string();break;case 2:n.validatorAddress=e.string();break;case 3:n.amount=a.cosmos.base.v1beta1.Coin.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.staking.v1beta1.MsgDelegate)return e;var t=new a.cosmos.staking.v1beta1.MsgDelegate;if(null!=e.delegatorAddress&&(t.delegatorAddress=String(e.delegatorAddress)),null!=e.validatorAddress&&(t.validatorAddress=String(e.validatorAddress)),null!=e.amount){if("object"!=typeof e.amount)throw TypeError(".cosmos.staking.v1beta1.MsgDelegate.amount: object expected");t.amount=a.cosmos.base.v1beta1.Coin.fromObject(e.amount)}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.delegatorAddress="",r.validatorAddress="",r.amount=null),null!=e.delegatorAddress&&e.hasOwnProperty("delegatorAddress")&&(r.delegatorAddress=e.delegatorAddress),null!=e.validatorAddress&&e.hasOwnProperty("validatorAddress")&&(r.validatorAddress=e.validatorAddress),null!=e.amount&&e.hasOwnProperty("amount")&&(r.amount=a.cosmos.base.v1beta1.Coin.toObject(e.amount,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.MsgDelegateResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.delegatorAddress=e.string();break;case 2:n.validatorSrcAddress=e.string();break;case 3:n.validatorDstAddress=e.string();break;case 4:n.amount=a.cosmos.base.v1beta1.Coin.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.staking.v1beta1.MsgBeginRedelegate)return e;var t=new a.cosmos.staking.v1beta1.MsgBeginRedelegate;if(null!=e.delegatorAddress&&(t.delegatorAddress=String(e.delegatorAddress)),null!=e.validatorSrcAddress&&(t.validatorSrcAddress=String(e.validatorSrcAddress)),null!=e.validatorDstAddress&&(t.validatorDstAddress=String(e.validatorDstAddress)),null!=e.amount){if("object"!=typeof e.amount)throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegate.amount: object expected");t.amount=a.cosmos.base.v1beta1.Coin.fromObject(e.amount)}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.delegatorAddress="",r.validatorSrcAddress="",r.validatorDstAddress="",r.amount=null),null!=e.delegatorAddress&&e.hasOwnProperty("delegatorAddress")&&(r.delegatorAddress=e.delegatorAddress),null!=e.validatorSrcAddress&&e.hasOwnProperty("validatorSrcAddress")&&(r.validatorSrcAddress=e.validatorSrcAddress),null!=e.validatorDstAddress&&e.hasOwnProperty("validatorDstAddress")&&(r.validatorDstAddress=e.validatorDstAddress),null!=e.amount&&e.hasOwnProperty("amount")&&(r.amount=a.cosmos.base.v1beta1.Coin.toObject(e.amount,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.MsgBeginRedelegateResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.completionTime=a.google.protobuf.Timestamp.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.staking.v1beta1.MsgBeginRedelegateResponse)return e;var t=new a.cosmos.staking.v1beta1.MsgBeginRedelegateResponse;if(null!=e.completionTime){if("object"!=typeof e.completionTime)throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegateResponse.completionTime: object expected");t.completionTime=a.google.protobuf.Timestamp.fromObject(e.completionTime)}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.completionTime=null),null!=e.completionTime&&e.hasOwnProperty("completionTime")&&(r.completionTime=a.google.protobuf.Timestamp.toObject(e.completionTime,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.MsgUndelegate=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.delegatorAddress=e.string();break;case 2:n.validatorAddress=e.string();break;case 3:n.amount=a.cosmos.base.v1beta1.Coin.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.staking.v1beta1.MsgUndelegate)return e;var t=new a.cosmos.staking.v1beta1.MsgUndelegate;if(null!=e.delegatorAddress&&(t.delegatorAddress=String(e.delegatorAddress)),null!=e.validatorAddress&&(t.validatorAddress=String(e.validatorAddress)),null!=e.amount){if("object"!=typeof e.amount)throw TypeError(".cosmos.staking.v1beta1.MsgUndelegate.amount: object expected");t.amount=a.cosmos.base.v1beta1.Coin.fromObject(e.amount)}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.delegatorAddress="",r.validatorAddress="",r.amount=null),null!=e.delegatorAddress&&e.hasOwnProperty("delegatorAddress")&&(r.delegatorAddress=e.delegatorAddress),null!=e.validatorAddress&&e.hasOwnProperty("validatorAddress")&&(r.validatorAddress=e.validatorAddress),null!=e.amount&&e.hasOwnProperty("amount")&&(r.amount=a.cosmos.base.v1beta1.Coin.toObject(e.amount,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.MsgUndelegateResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.completionTime=a.google.protobuf.Timestamp.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.staking.v1beta1.MsgUndelegateResponse)return e;var t=new a.cosmos.staking.v1beta1.MsgUndelegateResponse;if(null!=e.completionTime){if("object"!=typeof e.completionTime)throw TypeError(".cosmos.staking.v1beta1.MsgUndelegateResponse.completionTime: object expected");t.completionTime=a.google.protobuf.Timestamp.fromObject(e.completionTime)}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.completionTime=null),null!=e.completionTime&&e.hasOwnProperty("completionTime")&&(r.completionTime=a.google.protobuf.Timestamp.toObject(e.completionTime,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e}(),e.gov=function(){const e={};return e.v1beta1=function(){const e={};return e.VoteOption=function(){const e={},t=Object.create(e);return t[e[0]="VOTE_OPTION_UNSPECIFIED"]=0,t[e[1]="VOTE_OPTION_YES"]=1,t[e[2]="VOTE_OPTION_ABSTAIN"]=2,t[e[3]="VOTE_OPTION_NO"]=3,t[e[4]="VOTE_OPTION_NO_WITH_VETO"]=4,t}(),e.Msg=function(){function e(e,t,r){n.rpc.Service.call(this,e,t,r)}return(e.prototype=Object.create(n.rpc.Service.prototype)).constructor=e,e.create=function(e,t,r){return new this(e,t,r)},Object.defineProperty(e.prototype.vote=function e(t,r){return this.rpcCall(e,a.cosmos.gov.v1beta1.MsgVote,a.cosmos.gov.v1beta1.MsgVoteResponse,t,r)},"name",{value:"Vote"}),Object.defineProperty(e.prototype.deposit=function e(t,r){return this.rpcCall(e,a.cosmos.gov.v1beta1.MsgDeposit,a.cosmos.gov.v1beta1.MsgDepositResponse,t,r)},"name",{value:"Deposit"}),e}(),e.MsgVote=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.proposalId=e.uint64();break;case 2:n.voter=e.string();break;case 3:n.option=e.int32();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.gov.v1beta1.MsgVote)return e;var t=new a.cosmos.gov.v1beta1.MsgVote;switch(null!=e.proposalId&&(s.Long?(t.proposalId=s.Long.fromValue(e.proposalId)).unsigned=!0:"string"==typeof e.proposalId?t.proposalId=parseInt(e.proposalId,10):"number"==typeof e.proposalId?t.proposalId=e.proposalId:"object"==typeof e.proposalId&&(t.proposalId=new s.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber(!0))),null!=e.voter&&(t.voter=String(e.voter)),e.option){case"VOTE_OPTION_UNSPECIFIED":case 0:t.option=0;break;case"VOTE_OPTION_YES":case 1:t.option=1;break;case"VOTE_OPTION_ABSTAIN":case 2:t.option=2;break;case"VOTE_OPTION_NO":case 3:t.option=3;break;case"VOTE_OPTION_NO_WITH_VETO":case 4:t.option=4}return t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(s.Long){var n=new s.Long(0,0,!0);r.proposalId=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.proposalId=t.longs===String?"0":0;r.voter="",r.option=t.enums===String?"VOTE_OPTION_UNSPECIFIED":0}return null!=e.proposalId&&e.hasOwnProperty("proposalId")&&("number"==typeof e.proposalId?r.proposalId=t.longs===String?String(e.proposalId):e.proposalId:r.proposalId=t.longs===String?s.Long.prototype.toString.call(e.proposalId):t.longs===Number?new s.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber(!0):e.proposalId),null!=e.voter&&e.hasOwnProperty("voter")&&(r.voter=e.voter),null!=e.option&&e.hasOwnProperty("option")&&(r.option=t.enums===String?a.cosmos.gov.v1beta1.VoteOption[e.option]:e.option),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.MsgVoteResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.proposalId=e.uint64();break;case 2:n.depositor=e.string();break;case 3:n.amount&&n.amount.length||(n.amount=[]),n.amount.push(a.cosmos.base.v1beta1.Coin.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.gov.v1beta1.MsgDeposit)return e;var t=new a.cosmos.gov.v1beta1.MsgDeposit;if(null!=e.proposalId&&(s.Long?(t.proposalId=s.Long.fromValue(e.proposalId)).unsigned=!0:"string"==typeof e.proposalId?t.proposalId=parseInt(e.proposalId,10):"number"==typeof e.proposalId?t.proposalId=e.proposalId:"object"==typeof e.proposalId&&(t.proposalId=new s.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber(!0))),null!=e.depositor&&(t.depositor=String(e.depositor)),e.amount){if(!Array.isArray(e.amount))throw TypeError(".cosmos.gov.v1beta1.MsgDeposit.amount: array expected");t.amount=[];for(var r=0;r>>0,e.proposalId.high>>>0).toNumber(!0):e.proposalId),null!=e.depositor&&e.hasOwnProperty("depositor")&&(r.depositor=e.depositor),e.amount&&e.amount.length){r.amount=[];for(var i=0;i>>3){case 1:n.delegatorAddress=e.string();break;case 2:n.validatorAddress=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward)return e;var t=new a.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward;return null!=e.delegatorAddress&&(t.delegatorAddress=String(e.delegatorAddress)),null!=e.validatorAddress&&(t.validatorAddress=String(e.validatorAddress)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.delegatorAddress="",r.validatorAddress=""),null!=e.delegatorAddress&&e.hasOwnProperty("delegatorAddress")&&(r.delegatorAddress=e.delegatorAddress),null!=e.validatorAddress&&e.hasOwnProperty("validatorAddress")&&(r.validatorAddress=e.validatorAddress),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.MsgWithdrawDelegatorRewardResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.denom=e.string();break;case 2:n.amount=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.base.v1beta1.Coin)return e;var t=new a.cosmos.base.v1beta1.Coin;return null!=e.denom&&(t.denom=String(e.denom)),null!=e.amount&&(t.amount=String(e.amount)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.denom="",r.amount=""),null!=e.denom&&e.hasOwnProperty("denom")&&(r.denom=e.denom),null!=e.amount&&e.hasOwnProperty("amount")&&(r.amount=e.amount),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.DecCoin=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.denom=e.string();break;case 2:n.amount=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.base.v1beta1.DecCoin)return e;var t=new a.cosmos.base.v1beta1.DecCoin;return null!=e.denom&&(t.denom=String(e.denom)),null!=e.amount&&(t.amount=String(e.amount)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.denom="",r.amount=""),null!=e.denom&&e.hasOwnProperty("denom")&&(r.denom=e.denom),null!=e.amount&&e.hasOwnProperty("amount")&&(r.amount=e.amount),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.IntProto=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.int=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.base.v1beta1.IntProto)return e;var t=new a.cosmos.base.v1beta1.IntProto;return null!=e.int&&(t.int=String(e.int)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.int=""),null!=e.int&&e.hasOwnProperty("int")&&(r.int=e.int),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.DecProto=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.dec=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.base.v1beta1.DecProto)return e;var t=new a.cosmos.base.v1beta1.DecProto;return null!=e.dec&&(t.dec=String(e.dec)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.dec=""),null!=e.dec&&e.hasOwnProperty("dec")&&(r.dec=e.dec),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e.abci=function(){const e={};return e.v1beta1=function(){const e={};return e.MsgData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.msgType=e.string();break;case 2:n.data=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.base.abci.v1beta1.MsgData)return e;var t=new a.cosmos.base.abci.v1beta1.MsgData;return null!=e.msgType&&(t.msgType=String(e.msgType)),null!=e.data&&("string"==typeof e.data?s.base64.decode(e.data,t.data=s.newBuffer(s.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.msgType="",t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=s.newBuffer(r.data)))),null!=e.msgType&&e.hasOwnProperty("msgType")&&(r.msgType=e.msgType),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?s.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.TxMsgData=function(){function e(e){if(this.data=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.data&&n.data.length||(n.data=[]),n.data.push(a.cosmos.base.abci.v1beta1.MsgData.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.base.abci.v1beta1.TxMsgData)return e;var t=new a.cosmos.base.abci.v1beta1.TxMsgData;if(e.data){if(!Array.isArray(e.data))throw TypeError(".cosmos.base.abci.v1beta1.TxMsgData.data: array expected");t.data=[];for(var r=0;r>>3){case 1:n.signatures&&n.signatures.length||(n.signatures=[]),n.signatures.push(e.bytes());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.crypto.multisig.v1beta1.MultiSignature)return e;var t=new a.cosmos.crypto.multisig.v1beta1.MultiSignature;if(e.signatures){if(!Array.isArray(e.signatures))throw TypeError(".cosmos.crypto.multisig.v1beta1.MultiSignature.signatures: array expected");t.signatures=[];for(var r=0;r>>3){case 1:n.extraBitsStored=e.uint32();break;case 2:n.elems=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.crypto.multisig.v1beta1.CompactBitArray)return e;var t=new a.cosmos.crypto.multisig.v1beta1.CompactBitArray;return null!=e.extraBitsStored&&(t.extraBitsStored=e.extraBitsStored>>>0),null!=e.elems&&("string"==typeof e.elems?s.base64.decode(e.elems,t.elems=s.newBuffer(s.base64.length(e.elems)),0):e.elems.length&&(t.elems=e.elems)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.extraBitsStored=0,t.bytes===String?r.elems="":(r.elems=[],t.bytes!==Array&&(r.elems=s.newBuffer(r.elems)))),null!=e.extraBitsStored&&e.hasOwnProperty("extraBitsStored")&&(r.extraBitsStored=e.extraBitsStored),null!=e.elems&&e.hasOwnProperty("elems")&&(r.elems=t.bytes===String?s.base64.encode(e.elems,0,e.elems.length):t.bytes===Array?Array.prototype.slice.call(e.elems):e.elems),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e}(),e.secp256k1=function(){const e={};return e.PubKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.key=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.crypto.secp256k1.PubKey)return e;var t=new a.cosmos.crypto.secp256k1.PubKey;return null!=e.key&&("string"==typeof e.key?s.base64.decode(e.key,t.key=s.newBuffer(s.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.key="":(r.key=[],t.bytes!==Array&&(r.key=s.newBuffer(r.key)))),null!=e.key&&e.hasOwnProperty("key")&&(r.key=t.bytes===String?s.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.PrivKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.key=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.crypto.secp256k1.PrivKey)return e;var t=new a.cosmos.crypto.secp256k1.PrivKey;return null!=e.key&&("string"==typeof e.key?s.base64.decode(e.key,t.key=s.newBuffer(s.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.key="":(r.key=[],t.bytes!==Array&&(r.key=s.newBuffer(r.key)))),null!=e.key&&e.hasOwnProperty("key")&&(r.key=t.bytes===String?s.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e}(),e.tx=function(){const e={};return e.v1beta1=function(){const e={};return e.Tx=function(){function e(e){if(this.signatures=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.body=a.cosmos.tx.v1beta1.TxBody.decode(e,e.uint32());break;case 2:n.authInfo=a.cosmos.tx.v1beta1.AuthInfo.decode(e,e.uint32());break;case 3:n.signatures&&n.signatures.length||(n.signatures=[]),n.signatures.push(e.bytes());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.Tx)return e;var t=new a.cosmos.tx.v1beta1.Tx;if(null!=e.body){if("object"!=typeof e.body)throw TypeError(".cosmos.tx.v1beta1.Tx.body: object expected");t.body=a.cosmos.tx.v1beta1.TxBody.fromObject(e.body)}if(null!=e.authInfo){if("object"!=typeof e.authInfo)throw TypeError(".cosmos.tx.v1beta1.Tx.authInfo: object expected");t.authInfo=a.cosmos.tx.v1beta1.AuthInfo.fromObject(e.authInfo)}if(e.signatures){if(!Array.isArray(e.signatures))throw TypeError(".cosmos.tx.v1beta1.Tx.signatures: array expected");t.signatures=[];for(var r=0;r>>3){case 1:n.bodyBytes=e.bytes();break;case 2:n.authInfoBytes=e.bytes();break;case 3:n.signatures&&n.signatures.length||(n.signatures=[]),n.signatures.push(e.bytes());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.TxRaw)return e;var t=new a.cosmos.tx.v1beta1.TxRaw;if(null!=e.bodyBytes&&("string"==typeof e.bodyBytes?s.base64.decode(e.bodyBytes,t.bodyBytes=s.newBuffer(s.base64.length(e.bodyBytes)),0):e.bodyBytes.length&&(t.bodyBytes=e.bodyBytes)),null!=e.authInfoBytes&&("string"==typeof e.authInfoBytes?s.base64.decode(e.authInfoBytes,t.authInfoBytes=s.newBuffer(s.base64.length(e.authInfoBytes)),0):e.authInfoBytes.length&&(t.authInfoBytes=e.authInfoBytes)),e.signatures){if(!Array.isArray(e.signatures))throw TypeError(".cosmos.tx.v1beta1.TxRaw.signatures: array expected");t.signatures=[];for(var r=0;r>>3){case 1:n.bodyBytes=e.bytes();break;case 2:n.authInfoBytes=e.bytes();break;case 3:n.chainId=e.string();break;case 4:n.accountNumber=e.uint64();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.SignDoc)return e;var t=new a.cosmos.tx.v1beta1.SignDoc;return null!=e.bodyBytes&&("string"==typeof e.bodyBytes?s.base64.decode(e.bodyBytes,t.bodyBytes=s.newBuffer(s.base64.length(e.bodyBytes)),0):e.bodyBytes.length&&(t.bodyBytes=e.bodyBytes)),null!=e.authInfoBytes&&("string"==typeof e.authInfoBytes?s.base64.decode(e.authInfoBytes,t.authInfoBytes=s.newBuffer(s.base64.length(e.authInfoBytes)),0):e.authInfoBytes.length&&(t.authInfoBytes=e.authInfoBytes)),null!=e.chainId&&(t.chainId=String(e.chainId)),null!=e.accountNumber&&(s.Long?(t.accountNumber=s.Long.fromValue(e.accountNumber)).unsigned=!0:"string"==typeof e.accountNumber?t.accountNumber=parseInt(e.accountNumber,10):"number"==typeof e.accountNumber?t.accountNumber=e.accountNumber:"object"==typeof e.accountNumber&&(t.accountNumber=new s.LongBits(e.accountNumber.low>>>0,e.accountNumber.high>>>0).toNumber(!0))),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults)if(t.bytes===String?r.bodyBytes="":(r.bodyBytes=[],t.bytes!==Array&&(r.bodyBytes=s.newBuffer(r.bodyBytes))),t.bytes===String?r.authInfoBytes="":(r.authInfoBytes=[],t.bytes!==Array&&(r.authInfoBytes=s.newBuffer(r.authInfoBytes))),r.chainId="",s.Long){var n=new s.Long(0,0,!0);r.accountNumber=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.accountNumber=t.longs===String?"0":0;return null!=e.bodyBytes&&e.hasOwnProperty("bodyBytes")&&(r.bodyBytes=t.bytes===String?s.base64.encode(e.bodyBytes,0,e.bodyBytes.length):t.bytes===Array?Array.prototype.slice.call(e.bodyBytes):e.bodyBytes),null!=e.authInfoBytes&&e.hasOwnProperty("authInfoBytes")&&(r.authInfoBytes=t.bytes===String?s.base64.encode(e.authInfoBytes,0,e.authInfoBytes.length):t.bytes===Array?Array.prototype.slice.call(e.authInfoBytes):e.authInfoBytes),null!=e.chainId&&e.hasOwnProperty("chainId")&&(r.chainId=e.chainId),null!=e.accountNumber&&e.hasOwnProperty("accountNumber")&&("number"==typeof e.accountNumber?r.accountNumber=t.longs===String?String(e.accountNumber):e.accountNumber:r.accountNumber=t.longs===String?s.Long.prototype.toString.call(e.accountNumber):t.longs===Number?new s.LongBits(e.accountNumber.low>>>0,e.accountNumber.high>>>0).toNumber(!0):e.accountNumber),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.TxBody=function(){function e(e){if(this.messages=[],this.extensionOptions=[],this.nonCriticalExtensionOptions=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.messages&&n.messages.length||(n.messages=[]),n.messages.push(a.google.protobuf.Any.decode(e,e.uint32()));break;case 2:n.memo=e.string();break;case 3:n.timeoutHeight=e.uint64();break;case 1023:n.extensionOptions&&n.extensionOptions.length||(n.extensionOptions=[]),n.extensionOptions.push(a.google.protobuf.Any.decode(e,e.uint32()));break;case 2047:n.nonCriticalExtensionOptions&&n.nonCriticalExtensionOptions.length||(n.nonCriticalExtensionOptions=[]),n.nonCriticalExtensionOptions.push(a.google.protobuf.Any.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.TxBody)return e;var t=new a.cosmos.tx.v1beta1.TxBody;if(e.messages){if(!Array.isArray(e.messages))throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: array expected");t.messages=[];for(var r=0;r>>0,e.timeoutHeight.high>>>0).toNumber(!0))),e.extensionOptions){if(!Array.isArray(e.extensionOptions))throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: array expected");t.extensionOptions=[];for(r=0;r>>0,e.timeoutHeight.high>>>0).toNumber(!0):e.timeoutHeight),e.extensionOptions&&e.extensionOptions.length){r.extensionOptions=[];for(i=0;i>>3){case 1:n.signerInfos&&n.signerInfos.length||(n.signerInfos=[]),n.signerInfos.push(a.cosmos.tx.v1beta1.SignerInfo.decode(e,e.uint32()));break;case 2:n.fee=a.cosmos.tx.v1beta1.Fee.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.AuthInfo)return e;var t=new a.cosmos.tx.v1beta1.AuthInfo;if(e.signerInfos){if(!Array.isArray(e.signerInfos))throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: array expected");t.signerInfos=[];for(var r=0;r>>3){case 1:n.publicKey=a.google.protobuf.Any.decode(e,e.uint32());break;case 2:n.modeInfo=a.cosmos.tx.v1beta1.ModeInfo.decode(e,e.uint32());break;case 3:n.sequence=e.uint64();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.SignerInfo)return e;var t=new a.cosmos.tx.v1beta1.SignerInfo;if(null!=e.publicKey){if("object"!=typeof e.publicKey)throw TypeError(".cosmos.tx.v1beta1.SignerInfo.publicKey: object expected");t.publicKey=a.google.protobuf.Any.fromObject(e.publicKey)}if(null!=e.modeInfo){if("object"!=typeof e.modeInfo)throw TypeError(".cosmos.tx.v1beta1.SignerInfo.modeInfo: object expected");t.modeInfo=a.cosmos.tx.v1beta1.ModeInfo.fromObject(e.modeInfo)}return null!=e.sequence&&(s.Long?(t.sequence=s.Long.fromValue(e.sequence)).unsigned=!0:"string"==typeof e.sequence?t.sequence=parseInt(e.sequence,10):"number"==typeof e.sequence?t.sequence=e.sequence:"object"==typeof e.sequence&&(t.sequence=new s.LongBits(e.sequence.low>>>0,e.sequence.high>>>0).toNumber(!0))),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults)if(r.publicKey=null,r.modeInfo=null,s.Long){var n=new s.Long(0,0,!0);r.sequence=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.sequence=t.longs===String?"0":0;return null!=e.publicKey&&e.hasOwnProperty("publicKey")&&(r.publicKey=a.google.protobuf.Any.toObject(e.publicKey,t)),null!=e.modeInfo&&e.hasOwnProperty("modeInfo")&&(r.modeInfo=a.cosmos.tx.v1beta1.ModeInfo.toObject(e.modeInfo,t)),null!=e.sequence&&e.hasOwnProperty("sequence")&&("number"==typeof e.sequence?r.sequence=t.longs===String?String(e.sequence):e.sequence:r.sequence=t.longs===String?s.Long.prototype.toString.call(e.sequence):t.longs===Number?new s.LongBits(e.sequence.low>>>0,e.sequence.high>>>0).toNumber(!0):e.sequence),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.ModeInfo=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.single=a.cosmos.tx.v1beta1.ModeInfo.Single.decode(e,e.uint32());break;case 2:n.multi=a.cosmos.tx.v1beta1.ModeInfo.Multi.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.ModeInfo)return e;var t=new a.cosmos.tx.v1beta1.ModeInfo;if(null!=e.single){if("object"!=typeof e.single)throw TypeError(".cosmos.tx.v1beta1.ModeInfo.single: object expected");t.single=a.cosmos.tx.v1beta1.ModeInfo.Single.fromObject(e.single)}if(null!=e.multi){if("object"!=typeof e.multi)throw TypeError(".cosmos.tx.v1beta1.ModeInfo.multi: object expected");t.multi=a.cosmos.tx.v1beta1.ModeInfo.Multi.fromObject(e.multi)}return t},e.toObject=function(e,t){t||(t={});var r={};return null!=e.single&&e.hasOwnProperty("single")&&(r.single=a.cosmos.tx.v1beta1.ModeInfo.Single.toObject(e.single,t),t.oneofs&&(r.sum="single")),null!=e.multi&&e.hasOwnProperty("multi")&&(r.multi=a.cosmos.tx.v1beta1.ModeInfo.Multi.toObject(e.multi,t),t.oneofs&&(r.sum="multi")),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.Single=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.mode=e.int32();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.ModeInfo.Single)return e;var t=new a.cosmos.tx.v1beta1.ModeInfo.Single;switch(e.mode){case"SIGN_MODE_UNSPECIFIED":case 0:t.mode=0;break;case"SIGN_MODE_DIRECT":case 1:t.mode=1;break;case"SIGN_MODE_TEXTUAL":case 2:t.mode=2;break;case"SIGN_MODE_LEGACY_AMINO_JSON":case 127:t.mode=127}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.mode=t.enums===String?"SIGN_MODE_UNSPECIFIED":0),null!=e.mode&&e.hasOwnProperty("mode")&&(r.mode=t.enums===String?a.cosmos.tx.signing.v1beta1.SignMode[e.mode]:e.mode),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.Multi=function(){function e(e){if(this.modeInfos=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.bitarray=a.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(e,e.uint32());break;case 2:n.modeInfos&&n.modeInfos.length||(n.modeInfos=[]),n.modeInfos.push(a.cosmos.tx.v1beta1.ModeInfo.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.ModeInfo.Multi)return e;var t=new a.cosmos.tx.v1beta1.ModeInfo.Multi;if(null!=e.bitarray){if("object"!=typeof e.bitarray)throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.bitarray: object expected");t.bitarray=a.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(e.bitarray)}if(e.modeInfos){if(!Array.isArray(e.modeInfos))throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: array expected");t.modeInfos=[];for(var r=0;r>>3){case 1:n.amount&&n.amount.length||(n.amount=[]),n.amount.push(a.cosmos.base.v1beta1.Coin.decode(e,e.uint32()));break;case 2:n.gasLimit=e.uint64();break;case 3:n.payer=e.string();break;case 4:n.granter=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.v1beta1.Fee)return e;var t=new a.cosmos.tx.v1beta1.Fee;if(e.amount){if(!Array.isArray(e.amount))throw TypeError(".cosmos.tx.v1beta1.Fee.amount: array expected");t.amount=[];for(var r=0;r>>0,e.gasLimit.high>>>0).toNumber(!0))),null!=e.payer&&(t.payer=String(e.payer)),null!=e.granter&&(t.granter=String(e.granter)),t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.amount=[]),t.defaults){if(s.Long){var n=new s.Long(0,0,!0);r.gasLimit=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.gasLimit=t.longs===String?"0":0;r.payer="",r.granter=""}if(e.amount&&e.amount.length){r.amount=[];for(var i=0;i>>0,e.gasLimit.high>>>0).toNumber(!0):e.gasLimit),null!=e.payer&&e.hasOwnProperty("payer")&&(r.payer=e.payer),null!=e.granter&&e.hasOwnProperty("granter")&&(r.granter=e.granter),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e.signing=function(){const e={};return e.v1beta1=function(){const e={};return e.SignMode=function(){const e={},t=Object.create(e);return t[e[0]="SIGN_MODE_UNSPECIFIED"]=0,t[e[1]="SIGN_MODE_DIRECT"]=1,t[e[2]="SIGN_MODE_TEXTUAL"]=2,t[e[127]="SIGN_MODE_LEGACY_AMINO_JSON"]=127,t}(),e.SignatureDescriptors=function(){function e(e){if(this.signatures=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.signatures&&n.signatures.length||(n.signatures=[]),n.signatures.push(a.cosmos.tx.signing.v1beta1.SignatureDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.signing.v1beta1.SignatureDescriptors)return e;var t=new a.cosmos.tx.signing.v1beta1.SignatureDescriptors;if(e.signatures){if(!Array.isArray(e.signatures))throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: array expected");t.signatures=[];for(var r=0;r>>3){case 1:n.publicKey=a.google.protobuf.Any.decode(e,e.uint32());break;case 2:n.data=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(e,e.uint32());break;case 3:n.sequence=e.uint64();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.signing.v1beta1.SignatureDescriptor)return e;var t=new a.cosmos.tx.signing.v1beta1.SignatureDescriptor;if(null!=e.publicKey){if("object"!=typeof e.publicKey)throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.publicKey: object expected");t.publicKey=a.google.protobuf.Any.fromObject(e.publicKey)}if(null!=e.data){if("object"!=typeof e.data)throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.data: object expected");t.data=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(e.data)}return null!=e.sequence&&(s.Long?(t.sequence=s.Long.fromValue(e.sequence)).unsigned=!0:"string"==typeof e.sequence?t.sequence=parseInt(e.sequence,10):"number"==typeof e.sequence?t.sequence=e.sequence:"object"==typeof e.sequence&&(t.sequence=new s.LongBits(e.sequence.low>>>0,e.sequence.high>>>0).toNumber(!0))),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults)if(r.publicKey=null,r.data=null,s.Long){var n=new s.Long(0,0,!0);r.sequence=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.sequence=t.longs===String?"0":0;return null!=e.publicKey&&e.hasOwnProperty("publicKey")&&(r.publicKey=a.google.protobuf.Any.toObject(e.publicKey,t)),null!=e.data&&e.hasOwnProperty("data")&&(r.data=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(e.data,t)),null!=e.sequence&&e.hasOwnProperty("sequence")&&("number"==typeof e.sequence?r.sequence=t.longs===String?String(e.sequence):e.sequence:r.sequence=t.longs===String?s.Long.prototype.toString.call(e.sequence):t.longs===Number?new s.LongBits(e.sequence.low>>>0,e.sequence.high>>>0).toNumber(!0):e.sequence),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.Data=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.single=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.decode(e,e.uint32());break;case 2:n.multi=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data)return e;var t=new a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data;if(null!=e.single){if("object"!=typeof e.single)throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.single: object expected");t.single=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.fromObject(e.single)}if(null!=e.multi){if("object"!=typeof e.multi)throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.multi: object expected");t.multi=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.fromObject(e.multi)}return t},e.toObject=function(e,t){t||(t={});var r={};return null!=e.single&&e.hasOwnProperty("single")&&(r.single=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.toObject(e.single,t),t.oneofs&&(r.sum="single")),null!=e.multi&&e.hasOwnProperty("multi")&&(r.multi=a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.toObject(e.multi,t),t.oneofs&&(r.sum="multi")),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.Single=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.mode=e.int32();break;case 2:n.signature=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single)return e;var t=new a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single;switch(e.mode){case"SIGN_MODE_UNSPECIFIED":case 0:t.mode=0;break;case"SIGN_MODE_DIRECT":case 1:t.mode=1;break;case"SIGN_MODE_TEXTUAL":case 2:t.mode=2;break;case"SIGN_MODE_LEGACY_AMINO_JSON":case 127:t.mode=127}return null!=e.signature&&("string"==typeof e.signature?s.base64.decode(e.signature,t.signature=s.newBuffer(s.base64.length(e.signature)),0):e.signature.length&&(t.signature=e.signature)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.mode=t.enums===String?"SIGN_MODE_UNSPECIFIED":0,t.bytes===String?r.signature="":(r.signature=[],t.bytes!==Array&&(r.signature=s.newBuffer(r.signature)))),null!=e.mode&&e.hasOwnProperty("mode")&&(r.mode=t.enums===String?a.cosmos.tx.signing.v1beta1.SignMode[e.mode]:e.mode),null!=e.signature&&e.hasOwnProperty("signature")&&(r.signature=t.bytes===String?s.base64.encode(e.signature,0,e.signature.length):t.bytes===Array?Array.prototype.slice.call(e.signature):e.signature),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.Multi=function(){function e(e){if(this.signatures=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.bitarray=a.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(e,e.uint32());break;case 2:n.signatures&&n.signatures.length||(n.signatures=[]),n.signatures.push(a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi)return e;var t=new a.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi;if(null!=e.bitarray){if("object"!=typeof e.bitarray)throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.bitarray: object expected");t.bitarray=a.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(e.bitarray)}if(e.signatures){if(!Array.isArray(e.signatures))throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: array expected");t.signatures=[];for(var r=0;r{const e={};return e.protobuf=function(){const e={};return e.Any=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.type_url=e.string();break;case 2:n.value=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.google.protobuf.Any)return e;var t=new a.google.protobuf.Any;return null!=e.type_url&&(t.type_url=String(e.type_url)),null!=e.value&&("string"==typeof e.value?s.base64.decode(e.value,t.value=s.newBuffer(s.base64.length(e.value)),0):e.value.length&&(t.value=e.value)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type_url="",t.bytes===String?r.value="":(r.value=[],t.bytes!==Array&&(r.value=s.newBuffer(r.value)))),null!=e.type_url&&e.hasOwnProperty("type_url")&&(r.type_url=e.type_url),null!=e.value&&e.hasOwnProperty("value")&&(r.value=t.bytes===String?s.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.Timestamp=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.seconds=e.int64();break;case 2:n.nanos=e.int32();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.google.protobuf.Timestamp)return e;var t=new a.google.protobuf.Timestamp;return null!=e.seconds&&(s.Long?(t.seconds=s.Long.fromValue(e.seconds)).unsigned=!1:"string"==typeof e.seconds?t.seconds=parseInt(e.seconds,10):"number"==typeof e.seconds?t.seconds=e.seconds:"object"==typeof e.seconds&&(t.seconds=new s.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber())),null!=e.nanos&&(t.nanos=0|e.nanos),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(s.Long){var n=new s.Long(0,0,!1);r.seconds=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.seconds=t.longs===String?"0":0;r.nanos=0}return null!=e.seconds&&e.hasOwnProperty("seconds")&&("number"==typeof e.seconds?r.seconds=t.longs===String?String(e.seconds):e.seconds:r.seconds=t.longs===String?s.Long.prototype.toString.call(e.seconds):t.longs===Number?new s.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber():e.seconds),null!=e.nanos&&e.hasOwnProperty("nanos")&&(r.nanos=e.nanos),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e})(),t.ibc=a.ibc=(()=>{const e={};return e.applications=function(){const e={};return e.transfer=function(){const e={};return e.v1=function(){const e={};return e.Msg=function(){function e(e,t,r){n.rpc.Service.call(this,e,t,r)}return(e.prototype=Object.create(n.rpc.Service.prototype)).constructor=e,e.create=function(e,t,r){return new this(e,t,r)},Object.defineProperty(e.prototype.transfer=function e(t,r){return this.rpcCall(e,a.ibc.applications.transfer.v1.MsgTransfer,a.ibc.applications.transfer.v1.MsgTransferResponse,t,r)},"name",{value:"Transfer"}),e}(),e.MsgTransfer=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.sourcePort=e.string();break;case 2:n.sourceChannel=e.string();break;case 3:n.token=a.cosmos.base.v1beta1.Coin.decode(e,e.uint32());break;case 4:n.sender=e.string();break;case 5:n.receiver=e.string();break;case 6:n.timeoutHeight=a.ibc.core.client.v1.Height.decode(e,e.uint32());break;case 7:n.timeoutTimestamp=e.uint64();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.ibc.applications.transfer.v1.MsgTransfer)return e;var t=new a.ibc.applications.transfer.v1.MsgTransfer;if(null!=e.sourcePort&&(t.sourcePort=String(e.sourcePort)),null!=e.sourceChannel&&(t.sourceChannel=String(e.sourceChannel)),null!=e.token){if("object"!=typeof e.token)throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.token: object expected");t.token=a.cosmos.base.v1beta1.Coin.fromObject(e.token)}if(null!=e.sender&&(t.sender=String(e.sender)),null!=e.receiver&&(t.receiver=String(e.receiver)),null!=e.timeoutHeight){if("object"!=typeof e.timeoutHeight)throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.timeoutHeight: object expected");t.timeoutHeight=a.ibc.core.client.v1.Height.fromObject(e.timeoutHeight)}return null!=e.timeoutTimestamp&&(s.Long?(t.timeoutTimestamp=s.Long.fromValue(e.timeoutTimestamp)).unsigned=!0:"string"==typeof e.timeoutTimestamp?t.timeoutTimestamp=parseInt(e.timeoutTimestamp,10):"number"==typeof e.timeoutTimestamp?t.timeoutTimestamp=e.timeoutTimestamp:"object"==typeof e.timeoutTimestamp&&(t.timeoutTimestamp=new s.LongBits(e.timeoutTimestamp.low>>>0,e.timeoutTimestamp.high>>>0).toNumber(!0))),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults)if(r.sourcePort="",r.sourceChannel="",r.token=null,r.sender="",r.receiver="",r.timeoutHeight=null,s.Long){var n=new s.Long(0,0,!0);r.timeoutTimestamp=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.timeoutTimestamp=t.longs===String?"0":0;return null!=e.sourcePort&&e.hasOwnProperty("sourcePort")&&(r.sourcePort=e.sourcePort),null!=e.sourceChannel&&e.hasOwnProperty("sourceChannel")&&(r.sourceChannel=e.sourceChannel),null!=e.token&&e.hasOwnProperty("token")&&(r.token=a.cosmos.base.v1beta1.Coin.toObject(e.token,t)),null!=e.sender&&e.hasOwnProperty("sender")&&(r.sender=e.sender),null!=e.receiver&&e.hasOwnProperty("receiver")&&(r.receiver=e.receiver),null!=e.timeoutHeight&&e.hasOwnProperty("timeoutHeight")&&(r.timeoutHeight=a.ibc.core.client.v1.Height.toObject(e.timeoutHeight,t)),null!=e.timeoutTimestamp&&e.hasOwnProperty("timeoutTimestamp")&&("number"==typeof e.timeoutTimestamp?r.timeoutTimestamp=t.longs===String?String(e.timeoutTimestamp):e.timeoutTimestamp:r.timeoutTimestamp=t.longs===String?s.Long.prototype.toString.call(e.timeoutTimestamp):t.longs===Number?new s.LongBits(e.timeoutTimestamp.low>>>0,e.timeoutTimestamp.high>>>0).toNumber(!0):e.timeoutTimestamp),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.MsgTransferResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.revisionNumber=e.uint64();break;case 2:n.revisionHeight=e.uint64();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.ibc.core.client.v1.Height)return e;var t=new a.ibc.core.client.v1.Height;return null!=e.revisionNumber&&(s.Long?(t.revisionNumber=s.Long.fromValue(e.revisionNumber)).unsigned=!0:"string"==typeof e.revisionNumber?t.revisionNumber=parseInt(e.revisionNumber,10):"number"==typeof e.revisionNumber?t.revisionNumber=e.revisionNumber:"object"==typeof e.revisionNumber&&(t.revisionNumber=new s.LongBits(e.revisionNumber.low>>>0,e.revisionNumber.high>>>0).toNumber(!0))),null!=e.revisionHeight&&(s.Long?(t.revisionHeight=s.Long.fromValue(e.revisionHeight)).unsigned=!0:"string"==typeof e.revisionHeight?t.revisionHeight=parseInt(e.revisionHeight,10):"number"==typeof e.revisionHeight?t.revisionHeight=e.revisionHeight:"object"==typeof e.revisionHeight&&(t.revisionHeight=new s.LongBits(e.revisionHeight.low>>>0,e.revisionHeight.high>>>0).toNumber(!0))),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(s.Long){var n=new s.Long(0,0,!0);r.revisionNumber=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.revisionNumber=t.longs===String?"0":0;if(s.Long){n=new s.Long(0,0,!0);r.revisionHeight=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.revisionHeight=t.longs===String?"0":0}return null!=e.revisionNumber&&e.hasOwnProperty("revisionNumber")&&("number"==typeof e.revisionNumber?r.revisionNumber=t.longs===String?String(e.revisionNumber):e.revisionNumber:r.revisionNumber=t.longs===String?s.Long.prototype.toString.call(e.revisionNumber):t.longs===Number?new s.LongBits(e.revisionNumber.low>>>0,e.revisionNumber.high>>>0).toNumber(!0):e.revisionNumber),null!=e.revisionHeight&&e.hasOwnProperty("revisionHeight")&&("number"==typeof e.revisionHeight?r.revisionHeight=t.longs===String?String(e.revisionHeight):e.revisionHeight:r.revisionHeight=t.longs===String?s.Long.prototype.toString.call(e.revisionHeight):t.longs===Number?new s.LongBits(e.revisionHeight.low>>>0,e.revisionHeight.high>>>0).toNumber(!0):e.revisionHeight),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e}(),e}(),e})(),t.cosmwasm=a.cosmwasm=(()=>{const e={};return e.wasm=function(){const e={};return e.v1=function(){const e={};return e.MsgExecuteContract=function(){function e(e){if(this.funds=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.sender=e.string();break;case 2:n.contract=e.string();break;case 3:n.msg=e.bytes();break;case 5:n.funds&&n.funds.length||(n.funds=[]),n.funds.push(a.cosmos.base.v1beta1.Coin.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmwasm.wasm.v1.MsgExecuteContract)return e;var t=new a.cosmwasm.wasm.v1.MsgExecuteContract;if(null!=e.sender&&(t.sender=String(e.sender)),null!=e.contract&&(t.contract=String(e.contract)),null!=e.msg&&("string"==typeof e.msg?s.base64.decode(e.msg,t.msg=s.newBuffer(s.base64.length(e.msg)),0):e.msg.length&&(t.msg=e.msg)),e.funds){if(!Array.isArray(e.funds))throw TypeError(".cosmwasm.wasm.v1.MsgExecuteContract.funds: array expected");t.funds=[];for(var r=0;r>>3){case 1:n.data=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.cosmwasm.wasm.v1.MsgExecuteContractResponse)return e;var t=new a.cosmwasm.wasm.v1.MsgExecuteContractResponse;return null!=e.data&&("string"==typeof e.data?s.base64.decode(e.data,t.data=s.newBuffer(s.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=s.newBuffer(r.data)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?s.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e}(),e})(),t.tendermint=a.tendermint=(()=>{const e={};return e.crypto=function(){const e={};return e.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.ed25519=e.bytes();break;case 2:n.secp256k1=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.tendermint.crypto.PublicKey)return e;var t=new a.tendermint.crypto.PublicKey;return null!=e.ed25519&&("string"==typeof e.ed25519?s.base64.decode(e.ed25519,t.ed25519=s.newBuffer(s.base64.length(e.ed25519)),0):e.ed25519.length&&(t.ed25519=e.ed25519)),null!=e.secp256k1&&("string"==typeof e.secp256k1?s.base64.decode(e.secp256k1,t.secp256k1=s.newBuffer(s.base64.length(e.secp256k1)),0):e.secp256k1.length&&(t.secp256k1=e.secp256k1)),t},e.toObject=function(e,t){t||(t={});var r={};return null!=e.ed25519&&e.hasOwnProperty("ed25519")&&(r.ed25519=t.bytes===String?s.base64.encode(e.ed25519,0,e.ed25519.length):t.bytes===Array?Array.prototype.slice.call(e.ed25519):e.ed25519,t.oneofs&&(r.sum="ed25519")),null!=e.secp256k1&&e.hasOwnProperty("secp256k1")&&(r.secp256k1=t.bytes===String?s.base64.encode(e.secp256k1,0,e.secp256k1.length):t.bytes===Array?Array.prototype.slice.call(e.secp256k1):e.secp256k1,t.oneofs&&(r.sum="secp256k1")),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e})(),e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignDocWrapper=void 0;const n=r(370),i=r(155),o=r(371);class s{constructor(e){this.signDoc=e,this.mode="msgs"in e?"amino":"direct","amino"===this.mode?this.isADR36SignDoc=o.checkAndValidateADR36AminoSignDoc(this.aminoSignDoc):this.isADR36SignDoc=!1}static fromAminoSignDoc(e){return new s(e)}static fromDirectSignDoc(e){return new s(e)}static fromDirectSignDocBytes(e){return new s(i.cosmos.tx.v1beta1.SignDoc.decode(e))}clone(){return new s(this.signDoc)}get protoSignDoc(){if("amino"===this.mode)throw new Error("Sign doc is encoded as Amino Json");if("msgs"in this.signDoc)throw new Error("Unexpected error");return this._protoSignDoc||(this._protoSignDoc=new n.ProtoSignDocDecoder(this.signDoc)),this._protoSignDoc}get aminoSignDoc(){if("direct"===this.mode)throw new Error("Sign doc is encoded as Protobuf");if(!("msgs"in this.signDoc))throw new Error("Unexpected error");return this.signDoc}get chainId(){return"direct"===this.mode?this.protoSignDoc.chainId:this.aminoSignDoc.chain_id}get memo(){return"direct"===this.mode?this.protoSignDoc.txBody.memo:this.aminoSignDoc.memo}get fees(){var e,t;if("direct"===this.mode){const r=[];for(const n of null!==(t=null===(e=this.protoSignDoc.authInfo.fee)||void 0===e?void 0:e.amount)&&void 0!==t?t:[]){if(null==n.denom||null==n.amount)throw new Error("Invalid fee");r.push({denom:n.denom,amount:n.amount})}return r}return this.aminoSignDoc.fee.amount}get gas(){var e,t,r;return"direct"===this.mode?null!==(r=null===(t=null===(e=this.protoSignDoc.authInfo.fee)||void 0===e?void 0:e.gasLimit)||void 0===t?void 0:t.toNumber())&&void 0!==r?r:0:parseInt(this.aminoSignDoc.fee.gas)}}t.SignDocWrapper=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyADR36Amino=t.verifyADR36AminoSignDoc=t.makeADR36AminoSignDoc=t.checkAndValidateADR36AminoSignDoc=void 0;const n=r(137),i=r(359),o=r(2),s=r(86);function a(e,t){if(!(()=>{if(e&&e.msgs&&Array.isArray(e.msgs)&&1===e.msgs.length){return"sign/MsgSignData"===e.msgs[0].type}return!1})())return!1;if(""!==e.chain_id)throw new Error("Chain id should be empty string for ADR-36 signing");if(""!==e.memo)throw new Error("Memo should be empty string for ADR-36 signing");if("0"!==e.account_number)throw new Error('Account number should be "0" for ADR-36 signing');if("0"!==e.sequence)throw new Error('Sequence should be "0" for ADR-36 signing');if("0"!==e.fee.gas)throw new Error('Gas should be "0" for ADR-36 signing');if(0!==e.fee.amount.length)throw new Error("Fee amount should be empty array for ADR-36 signing");const r=e.msgs[0];if("sign/MsgSignData"!==r.type)throw new Error("Invalid type of ADR-36 sign msg: "+r.type);if(!r.value)throw new Error("Empty value in the msg");const n=r.value.signer;if(!n)throw new Error("Empty signer in the ADR-36 msg");i.Bech32Address.validate(n,t);const s=r.value.data;if(!s)throw new Error("Empty data in the ADR-36 msg");const a=o.Buffer.from(s,"base64");if(a.toString("base64")!==s)throw new Error("Data is not encoded by base64");if(0===a.length)throw new Error("Empty data in the ADR-36 msg");return!0}function c(e,t){return{chain_id:"",account_number:"0",sequence:"0",fee:{gas:"0",amount:[]},msgs:[{type:"sign/MsgSignData",value:{signer:e,data:t=o.Buffer.from(t).toString("base64")}}],memo:""}}function u(e,t,r,o){if(!a(t,e))throw new Error("Invalid sign doc for ADR-36");const c=new s.PubKeySecp256k1(r);if(new i.Bech32Address(c.getAddress()).toBech32(e)!==t.msgs[0].value.signer)throw new Error("Unmatched signer");const u=n.serializeSignDoc(t);return c.verify(u,o)}t.checkAndValidateADR36AminoSignDoc=a,t.makeADR36AminoSignDoc=c,t.verifyADR36AminoSignDoc=u,t.verifyADR36Amino=function(e,t,r,n,i){return u(e,c(t,r),n,i)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayContentEquals=void 0,t.arrayContentEquals=function(e,t){if(e.length!==t.length)return!1;for(let r=0;rsetTimeout(t,e))}},function(e,t,r){"use strict";(function(e){function r(e){return"object"==typeof e&&null!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=t.isNonNullObject=void 0,t.isNonNullObject=r,t.isUint8Array=function(t){return!!r(t)&&("[object Uint8Array]"===Object.prototype.toString.call(t)&&(void 0===e||void 0===e.isBuffer||!e.isBuffer(t)))}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Bip39=void 0;const s=r(57),a=o(r(102)),c=r(158),u=o(r(391)),l=r(392);t.Bip39=class{static encode(e){if(-1===[16,20,24,28,32].indexOf(e.length))throw new Error("invalid input length");return new l.EnglishMnemonic(a.entropyToMnemonic(s.toHex(e)))}static decode(e){return s.fromHex(a.mnemonicToEntropy(e.toString()))}static async mnemonicToSeed(e,t){const r=s.toUtf8(u.nfkd(e.toString())),n="mnemonic"+(t?u.nfkd(t):""),i=s.toUtf8(n);return this.pbkdf2(r,i,2048,64,"sha512")}static async pbkdf2(e,t,r,n,i){return new Promise((o,s)=>{c.pbkdf2(e,t,r,n,i,(e,t)=>{e?s(e):o(new Uint8Array(t))})})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromAscii=t.toAscii=void 0,t.toAscii=function(e){return Uint8Array.from(e.split("").map(e=>{const t=e.charCodeAt(0);if(t<32||t>126)throw new Error("Cannot encode character that is out of printable ASCII range: "+t);return t}))},t.fromAscii=function(e){return(t=Array.from(e),t.map(e=>{if(e<32||e>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+e);return String.fromCharCode(e)})).join("");var t}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.fromBase64=t.toBase64=void 0;const s=o(r(112));t.toBase64=function(e){return s.fromByteArray(e)},t.fromBase64=function(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return s.toByteArray(e)}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Bech32=void 0;const s=o(r(154));t.Bech32=class{static encode(e,t,r){return s.encode(e,s.toWords(t),r)}static decode(e,t=1/0){const r=s.decode(e,t);return{prefix:r.prefix,data:new Uint8Array(s.fromWords(r.words))}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromHex=t.toHex=void 0,t.toHex=function(e){let t="";for(const r of e)t+=("0"+r.toString(16)).slice(-2);return t},t.fromHex=function(e){if(e.length%2!=0)throw new Error("hex string length must be a multiple of 2");const t=[];for(let r=0;r0?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,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return a(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&s.forEach(u),o||(s.forEach(u),i(n))}))}));return t.reduce(l)}},function(e,t,r){var n=r(11),i=r(115),o=r(13).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+l(h,i,o,a)+c+r[d]+s[h];c=a,a=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.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=c},function(e,t,r){var n=r(11),i=r(115),o=r(13).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),m=u(n)+f(p,i,o,a)+c+r[h]+s[p]|0;c=a,a=o,o=l(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.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=c},function(e,t,r){var n=r(11),i=r(380),o=r(115),s=r(13).Buffer,a=new Array(64);function c(){this.init(),this._w=a,o.call(this,64,56)}n(c,i),c.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},c.prototype._hash=function(){var e=s.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=c},function(e,t,r){var n=r(11),i=r(381),o=r(115),s=r(13).Buffer,a=new Array(160);function c(){this.init(),this._w=a,o.call(this,128,112)}n(c,i),c.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},c.prototype._hash=function(){var e=s.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+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=c},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t){},function(e,t,r){"use strict";var n=r(244).Buffer,i=r(635);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,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,r=o,i=a,t.copy(r,i),a+=s.data.length,s=s.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,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,s,a,c=1,u={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(s+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r64?t=e(t):t.length<64&&(t=i.concat([t,s],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),a=0;a<64;a++)r[a]=54^t[a],n[a]=92^t[a];this._hash=[r]}n(a,o),a.prototype._update=function(e){this._hash.push(e)},a.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=a},function(e,t,r){e.exports=r(395)},function(e,t,r){var n=r(658),i=r(248),o=r(249),s=r(671),a=r(193);function c(e,t,r){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function u(e,t,r){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=a(t,!1,r,n);return c(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=c,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=a(t,!1,r,n);return u(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=u,t.listCiphers=t.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},function(e,t,r){var n=r(88),i=r(659),o=r(11),s=r(13).Buffer,a={"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 c(e){n.call(this);var t,r=e.mode.toLowerCase(),i=a[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var c=e.iv;s.isBuffer(c)||(c=s.from(c)),this._des=i.create({key:o,iv:c,type:t})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=c,o(c,n),c.prototype._update=function(e){return s.from(this._des.update(e))},c.prototype._final=function(){return s.from(this._des.final())}},function(e,t,r){"use strict";t.utils=r(396),t.Cipher=r(247),t.DES=r(397),t.CBC=r(660),t.EDE=r(661)},function(e,t,r){"use strict";var n=r(55),i=r(11),o={};function s(e){n.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),r=-1;++r>s%8,e._prev=o(e._prev,r?n:i);return a}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,s=n.allocUnsafe(o),a=-1;++a>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=s},function(e,t,r){var n=r(401),i=r(13).Buffer,o=r(249),s=r(402),a=r(88),c=r(192),u=r(193);function l(e,t,r){a.call(this),this._cache=new f,this._last=void 0,this._cipher=new c.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function d(e,t,r){var a=o[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===a.type?new s(a.module,t,r,!0):"auth"===a.type?new n(a.module,t,r,!0):new l(a.module,t,r)}r(11)(l,a),l.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},l.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 r=-1;for(;++r16)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},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(t,!1,r.key,r.iv);return d(e,n.key,n.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,r){(function(e){var n=r(403),i=r(675),o=r(676);var s={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,a,c){return e.isBuffer(i)||void 0===s[i]?t(r,"binary",i,a):(i=i||"binary",c=c||"binary",a=a||new e([2]),e.isBuffer(a)||(a=new e(a,c)),"number"==typeof r?new o(n(r,a),a,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,a,!0)))}}).call(this,r(2).Buffer)},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,r){(function(t){var n=r(6),i=new(r(404)),o=new n(24),s=new n(11),a=new n(10),c=new n(3),u=new n(7),l=r(403),f=r(89);function d(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=m;var p={};function m(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=h):this._primeCode=8}function g(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var f,d=0;if(e.isEven()||!l.simpleSieve||!l.fermatTest(e)||!i.test(e))return d+=1,d+="02"===r||"05"===r?8:4,p[n]=d,d;switch(i.test(e.shrn(1))||(d+=2),r){case"02":e.mod(o).cmp(s)&&(d+=8);break;case"05":(f=e.mod(a)).cmp(c)&&f.cmp(u)&&(d+=8);break;default:d+=4}return p[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new n(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length0?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,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return a(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&s.forEach(u),o||(s.forEach(u),i(n))}))}));return t.reduce(l)}},function(e,t,r){var n=r(13).Buffer,i=r(191),o=r(252),s=r(61).ec,a=r(416),c=r(195),u=r(422);function l(e,t,r,o){if((e=n.from(e.toArray())).length0&&r.ishrn(n),r}function d(e,t,r){var o,s;do{for(o=n.alloc(0);8*o.length=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,s|=c}return n(!(240&s),"Invalid character in "+e),i}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),c=t;c=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&s0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?f[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(e);r=(p=p.idivn(l)).isZero()?m+r:f[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,f=67108863&c,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,h=0|s[1],p=8191&h,m=h>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,k=0|s[4],S=8191&k,E=k>>>13,O=0|s[5],M=8191&O,x=O>>>13,A=0|s[6],j=8191&A,P=A>>>13,I=0|s[7],R=8191&I,T=I>>>13,C=0|s[8],B=8191&C,D=C>>>13,N=0|s[9],U=8191&N,z=N>>>13,L=0|a[0],q=8191&L,K=L>>>13,F=0|a[1],$=8191&F,H=F>>>13,J=0|a[2],W=8191&J,G=J>>>13,V=0|a[3],Z=8191&V,Y=V>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],fe=8191&le,de=le>>>13,he=0|a[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(f,q))|0)+((8191&(i=(i=Math.imul(f,K))+Math.imul(d,q)|0))<<13)|0;u=((o=Math.imul(d,K))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,K))+Math.imul(m,q)|0,o=Math.imul(m,K);var ye=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,H)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,K))+Math.imul(b,q)|0,o=Math.imul(b,K),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,K))+Math.imul(_,q)|0,o=Math.imul(_,K),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,Z)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,K))+Math.imul(E,q)|0,o=Math.imul(E,K),n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var we=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(M,q),i=(i=Math.imul(M,K))+Math.imul(x,q)|0,o=Math.imul(x,K),n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var _e=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,K))+Math.imul(P,q)|0,o=Math.imul(P,K),n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var ke=(u+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,K))+Math.imul(T,q)|0,o=Math.imul(T,K),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(u+(n=n+Math.imul(f,ce)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(D,q)|0,o=Math.imul(D,K),n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Ee=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,K))+Math.imul(z,q)|0,o=Math.imul(z,K),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var Oe=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,H))+Math.imul(z,$)|0,o=Math.imul(z,H),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Me=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,G))+Math.imul(z,W)|0,o=Math.imul(z,G),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,de)|0;var xe=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,Z),i=(i=Math.imul(U,Y))+Math.imul(z,Z)|0,o=Math.imul(z,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Ae=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(z,Q)|0,o=Math.imul(z,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var je=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;u=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(z,re)|0,o=Math.imul(z,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,se)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,de)|0;var Pe=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(z,oe)|0,o=Math.imul(z,se),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,de)|0;var Ie=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(z,ce)|0,o=Math.imul(z,ue),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,de)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,fe),i=(i=Math.imul(U,de))+Math.imul(z,fe)|0,o=Math.imul(z,de);var Te=(u+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Ce=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,me))+Math.imul(z,pe)|0))<<13)|0;return u=((o=Math.imul(z,me))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=_e,c[6]=ke,c[7]=Se,c[8]=Ee,c[9]=Oe,c[10]=Me,c[11]=xe,c[12]=Ae,c[13]=je,c[14]=Pe,c[15]=Ie,c[16]=Re,c[17]=Te,c[18]=Ce,0!==u&&(c[19]=u,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.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")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.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)},O.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},O.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)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.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),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var m=h,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,O),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.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)},M.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),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(71)(e))},function(e,t){},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.3","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny ","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.8","grunt":"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.10.3","mocha":"^6.2.2"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}')},function(e,t,r){"use strict";var n=r(56),i=r(6),o=r(11),s=r(194),a=n.assert;function c(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,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.zOne=this.z===this.curve.one}o(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,c,u,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),m=new i(0),g=new i(0),y=new i(1),b=0;0!==d.cmpn(0);){var v=h.div(d);u=h.sub(v.mul(d)),l=g.sub(v.mul(p));var w=y.sub(v.mul(m));if(!n&&u.cmp(f)<0)t=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++b)break;c=u,h=d,d=u,g=p,p=l,y=m,m=w}s=u.neg(),a=l;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.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 r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.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,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.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)},u.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.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))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),d=c.redSqr().redIAdd(l).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),d=a.redMul(l.redISub(f)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(f,d,h)},l.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,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(6),i=r(11),o=r(194),s=r(56);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,n=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]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(56),i=r(6),o=r(11),s=r(194),a=n.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.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),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(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(r,16),this.z=n?new i(n,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(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),f=s.redMul(o);return this.curve.point(c,u,f,l)},u.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(s.redSub(this.curve.two)),t=s.redMul(u.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),c=s.redSub(a).redISub(a);e=n.redSub(i).redISub(o).redMul(c),t=s.redMul(u.redSub(o)),r=s.redMul(c)}}else{var u=i.redAdd(o);a=this.curve._mulC(this.z).redSqr(),c=u.redSub(a).redSub(a);e=this.curve._mulC(n.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(c)}return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),f=o.redMul(c),d=s.redMul(a);return this.curve.point(u,l,d,f)},u.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),f=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.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},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(e,t,r){"use strict";t.sha1=r(694),t.sha224=r(695),t.sha256=r(414),t.sha384=r(696),t.sha512=r(415)},function(e,t,r){"use strict";var n=r(74),i=r(160),o=r(413),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,l),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),c=e.toArray("be",s),u=new i({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(u.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(f)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var y=h.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new l({r:g,s:y,recoveryParam:b})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new l(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){c((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,s=new n(e),a=t.r,u=t.s,f=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var h=t.r.invm(o),p=o.sub(s).mul(h).umod(o),m=u.mul(h).umod(o);return this.g.mulAdd(p,a,m)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).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(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(80),i=r(411),o=r(55);function s(e){if(!(this instanceof s))return new s(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"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);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(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(e,t,r){"use strict";var n=r(6),i=r(56),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o>>=0;return!(i<=127)&&(t.place=s,i)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;var u=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var l=c(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var f=e.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(u),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,e)}},function(e,t,r){"use strict";var n=r(80),i=r(253),o=r(56),s=o.assert,a=o.parseBytes,c=r(705),u=r(706);function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(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=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=t)throw new Error("invalid sig")}e.exports=function(e,t,r,u,l){var f=s(r);if("ec"===f.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(t,e,s)}(e,t,f)}if("dsa"===f.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,o=r.data.q,a=r.data.g,u=r.data.pub_key,l=s.signature.decode(e,"der"),f=l.s,d=l.r;c(f,o),c(d,o);var h=i.mont(n),p=f.invm(o);return 0===a.toRed(h).redPow(new i(t).mul(p).mod(o)).fromRed().mul(u.toRed(h).redPow(d.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(d)}(e,t,f)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");t=n.concat([l,t]);for(var d=f.modulus.byteLength(),h=[1],p=0;t.length+h.length+2r-d-2)throw new Error("message too long");var h=f.alloc(r-n-d-2),p=r-l-1,m=i(l),g=a(f.concat([u,h,f.alloc(1,1),t],p),s(m,p)),y=a(m,s(g,l));return new c(f.concat([f.alloc(1),y,g],r))}(p,t);else if(1===d)h=function(e,t,r){var n,o=t.length,s=e.modulus.byteLength();if(o>s-11)throw new Error("message too long");n=r?f.alloc(s-o-3,255):function(e){var t,r=f.allocUnsafe(e),n=0,o=i(2*e),s=0;for(;n=0)throw new Error("data too long for modulus")}return r?l(h,p):u(h,p)}},function(e,t,r){var n=r(195),i=r(423),o=r(424),s=r(6),a=r(252),c=r(82),u=r(425),l=r(13).Buffer;e.exports=function(e,t,r){var f;f=e.padding?e.padding:r?1:4;var d,h=n(e),p=h.modulus.byteLength();if(t.length>p||new s(t).cmp(h.modulus)>=0)throw new Error("decryption error");d=r?u(new s(t),h):a(t,h);var m=l.alloc(p-d.length);if(d=l.concat([m,d],p),4===f)return function(e,t){var r=e.modulus.byteLength(),n=c("sha1").update(l.alloc(0)).digest(),s=n.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,s+1),u=t.slice(s+1),f=o(a,i(u,s)),d=o(u,i(f,r-s-1));if(function(e,t){e=l.from(e),t=l.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var s=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,d,r);if(3===f)return d;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(13),s=r(89),a=o.Buffer,c=o.kMaxLength,u=e.crypto||e.msCrypto,l=Math.pow(2,32)-1;function f(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>l||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>l||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>c)throw new RangeError("buffer too small")}function h(e,t,r,i){if(n.browser){var o=e.buffer,a=new Uint8Array(o,t,r);return u.getRandomValues(a),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return s(r).copy(e,t),e;s(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}u&&u.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(a.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return f(r,t.length),d(n,r,t.length),h(t,r,n,i)},t.randomFillSync=function(t,r,n){void 0===r&&(r=0);if(!(a.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');f(r,t.length),void 0===n&&(n=t.length-r);return d(n,r,t.length),h(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(15),r(17))},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.Ripemd160=void 0;const i=n(r(103));class o{constructor(e){this.blockSize=64,this.impl=new i.default,e&&this.update(e)}update(t){return this.impl.update(e.from(t)),this}digest(){return Uint8Array.from(this.impl.digest())}}t.Ripemd160=o,t.ripemd160=function(e){return new o(e).digest()}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Secp256k1=void 0;const i=r(57),o=n(r(6)),s=n(r(61)),a=r(426),c=new s.default.ec("secp256k1"),u=new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");t.Secp256k1=class{static async makeKeypair(e){if(32!==e.length)throw new Error("input data is not a valid secp256k1 private key");const t=c.keyFromPrivate(e);if(!0!==t.validate().result)throw new Error("input data is not a valid secp256k1 private key");if(new o.default(e).gte(u))throw new Error("input data is not a valid secp256k1 private key");return{privkey:i.fromHex(t.getPrivate("hex")),pubkey:Uint8Array.from(t.getPublic("array"))}}static async createSignature(e,t){if(0===e.length)throw new Error("Message hash must not be empty");if(e.length>32)throw new Error("Message hash length must not exceed 32 bytes");const r=c.keyFromPrivate(t),{r:n,s:i,recoveryParam:o}=r.sign(e,{canonical:!0});if("number"!=typeof o)throw new Error("Recovery param missing");return new a.ExtendedSecp256k1Signature(Uint8Array.from(n.toArray()),Uint8Array.from(i.toArray()),o)}static async verifySignature(e,t,r){if(0===t.length)throw new Error("Message hash must not be empty");if(t.length>32)throw new Error("Message hash length must not exceed 32 bytes");const n=c.keyFromPublic(r);try{return n.verify(t,e.toDer())}catch(e){return!1}}static recoverPubkey(e,t){const r={r:i.toHex(e.r()),s:i.toHex(e.s())},n=c.recoverPubKey(t,r,e.recovery),o=c.keyFromPublic(n);return i.fromHex(o.getPublic(!1,"hex"))}static compressPubkey(e){switch(e.length){case 33:return e;case 65:return Uint8Array.from(c.keyFromPublic(e).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static trimRecoveryByte(e){switch(e.length){case 64:return e;case 65:return e.slice(0,64);default:throw new Error("Invalid signature length")}}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.stringToPath=t.pathToString=t.Slip10=t.Slip10RawIndex=t.slip10CurveFromString=t.Slip10Curve=void 0;const i=r(57),o=r(118),s=n(r(6)),a=n(r(61)),c=r(393),u=r(427);var l;!function(e){e.Secp256k1="Bitcoin seed",e.Ed25519="ed25519 seed"}(l=t.Slip10Curve||(t.Slip10Curve={})),t.slip10CurveFromString=function(e){switch(e){case l.Ed25519:return l.Ed25519;case l.Secp256k1:return l.Secp256k1;default:throw new Error(`Unknown curve string: '${e}'`)}};class f extends o.Uint32{static hardened(e){return new f(e+2**31)}static normal(e){return new f(e)}isHardened(){return this.data>=2**31}}t.Slip10RawIndex=f;const d=new a.default.ec("secp256k1");class h{static derivePath(e,t,r){let n=this.master(e,t);for(const t of r)n=this.child(e,n.privkey,n.chainCode,t);return n}static master(e,t){const r=new c.Hmac(u.Sha512,i.toAscii(e)).update(t).digest(),n=r.slice(0,32),o=r.slice(32,64);return e!==l.Ed25519&&(this.isZero(n)||this.isGteN(e,n))?this.master(e,r):{chainCode:o,privkey:n}}static child(e,t,r,n){let i;if(n.isHardened()){const e=new Uint8Array([0,...t,...n.toBytesBigEndian()]);i=new c.Hmac(u.Sha512,r).update(e).digest()}else{if(e===l.Ed25519)throw new Error("Normal keys are not allowed with ed25519");{const o=new Uint8Array([...h.serializedPoint(e,new s.default(t)),...n.toBytesBigEndian()]);i=new c.Hmac(u.Sha512,r).update(o).digest()}}return this.childImpl(e,t,r,n,i)}static serializedPoint(e,t){switch(e){case l.Secp256k1:return i.fromHex(d.g.mul(t).encodeCompressed("hex"));default:throw new Error("curve not supported")}}static childImpl(e,t,r,n,i){const o=i.slice(0,32),a=i.slice(32,64),f=a;if(e===l.Ed25519)return{chainCode:f,privkey:o};const d=this.n(e),h=new s.default(o).add(new s.default(t)).mod(d),p=Uint8Array.from(h.toArray("be",32));if(this.isGteN(e,o)||this.isZero(p)){const i=new c.Hmac(u.Sha512,r).update(new Uint8Array([1,...a,...n.toBytesBigEndian()])).digest();return this.childImpl(e,t,r,n,i)}return{chainCode:f,privkey:p}}static isZero(e){return e.every(e=>0===e)}static isGteN(e,t){return new s.default(t).gte(this.n(e))}static n(e){switch(e){case l.Secp256k1:return new s.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16);default:throw new Error("curve not supported")}}}t.Slip10=h,t.pathToString=function(e){return e.reduce((e,t)=>e+"/"+(t.isHardened()?t.toNumber()-2**31+"'":t.toString()),"m")},t.stringToPath=function(e){if(!e.startsWith("m"))throw new Error("Path string must start with 'm'");let t=e.slice(1);const r=new Array;for(;t;){const e=t.match(/^\/([0-9]+)('?)/);if(!e)throw new Error("Syntax error while reading path component");const[n,i,s]=e,a=o.Uint53.fromString(i).toNumber();if(a>=2**31)throw new Error("Component value too high. Must not exceed 2**31-1.");s?r.push(f.hardened(a)):r.push(f.normal(a)),t=t.slice(n.length)}return r}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Decimal=void 0;const i=n(r(6));class o{constructor(e,t){this.data={atomics:new i.default(e),fractionalDigits:t}}static fromUserInput(e,t){o.verifyFractionalDigits(t);const r=e.match(/[^0-9.]/);if(r)throw new Error("Invalid character at position "+(r.index+1));let n,i;if(-1===e.search(/\./))n=e,i="";else{const t=e.split(".");switch(t.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!t[1])throw new Error("Fractional part missing");n=t[0],i=t[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(i.length>t)throw new Error("Got more fractional digits than supported");const s=`${n}${i.padEnd(t,"0")}`;return new o(s,t)}static fromAtomics(e,t){return o.verifyFractionalDigits(t),new o(e,t)}static verifyFractionalDigits(e){if(!Number.isInteger(e))throw new Error("Fractional digits is not an integer");if(e<0)throw new Error("Fractional digits must not be negative");if(e>100)throw new Error("Fractional digits must not exceed 100")}static compare(e,t){if(e.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return e.data.atomics.cmp(new i.default(t.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}toString(){const e=new i.default(10).pow(new i.default(this.data.fractionalDigits)),t=this.data.atomics.div(e),r=this.data.atomics.mod(e);if(r.isZero())return t.toString();{const e=r.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${t.toString()}.${e}`}}toFloatApproximation(){const e=Number(this.toString());if(Number.isNaN(e))throw new Error("Conversion to number failed");return e}plus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.add(new i.default(e.atomics));return new o(t.toString(),this.fractionalDigits)}minus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.sub(new i.default(e.atomics));if(t.ltn(0))throw new Error("Difference must not be negative");return new o(t.toString(),this.fractionalDigits)}multiply(e){const t=this.data.atomics.mul(new i.default(e.toString()));return new o(t.toString(),this.fractionalDigits)}equals(e){return 0===o.compare(this,e)}isLessThan(e){return o.compare(this,e)<0}isLessThanOrEqual(e){return o.compare(this,e)<=0}isGreaterThan(e){return o.compare(this,e)>0}isGreaterThanOrEqual(e){return o.compare(this,e)>=0}}t.Decimal=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uint64=t.Uint53=t.Int53=t.Uint32=void 0;const i=n(r(6)),o=new i.default("18446744073709551615",10,"be");class s{constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<0||e>4294967295)throw new Error("Input not in uint32 range: "+e.toString());this.data=e}static fromBigEndianBytes(e){return s.fromBytes(e)}static fromBytes(e,t="be"){if(4!==e.length)throw new Error("Invalid input length. Expected 4 bytes.");for(let t=0;t255||e[t]<0)throw new Error("Invalid value in byte. Found: "+e[t]);const r="be"===t?e:Array.from(e).reverse();return new s(r[0]*2**24+65536*r[1]+256*r[2]+r[3])}static fromString(e){if(!e.match(/^[0-9]+$/))throw new Error("Invalid string format");return new s(Number.parseInt(e,10))}toBytesBigEndian(){return new Uint8Array([255&Math.floor(this.data/2**24),255&Math.floor(this.data/65536),255&Math.floor(this.data/256),255&Math.floor(this.data/1)])}toBytesLittleEndian(){return new Uint8Array([255&Math.floor(this.data/1),255&Math.floor(this.data/256),255&Math.floor(this.data/65536),255&Math.floor(this.data/2**24)])}toNumber(){return this.data}toString(){return this.data.toString()}}t.Uint32=s;class a{constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(eNumber.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+e.toString());this.data=e}static fromString(e){if(!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new a(Number.parseInt(e,10))}toNumber(){return this.data}toString(){return this.data.toString()}}t.Int53=a;class c{constructor(e){const t=new a(e);if(t.toNumber()<0)throw new Error("Input is negative");this.data=t}static fromString(e){const t=a.fromString(e);return new c(t.toNumber())}toNumber(){return this.data.toNumber()}toString(){return this.data.toString()}}t.Uint53=c;class u{constructor(e){if(e.isNeg())throw new Error("Input is negative");if(e.gt(o))throw new Error("Input exceeds uint64 range");this.data=e}static fromBytesBigEndian(e){return u.fromBytes(e)}static fromBytes(e,t="be"){if(8!==e.length)throw new Error("Invalid input length. Expected 8 bytes.");for(let t=0;t255||e[t]<0)throw new Error("Invalid value in byte. Found: "+e[t]);const r="be"===t?Array.from(e):Array.from(e).reverse();return new u(new i.default(r))}static fromString(e){if(!e.match(/^[0-9]+$/))throw new Error("Invalid string format");return new u(new i.default(e,10,"be"))}static fromNumber(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");let t;try{t=new i.default(e)}catch(e){throw new Error("Input is not a safe integer")}return new u(t)}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toNumber(){return this.data.toNumber()}}t.Uint64=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupAuthExtension=void 0,t.setupAuthExtension=function(e){return{auth:{account:async t=>{const r="/auth/accounts/"+t,n=await e.get(r);if("cosmos-sdk/Account"!==n.result.type)throw new Error("Unexpected response data format");return n}}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupBankExtension=void 0,t.setupBankExtension=function(e){return{bank:{balances:async t=>{const r="/bank/balances/"+t;return e.get(r)}}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupDistributionExtension=void 0,t.setupDistributionExtension=function(e){return{distribution:{delegatorRewards:async t=>e.get(`/distribution/delegators/${t}/rewards`),delegatorReward:async(t,r)=>e.get(`/distribution/delegators/${t}/rewards/${r}`),withdrawAddress:async t=>e.get(`/distribution/delegators/${t}/withdraw_address`),validator:async t=>e.get("/distribution/validators/"+t),validatorRewards:async t=>e.get(`/distribution/validators/${t}/rewards`),validatorOutstandingRewards:async t=>e.get(`/distribution/validators/${t}/outstanding_rewards`),parameters:async()=>e.get("/distribution/parameters"),communityPool:async()=>e.get("/distribution/community_pool")}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupGovExtension=t.GovParametersType=void 0,function(e){e.Deposit="deposit",e.Tallying="tallying",e.Voting="voting"}(t.GovParametersType||(t.GovParametersType={})),t.setupGovExtension=function(e){return{gov:{parameters:async t=>e.get("/gov/parameters/"+t),proposals:async()=>e.get("/gov/proposals"),proposal:async t=>e.get("/gov/proposals/"+t),proposer:async t=>e.get(`/gov/proposals/${t}/proposer`),deposits:async t=>e.get(`/gov/proposals/${t}/deposits`),deposit:async(t,r)=>e.get(`/gov/proposals/${t}/deposits/${r}`),tally:async t=>e.get(`/gov/proposals/${t}/tally`),votes:async t=>e.get(`/gov/proposals/${t}/votes`),vote:async(t,r)=>e.get(`/gov/proposals/${t}/votes/${r}`)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupMintExtension=void 0,t.setupMintExtension=function(e){return{mint:{parameters:async()=>e.get("/minting/parameters"),inflation:async()=>e.get("/minting/inflation"),annualProvisions:async()=>e.get("/minting/annual-provisions")}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupSlashingExtension=void 0,t.setupSlashingExtension=function(e){return{slashing:{signingInfos:async()=>e.get("/slashing/signing_infos"),parameters:async()=>e.get("/slashing/parameters")}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupStakingExtension=t.BondStatus=void 0,function(e){e[e.Unbonded=0]="Unbonded",e[e.Unbonding=1]="Unbonding",e[e.Bonded=2]="Bonded"}(t.BondStatus||(t.BondStatus={})),t.setupStakingExtension=function(e){return{staking:{delegatorDelegations:async t=>e.get(`/staking/delegators/${t}/delegations`),delegatorUnbondingDelegations:async t=>e.get(`/staking/delegators/${t}/unbonding_delegations`),delegatorTransactions:async t=>e.get(`/staking/delegators/${t}/txs`),delegatorValidators:async t=>e.get(`/staking/delegators/${t}/validators`),delegatorValidator:async(t,r)=>e.get(`/staking/delegators/${t}/validators/${r}`),delegation:async(t,r)=>e.get(`/staking/delegators/${t}/delegations/${r}`),unbondingDelegation:async(t,r)=>e.get(`/staking/delegators/${t}/unbonding_delegations/${r}`),redelegations:async()=>e.get("/staking/redelegations"),validators:async t=>e.get("/staking/validators",t),validator:async t=>e.get("/staking/validators/"+t),validatorDelegations:async t=>e.get(`/staking/validators/${t}/delegations`),validatorUnbondingDelegations:async t=>e.get(`/staking/validators/${t}/unbonding_delegations`),historicalInfo:async t=>e.get("/staking/historical_info/"+t),pool:async()=>e.get("/staking/pool"),parameters:async()=>e.get("/staking/parameters")}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupSupplyExtension=void 0,t.setupSupplyExtension=function(e){return{supply:{totalAll:async()=>e.get("/supply/total"),total:async t=>e.get("/supply/total/"+t)}}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LcdClient=t.normalizeLcdApiArray=void 0;const i=r(156),o=n(r(84)),s=r(430);function a(e){var t;if(null===(t=e.response)||void 0===t?void 0:t.data){let t;const r=e.response.data;throw t=r.error&&"string"==typeof r.error?r.error:"string"==typeof r?r:JSON.stringify(r),new Error(`${t} (HTTP ${e.response.status})`)}throw e}t.normalizeLcdApiArray=function(e){return e||[]};class c{constructor(e,t=s.BroadcastMode.Block){this.client=o.default.create({baseURL:e,headers:{post:{"Content-Type":"application/json"}}}),this.broadcastMode=t}static withExtensions(e,...t){const r=new c(e.apiUrl,e.broadcastMode),n=t.map(e=>e(r));for(const e of n){i.assert(i.isNonNullObject(e),"Extension must be a non-null object");for(const[t,n]of Object.entries(e)){i.assert(i.isNonNullObject(n),`Module must be a non-null object. Found type ${typeof n} for module "${t}".`);const e=r[t]||{};r[t]=Object.assign(Object.assign({},e),n)}}return r}async get(e,t){const{data:r}=await this.client.get(e,{params:t}).catch(a);if(null===r)throw new Error("Received null response from server");return r}async post(e,t){if(!i.isNonNullObject(t))throw new Error("Got unexpected type of params. Expected object.");const{data:r}=await this.client.post(e,t).catch(a);if(null===r)throw new Error("Received null response from server");return r}async blocksLatest(){const e=await this.get("/blocks/latest");if(!e.block)throw new Error("Unexpected response data format");return e}async blocks(e){const t=await this.get("/blocks/"+e);if(!t.block)throw new Error("Unexpected response data format");return t}async nodeInfo(){const e=await this.get("/node_info");if(!e.node_info)throw new Error("Unexpected response data format");return e}async txById(e){const t=await this.get("/txs/"+e);if(!t.tx)throw new Error("Unexpected response data format");return t}async txsQuery(e){const t=await this.get("/txs?"+e);if(!t.txs)throw new Error("Unexpected response data format");return t}async encodeTx(e){const t=await this.post("/txs/encode",e);if(!t.tx)throw new Error("Unexpected response data format");return t}async broadcastTx(e){const t={tx:e,mode:this.broadcastMode},r=await this.post("/txs",t);if(!r.txhash)throw new Error("Unexpected response data format");return r}}t.LcdClient=c},function(e,t,r){"use strict";var n=r(49),i=r(431),o=r(738),s=r(437);function a(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var c=a(r(434));c.Axios=o,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=r(438),c.CancelToken=r(751),c.isCancel=r(433),c.all=function(e){return Promise.all(e)},c.spread=r(752),c.isAxiosError=r(753),e.exports=c,e.exports.default=c},function(e,t,r){"use strict";var n=r(49),i=r(432),o=r(739),s=r(740),a=r(437);function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},c.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=c},function(e,t,r){"use strict";var n=r(49);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,r){"use strict";var n=r(49),i=r(741),o=r(433),s=r(434);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(49);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t,r){"use strict";var n=r(49);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(436);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(49);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(747),i=r(748);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(49),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(49);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(438);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePubkey=t.uint64ToString=t.uint64ToNumber=void 0;const n=r(118),i=r(259);t.uint64ToNumber=function(e){return("number"==typeof e?n.Uint64.fromNumber(e):n.Uint64.fromString(e)).toNumber()},t.uint64ToString=function(e){return("number"==typeof e?n.Uint64.fromNumber(e):n.Uint64.fromString(e)).toString()},t.normalizePubkey=function(e){return e?"string"==typeof e?i.decodeBech32Pubkey(e):e:null}},function(e,t,r){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.isMsgUndelegate=t.isMsgBeginRedelegate=t.isMsgDelegate=t.isMsgEditValidator=t.isMsgCreateValidator=t.isMsgUnjail=t.isMsgDeposit=t.isMsgVote=t.isMsgSubmitProposal=t.isMsgSubmitEvidence=t.isMsgFundCommunityPool=t.isMsgWithdrawValidatorCommission=t.isMsgWithdrawDelegatorReward=t.isMsgSetWithdrawAddress=t.isMsgVerifyInvariant=t.isMsgMultiSend=t.isMsgSend=void 0,t.isMsgSend=function(e){return"cosmos-sdk/MsgSend"===e.type},t.isMsgMultiSend=function(e){return"cosmos-sdk/MsgMultiSend"===e.type},t.isMsgVerifyInvariant=function(e){return"cosmos-sdk/MsgVerifyInvariant"===e.type},t.isMsgSetWithdrawAddress=function(e){return"cosmos-sdk/MsgModifyWithdrawAddress"===e.type},t.isMsgWithdrawDelegatorReward=function(e){return"cosmos-sdk/MsgWithdrawDelegationReward"===e.type},t.isMsgWithdrawValidatorCommission=function(e){return"cosmos-sdk/MsgWithdrawValidatorCommission"===e.type},t.isMsgFundCommunityPool=function(e){return"cosmos-sdk/MsgFundCommunityPool"===e.type},t.isMsgSubmitEvidence=function(e){return"cosmos-sdk/MsgSubmitEvidence"===e.type},t.isMsgSubmitProposal=function(e){return"cosmos-sdk/MsgSubmitProposal"===e.type},function(e){e[e.VoteOptionUnspecified=0]="VoteOptionUnspecified",e[e.VoteOptionYes=1]="VoteOptionYes",e[e.VoteOptionAbstain=2]="VoteOptionAbstain",e[e.VoteOptionNo=3]="VoteOptionNo",e[e.VoteOptionNoWithVeto=4]="VoteOptionNoWithVeto"}(n||(n={})),t.isMsgVote=function(e){return"cosmos-sdk/MsgVote"===e.type},t.isMsgDeposit=function(e){return"cosmos-sdk/MsgDeposit"===e.type},t.isMsgUnjail=function(e){return"cosmos-sdk/MsgUnjail"===e.type},t.isMsgCreateValidator=function(e){return"cosmos-sdk/MsgCreateValidator"===e.type},t.isMsgEditValidator=function(e){return"cosmos-sdk/MsgEditValidator"===e.type},t.isMsgDelegate=function(e){return"cosmos-sdk/MsgDelegate"===e.type},t.isMsgBeginRedelegate=function(e){return"cosmos-sdk/MsgBeginRedelegate"===e.type},t.isMsgUndelegate=function(e){return"cosmos-sdk/MsgUndelegate"===e.type}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findSequenceForSignedTx=void 0;const n=r(73),i=r(162),o=r(197);t.findSequenceForSignedTx=async function(e,t,r,s,a=0){const c=e.value.signatures.find(()=>!0);if(!c)throw new Error("Signature missing in tx");const{pubkey:u,signature:l}=o.decodeSignature(c),f=n.Secp256k1Signature.fromFixedLength(l);for(let o=a;o({hdPath:n.pathToString(e.hdPath),prefix:e.prefix}))},o=i.toUtf8(JSON.stringify(r)),s={algorithm:l.supportedAlgorithms.xchacha20poly1305Ietf},a=await l.encrypt(o,e,s),c={type:"secp256k1wallet-v1",kdf:t,encryption:s,data:i.toBase64(a)};return JSON.stringify(c)}}t.Secp256k1HdWallet=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Secp256k1Wallet=void 0;const n=r(73),i=r(240),o=r(162),s=r(197);class a{constructor(e,t,r){this.privkey=e,this.pubkey=t,this.prefix=r}static async fromKey(e,t="cosmos"){const r=(await n.Secp256k1.makeKeypair(e)).pubkey;return new a(e,n.Secp256k1.compressPubkey(r),t)}get address(){return i.rawSecp256k1PubkeyToAddress(this.pubkey,this.prefix)}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signAmino(e,t){if(e!==this.address)throw new Error(`Address ${e} not found in wallet`);const r=new n.Sha256(o.serializeSignDoc(t)).digest(),i=await n.Secp256k1.createSignature(r,this.privkey),a=new Uint8Array([...i.r(32),...i.s(32)]);return{signed:t,signature:s.encodeSecp256k1Signature(this.pubkey,a)}}}t.Secp256k1Wallet=a},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mnemonic=void 0;const i=r(102),o=r(762),s=r(2);class a{static generateWallet(e,t="m/44'/118'/0'/0/0",r="",i=256){return n(this,void 0,void 0,(function*(){const n=yield a.generateSeed(e,i);return{privKey:a.generateWalletFromMnemonic(n,t,r),mnemonic:n}}))}static validateMnemonic(e){i.validateMnemonic(e)}static generateSeed(e,t=128){return n(this,void 0,void 0,(function*(){if(t%32!=0)throw new TypeError("invalid entropy");let r=new Uint8Array(t/8);return r=yield e(r),i.entropyToMnemonic(s.Buffer.from(r).toString("hex"))}))}static generateWalletFromMnemonic(e,t="m/44'/118'/0'/0/0",r=""){const n=i.mnemonicToSeedSync(e,r),s=o.fromSeed(n).derivePath(t).privateKey;if(!s)throw new Error("null hd key");return s}}t.Mnemonic=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(763);t.fromSeed=n.fromSeed,t.fromBase58=n.fromBase58,t.fromPublicKey=n.fromPublicKey,t.fromPrivateKey=n.fromPrivateKey},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(764),i=r(443),o=r(767),s=r(769),a=r(771),c=s.BufferN(32),u=s.compile({wif:s.UInt8,bip32:{public:s.UInt32,private:s.UInt32}}),l={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},f=Math.pow(2,31)-1;function d(e){return s.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function h(e){return s.UInt32(e)&&e<=f}class p{constructor(e,t,r,n,i=0,o=0,a=0){this.__D=e,this.__Q=t,this.chainCode=r,this.network=n,this.__DEPTH=i,this.__INDEX=o,this.__PARENT_FINGERPRINT=a,s(u,n),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=o.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return n.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return y(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const t=this.network,r=this.isNeutered()?t.bip32.public:t.bip32.private,n=e.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),i.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return a.encode(this.network.wif,this.privateKey,!0)}derive(t){s(s.UInt32,t);const r=t>=2147483648,i=e.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");i[0]=0,this.privateKey.copy(i,1),i.writeUInt32BE(t,33)}else this.publicKey.copy(i,0),i.writeUInt32BE(t,33);const a=n.hmacSHA512(this.chainCode,i),c=a.slice(0,32),u=a.slice(32);if(!o.isPrivate(c))return this.derive(t+1);let l;if(this.isNeutered()){const e=o.pointAddScalar(this.publicKey,c,!0);if(null===e)return this.derive(t+1);l=y(e,u,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}else{const e=o.privateAdd(this.privateKey,c);if(null==e)return this.derive(t+1);l=g(e,u,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}return l}deriveHardened(e){return s(h,e),this.derive(e+2147483648)}derivePath(e){s(d,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))},this)}sign(t,r){if(!this.privateKey)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return o.sign(t,this.privateKey);{let r=o.sign(t,this.privateKey);const n=e.alloc(32,0);let i=0;for(;r[0]>127;)i++,n.writeUIntLE(i,0,6),r=o.signWithEntropy(t,this.privateKey,n);return r}}verify(e,t){return o.verify(e,this.publicKey,t)}}function m(e,t,r){return g(e,t,r)}function g(e,t,r,n,i,a){if(s({privateKey:c,chainCode:c},{privateKey:e,chainCode:t}),r=r||l,!o.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new p(e,void 0,t,r,n,i,a)}function y(e,t,r,n,i,a){if(s({publicKey:s.BufferN(33),chainCode:c},{publicKey:e,chainCode:t}),r=r||l,!o.isPoint(e))throw new TypeError("Point is not on the curve");return new p(void 0,e,t,r,n,i,a)}t.fromBase58=function(e,t){const r=i.decode(e);if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||l;const n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");const o=r[4],s=r.readUInt32BE(5);if(0===o&&0!==s)throw new TypeError("Invalid parent fingerprint");const a=r.readUInt32BE(9);if(0===o&&0!==a)throw new TypeError("Invalid index");const c=r.slice(13,45);let u;if(n===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");u=g(r.slice(46,78),c,t,o,a,s)}else{u=y(r.slice(45,78),c,t,o,a,s)}return u},t.fromPrivateKey=m,t.fromPublicKey=function(e,t,r){return y(e,t,r)},t.fromSeed=function(t,r){if(s(s.Buffer,t),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");r=r||l;const i=n.hmacSHA512(e.from("Bitcoin seed","utf8"),t);return m(i.slice(0,32),i.slice(32),r)}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(82),i=r(191);t.hash160=function(e){const t=n("sha256").update(e).digest();try{return n("rmd160").update(t).digest()}catch(e){return n("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return i("sha512",e).update(t).digest()}},function(e,t,r){"use strict";var n=r(766),i=r(13).Buffer;e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return n.encode(i.concat([t,r],t.length+4))},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},function(e,t,r){var n=r(444);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){(function(t){const n=r(6),i=new(0,r(61).ec)("secp256k1"),o=r(768),s=t.alloc(32,0),a=t.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),c=t.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),u=i.curve.n,l=u.shrn(1),f=i.curve.g;function d(e){return t.isBuffer(e)&&32===e.length}function h(e){return!!d(e)&&e.compare(a)<0}function p(e){if(!t.isBuffer(e))return!1;if(e.length<33)return!1;const r=e[0],n=e.slice(1,33);if(0===n.compare(s))return!1;if(n.compare(c)>=0)return!1;if((2===r||3===r)&&33===e.length){try{w(e)}catch(e){return!1}return!0}const i=e.slice(33);return 0!==i.compare(s)&&(!(i.compare(c)>=0)&&(4===r&&65===e.length))}function m(e){return 4!==e[0]}function g(e){return!!d(e)&&(e.compare(s)>0&&e.compare(a)<0)}function y(e,t){return void 0===e&&void 0!==t?m(t):void 0===e||e}function b(e){return new n(e)}function v(e){return e.toArrayLike(t,"be",32)}function w(e){return i.curve.decodePoint(e)}function _(e,r){return t.from(e._encode(r))}function k(e,r,n){if(!d(e))throw new TypeError("Expected Hash");if(!g(r))throw new TypeError("Expected Private");if(void 0!==n&&!d(n))throw new TypeError("Expected Extra Data (32 bytes)");const i=b(r),s=b(e);let a,c;o(e,r,(function(e){const t=b(e),r=f.mul(t);return!r.isInfinity()&&(a=r.x.umod(u),0!==a.isZero()&&(c=t.invm(u).mul(s.add(i.mul(a))).umod(u),0!==c.isZero()))}),g,n),c.cmp(l)>0&&(c=u.sub(c));const h=t.allocUnsafe(64);return v(a).copy(h,0),v(c).copy(h,32),h}e.exports={isPoint:p,isPointCompressed:function(e){return!!p(e)&&m(e)},isPrivate:g,pointAdd:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!p(t))throw new TypeError("Expected Point");const n=w(e),i=w(t),o=n.add(i);return o.isInfinity()?null:_(o,y(r,e))},pointAddScalar:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=y(r,e),i=w(e);if(0===t.compare(s))return _(i,n);const o=b(t),a=f.mul(o),c=i.add(a);return c.isInfinity()?null:_(c,n)},pointCompress:function(e,t){if(!p(e))throw new TypeError("Expected Point");const r=w(e);if(r.isInfinity())throw new TypeError("Expected Point");return _(r,y(t,e))},pointFromScalar:function(e,t){if(!g(e))throw new TypeError("Expected Private");const r=b(e),n=f.mul(r);return n.isInfinity()?null:_(n,y(t))},pointMultiply:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=y(r,e),i=w(e),o=b(t),s=i.mul(o);return s.isInfinity()?null:_(s,n)},privateAdd:function(e,t){if(!g(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=b(e),n=b(t),i=v(r.add(n).umod(u));return g(i)?i:null},privateSub:function(e,t){if(!g(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=b(e),n=b(t),i=v(r.sub(n).umod(u));return g(i)?i:null},sign:function(e,t){return k(e,t)},signWithEntropy:function(e,t,r){return k(e,t,r)},verify:function(e,r,n,i){if(!d(e))throw new TypeError("Expected Hash");if(!p(r))throw new TypeError("Expected Point");if(!function(e){const r=e.slice(0,32),n=e.slice(32,64);return t.isBuffer(e)&&64===e.length&&r.compare(a)<0&&n.compare(a)<0}(n))throw new TypeError("Expected Signature");const o=w(r),s=b(n.slice(0,32)),c=b(n.slice(32,64));if(i&&c.cmp(l)>0)return!1;if(s.gtn(0)<=0)return!1;if(c.gtn(0)<=0)return!1;const h=b(e),m=c.invm(u),g=h.mul(m).umod(u),y=s.mul(m).umod(u),v=f.mulAdd(g,o,y);return!v.isInfinity()&&v.x.umod(u).eq(s)}}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){const n=r(191),i=t.alloc(1,1),o=t.alloc(1,0);e.exports=function(e,r,s,a,c){let u=t.alloc(32,0),l=t.alloc(32,1);u=n("sha256",u).update(l).update(o).update(r).update(e).update(c||"").digest(),l=n("sha256",u).update(l).digest(),u=n("sha256",u).update(l).update(i).update(r).update(e).update(c||"").digest(),l=n("sha256",u).update(l).digest(),l=n("sha256",u).update(l).digest();let f=l;for(;!a(f)||!s(f);)u=n("sha256",u).update(l).update(o).digest(),l=n("sha256",u).update(l).digest(),l=n("sha256",u).update(l).digest(),f=l;return f}}).call(this,r(2).Buffer)},function(e,t,r){var n=r(445),i=r(260),o=n.tfJSON,s=n.TfTypeError,a=n.TfPropertyTypeError,c=n.tfSubError,u=n.getValueTypeName,l={arrayOf:function(e,t){function r(r,n){return!!i.Array(r)&&(!i.Nil(r)&&(!(void 0!==t.minLength&&r.lengtht.maxLength)&&((void 0===t.length||r.length===t.length)&&r.every((function(t,r){try{return d(e,t,n)}catch(e){throw c(e,r)}}))))))}return e=f(e),t=t||{},r.toJSON=function(){var r="["+o(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,n){return i.Nil(r)||t(r,n,e)}return t=f(t),r.toJSON=function(){return"?"+o(t)},r},map:function(e,t){function r(r,n){if(!i.Object(r))return!1;if(i.Nil(r))return!1;for(var o in r){try{t&&d(t,o,n)}catch(e){throw c(e,o,"key")}try{var s=r[o];d(e,s,n)}catch(e){throw c(e,o)}}return!0}return e=f(e),t&&(t=f(t)),r.toJSON=t?function(){return"{"+o(t)+": "+o(e)+"}"}:function(){return"{"+o(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=f(e[r]);function n(e,r){if(!i.Object(e))return!1;if(i.Nil(e))return!1;var n;try{for(n in t){d(t[n],e[n],r)}}catch(e){throw c(e,n)}if(r)for(n in e)if(!t[n])throw new a(void 0,n);return!0}return n.toJSON=function(){return o(t)},n},anyOf:function(){var e=[].slice.call(arguments).map(f);function t(t,r){return e.some((function(e){try{return d(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(o).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(f);function t(t,r){return e.every((function(e){try{return d(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(o).join(" & ")},t},quacksLike:function(e){function t(t){return e===u(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(f);function t(t,r){return!i.Nil(t)&&(!i.Nil(t.length)&&((!r||t.length===e.length)&&e.every((function(e,n){try{return d(e,t[n],r)}catch(e){throw c(e,n)}}))))}return t.toJSON=function(){return"("+e.map(o).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function f(e){if(i.String(e))return"?"===e[0]?l.maybe(e.slice(1)):i[e]||l.quacksLike(e);if(e&&i.Object(e)){if(i.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return l.arrayOf(e[0])}return l.object(e)}return i.Function(e)?e:l.value(e)}function d(e,t,r,n){if(i.Function(e)){if(e(t,r))return!0;throw new s(n||e,t)}return d(f(e),t,r)}for(var h in l.oneOf=l.anyOf,i)d[h]=i[h];for(h in l)d[h]=l[h];var p=r(770);for(h in p)d[h]=p[h];d.compile=f,d.TfTypeError=s,d.TfPropertyTypeError=a,e.exports=d},function(e,t,r){(function(t){var n=r(260),i=r(445);function o(e){return t.isBuffer(e)}function s(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function a(e,t){var r=e.toJSON();function n(n){if(!e(n))return!1;if(n.length===t)return!0;throw i.tfCustomError(r+"(Length: "+t+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var c=a.bind(null,n.Array),u=a.bind(null,o),l=a.bind(null,s),f=a.bind(null,n.String);var d=Math.pow(2,53)-1;var h={ArrayN:c,Buffer:o,BufferN:u,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:s,HexN:l,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-d&&e<=d&&Math.floor(e)===e},Range:function(e,t,r){function i(n,i){return r(n,i)&&n>e&&n>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=d&&Math.floor(e)===e}};for(var p in h)h[p].toJSON=function(e){return e}.bind(null,p);e.exports=h}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(443);function i(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function o(e,r,n){var i=new t(n?34:33);return i.writeUInt8(e,0),r.copy(i,1),n&&(i[33]=1),i}e.exports={decode:function(e,t){return i(n.decode(e),t)},decodeRaw:i,encode:function(e,t,r){return"number"==typeof e?n.encode(o(e,t,r)):n.encode(o(e.version,e.privateKey,e.compressed))},encodeRaw:o}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PubKeySecp256k1=t.PrivKeySecp256k1=void 0;const i=r(61),o=n(r(773)),s=r(2);class a{constructor(e){this.privKey=e}static generateRandomKey(){const e=new i.ec("secp256k1");return new a(s.Buffer.from(e.genKeyPair().getPrivate().toArray()))}toBytes(){return new Uint8Array(this.privKey)}getPubKey(){const e=new i.ec("secp256k1").keyFromPrivate(this.privKey);return new c(new Uint8Array(e.getPublic().encodeCompressed("array")))}sign(e){const t=new i.ec("secp256k1").keyFromPrivate(this.privKey),r=o.default.SHA256(o.default.lib.WordArray.create(e)).toString(),n=t.sign(s.Buffer.from(r,"hex"),{canonical:!0});return new Uint8Array(n.r.toArray("be",32).concat(n.s.toArray("be",32)))}}t.PrivKeySecp256k1=a;class c{constructor(e){this.pubKey=e}toBytes(){return new Uint8Array(this.pubKey)}getAddress(){let e=o.default.SHA256(o.default.lib.WordArray.create(this.pubKey)).toString();return e=o.default.RIPEMD160(o.default.enc.Hex.parse(e)).toString(),new Uint8Array(s.Buffer.from(e,"hex"))}toKeyPair(){return new i.ec("secp256k1").keyFromPublic(s.Buffer.from(this.pubKey).toString("hex"),"hex")}verify(e,t){const r=o.default.SHA256(o.default.lib.WordArray.create(e)).toString(),n=new i.ec("secp256k1");let a=t.slice(0,32),c=t.slice(32);const u=a[0]>=128,l=c[0]>=128;u&&(a=new Uint8Array([0,...a])),l&&(c=new Uint8Array([0,...c]));const f=new Uint8Array([2,a.length,...a,2,c.length,...c]);return n.verify(s.Buffer.from(r,"hex"),new Uint8Array([48,f.length,...f]),this.toKeyPair())}}t.PubKeySecp256k1=c},function(e,t,r){var n;e.exports=(n=r(19),r(198),r(774),r(775),r(119),r(120),r(261),r(446),r(776),r(447),r(777),r(778),r(779),r(262),r(780),r(105),r(40),r(781),r(782),r(783),r(784),r(785),r(786),r(787),r(788),r(789),r(790),r(791),r(792),r(793),r(794),r(795),r(796),n)},function(e,t,r){var n;e.exports=(n=r(19),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),n.lib.WordArray)},function(e,t,r){var n;e.exports=(n=r(19),function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),n.enc.Utf16)},function(e,t,r){var n,i,o,s,a,c;e.exports=(c=r(19),r(446),i=(n=c).lib.WordArray,o=n.algo,s=o.SHA256,a=o.SHA224=s.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=s._createHelper(a),n.HmacSHA224=s._createHmacHelper(a),c.SHA224)},function(e,t,r){var n,i,o,s,a,c,u,l;e.exports=(l=r(19),r(198),r(447),i=(n=l).x64,o=i.Word,s=i.WordArray,a=n.algo,c=a.SHA512,u=a.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=c._createHelper(u),n.HmacSHA384=c._createHmacHelper(u),l.SHA384)},function(e,t,r){var n;e.exports=(n=r(19),r(198),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.x64.Word,a=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var a=0,f=0,d=0;d<7;d++){if(1&i){var h=(1<>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(A=r[i]).high^=s,A.low^=o}for(var a=0;a<24;a++){for(var d=0;d<5;d++){for(var h=0,p=0,m=0;m<5;m++)h^=(A=r[d+5*m]).high,p^=A.low;var g=f[d];g.high=h,g.low=p}for(d=0;d<5;d++){var y=f[(d+4)%5],b=f[(d+1)%5],v=b.high,w=b.low;for(h=y.high^(v<<1|w>>>31),p=y.low^(w<<1|v>>>31),m=0;m<5;m++)(A=r[d+5*m]).high^=h,A.low^=p}for(var _=1;_<25;_++){var k=(A=r[_]).high,S=A.low,E=c[_];E<32?(h=k<>>32-E,p=S<>>32-E):(h=S<>>64-E,p=k<>>64-E);var O=f[u[_]];O.high=h,O.low=p}var M=f[0],x=r[0];for(M.high=x.high,M.low=x.low,d=0;d<5;d++)for(m=0;m<5;m++){var A=r[_=d+5*m],j=f[_],P=f[(d+1)%5+5*m],I=f[(d+2)%5+5*m];A.high=j.high^~P.high&I.high,A.low=j.low^~P.low&I.low}A=r[0];var R=l[a];A.high^=R.high,A.low^=R.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,u=[],l=0;l>>24)|4278255360&(d<<24|d>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),u.push(h),u.push(d)}return new i.init(u,a)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(d),t.HmacSHA3=o._createHmacHelper(d)}(Math),n.SHA3)},function(e,t,r){var n;e.exports=(n=r(19), +/** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,h,w,_,k,S,E,O,M,x,A=this._hash.words,j=f.words,P=d.words,I=a.words,R=c.words,T=u.words,C=l.words;for(k=o=A[0],S=s=A[1],E=h=A[2],O=w=A[3],M=_=A[4],r=0;r<80;r+=1)x=o+e[t+I[r]]|0,x+=r<16?p(s,h,w)+j[0]:r<32?m(s,h,w)+j[1]:r<48?g(s,h,w)+j[2]:r<64?y(s,h,w)+j[3]:b(s,h,w)+j[4],x=(x=v(x|=0,T[r]))+_|0,o=_,_=w,w=v(h,10),h=s,s=x,x=k+e[t+R[r]]|0,x+=r<16?b(S,E,O)+P[0]:r<32?y(S,E,O)+P[1]:r<48?g(S,E,O)+P[2]:r<64?m(S,E,O)+P[3]:p(S,E,O)+P[4],x=(x=v(x|=0,C[r]))+M|0,k=M,M=O,O=v(E,10),E=S,S=x;x=A[1]+h+O|0,A[1]=A[2]+w+M|0,A[2]=A[3]+_+k|0,A[3]=A[4]+o+S|0,A[4]=A[0]+s+E|0,A[0]=x},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function m(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function y(e,t,r){return e&r|t&~r}function b(e,t,r){return e^(t|~r)}function v(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(h),t.HmacRIPEMD160=o._createHmacHelper(h)}(Math),n.RIPEMD160)},function(e,t,r){var n,i,o,s,a,c,u,l,f;e.exports=(f=r(19),r(261),r(262),i=(n=f).lib,o=i.Base,s=i.WordArray,a=n.algo,c=a.SHA1,u=a.HMAC,l=a.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=u.create(r.hasher,e),i=s.create(),o=s.create([1]),a=i.words,c=o.words,l=r.keySize,f=r.iterations;a.length>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var r=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var a=s.slice(0);n.encryptBlock(a,0);for(var c=0;c>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},function(e,t,r){var n;e.exports=(n=r(19),r(40),n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},function(e,t,r){var n;e.exports=(n=r(19),r(40),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},function(e,t,r){var n;e.exports=(n=r(19),r(40),n.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},n.pad.ZeroPadding)},function(e,t,r){var n;e.exports=(n=r(19),r(40),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},function(e,t,r){var n,i,o,s;e.exports=(s=r(19),r(40),i=(n=s).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},s.format.Hex)},function(e,t,r){var n;e.exports=(n=r(19),r(119),r(120),r(105),r(40),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],s=[],a=[],c=[],u=[],l=[],f=[],d=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var m=e[r],g=e[m],y=e[g],b=257*e[p]^16843008*p;s[r]=b<<24|b>>>8,a[r]=b<<16|b>>>16,c[r]=b<<8|b>>>24,u[r]=b,b=16843009*y^65537*g^257*m^16843008*r,l[p]=b<<24|b>>>8,f[p]=b<<16|b>>>16,d[p]=b<<8|b>>>24,h[p]=b,r?(r=m^e[e[e[y^m]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s6&&s%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=p[s/r|0]<<24),o[s]=o[s-r]^u);for(var a=this._invKeySchedule=[],c=0;c>>24]]^f[i[u>>>16&255]]^d[i[u>>>8&255]]^h[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,u,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,f,d,h,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,s,a){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],f=e[t+2]^r[2],d=e[t+3]^r[3],h=4,p=1;p>>24]^i[l>>>16&255]^o[f>>>8&255]^s[255&d]^r[h++],g=n[l>>>24]^i[f>>>16&255]^o[d>>>8&255]^s[255&u]^r[h++],y=n[f>>>24]^i[d>>>16&255]^o[u>>>8&255]^s[255&l]^r[h++],b=n[d>>>24]^i[u>>>16&255]^o[l>>>8&255]^s[255&f]^r[h++];u=m,l=g,f=y,d=b}m=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[255&d])^r[h++],g=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[h++],y=(a[f>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^r[h++],b=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&f])^r[h++],e[t]=m,e[t+1]=g,e[t+2]=y,e[t+3]=b},keySize:8});e.AES=t._createHelper(m)}(),n.AES)},function(e,t,r){var n;e.exports=(n=r(19),r(119),r(120),r(105),r(40),function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,o=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],l=c[o];for(r=0;r<24;r++)u[r/6|0]|=t[(a[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(a[r+24]-1+l)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var f=this._invSubKeys=[];for(r=0;r<16;r++)f[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),d.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=u[c][((s^i[c])&l[c])>>>0];this._lBlock=s,this._rBlock=o^a}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,d.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=f.createEncryptor(r.create(t)),this._des2=f.createEncryptor(r.create(n)),this._des3=f.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),n.TripleDES)},function(e,t,r){var n;e.exports=(n=r(19),r(119),r(120),r(105),r(40),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var s=i%r,a=t[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var c=n[i];n[i]=n[o],n[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(s)}(),n.RC4)},function(e,t,r){var n;e.exports=(n=r(19),r(119),r(120),r(105),r(40),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],s=[],a=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=u>>>16|4294901760&l,d=l<<16|65535&u;for(i[0]^=u,i[1]^=f,i[2]^=l,i[3]^=d,i[4]^=u,i[5]^=f,i[6]^=l,i[7]^=d,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,c=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),n.Rabbit)},function(e,t,r){var n;e.exports=(n=r(19),r(119),r(120),r(105),r(40),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],s=[],a=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=u>>>16|4294901760&l,d=l<<16|65535&u;for(n[0]^=u,n[1]^=f,n[2]^=l,n[3]^=d,n[4]^=u,n[5]^=f,n[6]^=l,n[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,c=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),n.RabbitLegacy)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;const n=r(93);t.Hash=class{static sha256(e){return new Uint8Array((new n.sha256).update(e).digest())}static truncHashPortion(e,t=e.length,r=0){return e.substring(0,t)+"…"+e.substring(e.length-r,e.length)}}},,,,,,,,function(e,t){const r="Impossible case. Please create issue.",n="The tweak was out of range or the resulted private key is invalid",i="The tweak was out of range or equal to zero",o="Unknow error on context randomization",s="Private Key is invalid",a="Public Key could not be parsed",c="Public Key serialization error",u="The sum of the public keys is not valid",l="Signature could not be parsed",f="The nonce generation function failed, or the private key was invalid",d="Public key could not be recover",h="Scalar was invalid (zero or overflow)";function p(e,t){if(!e)throw new Error(t)}function m(e,t,r){if(p(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;p(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;p(t.length===r,n)}}function g(e){p("Boolean"===b(e),"Expected compressed to be a Boolean")}function y(e=(e=>new Uint8Array(e)),t){return"function"==typeof e&&(e=e(t)),m("output",e,t),e}function b(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=e=>({contextRandomize(t){switch(p(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&m("seed",t,32),e.contextRandomize(t)){case 1:throw new Error(o)}},privateKeyVerify:t=>(m("private key",t,32),0===e.privateKeyVerify(t)),privateKeyNegate(t){switch(m("private key",t,32),e.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(r)}},privateKeyTweakAdd(t,r){switch(m("private key",t,32),m("tweak",r,32),e.privateKeyTweakAdd(t,r)){case 0:return t;case 1:throw new Error(n)}},privateKeyTweakMul(t,r){switch(m("private key",t,32),m("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(i)}},publicKeyVerify:t=>(m("public key",t,[33,65]),0===e.publicKeyVerify(t)),publicKeyCreate(t,r=!0,n){switch(m("private key",t,32),g(r),n=y(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(c)}},publicKeyConvert(t,r=!0,n){switch(m("public key",t,[33,65]),g(r),n=y(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(a);case 2:throw new Error(c)}},publicKeyNegate(t,n=!0,i){switch(m("public key",t,[33,65]),g(n),i=y(i,n?33:65),e.publicKeyNegate(i,t)){case 0:return i;case 1:throw new Error(a);case 2:throw new Error(r);case 3:throw new Error(c)}},publicKeyCombine(t,r=!0,n){p(Array.isArray(t),"Expected public keys to be an Array"),p(t.length>0,"Expected public keys array will have more than zero items");for(const e of t)m("public key",e,[33,65]);switch(g(r),n=y(n,r?33:65),e.publicKeyCombine(n,t)){case 0:return n;case 1:throw new Error(a);case 2:throw new Error(u);case 3:throw new Error(c)}},publicKeyTweakAdd(t,r,i=!0,o){switch(m("public key",t,[33,65]),m("tweak",r,32),g(i),o=y(o,i?33:65),e.publicKeyTweakAdd(o,t,r)){case 0:return o;case 1:throw new Error(a);case 2:throw new Error(n)}},publicKeyTweakMul(t,r,n=!0,o){switch(m("public key",t,[33,65]),m("tweak",r,32),g(n),o=y(o,n?33:65),e.publicKeyTweakMul(o,t,r)){case 0:return o;case 1:throw new Error(a);case 2:throw new Error(i)}},signatureNormalize(t){switch(m("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(l)}},signatureExport(t,n){m("signature",t,64);const i={output:n=y(n,72),outputlen:72};switch(e.signatureExport(i,t)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(l);case 2:throw new Error(r)}},signatureImport(t,n){switch(m("signature",t),n=y(n,64),e.signatureImport(n,t)){case 0:return n;case 1:throw new Error(l);case 2:throw new Error(r)}},ecdsaSign(t,n,i={},o){m("message",t,32),m("private key",n,32),p("Object"===b(i),"Expected options to be an Object"),void 0!==i.data&&m("options.data",i.data),void 0!==i.noncefn&&p("Function"===b(i.noncefn),"Expected options.noncefn to be a Function");const s={signature:o=y(o,64),recid:null};switch(e.ecdsaSign(s,t,n,i.data,i.noncefn)){case 0:return s;case 1:throw new Error(f);case 2:throw new Error(r)}},ecdsaVerify(t,r,n){switch(m("signature",t,64),m("message",r,32),m("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(l);case 2:throw new Error(a)}},ecdsaRecover(t,n,i,o=!0,s){switch(m("signature",t,64),p("Number"===b(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),m("message",i,32),g(o),s=y(s,o?33:65),e.ecdsaRecover(s,t,n,i)){case 0:return s;case 1:throw new Error(l);case 2:throw new Error(d);case 3:throw new Error(r)}},ecdh(t,r,n={},i){switch(m("public key",t,[33,65]),m("private key",r,32),p("Object"===b(n),"Expected options to be an Object"),void 0!==n.data&&m("options.data",n.data),void 0!==n.hashfn?(p("Function"===b(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&m("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&m("options.ybuf",n.ybuf,32),m("output",i)):i=y(i,32),e.ecdh(i,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(a);case 2:throw new Error(h)}}})},function(e,t,r){const n=new(0,r(61).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function s(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){let r=new o(t);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){let s=new o(t),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;const c=s.redSqr().redIMul(s);return a.redSqr().redISub(c.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function a(e,t){const r=t.encode(null,33===e.length);for(let t=0;t0,privateKeyVerify(e){const t=new o(e);return t.cmp(i.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new o(e),r=i.n.sub(t).umod(i.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){const r=new o(t);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify:e=>null===s(e)?1:0,publicKeyCreate(e,t){const r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;return a(e,n.keyFromPrivate(t).getPublic()),0},publicKeyConvert(e,t){const r=s(t);if(null===r)return 1;return a(e,r.getPublic()),0},publicKeyNegate(e,t){const r=s(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e=0)return 2;const c=n.getPublic().add(i.g.mul(r));return c.isInfinity()?2:(a(e,c),0)},publicKeyTweakMul(e,t,r){const n=s(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0||r.isZero())return 2;return a(e,n.getPublic().mul(r)),0},signatureNormalize(e){const t=new o(e.subarray(0,32)),r=new o(e.subarray(32,64));return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const r=t.subarray(0,32),n=t.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=e;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let c=33,u=0;for(;c>1&&0===a[u]&&!(128&a[u+1]);--c,++u);if(a=a.subarray(u),128&a[0])return 1;if(c>1&&0===a[0]&&!(128&a[1]))return 1;let l=s.subarray(39,72);l[0]=0,l.set(n,1);let f=33,d=0;for(;f>1&&0===l[d]&&!(128&l[d+1]);--f,++d);return l=l.subarray(d),128&l[0]||f>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+c+f,s[0]=48,s[1]=e.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+c]=2,s[5+c]=l.length,s.set(l,6+c),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;const n=t[5+r];if(0===n)return 1;if(6+r+n!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(n>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let s=t.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=t.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let c=new o(s);c.cmp(i.n)>=0&&(c=new o(0));let u=new o(t.subarray(6+r));return u.cmp(i.n)>=0&&(u=new o(0)),e.set(c.toArrayLike(Uint8Array,"be",32),0),e.set(u.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,s,a){if(a){const e=a;a=n=>{const i=e(t,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const c=new o(r);if(c.cmp(i.n)>=0||c.isZero())return 1;let u;try{u=n.sign(t,r,{canonical:!0,k:a,pers:s})}catch(e){return 1}return e.signature.set(u.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(u.s.toArrayLike(Uint8Array,"be",32),32),e.recid=u.recoveryParam,0},ecdsaVerify(e,t,r){const a={r:e.subarray(0,32),s:e.subarray(32,64)},c=new o(a.r),u=new o(a.s);if(c.cmp(i.n)>=0||u.cmp(i.n)>=0)return 1;if(1===u.cmp(n.nh)||c.isZero()||u.isZero())return 3;const l=s(r);if(null===l)return 2;const f=l.getPublic();return n.verify(t,a,f)?0:3},ecdsaRecover(e,t,r,s){const c={r:t.slice(0,32),s:t.slice(32,64)},u=new o(c.r),l=new o(c.s);if(u.cmp(i.n)>=0||l.cmp(i.n)>=0)return 1;if(u.isZero()||l.isZero())return 2;let f;try{f=n.recoverPubKey(s,c,r)}catch(e){return 2}return a(e,f),0},ecdh(e,t,r,a,c,u,l){const f=s(t);if(null===f)return 1;const d=new o(r);if(d.cmp(i.n)>=0||d.isZero())return 2;const h=f.getPublic().mul(d);if(void 0===c){const t=h.encode(null,!0),r=n.hash().update(t).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{u||(u=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)u[e]=t[e];l||(l=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let e=0;e<32;++e)l[e]=r[e];const n=c(u,l,a);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}}},,,,function(e,t,r){"use strict";var n=r(811),i=r(91),o=r(457),s=r(265),a=r(458),c=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(s[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,l)))throw new Error(s[r]);this._dict_set=!0}}function l(e,t){var r=new u(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}u.prototype.push=function(e,t){var r,s,a=this.strm,u=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=o.string2buf(e):"[object ArrayBuffer]"===c.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new i.Buf8(u),a.next_out=0,a.avail_out=u),1!==(r=n.deflate(a,s))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(a.output,a.next_out))):this.onData(i.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==r);return 4===s?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==s||(this.onEnd(0),a.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=u,t.deflate=l,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},function(e,t,r){"use strict";var n,i=r(91),o=r(812),s=r(455),a=r(456),c=r(265);function u(e,t){return e.msg=c[t],t}function l(e){return(e<<1)-(e>4?9:0)}function f(e){for(var t=e.length;--t>=0;)e[t]=0}function d(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function h(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,d(e.strm)}function p(e,t){e.pending_buf[e.pending++]=t}function m(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function g(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,u=e.window,l=e.w_mask,f=e.prev,d=e.strstart+258,h=u[o+s-1],p=u[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+s]===p&&u[r+s-1]===h&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&os){if(e.match_start=t,s=n,n>=a)break;h=u[o+s-1],p=u[o+s]}}}while((t=f[t&l])>c&&0!=--i);return s<=e.lookahead?s:e.lookahead}function y(e){var t,r,n,o,c,u,l,f,d,h,p=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-262)){i.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=p?n-p:0}while(--r);t=r=p;do{n=e.prev[--t],e.prev[t]=n>=p?n-p:0}while(--r);o+=p}if(0===e.strm.avail_in)break;if(u=e.strm,l=e.window,f=e.strstart+e.lookahead,d=o,h=void 0,(h=u.avail_in)>d&&(h=d),r=0===h?0:(u.avail_in-=h,i.arraySet(l,u.input,u.next_in,h,f),1===u.state.wrap?u.adler=s(u.adler,l,h,f):2===u.state.wrap&&(u.adler=a(u.adler,l,h,f)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=3)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(a=2,n-=16),o<1||o>9||8!==r||n<8||n>15||t<0||t>9||s<0||s>4)return u(e,-2);8===n&&(n=9);var c=new _;return e.state=c,c.strm=e,c.wrap=a,c.gzhead=null,c.w_bits=n,c.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(y(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,h(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(h(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(h(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(h(e,!1),e.strm.avail_out),1)})),new w(4,4,8,4,b),new w(4,5,16,8,b),new w(4,6,32,32,b),new w(4,4,16,16,v),new w(8,16,32,32,v),new w(8,16,128,128,v),new w(8,32,128,256,v),new w(32,128,258,1024,v),new w(32,258,258,4096,v)],t.deflateInit=function(e,t){return E(e,t,8,15,8,0)},t.deflateInit2=E,t.deflateReset=S,t.deflateResetKeep=k,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},t.deflate=function(e,t){var r,i,s,c;if(!e||!e.state||t>5||t<0)return e?u(e,-2):-2;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return u(e,0===e.avail_out?-5:-2);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,p(i,31),p(i,139),p(i,8),i.gzhead?(p(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),p(i,255&i.gzhead.time),p(i,i.gzhead.time>>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,3),i.status=113);else{var g=8+(i.w_bits-8<<4)<<8;g|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(g|=32),g+=31-g%31,i.status=113,m(i,g),0!==i.strstart&&(m(i,e.adler>>>16),m(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),d(e),s=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),d(e),s=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===c&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),d(e),s=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===c&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&d(e),i.pending+2<=i.pending_buf_size&&(p(i,255&e.adler),p(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(d(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&l(t)<=l(r)&&4!==t)return u(e,-5);if(666===i.status&&0!==e.avail_in)return u(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var b=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(y(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(h(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(h(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(h(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=258){if(y(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+258;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(h(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(h(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(h(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==b&&4!==b||(i.status=666),1===b||3===b)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===b&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(f(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),d(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&e.adler),p(i,e.adler>>8&255),p(i,e.adler>>16&255),p(i,e.adler>>24&255),p(i,255&e.total_in),p(i,e.total_in>>8&255),p(i,e.total_in>>16&255),p(i,e.total_in>>24&255)):(m(i,e.adler>>>16),m(i,65535&e.adler)),d(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?u(e,-2):(e.state=null,113===t?u(e,-3):0):-2},t.deflateSetDictionary=function(e,t){var r,n,o,a,c,u,l,d,h=t.length;if(!e||!e.state)return-2;if(2===(a=(r=e.state).wrap)||1===a&&42!==r.status||r.lookahead)return-2;for(1===a&&(e.adler=s(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===a&&(f(r.head),r.strstart=0,r.block_start=0,r.insert=0),d=new i.Buf8(r.w_size),i.arraySet(d,t,h-r.w_size,r.w_size,0),t=d,h=r.w_size),c=e.avail_in,u=e.next_in,l=e.input,e.avail_in=h,e.next_in=0,e.input=t,y(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<=0;)e[t]=0}var o=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],s=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],c=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);i(u);var l=new Array(60);i(l);var f=new Array(512);i(f);var d=new Array(256);i(d);var h=new Array(29);i(h);var p,m,g,y=new Array(30);function b(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function w(e){return e<256?f[e]:f[256+(e>>>7)]}function _(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function k(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function O(e,t,r){var n,i,o=new Array(16),s=0;for(n=1;n<=15;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=E(o[a]++,a))}}function M(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function x(e){e.bi_valid>8?_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function A(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)j(e,o,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],j(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,j(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,s,a,c=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=c[2*c[2*(n=e.heap[r])+1]+1]+1)>p&&(o=p,m++),c[2*n+1]=o,n>u||(e.bl_count[o]++,s=0,n>=h&&(s=d[n-h]),a=c[2*n],e.opt_len+=a*(o+s),f&&(e.static_len+=a*(l[2*n+1]+s)));if(0!==m){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>u||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(e,t),O(o,u,e.bl_count)}function R(e,t,r){var n,i,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a>=7;n<30;n++)for(y[n]=i<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),I(e,e.l_desc),I(e,e.d_desc),s=function(e){var t;for(R(e,e.dyn_ltree,e.l_desc.max_code),R(e,e.dyn_dtree,e.d_desc.max_code),I(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*c[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?B(e,t,r,n):4===e.strategy||o===i?(k(e,2+(n?1:0),3),P(e,u,l)):(k(e,4+(n?1:0),3),function(e,t,r,n){var i;for(k(e,t-257,5),k(e,r-1,5),k(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(d[r]+256+1)]++,e.dyn_dtree[2*w(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){k(e,2,3),S(e,256,u),function(e){16===e.bi_valid?(_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var n=r(814),i=r(91),o=r(457),s=r(459),a=r(265),c=r(458),u=r(817),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new u,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(a[r])}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(e,t){var r,a,c,u,f,d=this.strm,h=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(h),d.next_out=0,d.avail_out=h),(r=n.inflate(d,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===s.Z_BUF_ERROR&&!0===m&&(r=s.Z_OK,m=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==s.Z_STREAM_END&&(0!==d.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(c=o.utf8border(d.output,d.next_out),u=d.next_out-c,f=o.buf2string(d.output,c),d.next_out=u,d.avail_out=h-u,u&&i.arraySet(d.output,d.output,c,u,0),this.onData(f)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},function(e,t,r){"use strict";var n=r(91),i=r(455),o=r(456),s=r(815),a=r(816);function c(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):-2}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,l(e)):-2}function d(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,f(e))):-2}function h(e,t){var r,n;return e?(n=new u,e.state=n,n.window=null,0!==(r=d(e,t))&&(e.state=null),r):-2}var p,m,g=!0;function y(e){if(g){var t;for(p=new n.Buf32(512),m=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,m,0,e.work,{bits:5}),g=!1}e.lencode=p,e.lenbits=9,e.distcode=m,e.distbits=5}function b(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=o(r.check,B,2,0),m=0,g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=30;break}if(g-=4,P=8+(15&(m>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(B[0]=255&m,B[1]=m>>>8&255,r.check=o(r.check,B,2,0)),m=0,g=0,r.mode=3;case 3:for(;g<32;){if(0===h)break e;h--,m+=u[f++]<>>8&255,B[2]=m>>>16&255,B[3]=m>>>24&255,r.check=o(r.check,B,4,0)),m=0,g=0,r.mode=4;case 4:for(;g<16;){if(0===h)break e;h--,m+=u[f++]<>8),512&r.flags&&(B[0]=255&m,B[1]=m>>>8&255,r.check=o(r.check,B,2,0)),m=0,g=0,r.mode=5;case 5:if(1024&r.flags){for(;g<16;){if(0===h)break e;h--,m+=u[f++]<>>8&255,r.check=o(r.check,B,2,0)),m=0,g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((_=r.length)>h&&(_=h),_&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,u,f,_,P)),512&r.flags&&(r.check=o(r.check,u,_,f)),h-=_,f+=_,r.length-=_),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===h)break e;_=0;do{P=u[f+_++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P))}while(P&&_>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;g<32;){if(0===h)break e;h--,m+=u[f++]<>>=7&g,g-=7&g,r.mode=27;break}for(;g<3;){if(0===h)break e;h--,m+=u[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6===t){m>>>=2,g-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}m>>>=2,g-=2;break;case 14:for(m>>>=7&g,g-=7&g;g<32;){if(0===h)break e;h--,m+=u[f++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&m,m=0,g=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(_=r.length){if(_>h&&(_=h),_>p&&(_=p),0===_)break e;n.arraySet(l,u,f,_,d),h-=_,f+=_,p-=_,d+=_,r.length-=_;break}r.mode=12;break;case 17:for(;g<14;){if(0===h)break e;h--,m+=u[f++]<>>=5,g-=5,r.ndist=1+(31&m),m>>>=5,g-=5,r.ncode=4+(15&m),m>>>=4,g-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,g-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},I=a(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,I){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,M=65535&C,!((E=C>>>24)<=g);){if(0===h)break e;h--,m+=u[f++]<>>=E,g-=E,r.lens[r.have++]=M;else{if(16===M){for(T=E+2;g>>=E,g-=E,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}P=r.lens[r.have-1],_=3+(3&m),m>>>=2,g-=2}else if(17===M){for(T=E+3;g>>=E)),m>>>=3,g-=3}else{for(T=E+7;g>>=E)),m>>>=7,g-=7}if(r.have+_>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;_--;)r.lens[r.have++]=P}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,R={bits:r.lenbits},I=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,I){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},I=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,I){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(h>=6&&p>=258){e.next_out=d,e.avail_out=p,e.next_in=f,e.avail_in=h,r.hold=m,r.bits=g,s(e,w),d=e.next_out,l=e.output,p=e.avail_out,f=e.next_in,u=e.input,h=e.avail_in,m=r.hold,g=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;O=(C=r.lencode[m&(1<>>16&255,M=65535&C,!((E=C>>>24)<=g);){if(0===h)break e;h--,m+=u[f++]<>x)])>>>16&255,M=65535&C,!(x+(E=C>>>24)<=g);){if(0===h)break e;h--,m+=u[f++]<>>=x,g-=x,r.back+=x}if(m>>>=E,g-=E,r.back+=E,r.length=M,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(T=r.extra;g>>=r.extra,g-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;O=(C=r.distcode[m&(1<>>16&255,M=65535&C,!((E=C>>>24)<=g);){if(0===h)break e;h--,m+=u[f++]<>x)])>>>16&255,M=65535&C,!(x+(E=C>>>24)<=g);){if(0===h)break e;h--,m+=u[f++]<>>=x,g-=x,r.back+=x}if(m>>>=E,g-=E,r.back+=E,64&O){e.msg="invalid distance code",r.mode=30;break}r.offset=M,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(T=r.extra;g>>=r.extra,g-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break e;if(_=w-p,r.offset>_){if((_=r.offset-_)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}_>r.wnext?(_-=r.wnext,k=r.wsize-_):k=r.wnext-_,_>r.length&&(_=r.length),S=r.window}else S=l,k=d-r.offset,_=r.length;_>p&&(_=p),p-=_,r.length-=_;do{l[d++]=S[k++]}while(--_);0===r.length&&(r.mode=21);break;case 26:if(0===p)break e;l[d++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;g<32;){if(0===h)break e;h--,m|=u[f++]<>>=w=v>>>24,p-=w,0===(w=v>>>16&255))M[o++]=65535&v;else{if(!(16&w)){if(0==(64&w)){v=m[(65535&v)+(h&(1<>>=w,p-=w),p<15&&(h+=O[n++]<>>=w=v>>>24,p-=w,!(16&(w=v>>>16&255))){if(0==(64&w)){v=g[(65535&v)+(h&(1<c){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,k>(w=o-s)){if((w=k-w)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,E=d,0===f){if(S+=u-w,w<_){_-=w;do{M[o++]=d[S++]}while(--w);S=o-k,E=M}}else if(f2;)M[o++]=E[S++],M[o++]=E[S++],M[o++]=E[S++],_-=3;_&&(M[o++]=E[S++],_>1&&(M[o++]=E[S++]))}else{S=o-k;do{M[o++]=M[S++],M[o++]=M[S++],M[o++]=M[S++],_-=3}while(_>2);_&&(M[o++]=M[S++],_>1&&(M[o++]=M[S++]))}break}}break}}while(n>3,h&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n=1&&0===B[M];M--);if(x>M&&(x=M),0===M)return u[l++]=20971520,u[l++]=20971520,d.bits=1,0;for(O=1;O0&&(0===e||1!==M))return-1;for(D[1]=0,S=1;S<15;S++)D[S+1]=D[S]+B[S];for(E=0;E852||2===e&&I>592)return 1;for(;;){v=S-j,f[E]b?(w=N[U+f[E]],_=T[C+f[E]]):(w=96,_=0),h=1<>j)+(p-=h)]=v<<24|w<<16|_|0}while(0!==p);for(h=1<>=1;if(0!==h?(R&=h-1,R+=h):R=0,E++,0==--B[S]){if(S===M)break;S=t[r+f[E]]}if(S>x&&(R&g)!==m){for(0===j&&(j=x),y+=O,P=1<<(A=S-j);A+j852||2===e&&I>592)return 1;u[m=R&g]=x<<24|A<<16|y-l|0}}return 0!==R&&(u[y+R]=S-j<<24|64<<16|0),d.bits=x,0}},function(e,t,r){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},,function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(820),t),i(r(821),t),i(r(266),t),i(r(822),t),i(r(823),t),i(r(824),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionKVStore=void 0;const n=r(266),i={get:"undefined"!=typeof browser?browser.storage.local.get:void 0,set:"undefined"!=typeof browser?browser.storage.local.set:void 0};class o extends n.BaseKVStore{constructor(e){super(i,e)}}t.ExtensionKVStore=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryKVStore=void 0;const n=r(266);class i{constructor(){this.store={}}get(){return Promise.resolve(this.store)}set(e){return this.store=Object.assign(Object.assign({},this.store),e),Promise.resolve()}}class o extends n.BaseKVStore{constructor(e){super(new i,e)}}t.MemoryKVStore=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalKVStore=void 0;t.LocalKVStore=class{constructor(e){this._prefix=e}get(e){const t=this.prefix()+"/"+e,r=localStorage.getItem(t);return null===r?Promise.resolve(void 0):Promise.resolve(JSON.parse(r))}set(e,t){const r=this.prefix()+"/"+e;return null===t?Promise.resolve(localStorage.removeItem(r)):Promise.resolve(localStorage.setItem(r,JSON.stringify(t)))}prefix(){return this._prefix}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedDBKVStore=void 0;t.IndexedDBKVStore=class{constructor(e){this._prefix=e}get(e){return n(this,void 0,void 0,(function*(){const t=(yield this.getDB()).transaction([this.prefix()],"readonly").objectStore(this.prefix());return new Promise((r,n)=>{const i=t.get(e);i.onerror=e=>{e.stopPropagation(),n(e.target)},i.onsuccess=()=>{i.result?r(i.result.data):r(void 0)}})}))}set(e,t){return n(this,void 0,void 0,(function*(){if(null===t){const t=(yield this.getDB()).transaction([this.prefix()],"readwrite").objectStore(this.prefix());return new Promise((r,n)=>{const i=t.delete(e);i.onerror=e=>{e.stopPropagation(),n(e.target)},i.onsuccess=()=>{r()}})}{const r=(yield this.getDB()).transaction([this.prefix()],"readwrite").objectStore(this.prefix());return new Promise((n,i)=>{const o=r.put({key:e,data:t});o.onerror=e=>{e.stopPropagation(),i(e.target)},o.onsuccess=()=>{n()}})}}))}prefix(){return this._prefix}getDB(){return n(this,void 0,void 0,(function*(){return this.cachedDB?this.cachedDB:new Promise((e,t)=>{const r=window.indexedDB.open(this.prefix());r.onerror=e=>{e.stopPropagation(),t(e.target)},r.onupgradeneeded=e=>{e.target.result.createObjectStore(this.prefix(),{keyPath:"key"})},r.onsuccess=()=>{this.cachedDB=r.result,e(r.result)}})}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DenomHelper=void 0;const n=r(2),i=r(86);t.DenomHelper=class{constructor(e){this._denom=e;const t=this.denom.split(/(\w+):(\w+):(.+)/).filter(Boolean);if(1!==t.length&&3!==t.length)throw new Error("Invalid denom: "+this.denom);this._type=3===t.length?t[0]:"",this._contractAddress=3===t.length?t[1]:""}static ibcDenom(e,t){const r=[];for(const t of e)r.push(`${t.portId}/${t.channelId}`);const o=`${r.join("/")}/${t}`;return"ibc/"+n.Buffer.from(i.Hash.sha256(n.Buffer.from(o))).toString("hex").toUpperCase()}get denom(){return this._denom}get type(){return this._type||"native"}get contractAddress(){return this._contractAddress}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toGenerator=void 0,t.toGenerator=function*(e){return yield e}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(828),t)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Debouncer=void 0;t.Debouncer=class{static promise(e){let t;return(...r)=>n(this,void 0,void 0,(function*(){if(t)return t;try{return t=e.apply(this,r),yield t}finally{t=void 0}}))}}},,,,function(e,t,r){(function(e,t){ +/*! ***************************************************************************** +Copyright (C) Microsoft. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +var r;!function(r){!function(n){var i="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=s(r);function s(e,t){return function(r,n){"function"!=typeof e[r]&&Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0===i.Reflect?i.Reflect=r:o=s(i.Reflect,o),function(t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,a={__proto__:[]}instanceof Array,c=!s&&!a,u={create:s?function(){return T(Object.create(null))}:a?function(){return T({__proto__:null})}:function(){return T({})},has:c?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},l=Object.getPrototypeOf(Function),f="object"==typeof e&&e.env&&"true"===e.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=f||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[o]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i=0;--r){var n=(0,e[r])(t);if(!_(n)&&!k(n)){if(!A(n))throw new TypeError;t=n}}return t}(e,t)}if(!M(e))throw new TypeError;if(!S(t))throw new TypeError;if(!S(n)&&!_(n)&&!k(n))throw new TypeError;return k(n)&&(n=void 0),function(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,r,n);if(!_(o)&&!k(o)){if(!S(o))throw new TypeError;n=o}}return n}(e,t,r=O(r),n)})),t("metadata",(function(e,t){return function(r,n){if(!S(r))throw new TypeError;if(!_(n)&&!function(e){switch(w(e)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;b(e,t,r,n)}})),t("defineMetadata",(function(e,t,r,n){if(!S(r))throw new TypeError;return _(n)||(n=O(n)),b(e,t,r,n)})),t("hasMetadata",(function(e,t,r){if(!S(t))throw new TypeError;return _(r)||(r=O(r)),function e(t,r,n){if(g(t,r,n))return!0;var i=R(r);return!k(i)&&e(t,i,n)}(e,t,r)})),t("hasOwnMetadata",(function(e,t,r){if(!S(t))throw new TypeError;return _(r)||(r=O(r)),g(e,t,r)})),t("getMetadata",(function(e,t,r){if(!S(t))throw new TypeError;return _(r)||(r=O(r)),function e(t,r,n){if(g(t,r,n))return y(t,r,n);var i=R(r);return k(i)?void 0:e(t,i,n)}(e,t,r)})),t("getOwnMetadata",(function(e,t,r){if(!S(t))throw new TypeError;return _(r)||(r=O(r)),y(e,t,r)})),t("getMetadataKeys",(function(e,t){if(!S(e))throw new TypeError;return _(t)||(t=O(t)),function e(t,r){var n=v(t,r),i=R(t);if(null===i)return n;var o=e(i,r);if(o.length<=0)return n;if(n.length<=0)return o;for(var s=new h,a=[],c=0,u=n;c0)return!0;var i=p.get(t);return i.delete(r),i.size>0||p.delete(t),!0}))}(o)}()}(r||(r={}))}).call(this,r(17),r(15))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(461),t),i(r(834),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const n=r(274),i=r(462),o=r(835);t.init=function(e,t){e.registerMessage(n.SetPersistentMemoryMsg),e.registerMessage(n.GetPersistentMemoryMsg),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const n=r(274);t.getHandler=e=>(t,r)=>{switch(r.constructor){case n.SetPersistentMemoryMsg:return i(e)(t,r);case n.GetPersistentMemoryMsg:return e.get();default:throw new Error("Unknown msg type")}};const i=e=>(t,r)=>(e.set(r.data),{success:!0})},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(463),t),i(r(843),t)},function(e,t,r){window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";const n=r(12);e.exports=function(e,...t){if(!e){if(1===t.length&&t[0]instanceof Error)throw t[0];throw new n(t)}}},function(e,t,r){"use strict";const n=r(0),i=r(12),o=r(29);let s,a;const c={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=o.version,t.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},t.assertOptions=function(e,t,r="Options"){n(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const i=Object.keys(e).filter(e=>!t.includes(e));n(0===i.length,"".concat(r," contain unknown keys: ").concat(i))},t.checkPreferences=function(e){a=a||r(16);const t=a.preferences.validate(e);if(t.error)throw new i([t.error.details[0].message])},t.compare=function(e,t,r){switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t}},t.default=function(e,t){return void 0===e?t:e},t.isIsoDate=function(e){return c.isoDate.test(e)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isResolvable=function(e){return!!e&&(e[t.symbols.ref]||e[t.symbols.template])},t.isSchema=function(e,r={}){const i=e&&e[t.symbols.any];return!!i&&(n(r.legacy||i.version===t.version,"Cannot mix different versions of joi schemas"),!0)},t.isValues=function(e){return e[t.symbols.values]},t.limit=function(e){return Number.isSafeInteger(e)&&e>=0},t.preferences=function(e,n){s=s||r(9),e=e||{},n=n||{};const i=Object.assign({},e,n);return n.errors&&e.errors&&(i.errors=Object.assign({},e.errors,n.errors),i.errors.wrap=Object.assign({},e.errors.wrap,n.errors.wrap)),n.messages&&(i.messages=s.compile(n.messages,e.messages)),delete i[t.symbols.prefs],i},t.tryWithPath=function(e,t,r={}){try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,r.append&&(e.message="".concat(e.message," (").concat(e.path,")")),e}},t.validateArg=function(e,r,{assert:n,message:i}){if(t.isSchema(n)){const t=n.validate(e);if(!t.error)return;return t.error.message}if(!n(e))return r?"".concat(r," ").concat(i):i},t.verifyFlat=function(e,t){for(const r of e)n(!Array.isArray(r),"Method no longer accepts array arguments:",t)}},function(e,t,r){"use strict";const n=r(6),i=r(13),o=r(14),s={needsProtoHack:new Set([i.set,i.map,i.weakSet,i.weakMap])};e.exports=s.clone=function(e,t={},r=null){if("object"!=typeof e||null===e)return e;let n=s.clone,a=r;if(t.shallow){if(!0!==t.shallow)return s.cloneWithShallow(e,t);n=e=>e}else if(a){const t=a.get(e);if(t)return t}else a=new Map;const c=i.getInternalProto(e);if(c===i.buffer)return!1;if(c===i.date)return new Date(e.getTime());if(c===i.regex)return new RegExp(e);const u=s.base(e,c,t);if(u===e)return e;if(a&&a.set(e,u),c===i.set)for(const r of e)u.add(n(r,t,a));else if(c===i.map)for(const[r,i]of e)u.set(r,n(i,t,a));const l=o.keys(e,t);for(const r of l){if("__proto__"===r)continue;if(c===i.array&&"length"===r){u.length=e.length;continue}const o=Object.getOwnPropertyDescriptor(e,r);o?o.get||o.set?Object.defineProperty(u,r,o):o.enumerable?u[r]=n(e[r],t,a):Object.defineProperty(u,r,{enumerable:!1,writable:!0,configurable:!0,value:n(e[r],t,a)}):Object.defineProperty(u,r,{enumerable:!0,writable:!0,configurable:!0,value:n(e[r],t,a)})}return u},s.cloneWithShallow=function(e,t){const r=t.shallow;(t=Object.assign({},t)).shallow=!1;const i=new Map;for(const t of r){const r=n(e,t);"object"!=typeof r&&"function"!=typeof r||i.set(r,r)}return s.clone(e,t,i)},s.base=function(e,t,r){if(!1===r.prototype)return s.needsProtoHack.has(t)?new t.constructor:t===i.array?[]:{};const n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===i.array){const e=[];return n!==t&&Object.setPrototypeOf(e,n),e}if(s.needsProtoHack.has(t)){const e=new n.constructor;return n!==t&&Object.setPrototypeOf(e,n),e}return Object.create(n)}},function(e,t,r){"use strict";const n=r(0),i=r(34),o=r(1),s=r(9);e.exports=i.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,{method:r}){try{return r(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){n(o.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return n(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate:(e,t,{code:r,local:n})=>t.error(r,n),args:["code","local"],multi:!0}},modifiers:{keep(e,t=!0){e.keep=t},message(e,t){e.message=s.compile(t)},warn(e,t=!0){e.warn=t}},manifest:{build(e,t){for(const r in t){const n=t[r];if(["examples","externals","metas","notes","tags"].includes(r))for(const t of n)e=e[r.slice(0,-1)](t);else if("alterations"!==r)if("whens"!==r){if("shared"===r)for(const t of n)e=e.shared(t)}else for(const t of n){const{ref:r,is:n,not:i,then:o,otherwise:s,concat:a}=t;e=a?e.concat(a):r?e.when(r,{is:n,not:i,then:o,otherwise:s,switch:t.switch,break:t.break}):e.when(n,{then:o,otherwise:s,break:t.break})}else{const t={};for(const{target:e,adjuster:r}of n)t[e]=r;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},function(e,t,r){"use strict";const n=r(32),i=r(1),o=r(7);t.Report=class{constructor(e,r,n,i,o,s,a){if(this.code=e,this.flags=i,this.messages=o,this.path=s.path,this.prefs=a,this.state=s,this.value=r,this.message=null,this.template=null,this.local=n||{},this.local.label=t.label(this.flags,this.state,this.prefs,this.messages),void 0===this.value||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];"object"!=typeof e&&(this.local.key=e)}}_setTemplate(e){if(this.template=e,!this.flags.label&&0===this.path.length){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const e=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return void 0===t?'Error code "'.concat(e,'" is not defined, your custom type is missing the correct messages definition'):(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(e,r){return t.template(this.value,e,r||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(const r of e)"object"!=typeof r&&("string"==typeof r?(t&&(t+="."),t+=r):t+="[".concat(r,"]"));return t},t.template=function(e,t,r,n,s){if(!t)return;if(o.isTemplate(t))return"root"!==r?t:null;let a=s.errors.language;return i.isResolvable(a)&&(a=a.resolve(e,n,s)),a&&t[a]&&void 0!==t[a][r]?t[a][r]:t[r]},t.label=function(e,r,n,i){if(e.label)return e.label;if(!n.errors.label)return"";let o=r.path;return"key"===n.errors.label&&r.path.length>1&&(o=r.path.slice(-1)),t.path(o)||t.template(null,n.messages,"root",r,n)||i&&t.template(null,i,"root",r,n)||"value"},t.process=function(e,r,n){if(!e)return null;const{override:i,message:o,details:s}=t.details(e);if(i)return i;if(n.errors.stack)return new t.ValidationError(o,s,r);const a=Error.stackTraceLimit;Error.stackTraceLimit=0;const c=new t.ValidationError(o,s,r);return Error.stackTraceLimit=a,c},t.details=function(e,t={}){let r=[];const n=[];for(const i of e){if(i instanceof Error){if(!1!==t.override)return{override:i};const e=i.toString();r.push(e),n.push({message:e,type:"override",context:{error:i}});continue}const e=i.toString();r.push(e),n.push({message:e,path:i.path.filter(e=>"object"!=typeof e),type:i.code,context:i.local})}return r.length>1&&(r=[...new Set(r)]),{message:r.join(". "),details:n}},t.ValidationError=class extends Error{constructor(e,t,r){super(e),this._original=r,this.details=t}static isError(e){return e instanceof t.ValidationError}},t.ValidationError.prototype.isJoi=!0,t.ValidationError.prototype.name="ValidationError",t.ValidationError.prototype.annotate=n.error},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0&&this.refs.push({ancestor:t.ancestor-n,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-n>=0&&this.refs.push({ancestor:e.ancestor-n,root:e.root}),l=l||r(7),l.isTemplate(e)&&this.register(e.refs(),n)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=a(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter(e=>!e.ancestor).map(e=>e.root)}}},function(e,t,r){"use strict";const n=r(0),i={};e.exports=function(e,t,r){if(!1===t||null==t)return e;"string"==typeof(r=r||{})&&(r={separator:r});const o=Array.isArray(t);n(!o||!r.separator,"Separator option no valid for array-based chain");const s=o?t:t.split(r.separator||".");let a=e;for(let e=0;e{const t=f.create(e,this._settings);return n.push(t),e=>t.resolve(...e)};try{var o=new c.Parser(e,{reference:i,functions:d.functions,constants:d.constants})}catch(t){throw t.message='Invalid template variable "'.concat(e,'" fails due to: ').concat(t.message),t}if(o.single){if("reference"===o.single.type){const e=n[0];return{ref:e,raw:t,refs:n,wrapped:r||"local"===e.type&&"label"===e.key}}return d.stringify(o.single.value)}return{formula:o,raw:t,refs:n}}toString(){return this.source}},d.Template.prototype[u.symbols.template]=!0,d.Template.prototype.isImmutable=!0,d.encode=function(e){return e.replace(/\\(\{+)/g,(e,t)=>d.opens.slice(0,t.length)).replace(/\\(\}+)/g,(e,t)=>d.closes.slice(0,t.length))},d.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},d.split=function(e){const t=[];let r="";for(let n=0;n ").concat(n.toString()));e=t}if(!Array.isArray(e))return e.toString();let l="";for(const n of e)l=l+(l.length?", ":"")+d.stringify(n,t,r,o,s,a);return u?l:d.wrap(l,o.errors.wrap.array)},d.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},d.functions={if:(e,t,r)=>e?t:r,msg(e){const[t,r,n,i,o]=this,s=o.messages;if(!s)return"";const a=l.template(t,s[0],e,r,n)||l.template(t,s[1],e,r,n);return a?a.render(t,r,n,i,o):""},number:e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e):"boolean"==typeof e?e?1:0:e instanceof Date?e.getTime():null}},function(e,t,r){"use strict";const n=r(0),i=r(1),o=r(5),s={};t.schema=function(e,t,r={}){i.assertOptions(r,["appendPath","override"]);try{return s.schema(e,t,r)}catch(e){throw r.appendPath&&void 0!==e.path&&(e.message="".concat(e.message," (").concat(e.path,")")),e}},s.schema=function(e,t,r){n(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(n(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));const o=(t,...n)=>!1!==r.override?t.valid(e.override,...n):t.valid(...n);if(s.simple(t))return o(e,t);if("function"==typeof t)return e.custom(t);if(n("object"==typeof t,"Invalid schema content:",typeof t),i.isResolvable(t))return o(e,t);if(i.isSchema(t))return t;if(Array.isArray(t)){for(const r of t)if(!s.simple(r))return e.alternatives().try(...t);return o(e,...t)}return t instanceof RegExp?e.string().regex(t):t instanceof Date?o(e.date(),t):(n(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(t))},t.ref=function(e,t){return o.isRef(e)?e:o.create(e,t)},t.compile=function(e,r,o={}){i.assertOptions(o,["legacy"]);const a=r&&r[i.symbols.any];if(a)return n(o.legacy||a.version===i.version,"Cannot mix different versions of joi schemas:",a.version,i.version),r;if("object"!=typeof r||!o.legacy)return t.schema(e,r,{appendPath:!0});const c=s.walk(r);return c?c.compile(c.root,r):t.schema(e,r,{appendPath:!0})},s.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=s.walk(t);if(e)return e}return null}const t=e[i.symbols.any];if(t)return{root:e[t.root],compile:t.compile};n(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const r=s.walk(e[t]);if(r)return r}return null},s.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,r,a){if(void 0===a&&(n(r&&"object"==typeof r,"Missing options"),a=r,r=o.create(".")),Array.isArray(a)&&(a={switch:a}),i.assertOptions(a,["is","not","then","otherwise","switch","break"]),i.isSchema(r))return n(void 0===a.is,'"is" can not be used with a schema condition'),n(void 0===a.not,'"not" can not be used with a schema condition'),n(void 0===a.switch,'"switch" can not be used with a schema condition'),s.condition(e,{is:r,then:a.then,otherwise:a.otherwise,break:a.break});if(n(o.isRef(r)||"string"==typeof r,"Invalid condition:",r),n(void 0===a.not||void 0===a.is,'Cannot combine "is" with "not"'),void 0===a.switch){let c=a;void 0!==a.not&&(c={is:a.not,then:a.otherwise,otherwise:a.then,break:a.break});let u=void 0!==c.is?e.$_compile(c.is):e.$_root.invalid(null,!1,0,"").required();return n(void 0!==c.then||void 0!==c.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),n(void 0===c.break||void 0===c.then||void 0===c.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===a.is||o.isRef(a.is)||i.isSchema(a.is)||(u=u.required()),s.condition(e,{ref:t.ref(r),is:u,then:c.then,otherwise:c.otherwise,break:c.break})}n(Array.isArray(a.switch),'"switch" must be an array'),n(void 0===a.is,'Cannot combine "switch" with "is"'),n(void 0===a.not,'Cannot combine "switch" with "not"'),n(void 0===a.then,'Cannot combine "switch" with "then"');const c={ref:t.ref(r),switch:[],break:a.break};for(let t=0;t=0;--r)if(o[r].isSame(e,t))return!0;o.push(new i.SeenEntry(e,t));try{return!!i.isDeepEqualObj(a,e,t,r,o)}finally{o.pop()}},i.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?i.mismatched:n.getInternalProto(e);const o=n.getInternalProto(e);return o!==n.getInternalProto(t)?i.mismatched:o},i.valueOf=function(e){const t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},i.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},i.isSetSimpleEqual=function(e,t){for(const r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0},i.isDeepEqualObj=function(e,t,r,o,s){const{isDeepEqual:a,valueOf:c,hasOwnEnumerableProperty:u}=i,{keys:l,getOwnPropertySymbols:f}=Object;if(e===n.array){if(!o.part){if(t.length!==r.length)return!1;for(let e=0;em.assert(e,t,!1,r),build(e){return n("function"==typeof l.build,"Manifest functionality disabled"),l.build(this,e)},checkPreferences(e){s.checkPreferences(e)},compile(e,t){return a.compile(this,e,t)},defaults(e){n("function"==typeof e,"modifier must be a function");const t=Object.assign({},this);for(const r of t._types){const i=e(t[r]());n(s.isSchema(i),"modifier must return a valid schema object"),t[r]=function(...e){return m.generate(this,i,e)}}return t},expression:(...e)=>new d(...e),extend(...e){s.verifyFlat(e,"extend"),p=p||r(16),n(e.length,"You need to provide at least one extension"),this.assert(e,p.extensions);const t=Object.assign({},this);t._types=new Set(t._types);for(let r of e){"function"==typeof r&&(r=r(t)),this.assert(r,p.extension);const e=m.expandExtension(r,t);for(const r of e){n(void 0===t[r.type]||t._types.has(r.type),"Cannot override name",r.type);const e=r.base||this.any(),i=u.type(e,r);t._types.add(r.type),t[r.type]=function(...e){return m.generate(this,i,e)}}}return t},isError:c.ValidationError.isError,isExpression:d.isTemplate,isRef:f.isRef,isSchema:s.isSchema,in:(...e)=>f.in(...e),override:s.symbols.override,ref:(...e)=>f.create(...e),types(){const e={};for(const t of this._types)e[t]=this[t]();for(const t in m.aliases)e[t]=this[t]();return e}},m.assert=function(e,t,r,n){const o=n[0]instanceof Error||"string"==typeof n[0]?n[0]:null,a=o?n[1]:n[0],u=t.validate(e,s.preferences({errors:{stack:!0}},a||{}));let l=u.error;if(!l)return u.value;if(o instanceof Error)throw o;const f=r&&"function"==typeof l.annotate?l.annotate():l.message;throw l instanceof c.ValidationError==0&&(l=i(l)),l.message=o?"".concat(o," ").concat(f):f,l},m.generate=function(e,t,r){return n(e,"Must be invoked on a Joi instance."),t.$_root=e,t._definition.args&&r.length?t._definition.args(t,...r):t},m.expandExtension=function(e,t){if("string"==typeof e.type)return[e];const r=[];for(const n of t._types)if(e.type.test(n)){const i=Object.assign({},e);i.type=n,i.base=t[n](),r.push(i)}return r},e.exports=m.root()},function(e,t,r){"use strict";const n=r(28);e.exports=class extends Error{constructor(e){super(e.filter(e=>""!==e).map(e=>"string"==typeof e?e:e instanceof Error?e.message:n(e)).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.assert)}}},function(e,t,r){"use strict";const n={};t=e.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},n.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const r=Object.prototype.toString.call(e);return n.typeMap.get(r)||t.generic}},function(e,t,r){"use strict";t.keys=function(e,t={}){return!1!==t.symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},function(e,t,r){"use strict";const n=r(0),i=r(2),o=r(1),s={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new s.Cache(e)},s.Cache=class{constructor(e={}){o.assertOptions(e,["max"]),n(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||s.max,this._map=new Map,this._list=new s.List}get length(){return this._map.size}set(e,t){if(null!==e&&!s.supported.has(typeof e))return;let r=this._map.get(e);if(r)return r.value=t,void this._list.first(r);r=this._list.unshift({key:e,value:t}),this._map.set(e,r),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),i(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},s.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:r}=e;return t.prev=r,r&&(r.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},function(e,t,r){"use strict";const n=r(11),i={};i.wrap=n.string().min(1).max(2).allow(!1),t.preferences=n.object({allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),context:n.object(),convert:n.boolean(),dateFormat:n.valid("date","iso","string","time","utc"),debug:n.boolean(),errors:{escapeHtml:n.boolean(),label:n.valid("path","key",!1),language:[n.string(),n.object().ref()],render:n.boolean(),stack:n.boolean(),wrap:{label:i.wrap,array:i.wrap}},externals:n.boolean(),messages:n.object(),noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:n.valid("required","optional","forbidden"),skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()}).strict(),i.nameRx=/^[a-zA-Z0-9]\w*$/,i.rule=n.object({alias:n.array().items(n.string().pattern(i.nameRx)).single(),args:n.array().items(n.string(),n.object({name:n.string().pattern(i.nameRx).required(),ref:n.boolean(),assert:n.alternatives([n.function(),n.object().schema()]).conditional("ref",{is:!0,then:n.required()}),normalize:n.function(),message:n.string().when("assert",{is:n.function(),then:n.required()})})),convert:n.boolean(),manifest:n.boolean(),method:n.function().allow(!1),multi:n.boolean(),validate:n.function()}),t.extension=n.object({type:n.alternatives([n.string(),n.object().regex()]).required(),args:n.function(),cast:n.object().pattern(i.nameRx,n.object({from:n.function().maxArity(1).required(),to:n.function().minArity(1).maxArity(2).required()})),base:n.object().schema().when("type",{is:n.object().regex(),then:n.forbidden()}),coerce:[n.function().maxArity(3),n.object({method:n.function().maxArity(3).required(),from:n.array().items(n.string()).single()})],flags:n.object().pattern(i.nameRx,n.object({setter:n.string(),default:n.any()})),manifest:{build:n.function().arity(2)},messages:[n.object(),n.string()],modifiers:n.object().pattern(i.nameRx,n.function().minArity(1).maxArity(2)),overrides:n.object().pattern(i.nameRx,n.function()),prepare:n.function().maxArity(3),rebuild:n.function().arity(1),rules:n.object().pattern(i.nameRx,i.rule),terms:n.object().pattern(i.nameRx,n.object({init:n.array().allow(null).required(),manifest:n.object().pattern(/.+/,[n.valid("schema","single"),n.object({mapped:n.object({from:n.string().required(),to:n.string().required()}).required()})])})),validate:n.function().maxArity(3)}).strict(),t.extensions=n.array().items(n.object(),n.function().arity(1)).strict(),i.desc={buffer:n.object({buffer:n.string()}),func:n.object({function:n.function().required(),options:{literal:!0}}),override:n.object({override:!0}),ref:n.object({ref:n.object({type:n.valid("value","global","local"),path:n.array().required(),separator:n.string().length(1).allow(!1),ancestor:n.number().min(0).integer().allow("root"),map:n.array().items(n.array().length(2)).min(1),adjust:n.function(),iterables:n.boolean(),in:n.boolean(),render:n.boolean()}).required()}),regex:n.object({regex:n.string().min(3)}),special:n.object({special:n.valid("deep").required()}),template:n.object({template:n.string().required(),options:n.object()}),value:n.object({value:n.alternatives([n.object(),n.array()]).required()})},i.desc.entity=n.alternatives([n.array().items(n.link("...")),n.boolean(),n.function(),n.number(),n.string(),i.desc.buffer,i.desc.func,i.desc.ref,i.desc.regex,i.desc.special,i.desc.template,i.desc.value,n.link("/")]),i.desc.values=n.array().items(null,n.boolean(),n.function(),n.number().allow(1/0,-1/0),n.string().allow(""),n.symbol(),i.desc.buffer,i.desc.func,i.desc.override,i.desc.ref,i.desc.regex,i.desc.template,i.desc.value),i.desc.messages=n.object().pattern(/.+/,[n.string(),i.desc.template,n.object().pattern(/.+/,[n.string(),i.desc.template])]),t.description=n.object({type:n.string().required(),flags:n.object({cast:n.string(),default:n.any(),description:n.string(),empty:n.link("/"),failover:i.desc.entity,id:n.string(),label:n.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:n.boolean(),unit:n.string()}).unknown(),preferences:{allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),convert:n.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:n.boolean(),label:["path","key"],language:[n.string(),i.desc.ref],wrap:{label:i.wrap,array:i.wrap}},externals:n.boolean(),messages:i.desc.messages,noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:["required","optional","forbidden"],skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()},allow:i.desc.values,invalid:i.desc.values,rules:n.array().min(1).items({name:n.string().required(),args:n.object().min(1),keep:n.boolean(),message:[n.string(),i.desc.messages],warn:n.boolean()}),keys:n.object().pattern(/.*/,n.link("/")),link:i.desc.ref}).pattern(/^[a-z]\w*$/,n.any())},function(e,t,r){"use strict";const n=r(0),i=r(2),o=r(1),s=r(9),a={};t.type=function(e,t){const r=Object.getPrototypeOf(e),c=i(r),u=e._assign(Object.create(c)),l=Object.assign({},t);delete l.base,c._definition=l;const f=r._definition||{};l.messages=s.merge(f.messages,l.messages),l.properties=Object.assign({},f.properties,l.properties),u.type=l.type,l.flags=Object.assign({},f.flags,l.flags);const d=Object.assign({},f.terms);if(l.terms)for(const e in l.terms){const t=l.terms[e];n(void 0===u.$_terms[e],"Invalid term override for",l.type,e),u.$_terms[e]=t.init,d[e]=t}l.terms=d,l.args||(l.args=f.args),l.prepare=a.prepare(l.prepare,f.prepare),l.coerce&&("function"==typeof l.coerce&&(l.coerce={method:l.coerce}),l.coerce.from&&!Array.isArray(l.coerce.from)&&(l.coerce={method:l.coerce.method,from:[].concat(l.coerce.from)})),l.coerce=a.coerce(l.coerce,f.coerce),l.validate=a.validate(l.validate,f.validate);const h=Object.assign({},f.rules);if(l.rules)for(const e in l.rules){const t=l.rules[e];n("object"==typeof t,"Invalid rule definition for",l.type,e);let r=t.method;if(void 0===r&&(r=function(){return this.$_addRule(e)}),r&&(n(!c[e],"Rule conflict in",l.type,e),c[e]=r),n(!h[e],"Rule conflict in",l.type,e),h[e]=t,t.alias){const e=[].concat(t.alias);for(const r of e)c[r]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map(e=>("string"==typeof e&&(e={name:e}),n(!t.argsByName.has(e.name),"Duplicated argument name",e.name),o.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e)))}l.rules=h;const p=Object.assign({},f.modifiers);if(l.modifiers)for(const e in l.modifiers){n(!c[e],"Rule conflict in",l.type,e);const t=l.modifiers[e];n("function"==typeof t,"Invalid modifier definition for",l.type,e);const r=function(t){return this.rule({[e]:t})};c[e]=r,p[e]=t}if(l.modifiers=p,l.overrides){c._super=r,u.$_super={};for(const e in l.overrides)n(r[e],"Cannot override missing",e),l.overrides[e][o.symbols.parent]=r[e],u.$_super[e]=r[e].bind(u);Object.assign(c,l.overrides)}l.cast=Object.assign({},f.cast,l.cast);const m=Object.assign({},f.manifest,l.manifest);return m.build=a.build(l.manifest&&l.manifest.build,f.manifest&&f.manifest.build),l.manifest=m,l.rebuild=a.rebuild(l.rebuild,f.rebuild),u},a.build=function(e,t){return e&&t?function(r,n){return t(e(r,n),n)}:e||t},a.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(r,n){let i;if((!t.from||t.from.includes(typeof r))&&(i=t.method(r,n),i)){if(i.errors||void 0===i.value)return i;r=i.value}if(!e.from||e.from.includes(typeof r)){const t=e.method(r,n);if(t)return t}return i}}:e||t},a.prepare=function(e,t){return e&&t?function(r,n){const i=e(r,n);if(i){if(i.errors||void 0===i.value)return i;r=i.value}return t(r,n)||i}:e||t},a.rebuild=function(e,t){return e&&t?function(r){t(r),e(r)}:e||t},a.validate=function(e,t){return e&&t?function(r,n){const i=t(r,n);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;r=i.value}return e(r,n)||i}:e||t}},function(e,t){},function(e,t){},function(e,t,r){"use strict";const n=r(0),i=r(2),o=r(14),s={};e.exports=s.merge=function(e,t,r){if(n(e&&"object"==typeof e,"Invalid target value: must be an object"),n(null==t||"object"==typeof t,"Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){n(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let n=0;ne.keys(t),validate(e,{schema:t,error:r,state:n,prefs:i}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e))return{value:e,errors:r("object.base",{type:t.$_property("typeof")})};if(!(t.$_terms.renames||t.$_terms.dependencies||t.$_terms.keys||t.$_terms.patterns||t.$_terms.externals))return;e=h.clone(e,i);const o=[];if(t.$_terms.renames&&!h.rename(t,e,n,i,o))return{value:e,errors:o};if(!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies)return{value:e,errors:o};const s=new Set(Object.keys(e));if(t.$_terms.keys){const r=[e,...n.ancestors];for(const a of t.$_terms.keys){const t=a.key,c=e[t];s.delete(t);const u=n.localize([...n.path,t],r,a),l=a.schema.$_validate(c,u,i);if(l.errors){if(i.abortEarly)return{value:e,errors:l.errors};o.push(...l.errors)}else"strip"===a.schema._flags.result||void 0===l.value&&void 0!==c?delete e[t]:void 0!==l.value&&(e[t]=l.value)}}if(s.size||t._flags._hasPatternMatch){const r=h.unknown(t,e,s,o,n,i);if(r)return r}if(t.$_terms.dependencies)for(const r of t.$_terms.dependencies){if(r.key&&void 0===r.key.resolve(e,n,i,null,{shadow:!1}))continue;const s=h.dependencies[r.rel](t,r,e,n,i);if(s){const r=t.$_createError(s.code,e,s.context,n,i);if(i.abortEarly)return{value:e,errors:r};o.push(r)}}return{value:e,errors:o}},rules:{and:{method(...e){return c.verifyFlat(e,"and"),h.dependency(this,"and",null,e)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,r){d.isTemplate(e)||(e=u.ref(e)),i(void 0===r||"string"==typeof r,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});const n=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:r}});return n.$_mutateRegister(e),n.$_mutateRegister(t),n},validate(e,{error:t,prefs:r,state:n},{subject:i,schema:o,message:s}){const a=i.resolve(e,n,r),c=f.isRef(i)?i.absolute(n):[];return o.$_match(a,n.localize(c,[e,...n.ancestors],o),r)?e:t("object.assert",{subject:i,message:s})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return i("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate:(e,t,{constructor:r,name:n})=>e instanceof r?e:t.error("object.instance",{type:n,value:e}),args:["constructor","name"]},keys:{method(e){i(void 0===e||"object"==typeof e,"Object schema must be a valid object"),i(!c.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(e)if(Object.keys(e).length){t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter(t=>!e.hasOwnProperty(t.key)):new h.Keys;for(const r in e)c.tryWithPath(()=>t.$_terms.keys.push({key:r,schema:this.$_compile(e[r])}),r)}else t.$_terms.keys=new h.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:n,operator:i,args:o})=>c.compare(Object.keys(e).length,r,i)?e:t.error("object."+n,{limit:o.limit,value:e}),args:[{name:"limit",ref:!0,assert:c.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(...e){return c.verifyFlat(e,"nand"),h.dependency(this,"nand",null,e)}},or:{method(...e){return c.verifyFlat(e,"or"),h.dependency(this,"or",null,e)}},oxor:{method(...e){return h.dependency(this,"oxor",null,e)}},pattern:{method(e,t,r={}){const n=e instanceof RegExp;n||(e=this.$_compile(e,{appendPath:!0})),i(void 0!==t,"Invalid rule"),c.assertOptions(r,["fallthrough","matches"]),n&&i(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const o=this.clone();o.$_terms.patterns=o.$_terms.patterns||[];const s={[n?"regex":"schema"]:e,rule:t};return r.matches&&(s.matches=this.$_compile(r.matches),"array"!==s.matches.type&&(s.matches=s.matches.$_root.array().items(s.matches)),o.$_mutateRegister(s.matches),o.$_setFlag("_hasPatternMatch",!0,{clone:!1})),r.fallthrough&&(s.fallthrough=!0),o.$_terms.patterns.push(s),o.$_mutateRegister(t),o}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>f.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t,r={}){i("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),i("string"==typeof t||t instanceof d,"Invalid rename to argument"),i(t!==e,"Cannot rename key to same name:",e),c.assertOptions(r,["alias","ignoreUndefined","override","multiple"]);const o=this.clone();o.$_terms.renames=o.$_terms.renames||[];for(const t of o.$_terms.renames)i(t.from!==e,"Cannot rename the same key multiple times");return t instanceof d&&o.$_mutateRegister(t),o.$_terms.renames.push({from:e,to:t,options:n(h.renameDefaults,r)}),o}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate:(e,t,{type:r})=>!c.isSchema(e)||"any"!==r&&e.type!==r?t.error("object.schema",{type:r}):e},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t,r={}){return h.dependency(this,"with",e,t,r)}},without:{method(e,t,r={}){return h.dependency(this,"without",e,t,r)}},xor:{method(...e){return c.verifyFlat(e,"xor"),h.dependency(this,"xor",null,e)}}},overrides:{default(e,t){return void 0===e&&(e=c.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){const t=new s.Sorter;for(const r of e.$_terms.keys)c.tryWithPath(()=>t.add(r,{after:r.schema.$_rootReferences(),group:r.key}),r.key);e.$_terms.keys=new h.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:r,key:n=null,peers:i,options:o}of t.dependencies)e=h.dependency(e,r,n,i,o);if(t.patterns)for(const{regex:r,schema:n,rule:i,fallthrough:o,matches:s}of t.patterns)e=e.pattern(r||n,i,{fallthrough:o,matches:s});if(t.renames)for(const{from:r,to:n,options:i}of t.renames)e=e.rename(r,n,i);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),h.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return o(e,{shallow:!0});const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e),r}const r=function(...t){return e.apply(this,t)};return r.prototype=o(e.prototype),Object.defineProperty(r,"name",{value:e.name,writable:!1}),Object.defineProperty(r,"length",{value:e.length,writable:!1}),Object.assign(r,e),r},h.dependency=function(e,t,r,n,o){i(null===r||"string"==typeof r,t,"key must be a strings"),o||(o=n.length>1&&"object"==typeof n[n.length-1]?n.pop():{}),c.assertOptions(o,["separator"]),n=[].concat(n);const s=c.default(o.separator,"."),a=[];for(const e of n)i("string"==typeof e,t,"peers must be a string or a reference"),a.push(u.ref(e,{separator:s,ancestor:0,prefix:!1}));null!==r&&(r=u.ref(r,{separator:s,ancestor:0,prefix:!1}));const l=e.clone();return l.$_terms.dependencies=l.$_terms.dependencies||[],l.$_terms.dependencies.push(new h.Dependency(t,r,a,n)),l},h.dependencies={and(e,t,r,n,i){const o=[],s=[],a=t.peers.length;for(const e of t.peers)void 0===e.resolve(r,n,i,null,{shadow:!1})?o.push(e.key):s.push(e.key);if(o.length!==a&&s.length!==a)return{code:"object.and",context:{present:s,presentWithLabels:h.keysToLabels(e,s),missing:o,missingWithLabels:h.keysToLabels(e,o)}}},nand(e,t,r,n,i){const o=[];for(const e of t.peers)void 0!==e.resolve(r,n,i,null,{shadow:!1})&&o.push(e.key);if(o.length!==t.peers.length)return;const s=t.paths[0],a=t.paths.slice(1);return{code:"object.nand",context:{main:s,mainWithLabel:h.keysToLabels(e,s),peers:a,peersWithLabels:h.keysToLabels(e,a)}}},or(e,t,r,n,i){for(const e of t.peers)if(void 0!==e.resolve(r,n,i,null,{shadow:!1}))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:h.keysToLabels(e,t.paths)}}},oxor(e,t,r,n,i){const o=[];for(const e of t.peers)void 0!==e.resolve(r,n,i,null,{shadow:!1})&&o.push(e.key);if(!o.length||1===o.length)return;const s={peers:t.paths,peersWithLabels:h.keysToLabels(e,t.paths)};return s.present=o,s.presentWithLabels=h.keysToLabels(e,o),{code:"object.oxor",context:s}},with(e,t,r,n,i){for(const o of t.peers)if(void 0===o.resolve(r,n,i,null,{shadow:!1}))return{code:"object.with",context:{main:t.key.key,mainWithLabel:h.keysToLabels(e,t.key.key),peer:o.key,peerWithLabel:h.keysToLabels(e,o.key)}}},without(e,t,r,n,i){for(const o of t.peers)if(void 0!==o.resolve(r,n,i,null,{shadow:!1}))return{code:"object.without",context:{main:t.key.key,mainWithLabel:h.keysToLabels(e,t.key.key),peer:o.key,peerWithLabel:h.keysToLabels(e,o.key)}}},xor(e,t,r,n,i){const o=[];for(const e of t.peers)void 0!==e.resolve(r,n,i,null,{shadow:!1})&&o.push(e.key);if(1===o.length)return;const s={peers:t.paths,peersWithLabels:h.keysToLabels(e,t.paths)};return 0===o.length?{code:"object.missing",context:s}:(s.present=o,s.presentWithLabels=h.keysToLabels(e,o),{code:"object.xor",context:s})}},h.keysToLabels=function(e,t){return Array.isArray(t)?t.map(t=>e.$_mapLabels(t)):e.$_mapLabels(t)},h.rename=function(e,t,r,n,i){const o={};for(const s of e.$_terms.renames){const a=[],c="string"!=typeof s.from;if(c)for(const e in t){if(void 0===t[e]&&s.options.ignoreUndefined)continue;if(e===s.to)continue;const r=s.from.exec(e);r&&a.push({from:e,to:s.to,match:r})}else!Object.prototype.hasOwnProperty.call(t,s.from)||void 0===t[s.from]&&s.options.ignoreUndefined||a.push(s);for(const u of a){const a=u.from;let l=u.to;if(l instanceof d&&(l=l.render(t,r,n,u.match)),a!==l){if(!s.options.multiple&&o[l]&&(i.push(e.$_createError("object.rename.multiple",t,{from:a,to:l,pattern:c},r,n)),n.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,l)&&!s.options.override&&!o[l]&&(i.push(e.$_createError("object.rename.override",t,{from:a,to:l,pattern:c},r,n)),n.abortEarly))return!1;void 0===t[a]?delete t[l]:t[l]=t[a],o[l]=!0,s.options.alias||delete t[a]}}}return!0},h.unknown=function(e,t,r,n,i,o){if(e.$_terms.patterns){let s=!1;const a=e.$_terms.patterns.map(e=>{if(e.matches)return s=!0,[]}),c=[t,...i.ancestors];for(const s of r){const u=t[s],l=[...i.path,s];for(let f=0;f256)return i.code("DOMAIN_TOO_LONG");if(o.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return i.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(o.domainControlRx.test(e))return i.code("DOMAIN_INVALID_CHARS");e=o.punycode(e);const r=t.minDomainSegments||o.minDomainSegments,n=e.split(".");if(n.lengtht.maxDomainSegments)return i.code("DOMAIN_SEGMENTS_COUNT_MAX");const s=t.tlds;if(s){const e=n[n.length-1].toLowerCase();if(s.deny&&s.deny.has(e)||s.allow&&!s.allow.has(e))return i.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e63)return i.code("DOMAIN_LONG_SEGMENT");if(e=1,"scheme must have at least 1 scheme specified");const o=[];for(let e=0;e=256)return"&#"+e+";";const r=e.toString(16).padStart(2,"0");return"&#x".concat(r,";")},n.isSafe=function(e){return void 0!==n.safeCharCodes[e]},n.namedHtml={38:"&",60:"<",62:">",34:""",160:" ",162:"¢",163:"£",164:"¤",169:"©",174:"®"},n.safeCharCodes=function(){const e={};for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&(e[t]=null);return e}()},function(e,t,r){"use strict";const n={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*\.?[0-9]*){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e,t={}){if(!t[n.settings]&&t.constants)for(const e in t.constants){const r=t.constants[e];if(null!==r&&!["boolean","number","string"].includes(typeof r))throw new Error("Formula constant ".concat(e," contains invalid ").concat(typeof r," value type"))}this.settings=t[n.settings]?t:Object.assign({[n.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let r=[],i="",o=0,s=!1;const a=e=>{if(o)throw new Error("Formula missing closing parenthesis");const a=r.length?r[r.length-1]:null;if(s||i||e){if(a&&"reference"===a.type&&")"===e)return a.type="function",a.value=this._subFormula(i,a.value),void(i="");if(")"===e){const e=new t.Parser(i,this.settings);r.push({type:"segment",value:e})}else if(s){if("]"===s)return r.push({type:"reference",value:i}),void(i="");r.push({type:"literal",value:i})}else if(n.operatorCharacters.includes(i))a&&"operator"===a.type&&n.operators.includes(a.value+i)?a.value+=i:r.push({type:"operator",value:i});else if(i.match(n.numberRx))r.push({type:"constant",value:parseFloat(i)});else if(void 0!==this.settings.constants[i])r.push({type:"constant",value:this.settings.constants[i]});else{if(!i.match(n.tokenRx))throw new Error("Formula contains invalid token: ".concat(i));r.push({type:"reference",value:i})}i=""}};for(const t of e)s?t===s?(a(),s=!1):i+=t:o?"("===t?(i+=t,++o):")"===t?(--o,o?i+=t:a(t)):i+=t:t in n.literals?s=n.literals[t]:"("===t?(a(),++o):n.operatorCharacters.includes(t)?(a(),i=t,a()):" "!==t?i+=t:a();a(),r=r.map((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==r[t-1].type?e:{type:"operator",value:"n"});let c=!1;for(const e of r){if("operator"===e.type){if(n.operatorsPrefix.includes(e.value))continue;if(!c)throw new Error("Formula contains an operator in invalid position");if(!n.operators.includes(e.value))throw new Error("Formula contains an unknown operator ".concat(e.value))}else if(c)throw new Error("Formula missing expected operator");c=!c}if(!c)throw new Error("Formula contains invalid trailing operator");1===r.length&&["reference","literal","constant"].includes(r[0].type)&&(this.single={type:"reference"===r[0].type?"reference":"value",value:r[0].value}),this._parts=r.map(e=>{if("operator"===e.type)return n.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error("Formula contains invalid reference ".concat(e.value));return this.settings.reference?this.settings.reference(e.value):n.reference(e.value)})}_subFormula(e,r){const i=this.settings.functions[r];if("function"!=typeof i)throw new Error("Formula contains unknown function ".concat(r));let o=[];if(e){let t="",i=0,s=!1;const a=()=>{if(!t)throw new Error("Formula contains function ".concat(r," with invalid arguments ").concat(e));o.push(t),t=""};for(let r=0;rnew t.Parser(e,this.settings)),function(e){const t=[];for(const r of o)t.push(r.evaluate(e));return i.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let r=t.length-2;r>=0;--r){const i=t[r];if(i&&"operator"===i.type){const o=t[r+1];t.splice(r+1,1);const s=n.evaluate(o,e);t[r]=n.single(i.value,s)}}return n.operatorsOrder.forEach(r=>{for(let i=1;i":return t>r;case">=":return t>=r;case"==":return t===r;case"!=":return t!==r;case"&&":return t&&r;case"||":return t||r}return null},n.exists=function(e){return null!=e}},function(e,t){},function(e,t,r){"use strict";const n=r(0),i=r(3),o=r(1),s=r(8),a=r(4),c=r(5),u={};e.exports=i.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:c.toSibling}},args:(e,...t)=>1===t.length&&Array.isArray(t[0])?e.try(...t[0]):e.try(...t),validate(e,t){const{schema:r,error:n,state:i,prefs:o}=t;if(r._flags.match){let t,s=0;for(let n=0;n"is"!==r.path[0]?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{o.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const r of t.matches){const{schema:t,ref:n,is:i,not:o,then:s,otherwise:a}=r;e=t?e.try(t):n?e.conditional(n,{is:i,then:s,not:o,otherwise:a,switch:r.switch}):e.conditional(i,{then:s,otherwise:a})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),u.errors=function(e,{error:t,state:r}){if(!e.length)return{errors:t("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const n=new Set,i=[];for(const{reports:o,schema:s}of e){if(o.length>1)return u.unmatched(e,t);const c=o[0];if(c instanceof a.Report==0)return u.unmatched(e,t);if(c.state.path.length!==r.path.length){i.push({type:s.type,report:c});continue}if("any.only"===c.code){for(const e of c.local.valids)n.add(e);continue}const[l,f]=c.code.split(".");"base"===f?n.add(l):i.push({type:s.type,report:c})}return i.length?1===i.length?{errors:i[0].report}:u.unmatched(e,t):{errors:t("alternatives.types",{types:[...n]})}},u.unmatched=function(e,t){const r=[];for(const t of e)r.push(...t.reports);return{errors:t("alternatives.match",a.details(r,{override:!1}))}}},function(e,t,r){"use strict";const n=r(0),i=r(2),o=r(10),s=r(20),a=r(15),c=r(1),u=r(8),l=r(4),f=r(17),d=r(18),h=r(9),p=r(35),m=r(5),g=r(19),y=r(36),b=r(21),v={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new p.Ids,this._preferences=null,this._refs=new m.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return n("function"==typeof d.describe,"Manifest functionality disabled"),d.describe(this)}allow(...e){return c.verifyFlat(e,"allow"),this._values(e,"_valids")}alter(e){n(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),n(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const r in e){const i=e[r];n("function"==typeof i,"Alteration adjuster for",r,"must be a function"),t.$_terms.alterations.push({target:r,adjuster:i})}return t.$_temp.ruleset=!1,t}artifact(e){return n(void 0!==e,"Artifact cannot be undefined"),n(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return n(!1===e||"string"==typeof e,"Invalid to value"),n(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return n(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return n(e,"Missing error"),n(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e,t={}){return n(void 0!==e,"Missing example"),c.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(n(!t,"Cannot combine options with description"),t=e.description,e=e.method),n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(n("string"==typeof e,"id must be a non-empty string"),n(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(...e){return this._values(e,"_invalids")}label(e){return n(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return n(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(...e){n(e.length,"Missing notes");for(const t of e)n(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!0){return n("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){n(e,"Missing preferences"),n(void 0===e.context,"Cannot override context"),n(void 0===e.externals,"Cannot override externals"),n(void 0===e.warnings,"Cannot override warnings"),n(void 0===e.debug,"Cannot override debug"),c.checkPreferences(e);const t=this.clone();return t._preferences=c.preferences(t._preferences,e),t}presence(e){return n(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(e=!0){return this.$_setFlag("result",e?"raw":void 0)}result(e){return n(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),r=void 0!==e&&!e;return t._preferences=c.preferences(t._preferences,{convert:r}),t}strip(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){n(e.length,"Missing tags");for(const t of e)n(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return n(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){c.verifyFlat(e,"valid");const t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){const r=this.clone();r.$_terms.whens||(r.$_terms.whens=[]);const i=u.when(r,e,t);if(!["any","link"].includes(r.type)){const e=i.is?[i]:i.switch;for(const t of e)n(!t.then||"any"===t.then.type||t.then.type===r.type,"Cannot combine",r.type,"with",t.then&&t.then.type),n(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===r.type,"Cannot combine",r.type,"with",t.otherwise&&t.otherwise.type)}return r.$_terms.whens.push(i),r.$_mutateRebuild()}cache(e){n(!this._inRuleset(),"Cannot set caching inside a ruleset"),n(!this._cache,"Cannot override schema cache"),n(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||a.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){n(c.isSchema(e),"Invalid schema object"),n("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),n(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),n(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const r=e.clone();for(const e of Object.keys(t))"type"!==e&&(r[e]=t[e]);t=r}t._ids.concat(e._ids),t._refs.register(e,m.toSibling),t._preferences=t._preferences?c.preferences(t._preferences,e._preferences):e._preferences,t._valids=b.merge(t._valids,e._valids,e._invalids),t._invalids=b.merge(t._invalids,e._invalids,e._valids);for(const r of e._singleRules.keys())t._singleRules.has(r)&&(t._rules=t._rules.filter(e=>e.keep||e.name!==r),t._singleRules.delete(r));for(const r of e._rules)e._definition.rules[r.method].multi||t._singleRules.set(r.name,r),t._rules.push(r);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const r=Object.assign({},e._flags);delete r.empty,s(t._flags,r)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const r=Object.assign({},e._flags);delete r.empty,s(t._flags,r)}else s(t._flags,e._flags);for(const r in e.$_terms){const n=e.$_terms[r];n?t.$_terms[r]?t.$_terms[r]=t.$_terms[r].concat(n):t.$_terms[r]=n.slice():t.$_terms[r]||(t.$_terms[r]=n)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return n(!e.base,"Cannot extend type with another base"),f.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){n(!this._inRuleset(),"Cannot fork inside a ruleset");let r=this;for(let n of[].concat(e))n=Array.isArray(n)?n:n.split("."),r=r._ids.fork(n,t,r);return r.$_temp.ruleset=!1,r}rule(e){const t=this._definition;c.assertOptions(e,Object.keys(t.modifiers)),n(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const r=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;n(r>=0&&rt.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),n(e&&"object"==typeof e,"Invalid options"),n(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)n("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const r=this._definition.rules[t.method],i=t.args;n(r,"Unknown rule",t.method);const o=this.clone();if(i){n(1===Object.keys(i).length||Object.keys(i).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in i){let s=i[e];if(void 0!==s){if(r.argsByName){const a=r.argsByName.get(e);if(a.ref&&c.isResolvable(s))t._resolve.push(e),o.$_mutateRegister(s);else if(a.normalize&&(s=a.normalize(s),i[e]=s),a.assert){const t=c.validateArg(s,e,a);n(!t,t,"or reference")}}i[e]=s}else delete i[e]}}return r.multi||(o._ruleRemove(t.name,{clone:!1}),o._singleRules.set(t.name,t)),!1===o.$_temp.ruleset&&(o.$_temp.ruleset=null),r.priority?o._rules.unshift(t):o._rules.push(t),o}$_compile(e,t){return u.schema(this.$_root,e,t)}$_createError(e,t,r,n,i,o={}){const s=!1!==o.flags?this._flags:{},a=o.messages?h.merge(this._definition.messages,o.messages):this._definition.messages;return new l.Report(e,t,r,s,a,n,i)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,r,n){(r=Object.assign({},r)).abortEarly=!0,r._externals=!1,t.snapshot();const i=!y.validate(e,this,t,r,n).errors;return t.restore(),i}$_modify(e){return c.assertOptions(e,["each","once","ref","schema"]),p.schema(this,e)||this}$_mutateRebuild(){return n(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,{source:t,name:r,path:n,key:i})=>{const o=this._definition[t][r]&&this._definition[t][r].register;!1!==o&&this.$_mutateRegister(e,{family:o,key:i})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:r}={}){this._refs.register(e,t),this._ids.register(e,{key:r})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,r={}){n("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const i=this._definition.flags[e]||{};if(o(t,i.default)&&(t=void 0),o(t,this._flags[e]))return this;const s=!1!==r.clone?this.clone():this;return void 0!==t?(s._flags[e]=t,s.$_mutateRegister(t)):delete s._flags[e],"_"!==e[0]&&(s.$_temp.ruleset=!1),s}$_parent(e,...t){return this[e][c.symbols.parent].call(this,...t)}$_validate(e,t,r){return y.validate(e,this,t,r)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=i(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const r in t){const n=t[r];e.$_terms[r]=n.init}return e.$_mutateRebuild()}_default(e,t,r={}){return c.assertOptions(r,"literal"),n(void 0!==t,"Missing",e,"value"),n("function"==typeof t||!r.literal,"Only function value supports literal option"),"function"==typeof t&&r.literal&&(t={[c.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,r){if(!this.$_terms.whens)return{schema:this};const n=[],i=[];for(let o=0;ou)break}const o=i.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",o),!o)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[o])return{schema:this.$_temp.whens[o],id:o};let s=this;this._definition.generate&&(s=this._definition.generate(this,e,t,r));for(const e of n)s=s.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(s,[this,...n]),this.$_temp.whens[o]=s,{schema:s,id:o}}_inner(e,t,r={}){n(!this._inRuleset(),"Cannot set ".concat(e," inside a ruleset"));const i=this.clone();return i.$_terms[e]&&!r.override||(i.$_terms[e]=[]),r.single?i.$_terms[e].push(t):i.$_terms[e].push(...t),i.$_temp.ruleset=!1,i}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){if(!this._singleRules.has(e))return this;const r=!1!==t.clone?this.clone():this;r._singleRules.delete(e);const n=[];for(let t=0;t{if(r===(e._flags.id||t))return n},ref:!1});return i?i.$_mutateRebuild():e},t.schema=function(e,t){let r;for(const n in e._flags){if("_"===n[0])continue;const i=u.scan(e._flags[n],{source:"flags",name:n},t);void 0!==i&&(r=r||e.clone(),r._flags[n]=i)}for(let n=0;nt.$_createError(i,e,o,s||r,n),s={original:e,prefs:n,schema:t,state:r,error:o,errorsArray:l.errorsArray,warn:(e,t,n)=>r.mainstay.warnings.push(o(e,t,n)),message:(i,o)=>t.$_createError("custom",e,o,r,n,{messages:i})};r.mainstay.tracer.entry(t,r);const c=t._definition;if(c.prepare&&void 0!==e&&n.convert){const t=c.prepare(e,s);if(t){if(r.mainstay.tracer.value(r,"prepare",e,t.value),t.errors)return l.finalize(t.value,[].concat(t.errors),s);e=t.value}}if(c.coerce&&void 0!==e&&n.convert&&(!c.coerce.from||c.coerce.from.includes(typeof e))){const t=c.coerce.method(e,s);if(t){if(r.mainstay.tracer.value(r,"coerced",e,t.value),t.errors)return l.finalize(t.value,[].concat(t.errors),s);e=t.value}}const u=t._flags.empty;u&&u.$_match(l.trim(e,t),r.nest(u),a.defaults)&&(r.mainstay.tracer.value(r,"empty",e,void 0),e=void 0);const f=i.presence||t._flags.presence||(t._flags._endedSwitch?null:n.presence);if(void 0===e){if("forbidden"===f)return l.finalize(e,null,s);if("required"===f)return l.finalize(e,[t.$_createError("any.required",e,null,r,n)],s);if("optional"===f){if(t._flags.default!==a.symbols.deepDefault)return l.finalize(e,null,s);r.mainstay.tracer.value(r,"default",e,{}),e={}}}else if("forbidden"===f)return l.finalize(e,[t.$_createError("any.unknown",e,null,r,n)],s);const d=[];if(t._valids){const i=t._valids.get(e,r,n,t._flags.insensitive);if(i)return n.convert&&(r.mainstay.tracer.value(r,"valids",e,i.value),e=i.value),r.mainstay.tracer.filter(t,r,"valid",i),l.finalize(e,null,s);if(t._flags.only){const i=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},r,n);if(n.abortEarly)return l.finalize(e,[i],s);d.push(i)}}if(t._invalids){const i=t._invalids.get(e,r,n,t._flags.insensitive);if(i){r.mainstay.tracer.filter(t,r,"invalid",i);const o=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},r,n);if(n.abortEarly)return l.finalize(e,[o],s);d.push(o)}}if(c.validate){const t=c.validate(e,s);if(t&&(r.mainstay.tracer.value(r,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return d.push(t.errors),l.finalize(e,d,s);if(t.errors.length)return d.push(...t.errors),l.finalize(e,d,s)}}return t._rules.length?l.rules(e,d,s):l.finalize(e,d,s)},l.rules=function(e,t,r){const{schema:n,state:i,prefs:o}=r;for(const s of n._rules){const c=n._definition.rules[s.method];if(c.convert&&o.convert){i.mainstay.tracer.log(n,i,"rule",s.name,"full");continue}let u,f=s.args;if(s._resolve.length){f=Object.assign({},f);for(const t of s._resolve){const r=c.argsByName.get(t),s=f[t].resolve(e,i,o),l=r.normalize?r.normalize(s):s,d=a.validateArg(l,null,r);if(d){u=n.$_createError("any.ref",s,{arg:t,ref:f[t],reason:d},i,o);break}f[t]=l}}u=u||c.validate(e,r,f,s);const d=l.rule(u,s);if(d.errors){if(i.mainstay.tracer.log(n,i,"rule",s.name,"error"),s.warn){i.mainstay.warnings.push(...d.errors);continue}if(o.abortEarly)return l.finalize(e,d.errors,r);t.push(...d.errors)}else i.mainstay.tracer.log(n,i,"rule",s.name,"pass"),i.mainstay.tracer.value(i,"rule",e,d.value,s.name),e=d.value}return l.finalize(e,t,r)},l.rule=function(e,t){return e instanceof c.Report?(l.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[a.symbols.errors]?(e.forEach(e=>l.error(e,t)),{errors:e,value:null}):{errors:null,value:e}},l.error=function(e,t){return t.message&&e._setTemplate(t.message),e},l.finalize=function(e,t,r){t=t||[];const{schema:i,state:o,prefs:s}=r;if(t.length){const n=l.default("failover",void 0,t,r);void 0!==n&&(o.mainstay.tracer.value(o,"failover",e,n),e=n,t=[])}if(t.length&&i._flags.error)if("function"==typeof i._flags.error){t=i._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)n(e instanceof Error||e instanceof c.Report,"error() must return an Error object")}else t=[i._flags.error];if(void 0===e){const n=l.default("default",e,t,r);o.mainstay.tracer.value(o,"default",e,n),e=n}if(i._flags.cast&&void 0!==e){const t=i._definition.cast[i._flags.cast];if(t.from(e)){const n=t.to(e,r);o.mainstay.tracer.value(o,"cast",e,n,i._flags.cast),e=n}}if(i.$_terms.externals&&s.externals&&!1!==s._externals)for(const{method:e}of i.$_terms.externals)o.mainstay.externals.push({method:e,path:o.path,label:c.label(i._flags,o,s)});const a={value:e,errors:t.length?t:null};return i._flags.result&&(a.value="strip"===i._flags.result?void 0:r.original,o.mainstay.tracer.value(o,i._flags.result,e,a.value),o.shadow(e,i._flags.result)),i._cache&&!1!==s.cache&&!i._refs.length&&i._cache.set(r.original,a),void 0===e||a.errors||void 0===i._flags.artifact||(o.mainstay.artifacts=o.mainstay.artifacts||new Map,o.mainstay.artifacts.has(i._flags.artifact)||o.mainstay.artifacts.set(i._flags.artifact,[]),o.mainstay.artifacts.get(i._flags.artifact).push(o.path)),a},l.prefs=function(e,t){const r=t===a.defaults;return r&&e._preferences[a.symbols.prefs]?e._preferences[a.symbols.prefs]:(t=a.preferences(t,e._preferences),r&&(e._preferences[a.symbols.prefs]=t),t)},l.default=function(e,t,r,n){const{schema:o,state:s,prefs:c}=n,u=o._flags[e];if(c.noDefaults||void 0===u)return t;if(s.mainstay.tracer.log(o,s,"rule",e,"full"),!u)return u;if("function"==typeof u){const a=u.length?[i(s.ancestors[0]),n]:[];try{return u(...a)}catch(t){return void r.push(o.$_createError("any.".concat(e),null,{error:t},s,c))}}return"object"!=typeof u?u:u[a.symbols.literal]?u.literal:a.isResolvable(u)?u.resolve(t,s,c):i(u)},l.trim=function(e,t){if("string"!=typeof e)return e;const r=t.$_getRule("trim");return r&&r.args.enabled?e.trim():e},l.ignore={active:!1,debug:o,entry:o,filter:o,log:o,resolve:o,value:o},l.errorsArray=function(){const e=[];return e[a.symbols.errors]=!0,e}},function(e,t,r){"use strict";e.exports=function(){}},function(e,t,r){"use strict";const n=r(2),i=r(6),o=r(1),s={value:Symbol("value")};e.exports=s.State=class{constructor(e,t,r){this.path=e,this.ancestors=t,this.mainstay=r.mainstay,this.schemas=r.schemas,this.debug=null}localize(e,t=null,r=null){const n=new s.State(e,t,this);return r&&n.schemas&&(n.schemas=[s.schemas(r),...n.schemas]),n}nest(e,t){const r=new s.State(this.path,this.ancestors,this);return r.schemas=r.schemas&&[s.schemas(e),...r.schemas],r.debug=t,r}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new s.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=n(this.mainstay.shadow.node(this.path)))}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0)}},s.schemas=function(e){return o.isSchema(e)?{schema:e}:e},s.Shadow=class{constructor(){this._values=null}set(e,t,r){if(!e.length)return;if("strip"===r&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let n=this._values;for(let t=0;tthis.$_compile(e[r]),r,{append:!0});t.$_terms.items.push(n)}return t.$_mutateRebuild()},validate(e,{schema:t,error:r,state:n,prefs:i,errorsArray:o}){const s=t.$_terms._requireds.slice(),c=t.$_terms.ordered.slice(),l=[...t.$_terms._inclusions,...s],f=!e[a.symbols.arraySingle];delete e[a.symbols.arraySingle];const d=o();let h=e.length;for(let o=0;o="})}},ordered:{method(...e){a.verifyFlat(e,"ordered");const t=this.$_addRule("items");for(let r=0;rthis.$_compile(e[r]),r,{append:!0});u.validateSingle(n,t),t.$_mutateRegister(n),t.$_terms.ordered.push(n)}return t.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return n(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(e={}){a.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=c.ref(e.by,{ancestor:0}),n(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,{error:t,state:r,prefs:n,schema:i},{options:o}){const{value:s,errors:a}=u.sort(i,e,o,r,n);if(a)return a;for(let r=0;rnew Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)u.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)u.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),u.fillMissedErrors=function(e,t,r,n,i,o){const s=[];let a=0;for(const e of r){const t=e._flags.label;t?s.push(t):++a}s.length?a?t.push(e.$_createError("array.includesRequiredBoth",n,{knownMisses:s,unknownMisses:a},i,o)):t.push(e.$_createError("array.includesRequiredKnowns",n,{knownMisses:s},i,o)):t.push(e.$_createError("array.includesRequiredUnknowns",n,{unknownMisses:a},i,o))},u.fillOrderedErrors=function(e,t,r,n,i,o){const s=[];for(const e of r)"required"===e._flags.presence&&s.push(e);s.length&&u.fillMissedErrors(e,t,s,n,i,o)},u.fastSplice=function(e,t){let r=t;for(;r{let f=u.compare(c,l,s,a);if(null!==f)return f;if(r.by&&(c=r.by.resolve(c,n,i),l=r.by.resolve(l,n,i)),f=u.compare(c,l,s,a),null!==f)return f;const d=typeof c;if(d!==typeof l)throw e.$_createError("array.sort.mismatching",t,null,n,i);if("number"!==d&&"string"!==d)throw e.$_createError("array.sort.unsupported",t,{type:d},n,i);return"number"===d?(c-l)*o:ce?1:0},string:{from:a.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},function(e,t,r){"use strict";const n=r(0),i=r(3),o=r(1),s=r(7),a={isDate:function(e){return e instanceof Date}};e.exports=i.extend({type:"date",coerce:{from:["number","string"],method:(e,{schema:t})=>({value:a.parse(e,t._flags.format)||e})},validate(e,{schema:t,error:r,prefs:n}){if(e instanceof Date&&!isNaN(e.getTime()))return;const i=t._flags.format;return n.convert&&i&&"string"==typeof e?{value:e,errors:r("date.format",{format:i})}:{value:e,errors:r("date.base")}},rules:{compare:{method:!1,validate(e,t,{date:r},{name:n,operator:i,args:s}){const a="now"===r?Date.now():r.getTime();return o.compare(e.getTime(),a,i)?e:t.error("date."+n,{limit:s.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:a.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return n(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(e="javascript"){return n(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:a.isDate,to:(e,t)=>e.getTime()},string:{from:a.isDate,to:(e,{prefs:t})=>s.date(e,t)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),a.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return o.isIsoDate(e)?a.date(e.toString()):null;const r=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return a.date(1*e);if("unix"===t)return a.date(1e3*e);if("string"==typeof r)return null}return a.date(e)},a.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},function(e,t,r){"use strict";const n=r(0),i=r(22);e.exports=i.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate:(e,t,{n:r})=>e.length===r?e:t.error("function.arity",{n:r})},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return n(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate:(e,t,{n:r})=>e.length>=r?e:t.error("function.minArity",{n:r})},maxArity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate:(e,t,{n:r})=>e.length<=r?e:t.error("function.maxArity",{n:r})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},function(e,t,r){"use strict";const n=r(0),i=r(2),o=r(20),s=r(6),a={};e.exports=function(e,t,r={}){if(n(e&&"object"==typeof e,"Invalid defaults value: must be an object"),n(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),n("object"==typeof r,"Invalid options: must be an object"),!t)return null;if(r.shallow)return a.applyToDefaultsWithShallow(e,t,r);const s=i(e);if(!0===t)return s;const c=void 0!==r.nullOverride&&r.nullOverride;return o(s,t,{nullOverride:c,mergeArrays:!1})},a.applyToDefaultsWithShallow=function(e,t,r){const c=r.shallow;n(Array.isArray(c),"Invalid keys");const u=new Map,l=!0===t?null:new Set;for(let r of c){r=Array.isArray(r)?r:r.split(".");const n=s(e,r);n&&"object"==typeof n?u.set(n,l&&s(t,r)||n):l&&l.add(r)}const f=i(e,{},u);if(!l)return f;for(const e of l)a.reachCopy(f,t,e);return o(f,t,{mergeArrays:!1,nullOverride:!1})},a.reachCopy=function(e,t,r){for(const e of r){if(!(e in t))return;t=t[e]}const n=t;let i=e;for(let e=0;ee.sort===t.sort?0:e.sorte.ref(t),validate(e,{schema:t,state:r,prefs:i}){n(t.$_terms.link,"Uninitialized link schema");const o=c.generate(t,e,r,i),s=t.$_terms.link[0].ref;return o.$_validate(e,r.nest(o,"link:".concat(s.display,":").concat(o.type)),i)},generate:(e,t,r,n)=>c.generate(e,t,r,n),rules:{ref:{method(e){n(!this.$_terms.link,"Cannot reinitialize schema"),e=s.ref(e),n("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),n("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(e=!0){return this.$_setFlag("relative",e)}}},overrides:{concat(e){n(this.$_terms.link,"Uninitialized link schema"),n(o.isSchema(e),"Invalid schema object"),n("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(n(t.link,"Invalid link description missing link"),e.ref(t.link))}}),c.generate=function(e,t,r,n){let i=r.mainstay.links.get(e);if(i)return i._generate(t,r,n).schema;const o=e.$_terms.link[0].ref,{perspective:s,path:a}=c.perspective(o,r);c.assert(s,"which is outside of schema boundaries",o,e,r,n);try{i=a.length?s.$_reach(a):s}catch(t){c.assert(!1,"to non-existing schema",o,e,r,n)}return c.assert("link"!==i.type,"which is another link",o,e,r,n),e._flags.relative||r.mainstay.links.set(e,i),i._generate(t,r,n).schema},c.perspective=function(e,t){if("local"===e.type){for(const{schema:r,key:n}of t.schemas){if((r._flags.id||n)===e.path[0])return{perspective:r,path:e.path.slice(1)};if(r.$_terms.shared)for(const t of r.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},c.assert=function(e,t,r,i,o,s){e||n(!1,'"'.concat(a.label(i._flags,o,s),'" contains link reference "').concat(r.display,'" ').concat(t))}},function(e,t,r){"use strict";const n=r(0),i=r(3),o=r(1),s={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/};e.exports=i.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:t,error:r}){const n=e.match(s.numberRx);if(!n)return;e=e.trim();const i={value:parseFloat(e)};if(0===i.value&&(i.value=0),!t._flags.unsafe)if(e.match(/e/i)){if(s.normalizeExponent("".concat(i.value/Math.pow(10,n[1]),"e").concat(n[1]))!==s.normalizeExponent(e))return i.errors=r("number.unsafe"),i}else{const t=i.value.toString();if(t.match(/e/i))return i;if(t!==s.normalizeDecimal(e))return i.errors=r("number.unsafe"),i}return i}},validate(e,{schema:t,error:r,prefs:n}){if(e===1/0||e===-1/0)return{value:e,errors:r("number.infinity")};if(!o.isNumber(e))return{value:e,errors:r("number.base")};const i={value:e};if(n.convert){const e=t.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);i.value=Math.round(i.value*t)/t}}return 0===i.value&&(i.value=0),!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||eo.compare(e,r,i)?e:t.error("number."+n,{limit:s.limit,value:e}),args:[{name:"limit",ref:!0,assert:o.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate:(e,t,{base:r},n)=>e%r==0?e:t.error("number.multiple",{multiple:n.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return n(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,{limit:r}){const n=e.toString().match(s.precisionRx);return Math.max((n[1]?n[1].length:0)-(n[2]?parseInt(n[2],10):0),0)<=r?e:t.error("number.precision",{limit:r,value:e})},convert:!0},sign:{method(e){return n(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,t,{sign:r})=>"negative"===r&&e<0||"positive"===r&&e>0?e:t.error("number.".concat(r))},unsafe:{method(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),s.normalizeExponent=function(e){return e.replace(/E/,"e").replace(/\.(\d*[1-9])?0+e/,".$1e").replace(/\.e/,"e").replace(/e\+/,"e").replace(/^\+/,"").replace(/^(-?)0+([1-9])/,"$1$2")},s.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},function(e,t,r){"use strict";const n=r(22);e.exports=n.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t"string"!=typeof e?{value:e,errors:t("string.base")}:""===e?{value:e,errors:t("string.empty")}:void 0,rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(e={}){return p.assertOptions(e,["paddingRequired","urlSafe"]),e=i({urlSafe:!1,paddingRequired:!0},e),s("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),s("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,t,{options:r})=>m.base64Regex[r.paddingRequired][r.urlSafe].test(e)?e:t.error("string.base64")},case:{method(e){return s(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,t,{direction:r})=>"lower"===r&&e===e.toLocaleLowerCase()||"upper"===r&&e===e.toLocaleUpperCase()?e:t.error("string.".concat(r,"case")),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let r=e.length,n=0,i=1;for(;r--;){const t=e.charAt(r)*i;n+=t-9*(t>9),i^=3}return n>0&&n%10==0?e:t.error("string.creditCard")}},dataUri:{method(e={}){return p.assertOptions(e,["paddingRequired"]),e=i({paddingRequired:!0},e),s("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,{options:r}){const n=e.match(m.dataUriRegex);if(n){if(!n[2])return e;if("base64"!==n[2])return e;if(m.base64Regex[r.paddingRequired].false.test(n[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&p.assertOptions(e,["allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const t=m.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate:(e,t,r,{address:n})=>a.isValid(e,n)?e:t.error("string.domain")},email:{method(e={}){p.assertOptions(e,["allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),s(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=m.addressOptions(e),r=new RegExp("\\s*[".concat(e.separator?l(e.separator):",","]\\s*"));return this.$_addRule({name:"email",args:{options:e},regex:r,address:t})},validate(e,t,{options:r},{regex:n,address:i}){const o=r.multiple?e.split(n):[e],s=[];for(const e of o)c.isValid(e,i)||s.push(e);return s.length?t.error("string.email",{value:e,invalids:s}):e}},guid:{alias:"uuid",method(e={}){p.assertOptions(e,["version","separator"]);let t="";if(e.version){const r=[].concat(e.version);s(r.length>=1,"version must have at least 1 valid version specified");const n=new Set;for(let e=0;em.hexRegex.test(e)?r.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>a.isValid(e,{minDomainSegments:1})||m.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){p.assertOptions(e,["cidr","version"]);const{cidr:t,versions:r,regex:n}=u.regex(e),i=e.version?r:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:i}},regex:n})},validate:(e,t,{options:r},{regex:n})=>n.test(e)?e:r.version?t.error("string.ipVersion",{value:e,cidr:r.cidr,version:r.version}):t.error("string.ip",{value:e,cidr:r.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:t})=>m.isoDate(e)?e:t("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>m.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return m.length(this,"length",e,"=",t)},validate(e,t,{limit:r,encoding:n},{name:i,operator:o,args:s}){const a=!n&&e.length;return p.compare(a,r,o)?e:t.error("string."+i,{limit:s.limit,value:e,encoding:n})},args:[{name:"limit",ref:!0,assert:p.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return m.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return m.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){return s(m.normalizationForms.includes(e),"normalization form must be one of "+m.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:t},{form:r})=>e===e.normalize(r)?e:t("string.normalize",{value:e,form:r}),convert:!0},pattern:{alias:"regex",method(e,t={}){s(e instanceof RegExp,"regex must be a RegExp"),s(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),p.assertOptions(t,["invert","name"]);const r=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:r})},validate:(e,t,{regex:r,options:n},{errorCode:i})=>r.test(e)^n.invert?e:t.error(i,{name:n.name,regex:r,value:e}),args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(l(e),"g")),s(e instanceof RegExp,"pattern must be a RegExp"),s("string"==typeof t,"replacement must be a String");const r=this.clone();return r.$_terms.replacements||(r.$_terms.replacements=[]),r.$_terms.replacements.push({pattern:e,replacement:t}),r}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(e=!0){return s("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,t,{enabled:r})=>r&&e!==e.trim()?t.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return s("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){p.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&p.assertOptions(e.domain,["allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:r}=d.regex(e),n=e.domain?m.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:n,scheme:r})},validate(e,t,{options:r},{regex:n,domain:i,scheme:o}){if(["http:/","https:/"].includes(e))return t.error("string.uri");const s=n.exec(e);if(s){if(i){const e=s[1]||s[2];if(!a.isValid(e,i))return t.error("string.domain",{value:e})}return e}return r.relativeOnly?t.error("string.uriRelativeOnly"):r.scheme?t.error("string.uriCustomScheme",{scheme:o,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:r,replacement:n}of t.replacements)e=e.replace(r,n);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),m.addressOptions=function(e){if(!e)return e;if(s(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),s(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return s(m.tlds,"Built-in TLD list disabled"),Object.assign({},e,m.tlds);s("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),s(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),s(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),m.validateTlds(e.tlds.deny,"tlds.deny"),e;const r=e.tlds.allow;return r?!0===r?(s(m.tlds,"Built-in TLD list disabled"),Object.assign({},e,m.tlds)):(Array.isArray(r)&&(e=Object.assign({},e,{tlds:{allow:new Set(r)}})),s(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),m.validateTlds(e.tlds.allow,"tlds.allow"),e):e},m.validateTlds=function(e,t){for(const r of e)s(a.isValid(r,{minDomainSegments:1,maxDomainSegments:1}),"".concat(t," must contain valid top level domain names"))},m.isoDate=function(e){if(!p.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},m.length=function(e,t,r,n,i){return s(!i||!1,"Invalid encoding:",i),e.$_addRule({name:t,method:"length",args:{limit:r,encoding:i},operator:n})}},function(e,t,r){"use strict";const n=r(24),i=r(23),o=r(25),s={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(n.TextEncoder||TextEncoder)};t.analyze=function(e,t){return s.email(e,t)},t.isValid=function(e,t){return!s.email(e,t)},s.email=function(e,t={}){if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return o.code("EMPTY_STRING");const r=!s.nonAsciiRx.test(e);if(!r){if(!1===t.allowUnicode)return o.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const n=e.split("@");if(2!==n.length)return n.length>2?o.code("MULTIPLE_AT_CHAR"):o.code("MISSING_AT_CHAR");const[a,c]=n;if(!a)return o.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return o.code("ADDRESS_TOO_LONG");if(s.encoder.encode(a).length>64)return o.code("LOCAL_TOO_LONG")}return s.local(a,r)||i.analyze(c,t)},s.local=function(e,t){const r=e.split(".");for(const e of r){if(!e.length)return o.code("EMPTY_LOCAL_SEGMENT");if(t){if(!s.atextRx.test(e))return o.code("INVALID_LOCAL_CHARS")}else for(const t of e){if(s.atextRx.test(t))continue;const e=s.binary(t);if(!s.atomRx.test(e))return o.code("INVALID_LOCAL_CHARS")}}},s.binary=function(e){return Array.from(s.encoder.encode(e)).map(e=>String.fromCharCode(e)).join("")},s.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,s.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},function(e,t,r){"use strict";const n=r(0),i=r(26);t.regex=function(e={}){n(void 0===e.cidr||"string"==typeof e.cidr,"options.cidr must be a string");const t=e.cidr?e.cidr.toLowerCase():"optional";n(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),n(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let r=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(r)||(r=[r]),n(r.length>=1,"options.version must have at least 1 version specified");for(let e=0;e{if("forbidden"===t)return i.ip[e];const r="\\/".concat("ipv4"===e?i.ip.v4Cidr:i.ip.v6Cidr);return"required"===t?"".concat(i.ip[e]).concat(r):"".concat(i.ip[e],"(?:").concat(r,")?")}),s="(?:".concat(o.join("|"),")"),a=new RegExp("^".concat(s,"$"));return{cidr:t,versions:r,regex:a,raw:s}}},function(e,t){},function(e,t,r){"use strict";const n=r(0),i=r(3),o={};o.Map=class extends Map{slice(){return new o.Map(this)}},e.exports=i.extend({type:"symbol",terms:{map:{init:new o.Map}},coerce:{method(e,{schema:t,error:r}){const n=t.$_terms.map.get(e);return n&&(e=n),t._flags.only&&"symbol"!=typeof e?{value:e,errors:r("symbol.map",{map:t.$_terms.map})}:{value:e}}},validate(e,{error:t}){if("symbol"!=typeof e)return{value:e,errors:t("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),n(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),r=[];for(const i of e){n(i&&i[Symbol.iterator],"Entry must be an iterable");const[e,o]=i;n("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),n("symbol"==typeof o,"Value must be a Symbol"),t.$_terms.map.set(e,o),r.push(o)}return t.valid(...r)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})}])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InteractionForegroundService=void 0;t.InteractionForegroundService=class{constructor(e){this.handler=e}pushData(e){this.handler.onInteractionDataReceived(e)}pushEvent(e){this.handler.onEventDataReceived(e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interactionForegroundInit=void 0;const n=r(276),i=r(471),o=r(841);t.interactionForegroundInit=function(e,t){e.registerMessage(n.PushInteractionDataMsg),e.registerMessage(n.PushEventDataMsg),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const n=r(276);t.getHandler=e=>(t,r)=>{switch(r.constructor){case n.PushInteractionDataMsg:return i(e)(t,r);case n.PushEventDataMsg:return o(e)(t,r);default:throw new Error("Unknown msg type")}};const i=e=>(t,r)=>e.pushData(r.data),o=e=>(t,r)=>e.pushEvent(r.data)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const n=r(199),i=r(467),o=r(844);t.init=function(e,t){e.registerMessage(n.GetChainInfosMsg),e.registerMessage(n.SuggestChainInfoMsg),e.registerMessage(n.RemoveSuggestedChainInfoMsg),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const i=r(199);t.getHandler=e=>(t,r)=>{switch(r.constructor){case i.GetChainInfosMsg:return o(e)(t,r);case i.SuggestChainInfoMsg:return s(e)(t,r);case i.RemoveSuggestedChainInfoMsg:return a(e)(t,r);default:throw new Error("Unknown msg type")}};const o=e=>()=>n(void 0,void 0,void 0,(function*(){return{chainInfos:yield e.getChainInfos()}})),s=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){if(yield e.hasChainInfo(r.chainInfo.chainId))return;const n=r.chainInfo;n.beta=!0,yield e.suggestChainInfo(t,n,r.origin)})),a=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.removeChainInfo(r.chainId),yield e.getChainInfos()}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(473),t),i(r(880),t)},function(e,t,r){"use strict";(function(e){var n=r(180);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(200)),o=n(r(201)),s=n(r(848)),a=n(r(849)),c=n(r(96)),u=n(r(103)),l=n(r(154)),f=r(475),d=r(851),h=r(278),p=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.APP_KEY;if((0,s.default)(this,t),!e)throw new Error("Transport has not been defined");this.transport=e,e.decorateAppAPIMethods(this,["getVersion","sign","getAddressAndPubKey","appInfo","deviceInfo","getBech32FromPK"],r)}var r,n,p,m,g,y,b,v,w,_;return(0,a.default)(t,[{key:"serializePath",value:(_=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,h.getVersion)(this.transport);case 2:if(this.versionResponse=e.sent,this.versionResponse.return_code===h.ERROR_CODE.NoError){e.next=5;break}throw this.versionResponse;case 5:e.t0=this.versionResponse.major,e.next=1===e.t0?8:2===e.t0?9:10;break;case 8:return e.abrupt("return",(0,f.serializePathv1)(t));case 9:return e.abrupt("return",(0,d.serializePathv2)(t));case 10:return e.abrupt("return",{return_code:25600,error_message:"App Version is not supported"});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"signGetChunks",value:(w=(0,o.default)(i.default.mark((function t(r,n){var o,s,a,c,u;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.serializePath(r);case 2:for(o=t.sent,(s=[]).push(o),a=e.from(n),c=0;ca.length&&(u=a.length),s.push(a.slice(c,u));return t.abrupt("return",s);case 8:case"end":return t.stop()}}),t,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getVersion",value:(v=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.getVersion)(this.transport);case 3:return this.versionResponse=e.sent,e.abrupt("return",this.versionResponse);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",(0,h.processErrorResponse)(e.t0));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return v.apply(this,arguments)})},{key:"appInfo",value:(b=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.transport.send(176,1,0,0).then((function(e){var t=e.slice(-2),r=256*t[0]+t[1],n={},i="err",o="err",s=0,a=0;if(1!==e[0])n.error_message="response format ID not recognized",n.return_code=36865;else{var c=e[1];i=e.slice(2,2+c).toString("ascii");var u=2+c,l=e[u];u+=1,o=e.slice(u,u+l).toString("ascii"),s=e[u+=l],a=e[u+=1]}return{return_code:r,error_message:(0,h.errorCodeToString)(r),appName:i,appVersion:o,flagLen:s,flagsValue:a,flag_recovery:0!=(1&a),flag_signed_mcu_code:0!=(2&a),flag_onboarded:0!=(4&a),flag_pin_validated:0!=(128&a)}}),h.processErrorResponse));case 1:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"deviceInfo",value:(y=(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.transport.send(224,1,0,0,e.from([]),[h.ERROR_CODE.NoError,28160]).then((function(e){var t=e.slice(-2),r=256*t[0]+t[1];if(28160===r)return{return_code:r,error_message:"This command is only available in the Dashboard"};var n=e.slice(0,4).toString("hex"),i=4,o=e[i];i+=1;var s=e.slice(i,i+o).toString(),a=e[i+=o];i+=1;var c=e.slice(i,i+a).toString("hex"),u=e[i+=a];i+=1;var l=e.slice(i,i+u);0===l[u-1]&&(l=e.slice(i,i+u-1));var f=l.toString();return{return_code:r,error_message:(0,h.errorCodeToString)(r),targetId:n,seVersion:s,flag:c,mcuVersion:f}}),h.processErrorResponse));case 1:case"end":return t.stop()}}),t,this)}))),function(){return y.apply(this,arguments)})},{key:"publicKey",value:(g=(0,o.default)(i.default.mark((function r(n){var o,s;return i.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.serializePath(n);case 3:o=r.sent,r.t0=this.versionResponse.major,r.next=1===r.t0?7:2===r.t0?8:10;break;case 7:return r.abrupt("return",(0,f.publicKeyv1)(this,o));case 8:return s=e.concat([t.serializeHRP("cosmos"),o]),r.abrupt("return",(0,d.publicKeyv2)(this,s));case 10:return r.abrupt("return",{return_code:25600,error_message:"App Version is not supported"});case 11:r.next=16;break;case 13:return r.prev=13,r.t1=r.catch(0),r.abrupt("return",(0,h.processErrorResponse)(r.t1));case 16:case"end":return r.stop()}}),r,this,[[0,13]])}))),function(e){return g.apply(this,arguments)})},{key:"getAddressAndPubKey",value:(m=(0,o.default)(i.default.mark((function r(n,o){var s=this;return i.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",this.serializePath(n).then((function(r){var n=e.concat([t.serializeHRP(o),r]);return s.transport.send(h.CLA,h.INS.GET_ADDR_SECP256K1,h.P1_VALUES.ONLY_RETRIEVE,0,n,[h.ERROR_CODE.NoError]).then((function(t){var r=t.slice(-2),n=256*r[0]+r[1],i=e.from(t.slice(0,33));return{bech32_address:e.from(t.slice(33,-2)).toString(),compressed_pk:i,return_code:n,error_message:(0,h.errorCodeToString)(n)}}),h.processErrorResponse)})).catch((function(e){return(0,h.processErrorResponse)(e)})));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",(0,h.processErrorResponse)(r.t0));case 7:case"end":return r.stop()}}),r,this,[[0,4]])}))),function(e,t){return m.apply(this,arguments)})},{key:"showAddressAndPubKey",value:(p=(0,o.default)(i.default.mark((function r(n,o){var s=this;return i.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",this.serializePath(n).then((function(r){var n=e.concat([t.serializeHRP(o),r]);return s.transport.send(h.CLA,h.INS.GET_ADDR_SECP256K1,h.P1_VALUES.SHOW_ADDRESS_IN_DEVICE,0,n,[h.ERROR_CODE.NoError]).then((function(t){var r=t.slice(-2),n=256*r[0]+r[1],i=e.from(t.slice(0,33));return{bech32_address:e.from(t.slice(33,-2)).toString(),compressed_pk:i,return_code:n,error_message:(0,h.errorCodeToString)(n)}}),h.processErrorResponse)})).catch((function(e){return(0,h.processErrorResponse)(e)})));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",(0,h.processErrorResponse)(r.t0));case 7:case"end":return r.stop()}}),r,this,[[0,4]])}))),function(e,t){return p.apply(this,arguments)})},{key:"signSendChunk",value:(n=(0,o.default)(i.default.mark((function e(t,r,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.versionResponse.major,e.next=1===e.t0?3:2===e.t0?4:5;break;case 3:return e.abrupt("return",(0,f.signSendChunkv1)(this,t,r,n));case 4:return e.abrupt("return",(0,d.signSendChunkv2)(this,t,r,n));case 5:return e.abrupt("return",{return_code:25600,error_message:"App Version is not supported"});case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"sign",value:(r=(0,o.default)(i.default.mark((function e(t,r){var n=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.signGetChunks(t,r).then((function(e){return n.signSendChunk(1,e.length,e[0],[h.ERROR_CODE.NoError]).then(function(){var t=(0,o.default)(i.default.mark((function t(r){var o,s;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o={return_code:r.return_code,error_message:r.error_message,signature:null},s=1;case 2:if(!(s83)throw new Error("Invalid HRP");var r=e.alloc(1+t.length);return r.writeUInt8(t.length,0),r.write(t,1),r}},{key:"getBech32FromPK",value:function(e,t){if(33!==t.length)throw new Error("expected compressed public key [31 bytes]");var r=c.default.createHash("sha256").update(t).digest(),n=(new u.default).update(r).digest();return l.default.encode(e,l.default.toWords(n))}}]),t}();t.default=p}).call(this,r(2).Buffer)},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),s=new S(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return O()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,s),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function f(){}function d(){}function h(){}var p={};p[i]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(E([])));g&&g!==t&&r.call(g,i)&&(p=g);var y=h.prototype=f.prototype=Object.create(p);function b(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var n;this._invoke=function(i,o){function s(){return new t((function(n,s){!function n(i,o,s,a){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}(i,o,n,s)}))}return n=n?n.then(s,s):s()}}function w(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function E(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(a&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function r(e,t){for(var r=0;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},p=[{vendorId:a.b}],m=function(){return Promise.resolve(!(!window.navigator||!window.navigator.hid))},g=function(){var e=navigator.hid;if(!e)throw new u.TransportError("navigator.hid is not supported","HIDNotSupported");return e};function y(){return f(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return[4,g().requestDevice({filters:p})];case 1:return e=t.sent(),Array.isArray(e)?[2,e]:[2,[e]]}}))}))}function b(){return f(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,g().getDevices()];case 1:return[2,e.sent().filter((function(e){return e.vendorId===a.b}))]}}))}))}var v=function(t){function r(r){var n=t.call(this)||this;return n.channel=Math.floor(65535*Math.random()),n.packetSize=64,n.inputs=[],n.read=function(){return n.inputs.length?Promise.resolve(n.inputs.shift()):new Promise((function(e){n.inputCallback=e}))},n.onInputReport=function(t){var r=e.from(t.data.buffer);n.inputCallback?(n.inputCallback(r),n.inputCallback=null):n.inputs.push(r)},n._disconnectEmitted=!1,n._emitDisconnect=function(e){n._disconnectEmitted||(n._disconnectEmitted=!0,n.emit("disconnect",e))},n.exchange=function(e){return f(n,void 0,void 0,(function(){var t=this;return d(this,(function(r){switch(r.label){case 0:return[4,this.exchangeAtomicImpl((function(){return f(t,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,f;return d(this,(function(d){switch(d.label){case 0:r=(t=this).channel,n=t.packetSize,Object(c.a)("apdu","=> "+e.toString("hex")),i=s()(r,n),o=i.makeBlocks(e),a=0,d.label=1;case 1:return a0?[2,e[0]]:[4,y()];case 2:return[2,t.sent()[0]]}}))}))}().then((function(r){if(r){if(!t){var n="number"==typeof r.productId?Object(a.a)(r.productId):void 0;e.next({type:"add",descriptor:r,deviceModel:n}),e.complete()}}else e.error(new u.TransportOpenUserCancelled("Access denied to use Ledger device"))}),(function(t){e.error(new u.TransportOpenUserCancelled(t.message))})),{unsubscribe:function(){t=!0}}},r}(i.a);t.default=v}.call(this,r(2).Buffer)},function(e,t,r){const n=r(125);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},function(e,t,r){const n=r(125);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},function(e,t,r){const n=r(44);e.exports=(e,t,r,i)=>{"string"==typeof r&&(i=r,r=void 0);try{return new n(e,r).inc(t,i).version}catch(e){return null}}},function(e,t,r){const n=r(125),i=r(280);e.exports=(e,t)=>{if(i(e,t))return null;{const r=n(e),i=n(t),o=r.prerelease.length||i.prerelease.length,s=o?"pre":"",a=o?"prerelease":"";for(const e in r)if(("major"===e||"minor"===e||"patch"===e)&&r[e]!==i[e])return s+e;return a}}},function(e,t,r){const n=r(44);e.exports=(e,t)=>new n(e,t).major},function(e,t,r){const n=r(44);e.exports=(e,t)=>new n(e,t).minor},function(e,t,r){const n=r(44);e.exports=(e,t)=>new n(e,t).patch},function(e,t,r){const n=r(125);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},function(e,t,r){const n=r(62);e.exports=(e,t,r)=>n(t,e,r)},function(e,t,r){const n=r(62);e.exports=(e,t)=>n(e,t,!0)},function(e,t,r){const n=r(281);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},function(e,t,r){const n=r(281);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},function(e,t,r){const n=r(44),i=r(125),{re:o,t:s}=r(124);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[s.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[s.COERCERTL].lastIndex=-1}else r=e.match(o[s.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},function(e,t,r){"use strict";const n=r(867),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),f=Symbol("lruList"),d=Symbol("cache"),h=Symbol("updateAgeOnGet"),p=()=>1;const m=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(g(e,t)){if(b(e,n),!e[a])return}else r&&(e[h]&&(n.value.now=Date.now()),e[f].unshiftNode(n));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},y=e=>{if(e[o]>e[i])for(let t=e[f].tail;e[o]>e[i]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[f].removeNode(t)}};class v{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;g(e,i)&&(b(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[s]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,y(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,y(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[o]=0,this[f].forEach(e=>{e.length=this[s](e.value,e.key),this[o]+=e.length})),y(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[f].length}rforEach(e,t){t=t||this;for(let r=this[f].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[f].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[f].toArray().map(e=>e.key)}values(){return this[f].toArray().map(e=>e.value)}reset(){this[u]&&this[f]&&this[f].length&&this[f].forEach(e=>this[u](e.key,e.value)),this[d]=new Map,this[f]=new n,this[o]=0}dump(){return this[f].map(e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[f]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[d].has(e)){if(a>this[i])return b(this,this[d].get(e)),!1;const s=this[d].get(e).value;return this[u]&&(this[l]||this[u](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),y(this),!0}const h=new v(e,t,a,n,r);return h.length>this[i]?(this[u]&&this[u](e,t),!1):(this[o]+=h.length,this[f].unshift(h),this[d].set(e,this[f].head),y(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!g(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[f].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach((e,t)=>m(this,t,!1))}}},function(e,t,r){"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&nnew n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},function(e,t,r){const n=r(44),i=r(63);e.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(o&&-1!==s.compare(e)||(o=e,s=new n(o,r)))}),o}},function(e,t,r){const n=r(44),i=r(63);e.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(o&&1!==s.compare(e)||(o=e,s=new n(o,r)))}),o}},function(e,t,r){const n=r(44),i=r(63),o=r(205);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!o(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}),!s||r&&!o(r,s)||(r=s)}return r&&e.test(r)?r:null}},function(e,t,r){const n=r(63);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},function(e,t,r){const n=r(285);e.exports=(e,t,r)=>n(e,t,">",r)},function(e,t,r){const n=r(285);e.exports=(e,t,r)=>n(e,t,"<",r)},function(e,t,r){const n=r(63);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t))},function(e,t,r){const n=r(207),i=r(62);e.exports=(e,t,r)=>{const o=[];let s=null,a=null;const c=e.sort((e,t)=>i(e,t,r));for(const e of c){n(e,t,r)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null)}s&&o.push([s,null]);const u=[];for(const[e,t]of o)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push("<="+t):u.push(`${e} - ${t}`):u.push(">="+e):u.push("*");const l=u.join(" || "),f="string"==typeof t.raw?t.raw:String(t);return l.length{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?[new i(">=0.0.0-0")]:[new i(">=0.0.0")]}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=[new i(">=0.0.0")]}const n=new Set;let c,f,d,h,p,m,g;for(const t of e)">"===t.operator||">="===t.operator?c=u(c,t,r):"<"===t.operator||"<="===t.operator?f=l(f,t,r):n.add(t.semver);if(n.size>1)return null;if(c&&f){if(d=a(c.semver,f.semver,r),d>0)return null;if(0===d&&(">="!==c.operator||"<="!==f.operator))return null}for(const e of n){if(c&&!s(e,String(c),r))return null;if(f&&!s(e,String(f),r))return null;for(const n of t)if(!s(e,String(n),r))return!1;return!0}let y=!(!f||r.includePrerelease||!f.semver.prerelease.length)&&f.semver,b=!(!c||r.includePrerelease||!c.semver.prerelease.length)&&c.semver;y&&1===y.prerelease.length&&"<"===f.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,c)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if(h=u(c,e,r),h===e&&h!==c)return!1}else if(">="===c.operator&&!s(c.semver,String(e),r))return!1;if(f)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(p=l(f,e,r),p===e&&p!==f)return!1}else if("<="===f.operator&&!s(f.semver,String(e),r))return!1;if(!e.operator&&(f||c)&&0!==d)return!1}return!(c&&m&&!f&&0!==d)&&(!(f&&g&&!c&&0!==d)&&(!b&&!y))},u=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(const n of e.set){for(const e of t.set){const t=c(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},function(e,t,r){"use strict";r.r(t),function(e){var n,i=r(216),o=r(217),s=r.n(o),a=r(67),c=r(129),u=r(27),l=r(134),f=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),d=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},h=function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] "+t.toString("hex")),o=s()(n,i),a=o.makeBlocks(t),u=0,h.label=1;case 1:return u(t,r)=>{switch(r.constructor){case i.LedgerGetWebHIDFlagMsg:return o(e)(t,r);case i.LedgerSetWebHIDFlagMsg:return s(e)(t,r);default:throw new Error("Unknown msg type")}};const o=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.getWebHIDFlag()})),s=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.setWebHIDFlag(r.flag)}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(479),t),i(r(896),t)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Crypto=void 0;const c=o(r(336)),u=r(86),l=a(r(884)),f=r(2);t.Crypto=class{static encrypt(e,t,r,n,i,o,a,d){return s(this,void 0,void 0,(function*(){let h=new Uint8Array(32);const p=f.Buffer.from(yield e(h)).toString("hex"),m={salt:p,dklen:32,n:131072,r:8,p:1},g=yield(()=>s(this,void 0,void 0,(function*(){switch(r){case"scrypt":return yield t.scrypt(o,m);case"sha256":return u.Hash.sha256(f.Buffer.from(`${p}/${o}`));case"pbkdf2":return new Promise((e,t)=>{l.default.pbkdf2(o,p,4e3,32,"sha256",(r,n)=>{r?t(r):e(new Uint8Array(n))})});default:throw new Error("Unknown kdf")}})))(),y=f.Buffer.from(i);h=new Uint8Array(16);const b=f.Buffer.from(yield e(h)),v=new c.Counter(0);v.setBytes(b);const w=new c.default.ModeOfOperation.ctr(g,v),_=f.Buffer.from(w.encrypt(y)),k=u.Hash.sha256(f.Buffer.concat([f.Buffer.from(g.slice(g.length/2)),_]));return{version:"1.2",type:n,coinTypeForChain:{},bip44HDPath:d,meta:a,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:b.toString("hex")},ciphertext:_.toString("hex"),kdf:r,kdfparams:m,mac:f.Buffer.from(k).toString("hex")}}}))}static decrypt(e,t,r){return s(this,void 0,void 0,(function*(){const n=yield(()=>s(this,void 0,void 0,(function*(){switch(t.crypto.kdf){case"scrypt":return yield e.scrypt(r,t.crypto.kdfparams);case"sha256":return u.Hash.sha256(f.Buffer.from(`${t.crypto.kdfparams.salt}/${r}`));case"pbkdf2":return new Promise((e,n)=>{l.default.pbkdf2(r,t.crypto.kdfparams.salt,4e3,32,"sha256",(t,r)=>{t?n(t):e(new Uint8Array(r))})});default:throw new Error("Unknown kdf")}})))(),i=new c.Counter(0);i.setBytes(f.Buffer.from(t.crypto.cipherparams.iv,"hex"));const o=new c.default.ModeOfOperation.ctr(n,i),a=u.Hash.sha256(f.Buffer.concat([f.Buffer.from(n.slice(n.length/2)),f.Buffer.from(t.crypto.ciphertext,"hex")]));if(!f.Buffer.from(a).equals(f.Buffer.from(t.crypto.mac,"hex")))throw new Error("Unmatched mac");return f.Buffer.from(o.decrypt(f.Buffer.from(t.crypto.ciphertext,"hex")))}))}}},function(e,t,r){t.pbkdf2=r(885),t.pbkdf2Sync=r(482)},function(e,t,r){(function(t){var n,i,o=r(13).Buffer,s=r(480),a=r(481),c=r(482),u=r(483),l=t.crypto&&t.crypto.subtle,f={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"},d=[];function h(){return i||(i=t.process&&t.process.nextTick?t.process.nextTick:t.queueMicrotask?t.queueMicrotask:t.setImmediate?t.setImmediate:t.setTimeout)}function p(e,t,r,n,i){return l.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return l.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return o.from(e)}))}e.exports=function(e,r,i,m,g,y){"function"==typeof g&&(y=g,g=void 0);var b=f[(g=g||"sha1").toLowerCase()];if(b&&"function"==typeof t.Promise){if(s(i,m),e=u(e,a,"Password"),r=u(r,a,"Salt"),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){h()((function(){t(null,e)}))}),(function(e){h()((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==d[e])return d[e];var r=p(n=n||o.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return d[e]=r,r}(b).then((function(t){return t?p(e,r,i,m,b):c(e,r,i,m,g)})),y)}else h()((function(){var t;try{t=c(e,r,i,m,g)}catch(e){return y(e)}y(null,t)}))}}).call(this,r(15))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeSignDoc=t.makeSignBytes=t.makeAuthInfoBytes=t.isOfflineDirectSigner=t.encodePubkey=t.decodePubkey=t.makeCosmoshubPath=t.DirectSecp256k1Wallet=t.DirectSecp256k1HdWallet=t.Registry=void 0;var n=r(888);Object.defineProperty(t,"Registry",{enumerable:!0,get:function(){return n.Registry}});var i=r(891);Object.defineProperty(t,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return i.DirectSecp256k1HdWallet}});var o=r(892);Object.defineProperty(t,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return o.DirectSecp256k1Wallet}});var s=r(492);Object.defineProperty(t,"makeCosmoshubPath",{enumerable:!0,get:function(){return s.makeCosmoshubPath}});var a=r(893);Object.defineProperty(t,"decodePubkey",{enumerable:!0,get:function(){return a.decodePubkey}}),Object.defineProperty(t,"encodePubkey",{enumerable:!0,get:function(){return a.encodePubkey}});var c=r(895);Object.defineProperty(t,"isOfflineDirectSigner",{enumerable:!0,get:function(){return c.isOfflineDirectSigner}});var u=r(290);Object.defineProperty(t,"makeAuthInfoBytes",{enumerable:!0,get:function(){return u.makeAuthInfoBytes}}),Object.defineProperty(t,"makeSignBytes",{enumerable:!0,get:function(){return u.makeSignBytes}}),Object.defineProperty(t,"makeSignDoc",{enumerable:!0,get:function(){return u.makeSignDoc}})},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.Registry=void 0;const n=r(889),i=r(208),o=r(489),s=r(209),a={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};t.Registry=class{constructor(e=[]){const{cosmosCoin:t,cosmosMsgSend:r}=a;this.types=new Map([[t,i.Coin],[r,n.MsgSend],...e])}register(e,t){this.types.set(e,t)}lookupType(e){return this.types.get(e)}lookupTypeWithError(e){const t=this.lookupType(e);if(!t)throw new Error("Unregistered type url: "+e);return t}encode({typeUrl:e,value:t}){if(e===a.cosmosTxBody)return this.encodeTxBody(t);const r=this.lookupTypeWithError(e),n=r.fromPartial(t);return Uint8Array.from(r.encode(n).finish())}encodeTxBody(e){const t=e.messages.map(e=>{const t=this.encode(e);return s.Any.fromPartial({typeUrl:e.typeUrl,value:t})}),r=o.TxBody.fromPartial(Object.assign(Object.assign({},e),{messages:t}));return Uint8Array.from(o.TxBody.encode(r).finish())}decode({typeUrl:t,value:r}){if(t===a.cosmosTxBody)return this.decodeTxBody(r);const n=this.lookupTypeWithError(t).decode(r);return Object.entries(n).forEach(([t,r])=>{void 0!==e&&void 0!==e.isBuffer&&e.isBuffer(r)&&(n[t]=Uint8Array.from(r))}),n}decodeTxBody(e){const t=o.TxBody.decode(e);return Object.assign(Object.assign({},t),{messages:t.messages.map(({typeUrl:e,value:t})=>{if(!e)throw new Error("Missing type_url in Any");if(!t)throw new Error("Missing value in Any");return this.decode({typeUrl:e,value:t})})})}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgMultiSendResponse=t.MsgMultiSend=t.MsgSendResponse=t.MsgSend=t.protobufPackage=void 0;const i=r(208),o=r(890),s=n(r(72));t.protobufPackage="cosmos.bank.v1beta1";const a={fromAddress:"",toAddress:""};t.MsgSend={encode(e,t=s.default.Writer.create()){t.uint32(10).string(e.fromAddress),t.uint32(18).string(e.toAddress);for(const r of e.amount)i.Coin.encode(r,t.uint32(26).fork()).ldelim();return t},decode(e,t){const r=e instanceof Uint8Array?new s.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const o=Object.assign({},a);for(o.amount=[];r.pos>>3){case 1:o.fromAddress=r.string();break;case 2:o.toAddress=r.string();break;case 3:o.amount.push(i.Coin.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);if(t.amount=[],void 0!==e.fromAddress&&null!==e.fromAddress?t.fromAddress=String(e.fromAddress):t.fromAddress="",void 0!==e.toAddress&&null!==e.toAddress?t.toAddress=String(e.toAddress):t.toAddress="",void 0!==e.amount&&null!==e.amount)for(const r of e.amount)t.amount.push(i.Coin.fromJSON(r));return t},fromPartial(e){const t=Object.assign({},a);if(t.amount=[],void 0!==e.fromAddress&&null!==e.fromAddress?t.fromAddress=e.fromAddress:t.fromAddress="",void 0!==e.toAddress&&null!==e.toAddress?t.toAddress=e.toAddress:t.toAddress="",void 0!==e.amount&&null!==e.amount)for(const r of e.amount)t.amount.push(i.Coin.fromPartial(r));return t},toJSON(e){const t={};return void 0!==e.fromAddress&&(t.fromAddress=e.fromAddress),void 0!==e.toAddress&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],t}};const c={};t.MsgSendResponse={encode:(e,t=s.default.Writer.create())=>t,decode(e,t){const r=e instanceof Uint8Array?new s.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},c);for(;r.posObject.assign({},c),fromPartial:e=>Object.assign({},c),toJSON:e=>({})};const u={};t.MsgMultiSend={encode(e,t=s.default.Writer.create()){for(const r of e.inputs)o.Input.encode(r,t.uint32(10).fork()).ldelim();for(const r of e.outputs)o.Output.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){const r=e instanceof Uint8Array?new s.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},u);for(i.inputs=[],i.outputs=[];r.pos>>3){case 1:i.inputs.push(o.Input.decode(r,r.uint32()));break;case 2:i.outputs.push(o.Output.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},u);if(t.inputs=[],t.outputs=[],void 0!==e.inputs&&null!==e.inputs)for(const r of e.inputs)t.inputs.push(o.Input.fromJSON(r));if(void 0!==e.outputs&&null!==e.outputs)for(const r of e.outputs)t.outputs.push(o.Output.fromJSON(r));return t},fromPartial(e){const t=Object.assign({},u);if(t.inputs=[],t.outputs=[],void 0!==e.inputs&&null!==e.inputs)for(const r of e.inputs)t.inputs.push(o.Input.fromPartial(r));if(void 0!==e.outputs&&null!==e.outputs)for(const r of e.outputs)t.outputs.push(o.Output.fromPartial(r));return t},toJSON(e){const t={};return e.inputs?t.inputs=e.inputs.map(e=>e?o.Input.toJSON(e):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(e=>e?o.Output.toJSON(e):void 0):t.outputs=[],t}};const l={};t.MsgMultiSendResponse={encode:(e,t=s.default.Writer.create())=>t,decode(e,t){const r=e instanceof Uint8Array?new s.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},l);for(;r.posObject.assign({},l),fromPartial:e=>Object.assign({},l),toJSON:e=>({})};t.MsgClientImpl=class{constructor(e){this.rpc=e}Send(e){const r=t.MsgSend.encode(e).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","methodDesc.name",r).then(e=>t.MsgSendResponse.decode(new s.default.Reader(e)))}MultiSend(e){const r=t.MsgMultiSend.encode(e).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","methodDesc.name",r).then(e=>t.MsgMultiSendResponse.decode(new s.default.Reader(e)))}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=t.DenomUnit=t.Supply=t.Output=t.Input=t.SendEnabled=t.Params=t.protobufPackage=void 0;const i=r(208),o=n(r(72));t.protobufPackage="cosmos.bank.v1beta1";const s={defaultSendEnabled:!1};t.Params={encode(e,r=o.default.Writer.create()){for(const n of e.sendEnabled)t.SendEnabled.encode(n,r.uint32(10).fork()).ldelim();return r.uint32(16).bool(e.defaultSendEnabled),r},decode(e,r){const n=e instanceof Uint8Array?new o.default.Reader(e):e;let i=void 0===r?n.len:n.pos+r;const a=Object.assign({},s);for(a.sendEnabled=[];n.pos>>3){case 1:a.sendEnabled.push(t.SendEnabled.decode(n,n.uint32()));break;case 2:a.defaultSendEnabled=n.bool();break;default:n.skipType(7&e)}}return a},fromJSON(e){const r=Object.assign({},s);if(r.sendEnabled=[],void 0!==e.sendEnabled&&null!==e.sendEnabled)for(const n of e.sendEnabled)r.sendEnabled.push(t.SendEnabled.fromJSON(n));return void 0!==e.defaultSendEnabled&&null!==e.defaultSendEnabled?r.defaultSendEnabled=Boolean(e.defaultSendEnabled):r.defaultSendEnabled=!1,r},fromPartial(e){const r=Object.assign({},s);if(r.sendEnabled=[],void 0!==e.sendEnabled&&null!==e.sendEnabled)for(const n of e.sendEnabled)r.sendEnabled.push(t.SendEnabled.fromPartial(n));return void 0!==e.defaultSendEnabled&&null!==e.defaultSendEnabled?r.defaultSendEnabled=e.defaultSendEnabled:r.defaultSendEnabled=!1,r},toJSON(e){const r={};return e.sendEnabled?r.sendEnabled=e.sendEnabled.map(e=>e?t.SendEnabled.toJSON(e):void 0):r.sendEnabled=[],void 0!==e.defaultSendEnabled&&(r.defaultSendEnabled=e.defaultSendEnabled),r}};const a={denom:"",enabled:!1};t.SendEnabled={encode:(e,t=o.default.Writer.create())=>(t.uint32(10).string(e.denom),t.uint32(16).bool(e.enabled),t),decode(e,t){const r=e instanceof Uint8Array?new o.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},a);for(;r.pos>>3){case 1:i.denom=r.string();break;case 2:i.enabled=r.bool();break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},a);return void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.enabled&&null!==e.enabled?t.enabled=Boolean(e.enabled):t.enabled=!1,t},fromPartial(e){const t=Object.assign({},a);return void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.enabled&&null!==e.enabled?t.enabled=e.enabled:t.enabled=!1,t},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.enabled&&(t.enabled=e.enabled),t}};const c={address:""};t.Input={encode(e,t=o.default.Writer.create()){t.uint32(10).string(e.address);for(const r of e.coins)i.Coin.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){const r=e instanceof Uint8Array?new o.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const s=Object.assign({},c);for(s.coins=[];r.pos>>3){case 1:s.address=r.string();break;case 2:s.coins.push(i.Coin.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return s},fromJSON(e){const t=Object.assign({},c);if(t.coins=[],void 0!==e.address&&null!==e.address?t.address=String(e.address):t.address="",void 0!==e.coins&&null!==e.coins)for(const r of e.coins)t.coins.push(i.Coin.fromJSON(r));return t},fromPartial(e){const t=Object.assign({},c);if(t.coins=[],void 0!==e.address&&null!==e.address?t.address=e.address:t.address="",void 0!==e.coins&&null!==e.coins)for(const r of e.coins)t.coins.push(i.Coin.fromPartial(r));return t},toJSON(e){const t={};return void 0!==e.address&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t}};const u={address:""};t.Output={encode(e,t=o.default.Writer.create()){t.uint32(10).string(e.address);for(const r of e.coins)i.Coin.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){const r=e instanceof Uint8Array?new o.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const s=Object.assign({},u);for(s.coins=[];r.pos>>3){case 1:s.address=r.string();break;case 2:s.coins.push(i.Coin.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return s},fromJSON(e){const t=Object.assign({},u);if(t.coins=[],void 0!==e.address&&null!==e.address?t.address=String(e.address):t.address="",void 0!==e.coins&&null!==e.coins)for(const r of e.coins)t.coins.push(i.Coin.fromJSON(r));return t},fromPartial(e){const t=Object.assign({},u);if(t.coins=[],void 0!==e.address&&null!==e.address?t.address=e.address:t.address="",void 0!==e.coins&&null!==e.coins)for(const r of e.coins)t.coins.push(i.Coin.fromPartial(r));return t},toJSON(e){const t={};return void 0!==e.address&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t}};const l={};t.Supply={encode(e,t=o.default.Writer.create()){for(const r of e.total)i.Coin.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){const r=e instanceof Uint8Array?new o.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const s=Object.assign({},l);for(s.total=[];r.pos>>3){case 1:s.total.push(i.Coin.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return s},fromJSON(e){const t=Object.assign({},l);if(t.total=[],void 0!==e.total&&null!==e.total)for(const r of e.total)t.total.push(i.Coin.fromJSON(r));return t},fromPartial(e){const t=Object.assign({},l);if(t.total=[],void 0!==e.total&&null!==e.total)for(const r of e.total)t.total.push(i.Coin.fromPartial(r));return t},toJSON(e){const t={};return e.total?t.total=e.total.map(e=>e?i.Coin.toJSON(e):void 0):t.total=[],t}};const f={denom:"",exponent:0,aliases:""};t.DenomUnit={encode(e,t=o.default.Writer.create()){t.uint32(10).string(e.denom),t.uint32(16).uint32(e.exponent);for(const r of e.aliases)t.uint32(26).string(r);return t},decode(e,t){const r=e instanceof Uint8Array?new o.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const i=Object.assign({},f);for(i.aliases=[];r.pos>>3){case 1:i.denom=r.string();break;case 2:i.exponent=r.uint32();break;case 3:i.aliases.push(r.string());break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=Object.assign({},f);if(t.aliases=[],void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.exponent&&null!==e.exponent?t.exponent=Number(e.exponent):t.exponent=0,void 0!==e.aliases&&null!==e.aliases)for(const r of e.aliases)t.aliases.push(String(r));return t},fromPartial(e){const t=Object.assign({},f);if(t.aliases=[],void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.exponent&&null!==e.exponent?t.exponent=e.exponent:t.exponent=0,void 0!==e.aliases&&null!==e.aliases)for(const r of e.aliases)t.aliases.push(r);return t},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.exponent&&(t.exponent=e.exponent),e.aliases?t.aliases=e.aliases.map(e=>e):t.aliases=[],t}};const d={description:"",base:"",display:""};t.Metadata={encode(e,r=o.default.Writer.create()){r.uint32(10).string(e.description);for(const n of e.denomUnits)t.DenomUnit.encode(n,r.uint32(18).fork()).ldelim();return r.uint32(26).string(e.base),r.uint32(34).string(e.display),r},decode(e,r){const n=e instanceof Uint8Array?new o.default.Reader(e):e;let i=void 0===r?n.len:n.pos+r;const s=Object.assign({},d);for(s.denomUnits=[];n.pos>>3){case 1:s.description=n.string();break;case 2:s.denomUnits.push(t.DenomUnit.decode(n,n.uint32()));break;case 3:s.base=n.string();break;case 4:s.display=n.string();break;default:n.skipType(7&e)}}return s},fromJSON(e){const r=Object.assign({},d);if(r.denomUnits=[],void 0!==e.description&&null!==e.description?r.description=String(e.description):r.description="",void 0!==e.denomUnits&&null!==e.denomUnits)for(const n of e.denomUnits)r.denomUnits.push(t.DenomUnit.fromJSON(n));return void 0!==e.base&&null!==e.base?r.base=String(e.base):r.base="",void 0!==e.display&&null!==e.display?r.display=String(e.display):r.display="",r},fromPartial(e){const r=Object.assign({},d);if(r.denomUnits=[],void 0!==e.description&&null!==e.description?r.description=e.description:r.description="",void 0!==e.denomUnits&&null!==e.denomUnits)for(const n of e.denomUnits)r.denomUnits.push(t.DenomUnit.fromPartial(n));return void 0!==e.base&&null!==e.base?r.base=e.base:r.base="",void 0!==e.display&&null!==e.display?r.display=e.display:r.display="",r},toJSON(e){const r={};return void 0!==e.description&&(r.description=e.description),e.denomUnits?r.denomUnits=e.denomUnits.map(e=>e?t.DenomUnit.toJSON(e):void 0):r.denomUnits=[],void 0!==e.base&&(r.base=e.base),void 0!==e.display&&(r.display=e.display),r}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectSecp256k1HdWallet=void 0;const n=r(73),i=r(137),o=r(492),s=r(290);class a{constructor(e,t,r,n,i){this.secret=e,this.accounts=[{hdPath:t,prefix:i}],this.privkey=r,this.pubkey=n}static async fromMnemonic(e,t=o.makeCosmoshubPath(0),r="cosmos"){const i=new n.EnglishMnemonic(e),s=await n.Bip39.mnemonicToSeed(i),{privkey:c}=n.Slip10.derivePath(n.Slip10Curve.Secp256k1,s,t),u=(await n.Secp256k1.makeKeypair(c)).pubkey;return new a(i,t,c,n.Secp256k1.compressPubkey(u),r)}static async generate(e=12,t=o.makeCosmoshubPath(0),r="cosmos"){const i=4*Math.floor(11*e/33),s=n.Random.getBytes(i),c=n.Bip39.encode(s);return a.fromMnemonic(c.toString(),t,r)}get mnemonic(){return this.secret.toString()}get address(){return i.rawSecp256k1PubkeyToAddress(this.pubkey,this.accounts[0].prefix)}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(e,t){const r=s.makeSignBytes(t);if(e!==this.address)throw new Error(`Address ${e} not found in wallet`);const o=n.sha256(r),a=await n.Secp256k1.createSignature(o,this.privkey),c=new Uint8Array([...a.r(32),...a.s(32)]);return{signed:t,signature:i.encodeSecp256k1Signature(this.pubkey,c)}}}t.DirectSecp256k1HdWallet=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectSecp256k1Wallet=void 0;const n=r(73),i=r(137),o=r(290);class s{constructor(e,t,r){this.privkey=e,this.pubkey=t,this.prefix=r}static async fromKey(e,t="cosmos"){const r=(await n.Secp256k1.makeKeypair(e)).pubkey;return new s(e,n.Secp256k1.compressPubkey(r),t)}get address(){return i.rawSecp256k1PubkeyToAddress(this.pubkey,this.prefix)}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(e,t){const r=o.makeSignBytes(t);if(e!==this.address)throw new Error(`Address ${e} not found in wallet`);const s=n.sha256(r),a=await n.Secp256k1.createSignature(s,this.privkey),c=new Uint8Array([...a.r(32),...a.s(32)]);return{signed:t,signature:i.encodeSecp256k1Signature(this.pubkey,c)}}}t.DirectSecp256k1Wallet=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePubkey=t.encodePubkey=void 0;const n=r(57),i=r(137),o=r(894),s=r(209);t.encodePubkey=function(e){switch(e.type){case"tendermint/PubKeySecp256k1":{const t=o.PubKey.fromPartial({key:n.fromBase64(e.value)});return s.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from(o.PubKey.encode(t).finish())})}default:throw new Error(`Pubkey type ${e.type} not recognized`)}},t.decodePubkey=function(e){if(!e||!e.value)return null;switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:t}=o.PubKey.decode(e.value);return i.encodeSecp256k1Pubkey(t)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized`)}}},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PrivKey=t.PubKey=t.protobufPackage=void 0;const i=n(r(72));t.protobufPackage="cosmos.crypto.secp256k1";const o={};t.PubKey={encode:(e,t=i.default.Writer.create())=>(t.uint32(10).bytes(e.key),t),decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const s=Object.assign({},o);for(;r.pos>>3){case 1:s.key=r.bytes();break;default:r.skipType(7&e)}}return s},fromJSON(e){const t=Object.assign({},o);return void 0!==e.key&&null!==e.key&&(t.key=u(e.key)),t},fromPartial(e){const t=Object.assign({},o);return void 0!==e.key&&null!==e.key?t.key=e.key:t.key=new Uint8Array,t},toJSON(e){const t={};return void 0!==e.key&&(t.key=f(void 0!==e.key?e.key:new Uint8Array)),t}};const s={};t.PrivKey={encode:(e,t=i.default.Writer.create())=>(t.uint32(10).bytes(e.key),t),decode(e,t){const r=e instanceof Uint8Array?new i.default.Reader(e):e;let n=void 0===t?r.len:r.pos+t;const o=Object.assign({},s);for(;r.pos>>3){case 1:o.key=r.bytes();break;default:r.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return void 0!==e.key&&null!==e.key&&(t.key=u(e.key)),t},fromPartial(e){const t=Object.assign({},s);return void 0!==e.key&&null!==e.key?t.key=e.key:t.key=new Uint8Array,t},toJSON(e){const t={};return void 0!==e.key&&(t.key=f(void 0!==e.key?e.key:new Uint8Array)),t}};var a=(()=>{if(void 0!==a)return a;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object")})();const c=a.atob||(e=>a.Buffer.from(e,"base64").toString("binary"));function u(e){const t=c(e),r=new Uint8Array(t.length);for(let e=0;ea.Buffer.from(e,"binary").toString("base64"));function f(e){const t=[];for(let r=0;r(t,r)=>{switch(r.constructor){case o.RestoreKeyRingMsg:return u(e)(t,r);case o.DeleteKeyRingMsg:return l(e)(t,r);case o.UpdateNameKeyRingMsg:return f(e)(t,r);case o.ShowKeyRingMsg:return d(e)(t,r);case o.CreateMnemonicKeyMsg:return h(e)(t,r);case o.AddMnemonicKeyMsg:return p(e)(t,r);case o.CreatePrivateKeyMsg:return m(e)(t,r);case o.AddPrivateKeyMsg:return g(e)(t,r);case o.CreateLedgerKeyMsg:return y(e)(t,r);case o.AddLedgerKeyMsg:return b(e)(t,r);case o.LockKeyRingMsg:return v(e)(t,r);case o.UnlockKeyRingMsg:return w(e)(t,r);case o.GetKeyMsg:return _(e)(t,r);case o.RequestSignAminoMsg:return k(e)(t,r);case o.RequestVerifyADR36AminoSignDoc:return S(e)(t,r);case o.RequestSignDirectMsg:return E(e)(t,r);case o.GetMultiKeyStoreInfoMsg:return O(e)(t,r);case o.ChangeKeyRingMsg:return M(e)(t,r);case o.GetIsKeyStoreCoinTypeSetMsg:return x(e)(t,r);case o.SetKeyStoreCoinTypeMsg:return A(e)(t,r);case o.CheckPasswordMsg:return j(e)(t,r);case o.ExportKeyRingDatasMsg:return P(e)(t,r);default:throw new Error("Unknown msg type")}};const u=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.restore()})),l=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.deleteKeyRing(r.index,r.password)})),f=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.updateNameKeyRing(r.index,r.name)})),d=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.showKeyRing(r.index,r.password)})),h=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.createMnemonicKey(r.kdf,r.mnemonic,r.password,r.meta,r.bip44HDPath)})),p=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.addMnemonicKey(r.kdf,r.mnemonic,r.meta,r.bip44HDPath)})),m=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.createPrivateKey(r.kdf,r.privateKey,r.password,r.meta)})),g=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.addPrivateKey(r.kdf,r.privateKey,r.meta)})),y=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.createLedgerKey(t,r.kdf,r.password,r.meta,r.bip44HDPath)})),b=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.addLedgerKey(t,r.kdf,r.meta,r.bip44HDPath)})),v=e=>()=>({status:e.lock()}),w=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return{status:yield e.unlock(r.password)}})),_=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin);const n=yield e.getKey(r.chainId);return{name:e.getKeyStoreMeta("name"),algo:"secp256k1",pubKey:n.pubKey,address:n.address,bech32Address:new s.Bech32Address(n.address).toBech32((yield e.chainsService.getChainInfo(r.chainId)).bech32Config.bech32PrefixAccAddr),isNanoLedger:n.isNanoLedger}})),k=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.requestSignAmino(t,r.origin,r.chainId,r.signer,r.signDoc,r.signOptions)})),S=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.verifyADR36AminoSignDoc(r.chainId,r.signer,r.data,r.signature)})),E=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin);const n=a.cosmos.tx.v1beta1.SignDoc.create({bodyBytes:r.signDoc.bodyBytes,authInfoBytes:r.signDoc.authInfoBytes,chainId:r.signDoc.chainId,accountNumber:r.signDoc.accountNumber?c.default.fromString(r.signDoc.accountNumber):void 0}),i=yield e.requestSignDirect(t,r.origin,r.chainId,r.signer,n,r.signOptions);return{signed:{bodyBytes:i.signed.bodyBytes,authInfoBytes:i.signed.authInfoBytes,chainId:i.signed.chainId,accountNumber:i.signed.accountNumber.toString()},signature:i.signature}})),O=e=>()=>({multiKeyStoreInfo:e.getMultiKeyStoreInfo()}),M=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.changeKeyStoreFromMultiKeyStore(r.index)})),x=e=>(t,r)=>e.getKeyStoreBIP44Selectables(r.chainId,r.paths),A=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.setKeyStoreCoinType(r.chainId,r.coinType),e.keyRingStatus})),j=e=>(t,r)=>e.checkPassword(r.password),P=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.exportKeyRingDatas(r.password)}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(493),t),i(r(984),t)},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},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(291));t.logs=o;const s=n(r(167));t.types=s;var a=r(905);t.pubkeyToAddress=a.pubkeyToAddress;var c=r(928);t.unmarshalTx=c.unmarshalTx;var u=r(293);t.makeSignBytes=u.makeSignBytes,t.marshalTx=u.marshalTx;var l=r(294);t.BroadcastMode=l.BroadcastMode,t.RestClient=l.RestClient;var f=r(520);t.CosmWasmClient=f.CosmWasmClient;var d=r(979);t.makeCosmoshubPath=d.makeSecretNetworkPath,t.makeSecretNetworkPath=d.makeSecretNetworkPath,t.Secp256k1Pen=d.Secp256k1Pen;var h=r(521);t.decodeBech32Pubkey=h.decodeBech32Pubkey,t.encodeBech32Pubkey=h.encodeBech32Pubkey,t.encodeSecp256k1Pubkey=h.encodeSecp256k1Pubkey;var p=r(981);t.findSequenceForSignedTx=p.findSequenceForSignedTx;var m=r(308);t.encodeSecp256k1Signature=m.encodeSecp256k1Signature,t.decodeSignature=m.decodeSignature;var g=r(982);t.SigningCosmWasmClient=g.SigningCosmWasmClient;const y=i(r(502));t.EnigmaUtils=y.default},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(154));t.Bech32=class{static encode(e,t){return i.encode(e,i.toWords(t))}static decode(e){const t=i.decode(e);return{prefix:t.prefix,data:new Uint8Array(i.fromWords(t.words))}}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(6));class o{constructor(e,t){this.data={atomics:new i.default(e),fractionalDigits:t}}static fromUserInput(e,t){o.verifyFractionalDigits(t);const r=e.match(/[^0-9.]/);if(r)throw new Error("Invalid character at position "+(r.index+1));let n,i;if(-1===e.search(/\./))n=e,i="";else{const t=e.split(".");switch(t.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!t[1])throw new Error("Fractional part missing");n=t[0],i=t[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(i.length>t)throw new Error("Got more fractional digits than supported");const s=`${n}${i.padEnd(t,"0")}`;return new o(s,t)}static fromAtomics(e,t){return o.verifyFractionalDigits(t),new o(e,t)}static verifyFractionalDigits(e){if(!Number.isInteger(e))throw new Error("Fractional digits is not an integer");if(e<0)throw new Error("Fractional digits must not be negative");if(e>100)throw new Error("Fractional digits must not exceed 100")}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}toString(){const e=new i.default(10).pow(new i.default(this.data.fractionalDigits)),t=this.data.atomics.div(e),r=this.data.atomics.mod(e);if(r.isZero())return t.toString();{const e=r.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${t.toString()}.${e}`}}toFloatApproximation(){const e=Number(this.toString());if(Number.isNaN(e))throw new Error("Conversion to number failed");return e}plus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.add(new i.default(e.atomics));return new o(t.toString(),this.fractionalDigits)}}t.Decimal=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(6)),o=new i.default("18446744073709551615",10,"be");class s{constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<0||e>4294967295)throw new Error("Input not in uint32 range: "+e.toString());this.data=e}static fromBigEndianBytes(e){if(4!==e.length)throw new Error("Invalid input length. Expected 4 bytes.");for(let t=0;t255||e[t]<0)throw new Error("Invalid value in byte. Found: "+e[t]);return new s(e[0]*2**24+65536*e[1]+256*e[2]+e[3])}toBytesBigEndian(){return new Uint8Array([255&Math.floor(this.data/2**24),255&Math.floor(this.data/65536),255&Math.floor(this.data/256),255&Math.floor(this.data/1)])}toBytesLittleEndian(){return new Uint8Array([255&Math.floor(this.data/1),255&Math.floor(this.data/256),255&Math.floor(this.data/65536),255&Math.floor(this.data/2**24)])}toNumber(){return this.data}toString(){return this.data.toString()}}t.Uint32=s;class a{constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(eNumber.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+e.toString());this.data=e}static fromString(e){if(!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new a(Number.parseInt(e,10))}toNumber(){return this.data}toString(){return this.data.toString()}}t.Int53=a;class c{constructor(e){const t=new a(e);if(t.toNumber()<0)throw new Error("Input is negative");this.data=t}static fromString(e){const t=a.fromString(e);return new c(t.toNumber())}toNumber(){return this.data.toNumber()}toString(){return this.data.toString()}}t.Uint53=c;class u{constructor(e){if(e.isNeg())throw new Error("Input is negative");if(e.gt(o))throw new Error("Input exceeds uint64 range");this.data=e}static fromBytesBigEndian(e){if(8!==e.length)throw new Error("Invalid input length. Expected 8 bytes.");for(let t=0;t255||e[t]<0)throw new Error("Invalid value in byte. Found: "+e[t]);const t=[];for(let r=0;re[t]).every(n)}Object.defineProperty(t,"__esModule",{value:!0}),t.isJsonCompatibleValue=n,t.isJsonCompatibleArray=i,t.isJsonCompatibleDictionary=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),i=r(496),o="string:",s="bytes:";class a{static toJson(e){if("number"==typeof e||"boolean"==typeof e)return e;if(null===e)return null;if("string"==typeof e)return`${o}${e}`;if(i.isUint8Array(e))return`${s}${n.Encoding.toHex(e)}`;if(Array.isArray(e))return e.map(a.toJson);if("object"==typeof e&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)){const t={};for(const r of Object.keys(e)){const n=e[r];void 0!==n&&(t[r]=a.toJson(n))}return t}throw new Error("Cannot encode type to JSON")}static fromJson(e){if("number"==typeof e||"boolean"==typeof e)return e;if(null===e)return null;if("string"==typeof e){if(e.startsWith(o))return e.slice(o.length);if(e.startsWith(s))return n.Encoding.fromHex(e.slice(s.length));throw new Error("Found string with unknown prefix")}if(Array.isArray(e))return e.map(a.fromJson);if("object"==typeof e&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)){const t={};for(const r of Object.keys(e))t[r]=a.fromJson(e[r]);return t}throw new Error("Cannot decode type from JSON")}}t.TransactionEncoder=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(168),i=r(64),o=r(167),{fromBase64:s}=i.Encoding;function a(e,t){if(33!==e.length)throw new Error("Invalid Secp256k1 pubkey length (compressed): "+e.length);const r=new n.Sha256(e).digest(),o=new n.Ripemd160(r).digest();return i.Bech32.encode(t,o)}t.rawSecp256k1PubkeyToAddress=a,t.pubkeyToAddress=function(e,t){const r=s(e.value);switch(e.type){case o.pubkeyType.secp256k1:return a(r,t);case o.pubkeyType.ed25519:{if(32!==r.length)throw new Error("Invalid Ed25519 pubkey length: "+r.length);const e=new n.Sha256(r).digest();return i.Bech32.encode(t,e.slice(0,20))}case o.pubkeyType.sr25519:{if(32!==r.length)throw new Error("Invalid Sr25519 pubkey length: "+r.length);const e=new n.Sha256(r).digest();return i.Bech32.encode(t,e.slice(0,20))}default:throw new Error("Unrecognized public key algorithm")}}},function(e,t,r){"use strict";(function(e){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=r(210),o=n(r(102)),s=r(158),a=n(r(391)),c=r(498);t.Bip39=class{static encode(e){if(-1===[16,20,24,28,32].indexOf(e.length))throw new Error("invalid input length");return new c.EnglishMnemonic(o.entropyToMnemonic(i.Encoding.toHex(e)))}static decode(e){return i.Encoding.fromHex(o.mnemonicToEntropy(e.toString()))}static async mnemonicToSeed(t,r){const n=e.from(a.nfkd(t.toString()),"utf8"),i="mnemonic"+(r?a.nfkd(r):""),o=e.from(i,"utf8");return this.pbkdf2(n,o,2048,64,"sha512")}static async pbkdf2(e,t,r,n,i){return new Promise((o,a)=>{s.pbkdf2(e,t,r,n,i,(e,t)=>{e?a(e):o(new Uint8Array(t))})})}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(908);Object.defineProperty(t,"Decimal",{enumerable:!0,get:function(){return n.Decimal}});var i=r(909);Object.defineProperty(t,"Int53",{enumerable:!0,get:function(){return i.Int53}}),Object.defineProperty(t,"Uint32",{enumerable:!0,get:function(){return i.Uint32}}),Object.defineProperty(t,"Uint53",{enumerable:!0,get:function(){return i.Uint53}}),Object.defineProperty(t,"Uint64",{enumerable:!0,get:function(){return i.Uint64}})},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Decimal=void 0;const i=n(r(6));class o{constructor(e,t){this.data={atomics:new i.default(e),fractionalDigits:t}}static fromUserInput(e,t){o.verifyFractionalDigits(t);const r=e.match(/[^0-9.]/);if(r)throw new Error("Invalid character at position "+(r.index+1));let n,i;if(-1===e.search(/\./))n=e,i="";else{const t=e.split(".");switch(t.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!t[1])throw new Error("Fractional part missing");n=t[0],i=t[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(i.length>t)throw new Error("Got more fractional digits than supported");const s=`${n}${i.padEnd(t,"0")}`;return new o(s,t)}static fromAtomics(e,t){return o.verifyFractionalDigits(t),new o(e,t)}static verifyFractionalDigits(e){if(!Number.isInteger(e))throw new Error("Fractional digits is not an integer");if(e<0)throw new Error("Fractional digits must not be negative");if(e>100)throw new Error("Fractional digits must not exceed 100")}static compare(e,t){if(e.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return e.data.atomics.cmp(new i.default(t.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}toString(){const e=new i.default(10).pow(new i.default(this.data.fractionalDigits)),t=this.data.atomics.div(e),r=this.data.atomics.mod(e);if(r.isZero())return t.toString();{const e=r.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${t.toString()}.${e}`}}toFloatApproximation(){const e=Number(this.toString());if(Number.isNaN(e))throw new Error("Conversion to number failed");return e}plus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.add(new i.default(e.atomics));return new o(t.toString(),this.fractionalDigits)}equals(e){return 0===o.compare(this,e)}isLessThan(e){return o.compare(this,e)<0}isLessThanOrEqual(e){return o.compare(this,e)<=0}isGreaterThan(e){return o.compare(this,e)>0}isGreaterThanOrEqual(e){return o.compare(this,e)>=0}}t.Decimal=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uint64=t.Uint53=t.Int53=t.Uint32=void 0;const i=n(r(6)),o=new i.default("18446744073709551615",10,"be");class s{constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<0||e>4294967295)throw new Error("Input not in uint32 range: "+e.toString());this.data=e}static fromBigEndianBytes(e){if(4!==e.length)throw new Error("Invalid input length. Expected 4 bytes.");for(let t=0;t255||e[t]<0)throw new Error("Invalid value in byte. Found: "+e[t]);return new s(e[0]*2**24+65536*e[1]+256*e[2]+e[3])}toBytesBigEndian(){return new Uint8Array([255&Math.floor(this.data/2**24),255&Math.floor(this.data/65536),255&Math.floor(this.data/256),255&Math.floor(this.data/1)])}toBytesLittleEndian(){return new Uint8Array([255&Math.floor(this.data/1),255&Math.floor(this.data/256),255&Math.floor(this.data/65536),255&Math.floor(this.data/2**24)])}toNumber(){return this.data}toString(){return this.data.toString()}}t.Uint32=s;class a{constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(eNumber.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+e.toString());this.data=e}static fromString(e){if(!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new a(Number.parseInt(e,10))}toNumber(){return this.data}toString(){return this.data.toString()}}t.Int53=a;class c{constructor(e){const t=new a(e);if(t.toNumber()<0)throw new Error("Input is negative");this.data=t}static fromString(e){const t=a.fromString(e);return new c(t.toNumber())}toNumber(){return this.data.toNumber()}toString(){return this.data.toString()}}t.Uint53=c;class u{constructor(e){if(e.isNeg())throw new Error("Input is negative");if(e.gt(o))throw new Error("Input exceeds uint64 range");this.data=e}static fromBytesBigEndian(e){if(8!==e.length)throw new Error("Invalid input length. Expected 8 bytes.");for(let t=0;t255||e[t]<0)throw new Error("Invalid value in byte. Found: "+e[t]);const t=[];for(let r=0;r{const t=e.charCodeAt(0);if(t<32||t>126)throw new Error("Cannot encode character that is out of printable ASCII range: "+t);return t}))},t.fromAscii=function(e){return(t=Array.from(e),t.map(e=>{if(e<32||e>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+e);return String.fromCharCode(e)})).join("");var t}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.fromBase64=t.toBase64=void 0;const s=o(r(112));t.toBase64=function(e){return s.fromByteArray(e)},t.fromBase64=function(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return s.toByteArray(e)}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Bech32=void 0;const s=o(r(154));t.Bech32=class{static encode(e,t){return s.encode(e,s.toWords(t))}static decode(e){const t=s.decode(e);return{prefix:t.prefix,data:new Uint8Array(s.fromWords(t.words))}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromHex=t.toHex=void 0,t.toHex=function(e){let t="";for(const r of e)t+=("0"+r.toString(16)).slice(-2);return t},t.fromHex=function(e){if(e.length%2!=0)throw new Error("hex string length must be a multiple of 2");const t=[];for(let r=0;rsetTimeout(t,e))}},function(e,t,r){"use strict";(function(e){function r(e){return"object"==typeof e&&null!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=t.isNonNullObject=void 0,t.isNonNullObject=r,t.isUint8Array=function(t){return!!r(t)&&("[object Uint8Array]"===Object.prototype.toString.call(t)&&(void 0===e||void 0===e.isBuffer||!e.isBuffer(t)))}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";function n(e){return!("string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&null!==e&&!i(e)&&!o(e))}function i(e){if(!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function o(e){if("object"!=typeof e||null===e)return!1;if("[object Object]"!==Object.prototype.toString.call(e))return!1;return Object.getOwnPropertyNames(e).map(t=>e[t]).every(n)}Object.defineProperty(t,"__esModule",{value:!0}),t.isJsonCompatibleValue=n,t.isJsonCompatibleArray=i,t.isJsonCompatibleDictionary=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(292),i=r(497),o="string:",s="bytes:";class a{static toJson(e){if("number"==typeof e||"boolean"==typeof e)return e;if(null===e)return null;if("string"==typeof e)return`${o}${e}`;if(i.isUint8Array(e))return`${s}${n.toHex(e)}`;if(Array.isArray(e))return e.map(a.toJson);if("object"==typeof e&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)){const t={};for(const r of Object.keys(e)){const n=e[r];void 0!==n&&(t[r]=a.toJson(n))}return t}throw new Error("Cannot encode type to JSON")}static fromJson(e){if("number"==typeof e||"boolean"==typeof e)return e;if(null===e)return null;if("string"==typeof e){if(e.startsWith(o))return e.slice(o.length);if(e.startsWith(s))return n.fromHex(e.slice(s.length));throw new Error("Found string with unknown prefix")}if(Array.isArray(e))return e.map(a.fromJson);if("object"==typeof e&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)){const t={};for(const r of Object.keys(e))t[r]=a.fromJson(e[r]);return t}throw new Error("Cannot decode type from JSON")}}t.TransactionEncoder=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(292);t.Encoding=class{static toHex(e){return n.toHex(e)}static fromHex(e){return n.fromHex(e)}static toBase64(e){return n.toBase64(e)}static fromBase64(e){return n.fromBase64(e)}static toAscii(e){return n.toAscii(e)}static fromAscii(e){return n.fromAscii(e)}static toUtf8(e){return n.toUtf8(e)}static fromUtf8(e){return n.fromUtf8(e)}static fromRfc3339(e){return n.fromRfc3339(e)}static toRfc3339(e){return n.toRfc3339(e)}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(227));t.Keccak256=class{constructor(e){this.blockSize=64,this.impl=i.default.keccak256.create(),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(394));t.Argon2id=class{static async execute(e,t,r){return await i.default.ready,i.default.crypto_pwhash(r.outputLength,e,t,r.opsLimit,1024*r.memLimitKib,i.default.crypto_pwhash_ALG_ARGON2ID13)}};class o{constructor(e,t){this.privkey=e,this.pubkey=t}static fromLibsodiumPrivkey(e){if(64!==e.length)throw new Error(`Unexpected key length ${e.length}. Must be 64.`);return new o(e.slice(0,32),e.slice(32,64))}toLibsodiumPrivkey(){return new Uint8Array([...this.privkey,...this.pubkey])}}t.Ed25519Keypair=o;t.Ed25519=class{static async makeKeypair(e){await i.default.ready;const t=i.default.crypto_sign_seed_keypair(e);return o.fromLibsodiumPrivkey(t.privateKey)}static async createSignature(e,t){return await i.default.ready,i.default.crypto_sign_detached(e,t.toLibsodiumPrivkey())}static async verifySignature(e,t,r){return await i.default.ready,i.default.crypto_sign_verify_detached(e,t,r)}};t.Xchacha20poly1305Ietf=class{static async encrypt(e,t,r){await i.default.ready;return i.default.crypto_aead_xchacha20poly1305_ietf_encrypt(e,null,null,r,t)}static async decrypt(e,t,r){await i.default.ready;return i.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,e,null,r,t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Random=class{static getBytes(e){try{const t="object"==typeof window?window:self,r=void 0!==t.crypto?t.crypto:t.msCrypto,n=new Uint8Array(e);return r.getRandomValues(n),n}catch(t){try{const t=r(96);return new Uint8Array([...t.randomBytes(e)])}catch(e){throw new Error("No secure random number generator found")}}}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(210),o=n(r(103)),{toHex:s}=i.Encoding;t.Ripemd160=class{constructor(e){this.blockSize=64,this.impl=new o.default,e&&this.update(e)}update(e){return this.impl.update(s(e),"hex"),this}digest(){return Uint8Array.from(this.impl.digest())}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(210),o=n(r(6)),s=n(r(61)),a=r(500),c=new s.default.ec("secp256k1"),u=new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");t.Secp256k1=class{static async makeKeypair(e){if(32!==e.length)throw new Error("input data is not a valid secp256k1 private key");const t=c.keyFromPrivate(e);if(!0!==t.validate().result)throw new Error("input data is not a valid secp256k1 private key");if(new o.default(e).gte(u))throw new Error("input data is not a valid secp256k1 private key");return{privkey:i.Encoding.fromHex(t.getPrivate("hex")),pubkey:i.Encoding.fromHex(t.getPublic().encode("hex"))}}static async createSignature(e,t){if(0===e.length)throw new Error("Message hash must not be empty");if(e.length>32)throw new Error("Message hash length must not exceed 32 bytes");const r=c.keyFromPrivate(t).sign(e,{canonical:!0});return new a.ExtendedSecp256k1Signature(Uint8Array.from(r.r.toArray()),Uint8Array.from(r.s.toArray()),r.recoveryParam)}static async verifySignature(e,t,r){if(0===t.length)throw new Error("Message hash must not be empty");if(t.length>32)throw new Error("Message hash length must not exceed 32 bytes");const n=c.keyFromPublic(r);try{return n.verify(t,e.toDer())}catch(e){return!1}}static recoverPubkey(e,t){const r={r:i.Encoding.toHex(e.r()),s:i.Encoding.toHex(e.s())},n=c.recoverPubKey(t,r,e.recovery),o=c.keyFromPublic(n);return i.Encoding.fromHex(o.getPublic(!1,"hex"))}static compressPubkey(e){switch(e.length){case 33:return e;case 65:return Uint8Array.from(c.keyFromPublic(e).pub.encodeCompressed());default:throw new Error("Invalid pubkey length")}}static trimRecoveryByte(e){switch(e.length){case 64:return e;case 65:return e.slice(0,64);default:throw new Error("Invalid signature length")}}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(210),o=n(r(6)),s=n(r(61)),a=r(499),c=r(501);var u;!function(e){e.Secp256k1="Bitcoin seed",e.Ed25519="ed25519 seed"}(u=t.Slip10Curve||(t.Slip10Curve={})),t.slip10CurveFromString=function(e){switch(e){case u.Ed25519:return u.Ed25519;case u.Secp256k1:return u.Secp256k1;default:throw new Error(`Unknown curve string: '${e}'`)}};class l extends i.Uint32{static hardened(e){return new l(e+2**31)}static normal(e){return new l(e)}isHardened(){return this.data>=2**31}}t.Slip10RawIndex=l;const f=new s.default.ec("secp256k1");class d{static derivePath(e,t,r){let n=this.master(e,t);for(const t of r)n=this.child(e,n.privkey,n.chainCode,t);return n}static master(e,t){const r=new a.Hmac(c.Sha512,i.Encoding.toAscii(e)).update(t).digest(),n=r.slice(0,32),o=r.slice(32,64);return e!==u.Ed25519&&(this.isZero(n)||this.isGteN(e,n))?this.master(e,r):{chainCode:o,privkey:n}}static child(e,t,r,n){let i;if(n.isHardened()){const e=new Uint8Array([0,...t,...n.toBytesBigEndian()]);i=new a.Hmac(c.Sha512,r).update(e).digest()}else{if(e===u.Ed25519)throw new Error("Normal keys are not allowed with ed25519");{const s=new Uint8Array([...d.serializedPoint(e,new o.default(t)),...n.toBytesBigEndian()]);i=new a.Hmac(c.Sha512,r).update(s).digest()}}return this.childImpl(e,t,r,n,i)}static serializedPoint(e,t){switch(e){case u.Secp256k1:return i.Encoding.fromHex(f.g.mul(t).encodeCompressed("hex"));default:throw new Error("curve not supported")}}static childImpl(e,t,r,n,i){const s=i.slice(0,32),l=i.slice(32,64),f=l;if(e===u.Ed25519)return{chainCode:f,privkey:s};const d=this.n(e),h=new o.default(s).add(new o.default(t)).mod(d),p=Uint8Array.from(h.toArray("be",32));if(this.isGteN(e,s)||this.isZero(p)){const i=new a.Hmac(c.Sha512,r).update(new Uint8Array([1,...l,...n.toBytesBigEndian()])).digest();return this.childImpl(e,t,r,n,i)}return{chainCode:f,privkey:p}}static isZero(e){return e.every(e=>0===e)}static isGteN(e,t){return new o.default(t).gte(this.n(e))}static n(e){switch(e){case u.Secp256k1:return new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16);default:throw new Error("curve not supported")}}}t.Slip10=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(64),i=r(167);t.unmarshalTx=function(e){const t=JSON.parse(n.Encoding.fromUtf8(e));if(!i.isStdTx(t))throw new Error("Must be json encoded StdTx");return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(295));var n=r(503);t.AEAD=n.AEAD;var i=r(504);t.SIV=i.SIV;var o=r(933);t.StreamEncryptor=o.StreamEncryptor,t.StreamDecryptor=o.StreamDecryptor;var s=r(505);t.CMAC=s.CMAC;var a=r(506);t.PMAC=a.PMAC;var c=r(934);t.PolyfillCryptoProvider=c.PolyfillCryptoProvider;var u=r(211);t.WebCryptoProvider=u.WebCryptoProvider},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(169);class o{constructor(e,t){this._crypto=e,this._key=t,this._iv=new i.default,this._emptyPromise=Promise.resolve(this)}static importKey(e,t){return n(this,void 0,void 0,(function*(){if(16!==t.length&&32!==t.length)throw new Error(`Miscreant: invalid key length: ${t.length} (expected 16 or 32 bytes)`);const r=yield e.subtle.importKey("raw",t,"AES-CBC",!1,["encrypt"]);return new o(e,r)}))}clear(){return this}encryptBlock(e){return n(this,void 0,void 0,(function*(){const t={name:"AES-CBC",iv:this._iv.data},r=yield this._crypto.subtle.encrypt(t,this._key,e.data);return e.data.set(new Uint8Array(r,0,i.default.SIZE)),this._emptyPromise}))}}t.default=o},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});class i{constructor(e,t){this.key=e,this.crypto=t}static importKey(e,t){return n(this,void 0,void 0,(function*(){if(16!==t.length&&32!==t.length)throw new Error(`Miscreant: invalid key length: ${t.length} (expected 16 or 32 bytes)`);const r=yield e.subtle.importKey("raw",t,"AES-CTR",!1,["encrypt"]);return new i(r,e)}))}encryptCtr(e,t){return n(this,void 0,void 0,(function*(){const r=yield this.crypto.subtle.encrypt({name:"AES-CTR",counter:e,length:16},this.key,t);return new Uint8Array(r)}))}clear(){return this}}t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=new Uint8Array([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0]);t.ctz=function(e){return n[e]}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(503),o=r(211);t.NONCE_SIZE=8,t.LAST_BLOCK_FLAG=1,t.COUNTER_MAX=4294967295;class s{static importKey(e,t,r,a=new o.WebCryptoProvider){return n(this,void 0,void 0,(function*(){return new s(yield i.AEAD.importKey(e,r,a),t)}))}constructor(e,t){this._aead=e,this._nonce_encoder=new c(t)}seal(e,t=!1,r=new Uint8Array(0)){return n(this,void 0,void 0,(function*(){return this._aead.seal(e,this._nonce_encoder.next(t),r)}))}clear(){return this._aead.clear(),this}}t.StreamEncryptor=s;class a{static importKey(e,t,r,s=new o.WebCryptoProvider){return n(this,void 0,void 0,(function*(){return new a(yield i.AEAD.importKey(e,r,s),t)}))}constructor(e,t){this._aead=e,this._nonce_encoder=new c(t)}open(e,t=!1,r=new Uint8Array(0)){return n(this,void 0,void 0,(function*(){return this._aead.open(e,this._nonce_encoder.next(t),r)}))}clear(){return this._aead.clear(),this}}t.StreamDecryptor=a;class c{constructor(e){if(e.length!==t.NONCE_SIZE)throw new Error("STREAM: nonce must be 8-bits (got "+e.length);this.buffer=new ArrayBuffer(t.NONCE_SIZE+4+1),this.view=new DataView(this.buffer),this.array=new Uint8Array(this.buffer),this.array.set(e),this.counter=0,this.finished=!1}next(e){if(this.finished)throw new Error("STREAM: already finished");if(this.view.setInt32(8,this.counter,!1),e)this.view.setInt8(12,t.LAST_BLOCK_FLAG),this.finished=!0;else if(this.counter+=1,this.counter>t.COUNTER_MAX)throw new Error("STREAM counter overflowed");return this.array}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(935),o=r(936);t.PolyfillCryptoProvider=class{constructor(){}importBlockCipherKey(e){return n(this,void 0,void 0,(function*(){return new i.default(e)}))}importCTRKey(e){return n(this,void 0,void 0,(function*(){return new o.default(new i.default(e))}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(297),i=new Uint8Array([1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47]),o=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);let a,c,u,l,f,d,h,p,m=!1;function g(e,t=0){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function y(e,t=new Uint8Array(4),r=0){return t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function b(e){return o[e>>>24&255]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[255&e]}t.default=class{constructor(e){if(m||function(){function e(e,t){let r=e,n=t,i=0;for(let e=1;e<256&&0!==n;e<<=1)0!=(n&e)&&(i^=r,n^=e),r<<=1,0!=(256&r)&&(r^=283);return i}const t=e=>e<<24|e>>>8;a=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(256),l=new Uint32Array(256);for(let r=0;r<256;r++){const n=o[r];let i=e(n,2)<<24|n<<16|n<<8|e(n,3);a[r]=i,i=t(i),c[r]=i,i=t(i),u[r]=i,i=t(i),l[r]=i,i=t(i)}f=new Uint32Array(256),d=new Uint32Array(256),h=new Uint32Array(256),p=new Uint32Array(256);for(let r=0;r<256;r++){const n=s[r];let i=e(n,14)<<24|e(n,9)<<16|e(n,13)<<8|e(n,11);f[r]=i,i=t(i),d[r]=i,i=t(i),h[r]=i,i=t(i),p[r]=i,i=t(i)}m=!0}(),16!==e.length&&32!==e.length)throw new Error(`Miscreant: invalid key length: ${e.length} (expected 16 or 32 bytes)`);this._encKey=function(e){const t=new Uint32Array(e.length+28),r=e.length/4|0,n=t.length;for(let n=0;n>>24)^i[e/r-1]<<24:r>6&&e%r==4&&(n=b(n)),t[e]=t[e-r]^n}var o;return t}(e),this._emptyPromise=Promise.resolve(this)}clear(){return this._encKey&&n.wipe(this._encKey),this}encryptBlock(e){const t=e.data,r=e.data;let n=g(t,0),i=g(t,4),s=g(t,8),f=g(t,12);n^=this._encKey[0],i^=this._encKey[1],s^=this._encKey[2],f^=this._encKey[3];let d=0,h=0,p=0,m=0;const b=this._encKey.length/4-2;let v=4;for(let e=0;e>>24&255]^c[i>>>16&255]^u[s>>>8&255]^l[255&f],h=this._encKey[v+1]^a[i>>>24&255]^c[s>>>16&255]^u[f>>>8&255]^l[255&n],p=this._encKey[v+2]^a[s>>>24&255]^c[f>>>16&255]^u[n>>>8&255]^l[255&i],m=this._encKey[v+3]^a[f>>>24&255]^c[n>>>16&255]^u[i>>>8&255]^l[255&s],v+=4,n=d,i=h,s=p,f=m;return n=o[d>>>24]<<24|o[h>>>16&255]<<16|o[p>>>8&255]<<8|o[255&m],i=o[h>>>24]<<24|o[p>>>16&255]<<16|o[m>>>8&255]<<8|o[255&d],s=o[p>>>24]<<24|o[m>>>16&255]<<16|o[d>>>8&255]<<8|o[255&h],f=o[m>>>24]<<24|o[d>>>16&255]<<16|o[h>>>8&255]<<8|o[255&p],n^=this._encKey[v+0],i^=this._encKey[v+1],s^=this._encKey[v+2],f^=this._encKey[v+3],y(n,r,0),y(i,r,4),y(s,r,8),y(f,r,12),this._emptyPromise}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(169);function o(e){let t=1;for(let r=i.default.SIZE-1;r>=0;r--)t+=255&e.data[r]|0,e.data[r]=255&t,t>>>=8}t.default=class{constructor(e){this._cipher=e,this._counter=new i.default,this._buffer=new i.default}clear(){return this._buffer.clear(),this._counter.clear(),this._cipher.clear(),this}encryptCtr(e,t){return n(this,void 0,void 0,(function*(){if(e.length!==i.default.SIZE)throw new Error("CTR: iv length must be equal to cipher block size");this._counter.data.set(e);let r=i.default.SIZE;const n=new Uint8Array(t.length);for(let e=0;e>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function p(e,t,r,n){return function(e,t,r,n,i){var o,s=0;for(o=0;o>>8)-1}(e,t,r,n,32)}function m(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function g(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function y(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function b(e,t){var r,n,o,s=i(),a=i();for(r=0;r<16;r++)a[r]=t[r];for(g(a),g(a),g(a),n=0;n<2;n++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,y(a,s,1-o)}for(r=0;r<16;r++)e[2*r]=255&a[r],e[2*r+1]=a[r]>>8}function v(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return b(r,e),b(n,t),p(r,0,n,0)}function w(e){var t=new Uint8Array(32);return b(t,e),1&t[0]}function _(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function k(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function S(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function E(e,t,r){var n,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,d=0,h=0,p=0,m=0,g=0,y=0,b=0,v=0,w=0,_=0,k=0,S=0,E=0,O=0,M=0,x=0,A=0,j=0,P=0,I=0,R=0,T=0,C=0,B=0,D=r[0],N=r[1],U=r[2],z=r[3],L=r[4],q=r[5],K=r[6],F=r[7],$=r[8],H=r[9],J=r[10],W=r[11],G=r[12],V=r[13],Z=r[14],Y=r[15];o+=(n=t[0])*D,s+=n*N,a+=n*U,c+=n*z,u+=n*L,l+=n*q,f+=n*K,d+=n*F,h+=n*$,p+=n*H,m+=n*J,g+=n*W,y+=n*G,b+=n*V,v+=n*Z,w+=n*Y,s+=(n=t[1])*D,a+=n*N,c+=n*U,u+=n*z,l+=n*L,f+=n*q,d+=n*K,h+=n*F,p+=n*$,m+=n*H,g+=n*J,y+=n*W,b+=n*G,v+=n*V,w+=n*Z,_+=n*Y,a+=(n=t[2])*D,c+=n*N,u+=n*U,l+=n*z,f+=n*L,d+=n*q,h+=n*K,p+=n*F,m+=n*$,g+=n*H,y+=n*J,b+=n*W,v+=n*G,w+=n*V,_+=n*Z,k+=n*Y,c+=(n=t[3])*D,u+=n*N,l+=n*U,f+=n*z,d+=n*L,h+=n*q,p+=n*K,m+=n*F,g+=n*$,y+=n*H,b+=n*J,v+=n*W,w+=n*G,_+=n*V,k+=n*Z,S+=n*Y,u+=(n=t[4])*D,l+=n*N,f+=n*U,d+=n*z,h+=n*L,p+=n*q,m+=n*K,g+=n*F,y+=n*$,b+=n*H,v+=n*J,w+=n*W,_+=n*G,k+=n*V,S+=n*Z,E+=n*Y,l+=(n=t[5])*D,f+=n*N,d+=n*U,h+=n*z,p+=n*L,m+=n*q,g+=n*K,y+=n*F,b+=n*$,v+=n*H,w+=n*J,_+=n*W,k+=n*G,S+=n*V,E+=n*Z,O+=n*Y,f+=(n=t[6])*D,d+=n*N,h+=n*U,p+=n*z,m+=n*L,g+=n*q,y+=n*K,b+=n*F,v+=n*$,w+=n*H,_+=n*J,k+=n*W,S+=n*G,E+=n*V,O+=n*Z,M+=n*Y,d+=(n=t[7])*D,h+=n*N,p+=n*U,m+=n*z,g+=n*L,y+=n*q,b+=n*K,v+=n*F,w+=n*$,_+=n*H,k+=n*J,S+=n*W,E+=n*G,O+=n*V,M+=n*Z,x+=n*Y,h+=(n=t[8])*D,p+=n*N,m+=n*U,g+=n*z,y+=n*L,b+=n*q,v+=n*K,w+=n*F,_+=n*$,k+=n*H,S+=n*J,E+=n*W,O+=n*G,M+=n*V,x+=n*Z,A+=n*Y,p+=(n=t[9])*D,m+=n*N,g+=n*U,y+=n*z,b+=n*L,v+=n*q,w+=n*K,_+=n*F,k+=n*$,S+=n*H,E+=n*J,O+=n*W,M+=n*G,x+=n*V,A+=n*Z,j+=n*Y,m+=(n=t[10])*D,g+=n*N,y+=n*U,b+=n*z,v+=n*L,w+=n*q,_+=n*K,k+=n*F,S+=n*$,E+=n*H,O+=n*J,M+=n*W,x+=n*G,A+=n*V,j+=n*Z,P+=n*Y,g+=(n=t[11])*D,y+=n*N,b+=n*U,v+=n*z,w+=n*L,_+=n*q,k+=n*K,S+=n*F,E+=n*$,O+=n*H,M+=n*J,x+=n*W,A+=n*G,j+=n*V,P+=n*Z,I+=n*Y,y+=(n=t[12])*D,b+=n*N,v+=n*U,w+=n*z,_+=n*L,k+=n*q,S+=n*K,E+=n*F,O+=n*$,M+=n*H,x+=n*J,A+=n*W,j+=n*G,P+=n*V,I+=n*Z,R+=n*Y,b+=(n=t[13])*D,v+=n*N,w+=n*U,_+=n*z,k+=n*L,S+=n*q,E+=n*K,O+=n*F,M+=n*$,x+=n*H,A+=n*J,j+=n*W,P+=n*G,I+=n*V,R+=n*Z,T+=n*Y,v+=(n=t[14])*D,w+=n*N,_+=n*U,k+=n*z,S+=n*L,E+=n*q,O+=n*K,M+=n*F,x+=n*$,A+=n*H,j+=n*J,P+=n*W,I+=n*G,R+=n*V,T+=n*Z,C+=n*Y,w+=(n=t[15])*D,s+=38*(k+=n*U),a+=38*(S+=n*z),c+=38*(E+=n*L),u+=38*(O+=n*q),l+=38*(M+=n*K),f+=38*(x+=n*F),d+=38*(A+=n*$),h+=38*(j+=n*H),p+=38*(P+=n*J),m+=38*(I+=n*W),g+=38*(R+=n*G),y+=38*(T+=n*V),b+=38*(C+=n*Z),v+=38*(B+=n*Y),o=(n=(o+=38*(_+=n*N))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=d,e[8]=h,e[9]=p,e[10]=m,e[11]=g,e[12]=y,e[13]=b,e[14]=v,e[15]=w}function O(e,t){E(e,t,t)}function M(e,t){var r,n=i();for(r=0;r<16;r++)n[r]=t[r];for(r=253;r>=0;r--)O(n,n),2!==r&&4!==r&&E(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}function x(e,t,r){var n,o,s=new Uint8Array(32),c=new Float64Array(80),u=i(),l=i(),f=i(),d=i(),h=i(),p=i();for(o=0;o<31;o++)s[o]=t[o];for(s[31]=127&t[31]|64,s[0]&=248,_(c,r),o=0;o<16;o++)l[o]=c[o],d[o]=u[o]=f[o]=0;for(u[0]=d[0]=1,o=254;o>=0;--o)y(u,l,n=s[o>>>3]>>>(7&o)&1),y(f,d,n),k(h,u,f),S(u,u,f),k(f,l,d),S(l,l,d),O(d,h),O(p,u),E(u,f,u),E(f,l,h),k(h,u,f),S(u,u,f),O(l,u),S(f,d,p),E(u,f,a),k(u,u,d),E(f,f,u),E(u,d,p),E(d,l,c),O(l,h),y(u,l,n),y(f,d,n);for(o=0;o<16;o++)c[o+16]=u[o],c[o+32]=f[o],c[o+48]=l[o],c[o+64]=d[o];var m=c.subarray(32),g=c.subarray(16);return M(m,m),E(g,g,m),b(e,g),0}var A=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function j(e,t,r,n){for(var i,o,s,a,c,u,l,f,d,h,p,m,g,y,b,v,w,_,k,S,E,O,M,x,j,P,I=new Int32Array(16),R=new Int32Array(16),T=e[0],C=e[1],B=e[2],D=e[3],N=e[4],U=e[5],z=e[6],L=e[7],q=t[0],K=t[1],F=t[2],$=t[3],H=t[4],J=t[5],W=t[6],G=t[7],V=0;n>=128;){for(k=0;k<16;k++)S=8*k+V,I[k]=r[S+0]<<24|r[S+1]<<16|r[S+2]<<8|r[S+3],R[k]=r[S+4]<<24|r[S+5]<<16|r[S+6]<<8|r[S+7];for(k=0;k<80;k++)if(i=T,o=C,s=B,a=D,c=N,u=U,l=z,L,d=q,h=K,p=F,m=$,g=H,y=J,b=W,G,M=65535&(O=G),x=O>>>16,j=65535&(E=L),P=E>>>16,M+=65535&(O=(H>>>14|N<<18)^(H>>>18|N<<14)^(N>>>9|H<<23)),x+=O>>>16,j+=65535&(E=(N>>>14|H<<18)^(N>>>18|H<<14)^(H>>>9|N<<23)),P+=E>>>16,M+=65535&(O=H&J^~H&W),x+=O>>>16,j+=65535&(E=N&U^~N&z),P+=E>>>16,M+=65535&(O=A[2*k+1]),x+=O>>>16,j+=65535&(E=A[2*k]),P+=E>>>16,E=I[k%16],x+=(O=R[k%16])>>>16,j+=65535&E,P+=E>>>16,j+=(x+=(M+=65535&O)>>>16)>>>16,M=65535&(O=_=65535&M|x<<16),x=O>>>16,j=65535&(E=w=65535&j|(P+=j>>>16)<<16),P=E>>>16,M+=65535&(O=(q>>>28|T<<4)^(T>>>2|q<<30)^(T>>>7|q<<25)),x+=O>>>16,j+=65535&(E=(T>>>28|q<<4)^(q>>>2|T<<30)^(q>>>7|T<<25)),P+=E>>>16,x+=(O=q&K^q&F^K&F)>>>16,j+=65535&(E=T&C^T&B^C&B),P+=E>>>16,f=65535&(j+=(x+=(M+=65535&O)>>>16)>>>16)|(P+=j>>>16)<<16,v=65535&M|x<<16,M=65535&(O=m),x=O>>>16,j=65535&(E=a),P=E>>>16,x+=(O=_)>>>16,j+=65535&(E=w),P+=E>>>16,C=i,B=o,D=s,N=a=65535&(j+=(x+=(M+=65535&O)>>>16)>>>16)|(P+=j>>>16)<<16,U=c,z=u,L=l,T=f,K=d,F=h,$=p,H=m=65535&M|x<<16,J=g,W=y,G=b,q=v,k%16==15)for(S=0;S<16;S++)E=I[S],M=65535&(O=R[S]),x=O>>>16,j=65535&E,P=E>>>16,E=I[(S+9)%16],M+=65535&(O=R[(S+9)%16]),x+=O>>>16,j+=65535&E,P+=E>>>16,w=I[(S+1)%16],M+=65535&(O=((_=R[(S+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),x+=O>>>16,j+=65535&(E=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),P+=E>>>16,w=I[(S+14)%16],x+=(O=((_=R[(S+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,j+=65535&(E=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,I[S]=65535&j|P<<16,R[S]=65535&M|x<<16;M=65535&(O=q),x=O>>>16,j=65535&(E=T),P=E>>>16,E=e[0],x+=(O=t[0])>>>16,j+=65535&E,P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,e[0]=T=65535&j|P<<16,t[0]=q=65535&M|x<<16,M=65535&(O=K),x=O>>>16,j=65535&(E=C),P=E>>>16,E=e[1],x+=(O=t[1])>>>16,j+=65535&E,P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,e[1]=C=65535&j|P<<16,t[1]=K=65535&M|x<<16,M=65535&(O=F),x=O>>>16,j=65535&(E=B),P=E>>>16,E=e[2],x+=(O=t[2])>>>16,j+=65535&E,P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,e[2]=B=65535&j|P<<16,t[2]=F=65535&M|x<<16,M=65535&(O=$),x=O>>>16,j=65535&(E=D),P=E>>>16,E=e[3],x+=(O=t[3])>>>16,j+=65535&E,P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,e[3]=D=65535&j|P<<16,t[3]=$=65535&M|x<<16,M=65535&(O=H),x=O>>>16,j=65535&(E=N),P=E>>>16,E=e[4],x+=(O=t[4])>>>16,j+=65535&E,P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,e[4]=N=65535&j|P<<16,t[4]=H=65535&M|x<<16,M=65535&(O=J),x=O>>>16,j=65535&(E=U),P=E>>>16,E=e[5],x+=(O=t[5])>>>16,j+=65535&E,P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,e[5]=U=65535&j|P<<16,t[5]=J=65535&M|x<<16,M=65535&(O=W),x=O>>>16,j=65535&(E=z),P=E>>>16,E=e[6],x+=(O=t[6])>>>16,j+=65535&E,P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,e[6]=z=65535&j|P<<16,t[6]=W=65535&M|x<<16,M=65535&(O=G),x=O>>>16,j=65535&(E=L),P=E>>>16,E=e[7],x+=(O=t[7])>>>16,j+=65535&E,P+=E>>>16,P+=(j+=(x+=(M+=65535&O)>>>16)>>>16)>>>16,e[7]=L=65535&j|P<<16,t[7]=G=65535&M|x<<16,V+=128,n-=128}return n}function P(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,j(i,o,t,r),r%=128,n=0;n=0;--i)R(e,t,n=r[i/8|0]>>(7&i)&1),I(t,e),I(e,e),R(e,t,n)}function B(e,t){var r=[i(),i(),i(),i()];m(r[0],l),m(r[1],f),m(r[2],s),E(r[3],l,f),C(e,r,t)}var D=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function N(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*D[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*D[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function U(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;N(e,r)}function z(e,t,r,n,o){for(var s=new Uint8Array(64),a=[i(),i(),i(),i()],c=0;c<32;c++)s[c]=n[c];s[0]&=248,s[31]&=127,s[31]|=64,B(a,s),T(s.subarray(32),a);var u,l=128&s[63];return u=o?function(e,t,r,n,o){var s,a,c=new Uint8Array(64),u=new Uint8Array(64),l=new Float64Array(64),f=[i(),i(),i(),i()];for(e[0]=254,s=1;s<32;s++)e[s]=255;for(s=0;s<32;s++)e[32+s]=n[s];for(s=0;s=0;r--)O(n,n),1!==r&&E(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}(r,r),E(r,r,a),E(r,r,u),E(r,r,u),E(e[0],r,u),O(n,e[0]),E(n,n,u),v(n,a)&&E(e[0],e[0],d),O(n,e[0]),E(n,n,u),v(n,a)?-1:(w(e[0])===t[31]>>7&&S(e[0],o,e[0]),E(e[3],e[0],e[1]),0)}function q(e,t,r,n){var o=function(e){var t=new Uint8Array(32),r=i(),n=i(),o=i();return _(r,e),k(n,r,s),S(o,r,s),M(n,n),E(n,n,o),b(t,n),t}(n);return o[31]|=128&t[63],t[63]&=127,function(e,t,r,n){var o,s=new Uint8Array(32),a=new Uint8Array(64),c=[i(),i(),i(),i()],u=[i(),i(),i(),i()];if(-1,r<64)return-1;if(L(u,n))return-1;for(o=0;o=0},t.generateKeyPair=function(e){if(K(e),32!==e.length)throw new Error("wrong seed length");for(var t=new Uint8Array(32),r=new Uint8Array(32),i=0;i<32;i++)t[i]=e[i];return x(r,t,n),t[0]&=248,t[31]&=127,t[31]|=64,r[31]&=127,{public:r,private:t}},t.default={}},function(e,t,r){(function(n,i){var o;!function(s){"use strict";function a(e,t){if(t=t||{type:"Array"},void 0!==n&&"number"==typeof n.pid&&n.versions&&n.versions.node)return function(e,t){var n=r(939).randomBytes(e);switch(t.type){case"Array":return[].slice.call(n);case"Buffer":return n;case"Uint8Array":for(var i=new Uint8Array(e),o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] "+g.message,new Error("UnsupportedEnvironments: "+s);case 14:return[2,new Uint8Array(o)]}}))}))};var l=function(e,t,r){return n(void 0,void 0,void 0,(function(){var n,o,s,c,l,f,d,h;return i(this,(function(i){switch(i.label){case 0:return n=a.default.hashes[r].blockSize,o=a.default.hashes[r].hashSize,e.length>n?[4,u.default.compute(e,r)]:[3,2];case 1:e=i.sent(),i.label=2;case 2:return(s=new Uint8Array(n)).set(e),c=s.map((function(e){return 255&(54^e)})),l=s.map((function(e){return 255&(92^e)})),(f=new Uint8Array(n+t.length)).set(c),f.set(t,n),[4,u.default.compute(f,r)];case 3:return d=i.sent(),(h=new Uint8Array(n+o)).set(l),h.set(d,n),[2,u.default.compute(h,r)]}}))}))};t.verify=function(e,r,o,s){return void 0===s&&(s="SHA-256"),n(void 0,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return[4,t.compute(e,r,s)];case 1:return n=i.sent(),[2,o.toString()===n.toString()]}}))}))};var f=function(e,t,r,n,i,o){return new Promise((function(s,a){var c=o.importKey(e,t,r,n,i);c.oncomplete=function(e){s(e.target.result)},c.onerror=function(){a("KeyImportingFailed")}}))},d=function(e,t,r,n){return new Promise((function(i,o){var s=n.sign({name:"HMAC",hash:{name:e}},t,r);s.oncomplete=function(e){i(new Uint8Array(e.target.result))},s.onerror=function(){o("ComputingHMACFailed")}}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={hashes:{"SHA3-512":{nodeName:"sha3-512",hashSize:64,blockSize:72},"SHA3-384":{nodeName:"sha3-384",hashSize:48,blockSize:104},"SHA3-256":{nodeName:"sha3-256",hashSize:32,blockSize:136},"SHA3-224":{nodeName:"sha3-224",hashSize:28,blockSize:144},"SHA-256":{nodeName:"sha256",hashSize:32,blockSize:64},"SHA-384":{nodeName:"sha384",hashSize:48,blockSize:128},"SHA-512":{nodeName:"sha512",hashSize:64,blockSize:128},"SHA-1":{nodeName:"sha1",hashSize:20,blockSize:64},MD5:{nodeName:"md5",hashSize:16,blockSize:64}}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] "+e.message,new Error("UnsupportedEnvironment: "+o)}return[2,new Uint8Array(n)]}}))}))};var d=function(e,t,r){return new Promise((function(n,i){var o=r.digest(e,t);o.oncomplete=function(e){n(e.target.result)},o.onerror=function(e){i(e)}}))},h=function(e,t,r){var n=c.default.hashes[e].nodeName,i=r.createHash(n);return i.update(t),i.digest()},p=function(e,t){var n;if("MD5"===e)n=u.default(Array.from(t),{asBytes:!0});else if(["SHA3-512","SHA3-384","SHA3-256","SHA3-224"].indexOf(e)>=0){var i=8*c.default.hashes[e].hashSize,o=new l.SHA3(i),s=r(2).Buffer;o.update(s.from(t)),n=o.digest("binary")}else n=f.default[c.default.hashes[e].nodeName]().update(t).digest();return new Uint8Array(n)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={hashes:{"SHA3-512":{nodeName:"sha3-512",hashSize:64},"SHA3-384":{nodeName:"sha3-384",hashSize:48},"SHA3-256":{nodeName:"sha3-256",hashSize:32},"SHA3-224":{nodeName:"sha3-224",hashSize:28},"SHA-256":{nodeName:"sha256",hashSize:32},"SHA-384":{nodeName:"sha384",hashSize:48},"SHA-512":{nodeName:"sha512",hashSize:64},"SHA-1":{nodeName:"sha1",hashSize:20},MD5:{nodeName:"md5",hashSize:16}}}},function(e,t,r){var n,i,o,s,a;n=r(950),i=r(509).utf8,o=r(951),s=r(509).bin,(a=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?s.stringToBytes(e):i.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=n.bytesToWords(e),c=8*e.length,u=1732584193,l=-271733879,f=-1732584194,d=271733878,h=0;h>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[c>>>5]|=128<>>9<<4)]=c;var p=a._ff,m=a._gg,g=a._hh,y=a._ii;for(h=0;h>>0,l=l+v>>>0,f=f+w>>>0,d=d+_>>>0}return n.endian([u,l,f,d])})._ff=function(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+(i>>>0)+s;return(a<>>32-o)+t},a._gg=function(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+(i>>>0)+s;return(a<>>32-o)+t},a._hh=function(e,t,r,n,i,o,s){var a=e+(t^r^n)+(i>>>0)+s;return(a<>>32-o)+t},a._ii=function(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+(i>>>0)+s;return(a<>>32-o)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(a(e,t));return t&&t.asBytes?r:t&&t.asString?s.bytesToString(r):n.bytesToHex(r)}},function(e,t){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,i=0;n>>6-2*i);return t}},e.exports=n},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ +e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SHAKE=t.SHA3Hash=t.SHA3=t.Keccak=void 0;var n,i=r(2),o=(n=r(953))&&n.__esModule?n:{default:n};var s=function(e){var t=e.allowedSizes,r=e.padding;return function e(){var n=this,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:512;if(!this||this.constructor!==e)return new e(s);if(t&&!t.includes(s))throw new Error("Unsupported hash length");var a=new o.default({capacity:s});return this.update=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if(i.Buffer.isBuffer(e))return a.absorb(e),n;if("string"==typeof e)return n.update(i.Buffer.from(e,t));throw new TypeError("Not a string or buffer")},this.digest=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"binary",t="string"==typeof e?{format:e}:e,n=a.squeeze({buffer:t.buffer,padding:t.padding||r});return t.format&&"binary"!==t.format?n.toString(t.format):n},this.reset=function(){return a.reset(),n},this}},a=s({allowedSizes:[224,256,384,512],padding:1});t.Keccak=a;var c=s({allowedSizes:[224,256,384,512],padding:6});t.SHA3=c;var u=s({allowedSizes:[128,256],padding:31});t.SHAKE=u;var l=a;t.SHA3Hash=l,c.SHA3Hash=l;var f=c;t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(2),o=(n=r(954))&&n.__esModule?n:{default:n};var s=function(e,t){for(var r=0;r>>8,t[r+2]=e[n+1]>>>16,t[r+3]=e[n+1]>>>24,t[r+4]=e[n],t[r+5]=e[n]>>>8,t[r+6]=e[n]>>>16,t[r+7]=e[n]>>>24}return t},c=function(e){var t=this,r=e.capacity,n=e.padding,c=(0,o.default)(),u=r/8,l=200-r/4,f=0,d=new Uint32Array(50),h=i.Buffer.allocUnsafe(l);return this.absorb=function(e){for(var r=0;r=l&&(s(h,d),c(d),f=0);return t},this.squeeze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={buffer:e.buffer||i.Buffer.allocUnsafe(u),padding:e.padding||n,queue:i.Buffer.allocUnsafe(h.length),state:new Uint32Array(d.length)};h.copy(t.queue);for(var r=0;r>>l,s[(u+1)%2]=c<>>l,(0,o.default)(s,0)(t,d),(0,o.default)(r,0)(s,0)}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(299))&&n.__esModule?n:{default:n};var o=function(e){for(var t=e.A,r=e.C,n=e.D,o=e.W,s=0,a=0,c=0;c<5;c++){var u=2*c,l=2*(c+5),f=2*(c+10),d=2*(c+15),h=2*(c+20);r[u]=t[u]^t[l]^t[f]^t[d]^t[h],r[u+1]=t[u+1]^t[l+1]^t[f+1]^t[d+1]^t[h+1]}for(var p=0;p<5;p++){(0,i.default)(r,(p+1)%5)(o,0),s=o[0],a=o[1],o[0]=s<<1|a>>>31,o[1]=a<<1|s>>>31,n[2*p]=r[(p+4)%5*2]^o[0],n[2*p+1]=r[(p+4)%5*2+1]^o[1];for(var m=0;m<25;m+=5)t[2*(m+p)]^=n[2*p],t[2*(m+p)+1]^=n[2*p+1]}};t.default=o},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});var i,o,s=n(r(510)),a=n(r(964));!function(e){e.encodeBase64=s.encodeBase64,e.decodeBase64=s.decodeBase64,e.encodeBase64Url=s.encodeBase64Url,e.decodeBase64Url=s.decodeBase64Url,e.arrayBufferToHexString=s.arrayBufferToHexString,e.hexStringToArrayBuffer=s.hexStringToArrayBuffer,e.stringToArrayBuffer=s.stringToArrayBuffer,e.arrayBufferToString=s.arrayBufferToString}(i=t.encoder||(t.encoder={})),function(e){e.binToPem=a.binToPem,e.pemToBin=a.pemToBin}(o=t.formatter||(t.formatter={})),t.default={encoder:i,formatter:o}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvBtoa=function(){return"undefined"!=typeof window?window.btoa:r},t.getEnvAtob=function(){return"undefined"!=typeof window?window.atob:n};var r=function(t){if(void 0===e)throw new Error("UnsupportedEnvironment");return e.from(t.toString(),"binary").toString("base64")},n=function(t){if(void 0===e)throw new Error("UnsupportedEnvironment");return e.from(t,"base64").toString("binary")}}).call(this,r(2).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});var i=n(r(510)),o={public:"PUBLIC KEY",private:"PRIVATE KEY",encryptedPrivate:"ENCRYPTED PRIVATE KEY",certificate:"CERTIFICATE",certRequest:"CERTIFICATE REQUEST"};t.pemToBin=function(e){var t=a(e);return i.decodeBase64(t)},t.binToPem=function(e,t){var r=i.encodeBase64(e);return s(r,t)};var s=function(e,t){for(var r=o[t],n="-----BEGIN "+r+"-----\n";e.length>0;)n+=e.substring(0,64)+"\n",e=e.substring(64);return n=n+"-----END "+r+"-----"},a=function(e){var t=RegExp("^-----[s]*BEGIN[^-]*-----$","gm"),r=RegExp("^-----[s]*END[^-]*-----$","gm");try{var n=e.split(t)[1].split(r)[0];return n=n.replace(/\r?\n/g,"")}catch(e){throw new Error("Invalid format as PEM")}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]Math.pow(2,32)-1)throw new Error("TooLongKeyDataIndicated");u=new Uint8Array(s.default.hashes[o].hashSize*n),l=new Uint8Array(4),f=0,i.label=1;case 1:return f0;)e[r-1]+=t&&0===e[r]?1:0,t=t&&0===e[r],r--;return e}},function(e,t,r){"use strict";e.exports=r(967)},function(e,t,r){"use strict";var n=e.exports=r(968);n.build="full",n.tokenize=r(519),n.parse=r(977),n.common=r(978),n.Root._configure(n.Type,n.parse,n.common)},function(e,t,r){"use strict";var n=e.exports=r(969);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(514),n.decoder=r(515),n.verifier=r(516),n.converter=r(517),n.ReflectionObject=r(126),n.Namespace=r(170),n.Root=r(307),n.Enum=r(76),n.Type=r(302),n.Field=r(106),n.OneOf=r(171),n.MapField=r(303),n.Service=r(304),n.Method=r(305),n.Message=r(306),n.wrappers=r(518),n.types=r(127),n.util=r(41),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},function(e,t,r){"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(300),n.BufferWriter=r(971),n.Reader=r(301),n.BufferReader=r(972),n.util=r(79),n.rpc=r(512),n.roots=r(513),n.configure=i,i()},function(e,t,r){"use strict";e.exports=i;var n=r(79);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},function(e,t,r){"use strict";e.exports=o;var n=r(300);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(79);function o(){n.call(this)}function s(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},function(e,t,r){"use strict";e.exports=o;var n=r(301);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(79);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},function(e,t,r){"use strict";e.exports=i;var n=r(79);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,r){"use strict";function n(e,t){"string"==typeof e&&(t=e,e=void 0);var r=[];function i(e){if("string"!=typeof e){var t=o();if(n.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),u=0;u0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return n+t.join("/")};n.resolve=function(e,t,r){return r||(t=o(t)),i(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},function(e,t,r){"use strict";e.exports=E,E.filename=null,E.defaults={keepCase:!1};var n=r(519),i=r(307),o=r(302),s=r(106),a=r(303),c=r(171),u=r(76),l=r(304),f=r(305),d=r(127),h=r(41),p=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,y=/^-?0[x][0-9a-fA-F]+$/,b=/^0[0-7]+$/,v=/^-?0[0-7]+$/,w=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,_=/^[a-zA-Z_][a-zA-Z_0-9]*$/,k=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,S=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function E(e,t,r){t instanceof i||(r=t,t=new i),r||(r=E.defaults);var O,M,x,A,j,P=r.preferTrailingComment||!1,I=n(e,r.alternateCommentMode||!1),R=I.next,T=I.push,C=I.peek,B=I.skip,D=I.cmnt,N=!0,U=!1,z=t,L=r.keepCase?function(e){return e}:h.camelCase;function q(e,t,r){var n=E.filename;return r||(E.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+I.line+")")}function K(){var e,t=[];do{if('"'!==(e=R())&&"'"!==e)throw q(e);t.push(R()),B(e),e=C()}while('"'===e||"'"===e);return t.join("")}function F(e){var t=R();switch(t){case"'":case'"':return T(t),K();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(p.test(e))return r*parseInt(e,10);if(g.test(e))return r*parseInt(e,16);if(b.test(e))return r*parseInt(e,8);if(w.test(e))return r*parseFloat(e);throw q(e,"number",t)}(t,!0)}catch(r){if(e&&k.test(t))return t;throw q(t,"value")}}function $(e,t){var r,n;do{!t||'"'!==(r=C())&&"'"!==r?e.push([n=H(R()),B("to",!0)?H(R()):n]):e.push(K())}while(B(",",!0));B(";")}function H(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw q(e,"id");if(m.test(e))return parseInt(e,10);if(y.test(e))return parseInt(e,16);if(v.test(e))return parseInt(e,8);throw q(e,"id")}function J(){if(void 0!==O)throw q("package");if(O=R(),!k.test(O))throw q(O,"name");z=z.define(O),B(";")}function W(){var e,t=C();switch(t){case"weak":e=x||(x=[]),R();break;case"public":R();default:e=M||(M=[])}t=K(),B(";"),e.push(t)}function G(){if(B("="),A=K(),!(U="proto3"===A)&&"proto2"!==A)throw q(A,"syntax");B(";")}function V(e,t){switch(t){case"option":return X(e,t),B(";"),!0;case"message":return function(e,t){if(!_.test(t=R()))throw q(t,"type name");var r=new o(t);Z(r,(function(e){if(!V(r,e))switch(e){case"map":!function(e){B("<");var t=R();if(void 0===d.mapKey[t])throw q(t,"type");B(",");var r=R();if(!k.test(r))throw q(r,"type");B(">");var n=R();if(!_.test(n))throw q(n,"name");B("=");var i=new a(L(n),H(R()),t,r);Z(i,(function(e){if("option"!==e)throw q(e);X(i,e),B(";")}),(function(){te(i)})),e.add(i)}(r);break;case"required":case"repeated":Y(r,e);break;case"optional":Y(r,U?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!_.test(t=R()))throw q(t,"name");var r=new c(L(t));Z(r,(function(e){"option"===e?(X(r,e),B(";")):(T(e),Y(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":$(r.extensions||(r.extensions=[]));break;case"reserved":$(r.reserved||(r.reserved=[]),!0);break;default:if(!U||!k.test(e))throw q(e);T(e),Y(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!_.test(t=R()))throw q(t,"name");var r=new u(t);Z(r,(function(e){switch(e){case"option":X(r,e),B(";");break;case"reserved":$(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!_.test(t))throw q(t,"name");B("=");var r=H(R(),!0),n={};Z(n,(function(e){if("option"!==e)throw q(e);X(n,e),B(";")}),(function(){te(n)})),e.add(t,r,n.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!_.test(t=R()))throw q(t,"service name");var r=new l(t);Z(r,(function(e){if(!V(r,e)){if("rpc"!==e)throw q(e);!function(e,t){var r=D(),n=t;if(!_.test(t=R()))throw q(t,"name");var i,o,s,a,c=t;B("("),B("stream",!0)&&(o=!0);if(!k.test(t=R()))throw q(t);i=t,B(")"),B("returns"),B("("),B("stream",!0)&&(a=!0);if(!k.test(t=R()))throw q(t);s=t,B(")");var u=new f(c,n,i,s,o,a);u.comment=r,Z(u,(function(e){if("option"!==e)throw q(e);X(u,e),B(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!k.test(t=R()))throw q(t,"reference");var r=t;Z(null,(function(t){switch(t){case"required":case"repeated":Y(e,t,r);break;case"optional":Y(e,U?"proto3_optional":"optional",r);break;default:if(!U||!k.test(t))throw q(t);T(t),Y(e,"optional",r)}}))}(e,t),!0}return!1}function Z(e,t,r){var n=I.line;if(e&&("string"!=typeof e.comment&&(e.comment=D()),e.filename=E.filename),B("{",!0)){for(var i;"}"!==(i=R());)t(i);B(";",!0)}else r&&r(),B(";"),e&&("string"!=typeof e.comment||P)&&(e.comment=D(n)||e.comment)}function Y(e,t,r){var n=R();if("group"!==n){if(!k.test(n))throw q(n,"type");var i=R();if(!_.test(i))throw q(i,"name");i=L(i),B("=");var a=new s(i,H(R()),n,t,r);if(Z(a,(function(e){if("option"!==e)throw q(e);X(a,e),B(";")}),(function(){te(a)})),"proto3_optional"===t){var u=new c("_"+i);a.setOption("proto3_optional",!0),u.add(a),e.add(u)}else e.add(a);U||!a.repeated||void 0===d.packed[n]&&void 0!==d.basic[n]||a.setOption("packed",!1,!0)}else!function(e,t){var r=R();if(!_.test(r))throw q(r,"name");var n=h.lcFirst(r);r===n&&(r=h.ucFirst(r));B("=");var i=H(R()),a=new o(r);a.group=!0;var c=new s(n,i,r,t);c.filename=E.filename,Z(a,(function(e){switch(e){case"option":X(a,e),B(";");break;case"required":case"repeated":Y(a,e);break;case"optional":Y(a,U?"proto3_optional":"optional");break;default:throw q(e)}})),e.add(a).add(c)}(e,t)}function X(e,t){var r=B("(",!0);if(!k.test(t=R()))throw q(t,"name");var n,i=t,o=i;r&&(B(")"),o=i="("+i+")",t=C(),S.test(t)&&(n=t.substr(1),i+=t,R())),B("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,o,Q(e,i),n)}function Q(e,t){if(B("{",!0)){for(var r={};!B("}",!0);){if(!_.test(j=R()))throw q(j,"name");var n,i=j;"{"===C()?n=Q(e,t+"."+j):(B(":"),"{"===C()?n=Q(e,t+"."+j):(n=F(!0),ee(e,t+"."+j,n)));var o=r[i];o&&(n=[].concat(o).concat(n)),r[i]=n,B(",",!0)}return r}var s=F(!0);return ee(e,t,s),s}function ee(e,t,r){e.setOption&&e.setOption(t,r)}function te(e){if(B("[",!0)){do{X(e,"option")}while(B(",",!0));B("]")}return e}for(;null!==(j=R());)switch(j){case"package":if(!N)throw q(j);J();break;case"import":if(!N)throw q(j);W();break;case"syntax":if(!N)throw q(j);G();break;case"option":X(z,j),B(";");break;default:if(V(z,j)){N=!1;continue}throw q(j)}return E.filename=null,{package:O,imports:M,weakImports:x,syntax:A,root:t}}},function(e,t,r){"use strict";e.exports=o;var n,i=/\/|\./;function o(e,t){i.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),o[e]=t}o("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),o("duration",{Duration:n={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),o("timestamp",{Timestamp:n}),o("empty",{Empty:{fields:{}}}),o("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),o("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),o("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),o.get=function(e){return o[e]||null}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(168),i=r(308);function o(e){return[n.Slip10RawIndex.hardened(44),n.Slip10RawIndex.hardened(529),n.Slip10RawIndex.hardened(0),n.Slip10RawIndex.normal(0),n.Slip10RawIndex.normal(e)]}t.makeSecretNetworkPath=o;class s{constructor(e,t){this.privkey=e,this.pubkey=t}static async fromMnemonic(e,t=o(0)){const r=await n.Bip39.mnemonicToSeed(new n.EnglishMnemonic(e)),{privkey:i}=n.Slip10.derivePath(n.Slip10Curve.Secp256k1,r,t),a=(await n.Secp256k1.makeKeypair(i)).pubkey;return new s(i,n.Secp256k1.compressPubkey(a))}async sign(e,t="sha256"){const r=function(e,t){switch(t){case null:return new Uint8Array([...e]);case"sha256":return new n.Sha256(e).digest();case"sha512":return new n.Sha512(e).digest();default:throw new Error("Unknown prehash type")}}(e,t),o=await n.Secp256k1.createSignature(r,this.privkey),s=new Uint8Array([...o.r(32),...o.s(32)]);return i.encodeSecp256k1Signature(this.pubkey,s)}}t.Secp256k1Pen=s},function(e,t,r){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(168),i=r(293),o=r(308);t.findSequenceForSignedTx=async function(e,t,r,s,a=0){const c=e.value.signatures.find(()=>!0);if(!c)throw new Error("Signature missing in tx");const{pubkey:u,signature:l}=o.decodeSignature(c),f=n.Secp256k1Signature.fromFixedLength(l);for(let o=a;oo.Encoding.fromBase64(e.value.msg).slice(0,32)),p=d.decodeTxData(o.Encoding.fromHex(f.data));let m=Uint8Array.from([]);p[0].data&&(m=await this.restClient.decryptDataField(o.Encoding.toHex(o.Encoding.fromBase64(p[0].data)),h));return{logs:await this.restClient.decryptLogs(f.logs,h),transactionHash:f.transactionHash,data:m}}async execute(e,t,r="",n,i=this.fees.exec,s){s?this.restClient.codeHashCache.set(e,s):s=await this.restClient.getCodeHashByContractAddr(e),r||(r="");const a={type:"wasm/MsgExecuteContract",value:{sender:this.senderAddress,contract:e,msg:o.Encoding.toBase64(await this.restClient.enigmautils.encrypt(s,t)),sent_funds:null!=n?n:[]}},{accountNumber:c,sequence:u}=await this.getNonce(),l=await this.getChainId(),f=await this.signAdapter([a],i,l,r,c,u),h=o.Encoding.fromBase64(a.value.msg).slice(0,32);let p;try{p=await this.postTx(f)}catch(e){try{const t=/failed to execute message; message index: 0: encrypted: (.+?): (?:instantiate|execute|query) contract failed/g.exec(e.message);if(null==t||2!=t.length)throw e;const r=t[1],n=o.Encoding.fromBase64(r),i=await this.restClient.enigmautils.decrypt(n,h);e.message=e.message.replace(r,o.Encoding.fromUtf8(i))}catch(t){throw new Error(`Failed to decrypt the following error message: ${e.message}. Decryption error of the error message: ${t.message}`)}throw e}const m=d.decodeTxData(o.Encoding.fromHex(p.data));let g=Uint8Array.from([]);if(m[0].data){g=await this.restClient.decryptDataField(o.Encoding.toHex(o.Encoding.fromBase64(m[0].data)),[h])}return{logs:await this.restClient.decryptLogs(p.logs,[h]),transactionHash:p.transactionHash,data:g}}async sendTokens(e,t,r="",n=this.fees.send){const i={type:"cosmos-sdk/MsgSend",value:{from_address:this.senderAddress,to_address:e,amount:t}};r||(r="");const{accountNumber:o,sequence:s}=await this.getNonce(),a=await this.getChainId(),c=await this.signAdapter([i],n,a,r,o,s);return this.postTx(c)}}t.SigningCosmWasmClient=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=new RegExp("^[a-z0-9][a-z0-9._-]*[a-z0-9](/[a-z0-9][a-z0-9._-]*[a-z0-9])+:[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$");t.isValidBuilder=function(e){return!(e.length>128)&&!!e.match(n)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const n=r(309),i=r(522),o=r(985);t.init=function(e,t){e.registerMessage(n.GetPubkeyMsg),e.registerMessage(n.ReqeustEncryptMsg),e.registerMessage(n.RequestDecryptMsg),e.registerMessage(n.GetTxEncryptionKeyMsg),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const i=r(309);t.getHandler=e=>(t,r)=>{switch(r.constructor){case i.GetPubkeyMsg:return o(e)(t,r);case i.ReqeustEncryptMsg:return s(e)(t,r);case i.RequestDecryptMsg:return a(e)(t,r);case i.GetTxEncryptionKeyMsg:return c(e)(t,r);default:throw new Error("Unknown msg type")}};const o=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.getPubkey(t,r.chainId)})),s=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.encrypt(t,r.chainId,r.contractCodeHash,r.msg)})),a=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.decrypt(t,r.chainId,r.cipherText,r.nonce)})),c=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.getTxEncryptionKey(t,r.chainId,r.nonce)}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(523),t),i(r(987),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const n=r(310),i=r(524),o=r(988);t.init=function(e,t){e.registerMessage(n.SendTxMsg),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const i=r(310);t.getHandler=e=>(t,r)=>{switch(r.constructor){case i.SendTxMsg:return o(e)(t,r);default:throw new Error("Unknown msg type")}};const o=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.sendTx(r.chainId,r.tx,r.mode)}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(466),t),i(r(990),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const n=r(275),i=r(468),o=r(991);t.init=function(e,t){e.registerMessage(n.TryUpdateChainMsg),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const i=r(275);t.getHandler=e=>(t,r)=>{switch(r.constructor){case i.TryUpdateChainMsg:return o(e)(t,r);default:throw new Error("Unknown msg type")}};const o=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){yield e.tryUpdateChain(r.chainId)}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(525),t),i(r(993),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const n=r(213),i=r(526),o=r(994);t.init=function(e,t){e.registerMessage(n.GetTokensMsg),e.registerMessage(n.SuggestTokenMsg),e.registerMessage(n.AddTokenMsg),e.registerMessage(n.RemoveTokenMsg),e.registerMessage(n.GetSecret20ViewingKey),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const i=r(213);t.getHandler=e=>(t,r)=>{switch(r.constructor){case i.GetTokensMsg:return o(e)(t,r);case i.SuggestTokenMsg:return s(e)(t,r);case i.AddTokenMsg:return a(e)(t,r);case i.RemoveTokenMsg:return c(e)(t,r);case i.GetSecret20ViewingKey:return u(e)(t,r);default:throw new Error("Unknown msg type")}};const o=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.getTokens(r.chainId)})),s=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.suggestToken(t,r.chainId,r.contractAddress,r.viewingKey)})),a=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){yield e.addToken(r.chainId,r.currency)})),c=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){yield e.removeToken(r.chainId,r.currency)})),u=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.permissionService.checkOrGrantBasicAccessPermission(t,r.chainId,r.origin),yield e.getSecret20ViewingKey(r.chainId,r.contractAddress)}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(469),t),i(r(996),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const n=r(277),i=r(472),o=r(997);t.init=function(e,t){e.registerMessage(n.ApproveInteractionMsg),e.registerMessage(n.RejectInteractionMsg),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const n=r(277);t.getHandler=e=>(t,r)=>{switch(r.constructor){case n.ApproveInteractionMsg:return i(e)(t,r);case n.RejectInteractionMsg:return o(e)(t,r);default:throw new Error("Unknown msg type")}};const i=e=>(t,r)=>e.approve(r.id,r.result),o=e=>(t,r)=>e.reject(r.id)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(485),t),i(r(999),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const n=r(289),i=r(488),o=r(1e3);t.init=function(e,t){e.registerMessage(n.EnableAccessMsg),e.registerMessage(n.GetPermissionOriginsMsg),e.registerMessage(n.GetOriginPermittedChainsMsg),e.registerMessage(n.AddPermissionOrigin),e.registerMessage(n.RemovePermissionOrigin),e.addHandler(i.ROUTE,o.getHandler(t))}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getHandler=void 0;const i=r(289);t.getHandler=e=>(t,r)=>{switch(r.constructor){case i.EnableAccessMsg:return o(e)(t,r);case i.GetPermissionOriginsMsg:return s(e)(t,r);case i.GetOriginPermittedChainsMsg:return a(e)(t,r);case i.AddPermissionOrigin:return c(e)(t,r);case i.RemovePermissionOrigin:return u(e)(t,r);default:throw new Error("Unknown msg type")}};const o=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){return yield e.checkOrGrantBasicAccessPermission(t,r.chainIds,r.origin)})),s=e=>(t,r)=>e.getPermissionOrigins(r.chainId,r.permissionType),a=e=>(t,r)=>e.getOriginPermittedChains(r.permissionOrigin,r.permissionType),c=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){yield e.addPermission([r.chainId],r.permissionType,[r.permissionOrigin])})),u=e=>(t,r)=>n(void 0,void 0,void 0,(function*(){yield e.removePermission(r.chainId,r.permissionType,[r.permissionOrigin])}))},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(461),t),i(r(274),t)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(493),t),i(r(309),t)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(523),t),i(r(310),t),i(r(1004),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(525),t),i(r(213),t),i(r(527),t)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){e.exports=r(1761)},function(e,t,r){"use strict";r.r(t);var n=r(18),i=r(58),o=r(35),s=r(46),a=r(575),c=r.n(a),u=r(2),l=r(341),f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const d=new i.ExtensionRouter(i.ExtensionEnv.produceEnv);d.addGuard(i.ExtensionGuards.checkOriginIsValid),d.addGuard(i.ExtensionGuards.checkMessageIsInternal),Object(s.init)(d,e=>new o.ExtensionKVStore(e),new i.ContentScriptMessageRequester,l.a,l.b,e=>Promise.resolve(crypto.getRandomValues(e)),{scrypt:(e,t)=>f(void 0,void 0,void 0,(function*(){return yield c.a.scrypt(u.Buffer.from(e),u.Buffer.from(t.salt,"hex"),t.n,t.r,t.p,t.dklen)}))},{create:e=>{browser.notifications.create({type:"basic",iconUrl:e.iconRelativeUrl?browser.runtime.getURL(e.iconRelativeUrl):void 0,title:e.title,message:e.message})}}),d.listen(n.BACKGROUND_PORT)}]); \ No newline at end of file