1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[347],{40926:function(t,e,r){"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function i(){let t=n();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=n,e.getSubtleCrypto=i,e.isBrowserCryptoAvailable=function(){return!!n()&&!!i()}},88618:function(t,e,r){"use strict";var n=r(34155);function i(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function s(){return void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=i,e.isNode=s,e.isBrowser=function(){return!i()&&!s()}},1468:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});let n=r(34308);n.__exportStar(r(40926),e),n.__exportStar(r(88618),e)},34308:function(t,e,r){"use strict";r.r(e),r.d(e,{__assign:function(){return s},__asyncDelegator:function(){return M},__asyncGenerator:function(){return w},__asyncValues:function(){return _},__await:function(){return y},__awaiter:function(){return c},__classPrivateFieldGet:function(){return O},__classPrivateFieldSet:function(){return I},__createBinding:function(){return d},__decorate:function(){return a},__exportStar:function(){return f},__extends:function(){return i},__generator:function(){return l},__importDefault:function(){return S},__importStar:function(){return k}
vendor: 5,093 bytes, lines 1-14
1,__makeTemplateObject:function(){return b},__metadata:function(){return u},__param:function(){return h},__read:function(){return m},__rest:function(){return o},__spread:function(){return g},__spreadArrays:function(){return v},__values:function(){return p}});/*! ***************************************************************************** 2Copyright (c) Microsoft Corporation. 3 4Permission to use, copy, modify, and/or distribute this software for any 5purpose with or without fee is hereby granted. 6 7THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 9AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 11LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 12OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 13PERFORMANCE OF THIS SOFTWARE. 14***************************************************************************** */var n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var s=function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function o(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)0>e.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function a(t,e,r,n){var i,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s<3?i(o):s>3?i(e,r,o):i(e,r))||o);return s>3&&o&&Object.defineProperty(e,r,o),o}function h(t,e){return function(r,n){e(r,n,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(t){try{h(n.next(t))}catch(e){s(e)}}function a(t){try{h(n.throw(t))}catch(e){s(e)}}function h(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(o,a)}h((n=n.apply(t,e||[])).next())})}function l(t,e){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(a){s=[6,a],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function d(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}function f(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||(e[r]=t[r])}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(a){i={error:a}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function v(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function w(t,e,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(t,e||[]),s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(t){i[t]&&(n[t]=function(e){return new Promise(function(r,n){
14s.push([t,e,r,n])>1||a(t,e)})})}function a(t,e){try{var r;(r=i[t](e)).value instanceof y?Promise.resolve(r.value.v).then(h,u):c(s[0][2],r)}catch(n){c(s[0][3],n)}}function h(t){a("next",t)}function u(t){a("throw",t)}function c(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function M(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,i){e[n]=t[n]?function(e){return(r=!r)?{value:y(t[n](e)),done:"return"===n}:i?i(e):e}:i}}function _(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,i){!function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)}(n,i,(e=t[r](e)).done,e.value)})}}}function b(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function k(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}function O(t,e){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return e.get(t)}function I(t,e,r){if(!e.has(t))throw TypeError("attempted to set private field on non-instance");return e.set(t,r),r}},68007:function(t){"use strict";t.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},11460:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}
vendor: 8,514 bytes, line 14
14"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{u=r(36563).Buffer}catch(o){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),s=e;s<i;s++){var o=t.charCodeAt(s)-48;n<<=4,o>=49&&o<=54?n|=o-49+10:o>=17&&o<=22?n|=o-17+10:n|=15&o}return n}function h(t,e,r,n){for(var i=0,s=Math.min(t.length,r),o=e;o<s;o++){var a=t.charCodeAt(o)-48;i*=n,a>=49?i+=a-49+10:a>=17?i+=a-17+10:i+=a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return 0>t.cmp(e)?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var i,s,o=0;o<this.length;o++)this.words[o]=0;var a=0;if("be"===r)for(o=t.length-1,i=0;o>=0;o-=3)s=t[o]|t[o-1]<<8|t[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(o=0,i=0;o<t.length;o+=3)s=t[o]|t[o+1]<<8|t[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this.strip()},s.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var r,n,i=0;i<this.length;i++)this.words[i]=0;var s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=a(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=a(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,a=Math.min(s,s-o)+r,u=0,c=r;c<a;c+=n)u=h(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var l=1;for(u=h(t,c,t.length,e),c=0;c<o;c++)l*=e;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},s.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u,c=["","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],d=[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 f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var c=h>>>26,l=67108863&h,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;c+=(o=(i=0|t.words[p])*(s=0|e.words[f])+l)/67108864|0,l=67108863&o}r.words[u]=0|l,h=0|c}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}s.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=((a<<i|s)&16777215).toString(16);r=0!=(s=a>>>24-i&16777215)||o!==this.length-1?c[6-h.length]+h+r:h+r,(i+=2)>=26&&(i-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=l[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:c[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return n(void 0!==u),this.toArrayLike(u,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var i,s,o=this.byteLength(),a=r||Math.max(1,o);n(o<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var h=new t(a),u=this.clone();if("le"===e){for(s=0;!u.isZero();s++)i=u.andln(255),u.iushrn(8),h[s]=i;for(;s<a;s++)h[s]=0}else{for(s=0;s<a-o;s++)h[s]=0;for(s=0;!u.isZero();s++)i=u.andln(255),u.iushrn(8),h[a-s-1]=i}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return n((this.negative|t.negative)==0),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return n((this.negative|t.negative)==0),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return n((this.negative|t.negative)==0),this.iuxor(t)}
vendor: 6,976 bytes, line 14
14,s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this.strip()},s.prototype.iadd=function(t){if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(n=(0|e.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&n;for(;0!==s&&o<e.length;o++)s=(n=(0|e.words[o])+s)>>26,this.words[o]=67108863&n;if(0===s&&o<e.length&&e!==this)for(;o<e.length;o++)this.words[o]=e.words[o];return this.length=Math.max(this.length,o),e!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,s,o=t.words,a=e.words,h=r.words,u=0,c=0|o[0],l=8191&c,d=c>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],v=8191&g,y=g>>>13,w=0|o[3],M=8191&w,_=w>>>13,b=0|o[4],k=8191&b,S=b>>>13,O=0|o[5],I=8191&O,x=O>>>13,R=0|o[6],E=8191&R,C=R>>>13,T=0|o[7],N=8191&T,A=T>>>13,q=0|o[8],P=8191&q,j=q>>>13,Z=0|o[9],W=8191&Z,L=Z>>>13,B=0|a[0],D=8191&B,U=B>>>13,F=0|a[1],$=8191&F,J=F>>>13,K=0|a[2],z=8191&K,V=K>>>13,Y=0|a[3],H=8191&Y,Q=Y>>>13,G=0|a[4],X=8191&G,tt=G>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],ts=8191&ti,to=ti>>>13,ta=0|a[7],th=8191&ta,tu=ta>>>13,tc=0|a[8],tl=8191&tc,td=tc>>>13,tf=0|a[9],tp=8191&tf,tm=tf>>>13;r.negative=t.negative^e.negative,r.length=19;var tg=(u+(n=Math.imul(l,D))|0)+((8191&(i=(i=Math.imul(l,U))+Math.imul(d,D)|0))<<13)|0;u=((s=Math.imul(d,U))+(i>>>13)|0)+(tg>>>26)|0,tg&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,U))+Math.imul(m,D)|0,s=Math.imul(m,U);var tv=(u+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(d,$)|0))<<13)|0;u=((s=s+Math.imul(d,J)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=67108863,n=Math.imul(v,D),i=(i=Math.imul(v,U))+Math.imul(y,D)|0,s=Math.imul(y,U),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,$)|0,s=s+Math.imul(m,J)|0;var ty=(u+(n=n+Math.imul(l,z)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(d,z)|0))<<13)|0;u=((s=s+Math.imul(d,V)|0)+(i>>>13)|0)+(ty>>>26)|0,ty&=67108863,n=Math.imul(M,D),i=(i=Math.imul(M,U))+Math.imul(_,D)|0,s=Math.imul(_,U),n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,J)|0,n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,z)|0,s=s+Math.imul(m,V)|0;var tw=(u+(n=n+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(d,H)|0))<<13)|0;u=((s=s+Math.imul(d,Q)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=67108863,n=Math.imul(k,D),i=(i=Math.imul(k,U))+Math.imul(S,D)|0,s=Math.imul(S,U),n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,J)|0,n=n+Math.imul(v,z)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,z)|0,s=s+Math.imul(y,V)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,H)|0,s=s+Math.imul(m,Q)|0;var tM=(u+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(d,X)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=67108863,n=Math.imul(I,D),i=(i=Math.imul(I,U))+Math.imul(x,D)|0,s=Math.imul(x,U),n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(S,$)|0,s=s+Math.imul(S,J)|0,n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(_,z)|0,s=s+Math.imul(_,V)|0,n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(y,H)|0,s=s+Math.imul(y,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,X)|0,s=s+Math.imul(m,tt)|0;var t_=(u+(n=n+Math.imul(l,tr)|0)|0)+((8191&(i=(i=i+Math.imul(l,tn)|0)+Math.imul(d,tr)|0))<<13)|0;u=((s=s+Math.imul(d,tn)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=67108863,n=Math.imul(E,D),i=(i=Math.imul(E,U))+Math.imul(C,D)|0,s=Math.imul(C,U),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,J)|0,n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(S,z)|0,s=s+Math.imul(S,V)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,Q)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(m,tr)|0,s=s+Math.imul(m,tn)|0;var tb=(u+(n=n+Math.imul(l,ts)|0)|0)+((8191&(i=(i=i+Math.imul(l,to)|0)+Math.imul(d,ts)|0))<<13)|0;u=((s=s+Math.imul(d,to)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=67108863,n=Math.imul(N,D),i=(i=Math.imul(N,U))+Math.imul(A,D)|0,s=Math.imul(A,U),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(C,$)|0,s=s+Math.imul(C,J)|0,n=n+Math.imul(I,z)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(x,z)|0,s=s+Math.imul(x,V)|0,n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,Q)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,X)|0,s=s+Math.imul(_,tt)|0,n=n+Math.imul(v,tr)|0,i=(i=i+Math.imul(v,tn)|0)+Math.imul(y,tr)|0,s=s+Math.imul(y,tn)|0,n=n+Math.imul(p,ts)|0,i=(i=i+Math.imul(p,to)|0)+Math.imul(m,ts)|0,s=s+Math.imul(m,to)|0;var tk=(u+(n=n+Math.imul(l,th)|0)|0)+((8191&(i=(i=i+Math.imul(l,tu)|0)+Math.imul(d,th)|0))<<13)|0;u=((s=s+Math.imul(d,tu)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=67108863,n=Math.imul(P,D),i=(i=Math.imul(P,U))+Math.imul(j,D)|0,s=Math.imul(j,U),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,J)|0,n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(C,z)|0,s=s+Math.imul(C,V)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(x,H)|0,s=s+Math.imul(x,Q)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,X)|0,s=s+Math.imul(S,tt)|0,n=n+Math.imul(M,tr)|0,i=(i=i+Math.imul(M,tn
vendor: 5,386 bytes, line 14
14)|0)+Math.imul(_,tr)|0,s=s+Math.imul(_,tn)|0,n=n+Math.imul(v,ts)|0,i=(i=i+Math.imul(v,to)|0)+Math.imul(y,ts)|0,s=s+Math.imul(y,to)|0,n=n+Math.imul(p,th)|0,i=(i=i+Math.imul(p,tu)|0)+Math.imul(m,th)|0,s=s+Math.imul(m,tu)|0;var tS=(u+(n=n+Math.imul(l,tl)|0)|0)+((8191&(i=(i=i+Math.imul(l,td)|0)+Math.imul(d,tl)|0))<<13)|0;u=((s=s+Math.imul(d,td)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=67108863,n=Math.imul(W,D),i=(i=Math.imul(W,U))+Math.imul(L,D)|0,s=Math.imul(L,U),n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(j,$)|0,s=s+Math.imul(j,J)|0,n=n+Math.imul(N,z)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(A,z)|0,s=s+Math.imul(A,V)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(C,H)|0,s=s+Math.imul(C,Q)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,tt)|0,n=n+Math.imul(k,tr)|0,i=(i=i+Math.imul(k,tn)|0)+Math.imul(S,tr)|0,s=s+Math.imul(S,tn)|0,n=n+Math.imul(M,ts)|0,i=(i=i+Math.imul(M,to)|0)+Math.imul(_,ts)|0,s=s+Math.imul(_,to)|0,n=n+Math.imul(v,th)|0,i=(i=i+Math.imul(v,tu)|0)+Math.imul(y,th)|0,s=s+Math.imul(y,tu)|0,n=n+Math.imul(p,tl)|0,i=(i=i+Math.imul(p,td)|0)+Math.imul(m,tl)|0,s=s+Math.imul(m,td)|0;var tO=(u+(n=n+Math.imul(l,tp)|0)|0)+((8191&(i=(i=i+Math.imul(l,tm)|0)+Math.imul(d,tp)|0))<<13)|0;u=((s=s+Math.imul(d,tm)|0)+(i>>>13)|0)+(tO>>>26)|0,tO&=67108863,n=Math.imul(W,$),i=(i=Math.imul(W,J))+Math.imul(L,$)|0,s=Math.imul(L,J),n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(j,z)|0,s=s+Math.imul(j,V)|0,n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,Q)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(C,X)|0,s=s+Math.imul(C,tt)|0,n=n+Math.imul(I,tr)|0,i=(i=i+Math.imul(I,tn)|0)+Math.imul(x,tr)|0,s=s+Math.imul(x,tn)|0,n=n+Math.imul(k,ts)|0,i=(i=i+Math.imul(k,to)|0)+Math.imul(S,ts)|0,s=s+Math.imul(S,to)|0,n=n+Math.imul(M,th)|0,i=(i=i+Math.imul(M,tu)|0)+Math.imul(_,th)|0,s=s+Math.imul(_,tu)|0,n=n+Math.imul(v,tl)|0,i=(i=i+Math.imul(v,td)|0)+Math.imul(y,tl)|0,s=s+Math.imul(y,td)|0;var tI=(u+(n=n+Math.imul(p,tp)|0)|0)+((8191&(i=(i=i+Math.imul(p,tm)|0)+Math.imul(m,tp)|0))<<13)|0;u=((s=s+Math.imul(m,tm)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=67108863,n=Math.imul(W,z),i=(i=Math.imul(W,V))+Math.imul(L,z)|0,s=Math.imul(L,V),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(j,H)|0,s=s+Math.imul(j,Q)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(A,X)|0,s=s+Math.imul(A,tt)|0,n=n+Math.imul(E,tr)|0,i=(i=i+Math.imul(E,tn)|0)+Math.imul(C,tr)|0,s=s+Math.imul(C,tn)|0,n=n+Math.imul(I,ts)|0,i=(i=i+Math.imul(I,to)|0)+Math.imul(x,ts)|0,s=s+Math.imul(x,to)|0,n=n+Math.imul(k,th)|0,i=(i=i+Math.imul(k,tu)|0)+Math.imul(S,th)|0,s=s+Math.imul(S,tu)|0,n=n+Math.imul(M,tl)|0,i=(i=i+Math.imul(M,td)|0)+Math.imul(_,tl)|0,s=s+Math.imul(_,td)|0;var tx=(u+(n=n+Math.imul(v,tp)|0)|0)+((8191&(i=(i=i+Math.imul(v,tm)|0)+Math.imul(y,tp)|0))<<13)|0;u=((s=s+Math.imul(y,tm)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=67108863,n=Math.imul(W,H),i=(i=Math.imul(W,Q))+Math.imul(L,H)|0,s=Math.imul(L,Q),n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(j,X)|0,s=s+Math.imul(j,tt)|0,n=n+Math.imul(N,tr)|0,i=(i=i+Math.imul(N,tn)|0)+Math.imul(A,tr)|0,s=s+Math.imul(A,tn)|0,n=n+Math.imul(E,ts)|0,i=(i=i+Math.imul(E,to)|0)+Math.imul(C,ts)|0,s=s+Math.imul(C,to)|0,n=n+Math.imul(I,th)|0,i=(i=i+Math.imul(I,tu)|0)+Math.imul(x,th)|0,s=s+Math.imul(x,tu)|0,n=n+Math.imul(k,tl)|0,i=(i=i+Math.imul(k,td)|0)+Math.imul(S,tl)|0,s=s+Math.imul(S,td)|0;var tR=(u+(n=n+Math.imul(M,tp)|0)|0)+((8191&(i=(i=i+Math.imul(M,tm)|0)+Math.imul(_,tp)|0))<<13)|0;u=((s=s+Math.imul(_,tm)|0)+(i>>>13)|0)+(tR>>>26)|0,tR&=67108863,n=Math.imul(W,X),i=(i=Math.imul(W,tt))+Math.imul(L,X)|0,s=Math.imul(L,tt),n=n+Math.imul(P,tr)|0,i=(i=i+Math.imul(P,tn)|0)+Math.imul(j,tr)|0,s=s+Math.imul(j,tn)|0,n=n+Math.imul(N,ts)|0,i=(i=i+Math.imul(N,to)|0)+Math.imul(A,ts)|0,s=s+Math.imul(A,to)|0,n=n+Math.imul(E,th)|0,i=(i=i+Math.imul(E,tu)|0)+Math.imul(C,th)|0,s=s+Math.imul(C,tu)|0,n=n+Math.imul(I,tl)|0,i=(i=i+Math.imul(I,td)|0)+Math.imul(x,tl)|0,s=s+Math.imul(x,td)|0;var tE=(u+(n=n+Math.imul(k,tp)|0)|0)+((8191&(i=(i=i+Math.imul(k,tm)|0)+Math.imul(S,tp)|0))<<13)|0;u=((s=s+Math.imul(S,tm)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=67108863,n=Math.imul(W,tr),i=(i=Math.imul(W,tn))+Math.imul(L,tr)|0,s=Math.imul(L,tn),n=n+Math.imul(P,ts)|0,i=(i=i+Math.imul(P,to)|0)+Math.imul(j,ts)|0,s=s+Math.imul(j,to)|0,n=n+Math.imul(N,th)|0,i=(i=i+Math.imul(N,tu)|0)+Math.imul(A,th)|0,s=s+Math.imul(A,tu)|0,n=n+Math.imul(E,tl)|0,i=(i=i+Math.imul(E,td)|0)+Math.imul(C,tl)|0,s=s+Math.imul(C,td)|0;var tC=(u+(n=n+Math.imul(I,tp)|0)|0)+((8191&(i=(i=i+Math.imul(I,tm)|0)+Math.imul(x,tp)|0))<<13)|0;u=((s=s+Math.imul(x,tm)|0)+(i>>>13)|0)+(tC>>>26)|0,tC&=67108863,n=Math.imul(W,ts),i=(i=Math.imul(W,to))+Math.imul(L,ts)|0,s=Math.imul(L,to),n=n+Math.imul(P,th)|0,i=(i=i+Math.imul(P,tu)|0)+Math.imul(j,th)|0,s=s+Math.imul(j,tu)|0,n=n+Math.imul(N,tl)|0,i=(i=i+Math.imul(N,td)|0)+Math.imul(A,tl)|0,s=s+Math.imul(A,td)|0;var tT=(u+(n=n+Math.imul(E,tp)|0)|0)+((8191&(i=(i=i+Math.imul(E,tm)|0)+Math.imul(C,tp)|0))<<13)|0;u=((s=s+Math.imul(C,tm)|0)+(i>>>13)|0)+(tT>>>26)|0,tT&=67108863,n=Math.imul(W,th),i=(i=Math.imul(W,tu))+Math.imul(L,th)|0,s=Math.imul(L,tu),n=n+Math.imul(P,tl)|0,i=(i=i+Math.imul(P,td)|0)+Math.imul(j,tl)|0,s=s+Math.imul(j,td)|0;var tN=(u+(n=n+Math.imul(N,tp)|0)|0)+((8191&(i=(i=i+Math.imul(N,tm)|0)+Math.imul(A,tp)|0))<<13)|0;u=((s=s+Math.imul(A,tm)|0)+(i>>>13)|0)+(tN>>>
vendor: 5,222 bytes, line 14
1426)|0,tN&=67108863,n=Math.imul(W,tl),i=(i=Math.imul(W,td))+Math.imul(L,tl)|0,s=Math.imul(L,td);var tA=(u+(n=n+Math.imul(P,tp)|0)|0)+((8191&(i=(i=i+Math.imul(P,tm)|0)+Math.imul(j,tp)|0))<<13)|0;u=((s=s+Math.imul(j,tm)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=67108863;var tq=(u+(n=Math.imul(W,tp))|0)+((8191&(i=(i=Math.imul(W,tm))+Math.imul(L,tp)|0))<<13)|0;return u=((s=Math.imul(L,tm))+(i>>>13)|0)+(tq>>>26)|0,tq&=67108863,h[0]=tg,h[1]=tv,h[2]=ty,h[3]=tw,h[4]=tM,h[5]=t_,h[6]=tb,h[7]=tk,h[8]=tS,h[9]=tO,h[10]=tI,h[11]=tx,h[12]=tR,h[13]=tE,h[14]=tC,h[15]=tT,h[16]=tN,h[17]=tA,h[18]=tq,0!==u&&(h[19]=u,r.length++),r};function m(t,e,r){return new g().mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;for(var a=67108863&n,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var c=s-u,l=(0|t.words[c])*(0|e.words[u]),d=67108863&l;o=o+(l/67108864|0)|0,a=67108863&(d=d+a|0),i+=(o=o+(d>>>26)|0)>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},g.prototype.makeRBT=function(t){for(var e=Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,s){for(var o=0;o<s;o++)n[o]=e[t[o]],i[o]=r[t[o]]},g.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var l=h,d=u,f=0;f<o;f++){var p=r[c+f],m=n[c+f],g=r[c+f+o],v=n[c+f+o],y=l*g-d*v;v=l*v+d*g,g=y,r[c+f]=p+g,n[c+f]=m+v,r[c+f+o]=p-g,n[c+f+o]=m-v,f!==a&&(y=h*l-u*d,d=h*d+u*l,l=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===s),n((-8192&s)==0)},g.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),s=this.stub(n),o=Array(n),a=Array(n),h=Array(n),u=Array(n),c=Array(n),l=Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,s,a,h,n,i),this.transform(u,s,c,l,n,i);for(var f=0;f<n;f++){var p=a[f]*c[f]-h[f]*l[f];h[f]=a[f]*l[f]+h[f]*c[f],a[f]=p}return this.conjugate(a,h,n),this.transform(a,h,d,s,n,i),this.conjugate(d,s,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,s=(67108863&i)+(67108863&e);e>>=26,e+=(i/67108864|0)+(s>>>26),this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<r;this.words[e]=h|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},s.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var i,s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=r;if(i-=o,i=Math.max(0,i),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var l=0|this.words[u];this.words[u]=c<<26-s|l>>>s,c=l&a}
vendor: 15,967 bytes, line 14
14return h&&0!==c&&(h.words[h.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<<e)},s.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<<e),this.strip())},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return(n("number"==typeof t),n(t<67108864),t<0)?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var h=(0|t.words[i])*e;s-=67108863&h,a=(s>>26)-(h/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,i=this.clone(),o=t,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),i.iushln(n),a=0|o.words[o.length-1]);var h=i.length-o.length;if("mod"!==e){(r=new s(null)).length=h+1,r.words=Array(r.length);for(var u=0;u<r.length;u++)r.words[u]=0}var c=i.clone()._ishlnsubmul(o,1,h);0===c.negative&&(i=c,r&&(r.words[h]=1));for(var l=h-1;l>=0;l--){var d=(0|i.words[o.length+l])*67108864+(0|i.words[o.length+l-1]);for(d=Math.min(d/a|0,67108863),i._ishlnsubmul(o,d,l);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);r&&(r.words[l]=d)}return r&&r.strip(),i.strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},s.prototype.divmod=function(t,e,r){var i,o,a;return(n(!t.isZero()),this.isZero())?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||0>this.cmp(t)?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e)},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),s=r.cmp(n);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){n(t<=67108863);for(var e=67108864%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},s.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var d=0,f=1;(e.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(l)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(c),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),o.isub(h)):(r.isub(e),a.isub(i),h.isub(o))}return{a:a,b:h,gcd:r.iushln(u)}},s.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var o=new s(1),a=new s(0),h=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,c=1;(r.words[0]&c)==0&&u<26;++u,c<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var l=0,d=1;(i.words[0]&d)==0&&l<26;++l,d<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),o.isub(a)):(i.isub(r),a.isub(o))}return 0>(e=0===r.cmpn(1)?o:a).cmpn(0)&&e.iadd(t),e},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];a+=s,s=a>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return -1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return -1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return -1===this.cmpn(t)},s.prototype.lt=function(t){return -1===this.cmp(t)},s.prototype.lten=function(t){return 0>=this.cmpn(t)},s.prototype.lte=function(t){return 0>=this.cmp(t)},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new k(t)},s.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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 t=new s(null);return t.words=Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(w,y),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9){t.words[0]=0,t.length=1;return}var i=t.words[9];for(n=10,e.words[e.length++]=4194303&i;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(4194303&s)<<4|i>>>22,i=s}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(M,y),i(_,y),i(b,y),b.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=(0|t.words[r])*19+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){var e;if(v[t])return v[t];if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new _;else if("p25519"===t)e=new b;else throw Error("Unknown prime "+t);return v[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n((t.negative|e.negative)==0,"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,u).cmp(h);)c.redIAdd(h);for(var l=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var v=this.pow(l,new s(1).iushln(p-g-1));d=d.redMul(v),l=v.redSqr(),f=f.redMul(l),p=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=h-1;c>=0;c--){var l=u>>c&1;if(i!==r[0]&&(i=this.sqr(i)),0===l&&0===o){a=0;continue}o<<=1,o|=l,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[o]),a=0,o=0)}h=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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):0>
14i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),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):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},66151:function(t,e,r){"use strict";let n=r(2507),i=r(44020),s=r(80500),o=t=>null==t;function a(t){if("string"!=typeof t||1!==t.length)throw TypeError("arrayFormatSeparator must be single character string")}function h(t,e){return e.encode?e.strict?n(t):encodeURIComponent(t):t}function u(t,e){return e.decode?i(t):t}function c(t){let e=t.indexOf("#");return -1!==e&&(t=t.slice(0,e)),t}function l(t){t=c(t);let e=t.indexOf("?");return -1===e?"":t.slice(e+1)}function d(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function f(t,e){a((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{if(e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),!e){n[t]=r;return}void 0===n[t]&&(n[t]={}),n[t][e[1]]=r};case"bracket":return(t,r,n)=>{if(e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),!e){n[t]=r;return}if(void 0===n[t]){n[t]=[r];return}n[t]=[].concat(n[t],r)};case"comma":case"separator":return(e,r,n)=>{let i="string"==typeof r&&r.split("").indexOf(t.arrayFormatSeparator)>-1,s=i?r.split(t.arrayFormatSeparator).map(e=>u(e,t)):null===r?r:u(r,t);n[e]=s};default:return(t,e,r)=>{if(void 0===r[t]){r[t]=e;return}r[t]=[].concat(r[t],e)}}}(e),n=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return n;for(let i of t.split("&")){let[o,h]=s(e.decode?i.replace(/\+/g," "):i,"=");h=void 0===h?null:["comma","separator"].includes(e.arrayFormat)?h:u(h,e),r(u(o,e),h,n)}for(let c of Object.keys(n)){let l=n[c];if("object"==typeof l&&null!==l)for(let f of Object.keys(l))l[f]=d(l[f],e);else n[c]=d(l,e)}return!1===e.sort?n:(!0===e.sort?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((t,e)=>{let r=n[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(r):t[e]=r,t},Object.create(null))}e.extract=l,e.parse=f,e.stringify=(t,e)=>{if(!t)return"";a((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let r=r=>e.skipNull&&o(t[r])||e.skipEmptyString&&""===t[r],n=function(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{let i=r.length;return void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[h(e,t),"[",i,"]"].join("")]:[...r,[h(e,t),"[",h(i,t),"]=",h(n,t)].join("")]};case"bracket":return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[h(e,t),"[]"].join("")]:[...r,[h(e,t),"[]=",h(n,t)].join("")];case"comma":case"separator":return e=>(r,n)=>null==n||0===n.length?r:0===r.length?[[h(e,t),"=",h(n,t)].join("")]:[[r,h(n,t)].join(t.arrayFormatSeparator)];default:return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,h(e,t)]:[...r,[h(e,t),"=",h(n,t)].join("")]}}(e),i={};for(let s of Object.keys(t))r(s)||(i[s]=t[s]);let u=Object.keys(i);return!1!==e.sort&&u.sort(e.sort),u.map(r=>{let i=t[r];return void 0===i?"":null===i?h(r,e):Array.isArray(i)?i.reduce(n(r),[]).join("&"):h(r,e)+"="+h(i,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[r,n]=s(t,"#");return Object.assign({url:r.split("?")[0]||"",query:f(l(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0},r);let n=c(t.url).split("?")[0]||"",i=e.extract(t.url),s=e.parse(i,{sort:!1}),o=Object.assign(s,t.query),a=e.stringify(o,r);a&&(a=`?${a}`);let u=function(t){let e="",r=t.indexOf("#");return -1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(u=`#${h(t.fragmentIdentifier,r)}`),`${n}${a}${u}`}},2507:function(t){"use strict";
14t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)},62873:function(t,e){"use strict";function r(t){let e;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function n(t){let e=r(t);if(!e)throw Error(`${t} is not defined in Window`);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=n,e.getDocumentOrThrow=function(){return n("document")},e.getDocument=function(){return r("document")},e.getNavigatorOrThrow=function(){return n("navigator")},e.getNavigator=function(){return r("navigator")},e.getLocationOrThrow=function(){return n("location")},e.getLocation=function(){return r("location")},e.getCryptoOrThrow=function(){return n("crypto")},e.getCrypto=function(){return r("crypto")},e.getLocalStorageOrThrow=function(){return n("localStorage")},e.getLocalStorage=function(){return r("localStorage")}},65755:function(t,e,r){"use strict";e.D=void 0;let n=r(62873);e.D=function(){let t,e,r;try{t=n.getDocumentOrThrow(),e=n.getLocationOrThrow()}catch(i){return null}function s(...e){let r=t.getElementsByTagName("meta");for(let n=0;n<r.length;n++){let i=r[n],s=["itemprop","property","name"].map(t=>i.getAttribute(t)).filter(t=>!!t&&e.includes(t));if(s.length&&s){let o=i.getAttribute("content");if(o)return o}}return""}let o=((r=s("name","og:site_name","og:title","twitter:title"))||(r=t.title),r),a=function(){let t=s("description","og:description","twitter:description","keywords");return t}(),h=e.origin,u=function(){let r=t.getElementsByTagName("link"),n=[];for(let i=0;i<r.length;i++){let s=r[i],o=s.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-1){let a=s.getAttribute("href");if(a){if(-1===a.toLowerCase().indexOf("https:")&&-1===a.toLowerCase().indexOf("http:")&&0!==a.indexOf("//")){let h=e.protocol+"//"+e.host;if(0===a.indexOf("/"))h+=a;else{let u=e.pathname.split("/");u.pop();let c=u.join("/");h+=c+"/"+a}n.push(h)}else if(0===a.indexOf("//")){let l=e.protocol+a;n.push(l)}else n.push(a)}}}return n}();return{description:a,url:h,icons:u,name:o}}},35796:function(t,e,r){"use strict";r.d(e,{d:function(){return f}});var n=r(15861),i=r(15671),s=r(43144),o=r(73237),a=r(60136),h=r(82963),u=r(61120),c=r(64687),l=r.n(c),d=r(45624),f=function(t){(0,a.Z)(g,t);var e,r,c,f,p,m=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,r=(0,u.Z)(g);if(e){var n=(0,u.Z)(this).constructor;t=Reflect.construct(r,arguments,n)}else t=r.apply(this,arguments);return(0,h.Z)(this,t)});function g(){return(0,i.Z)(this,g),m.apply(this,arguments)}return(0,s.Z)(g,[{key:"init",value:(r=(0,n.Z)(l().mark(function t(e){return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:this.chainConfig||(this.chainConfig=(0,d.h2)(d.EN.EIP155,1));case 1:case"end":return t.stop()}},t,this)})),function(t){return r.apply(this,arguments)})},{key:"authenticateUser",value:(c=(0,n.Z)(l().mark(function t(){var e,r,n,i,s,o,a,h,u;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(!this.provider||this.status!==d.MP.CONNECTED)){t.next=2;break}throw d.RM.notConnectedError();case 2:return r=(e=this.chainConfig).chainNamespace,n=e.chainId,t.next=5,this.provider.request({method:"eth_accounts"});case 5:if(!((i=t.sent)&&i.length>0)){t.next=24;break}if(!(s=(0,d.Cb)(i[0],this.name))||(0,d.$E)(s)){t.next=12;break}return t.abrupt("return",{idToken:s});case 12:return o={domain:window.location.origin,uri:window.location.href,address:i[0],chainId:parseInt(n,16),version:"1",nonce:Math.random().toString(36).slice(2),issuedAt:new Date().toISOString()},t.next=15,(0,d.tV)(o,r);case 15:return a=t.sent,t.next=18,this.provider.request({method:"personal_sign",params:[a,i[0]]});case 18:return h=t.sent,t.next=21,(0,d.rn)(r,h,a,this.name,this.sessionTime,this.clientId,this.web3AuthNetwork);case 21:return u=t.sent,(0,d.Fr)(i[0],this.name,u),t.abrupt("return",{idToken:u});case 24:throw d.RM.notConnectedError("Not connected with wallet, Please login/connect first");case 25:case"end":return t.stop()}},t,this)})),function(){return c.apply(this,arguments)})},{key:"disconnectSession",value:(f=(0,n.Z)(l().mark(function t(){var e;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return(0,o.Z)((0,u.Z)(g.prototype),"checkDisconnectionRequirements",this).call(this),t.next=3,this.provider.request({method:"eth_accounts"});case 3:(e=t.sent)&&e.length>0&&(0,d.qz)(e[0],this.name);case 5:case"end":return t.stop()}},t,this)})),function(){return f.apply(this,arguments)})},{key:"disconnect",value:(p=(0,n.Z)(l().mark(function t(){return l().wrap(function(t){for(;;
14)switch(t.prev=t.next){case 0:this.rehydrated=!1,this.emit(d.n2.DISCONNECTED);case 2:case"end":return t.stop()}},t,this)})),function(){return p.apply(this,arguments)})}]),g}(d.J5)},51347:function(t,e,r){"use strict";r.r(e),r.d(e,{WalletConnectV1Adapter:function(){return tU}});var n={};r.r(n),r.d(n,{decrypt:function(){return tP},encrypt:function(){return tq},generateKey:function(){return tN},verifyHmac:function(){return tA}});var i=r(15861),s=r(15671),o=r(43144),a=r(97326),h=r(73237),u=r(60136),c=r(82963),l=r(61120),d=r(4942),f=r(64687),p=r.n(f),m=r(65755),g=r(62873),v=r(34155),y=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n},w=function(t,e,r){this.name=t,this.version=e,this.os=r,this.type="browser"},M=function(t){this.version=t,this.type="node",this.name="node",this.os=v.platform},_=function(t,e,r,n){this.name=t,this.version=e,this.os=r,this.bot=n,this.type="bot-device"},b=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},k=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},S=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,O=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],I=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function x(t){var e=""!==t&&O.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1);if(!e)return null;var r=e[0],n=e[1];if("searchbot"===r)return new b;var i=n[1]&&n[1].split(/[._]/).slice(0,3);i?i.length<3&&(i=y(i,function(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}(3-i.length))):i=[];var s=i.join("."),o=function(t){for(var e=0,r=I.length;e<r;e++){var n=I[e],i=n[0];if(n[1].exec(t))return i}return null}(t),a=S.exec(t);return a&&a[1]?new _(r,s,o,a[1]):new w(r,s,o)}function R(t){return t?x(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new k:"undefined"!=typeof navigator?x(navigator.userAgent):void 0!==v&&v.ver
14sion?new M(v.version.slice(1)):null}function E(){let t=R();return t&&t.os?t.os:void 0}g.getFromWindow,g.getFromWindowOrThrow,g.getDocumentOrThrow,g.getDocument,g.getNavigatorOrThrow;let C=g.getNavigator;g.getLocationOrThrow;let T=g.getLocation;g.getCryptoOrThrow,g.getCrypto,g.getLocalStorageOrThrow;let N=g.getLocalStorage,A=function(t){if("string"!=typeof t)throw Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch(e){return t}};function q(t){let e=null,r=N();return r&&(e=r.getItem(t)),e?A(e):e}function P(t){let e=N();e&&e.removeItem(t)}let j="WALLETCONNECT_DEEPLINK_CHOICE",Z=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],W=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];var L=r(11460),B=r.n(L);r(4501);var D=r(65054),U=r.n(D),F=r(48764).Buffer;let $="utf8";function J(t){return new Uint8Array(t)}function K(t,e=!1){let r=t.toString("hex");return e?G(r):r}function z(t,e=!1){return K(U()(t),e)}function V(t){return J(F.from(Q(t),"hex"))}function Y(t){return F.from(t,$)}function H(...t){let e=[];return t.forEach(t=>e=e.concat(Array.from(t))),new Uint8Array([...e])}function Q(t){return t.replace(/^0x/,"")}function G(t){return t.startsWith("0x")?t:`0x${t}`}function X(t){return(t=function(t,e=8,r="0"){return function(t,e,r="0"){return function(t,e,r,n="0"){let i=e-t.length,s=t;if(i>0){let o=n.repeat(i);s=r?o+t:t+o}return s}(t,e,!0,r)}(t,function(t,e=8){let r=t%e;return r?(t-r)/e*e+e:t}(t.length,e),r)}(t=Q(t),2))&&(t=G(t)),t}function tt(t){var e;return e=new Uint8Array(t),U()(e)}function te(t,e){let r=Q(X(new(B())(t).toString(16)));return e?r:G(r)}var tr=r(91094),tn=r(1468);let ti=function(){let t=1e3*Date.now();return t+Math.floor(1e3*Math.random())};function ts(){let t=((t,e)=>{for(e=t="";t++<36;e+=51*t&52?(15^t?8^Math.random()*(20^t?16:4):4).toString(16):"-");return e})();return t}function to(t,e){return"string"==typeof t&&!!t.match(/^0x[0-9A-Fa-f]*$/)&&(!e||t.length===2+2*e)}function ta(t){return void 0!==t.result}function th(t){return void 0!==t.error}function tu(t){return void 0!==t.event}let tc=t=>!!t&&"0x"===t.toLowerCase().substring(0,2)&&!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!!(/^(0x)?[0-9a-f]{40}$/.test(t)||/^(0x)?[0-9A-F]{40}$/.test(t))||t===function(t){t=Q(t.toLowerCase());let e=Q((0,tr.keccak_256)(Y(t))),r="";for(let n=0;n<t.length;n++)parseInt(e[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return G(r)}(t));function tl(t){return t&&t.length&&!to(t[0])&&(t[0]=function(t,e=!1){return K(Y(t),e)}(t[0],!0)),t}function td(t){if(void 0!==t.type&&"0"!==t.type)return t;if(void 0===t.from||!tc(t.from))throw Error("Transaction object must include a valid 'from' value.");function e(t){let e=t;return"number"!=typeof t&&("string"!=typeof t||""===t||"string"==typeof t&&""===t.trim())||(to(t)?"string"==typeof t&&(e=X(t)):e=te(t)),"string"==typeof e&&(e=function(t){let e=t.startsWith("0x");return t=(t=Q(t)).startsWith("0")?t.substring(1):t,e?G(t):t}(G(e))),e}let r={from:X(t.from),to:void 0===t.to?void 0:X(t.to),gasPrice:void 0===t.gasPrice?"":e(t.gasPrice),gas:void 0===t.gas?void 0===t.gasLimit?"":e(t.gasLimit):e(t.gas),value:void 0===t.value?"":e(t.value),nonce:void 0===t.nonce?"":e(t.nonce),data:void 0===t.data?"":X(t.data)||"0x"},n=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach(t=>{(void 0===r[t]||"string"==typeof r[t]&&!r[t].trim().length)&&n.includes(t)&&delete r[t]}),r}var tf=r(66151),tp=class{constructor(){this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(t,e){this._eventEmitters.push({event:t,callback:e})}trigger(t){let e=[];t&&(e=this._eventEmitters.filter(e=>e.event===t)),e.forEach(t=>{t.callback()})}};let tm=void 0!==r.g.WebSocket?r.g.WebSocket:r(68007);var tg=class{constructor(t){if(this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new tp,!t.url||"string"!=typeof t.url)throw Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(t){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(t){}get connecting(){return 0===this.readyState}set connected(t){}get connected(){return 1===this.readyState}set closing(t){}get closing(){return 2===this.readyState}set closed(t){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(t,e,r){if(!e||"string"!=typeof e)throw Error("Missing or invalid topic field");this._socketSend({topic:e,type:"pub",payload:t,silent:!!r})}subscribe(t){this._socketSend({topic:t,type:"sub",payload:"",silent:!0})}on(t,e){this._events.push({event:t,callback:e})}_socketCreate(){if(this._nextSocket)return;let t=function(t,e,r){var n,i,s,o,a;let h;let u=t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t,c=u.split("?"),l=!function(){let t=!function(){let t=R(),e=!!t&&!!t.name&&"node"===t.name.toLowerCase();return e}()&&!!C();return t}()?{protocol:e,version:r,env:(null===(i=R())||void 0===i?void 0:i.name)||""}:{protocol:e,version:r,env:"browser",host:(null===(n=T())||void 0===n?void 0:n.host)||""},d=(a=Object.assign(Object.assign({},(o=function(t){let e=-1!==t.indexOf("?")?t.indexOf("?"):void 0,r=void 0!==e?t.substr(e):"";return r}(c[1]||""),tf.parse(o))),l),tf.stringify(a));return c[0]+"?"+d}(this._url,this._protocol,this._version);if(this._nextSocket=new tm(t),!this._nextSocket)throw Error("Failed to create socket");this._nextSocket.onmessage=t=>this._socketReceive(t),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=t=>this._socketError(t),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(t){let e=JSON.stringify(t);this._socket&&1===this._socket.readyState?this._socket.send(e):(this._setToQueue(t),this._socketCreate())}async _socketReceive(t){let e;try{e=JSON.parse(t.data)}catch(r){return}if(this._socketSend({topic:e.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState){let n=this._events.filter(t=>"message"===t.event);
14n&&n.length&&n.forEach(t=>t.callback(e))}}_socketError(t){let e=this._events.filter(t=>"error"===t.event);e&&e.length&&e.forEach(e=>e.callback(t))}_queueSubscriptions(){let t=this._subscriptions;t.forEach(t=>this._queue.push({topic:t,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(t){this._queue.push(t)}_pushQueue(){let t=this._queue;t.forEach(t=>this._socketSend(t)),this._queue=[]}};let tv="Session currently connected",ty="Session currently disconnected",tw="JSON RPC response format is invalid",tM="User close QRCode Modal";var t_=class{constructor(){this._eventEmitters=[]}subscribe(t){this._eventEmitters.push(t)}unsubscribe(t){this._eventEmitters=this._eventEmitters.filter(e=>e.event!==t)}trigger(t){let e,r=[];(e=void 0!==t.method?t.method:ta(t)||th(t)?`response:${t.id}`:tu(t)?t.event:"")&&(r=this._eventEmitters.filter(t=>t.event===e)),r&&r.length||Z.includes(e)||e.startsWith("wc_")||tu(e)||(r=this._eventEmitters.filter(t=>"call_request"===t.event)),r.forEach(e=>{if(th(t)){let r=Error(t.error.message);e.callback(r,null)}else e.callback(null,t)})}},tb=class{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null,e=q(this.storageId);return e&&void 0!==e.bridge&&(t=e),t}setSession(t){return!function(t,e){let r="string"==typeof e?e:JSON.stringify(e),n=N();n&&n.setItem(t,r)}(this.storageId,t),t}removeSession(){P(this.storageId)}};let tk="abcdefghijklmnopqrstuvwxyz0123456789".split("").map(t=>`https://${t}.bridge.walletconnect.org`);var tS=class{constructor(t){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new t_,this._clientMeta=m.D()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new tb(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...W,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw Error("Missing one of the required parameters: bridge / uri / session");if(t.connectorOpts.bridge){var e,r;this.bridge="walletconnect.org"!==(0,(0,((r=e=t.connectorOpts.bridge).indexOf("//")>-1?r.split("/")[2]:r.split("/")[0]).split(":")[0]).split("?")[0]).split(".").slice(-2).join(".")?e:tk[Math.floor(Math.random()*tk.length)]}t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);let n=t.connectorOpts.session||this._getStorageSession();n&&(this.session=n),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new tg({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}set bridge(t){t&&(this._bridge=t)}get bridge(){return this._bridge}set key(t){if(!t)return;let e=V(t).buffer;this._key=e}get key(){if(this._key){var t;let e=(t=this._key,z(new Uint8Array(t),!1));return e}return""}set clientId(t){t&&(this._clientId=t)}get clientId(){let t=this._clientId;return t||(t=this._clientId=ts()),this._clientId}set peerId(t){t&&(this._peerId=t)}get peerId(){return this._peerId}set clientMeta(t){}get clientMeta(){let t=this._clientMeta;return t||(t=this._clientMeta=m.D()),t}set peerMeta(t){this._peerMeta=t}get peerMeta(){let t=this._peerMeta;return t}set handshakeTopic(t){t&&(this._handshakeTopic=t)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(t){t&&(this._handshakeId=t)}get handshakeId(){return this._handshakeId}get uri(){let t=this._formatUri();return t}set uri(t){if(!t)return;let{handshakeTopic:e,bridge:r,key:n}=this._parseUri(t);this.handshakeTopic=e,this.bridge=r,this.key=n}set chainId(t){this._chainId=t}get chainId(){let t=this._chainId;return t}set networkId(t){this._networkId=t}get networkId(){let t=this._networkId;return t}set accounts(t){this._accounts=t}get accounts(){let t=this._accounts;return t}set rpcUrl(t){this._rpcUrl=t}get rpcUrl(){let t=this._rpcUrl;return t}set connected(t){}get connected(){return this._connected}set pending(t){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(t){t&&(this._connected=t.connected,this.accounts=t.accounts,this.chainId=t.chainId,this.bridge=t.bridge,this.key=t.key,this.clientId=t.clientId,this.clientMeta=t.clientMeta,this.peerId=t.peerId,this.peerMeta=t.peerMeta,this.handshakeId=t.handshakeId,this.handshakeTopic=t.handshakeTopic)}on(t,e){this._eventManager.subscribe({event:t,callback:e})}off(t){this._eventManager.unsubscribe(t)}async createInstantRequest(t){this._key=await this._generateKey();let e=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]});this.handshakeId=e.id,this.handshakeTopic=ts(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw Error(tM)});let r=()=>{this.killSession()};try{let n=await this._sendCallRequest(e);return n&&r(),n}catch(i){throw r(),i}}async connect(t){if(!this._qrcodeModal)throw Error("QRCode Modal not provided");return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(t),new Promise(async(t,e)=>{this.on("modal_closed",()=>e(Error(tM))),this.on("connect",(r,n)=>{if(r)return e(r);t(n.params[0])})}))}async createSession(t){if(this._connected)throw Error(tv);if(this.pending)return;this._key=await this._generateKey();let e=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]});this.handshakeId=e.id,this.handshakeTopic=ts(),this._sendSessionRequest(e,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(t){if(this._connected)throw Error(tv);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";let e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:e};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(t){if(this._connected)throw Error(tv);let e=t&&t.message?t.message:"Session Rejected",r=this._formatResponse({id:this.handshakeId,error:{message:e}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession()}updateSession(t){if(!this._connected)throw Error(ty);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";let e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[e]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(t){let e=t?t.message:"Session Disconnected",r=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});await this._sendRequest(r),this._handleSessionDisconnect(e)}async sendTransaction(t){if(!this._connected)throw Error(ty);let e=td(t),r=this._formatRequest({method:"eth_sendTransaction",params:[e]}),n=await this._sendCallRequest(r);return n}async signTransaction(t){if(!this._connected)throw Error(ty);let e=td(t),r=this._formatRequest({method:"eth_signTransaction",params:[e]}),n=await this._sendCallRequest(r);return n}async signMessage(t){if(!this._connected)throw Error(ty);let e=this._formatRequest({method:"eth_sign",params:t}),r=await this._sendCallRequest(e);return r}async signPersonalMessage(t){if(!this._connected)throw Error(ty);t=tl(t);let e=this._formatRequest({method:"personal_sign",params:t}),r=await this._sendCallRequest(e);return r}async signTypedData(t){if(!this._connected)throw Error(ty);let e=this._formatRequest({method:"eth_signTypedData",params:t}),r=await this._sendCallRequest(e);return r}async updateChain(t){if(!this._connected)throw Error("Session currently disconnected");let e=this._formatRequest({method:"wallet_updateChain",params:[t]}),r=await this._sendCallRequest(e);return r}unsafeSend(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,o
14ptions:e}]}),new Promise((e,r)=>{this._subscribeToResponse(t.id,(t,n)=>{if(t){r(t);return}if(!n)throw Error("Missing JSON RPC response");e(n)})})}async sendCustomRequest(t,e){if(!this._connected)throw Error(ty);switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return te(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=td(t.params[0]));break;case"personal_sign":t.params&&(t.params=tl(t.params))}let r=this._formatRequest(t),n=await this._sendCallRequest(r,e);return n}approveRequest(t){if(ta(t)){let e=this._formatResponse(t);this._sendResponse(e)}else throw Error('JSON-RPC success response must include "result" field')}rejectRequest(t){if(th(t)){let e=this._formatResponse(t);this._sendResponse(e)}else throw Error('JSON-RPC error response must include "error" field')}transportClose(){this._transport.close()}async _sendRequest(t,e){let r=this._formatRequest(t),n=await this._encrypt(r),i=void 0!==(null==e?void 0:e.topic)?e.topic:this.peerId,s=JSON.stringify(n),o=void 0!==(null==e?void 0:e.forcePushNotification)?!e.forcePushNotification:!!r.method.startsWith("wc_")||!W.includes(r.method);this._transport.send(s,i,o)}async _sendResponse(t){let e=await this._encrypt(t),r=this.peerId,n=JSON.stringify(e);this._transport.send(n,r,!0)}async _sendSessionRequest(t,e,r){this._sendRequest(t,r),this._subscribeToSessionResponse(t.id,e)}_sendCallRequest(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),this._subscribeToCallResponse(t.id)}_formatRequest(t){if(void 0===t.method)throw Error('JSON RPC request must have valid "method" value');let e={id:void 0===t.id?ti():t.id,jsonrpc:"2.0",method:t.method,params:void 0===t.params?[]:t.params};return e}_formatResponse(t){if(void 0===t.id)throw Error('JSON RPC request must have valid "id" value');let e={id:t.id,jsonrpc:"2.0"};if(th(t)){let r=function(t){let e=t.message||"Failed or Rejected Request",r=-32e3;if(t&&!t.code)switch(e){case"Parse error":r=-32700;break;case"Invalid request":r=-32600;break;case"Method not found":r=-32601;break;case"Invalid params":r=-32602;break;case"Internal error":r=-32603;break;default:r=-32e3}let n={code:r,message:e};return t.data&&(n.data=t.data),n}(t.error),n=Object.assign(Object.assign(Object.assign({},e),t),{error:r});return n}if(ta(t)){let i=Object.assign(Object.assign({},e),t);return i}throw Error(tw)}_handleSessionDisconnect(t){this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),P(j)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:t||"Session Disconnected"}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(t,e){e&&e.approved?(this._connected?(e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),e.peerId&&!this.peerId&&(this.peerId=e.peerId),e.peerMeta&&!this.peerMeta&&(this.peerMeta=e.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(t)}async _handleIncomingMessages(t){let e;let r=[this.clientId,this.handshakeTopic];if(!r.includes(t.topic))return;try{e=JSON.parse(t.payload)}catch(n){return}let i=await this._decrypt(e);i&&this._eventManager.trigger(i)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(t,e){this.on(`response:${t}`,e)}_subscribeToSessionResponse(t,e){this._subscribeToResponse(t,(t,r)=>{if(t){this._handleSessionResponse(t.message);return}ta(r)?this._handleSessionResponse(e,r.result):r.error&&r.error.message?this._handleSessionResponse(r.error.message):this._handleSessionResponse(e)})}_subscribeToCallResponse(t){return new Promise((e,r)=>{this._subscribeToResponse(t,(t,n)=>{if(t){r(t);return}ta(n)?e(n.result):n.error&&n.error.message?r(n.error):r(Error(tw))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(t,e)=>{let{request:r}=e.params[0];if(function(){let t=E();return!!t&&(function(){let t=E();return!!t&&t.toLowerCase().includes("android")}()||function(){let t=E();return!!t&&(t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}())}()&&this._signingMethods.includes(r.method)){let n=q(j);n&&(window.location.href=n.href)}}),this.on("wc_sessionRequest",(t,e)=>{t&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),this.handshakeId=e.id,this.peerId=e.params[0].peerId,this.peerMeta=e.params[0].peerMeta;let r=Object.assign(Object.assign({},e),{method:"session_request"});this._eventManager.trigger(r)}),this.on("wc_sessionUpdate",(t,e)=>{t&&this._handleSessionResponse(t.message),this._handleSessionResponse("Session disconnected",e.params[0])})}_initTransport(){this._transport.on("message",t=>this._handleIncomingMessages(t)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){let t=this.protocol,e=this.handshakeTopic,r=this.version,n=encodeURIComponent(this.bridge),i=this.key,s=`${t}:${e}@${r}?bridge=${n}&key=${i}`;return s}_parseUri(t){let e=function(t){let e=t.indexOf(":"),r=-1!==t.indexOf("?")?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r),s=function(t){let e=t.split("@"),r={handshakeTopic:e[0],version:parseInt(e[1],10)};return r}(i),o=void 0!==r?t.substr(r):"",a=function(t){let e=tf.parse(t),r={key:e.key||"",bridge:e.bridge||""};return r}(o),h=Object.assign(Object.assign({protocol:n},s),a);return h}(t);if(e.protocol===this.protocol){if(!e.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");let r=e.handshakeTopic;if(!e.bridge)throw Error("Invalid or missing bridge url parameter value");let n=decodeURIComponent(e.bridge);
14if(!e.key)throw Error("Invalid or missing key parameter value");let i=e.key;return{handshakeTopic:r,bridge:n,key:i}}throw Error("URI format is invalid")}async _generateKey(){if(this._cryptoLib){let t=await this._cryptoLib.generateKey();return t}return null}async _encrypt(t){let e=this._key;if(this._cryptoLib&&e){let r=await this._cryptoLib.encrypt(t,e);return r}return null}async _decrypt(t){let e=this._key;if(this._cryptoLib&&e){let r=await this._cryptoLib.decrypt(t,e);return r}return null}_getStorageSession(){let t=null;return this._sessionStorage&&(t=this._sessionStorage.getSession()),t}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(t){if(!t.url||"string"!=typeof t.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!t.type||"string"!=typeof t.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!t.token||"string"!=typeof t.token)throw Error("Invalid or missing pushServerOpts.token parameter value");let e={bridge:this.bridge,topic:this.clientId,type:t.type,token:t.token,peerName:"",language:t.language||""};this.on("connect",async(r,n)=>{if(r)throw r;if(t.peerMeta){let i=n.params[0].peerMeta.name;e.peerName=i}try{let s=await fetch(`${t.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}),o=await s.json();if(!o.success)throw Error("Failed to register in Push Server")}catch(a){throw Error("Failed to register in Push Server")}})}};let tO="AES-CBC",tI="HMAC";async function tx(t,e=tO){return tn.getSubtleCrypto().importKey("raw",t,e===tO?{length:256,name:tO}:{hash:{name:"SHA-256"},name:tI},!0,e===tO?["encrypt","decrypt"]:["sign","verify"])}async function tR(t,e,r){let n=tn.getSubtleCrypto(),i=await tx(e,tO),s=await n.encrypt({iv:t,name:tO},i,r);return new Uint8Array(s)}async function tE(t,e,r){let n=tn.getSubtleCrypto(),i=await tx(e,tO),s=await n.decrypt({iv:t,name:tO},i,r);return new Uint8Array(s)}async function tC(t,e){let r=tn.getSubtleCrypto(),n=await tx(t,tI),i=await r.sign({length:256,name:tI},n,e);return new Uint8Array(i)}async function tT(t,e){let r=await tC(t,e);return r}async function tN(t){let e=function(t){let e=tn.getBrowerCrypto();return e.getRandomValues(new Uint8Array(t))}((t||256)/8),r=J(U()(e)).buffer;return r}async function tA(t,e){let r=V(t.data),n=V(t.iv),i=V(t.hmac),s=z(i,!1),o=H(r,n),a=await tT(e,o),h=z(a,!1);return Q(s)===Q(h)}async function tq(t,e,r){let n=J(tt(e)),i=r||await tN(128),s=J(tt(i)),o=z(s,!1),a=JSON.stringify(t),h=J(Y(a)),u=await tR(s,n,h),c=z(u,!1),l=H(u,s),d=await tT(n,l),f=z(d,!1);return{data:c,hmac:f,iv:o}}async function tP(t,e){var r;let n;let i=J(tt(e));if(!i)throw Error("Missing key: required for decryption");let s=await tA(t,i);if(!s)return null;let o=V(t.data),a=V(t.iv),h=await tE(a,i,o),u=(r=h,U()(r).toString($));try{n=JSON.parse(u)}catch(c){return null}return n}var tj=class extends tS{constructor(t,e){super({cryptoLib:n,connectorOpts:t,pushServerOpts:e})}},tZ=r(45624),tW=r(35796),tL=r(52062),tB=[{name:"Rainbow",chains:[tZ.EN.EIP155],logo:"https://images.web3auth.io/login-rainbow.svg",mobile:{native:"rainbow:",universal:"https://rnbwapp.com"},desktop:{native:"",universal:""}},{name:"MetaMask",chains:[tZ.EN.EIP155],logo:"https://images.web3auth.io/login-metamask.svg",mobile:{native:"metamask:",universal:"https://metamask.app.link"},desktop:{native:"",universal:""}}];function tD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}var tU=function(t){(0,u.Z)(_,t);var e,r,n,f,m,g,v,y,w,M=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(_);if(e){var n=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,n)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function _(t){var e;return(0,s.Z)(this,_),e=M.call(this,t),(0,d.Z)((0,a.Z)(e),"name",tZ.rW.WALLET_CONNECT_V1),(0,d.Z)((0,a.Z)(e),"adapterNamespace",tZ.yk.EIP155),(0,d.Z)((0,a.Z)(e),"currentChainNamespace",tZ.EN.EIP155),(0,d.Z)((0,a.Z)(e),"type",tZ.hN.EXTERNAL),(0,d.Z)((0,a.Z)(e),"adapterOptions",void 0),(0,d.Z)((0,a.Z)(e),"status",tZ.MP.NOT_READY),(0,d.Z)((0,a.Z)(e),"adapterData",{uri:"",extensionAdapters:tB}),(0,d.Z)((0,a.Z)(e),"connector",null),(0,d.Z)((0,a.Z)(e),"wcProvider",null),e.adapterOptions=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
14e%2?tD(Object(r),!0).forEach(function(e){(0,d.Z)(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tD(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},t),e}return(0,o.Z)(_,[{key:"connected",get:function(){var t;return!!(null!==(t=this.connector)&&void 0!==t&&t.connected)}},{key:"provider",get:function(){var t;return(null===(t=this.wcProvider)||void 0===t?void 0:t.provider)||null},set:function(t){throw Error("Not implemented")}},{key:"init",value:(r=(0,i.Z)(p().mark(function t(){return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,h.Z)((0,l.Z)(_.prototype),"init",this).call(this);case 2:if((0,h.Z)((0,l.Z)(_.prototype),"checkInitializationRequirements",this).call(this),this.connector=this.getWalletConnectInstance(),this.wcProvider=new tL.WalletConnectProvider({config:{chainConfig:this.chainConfig},connector:this.connector}),this.emit(tZ.n2.READY,tZ.rW.WALLET_CONNECT_V1),this.status=tZ.MP.READY,tZ.cM.debug("initializing wallet connect v1 adapter"),!this.connector.connected){t.next=12;break}return this.rehydrated=!0,t.next=12,this.onConnectHandler({accounts:this.connector.accounts,chainId:this.connector.chainId});case 12:case"end":return t.stop()}},t,this)})),function(){return r.apply(this,arguments)})},{key:"connect",value:(n=(0,i.Z)(p().mark(function t(){var e,r,n=this;return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((0,h.Z)((0,l.Z)(_.prototype),"checkConnectionRequirements",this).call(this),this.connector){t.next=3;break}throw tZ.Ty.notReady("Wallet adapter is not ready yet");case 3:if(!this.connected){t.next=7;break}return t.next=6,this.onConnectHandler({accounts:this.connector.accounts,chainId:this.connector.chainId});case 6:return t.abrupt("return",this.provider);case 7:if(!(this.status!==tZ.MP.CONNECTING)){t.next=13;break}return null!==(e=this.adapterOptions.adapterSettings)&&void 0!==e&&e.qrcodeModal&&(this.connector=this.getWalletConnectInstance(),this.wcProvider=new tL.WalletConnectProvider({config:{chainConfig:this.chainConfig,skipLookupNetwork:null===(r=this.adapterOptions.adapterSettings)||void 0===r?void 0:r.skipNetworkSwitching},connector:this.connector})),t.next=11,this.createNewSession();case 11:this.status=tZ.MP.CONNECTING,this.emit(tZ.n2.CONNECTING,{adapter:tZ.rW.WALLET_CONNECT_V1});case 13:return t.abrupt("return",new Promise(function(t,e){if(!n.connector){e(tZ.Ty.notReady("Wallet adapter is not ready yet"));return}n.connector.on("modal_closed",(0,i.Z)(p().mark(function t(){return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n.status=tZ.MP.READY,n.emit(tZ.n2.READY,tZ.rW.WALLET_CONNECT_V1),t.abrupt("return",e(Error("User closed modal")));case 3:case"end":return t.stop()}},t)})));try{n.connector.on("connect",function(){var e=(0,i.Z)(p().mark(function e(r,i){return p().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r&&n.emit(tZ.n2.ERRORED,r),tZ.cM.debug("connected event emitted by web3auth"),e.next=4,n.onConnectHandler(i.params[0]);case 4:return e.abrupt("return",t(n.provider));case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}())}catch(r){tZ.cM.error("Wallet connect v1 adapter error while connecting",r),n.status=tZ.MP.READY,n.rehydrated=!0,n.emit(tZ.n2.ERRORED,r),e(r instanceof tZ.up?r:tZ.RM.connectionError("Failed to login with wallet connect: ".concat((null==r?void 0:r.message)||"")))}}));case 14:case"end":return t.stop()}},t,this)})),function(){return n.apply(this,arguments)})},{key:"getUserInfo",value:(f=(0,i.Z)(p().mark(function t(){return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.connected){t.next=2;break}throw tZ.RM.notConnectedError("Not connected with wallet, Please login/connect first");case 2:return t.abrupt("return",{});case 3:case"end":return t.stop()}},t,this)})),function(){return f.apply(this,arguments)})},{key:"disconnect",value:(m=(0,i.Z)(p().mark(function t(){var e,r,n=arguments;return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{cleanup:!1},t.next=3,(0,h.Z)((0,l.Z)(_.prototype),"disconnectSession",this).call(this);case 3:if(r=e.cleanup,!(!this.connector||!this.connected)){t.next=6;break}throw tZ.RM.notConnectedError("Not connected with wallet");case 6:return t.next=8,this.connector.killSession();case 8:return this.rehydrated=!1,r?(this.connector=null,this.status=tZ.MP.NOT_READY,this.wcProvider=null):this.status=tZ.MP.READY,t.next=12,(0,h.Z)((0,l.Z)(_.prototype),"disconnect",this).call(this);case 12:case"end":return t.stop()}},t,this)})),function(){return m.apply(this,arguments)})},{key:"addChain",value:(g=(0,i.Z)(p().mark(function t(e){var r,n;return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,this.wcProvider){t.next=3;break}throw tZ.Ty.notReady("Wallet adapter is not ready yet");case 3:if(!(n=null===(r=this.adapterOptions.adapterSettings)||void 0===r?void 0:r.networkSwitchModal)){t.next=7;break}return t.next=7,n.addNetwork({chainConfig:e,appOrigin:window.location.hostname});case 7:return t.next=9,this.wcProvider.addChain(e);case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),tZ.cM.error(t.t0);case 14:case"end":return t.stop()}},t,this,[[0,11]])})),function(t){return g.apply(this,arguments)})},{key:"switchChain",value:(v=(0,i.Z)(p().mark(function t(e,r){var n,i;return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.wcProvider){t.next=2;break}throw tZ.Ty.notReady("Wallet adapter is not ready yet");case 2:if(!(i=null===(n=this.adapterOptions.adapterSettings)||void 0===n?void 0:n.networkSwitchModal)){t.next=6;break}return t.next=6,i.switchNetwork({currentChainConfig:r,newChainConfig:e,appOrigin:window.location.hostname});case 6:return t.next=8,this.wcProvider.switchChain({chainId:r.chainId,lookup:!1,addChain:!1});case 8:case"end":return t.stop()}},t,this)})),function(t,e){return v.apply(this,arguments)})},{key:"createNewSession",value:(y=(0,i.Z)(p().mark(function t(){var e,r,n,s,o=this,a=arguments;return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.length>0&&void 0!==a[0]?a[0]:{forceNewSession:!1},this.connector){t.next=3;break}throw tZ.Ty.notReady("Wallet adapter is not ready yet");
14case 3:if(!(n.forceNewSession&&this.connector.pending)){t.next=6;break}return t.next=6,this.connector.killSession();case 6:if(!(null!==(e=this.adapterOptions)&&void 0!==e&&null!==(r=e.adapterSettings)&&void 0!==r&&r.qrcodeModal)){t.next=10;break}return t.next=9,this.connector.createSession({chainId:parseInt((null===(s=this.chainConfig)||void 0===s?void 0:s.chainId)||"0x1",16)});case 9:return t.abrupt("return");case 10:return t.abrupt("return",new Promise(function(t,e){var r;if(!o.connector){e(tZ.Ty.notReady("Wallet adapter is not ready yet"));return}tZ.cM.debug("creating new session for web3auth wallet connect"),o.connector.on("display_uri",function(){var r=(0,i.Z)(p().mark(function r(n,i){var s,a;return p().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!n){r.next=3;break}return o.emit(tZ.n2.ERRORED,tZ.RM.connectionError("Failed to display wallet connect qr code")),r.abrupt("return",e(n));case 3:return a=i.params[0],o.updateAdapterData({uri:a,extensionAdapters:tB}),null===(s=o.connector)||void 0===s||s.off("display_uri"),r.abrupt("return",t());case 7:case"end":return r.stop()}},r)}));return function(t,e){return r.apply(this,arguments)}}()),o.connector.createSession({chainId:parseInt((null===(r=o.chainConfig)||void 0===r?void 0:r.chainId)||"0x1",16)}).catch(function(t){return tZ.cM.error("error while creating new wallet connect session",t),o.emit(tZ.n2.ERRORED,t),e(t)})}));case 11:case"end":return t.stop()}},t,this)})),function(){return y.apply(this,arguments)})},{key:"onConnectHandler",value:(w=(0,i.Z)(p().mark(function t(e){var r,n,i,s,o,a;return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(!this.connector||!this.wcProvider)){t.next=2;break}throw tZ.Ty.notReady("Wallet adapter is not ready yet");case 2:if(this.chainConfig){t.next=4;break}throw tZ.Ty.invalidParams("Chain config is not set");case 4:if(r=e.chainId,tZ.cM.debug("connected chainId in hex"),!(r!==parseInt(this.chainConfig.chainId,16))||(o=(0,tZ.h2)(tZ.EN.EIP155,r)||{chainId:"0x".concat(r.toString(16)),displayName:"Unknown Network"},!(!(a=null===(n=this.adapterOptions.adapterSettings)||void 0===n?void 0:n.qrcodeModal)||a&&!(null!==(i=this.adapterOptions)&&void 0!==i&&null!==(s=i.adapterSettings)&&void 0!==s&&s.skipNetworkSwitching)))){t.next=27;break}return t.prev=10,t.next=13,this.addChain(this.chainConfig);case 13:return t.next=15,this.switchChain(o,this.chainConfig);case 15:this.connector=this.getWalletConnectInstance(),t.next=27;break;case 18:return t.prev=18,t.t0=t.catch(10),tZ.cM.error("error while chain switching",t.t0),t.next=23,this.createNewSession({forceNewSession:!0});case 23:return this.emit(tZ.n2.ERRORED,tZ.Ty.fromCode(5e3,"Not connected to correct network. Expected: ".concat(this.chainConfig.displayName,", Current: ").concat((null==o?void 0:o.displayName)||r,", Please switch to correct network from wallet"))),this.status=tZ.MP.READY,this.rehydrated=!0,t.abrupt("return");case 27:return t.next=29,this.wcProvider.setupProvider(this.connector);case 29:this.subscribeEvents(this.connector),this.status=tZ.MP.CONNECTED,this.emit(tZ.n2.CONNECTED,{adapter:tZ.rW.WALLET_CONNECT_V1,reconnected:this.rehydrated});case 32:case"end":return t.stop()}},t,this,[[10,18]])})),function(t){return w.apply(this,arguments)})},{key:"subscribeEvents",value:function(t){var e,r=this;t.on("session_update",(e=(0,i.Z)(p().mark(function t(e){return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e&&r.emit(tZ.n2.ERRORED,e);case 1:case"end":return t.stop()}},t)})),function(t){return e.apply(this,arguments)}))}},{key:"getWalletConnectInstance",value:function(){var t=this.adapterOptions.adapterSettings||{};return t.bridge=t.bridge||"https://bridge.walletconnect.org",new tj(t)}}]),_}(tW.d)},4501:function(t){t.exports=n,n.strict=i,n.loose=s;var e=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function n(t){return i(t)||s(t)}function i(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function s(t){return r[e.call(t)]}},80500:function(t){"use strict";
14t.exports=(t,e)=>{if(!("string"==typeof t&&"string"==typeof e))throw TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let r=t.indexOf(e);return -1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},65054:function(t,e,r){var n=r(48764).Buffer,i=r(4501).strict;t.exports=function(t){if(!i(t))return n.from(t);var e=n.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(e=e.slice(t.byteOffset,t.byteOffset+t.byteLength)),e}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.